jfs-components 0.0.6 → 0.0.7

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 (315) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.mdx +1 -1
  2. package/lib/commonjs/components/ActionFooter/ActionFooter.js +2 -14
  3. package/lib/commonjs/components/ActionFooter/ActionFooter.js.map +1 -1
  4. package/lib/commonjs/components/ActionFooter/ActionFooter.mdx +1 -1
  5. package/lib/commonjs/components/ActionTile/ActionTile.mdx +5 -1
  6. package/lib/commonjs/components/AppBar/AppBar.js +100 -238
  7. package/lib/commonjs/components/AppBar/AppBar.js.map +1 -1
  8. package/lib/commonjs/components/AppBar/AppBar.mdx +51 -39
  9. package/lib/commonjs/components/Avatar/Avatar.mdx +9 -1
  10. package/lib/commonjs/components/AvatarGroup/AvatarGroup.mdx +9 -1
  11. package/lib/commonjs/components/Badge/Badge.mdx +1 -1
  12. package/lib/commonjs/components/Balance/Balance.js +77 -0
  13. package/lib/commonjs/components/Balance/Balance.js.map +1 -0
  14. package/lib/commonjs/components/Balance/Balance.mdx +62 -0
  15. package/lib/commonjs/components/BottomNav/BottomNav.mdx +5 -1
  16. package/lib/commonjs/components/BottomNavItem/BottomNavItem.mdx +5 -1
  17. package/lib/commonjs/components/Button/Button.mdx +5 -1
  18. package/lib/commonjs/components/ButtonGroup/ButtonGroup.js +64 -0
  19. package/lib/commonjs/components/ButtonGroup/ButtonGroup.js.map +1 -0
  20. package/lib/commonjs/components/ButtonGroup/ButtonGroup.mdx +56 -0
  21. package/lib/commonjs/components/Card/Card.mdx +1 -1
  22. package/lib/commonjs/components/CardFeedback/CardFeedback.mdx +5 -1
  23. package/lib/commonjs/components/ChipGroup/ChipGroup.js +54 -0
  24. package/lib/commonjs/components/ChipGroup/ChipGroup.js.map +1 -0
  25. package/lib/commonjs/components/ChipGroup/ChipGroup.mdx +40 -0
  26. package/lib/commonjs/components/ChipSelect/ChipSelect.js +103 -0
  27. package/lib/commonjs/components/ChipSelect/ChipSelect.js.map +1 -0
  28. package/lib/commonjs/components/ChipSelect/ChipSelect.mdx +80 -0
  29. package/lib/commonjs/components/CtaCard/CtaCard.js +5 -18
  30. package/lib/commonjs/components/CtaCard/CtaCard.js.map +1 -1
  31. package/lib/commonjs/components/CtaCard/CtaCard.mdx +1 -1
  32. package/lib/commonjs/components/Disclaimer/Disclaimer.mdx +5 -1
  33. package/lib/commonjs/components/Divider/Divider.mdx +5 -1
  34. package/lib/commonjs/components/Drawer/Drawer.mdx +9 -1
  35. package/lib/commonjs/components/EmptyState/EmptyState.js +138 -0
  36. package/lib/commonjs/components/EmptyState/EmptyState.js.map +1 -0
  37. package/lib/commonjs/components/EmptyState/EmptyState.mdx +73 -0
  38. package/lib/commonjs/components/FilterBar/FilterBar.mdx +1 -1
  39. package/lib/commonjs/components/HStack/HStack.js +67 -0
  40. package/lib/commonjs/components/HStack/HStack.js.map +1 -0
  41. package/lib/commonjs/components/HStack/HStack.mdx +44 -0
  42. package/lib/commonjs/components/IconButton/IconButton.mdx +5 -1
  43. package/lib/commonjs/components/IconCapsule/IconCapsule.js +3 -3
  44. package/lib/commonjs/components/IconCapsule/IconCapsule.js.map +1 -1
  45. package/lib/commonjs/components/IconCapsule/IconCapsule.mdx +12 -4
  46. package/lib/commonjs/components/Introduction.mdx +3 -98
  47. package/lib/commonjs/components/LazyList/LazyList.mdx +1 -1
  48. package/lib/commonjs/components/ListGroup/ListGroup.js +3 -30
  49. package/lib/commonjs/components/ListGroup/ListGroup.js.map +1 -1
  50. package/lib/commonjs/components/ListGroup/ListGroup.mdx +5 -1
  51. package/lib/commonjs/components/ListItem/ListItem.js +5 -37
  52. package/lib/commonjs/components/ListItem/ListItem.js.map +1 -1
  53. package/lib/commonjs/components/ListItem/ListItem.mdx +5 -1
  54. package/lib/commonjs/components/MediaCard/MediaCard.mdx +5 -1
  55. package/lib/commonjs/components/MerchantProfile/MerchantProfile.mdx +1 -1
  56. package/lib/commonjs/components/MoneyValue/MoneyValue.mdx +6 -2
  57. package/lib/commonjs/components/NavArrow/NavArrow.js +42 -17
  58. package/lib/commonjs/components/NavArrow/NavArrow.js.map +1 -1
  59. package/lib/commonjs/components/NavArrow/NavArrow.mdx +5 -1
  60. package/lib/commonjs/components/PageTitle/PageTitle.mdx +5 -1
  61. package/lib/commonjs/components/Screen/Screen.js +53 -0
  62. package/lib/commonjs/components/Screen/Screen.js.map +1 -0
  63. package/lib/commonjs/components/Screen/Screen.mdx +58 -0
  64. package/lib/commonjs/components/Section/Section.js +3 -25
  65. package/lib/commonjs/components/Section/Section.js.map +1 -1
  66. package/lib/commonjs/components/Section/Section.mdx +5 -1
  67. package/lib/commonjs/components/Stepper/Step.mdx +5 -1
  68. package/lib/commonjs/components/Stepper/StepLabel.mdx +5 -1
  69. package/lib/commonjs/components/Stepper/Stepper.mdx +1 -1
  70. package/lib/commonjs/components/SupportText/SupportText.js +83 -0
  71. package/lib/commonjs/components/SupportText/SupportText.js.map +1 -0
  72. package/lib/commonjs/components/SupportText/SupportText.mdx +48 -0
  73. package/lib/commonjs/components/SupportText/SupportTextIcon.js +47 -0
  74. package/lib/commonjs/components/SupportText/SupportTextIcon.js.map +1 -0
  75. package/lib/commonjs/components/SupportText/SupportTextIcon.mdx +35 -0
  76. package/lib/commonjs/components/SupportText/index.js +21 -0
  77. package/lib/commonjs/components/SupportText/index.js.map +1 -0
  78. package/lib/commonjs/components/TextInput/TextInput.mdx +9 -1
  79. package/lib/commonjs/components/ThreadHero/ThreadHero.mdx +1 -1
  80. package/lib/commonjs/components/Tooltip/Tooltip.mdx +5 -1
  81. package/lib/commonjs/components/TransactionBubble/TransactionBubble.mdx +1 -1
  82. package/lib/commonjs/components/TransactionDetails/TransactionDetails.js +2 -24
  83. package/lib/commonjs/components/TransactionDetails/TransactionDetails.js.map +1 -1
  84. package/lib/commonjs/components/TransactionDetails/TransactionDetails.mdx +1 -1
  85. package/lib/commonjs/components/TransactionStatus/TransactionStatus.mdx +1 -1
  86. package/lib/commonjs/components/UpiHandle/UpiHandle.mdx +5 -1
  87. package/lib/commonjs/components/VStack/VStack.js +73 -0
  88. package/lib/commonjs/components/VStack/VStack.js.map +1 -0
  89. package/lib/commonjs/components/VStack/VStack.mdx +44 -0
  90. package/lib/commonjs/components/index.js +28 -0
  91. package/lib/commonjs/components/index.js.map +1 -1
  92. package/lib/commonjs/design-tokens/JFS Variables-variables-full.json +1 -18633
  93. package/lib/commonjs/design-tokens/figma-variables-resolver.js +3 -9
  94. package/lib/commonjs/design-tokens/figma-variables-resolver.js.map +1 -2
  95. package/lib/commonjs/icons/ic_info.svg +1 -0
  96. package/lib/commonjs/icons/ic_warning.svg +1 -0
  97. package/lib/commonjs/icons/registry.js +2 -2
  98. package/lib/commonjs/icons/registry.js.map +1 -1
  99. package/lib/commonjs/utils/react-utils.js +47 -0
  100. package/lib/commonjs/utils/react-utils.js.map +1 -0
  101. package/lib/module/components/Accordion/Accordion.mdx +1 -1
  102. package/lib/module/components/ActionFooter/ActionFooter.js +2 -14
  103. package/lib/module/components/ActionFooter/ActionFooter.js.map +1 -1
  104. package/lib/module/components/ActionFooter/ActionFooter.mdx +1 -1
  105. package/lib/module/components/ActionTile/ActionTile.mdx +5 -1
  106. package/lib/module/components/AppBar/AppBar.js +100 -238
  107. package/lib/module/components/AppBar/AppBar.js.map +1 -1
  108. package/lib/module/components/AppBar/AppBar.mdx +51 -39
  109. package/lib/module/components/Avatar/Avatar.mdx +9 -1
  110. package/lib/module/components/AvatarGroup/AvatarGroup.mdx +9 -1
  111. package/lib/module/components/Badge/Badge.mdx +1 -1
  112. package/lib/module/components/Balance/Balance.js +72 -0
  113. package/lib/module/components/Balance/Balance.js.map +1 -0
  114. package/lib/module/components/Balance/Balance.mdx +62 -0
  115. package/lib/module/components/BottomNav/BottomNav.mdx +5 -1
  116. package/lib/module/components/BottomNavItem/BottomNavItem.mdx +5 -1
  117. package/lib/module/components/Button/Button.mdx +5 -1
  118. package/lib/module/components/ButtonGroup/ButtonGroup.js +59 -0
  119. package/lib/module/components/ButtonGroup/ButtonGroup.js.map +1 -0
  120. package/lib/module/components/ButtonGroup/ButtonGroup.mdx +56 -0
  121. package/lib/module/components/Card/Card.mdx +1 -1
  122. package/lib/module/components/CardFeedback/CardFeedback.mdx +5 -1
  123. package/lib/module/components/ChipGroup/ChipGroup.js +49 -0
  124. package/lib/module/components/ChipGroup/ChipGroup.js.map +1 -0
  125. package/lib/module/components/ChipGroup/ChipGroup.mdx +40 -0
  126. package/lib/module/components/ChipSelect/ChipSelect.js +98 -0
  127. package/lib/module/components/ChipSelect/ChipSelect.js.map +1 -0
  128. package/lib/module/components/ChipSelect/ChipSelect.mdx +80 -0
  129. package/lib/module/components/CtaCard/CtaCard.js +5 -18
  130. package/lib/module/components/CtaCard/CtaCard.js.map +1 -1
  131. package/lib/module/components/CtaCard/CtaCard.mdx +1 -1
  132. package/lib/module/components/Disclaimer/Disclaimer.mdx +5 -1
  133. package/lib/module/components/Divider/Divider.mdx +5 -1
  134. package/lib/module/components/Drawer/Drawer.mdx +9 -1
  135. package/lib/module/components/EmptyState/EmptyState.js +132 -0
  136. package/lib/module/components/EmptyState/EmptyState.js.map +1 -0
  137. package/lib/module/components/EmptyState/EmptyState.mdx +73 -0
  138. package/lib/module/components/FilterBar/FilterBar.mdx +1 -1
  139. package/lib/module/components/HStack/HStack.js +61 -0
  140. package/lib/module/components/HStack/HStack.js.map +1 -0
  141. package/lib/module/components/HStack/HStack.mdx +44 -0
  142. package/lib/module/components/IconButton/IconButton.mdx +5 -1
  143. package/lib/module/components/IconCapsule/IconCapsule.js +3 -3
  144. package/lib/module/components/IconCapsule/IconCapsule.js.map +1 -1
  145. package/lib/module/components/IconCapsule/IconCapsule.mdx +12 -4
  146. package/lib/module/components/Introduction.mdx +3 -98
  147. package/lib/module/components/LazyList/LazyList.mdx +1 -1
  148. package/lib/module/components/ListGroup/ListGroup.js +1 -30
  149. package/lib/module/components/ListGroup/ListGroup.js.map +1 -1
  150. package/lib/module/components/ListGroup/ListGroup.mdx +5 -1
  151. package/lib/module/components/ListItem/ListItem.js +1 -35
  152. package/lib/module/components/ListItem/ListItem.js.map +1 -1
  153. package/lib/module/components/ListItem/ListItem.mdx +5 -1
  154. package/lib/module/components/MediaCard/MediaCard.mdx +5 -1
  155. package/lib/module/components/MerchantProfile/MerchantProfile.mdx +1 -1
  156. package/lib/module/components/MoneyValue/MoneyValue.mdx +6 -2
  157. package/lib/module/components/NavArrow/NavArrow.js +42 -17
  158. package/lib/module/components/NavArrow/NavArrow.js.map +1 -1
  159. package/lib/module/components/NavArrow/NavArrow.mdx +5 -1
  160. package/lib/module/components/PageTitle/PageTitle.mdx +5 -1
  161. package/lib/module/components/Screen/Screen.js +47 -0
  162. package/lib/module/components/Screen/Screen.js.map +1 -0
  163. package/lib/module/components/Screen/Screen.mdx +58 -0
  164. package/lib/module/components/Section/Section.js +1 -23
  165. package/lib/module/components/Section/Section.js.map +1 -1
  166. package/lib/module/components/Section/Section.mdx +5 -1
  167. package/lib/module/components/Stepper/Step.mdx +5 -1
  168. package/lib/module/components/Stepper/StepLabel.mdx +5 -1
  169. package/lib/module/components/Stepper/Stepper.mdx +1 -1
  170. package/lib/module/components/SupportText/SupportText.js +78 -0
  171. package/lib/module/components/SupportText/SupportText.js.map +1 -0
  172. package/lib/module/components/SupportText/SupportText.mdx +48 -0
  173. package/lib/module/components/SupportText/SupportTextIcon.js +42 -0
  174. package/lib/module/components/SupportText/SupportTextIcon.js.map +1 -0
  175. package/lib/module/components/SupportText/SupportTextIcon.mdx +35 -0
  176. package/lib/module/components/SupportText/index.js +5 -0
  177. package/lib/module/components/SupportText/index.js.map +1 -0
  178. package/lib/module/components/TextInput/TextInput.mdx +9 -1
  179. package/lib/module/components/ThreadHero/ThreadHero.mdx +1 -1
  180. package/lib/module/components/Tooltip/Tooltip.mdx +5 -1
  181. package/lib/module/components/TransactionBubble/TransactionBubble.mdx +1 -1
  182. package/lib/module/components/TransactionDetails/TransactionDetails.js +2 -26
  183. package/lib/module/components/TransactionDetails/TransactionDetails.js.map +1 -1
  184. package/lib/module/components/TransactionDetails/TransactionDetails.mdx +1 -1
  185. package/lib/module/components/TransactionStatus/TransactionStatus.mdx +1 -1
  186. package/lib/module/components/UpiHandle/UpiHandle.mdx +5 -1
  187. package/lib/module/components/VStack/VStack.js +67 -0
  188. package/lib/module/components/VStack/VStack.js.map +1 -0
  189. package/lib/module/components/VStack/VStack.mdx +44 -0
  190. package/lib/module/components/index.js +4 -0
  191. package/lib/module/components/index.js.map +1 -1
  192. package/lib/module/design-tokens/JFS Variables-variables-full.json +1 -18633
  193. package/lib/module/design-tokens/figma-variables-resolver.js +2 -2
  194. package/lib/module/design-tokens/figma-variables-resolver.js.map +0 -1
  195. package/lib/module/icons/ic_info.svg +1 -0
  196. package/lib/module/icons/ic_warning.svg +1 -0
  197. package/lib/module/icons/registry.js +2 -2
  198. package/lib/module/icons/registry.js.map +1 -1
  199. package/lib/module/utils/react-utils.js +43 -0
  200. package/lib/module/utils/react-utils.js.map +1 -0
  201. package/lib/typescript/components/ActionFooter/ActionFooter.d.ts.map +1 -1
  202. package/lib/typescript/components/AppBar/AppBar.d.ts +34 -68
  203. package/lib/typescript/components/AppBar/AppBar.d.ts.map +1 -1
  204. package/lib/typescript/components/Balance/Balance.d.ts +44 -0
  205. package/lib/typescript/components/Balance/Balance.d.ts.map +1 -0
  206. package/lib/typescript/components/ButtonGroup/ButtonGroup.d.ts +36 -0
  207. package/lib/typescript/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
  208. package/lib/typescript/components/ChipGroup/ChipGroup.d.ts +29 -0
  209. package/lib/typescript/components/ChipGroup/ChipGroup.d.ts.map +1 -0
  210. package/lib/typescript/components/ChipSelect/ChipSelect.d.ts +47 -0
  211. package/lib/typescript/components/ChipSelect/ChipSelect.d.ts.map +1 -0
  212. package/lib/typescript/components/CtaCard/CtaCard.d.ts.map +1 -1
  213. package/lib/typescript/components/EmptyState/EmptyState.d.ts +38 -0
  214. package/lib/typescript/components/EmptyState/EmptyState.d.ts.map +1 -0
  215. package/lib/typescript/components/HStack/HStack.d.ts +41 -0
  216. package/lib/typescript/components/HStack/HStack.d.ts.map +1 -0
  217. package/lib/typescript/components/ListGroup/ListGroup.d.ts.map +1 -1
  218. package/lib/typescript/components/ListItem/ListItem.d.ts.map +1 -1
  219. package/lib/typescript/components/NavArrow/NavArrow.d.ts +3 -3
  220. package/lib/typescript/components/NavArrow/NavArrow.d.ts.map +1 -1
  221. package/lib/typescript/components/Screen/Screen.d.ts +23 -0
  222. package/lib/typescript/components/Screen/Screen.d.ts.map +1 -0
  223. package/lib/typescript/components/Section/Section.d.ts.map +1 -1
  224. package/lib/typescript/components/SupportText/SupportText.d.ts +34 -0
  225. package/lib/typescript/components/SupportText/SupportText.d.ts.map +1 -0
  226. package/lib/typescript/components/SupportText/SupportTextIcon.d.ts +10 -0
  227. package/lib/typescript/components/SupportText/SupportTextIcon.d.ts.map +1 -0
  228. package/lib/typescript/components/SupportText/index.d.ts +3 -0
  229. package/lib/typescript/components/SupportText/index.d.ts.map +1 -0
  230. package/lib/typescript/components/TransactionDetails/TransactionDetails.d.ts.map +1 -1
  231. package/lib/typescript/components/VStack/VStack.d.ts +41 -0
  232. package/lib/typescript/components/VStack/VStack.d.ts.map +1 -0
  233. package/lib/typescript/components/index.d.ts +4 -0
  234. package/lib/typescript/components/index.d.ts.map +1 -1
  235. package/lib/typescript/icons/registry.d.ts +1 -1
  236. package/lib/typescript/icons/registry.d.ts.map +1 -1
  237. package/lib/typescript/utils/react-utils.d.ts +7 -0
  238. package/lib/typescript/utils/react-utils.d.ts.map +1 -0
  239. package/package.json +7 -5
  240. package/src/components/.token-metadata.json +468 -12
  241. package/src/components/Accordion/Accordion.mdx +1 -1
  242. package/src/components/ActionFooter/ActionFooter.mdx +1 -1
  243. package/src/components/ActionFooter/ActionFooter.tsx +3 -12
  244. package/src/components/ActionTile/ActionTile.mdx +5 -1
  245. package/src/components/AppBar/AppBar.mdx +51 -39
  246. package/src/components/AppBar/AppBar.tsx +140 -261
  247. package/src/components/Avatar/Avatar.mdx +9 -1
  248. package/src/components/AvatarGroup/AvatarGroup.mdx +9 -1
  249. package/src/components/Badge/Badge.mdx +1 -1
  250. package/src/components/Balance/Balance.mdx +62 -0
  251. package/src/components/Balance/Balance.tsx +107 -0
  252. package/src/components/BottomNav/BottomNav.mdx +5 -1
  253. package/src/components/BottomNavItem/BottomNavItem.mdx +5 -1
  254. package/src/components/Button/Button.mdx +5 -1
  255. package/src/components/ButtonGroup/ButtonGroup.mdx +56 -0
  256. package/src/components/ButtonGroup/ButtonGroup.tsx +78 -0
  257. package/src/components/Card/Card.mdx +1 -1
  258. package/src/components/CardFeedback/CardFeedback.mdx +5 -1
  259. package/src/components/ChipGroup/ChipGroup.mdx +40 -0
  260. package/src/components/ChipGroup/ChipGroup.tsx +67 -0
  261. package/src/components/ChipSelect/ChipSelect.mdx +80 -0
  262. package/src/components/ChipSelect/ChipSelect.tsx +138 -0
  263. package/src/components/CtaCard/CtaCard.mdx +1 -1
  264. package/src/components/CtaCard/CtaCard.tsx +12 -20
  265. package/src/components/Disclaimer/Disclaimer.mdx +5 -1
  266. package/src/components/Divider/Divider.mdx +5 -1
  267. package/src/components/Drawer/Drawer.mdx +9 -1
  268. package/src/components/EmptyState/EmptyState.mdx +73 -0
  269. package/src/components/EmptyState/EmptyState.tsx +181 -0
  270. package/src/components/FilterBar/FilterBar.mdx +1 -1
  271. package/src/components/HStack/HStack.mdx +44 -0
  272. package/src/components/HStack/HStack.tsx +95 -0
  273. package/src/components/IconButton/IconButton.mdx +5 -1
  274. package/src/components/IconCapsule/IconCapsule.mdx +12 -4
  275. package/src/components/IconCapsule/IconCapsule.tsx +3 -3
  276. package/src/components/Introduction.mdx +3 -98
  277. package/src/components/LazyList/LazyList.mdx +1 -1
  278. package/src/components/ListGroup/ListGroup.mdx +5 -1
  279. package/src/components/ListGroup/ListGroup.tsx +5 -43
  280. package/src/components/ListItem/ListItem.mdx +5 -1
  281. package/src/components/ListItem/ListItem.tsx +15 -60
  282. package/src/components/MediaCard/MediaCard.mdx +5 -1
  283. package/src/components/MerchantProfile/MerchantProfile.mdx +1 -1
  284. package/src/components/MoneyValue/MoneyValue.mdx +6 -2
  285. package/src/components/NavArrow/NavArrow.mdx +5 -1
  286. package/src/components/NavArrow/NavArrow.tsx +48 -16
  287. package/src/components/PageTitle/PageTitle.mdx +5 -1
  288. package/src/components/Screen/Screen.mdx +58 -0
  289. package/src/components/Screen/Screen.tsx +60 -0
  290. package/src/components/Section/Section.mdx +5 -1
  291. package/src/components/Section/Section.tsx +17 -46
  292. package/src/components/Stepper/Step.mdx +5 -1
  293. package/src/components/Stepper/StepLabel.mdx +5 -1
  294. package/src/components/Stepper/Stepper.mdx +1 -1
  295. package/src/components/SupportText/SupportText.mdx +48 -0
  296. package/src/components/SupportText/SupportText.tsx +104 -0
  297. package/src/components/SupportText/SupportTextIcon.mdx +35 -0
  298. package/src/components/SupportText/SupportTextIcon.tsx +45 -0
  299. package/src/components/SupportText/index.ts +2 -0
  300. package/src/components/TextInput/TextInput.mdx +9 -1
  301. package/src/components/ThreadHero/ThreadHero.mdx +1 -1
  302. package/src/components/Tooltip/Tooltip.mdx +5 -1
  303. package/src/components/TransactionBubble/TransactionBubble.mdx +1 -1
  304. package/src/components/TransactionDetails/TransactionDetails.mdx +1 -1
  305. package/src/components/TransactionDetails/TransactionDetails.tsx +1 -38
  306. package/src/components/TransactionStatus/TransactionStatus.mdx +1 -1
  307. package/src/components/UpiHandle/UpiHandle.mdx +5 -1
  308. package/src/components/VStack/VStack.mdx +44 -0
  309. package/src/components/VStack/VStack.tsx +100 -0
  310. package/src/components/index.ts +4 -0
  311. package/src/design-tokens/JFS Variables-variables-full.json +1 -18633
  312. package/src/icons/ic_info.svg +1 -0
  313. package/src/icons/ic_warning.svg +1 -0
  314. package/src/icons/registry.ts +9 -1
  315. package/src/utils/react-utils.ts +51 -0
@@ -1,4 +1,4 @@
1
- import { Meta, Story, Canvas, PureArgsTable as ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
2
2
  import * as AccordionStories from './Accordion.stories';
3
3
  import Accordion from './Accordion';
4
4
  import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
@@ -1,4 +1,4 @@
1
- import { Meta, Story, Canvas, PureArgsTable as ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
2
2
  import * as ActionFooterStories from './ActionFooter.stories';
3
3
  import ActionFooter from './ActionFooter';
4
4
 
@@ -6,6 +6,7 @@ import {
6
6
  Platform,
7
7
  } from 'react-native'
8
8
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
9
+ import { cloneChildrenWithModes } from '../../utils/react-utils'
9
10
 
10
11
  export type ActionFooterProps = {
11
12
  /**
@@ -108,22 +109,12 @@ function ActionFooter({
108
109
  }
109
110
 
110
111
  // Web-specific box-shadow
111
- const webShadow = Platform.OS === 'web'
112
+ const webShadow = Platform.OS === 'web'
112
113
  ? { boxShadow: '0px -12px 24px 0px rgba(12, 13, 16, 0.12), 0px -16px 48px 0px rgba(12, 13, 16, 0.16)' } as any
113
114
  : {}
114
115
 
115
116
  // Pass modes prop to all slot children
116
- const childrenWithModes = React.Children.map(children, (child) => {
117
- if (React.isValidElement(child)) {
118
- // Merge modes: child's modes take precedence over parent's modes
119
- const childModes = (child.props as any).modes
120
- const mergedModes = childModes ? { ...modes, ...childModes } : modes
121
- return React.cloneElement(child as React.ReactElement<any>, {
122
- modes: mergedModes,
123
- })
124
- }
125
- return child
126
- })
117
+ const childrenWithModes = cloneChildrenWithModes(children, modes)
127
118
 
128
119
  return (
129
120
  <View
@@ -1,4 +1,4 @@
1
- import { Meta, Story, Canvas, PureArgsTable as Controls } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, PureArgsTable as Controls } from '@storybook/blocks';
2
2
  import * as ActionTileStories from './ActionTile.stories';
3
3
 
4
4
  <Meta of={ActionTileStories} />
@@ -15,6 +15,10 @@ This component uses the following design token collections. Each collection supp
15
15
  ### Color Mode
16
16
  - **Modes:** Light | Dark
17
17
  - **Default:** Light
18
+
19
+ ### Colors Router
20
+ - **Modes:** POC | Old
21
+ - **Default:** POC
18
22
  ## Usage
19
23
 
20
24
  ```tsx
@@ -1,63 +1,75 @@
1
- import { Meta, Story, Canvas, PureArgsTable as ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Meta, Story, Controls } from '@storybook/blocks';
2
2
  import * as AppBarStories from './AppBar.stories';
3
- import AppBar from './AppBar';
4
- import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
5
3
 
6
4
  <Meta of={AppBarStories} />
7
5
 
8
6
  # AppBar
9
7
 
10
- Helper function to recursively clone children and pass modes prop to components that accept it.
8
+ The `AppBar` component supports two main types tailored for different hierarchy levels in the app:
9
+ - **MainPage**: Taller bar, typically used on landing pages. Supports branding (leading), and varied actions.
10
+ - **SubPage**: Standard height, used for inner pages. Typically features a "Back" arrow and a page title.
11
+
11
12
 
12
13
  ## Available Collections and Modes
13
14
 
14
- This component does not use any design token collections with multiple modes.
15
- ## Usage
15
+ This component uses the following design token collections. Each collection supports multiple modes that can be configured via the `modes` prop.
16
16
 
17
- <Canvas>
18
- <Story of={AppBarStories.Default} />
19
- </Canvas>
17
+ ### Color Mode
18
+ - **Modes:** Light | Dark
19
+ - **Default:** Light
20
+
21
+ ### Colors Router
22
+ - **Modes:** POC | Old
23
+ - **Default:** POC
24
+ ## Usage
20
25
 
26
+ ```tsx
27
+ import { AppBar } from 'jfs-components';
28
+ // or relative path...
21
29
 
22
- <AccessibilitySection
23
- items={[
24
- 'Set `accessibilityLabel` and `accessibilityHint` on AppBar/AppBarHome to describe the screen or navigation target.',
25
- 'Give every IconButton in leading/actions slots a readable label; pair with `onLeadingPress` for back/home navigation instead of relying on gestures.',
26
- 'Keep middle slot content informational only—the wrapper is hidden from the accessibility tree to avoid duplicate announcements.',
27
- 'Hide decorative icons from assistive tech by setting `accessibilityElementsHidden`/`importantForAccessibility` on custom elements.',
28
- ]}
30
+ // MainPage Example
31
+ <AppBar
32
+ type="MainPage"
33
+ leadingSlot={<JioLogo />}
34
+ actionsSlot={
35
+ <>
36
+ <IconButton iconName="ic_search" />
37
+ <IconButton iconName="ic_notification" />
38
+ <Avatar />
39
+ </>
40
+ }
29
41
  />
30
42
 
31
- <AnatomySection>
32
- <ul>
33
- <li><strong>Leading</strong> — default back IconButton; replace with any element (receives merged `modes`).</li>
34
- <li><strong>Middle slot</strong> centered, non-interactive title/search content layered above the bar.</li>
35
- <li><strong>Actions slot</strong> — right-aligned IconButtons; defaults to search and overflow buttons.</li>
36
- <li><strong>AppBarHome</strong> leading IconButton + actions + Avatar arranged on the right.</li>
37
- </ul>
38
- </AnatomySection>
39
-
40
- <UsageConstraintsSection
41
- items={[
42
- 'Pass shared `modes` so token-driven spacing and sizes stay consistent across slots and Avatar.',
43
- 'Avoid focusable controls in the middle slot; it is for display content and hidden from the accessibility tree.',
44
- 'Provide explicit `onLeadingPress`/`onPress` handlers to avoid inert navigation controls.',
45
- 'Override layout with `style` sparingly—keep token padding to preserve tap targets.',
46
- ]}
43
+ // SubPage Example
44
+ <AppBar
45
+ type="SubPage"
46
+ // Default leading is back arrow, so leadingSlot can be omitted if that's desired
47
+ onLeadingPress={() => navigation.goBack()}
48
+ middleSlot={<Text style={{ fontWeight: 'bold' }}>Settings</Text>}
49
+ actionsSlot={<IconButton iconName="ic_more_horizontal" />}
47
50
  />
51
+ ```
52
+
48
53
  ## Props
49
54
 
50
- <ArgsTable of={AppBar} />
55
+ <Controls />
56
+
57
+ ## Slots & Modes
58
+
59
+ The `AppBar` automatically passes `modes` down to all children within `leadingSlot`, `middleSlot`, and `actionsSlot`.
60
+ This ensures that if you switch the AppBar's mode (e.g. to Dark Mode), all buttons and text inside will adapt if they respect the `modes` prop.
51
61
 
52
62
  ## Design Tokens
53
63
 
54
64
  This component uses the following design tokens, resolved through `getVariableByName`:
55
65
 
56
- - **`appBarActions/actions/gap`**
57
- - **`appBarActions/padding/horizontal`**
58
- - **`appBarActions/padding/vertical`**
59
- - **`appBarHome/actions/gap`**
60
- - **`appBarHome/padding/horizontal`**
61
- - **`appBarHome/padding/vertical`**
66
+ - **`appBar/mainPage/actions/gap`**
67
+ - **`appBar/mainPage/background`**
68
+ - **`appBar/mainPage/padding/horizontal`**
69
+ - **`appBar/mainPage/padding/vertical`**
70
+ - **`appBar/subPage/actions/gap`**
71
+ - **`appBar/subPage/background`**
72
+ - **`appBar/subPage/padding/horizontal`**
73
+ - **`appBar/subPage/padding/vertical`**
62
74
 
63
75
  All tokens support mode-based theming through the `modes` prop.
@@ -1,13 +1,15 @@
1
1
  import React, { useState } from 'react'
2
- import { View, type StyleProp, type ViewStyle } from 'react-native'
2
+ import { View, type StyleProp, type ViewStyle, Pressable } from 'react-native'
3
3
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
4
4
  import { useTokens } from '../../design-tokens/JFSThemeProvider'
5
5
  import IconButton from '../IconButton/IconButton'
6
6
  import Avatar from '../Avatar/Avatar'
7
+ import NavArrow from '../NavArrow/NavArrow'
8
+ // We might need to import Image or Svg if we had the assets locally, but for now we'll use placeholders or standard icons for defaults.
9
+ // The user prompt mentioned "Use getVariableByName... strict camelCase".
7
10
 
8
11
  /**
9
12
  * Helper function to recursively clone children and pass modes prop to components that accept it.
10
- * This ensures that all child components in slots receive the modes prop from the parent.
11
13
  */
12
14
  function cloneChildrenWithModes(
13
15
  children: React.ReactNode,
@@ -24,7 +26,6 @@ function cloneChildrenWithModes(
24
26
 
25
27
  // Clone the child with modes prop if it doesn't already have one
26
28
  // or merge with existing modes if it does
27
- // Merge order: parent modes first, then child's explicit modes override them
28
29
  const existingModes = (child.props as any)?.modes
29
30
  const mergedModes = existingModes ? { ...modes, ...existingModes } : modes
30
31
 
@@ -48,153 +49,176 @@ function cloneChildrenWithModes(
48
49
  })?.filter((child) => child !== null && child !== undefined) as React.ReactNode[] ?? []
49
50
  }
50
51
 
51
- /**
52
- * AppBar component that mirrors the Figma "AppBar" component.
53
- *
54
- * This component supports:
55
- * - **leading** IconButton (default: back button with ic_chevron_left)
56
- * - **middle** slot for custom content (typically title or search)
57
- * - **actions** slot for custom action buttons (default: two IconButtons)
58
- * - **design-token driven styling** via `getVariableByName` and `modes`
59
- *
60
- * Wherever the Figma layer name contains "Slot", this component exposes a
61
- * dedicated React "slot" prop:
62
- * - Slot "Middle" `middleSlot`
63
- * - Slot "Actions" → `actionsSlot`
64
- *
65
- * @component
66
- * @param {Object} props
67
- * @param {React.ReactNode} [props.leading] - Optional leading element. Defaults to IconButton with ic_chevron_left.
68
- * @param {React.ReactNode} [props.middleSlot] - Optional custom slot for middle content (Figma Slot "Middle").
69
- * @param {React.ReactNode} [props.actionsSlot] - Optional custom slot for action buttons (Figma Slot "Actions").
70
- * @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens.
71
- * @param {Function} [props.onLeadingPress] - Callback when leading button is pressed (only used if leading is not provided).
72
- * @param {Object} [props.style] - Optional container style overrides.
73
- * @param {string} [props.accessibilityLabel] - Accessibility label for the app bar
74
- * @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
75
- */
76
- type AppBarProps = {
77
- leading?: React.ReactNode;
52
+ type AppBarType = 'MainPage' | 'SubPage'
53
+
54
+ export type AppBarProps = {
55
+ /**
56
+ * Type of the App Bar.
57
+ * - `MainPage`: Taller, usually has Jio logo (leading) and Profile/Notif (actions).
58
+ * - `SubPage`: Shorter, usually has Back arrow (leading) and Page Title (middle).
59
+ * @default "MainPage"
60
+ */
61
+ type?: AppBarType;
62
+ /**
63
+ * Slot for the leading element.
64
+ * Defaults:
65
+ * - MainPage: Jio Logo (placeholder circle for now if no asset)
66
+ * - SubPage: Back Icon Button
67
+ */
68
+ leadingSlot?: React.ReactNode;
69
+ /**
70
+ * Slot for the middle content.
71
+ * Often used for "Page Title" in SubPage.
72
+ */
78
73
  middleSlot?: React.ReactNode;
74
+ /**
75
+ * Slot for the actions on the right.
76
+ */
79
77
  actionsSlot?: React.ReactNode;
78
+ /**
79
+ * Token modes to override.
80
+ */
80
81
  modes?: Record<string, any>;
82
+ /**
83
+ * Callback for the default leading slot press (e.g. back button).
84
+ */
81
85
  onLeadingPress?: () => void;
86
+ /**
87
+ * Container style override.
88
+ */
82
89
  style?: StyleProp<ViewStyle>;
83
90
  accessibilityLabel?: string;
84
91
  accessibilityHint?: string;
85
92
  } & Omit<React.ComponentProps<typeof View>, 'style' | 'accessibilityRole' | 'accessibilityLabel' | 'accessibilityHint'>;
86
93
 
87
- function AppBar({
88
- leading,
94
+ export default function AppBar({
95
+ type = 'MainPage',
96
+ leadingSlot,
89
97
  middleSlot,
90
98
  actionsSlot,
91
99
  modes: propModes = {},
92
100
  onLeadingPress,
93
101
  style,
94
- accessibilityLabel = "App bar",
102
+ accessibilityLabel,
95
103
  accessibilityHint,
96
104
  ...rest
97
105
  }: AppBarProps) {
98
106
  const { modes: globalModes } = useTokens()
99
107
  const modes = { ...globalModes, ...propModes }
100
108
 
101
- const [childFocused, setChildFocused] = useState(false)
109
+ const isMain = type === 'MainPage'
110
+ const isSub = type === 'SubPage'
102
111
 
103
- function injectFocusHandlers(node: React.ReactNode): React.ReactNode {
104
- if (!React.isValidElement(node)) return node
105
- const existingOnFocus = (node.props as any)?.onFocus
106
- const existingOnBlur = (node.props as any)?.onBlur
107
- return React.cloneElement(node, {
108
- ...(node.props as any),
109
- onFocus: (e: any) => {
110
- setChildFocused(true)
111
- existingOnFocus?.(e)
112
- },
113
- onBlur: (e: any) => {
114
- setChildFocused(false)
115
- existingOnBlur?.(e)
116
- },
117
- })
118
- }
119
- // Resolve container tokens
120
- const paddingHorizontal = getVariableByName('appBarActions/padding/horizontal', modes) ?? 16
121
- const paddingVertical = getVariableByName('appBarActions/padding/vertical', modes) ?? 10
122
- const actionsGap = getVariableByName('appBarActions/actions/gap', modes) ?? 8
112
+ // --- Tokens ---
113
+ // Construct token keys based on type. keys must be camelCase as per instruction.
114
+ // We use explicit string literals so that the extraction script can find them.
115
+ const paddingHorizontal = isMain
116
+ ? getVariableByName('appBar/mainPage/padding/horizontal', modes)
117
+ : getVariableByName('appBar/subPage/padding/horizontal', modes)
123
118
 
119
+ const paddingVertical = isMain
120
+ ? getVariableByName('appBar/mainPage/padding/vertical', modes)
121
+ : getVariableByName('appBar/subPage/padding/vertical', modes)
122
+
123
+ const backgroundColor = isMain
124
+ ? getVariableByName('appBar/mainPage/background', modes)
125
+ : getVariableByName('appBar/subPage/background', modes)
126
+
127
+ const actionsGap = isMain
128
+ ? getVariableByName('appBar/mainPage/actions/gap', modes)
129
+ : getVariableByName('appBar/subPage/actions/gap', modes)
130
+
131
+ // Layout styles
124
132
  const containerStyle: ViewStyle = {
125
133
  flexDirection: 'row',
126
134
  alignItems: 'center',
127
135
  justifyContent: 'space-between',
128
- paddingHorizontal,
129
- paddingVertical,
130
- minHeight: 52,
136
+ paddingHorizontal: paddingHorizontal ?? 16,
137
+ paddingVertical: paddingVertical ?? (isMain ? 16 : 10),
138
+ backgroundColor: backgroundColor ?? '#FFFFFF',
139
+ // We can set minHeight if we want to enforce consistency, but padding should dictate it mostly.
140
+ // Figma shows specific heights implicitly via padding + content.
141
+ // MainPage: h=68 (16 top/bot padding? 36 height content?)
142
+ // SubPage: h=52
131
143
  }
132
144
 
133
- const actionsRowStyle: ViewStyle = {
134
- flexDirection: 'row',
135
- gap: actionsGap,
136
- alignItems: 'center',
145
+ // --- Leading Slot Default ---
146
+ // SubPage default: Back Arrow
147
+ // MainPage default: Jio Logo (We'll use a placeholder or basic text if no asset,
148
+ // but looking at "AppBarHome" before, it had "ic_hellojio". Let's stick to generic defaults or empty if not provided,
149
+ // but usually a component library provides sensible defaults.)
150
+
151
+ // Actually, let's implement the specific defaults mentioned in the plan/analysis
152
+ // SubPage: NavArrow props (icon, etc). We'll use IconButton with 'ic_chevron_left' as a close approximation.
153
+
154
+ let defaultLeading: React.ReactNode = null
155
+ if (leadingSlot === undefined) {
156
+ if (isSub) {
157
+ defaultLeading = (
158
+ <Pressable
159
+ {...(onLeadingPress ? { onPress: onLeadingPress } : {})}
160
+ hitSlop={8}
161
+ accessibilityRole="button"
162
+ accessibilityLabel="Back"
163
+ style={({ pressed }) => ({
164
+ opacity: pressed ? 0.7 : 1,
165
+ alignItems: 'center',
166
+ justifyContent: 'center',
167
+ })}
168
+ >
169
+ <NavArrow direction="Back" modes={modes} />
170
+ </Pressable>
171
+ )
172
+ } else {
173
+ // MainPage default leading: often the Brand Logo.
174
+ // We'll leave it empty or render a placeholder if desired, but standard AppBar often lets consumer pass logo.
175
+ // Previous code had `leadingIconName='ic_hellojio'` for Home.
176
+ // We will render nothing by default for MainPage leading to keep it flexible, OR a specialized Logo component if we had one.
177
+ // For now, let's assume consumer passes it for MainPage, or we leave empty.
178
+ // Wait, Figma screenshot shows "Jio" logo.
179
+ // The user said: "mostly token namings are 'camelCase'. Maximize existing component usage."
180
+ // I'll leave defaultLeading as null for MainPage unless I have a "BrandLogo" component.
181
+ }
137
182
  }
138
183
 
139
- // Default leading: IconButton with back icon
140
- const defaultLeading = leading ?? (
141
- <IconButton
142
- iconName="ic_chevron_left"
143
- modes={modes}
144
- {...(onLeadingPress !== undefined ? { onPress: onLeadingPress } : {})}
145
- accessibilityLabel="Go back"
146
- accessibilityHint="Navigates to the previous screen"
147
- />
148
- )
149
-
150
- // Default actions: Two IconButtons
151
- const defaultActions = actionsSlot ?? (
152
- <View style={actionsRowStyle}>
153
- <IconButton
154
- iconName="ic_hellojio"
155
- modes={modes}
156
- onPress={() => { }}
157
- accessibilityLabel="Hello Jio"
158
- accessibilityHint="Opens Hello Jio menu"
159
- />
160
- <IconButton
161
- iconName="ic_more_horizontal"
162
- modes={modes}
163
- onPress={() => { }}
164
- accessibilityLabel="More options"
165
- accessibilityHint="Opens additional options menu"
166
- />
167
- </View>
168
- )
184
+ // --- Process Slots ---
185
+ const processedLeading = leadingSlot
186
+ ? cloneChildrenWithModes([leadingSlot], modes)[0]
187
+ : defaultLeading
169
188
 
170
- // Clone slot children and pass modes to all children that accept it
171
- const processedMiddleSlot = middleSlot
189
+ const processedMiddle = middleSlot
172
190
  ? cloneChildrenWithModes(React.Children.toArray(middleSlot), modes)
173
191
  : null
174
192
 
175
- const processedActionsSlot = actionsSlot
176
- ? cloneChildrenWithModes(React.Children.toArray(actionsSlot), modes)
177
- : defaultActions
193
+ // Actions Gap wrapper
194
+ // The Figma has "Actions" slot with a gap.
195
+ const actionsStyle: ViewStyle = {
196
+ flexDirection: 'row',
197
+ alignItems: 'center',
198
+ gap: actionsGap ?? 0,
199
+ }
178
200
 
179
- // Process leading if it's a React element
180
- const processedLeading = React.isValidElement(leading)
181
- ? injectFocusHandlers(cloneChildrenWithModes([leading], modes)[0])
182
- : defaultLeading
201
+ const processedActions = actionsSlot
202
+ ? <View style={actionsStyle}>{cloneChildrenWithModes(React.Children.toArray(actionsSlot), modes)}</View>
203
+ : null
183
204
 
184
205
  return (
185
206
  <View
186
- style={[
187
- containerStyle,
188
- childFocused ? { borderBottomWidth: 2, borderBottomColor: '#222' } : null,
189
- style,
190
- ]}
207
+ style={[containerStyle, style]}
191
208
  accessibilityRole="header"
192
- accessibilityLabel={accessibilityLabel}
193
- {...(accessibilityHint !== undefined ? { accessibilityHint } : {})}
209
+ accessibilityLabel={accessibilityLabel || (isMain ? "Main Header" : "Sub Header")}
210
+ {...(accessibilityHint ? { accessibilityHint } : {})}
194
211
  {...rest}
195
212
  >
196
- {processedLeading}
197
- {processedMiddleSlot && (
213
+ {/* Leading Section */}
214
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
215
+ {processedLeading}
216
+ </View>
217
+
218
+ {/* Middle Section (Absolute centered often, or flex? Figma shows "Slot 'Middle'" inside a wrapper that is absolute center) */}
219
+ {/* Figma: "absolute flex h-full items-center justify-center left-1/2 ... translate-x-[-50%]" */}
220
+ {/* We should only render this wrapper if there IS middle content, to avoid z-index blocking hits. */}
221
+ {processedMiddle && (
198
222
  <View
199
223
  style={{
200
224
  position: 'absolute',
@@ -204,164 +228,19 @@ function AppBar({
204
228
  bottom: 0,
205
229
  alignItems: 'center',
206
230
  justifyContent: 'center',
207
- paddingHorizontal: 21,
208
- pointerEvents: 'box-none',
231
+ zIndex: -1, // Behind actions if overlap? Or should be on top?
232
+ // Usually middle title shouldn't block actions. `pointerEvents="box-none"` is safer.
209
233
  }}
210
- accessibilityElementsHidden={true}
211
- importantForAccessibility="no"
234
+ pointerEvents="box-none"
212
235
  >
213
- {processedMiddleSlot}
236
+ {processedMiddle}
214
237
  </View>
215
238
  )}
216
- <View style={actionsRowStyle}>
217
- {Array.isArray(processedActionsSlot)
218
- ? processedActionsSlot.map((n) => injectFocusHandlers(n))
219
- : injectFocusHandlers(processedActionsSlot)}
220
- </View>
221
- </View>
222
- )
223
- }
224
-
225
- /**
226
- * AppBarHome component that mirrors the Figma "AppBar.home" component.
227
- *
228
- * This component supports:
229
- * - **leading** IconButton (default: circular button with customizable icon)
230
- * - **actions** slot for custom action buttons (default: search and notification IconButtons)
231
- * - **avatar** Avatar component on the right
232
- * - **design-token driven styling** via `getVariableByName` and `modes`
233
- *
234
- * Wherever the Figma layer name contains "Slot", this component exposes a
235
- * dedicated React "slot" prop:
236
- * - Slot "Actions" → `actionsSlot`
237
- *
238
- * @component
239
- * @param {Object} props
240
- * @param {React.ReactNode} [props.leading] - Optional leading element. Defaults to IconButton with customizable icon.
241
- * @param {React.ReactNode} [props.actionsSlot] - Optional custom slot for action buttons (Figma Slot "Actions").
242
- * @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens.
243
- * @param {Function} [props.onLeadingPress] - Callback when leading button is pressed (only used if leading is not provided).
244
- * @param {string} [props.leadingIconName] - Icon name for default leading button (default: 'ic_hellojio').
245
- * @param {Object} [props.avatarProps] - Props to pass to Avatar component.
246
- * @param {Object} [props.style] - Optional container style overrides.
247
- * @param {string} [props.accessibilityLabel] - Accessibility label for the app bar
248
- * @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
249
- */
250
- type AppBarHomeProps = {
251
- leading?: React.ReactNode;
252
- actionsSlot?: React.ReactNode;
253
- modes?: Record<string, any>;
254
- onLeadingPress?: () => void;
255
- leadingIconName?: string;
256
- avatarProps?: React.ComponentProps<typeof Avatar>;
257
- style?: StyleProp<ViewStyle>;
258
- accessibilityLabel?: string;
259
- accessibilityHint?: string;
260
- } & Omit<React.ComponentProps<typeof View>, 'style' | 'accessibilityRole' | 'accessibilityLabel' | 'accessibilityHint'>;
261
-
262
- function AppBarHome({
263
- leading,
264
- actionsSlot,
265
- modes: propModes = {},
266
- onLeadingPress,
267
- leadingIconName = 'ic_hellojio',
268
- avatarProps,
269
- style,
270
- accessibilityLabel = "Home app bar",
271
- accessibilityHint,
272
- ...rest
273
- }: AppBarHomeProps) {
274
- const { modes: globalModes } = useTokens()
275
- const modes = { ...globalModes, ...propModes }
276
-
277
- // Resolve container tokens
278
- const paddingHorizontal = getVariableByName('appBarHome/padding/horizontal', modes) ?? 16
279
- const paddingVertical = getVariableByName('appBarHome/padding/vertical', modes) ?? 16
280
- const actionsGap = getVariableByName('appBarHome/actions/gap', modes) ?? 0
281
-
282
- const containerStyle: ViewStyle = {
283
- flexDirection: 'row',
284
- alignItems: 'center',
285
- justifyContent: 'space-between',
286
- paddingHorizontal,
287
- paddingVertical,
288
- width: '100%',
289
- }
290
-
291
- const homeActionsRowStyle: ViewStyle = {
292
- flexDirection: 'row',
293
- gap: actionsGap,
294
- alignItems: 'center',
295
- }
296
-
297
- // Default leading: IconButton with customizable icon
298
- // The IconButton already handles its own circular styling, so we just use it directly
299
- const defaultLeading = leading ?? (
300
- <IconButton
301
- iconName={leadingIconName}
302
- modes={modes}
303
- {...(onLeadingPress !== undefined ? { onPress: onLeadingPress } : {})}
304
- accessibilityLabel="Home"
305
- accessibilityHint="Opens home menu"
306
- />
307
- )
308
-
309
- // Default actions: Search and Notification IconButtons
310
- const defaultActions = actionsSlot ?? (
311
- <View style={homeActionsRowStyle}>
312
- <IconButton
313
- iconName="ic_search"
314
- modes={modes}
315
- onPress={() => { }}
316
- accessibilityLabel="Search"
317
- accessibilityHint="Opens search screen"
318
- />
319
- <IconButton
320
- iconName="ic_notification"
321
- modes={modes}
322
- onPress={() => { }}
323
- accessibilityLabel="Notifications"
324
- accessibilityHint="Opens notifications"
325
- />
326
- </View>
327
- )
328
-
329
- // Clone slot children and pass modes to all children that accept it
330
- const processedActionsSlot = actionsSlot
331
- ? cloneChildrenWithModes(React.Children.toArray(actionsSlot), modes)
332
- : defaultActions
333
-
334
- // Process leading if it's a React element
335
- const processedLeading = React.isValidElement(leading)
336
- ? cloneChildrenWithModes([leading], modes)[0]
337
- : defaultLeading
338
239
 
339
- // Process avatar with modes
340
- const avatarModes = avatarProps?.modes ? { ...modes, ...avatarProps.modes } : modes
341
- const processedAvatar = (
342
- <Avatar
343
- {...(avatarProps ?? {})}
344
- modes={avatarModes}
345
- />
346
- )
347
-
348
- return (
349
- <View
350
- style={[containerStyle, style]}
351
- accessibilityRole="header"
352
- accessibilityLabel={accessibilityLabel}
353
- {...(accessibilityHint !== undefined ? { accessibilityHint } : {})}
354
- {...rest}
355
- >
356
- {processedLeading}
357
- <View style={homeActionsRowStyle}>
358
- {processedActionsSlot}
359
- {processedAvatar}
240
+ {/* Actions Section */}
241
+ <View style={actionsStyle}>
242
+ {processedActions}
360
243
  </View>
361
244
  </View>
362
245
  )
363
246
  }
364
-
365
- export default AppBar
366
- export { AppBarHome }
367
-