create-du-app 0.1.2 → 0.1.4

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 (421) hide show
  1. package/README.md +56 -36
  2. package/package.json +6 -5
  3. package/src/generate.js +246 -15
  4. package/src/index.js +8 -8
  5. package/src/prompts.js +1 -1
  6. package/src/registry.js +3 -1
  7. package/templates/mobile/expo/.env.example +5 -0
  8. package/templates/mobile/expo/.eslintrc.js +7 -0
  9. package/templates/mobile/expo/.prettierrc.js +7 -0
  10. package/templates/mobile/expo/.svgrrc.js +9 -0
  11. package/templates/mobile/expo/README.md +42 -7
  12. package/templates/mobile/expo/_gitignore +20 -0
  13. package/templates/mobile/expo/_package.json +62 -1
  14. package/templates/mobile/expo/app.json +18 -0
  15. package/templates/mobile/expo/babel.config.js +21 -0
  16. package/templates/mobile/expo/index.js +5 -0
  17. package/templates/mobile/expo/metro.config.js +31 -0
  18. package/templates/mobile/expo/src/app/App.tsx +24 -0
  19. package/templates/mobile/expo/src/app/app-provider.tsx +36 -0
  20. package/templates/mobile/expo/src/app/config/translation.ts +26 -0
  21. package/templates/mobile/expo/src/app/index.ts +1 -0
  22. package/templates/mobile/expo/src/app/navigation/app-route-type.ts +27 -0
  23. package/templates/mobile/expo/src/app/navigation/bottom-tabs.tsx +34 -0
  24. package/templates/mobile/expo/src/app/navigation/index.tsx +14 -0
  25. package/templates/mobile/expo/src/app/stores/auth.store.ts +33 -0
  26. package/templates/mobile/expo/src/app/stores/common.store.ts +19 -0
  27. package/templates/mobile/expo/src/app/stores/index.ts +3 -0
  28. package/templates/mobile/expo/src/app/stores/loading.store.ts +22 -0
  29. package/templates/mobile/expo/src/assets/Images/empty-list.png +0 -0
  30. package/templates/mobile/expo/src/assets/Images/index.ts +5 -0
  31. package/templates/mobile/expo/src/assets/Images/screen-bg-gradian.png +0 -0
  32. package/templates/mobile/expo/src/assets/i18n/en.json +12 -0
  33. package/templates/mobile/expo/src/assets/i18n/fr.json +12 -0
  34. package/templates/mobile/expo/src/assets/lotties/index.ts +3 -0
  35. package/templates/mobile/expo/src/assets/lotties/loading.json +1 -0
  36. package/templates/mobile/expo/src/assets/svgs/arrow-left.svg +3 -0
  37. package/templates/mobile/expo/src/assets/svgs/arrow-right.svg +3 -0
  38. package/templates/mobile/expo/src/assets/svgs/calendar.svg +12 -0
  39. package/templates/mobile/expo/src/assets/svgs/check.svg +3 -0
  40. package/templates/mobile/expo/src/assets/svgs/close.svg +3 -0
  41. package/templates/mobile/expo/src/assets/svgs/eye-hide.svg +3 -0
  42. package/templates/mobile/expo/src/assets/svgs/eye.svg +4 -0
  43. package/templates/mobile/expo/src/assets/svgs/index.ts +29 -0
  44. package/templates/mobile/expo/src/assets/svgs/minus.svg +3 -0
  45. package/templates/mobile/expo/src/assets/svgs/plus.svg +3 -0
  46. package/templates/mobile/expo/src/assets/svgs/search.svg +3 -0
  47. package/templates/mobile/expo/src/assets/svgs/toast-error.svg +5 -0
  48. package/templates/mobile/expo/src/assets/svgs/toast-success.svg +4 -0
  49. package/templates/mobile/expo/src/core/api/endpoints.ts +8 -0
  50. package/templates/mobile/expo/src/core/api/example.api.ts +53 -0
  51. package/templates/mobile/expo/src/core/api/index.ts +4 -0
  52. package/templates/mobile/expo/src/core/components/common/index.ts +1 -0
  53. package/templates/mobile/expo/src/core/components/common/list-empty/index.ts +2 -0
  54. package/templates/mobile/expo/src/core/components/common/list-empty/list-empty.tsx +30 -0
  55. package/templates/mobile/expo/src/core/components/common/list-empty/list-empty.type.ts +5 -0
  56. package/templates/mobile/expo/src/core/components/forms/hf-date-time.tsx +301 -0
  57. package/templates/mobile/expo/src/core/components/forms/hf-password-input.tsx +153 -0
  58. package/templates/mobile/expo/src/core/components/forms/hf-text-input.tsx +59 -0
  59. package/templates/mobile/expo/src/core/components/forms/hf-time-picker.tsx +117 -0
  60. package/templates/mobile/expo/src/core/components/forms/index.ts +4 -0
  61. package/templates/mobile/expo/src/core/components/index.ts +5 -0
  62. package/templates/mobile/expo/src/core/components/loading/index.ts +1 -0
  63. package/templates/mobile/expo/src/core/components/loading/loading-app/index.ts +1 -0
  64. package/templates/mobile/expo/src/core/components/loading/loading-app/loading-app.tsx +50 -0
  65. package/templates/mobile/expo/src/core/components/offline/index.ts +1 -0
  66. package/templates/mobile/expo/src/core/components/offline/offline-banner.tsx +186 -0
  67. package/templates/mobile/expo/src/core/components/screen/index.ts +1 -0
  68. package/templates/mobile/expo/src/core/components/screen/screen-container/index.ts +1 -0
  69. package/templates/mobile/expo/src/core/components/screen/screen-container/screen-container.tsx +252 -0
  70. package/templates/mobile/expo/src/core/components/splash/index.ts +1 -0
  71. package/templates/mobile/expo/src/core/components/splash/splash-overlay/index.ts +1 -0
  72. package/templates/mobile/expo/src/core/components/splash/splash-overlay/splash-overlay.tsx +93 -0
  73. package/templates/mobile/expo/src/core/components/ui/animated-list-item/animated-list-item.tsx +48 -0
  74. package/templates/mobile/expo/src/core/components/ui/animated-list-item/animated-list-item.type.ts +10 -0
  75. package/templates/mobile/expo/src/core/components/ui/animated-list-item/index.ts +2 -0
  76. package/templates/mobile/expo/src/core/components/ui/app-image/app-image.tsx +104 -0
  77. package/templates/mobile/expo/src/core/components/ui/app-image/app-image.type.ts +19 -0
  78. package/templates/mobile/expo/src/core/components/ui/app-image/index.ts +2 -0
  79. package/templates/mobile/expo/src/core/components/ui/asset-placeholder/asset-placeholder.tsx +76 -0
  80. package/templates/mobile/expo/src/core/components/ui/asset-placeholder/index.ts +1 -0
  81. package/templates/mobile/expo/src/core/components/ui/avatar-image/avatar-image.tsx +90 -0
  82. package/templates/mobile/expo/src/core/components/ui/avatar-image/index.ts +1 -0
  83. package/templates/mobile/expo/src/core/components/ui/bottom-sheet/bottom-sheet.tsx +145 -0
  84. package/templates/mobile/expo/src/core/components/ui/bottom-sheet/bottom-sheet.type.ts +10 -0
  85. package/templates/mobile/expo/src/core/components/ui/bottom-sheet/index.ts +2 -0
  86. package/templates/mobile/expo/src/core/components/ui/button/button.style.ts +146 -0
  87. package/templates/mobile/expo/src/core/components/ui/button/button.tsx +97 -0
  88. package/templates/mobile/expo/src/core/components/ui/button/button.type.ts +47 -0
  89. package/templates/mobile/expo/src/core/components/ui/button/index.ts +4 -0
  90. package/templates/mobile/expo/src/core/components/ui/checkbox/checkbox.tsx +127 -0
  91. package/templates/mobile/expo/src/core/components/ui/checkbox/checkbox.type.ts +24 -0
  92. package/templates/mobile/expo/src/core/components/ui/checkbox/index.ts +2 -0
  93. package/templates/mobile/expo/src/core/components/ui/collapsible-section/collapsible-section.tsx +141 -0
  94. package/templates/mobile/expo/src/core/components/ui/collapsible-section/collapsible-section.type.ts +10 -0
  95. package/templates/mobile/expo/src/core/components/ui/collapsible-section/index.ts +2 -0
  96. package/templates/mobile/expo/src/core/components/ui/components.registry.json +313 -0
  97. package/templates/mobile/expo/src/core/components/ui/field/field-frame.tsx +62 -0
  98. package/templates/mobile/expo/src/core/components/ui/field/field.shared.ts +31 -0
  99. package/templates/mobile/expo/src/core/components/ui/header/header.tsx +196 -0
  100. package/templates/mobile/expo/src/core/components/ui/header/header.type.ts +30 -0
  101. package/templates/mobile/expo/src/core/components/ui/header/index.ts +2 -0
  102. package/templates/mobile/expo/src/core/components/ui/icon-button/icon-button.style.ts +23 -0
  103. package/templates/mobile/expo/src/core/components/ui/icon-button/icon-button.tsx +66 -0
  104. package/templates/mobile/expo/src/core/components/ui/icon-button/icon-button.type.ts +25 -0
  105. package/templates/mobile/expo/src/core/components/ui/icon-button/index.ts +2 -0
  106. package/templates/mobile/expo/src/core/components/ui/image-slider/image-slider.tsx +107 -0
  107. package/templates/mobile/expo/src/core/components/ui/image-slider/image-slider.type.ts +10 -0
  108. package/templates/mobile/expo/src/core/components/ui/image-slider/index.ts +2 -0
  109. package/templates/mobile/expo/src/core/components/ui/index.ts +25 -0
  110. package/templates/mobile/expo/src/core/components/ui/label/index.ts +2 -0
  111. package/templates/mobile/expo/src/core/components/ui/label/label.tsx +36 -0
  112. package/templates/mobile/expo/src/core/components/ui/label/label.type.ts +12 -0
  113. package/templates/mobile/expo/src/core/components/ui/modal/index.ts +2 -0
  114. package/templates/mobile/expo/src/core/components/ui/modal/modal.tsx +62 -0
  115. package/templates/mobile/expo/src/core/components/ui/modal/modal.type.ts +11 -0
  116. package/templates/mobile/expo/src/core/components/ui/otp-input/index.ts +2 -0
  117. package/templates/mobile/expo/src/core/components/ui/otp-input/otp-input.tsx +129 -0
  118. package/templates/mobile/expo/src/core/components/ui/otp-input/otp-input.type.ts +20 -0
  119. package/templates/mobile/expo/src/core/components/ui/page-dots/index.ts +1 -0
  120. package/templates/mobile/expo/src/core/components/ui/page-dots/page-dots.tsx +60 -0
  121. package/templates/mobile/expo/src/core/components/ui/radio/index.ts +2 -0
  122. package/templates/mobile/expo/src/core/components/ui/radio/radio.tsx +121 -0
  123. package/templates/mobile/expo/src/core/components/ui/radio/radio.type.ts +20 -0
  124. package/templates/mobile/expo/src/core/components/ui/screen/index.ts +1 -0
  125. package/templates/mobile/expo/src/core/components/ui/screen/screen-gradient.tsx +33 -0
  126. package/templates/mobile/expo/src/core/components/ui/search-box/index.ts +2 -0
  127. package/templates/mobile/expo/src/core/components/ui/search-box/search-box.tsx +162 -0
  128. package/templates/mobile/expo/src/core/components/ui/search-box/search-box.type.ts +26 -0
  129. package/templates/mobile/expo/src/core/components/ui/segmented-control/index.ts +2 -0
  130. package/templates/mobile/expo/src/core/components/ui/segmented-control/segmented-control.tsx +86 -0
  131. package/templates/mobile/expo/src/core/components/ui/segmented-control/segmented-control.type.ts +22 -0
  132. package/templates/mobile/expo/src/core/components/ui/skeleton/index.ts +2 -0
  133. package/templates/mobile/expo/src/core/components/ui/skeleton/skeleton.tsx +106 -0
  134. package/templates/mobile/expo/src/core/components/ui/skeleton/skeleton.type.ts +8 -0
  135. package/templates/mobile/expo/src/core/components/ui/success-state/index.ts +1 -0
  136. package/templates/mobile/expo/src/core/components/ui/success-state/success-state.tsx +68 -0
  137. package/templates/mobile/expo/src/core/components/ui/tabs/index.ts +2 -0
  138. package/templates/mobile/expo/src/core/components/ui/tabs/tabs.tsx +273 -0
  139. package/templates/mobile/expo/src/core/components/ui/tabs/tabs.type.ts +21 -0
  140. package/templates/mobile/expo/src/core/components/ui/tag-input/index.ts +2 -0
  141. package/templates/mobile/expo/src/core/components/ui/tag-input/tag-input.tsx +146 -0
  142. package/templates/mobile/expo/src/core/components/ui/tag-input/tag-input.type.ts +22 -0
  143. package/templates/mobile/expo/src/core/components/ui/text-area/index.ts +2 -0
  144. package/templates/mobile/expo/src/core/components/ui/text-area/text-area.tsx +90 -0
  145. package/templates/mobile/expo/src/core/components/ui/text-area/text-area.type.ts +20 -0
  146. package/templates/mobile/expo/src/core/components/ui/text-field/index.ts +2 -0
  147. package/templates/mobile/expo/src/core/components/ui/text-field/text-field.tsx +116 -0
  148. package/templates/mobile/expo/src/core/components/ui/text-field/text-field.type.ts +21 -0
  149. package/templates/mobile/expo/src/core/components/ui/toggle/index.ts +2 -0
  150. package/templates/mobile/expo/src/core/components/ui/toggle/toggle.tsx +110 -0
  151. package/templates/mobile/expo/src/core/components/ui/toggle/toggle.type.ts +19 -0
  152. package/templates/mobile/expo/src/core/constants/external-urls.constant.ts +5 -0
  153. package/templates/mobile/expo/src/core/constants/hard-data.constant.ts +0 -0
  154. package/templates/mobile/expo/src/core/constants/index.ts +2 -0
  155. package/templates/mobile/expo/src/core/constants/type.constant.ts +3 -0
  156. package/templates/mobile/expo/src/core/context/index.ts +1 -0
  157. package/templates/mobile/expo/src/core/context/shared-transition-context.tsx +35 -0
  158. package/templates/mobile/expo/src/core/hook/index.ts +8 -0
  159. package/templates/mobile/expo/src/core/hook/useActiveRouteName.ts +63 -0
  160. package/templates/mobile/expo/src/core/hook/useAppNavigation.tsx +7 -0
  161. package/templates/mobile/expo/src/core/hook/useBottomInset.tsx +26 -0
  162. package/templates/mobile/expo/src/core/hook/useDebounce.tsx +16 -0
  163. package/templates/mobile/expo/src/core/hook/useEndReached.tsx +46 -0
  164. package/templates/mobile/expo/src/core/hook/useManualRefetch.ts +56 -0
  165. package/templates/mobile/expo/src/core/hook/useNetworkStatus.ts +68 -0
  166. package/templates/mobile/expo/src/core/hook/useTimeout.tsx +30 -0
  167. package/templates/mobile/expo/src/core/index.ts +7 -0
  168. package/templates/mobile/expo/src/core/services/api.service.ts +230 -0
  169. package/templates/mobile/expo/src/core/services/device-id.service.ts +23 -0
  170. package/templates/mobile/expo/src/core/services/index.ts +3 -0
  171. package/templates/mobile/expo/src/core/services/session-end.bridge.ts +26 -0
  172. package/templates/mobile/expo/src/core/theme/dark.theme.ts +10 -0
  173. package/templates/mobile/expo/src/core/theme/index.ts +5 -0
  174. package/templates/mobile/expo/src/core/theme/light.theme.ts +44 -0
  175. package/templates/mobile/expo/src/core/theme/theme-context.tsx +82 -0
  176. package/templates/mobile/expo/src/core/theme/theme.types.ts +26 -0
  177. package/templates/mobile/expo/src/core/theme/use-themed-styles.ts +25 -0
  178. package/templates/mobile/expo/src/core/utils/color.util.tsx +198 -0
  179. package/templates/mobile/expo/src/core/utils/date.util.ts +97 -0
  180. package/templates/mobile/expo/src/core/utils/device-locale.util.ts +22 -0
  181. package/templates/mobile/expo/src/core/utils/emitter/index.ts +161 -0
  182. package/templates/mobile/expo/src/core/utils/emitter/type.ts +40 -0
  183. package/templates/mobile/expo/src/core/utils/enum.util.tsx +15 -0
  184. package/templates/mobile/expo/src/core/utils/font.util.tsx +42 -0
  185. package/templates/mobile/expo/src/core/utils/func.util.ts +48 -0
  186. package/templates/mobile/expo/src/core/utils/greeting.util.ts +20 -0
  187. package/templates/mobile/expo/src/core/utils/image-format.util.ts +117 -0
  188. package/templates/mobile/expo/src/core/utils/image-picker.util.ts +84 -0
  189. package/templates/mobile/expo/src/core/utils/index.ts +18 -0
  190. package/templates/mobile/expo/src/core/utils/linking.util.ts +16 -0
  191. package/templates/mobile/expo/src/core/utils/navigation.util.tsx +100 -0
  192. package/templates/mobile/expo/src/core/utils/number-format.ts +28 -0
  193. package/templates/mobile/expo/src/core/utils/query-client.util.ts +35 -0
  194. package/templates/mobile/expo/src/core/utils/query-persister.util.ts +36 -0
  195. package/templates/mobile/expo/src/core/utils/schema.util.tsx +2713 -0
  196. package/templates/mobile/expo/src/core/utils/size.util.tsx +74 -0
  197. package/templates/mobile/expo/src/core/utils/storage.util.tsx +53 -0
  198. package/templates/mobile/expo/src/core/utils/toast.util.tsx +151 -0
  199. package/templates/mobile/expo/src/core/utils/translator.util.tsx +23 -0
  200. package/templates/mobile/expo/src/core/utils/typography.util.tsx +69 -0
  201. package/templates/mobile/expo/src/core/utils/validate.util.tsx +13 -0
  202. package/templates/mobile/expo/src/declarations.d.ts +54 -0
  203. package/templates/mobile/expo/src/modules/home/home.screen.tsx +33 -0
  204. package/templates/mobile/expo/src/modules/profile/profile.screen.tsx +29 -0
  205. package/templates/mobile/expo/src/scripts/link-fonts.js +60 -0
  206. package/templates/mobile/expo/src/scripts/sync-images.js +56 -0
  207. package/templates/mobile/expo/src/scripts/sync-svgs.js +50 -0
  208. package/templates/mobile/expo/src/types/models.d.ts +24 -0
  209. package/templates/mobile/expo/tsconfig.json +19 -0
  210. package/templates/mobile/rn/.env.example +5 -0
  211. package/templates/mobile/rn/.eslintrc.js +7 -0
  212. package/templates/mobile/rn/.prettierrc.js +7 -0
  213. package/templates/mobile/rn/.svgrrc.js +9 -0
  214. package/templates/mobile/rn/README.md +40 -7
  215. package/templates/mobile/rn/_gitignore +24 -0
  216. package/templates/mobile/rn/_package.json +67 -1
  217. package/templates/mobile/rn/app.json +4 -0
  218. package/templates/mobile/rn/babel.config.js +18 -0
  219. package/templates/mobile/rn/index.js +8 -0
  220. package/templates/mobile/rn/metro.config.js +33 -0
  221. package/templates/mobile/rn/src/app/App.tsx +24 -0
  222. package/templates/mobile/rn/src/app/app-provider.tsx +36 -0
  223. package/templates/mobile/rn/src/app/config/translation.ts +26 -0
  224. package/templates/mobile/rn/src/app/index.ts +1 -0
  225. package/templates/mobile/rn/src/app/navigation/app-route-type.ts +27 -0
  226. package/templates/mobile/rn/src/app/navigation/bottom-tabs.tsx +34 -0
  227. package/templates/mobile/rn/src/app/navigation/index.tsx +14 -0
  228. package/templates/mobile/rn/src/app/stores/auth.store.ts +33 -0
  229. package/templates/mobile/rn/src/app/stores/common.store.ts +19 -0
  230. package/templates/mobile/rn/src/app/stores/index.ts +3 -0
  231. package/templates/mobile/rn/src/app/stores/loading.store.ts +22 -0
  232. package/templates/mobile/rn/src/assets/Images/empty-list.png +0 -0
  233. package/templates/mobile/rn/src/assets/Images/index.ts +5 -0
  234. package/templates/mobile/rn/src/assets/Images/screen-bg-gradian.png +0 -0
  235. package/templates/mobile/rn/src/assets/i18n/en.json +12 -0
  236. package/templates/mobile/rn/src/assets/i18n/fr.json +12 -0
  237. package/templates/mobile/rn/src/assets/lotties/index.ts +3 -0
  238. package/templates/mobile/rn/src/assets/lotties/loading.json +1 -0
  239. package/templates/mobile/rn/src/assets/svgs/arrow-left.svg +3 -0
  240. package/templates/mobile/rn/src/assets/svgs/arrow-right.svg +3 -0
  241. package/templates/mobile/rn/src/assets/svgs/calendar.svg +12 -0
  242. package/templates/mobile/rn/src/assets/svgs/check.svg +3 -0
  243. package/templates/mobile/rn/src/assets/svgs/close.svg +3 -0
  244. package/templates/mobile/rn/src/assets/svgs/eye-hide.svg +3 -0
  245. package/templates/mobile/rn/src/assets/svgs/eye.svg +4 -0
  246. package/templates/mobile/rn/src/assets/svgs/index.ts +29 -0
  247. package/templates/mobile/rn/src/assets/svgs/minus.svg +3 -0
  248. package/templates/mobile/rn/src/assets/svgs/plus.svg +3 -0
  249. package/templates/mobile/rn/src/assets/svgs/search.svg +3 -0
  250. package/templates/mobile/rn/src/assets/svgs/toast-error.svg +5 -0
  251. package/templates/mobile/rn/src/assets/svgs/toast-success.svg +4 -0
  252. package/templates/mobile/rn/src/core/api/endpoints.ts +8 -0
  253. package/templates/mobile/rn/src/core/api/example.api.ts +53 -0
  254. package/templates/mobile/rn/src/core/api/index.ts +4 -0
  255. package/templates/mobile/rn/src/core/components/common/index.ts +1 -0
  256. package/templates/mobile/rn/src/core/components/common/list-empty/index.ts +2 -0
  257. package/templates/mobile/rn/src/core/components/common/list-empty/list-empty.tsx +30 -0
  258. package/templates/mobile/rn/src/core/components/common/list-empty/list-empty.type.ts +5 -0
  259. package/templates/mobile/rn/src/core/components/forms/hf-date-time.tsx +301 -0
  260. package/templates/mobile/rn/src/core/components/forms/hf-password-input.tsx +153 -0
  261. package/templates/mobile/rn/src/core/components/forms/hf-text-input.tsx +59 -0
  262. package/templates/mobile/rn/src/core/components/forms/hf-time-picker.tsx +117 -0
  263. package/templates/mobile/rn/src/core/components/forms/index.ts +4 -0
  264. package/templates/mobile/rn/src/core/components/index.ts +5 -0
  265. package/templates/mobile/rn/src/core/components/loading/index.ts +1 -0
  266. package/templates/mobile/rn/src/core/components/loading/loading-app/index.ts +1 -0
  267. package/templates/mobile/rn/src/core/components/loading/loading-app/loading-app.tsx +50 -0
  268. package/templates/mobile/rn/src/core/components/offline/index.ts +1 -0
  269. package/templates/mobile/rn/src/core/components/offline/offline-banner.tsx +186 -0
  270. package/templates/mobile/rn/src/core/components/screen/index.ts +1 -0
  271. package/templates/mobile/rn/src/core/components/screen/screen-container/index.ts +1 -0
  272. package/templates/mobile/rn/src/core/components/screen/screen-container/screen-container.tsx +252 -0
  273. package/templates/mobile/rn/src/core/components/splash/index.ts +1 -0
  274. package/templates/mobile/rn/src/core/components/splash/splash-overlay/index.ts +1 -0
  275. package/templates/mobile/rn/src/core/components/splash/splash-overlay/splash-overlay.tsx +93 -0
  276. package/templates/mobile/rn/src/core/components/ui/animated-list-item/animated-list-item.tsx +48 -0
  277. package/templates/mobile/rn/src/core/components/ui/animated-list-item/animated-list-item.type.ts +10 -0
  278. package/templates/mobile/rn/src/core/components/ui/animated-list-item/index.ts +2 -0
  279. package/templates/mobile/rn/src/core/components/ui/app-image/app-image.tsx +104 -0
  280. package/templates/mobile/rn/src/core/components/ui/app-image/app-image.type.ts +19 -0
  281. package/templates/mobile/rn/src/core/components/ui/app-image/index.ts +2 -0
  282. package/templates/mobile/rn/src/core/components/ui/asset-placeholder/asset-placeholder.tsx +76 -0
  283. package/templates/mobile/rn/src/core/components/ui/asset-placeholder/index.ts +1 -0
  284. package/templates/mobile/rn/src/core/components/ui/avatar-image/avatar-image.tsx +90 -0
  285. package/templates/mobile/rn/src/core/components/ui/avatar-image/index.ts +1 -0
  286. package/templates/mobile/rn/src/core/components/ui/bottom-sheet/bottom-sheet.tsx +145 -0
  287. package/templates/mobile/rn/src/core/components/ui/bottom-sheet/bottom-sheet.type.ts +10 -0
  288. package/templates/mobile/rn/src/core/components/ui/bottom-sheet/index.ts +2 -0
  289. package/templates/mobile/rn/src/core/components/ui/button/button.style.ts +146 -0
  290. package/templates/mobile/rn/src/core/components/ui/button/button.tsx +97 -0
  291. package/templates/mobile/rn/src/core/components/ui/button/button.type.ts +47 -0
  292. package/templates/mobile/rn/src/core/components/ui/button/index.ts +4 -0
  293. package/templates/mobile/rn/src/core/components/ui/checkbox/checkbox.tsx +127 -0
  294. package/templates/mobile/rn/src/core/components/ui/checkbox/checkbox.type.ts +24 -0
  295. package/templates/mobile/rn/src/core/components/ui/checkbox/index.ts +2 -0
  296. package/templates/mobile/rn/src/core/components/ui/collapsible-section/collapsible-section.tsx +141 -0
  297. package/templates/mobile/rn/src/core/components/ui/collapsible-section/collapsible-section.type.ts +10 -0
  298. package/templates/mobile/rn/src/core/components/ui/collapsible-section/index.ts +2 -0
  299. package/templates/mobile/rn/src/core/components/ui/components.registry.json +313 -0
  300. package/templates/mobile/rn/src/core/components/ui/field/field-frame.tsx +62 -0
  301. package/templates/mobile/rn/src/core/components/ui/field/field.shared.ts +31 -0
  302. package/templates/mobile/rn/src/core/components/ui/header/header.tsx +196 -0
  303. package/templates/mobile/rn/src/core/components/ui/header/header.type.ts +30 -0
  304. package/templates/mobile/rn/src/core/components/ui/header/index.ts +2 -0
  305. package/templates/mobile/rn/src/core/components/ui/icon-button/icon-button.style.ts +23 -0
  306. package/templates/mobile/rn/src/core/components/ui/icon-button/icon-button.tsx +66 -0
  307. package/templates/mobile/rn/src/core/components/ui/icon-button/icon-button.type.ts +25 -0
  308. package/templates/mobile/rn/src/core/components/ui/icon-button/index.ts +2 -0
  309. package/templates/mobile/rn/src/core/components/ui/image-slider/image-slider.tsx +107 -0
  310. package/templates/mobile/rn/src/core/components/ui/image-slider/image-slider.type.ts +10 -0
  311. package/templates/mobile/rn/src/core/components/ui/image-slider/index.ts +2 -0
  312. package/templates/mobile/rn/src/core/components/ui/index.ts +25 -0
  313. package/templates/mobile/rn/src/core/components/ui/label/index.ts +2 -0
  314. package/templates/mobile/rn/src/core/components/ui/label/label.tsx +36 -0
  315. package/templates/mobile/rn/src/core/components/ui/label/label.type.ts +12 -0
  316. package/templates/mobile/rn/src/core/components/ui/modal/index.ts +2 -0
  317. package/templates/mobile/rn/src/core/components/ui/modal/modal.tsx +62 -0
  318. package/templates/mobile/rn/src/core/components/ui/modal/modal.type.ts +11 -0
  319. package/templates/mobile/rn/src/core/components/ui/otp-input/index.ts +2 -0
  320. package/templates/mobile/rn/src/core/components/ui/otp-input/otp-input.tsx +129 -0
  321. package/templates/mobile/rn/src/core/components/ui/otp-input/otp-input.type.ts +20 -0
  322. package/templates/mobile/rn/src/core/components/ui/page-dots/index.ts +1 -0
  323. package/templates/mobile/rn/src/core/components/ui/page-dots/page-dots.tsx +60 -0
  324. package/templates/mobile/rn/src/core/components/ui/radio/index.ts +2 -0
  325. package/templates/mobile/rn/src/core/components/ui/radio/radio.tsx +121 -0
  326. package/templates/mobile/rn/src/core/components/ui/radio/radio.type.ts +20 -0
  327. package/templates/mobile/rn/src/core/components/ui/screen/index.ts +1 -0
  328. package/templates/mobile/rn/src/core/components/ui/screen/screen-gradient.tsx +33 -0
  329. package/templates/mobile/rn/src/core/components/ui/search-box/index.ts +2 -0
  330. package/templates/mobile/rn/src/core/components/ui/search-box/search-box.tsx +162 -0
  331. package/templates/mobile/rn/src/core/components/ui/search-box/search-box.type.ts +26 -0
  332. package/templates/mobile/rn/src/core/components/ui/segmented-control/index.ts +2 -0
  333. package/templates/mobile/rn/src/core/components/ui/segmented-control/segmented-control.tsx +86 -0
  334. package/templates/mobile/rn/src/core/components/ui/segmented-control/segmented-control.type.ts +22 -0
  335. package/templates/mobile/rn/src/core/components/ui/skeleton/index.ts +2 -0
  336. package/templates/mobile/rn/src/core/components/ui/skeleton/skeleton.tsx +106 -0
  337. package/templates/mobile/rn/src/core/components/ui/skeleton/skeleton.type.ts +8 -0
  338. package/templates/mobile/rn/src/core/components/ui/success-state/index.ts +1 -0
  339. package/templates/mobile/rn/src/core/components/ui/success-state/success-state.tsx +68 -0
  340. package/templates/mobile/rn/src/core/components/ui/tabs/index.ts +2 -0
  341. package/templates/mobile/rn/src/core/components/ui/tabs/tabs.tsx +273 -0
  342. package/templates/mobile/rn/src/core/components/ui/tabs/tabs.type.ts +21 -0
  343. package/templates/mobile/rn/src/core/components/ui/tag-input/index.ts +2 -0
  344. package/templates/mobile/rn/src/core/components/ui/tag-input/tag-input.tsx +146 -0
  345. package/templates/mobile/rn/src/core/components/ui/tag-input/tag-input.type.ts +22 -0
  346. package/templates/mobile/rn/src/core/components/ui/text-area/index.ts +2 -0
  347. package/templates/mobile/rn/src/core/components/ui/text-area/text-area.tsx +90 -0
  348. package/templates/mobile/rn/src/core/components/ui/text-area/text-area.type.ts +20 -0
  349. package/templates/mobile/rn/src/core/components/ui/text-field/index.ts +2 -0
  350. package/templates/mobile/rn/src/core/components/ui/text-field/text-field.tsx +116 -0
  351. package/templates/mobile/rn/src/core/components/ui/text-field/text-field.type.ts +21 -0
  352. package/templates/mobile/rn/src/core/components/ui/toggle/index.ts +2 -0
  353. package/templates/mobile/rn/src/core/components/ui/toggle/toggle.tsx +110 -0
  354. package/templates/mobile/rn/src/core/components/ui/toggle/toggle.type.ts +19 -0
  355. package/templates/mobile/rn/src/core/constants/external-urls.constant.ts +5 -0
  356. package/templates/mobile/rn/src/core/constants/hard-data.constant.ts +0 -0
  357. package/templates/mobile/rn/src/core/constants/index.ts +2 -0
  358. package/templates/mobile/rn/src/core/constants/type.constant.ts +3 -0
  359. package/templates/mobile/rn/src/core/context/index.ts +1 -0
  360. package/templates/mobile/rn/src/core/context/shared-transition-context.tsx +35 -0
  361. package/templates/mobile/rn/src/core/hook/index.ts +8 -0
  362. package/templates/mobile/rn/src/core/hook/useActiveRouteName.ts +63 -0
  363. package/templates/mobile/rn/src/core/hook/useAppNavigation.tsx +7 -0
  364. package/templates/mobile/rn/src/core/hook/useBottomInset.tsx +26 -0
  365. package/templates/mobile/rn/src/core/hook/useDebounce.tsx +16 -0
  366. package/templates/mobile/rn/src/core/hook/useEndReached.tsx +46 -0
  367. package/templates/mobile/rn/src/core/hook/useManualRefetch.ts +56 -0
  368. package/templates/mobile/rn/src/core/hook/useNetworkStatus.ts +68 -0
  369. package/templates/mobile/rn/src/core/hook/useTimeout.tsx +30 -0
  370. package/templates/mobile/rn/src/core/index.ts +7 -0
  371. package/templates/mobile/rn/src/core/services/api.service.ts +230 -0
  372. package/templates/mobile/rn/src/core/services/device-id.service.ts +23 -0
  373. package/templates/mobile/rn/src/core/services/index.ts +3 -0
  374. package/templates/mobile/rn/src/core/services/session-end.bridge.ts +26 -0
  375. package/templates/mobile/rn/src/core/theme/dark.theme.ts +10 -0
  376. package/templates/mobile/rn/src/core/theme/index.ts +5 -0
  377. package/templates/mobile/rn/src/core/theme/light.theme.ts +44 -0
  378. package/templates/mobile/rn/src/core/theme/theme-context.tsx +82 -0
  379. package/templates/mobile/rn/src/core/theme/theme.types.ts +26 -0
  380. package/templates/mobile/rn/src/core/theme/use-themed-styles.ts +25 -0
  381. package/templates/mobile/rn/src/core/utils/color.util.tsx +198 -0
  382. package/templates/mobile/rn/src/core/utils/date.util.ts +97 -0
  383. package/templates/mobile/rn/src/core/utils/device-locale.util.ts +22 -0
  384. package/templates/mobile/rn/src/core/utils/emitter/index.ts +161 -0
  385. package/templates/mobile/rn/src/core/utils/emitter/type.ts +40 -0
  386. package/templates/mobile/rn/src/core/utils/enum.util.tsx +15 -0
  387. package/templates/mobile/rn/src/core/utils/font.util.tsx +42 -0
  388. package/templates/mobile/rn/src/core/utils/func.util.ts +48 -0
  389. package/templates/mobile/rn/src/core/utils/greeting.util.ts +20 -0
  390. package/templates/mobile/rn/src/core/utils/image-format.util.ts +117 -0
  391. package/templates/mobile/rn/src/core/utils/image-picker.util.ts +84 -0
  392. package/templates/mobile/rn/src/core/utils/index.ts +18 -0
  393. package/templates/mobile/rn/src/core/utils/linking.util.ts +16 -0
  394. package/templates/mobile/rn/src/core/utils/navigation.util.tsx +100 -0
  395. package/templates/mobile/rn/src/core/utils/number-format.ts +28 -0
  396. package/templates/mobile/rn/src/core/utils/query-client.util.ts +35 -0
  397. package/templates/mobile/rn/src/core/utils/query-persister.util.ts +36 -0
  398. package/templates/mobile/rn/src/core/utils/schema.util.tsx +2713 -0
  399. package/templates/mobile/rn/src/core/utils/size.util.tsx +74 -0
  400. package/templates/mobile/rn/src/core/utils/storage.util.tsx +53 -0
  401. package/templates/mobile/rn/src/core/utils/toast.util.tsx +151 -0
  402. package/templates/mobile/rn/src/core/utils/translator.util.tsx +23 -0
  403. package/templates/mobile/rn/src/core/utils/typography.util.tsx +69 -0
  404. package/templates/mobile/rn/src/core/utils/validate.util.tsx +13 -0
  405. package/templates/mobile/rn/src/declarations.d.ts +54 -0
  406. package/templates/mobile/rn/src/modules/home/home.screen.tsx +33 -0
  407. package/templates/mobile/rn/src/modules/profile/profile.screen.tsx +29 -0
  408. package/templates/mobile/rn/src/scripts/link-fonts.js +60 -0
  409. package/templates/mobile/rn/src/scripts/sync-images.js +56 -0
  410. package/templates/mobile/rn/src/scripts/sync-svgs.js +50 -0
  411. package/templates/mobile/rn/src/types/models.d.ts +24 -0
  412. package/templates/mobile/rn/tsconfig.json +21 -0
  413. package/templates/shared/README.md +21 -6
  414. package/templates/shared/_package.json +26 -4
  415. package/templates/shared/src/api-endpoints.ts +8 -0
  416. package/templates/shared/src/enums.ts +34 -0
  417. package/templates/shared/src/external-urls.ts +5 -0
  418. package/templates/shared/src/index.ts +15 -0
  419. package/templates/shared/tsconfig.json +8 -0
  420. package/templates/shared/tsup.config.ts +9 -0
  421. package/templates/shared/index.js +0 -4
@@ -0,0 +1,196 @@
1
+ import { IconArrowLeft, IconArrowRight } from '@src/assets/svgs';
2
+ import { ThemeColors, useTheme, useThemedStyles } from '@src/core/theme';
3
+ import { Font, fontSize, horizontalScale, Spacing } from '@src/core/utils';
4
+ import React from 'react';
5
+ import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
6
+ import { HeaderProps } from './header.type';
7
+
8
+ /**
9
+ * Design-system Header (Life-Master-Design) — navigation/section header.
10
+ *
11
+ * Variants:
12
+ * - `welcome` — large title + subtitle (left), optional right slot (avatar)
13
+ * - `default` — centered title + subtitle, optional left/right slots (arrows)
14
+ * - `back` — back link (icon + label)
15
+ * - `step` — left + right slots spread apart (e.g. back arrow + "Skip")
16
+ *
17
+ * Use `left` / `right` slots to drop in IconButtons, avatars, etc.
18
+ *
19
+ * @example
20
+ * <Header variant="welcome" title="Bonjour, Anna" subtitle="…" right={<Avatar />} />
21
+ * <Header variant="default" title="L'Architecte de Soi" subtitle="Créer" left={<Back/>} right={<Next/>} />
22
+ * <Header variant="back" backLabel="Retour à l'inscription" onBackPress={goBack} />
23
+ */
24
+ const Header = (props: HeaderProps) => {
25
+ const {
26
+ variant = 'default',
27
+ title,
28
+ subtitle,
29
+ left,
30
+ right,
31
+ onBackPress,
32
+ backLabel = 'Back',
33
+ style,
34
+ } = props;
35
+ const { colors } = useTheme();
36
+ const styles = useThemedStyles(makeStyles);
37
+
38
+ if (variant === 'welcome') {
39
+ return (
40
+ <View style={[styles.welcome, style]}>
41
+ <View style={styles.welcomeText}>
42
+ {title ? <Text style={styles.titleLg}>{title}</Text> : null}
43
+ {subtitle ? <Text style={styles.subtitle}>{subtitle}</Text> : null}
44
+ </View>
45
+ {right}
46
+ </View>
47
+ );
48
+ }
49
+
50
+ if (variant === 'back') {
51
+ return (
52
+ <TouchableOpacity
53
+ accessibilityRole="button"
54
+ accessibilityLabel={backLabel}
55
+ activeOpacity={0.7}
56
+ onPress={onBackPress}
57
+ style={[styles.backRow, style]}
58
+ >
59
+ <IconArrowRight
60
+ width={horizontalScale(16)}
61
+ height={horizontalScale(16)}
62
+ color={colors.fg_neutral_normal}
63
+ style={styles.flip}
64
+ />
65
+ <Text style={styles.backLabel}>{backLabel}</Text>
66
+ </TouchableOpacity>
67
+ );
68
+ }
69
+
70
+ if (variant === 'step') {
71
+ return (
72
+ <View style={[styles.rowBetween, style]}>
73
+ <View style={styles.side}>{left}</View>
74
+ <View style={styles.sideEnd}>{right}</View>
75
+ </View>
76
+ );
77
+ }
78
+
79
+ // default — centered title + subtitle with optional side slots. When no
80
+ // `left` slot is given but `onBackPress` is set, render a plain back arrow so
81
+ // detail screens get a back affordance without repeating the markup.
82
+ const autoBack = !left && !!onBackPress;
83
+ const leftSlot = left ?? (
84
+ autoBack ? (
85
+ <TouchableOpacity
86
+ accessibilityRole="button"
87
+ accessibilityLabel={backLabel}
88
+ hitSlop={8}
89
+ onPress={onBackPress}
90
+ style={styles.back}
91
+ >
92
+ <IconArrowLeft
93
+ width={horizontalScale(24)}
94
+ height={horizontalScale(24)}
95
+ color={colors.fg_neutral_normal}
96
+ />
97
+ </TouchableOpacity>
98
+ ) : null
99
+ );
100
+
101
+ return (
102
+ <View style={[styles.rowBetween, style]}>
103
+ <View style={styles.side}>{leftSlot}</View>
104
+ <View style={styles.centerText}>
105
+ {title ? <Text style={styles.titleMd}>{title}</Text> : null}
106
+ {subtitle ? <Text style={styles.subtitle}>{subtitle}</Text> : null}
107
+ </View>
108
+ <View style={styles.sideEnd}>
109
+ {/* When the back arrow is auto-rendered with no real right slot, keep a
110
+ same-width spacer so the title stays optically centered. */}
111
+ {right ?? (autoBack ? <View style={styles.backSpacer} /> : null)}
112
+ </View>
113
+ </View>
114
+ );
115
+ };
116
+
117
+ export default Header;
118
+
119
+ const makeStyles = (c: ThemeColors) =>
120
+ StyleSheet.create({
121
+ welcome: {
122
+ flexDirection: 'row',
123
+ alignItems: 'center',
124
+ justifyContent: 'space-between',
125
+ alignSelf: 'stretch',
126
+ gap: Spacing.spacing_base, // 16
127
+ },
128
+ welcomeText: {
129
+ flex: 1,
130
+ gap: Spacing.spacing_2xs, // 2
131
+ },
132
+ rowBetween: {
133
+ flexDirection: 'row',
134
+ alignItems: 'center',
135
+ justifyContent: 'space-between',
136
+ alignSelf: 'stretch',
137
+ gap: Spacing.spacing_md, // 12
138
+ },
139
+ side: {
140
+ minWidth: horizontalScale(24),
141
+ alignItems: 'flex-start',
142
+ },
143
+ // Plain back affordance (no surface) auto-rendered in the `default` variant.
144
+ back: {
145
+ padding: Spacing.spacing_m_nudge, // 10
146
+ marginLeft: -Spacing.spacing_m_nudge, // align the icon to the edge
147
+ },
148
+ // Same width as the back arrow so the centered title stays balanced.
149
+ backSpacer: {
150
+ width: horizontalScale(24),
151
+ height: horizontalScale(24),
152
+ },
153
+ sideEnd: {
154
+ minWidth: horizontalScale(24),
155
+ alignItems: 'flex-end',
156
+ },
157
+ centerText: {
158
+ flex: 1,
159
+ alignItems: 'center',
160
+ gap: Spacing.spacing_2xs, // 2
161
+ },
162
+ titleLg: {
163
+ fontFamily: Font.dmSansSemiBold,
164
+ fontSize: fontSize(24),
165
+ lineHeight: 32,
166
+ letterSpacing: 0.5,
167
+ color: c.hFFFFFF,
168
+ },
169
+ titleMd: {
170
+ fontFamily: Font.dmSansSemiBold,
171
+ fontSize: fontSize(20),
172
+ lineHeight: 28,
173
+ color: c.hFFFFFF,
174
+ textAlign: 'center',
175
+ },
176
+ subtitle: {
177
+ fontFamily: Font.dmSansRegular,
178
+ fontSize: fontSize(12),
179
+ lineHeight: 18,
180
+ color: c.fg_neutral_faded,
181
+ },
182
+ backRow: {
183
+ flexDirection: 'row',
184
+ alignItems: 'center',
185
+ gap: Spacing.spacing_sm, // 8
186
+ },
187
+ flip: {
188
+ transform: [{ scaleX: -1 }],
189
+ },
190
+ backLabel: {
191
+ fontFamily: Font.dmSansMedium,
192
+ fontSize: fontSize(14),
193
+ lineHeight: 20,
194
+ color: c.fg_neutral_normal,
195
+ },
196
+ });
@@ -0,0 +1,30 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+
4
+ export type HeaderVariant = 'welcome' | 'default' | 'back' | 'step';
5
+
6
+ export interface HeaderProps {
7
+ /**
8
+ * Layout preset:
9
+ * - `welcome` — big title + subtitle on the left, optional right slot (e.g. avatar)
10
+ * - `default` — centered title + subtitle, optional left/right slots (e.g. arrows)
11
+ * - `back` — a back link row (icon + label)
12
+ * - `step` — left slot + right slot spread apart (e.g. back arrow + "Skip")
13
+ * @default 'default'
14
+ */
15
+ variant?: HeaderVariant;
16
+ /** Main title. */
17
+ title?: string;
18
+ /** Secondary text under the title. */
19
+ subtitle?: string;
20
+ /** Left slot (e.g. a back IconButton). */
21
+ left?: ReactNode;
22
+ /** Right slot (e.g. an avatar / skip button / forward arrow). */
23
+ right?: ReactNode;
24
+ /** Press handler for the `back` variant. */
25
+ onBackPress?: () => void;
26
+ /** Label for the `back` variant. @default 'Back' */
27
+ backLabel?: string;
28
+ /** Override the container style. */
29
+ style?: StyleProp<ViewStyle>;
30
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Header } from './header';
2
+ export * from './header.type';
@@ -0,0 +1,23 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { horizontalScale, Radius } from '@src/core/utils';
3
+ import { IconButtonSize } from './icon-button.type';
4
+
5
+ /** Square dimensions + icon size per size token (from Figma). */
6
+ export const ICON_SIZE_TOKENS: Record<
7
+ IconButtonSize,
8
+ { box: number; iconSize: number }
9
+ > = {
10
+ // `box` is a fixed square (matches Button height) — not horizontalScale'd, so
11
+ // the control keeps its 44/56 spec height across screen widths.
12
+ md: { box: 44, iconSize: horizontalScale(24) },
13
+ lg: { box: 56, iconSize: horizontalScale(30) },
14
+ };
15
+
16
+ export const styles = StyleSheet.create({
17
+ base: {
18
+ alignItems: 'center',
19
+ justifyContent: 'center',
20
+ borderRadius: Radius.radius_lg, // 12
21
+ overflow: 'hidden',
22
+ },
23
+ });
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import { ActivityIndicator, TouchableOpacity } from 'react-native';
3
+ import { useTheme } from '@src/core/theme';
4
+ import { resolveColors } from '../button';
5
+ import { ICON_SIZE_TOKENS, styles } from './icon-button.style';
6
+ import { IconButtonProps } from './icon-button.type';
7
+
8
+ /**
9
+ * Design-system Icon Button (Life-Master-Design) — a square, icon-only button.
10
+ *
11
+ * Shares the exact color matrix as {@link Button} (variant × colorScheme),
12
+ * reusing its `resolveColors`. Sizes: `md` (44px) | `lg` (56px).
13
+ * Supports `disabled` and `loading` states.
14
+ *
15
+ * @example
16
+ * <IconButton Icon={IconHeart} accessibilityLabel="Like" onPress={onLike} />
17
+ * <IconButton Icon={IconClose} variant="outline" colorScheme="neutral" size="md" accessibilityLabel="Close" />
18
+ */
19
+ const IconButton = (props: IconButtonProps) => {
20
+ const {
21
+ Icon,
22
+ variant = 'solid',
23
+ colorScheme = 'primary',
24
+ size = 'lg',
25
+ disabled = false,
26
+ loading = false,
27
+ accessibilityLabel,
28
+ style,
29
+ ...rest
30
+ } = props;
31
+
32
+ const { colors: themeColors } = useTheme();
33
+ const isInteractionBlocked = disabled || loading;
34
+ const colors = resolveColors(themeColors, variant, colorScheme, disabled);
35
+ const sizeTokens = ICON_SIZE_TOKENS[size];
36
+
37
+ return (
38
+ <TouchableOpacity
39
+ accessibilityRole="button"
40
+ accessibilityLabel={accessibilityLabel}
41
+ accessibilityState={{ disabled: isInteractionBlocked, busy: loading }}
42
+ activeOpacity={0.7}
43
+ disabled={isInteractionBlocked}
44
+ style={[
45
+ styles.base,
46
+ {
47
+ width: sizeTokens.box,
48
+ height: sizeTokens.box,
49
+ backgroundColor: colors.background,
50
+ borderColor: colors.border,
51
+ borderWidth: colors.borderWidth,
52
+ },
53
+ style,
54
+ ]}
55
+ {...rest}
56
+ >
57
+ {loading ? (
58
+ <ActivityIndicator size="small" color={colors.content} />
59
+ ) : (
60
+ <Icon width={sizeTokens.iconSize} height={sizeTokens.iconSize} color={colors.content} />
61
+ )}
62
+ </TouchableOpacity>
63
+ );
64
+ };
65
+
66
+ export default IconButton;
@@ -0,0 +1,25 @@
1
+ import { StyleProp, TouchableOpacityProps, ViewStyle } from 'react-native';
2
+ import { SvgProps } from 'react-native-svg';
3
+ import { ButtonColorScheme, ButtonVariant } from '../button';
4
+
5
+ /** Size token — `md` = 44px, `lg` = 56px square. */
6
+ export type IconButtonSize = 'md' | 'lg';
7
+
8
+ export type IconButtonProps = Omit<TouchableOpacityProps, 'children'> & {
9
+ /** Icon to render, centered (SVG component). */
10
+ Icon: React.FC<SvgProps>;
11
+ /** Visual style. @default 'solid' */
12
+ variant?: ButtonVariant;
13
+ /** Color scheme. @default 'primary' */
14
+ colorScheme?: ButtonColorScheme;
15
+ /** Size token. @default 'lg' */
16
+ size?: IconButtonSize;
17
+ /** Disable interaction + apply the disabled (faded) visual. */
18
+ disabled?: boolean;
19
+ /** Show a spinner instead of the icon; also blocks interaction. */
20
+ loading?: boolean;
21
+ /** Accessibility label (required — icon-only control needs a name). */
22
+ accessibilityLabel: string;
23
+ /** Override the container style. */
24
+ style?: StyleProp<ViewStyle>;
25
+ };
@@ -0,0 +1,2 @@
1
+ export { default as IconButton } from './icon-button';
2
+ export * from './icon-button.type';
@@ -0,0 +1,107 @@
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import {
3
+ FlatList,
4
+ StyleSheet,
5
+ View,
6
+ ViewToken,
7
+ } from 'react-native';
8
+ import FastImage from 'react-native-fast-image';
9
+
10
+ import { AppImage } from '../app-image';
11
+ import { Label } from '../label';
12
+ import { useTheme } from '@src/core/theme';
13
+ import { Font, fontSize, horizontalScale, Radius, verticalScale, WIDTH_SCREEN } from '@src/core/utils';
14
+ import { ImageSliderProps } from './image-slider.type';
15
+
16
+ const ImageSlider: React.FC<ImageSliderProps> = ({
17
+ images,
18
+ width = WIDTH_SCREEN,
19
+ style,
20
+ counterStyle,
21
+ showCounter = true,
22
+ preloadRest = true,
23
+ }) => {
24
+ const { colors } = useTheme();
25
+ const data = images;
26
+ const [activeIndex, setActiveIndex] = useState(0);
27
+ const viewabilityConfig = useRef({ viewAreaCoveragePercentThreshold: 50 });
28
+ const onViewableItemsChanged = useRef(
29
+ ({ viewableItems }: { viewableItems: ViewToken[] }) => {
30
+ if (viewableItems.length > 0 && viewableItems[0].index != null) {
31
+ setActiveIndex(viewableItems[0].index);
32
+ }
33
+ },
34
+ );
35
+
36
+ useEffect(() => {
37
+ if (!preloadRest) return;
38
+ const rest = data.slice(1).filter(Boolean).map(uri => ({ uri }));
39
+ if (rest.length > 0) FastImage.preload(rest);
40
+ }, [data, preloadRest]);
41
+
42
+ if (data.length === 0) return null;
43
+
44
+ return (
45
+ <View style={[styles.container, style]}>
46
+ <FlatList
47
+ data={data}
48
+ horizontal
49
+ pagingEnabled
50
+ showsHorizontalScrollIndicator={false}
51
+ keyExtractor={(_, i) => String(i)}
52
+ viewabilityConfig={viewabilityConfig.current}
53
+ onViewableItemsChanged={onViewableItemsChanged.current}
54
+ renderItem={({ item }) => (
55
+ <View style={[styles.slide, { width }]}>
56
+ <AppImage
57
+ source={{ uri: item }}
58
+ style={styles.image}
59
+ containerStyle={StyleSheet.absoluteFill}
60
+ resizeMode="cover"
61
+ />
62
+ </View>
63
+ )}
64
+ />
65
+ {showCounter && (
66
+ <View style={[styles.counter, counterStyle]}>
67
+ <Label
68
+ value={`${activeIndex + 1}/${data.length}`}
69
+ style={styles.counterText}
70
+ fontFamily={Font.rethinkSansRegular}
71
+ color={colors.hFFFFFF}
72
+ />
73
+ </View>
74
+ )}
75
+ </View>
76
+ );
77
+ };
78
+
79
+ export default ImageSlider;
80
+
81
+ const styles = StyleSheet.create({
82
+ container: {
83
+ width: '100%',
84
+ height: '100%',
85
+ },
86
+ slide: {
87
+ height: '100%',
88
+ },
89
+ image: {
90
+ width: '100%',
91
+ height: '100%',
92
+ },
93
+ counter: {
94
+ position: 'absolute',
95
+ top: verticalScale(12),
96
+ right: horizontalScale(12),
97
+ backgroundColor: 'rgba(0,0,0,0.3)',
98
+ borderWidth: 0.5,
99
+ borderColor: 'rgba(255,255,255,0.4)',
100
+ borderRadius: Radius.radius_full,
101
+ paddingHorizontal: horizontalScale(8),
102
+ paddingVertical: verticalScale(2),
103
+ },
104
+ counterText: {
105
+ fontSize: fontSize(12),
106
+ },
107
+ });
@@ -0,0 +1,10 @@
1
+ import { StyleProp, ViewStyle } from 'react-native';
2
+
3
+ export interface ImageSliderProps {
4
+ images: string[];
5
+ width?: number;
6
+ style?: StyleProp<ViewStyle>;
7
+ counterStyle?: StyleProp<ViewStyle>;
8
+ showCounter?: boolean;
9
+ preloadRest?: boolean;
10
+ }
@@ -0,0 +1,2 @@
1
+ export { default as ImageSlider } from './image-slider';
2
+ export * from './image-slider.type';
@@ -0,0 +1,25 @@
1
+ // Design-system UI components (Life-Master-Design).
2
+ // See components.registry.json for the catalog used by the create-UI skill.
3
+ export * from './button';
4
+ export * from './icon-button';
5
+ export * from './checkbox';
6
+ export * from './radio';
7
+ export * from './toggle';
8
+ export * from './text-field';
9
+ export * from './text-area';
10
+ export * from './otp-input';
11
+ export * from './tag-input';
12
+ export * from './search-box';
13
+ export * from './tabs';
14
+ export * from './segmented-control';
15
+ export * from './header';
16
+ export * from './screen';
17
+ export * from './label';
18
+ export * from './modal';
19
+ export * from './bottom-sheet';
20
+ export * from './app-image';
21
+ export * from './image-slider';
22
+ export * from './collapsible-section';
23
+ export * from './animated-list-item';
24
+ export * from './skeleton';
25
+ export * from './avatar-image';
@@ -0,0 +1,2 @@
1
+ export { default as Label } from './label';
2
+ export * from './label.type';
@@ -0,0 +1,36 @@
1
+ import { Font, fontSize } from '@src/core/utils';
2
+ import { ThemeColors, useTheme, useThemedStyles } from '@src/core/theme';
3
+ import React from 'react';
4
+ import { StyleSheet, Text } from 'react-native';
5
+ import { LabelProps } from './label.type';
6
+
7
+ const Label = (props: LabelProps) => {
8
+ const { colors } = useTheme();
9
+ const styles = useThemedStyles(makeStyles);
10
+ const {
11
+ value = '',
12
+ style = {},
13
+ fontFamily = Font.rethinkSansRegular,
14
+ numberOfLines = undefined,
15
+ children,
16
+ color = colors.fg_neutral_normal,
17
+ onPress,
18
+ } = props;
19
+
20
+ return (
21
+ <Text onPress={onPress} style={[styles.regular, { fontFamily, color }, style]} numberOfLines={numberOfLines}>
22
+ {value}
23
+ {children}
24
+ </Text>
25
+ );
26
+ };
27
+
28
+ export default Label;
29
+
30
+ const makeStyles = (c: ThemeColors) =>
31
+ StyleSheet.create({
32
+ regular: {
33
+ fontSize: fontSize(14),
34
+ color: c.fg_neutral_normal,
35
+ },
36
+ });
@@ -0,0 +1,12 @@
1
+ import { StyleProp, TextStyle } from 'react-native';
2
+ import { ReactChildren } from '@src/core/constants';
3
+
4
+ export interface LabelProps {
5
+ value?: string;
6
+ style?: StyleProp<TextStyle>;
7
+ numberOfLines?: number;
8
+ children?: ReactChildren;
9
+ fontFamily?: string;
10
+ color?: string;
11
+ onPress?: () => void;
12
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Modal } from './modal';
2
+ export * from './modal.type';
@@ -0,0 +1,62 @@
1
+ import React, { FC, memo } from 'react';
2
+ import {
3
+ Modal as RNModal,
4
+ Pressable,
5
+ StyleSheet,
6
+ } from 'react-native';
7
+ import { horizontalScale, verticalScale } from '../../../utils';
8
+ import { ThemeColors, useTheme, useThemedStyles } from '@src/core/theme';
9
+ import { ModalAppProps as ModalProps } from './modal.type';
10
+
11
+ const Modal: FC<ModalProps> = memo(props => {
12
+ const {
13
+ visible,
14
+ animationType = 'fade',
15
+ children,
16
+ styleContainer = {},
17
+ styleContent = {},
18
+ onHideModal = () => {},
19
+ } = props;
20
+
21
+ const { colors } = useTheme();
22
+ const styles = useThemedStyles(makeStyles);
23
+
24
+ return (
25
+ <RNModal
26
+ visible={visible}
27
+ animationType={animationType}
28
+ transparent
29
+ backdropColor={colors.rgba000000_50}
30
+ statusBarTranslucent
31
+ onRequestClose={onHideModal}
32
+ >
33
+ <Pressable
34
+ style={[styles.container, styleContainer]}
35
+ onPress={onHideModal}
36
+ >
37
+ <Pressable style={[styles.content, styleContent]}>
38
+ {children}
39
+ </Pressable>
40
+ </Pressable>
41
+ </RNModal>
42
+ );
43
+ });
44
+
45
+ export default Modal;
46
+
47
+ const makeStyles = (c: ThemeColors) =>
48
+ StyleSheet.create({
49
+ container: {
50
+ width: '100%',
51
+ height: '100%',
52
+ backgroundColor: c.rgba000000_50,
53
+ justifyContent: 'center',
54
+ alignItems: 'center',
55
+ },
56
+ content: {
57
+ width: horizontalScale(335),
58
+ minHeight: verticalScale(50),
59
+ backgroundColor: c.hFFFFFF,
60
+ borderRadius: horizontalScale(16),
61
+ },
62
+ });
@@ -0,0 +1,11 @@
1
+ import { ModalProps, StyleProp, ViewStyle } from 'react-native';
2
+ import { ReactChildren } from '@src/core/constants';
3
+
4
+ export type ModalAppProps = {
5
+ visible: boolean;
6
+ animationType?: ModalProps['animationType'];
7
+ onHideModal?: () => void;
8
+ styleContainer?: StyleProp<ViewStyle>;
9
+ styleContent?: StyleProp<ViewStyle>;
10
+ children?: ReactChildren;
11
+ };
@@ -0,0 +1,2 @@
1
+ export { default as OtpInput } from './otp-input';
2
+ export * from './otp-input.type';