@metamask/design-system-react-native 0.8.0 → 0.10.0

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 (252) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/dist/components/ActionListItem/ActionListItem.cjs +86 -0
  3. package/dist/components/ActionListItem/ActionListItem.cjs.map +1 -0
  4. package/dist/components/ActionListItem/ActionListItem.d.cts +4 -0
  5. package/dist/components/ActionListItem/ActionListItem.d.cts.map +1 -0
  6. package/dist/components/ActionListItem/ActionListItem.d.mts +4 -0
  7. package/dist/components/ActionListItem/ActionListItem.d.mts.map +1 -0
  8. package/dist/components/ActionListItem/ActionListItem.mjs +66 -0
  9. package/dist/components/ActionListItem/ActionListItem.mjs.map +1 -0
  10. package/dist/components/ActionListItem/ActionListItem.types.cjs +3 -0
  11. package/dist/components/ActionListItem/ActionListItem.types.cjs.map +1 -0
  12. package/dist/components/ActionListItem/ActionListItem.types.d.cts +73 -0
  13. package/dist/components/ActionListItem/ActionListItem.types.d.cts.map +1 -0
  14. package/dist/components/ActionListItem/ActionListItem.types.d.mts +73 -0
  15. package/dist/components/ActionListItem/ActionListItem.types.d.mts.map +1 -0
  16. package/dist/components/ActionListItem/ActionListItem.types.mjs +2 -0
  17. package/dist/components/ActionListItem/ActionListItem.types.mjs.map +1 -0
  18. package/dist/components/ActionListItem/index.cjs +6 -0
  19. package/dist/components/ActionListItem/index.cjs.map +1 -0
  20. package/dist/components/ActionListItem/index.d.cts +3 -0
  21. package/dist/components/ActionListItem/index.d.cts.map +1 -0
  22. package/dist/components/ActionListItem/index.d.mts +3 -0
  23. package/dist/components/ActionListItem/index.d.mts.map +1 -0
  24. package/dist/components/ActionListItem/index.mjs +2 -0
  25. package/dist/components/ActionListItem/index.mjs.map +1 -0
  26. package/dist/components/BadgeCount/BadgeCount.cjs +3 -3
  27. package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
  28. package/dist/components/BadgeCount/BadgeCount.constants.cjs +6 -10
  29. package/dist/components/BadgeCount/BadgeCount.constants.cjs.map +1 -1
  30. package/dist/components/BadgeCount/BadgeCount.constants.d.cts +1 -2
  31. package/dist/components/BadgeCount/BadgeCount.constants.d.cts.map +1 -1
  32. package/dist/components/BadgeCount/BadgeCount.constants.d.mts +1 -2
  33. package/dist/components/BadgeCount/BadgeCount.constants.d.mts.map +1 -1
  34. package/dist/components/BadgeCount/BadgeCount.constants.mjs +3 -7
  35. package/dist/components/BadgeCount/BadgeCount.constants.mjs.map +1 -1
  36. package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
  37. package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
  38. package/dist/components/BadgeCount/BadgeCount.mjs +3 -3
  39. package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
  40. package/dist/components/BadgeCount/BadgeCount.types.cjs.map +1 -1
  41. package/dist/components/BadgeCount/BadgeCount.types.d.cts +5 -22
  42. package/dist/components/BadgeCount/BadgeCount.types.d.cts.map +1 -1
  43. package/dist/components/BadgeCount/BadgeCount.types.d.mts +5 -22
  44. package/dist/components/BadgeCount/BadgeCount.types.d.mts.map +1 -1
  45. package/dist/components/BadgeCount/BadgeCount.types.mjs.map +1 -1
  46. package/dist/components/BadgeCount/index.cjs +2 -2
  47. package/dist/components/BadgeCount/index.cjs.map +1 -1
  48. package/dist/components/BadgeCount/index.d.cts +1 -1
  49. package/dist/components/BadgeCount/index.d.cts.map +1 -1
  50. package/dist/components/BadgeCount/index.d.mts +1 -1
  51. package/dist/components/BadgeCount/index.d.mts.map +1 -1
  52. package/dist/components/BadgeCount/index.mjs +1 -1
  53. package/dist/components/BadgeCount/index.mjs.map +1 -1
  54. package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +27 -0
  55. package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -0
  56. package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.cjs +15 -0
  57. package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.cjs.map +1 -0
  58. package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.cts +7 -0
  59. package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.cts.map +1 -0
  60. package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.mts +7 -0
  61. package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.mts.map +1 -0
  62. package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.mjs +12 -0
  63. package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.mjs.map +1 -0
  64. package/dist/components/BottomSheetHeader/BottomSheetHeader.d.cts +4 -0
  65. package/dist/components/BottomSheetHeader/BottomSheetHeader.d.cts.map +1 -0
  66. package/dist/components/BottomSheetHeader/BottomSheetHeader.d.mts +4 -0
  67. package/dist/components/BottomSheetHeader/BottomSheetHeader.d.mts.map +1 -0
  68. package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +27 -0
  69. package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -0
  70. package/dist/components/BottomSheetHeader/BottomSheetHeader.types.cjs +14 -0
  71. package/dist/components/BottomSheetHeader/BottomSheetHeader.types.cjs.map +1 -0
  72. package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.cts +50 -0
  73. package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.cts.map +1 -0
  74. package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.mts +50 -0
  75. package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.mts.map +1 -0
  76. package/dist/components/BottomSheetHeader/BottomSheetHeader.types.mjs +11 -0
  77. package/dist/components/BottomSheetHeader/BottomSheetHeader.types.mjs.map +1 -0
  78. package/dist/components/BottomSheetHeader/index.cjs +8 -0
  79. package/dist/components/BottomSheetHeader/index.cjs.map +1 -0
  80. package/dist/components/BottomSheetHeader/index.d.cts +4 -0
  81. package/dist/components/BottomSheetHeader/index.d.cts.map +1 -0
  82. package/dist/components/BottomSheetHeader/index.d.mts +4 -0
  83. package/dist/components/BottomSheetHeader/index.d.mts.map +1 -0
  84. package/dist/components/BottomSheetHeader/index.mjs +3 -0
  85. package/dist/components/BottomSheetHeader/index.mjs.map +1 -0
  86. package/dist/components/ButtonHero/ButtonHero.cjs +37 -0
  87. package/dist/components/ButtonHero/ButtonHero.cjs.map +1 -0
  88. package/dist/components/ButtonHero/ButtonHero.d.cts +13 -0
  89. package/dist/components/ButtonHero/ButtonHero.d.cts.map +1 -0
  90. package/dist/components/ButtonHero/ButtonHero.d.mts +13 -0
  91. package/dist/components/ButtonHero/ButtonHero.d.mts.map +1 -0
  92. package/dist/components/ButtonHero/ButtonHero.mjs +37 -0
  93. package/dist/components/ButtonHero/ButtonHero.mjs.map +1 -0
  94. package/dist/components/ButtonHero/ButtonHero.types.cjs +3 -0
  95. package/dist/components/ButtonHero/ButtonHero.types.cjs.map +1 -0
  96. package/dist/components/ButtonHero/ButtonHero.types.d.cts +3 -0
  97. package/dist/components/ButtonHero/ButtonHero.types.d.cts.map +1 -0
  98. package/dist/components/ButtonHero/ButtonHero.types.d.mts +3 -0
  99. package/dist/components/ButtonHero/ButtonHero.types.d.mts.map +1 -0
  100. package/dist/components/ButtonHero/ButtonHero.types.mjs +2 -0
  101. package/dist/components/ButtonHero/ButtonHero.types.mjs.map +1 -0
  102. package/dist/components/ButtonHero/index.cjs +8 -0
  103. package/dist/components/ButtonHero/index.cjs.map +1 -0
  104. package/dist/components/ButtonHero/index.d.cts +4 -0
  105. package/dist/components/ButtonHero/index.d.cts.map +1 -0
  106. package/dist/components/ButtonHero/index.d.mts +4 -0
  107. package/dist/components/ButtonHero/index.d.mts.map +1 -0
  108. package/dist/components/ButtonHero/index.mjs +3 -0
  109. package/dist/components/ButtonHero/index.mjs.map +1 -0
  110. package/dist/components/ButtonSemantic/ButtonSemantic.cjs +64 -0
  111. package/dist/components/ButtonSemantic/ButtonSemantic.cjs.map +1 -0
  112. package/dist/components/ButtonSemantic/ButtonSemantic.constants.cjs +17 -0
  113. package/dist/components/ButtonSemantic/ButtonSemantic.constants.cjs.map +1 -0
  114. package/dist/components/ButtonSemantic/ButtonSemantic.constants.d.cts +5 -0
  115. package/dist/components/ButtonSemantic/ButtonSemantic.constants.d.cts.map +1 -0
  116. package/dist/components/ButtonSemantic/ButtonSemantic.constants.d.mts +5 -0
  117. package/dist/components/ButtonSemantic/ButtonSemantic.constants.d.mts.map +1 -0
  118. package/dist/components/ButtonSemantic/ButtonSemantic.constants.mjs +14 -0
  119. package/dist/components/ButtonSemantic/ButtonSemantic.constants.mjs.map +1 -0
  120. package/dist/components/ButtonSemantic/ButtonSemantic.d.cts +4 -0
  121. package/dist/components/ButtonSemantic/ButtonSemantic.d.cts.map +1 -0
  122. package/dist/components/ButtonSemantic/ButtonSemantic.d.mts +4 -0
  123. package/dist/components/ButtonSemantic/ButtonSemantic.d.mts.map +1 -0
  124. package/dist/components/ButtonSemantic/ButtonSemantic.mjs +44 -0
  125. package/dist/components/ButtonSemantic/ButtonSemantic.mjs.map +1 -0
  126. package/dist/components/ButtonSemantic/ButtonSemantic.types.cjs +18 -0
  127. package/dist/components/ButtonSemantic/ButtonSemantic.types.cjs.map +1 -0
  128. package/dist/components/ButtonSemantic/ButtonSemantic.types.d.cts +30 -0
  129. package/dist/components/ButtonSemantic/ButtonSemantic.types.d.cts.map +1 -0
  130. package/dist/components/ButtonSemantic/ButtonSemantic.types.d.mts +30 -0
  131. package/dist/components/ButtonSemantic/ButtonSemantic.types.d.mts.map +1 -0
  132. package/dist/components/ButtonSemantic/ButtonSemantic.types.mjs +15 -0
  133. package/dist/components/ButtonSemantic/ButtonSemantic.types.mjs.map +1 -0
  134. package/dist/components/ButtonSemantic/index.cjs +8 -0
  135. package/dist/components/ButtonSemantic/index.cjs.map +1 -0
  136. package/dist/components/ButtonSemantic/index.d.cts +4 -0
  137. package/dist/components/ButtonSemantic/index.d.cts.map +1 -0
  138. package/dist/components/ButtonSemantic/index.d.mts +4 -0
  139. package/dist/components/ButtonSemantic/index.d.mts.map +1 -0
  140. package/dist/components/ButtonSemantic/index.mjs +3 -0
  141. package/dist/components/ButtonSemantic/index.mjs.map +1 -0
  142. package/dist/components/HeaderBase/HeaderBase.cjs +17 -8
  143. package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -1
  144. package/dist/components/HeaderBase/HeaderBase.constants.cjs +15 -0
  145. package/dist/components/HeaderBase/HeaderBase.constants.cjs.map +1 -0
  146. package/dist/components/HeaderBase/HeaderBase.constants.d.cts +7 -0
  147. package/dist/components/HeaderBase/HeaderBase.constants.d.cts.map +1 -0
  148. package/dist/components/HeaderBase/HeaderBase.constants.d.mts +7 -0
  149. package/dist/components/HeaderBase/HeaderBase.constants.d.mts.map +1 -0
  150. package/dist/components/HeaderBase/HeaderBase.constants.mjs +12 -0
  151. package/dist/components/HeaderBase/HeaderBase.constants.mjs.map +1 -0
  152. package/dist/components/HeaderBase/HeaderBase.d.cts.map +1 -1
  153. package/dist/components/HeaderBase/HeaderBase.d.mts.map +1 -1
  154. package/dist/components/HeaderBase/HeaderBase.mjs +18 -9
  155. package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -1
  156. package/dist/components/HeaderBase/HeaderBase.types.cjs +12 -0
  157. package/dist/components/HeaderBase/HeaderBase.types.cjs.map +1 -1
  158. package/dist/components/HeaderBase/HeaderBase.types.d.cts +16 -0
  159. package/dist/components/HeaderBase/HeaderBase.types.d.cts.map +1 -1
  160. package/dist/components/HeaderBase/HeaderBase.types.d.mts +16 -0
  161. package/dist/components/HeaderBase/HeaderBase.types.d.mts.map +1 -1
  162. package/dist/components/HeaderBase/HeaderBase.types.mjs +11 -1
  163. package/dist/components/HeaderBase/HeaderBase.types.mjs.map +1 -1
  164. package/dist/components/HeaderBase/index.cjs +3 -1
  165. package/dist/components/HeaderBase/index.cjs.map +1 -1
  166. package/dist/components/HeaderBase/index.d.cts +1 -0
  167. package/dist/components/HeaderBase/index.d.cts.map +1 -1
  168. package/dist/components/HeaderBase/index.d.mts +1 -0
  169. package/dist/components/HeaderBase/index.d.mts.map +1 -1
  170. package/dist/components/HeaderBase/index.mjs +1 -0
  171. package/dist/components/HeaderBase/index.mjs.map +1 -1
  172. package/dist/components/SensitiveText/SensitiveText.cjs +47 -0
  173. package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -0
  174. package/dist/components/SensitiveText/SensitiveText.constants.cjs +14 -0
  175. package/dist/components/SensitiveText/SensitiveText.constants.cjs.map +1 -0
  176. package/dist/components/SensitiveText/SensitiveText.constants.d.cts +11 -0
  177. package/dist/components/SensitiveText/SensitiveText.constants.d.cts.map +1 -0
  178. package/dist/components/SensitiveText/SensitiveText.constants.d.mts +11 -0
  179. package/dist/components/SensitiveText/SensitiveText.constants.d.mts.map +1 -0
  180. package/dist/components/SensitiveText/SensitiveText.constants.mjs +11 -0
  181. package/dist/components/SensitiveText/SensitiveText.constants.mjs.map +1 -0
  182. package/dist/components/SensitiveText/SensitiveText.d.cts +4 -0
  183. package/dist/components/SensitiveText/SensitiveText.d.cts.map +1 -0
  184. package/dist/components/SensitiveText/SensitiveText.d.mts +4 -0
  185. package/dist/components/SensitiveText/SensitiveText.d.mts.map +1 -0
  186. package/dist/components/SensitiveText/SensitiveText.mjs +27 -0
  187. package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -0
  188. package/dist/components/SensitiveText/SensitiveText.types.cjs +3 -0
  189. package/dist/components/SensitiveText/SensitiveText.types.cjs.map +1 -0
  190. package/dist/components/SensitiveText/SensitiveText.types.d.cts +38 -0
  191. package/dist/components/SensitiveText/SensitiveText.types.d.cts.map +1 -0
  192. package/dist/components/SensitiveText/SensitiveText.types.d.mts +38 -0
  193. package/dist/components/SensitiveText/SensitiveText.types.d.mts.map +1 -0
  194. package/dist/components/SensitiveText/SensitiveText.types.mjs +2 -0
  195. package/dist/components/SensitiveText/SensitiveText.types.mjs.map +1 -0
  196. package/dist/components/SensitiveText/index.cjs +8 -0
  197. package/dist/components/SensitiveText/index.cjs.map +1 -0
  198. package/dist/components/SensitiveText/index.d.cts +4 -0
  199. package/dist/components/SensitiveText/index.d.cts.map +1 -0
  200. package/dist/components/SensitiveText/index.d.mts +4 -0
  201. package/dist/components/SensitiveText/index.d.mts.map +1 -0
  202. package/dist/components/SensitiveText/index.mjs +3 -0
  203. package/dist/components/SensitiveText/index.mjs.map +1 -0
  204. package/dist/components/TextField/TextField.cjs +42 -0
  205. package/dist/components/TextField/TextField.cjs.map +1 -0
  206. package/dist/components/TextField/TextField.constants.cjs +13 -0
  207. package/dist/components/TextField/TextField.constants.cjs.map +1 -0
  208. package/dist/components/TextField/TextField.constants.d.cts +6 -0
  209. package/dist/components/TextField/TextField.constants.d.cts.map +1 -0
  210. package/dist/components/TextField/TextField.constants.d.mts +6 -0
  211. package/dist/components/TextField/TextField.constants.d.mts.map +1 -0
  212. package/dist/components/TextField/TextField.constants.mjs +10 -0
  213. package/dist/components/TextField/TextField.constants.mjs.map +1 -0
  214. package/dist/components/TextField/TextField.d.cts +12 -0
  215. package/dist/components/TextField/TextField.d.cts.map +1 -0
  216. package/dist/components/TextField/TextField.d.mts +12 -0
  217. package/dist/components/TextField/TextField.d.mts.map +1 -0
  218. package/dist/components/TextField/TextField.mjs +39 -0
  219. package/dist/components/TextField/TextField.mjs.map +1 -0
  220. package/dist/components/TextField/TextField.types.cjs +13 -0
  221. package/dist/components/TextField/TextField.types.cjs.map +1 -0
  222. package/dist/components/TextField/TextField.types.d.cts +49 -0
  223. package/dist/components/TextField/TextField.types.d.cts.map +1 -0
  224. package/dist/components/TextField/TextField.types.d.mts +49 -0
  225. package/dist/components/TextField/TextField.types.d.mts.map +1 -0
  226. package/dist/components/TextField/TextField.types.mjs +10 -0
  227. package/dist/components/TextField/TextField.types.mjs.map +1 -0
  228. package/dist/components/TextField/index.cjs +8 -0
  229. package/dist/components/TextField/index.cjs.map +1 -0
  230. package/dist/components/TextField/index.d.cts +4 -0
  231. package/dist/components/TextField/index.d.cts.map +1 -0
  232. package/dist/components/TextField/index.d.mts +4 -0
  233. package/dist/components/TextField/index.d.mts.map +1 -0
  234. package/dist/components/TextField/index.mjs +3 -0
  235. package/dist/components/TextField/index.mjs.map +1 -0
  236. package/dist/components/index.cjs +17 -2
  237. package/dist/components/index.cjs.map +1 -1
  238. package/dist/components/index.d.cts +11 -1
  239. package/dist/components/index.d.cts.map +1 -1
  240. package/dist/components/index.d.mts +11 -1
  241. package/dist/components/index.d.mts.map +1 -1
  242. package/dist/components/index.mjs +6 -1
  243. package/dist/components/index.mjs.map +1 -1
  244. package/dist/types/index.cjs +2 -16
  245. package/dist/types/index.cjs.map +1 -1
  246. package/dist/types/index.d.cts +1 -13
  247. package/dist/types/index.d.cts.map +1 -1
  248. package/dist/types/index.d.mts +1 -13
  249. package/dist/types/index.d.mts.map +1 -1
  250. package/dist/types/index.mjs +1 -14
  251. package/dist/types/index.mjs.map +1 -1
  252. package/package.json +3 -3
@@ -33,7 +33,10 @@ const react_native_safe_area_context_1 = require("react-native-safe-area-context
33
33
  const Box_1 = require("../Box/index.cjs");
34
34
  const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
35
35
  const Text_1 = require("../Text/index.cjs");
36
- const HeaderBase = ({ children, style, startAccessory, endAccessory, startButtonIconProps, endButtonIconProps, includesTopInset = false, startAccessoryWrapperProps, endAccessoryWrapperProps, titleTestID, twClassName, ...props }) => {
36
+ // Internal dependencies.
37
+ const HeaderBase_constants_1 = require("./HeaderBase.constants.cjs");
38
+ const HeaderBase_types_1 = require("./HeaderBase.types.cjs");
39
+ const HeaderBase = ({ children, style, variant = HeaderBase_types_1.HeaderBaseVariant.Compact, startAccessory, endAccessory, startButtonIconProps, endButtonIconProps, includesTopInset = false, startAccessoryWrapperProps, endAccessoryWrapperProps, titleTestID, twClassName, ...props }) => {
37
40
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
38
41
  const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
39
42
  const [startAccessoryWidth, setStartAccessoryWidth] = (0, react_1.useState)(0);
@@ -48,11 +51,17 @@ const HeaderBase = ({ children, style, startAccessory, endAccessory, startButton
48
51
  const hasStartContent = startAccessory || startButtonIconProps;
49
52
  const hasEndContent = endAccessory || (endButtonIconProps && endButtonIconProps.length > 0);
50
53
  const hasAnyAccessory = hasStartContent || hasEndContent;
51
- // Render both wrappers if any accessory exists (for centering)
52
- const shouldRenderStartWrapper = Boolean(hasAnyAccessory);
53
- const shouldRenderEndWrapper = Boolean(hasAnyAccessory);
54
- // Calculate equal width for both accessory wrappers to ensure title stays centered
55
- const accessoryWrapperWidth = hasAnyAccessory && (startAccessoryWidth || endAccessoryWidth)
54
+ const isCompact = variant === HeaderBase_types_1.HeaderBaseVariant.Compact;
55
+ // For Compact variant, render both wrappers if any accessory exists (for centering)
56
+ // For Display variant, only render wrappers when they have content
57
+ const shouldRenderStartWrapper = isCompact
58
+ ? Boolean(hasAnyAccessory)
59
+ : Boolean(hasStartContent);
60
+ const shouldRenderEndWrapper = isCompact
61
+ ? Boolean(hasAnyAccessory)
62
+ : Boolean(hasEndContent);
63
+ // Calculate equal width for both accessory wrappers to ensure title stays centered (Compact only)
64
+ const accessoryWrapperWidth = isCompact && hasAnyAccessory && (startAccessoryWidth || endAccessoryWidth)
56
65
  ? Math.max(startAccessoryWidth, endAccessoryWidth)
57
66
  : undefined;
58
67
  const renderStartContent = () => {
@@ -103,8 +112,8 @@ const HeaderBase = ({ children, style, startAccessory, endAccessory, startButton
103
112
  </react_native_1.View>)}
104
113
 
105
114
  {/* Title */}
106
- <Box_1.Box twClassName="flex-1 items-center">
107
- {typeof children === 'string' ? (<Text_1.Text variant={Text_1.TextVariant.HeadingSm} testID={titleTestID} style={tw.style('text-center')}>
115
+ <Box_1.Box twClassName={isCompact ? 'flex-1 items-center' : 'flex-1'}>
116
+ {typeof children === 'string' ? (<Text_1.Text variant={HeaderBase_constants_1.HEADERBASE_VARIANT_TEXT_VARIANTS[variant]} testID={titleTestID} style={isCompact ? tw.style('text-center') : undefined}>
108
117
  {children}
109
118
  </Text_1.Text>) : (children)}
110
119
  </Box_1.Box>
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBase.cjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,qFAAmE;AACnE,+CAAqD;AAErD,wDAAoC;AACpC,mFAAmE;AAEnE,yBAAyB;AACzB,0CAA6B;AAC7B,wDAA2D;AAC3D,4CAA4C;AAKrC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,KAAK,EACL,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,GAAG,KAAK,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,MAAM,GAAG,IAAA,kDAAiB,GAAE,CAAC;IAEnC,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAClE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAE9D,MAAM,0BAA0B,GAAG,IAAA,mBAAW,EAAC,CAAC,CAAoB,EAAE,EAAE;QACtE,sBAAsB,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,wBAAwB,GAAG,IAAA,mBAAW,EAAC,CAAC,CAAoB,EAAE,EAAE;QACpE,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,yCAAyC;IACzC,MAAM,eAAe,GAAG,cAAc,IAAI,oBAAoB,CAAC;IAC/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,OAAO,CAAC,CAAC,kBAAW,CAAC,SAAS,CAAC,CAC/B,MAAM,CAAC,CAAC,WAAW,CAAC,CACpB,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAE/B;YAAA,CAAC,QAAQ,CACX;UAAA,EAAE,WAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACH;MAAA,EAAE,SAAG,CAEL;;MAAA,CAAC,mBAAmB,CACpB;MAAA,CAAC,sBAAsB,IAAI,CACzB,CAAC,mBAAI,CACH,KAAK,CAAC,CACJ,qBAAqB;gBACnB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;gBACzD,CAAC,CAAC,SAAS,CACd,CACD,IAAI,wBAAwB,CAAC,CAE7B;UAAA,CAAC,mBAAI,CACH,QAAQ,CAAC,CAAC,wBAAwB,CAAC,CACnC,KAAK,CAAC,CACJ,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAC/D,CAED;YAAA,CAAC,gBAAgB,EAAE,CACrB;UAAA,EAAE,mBAAI,CACR;QAAA,EAAE,mBAAI,CAAC,CACR,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAtJW,QAAA,UAAU,cAsJrB","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback, useState } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { Box } from '../Box';\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { Text, TextVariant } from '../Text';\n\n// Internal dependencies.\nimport type { HeaderBaseProps } from './HeaderBase.types';\n\nexport const HeaderBase: React.FC<HeaderBaseProps> = ({\n children,\n style,\n startAccessory,\n endAccessory,\n startButtonIconProps,\n endButtonIconProps,\n includesTopInset = false,\n startAccessoryWrapperProps,\n endAccessoryWrapperProps,\n titleTestID,\n twClassName,\n ...props\n}) => {\n const tw = useTailwind();\n const insets = useSafeAreaInsets();\n\n const [startAccessoryWidth, setStartAccessoryWidth] = useState(0);\n const [endAccessoryWidth, setEndAccessoryWidth] = useState(0);\n\n const handleStartAccessoryLayout = useCallback((e: LayoutChangeEvent) => {\n setStartAccessoryWidth(e.nativeEvent.layout.width);\n }, []);\n\n const handleEndAccessoryLayout = useCallback((e: LayoutChangeEvent) => {\n setEndAccessoryWidth(e.nativeEvent.layout.width);\n }, []);\n\n // Determine what to render for start/end\n const hasStartContent = startAccessory || startButtonIconProps;\n const hasEndContent =\n endAccessory || (endButtonIconProps && endButtonIconProps.length > 0);\n const hasAnyAccessory = hasStartContent || hasEndContent;\n\n // Render both wrappers if any accessory exists (for centering)\n const shouldRenderStartWrapper = Boolean(hasAnyAccessory);\n const shouldRenderEndWrapper = Boolean(hasAnyAccessory);\n\n // Calculate equal width for both accessory wrappers to ensure title stays centered\n const accessoryWrapperWidth =\n hasAnyAccessory && (startAccessoryWidth || endAccessoryWidth)\n ? Math.max(startAccessoryWidth, endAccessoryWidth)\n : undefined;\n\n const renderStartContent = () => {\n if (startAccessory) {\n return startAccessory;\n }\n if (startButtonIconProps) {\n return <ButtonIcon size={ButtonIconSize.Md} {...startButtonIconProps} />;\n }\n return null;\n };\n\n const renderEndContent = () => {\n if (endAccessory) {\n return endAccessory;\n }\n if (endButtonIconProps && endButtonIconProps.length > 0) {\n // Reverse the array so first item appears rightmost\n // Use original index (before reversal) for stable React keys\n const reversedProps = endButtonIconProps\n .map((iconProps, originalIndex) => ({\n iconProps,\n originalIndex,\n }))\n .reverse();\n return reversedProps.map(({ iconProps, originalIndex }) => (\n <ButtonIcon\n key={`end-button-icon-${originalIndex}`}\n size={ButtonIconSize.Md}\n {...iconProps}\n />\n ));\n }\n return null;\n };\n\n // Check if we have multiple end buttons for layout styling\n const hasMultipleEndButtons =\n !endAccessory && endButtonIconProps && endButtonIconProps.length > 1;\n\n // Merge default styles with passed-in twClassName\n const baseStyles = 'flex-row items-center gap-4 h-14';\n const resolvedTwClassName = twClassName\n ? `${baseStyles} ${twClassName}`\n : baseStyles;\n\n return (\n <View\n style={[\n tw.style(resolvedTwClassName),\n includesTopInset && { marginTop: insets.top },\n style,\n ]}\n {...props}\n >\n {/* Start accessory */}\n {shouldRenderStartWrapper && (\n <View\n style={\n accessoryWrapperWidth\n ? tw.style('items-start', { width: accessoryWrapperWidth })\n : undefined\n }\n {...startAccessoryWrapperProps}\n >\n <View onLayout={handleStartAccessoryLayout}>\n {renderStartContent()}\n </View>\n </View>\n )}\n\n {/* Title */}\n <Box twClassName=\"flex-1 items-center\">\n {typeof children === 'string' ? (\n <Text\n variant={TextVariant.HeadingSm}\n testID={titleTestID}\n style={tw.style('text-center')}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </Box>\n\n {/* End accessory */}\n {shouldRenderEndWrapper && (\n <View\n style={\n accessoryWrapperWidth\n ? tw.style('items-end', { width: accessoryWrapperWidth })\n : undefined\n }\n {...endAccessoryWrapperProps}\n >\n <View\n onLayout={handleEndAccessoryLayout}\n style={\n hasMultipleEndButtons ? tw.style('flex-row gap-2') : undefined\n }\n >\n {renderEndContent()}\n </View>\n </View>\n )}\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"HeaderBase.cjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,qFAAmE;AACnE,+CAAqD;AAErD,wDAAoC;AACpC,mFAAmE;AAEnE,yBAAyB;AACzB,0CAA6B;AAC7B,wDAA2D;AAC3D,4CAA+B;AAE/B,yBAAyB;AACzB,qEAA0E;AAE1E,6DAAuD;AAEhD,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ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AC,uDAAgC,CAAC,OAAO,CAAC,CAAC,CACnD,MAAM,CAAC,CAAC,WAAW,CAAC,CACpB,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAEvD;YAAA,CAAC,QAAQ,CACX;UAAA,EAAE,WAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACH;MAAA,EAAE,SAAG,CAEL;;MAAA,CAAC,mBAAmB,CACpB;MAAA,CAAC,sBAAsB,IAAI,CACzB,CAAC,mBAAI,CACH,KAAK,CAAC,CACJ,qBAAqB;gBACnB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;gBACzD,CAAC,CAAC,SAAS,CACd,CACD,IAAI,wBAAwB,CAAC,CAE7B;UAAA,CAAC,mBAAI,CACH,QAAQ,CAAC,CAAC,wBAAwB,CAAC,CACnC,KAAK,CAAC,CACJ,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAC/D,CAED;YAAA,CAAC,gBAAgB,EAAE,CACrB;UAAA,EAAE,mBAAI,CACR;QAAA,EAAE,mBAAI,CAAC,CACR,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA9JW,QAAA,UAAU,cA8JrB","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback, useState } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { Box } from '../Box';\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { Text } from '../Text';\n\n// Internal dependencies.\nimport { HEADERBASE_VARIANT_TEXT_VARIANTS } from './HeaderBase.constants';\nimport type { HeaderBaseProps } from './HeaderBase.types';\nimport { HeaderBaseVariant } from './HeaderBase.types';\n\nexport const HeaderBase: React.FC<HeaderBaseProps> = ({\n children,\n style,\n variant = HeaderBaseVariant.Compact,\n startAccessory,\n endAccessory,\n startButtonIconProps,\n endButtonIconProps,\n includesTopInset = false,\n startAccessoryWrapperProps,\n endAccessoryWrapperProps,\n titleTestID,\n twClassName,\n ...props\n}) => {\n const tw = useTailwind();\n const insets = useSafeAreaInsets();\n\n const [startAccessoryWidth, setStartAccessoryWidth] = useState(0);\n const [endAccessoryWidth, setEndAccessoryWidth] = useState(0);\n\n const handleStartAccessoryLayout = useCallback((e: LayoutChangeEvent) => {\n setStartAccessoryWidth(e.nativeEvent.layout.width);\n }, []);\n\n const handleEndAccessoryLayout = useCallback((e: LayoutChangeEvent) => {\n setEndAccessoryWidth(e.nativeEvent.layout.width);\n }, []);\n\n // Determine what to render for start/end\n const hasStartContent = startAccessory || startButtonIconProps;\n const hasEndContent =\n endAccessory || (endButtonIconProps && endButtonIconProps.length > 0);\n const hasAnyAccessory = hasStartContent || hasEndContent;\n\n const isCompact = variant === HeaderBaseVariant.Compact;\n\n // For Compact variant, render both wrappers if any accessory exists (for centering)\n // For Display variant, only render wrappers when they have content\n const shouldRenderStartWrapper = isCompact\n ? Boolean(hasAnyAccessory)\n : Boolean(hasStartContent);\n const shouldRenderEndWrapper = isCompact\n ? Boolean(hasAnyAccessory)\n : Boolean(hasEndContent);\n\n // Calculate equal width for both accessory wrappers to ensure title stays centered (Compact only)\n const accessoryWrapperWidth =\n isCompact && hasAnyAccessory && (startAccessoryWidth || endAccessoryWidth)\n ? Math.max(startAccessoryWidth, endAccessoryWidth)\n : undefined;\n\n const renderStartContent = () => {\n if (startAccessory) {\n return startAccessory;\n }\n if (startButtonIconProps) {\n return <ButtonIcon size={ButtonIconSize.Md} {...startButtonIconProps} />;\n }\n return null;\n };\n\n const renderEndContent = () => {\n if (endAccessory) {\n return endAccessory;\n }\n if (endButtonIconProps && endButtonIconProps.length > 0) {\n // Reverse the array so first item appears rightmost\n // Use original index (before reversal) for stable React keys\n const reversedProps = endButtonIconProps\n .map((iconProps, originalIndex) => ({\n iconProps,\n originalIndex,\n }))\n .reverse();\n return reversedProps.map(({ iconProps, originalIndex }) => (\n <ButtonIcon\n key={`end-button-icon-${originalIndex}`}\n size={ButtonIconSize.Md}\n {...iconProps}\n />\n ));\n }\n return null;\n };\n\n // Check if we have multiple end buttons for layout styling\n const hasMultipleEndButtons =\n !endAccessory && endButtonIconProps && endButtonIconProps.length > 1;\n\n // Merge default styles with passed-in twClassName\n const baseStyles = 'flex-row items-center gap-4 h-14';\n const resolvedTwClassName = twClassName\n ? `${baseStyles} ${twClassName}`\n : baseStyles;\n\n return (\n <View\n style={[\n tw.style(resolvedTwClassName),\n includesTopInset && { marginTop: insets.top },\n style,\n ]}\n {...props}\n >\n {/* Start accessory */}\n {shouldRenderStartWrapper && (\n <View\n style={\n accessoryWrapperWidth\n ? tw.style('items-start', { width: accessoryWrapperWidth })\n : undefined\n }\n {...startAccessoryWrapperProps}\n >\n <View onLayout={handleStartAccessoryLayout}>\n {renderStartContent()}\n </View>\n </View>\n )}\n\n {/* Title */}\n <Box twClassName={isCompact ? 'flex-1 items-center' : 'flex-1'}>\n {typeof children === 'string' ? (\n <Text\n variant={HEADERBASE_VARIANT_TEXT_VARIANTS[variant]}\n testID={titleTestID}\n style={isCompact ? tw.style('text-center') : undefined}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </Box>\n\n {/* End accessory */}\n {shouldRenderEndWrapper && (\n <View\n style={\n accessoryWrapperWidth\n ? tw.style('items-end', { width: accessoryWrapperWidth })\n : undefined\n }\n {...endAccessoryWrapperProps}\n >\n <View\n onLayout={handleEndAccessoryLayout}\n style={\n hasMultipleEndButtons ? tw.style('flex-row gap-2') : undefined\n }\n >\n {renderEndContent()}\n </View>\n </View>\n )}\n </View>\n );\n};\n"]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HEADERBASE_VARIANT_TEXT_VARIANTS = void 0;
4
+ // External dependencies.
5
+ const Text_1 = require("../Text/index.cjs");
6
+ // Internal dependencies.
7
+ const HeaderBase_types_1 = require("./HeaderBase.types.cjs");
8
+ /**
9
+ * Text variant mapping based on HeaderBase variant.
10
+ */
11
+ exports.HEADERBASE_VARIANT_TEXT_VARIANTS = {
12
+ [HeaderBase_types_1.HeaderBaseVariant.Compact]: Text_1.TextVariant.HeadingSm,
13
+ [HeaderBase_types_1.HeaderBaseVariant.Display]: Text_1.TextVariant.HeadingLg,
14
+ };
15
+ //# sourceMappingURL=HeaderBase.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderBase.constants.cjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.constants.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,4CAAsC;AAEtC,yBAAyB;AACzB,6DAAuD;AAEvD;;GAEG;AACU,QAAA,gCAAgC,GAGzC;IACF,CAAC,oCAAiB,CAAC,OAAO,CAAC,EAAE,kBAAW,CAAC,SAAS;IAClD,CAAC,oCAAiB,CAAC,OAAO,CAAC,EAAE,kBAAW,CAAC,SAAS;CACnD,CAAC","sourcesContent":["// External dependencies.\nimport { TextVariant } from '../Text';\n\n// Internal dependencies.\nimport { HeaderBaseVariant } from './HeaderBase.types';\n\n/**\n * Text variant mapping based on HeaderBase variant.\n */\nexport const HEADERBASE_VARIANT_TEXT_VARIANTS: Record<\n HeaderBaseVariant,\n TextVariant\n> = {\n [HeaderBaseVariant.Compact]: TextVariant.HeadingSm,\n [HeaderBaseVariant.Display]: TextVariant.HeadingLg,\n};\n"]}
@@ -0,0 +1,7 @@
1
+ import { TextVariant } from "../Text/index.cjs";
2
+ import { HeaderBaseVariant } from "./HeaderBase.types.cjs";
3
+ /**
4
+ * Text variant mapping based on HeaderBase variant.
5
+ */
6
+ export declare const HEADERBASE_VARIANT_TEXT_VARIANTS: Record<HeaderBaseVariant, TextVariant>;
7
+ //# sourceMappingURL=HeaderBase.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderBase.constants.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAGtC,OAAO,EAAE,iBAAiB,EAAE,+BAA2B;AAEvD;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,iBAAiB,EACjB,WAAW,CAIZ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { TextVariant } from "../Text/index.mjs";
2
+ import { HeaderBaseVariant } from "./HeaderBase.types.mjs";
3
+ /**
4
+ * Text variant mapping based on HeaderBase variant.
5
+ */
6
+ export declare const HEADERBASE_VARIANT_TEXT_VARIANTS: Record<HeaderBaseVariant, TextVariant>;
7
+ //# sourceMappingURL=HeaderBase.constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderBase.constants.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAGtC,OAAO,EAAE,iBAAiB,EAAE,+BAA2B;AAEvD;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,iBAAiB,EACjB,WAAW,CAIZ,CAAC"}
@@ -0,0 +1,12 @@
1
+ // External dependencies.
2
+ import { TextVariant } from "../Text/index.mjs";
3
+ // Internal dependencies.
4
+ import { HeaderBaseVariant } from "./HeaderBase.types.mjs";
5
+ /**
6
+ * Text variant mapping based on HeaderBase variant.
7
+ */
8
+ export const HEADERBASE_VARIANT_TEXT_VARIANTS = {
9
+ [HeaderBaseVariant.Compact]: TextVariant.HeadingSm,
10
+ [HeaderBaseVariant.Display]: TextVariant.HeadingLg,
11
+ };
12
+ //# sourceMappingURL=HeaderBase.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderBase.constants.mjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAEtC,yBAAyB;AACzB,OAAO,EAAE,iBAAiB,EAAE,+BAA2B;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAGzC;IACF,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS;IAClD,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS;CACnD,CAAC","sourcesContent":["// External dependencies.\nimport { TextVariant } from '../Text';\n\n// Internal dependencies.\nimport { HeaderBaseVariant } from './HeaderBase.types';\n\n/**\n * Text variant mapping based on HeaderBase variant.\n */\nexport const HEADERBASE_VARIANT_TEXT_VARIANTS: Record<\n HeaderBaseVariant,\n TextVariant\n> = {\n [HeaderBaseVariant.Compact]: TextVariant.HeadingSm,\n [HeaderBaseVariant.Display]: TextVariant.HeadingLg,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBase.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgC,cAAc;AAWrD,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsJhD,CAAC"}
1
+ {"version":3,"file":"HeaderBase.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgC,cAAc;AAYrD,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAG1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8JhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBase.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgC,cAAc;AAWrD,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsJhD,CAAC"}
1
+ {"version":3,"file":"HeaderBase.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgC,cAAc;AAYrD,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAG1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8JhD,CAAC"}
@@ -13,8 +13,11 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
13
13
  // External dependencies.
14
14
  import { Box } from "../Box/index.mjs";
15
15
  import { ButtonIcon, ButtonIconSize } from "../ButtonIcon/index.mjs";
16
- import { Text, TextVariant } from "../Text/index.mjs";
17
- export const HeaderBase = ({ children, style, startAccessory, endAccessory, startButtonIconProps, endButtonIconProps, includesTopInset = false, startAccessoryWrapperProps, endAccessoryWrapperProps, titleTestID, twClassName, ...props }) => {
16
+ import { Text } from "../Text/index.mjs";
17
+ // Internal dependencies.
18
+ import { HEADERBASE_VARIANT_TEXT_VARIANTS } from "./HeaderBase.constants.mjs";
19
+ import { HeaderBaseVariant } from "./HeaderBase.types.mjs";
20
+ export const HeaderBase = ({ children, style, variant = HeaderBaseVariant.Compact, startAccessory, endAccessory, startButtonIconProps, endButtonIconProps, includesTopInset = false, startAccessoryWrapperProps, endAccessoryWrapperProps, titleTestID, twClassName, ...props }) => {
18
21
  const tw = useTailwind();
19
22
  const insets = useSafeAreaInsets();
20
23
  const [startAccessoryWidth, setStartAccessoryWidth] = useState(0);
@@ -29,11 +32,17 @@ export const HeaderBase = ({ children, style, startAccessory, endAccessory, star
29
32
  const hasStartContent = startAccessory || startButtonIconProps;
30
33
  const hasEndContent = endAccessory || (endButtonIconProps && endButtonIconProps.length > 0);
31
34
  const hasAnyAccessory = hasStartContent || hasEndContent;
32
- // Render both wrappers if any accessory exists (for centering)
33
- const shouldRenderStartWrapper = Boolean(hasAnyAccessory);
34
- const shouldRenderEndWrapper = Boolean(hasAnyAccessory);
35
- // Calculate equal width for both accessory wrappers to ensure title stays centered
36
- const accessoryWrapperWidth = hasAnyAccessory && (startAccessoryWidth || endAccessoryWidth)
35
+ const isCompact = variant === HeaderBaseVariant.Compact;
36
+ // For Compact variant, render both wrappers if any accessory exists (for centering)
37
+ // For Display variant, only render wrappers when they have content
38
+ const shouldRenderStartWrapper = isCompact
39
+ ? Boolean(hasAnyAccessory)
40
+ : Boolean(hasStartContent);
41
+ const shouldRenderEndWrapper = isCompact
42
+ ? Boolean(hasAnyAccessory)
43
+ : Boolean(hasEndContent);
44
+ // Calculate equal width for both accessory wrappers to ensure title stays centered (Compact only)
45
+ const accessoryWrapperWidth = isCompact && hasAnyAccessory && (startAccessoryWidth || endAccessoryWidth)
37
46
  ? Math.max(startAccessoryWidth, endAccessoryWidth)
38
47
  : undefined;
39
48
  const renderStartContent = () => {
@@ -84,8 +93,8 @@ export const HeaderBase = ({ children, style, startAccessory, endAccessory, star
84
93
  </View>)}
85
94
 
86
95
  {/* Title */}
87
- <Box twClassName="flex-1 items-center">
88
- {typeof children === 'string' ? (<Text variant={TextVariant.HeadingSm} testID={titleTestID} style={tw.style('text-center')}>
96
+ <Box twClassName={isCompact ? 'flex-1 items-center' : 'flex-1'}>
97
+ {typeof children === 'string' ? (<Text variant={HEADERBASE_VARIANT_TEXT_VARIANTS[variant]} testID={titleTestID} style={isCompact ? tw.style('text-center') : undefined}>
89
98
  {children}
90
99
  </Text>) : (children)}
91
100
  </Box>
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBase.mjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO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AC,WAAW,CAAC,SAAS,CAAC,CAC/B,MAAM,CAAC,CAAC,WAAW,CAAC,CACpB,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAE/B;YAAA,CAAC,QAAQ,CACX;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACH;MAAA,EAAE,GAAG,CAEL;;MAAA,CAAC,mBAAmB,CACpB;MAAA,CAAC,sBAAsB,IAAI,CACzB,CAAC,IAAI,CACH,KAAK,CAAC,CACJ,qBAAqB;gBACnB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;gBACzD,CAAC,CAAC,SAAS,CACd,CACD,IAAI,wBAAwB,CAAC,CAE7B;UAAA,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,wBAAwB,CAAC,CACnC,KAAK,CAAC,CACJ,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAC/D,CAED;YAAA,CAAC,gBAAgB,EAAE,CACrB;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback, useState } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { Box } from '../Box';\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { Text, TextVariant } from '../Text';\n\n// Internal dependencies.\nimport type { HeaderBaseProps } from './HeaderBase.types';\n\nexport const HeaderBase: React.FC<HeaderBaseProps> = ({\n children,\n style,\n startAccessory,\n endAccessory,\n startButtonIconProps,\n endButtonIconProps,\n includesTopInset = false,\n startAccessoryWrapperProps,\n endAccessoryWrapperProps,\n titleTestID,\n twClassName,\n ...props\n}) => {\n const tw = useTailwind();\n const insets = useSafeAreaInsets();\n\n const [startAccessoryWidth, setStartAccessoryWidth] = useState(0);\n const [endAccessoryWidth, setEndAccessoryWidth] = useState(0);\n\n const handleStartAccessoryLayout = useCallback((e: LayoutChangeEvent) => {\n setStartAccessoryWidth(e.nativeEvent.layout.width);\n }, []);\n\n const handleEndAccessoryLayout = useCallback((e: LayoutChangeEvent) => {\n setEndAccessoryWidth(e.nativeEvent.layout.width);\n }, []);\n\n // Determine what to render for start/end\n const hasStartContent = startAccessory || startButtonIconProps;\n const hasEndContent =\n endAccessory || (endButtonIconProps && endButtonIconProps.length > 0);\n const hasAnyAccessory = hasStartContent || hasEndContent;\n\n // Render both wrappers if any accessory exists (for centering)\n const shouldRenderStartWrapper = Boolean(hasAnyAccessory);\n const shouldRenderEndWrapper = Boolean(hasAnyAccessory);\n\n // Calculate equal width for both accessory wrappers to ensure title stays centered\n const accessoryWrapperWidth =\n hasAnyAccessory && (startAccessoryWidth || endAccessoryWidth)\n ? Math.max(startAccessoryWidth, endAccessoryWidth)\n : undefined;\n\n const renderStartContent = () => {\n if (startAccessory) {\n return startAccessory;\n }\n if (startButtonIconProps) {\n return <ButtonIcon size={ButtonIconSize.Md} {...startButtonIconProps} />;\n }\n return null;\n };\n\n const renderEndContent = () => {\n if (endAccessory) {\n return endAccessory;\n }\n if (endButtonIconProps && endButtonIconProps.length > 0) {\n // Reverse the array so first item appears rightmost\n // Use original index (before reversal) for stable React keys\n const reversedProps = endButtonIconProps\n .map((iconProps, originalIndex) => ({\n iconProps,\n originalIndex,\n }))\n .reverse();\n return reversedProps.map(({ iconProps, originalIndex }) => (\n <ButtonIcon\n key={`end-button-icon-${originalIndex}`}\n size={ButtonIconSize.Md}\n {...iconProps}\n />\n ));\n }\n return null;\n };\n\n // Check if we have multiple end buttons for layout styling\n const hasMultipleEndButtons =\n !endAccessory && endButtonIconProps && endButtonIconProps.length > 1;\n\n // Merge default styles with passed-in twClassName\n const baseStyles = 'flex-row items-center gap-4 h-14';\n const resolvedTwClassName = twClassName\n ? `${baseStyles} ${twClassName}`\n : baseStyles;\n\n return (\n <View\n style={[\n tw.style(resolvedTwClassName),\n includesTopInset && { marginTop: insets.top },\n style,\n ]}\n {...props}\n >\n {/* Start accessory */}\n {shouldRenderStartWrapper && (\n <View\n style={\n accessoryWrapperWidth\n ? tw.style('items-start', { width: accessoryWrapperWidth })\n : undefined\n }\n {...startAccessoryWrapperProps}\n >\n <View onLayout={handleStartAccessoryLayout}>\n {renderStartContent()}\n </View>\n </View>\n )}\n\n {/* Title */}\n <Box twClassName=\"flex-1 items-center\">\n {typeof children === 'string' ? (\n <Text\n variant={TextVariant.HeadingSm}\n testID={titleTestID}\n style={tw.style('text-center')}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </Box>\n\n {/* End accessory */}\n {shouldRenderEndWrapper && (\n <View\n style={\n accessoryWrapperWidth\n ? tw.style('items-end', { width: accessoryWrapperWidth })\n : undefined\n }\n {...endAccessoryWrapperProps}\n >\n <View\n onLayout={handleEndAccessoryLayout}\n style={\n hasMultipleEndButtons ? tw.style('flex-row gap-2') : undefined\n }\n >\n {renderEndContent()}\n </View>\n </View>\n )}\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"HeaderBase.mjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,QAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc;;AAErD,OAAO,EAAE,IAAI,EAAE,8BAAqB;AACpC,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,yBAAyB;AACzB,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gCAAsB;AAC3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qB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAC7D;QAAA,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC9B,CAAC,IAAI,CACH,OAAO,CAAC,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC,CACnD,MAAM,CAAC,CAAC,WAAW,CAAC,CACpB,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAEvD;YAAA,CAAC,QAAQ,CACX;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACH;MAAA,EAAE,GAAG,CAEL;;MAAA,CAAC,mBAAmB,CACpB;MAAA,CAAC,sBAAsB,IAAI,CACzB,CAAC,IAAI,CACH,KAAK,CAAC,CACJ,qBAAqB;gBACnB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;gBACzD,CAAC,CAAC,SAAS,CACd,CACD,IAAI,wBAAwB,CAAC,CAE7B;UAAA,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,wBAAwB,CAAC,CACnC,KAAK,CAAC,CACJ,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAC/D,CAED;YAAA,CAAC,gBAAgB,EAAE,CACrB;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback, useState } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { Box } from '../Box';\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { Text } from '../Text';\n\n// Internal dependencies.\nimport { HEADERBASE_VARIANT_TEXT_VARIANTS } from './HeaderBase.constants';\nimport type { HeaderBaseProps } from './HeaderBase.types';\nimport { HeaderBaseVariant } from './HeaderBase.types';\n\nexport const HeaderBase: React.FC<HeaderBaseProps> = ({\n children,\n style,\n variant = HeaderBaseVariant.Compact,\n startAccessory,\n endAccessory,\n startButtonIconProps,\n endButtonIconProps,\n includesTopInset = false,\n startAccessoryWrapperProps,\n endAccessoryWrapperProps,\n titleTestID,\n twClassName,\n ...props\n}) => {\n const tw = useTailwind();\n const insets = useSafeAreaInsets();\n\n const [startAccessoryWidth, setStartAccessoryWidth] = useState(0);\n const [endAccessoryWidth, setEndAccessoryWidth] = useState(0);\n\n const handleStartAccessoryLayout = useCallback((e: LayoutChangeEvent) => {\n setStartAccessoryWidth(e.nativeEvent.layout.width);\n }, []);\n\n const handleEndAccessoryLayout = useCallback((e: LayoutChangeEvent) => {\n setEndAccessoryWidth(e.nativeEvent.layout.width);\n }, []);\n\n // Determine what to render for start/end\n const hasStartContent = startAccessory || startButtonIconProps;\n const hasEndContent =\n endAccessory || (endButtonIconProps && endButtonIconProps.length > 0);\n const hasAnyAccessory = hasStartContent || hasEndContent;\n\n const isCompact = variant === HeaderBaseVariant.Compact;\n\n // For Compact variant, render both wrappers if any accessory exists (for centering)\n // For Display variant, only render wrappers when they have content\n const shouldRenderStartWrapper = isCompact\n ? Boolean(hasAnyAccessory)\n : Boolean(hasStartContent);\n const shouldRenderEndWrapper = isCompact\n ? Boolean(hasAnyAccessory)\n : Boolean(hasEndContent);\n\n // Calculate equal width for both accessory wrappers to ensure title stays centered (Compact only)\n const accessoryWrapperWidth =\n isCompact && hasAnyAccessory && (startAccessoryWidth || endAccessoryWidth)\n ? Math.max(startAccessoryWidth, endAccessoryWidth)\n : undefined;\n\n const renderStartContent = () => {\n if (startAccessory) {\n return startAccessory;\n }\n if (startButtonIconProps) {\n return <ButtonIcon size={ButtonIconSize.Md} {...startButtonIconProps} />;\n }\n return null;\n };\n\n const renderEndContent = () => {\n if (endAccessory) {\n return endAccessory;\n }\n if (endButtonIconProps && endButtonIconProps.length > 0) {\n // Reverse the array so first item appears rightmost\n // Use original index (before reversal) for stable React keys\n const reversedProps = endButtonIconProps\n .map((iconProps, originalIndex) => ({\n iconProps,\n originalIndex,\n }))\n .reverse();\n return reversedProps.map(({ iconProps, originalIndex }) => (\n <ButtonIcon\n key={`end-button-icon-${originalIndex}`}\n size={ButtonIconSize.Md}\n {...iconProps}\n />\n ));\n }\n return null;\n };\n\n // Check if we have multiple end buttons for layout styling\n const hasMultipleEndButtons =\n !endAccessory && endButtonIconProps && endButtonIconProps.length > 1;\n\n // Merge default styles with passed-in twClassName\n const baseStyles = 'flex-row items-center gap-4 h-14';\n const resolvedTwClassName = twClassName\n ? `${baseStyles} ${twClassName}`\n : baseStyles;\n\n return (\n <View\n style={[\n tw.style(resolvedTwClassName),\n includesTopInset && { marginTop: insets.top },\n style,\n ]}\n {...props}\n >\n {/* Start accessory */}\n {shouldRenderStartWrapper && (\n <View\n style={\n accessoryWrapperWidth\n ? tw.style('items-start', { width: accessoryWrapperWidth })\n : undefined\n }\n {...startAccessoryWrapperProps}\n >\n <View onLayout={handleStartAccessoryLayout}>\n {renderStartContent()}\n </View>\n </View>\n )}\n\n {/* Title */}\n <Box twClassName={isCompact ? 'flex-1 items-center' : 'flex-1'}>\n {typeof children === 'string' ? (\n <Text\n variant={HEADERBASE_VARIANT_TEXT_VARIANTS[variant]}\n testID={titleTestID}\n style={isCompact ? tw.style('text-center') : undefined}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </Box>\n\n {/* End accessory */}\n {shouldRenderEndWrapper && (\n <View\n style={\n accessoryWrapperWidth\n ? tw.style('items-end', { width: accessoryWrapperWidth })\n : undefined\n }\n {...endAccessoryWrapperProps}\n >\n <View\n onLayout={handleEndAccessoryLayout}\n style={\n hasMultipleEndButtons ? tw.style('flex-row gap-2') : undefined\n }\n >\n {renderEndContent()}\n </View>\n </View>\n )}\n </View>\n );\n};\n"]}
@@ -1,3 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HeaderBaseVariant = void 0;
4
+ /**
5
+ * Variant options for HeaderBase component.
6
+ * Controls title text size and alignment.
7
+ */
8
+ var HeaderBaseVariant;
9
+ (function (HeaderBaseVariant) {
10
+ /** Center-aligned title with HeadingSm text */
11
+ HeaderBaseVariant["Compact"] = "compact";
12
+ /** Left-aligned title with HeadingLg text */
13
+ HeaderBaseVariant["Display"] = "display";
14
+ })(HeaderBaseVariant || (exports.HeaderBaseVariant = HeaderBaseVariant = {}));
3
15
  //# sourceMappingURL=HeaderBase.types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBase.types.cjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { ReactNode } from 'react';\nimport type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\n// External dependencies.\nimport type { ButtonIconProps } from '../ButtonIcon';\n\n/**\n * HeaderBase component props.\n *\n * Extends React Native's ViewProps to inherit standard props such as\n * `testID`, `accessibilityLabel`, and other View props.\n */\nexport type HeaderBaseProps = ViewProps & {\n /**\n * Title of the HeaderBase. Pass a string for automatic Text rendering,\n * or a ReactNode for custom content.\n */\n children?: ReactNode | string;\n /**\n * Optional style for the header container.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional prop to include content to be displayed before the title.\n * Takes priority over startButtonIconProps if both are provided.\n */\n startAccessory?: ReactNode;\n /**\n * Optional prop to include content to be displayed after the title.\n * Takes priority over endButtonIconProps if both are provided.\n */\n endAccessory?: ReactNode;\n /**\n * Optional ButtonIcon props to render a ButtonIcon as the start accessory.\n * Only used if startAccessory is not provided.\n *\n * @default size: ButtonIconSize.Md\n */\n startButtonIconProps?: ButtonIconProps;\n /**\n * Optional array of ButtonIcon props to render multiple ButtonIcons as end accessories.\n * Rendered in reverse order (first item appears rightmost).\n * Only used if endAccessory is not provided.\n *\n * @default size: ButtonIconSize.Md for each\n */\n endButtonIconProps?: ButtonIconProps[];\n /**\n * Optional prop to include the top inset to make sure the header is visible\n * below device's notch.\n *\n * @default false\n */\n includesTopInset?: boolean;\n /**\n * Optional props to pass to the start accessory wrapper View.\n */\n startAccessoryWrapperProps?: ViewProps;\n /**\n * Optional props to pass to the end accessory wrapper View.\n */\n endAccessoryWrapperProps?: ViewProps;\n /**\n * Optional test ID for the title Text element.\n * Only used when children is a string.\n */\n titleTestID?: string;\n /**\n * Optional Tailwind class names for the header container.\n * Merged with default styles using tw.style().\n */\n twClassName?: string;\n};\n"]}
1
+ {"version":3,"file":"HeaderBase.types.cjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.types.ts"],"names":[],"mappings":";;;AAOA;;;GAGG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,+CAA+C;IAC/C,wCAAmB,CAAA;IACnB,6CAA6C;IAC7C,wCAAmB,CAAA;AACrB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B","sourcesContent":["// Third party dependencies.\nimport type { ReactNode } from 'react';\nimport type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\n// External dependencies.\nimport type { ButtonIconProps } from '../ButtonIcon';\n\n/**\n * Variant options for HeaderBase component.\n * Controls title text size and alignment.\n */\nexport enum HeaderBaseVariant {\n /** Center-aligned title with HeadingSm text */\n Compact = 'compact',\n /** Left-aligned title with HeadingLg text */\n Display = 'display',\n}\n\n/**\n * HeaderBase component props.\n *\n * Extends React Native's ViewProps to inherit standard props such as\n * `testID`, `accessibilityLabel`, and other View props.\n */\nexport type HeaderBaseProps = ViewProps & {\n /**\n * Variant controlling header text size.\n *\n * @default HeaderBaseVariant.Compact\n */\n variant?: HeaderBaseVariant;\n /**\n * Title of the HeaderBase. Pass a string for automatic Text rendering,\n * or a ReactNode for custom content.\n */\n children?: ReactNode | string;\n /**\n * Optional style for the header container.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional prop to include content to be displayed before the title.\n * Takes priority over startButtonIconProps if both are provided.\n */\n startAccessory?: ReactNode;\n /**\n * Optional prop to include content to be displayed after the title.\n * Takes priority over endButtonIconProps if both are provided.\n */\n endAccessory?: ReactNode;\n /**\n * Optional ButtonIcon props to render a ButtonIcon as the start accessory.\n * Only used if startAccessory is not provided.\n *\n * @default size: ButtonIconSize.Md\n */\n startButtonIconProps?: ButtonIconProps;\n /**\n * Optional array of ButtonIcon props to render multiple ButtonIcons as end accessories.\n * Rendered in reverse order (first item appears rightmost).\n * Only used if endAccessory is not provided.\n *\n * @default size: ButtonIconSize.Md for each\n */\n endButtonIconProps?: ButtonIconProps[];\n /**\n * Optional prop to include the top inset to make sure the header is visible\n * below device's notch.\n *\n * @default false\n */\n includesTopInset?: boolean;\n /**\n * Optional props to pass to the start accessory wrapper View.\n */\n startAccessoryWrapperProps?: ViewProps;\n /**\n * Optional props to pass to the end accessory wrapper View.\n */\n endAccessoryWrapperProps?: ViewProps;\n /**\n * Optional test ID for the title Text element.\n * Only used when children is a string.\n */\n titleTestID?: string;\n /**\n * Optional Tailwind class names for the header container.\n * Merged with default styles using tw.style().\n */\n twClassName?: string;\n};\n"]}
@@ -1,6 +1,16 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
3
3
  import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
4
+ /**
5
+ * Variant options for HeaderBase component.
6
+ * Controls title text size and alignment.
7
+ */
8
+ export declare enum HeaderBaseVariant {
9
+ /** Center-aligned title with HeadingSm text */
10
+ Compact = "compact",
11
+ /** Left-aligned title with HeadingLg text */
12
+ Display = "display"
13
+ }
4
14
  /**
5
15
  * HeaderBase component props.
6
16
  *
@@ -8,6 +18,12 @@ import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
8
18
  * `testID`, `accessibilityLabel`, and other View props.
9
19
  */
10
20
  export type HeaderBaseProps = ViewProps & {
21
+ /**
22
+ * Variant controlling header text size.
23
+ *
24
+ * @default HeaderBaseVariant.Compact
25
+ */
26
+ variant?: HeaderBaseVariant;
11
27
  /**
12
28
  * Title of the HeaderBase. Pass a string for automatic Text rendering,
13
29
  * or a ReactNode for custom content.
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;IACvC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,0BAA0B,CAAC,EAAE,SAAS,CAAC;IACvC;;OAEG;IACH,wBAAwB,CAAC,EAAE,SAAS,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"HeaderBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,+CAA+C;IAC/C,OAAO,YAAY;IACnB,6CAA6C;IAC7C,OAAO,YAAY;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;IACvC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,0BAA0B,CAAC,EAAE,SAAS,CAAC;IACvC;;OAEG;IACH,wBAAwB,CAAC,EAAE,SAAS,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -1,6 +1,16 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
3
3
  import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
4
+ /**
5
+ * Variant options for HeaderBase component.
6
+ * Controls title text size and alignment.
7
+ */
8
+ export declare enum HeaderBaseVariant {
9
+ /** Center-aligned title with HeadingSm text */
10
+ Compact = "compact",
11
+ /** Left-aligned title with HeadingLg text */
12
+ Display = "display"
13
+ }
4
14
  /**
5
15
  * HeaderBase component props.
6
16
  *
@@ -8,6 +18,12 @@ import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
8
18
  * `testID`, `accessibilityLabel`, and other View props.
9
19
  */
10
20
  export type HeaderBaseProps = ViewProps & {
21
+ /**
22
+ * Variant controlling header text size.
23
+ *
24
+ * @default HeaderBaseVariant.Compact
25
+ */
26
+ variant?: HeaderBaseVariant;
11
27
  /**
12
28
  * Title of the HeaderBase. Pass a string for automatic Text rendering,
13
29
  * or a ReactNode for custom content.
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;IACvC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,0BAA0B,CAAC,EAAE,SAAS,CAAC;IACvC;;OAEG;IACH,wBAAwB,CAAC,EAAE,SAAS,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"HeaderBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,+CAA+C;IAC/C,OAAO,YAAY;IACnB,6CAA6C;IAC7C,OAAO,YAAY;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;IACvC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,0BAA0B,CAAC,EAAE,SAAS,CAAC;IACvC;;OAEG;IACH,wBAAwB,CAAC,EAAE,SAAS,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -1,2 +1,12 @@
1
- export {};
1
+ /**
2
+ * Variant options for HeaderBase component.
3
+ * Controls title text size and alignment.
4
+ */
5
+ export var HeaderBaseVariant;
6
+ (function (HeaderBaseVariant) {
7
+ /** Center-aligned title with HeadingSm text */
8
+ HeaderBaseVariant["Compact"] = "compact";
9
+ /** Left-aligned title with HeadingLg text */
10
+ HeaderBaseVariant["Display"] = "display";
11
+ })(HeaderBaseVariant || (HeaderBaseVariant = {}));
2
12
  //# sourceMappingURL=HeaderBase.types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderBase.types.mjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { ReactNode } from 'react';\nimport type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\n// External dependencies.\nimport type { ButtonIconProps } from '../ButtonIcon';\n\n/**\n * HeaderBase component props.\n *\n * Extends React Native's ViewProps to inherit standard props such as\n * `testID`, `accessibilityLabel`, and other View props.\n */\nexport type HeaderBaseProps = ViewProps & {\n /**\n * Title of the HeaderBase. Pass a string for automatic Text rendering,\n * or a ReactNode for custom content.\n */\n children?: ReactNode | string;\n /**\n * Optional style for the header container.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional prop to include content to be displayed before the title.\n * Takes priority over startButtonIconProps if both are provided.\n */\n startAccessory?: ReactNode;\n /**\n * Optional prop to include content to be displayed after the title.\n * Takes priority over endButtonIconProps if both are provided.\n */\n endAccessory?: ReactNode;\n /**\n * Optional ButtonIcon props to render a ButtonIcon as the start accessory.\n * Only used if startAccessory is not provided.\n *\n * @default size: ButtonIconSize.Md\n */\n startButtonIconProps?: ButtonIconProps;\n /**\n * Optional array of ButtonIcon props to render multiple ButtonIcons as end accessories.\n * Rendered in reverse order (first item appears rightmost).\n * Only used if endAccessory is not provided.\n *\n * @default size: ButtonIconSize.Md for each\n */\n endButtonIconProps?: ButtonIconProps[];\n /**\n * Optional prop to include the top inset to make sure the header is visible\n * below device's notch.\n *\n * @default false\n */\n includesTopInset?: boolean;\n /**\n * Optional props to pass to the start accessory wrapper View.\n */\n startAccessoryWrapperProps?: ViewProps;\n /**\n * Optional props to pass to the end accessory wrapper View.\n */\n endAccessoryWrapperProps?: ViewProps;\n /**\n * Optional test ID for the title Text element.\n * Only used when children is a string.\n */\n titleTestID?: string;\n /**\n * Optional Tailwind class names for the header container.\n * Merged with default styles using tw.style().\n */\n twClassName?: string;\n};\n"]}
1
+ {"version":3,"file":"HeaderBase.types.mjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/HeaderBase.types.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,+CAA+C;IAC/C,wCAAmB,CAAA;IACnB,6CAA6C;IAC7C,wCAAmB,CAAA;AACrB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B","sourcesContent":["// Third party dependencies.\nimport type { ReactNode } from 'react';\nimport type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\n// External dependencies.\nimport type { ButtonIconProps } from '../ButtonIcon';\n\n/**\n * Variant options for HeaderBase component.\n * Controls title text size and alignment.\n */\nexport enum HeaderBaseVariant {\n /** Center-aligned title with HeadingSm text */\n Compact = 'compact',\n /** Left-aligned title with HeadingLg text */\n Display = 'display',\n}\n\n/**\n * HeaderBase component props.\n *\n * Extends React Native's ViewProps to inherit standard props such as\n * `testID`, `accessibilityLabel`, and other View props.\n */\nexport type HeaderBaseProps = ViewProps & {\n /**\n * Variant controlling header text size.\n *\n * @default HeaderBaseVariant.Compact\n */\n variant?: HeaderBaseVariant;\n /**\n * Title of the HeaderBase. Pass a string for automatic Text rendering,\n * or a ReactNode for custom content.\n */\n children?: ReactNode | string;\n /**\n * Optional style for the header container.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional prop to include content to be displayed before the title.\n * Takes priority over startButtonIconProps if both are provided.\n */\n startAccessory?: ReactNode;\n /**\n * Optional prop to include content to be displayed after the title.\n * Takes priority over endButtonIconProps if both are provided.\n */\n endAccessory?: ReactNode;\n /**\n * Optional ButtonIcon props to render a ButtonIcon as the start accessory.\n * Only used if startAccessory is not provided.\n *\n * @default size: ButtonIconSize.Md\n */\n startButtonIconProps?: ButtonIconProps;\n /**\n * Optional array of ButtonIcon props to render multiple ButtonIcons as end accessories.\n * Rendered in reverse order (first item appears rightmost).\n * Only used if endAccessory is not provided.\n *\n * @default size: ButtonIconSize.Md for each\n */\n endButtonIconProps?: ButtonIconProps[];\n /**\n * Optional prop to include the top inset to make sure the header is visible\n * below device's notch.\n *\n * @default false\n */\n includesTopInset?: boolean;\n /**\n * Optional props to pass to the start accessory wrapper View.\n */\n startAccessoryWrapperProps?: ViewProps;\n /**\n * Optional props to pass to the end accessory wrapper View.\n */\n endAccessoryWrapperProps?: ViewProps;\n /**\n * Optional test ID for the title Text element.\n * Only used when children is a string.\n */\n titleTestID?: string;\n /**\n * Optional Tailwind class names for the header container.\n * Merged with default styles using tw.style().\n */\n twClassName?: string;\n};\n"]}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HeaderBase = void 0;
3
+ exports.HeaderBaseVariant = exports.HeaderBase = void 0;
4
4
  var HeaderBase_1 = require("./HeaderBase.cjs");
5
5
  Object.defineProperty(exports, "HeaderBase", { enumerable: true, get: function () { return HeaderBase_1.HeaderBase; } });
6
+ var HeaderBase_types_1 = require("./HeaderBase.types.cjs");
7
+ Object.defineProperty(exports, "HeaderBaseVariant", { enumerable: true, get: function () { return HeaderBase_types_1.HeaderBaseVariant; } });
6
8
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { HeaderBase } from './HeaderBase';\nexport type { HeaderBaseProps } from './HeaderBase.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,2DAAuD;AAA9C,qHAAA,iBAAiB,OAAA","sourcesContent":["export { HeaderBase } from './HeaderBase';\nexport { HeaderBaseVariant } from './HeaderBase.types';\nexport type { HeaderBaseProps } from './HeaderBase.types';\n"]}
@@ -1,3 +1,4 @@
1
1
  export { HeaderBase } from "./HeaderBase.cjs";
2
+ export { HeaderBaseVariant } from "./HeaderBase.types.cjs";
2
3
  export type { HeaderBaseProps } from "./HeaderBase.types.cjs";
3
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,OAAO,EAAE,iBAAiB,EAAE,+BAA2B;AACvD,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,3 +1,4 @@
1
1
  export { HeaderBase } from "./HeaderBase.mjs";
2
+ export { HeaderBaseVariant } from "./HeaderBase.types.mjs";
2
3
  export type { HeaderBaseProps } from "./HeaderBase.types.mjs";
3
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,OAAO,EAAE,iBAAiB,EAAE,+BAA2B;AACvD,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,2 +1,3 @@
1
1
  export { HeaderBase } from "./HeaderBase.mjs";
2
+ export { HeaderBaseVariant } from "./HeaderBase.types.mjs";
2
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { HeaderBase } from './HeaderBase';\nexport type { HeaderBaseProps } from './HeaderBase.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/HeaderBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,OAAO,EAAE,iBAAiB,EAAE,+BAA2B","sourcesContent":["export { HeaderBase } from './HeaderBase';\nexport { HeaderBaseVariant } from './HeaderBase.types';\nexport type { HeaderBaseProps } from './HeaderBase.types';\n"]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.SensitiveText = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const Text_1 = require("../Text/index.cjs");
29
+ const SensitiveText_constants_1 = require("./SensitiveText.constants.cjs");
30
+ const isValidLength = (value) => {
31
+ const num = Number(value);
32
+ return !Number.isNaN(num) && num > 0;
33
+ };
34
+ const SensitiveText = ({ isHidden = false, length = SensitiveText_constants_1.SensitiveTextLength.Short, children, ...props }) => {
35
+ const fallback = (0, react_1.useMemo)(() => {
36
+ let resolvedLength = length;
37
+ if (!(length in SensitiveText_constants_1.SensitiveTextLength) && !isValidLength(length)) {
38
+ console.warn(`Invalid length provided: ${length}. Falling back to Short.`);
39
+ resolvedLength = SensitiveText_constants_1.SensitiveTextLength.Short;
40
+ }
41
+ const numLength = Number(resolvedLength);
42
+ return '•'.repeat(Number.isNaN(numLength) ? 0 : numLength);
43
+ }, [length]);
44
+ return <Text_1.Text {...props}>{isHidden ? fallback : children}</Text_1.Text>;
45
+ };
46
+ exports.SensitiveText = SensitiveText;
47
+ //# sourceMappingURL=SensitiveText.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SensitiveText.cjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAuC;AAEvC,4CAA+B;AAE/B,2EAAgE;AAGhE,MAAM,aAAa,GAAG,CAAC,KAAa,EAAW,EAAE;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AAEK,MAAM,aAAa,GAAiC,CAAC,EAC1D,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,6CAAmB,CAAC,KAAK,EAClC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC5B,IAAI,cAAc,GAAG,MAAM,CAAC;QAE5B,IAAI,CAAC,CAAC,MAAM,IAAI,6CAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;YAC9D,OAAO,CAAC,IAAI,CACV,4BAA4B,MAAM,0BAA0B,CAC7D,CAAC;YACF,cAAc,GAAG,6CAAmB,CAAC,KAAK,CAAC;SAC5C;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QACzC,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,CAAC,WAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,WAAI,CAAC,CAAC;AAClE,CAAC,CAAC;AArBW,QAAA,aAAa,iBAqBxB","sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Text } from '../Text';\n\nimport { SensitiveTextLength } from './SensitiveText.constants';\nimport type { SensitiveTextProps } from './SensitiveText.types';\n\nconst isValidLength = (value: string): boolean => {\n const num = Number(value);\n return !Number.isNaN(num) && num > 0;\n};\n\nexport const SensitiveText: React.FC<SensitiveTextProps> = ({\n isHidden = false,\n length = SensitiveTextLength.Short,\n children,\n ...props\n}) => {\n const fallback = useMemo(() => {\n let resolvedLength = length;\n\n if (!(length in SensitiveTextLength) && !isValidLength(length)) {\n console.warn(\n `Invalid length provided: ${length}. Falling back to Short.`,\n );\n resolvedLength = SensitiveTextLength.Short;\n }\n\n const numLength = Number(resolvedLength);\n return '•'.repeat(Number.isNaN(numLength) ? 0 : numLength);\n }, [length]);\n\n return <Text {...props}>{isHidden ? fallback : children}</Text>;\n};\n"]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SensitiveTextLength = void 0;
4
+ /**
5
+ * Predefined length options for SensitiveText hidden content.
6
+ * Values represent the number of bullet characters displayed when text is hidden.
7
+ */
8
+ exports.SensitiveTextLength = {
9
+ Short: '6',
10
+ Medium: '9',
11
+ Long: '12',
12
+ ExtraLong: '20',
13
+ };
14
+ //# sourceMappingURL=SensitiveText.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SensitiveText.constants.cjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.constants.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,mBAAmB,GAAG;IACjC,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;CACP,CAAC","sourcesContent":["/**\n * Predefined length options for SensitiveText hidden content.\n * Values represent the number of bullet characters displayed when text is hidden.\n */\nexport const SensitiveTextLength = {\n Short: '6',\n Medium: '9',\n Long: '12',\n ExtraLong: '20',\n} as const;\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Predefined length options for SensitiveText hidden content.
3
+ * Values represent the number of bullet characters displayed when text is hidden.
4
+ */
5
+ export declare const SensitiveTextLength: {
6
+ readonly Short: "6";
7
+ readonly Medium: "9";
8
+ readonly Long: "12";
9
+ readonly ExtraLong: "20";
10
+ };
11
+ //# sourceMappingURL=SensitiveText.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SensitiveText.constants.d.cts","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Predefined length options for SensitiveText hidden content.
3
+ * Values represent the number of bullet characters displayed when text is hidden.
4
+ */
5
+ export declare const SensitiveTextLength: {
6
+ readonly Short: "6";
7
+ readonly Medium: "9";
8
+ readonly Long: "12";
9
+ readonly ExtraLong: "20";
10
+ };
11
+ //# sourceMappingURL=SensitiveText.constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SensitiveText.constants.d.mts","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Predefined length options for SensitiveText hidden content.
3
+ * Values represent the number of bullet characters displayed when text is hidden.
4
+ */
5
+ export const SensitiveTextLength = {
6
+ Short: '6',
7
+ Medium: '9',
8
+ Long: '12',
9
+ ExtraLong: '20',
10
+ };
11
+ //# sourceMappingURL=SensitiveText.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SensitiveText.constants.mjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;CACP,CAAC","sourcesContent":["/**\n * Predefined length options for SensitiveText hidden content.\n * Values represent the number of bullet characters displayed when text is hidden.\n */\nexport const SensitiveTextLength = {\n Short: '6',\n Medium: '9',\n Long: '12',\n ExtraLong: '20',\n} as const;\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { SensitiveTextProps } from "./SensitiveText.types.cjs";
3
+ export declare const SensitiveText: React.FC<SensitiveTextProps>;
4
+ //# sourceMappingURL=SensitiveText.d.cts.map