@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,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgProjects = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M8 6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3h1a4 4 0 0 1 4 4v6a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4v-6a4 4 0 0 1 4-4zm-3 7v3a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-5v.75c0 .69-.56 1.25-1.25 1.25h-1.5c-.69 0-1.25-.56-1.25-1.25V13zm5-7h4a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1m2 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgProjects);
21
+ export default ForwardRef;
@@ -0,0 +1,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgRecruitment = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M11.579 3.5a7.579 7.579 0 1 0 4.73 13.5l2.253 2.253a.842.842 0 0 0 1.191-1.19L17.5 15.81A7.579 7.579 0 0 0 11.578 3.5m2.32 5.65a2.15 2.15 0 1 1-4.298 0 2.15 2.15 0 0 1 4.298 0m-2.149 2.924c-1.206 0-2.27.569-3.09 1.215-.848.668-.283 1.83.798 1.83h4.584c1.081 0 1.646-1.162.797-1.83-.82-.646-1.883-1.215-3.089-1.215"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgRecruitment);
21
+ export default ForwardRef;
@@ -0,0 +1,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgReports = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M12 2.85c.36 0 .65.292.65.65v.85H20a.65.65 0 0 1 0 1.3h-.35V12A3.65 3.65 0 0 1 16 15.65h-2.43l3.89 3.89a.651.651 0 0 1-.92.92l-3.89-3.89V20a.651.651 0 0 1-1.3 0v-3.43l-3.89 3.89a.651.651 0 0 1-.92-.92l3.891-3.89h-2.43A3.65 3.65 0 0 1 4.35 12V5.65H4a.65.65 0 1 1 0-1.3h7.35V3.5a.65.65 0 0 1 .65-.65m3.96 5.69a.65.65 0 0 0-.817-.083l-.103.083L13 10.58l-1.54-1.54a.65.65 0 0 0-.817-.083l-.103.083-2 2a.65.65 0 0 0 .92.92L11 10.42l1.54 1.54a.65.65 0 0 0 .92 0l2.5-2.5.083-.102a.65.65 0 0 0-.083-.818"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgReports);
21
+ export default ForwardRef;
@@ -0,0 +1,27 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgSales = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ d="m5.172 14.086.171.171 5-5 1.75 1.75a1.768 1.768 0 0 0 2.5-2.5L11.964 5.88a3 3 0 0 0-4.242 0l-2.55 2.55a4 4 0 0 0 0 5.657"
15
+ />
16
+ <Path
17
+ fill="currentColor"
18
+ d="M13.987 6.063a2.83 2.83 0 0 1 2.856.694l1.672 1.672a4 4 0 0 1 0 5.656l-4.258 4.258a2 2 0 0 1-2.828 0l-.586-.586-.086.086a2 2 0 0 1-2.828 0c-.323-.323-.857-.29-1.305-.2a1.41 1.41 0 0 1-1.28-.386l-.25-.25a1.77 1.77 0 0 1-.467-1.667c.504.335 1.19.281 1.635-.164l4.081-4.08.831.83.115.11a3.068 3.068 0 0 0 4.333-4.333l-.11-.115z"
19
+ />
20
+ <Path
21
+ fill="currentColor"
22
+ d="m14.593 8.507.121.134a1.768 1.768 0 0 1-2.62 2.366l-1.75-1.75 2.5-2.5z"
23
+ />
24
+ </Svg>
25
+ );
26
+ const ForwardRef = forwardRef(SvgSales);
27
+ export default ForwardRef;
@@ -0,0 +1,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgSettings = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M9.752 4.372c1.038-1.662 3.458-1.662 4.496 0l.74 1.185c.238.38.65.619 1.098.634l1.396.048c1.958.068 3.168 2.164 2.248 3.894l-.656 1.233a1.35 1.35 0 0 0 0 1.268l.656 1.233c.92 1.73-.29 3.826-2.248 3.893l-1.396.049a1.35 1.35 0 0 0-1.098.634l-.74 1.185c-1.038 1.662-3.458 1.662-4.496 0l-.74-1.185a1.35 1.35 0 0 0-1.098-.634l-1.396-.049c-1.958-.067-3.168-2.163-2.248-3.893l.656-1.233a1.35 1.35 0 0 0 0-1.268l-.656-1.233c-.92-1.73.29-3.826 2.248-3.894l1.396-.048a1.35 1.35 0 0 0 1.098-.634zM12 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgSettings);
21
+ export default ForwardRef;
@@ -0,0 +1,27 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgShifts = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M5.65 5A3.65 3.65 0 0 0 2 8.65V15a3.65 3.65 0 0 0 3.65 3.65h6.98a5.8 5.8 0 0 1 7.02-8.538V8.65A3.65 3.65 0 0 0 16 5zM5 9.65A.65.65 0 0 1 5.65 9h4a.65.65 0 1 1 0 1.3h-4A.65.65 0 0 1 5 9.65M5 14a.65.65 0 0 1 .65-.65h2a.65.65 0 1 1 0 1.3h-2A.65.65 0 0 1 5 14"
16
+ clipRule="evenodd"
17
+ />
18
+ <Path
19
+ fill="currentColor"
20
+ fillRule="evenodd"
21
+ d="M17.5 11a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9m0 2.35a.65.65 0 0 1 .65.65v1.054c0 .061.03.118.082.152l1.128.753a.65.65 0 0 1-.72 1.082l-1.13-.753a1.48 1.48 0 0 1-.66-1.234V14a.65.65 0 0 1 .65-.65"
22
+ clipRule="evenodd"
23
+ />
24
+ </Svg>
25
+ );
26
+ const ForwardRef = forwardRef(SvgShifts);
27
+ export default ForwardRef;
@@ -0,0 +1,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgSocial = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M12 4.35A7.65 7.65 0 1 1 12 19.65 7.65 7.65 0 0 1 12 4.35m3.184 9.104a.876.876 0 0 0-1.23-.137 3.13 3.13 0 0 1-3.907 0 .876.876 0 0 0-1.094 1.366 4.88 4.88 0 0 0 6.094 0 .876.876 0 0 0 .137-1.23M10 9.125a.875.875 0 0 0-.875.875v1a.875.875 0 0 0 1.75 0v-1A.875.875 0 0 0 10 9.125m4 0a.875.875 0 0 0-.875.875v1a.875.875 0 0 0 1.75 0v-1A.875.875 0 0 0 14 9.125"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgSocial);
21
+ export default ForwardRef;
@@ -0,0 +1,19 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgSoftware = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ d="M3 7.5a3.6 3.6 0 0 1 3.6-3.6h10.8A3.6 3.6 0 0 1 21 7.5v5.4a3.6 3.6 0 0 1-3.6 3.6h-1.8v1.8h.9a.9.9 0 1 1 0 1.8h-9a.9.9 0 0 1 0-1.8h.9v-1.8H6.6A3.6 3.6 0 0 1 3 12.9zm3.6 7.2h10.8a1.8 1.8 0 0 0 1.8-1.8V7.5a1.8 1.8 0 0 0-1.8-1.8H6.6a1.8 1.8 0 0 0-1.8 1.8v5.4a1.8 1.8 0 0 0 1.8 1.8"
15
+ />
16
+ </Svg>
17
+ );
18
+ const ForwardRef = forwardRef(SvgSoftware);
19
+ export default ForwardRef;
@@ -0,0 +1,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgSpaces = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M10.446 3.948a3.2 3.2 0 0 1 3.108 0l4.8 2.667A3.2 3.2 0 0 1 20 9.412v5.176a3.2 3.2 0 0 1-1.646 2.797l-4.8 2.667a3.2 3.2 0 0 1-3.108 0l-4.8-2.667A3.2 3.2 0 0 1 4 14.588V9.412a3.2 3.2 0 0 1 1.646-2.797zm2.331 1.399a1.6 1.6 0 0 0-1.554 0L6.447 8 12 11.085 17.553 8zm5.622 4.013L12.8 12.47v6.17l1.6-.889v-3.236a1.6 1.6 0 0 1 .823-1.399l.388-.215a.8.8 0 0 1 1.189.699v2.818l.777-.431a1.6 1.6 0 0 0 .823-1.4V9.36"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgSpaces);
21
+ export default ForwardRef;
@@ -0,0 +1,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgSpending = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M6.667 4.889A2.667 2.667 0 0 0 4 7.6v7.956a3.555 3.555 0 0 0 3.556 3.555h8.889A3.555 3.555 0 0 0 20 15.555V12a3.56 3.56 0 0 0-2.667-3.443V7.556a2.667 2.667 0 0 0-2.667-2.667zm-.889 2.692a.89.89 0 0 0 .889.864h8.888v-.89a.89.89 0 0 0-.889-.888h-8a.89.89 0 0 0-.888.889zm11.555 6.197a1.333 1.333 0 1 1-2.666 0 1.333 1.333 0 0 1 2.666 0"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgSpending);
21
+ export default ForwardRef;
@@ -0,0 +1,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgTasks = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0m11.338-2.592a.8.8 0 0 1 .054 1.13l-4 4.4a.8.8 0 0 1-1.158.028l-1.6-1.6a.8.8 0 0 1 1.132-1.132l1.006 1.007 3.436-3.78a.8.8 0 0 1 1.13-.053"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgTasks);
21
+ export default ForwardRef;
@@ -0,0 +1,21 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgTimeOff = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M8.907 3.573c-1.102-.007-2.253.416-2.734 1.31a.89.89 0 0 0 .089.974l1.043 1.305C4.51 7.693 3.036 9.572 3 11.328c-.01.517.41.906.888.906h1.418a4.7 4.7 0 0 0-.244 3.477.888.888 0 0 0 1.244.524l3.222-1.61-.343 4.116H7.921a.843.843 0 0 0 0 1.686h8.158a.843.843 0 0 0 0-1.686h-1.264l-.343-4.117 3.222 1.611a.888.888 0 0 0 1.244-.524 4.7 4.7 0 0 0-.244-3.477h1.418a.89.89 0 0 0 .888-.906c-.036-1.757-1.51-3.635-4.305-4.166l1.043-1.305a.89.89 0 0 0 .09-.974c-.482-.894-1.633-1.317-2.735-1.31-.98.007-2.08.338-3.093 1.123-1.013-.785-2.112-1.116-3.093-1.123m3.8 10.169L12 13.388l-.707.354-.417 5h2.248z"
16
+ clipRule="evenodd"
17
+ />
18
+ </Svg>
19
+ );
20
+ const ForwardRef = forwardRef(SvgTimeOff);
21
+ export default ForwardRef;
@@ -0,0 +1,25 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgTimeTracking = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M8.85 2.05a.9.9 0 1 0 0 1.8h2.25v.95a8.101 8.101 0 1 0 1.8 0v-.95h2.25a.9.9 0 1 0 0-1.8zM12.9 9.7a.9.9 0 0 0-1.8 0v2.628a1.8 1.8 0 0 0 .907 1.563l2.697 1.54a.9.9 0 1 0 .893-1.562L12.9 12.328z"
16
+ clipRule="evenodd"
17
+ />
18
+ <Path
19
+ fill="currentColor"
20
+ d="M6.336 5.836a.9.9 0 1 0-1.272-1.272l-1.8 1.8a.9.9 0 0 0 1.272 1.272zM18.936 4.564a.9.9 0 0 0-1.272 1.272l1.8 1.8a.9.9 0 0 0 1.272-1.272z"
21
+ />
22
+ </Svg>
23
+ );
24
+ const ForwardRef = forwardRef(SvgTimeTracking);
25
+ export default ForwardRef;
@@ -0,0 +1,19 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgTrainings = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ d="M12 6.83C10.748 6.076 9.515 5.3 8.277 5.3c-1.414 0-2.715.547-3.943 1.53A.89.89 0 0 0 4 7.524v8.373c0 .765.464 1.328.998 1.615.524.282 1.198.35 1.81.094 1.354-.569 2.815-.38 4.698.88.299.199.689.199.988 0 1.883-1.26 3.344-1.449 4.699-.88.61.256 1.285.188 1.81-.094.533-.287.997-.85.997-1.615V7.524a.89.89 0 0 0-.334-.694c-1.228-.983-2.529-1.53-3.943-1.53-1.239 0-2.471.776-3.723 1.53"
15
+ />
16
+ </Svg>
17
+ );
18
+ const ForwardRef = forwardRef(SvgTrainings);
19
+ export default ForwardRef;
@@ -0,0 +1,19 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgTreasury = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ d="M11.77 3.054c.151-.036.309-.036.46 0l7.5 1.765a1 1 0 0 1 .77.973V8a1 1 0 0 1-1 1h-.85v7h.85a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h.85V9H4.5a1 1 0 0 1-1-1V5.792a1 1 0 0 1 .77-.973zM10.65 16h2.7V9h-2.7zm4 0h2.7V9h-2.7zm-8 0h2.7V9h-2.7z"
15
+ />
16
+ </Svg>
17
+ );
18
+ const ForwardRef = forwardRef(SvgTreasury);
19
+ export default ForwardRef;
@@ -0,0 +1,19 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import { Ref, forwardRef } from "react";
4
+ const SvgWorkflows = (props: SvgProps, ref: Ref<Svg>) => (
5
+ <Svg
6
+ fill="none"
7
+ viewBox="0 0 24 24"
8
+ className={props.className}
9
+ ref={ref}
10
+ {...props}
11
+ >
12
+ <Path
13
+ fill="currentColor"
14
+ d="M17.42 4.455a1.125 1.125 0 0 0-1.59 1.59l.329.33h-3.85A4.5 4.5 0 0 0 8.491 8.49l-.83 1.328a2.25 2.25 0 0 1-1.908 1.057H3.125a1.125 1.125 0 0 0 0 2.25h2.63c.775 0 1.496.4 1.907 1.057l.83 1.328a4.5 4.5 0 0 0 3.816 2.115h3.851l-.33.33a1.125 1.125 0 0 0 1.592 1.59l2.25-2.25c.439-.439.439-1.151 0-1.59l-2.25-2.25a1.125 1.125 0 0 0-1.591 1.59l.329.33h-3.85a2.25 2.25 0 0 1-1.909-1.057l-.83-1.328a4.5 4.5 0 0 0-.839-.99c.322-.284.606-.616.84-.99l.83-1.328a2.25 2.25 0 0 1 1.907-1.057h3.851l-.33.33a1.125 1.125 0 0 0 1.592 1.59l2.25-2.25c.439-.439.439-1.151 0-1.59z"
15
+ />
16
+ </Svg>
17
+ );
18
+ const ForwardRef = forwardRef(SvgWorkflows);
19
+ export default ForwardRef;
@@ -0,0 +1,35 @@
1
+ export { default as Benefits } from "./Benefits";
2
+ export { default as Calendar } from "./Calendar";
3
+ export { default as Cards } from "./Cards";
4
+ export { default as ClockIn } from "./ClockIn";
5
+ export { default as Discover } from "./Discover";
6
+ export { default as Documents } from "./Documents";
7
+ export { default as Engagement } from "./Engagement";
8
+ export { default as Finance } from "./Finance";
9
+ export { default as Goals } from "./Goals";
10
+ export { default as Home } from "./Home";
11
+ export { default as Hub } from "./Hub";
12
+ export { default as Inbox } from "./Inbox";
13
+ export { default as Kudos } from "./Kudos";
14
+ export { default as MyDocuments } from "./MyDocuments";
15
+ export { default as Organization } from "./Organization";
16
+ export { default as Overviews } from "./Overviews";
17
+ export { default as Payroll } from "./Payroll";
18
+ export { default as Performance } from "./Performance";
19
+ export { default as Profile } from "./Profile";
20
+ export { default as Projects } from "./Projects";
21
+ export { default as Recruitment } from "./Recruitment";
22
+ export { default as Reports } from "./Reports";
23
+ export { default as Sales } from "./Sales";
24
+ export { default as Settings } from "./Settings";
25
+ export { default as Shifts } from "./Shifts";
26
+ export { default as Social } from "./Social";
27
+ export { default as Software } from "./Software";
28
+ export { default as Spaces } from "./Spaces";
29
+ export { default as Spending } from "./Spending";
30
+ export { default as Tasks } from "./Tasks";
31
+ export { default as TimeOff } from "./TimeOff";
32
+ export { default as TimeTracking } from "./TimeTracking";
33
+ export { default as Trainings } from "./Trainings";
34
+ export { default as Treasury } from "./Treasury";
35
+ export { default as Workflows } from "./Workflows";
@@ -0,0 +1,9 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from "react";
2
+ import { SvgProps } from "react-native-svg";
3
+
4
+ export type IconComponent = ForwardRefExoticComponent<
5
+ SvgProps &
6
+ RefAttributes<SVGSVGElement> & {
7
+ className?: string;
8
+ }
9
+ >;
package/src/index.ts ADDED
@@ -0,0 +1,18 @@
1
+ // Export components
2
+ export * from "./components/Activity/ActivityItem";
3
+ export * from "./components/Button";
4
+ export * from "./components/ExampleComponent";
5
+ export * from "./components/Icon";
6
+ export * from "./components/Avatars/exports";
7
+ export * from "./components/Counter";
8
+ export * from "./components/OnePreset";
9
+ export * from "./components/Tags/exports";
10
+ export * from "./components/OneChip";
11
+ export * from "./components/Navigation/PageHeader";
12
+ export * from "./components/Tags/exports";
13
+ export * from "./components/experimental/Lists/DataList";
14
+ export * from "./components/experimental/Lists/DetailsItem";
15
+ export * from "./components/experimental/Lists/DetailsItemsList";
16
+
17
+ // Export icons
18
+ export * from "./icons";
@@ -0,0 +1,102 @@
1
+ import {
2
+ format,
3
+ formatDistanceToNowStrict,
4
+ differenceInDays,
5
+ isToday,
6
+ isYesterday,
7
+ startOfDay,
8
+ startOfMonth,
9
+ startOfWeek,
10
+ startOfYear,
11
+ } from "date-fns";
12
+
13
+ export function formatTime(date: Date) {
14
+ return format(date, "p");
15
+ }
16
+
17
+ export function formatTime24Hours(date: Date) {
18
+ return format(date, "HH:mm");
19
+ }
20
+
21
+ export function getAbbreviateMonth(date: Date) {
22
+ return format(date, "LLL");
23
+ }
24
+
25
+ export function getDayOfMonth(date: Date) {
26
+ return date.getDate();
27
+ }
28
+
29
+ export function getAgo(date: Date, addSuffix = true) {
30
+ return formatDistanceToNowStrict(date, { addSuffix });
31
+ }
32
+
33
+ type GetDisplayDateBasedOnDurationOptions = {
34
+ yesterdayRelative?: boolean;
35
+ };
36
+
37
+ export function getDisplayDateBasedOnDuration(
38
+ date: Date,
39
+ { yesterdayRelative = true }: GetDisplayDateBasedOnDurationOptions = {},
40
+ ) {
41
+ if (isToday(date)) {
42
+ return getAgo(date);
43
+ }
44
+
45
+ if (isYesterday(date)) {
46
+ return yesterdayRelative ? getAgo(date) : format(date, "p");
47
+ }
48
+
49
+ return format(date, "PPPp");
50
+ }
51
+
52
+ type DateGroup = "today" | "yesterday" | "lastWeek" | "lastMonth" | number;
53
+
54
+ export const categorizeItemsByDate = <
55
+ T extends Record<D, Date>,
56
+ D extends keyof T,
57
+ >(
58
+ items: T[],
59
+ dateField: D,
60
+ ) => {
61
+ const groups: Record<DateGroup, T[]> = {
62
+ today: [],
63
+ yesterday: [],
64
+ lastWeek: [],
65
+ lastMonth: [],
66
+ };
67
+
68
+ items.forEach((item) => {
69
+ const date = item[dateField];
70
+
71
+ const diffDays = Math.abs(differenceInDays(date, new Date()));
72
+
73
+ if (isToday(date)) {
74
+ groups.today.push(item);
75
+ } else if (isYesterday(date)) {
76
+ groups.yesterday.push(item);
77
+ } else if (diffDays <= 7) {
78
+ groups.lastWeek.push(item);
79
+ } else if (diffDays <= 30) {
80
+ groups.lastMonth.push(item);
81
+ } else {
82
+ groups[date.getFullYear()].push(item);
83
+ }
84
+ });
85
+
86
+ return groups;
87
+ };
88
+
89
+ export type DateGranularity = "day" | "week" | "month" | "year";
90
+ const dateGranularityFunction: Record<DateGranularity, (date: Date) => Date> = {
91
+ day: startOfDay,
92
+ month: startOfMonth,
93
+ week: startOfWeek,
94
+ year: startOfYear,
95
+ };
96
+
97
+ export function setDateGranularity(date: Date, granularity: DateGranularity) {
98
+ return (
99
+ dateGranularityFunction[granularity]?.(date) ||
100
+ new Error(`Invalid date granularity ${granularity}`)
101
+ );
102
+ }
@@ -0,0 +1,47 @@
1
+ import { Text, View } from "react-native";
2
+ import { cn } from "./utils";
3
+ import { parse } from "twemoji-parser";
4
+ import { SvgUri } from "react-native-svg";
5
+ import { useState } from "react";
6
+
7
+ interface ParseObject {
8
+ url: string;
9
+ indices: [number, number];
10
+ text: string;
11
+ }
12
+
13
+ export interface EmojiImageProps {
14
+ size?: { icon: string; text: string };
15
+ className?: string;
16
+ emoji: string;
17
+ }
18
+
19
+ export function EmojiImage({ emoji, size, className }: EmojiImageProps) {
20
+ const emojiEntity = parseEmoji(emoji);
21
+
22
+ const [error, setError] = useState(false);
23
+
24
+ return emojiEntity && !error ? (
25
+ <View className={size?.icon}>
26
+ <SvgUri
27
+ onError={() => setError(true)}
28
+ width="100%"
29
+ height="100%"
30
+ uri={emojiEntity.url}
31
+ />
32
+ </View>
33
+ ) : (
34
+ <Text className={cn(size?.text, className)} key={emoji}>
35
+ {emoji}
36
+ </Text>
37
+ );
38
+ }
39
+
40
+ const parseEmoji = (emoji: string): ParseObject | null => {
41
+ const [entity] = parse(emoji, {
42
+ buildUrl: (codePoints: string) =>
43
+ `https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/${codePoints}.svg`,
44
+ });
45
+
46
+ return entity || null;
47
+ };
@@ -0,0 +1,17 @@
1
+ import { cssInterop } from "nativewind";
2
+ import { ForwardRefExoticComponent, RefAttributes } from "react";
3
+ import { SvgProps } from "react-native-svg";
4
+
5
+ export function iconWithClassName(
6
+ icon: ForwardRefExoticComponent<SvgProps & RefAttributes<SVGSVGElement>>,
7
+ ) {
8
+ cssInterop(icon, {
9
+ className: {
10
+ target: "style",
11
+ nativeStyleToProp: {
12
+ color: true,
13
+ opacity: true,
14
+ },
15
+ },
16
+ });
17
+ }
@@ -0,0 +1,31 @@
1
+ import { useEffect } from "react";
2
+
3
+ type Rules = {
4
+ disallowEmpty?: boolean;
5
+ minLength?: number;
6
+ maxLength?: number;
7
+ };
8
+
9
+ const textFormatEnforcer = (text: string, rules: Rules) => {
10
+ if (rules.disallowEmpty && text.length === 0) {
11
+ throw Error("You need to provide some text that is not empty");
12
+ }
13
+
14
+ if (rules.maxLength !== undefined && text.length > rules.maxLength) {
15
+ throw Error(
16
+ `"${text}" should have no more than ${rules.maxLength} characters`,
17
+ );
18
+ }
19
+
20
+ if (rules.minLength !== undefined && text.length < rules.minLength) {
21
+ throw Error(`"${text}" should have at least ${rules.minLength} characters`);
22
+ }
23
+ };
24
+
25
+ export const useTextFormatEnforcer = (text?: string, rules?: Rules) => {
26
+ useEffect(() => {
27
+ if (text !== undefined && rules) {
28
+ textFormatEnforcer(text, rules);
29
+ }
30
+ }, [text, rules]);
31
+ };
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }