@metamask-previews/design-system-react-native 0.56.1-preview-00dfeb8 → 0.56.1-preview-7d5964a

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 (161) hide show
  1. package/dist/components/BoxColumn/BoxColumn.cjs +0 -13
  2. package/dist/components/BoxColumn/BoxColumn.cjs.map +1 -1
  3. package/dist/components/BoxColumn/BoxColumn.d.cts +0 -13
  4. package/dist/components/BoxColumn/BoxColumn.d.cts.map +1 -1
  5. package/dist/components/BoxColumn/BoxColumn.d.mts +0 -13
  6. package/dist/components/BoxColumn/BoxColumn.d.mts.map +1 -1
  7. package/dist/components/BoxColumn/BoxColumn.mjs +0 -13
  8. package/dist/components/BoxColumn/BoxColumn.mjs.map +1 -1
  9. package/dist/components/BoxColumn/BoxColumn.types.cjs.map +1 -1
  10. package/dist/components/BoxColumn/BoxColumn.types.d.cts +0 -2
  11. package/dist/components/BoxColumn/BoxColumn.types.d.cts.map +1 -1
  12. package/dist/components/BoxColumn/BoxColumn.types.d.mts +0 -2
  13. package/dist/components/BoxColumn/BoxColumn.types.d.mts.map +1 -1
  14. package/dist/components/BoxColumn/BoxColumn.types.mjs.map +1 -1
  15. package/dist/components/BoxRow/BoxRow.cjs +0 -13
  16. package/dist/components/BoxRow/BoxRow.cjs.map +1 -1
  17. package/dist/components/BoxRow/BoxRow.d.cts +0 -13
  18. package/dist/components/BoxRow/BoxRow.d.cts.map +1 -1
  19. package/dist/components/BoxRow/BoxRow.d.mts +0 -13
  20. package/dist/components/BoxRow/BoxRow.d.mts.map +1 -1
  21. package/dist/components/BoxRow/BoxRow.mjs +0 -13
  22. package/dist/components/BoxRow/BoxRow.mjs.map +1 -1
  23. package/dist/components/BoxRow/BoxRow.types.cjs.map +1 -1
  24. package/dist/components/BoxRow/BoxRow.types.d.cts +0 -2
  25. package/dist/components/BoxRow/BoxRow.types.d.cts.map +1 -1
  26. package/dist/components/BoxRow/BoxRow.types.d.mts +0 -2
  27. package/dist/components/BoxRow/BoxRow.types.d.mts.map +1 -1
  28. package/dist/components/BoxRow/BoxRow.types.mjs.map +1 -1
  29. package/dist/components/ButtonBase/ButtonBase.cjs +5 -9
  30. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  31. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  32. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  33. package/dist/components/ButtonBase/ButtonBase.mjs +6 -10
  34. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  35. package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
  36. package/dist/components/ButtonBase/ButtonBase.types.d.cts +3 -2
  37. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  38. package/dist/components/ButtonBase/ButtonBase.types.d.mts +3 -2
  39. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  40. package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
  41. package/dist/components/Content/Content.cjs +32 -40
  42. package/dist/components/Content/Content.cjs.map +1 -1
  43. package/dist/components/Content/Content.d.cts.map +1 -1
  44. package/dist/components/Content/Content.d.mts.map +1 -1
  45. package/dist/components/Content/Content.mjs +32 -40
  46. package/dist/components/Content/Content.mjs.map +1 -1
  47. package/dist/components/HeaderRoot/HeaderRoot.cjs +5 -8
  48. package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -1
  49. package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -1
  50. package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -1
  51. package/dist/components/HeaderRoot/HeaderRoot.mjs +5 -8
  52. package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -1
  53. package/dist/components/KeyValueColumn/KeyValueColumn.cjs +12 -21
  54. package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
  55. package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
  56. package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
  57. package/dist/components/KeyValueColumn/KeyValueColumn.mjs +13 -22
  58. package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
  59. package/dist/components/KeyValueRow/KeyValueRow.cjs +10 -19
  60. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
  61. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
  62. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
  63. package/dist/components/KeyValueRow/KeyValueRow.mjs +11 -20
  64. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
  65. package/dist/components/ListItem/ListItem.cjs +3 -4
  66. package/dist/components/ListItem/ListItem.cjs.map +1 -1
  67. package/dist/components/ListItem/ListItem.d.cts.map +1 -1
  68. package/dist/components/ListItem/ListItem.d.mts.map +1 -1
  69. package/dist/components/ListItem/ListItem.mjs +4 -5
  70. package/dist/components/ListItem/ListItem.mjs.map +1 -1
  71. package/dist/components/SectionHeader/SectionHeader.cjs +10 -17
  72. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
  73. package/dist/components/SectionHeader/SectionHeader.d.cts +2 -2
  74. package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
  75. package/dist/components/SectionHeader/SectionHeader.d.mts +2 -2
  76. package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
  77. package/dist/components/SectionHeader/SectionHeader.mjs +11 -18
  78. package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
  79. package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -1
  80. package/dist/components/SectionHeader/SectionHeader.types.d.cts +5 -5
  81. package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -1
  82. package/dist/components/SectionHeader/SectionHeader.types.d.mts +5 -5
  83. package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -1
  84. package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -1
  85. package/dist/components/Tag/Tag.cjs +18 -12
  86. package/dist/components/Tag/Tag.cjs.map +1 -1
  87. package/dist/components/Tag/Tag.d.cts.map +1 -1
  88. package/dist/components/Tag/Tag.d.mts.map +1 -1
  89. package/dist/components/Tag/Tag.mjs +19 -13
  90. package/dist/components/Tag/Tag.mjs.map +1 -1
  91. package/dist/components/TitleAlert/TitleAlert.cjs +18 -20
  92. package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -1
  93. package/dist/components/TitleAlert/TitleAlert.d.cts +3 -3
  94. package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -1
  95. package/dist/components/TitleAlert/TitleAlert.d.mts +3 -3
  96. package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -1
  97. package/dist/components/TitleAlert/TitleAlert.mjs +19 -21
  98. package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -1
  99. package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -1
  100. package/dist/components/TitleAlert/TitleAlert.types.d.cts +7 -6
  101. package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -1
  102. package/dist/components/TitleAlert/TitleAlert.types.d.mts +7 -6
  103. package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -1
  104. package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -1
  105. package/dist/components/TitleHub/TitleHub.cjs +13 -22
  106. package/dist/components/TitleHub/TitleHub.cjs.map +1 -1
  107. package/dist/components/TitleHub/TitleHub.d.cts +3 -3
  108. package/dist/components/TitleHub/TitleHub.d.cts.map +1 -1
  109. package/dist/components/TitleHub/TitleHub.d.mts +3 -3
  110. package/dist/components/TitleHub/TitleHub.d.mts.map +1 -1
  111. package/dist/components/TitleHub/TitleHub.mjs +14 -23
  112. package/dist/components/TitleHub/TitleHub.mjs.map +1 -1
  113. package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -1
  114. package/dist/components/TitleHub/TitleHub.types.d.cts +10 -10
  115. package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
  116. package/dist/components/TitleHub/TitleHub.types.d.mts +10 -10
  117. package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
  118. package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -1
  119. package/dist/components/TitleStandard/TitleStandard.cjs +9 -15
  120. package/dist/components/TitleStandard/TitleStandard.cjs.map +1 -1
  121. package/dist/components/TitleStandard/TitleStandard.d.cts +2 -2
  122. package/dist/components/TitleStandard/TitleStandard.d.cts.map +1 -1
  123. package/dist/components/TitleStandard/TitleStandard.d.mts +2 -2
  124. package/dist/components/TitleStandard/TitleStandard.d.mts.map +1 -1
  125. package/dist/components/TitleStandard/TitleStandard.mjs +10 -16
  126. package/dist/components/TitleStandard/TitleStandard.mjs.map +1 -1
  127. package/dist/components/TitleStandard/TitleStandard.types.cjs.map +1 -1
  128. package/dist/components/TitleStandard/TitleStandard.types.d.cts +7 -7
  129. package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -1
  130. package/dist/components/TitleStandard/TitleStandard.types.d.mts +7 -7
  131. package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -1
  132. package/dist/components/TitleStandard/TitleStandard.types.mjs.map +1 -1
  133. package/dist/components/TitleSubpage/TitleSubpage.cjs +18 -31
  134. package/dist/components/TitleSubpage/TitleSubpage.cjs.map +1 -1
  135. package/dist/components/TitleSubpage/TitleSubpage.d.cts +3 -3
  136. package/dist/components/TitleSubpage/TitleSubpage.d.cts.map +1 -1
  137. package/dist/components/TitleSubpage/TitleSubpage.d.mts +3 -3
  138. package/dist/components/TitleSubpage/TitleSubpage.d.mts.map +1 -1
  139. package/dist/components/TitleSubpage/TitleSubpage.mjs +19 -32
  140. package/dist/components/TitleSubpage/TitleSubpage.mjs.map +1 -1
  141. package/dist/components/TitleSubpage/TitleSubpage.types.cjs.map +1 -1
  142. package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +9 -8
  143. package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -1
  144. package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +9 -8
  145. package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -1
  146. package/dist/components/TitleSubpage/TitleSubpage.types.mjs.map +1 -1
  147. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs +7 -9
  148. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs.map +1 -1
  149. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts.map +1 -1
  150. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts.map +1 -1
  151. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs +8 -10
  152. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs.map +1 -1
  153. package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs +1 -1
  154. package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs.map +1 -1
  155. package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs +1 -1
  156. package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs.map +1 -1
  157. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
  158. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +1 -1
  159. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +1 -1
  160. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
  161. package/package.json +4 -4
@@ -9,19 +9,19 @@ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-t
9
9
  const react_1 = __importDefault(require("react"));
10
10
  const react_native_1 = require("react-native");
11
11
  const Box_1 = require("../Box/index.cjs");
12
+ const BoxRow_1 = require("../BoxRow/index.cjs");
12
13
  const Icon_1 = require("../Icon/index.cjs");
13
- const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
14
14
  /**
15
15
  * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.
16
16
  * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.
17
- * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.
17
+ * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.
18
18
  *
19
19
  * @param sectionHeaderProps - Component props
20
20
  * @param sectionHeaderProps.title - Title content for the inner row (required)
21
21
  * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)
22
22
  * @param sectionHeaderProps.children - Optional full-width content below the header row
23
23
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
24
- * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`
24
+ * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
25
25
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
26
26
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
27
27
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
@@ -42,25 +42,20 @@ const SectionHeader = (sectionHeaderProps) => {
42
42
  const resolvedStartAccessory = startIconName ? (<Icon_1.Icon size={design_system_shared_1.IconSize.Md} color={design_system_shared_1.IconColor.IconDefault} twClassName="shrink-0" {...startIconProps} name={startIconName}/>) : (startAccessory);
43
43
  const resolvedEndAccessory = resolvedEndIconName ? (<Icon_1.Icon size={design_system_shared_1.IconSize.Md} color={design_system_shared_1.IconColor.IconAlternative} twClassName="shrink-0" {...endIconProps} name={resolvedEndIconName}/>) : (endAccessory);
44
44
  const hasAccessories = Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);
45
- const titleRow = title ? (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} {...titleWrapperProps} twClassName={(0, design_system_shared_1.mergeTwClassName)(hasAccessories ? 'w-full shrink min-w-0' : '', titleWrapperProps?.twClassName)}>
46
- <TextOrChildren_1.TextOrChildren textProps={{
45
+ const titleRow = title ? (<BoxRow_1.BoxRow {...titleWrapperProps} gap={1} endAccessory={titleAccessory} twClassName={(0, design_system_shared_1.mergeTwClassName)(hasAccessories ? 'w-full shrink min-w-0' : '', titleWrapperProps?.twClassName)} textProps={{
47
46
  variant: design_system_shared_1.TextVariant.HeadingMd,
48
47
  color: design_system_shared_1.TextColor.TextDefault,
49
48
  ...titleProps,
50
49
  }}>
51
- {title}
52
- </TextOrChildren_1.TextOrChildren>
53
- {titleAccessory}
54
- </Box_1.Box>) : null;
50
+ {title}
51
+ </BoxRow_1.BoxRow>) : null;
55
52
  let mainContent = null;
56
53
  if (titleRow) {
57
54
  mainContent = hasAccessories ? (<Box_1.Box twClassName="shrink min-w-0">{titleRow}</Box_1.Box>) : (titleRow);
58
55
  }
59
- const headerRow = (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1}>
60
- {resolvedStartAccessory}
56
+ const headerRow = (<BoxRow_1.BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
61
57
  {mainContent}
62
- {resolvedEndAccessory}
63
- </Box_1.Box>);
58
+ </BoxRow_1.BoxRow>);
64
59
  const body = children ? (<Box_1.Box gap={1}>
65
60
  {headerRow}
66
61
  {children}
@@ -82,11 +77,9 @@ const SectionHeader = (sectionHeaderProps) => {
82
77
  {children}
83
78
  </Box_1.Box>);
84
79
  }
85
- return (<Box_1.Box {...props} flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} style={style} twClassName={(0, design_system_shared_1.mergeTwClassName)('px-4 pb-2 pt-3', twClassName)}>
86
- {resolvedStartAccessory}
80
+ return (<BoxRow_1.BoxRow {...props} gap={1} style={style} twClassName={(0, design_system_shared_1.mergeTwClassName)('px-4 pb-2 pt-3', twClassName)} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
87
81
  {mainContent}
88
- {resolvedEndAccessory}
89
- </Box_1.Box>);
82
+ </BoxRow_1.BoxRow>);
90
83
  };
91
84
  exports.SectionHeader = SectionHeader;
92
85
  exports.SectionHeader.displayName = 'SectionHeader';
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.cjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,kFASiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAyC;AAEzC,0CAA6B;AAC7B,4CAA+B;AAC/B,gFAAmE;AAInE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,aAAa,GAAiC,CACzD,kBAAkB,EAClB,EAAE;IACF,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACT,GAAG,kBAAkB,CAAC;IAEvB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,mBAAmB,GACvB,WAAW;QACX,CAAC,aAAa,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,+BAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAErE,MAAM,sBAAsB,GAAG,aAAa,CAAC,CAAC,CAAC,CAC7C,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,CAClB,KAAK,CAAC,CAAC,gCAAS,CAAC,WAAW,CAAC,CAC7B,WAAW,CAAC,UAAU,CACtB,IAAI,cAAc,CAAC,CACnB,IAAI,CAAC,CAAC,aAAa,CAAC,EACpB,CACH,CAAC,CAAC,CAAC,CACF,cAAc,CACf,CAAC;IAEF,MAAM,oBAA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ACpE,CAAC,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,IAAI,CACP;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CACL,CAAC,SAAG,CACF,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAE7D;QAAA,CAAC,SAAS,CACV;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,SAAG,CAAC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,SAAG,CACF,IAAI,KAAK,CAAC,CACV,aAAa,CAAC,CAAC,uCAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAE7D;MAAA,CAAC,sBAAsB,CACvB;MAAA,CAAC,WAAW,CACZ;MAAA,CAAC,oBAAoB,CACvB;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAhKW,QAAA,aAAa,iBAgKxB;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { Icon } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)\n * @param sectionHeaderProps.children - Optional full-width content below the header row\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const titleRow = title ? (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n {...titleWrapperProps}\n twClassName={mergeTwClassName(\n hasAccessories ? 'w-full shrink min-w-0' : '',\n titleWrapperProps?.twClassName,\n )}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </TextOrChildren>\n {titleAccessory}\n </Box>\n ) : null;\n\n let mainContent = null;\n if (titleRow) {\n mainContent = hasAccessories ? (\n <Box twClassName=\"shrink min-w-0\">{titleRow}</Box>\n ) : (\n titleRow\n );\n }\n\n const headerRow = (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n >\n {resolvedStartAccessory}\n {mainContent}\n {resolvedEndAccessory}\n </Box>\n );\n\n const body = children ? (\n <Box gap={1}>\n {headerRow}\n {children}\n </Box>\n ) : (\n headerRow\n );\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n {body}\n </Pressable>\n );\n }\n\n if (children) {\n return (\n <Box\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n >\n {headerRow}\n {children}\n </Box>\n );\n }\n\n return (\n <Box\n {...props}\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n >\n {resolvedStartAccessory}\n {mainContent}\n {resolvedEndAccessory}\n </Box>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
1
+ {"version":3,"file":"SectionHeader.cjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAOiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAyC;AAEzC,0CAA6B;AAC7B,gDAAmC;AACnC,4CAA+B;AAI/B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,aAAa,GAAiC,CACzD,kBAAkB,EAClB,EAAE;IACF,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACT,GAAG,kBAAkB,CAAC;IAEvB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,mBAAmB,GACvB,WAAW;QACX,CAAC,aAAa,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,+BAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAErE,MAAM,sBAAsB,GAAG,aAAa,CAAC,CAAC,CAAC,CAC7C,CAAC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,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACpE,CAAC,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,IAAI,CACP;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CACL,CAAC,SAAG,CACF,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAE7D;QAAA,CAAC,SAAS,CACV;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,SAAG,CAAC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,eAAM,CACL,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAC7D,cAAc,CAAC,CAAC,sBAAsB,CAAC,CACvC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAEnC;MAAA,CAAC,WAAW,CACd;IAAA,EAAE,eAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAvJW,QAAA,aAAa,iBAuJxB;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon } from '../Icon';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)\n * @param sectionHeaderProps.children - Optional full-width content below the header row\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const titleRow = title ? (\n <BoxRow\n {...titleWrapperProps}\n gap={1}\n endAccessory={titleAccessory}\n twClassName={mergeTwClassName(\n hasAccessories ? 'w-full shrink min-w-0' : '',\n titleWrapperProps?.twClassName,\n )}\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null;\n\n let mainContent = null;\n if (titleRow) {\n mainContent = hasAccessories ? (\n <Box twClassName=\"shrink min-w-0\">{titleRow}</Box>\n ) : (\n titleRow\n );\n }\n\n const headerRow = (\n <BoxRow\n gap={1}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n\n const body = children ? (\n <Box gap={1}>\n {headerRow}\n {children}\n </Box>\n ) : (\n headerRow\n );\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n {body}\n </Pressable>\n );\n }\n\n if (children) {\n return (\n <Box\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n >\n {headerRow}\n {children}\n </Box>\n );\n }\n\n return (\n <BoxRow\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
@@ -3,14 +3,14 @@ import type { SectionHeaderProps } from "./SectionHeader.types.cjs";
3
3
  /**
4
4
  * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.
5
5
  * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.
6
- * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.
6
+ * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.
7
7
  *
8
8
  * @param sectionHeaderProps - Component props
9
9
  * @param sectionHeaderProps.title - Title content for the inner row (required)
10
10
  * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)
11
11
  * @param sectionHeaderProps.children - Optional full-width content below the header row
12
12
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
13
- * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`
13
+ * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
14
14
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
15
15
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
16
16
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.d.cts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgKtD,CAAC"}
1
+ {"version":3,"file":"SectionHeader.d.cts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuJtD,CAAC"}
@@ -3,14 +3,14 @@ import type { SectionHeaderProps } from "./SectionHeader.types.mjs";
3
3
  /**
4
4
  * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.
5
5
  * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.
6
- * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.
6
+ * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.
7
7
  *
8
8
  * @param sectionHeaderProps - Component props
9
9
  * @param sectionHeaderProps.title - Title content for the inner row (required)
10
10
  * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)
11
11
  * @param sectionHeaderProps.children - Optional full-width content below the header row
12
12
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
13
- * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`
13
+ * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
14
14
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
15
15
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
16
16
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgKtD,CAAC"}
1
+ {"version":3,"file":"SectionHeader.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuJtD,CAAC"}
@@ -4,25 +4,25 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { BoxAlignItems, BoxFlexDirection, IconColor, IconName, IconSize, mergeTwClassName, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
7
+ import { IconColor, IconName, IconSize, mergeTwClassName, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
8
8
  import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
9
9
  import $React from "react";
10
10
  const React = $importDefault($React);
11
11
  import { Pressable } from "react-native";
12
12
  import { Box } from "../Box/index.mjs";
13
+ import { BoxRow } from "../BoxRow/index.mjs";
13
14
  import { Icon } from "../Icon/index.mjs";
14
- import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
15
15
  /**
16
16
  * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.
17
17
  * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.
18
- * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.
18
+ * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.
19
19
  *
20
20
  * @param sectionHeaderProps - Component props
21
21
  * @param sectionHeaderProps.title - Title content for the inner row (required)
22
22
  * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)
23
23
  * @param sectionHeaderProps.children - Optional full-width content below the header row
24
24
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
25
- * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`
25
+ * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
26
26
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
27
27
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
28
28
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
@@ -43,25 +43,20 @@ export const SectionHeader = (sectionHeaderProps) => {
43
43
  const resolvedStartAccessory = startIconName ? (<Icon size={IconSize.Md} color={IconColor.IconDefault} twClassName="shrink-0" {...startIconProps} name={startIconName}/>) : (startAccessory);
44
44
  const resolvedEndAccessory = resolvedEndIconName ? (<Icon size={IconSize.Md} color={IconColor.IconAlternative} twClassName="shrink-0" {...endIconProps} name={resolvedEndIconName}/>) : (endAccessory);
45
45
  const hasAccessories = Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);
46
- const titleRow = title ? (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1} {...titleWrapperProps} twClassName={mergeTwClassName(hasAccessories ? 'w-full shrink min-w-0' : '', titleWrapperProps?.twClassName)}>
47
- <TextOrChildren textProps={{
46
+ const titleRow = title ? (<BoxRow {...titleWrapperProps} gap={1} endAccessory={titleAccessory} twClassName={mergeTwClassName(hasAccessories ? 'w-full shrink min-w-0' : '', titleWrapperProps?.twClassName)} textProps={{
48
47
  variant: TextVariant.HeadingMd,
49
48
  color: TextColor.TextDefault,
50
49
  ...titleProps,
51
50
  }}>
52
- {title}
53
- </TextOrChildren>
54
- {titleAccessory}
55
- </Box>) : null;
51
+ {title}
52
+ </BoxRow>) : null;
56
53
  let mainContent = null;
57
54
  if (titleRow) {
58
55
  mainContent = hasAccessories ? (<Box twClassName="shrink min-w-0">{titleRow}</Box>) : (titleRow);
59
56
  }
60
- const headerRow = (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1}>
61
- {resolvedStartAccessory}
57
+ const headerRow = (<BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
62
58
  {mainContent}
63
- {resolvedEndAccessory}
64
- </Box>);
59
+ </BoxRow>);
65
60
  const body = children ? (<Box gap={1}>
66
61
  {headerRow}
67
62
  {children}
@@ -83,11 +78,9 @@ export const SectionHeader = (sectionHeaderProps) => {
83
78
  {children}
84
79
  </Box>);
85
80
  }
86
- return (<Box {...props} flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}>
87
- {resolvedStartAccessory}
81
+ return (<BoxRow {...props} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
88
82
  {mainContent}
89
- {resolvedEndAccessory}
90
- </Box>);
83
+ </BoxRow>);
91
84
  };
92
85
  SectionHeader.displayName = 'SectionHeader';
93
86
  //# sourceMappingURL=SectionHeader.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,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b,WAAW,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAE7D;QAAA,CAAC,SAAS,CACV;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,GAAG,CAAC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,GAAG,CACF,IAAI,KAAK,CAAC,CACV,aAAa,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAE7D;MAAA,CAAC,sBAAsB,CACvB;MAAA,CAAC,WAAW,CACZ;MAAA,CAAC,oBAAoB,CACvB;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { Icon } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)\n * @param sectionHeaderProps.children - Optional full-width content below the header row\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const titleRow = title ? (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n {...titleWrapperProps}\n twClassName={mergeTwClassName(\n hasAccessories ? 'w-full shrink min-w-0' : '',\n titleWrapperProps?.twClassName,\n )}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </TextOrChildren>\n {titleAccessory}\n </Box>\n ) : null;\n\n let mainContent = null;\n if (titleRow) {\n mainContent = hasAccessories ? (\n <Box twClassName=\"shrink min-w-0\">{titleRow}</Box>\n ) : (\n titleRow\n );\n }\n\n const headerRow = (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n >\n {resolvedStartAccessory}\n {mainContent}\n {resolvedEndAccessory}\n </Box>\n );\n\n const body = children ? (\n <Box gap={1}>\n {headerRow}\n {children}\n </Box>\n ) : (\n headerRow\n );\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n {body}\n </Pressable>\n );\n }\n\n if (children) {\n return (\n <Box\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n >\n {headerRow}\n {children}\n </Box>\n );\n }\n\n return (\n <Box\n {...props}\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n >\n {resolvedStartAccessory}\n {mainContent}\n {resolvedEndAccessory}\n </Box>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
1
+ {"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiC,CACzD,kBAAkB,EAClB,EAAE;IACF,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACT,GAAG,kBAAkB,CAAC;IAEvB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,mBAAmB,GACvB,WAAW;QACX,CAAC,aAAa,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAErE,MAAM,sBAAsB,GAAG,aAAa,CAAC,CAAC,CAAC,CAC7C,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,KAAK,CAAC,CAAC,SAAS,CAAC,WAAW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P;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CACL,CAAC,GAAG,CACF,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAE7D;QAAA,CAAC,SAAS,CACV;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,GAAG,CAAC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,MAAM,CACL,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAC7D,cAAc,CAAC,CAAC,sBAAsB,CAAC,CACvC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAEnC;MAAA,CAAC,WAAW,CACd;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon } from '../Icon';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)\n * @param sectionHeaderProps.children - Optional full-width content below the header row\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const titleRow = title ? (\n <BoxRow\n {...titleWrapperProps}\n gap={1}\n endAccessory={titleAccessory}\n twClassName={mergeTwClassName(\n hasAccessories ? 'w-full shrink min-w-0' : '',\n titleWrapperProps?.twClassName,\n )}\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null;\n\n let mainContent = null;\n if (titleRow) {\n mainContent = hasAccessories ? (\n <Box twClassName=\"shrink min-w-0\">{titleRow}</Box>\n ) : (\n titleRow\n );\n }\n\n const headerRow = (\n <BoxRow\n gap={1}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n\n const body = children ? (\n <Box gap={1}>\n {headerRow}\n {children}\n </Box>\n ) : (\n headerRow\n );\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n {body}\n </Pressable>\n );\n }\n\n if (children) {\n return (\n <Box\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n >\n {headerRow}\n {children}\n </Box>\n );\n }\n\n return (\n <BoxRow\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.types.cjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { SectionHeaderPropsShared } from '@metamask-previews/design-system-shared';\nimport type { PressableProps, ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxProps } from '../Box/Box.types';\nimport type { IconProps } from '../Icon';\nimport type { TextProps } from '../Text/Text.types';\n\ntype SectionHeaderPropsBase = SectionHeaderPropsShared & {\n /**\n * Optional props merged into the title `Text` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props spread onto the title row {@link Box} (a row with centered items and `gap={1}` by default; values here override those defaults). Omits `children` (SectionHeader sets it via `title` and `titleAccessory`).\n */\n titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the start icon.\n */\n startIconProps?: Omit<Partial<IconProps>, 'name'>;\n /**\n * Optional prop to pass additional properties to the end icon.\n */\n endIconProps?: Omit<Partial<IconProps>, 'name'>;\n /**\n * Optional Tailwind class name to apply to the outer row.\n */\n twClassName?: string;\n};\n\n/**\n * SectionHeader component props (React Native).\n * Extends {@link SectionHeaderPropsShared} with platform `Text` / `Icon` passthroughs, `twClassName`, and wrapper props.\n * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a row {@link Box} with `ViewProps`.\n */\nexport type SectionHeaderProps =\n | (SectionHeaderPropsBase & {\n isInteractive?: false;\n } & Omit<ViewProps, 'children'>)\n | (SectionHeaderPropsBase & {\n isInteractive: true;\n } & Omit<PressableProps, 'children'>);\n"]}
1
+ {"version":3,"file":"SectionHeader.types.cjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { SectionHeaderPropsShared } from '@metamask-previews/design-system-shared';\nimport type { PressableProps, ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { IconProps } from '../Icon';\nimport type { TextProps } from '../Text/Text.types';\n\ntype SectionHeaderPropsBase = SectionHeaderPropsShared & {\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props spread onto the title row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (SectionHeader sets those via `title`, `titleAccessory`, and `titleProps`).\n */\n titleWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional prop to pass additional properties to the start icon.\n */\n startIconProps?: Omit<Partial<IconProps>, 'name'>;\n /**\n * Optional prop to pass additional properties to the end icon.\n */\n endIconProps?: Omit<Partial<IconProps>, 'name'>;\n /**\n * Optional Tailwind class name to apply to the outer row.\n */\n twClassName?: string;\n};\n\n/**\n * SectionHeader component props (React Native).\n * Extends {@link SectionHeaderPropsShared} with platform `Text` / `Icon` passthroughs, `twClassName`, and wrapper props.\n * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a {@link BoxRow} with `ViewProps`.\n */\nexport type SectionHeaderProps =\n | (SectionHeaderPropsBase & {\n isInteractive?: false;\n } & Omit<ViewProps, 'children'>)\n | (SectionHeaderPropsBase & {\n isInteractive: true;\n } & Omit<PressableProps, 'children'>);\n"]}
@@ -1,17 +1,17 @@
1
1
  import type { SectionHeaderPropsShared } from "@metamask-previews/design-system-shared";
2
2
  import type { PressableProps, ViewProps } from "react-native";
3
- import type { BoxProps } from "../Box/Box.types.cjs";
3
+ import type { BoxRowProps } from "../BoxRow/BoxRow.types.cjs";
4
4
  import type { IconProps } from "../Icon/index.cjs";
5
5
  import type { TextProps } from "../Text/Text.types.cjs";
6
6
  type SectionHeaderPropsBase = SectionHeaderPropsShared & {
7
7
  /**
8
- * Optional props merged into the title `Text` when `title` is a string.
8
+ * Optional props merged into {@link BoxRow} `textProps` when `title` is a string.
9
9
  */
10
10
  titleProps?: Omit<Partial<TextProps>, 'children'>;
11
11
  /**
12
- * Optional props spread onto the title row {@link Box} (a row with centered items and `gap={1}` by default; values here override those defaults). Omits `children` (SectionHeader sets it via `title` and `titleAccessory`).
12
+ * Optional props spread onto the title row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (SectionHeader sets those via `title`, `titleAccessory`, and `titleProps`).
13
13
  */
14
- titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
14
+ titleWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
15
15
  /**
16
16
  * Optional prop to pass additional properties to the start icon.
17
17
  */
@@ -28,7 +28,7 @@ type SectionHeaderPropsBase = SectionHeaderPropsShared & {
28
28
  /**
29
29
  * SectionHeader component props (React Native).
30
30
  * Extends {@link SectionHeaderPropsShared} with platform `Text` / `Icon` passthroughs, `twClassName`, and wrapper props.
31
- * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a row {@link Box} with `ViewProps`.
31
+ * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a {@link BoxRow} with `ViewProps`.
32
32
  */
33
33
  export type SectionHeaderProps = (SectionHeaderPropsBase & {
34
34
  isInteractive?: false;
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.types.d.cts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB;AAG9D,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,KAAK,sBAAsB,GAAG,wBAAwB,GAAG;IACvD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAClD;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,CAAC,sBAAsB,GAAG;IACxB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,GAChC,CAAC,sBAAsB,GAAG;IACxB,aAAa,EAAE,IAAI,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"SectionHeader.types.d.cts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB;AAG9D,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,KAAK,sBAAsB,GAAG,wBAAwB,GAAG;IACvD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,iBAAiB,CAAC,EAAE,IAAI,CACtB,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,cAAc,GAAG,WAAW,CAC1C,CAAC;IACF;;OAEG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAClD;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,CAAC,sBAAsB,GAAG;IACxB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,GAChC,CAAC,sBAAsB,GAAG;IACxB,aAAa,EAAE,IAAI,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC"}
@@ -1,17 +1,17 @@
1
1
  import type { SectionHeaderPropsShared } from "@metamask-previews/design-system-shared";
2
2
  import type { PressableProps, ViewProps } from "react-native";
3
- import type { BoxProps } from "../Box/Box.types.mjs";
3
+ import type { BoxRowProps } from "../BoxRow/BoxRow.types.mjs";
4
4
  import type { IconProps } from "../Icon/index.mjs";
5
5
  import type { TextProps } from "../Text/Text.types.mjs";
6
6
  type SectionHeaderPropsBase = SectionHeaderPropsShared & {
7
7
  /**
8
- * Optional props merged into the title `Text` when `title` is a string.
8
+ * Optional props merged into {@link BoxRow} `textProps` when `title` is a string.
9
9
  */
10
10
  titleProps?: Omit<Partial<TextProps>, 'children'>;
11
11
  /**
12
- * Optional props spread onto the title row {@link Box} (a row with centered items and `gap={1}` by default; values here override those defaults). Omits `children` (SectionHeader sets it via `title` and `titleAccessory`).
12
+ * Optional props spread onto the title row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (SectionHeader sets those via `title`, `titleAccessory`, and `titleProps`).
13
13
  */
14
- titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
14
+ titleWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
15
15
  /**
16
16
  * Optional prop to pass additional properties to the start icon.
17
17
  */
@@ -28,7 +28,7 @@ type SectionHeaderPropsBase = SectionHeaderPropsShared & {
28
28
  /**
29
29
  * SectionHeader component props (React Native).
30
30
  * Extends {@link SectionHeaderPropsShared} with platform `Text` / `Icon` passthroughs, `twClassName`, and wrapper props.
31
- * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a row {@link Box} with `ViewProps`.
31
+ * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a {@link BoxRow} with `ViewProps`.
32
32
  */
33
33
  export type SectionHeaderProps = (SectionHeaderPropsBase & {
34
34
  isInteractive?: false;
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.types.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB;AAG9D,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,KAAK,sBAAsB,GAAG,wBAAwB,GAAG;IACvD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAClD;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,CAAC,sBAAsB,GAAG;IACxB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,GAChC,CAAC,sBAAsB,GAAG;IACxB,aAAa,EAAE,IAAI,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"SectionHeader.types.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB;AAG9D,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,KAAK,sBAAsB,GAAG,wBAAwB,GAAG;IACvD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,iBAAiB,CAAC,EAAE,IAAI,CACtB,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,cAAc,GAAG,WAAW,CAC1C,CAAC;IACF;;OAEG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAClD;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,CAAC,sBAAsB,GAAG;IACxB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,GAChC,CAAC,sBAAsB,GAAG;IACxB,aAAa,EAAE,IAAI,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.types.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { SectionHeaderPropsShared } from '@metamask-previews/design-system-shared';\nimport type { PressableProps, ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxProps } from '../Box/Box.types';\nimport type { IconProps } from '../Icon';\nimport type { TextProps } from '../Text/Text.types';\n\ntype SectionHeaderPropsBase = SectionHeaderPropsShared & {\n /**\n * Optional props merged into the title `Text` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props spread onto the title row {@link Box} (a row with centered items and `gap={1}` by default; values here override those defaults). Omits `children` (SectionHeader sets it via `title` and `titleAccessory`).\n */\n titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the start icon.\n */\n startIconProps?: Omit<Partial<IconProps>, 'name'>;\n /**\n * Optional prop to pass additional properties to the end icon.\n */\n endIconProps?: Omit<Partial<IconProps>, 'name'>;\n /**\n * Optional Tailwind class name to apply to the outer row.\n */\n twClassName?: string;\n};\n\n/**\n * SectionHeader component props (React Native).\n * Extends {@link SectionHeaderPropsShared} with platform `Text` / `Icon` passthroughs, `twClassName`, and wrapper props.\n * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a row {@link Box} with `ViewProps`.\n */\nexport type SectionHeaderProps =\n | (SectionHeaderPropsBase & {\n isInteractive?: false;\n } & Omit<ViewProps, 'children'>)\n | (SectionHeaderPropsBase & {\n isInteractive: true;\n } & Omit<PressableProps, 'children'>);\n"]}
1
+ {"version":3,"file":"SectionHeader.types.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { SectionHeaderPropsShared } from '@metamask-previews/design-system-shared';\nimport type { PressableProps, ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { IconProps } from '../Icon';\nimport type { TextProps } from '../Text/Text.types';\n\ntype SectionHeaderPropsBase = SectionHeaderPropsShared & {\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props spread onto the title row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (SectionHeader sets those via `title`, `titleAccessory`, and `titleProps`).\n */\n titleWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional prop to pass additional properties to the start icon.\n */\n startIconProps?: Omit<Partial<IconProps>, 'name'>;\n /**\n * Optional prop to pass additional properties to the end icon.\n */\n endIconProps?: Omit<Partial<IconProps>, 'name'>;\n /**\n * Optional Tailwind class name to apply to the outer row.\n */\n twClassName?: string;\n};\n\n/**\n * SectionHeader component props (React Native).\n * Extends {@link SectionHeaderPropsShared} with platform `Text` / `Icon` passthroughs, `twClassName`, and wrapper props.\n * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a {@link BoxRow} with `ViewProps`.\n */\nexport type SectionHeaderProps =\n | (SectionHeaderPropsBase & {\n isInteractive?: false;\n } & Omit<ViewProps, 'children'>)\n | (SectionHeaderPropsBase & {\n isInteractive: true;\n } & Omit<PressableProps, 'children'>);\n"]}
@@ -8,31 +8,37 @@ const design_system_shared_1 = require("@metamask-previews/design-system-shared"
8
8
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
9
9
  const react_1 = __importDefault(require("react"));
10
10
  const Box_1 = require("../Box/index.cjs");
11
+ const BoxRow_1 = require("../BoxRow/index.cjs");
11
12
  const Icon_1 = require("../Icon/index.cjs");
12
- const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
13
13
  const Tag_constants_1 = require("./Tag.constants.cjs");
14
14
  const Tag = ({ children, severity = design_system_shared_1.TagSeverity.Neutral, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, twClassName, style, ...props }) => {
15
15
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
16
16
  const backgroundColor = Tag_constants_1.MAP_TAG_SEVERITY_BACKGROUND[severity];
17
17
  const textColor = Tag_constants_1.MAP_TAG_SEVERITY_TEXT_COLOR[severity];
18
18
  const iconColor = Tag_constants_1.MAP_TAG_SEVERITY_ICON_COLOR[severity];
19
- const resolvedStartIconName = startIconName ?? startIconProps?.name;
20
- const resolvedEndIconName = endIconName ?? endIconProps?.name;
21
19
  return (<Box_1.Box {...props} backgroundColor={backgroundColor} style={[
22
- tw.style('rounded-md self-start', resolvedStartIconName ? 'pl-1' : 'pl-1.5', resolvedEndIconName ? 'pr-1' : 'pr-1.5', twClassName),
20
+ tw.style('rounded-md self-start', (startIconName ?? startIconProps?.name) ? 'pl-1' : 'pl-1.5', (endIconName ?? endIconProps?.name) ? 'pr-1' : 'pr-1.5', twClassName),
23
21
  style,
24
22
  ]}>
25
- <Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} twClassName="gap-0.5">
26
- {resolvedStartIconName ? (<Icon_1.Icon name={resolvedStartIconName} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>) : ((startAccessory ?? null))}
27
- <TextOrChildren_1.TextOrChildren textProps={{
23
+ <BoxRow_1.BoxRow twClassName="gap-0.5" textProps={{
28
24
  color: textColor,
29
25
  variant: design_system_shared_1.TextVariant.BodyXs,
30
26
  fontWeight: design_system_shared_1.FontWeight.Medium,
31
- }}>
32
- {children}
33
- </TextOrChildren_1.TextOrChildren>
34
- {resolvedEndIconName ? (<Icon_1.Icon name={resolvedEndIconName} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>) : ((endAccessory ?? null))}
35
- </Box_1.Box>
27
+ }} startAccessory={(() => {
28
+ const name = startIconName ?? startIconProps?.name;
29
+ if (!name) {
30
+ return startAccessory ?? null;
31
+ }
32
+ return (<Icon_1.Icon name={name} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>);
33
+ })()} endAccessory={(() => {
34
+ const name = endIconName ?? endIconProps?.name;
35
+ if (!name) {
36
+ return endAccessory ?? null;
37
+ }
38
+ return (<Icon_1.Icon name={name} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>);
39
+ })()}>
40
+ {children}
41
+ </BoxRow_1.BoxRow>
36
42
  </Box_1.Box>);
37
43
  };
38
44
  exports.Tag = Tag;
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.cjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAMiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAE1B,0CAA6B;AAC7B,4CAAyC;AACzC,gFAAmE;AAEnE,uDAIyB;AAGlB,MAAM,GAAG,GAAuB,CAAC,EACtC,QAAQ,EACR,QAAQ,GAAG,kCAAW,CAAC,OAAO,EAC9B,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,M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AC,QAAQ,CACX;QAAA,EAAE,+BAAc,CAChB;QAAA,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACrB,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAC1B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,CAAC,YAAY,IAAI,IAAI,CAAC,CACvB,CACH;MAAA,EAAE,SAAG,CACP;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,GAAG,OA0Ed","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { Icon, IconSize } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n const resolvedStartIconName = startIconName ?? startIconProps?.name;\n const resolvedEndIconName = endIconName ?? endIconProps?.name;\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n resolvedStartIconName ? 'pl-1' : 'pl-1.5',\n resolvedEndIconName ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n twClassName=\"gap-0.5\"\n >\n {resolvedStartIconName ? (\n <Icon\n name={resolvedStartIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n ) : (\n (startAccessory ?? null)\n )}\n <TextOrChildren\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n >\n {children}\n </TextOrChildren>\n {resolvedEndIconName ? (\n <Icon\n name={resolvedEndIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n ) : (\n (endAccessory ?? null)\n )}\n </Box>\n </Box>\n );\n};\n"]}
1
+ {"version":3,"file":"Tag.cjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAIiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAE1B,0CAA6B;AAC7B,gDAAmC;AACnC,4CAAyC;AAEzC,uDAIyB;AAGlB,MAAM,GAAG,GAAuB,CAAC,EACtC,QAAQ,EACR,QAAQ,GAAG,kCAAW,CAAC,OAAO,EAC9B,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,eAAe,GAAG,2CAA2B,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,2CAA2B,CAAC,QAAQ,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,2CAA2B,CAAC,QAAQ,CAAC,CAAC;IAExD,OAAO,CACL,CAAC,SAAG,CACF,IAAI,K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AAC,CACjB,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC,CAEL;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,eAAM,CACV;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,GAAG,OA0Ed","sourcesContent":["import {\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon, IconSize } from '../Icon';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n (startIconName ?? startIconProps?.name) ? 'pl-1' : 'pl-1.5',\n (endIconName ?? endIconProps?.name) ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <BoxRow\n twClassName=\"gap-0.5\"\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n startAccessory={(() => {\n const name = startIconName ?? startIconProps?.name;\n if (!name) {\n return startAccessory ?? null;\n }\n return (\n <Icon\n name={name}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n );\n })()}\n endAccessory={(() => {\n const name = endIconName ?? endIconProps?.name;\n if (!name) {\n return endAccessory ?? null;\n }\n return (\n <Icon\n name={name}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n );\n })()}\n >\n {children}\n </BoxRow>\n </Box>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.cts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
1
+ {"version":3,"file":"Tag.d.cts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.mts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
1
+ {"version":3,"file":"Tag.d.mts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
@@ -4,36 +4,42 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { BoxAlignItems, BoxFlexDirection, FontWeight, TagSeverity, TextVariant } from "@metamask-previews/design-system-shared";
7
+ import { FontWeight, TagSeverity, TextVariant } from "@metamask-previews/design-system-shared";
8
8
  import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
9
9
  import $React from "react";
10
10
  const React = $importDefault($React);
11
11
  import { Box } from "../Box/index.mjs";
12
+ import { BoxRow } from "../BoxRow/index.mjs";
12
13
  import { Icon, IconSize } from "../Icon/index.mjs";
13
- import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
14
14
  import { MAP_TAG_SEVERITY_BACKGROUND, MAP_TAG_SEVERITY_ICON_COLOR, MAP_TAG_SEVERITY_TEXT_COLOR } from "./Tag.constants.mjs";
15
15
  export const Tag = ({ children, severity = TagSeverity.Neutral, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, twClassName, style, ...props }) => {
16
16
  const tw = useTailwind();
17
17
  const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];
18
18
  const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];
19
19
  const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];
20
- const resolvedStartIconName = startIconName ?? startIconProps?.name;
21
- const resolvedEndIconName = endIconName ?? endIconProps?.name;
22
20
  return (<Box {...props} backgroundColor={backgroundColor} style={[
23
- tw.style('rounded-md self-start', resolvedStartIconName ? 'pl-1' : 'pl-1.5', resolvedEndIconName ? 'pr-1' : 'pr-1.5', twClassName),
21
+ tw.style('rounded-md self-start', (startIconName ?? startIconProps?.name) ? 'pl-1' : 'pl-1.5', (endIconName ?? endIconProps?.name) ? 'pr-1' : 'pr-1.5', twClassName),
24
22
  style,
25
23
  ]}>
26
- <Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} twClassName="gap-0.5">
27
- {resolvedStartIconName ? (<Icon name={resolvedStartIconName} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>) : ((startAccessory ?? null))}
28
- <TextOrChildren textProps={{
24
+ <BoxRow twClassName="gap-0.5" textProps={{
29
25
  color: textColor,
30
26
  variant: TextVariant.BodyXs,
31
27
  fontWeight: FontWeight.Medium,
32
- }}>
33
- {children}
34
- </TextOrChildren>
35
- {resolvedEndIconName ? (<Icon name={resolvedEndIconName} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>) : ((endAccessory ?? null))}
36
- </Box>
28
+ }} startAccessory={(() => {
29
+ const name = startIconName ?? startIconProps?.name;
30
+ if (!name) {
31
+ return startAccessory ?? null;
32
+ }
33
+ return (<Icon name={name} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>);
34
+ })()} endAccessory={(() => {
35
+ const name = endIconName ?? endIconProps?.name;
36
+ if (!name) {
37
+ return endAccessory ?? null;
38
+ }
39
+ return (<Icon name={name} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>);
40
+ })()}>
41
+ {children}
42
+ </BoxRow>
37
43
  </Box>);
38
44
  };
39
45
  //# sourceMappingURL=Tag.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.mjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,0BAAgB;AACzC,OAAO,EAAE,cAAc,EAAE,oDAA0C;AAEnE,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC5B,4BAAwB;AAGzB,MAAM,CAAC,MAAM,GAAG,GAAuB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C,CAAC,CAAC,CACF,CAAC,cAAc,IAAI,IAAI,CAAC,CACzB,CACD;QAAA,CAAC,cAAc,CACb,SAAS,CAAC,CAAC;YACT,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;SAC9B,CAAC,CAEF;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,cAAc,CAChB;QAAA,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACrB,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAC1B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,CAAC,YAAY,IAAI,IAAI,CAAC,CACvB,CACH;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { Icon, IconSize } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n const resolvedStartIconName = startIconName ?? startIconProps?.name;\n const resolvedEndIconName = endIconName ?? endIconProps?.name;\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n resolvedStartIconName ? 'pl-1' : 'pl-1.5',\n resolvedEndIconName ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n twClassName=\"gap-0.5\"\n >\n {resolvedStartIconName ? (\n <Icon\n name={resolvedStartIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n ) : (\n (startAccessory ?? null)\n )}\n <TextOrChildren\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n >\n {children}\n </TextOrChildren>\n {resolvedEndIconName ? (\n <Icon\n name={resolvedEndIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n ) : (\n (endAccessory ?? null)\n )}\n </Box>\n </Box>\n );\n};\n"]}
1
+ {"version":3,"file":"Tag.mjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,0BAAgB;AAEzC,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC5B,4BAAwB;AAGzB,MAAM,CAAC,MAAM,GAAG,GAAuB,CAAC,EACtC,QAA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IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,cAAc,CAAC,EACnB,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC,CACL,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE;YAClB,MAAM,IAAI,GAAG,WAAW,IAAI,YAAY,EAAE,IAAI,CAAC;YAC/C,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,YAAY,IAAI,IAAI,CAAC;YAC9B,CAAC;YACD,OAAO,CACL,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC,CAEL;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,MAAM,CACV;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon, IconSize } from '../Icon';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n (startIconName ?? startIconProps?.name) ? 'pl-1' : 'pl-1.5',\n (endIconName ?? endIconProps?.name) ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <BoxRow\n twClassName=\"gap-0.5\"\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n startAccessory={(() => {\n const name = startIconName ?? startIconProps?.name;\n if (!name) {\n return startAccessory ?? null;\n }\n return (\n <Icon\n name={name}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n );\n })()}\n endAccessory={(() => {\n const name = endIconName ?? endIconProps?.name;\n if (!name) {\n return endAccessory ?? null;\n }\n return (\n <Icon\n name={name}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n );\n })()}\n >\n {children}\n </BoxRow>\n </Box>\n );\n};\n"]}