@factorialco/f0-react-native 0.19.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 (310) hide show
  1. package/README.md +54 -0
  2. package/package.json +84 -0
  3. package/src/components/Activity/ActivityItem/__snapshots__/index.spec.tsx.snap +62 -0
  4. package/src/components/Activity/ActivityItem/index.spec.tsx +103 -0
  5. package/src/components/Activity/ActivityItem/index.tsx +90 -0
  6. package/src/components/Avatars/Avatar.tsx +56 -0
  7. package/src/components/Avatars/BaseAvatar/index.tsx +126 -0
  8. package/src/components/Avatars/BaseAvatar/utils.ts +73 -0
  9. package/src/components/Avatars/CompanyAvatar/__snapshots__/index.spec.tsx.snap +25 -0
  10. package/src/components/Avatars/CompanyAvatar/index.spec.tsx +11 -0
  11. package/src/components/Avatars/CompanyAvatar/index.tsx +36 -0
  12. package/src/components/Avatars/DateAvatar/__snapshots__/index.spec.tsx.snap +18 -0
  13. package/src/components/Avatars/DateAvatar/index.spec.tsx +12 -0
  14. package/src/components/Avatars/DateAvatar/index.tsx +22 -0
  15. package/src/components/Avatars/EmojiAvatar/__snapshots__/index.spec.tsx.snap +37 -0
  16. package/src/components/Avatars/EmojiAvatar/index.spec.tsx +15 -0
  17. package/src/components/Avatars/EmojiAvatar/index.tsx +37 -0
  18. package/src/components/Avatars/FileAvatar/__snapshots__/index.spec.tsx.snap +261 -0
  19. package/src/components/Avatars/FileAvatar/index.spec.tsx +43 -0
  20. package/src/components/Avatars/FileAvatar/index.tsx +117 -0
  21. package/src/components/Avatars/FileAvatar/utils.ts +103 -0
  22. package/src/components/Avatars/IconAvatar/__snapshots__/index.spec.tsx.snap +256 -0
  23. package/src/components/Avatars/IconAvatar/index.spec.tsx +16 -0
  24. package/src/components/Avatars/IconAvatar/index.tsx +31 -0
  25. package/src/components/Avatars/ModuleAvatar/index.tsx +106 -0
  26. package/src/components/Avatars/ModuleAvatar/modules.ts +64 -0
  27. package/src/components/Avatars/PersonAvatar/__snapshots__/index.spec.tsx.snap +25 -0
  28. package/src/components/Avatars/PersonAvatar/index.spec.tsx +13 -0
  29. package/src/components/Avatars/PersonAvatar/index.tsx +38 -0
  30. package/src/components/Avatars/TeamAvatar/__snapshots__/index.spec.tsx.snap +25 -0
  31. package/src/components/Avatars/TeamAvatar/index.spec.tsx +11 -0
  32. package/src/components/Avatars/TeamAvatar/index.tsx +36 -0
  33. package/src/components/Avatars/exports.ts +9 -0
  34. package/src/components/Avatars/types.ts +15 -0
  35. package/src/components/Badge/index.tsx +47 -0
  36. package/src/components/Button/__snapshots__/index.spec.tsx.snap +517 -0
  37. package/src/components/Button/index.spec.tsx +124 -0
  38. package/src/components/Button/index.tsx +233 -0
  39. package/src/components/Counter/__snapshots__/index.spec.tsx.snap +113 -0
  40. package/src/components/Counter/index.spec.tsx +53 -0
  41. package/src/components/Counter/index.tsx +59 -0
  42. package/src/components/ExampleComponent.tsx +22 -0
  43. package/src/components/Icon/README.md +63 -0
  44. package/src/components/Icon/__tests__/Icon.spec.tsx +35 -0
  45. package/src/components/Icon/index.tsx +85 -0
  46. package/src/components/Navigation/PageHeader/__snapshots__/index.spec.tsx.snap +242 -0
  47. package/src/components/Navigation/PageHeader/index.spec.tsx +198 -0
  48. package/src/components/Navigation/PageHeader/index.tsx +53 -0
  49. package/src/components/OneChip/__snapshots__/index.spec.tsx.snap +366 -0
  50. package/src/components/OneChip/index.spec.tsx +69 -0
  51. package/src/components/OneChip/index.tsx +89 -0
  52. package/src/components/OnePreset/__snapshots__/index.spec.tsx.snap +149 -0
  53. package/src/components/OnePreset/index.spec.tsx +46 -0
  54. package/src/components/OnePreset/index.tsx +36 -0
  55. package/src/components/Tags/AlertTab/__snapshots__/index.spec.tsx.snap +292 -0
  56. package/src/components/Tags/AlertTab/index.spec.tsx +18 -0
  57. package/src/components/Tags/AlertTab/index.tsx +61 -0
  58. package/src/components/Tags/BaseTag/index.tsx +64 -0
  59. package/src/components/Tags/DotTag/__snapshots__/index.spec.tsx.snap +1081 -0
  60. package/src/components/Tags/DotTag/index.spec.tsx +14 -0
  61. package/src/components/Tags/DotTag/index.tsx +54 -0
  62. package/src/components/Tags/RawTag/__snapshots__/index.spec.tsx.snap +213 -0
  63. package/src/components/Tags/RawTag/index.spec.tsx +19 -0
  64. package/src/components/Tags/RawTag/index.tsx +41 -0
  65. package/src/components/Tags/Tag.tsx +32 -0
  66. package/src/components/Tags/exports.ts +3 -0
  67. package/src/components/__tests__/ExampleComponent.spec.tsx +16 -0
  68. package/src/components/experimental/Lists/DataList/ItemContainer.tsx +74 -0
  69. package/src/components/experimental/Lists/DataList/actions/CopyAction.tsx +72 -0
  70. package/src/components/experimental/Lists/DataList/actions/GenericAction.tsx +37 -0
  71. package/src/components/experimental/Lists/DataList/index.tsx +186 -0
  72. package/src/components/experimental/Lists/DetailsItem/__snapshots__/index.spec.tsx.snap +759 -0
  73. package/src/components/experimental/Lists/DetailsItem/index.spec.tsx +81 -0
  74. package/src/components/experimental/Lists/DetailsItem/index.tsx +68 -0
  75. package/src/components/experimental/Lists/DetailsItemsList/__snapshots__/index.spec.tsx.snap +671 -0
  76. package/src/components/experimental/Lists/DetailsItemsList/index.spec.tsx +73 -0
  77. package/src/components/experimental/Lists/DetailsItemsList/index.tsx +52 -0
  78. package/src/icons/app/AcademicCap.tsx +31 -0
  79. package/src/icons/app/Add.tsx +21 -0
  80. package/src/icons/app/Ai.tsx +24 -0
  81. package/src/icons/app/Alert.tsx +16 -0
  82. package/src/icons/app/AlertCircle.tsx +19 -0
  83. package/src/icons/app/AlertCircleLine.tsx +17 -0
  84. package/src/icons/app/AlignTextCenter.tsx +21 -0
  85. package/src/icons/app/AlignTextJustify.tsx +21 -0
  86. package/src/icons/app/AlignTextLeft.tsx +21 -0
  87. package/src/icons/app/AlignTextRight.tsx +21 -0
  88. package/src/icons/app/Appearance.tsx +33 -0
  89. package/src/icons/app/Archive.tsx +21 -0
  90. package/src/icons/app/ArchiveOpen.tsx +21 -0
  91. package/src/icons/app/ArrowCycle.tsx +27 -0
  92. package/src/icons/app/ArrowDown.tsx +27 -0
  93. package/src/icons/app/ArrowLeft.tsx +21 -0
  94. package/src/icons/app/ArrowRight.tsx +21 -0
  95. package/src/icons/app/ArrowUp.tsx +21 -0
  96. package/src/icons/app/Bank.tsx +20 -0
  97. package/src/icons/app/BarGraph.tsx +21 -0
  98. package/src/icons/app/Bell.tsx +24 -0
  99. package/src/icons/app/Bold.tsx +23 -0
  100. package/src/icons/app/BookOpen.tsx +21 -0
  101. package/src/icons/app/Briefcase.tsx +18 -0
  102. package/src/icons/app/Bucket.tsx +23 -0
  103. package/src/icons/app/Building.tsx +25 -0
  104. package/src/icons/app/Bullet.tsx +19 -0
  105. package/src/icons/app/Calculator.tsx +17 -0
  106. package/src/icons/app/Calendar.tsx +21 -0
  107. package/src/icons/app/CalendarArrowDown.tsx +21 -0
  108. package/src/icons/app/CalendarArrowLeft.tsx +21 -0
  109. package/src/icons/app/CalendarArrowRight.tsx +21 -0
  110. package/src/icons/app/CameraPlus.tsx +22 -0
  111. package/src/icons/app/ChartLine.tsx +26 -0
  112. package/src/icons/app/ChartPie.tsx +25 -0
  113. package/src/icons/app/Check.tsx +21 -0
  114. package/src/icons/app/CheckCircle.tsx +21 -0
  115. package/src/icons/app/CheckCircleLine.tsx +22 -0
  116. package/src/icons/app/CheckDouble.tsx +21 -0
  117. package/src/icons/app/ChevronDown.tsx +21 -0
  118. package/src/icons/app/ChevronLeft.tsx +21 -0
  119. package/src/icons/app/ChevronRight.tsx +21 -0
  120. package/src/icons/app/ChevronUp.tsx +21 -0
  121. package/src/icons/app/Circle.tsx +16 -0
  122. package/src/icons/app/Clock.tsx +22 -0
  123. package/src/icons/app/Code.tsx +21 -0
  124. package/src/icons/app/Coffee.tsx +24 -0
  125. package/src/icons/app/Comment.tsx +19 -0
  126. package/src/icons/app/Completed.tsx +21 -0
  127. package/src/icons/app/CreditCard.tsx +21 -0
  128. package/src/icons/app/Cross.tsx +21 -0
  129. package/src/icons/app/CrossedCircle.tsx +21 -0
  130. package/src/icons/app/Crown.tsx +21 -0
  131. package/src/icons/app/Delete.tsx +21 -0
  132. package/src/icons/app/Deny.tsx +21 -0
  133. package/src/icons/app/Desktop.tsx +26 -0
  134. package/src/icons/app/DollarBill.tsx +22 -0
  135. package/src/icons/app/DottedCircle.tsx +16 -0
  136. package/src/icons/app/Download.tsx +21 -0
  137. package/src/icons/app/DropdownDefault.tsx +25 -0
  138. package/src/icons/app/DropdownOpen.tsx +25 -0
  139. package/src/icons/app/Ellipsis.tsx +36 -0
  140. package/src/icons/app/EllipsisHorizontal.tsx +18 -0
  141. package/src/icons/app/Envelope.tsx +21 -0
  142. package/src/icons/app/EnvelopeOpen.tsx +23 -0
  143. package/src/icons/app/Exit.tsx +21 -0
  144. package/src/icons/app/ExternalLink.tsx +21 -0
  145. package/src/icons/app/EyeInvisible.tsx +26 -0
  146. package/src/icons/app/EyeVisible.tsx +21 -0
  147. package/src/icons/app/FaceNegative.tsx +21 -0
  148. package/src/icons/app/FaceNeutral.tsx +21 -0
  149. package/src/icons/app/FacePositive.tsx +21 -0
  150. package/src/icons/app/FaceSuperNegative.tsx +21 -0
  151. package/src/icons/app/FaceSuperPositive.tsx +21 -0
  152. package/src/icons/app/Feed.tsx +21 -0
  153. package/src/icons/app/File.tsx +21 -0
  154. package/src/icons/app/FileFilled.tsx +21 -0
  155. package/src/icons/app/Filter.tsx +19 -0
  156. package/src/icons/app/Flag.tsx +21 -0
  157. package/src/icons/app/Folder.tsx +19 -0
  158. package/src/icons/app/Folders.tsx +24 -0
  159. package/src/icons/app/Globe.tsx +26 -0
  160. package/src/icons/app/Graph.tsx +26 -0
  161. package/src/icons/app/Handshake.tsx +29 -0
  162. package/src/icons/app/Heading1.tsx +21 -0
  163. package/src/icons/app/Heading2.tsx +21 -0
  164. package/src/icons/app/Heading3.tsx +21 -0
  165. package/src/icons/app/Heart.tsx +21 -0
  166. package/src/icons/app/HoldHeart.tsx +21 -0
  167. package/src/icons/app/Home.tsx +20 -0
  168. package/src/icons/app/Hub.tsx +51 -0
  169. package/src/icons/app/Image.tsx +21 -0
  170. package/src/icons/app/InProgressTask.tsx +17 -0
  171. package/src/icons/app/Inbox.tsx +26 -0
  172. package/src/icons/app/Info.tsx +21 -0
  173. package/src/icons/app/InfoCircle.tsx +21 -0
  174. package/src/icons/app/InfoCircleLine.tsx +28 -0
  175. package/src/icons/app/Italic.tsx +21 -0
  176. package/src/icons/app/Kanban.tsx +21 -0
  177. package/src/icons/app/Laptop.tsx +20 -0
  178. package/src/icons/app/LayersFront.tsx +26 -0
  179. package/src/icons/app/Lightbulb.tsx +26 -0
  180. package/src/icons/app/Link.tsx +25 -0
  181. package/src/icons/app/LinkRemove.tsx +20 -0
  182. package/src/icons/app/List.tsx +25 -0
  183. package/src/icons/app/LockLocked.tsx +21 -0
  184. package/src/icons/app/LockUnlocked.tsx +21 -0
  185. package/src/icons/app/LogoAvatar.tsx +23 -0
  186. package/src/icons/app/LogoEruditai.tsx +19 -0
  187. package/src/icons/app/LogoTravelperk.tsx +27 -0
  188. package/src/icons/app/Masonry.tsx +19 -0
  189. package/src/icons/app/Maximize.tsx +21 -0
  190. package/src/icons/app/Megaphone.tsx +21 -0
  191. package/src/icons/app/Menu.tsx +21 -0
  192. package/src/icons/app/MessageFrown.tsx +25 -0
  193. package/src/icons/app/MessageHeart.tsx +25 -0
  194. package/src/icons/app/Messages.tsx +21 -0
  195. package/src/icons/app/Microphone.tsx +26 -0
  196. package/src/icons/app/MicrophoneNegative.tsx +26 -0
  197. package/src/icons/app/Minimize.tsx +21 -0
  198. package/src/icons/app/Minus.tsx +21 -0
  199. package/src/icons/app/Mobile.tsx +21 -0
  200. package/src/icons/app/Money.tsx +26 -0
  201. package/src/icons/app/MoneyBag.tsx +24 -0
  202. package/src/icons/app/MoveDown.tsx +44 -0
  203. package/src/icons/app/MoveTop.tsx +34 -0
  204. package/src/icons/app/MoveUp.tsx +42 -0
  205. package/src/icons/app/Office.tsx +31 -0
  206. package/src/icons/app/OlList.tsx +21 -0
  207. package/src/icons/app/PalmTree.tsx +20 -0
  208. package/src/icons/app/Paperclip.tsx +20 -0
  209. package/src/icons/app/PartiallyCompleted.tsx +21 -0
  210. package/src/icons/app/PauseCircle.tsx +21 -0
  211. package/src/icons/app/Pencil.tsx +21 -0
  212. package/src/icons/app/People.tsx +27 -0
  213. package/src/icons/app/Person.tsx +22 -0
  214. package/src/icons/app/Phone.tsx +20 -0
  215. package/src/icons/app/Pin.tsx +22 -0
  216. package/src/icons/app/PixBrazil.tsx +19 -0
  217. package/src/icons/app/Placeholder.tsx +21 -0
  218. package/src/icons/app/Plane.tsx +21 -0
  219. package/src/icons/app/Plus.tsx +21 -0
  220. package/src/icons/app/Present.tsx +31 -0
  221. package/src/icons/app/Printer.tsx +26 -0
  222. package/src/icons/app/Proyector.tsx +22 -0
  223. package/src/icons/app/Question.tsx +22 -0
  224. package/src/icons/app/Quote.tsx +21 -0
  225. package/src/icons/app/Reaction.tsx +32 -0
  226. package/src/icons/app/Receipt.tsx +20 -0
  227. package/src/icons/app/Record.tsx +17 -0
  228. package/src/icons/app/RemoveFavorite.tsx +21 -0
  229. package/src/icons/app/Replace.tsx +21 -0
  230. package/src/icons/app/Reset.tsx +27 -0
  231. package/src/icons/app/Rocket.tsx +26 -0
  232. package/src/icons/app/Salad.tsx +21 -0
  233. package/src/icons/app/Save.tsx +27 -0
  234. package/src/icons/app/Schedule.tsx +32 -0
  235. package/src/icons/app/Search.tsx +17 -0
  236. package/src/icons/app/SearchPerson.tsx +24 -0
  237. package/src/icons/app/Settings.tsx +20 -0
  238. package/src/icons/app/Share.tsx +27 -0
  239. package/src/icons/app/Sliders.tsx +22 -0
  240. package/src/icons/app/SolidPause.tsx +19 -0
  241. package/src/icons/app/SolidPlay.tsx +19 -0
  242. package/src/icons/app/SolidStop.tsx +19 -0
  243. package/src/icons/app/Sort.tsx +21 -0
  244. package/src/icons/app/Sparkles.tsx +25 -0
  245. package/src/icons/app/Spinner.tsx +20 -0
  246. package/src/icons/app/Split.tsx +21 -0
  247. package/src/icons/app/Star.tsx +21 -0
  248. package/src/icons/app/StarFilled.tsx +19 -0
  249. package/src/icons/app/Strikethrough.tsx +21 -0
  250. package/src/icons/app/Suitcase.tsx +22 -0
  251. package/src/icons/app/Table.tsx +21 -0
  252. package/src/icons/app/Target.tsx +31 -0
  253. package/src/icons/app/TextSize.tsx +21 -0
  254. package/src/icons/app/Timer.tsx +27 -0
  255. package/src/icons/app/Underline.tsx +26 -0
  256. package/src/icons/app/Upload.tsx +21 -0
  257. package/src/icons/app/Video.tsx +23 -0
  258. package/src/icons/app/VideoRecorder.tsx +31 -0
  259. package/src/icons/app/VideoRecorderNegative.tsx +22 -0
  260. package/src/icons/app/Wallet.tsx +26 -0
  261. package/src/icons/app/Warning.tsx +21 -0
  262. package/src/icons/app/WhatsappChat.tsx +23 -0
  263. package/src/icons/app/Windows.tsx +21 -0
  264. package/src/icons/app/index.ts +186 -0
  265. package/src/icons/index.ts +5 -0
  266. package/src/icons/modules/Benefits.tsx +25 -0
  267. package/src/icons/modules/Calendar.tsx +21 -0
  268. package/src/icons/modules/Cards.tsx +25 -0
  269. package/src/icons/modules/ClockIn.tsx +21 -0
  270. package/src/icons/modules/Discover.tsx +25 -0
  271. package/src/icons/modules/Documents.tsx +19 -0
  272. package/src/icons/modules/Engagement.tsx +21 -0
  273. package/src/icons/modules/Finance.tsx +21 -0
  274. package/src/icons/modules/Goals.tsx +19 -0
  275. package/src/icons/modules/Home.tsx +19 -0
  276. package/src/icons/modules/Hub.tsx +20 -0
  277. package/src/icons/modules/Inbox.tsx +19 -0
  278. package/src/icons/modules/Kudos.tsx +19 -0
  279. package/src/icons/modules/MyDocuments.tsx +21 -0
  280. package/src/icons/modules/Organization.tsx +19 -0
  281. package/src/icons/modules/Overviews.tsx +23 -0
  282. package/src/icons/modules/Payroll.tsx +25 -0
  283. package/src/icons/modules/Performance.tsx +19 -0
  284. package/src/icons/modules/Profile.tsx +19 -0
  285. package/src/icons/modules/Projects.tsx +21 -0
  286. package/src/icons/modules/Recruitment.tsx +21 -0
  287. package/src/icons/modules/Reports.tsx +21 -0
  288. package/src/icons/modules/Sales.tsx +27 -0
  289. package/src/icons/modules/Settings.tsx +21 -0
  290. package/src/icons/modules/Shifts.tsx +27 -0
  291. package/src/icons/modules/Social.tsx +21 -0
  292. package/src/icons/modules/Software.tsx +19 -0
  293. package/src/icons/modules/Spaces.tsx +21 -0
  294. package/src/icons/modules/Spending.tsx +21 -0
  295. package/src/icons/modules/Tasks.tsx +21 -0
  296. package/src/icons/modules/TimeOff.tsx +21 -0
  297. package/src/icons/modules/TimeTracking.tsx +25 -0
  298. package/src/icons/modules/Trainings.tsx +19 -0
  299. package/src/icons/modules/Treasury.tsx +19 -0
  300. package/src/icons/modules/Workflows.tsx +19 -0
  301. package/src/icons/modules/index.ts +35 -0
  302. package/src/icons/types.ts +9 -0
  303. package/src/index.ts +18 -0
  304. package/src/lib/date.ts +102 -0
  305. package/src/lib/emojis.tsx +47 -0
  306. package/src/lib/iconWithClassName.ts +17 -0
  307. package/src/lib/text.ts +31 -0
  308. package/src/lib/utils.ts +6 -0
  309. package/src/ui/avatar.tsx +113 -0
  310. package/tailwind.config.ts +19 -0
@@ -0,0 +1,36 @@
1
+ import { ComponentProps } from "react";
2
+ import { BaseAvatar } from "../BaseAvatar";
3
+ import { AvatarBadge } from "../types";
4
+
5
+ type BaseAvatarProps = ComponentProps<typeof BaseAvatar>;
6
+
7
+ type Props = {
8
+ name: string;
9
+ src?: string;
10
+ size?: BaseAvatarProps["size"];
11
+ badge?: AvatarBadge;
12
+ } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
13
+
14
+ export const TeamAvatar = ({
15
+ name,
16
+ src,
17
+ size,
18
+ "aria-label": ariaLabel,
19
+ "aria-labelledby": ariaLabelledby,
20
+ badge,
21
+ }: Props) => {
22
+ return (
23
+ <BaseAvatar
24
+ type="base"
25
+ name={name}
26
+ src={src}
27
+ size={size}
28
+ color="random"
29
+ aria-label={ariaLabel}
30
+ aria-labelledby={ariaLabelledby}
31
+ badge={badge}
32
+ />
33
+ );
34
+ };
35
+
36
+ TeamAvatar.displayName = "TeamAvatar";
@@ -0,0 +1,9 @@
1
+ export * from "./Avatar";
2
+ export * from "./CompanyAvatar";
3
+ export * from "./DateAvatar";
4
+ export * from "./EmojiAvatar";
5
+ export * from "./FileAvatar";
6
+ export * from "./IconAvatar";
7
+ export * from "./ModuleAvatar";
8
+ export * from "./PersonAvatar";
9
+ export * from "./TeamAvatar";
@@ -0,0 +1,15 @@
1
+ import { BadgeProps } from "../Badge";
2
+ import { ModuleId } from "./ModuleAvatar/modules";
3
+
4
+ export type AvatarBadge = (
5
+ | {
6
+ type: "module";
7
+ module: ModuleId;
8
+ }
9
+ | {
10
+ type: Exclude<BadgeProps["type"], undefined>;
11
+ icon: BadgeProps["icon"];
12
+ }
13
+ ) & {
14
+ tooltip?: string;
15
+ };
@@ -0,0 +1,47 @@
1
+ import { cva, type VariantProps } from "cva";
2
+ import { Icon, IconType } from "../Icon";
3
+
4
+ const badgeVariants = cva({
5
+ base: "flex shrink-0 items-center justify-center rounded-full",
6
+ variants: {
7
+ type: {
8
+ neutral: "bg-transparent text-f1-icon",
9
+ highlight: "text-f1-special-highlight",
10
+ positive: "bg-f1-background-positive-bold text-f1-foreground-inverse",
11
+ critical: "bg-f1-icon-critical text-f1-foreground-inverse",
12
+ warning: "bg-f1-background-warning-bold text-f1-foreground-inverse",
13
+ },
14
+ size: {
15
+ xs: "h-2.5 w-2.5",
16
+ sm: "h-3 w-3",
17
+ md: "h-5 w-5",
18
+ lg: "h-6 w-6",
19
+ },
20
+ },
21
+ defaultVariants: {
22
+ type: "neutral",
23
+ size: "md",
24
+ },
25
+ });
26
+
27
+ const iconSizes = {
28
+ xs: "xs",
29
+ sm: "xs",
30
+ md: "sm",
31
+ lg: "md",
32
+ } as const;
33
+
34
+ export interface BadgeProps extends VariantProps<typeof badgeVariants> {
35
+ icon: IconType;
36
+ size?: keyof typeof iconSizes;
37
+ }
38
+
39
+ export const Badge = ({ type, size = "md", icon }: BadgeProps) => {
40
+ return (
41
+ <Icon
42
+ className={badgeVariants({ type, size })}
43
+ icon={icon}
44
+ size={iconSizes[size]}
45
+ />
46
+ );
47
+ };
@@ -0,0 +1,517 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Button Snapshot - critical variant 1`] = `
4
+ <View
5
+ className="flex item-start"
6
+ >
7
+ <View
8
+ accessibilityLabel="Test Button"
9
+ accessibilityRole="button"
10
+ accessibilityState={
11
+ {
12
+ "busy": false,
13
+ "checked": undefined,
14
+ "disabled": false,
15
+ "expanded": undefined,
16
+ "selected": undefined,
17
+ }
18
+ }
19
+ accessibilityValue={
20
+ {
21
+ "max": undefined,
22
+ "min": undefined,
23
+ "now": undefined,
24
+ "text": undefined,
25
+ }
26
+ }
27
+ accessible={true}
28
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-secondary border border-f1-border h-8 rounded gap-1 px-2 sm:px-3 lg:px-4"
29
+ collapsable={false}
30
+ focusable={true}
31
+ onBlur={[Function]}
32
+ onClick={[Function]}
33
+ onFocus={[Function]}
34
+ onResponderGrant={[Function]}
35
+ onResponderMove={[Function]}
36
+ onResponderRelease={[Function]}
37
+ onResponderTerminate={[Function]}
38
+ onResponderTerminationRequest={[Function]}
39
+ onStartShouldSetResponder={[Function]}
40
+ >
41
+ <Text
42
+ className="text-base font-medium text-f1-foreground-critical"
43
+ >
44
+ Test Button
45
+ </Text>
46
+ </View>
47
+ </View>
48
+ `;
49
+
50
+ exports[`Button Snapshot - default button 1`] = `
51
+ <View
52
+ className="flex item-start"
53
+ >
54
+ <View
55
+ accessibilityLabel="Test Button"
56
+ accessibilityRole="button"
57
+ accessibilityState={
58
+ {
59
+ "busy": false,
60
+ "checked": undefined,
61
+ "disabled": false,
62
+ "expanded": undefined,
63
+ "selected": undefined,
64
+ }
65
+ }
66
+ accessibilityValue={
67
+ {
68
+ "max": undefined,
69
+ "min": undefined,
70
+ "now": undefined,
71
+ "text": undefined,
72
+ }
73
+ }
74
+ accessible={true}
75
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-8 rounded gap-1 px-2 sm:px-3 lg:px-4"
76
+ collapsable={false}
77
+ focusable={true}
78
+ onBlur={[Function]}
79
+ onClick={[Function]}
80
+ onFocus={[Function]}
81
+ onResponderGrant={[Function]}
82
+ onResponderMove={[Function]}
83
+ onResponderRelease={[Function]}
84
+ onResponderTerminate={[Function]}
85
+ onResponderTerminationRequest={[Function]}
86
+ onStartShouldSetResponder={[Function]}
87
+ >
88
+ <Text
89
+ className="text-base font-medium text-f1-foreground-inverse"
90
+ >
91
+ Test Button
92
+ </Text>
93
+ </View>
94
+ </View>
95
+ `;
96
+
97
+ exports[`Button Snapshot - different sizes 1`] = `
98
+ <View
99
+ className="flex item-start"
100
+ >
101
+ <View
102
+ accessibilityLabel="Test Button"
103
+ accessibilityRole="button"
104
+ accessibilityState={
105
+ {
106
+ "busy": false,
107
+ "checked": undefined,
108
+ "disabled": false,
109
+ "expanded": undefined,
110
+ "selected": undefined,
111
+ }
112
+ }
113
+ accessibilityValue={
114
+ {
115
+ "max": undefined,
116
+ "min": undefined,
117
+ "now": undefined,
118
+ "text": undefined,
119
+ }
120
+ }
121
+ accessible={true}
122
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-6 rounded-sm gap-1 px-2 sm:px-3 lg:px-4"
123
+ collapsable={false}
124
+ focusable={true}
125
+ onBlur={[Function]}
126
+ onClick={[Function]}
127
+ onFocus={[Function]}
128
+ onResponderGrant={[Function]}
129
+ onResponderMove={[Function]}
130
+ onResponderRelease={[Function]}
131
+ onResponderTerminate={[Function]}
132
+ onResponderTerminationRequest={[Function]}
133
+ onStartShouldSetResponder={[Function]}
134
+ >
135
+ <Text
136
+ className="text-base font-medium text-f1-foreground-inverse"
137
+ >
138
+ Test Button
139
+ </Text>
140
+ </View>
141
+ </View>
142
+ `;
143
+
144
+ exports[`Button Snapshot - different sizes 2`] = `
145
+ <View
146
+ className="flex item-start"
147
+ >
148
+ <View
149
+ accessibilityLabel="Test Button"
150
+ accessibilityRole="button"
151
+ accessibilityState={
152
+ {
153
+ "busy": false,
154
+ "checked": undefined,
155
+ "disabled": false,
156
+ "expanded": undefined,
157
+ "selected": undefined,
158
+ }
159
+ }
160
+ accessibilityValue={
161
+ {
162
+ "max": undefined,
163
+ "min": undefined,
164
+ "now": undefined,
165
+ "text": undefined,
166
+ }
167
+ }
168
+ accessible={true}
169
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-8 rounded gap-1 px-2 sm:px-3 lg:px-4"
170
+ collapsable={false}
171
+ focusable={true}
172
+ onBlur={[Function]}
173
+ onClick={[Function]}
174
+ onFocus={[Function]}
175
+ onResponderGrant={[Function]}
176
+ onResponderMove={[Function]}
177
+ onResponderRelease={[Function]}
178
+ onResponderTerminate={[Function]}
179
+ onResponderTerminationRequest={[Function]}
180
+ onStartShouldSetResponder={[Function]}
181
+ >
182
+ <Text
183
+ className="text-base font-medium text-f1-foreground-inverse"
184
+ >
185
+ Test Button
186
+ </Text>
187
+ </View>
188
+ </View>
189
+ `;
190
+
191
+ exports[`Button Snapshot - different sizes 3`] = `
192
+ <View
193
+ className="flex item-start"
194
+ >
195
+ <View
196
+ accessibilityLabel="Test Button"
197
+ accessibilityRole="button"
198
+ accessibilityState={
199
+ {
200
+ "busy": false,
201
+ "checked": undefined,
202
+ "disabled": false,
203
+ "expanded": undefined,
204
+ "selected": undefined,
205
+ }
206
+ }
207
+ accessibilityValue={
208
+ {
209
+ "max": undefined,
210
+ "min": undefined,
211
+ "now": undefined,
212
+ "text": undefined,
213
+ }
214
+ }
215
+ accessible={true}
216
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-10 rounded-md gap-1 px-2 sm:px-3 lg:px-4"
217
+ collapsable={false}
218
+ focusable={true}
219
+ onBlur={[Function]}
220
+ onClick={[Function]}
221
+ onFocus={[Function]}
222
+ onResponderGrant={[Function]}
223
+ onResponderMove={[Function]}
224
+ onResponderRelease={[Function]}
225
+ onResponderTerminate={[Function]}
226
+ onResponderTerminationRequest={[Function]}
227
+ onStartShouldSetResponder={[Function]}
228
+ >
229
+ <Text
230
+ className="text-base font-medium text-f1-foreground-inverse"
231
+ >
232
+ Test Button
233
+ </Text>
234
+ </View>
235
+ </View>
236
+ `;
237
+
238
+ exports[`Button Snapshot - disabled state 1`] = `
239
+ <View
240
+ className="flex item-start"
241
+ >
242
+ <View
243
+ accessibilityLabel="Test Button, disabled"
244
+ accessibilityRole="button"
245
+ accessibilityState={
246
+ {
247
+ "busy": false,
248
+ "checked": undefined,
249
+ "disabled": true,
250
+ "expanded": undefined,
251
+ "selected": undefined,
252
+ }
253
+ }
254
+ accessibilityValue={
255
+ {
256
+ "max": undefined,
257
+ "min": undefined,
258
+ "now": undefined,
259
+ "text": undefined,
260
+ }
261
+ }
262
+ accessible={true}
263
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-8 rounded opacity-50 gap-1 px-2 sm:px-3 lg:px-4"
264
+ collapsable={false}
265
+ focusable={true}
266
+ onBlur={[Function]}
267
+ onClick={[Function]}
268
+ onFocus={[Function]}
269
+ onResponderGrant={[Function]}
270
+ onResponderMove={[Function]}
271
+ onResponderRelease={[Function]}
272
+ onResponderTerminate={[Function]}
273
+ onResponderTerminationRequest={[Function]}
274
+ onStartShouldSetResponder={[Function]}
275
+ >
276
+ <Text
277
+ className="text-base font-medium text-f1-foreground-inverse"
278
+ >
279
+ Test Button
280
+ </Text>
281
+ </View>
282
+ </View>
283
+ `;
284
+
285
+ exports[`Button Snapshot - loading state 1`] = `
286
+ <View
287
+ className="flex item-start"
288
+ >
289
+ <View
290
+ accessibilityLabel="Test Button, disabled, loading"
291
+ accessibilityRole="button"
292
+ accessibilityState={
293
+ {
294
+ "busy": true,
295
+ "checked": undefined,
296
+ "disabled": true,
297
+ "expanded": undefined,
298
+ "selected": undefined,
299
+ }
300
+ }
301
+ accessibilityValue={
302
+ {
303
+ "max": undefined,
304
+ "min": undefined,
305
+ "now": undefined,
306
+ "text": undefined,
307
+ }
308
+ }
309
+ accessible={true}
310
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-8 rounded opacity-50 gap-1 px-2 sm:px-3 lg:px-4"
311
+ collapsable={false}
312
+ focusable={true}
313
+ onBlur={[Function]}
314
+ onClick={[Function]}
315
+ onFocus={[Function]}
316
+ onResponderGrant={[Function]}
317
+ onResponderMove={[Function]}
318
+ onResponderRelease={[Function]}
319
+ onResponderTerminate={[Function]}
320
+ onResponderTerminationRequest={[Function]}
321
+ onStartShouldSetResponder={[Function]}
322
+ >
323
+ <Text
324
+ className="text-base font-medium text-f1-foreground-inverse"
325
+ >
326
+ Test Button
327
+ </Text>
328
+ </View>
329
+ </View>
330
+ `;
331
+
332
+ exports[`Button Snapshot - outline variant 1`] = `
333
+ <View
334
+ className="flex item-start"
335
+ >
336
+ <View
337
+ accessibilityLabel="Test Button"
338
+ accessibilityRole="button"
339
+ accessibilityState={
340
+ {
341
+ "busy": false,
342
+ "checked": undefined,
343
+ "disabled": false,
344
+ "expanded": undefined,
345
+ "selected": undefined,
346
+ }
347
+ }
348
+ accessibilityValue={
349
+ {
350
+ "max": undefined,
351
+ "min": undefined,
352
+ "now": undefined,
353
+ "text": undefined,
354
+ }
355
+ }
356
+ accessible={true}
357
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-inverse-secondary border border-f1-border h-8 rounded gap-1 px-2 sm:px-3 lg:px-4"
358
+ collapsable={false}
359
+ focusable={true}
360
+ onBlur={[Function]}
361
+ onClick={[Function]}
362
+ onFocus={[Function]}
363
+ onResponderGrant={[Function]}
364
+ onResponderMove={[Function]}
365
+ onResponderRelease={[Function]}
366
+ onResponderTerminate={[Function]}
367
+ onResponderTerminationRequest={[Function]}
368
+ onStartShouldSetResponder={[Function]}
369
+ >
370
+ <Text
371
+ className="text-base font-medium text-f1-foreground"
372
+ >
373
+ Test Button
374
+ </Text>
375
+ </View>
376
+ </View>
377
+ `;
378
+
379
+ exports[`Button Snapshot - round button with hidden label 1`] = `
380
+ <View
381
+ className="flex item-start"
382
+ >
383
+ <View
384
+ accessibilityLabel="Test Button"
385
+ accessibilityRole="button"
386
+ accessibilityState={
387
+ {
388
+ "busy": false,
389
+ "checked": undefined,
390
+ "disabled": false,
391
+ "expanded": undefined,
392
+ "selected": undefined,
393
+ }
394
+ }
395
+ accessibilityValue={
396
+ {
397
+ "max": undefined,
398
+ "min": undefined,
399
+ "now": undefined,
400
+ "text": undefined,
401
+ }
402
+ }
403
+ accessible={true}
404
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-8 rounded aspect-square p-0"
405
+ collapsable={false}
406
+ focusable={true}
407
+ onBlur={[Function]}
408
+ onClick={[Function]}
409
+ onFocus={[Function]}
410
+ onResponderGrant={[Function]}
411
+ onResponderMove={[Function]}
412
+ onResponderRelease={[Function]}
413
+ onResponderTerminate={[Function]}
414
+ onResponderTerminationRequest={[Function]}
415
+ onStartShouldSetResponder={[Function]}
416
+ />
417
+ </View>
418
+ `;
419
+
420
+ exports[`Button Snapshot - with emoji 1`] = `
421
+ <View
422
+ className="flex item-start"
423
+ >
424
+ <View
425
+ accessibilityLabel="Test Button"
426
+ accessibilityRole="button"
427
+ accessibilityState={
428
+ {
429
+ "busy": false,
430
+ "checked": undefined,
431
+ "disabled": false,
432
+ "expanded": undefined,
433
+ "selected": undefined,
434
+ }
435
+ }
436
+ accessibilityValue={
437
+ {
438
+ "max": undefined,
439
+ "min": undefined,
440
+ "now": undefined,
441
+ "text": undefined,
442
+ }
443
+ }
444
+ accessible={true}
445
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-8 rounded gap-1 px-2 sm:px-3 lg:px-4"
446
+ collapsable={false}
447
+ focusable={true}
448
+ onBlur={[Function]}
449
+ onClick={[Function]}
450
+ onFocus={[Function]}
451
+ onResponderGrant={[Function]}
452
+ onResponderMove={[Function]}
453
+ onResponderRelease={[Function]}
454
+ onResponderTerminate={[Function]}
455
+ onResponderTerminationRequest={[Function]}
456
+ onStartShouldSetResponder={[Function]}
457
+ >
458
+ <Text
459
+ className="text-base font-medium text-f1-foreground-inverse"
460
+ >
461
+ 👋
462
+ </Text>
463
+ <Text
464
+ className="text-base font-medium text-f1-foreground-inverse"
465
+ >
466
+ Test Button
467
+ </Text>
468
+ </View>
469
+ </View>
470
+ `;
471
+
472
+ exports[`Button Snapshot - with icon 1`] = `
473
+ <View
474
+ className="flex item-start"
475
+ >
476
+ <View
477
+ accessibilityLabel="Test Button"
478
+ accessibilityRole="button"
479
+ accessibilityState={
480
+ {
481
+ "busy": false,
482
+ "checked": undefined,
483
+ "disabled": false,
484
+ "expanded": undefined,
485
+ "selected": undefined,
486
+ }
487
+ }
488
+ accessibilityValue={
489
+ {
490
+ "max": undefined,
491
+ "min": undefined,
492
+ "now": undefined,
493
+ "text": undefined,
494
+ }
495
+ }
496
+ accessible={true}
497
+ className="flex-row items-center justify-center border-none grow-0 bg-f1-background-accent-bold h-8 rounded gap-1 px-2 sm:px-3 lg:px-4"
498
+ collapsable={false}
499
+ focusable={true}
500
+ onBlur={[Function]}
501
+ onClick={[Function]}
502
+ onFocus={[Function]}
503
+ onResponderGrant={[Function]}
504
+ onResponderMove={[Function]}
505
+ onResponderRelease={[Function]}
506
+ onResponderTerminate={[Function]}
507
+ onResponderTerminationRequest={[Function]}
508
+ onStartShouldSetResponder={[Function]}
509
+ >
510
+ <Text
511
+ className="text-base font-medium text-f1-foreground-inverse"
512
+ >
513
+ Test Button
514
+ </Text>
515
+ </View>
516
+ </View>
517
+ `;