@medway-ui/native 1.9.1 → 1.10.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 (298) 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/metro.js +26 -73
  255. package/setup/tailwind.js +16 -8
  256. package/setup/tokens.native.css +51 -20
  257. package/src/components/Alert.tsx +37 -20
  258. package/src/components/AlertDialog.tsx +18 -19
  259. package/src/components/Badge.tsx +16 -15
  260. package/src/components/Button.tsx +64 -31
  261. package/src/components/CardNews.tsx +17 -6
  262. package/src/components/Carousel.tsx +5 -5
  263. package/src/components/Checkbox.tsx +17 -7
  264. package/src/components/Chip.tsx +49 -21
  265. package/src/components/Choice.tsx +34 -14
  266. package/src/components/Dialog.tsx +15 -5
  267. package/src/components/DropdownMenu.tsx +62 -14
  268. package/src/components/EmptyState.tsx +3 -3
  269. package/src/components/FallbackImage.tsx +32 -23
  270. package/src/components/Feed.tsx +2 -1
  271. package/src/components/Feedback.tsx +0 -1
  272. package/src/components/Filter.tsx +2 -3
  273. package/src/components/Input.tsx +83 -64
  274. package/src/components/InvitePopover.tsx +11 -3
  275. package/src/components/LeaderboardCard.tsx +4 -1
  276. package/src/components/Loading.tsx +17 -14
  277. package/src/components/LoadingOverlay.tsx +33 -50
  278. package/src/components/MemberRow.tsx +3 -3
  279. package/src/components/PageHeader.tsx +4 -1
  280. package/src/components/PostForm.tsx +28 -16
  281. package/src/components/PrizeCollection.tsx +3 -3
  282. package/src/components/RadioGroup.tsx +69 -12
  283. package/src/components/SectionHeader.tsx +4 -1
  284. package/src/components/Select.tsx +4 -3
  285. package/src/components/Separator.tsx +2 -2
  286. package/src/components/Sheet.tsx +15 -8
  287. package/src/components/Skeleton.tsx +1 -1
  288. package/src/components/Tabs.tsx +5 -4
  289. package/src/components/Tag.tsx +56 -35
  290. package/src/components/Toast.tsx +10 -6
  291. package/src/editor/NoteEditor.tsx +246 -72
  292. package/src/editor/editorHtml.generated.ts +1 -1
  293. package/src/editor/index.ts +8 -4
  294. package/src/editor/protocol.ts +4 -12
  295. package/src/hooks/useThemeColor.ts +41 -19
  296. package/src/index.ts +1 -1
  297. package/src/lib/backdrop.ts +16 -0
  298. package/src/lib/overlay-host.tsx +5 -5
package/setup/tailwind.js CHANGED
@@ -1,10 +1,18 @@
1
1
  const path = require('path');
2
2
  const { resolveMedwayUiPaths } = require('./monorepo');
3
3
 
4
+ function resolveFromProject(request, projectRoot) {
5
+ return require.resolve(request, { paths: [projectRoot] });
6
+ }
7
+
8
+ // O jiti vem como dependência do tailwindcss, então nem sempre fica visível na raiz do app (pnpm).
9
+ function resolveJiti(projectRoot) {
10
+ const tailwindRoot = path.dirname(resolveFromProject('tailwindcss/package.json', projectRoot));
11
+ return require.resolve('jiti', { paths: [projectRoot, tailwindRoot] });
12
+ }
13
+
4
14
  function loadDesignTokens(projectRoot) {
5
- const tokensPath = require.resolve('@medway-ui/core/tokens', {
6
- paths: [projectRoot],
7
- });
15
+ const tokensPath = resolveFromProject('@medway-ui/core/tokens', projectRoot);
8
16
 
9
17
  try {
10
18
  return require(tokensPath);
@@ -14,7 +22,7 @@ function loadDesignTokens(projectRoot) {
14
22
  throw error;
15
23
  }
16
24
 
17
- const jiti = require('jiti')(path.join(projectRoot, 'tailwind.config.js'));
25
+ const jiti = require(resolveJiti(projectRoot))(path.join(projectRoot, 'tailwind.config.js'));
18
26
  return jiti(tokensPath);
19
27
  }
20
28
  }
@@ -42,11 +50,11 @@ const NATIVE_MONTSERRAT_BY_WEIGHT = {
42
50
  black: 'MontserratBlack',
43
51
  };
44
52
 
45
- function createNativeMontserratFontPlugin() {
46
- // Lazy-require so greenfield web tooling can still import this file if needed.
47
- const plugin = require('tailwindcss/plugin');
53
+ function createNativeMontserratFontPlugin(projectRoot) {
54
+ const plugin = require(resolveFromProject('tailwindcss/plugin', projectRoot));
48
55
 
49
56
  return plugin(({ addBase, addUtilities }) => {
57
+ // No app o NativeWind descarta o seletor universal (só guarda variáveis): texto sem font-* fica sem família.
50
58
  addBase({
51
59
  '*': {
52
60
  fontFamily: 'Montserrat',
@@ -121,7 +129,7 @@ function createMedwayUiTailwindConfig(options = {}) {
121
129
  boxShadow,
122
130
  },
123
131
  },
124
- plugins: [createNativeMontserratFontPlugin()],
132
+ plugins: [createNativeMontserratFontPlugin(projectRoot)],
125
133
  };
126
134
  }
127
135
 
@@ -387,6 +387,7 @@
387
387
  --color-state-focus: var(--color-gray-70);
388
388
  --color-state-active: var(--color-primary-16);
389
389
  --color-state-error: var(--color-red-16);
390
+ --color-state-success: var(--color-green-16);
390
391
 
391
392
  /* === Base feedback success colors === */
392
393
  --color-feedback-success-foreground: var(--color-green-darken-3);
@@ -628,25 +629,39 @@
628
629
  --color-gradient-prev-bg-2: var(--color-gray-10);
629
630
 
630
631
  /* === Base gradient r1 === */
631
- --color-gradient-r1-blur-1: var(--color-secondary);
632
- --color-gradient-r1-blur-2: var(--color-primary-lighten-3);
632
+ --color-gradient-r1-blur-1: var(--color-secondary-lighten-1);
633
+ --color-gradient-r1-blur-2: var(--color-cm);
633
634
  --color-gradient-r1-blur-3: var(--color-primary-lighten-5);
634
- --color-gradient-r1-bg-1: var(--color-primary);
635
- --color-gradient-r1-bg-2: var(--color-primary-lighten-1);
635
+ --color-gradient-r1-bg-1: var(--color-primary-lighten-2);
636
+ --color-gradient-r1-bg-2: var(--color-primary-lighten-6);
636
637
 
637
638
  /* === Base gradient rplus === */
638
- --color-gradient-rplus-blur-1: var(--color-primary-lighten-1);
639
+ --color-gradient-rplus-blur-1: var(--color-prev);
639
640
  --color-gradient-rplus-blur-2: var(--color-primary-lighten-3);
640
641
  --color-gradient-rplus-blur-3: var(--color-primary-lighten-5);
641
- --color-gradient-rplus-bg-1: var(--color-primary-lighten-1);
642
- --color-gradient-rplus-bg-2: var(--color-primary);
642
+ --color-gradient-rplus-bg-1: var(--color-primary-lighten-4);
643
+ --color-gradient-rplus-bg-2: var(--color-prev-lighten-3);
643
644
 
644
645
  /* === Base gradient pt === */
645
- --color-gradient-pt-blur-1: var(--color-secondary);
646
- --color-gradient-pt-blur-2: var(--color-secondary-darken-2);
647
- --color-gradient-pt-blur-3: var(--color-secondary-darken-4);
646
+ --color-gradient-pt-blur-1: var(--color-cir);
647
+ --color-gradient-pt-blur-2: var(--color-secondary-darken-1);
648
+ --color-gradient-pt-blur-3: var(--color-secondary-darken-2);
648
649
  --color-gradient-pt-bg-1: var(--color-gray-600);
649
- --color-gradient-pt-bg-2: var(--color-gray-450);
650
+ --color-gradient-pt-bg-2: var(--color-gray-300);
651
+
652
+ /* === Base gradient default === */
653
+ --color-gradient-default-blur-1: var(--color-gray-10);
654
+ --color-gradient-default-blur-2: var(--color-secondary-lighten-5);
655
+ --color-gradient-default-blur-3: var(--color-primary-lighten-6);
656
+ --color-gradient-default-bg-1: var(--color-gray-150);
657
+ --color-gradient-default-bg-2: var(--color-gray-50);
658
+
659
+ /* === Base gradient neutral === */
660
+ --color-gradient-neutral-blur-1: var(--color-white);
661
+ --color-gradient-neutral-blur-2: var(--color-gray-70);
662
+ --color-gradient-neutral-blur-3: var(--color-gray-150);
663
+ --color-gradient-neutral-bg-1: var(--color-gray-50);
664
+ --color-gradient-neutral-bg-2: var(--color-gray-30);
650
665
 
651
666
  /* === Typography fontfamily === */
652
667
  /* RN: single family name (loaded via expo-font as "Montserrat"). */
@@ -662,7 +677,7 @@
662
677
  --font-weight-medium: 500;
663
678
  --font-weight-semibold: 600;
664
679
  --font-weight-bold: 700;
665
- --font-weight-extrabold: 900;
680
+ --font-weight-extrabold: 800;
666
681
 
667
682
  /* === Typography size === */
668
683
  --text-xxs: 10px;
@@ -702,6 +717,7 @@
702
717
  --radius-sm: 4px;
703
718
  --radius-md: 8px;
704
719
  --radius-lg: 16px;
720
+ --radius-xl: 32px;
705
721
  --radius-pill: 320px;
706
722
  --radius-circular: 1600px;
707
723
  --radius-full: 9999px;
@@ -745,6 +761,7 @@
745
761
  --color-state-focus: var(--color-gray-700);
746
762
  --color-state-active: var(--color-white-16);
747
763
  --color-state-error: var(--color-red-16);
764
+ --color-state-success: var(--color-green-16);
748
765
 
749
766
  /* === Base feedback success colors === */
750
767
  --color-feedback-success-foreground: var(--color-green-lighten-4);
@@ -794,7 +811,7 @@
794
811
  /* === Dark surface colors === */
795
812
  --color-surface-elevated: var(--color-gray-800);
796
813
  --color-surface-card: var(--color-gray-850);
797
- --color-surface-navigation: var(--color-gray-850);
814
+ --color-surface-navigation: var(--color-gray-900);
798
815
  --color-surface-section: var(--color-gray-850);
799
816
  --color-surface-page: var(--color-gray-950);
800
817
  --color-surface-disable: var(--color-black-8);
@@ -1000,23 +1017,37 @@
1000
1017
 
1001
1018
  /* === Dark gradient r1 === */
1002
1019
  --color-gradient-r1-blur-1: var(--color-secondary);
1003
- --color-gradient-r1-blur-2: var(--color-primary-lighten-1);
1020
+ --color-gradient-r1-blur-2: var(--color-primary-lighten-2);
1004
1021
  --color-gradient-r1-blur-3: var(--color-primary-lighten-2);
1005
1022
  --color-gradient-r1-bg-1: var(--color-primary);
1006
- --color-gradient-r1-bg-2: var(--color-primary-darken-2);
1023
+ --color-gradient-r1-bg-2: var(--color-primary-darken-1);
1007
1024
 
1008
1025
  /* === Dark gradient rplus === */
1009
- --color-gradient-rplus-blur-1: var(--color-primary-lighten-5);
1026
+ --color-gradient-rplus-blur-1: var(--color-prev-darken-1);
1010
1027
  --color-gradient-rplus-blur-2: var(--color-primary-lighten-3);
1011
1028
  --color-gradient-rplus-blur-3: var(--color-primary-lighten-1);
1012
1029
  --color-gradient-rplus-bg-1: var(--color-primary);
1013
- --color-gradient-rplus-bg-2: var(--color-primary-darken-2);
1030
+ --color-gradient-rplus-bg-2: var(--color-prev-darken-6);
1014
1031
 
1015
1032
  /* === Dark gradient pt === */
1016
- --color-gradient-pt-blur-1: var(--color-secondary);
1017
- --color-gradient-pt-blur-2: var(--color-secondary-darken-1);
1018
- --color-gradient-pt-blur-3: var(--color-secondary-darken-3);
1033
+ --color-gradient-pt-blur-1: var(--color-cir-darken-1);
1034
+ --color-gradient-pt-blur-2: var(--color-secondary-darken-2);
1035
+ --color-gradient-pt-blur-3: var(--color-secondary-darken-4);
1019
1036
  --color-gradient-pt-bg-1: var(--color-gray-800);
1020
1037
  --color-gradient-pt-bg-2: var(--color-gray-900);
1038
+
1039
+ /* === Dark gradient default === */
1040
+ --color-gradient-default-blur-1: var(--color-primary-lighten-1);
1041
+ --color-gradient-default-blur-2: var(--color-secondary-lighten-2);
1042
+ --color-gradient-default-blur-3: var(--color-primary-lighten-3);
1043
+ --color-gradient-default-bg-1: var(--color-gray-850);
1044
+ --color-gradient-default-bg-2: var(--color-gray-900);
1045
+
1046
+ /* === Dark gradient neutral === */
1047
+ --color-gradient-neutral-blur-1: var(--color-gray-900);
1048
+ --color-gradient-neutral-blur-2: var(--color-gray-850);
1049
+ --color-gradient-neutral-blur-3: var(--color-gray-800);
1050
+ --color-gradient-neutral-bg-1: var(--color-gray-850);
1051
+ --color-gradient-neutral-bg-2: var(--color-gray-950);
1021
1052
  }
1022
1053
  }
@@ -29,15 +29,17 @@ const AlertContext = createContext<{
29
29
  onClose?: () => void;
30
30
  } | null>(null);
31
31
 
32
+ const alertBackgroundClassName: Record<AlertVariant, string> = {
33
+ regular: "bg-primary-background-soft",
34
+ emphasis: "bg-secondary-background-soft",
35
+ success: "bg-feedback-success-background-soft",
36
+ warning: "bg-feedback-warning-background-soft",
37
+ error: "bg-feedback-error-background-soft",
38
+ };
39
+
32
40
  const alertVariants = cva("relative w-full rounded-md px-4 py-3 flex-col gap-1", {
33
41
  variants: {
34
- variant: {
35
- regular: "bg-primary-background-soft",
36
- emphasis: "bg-secondary-background-soft",
37
- success: "bg-green-background-soft",
38
- warning: "bg-yellow-background-soft",
39
- error: "bg-red-background-soft",
40
- },
42
+ variant: alertBackgroundClassName,
41
43
  },
42
44
  defaultVariants: { variant: "regular" },
43
45
  });
@@ -47,30 +49,45 @@ const alertTextColorVariants = cva("", {
47
49
  variant: {
48
50
  regular: "text-primary-foreground",
49
51
  emphasis: "text-secondary-foreground",
50
- success: "text-green-foreground",
51
- warning: "text-yellow-foreground",
52
- error: "text-red-foreground",
52
+ success: "text-feedback-success-foreground",
53
+ warning: "text-feedback-warning-foreground",
54
+ error: "text-feedback-error-foreground",
53
55
  },
54
56
  },
55
57
  defaultVariants: { variant: "regular" },
56
58
  });
57
59
 
60
+ const alertDescriptionColorClassName: Record<AlertVariant, string> = {
61
+ regular: "text-primary-foreground-emphasis",
62
+ emphasis: "text-secondary-foreground-emphasis",
63
+ success: "text-feedback-success-foreground-emphasis",
64
+ warning: "text-feedback-warning-foreground-emphasis",
65
+ error: "text-feedback-error-foreground-emphasis",
66
+ };
67
+
58
68
  const alertButtonVariants = cva(
59
- "flex-row items-center justify-center rounded-pill px-3 min-h-10",
69
+ "flex-row items-center justify-center rounded-pill px-3 min-h-10 disabled:opacity-50",
60
70
  {
61
71
  variants: {
62
72
  variant: {
63
73
  regular: "",
64
- basic: "bg-transparent",
74
+ basic: "",
65
75
  },
66
76
  alertVariant: {
67
- regular: "bg-primary-background-soft",
68
- emphasis: "bg-secondary-background-soft",
69
- success: "bg-green-background-soft",
70
- warning: "bg-yellow-background-soft",
71
- error: "bg-red-background-soft",
77
+ regular: "active:bg-primary-background-soft-emphasis",
78
+ emphasis: "active:bg-secondary-background-soft-emphasis",
79
+ success: "active:bg-feedback-success-background-soft-emphasis",
80
+ warning: "active:bg-feedback-warning-background-soft-emphasis",
81
+ error: "active:bg-feedback-error-background-soft-emphasis",
72
82
  },
73
83
  },
84
+ compoundVariants: (Object.keys(alertBackgroundClassName) as AlertVariant[]).map(
85
+ (alertVariant) => ({
86
+ variant: "regular" as const,
87
+ alertVariant,
88
+ className: alertBackgroundClassName[alertVariant],
89
+ })
90
+ ),
74
91
  defaultVariants: { variant: "regular", alertVariant: "regular" },
75
92
  }
76
93
  );
@@ -89,7 +106,7 @@ function Alert({ className, variant = "regular", onClose, children, ...props }:
89
106
  <AlertContext.Provider value={ctx}>
90
107
  <View
91
108
  accessibilityRole="alert"
92
- className={cn(alertVariants({ variant }), className)}
109
+ className={cn(alertVariants({ variant }), onClose && "pr-12", className)}
93
110
  {...props}
94
111
  >
95
112
  {children}
@@ -131,7 +148,7 @@ function AlertTitle({ className, children, ...props }: ViewProps & { children?:
131
148
  <View className={cn("", className)} {...props}>
132
149
  <Text
133
150
  numberOfLines={1}
134
- className={cn("text-md font-medium", alertTextColorVariants({ variant }))}
151
+ className={cn("text-md font-semibold", alertTextColorVariants({ variant }))}
135
152
  >
136
153
  {children}
137
154
  </Text>
@@ -145,7 +162,7 @@ function AlertDescription({ className, children, ...props }: ViewProps & { child
145
162
  <View className={cn("", className)} {...props}>
146
163
  <Text
147
164
  numberOfLines={3}
148
- className={cn("text-sm font-medium leading-5", alertTextColorVariants({ variant }))}
165
+ className={cn("text-sm font-medium leading-sm", alertDescriptionColorClassName[variant])}
149
166
  >
150
167
  {children}
151
168
  </Text>
@@ -1,10 +1,12 @@
1
1
  import { createContext, useContext, useMemo, type ReactNode } from "react";
2
- import { View, Text, type ViewProps } from "react-native";
2
+ import { View, type ViewProps } from "react-native";
3
3
  import * as AlertDialogPrimitive from "@rn-primitives/alert-dialog";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { CloseMd } from "@medway-ui/icons/native";
6
6
  import { useThemeColor } from "@/hooks/useThemeColor";
7
+ import { useBackdropStyle } from "@/lib/backdrop";
7
8
  import { cn } from "@/lib/utils";
9
+ import { Text } from "@/components/Text";
8
10
  import { Button, type ButtonProps } from "@/components/Button";
9
11
  import { Tag, type TagProps } from "@/components/Tag";
10
12
 
@@ -66,9 +68,9 @@ const alertDialogIconContainerVariants = cva(
66
68
  variant: {
67
69
  regular: "bg-primary-background-fill",
68
70
  emphasis: "bg-secondary-background-fill",
69
- warning: "bg-yellow-background-fill",
70
- error: "bg-red-background-fill",
71
- success: "bg-green-background-fill",
71
+ warning: "bg-feedback-warning-background-fill",
72
+ error: "bg-feedback-error-background-fill",
73
+ success: "bg-feedback-success-background-fill",
72
74
  },
73
75
  },
74
76
  defaultVariants: { variant: DEFAULT_VARIANT },
@@ -80,9 +82,9 @@ const alertDialogIconTextVariants = cva("", {
80
82
  variant: {
81
83
  regular: "text-primary-foreground-onfill",
82
84
  emphasis: "text-secondary-foreground-onfill",
83
- warning: "text-yellow-foreground-onfill",
84
- error: "text-red-foreground-onfill",
85
- success: "text-green-foreground-onfill",
85
+ warning: "text-feedback-warning-foreground-onfill",
86
+ error: "text-feedback-error-foreground-onfill",
87
+ success: "text-feedback-success-foreground-onfill",
86
88
  },
87
89
  },
88
90
  defaultVariants: { variant: DEFAULT_VARIANT },
@@ -96,14 +98,6 @@ const alertDialogTagVariantMap: Record<AlertDialogVariant, TagProps["variant"]>
96
98
  success: "success-soft",
97
99
  };
98
100
 
99
- const actionVariantMap: Record<AlertDialogVariant, NonNullable<ButtonProps["variant"]>> = {
100
- regular: "regular",
101
- emphasis: "emphasis",
102
- warning: "warning",
103
- error: "error",
104
- success: "success",
105
- };
106
-
107
101
  function AlertDialog({ variant = DEFAULT_VARIANT, ...props }: AlertDialogProps) {
108
102
  const ctx = useMemo(() => ({ variant }), [variant]);
109
103
  return (
@@ -122,9 +116,12 @@ function AlertDialogPortal({ ...props }: AlertDialogPrimitive.PortalProps) {
122
116
  }
123
117
 
124
118
  function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.OverlayProps) {
119
+ const backdropStyle = useBackdropStyle(className);
120
+
125
121
  return (
126
122
  <AlertDialogPrimitive.Overlay
127
- className={cn("absolute inset-0 bg-black-48", className)}
123
+ className={cn("absolute inset-0", className)}
124
+ style={backdropStyle}
128
125
  {...props}
129
126
  />
130
127
  );
@@ -138,11 +135,13 @@ function AlertDialogContent({
138
135
  ...props
139
136
  }: AlertDialogContentProps) {
140
137
  const closeIconColor = useThemeColor("gray-foreground");
138
+ const backdropStyle = useBackdropStyle(overlayClassName);
141
139
 
142
140
  return (
143
141
  <AlertDialogPrimitive.Portal>
144
142
  <AlertDialogPrimitive.Overlay
145
- className={cn("absolute inset-0 bg-black-48", overlayClassName)}
143
+ className={cn("absolute inset-0", overlayClassName)}
144
+ style={backdropStyle}
146
145
  />
147
146
  <AlertDialogPrimitive.Content
148
147
  className="absolute inset-0 items-center justify-center px-4"
@@ -150,7 +149,7 @@ function AlertDialogContent({
150
149
  >
151
150
  <View
152
151
  className={cn(
153
- "relative flex-col w-full rounded-xl bg-background shadow-lg overflow-hidden",
152
+ "relative flex-col w-full rounded-lg bg-surface-elevated shadow-lg overflow-hidden",
154
153
  className
155
154
  )}
156
155
  >
@@ -247,7 +246,7 @@ function AlertDialogAction({
247
246
  }: AlertDialogActionProps) {
248
247
  const ctx = useContext(AlertDialogContext);
249
248
  const primitiveCtx = AlertDialogPrimitive.useRootContext();
250
- const resolvedVariant = variant ?? actionVariantMap[ctx?.variant ?? DEFAULT_VARIANT];
249
+ const resolvedVariant = variant ?? ctx?.variant ?? DEFAULT_VARIANT;
251
250
 
252
251
  return (
253
252
  <View className={cn("flex-1", className)}>
@@ -57,13 +57,13 @@ const badgeVariants = cva("flex-row items-center justify-center rounded-pill", {
57
57
  cir: "bg-cir-background-fill",
58
58
  "cir-soft": "bg-surface-card",
59
59
  // The design paints pediatrics with the warning tokens, all but the filled label.
60
- ped: "bg-yellow-background-fill",
60
+ ped: "bg-feedback-warning-background-fill",
61
61
  "ped-soft": "bg-surface-card",
62
62
  prev: "bg-prev-background-fill",
63
63
  "prev-soft": "bg-surface-card",
64
64
  freemium: "bg-primary",
65
- error: "bg-red-background-soft",
66
- warning: "bg-yellow-background-soft",
65
+ error: "bg-feedback-error-background-soft",
66
+ warning: "bg-feedback-warning-background-soft",
67
67
  neutral: "bg-gray-background-soft",
68
68
  },
69
69
  size: {
@@ -93,7 +93,7 @@ const SOFT_TINT: Partial<Record<BadgeVariant, string>> = {
93
93
  "cm-soft": "bg-cm-background-soft",
94
94
  "go-soft": "bg-go-background-soft",
95
95
  "cir-soft": "bg-cir-background-soft",
96
- "ped-soft": "bg-yellow-background-soft",
96
+ "ped-soft": "bg-feedback-warning-background-soft",
97
97
  "prev-soft": "bg-prev-background-soft",
98
98
  };
99
99
 
@@ -112,13 +112,13 @@ const badgeTextVariants = cva("font-bold", {
112
112
  cir: "text-cir-foreground-onfill",
113
113
  "cir-soft": "text-cir-foreground",
114
114
  ped: "text-ped-foreground-onfill",
115
- "ped-soft": "text-yellow-foreground",
115
+ "ped-soft": "text-feedback-warning-foreground",
116
116
  prev: "text-prev-foreground-onfill",
117
117
  "prev-soft": "text-prev-foreground",
118
118
  // White, not the design's onfill token: that one turns dark in dark mode, on a fill that stays navy.
119
119
  freemium: "font-semibold text-white",
120
- error: "text-red-stroke-emphasis",
121
- warning: "text-yellow-foreground",
120
+ error: "text-feedback-error-foreground",
121
+ warning: "text-feedback-warning-foreground",
122
122
  neutral: "text-primary-foreground",
123
123
  },
124
124
  size: {
@@ -151,13 +151,13 @@ const badgeDotVariants = cva("rounded-circular", {
151
151
  "go-soft": "bg-go-background-fill",
152
152
  cir: "bg-cir-background-fill",
153
153
  "cir-soft": "bg-cir-background-fill",
154
- ped: "bg-yellow-background-fill",
155
- "ped-soft": "bg-yellow-background-fill",
154
+ ped: "bg-feedback-warning-background-fill",
155
+ "ped-soft": "bg-feedback-warning-background-fill",
156
156
  prev: "bg-prev-background-fill",
157
157
  "prev-soft": "bg-prev-background-fill",
158
158
  freemium: "bg-primary",
159
- error: "bg-red-background-fill",
160
- warning: "bg-yellow-background-fill",
159
+ error: "bg-feedback-error-background-fill",
160
+ warning: "bg-feedback-warning-background-fill",
161
161
  neutral: "bg-gray-background-fill",
162
162
  },
163
163
  size: {
@@ -197,6 +197,8 @@ const FREEMIUM_GRADIENT: ViewStyle = {
197
197
 
198
198
  const SHINE_DURATION_MS = 2000;
199
199
 
200
+ const SHINE_BAND_FRAME: ViewStyle = { position: "absolute", top: 0, bottom: 0 };
201
+
200
202
  function BadgeShine() {
201
203
  const progress = useSharedValue(0);
202
204
  const width = useSharedValue(0);
@@ -234,10 +236,9 @@ function BadgeShine() {
234
236
  className="absolute inset-0 overflow-hidden rounded-pill"
235
237
  onLayout={handleLayout}
236
238
  >
237
- <Animated.View
238
- className="absolute bottom-0 top-0 bg-white-24"
239
- style={bandStyle}
240
- />
239
+ <Animated.View style={[SHINE_BAND_FRAME, bandStyle]}>
240
+ <View className="flex-1 bg-white-24" />
241
+ </Animated.View>
241
242
  </View>
242
243
  );
243
244
  }
@@ -91,23 +91,23 @@ const buttonVariants = cva(
91
91
  "emphasis-basic":
92
92
  "bg-transparent active:bg-secondary-background-soft-emphasis disabled:bg-transparent",
93
93
  error:
94
- "bg-red-background-fill active:bg-red-background-fill-emphasis disabled:bg-gray-background-fill-muted",
94
+ "bg-feedback-error-background-fill active:bg-feedback-error-background-fill-emphasis disabled:bg-gray-background-fill-muted",
95
95
  "error-soft":
96
- "bg-red-background-soft active:bg-red-background-soft-emphasis disabled:bg-gray-background-soft-muted",
96
+ "bg-feedback-error-background-soft active:bg-feedback-error-background-soft-emphasis disabled:bg-gray-background-soft-muted",
97
97
  "error-basic":
98
- "bg-transparent active:bg-red-background-soft-emphasis disabled:bg-transparent",
98
+ "bg-transparent active:bg-feedback-error-background-soft-emphasis disabled:bg-transparent",
99
99
  warning:
100
- "bg-yellow-background-fill active:bg-yellow-background-fill-emphasis disabled:bg-gray-background-fill-muted",
100
+ "bg-feedback-warning-background-fill active:bg-feedback-warning-background-fill-emphasis disabled:bg-gray-background-fill-muted",
101
101
  "warning-soft":
102
- "bg-yellow-background-soft active:bg-yellow-background-soft-emphasis disabled:bg-gray-background-soft-muted",
102
+ "bg-feedback-warning-background-soft active:bg-feedback-warning-background-soft-emphasis disabled:bg-gray-background-soft-muted",
103
103
  "warning-basic":
104
- "bg-transparent active:bg-yellow-background-soft-emphasis disabled:bg-transparent",
104
+ "bg-transparent active:bg-feedback-warning-background-soft-emphasis disabled:bg-transparent",
105
105
  success:
106
- "bg-green-background-fill active:bg-green-background-fill-emphasis disabled:bg-gray-background-fill-muted",
106
+ "bg-feedback-success-background-fill active:bg-feedback-success-background-fill-emphasis disabled:bg-gray-background-fill-muted",
107
107
  "success-soft":
108
- "bg-green-background-soft active:bg-green-background-soft-emphasis disabled:bg-gray-background-soft-muted",
108
+ "bg-feedback-success-background-soft active:bg-feedback-success-background-soft-emphasis disabled:bg-gray-background-soft-muted",
109
109
  "success-basic":
110
- "bg-transparent active:bg-green-background-soft-emphasis disabled:bg-transparent",
110
+ "bg-transparent active:bg-feedback-success-background-soft-emphasis disabled:bg-transparent",
111
111
  outlined:
112
112
  "border border-gray-stroke-muted bg-transparent active:bg-state-hover disabled:border-gray-stroke-muted",
113
113
  gradient:
@@ -132,24 +132,24 @@ const buttonVariants = cva(
132
132
  const buttonTextVariants = cva("font-semibold shrink-0", {
133
133
  variants: {
134
134
  variant: {
135
- regular: "text-primary-foreground-onfill disabled:text-gray-foreground-onfill",
136
- "regular-soft": "text-primary-foreground disabled:text-gray-foreground-muted",
137
- "regular-basic": "text-primary-foreground disabled:text-gray-foreground-muted",
138
- emphasis: "text-secondary-foreground-onfill disabled:text-gray-foreground-onfill",
139
- "emphasis-soft": "text-secondary-foreground disabled:text-gray-foreground-muted",
140
- "emphasis-basic": "text-secondary-foreground disabled:text-gray-foreground-muted",
141
- error: "text-red-foreground-onfill disabled:text-gray-foreground-onfill",
142
- "error-soft": "text-red-foreground disabled:text-gray-foreground-muted",
143
- "error-basic": "text-red-foreground disabled:text-gray-foreground-muted",
144
- warning: "text-yellow-foreground-onfill disabled:text-gray-foreground-onfill",
145
- "warning-soft": "text-yellow-foreground disabled:text-gray-foreground-muted",
146
- "warning-basic": "text-yellow-foreground disabled:text-gray-foreground-muted",
147
- success: "text-green-foreground-onfill disabled:text-gray-foreground-onfill",
148
- "success-soft": "text-green-foreground disabled:text-gray-foreground-muted",
149
- "success-basic": "text-green-foreground disabled:text-gray-foreground-muted",
150
- outlined: "text-foreground disabled:text-gray-foreground-muted",
151
- gradient: "text-white disabled:text-gray-foreground-onfill",
152
- medbrain: "text-secondary disabled:text-gray-foreground-onfill",
135
+ regular: "text-primary-foreground-onfill",
136
+ "regular-soft": "text-primary-foreground",
137
+ "regular-basic": "text-primary-foreground",
138
+ emphasis: "text-secondary-foreground-onfill",
139
+ "emphasis-soft": "text-secondary-foreground",
140
+ "emphasis-basic": "text-secondary-foreground",
141
+ error: "text-feedback-error-foreground-onfill",
142
+ "error-soft": "text-feedback-error-foreground",
143
+ "error-basic": "text-feedback-error-foreground",
144
+ warning: "text-feedback-warning-foreground-onfill",
145
+ "warning-soft": "text-feedback-warning-foreground",
146
+ "warning-basic": "text-feedback-warning-foreground",
147
+ success: "text-feedback-success-foreground-onfill",
148
+ "success-soft": "text-feedback-success-foreground",
149
+ "success-basic": "text-feedback-success-foreground",
150
+ outlined: "text-foreground",
151
+ gradient: "text-white",
152
+ medbrain: "text-secondary",
153
153
  },
154
154
  size: {
155
155
  sm: "text-xs",
@@ -157,10 +157,39 @@ const buttonTextVariants = cva("font-semibold shrink-0", {
157
157
  lg: "text-md",
158
158
  xl: "text-lg",
159
159
  },
160
+ disabled: {
161
+ true: "",
162
+ false: "",
163
+ },
160
164
  },
165
+ compoundVariants: [
166
+ {
167
+ variant: ["regular", "emphasis", "error", "warning", "success", "gradient", "medbrain"],
168
+ disabled: true,
169
+ className: "text-gray-foreground-onfill",
170
+ },
171
+ {
172
+ variant: [
173
+ "regular-soft",
174
+ "regular-basic",
175
+ "emphasis-soft",
176
+ "emphasis-basic",
177
+ "error-soft",
178
+ "error-basic",
179
+ "warning-soft",
180
+ "warning-basic",
181
+ "success-soft",
182
+ "success-basic",
183
+ "outlined",
184
+ ],
185
+ disabled: true,
186
+ className: "text-gray-foreground-muted",
187
+ },
188
+ ],
161
189
  defaultVariants: {
162
190
  variant: "regular",
163
191
  size: "md",
192
+ disabled: false,
164
193
  },
165
194
  });
166
195
 
@@ -185,6 +214,10 @@ function Button({
185
214
  const resolvedSize = size ?? "md";
186
215
  const resolvedVariant = variant ?? "regular";
187
216
  const isIconOnly = !children && !alert && (!!iconLeft || !!iconRight);
217
+ const isDisabled = !!disabled || loading;
218
+ const textClassName = cn(
219
+ buttonTextVariants({ variant: resolvedVariant, size, disabled: isDisabled })
220
+ );
188
221
 
189
222
  return (
190
223
  <View style={[{ position: "relative" }, containerStyle]}>
@@ -197,9 +230,9 @@ function Button({
197
230
  )}
198
231
 
199
232
  <Pressable
200
- disabled={disabled || loading}
233
+ disabled={isDisabled}
201
234
  accessibilityRole="button"
202
- accessibilityState={{ disabled: disabled || loading, busy: loading }}
235
+ accessibilityState={{ disabled: isDisabled, busy: loading }}
203
236
  className={cn(
204
237
  buttonVariants({ variant, size }),
205
238
  isIconOnly && ICON_ONLY_SIZES[resolvedSize],
@@ -218,7 +251,7 @@ function Button({
218
251
  <View className="opacity-0 flex-row items-center gap-2">
219
252
  {iconLeft}
220
253
  {children != null && (
221
- <Text className={cn(buttonTextVariants({ variant: resolvedVariant, size }))}>
254
+ <Text className={textClassName}>
222
255
  {children}
223
256
  </Text>
224
257
  )}
@@ -242,7 +275,7 @@ function Button({
242
275
  iconLeft
243
276
  )}
244
277
  {children != null && (
245
- <Text className={cn(buttonTextVariants({ variant: resolvedVariant, size }))}>
278
+ <Text className={textClassName}>
246
279
  {children}
247
280
  </Text>
248
281
  )}