@medway-ui/native 1.1.2 → 1.3.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 (244) hide show
  1. package/lib/commonjs/components/Alert.js +5 -4
  2. package/lib/commonjs/components/Alert.js.map +1 -1
  3. package/lib/commonjs/components/Avatar.js +2 -1
  4. package/lib/commonjs/components/Avatar.js.map +1 -1
  5. package/lib/commonjs/components/Badge.js +2 -1
  6. package/lib/commonjs/components/Badge.js.map +1 -1
  7. package/lib/commonjs/components/Button.js +3 -2
  8. package/lib/commonjs/components/Button.js.map +1 -1
  9. package/lib/commonjs/components/CardNews.js +7 -6
  10. package/lib/commonjs/components/CardNews.js.map +1 -1
  11. package/lib/commonjs/components/Carousel.js +122 -0
  12. package/lib/commonjs/components/Carousel.js.map +1 -0
  13. package/lib/commonjs/components/Checkbox.js +11 -2
  14. package/lib/commonjs/components/Checkbox.js.map +1 -1
  15. package/lib/commonjs/components/DropdownMenu.js +225 -0
  16. package/lib/commonjs/components/DropdownMenu.js.map +1 -0
  17. package/lib/commonjs/components/EmptyState.js +19 -20
  18. package/lib/commonjs/components/EmptyState.js.map +1 -1
  19. package/lib/commonjs/components/Feed.js +82 -0
  20. package/lib/commonjs/components/Feed.js.map +1 -0
  21. package/lib/commonjs/components/FeedNotice.js +76 -0
  22. package/lib/commonjs/components/FeedNotice.js.map +1 -0
  23. package/lib/commonjs/components/Input.js +21 -9
  24. package/lib/commonjs/components/Input.js.map +1 -1
  25. package/lib/commonjs/components/InvitePopover.js +196 -0
  26. package/lib/commonjs/components/InvitePopover.js.map +1 -0
  27. package/lib/commonjs/components/Label.js +2 -1
  28. package/lib/commonjs/components/Label.js.map +1 -1
  29. package/lib/commonjs/components/LeaderboardCard.js +58 -0
  30. package/lib/commonjs/components/LeaderboardCard.js.map +1 -0
  31. package/lib/commonjs/components/MemberRow.js +131 -0
  32. package/lib/commonjs/components/MemberRow.js.map +1 -0
  33. package/lib/commonjs/components/PageHeader.js +3 -2
  34. package/lib/commonjs/components/PageHeader.js.map +1 -1
  35. package/lib/commonjs/components/PostForm.js +182 -0
  36. package/lib/commonjs/components/PostForm.js.map +1 -0
  37. package/lib/commonjs/components/PrizeCollection.js +135 -0
  38. package/lib/commonjs/components/PrizeCollection.js.map +1 -0
  39. package/lib/commonjs/components/RadioGroup.js +22 -0
  40. package/lib/commonjs/components/RadioGroup.js.map +1 -1
  41. package/lib/commonjs/components/SectionHeader.js +36 -0
  42. package/lib/commonjs/components/SectionHeader.js.map +1 -0
  43. package/lib/commonjs/components/Switch.js +33 -19
  44. package/lib/commonjs/components/Switch.js.map +1 -1
  45. package/lib/commonjs/components/Tabs.js +156 -0
  46. package/lib/commonjs/components/Tabs.js.map +1 -0
  47. package/lib/commonjs/components/Tag.js +2 -1
  48. package/lib/commonjs/components/Tag.js.map +1 -1
  49. package/lib/commonjs/components/Text.js +60 -0
  50. package/lib/commonjs/components/Text.js.map +1 -0
  51. package/lib/commonjs/components/Toast.js +3 -2
  52. package/lib/commonjs/components/Toast.js.map +1 -1
  53. package/lib/commonjs/components/Tooltip.js +2 -2
  54. package/lib/commonjs/components/Tooltip.js.map +1 -1
  55. package/lib/commonjs/editor/NoteEditor.js +710 -0
  56. package/lib/commonjs/editor/NoteEditor.js.map +1 -0
  57. package/lib/commonjs/editor/editorHtml.generated.js +21 -0
  58. package/lib/commonjs/editor/editorHtml.generated.js.map +1 -0
  59. package/lib/commonjs/editor/index.js +33 -0
  60. package/lib/commonjs/editor/index.js.map +1 -0
  61. package/lib/commonjs/editor/protocol.js +88 -0
  62. package/lib/commonjs/editor/protocol.js.map +1 -0
  63. package/lib/commonjs/hooks/useThemeColor.js +66 -29
  64. package/lib/commonjs/hooks/useThemeColor.js.map +1 -1
  65. package/lib/commonjs/index.js +319 -1
  66. package/lib/commonjs/index.js.map +1 -1
  67. package/lib/commonjs/lib/overlay-host.js +101 -0
  68. package/lib/commonjs/lib/overlay-host.js.map +1 -0
  69. package/lib/commonjs/lib/typography.js +26 -0
  70. package/lib/commonjs/lib/typography.js.map +1 -0
  71. package/lib/commonjs/nativewind-env.d.js +0 -1
  72. package/lib/commonjs/nativewind-env.d.js.map +1 -1
  73. package/lib/module/components/Alert.js +3 -2
  74. package/lib/module/components/Alert.js.map +1 -1
  75. package/lib/module/components/Avatar.js +2 -1
  76. package/lib/module/components/Avatar.js.map +1 -1
  77. package/lib/module/components/Badge.js +2 -1
  78. package/lib/module/components/Badge.js.map +1 -1
  79. package/lib/module/components/Button.js +2 -1
  80. package/lib/module/components/Button.js.map +1 -1
  81. package/lib/module/components/CardNews.js +2 -1
  82. package/lib/module/components/CardNews.js.map +1 -1
  83. package/lib/module/components/Carousel.js +117 -0
  84. package/lib/module/components/Carousel.js.map +1 -0
  85. package/lib/module/components/Checkbox.js +12 -2
  86. package/lib/module/components/Checkbox.js.map +1 -1
  87. package/lib/module/components/DropdownMenu.js +216 -0
  88. package/lib/module/components/DropdownMenu.js.map +1 -0
  89. package/lib/module/components/EmptyState.js +19 -20
  90. package/lib/module/components/EmptyState.js.map +1 -1
  91. package/lib/module/components/Feed.js +77 -0
  92. package/lib/module/components/Feed.js.map +1 -0
  93. package/lib/module/components/FeedNotice.js +73 -0
  94. package/lib/module/components/FeedNotice.js.map +1 -0
  95. package/lib/module/components/Input.js +21 -9
  96. package/lib/module/components/Input.js.map +1 -1
  97. package/lib/module/components/InvitePopover.js +183 -0
  98. package/lib/module/components/InvitePopover.js.map +1 -0
  99. package/lib/module/components/Label.js +2 -1
  100. package/lib/module/components/Label.js.map +1 -1
  101. package/lib/module/components/LeaderboardCard.js +53 -0
  102. package/lib/module/components/LeaderboardCard.js.map +1 -0
  103. package/lib/module/components/MemberRow.js +127 -0
  104. package/lib/module/components/MemberRow.js.map +1 -0
  105. package/lib/module/components/PageHeader.js +2 -1
  106. package/lib/module/components/PageHeader.js.map +1 -1
  107. package/lib/module/components/PostForm.js +174 -0
  108. package/lib/module/components/PostForm.js.map +1 -0
  109. package/lib/module/components/PrizeCollection.js +127 -0
  110. package/lib/module/components/PrizeCollection.js.map +1 -0
  111. package/lib/module/components/RadioGroup.js +21 -1
  112. package/lib/module/components/RadioGroup.js.map +1 -1
  113. package/lib/module/components/SectionHeader.js +33 -0
  114. package/lib/module/components/SectionHeader.js.map +1 -0
  115. package/lib/module/components/Switch.js +34 -20
  116. package/lib/module/components/Switch.js.map +1 -1
  117. package/lib/module/components/Tabs.js +148 -0
  118. package/lib/module/components/Tabs.js.map +1 -0
  119. package/lib/module/components/Tag.js +2 -1
  120. package/lib/module/components/Tag.js.map +1 -1
  121. package/lib/module/components/Text.js +58 -0
  122. package/lib/module/components/Text.js.map +1 -0
  123. package/lib/module/components/Toast.js +2 -1
  124. package/lib/module/components/Toast.js.map +1 -1
  125. package/lib/module/components/Tooltip.js +1 -1
  126. package/lib/module/components/Tooltip.js.map +1 -1
  127. package/lib/module/editor/NoteEditor.js +705 -0
  128. package/lib/module/editor/NoteEditor.js.map +1 -0
  129. package/lib/module/editor/editorHtml.generated.js +17 -0
  130. package/lib/module/editor/editorHtml.generated.js.map +1 -0
  131. package/lib/module/editor/index.js +5 -0
  132. package/lib/module/editor/index.js.map +1 -0
  133. package/lib/module/editor/protocol.js +83 -0
  134. package/lib/module/editor/protocol.js.map +1 -0
  135. package/lib/module/hooks/useThemeColor.js +66 -31
  136. package/lib/module/hooks/useThemeColor.js.map +1 -1
  137. package/lib/module/index.js +33 -3
  138. package/lib/module/index.js.map +1 -1
  139. package/lib/module/lib/overlay-host.js +96 -0
  140. package/lib/module/lib/overlay-host.js.map +1 -0
  141. package/lib/module/lib/typography.js +22 -0
  142. package/lib/module/lib/typography.js.map +1 -0
  143. package/lib/module/nativewind-env.d.js +0 -1
  144. package/lib/module/nativewind-env.d.js.map +1 -1
  145. package/lib/typescript/components/Alert.d.ts.map +1 -1
  146. package/lib/typescript/components/Avatar.d.ts.map +1 -1
  147. package/lib/typescript/components/Badge.d.ts.map +1 -1
  148. package/lib/typescript/components/Button.d.ts.map +1 -1
  149. package/lib/typescript/components/CardNews.d.ts.map +1 -1
  150. package/lib/typescript/components/Carousel.d.ts +29 -0
  151. package/lib/typescript/components/Carousel.d.ts.map +1 -0
  152. package/lib/typescript/components/Checkbox.d.ts.map +1 -1
  153. package/lib/typescript/components/DropdownMenu.d.ts +39 -0
  154. package/lib/typescript/components/DropdownMenu.d.ts.map +1 -0
  155. package/lib/typescript/components/EmptyState.d.ts +1 -1
  156. package/lib/typescript/components/EmptyState.d.ts.map +1 -1
  157. package/lib/typescript/components/Feed.d.ts +22 -0
  158. package/lib/typescript/components/Feed.d.ts.map +1 -0
  159. package/lib/typescript/components/FeedNotice.d.ts +17 -0
  160. package/lib/typescript/components/FeedNotice.d.ts.map +1 -0
  161. package/lib/typescript/components/Input.d.ts +3 -2
  162. package/lib/typescript/components/Input.d.ts.map +1 -1
  163. package/lib/typescript/components/InvitePopover.d.ts +46 -0
  164. package/lib/typescript/components/InvitePopover.d.ts.map +1 -0
  165. package/lib/typescript/components/Label.d.ts.map +1 -1
  166. package/lib/typescript/components/LeaderboardCard.d.ts +16 -0
  167. package/lib/typescript/components/LeaderboardCard.d.ts.map +1 -0
  168. package/lib/typescript/components/MemberRow.d.ts +40 -0
  169. package/lib/typescript/components/MemberRow.d.ts.map +1 -0
  170. package/lib/typescript/components/PageHeader.d.ts.map +1 -1
  171. package/lib/typescript/components/PostForm.d.ts +50 -0
  172. package/lib/typescript/components/PostForm.d.ts.map +1 -0
  173. package/lib/typescript/components/PrizeCollection.d.ts +35 -0
  174. package/lib/typescript/components/PrizeCollection.d.ts.map +1 -0
  175. package/lib/typescript/components/RadioGroup.d.ts +10 -2
  176. package/lib/typescript/components/RadioGroup.d.ts.map +1 -1
  177. package/lib/typescript/components/SectionHeader.d.ts +12 -0
  178. package/lib/typescript/components/SectionHeader.d.ts.map +1 -0
  179. package/lib/typescript/components/Switch.d.ts.map +1 -1
  180. package/lib/typescript/components/Tabs.d.ts +32 -0
  181. package/lib/typescript/components/Tabs.d.ts.map +1 -0
  182. package/lib/typescript/components/Tag.d.ts.map +1 -1
  183. package/lib/typescript/components/Text.d.ts +23 -0
  184. package/lib/typescript/components/Text.d.ts.map +1 -0
  185. package/lib/typescript/components/Toast.d.ts +1 -1
  186. package/lib/typescript/components/Toast.d.ts.map +1 -1
  187. package/lib/typescript/components/Tooltip.d.ts.map +1 -1
  188. package/lib/typescript/editor/NoteEditor.d.ts +82 -0
  189. package/lib/typescript/editor/NoteEditor.d.ts.map +1 -0
  190. package/lib/typescript/editor/editorHtml.generated.d.ts +13 -0
  191. package/lib/typescript/editor/editorHtml.generated.d.ts.map +1 -0
  192. package/lib/typescript/editor/index.d.ts +6 -0
  193. package/lib/typescript/editor/index.d.ts.map +1 -0
  194. package/lib/typescript/editor/protocol.d.ts +153 -0
  195. package/lib/typescript/editor/protocol.d.ts.map +1 -0
  196. package/lib/typescript/hooks/useThemeColor.d.ts +4 -2
  197. package/lib/typescript/hooks/useThemeColor.d.ts.map +1 -1
  198. package/lib/typescript/index.d.ts +28 -4
  199. package/lib/typescript/index.d.ts.map +1 -1
  200. package/lib/typescript/lib/overlay-host.d.ts +23 -0
  201. package/lib/typescript/lib/overlay-host.d.ts.map +1 -0
  202. package/lib/typescript/lib/typography.d.ts +12 -0
  203. package/lib/typescript/lib/typography.d.ts.map +1 -0
  204. package/package.json +36 -3
  205. package/setup/MedwayUiProvider.tsx +15 -3
  206. package/setup/metro.js +27 -5
  207. package/setup/tailwind.js +52 -4
  208. package/setup/tokens.native.css +8 -3
  209. package/src/components/Alert.tsx +4 -2
  210. package/src/components/Avatar.tsx +3 -1
  211. package/src/components/Badge.tsx +3 -1
  212. package/src/components/Button.tsx +3 -7
  213. package/src/components/CardNews.tsx +2 -1
  214. package/src/components/Carousel.tsx +152 -0
  215. package/src/components/Checkbox.tsx +14 -4
  216. package/src/components/DropdownMenu.tsx +312 -0
  217. package/src/components/EmptyState.tsx +21 -23
  218. package/src/components/Feed.tsx +96 -0
  219. package/src/components/FeedNotice.tsx +112 -0
  220. package/src/components/Input.tsx +11 -6
  221. package/src/components/InvitePopover.tsx +240 -0
  222. package/src/components/Label.tsx +3 -1
  223. package/src/components/LeaderboardCard.tsx +70 -0
  224. package/src/components/MemberRow.tsx +157 -0
  225. package/src/components/PageHeader.tsx +3 -1
  226. package/src/components/PostForm.tsx +250 -0
  227. package/src/components/PrizeCollection.tsx +190 -0
  228. package/src/components/RadioGroup.tsx +32 -3
  229. package/src/components/SectionHeader.tsx +45 -0
  230. package/src/components/Switch.tsx +65 -59
  231. package/src/components/Tabs.tsx +182 -0
  232. package/src/components/Tag.tsx +3 -1
  233. package/src/components/Text.tsx +66 -0
  234. package/src/components/Toast.tsx +3 -1
  235. package/src/components/Tooltip.tsx +2 -1
  236. package/src/editor/NoteEditor.tsx +802 -0
  237. package/src/editor/editorHtml.generated.ts +14 -0
  238. package/src/editor/index.ts +13 -0
  239. package/src/editor/protocol.ts +184 -0
  240. package/src/hooks/useThemeColor.ts +77 -32
  241. package/src/index.ts +153 -6
  242. package/src/lib/overlay-host.tsx +102 -0
  243. package/src/lib/typography.ts +21 -0
  244. package/src/nativewind-env.d.ts +2 -0
@@ -1,15 +1,7 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { View, type ViewProps } from "react-native";
3
3
 
4
- import {
5
- Alert,
6
- AlertActions,
7
- AlertContainer,
8
- AlertContent,
9
- AlertDescription,
10
- AlertIcon,
11
- AlertTitle,
12
- } from "@/components/Alert";
4
+ import { Text } from "@/components/Text";
13
5
  import { cn } from "@/lib/utils";
14
6
 
15
7
  interface EmptyStateProps extends ViewProps {
@@ -26,29 +18,35 @@ function EmptyState({
26
18
  title,
27
19
  description,
28
20
  action,
29
- variant = "regular",
21
+ variant: _variant = "regular",
30
22
  ...props
31
23
  }: EmptyStateProps) {
32
24
  return (
33
25
  <View
34
26
  className={cn(
35
- "items-center gap-6 rounded-lg border border-gray-stroke-muted bg-surface-card p-8",
27
+ "w-full items-center gap-6 rounded-xl border border-gray-stroke-muted bg-surface-card p-8 shadow-sm",
36
28
  className
37
29
  )}
38
30
  {...props}
39
31
  >
40
- <Alert variant={variant} className="border-0 bg-transparent p-0">
41
- <AlertContainer>
42
- {icon ? <AlertIcon icon={icon} /> : null}
43
- <AlertContent>
44
- <AlertTitle>{title}</AlertTitle>
45
- {description ? (
46
- <AlertDescription>{description}</AlertDescription>
47
- ) : null}
48
- </AlertContent>
49
- </AlertContainer>
50
- {action ? <AlertActions>{action}</AlertActions> : null}
51
- </Alert>
32
+ {icon ? (
33
+ <View className="size-16 items-center justify-center rounded-full bg-gray-background-soft">
34
+ {icon}
35
+ </View>
36
+ ) : null}
37
+
38
+ <View className="w-full items-center gap-4">
39
+ <Text className="text-center text-lg font-semibold text-primary-foreground">
40
+ {title}
41
+ </Text>
42
+ {description ? (
43
+ <Text className="text-center text-sm font-medium text-primary-foreground-muted">
44
+ {description}
45
+ </Text>
46
+ ) : null}
47
+ </View>
48
+
49
+ {action ? <View className="w-full">{action}</View> : null}
52
50
  </View>
53
51
  );
54
52
  }
@@ -0,0 +1,96 @@
1
+ import { type ReactNode } from "react";
2
+ import { TextInput, View, type TextInputProps, type ViewProps } from "react-native";
3
+
4
+ import { Text } from "@/components/Text";
5
+
6
+ import { InputText, inputVariants } from "@/components/Input";
7
+ import { cn } from "@/lib/utils";
8
+
9
+ interface FeedProps extends ViewProps {
10
+ children?: ReactNode;
11
+ }
12
+
13
+ interface FeedTitleProps extends ViewProps {
14
+ children?: ReactNode;
15
+ }
16
+
17
+ interface FeedComposerProps extends Omit<TextInputProps, "value" | "defaultValue"> {
18
+ value?: string;
19
+ defaultValue?: string;
20
+ onChangeText?: (value: string) => void;
21
+ maxLength?: number;
22
+ placeholder?: string;
23
+ iconLeft?: ReactNode;
24
+ }
25
+
26
+ function Feed({ className, children, ...props }: FeedProps) {
27
+ return (
28
+ <View className={cn("gap-3", className)} {...props}>
29
+ {children}
30
+ </View>
31
+ );
32
+ }
33
+
34
+ function FeedTitle({ className, children, ...props }: FeedTitleProps) {
35
+ return (
36
+ <Text
37
+ className={cn("text-lg font-medium text-primary-foreground", className)}
38
+ {...props}
39
+ >
40
+ {children}
41
+ </Text>
42
+ );
43
+ }
44
+
45
+ function FeedComposer({
46
+ className,
47
+ value,
48
+ defaultValue,
49
+ onChangeText,
50
+ maxLength = 120,
51
+ placeholder = "Diga alguma coisa",
52
+ iconLeft,
53
+ editable = true,
54
+ ...props
55
+ }: FeedComposerProps) {
56
+ const currentLength = (value ?? defaultValue ?? "").length;
57
+
58
+ return (
59
+ <View className={cn("gap-1", className)}>
60
+ <View className="relative flex-row items-center">
61
+ {iconLeft ? (
62
+ <View className="absolute left-4 z-10 size-6">{iconLeft}</View>
63
+ ) : null}
64
+ <TextInput
65
+ multiline
66
+ textAlignVertical="top"
67
+ maxLength={maxLength}
68
+ value={value}
69
+ defaultValue={defaultValue}
70
+ onChangeText={onChangeText}
71
+ placeholder={placeholder}
72
+ editable={editable}
73
+ className={cn(
74
+ inputVariants({
75
+ size: "lg",
76
+ invalid: false,
77
+ focused: false,
78
+ disabled: !editable,
79
+ }),
80
+ "min-h-12 py-3 font-medium",
81
+ iconLeft ? "pl-12" : ""
82
+ )}
83
+ accessibilityLabel={placeholder}
84
+ {...props}
85
+ style={[{ fontFamily: "MontserratMedium" }, props.style]}
86
+ />
87
+ </View>
88
+ <InputText className="text-right text-xs font-medium text-gray-foreground">
89
+ {currentLength} / {maxLength}
90
+ </InputText>
91
+ </View>
92
+ );
93
+ }
94
+
95
+ export { Feed, FeedComposer, FeedTitle };
96
+ export type { FeedComposerProps, FeedProps, FeedTitleProps };
@@ -0,0 +1,112 @@
1
+ import { type ReactNode } from "react";
2
+ import { View, type ViewProps } from "react-native";
3
+
4
+ import { Text } from "@/components/Text";
5
+
6
+ import {
7
+ bodySmMediumStyle,
8
+ bodySmSemiboldStyle,
9
+ bodyXsMediumStyle,
10
+ } from "@/lib/typography";
11
+ import { cn } from "@/lib/utils";
12
+
13
+ type FeedNoticeSecondaryMessage = {
14
+ prefix: string;
15
+ highlight: string;
16
+ };
17
+
18
+ interface FeedNoticeProps extends ViewProps {
19
+ icon?: ReactNode;
20
+ message: string;
21
+ secondaryMessage?: FeedNoticeSecondaryMessage;
22
+ date: string;
23
+ time: string;
24
+ }
25
+
26
+ function FeedNoticeMessage({
27
+ message,
28
+ secondaryMessage,
29
+ }: {
30
+ message: string;
31
+ secondaryMessage?: FeedNoticeSecondaryMessage;
32
+ }) {
33
+ if (!secondaryMessage) {
34
+ return (
35
+ <Text
36
+ className="text-center text-sm font-medium leading-sm text-gray-foreground"
37
+ style={bodySmMediumStyle}
38
+ >
39
+ {message}
40
+ </Text>
41
+ );
42
+ }
43
+
44
+ return (
45
+ <View className="items-center">
46
+ <Text
47
+ className="text-center text-sm font-medium leading-sm text-gray-foreground"
48
+ style={bodySmMediumStyle}
49
+ >
50
+ {message}
51
+ </Text>
52
+ <Text
53
+ className="text-center text-sm font-medium leading-sm text-gray-foreground"
54
+ style={bodySmMediumStyle}
55
+ >
56
+ {secondaryMessage.prefix}
57
+ <Text
58
+ className="text-sm font-semibold leading-sm text-gray-foreground"
59
+ style={bodySmSemiboldStyle}
60
+ >
61
+ {secondaryMessage.highlight}
62
+ </Text>
63
+ </Text>
64
+ </View>
65
+ );
66
+ }
67
+
68
+ function FeedNotice({
69
+ className,
70
+ icon,
71
+ message,
72
+ secondaryMessage,
73
+ date,
74
+ time,
75
+ ...props
76
+ }: FeedNoticeProps) {
77
+ return (
78
+ <View
79
+ className={cn(
80
+ "items-center gap-1 rounded-lg bg-gray-background-soft px-6 py-2",
81
+ className
82
+ )}
83
+ {...props}
84
+ >
85
+ {icon ? <View className="size-5">{icon}</View> : null}
86
+ <FeedNoticeMessage message={message} secondaryMessage={secondaryMessage} />
87
+ <View className="flex-row items-center gap-1">
88
+ <Text
89
+ className="text-xs font-medium leading-xs text-gray-foreground-muted"
90
+ style={bodyXsMediumStyle}
91
+ >
92
+ {date}
93
+ </Text>
94
+ <Text
95
+ className="text-xs font-medium leading-xs text-gray-foreground-muted"
96
+ style={bodyXsMediumStyle}
97
+ >
98
+ •
99
+ </Text>
100
+ <Text
101
+ className="text-xs font-medium leading-xs text-gray-foreground-muted"
102
+ style={bodyXsMediumStyle}
103
+ >
104
+ {time}
105
+ </Text>
106
+ </View>
107
+ </View>
108
+ );
109
+ }
110
+
111
+ export { FeedNotice };
112
+ export type { FeedNoticeProps, FeedNoticeSecondaryMessage };
@@ -10,11 +10,9 @@ import {
10
10
  import {
11
11
  View,
12
12
  TextInput,
13
- Text,
14
13
  Pressable,
15
14
  type TextInputProps,
16
15
  type ViewProps,
17
- type TextProps,
18
16
  } from "react-native";
19
17
  import Animated, {
20
18
  useSharedValue,
@@ -32,7 +30,9 @@ import {
32
30
  Show,
33
31
  TriangleWarning,
34
32
  } from "@medway-ui/icons/native";
33
+ import { Text, type TextComponentProps } from "@/components/Text";
35
34
  import { useThemeColor } from "@/hooks/useThemeColor";
35
+ import { fontFamilyMedium } from "@/lib/typography";
36
36
  import { cn } from "@/lib/utils";
37
37
 
38
38
  export type InputType = "text" | "email" | "numeric" | "password";
@@ -78,7 +78,7 @@ export interface InputLabelProps {
78
78
  disabled?: boolean;
79
79
  }
80
80
 
81
- export interface InputTextProps extends TextProps {
81
+ export interface InputTextProps extends TextComponentProps {
82
82
  invalid?: boolean;
83
83
  }
84
84
 
@@ -147,6 +147,7 @@ function FloatingLabel({ children, floated = false, disabled = false }: InputLab
147
147
  left: 16,
148
148
  top: "50%",
149
149
  zIndex: 10,
150
+ fontFamily: fontFamilyMedium,
150
151
  },
151
152
  ]}
152
153
  className={cn(
@@ -167,7 +168,7 @@ function InputText({ invalid = false, className, ...props }: InputTextProps) {
167
168
  return (
168
169
  <Text
169
170
  className={cn(
170
- "text-xs -mt-1",
171
+ "text-xs font-medium -mt-1",
171
172
  invalid ? "text-feedback-error-foreground" : "text-gray-foreground",
172
173
  className
173
174
  )}
@@ -238,13 +239,14 @@ function InputPassword({ className, size = "lg", invalid = false, label, ...prop
238
239
  secureTextEntry={!visible}
239
240
  className={cn(
240
241
  inputVariants({ size, invalid, focused, disabled: props.editable === false }),
241
- "pl-12 pr-12",
242
+ "pl-12 pr-12 font-medium",
242
243
  className
243
244
  )}
244
245
  onFocus={() => setFocused(true)}
245
246
  onBlur={() => setFocused(false)}
246
247
  accessibilityLabel={label}
247
248
  {...props}
249
+ style={[{ fontFamily: fontFamilyMedium }, props.style]}
248
250
  />
249
251
  </View>
250
252
  <InputEndIcon>
@@ -325,11 +327,12 @@ function InputNumeric({
325
327
  className={cn(
326
328
  inputVariants({ size, invalid, focused, disabled: !editable }),
327
329
  iconLeft ? "pl-12" : "",
328
- "pr-12",
330
+ "pr-12 font-medium",
329
331
  className
330
332
  )}
331
333
  accessibilityLabel={label}
332
334
  {...props}
335
+ style={[{ fontFamily: fontFamilyMedium }, props.style]}
333
336
  />
334
337
  </View>
335
338
  <InputEndIcon>
@@ -454,10 +457,12 @@ function Input({
454
457
  inputVariants({ size, invalid, focused, disabled: !editable }),
455
458
  resolvedIconLeft ? "pl-12" : "",
456
459
  resolvedIconRight ? "pr-12" : "",
460
+ "font-medium",
457
461
  className
458
462
  )}
459
463
  accessibilityLabel={label}
460
464
  {...props}
465
+ style={[{ fontFamily: fontFamilyMedium }, props.style]}
461
466
  />
462
467
  </View>
463
468
  {resolvedIconRight && (
@@ -0,0 +1,240 @@
1
+ import { type ReactNode } from "react";
2
+ import { View, type ViewProps } from "react-native";
3
+
4
+ import { Text } from "@/components/Text";
5
+ import * as PopoverPrimitive from "@rn-primitives/popover";
6
+ import { CloseMd } from "@medway-ui/icons/native";
7
+
8
+ import { Button } from "@/components/Button";
9
+ import { Input } from "@/components/Input";
10
+ import { Separator } from "@/components/Separator";
11
+ import { cn } from "@/lib/utils";
12
+
13
+ interface InvitePopoverProps extends PopoverPrimitive.RootProps {
14
+ children?: ReactNode;
15
+ }
16
+
17
+ interface InvitePopoverTriggerProps extends PopoverPrimitive.TriggerProps {
18
+ children?: ReactNode;
19
+ className?: string;
20
+ }
21
+
22
+ interface InvitePopoverContentProps extends PopoverPrimitive.ContentProps {
23
+ className?: string;
24
+ children?: ReactNode;
25
+ align?: "start" | "center" | "end";
26
+ sideOffset?: number;
27
+ }
28
+
29
+ interface InvitePopoverEmailRowProps extends ViewProps {
30
+ value?: string;
31
+ defaultValue?: string;
32
+ onChangeText?: (value: string) => void;
33
+ onAddPress?: () => void;
34
+ addIcon?: ReactNode;
35
+ placeholder?: string;
36
+ label?: string;
37
+ }
38
+
39
+ interface InvitePopoverActionProps extends ViewProps {
40
+ children?: ReactNode;
41
+ iconLeft?: ReactNode;
42
+ iconRight?: ReactNode;
43
+ onPress?: () => void;
44
+ loading?: boolean;
45
+ disabled?: boolean;
46
+ }
47
+
48
+ function InvitePopover({ children, ...props }: InvitePopoverProps) {
49
+ return <PopoverPrimitive.Root {...props}>{children}</PopoverPrimitive.Root>;
50
+ }
51
+
52
+ function InvitePopoverTrigger({
53
+ className,
54
+ children,
55
+ ...props
56
+ }: InvitePopoverTriggerProps) {
57
+ return (
58
+ <PopoverPrimitive.Trigger className={cn(className)} {...props}>
59
+ {children}
60
+ </PopoverPrimitive.Trigger>
61
+ );
62
+ }
63
+
64
+ function InvitePopoverContent({
65
+ className,
66
+ align = "end",
67
+ sideOffset = 8,
68
+ children,
69
+ ...props
70
+ }: InvitePopoverContentProps) {
71
+ return (
72
+ <PopoverPrimitive.Portal>
73
+ <PopoverPrimitive.Overlay className="absolute inset-0" />
74
+ <PopoverPrimitive.Content
75
+ align={align}
76
+ sideOffset={sideOffset}
77
+ className={cn(
78
+ "z-50 w-[min(370px,100vw-2rem)] border-0 bg-transparent p-0 shadow-none",
79
+ className
80
+ )}
81
+ {...props}
82
+ >
83
+ {children}
84
+ </PopoverPrimitive.Content>
85
+ </PopoverPrimitive.Portal>
86
+ );
87
+ }
88
+
89
+ function InvitePopoverClose({ className, ...props }: PopoverPrimitive.CloseProps) {
90
+ return (
91
+ <PopoverPrimitive.Close
92
+ className={cn(
93
+ "mb-4 size-12 items-center justify-center self-end rounded-pill bg-primary-background-fill active:bg-primary-background-fill-emphasis",
94
+ className
95
+ )}
96
+ accessibilityLabel="Fechar"
97
+ {...props}
98
+ >
99
+ <View className="size-6">
100
+ <CloseMd width={24} height={24} color="#FFFFFF" strokeWidth={2.2} />
101
+ </View>
102
+ </PopoverPrimitive.Close>
103
+ );
104
+ }
105
+
106
+ function InvitePopoverCard({ className, children, ...props }: ViewProps) {
107
+ return (
108
+ <View
109
+ className={cn(
110
+ "gap-6 rounded-lg border border-gray-stroke-muted bg-gray-foreground-onfill p-4",
111
+ className
112
+ )}
113
+ {...props}
114
+ >
115
+ {children}
116
+ </View>
117
+ );
118
+ }
119
+
120
+ function InvitePopoverTitle({ className, children, ...props }: ViewProps) {
121
+ return (
122
+ <Text
123
+ className={cn("text-title-xs font-semibold text-primary-foreground", className)}
124
+ {...props}
125
+ >
126
+ {children}
127
+ </Text>
128
+ );
129
+ }
130
+
131
+ function InvitePopoverEmailRow({
132
+ className,
133
+ value,
134
+ defaultValue,
135
+ onChangeText,
136
+ onAddPress,
137
+ addIcon,
138
+ placeholder = "usuario@mail.com",
139
+ label = "Digite um e-mail",
140
+ ...props
141
+ }: InvitePopoverEmailRowProps) {
142
+ return (
143
+ <View className={cn("gap-2", className)} {...props}>
144
+ <Text className="pb-2 text-sm font-medium text-gray-foreground">{label}</Text>
145
+ <View className="flex-row items-end gap-4">
146
+ <View className="min-w-0 flex-1">
147
+ <Input
148
+ type="email"
149
+ size="lg"
150
+ value={value}
151
+ defaultValue={defaultValue}
152
+ onChangeText={onChangeText}
153
+ placeholder={placeholder}
154
+ keyboardType="email-address"
155
+ autoCapitalize="none"
156
+ autoCorrect={false}
157
+ />
158
+ </View>
159
+ {onAddPress ? (
160
+ <Button
161
+ variant="regular-soft"
162
+ size="lg"
163
+ className="size-12 min-h-12 min-w-12 max-w-12 p-0"
164
+ iconLeft={addIcon}
165
+ onPress={onAddPress}
166
+ accessibilityLabel="Adicionar e-mail"
167
+ />
168
+ ) : null}
169
+ </View>
170
+ </View>
171
+ );
172
+ }
173
+
174
+ function InvitePopoverSendButton({
175
+ className,
176
+ children = "Enviar",
177
+ iconRight,
178
+ ...props
179
+ }: InvitePopoverActionProps) {
180
+ return (
181
+ <Button
182
+ variant="regular"
183
+ size="lg"
184
+ className={cn("w-full", className)}
185
+ iconRight={iconRight}
186
+ {...props}
187
+ >
188
+ {children}
189
+ </Button>
190
+ );
191
+ }
192
+
193
+ function InvitePopoverDivider({ className, ...props }: ViewProps) {
194
+ return (
195
+ <View className={cn("flex-row items-center gap-4 py-6", className)} {...props}>
196
+ <Separator className="flex-1" />
197
+ <Text className="text-xs font-semibold text-primary-foreground">ou</Text>
198
+ <Separator className="flex-1" />
199
+ </View>
200
+ );
201
+ }
202
+
203
+ function InvitePopoverShareButton({
204
+ className,
205
+ children = "Compartilhar link",
206
+ iconLeft,
207
+ ...props
208
+ }: InvitePopoverActionProps) {
209
+ return (
210
+ <Button
211
+ variant="regular"
212
+ size="lg"
213
+ className={cn("w-full", className)}
214
+ iconLeft={iconLeft}
215
+ {...props}
216
+ >
217
+ {children}
218
+ </Button>
219
+ );
220
+ }
221
+
222
+ export {
223
+ InvitePopover,
224
+ InvitePopoverCard,
225
+ InvitePopoverClose,
226
+ InvitePopoverContent,
227
+ InvitePopoverDivider,
228
+ InvitePopoverEmailRow,
229
+ InvitePopoverSendButton,
230
+ InvitePopoverShareButton,
231
+ InvitePopoverTitle,
232
+ InvitePopoverTrigger,
233
+ };
234
+ export type {
235
+ InvitePopoverActionProps,
236
+ InvitePopoverContentProps,
237
+ InvitePopoverEmailRowProps,
238
+ InvitePopoverProps,
239
+ InvitePopoverTriggerProps,
240
+ };
@@ -1,5 +1,7 @@
1
1
  import { type ReactNode } from "react";
2
- import { Pressable, Text, type PressableProps } from "react-native";
2
+ import { Pressable, type PressableProps } from "react-native";
3
+
4
+ import { Text } from "@/components/Text";
3
5
  import { cva, type VariantProps } from "class-variance-authority";
4
6
  import { cn } from "@/lib/utils";
5
7
 
@@ -0,0 +1,70 @@
1
+ import { type ReactNode } from "react";
2
+ import { View, type ViewProps } from "react-native";
3
+
4
+ import { Text } from "@/components/Text";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ interface LeaderboardCardProps extends ViewProps {
9
+ children?: ReactNode;
10
+ }
11
+
12
+ interface LeaderboardCardHeaderProps extends ViewProps {
13
+ icon?: ReactNode;
14
+ title: string;
15
+ badge?: ReactNode;
16
+ }
17
+
18
+ function LeaderboardCard({ className, children, ...props }: LeaderboardCardProps) {
19
+ return (
20
+ <View
21
+ className={cn(
22
+ "gap-8 rounded-lg border border-gray-stroke-muted bg-surface-card p-6",
23
+ className
24
+ )}
25
+ {...props}
26
+ >
27
+ {children}
28
+ </View>
29
+ );
30
+ }
31
+
32
+ function LeaderboardCardHeader({
33
+ className,
34
+ icon,
35
+ title,
36
+ badge,
37
+ ...props
38
+ }: LeaderboardCardHeaderProps) {
39
+ return (
40
+ <View
41
+ className={cn("flex-row items-center gap-3", className)}
42
+ {...props}
43
+ >
44
+ {icon ? (
45
+ <View className="size-8 items-center justify-center rounded-full bg-gray-background-soft p-2">
46
+ {icon}
47
+ </View>
48
+ ) : null}
49
+ <View className="min-w-0 flex-1 flex-row items-center justify-between gap-2">
50
+ <Text className="text-lg font-semibold text-primary-foreground">
51
+ {title}
52
+ </Text>
53
+ {typeof badge === "string" ? (
54
+ <Text className="text-xs font-semibold text-primary-foreground">
55
+ {badge}
56
+ </Text>
57
+ ) : (
58
+ badge
59
+ )}
60
+ </View>
61
+ </View>
62
+ );
63
+ }
64
+
65
+ function LeaderboardCardList({ className, ...props }: ViewProps) {
66
+ return <View className={cn("gap-2", className)} {...props} />;
67
+ }
68
+
69
+ export { LeaderboardCard, LeaderboardCardHeader, LeaderboardCardList };
70
+ export type { LeaderboardCardHeaderProps, LeaderboardCardProps };