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
@@ -0,0 +1,138 @@
1
+ import React from 'react';
2
+ import { View, Text, TouchableOpacity, type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
3
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
4
+ import Icon from '../../icons/Icon';
5
+
6
+ export type ChipSelectProps = {
7
+ /**
8
+ * Label text to display.
9
+ * @default "Date"
10
+ */
11
+ label?: string;
12
+ /**
13
+ * Whether the chip is in active state.
14
+ * @default false
15
+ */
16
+ active?: boolean;
17
+ /**
18
+ * Icon name to display in Idle state (when active is false).
19
+ * @default "ic_calendar_week"
20
+ */
21
+ icon?: string;
22
+ /**
23
+ * Whether to show the close icon in Active state (when active is true).
24
+ * @default true
25
+ */
26
+ close?: boolean;
27
+ /**
28
+ * Modes for design token resolution.
29
+ */
30
+ modes?: Record<string, any>;
31
+ /**
32
+ * Optional style overrides.
33
+ */
34
+ style?: StyleProp<ViewStyle>;
35
+ /**
36
+ * Optional slot to override the label text.
37
+ */
38
+ labelSlot?: React.ReactNode;
39
+ /**
40
+ * Button press handler.
41
+ */
42
+ onPress?: () => void;
43
+ };
44
+
45
+ /**
46
+ * ChipSelect component for selecting options (e.g. Date selection).
47
+ * Based on Figma Node 1901-4727.
48
+ */
49
+ function ChipSelect({
50
+ label = 'Date',
51
+ active = false,
52
+ icon = 'ic_calendar_week',
53
+ close = true,
54
+ modes = {},
55
+ style,
56
+ labelSlot,
57
+ onPress,
58
+ }: ChipSelectProps) {
59
+ // Force control of the 'ChipSelect State' mode based on the active prop
60
+ // This overrides any 'ChipSelect State' passed from outside, but preserves other modes
61
+ const resolvedModes = {
62
+ ...modes,
63
+ 'ChipSelect State': active ? 'Active' : 'Idle',
64
+ };
65
+
66
+ // --- Token Resolution ---
67
+ const gap = parseInt(getVariableByName('chipSelect/gap', resolvedModes), 10) || 4;
68
+ const paddingHorizontal = parseInt(getVariableByName('chipSelect/padding/horizontal', resolvedModes), 10) || 16;
69
+ const paddingVertical = parseInt(getVariableByName('chipSelect/padding/vertical', resolvedModes), 10) || 0;
70
+ const radius = parseInt(getVariableByName('chipSelect/radius', resolvedModes), 10) || 999;
71
+
72
+ // Background
73
+ const backgroundColor = getVariableByName('chipSelect/background', resolvedModes) || '#f5f5f5';
74
+
75
+ // Text Styles
76
+ const textColor = getVariableByName('chipSelect/foreground', resolvedModes) || '#0d0d0f';
77
+ const fontSize = parseInt(getVariableByName('chipSelect/fontSize', resolvedModes), 10) || 14;
78
+ const fontFamily = getVariableByName('chipSelect/fontFamily', resolvedModes) || 'JioType Var';
79
+ const lineHeight = parseInt(getVariableByName('chipSelect/lineHeight', resolvedModes), 10) || 32;
80
+ const fontWeight = getVariableByName('chipSelect/fontWeight', resolvedModes) || '700';
81
+
82
+ // Icon Styles
83
+ const iconSize = parseInt(getVariableByName('chipSelect/icon/size', resolvedModes), 10) || 16;
84
+
85
+ // --- Styles ---
86
+ const containerStyle: ViewStyle = {
87
+ flexDirection: 'row',
88
+ alignItems: 'center',
89
+ justifyContent: 'center',
90
+ backgroundColor: backgroundColor,
91
+ borderRadius: radius,
92
+ paddingHorizontal: paddingHorizontal,
93
+ paddingVertical: paddingVertical,
94
+ gap: gap,
95
+ };
96
+
97
+ const textStyle: TextStyle = {
98
+ color: textColor,
99
+ fontFamily: fontFamily,
100
+ fontSize: fontSize,
101
+ lineHeight: lineHeight,
102
+ fontWeight: fontWeight as any,
103
+ textAlign: 'center',
104
+ };
105
+
106
+ const renderLabel = () => {
107
+ if (labelSlot) {
108
+ if (React.isValidElement(labelSlot)) {
109
+ // Pass resolved modes to slot
110
+ return React.cloneElement(labelSlot as React.ReactElement<any>, { modes: resolvedModes });
111
+ }
112
+ return labelSlot;
113
+ }
114
+ return <Text style={textStyle}>{label}</Text>;
115
+ };
116
+
117
+ return (
118
+ <TouchableOpacity
119
+ style={[containerStyle, style]}
120
+ onPress={onPress}
121
+ activeOpacity={0.8}
122
+ >
123
+ {/* Start Icon */}
124
+ {icon && (
125
+ <Icon name={icon} size={iconSize} color={textColor} />
126
+ )}
127
+
128
+ {renderLabel()}
129
+
130
+ {/* End/Close Icon (Only when active AND close is true) */}
131
+ {active && close && (
132
+ <Icon name="ic_close" size={iconSize} color={textColor} />
133
+ )}
134
+ </TouchableOpacity>
135
+ );
136
+ }
137
+
138
+ export default ChipSelect;
@@ -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 CtaCardStories from './CtaCard.stories';
3
3
  import CtaCard from './CtaCard';
4
4
 
@@ -1,9 +1,10 @@
1
- import React from 'react';
2
- import { View, Text, type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
3
- import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
4
- import { useTokens } from '../../design-tokens/JFSThemeProvider';
5
- import IconCapsule from '../IconCapsule/IconCapsule';
6
- import Button from '../Button/Button';
1
+ import React from 'react'
2
+ import { View, Text, type StyleProp, type ViewStyle, type TextStyle } from 'react-native'
3
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
4
+ import { useTokens } from '../../design-tokens/JFSThemeProvider'
5
+ import IconCapsule from '../IconCapsule/IconCapsule'
6
+ import Button from '../Button/Button'
7
+ import { cloneChildrenWithModes } from '../../utils/react-utils'
7
8
 
8
9
  type CtaCardProps = {
9
10
  /**
@@ -135,37 +136,28 @@ function CtaCard({
135
136
  fontWeight: '400', // Regular
136
137
  };
137
138
 
138
- // --- Slot Helper ---
139
- // Helper to clone element with modes if no modes are already present on it (standard in this library)
140
- const renderSlot = (slot: React.ReactNode) => {
141
- if (React.isValidElement(slot)) {
142
- return React.cloneElement(slot as React.ReactElement<any>, {
143
- modes: { ...modes, ...(slot as any).props.modes },
144
- });
145
- }
146
- return slot;
147
- };
139
+
148
140
 
149
141
  return (
150
142
  <View style={[containerStyle, style]}>
151
143
  <View style={contentWrapStyle}>
152
144
  {/* Icon Slot */}
153
145
  {iconSlot ? (
154
- renderSlot(iconSlot)
146
+ cloneChildrenWithModes(iconSlot, modes)
155
147
  ) : (
156
148
  <IconCapsule iconName={iconName} modes={modes} />
157
149
  )}
158
150
 
159
151
  {/* Title Slot */}
160
152
  {titleSlot ? (
161
- renderSlot(titleSlot)
153
+ cloneChildrenWithModes(titleSlot, modes)
162
154
  ) : (
163
155
  <Text style={titleStyle}>{title}</Text>
164
156
  )}
165
157
 
166
158
  {/* Body Slot */}
167
159
  {bodySlot ? (
168
- renderSlot(bodySlot)
160
+ cloneChildrenWithModes(bodySlot, modes)
169
161
  ) : (
170
162
  <Text style={bodyStyle}>{body}</Text>
171
163
  )}
@@ -173,7 +165,7 @@ function CtaCard({
173
165
 
174
166
  {/* Button Slot - placed outside content wrap based on Figma structure (flex-col gap=16) */}
175
167
  {buttonSlot ? (
176
- renderSlot(buttonSlot)
168
+ cloneChildrenWithModes(buttonSlot, modes)
177
169
  ) : (
178
170
  <Button
179
171
  label={buttonLabel}
@@ -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 DisclaimerStories from './Disclaimer.stories';
3
3
  import Disclaimer from './Disclaimer';
4
4
  import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
@@ -16,6 +16,10 @@ This component uses the following design token collections. Each collection supp
16
16
  ### Color Mode
17
17
  - **Modes:** Light | Dark
18
18
  - **Default:** Light
19
+
20
+ ### Colors Router
21
+ - **Modes:** POC | Old
22
+ - **Default:** POC
19
23
  ## Usage
20
24
 
21
25
  <Canvas>
@@ -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 DividerStories from './Divider.stories';
3
3
  import Divider from './Divider';
4
4
 
@@ -19,6 +19,10 @@ This component uses the following design token collections. Each collection supp
19
19
  ### Color Mode
20
20
  - **Modes:** Light | Dark
21
21
  - **Default:** Light
22
+
23
+ ### Colors Router
24
+ - **Modes:** POC | Old
25
+ - **Default:** POC
22
26
  ## Usage
23
27
 
24
28
  ### Horizontal Divider
@@ -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 DrawerStories from './Drawer.stories';
3
3
  import Drawer from './Drawer';
4
4
  import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
@@ -13,9 +13,17 @@ Lightweight bottom drawer/sheet with a draggable handle.
13
13
 
14
14
  This component uses the following design token collections. Each collection supports multiple modes that can be configured via the `modes` prop.
15
15
 
16
+ ### Page type
17
+ - **Modes:** MainPage | SubPage
18
+ - **Default:** MainPage
19
+
16
20
  ### Color Mode
17
21
  - **Modes:** Light | Dark
18
22
  - **Default:** Light
23
+
24
+ ### Colors Router
25
+ - **Modes:** POC | Old
26
+ - **Default:** POC
19
27
  ## Usage
20
28
 
21
29
  <Canvas>
@@ -0,0 +1,73 @@
1
+ import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
2
+ import * as EmptyStateStories from './EmptyState.stories';
3
+ import EmptyState from './EmptyState';
4
+
5
+ <Meta of={EmptyStateStories} />
6
+
7
+ # EmptyState
8
+
9
+ The `EmptyState` component is used to display messages when there is no content to show, typically with an icon, title, description, and an action button.
10
+
11
+
12
+ ## Available Collections and Modes
13
+
14
+ This component uses the following design token collections. Each collection supports multiple modes that can be configured via the `modes` prop.
15
+
16
+ ### Color Mode
17
+ - **Modes:** Light | Dark
18
+ - **Default:** Light
19
+
20
+ ### Colors Router
21
+ - **Modes:** POC | Old
22
+ - **Default:** POC
23
+ ## Usage
24
+
25
+ ```tsx
26
+ import { EmptyState } from 'jfs-components';
27
+
28
+ <EmptyState
29
+ title="No payments to show"
30
+ description="Start by paying bills, recharge or your friends"
31
+ modes={{}}
32
+ />
33
+ ```
34
+
35
+ ## Props
36
+
37
+ <Controls />
38
+
39
+ ## Examples
40
+
41
+ ### Default
42
+
43
+ <Canvas of={EmptyStateStories.Default} />
44
+
45
+ ### Custom Text
46
+
47
+ <Canvas of={EmptyStateStories.WithCustomText} />
48
+
49
+ ### Custom Slots
50
+
51
+ <Canvas of={EmptyStateStories.CustomSlots} />
52
+
53
+
54
+ ## Design Tokens
55
+
56
+ This component uses the following design tokens, resolved through `getVariableByName`:
57
+
58
+ - **`emptyState/body/color`**
59
+ - **`emptyState/body/fontFamily`**
60
+ - **`emptyState/body/fontSize`**
61
+ - **`emptyState/body/fontWeight`**
62
+ - **`emptyState/body/lineHeight`**
63
+ - **`emptyState/content/gap`**
64
+ - **`emptyState/gap`**
65
+ - **`emptyState/padding`**
66
+ - **`emptyState/radius`**
67
+ - **`emptyState/title/color`**
68
+ - **`emptyState/title/fontFamily`**
69
+ - **`emptyState/title/fontSize`**
70
+ - **`emptyState/title/fontWeight`**
71
+ - **`emptyState/title/lineHeight`**
72
+
73
+ All tokens support mode-based theming through the `modes` prop.
@@ -0,0 +1,181 @@
1
+ import React, { useMemo } from 'react'
2
+ import { View, Text, type StyleProp, type ViewStyle, type TextStyle } from 'react-native'
3
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
4
+ import { useTokens } from '../../design-tokens/JFSThemeProvider'
5
+ import IconCapsule from '../IconCapsule/IconCapsule'
6
+ import Button from '../Button/Button'
7
+
8
+ export type EmptyStateProps = {
9
+ /**
10
+ * Title text for the empty state
11
+ * @default "No payments to show"
12
+ */
13
+ title?: string;
14
+ /**
15
+ * Body description text
16
+ * @default "Start by paying bills, recharge or your friends"
17
+ */
18
+ description?: string;
19
+ /**
20
+ * Custom slot for the icon area. Defaults to IconCapsule.
21
+ * If providing a custom component, ensure it accepts `modes` if needed.
22
+ */
23
+ iconSlot?: React.ReactNode;
24
+ /**
25
+ * Custom slot for the button area. Defaults to "Button" component.
26
+ * If providing a custom component, ensure it accepts `modes` if needed.
27
+ */
28
+ buttonSlot?: React.ReactNode;
29
+ /**
30
+ * Mode configuration for theming
31
+ */
32
+ modes?: Record<string, any>;
33
+ style?: StyleProp<ViewStyle>;
34
+ testID?: string;
35
+ }
36
+
37
+ /**
38
+ * EmptyState component that displays an icon, title, description and an action button.
39
+ *
40
+ * @component
41
+ */
42
+ function EmptyState({
43
+ title = "No payments to show",
44
+ description = "Start by paying bills, recharge or your friends",
45
+ iconSlot,
46
+ buttonSlot,
47
+ modes: propModes = {},
48
+ style,
49
+ testID,
50
+ }: EmptyStateProps) {
51
+ const { modes: globalModes } = useTokens()
52
+ const modes = { ...globalModes, ...propModes }
53
+
54
+ // Container Tokens
55
+ const gap = getVariableByName('emptyState/gap', modes) || 24
56
+ const padding = getVariableByName('emptyState/padding', modes) || 4
57
+ const radius = getVariableByName('emptyState/radius', modes) || 16
58
+
59
+ // Content Wrap Tokens
60
+ const contentGap = getVariableByName('emptyState/content/gap', modes) || 16
61
+
62
+ // Title Tokens
63
+ const titleColor = getVariableByName('emptyState/title/color', modes) || '#0d0d0f'
64
+ const titleFontSize = getVariableByName('emptyState/title/fontSize', modes) || 16
65
+ const titleFontFamily = getVariableByName('emptyState/title/fontFamily', modes) || 'System'
66
+ const titleLineHeight = getVariableByName('emptyState/title/lineHeight', modes) || 18
67
+ const titleFontWeight = getVariableByName('emptyState/title/fontWeight', modes) || 700
68
+
69
+ // Body Tokens
70
+ const bodyColor = getVariableByName('emptyState/body/color', modes) || '#1a1c1f'
71
+ const bodyFontSize = getVariableByName('emptyState/body/fontSize', modes) || 12
72
+ const bodyFontFamily = getVariableByName('emptyState/body/fontFamily', modes) || 'System'
73
+ const bodyLineHeight = getVariableByName('emptyState/body/lineHeight', modes) || 16
74
+ const bodyFontWeight = getVariableByName('emptyState/body/fontWeight', modes) || 400
75
+
76
+
77
+ const containerStyle: ViewStyle = {
78
+ flexDirection: 'column',
79
+ alignItems: 'center',
80
+ justifyContent: 'center',
81
+ gap: gap,
82
+ padding: padding,
83
+ borderRadius: radius,
84
+ // Width is set in Figma as fixed 236, but typical practice is to let it be flexible or controlled by parent
85
+ // However, for strict adherence to "Maximize existing component usage" and specific styles, we can leave width
86
+ // to parent or default to auto.
87
+ }
88
+
89
+ const contentWrapStyle: ViewStyle = {
90
+ flexDirection: 'column',
91
+ alignItems: 'center',
92
+ gap: contentGap,
93
+ width: '100%',
94
+ }
95
+
96
+ const titleStyle: TextStyle = {
97
+ color: titleColor,
98
+ fontSize: titleFontSize,
99
+ fontFamily: titleFontFamily,
100
+ lineHeight: titleLineHeight,
101
+ fontWeight: String(titleFontWeight) as TextStyle['fontWeight'],
102
+ textAlign: 'center',
103
+ }
104
+
105
+ const bodyStyle: TextStyle = {
106
+ color: bodyColor,
107
+ fontSize: bodyFontSize,
108
+ fontFamily: bodyFontFamily,
109
+ lineHeight: bodyLineHeight,
110
+ fontWeight: String(bodyFontWeight) as TextStyle['fontWeight'],
111
+ textAlign: 'center',
112
+ }
113
+
114
+ const defaultIconSlot = useMemo(() => (
115
+ <IconCapsule modes={modes} />
116
+ ), [modes])
117
+
118
+ // Checking if iconSlot is passed; if not use default.
119
+ // If it is passed, we assume the user handles everything or we inject props if it's a valid element?
120
+ // User instructions say: "whenever there is a slot, that's should be implemented as real react slot... manual passing down modes"
121
+ // So we just render what is passed, but for defaults we pass modes.
122
+ // Ideally, if iconSlot is a function we could pass modes, but ReactNode is static.
123
+ // The instruction "make sure modes are always passed to all slot children" implies we might need to cloneElement if possible,
124
+ // AND/OR user needs to pass it manually in usage.
125
+ // But for the DEFAULT slots we render, we definitely pass modes.
126
+
127
+ const iconContent = iconSlot || defaultIconSlot
128
+
129
+ const defaultButtonSlot = useMemo(() => (
130
+ <Button label="Button" modes={modes} />
131
+ ), [modes])
132
+
133
+ const buttonContent = buttonSlot || defaultButtonSlot
134
+
135
+ return (
136
+ <View style={[containerStyle, style]} testID={testID}>
137
+ <View style={contentWrapStyle}>
138
+ {/* Icon Slot */}
139
+ {iconContent}
140
+
141
+ {/* Texts */}
142
+ <View style={{ alignItems: 'center', gap: 0 }}>
143
+ {/* Note: Figma auto-layout shows gap undefined for the texts parent wrapper if it existed,
144
+ but looking at structure:
145
+ Empty state (gap 24) -> Content wrap (gap 16) -> Icon Capsule, Texts
146
+ Wait, the Figma structure from context:
147
+ Empty state (gap 24)
148
+ -> Content wrap (gap 16)
149
+ -> Icon Capsule
150
+ -> (Implicit Text grouping? Or direct text nodes?)
151
+ Looking at context:
152
+ Empty state (Gap 24)
153
+ Content wrap (Gap 16)
154
+ Icon Capsule
155
+ p (Title)
156
+ p (Body)
157
+ Button
158
+ Wait, looking closer at provided context from Step 6:
159
+ Root (Empty state) -> gap 24
160
+ - Content wrap -> gap 16
161
+ - Icon Capsule
162
+ - Title text
163
+ - Body text
164
+ - Button
165
+
166
+ So Title and Body are inside Content wrap.
167
+ */}
168
+ <View style={{ alignItems: 'center' }}>
169
+ <Text style={titleStyle}>{title}</Text>
170
+ {description ? <Text style={bodyStyle}>{description}</Text> : null}
171
+ </View>
172
+ </View>
173
+ </View>
174
+
175
+ {/* Button Slot */}
176
+ {buttonContent}
177
+ </View>
178
+ )
179
+ }
180
+
181
+ export default EmptyState
@@ -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 FilterBarStories from './FilterBar.stories';
3
3
  import FilterBar from './FilterBar';
4
4
  import { AccessibilitySection, AnatomySection, UsageConstraintsSection } from '../docs/DocSections';
@@ -0,0 +1,44 @@
1
+ import { Meta, Story, Canvas, Controls } from '@storybook/blocks';
2
+ import * as HStackStories from './HStack.stories';
3
+ import HStack from './HStack';
4
+
5
+ <Meta of={HStackStories} />
6
+
7
+ # HStack
8
+
9
+ `HStack` arranges its children in a horizontal line. It uses design tokens for spacing and gap.
10
+
11
+
12
+ ## Available Collections and Modes
13
+
14
+ This component does not use any design token collections with multiple modes.
15
+ ## Usage
16
+
17
+ ```tsx
18
+ import { HStack } from 'jfs-components';
19
+
20
+ <HStack justifyHorizontal="space-between" modes={{ 'hstack/gap': 16 }}>
21
+ <View>Left</View>
22
+ <View>Right</View>
23
+ </HStack>
24
+ ```
25
+
26
+ <Canvas>
27
+ <Story of={HStackStories.Default} />
28
+ </Canvas>
29
+
30
+ ## Props
31
+
32
+ <Controls of={HStackStories.Default} />
33
+
34
+ ## Design Tokens
35
+
36
+ This component uses the following design tokens, resolved through `getVariableByName`:
37
+
38
+ - **`hstack/gap`**
39
+ - **`hstack/padding/bottom`**
40
+ - **`hstack/padding/left`**
41
+ - **`hstack/padding/right`**
42
+ - **`hstack/padding/top`**
43
+
44
+ All tokens support mode-based theming through the `modes` prop.
@@ -0,0 +1,95 @@
1
+ import React from 'react'
2
+ import { View, StyleProp, ViewStyle, ViewProps } from 'react-native'
3
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
4
+ import { useTokens } from '../../design-tokens/JFSThemeProvider'
5
+ import { cloneChildrenWithModes } from '../../utils/react-utils'
6
+
7
+ export interface HStackProps extends ViewProps {
8
+ /**
9
+ * The content to display inside the stack.
10
+ */
11
+ children?: React.ReactNode;
12
+ /**
13
+ * Alignment of children along the cross axis (vertical for HStack).
14
+ * Maps to alignItems.
15
+ */
16
+ alignVertical?: ViewStyle['alignItems'];
17
+ /**
18
+ * Justification of children along the main axis (horizontal for HStack).
19
+ * Maps to justifyContent.
20
+ */
21
+ justifyHorizontal?: ViewStyle['justifyContent'];
22
+ /**
23
+ * Controls whether children can wrap.
24
+ * Maps to flexWrap.
25
+ */
26
+ wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse';
27
+ /**
28
+ * If true, reverses the direction of the stack (row-reverse).
29
+ */
30
+ reverse?: boolean;
31
+ /**
32
+ * Prop for web semantics, often mapped to HTML tags.
33
+ */
34
+ as?: any;
35
+ /**
36
+ * Modes object to override default variable values.
37
+ */
38
+ modes?: Record<string, any>;
39
+ }
40
+
41
+ /**
42
+ * HStack component for horizontal layout using design token spacing.
43
+ */
44
+ export const HStack = ({
45
+ children,
46
+ alignVertical,
47
+ justifyHorizontal,
48
+ wrap,
49
+ reverse = false,
50
+ as,
51
+ modes: propModes = {},
52
+ style,
53
+ ...rest
54
+ }: HStackProps) => {
55
+ const { modes: globalModes } = useTokens()
56
+ const modes = { ...globalModes, ...propModes }
57
+
58
+ const paddingTop = getVariableByName('hstack/padding/top', modes)
59
+ const paddingBottom = getVariableByName('hstack/padding/bottom', modes)
60
+ const paddingLeft = getVariableByName('hstack/padding/left', modes)
61
+ const paddingRight = getVariableByName('hstack/padding/right', modes)
62
+ const gap = getVariableByName('hstack/gap', modes)
63
+
64
+ const flexWrap = typeof wrap === 'boolean' ? (wrap ? 'wrap' : 'nowrap') : wrap
65
+
66
+ const containerStyle: ViewStyle = {
67
+ flexDirection: reverse ? 'row-reverse' : 'row',
68
+ alignItems: alignVertical,
69
+ justifyContent: justifyHorizontal,
70
+ flexWrap,
71
+ paddingTop,
72
+ paddingBottom,
73
+ paddingLeft,
74
+ paddingRight,
75
+ gap,
76
+ }
77
+
78
+ // Pass modes down to children
79
+ const processedChildren = children
80
+ ? cloneChildrenWithModes(children, modes)
81
+ : null
82
+
83
+ const viewProps = {
84
+ ...rest,
85
+ as,
86
+ }
87
+
88
+ return (
89
+ <View style={[containerStyle, style]} {...viewProps}>
90
+ {processedChildren}
91
+ </View>
92
+ )
93
+ }
94
+
95
+ export default HStack