@metamask-previews/design-system-react-native 0.56.1-preview-7d5964a → 0.56.2-preview-91ce2ce2

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 (188) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs +1 -1
  3. package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -1
  4. package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs +1 -1
  5. package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -1
  6. package/dist/components/BoxColumn/BoxColumn.cjs +13 -0
  7. package/dist/components/BoxColumn/BoxColumn.cjs.map +1 -1
  8. package/dist/components/BoxColumn/BoxColumn.d.cts +13 -0
  9. package/dist/components/BoxColumn/BoxColumn.d.cts.map +1 -1
  10. package/dist/components/BoxColumn/BoxColumn.d.mts +13 -0
  11. package/dist/components/BoxColumn/BoxColumn.d.mts.map +1 -1
  12. package/dist/components/BoxColumn/BoxColumn.mjs +13 -0
  13. package/dist/components/BoxColumn/BoxColumn.mjs.map +1 -1
  14. package/dist/components/BoxColumn/BoxColumn.types.cjs.map +1 -1
  15. package/dist/components/BoxColumn/BoxColumn.types.d.cts +2 -0
  16. package/dist/components/BoxColumn/BoxColumn.types.d.cts.map +1 -1
  17. package/dist/components/BoxColumn/BoxColumn.types.d.mts +2 -0
  18. package/dist/components/BoxColumn/BoxColumn.types.d.mts.map +1 -1
  19. package/dist/components/BoxColumn/BoxColumn.types.mjs.map +1 -1
  20. package/dist/components/BoxRow/BoxRow.cjs +13 -0
  21. package/dist/components/BoxRow/BoxRow.cjs.map +1 -1
  22. package/dist/components/BoxRow/BoxRow.d.cts +13 -0
  23. package/dist/components/BoxRow/BoxRow.d.cts.map +1 -1
  24. package/dist/components/BoxRow/BoxRow.d.mts +13 -0
  25. package/dist/components/BoxRow/BoxRow.d.mts.map +1 -1
  26. package/dist/components/BoxRow/BoxRow.mjs +13 -0
  27. package/dist/components/BoxRow/BoxRow.mjs.map +1 -1
  28. package/dist/components/BoxRow/BoxRow.types.cjs.map +1 -1
  29. package/dist/components/BoxRow/BoxRow.types.d.cts +2 -0
  30. package/dist/components/BoxRow/BoxRow.types.d.cts.map +1 -1
  31. package/dist/components/BoxRow/BoxRow.types.d.mts +2 -0
  32. package/dist/components/BoxRow/BoxRow.types.d.mts.map +1 -1
  33. package/dist/components/BoxRow/BoxRow.types.mjs.map +1 -1
  34. package/dist/components/ButtonBase/ButtonBase.cjs +9 -5
  35. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  36. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  37. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  38. package/dist/components/ButtonBase/ButtonBase.mjs +10 -6
  39. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  40. package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
  41. package/dist/components/ButtonBase/ButtonBase.types.d.cts +2 -3
  42. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  43. package/dist/components/ButtonBase/ButtonBase.types.d.mts +2 -3
  44. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  45. package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
  46. package/dist/components/Content/Content.cjs +40 -32
  47. package/dist/components/Content/Content.cjs.map +1 -1
  48. package/dist/components/Content/Content.d.cts.map +1 -1
  49. package/dist/components/Content/Content.d.mts.map +1 -1
  50. package/dist/components/Content/Content.mjs +40 -32
  51. package/dist/components/Content/Content.mjs.map +1 -1
  52. package/dist/components/HeaderRoot/HeaderRoot.cjs +8 -5
  53. package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -1
  54. package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -1
  55. package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -1
  56. package/dist/components/HeaderRoot/HeaderRoot.mjs +8 -5
  57. package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -1
  58. package/dist/components/KeyValueColumn/KeyValueColumn.cjs +21 -12
  59. package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
  60. package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
  61. package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
  62. package/dist/components/KeyValueColumn/KeyValueColumn.mjs +22 -13
  63. package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
  64. package/dist/components/KeyValueRow/KeyValueRow.cjs +19 -10
  65. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
  66. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
  67. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
  68. package/dist/components/KeyValueRow/KeyValueRow.mjs +20 -11
  69. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
  70. package/dist/components/KeyValueSelect/KeyValueSelect.types.cjs.map +1 -1
  71. package/dist/components/KeyValueSelect/KeyValueSelect.types.d.cts +1 -1
  72. package/dist/components/KeyValueSelect/KeyValueSelect.types.d.cts.map +1 -1
  73. package/dist/components/KeyValueSelect/KeyValueSelect.types.d.mts +1 -1
  74. package/dist/components/KeyValueSelect/KeyValueSelect.types.d.mts.map +1 -1
  75. package/dist/components/KeyValueSelect/KeyValueSelect.types.mjs.map +1 -1
  76. package/dist/components/ListItem/ListItem.cjs +4 -3
  77. package/dist/components/ListItem/ListItem.cjs.map +1 -1
  78. package/dist/components/ListItem/ListItem.d.cts.map +1 -1
  79. package/dist/components/ListItem/ListItem.d.mts.map +1 -1
  80. package/dist/components/ListItem/ListItem.mjs +5 -4
  81. package/dist/components/ListItem/ListItem.mjs.map +1 -1
  82. package/dist/components/SectionHeader/SectionHeader.cjs +17 -10
  83. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
  84. package/dist/components/SectionHeader/SectionHeader.d.cts +2 -2
  85. package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
  86. package/dist/components/SectionHeader/SectionHeader.d.mts +2 -2
  87. package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
  88. package/dist/components/SectionHeader/SectionHeader.mjs +18 -11
  89. package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
  90. package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -1
  91. package/dist/components/SectionHeader/SectionHeader.types.d.cts +5 -5
  92. package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -1
  93. package/dist/components/SectionHeader/SectionHeader.types.d.mts +5 -5
  94. package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -1
  95. package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -1
  96. package/dist/components/SelectButton/SelectButton.cjs +10 -3
  97. package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
  98. package/dist/components/SelectButton/SelectButton.d.cts +1 -1
  99. package/dist/components/SelectButton/SelectButton.d.cts.map +1 -1
  100. package/dist/components/SelectButton/SelectButton.d.mts +1 -1
  101. package/dist/components/SelectButton/SelectButton.d.mts.map +1 -1
  102. package/dist/components/SelectButton/SelectButton.mjs +10 -3
  103. package/dist/components/SelectButton/SelectButton.mjs.map +1 -1
  104. package/dist/components/Switch/Switch.cjs +4 -2
  105. package/dist/components/Switch/Switch.cjs.map +1 -1
  106. package/dist/components/Switch/Switch.d.cts +1 -1
  107. package/dist/components/Switch/Switch.d.cts.map +1 -1
  108. package/dist/components/Switch/Switch.d.mts +1 -1
  109. package/dist/components/Switch/Switch.d.mts.map +1 -1
  110. package/dist/components/Switch/Switch.mjs +4 -2
  111. package/dist/components/Switch/Switch.mjs.map +1 -1
  112. package/dist/components/Tag/Tag.cjs +12 -18
  113. package/dist/components/Tag/Tag.cjs.map +1 -1
  114. package/dist/components/Tag/Tag.d.cts.map +1 -1
  115. package/dist/components/Tag/Tag.d.mts.map +1 -1
  116. package/dist/components/Tag/Tag.mjs +13 -19
  117. package/dist/components/Tag/Tag.mjs.map +1 -1
  118. package/dist/components/TitleAlert/TitleAlert.cjs +20 -18
  119. package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -1
  120. package/dist/components/TitleAlert/TitleAlert.d.cts +3 -3
  121. package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -1
  122. package/dist/components/TitleAlert/TitleAlert.d.mts +3 -3
  123. package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -1
  124. package/dist/components/TitleAlert/TitleAlert.mjs +21 -19
  125. package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -1
  126. package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -1
  127. package/dist/components/TitleAlert/TitleAlert.types.d.cts +6 -7
  128. package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -1
  129. package/dist/components/TitleAlert/TitleAlert.types.d.mts +6 -7
  130. package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -1
  131. package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -1
  132. package/dist/components/TitleHub/TitleHub.cjs +22 -13
  133. package/dist/components/TitleHub/TitleHub.cjs.map +1 -1
  134. package/dist/components/TitleHub/TitleHub.d.cts +3 -3
  135. package/dist/components/TitleHub/TitleHub.d.cts.map +1 -1
  136. package/dist/components/TitleHub/TitleHub.d.mts +3 -3
  137. package/dist/components/TitleHub/TitleHub.d.mts.map +1 -1
  138. package/dist/components/TitleHub/TitleHub.mjs +23 -14
  139. package/dist/components/TitleHub/TitleHub.mjs.map +1 -1
  140. package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -1
  141. package/dist/components/TitleHub/TitleHub.types.d.cts +10 -10
  142. package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
  143. package/dist/components/TitleHub/TitleHub.types.d.mts +10 -10
  144. package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
  145. package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -1
  146. package/dist/components/TitleStandard/TitleStandard.cjs +15 -9
  147. package/dist/components/TitleStandard/TitleStandard.cjs.map +1 -1
  148. package/dist/components/TitleStandard/TitleStandard.d.cts +2 -2
  149. package/dist/components/TitleStandard/TitleStandard.d.cts.map +1 -1
  150. package/dist/components/TitleStandard/TitleStandard.d.mts +2 -2
  151. package/dist/components/TitleStandard/TitleStandard.d.mts.map +1 -1
  152. package/dist/components/TitleStandard/TitleStandard.mjs +16 -10
  153. package/dist/components/TitleStandard/TitleStandard.mjs.map +1 -1
  154. package/dist/components/TitleStandard/TitleStandard.types.cjs.map +1 -1
  155. package/dist/components/TitleStandard/TitleStandard.types.d.cts +7 -7
  156. package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -1
  157. package/dist/components/TitleStandard/TitleStandard.types.d.mts +7 -7
  158. package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -1
  159. package/dist/components/TitleStandard/TitleStandard.types.mjs.map +1 -1
  160. package/dist/components/TitleSubpage/TitleSubpage.cjs +31 -18
  161. package/dist/components/TitleSubpage/TitleSubpage.cjs.map +1 -1
  162. package/dist/components/TitleSubpage/TitleSubpage.d.cts +3 -3
  163. package/dist/components/TitleSubpage/TitleSubpage.d.cts.map +1 -1
  164. package/dist/components/TitleSubpage/TitleSubpage.d.mts +3 -3
  165. package/dist/components/TitleSubpage/TitleSubpage.d.mts.map +1 -1
  166. package/dist/components/TitleSubpage/TitleSubpage.mjs +32 -19
  167. package/dist/components/TitleSubpage/TitleSubpage.mjs.map +1 -1
  168. package/dist/components/TitleSubpage/TitleSubpage.types.cjs.map +1 -1
  169. package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +8 -9
  170. package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -1
  171. package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +8 -9
  172. package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -1
  173. package/dist/components/TitleSubpage/TitleSubpage.types.mjs.map +1 -1
  174. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs +9 -7
  175. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs.map +1 -1
  176. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts.map +1 -1
  177. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts.map +1 -1
  178. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs +10 -8
  179. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs.map +1 -1
  180. package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs +1 -1
  181. package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs.map +1 -1
  182. package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs +1 -1
  183. package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs.map +1 -1
  184. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
  185. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +1 -1
  186. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +1 -1
  187. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
  188. package/package.json +4 -4
@@ -9,7 +9,6 @@ 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");
13
12
  const Content_1 = require("../Content/index.cjs");
14
13
  const ListItem = ({ children, isInteractive = false, twClassName, style, startAccessory, endAccessory, accessoryGap = 0, variant = design_system_shared_1.ContentVariant.TwoLines, avatar, title, titleProps, titleStartAccessory, titleEndAccessory, description, descriptionProps, descriptionStartAccessory, descriptionEndAccessory, value, valueProps, valueStartAccessory, valueEndAccessory, subvalue, subvalueProps, subvalueStartAccessory, subvalueEndAccessory, accessibilityRole, ...props }) => {
15
14
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
@@ -39,9 +38,11 @@ const ListItem = ({ children, isInteractive = false, twClassName, style, startAc
39
38
  };
40
39
  const hasRowAccessories = Boolean(startAccessory) || Boolean(endAccessory);
41
40
  const content = (<Content_1.Content twClassName={hasRowAccessories ? 'flex-1 min-w-0' : undefined} variant={variant} avatar={avatar} title={title} titleProps={titleProps} titleStartAccessory={titleStartAccessory} titleEndAccessory={titleEndAccessory} description={description} descriptionProps={descriptionProps} descriptionStartAccessory={descriptionStartAccessory} descriptionEndAccessory={descriptionEndAccessory} value={value} valueProps={valueProps} valueStartAccessory={valueStartAccessory} valueEndAccessory={valueEndAccessory} subvalue={subvalue} subvalueProps={subvalueProps} subvalueStartAccessory={subvalueStartAccessory} subvalueEndAccessory={subvalueEndAccessory}/>);
42
- const listContent = hasRowAccessories ? (<BoxRow_1.BoxRow startAccessory={startAccessory} endAccessory={endAccessory} alignItems={accessoryAlignItems} gap={accessoryGap}>
41
+ const listContent = hasRowAccessories ? (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={accessoryAlignItems} gap={accessoryGap}>
42
+ {startAccessory}
43
43
  {content}
44
- </BoxRow_1.BoxRow>) : (content);
44
+ {endAccessory}
45
+ </Box_1.Box>) : (content);
45
46
  if (isInteractive) {
46
47
  return (<react_native_1.Pressable accessibilityRole={accessibilityRole ?? 'button'} style={getPressableStyle} {...props}>
47
48
  {listContent}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.cjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAIiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAyC;AAOzC,0CAA6B;AAC7B,gDAAmC;AACnC,kDAAqC;AAI9B,MAAM,QAAQ,GAA4B,CAAC,EAChD,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,WAAW,EACX,KAAK,EACL,cAAc,EACd,YAA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MAAM,WAAW,GAAG,iBAAiB,CAAC,CAAC,CAAC,CACtC,CAAC,eAAM,CACL,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,UAAU,CAAC,CAAC,mBAAmB,CAAC,CAChC,GAAG,CAAC,CAAC,YAAY,CAAC,CAElB;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,eAAM,CAAC,CACV,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CACL,CAAC,wBAAS,CACR,iBAAiB,CAAC,CAAC,iBAAiB,IAAI,QAAQ,CAAC,CACjD,KAAK,CAAC,CAAC,iBAAiB,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,WAAW,CACZ;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,SAAG,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,CAAC,CAClC;MAAA,CAAC,WAAW,CACZ;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA3HW,QAAA,QAAQ,YA2HnB;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import {\n BoxAlignItems,\n ContentVariant,\n mergeTwClassName,\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';\nimport type {\n PressableStateCallbackType,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Content } from '../Content';\n\nimport type { ListItemProps } from './ListItem.types';\n\nexport const ListItem: React.FC<ListItemProps> = ({\n children,\n isInteractive = false,\n twClassName,\n style,\n startAccessory,\n endAccessory,\n accessoryGap = 0,\n variant = ContentVariant.TwoLines,\n avatar,\n title,\n titleProps,\n titleStartAccessory,\n titleEndAccessory,\n description,\n descriptionProps,\n descriptionStartAccessory,\n descriptionEndAccessory,\n value,\n valueProps,\n valueStartAccessory,\n valueEndAccessory,\n subvalue,\n subvalueProps,\n subvalueStartAccessory,\n subvalueEndAccessory,\n accessibilityRole,\n ...props\n}) => {\n const tw = useTailwind();\n const isMultiLine = variant === ContentVariant.MultiLine;\n let rootSizeClassName = 'min-h-[72px] justify-center';\n if (variant === ContentVariant.OneLine) {\n rootSizeClassName = 'min-h-[48px] justify-center';\n } else if (isMultiLine) {\n rootSizeClassName = 'min-h-[88px] justify-start';\n }\n const accessoryAlignItems = isMultiLine\n ? BoxAlignItems.Start\n : BoxAlignItems.Center;\n\n const rootBaseClassName = mergeTwClassName(\n 'w-full px-4 py-3',\n rootSizeClassName,\n );\n const rootTwClassName = mergeTwClassName(rootBaseClassName, twClassName);\n\n const wrapperStyle = style\n ? [tw.style(rootTwClassName), style]\n : tw.style(rootTwClassName);\n\n const getPressableStyle = ({\n pressed,\n }: PressableStateCallbackType): StyleProp<ViewStyle> => {\n const baseStyle = tw.style(rootTwClassName, pressed && 'bg-pressed');\n\n if (!style) {\n return baseStyle;\n }\n\n const userStyle = typeof style === 'function' ? style({ pressed }) : style;\n\n return [baseStyle, userStyle];\n };\n\n const hasRowAccessories = Boolean(startAccessory) || Boolean(endAccessory);\n\n const content = (\n <Content\n twClassName={hasRowAccessories ? 'flex-1 min-w-0' : undefined}\n variant={variant}\n avatar={avatar}\n title={title}\n titleProps={titleProps}\n titleStartAccessory={titleStartAccessory}\n titleEndAccessory={titleEndAccessory}\n description={description}\n descriptionProps={descriptionProps}\n descriptionStartAccessory={descriptionStartAccessory}\n descriptionEndAccessory={descriptionEndAccessory}\n value={value}\n valueProps={valueProps}\n valueStartAccessory={valueStartAccessory}\n valueEndAccessory={valueEndAccessory}\n subvalue={subvalue}\n subvalueProps={subvalueProps}\n subvalueStartAccessory={subvalueStartAccessory}\n subvalueEndAccessory={subvalueEndAccessory}\n />\n );\n\n const listContent = hasRowAccessories ? (\n <BoxRow\n startAccessory={startAccessory}\n endAccessory={endAccessory}\n alignItems={accessoryAlignItems}\n gap={accessoryGap}\n >\n {content}\n </BoxRow>\n ) : (\n content\n );\n\n if (isInteractive) {\n return (\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n style={getPressableStyle}\n {...props}\n >\n {listContent}\n {children}\n </Pressable>\n );\n }\n\n return (\n <Box style={wrapperStyle} {...props}>\n {listContent}\n {children}\n </Box>\n );\n};\n\nListItem.displayName = 'ListItem';\n"]}
1
+ {"version":3,"file":"ListItem.cjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAKiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAyC;AAOzC,0CAA6B;AAC7B,kDAAqC;AAI9B,MAAM,QAAQ,GAA4B,CAAC,EAChD,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,WAAW,EACX,KAAK,EACL,cAAc,EACd,YAAY,EACZ,YAAY,GAAG,CAAC,EAChB,OAAO,GAAG,qCAAc,CAAC,QAAQ,EACjC,MAAM,EACN,KAAK,EACL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,KAAK,EACL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,WAAW,GAAG,OAAO,KAAK,qCAAc,CAAC,SAAS,CAAC;IACzD,IAAI,iBAAiB,GAAG,6BAA6B,CAAC;IACtD,IAAI,OAAO,KAAK,qCAAc,CAAC,OAAO,EAAE,CAAC;QACvC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AAC,QAAQ,CACX;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,SAAG,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,CAAC,CAClC;MAAA,CAAC,WAAW,CACZ;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA5HW,QAAA,QAAQ,YA4HnB;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n ContentVariant,\n mergeTwClassName,\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';\nimport type {\n PressableStateCallbackType,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport { Box } from '../Box';\nimport { Content } from '../Content';\n\nimport type { ListItemProps } from './ListItem.types';\n\nexport const ListItem: React.FC<ListItemProps> = ({\n children,\n isInteractive = false,\n twClassName,\n style,\n startAccessory,\n endAccessory,\n accessoryGap = 0,\n variant = ContentVariant.TwoLines,\n avatar,\n title,\n titleProps,\n titleStartAccessory,\n titleEndAccessory,\n description,\n descriptionProps,\n descriptionStartAccessory,\n descriptionEndAccessory,\n value,\n valueProps,\n valueStartAccessory,\n valueEndAccessory,\n subvalue,\n subvalueProps,\n subvalueStartAccessory,\n subvalueEndAccessory,\n accessibilityRole,\n ...props\n}) => {\n const tw = useTailwind();\n const isMultiLine = variant === ContentVariant.MultiLine;\n let rootSizeClassName = 'min-h-[72px] justify-center';\n if (variant === ContentVariant.OneLine) {\n rootSizeClassName = 'min-h-[48px] justify-center';\n } else if (isMultiLine) {\n rootSizeClassName = 'min-h-[88px] justify-start';\n }\n const accessoryAlignItems = isMultiLine\n ? BoxAlignItems.Start\n : BoxAlignItems.Center;\n\n const rootBaseClassName = mergeTwClassName(\n 'w-full px-4 py-3',\n rootSizeClassName,\n );\n const rootTwClassName = mergeTwClassName(rootBaseClassName, twClassName);\n\n const wrapperStyle = style\n ? [tw.style(rootTwClassName), style]\n : tw.style(rootTwClassName);\n\n const getPressableStyle = ({\n pressed,\n }: PressableStateCallbackType): StyleProp<ViewStyle> => {\n const baseStyle = tw.style(rootTwClassName, pressed && 'bg-pressed');\n\n if (!style) {\n return baseStyle;\n }\n\n const userStyle = typeof style === 'function' ? style({ pressed }) : style;\n\n return [baseStyle, userStyle];\n };\n\n const hasRowAccessories = Boolean(startAccessory) || Boolean(endAccessory);\n\n const content = (\n <Content\n twClassName={hasRowAccessories ? 'flex-1 min-w-0' : undefined}\n variant={variant}\n avatar={avatar}\n title={title}\n titleProps={titleProps}\n titleStartAccessory={titleStartAccessory}\n titleEndAccessory={titleEndAccessory}\n description={description}\n descriptionProps={descriptionProps}\n descriptionStartAccessory={descriptionStartAccessory}\n descriptionEndAccessory={descriptionEndAccessory}\n value={value}\n valueProps={valueProps}\n valueStartAccessory={valueStartAccessory}\n valueEndAccessory={valueEndAccessory}\n subvalue={subvalue}\n subvalueProps={subvalueProps}\n subvalueStartAccessory={subvalueStartAccessory}\n subvalueEndAccessory={subvalueEndAccessory}\n />\n );\n\n const listContent = hasRowAccessories ? (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={accessoryAlignItems}\n gap={accessoryGap}\n >\n {startAccessory}\n {content}\n {endAccessory}\n </Box>\n ) : (\n content\n );\n\n if (isInteractive) {\n return (\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n style={getPressableStyle}\n {...props}\n >\n {listContent}\n {children}\n </Pressable>\n );\n }\n\n return (\n <Box style={wrapperStyle} {...props}>\n {listContent}\n {children}\n </Box>\n );\n};\n\nListItem.displayName = 'ListItem';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.cts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAEtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA2H5C,CAAC"}
1
+ {"version":3,"file":"ListItem.d.cts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAEtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4H5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.mts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAEtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA2H5C,CAAC"}
1
+ {"version":3,"file":"ListItem.d.mts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAEtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4H5C,CAAC"}
@@ -4,13 +4,12 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { BoxAlignItems, ContentVariant, mergeTwClassName } from "@metamask-previews/design-system-shared";
7
+ import { BoxAlignItems, BoxFlexDirection, ContentVariant, mergeTwClassName } 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";
14
13
  import { Content } from "../Content/index.mjs";
15
14
  export const ListItem = ({ children, isInteractive = false, twClassName, style, startAccessory, endAccessory, accessoryGap = 0, variant = ContentVariant.TwoLines, avatar, title, titleProps, titleStartAccessory, titleEndAccessory, description, descriptionProps, descriptionStartAccessory, descriptionEndAccessory, value, valueProps, valueStartAccessory, valueEndAccessory, subvalue, subvalueProps, subvalueStartAccessory, subvalueEndAccessory, accessibilityRole, ...props }) => {
16
15
  const tw = useTailwind();
@@ -40,9 +39,11 @@ export const ListItem = ({ children, isInteractive = false, twClassName, style,
40
39
  };
41
40
  const hasRowAccessories = Boolean(startAccessory) || Boolean(endAccessory);
42
41
  const content = (<Content twClassName={hasRowAccessories ? 'flex-1 min-w-0' : undefined} variant={variant} avatar={avatar} title={title} titleProps={titleProps} titleStartAccessory={titleStartAccessory} titleEndAccessory={titleEndAccessory} description={description} descriptionProps={descriptionProps} descriptionStartAccessory={descriptionStartAccessory} descriptionEndAccessory={descriptionEndAccessory} value={value} valueProps={valueProps} valueStartAccessory={valueStartAccessory} valueEndAccessory={valueEndAccessory} subvalue={subvalue} subvalueProps={subvalueProps} subvalueStartAccessory={subvalueStartAccessory} subvalueEndAccessory={subvalueEndAccessory}/>);
43
- const listContent = hasRowAccessories ? (<BoxRow startAccessory={startAccessory} endAccessory={endAccessory} alignItems={accessoryAlignItems} gap={accessoryGap}>
42
+ const listContent = hasRowAccessories ? (<Box flexDirection={BoxFlexDirection.Row} alignItems={accessoryAlignItems} gap={accessoryGap}>
43
+ {startAccessory}
44
44
  {content}
45
- </BoxRow>) : (content);
45
+ {endAccessory}
46
+ </Box>) : (content);
46
47
  if (isInteractive) {
47
48
  return (<Pressable accessibilityRole={accessibilityRole ?? 'button'} style={getPressableStyle} {...props}>
48
49
  {listContent}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.mjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EACjB,gDAAgD;AACjD,OAAO,EAAE,W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CACb,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,CACzC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,CAC/C,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,EAC3C,CACH,CAAC;IAEF,MAAM,WAAW,GAAG,iBAAiB,CAAC,CAAC,CAAC,CACtC,CAAC,MAAM,CACL,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,UAAU,CAAC,CAAC,mBAAmB,CAAC,CAChC,GAAG,CAAC,CAAC,YAAY,CAAC,CAElB;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CACL,CAAC,SAAS,CACR,iBAAiB,CAAC,CAAC,iBAAiB,IAAI,QAAQ,CAAC,CACjD,KAAK,CAAC,CAAC,iBAAiB,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,WAAW,CACZ;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,CAAC,CAClC;MAAA,CAAC,WAAW,CACZ;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import {\n BoxAlignItems,\n ContentVariant,\n mergeTwClassName,\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';\nimport type {\n PressableStateCallbackType,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Content } from '../Content';\n\nimport type { ListItemProps } from './ListItem.types';\n\nexport const ListItem: React.FC<ListItemProps> = ({\n children,\n isInteractive = false,\n twClassName,\n style,\n startAccessory,\n endAccessory,\n accessoryGap = 0,\n variant = ContentVariant.TwoLines,\n avatar,\n title,\n titleProps,\n titleStartAccessory,\n titleEndAccessory,\n description,\n descriptionProps,\n descriptionStartAccessory,\n descriptionEndAccessory,\n value,\n valueProps,\n valueStartAccessory,\n valueEndAccessory,\n subvalue,\n subvalueProps,\n subvalueStartAccessory,\n subvalueEndAccessory,\n accessibilityRole,\n ...props\n}) => {\n const tw = useTailwind();\n const isMultiLine = variant === ContentVariant.MultiLine;\n let rootSizeClassName = 'min-h-[72px] justify-center';\n if (variant === ContentVariant.OneLine) {\n rootSizeClassName = 'min-h-[48px] justify-center';\n } else if (isMultiLine) {\n rootSizeClassName = 'min-h-[88px] justify-start';\n }\n const accessoryAlignItems = isMultiLine\n ? BoxAlignItems.Start\n : BoxAlignItems.Center;\n\n const rootBaseClassName = mergeTwClassName(\n 'w-full px-4 py-3',\n rootSizeClassName,\n );\n const rootTwClassName = mergeTwClassName(rootBaseClassName, twClassName);\n\n const wrapperStyle = style\n ? [tw.style(rootTwClassName), style]\n : tw.style(rootTwClassName);\n\n const getPressableStyle = ({\n pressed,\n }: PressableStateCallbackType): StyleProp<ViewStyle> => {\n const baseStyle = tw.style(rootTwClassName, pressed && 'bg-pressed');\n\n if (!style) {\n return baseStyle;\n }\n\n const userStyle = typeof style === 'function' ? style({ pressed }) : style;\n\n return [baseStyle, userStyle];\n };\n\n const hasRowAccessories = Boolean(startAccessory) || Boolean(endAccessory);\n\n const content = (\n <Content\n twClassName={hasRowAccessories ? 'flex-1 min-w-0' : undefined}\n variant={variant}\n avatar={avatar}\n title={title}\n titleProps={titleProps}\n titleStartAccessory={titleStartAccessory}\n titleEndAccessory={titleEndAccessory}\n description={description}\n descriptionProps={descriptionProps}\n descriptionStartAccessory={descriptionStartAccessory}\n descriptionEndAccessory={descriptionEndAccessory}\n value={value}\n valueProps={valueProps}\n valueStartAccessory={valueStartAccessory}\n valueEndAccessory={valueEndAccessory}\n subvalue={subvalue}\n subvalueProps={subvalueProps}\n subvalueStartAccessory={subvalueStartAccessory}\n subvalueEndAccessory={subvalueEndAccessory}\n />\n );\n\n const listContent = hasRowAccessories ? (\n <BoxRow\n startAccessory={startAccessory}\n endAccessory={endAccessory}\n alignItems={accessoryAlignItems}\n gap={accessoryGap}\n >\n {content}\n </BoxRow>\n ) : (\n content\n );\n\n if (isInteractive) {\n return (\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n style={getPressableStyle}\n {...props}\n >\n {listContent}\n {children}\n </Pressable>\n );\n }\n\n return (\n <Box style={wrapperStyle} {...props}>\n {listContent}\n {children}\n </Box>\n );\n};\n\nListItem.displayName = 'ListItem';\n"]}
1
+ {"version":3,"file":"ListItem.mjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACjB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAOzC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,OAAO,EAAE,6BAAmB;AAIrC,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAChD,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,WAAW,EACX,KAAK,EACL,cAAc,EACd,YAAY,EACZ,YAAY,GAAG,CAAC,EAChB,OAAO,GAAG,cAAc,CAAC,QAAQ,EACjC,MAAM,EACN,KAAK,EACL,UAAU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,CAAC,CAAC,mBAAmB,CAAC,CAChC,GAAG,CAAC,CAAC,YAAY,CAAC,CAElB;MAAA,CAAC,cAAc,CACf;MAAA,CAAC,OAAO,CACR;MAAA,CAAC,YAAY,CACf;IAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CACL,CAAC,SAAS,CACR,iBAAiB,CAAC,CAAC,iBAAiB,IAAI,QAAQ,CAAC,CACjD,KAAK,CAAC,CAAC,iBAAiB,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,WAAW,CACZ;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,CAAC,CAClC;MAAA,CAAC,WAAW,CACZ;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n ContentVariant,\n mergeTwClassName,\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';\nimport type {\n PressableStateCallbackType,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport { Box } from '../Box';\nimport { Content } from '../Content';\n\nimport type { ListItemProps } from './ListItem.types';\n\nexport const ListItem: React.FC<ListItemProps> = ({\n children,\n isInteractive = false,\n twClassName,\n style,\n startAccessory,\n endAccessory,\n accessoryGap = 0,\n variant = ContentVariant.TwoLines,\n avatar,\n title,\n titleProps,\n titleStartAccessory,\n titleEndAccessory,\n description,\n descriptionProps,\n descriptionStartAccessory,\n descriptionEndAccessory,\n value,\n valueProps,\n valueStartAccessory,\n valueEndAccessory,\n subvalue,\n subvalueProps,\n subvalueStartAccessory,\n subvalueEndAccessory,\n accessibilityRole,\n ...props\n}) => {\n const tw = useTailwind();\n const isMultiLine = variant === ContentVariant.MultiLine;\n let rootSizeClassName = 'min-h-[72px] justify-center';\n if (variant === ContentVariant.OneLine) {\n rootSizeClassName = 'min-h-[48px] justify-center';\n } else if (isMultiLine) {\n rootSizeClassName = 'min-h-[88px] justify-start';\n }\n const accessoryAlignItems = isMultiLine\n ? BoxAlignItems.Start\n : BoxAlignItems.Center;\n\n const rootBaseClassName = mergeTwClassName(\n 'w-full px-4 py-3',\n rootSizeClassName,\n );\n const rootTwClassName = mergeTwClassName(rootBaseClassName, twClassName);\n\n const wrapperStyle = style\n ? [tw.style(rootTwClassName), style]\n : tw.style(rootTwClassName);\n\n const getPressableStyle = ({\n pressed,\n }: PressableStateCallbackType): StyleProp<ViewStyle> => {\n const baseStyle = tw.style(rootTwClassName, pressed && 'bg-pressed');\n\n if (!style) {\n return baseStyle;\n }\n\n const userStyle = typeof style === 'function' ? style({ pressed }) : style;\n\n return [baseStyle, userStyle];\n };\n\n const hasRowAccessories = Boolean(startAccessory) || Boolean(endAccessory);\n\n const content = (\n <Content\n twClassName={hasRowAccessories ? 'flex-1 min-w-0' : undefined}\n variant={variant}\n avatar={avatar}\n title={title}\n titleProps={titleProps}\n titleStartAccessory={titleStartAccessory}\n titleEndAccessory={titleEndAccessory}\n description={description}\n descriptionProps={descriptionProps}\n descriptionStartAccessory={descriptionStartAccessory}\n descriptionEndAccessory={descriptionEndAccessory}\n value={value}\n valueProps={valueProps}\n valueStartAccessory={valueStartAccessory}\n valueEndAccessory={valueEndAccessory}\n subvalue={subvalue}\n subvalueProps={subvalueProps}\n subvalueStartAccessory={subvalueStartAccessory}\n subvalueEndAccessory={subvalueEndAccessory}\n />\n );\n\n const listContent = hasRowAccessories ? (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={accessoryAlignItems}\n gap={accessoryGap}\n >\n {startAccessory}\n {content}\n {endAccessory}\n </Box>\n ) : (\n content\n );\n\n if (isInteractive) {\n return (\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n style={getPressableStyle}\n {...props}\n >\n {listContent}\n {children}\n </Pressable>\n );\n }\n\n return (\n <Box style={wrapperStyle} {...props}>\n {listContent}\n {children}\n </Box>\n );\n};\n\nListItem.displayName = 'ListItem';\n"]}
@@ -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");
13
12
  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 {@link BoxRow}.
17
+ * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.
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 `BoxRow`
24
+ * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`
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,20 +42,25 @@ 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 ? (<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={{
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={{
46
47
  variant: design_system_shared_1.TextVariant.HeadingMd,
47
48
  color: design_system_shared_1.TextColor.TextDefault,
48
49
  ...titleProps,
49
50
  }}>
50
- {title}
51
- </BoxRow_1.BoxRow>) : null;
51
+ {title}
52
+ </TextOrChildren_1.TextOrChildren>
53
+ {titleAccessory}
54
+ </Box_1.Box>) : null;
52
55
  let mainContent = null;
53
56
  if (titleRow) {
54
57
  mainContent = hasAccessories ? (<Box_1.Box twClassName="shrink min-w-0">{titleRow}</Box_1.Box>) : (titleRow);
55
58
  }
56
- const headerRow = (<BoxRow_1.BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
59
+ const headerRow = (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1}>
60
+ {resolvedStartAccessory}
57
61
  {mainContent}
58
- </BoxRow_1.BoxRow>);
62
+ {resolvedEndAccessory}
63
+ </Box_1.Box>);
59
64
  const body = children ? (<Box_1.Box gap={1}>
60
65
  {headerRow}
61
66
  {children}
@@ -77,9 +82,11 @@ const SectionHeader = (sectionHeaderProps) => {
77
82
  {children}
78
83
  </Box_1.Box>);
79
84
  }
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}>
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}
81
87
  {mainContent}
82
- </BoxRow_1.BoxRow>);
88
+ {resolvedEndAccessory}
89
+ </Box_1.Box>);
83
90
  };
84
91
  exports.SectionHeader = SectionHeader;
85
92
  exports.SectionHeader.displayName = 'SectionHeader';
@@ -1 +1 @@
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,EAC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AG,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
+ {"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,YA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AE,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"]}
@@ -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 {@link BoxRow}.
6
+ * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.
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 `BoxRow`
13
+ * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`
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":"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"}
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"}
@@ -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 {@link BoxRow}.
6
+ * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.
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 `BoxRow`
13
+ * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`
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":"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"}
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"}
@@ -4,25 +4,25 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { IconColor, IconName, IconSize, mergeTwClassName, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
7
+ import { BoxAlignItems, BoxFlexDirection, 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";
14
13
  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 {@link BoxRow}.
18
+ * Otherwise, remaining `View` props are forwarded to the outer row {@link Box}.
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 `BoxRow`
25
+ * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner title row `Box`
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,20 +43,25 @@ 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 ? (<BoxRow {...titleWrapperProps} gap={1} endAccessory={titleAccessory} twClassName={mergeTwClassName(hasAccessories ? 'w-full shrink min-w-0' : '', titleWrapperProps?.twClassName)} textProps={{
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={{
47
48
  variant: TextVariant.HeadingMd,
48
49
  color: TextColor.TextDefault,
49
50
  ...titleProps,
50
51
  }}>
51
- {title}
52
- </BoxRow>) : null;
52
+ {title}
53
+ </TextOrChildren>
54
+ {titleAccessory}
55
+ </Box>) : null;
53
56
  let mainContent = null;
54
57
  if (titleRow) {
55
58
  mainContent = hasAccessories ? (<Box twClassName="shrink min-w-0">{titleRow}</Box>) : (titleRow);
56
59
  }
57
- const headerRow = (<BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
60
+ const headerRow = (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1}>
61
+ {resolvedStartAccessory}
58
62
  {mainContent}
59
- </BoxRow>);
63
+ {resolvedEndAccessory}
64
+ </Box>);
60
65
  const body = children ? (<Box gap={1}>
61
66
  {headerRow}
62
67
  {children}
@@ -78,9 +83,11 @@ export const SectionHeader = (sectionHeaderProps) => {
78
83
  {children}
79
84
  </Box>);
80
85
  }
81
- return (<BoxRow {...props} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
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}
82
88
  {mainContent}
83
- </BoxRow>);
89
+ {resolvedEndAccessory}
90
+ </Box>);
84
91
  };
85
92
  SectionHeader.displayName = 'SectionHeader';
86
93
  //# sourceMappingURL=SectionHeader.mjs.map
@@ -1 +1 @@
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;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,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACpE,CAAC,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,IAAI,CACP;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
+ {"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,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAC/B,OAAO,EAAE,cAAc,EAAE,oDAA0C;AAInE;;;;;;;;;;;;;;;;;;;;;;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;IAEr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oxFlexDirection,\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 +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 { 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
+ {"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,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 { BoxRowProps } from "../BoxRow/BoxRow.types.cjs";
3
+ import type { BoxProps } from "../Box/Box.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 {@link BoxRow} `textProps` when `title` is a string.
8
+ * Optional props merged into the title `Text` 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 BoxRow}. Omits `children`, `endAccessory`, and `textProps` (SectionHeader sets those via `title`, `titleAccessory`, and `titleProps`).
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`).
13
13
  */
14
- titleWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
14
+ titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
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 {@link BoxRow} with `ViewProps`.
31
+ * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a row {@link Box} 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,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
+ {"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,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 { BoxRowProps } from "../BoxRow/BoxRow.types.mjs";
3
+ import type { BoxProps } from "../Box/Box.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 {@link BoxRow} `textProps` when `title` is a string.
8
+ * Optional props merged into the title `Text` 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 BoxRow}. Omits `children`, `endAccessory`, and `textProps` (SectionHeader sets those via `title`, `titleAccessory`, and `titleProps`).
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`).
13
13
  */
14
- titleWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
14
+ titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
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 {@link BoxRow} with `ViewProps`.
31
+ * When `isInteractive` is `true`, the outer wrapper is a `Pressable`; otherwise it is a row {@link Box} 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,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
+ {"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 +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 { 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
+ {"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"]}
@@ -10,9 +10,16 @@ const ButtonBase_1 = require("../ButtonBase/index.cjs");
10
10
  const Icon_1 = require("../Icon/index.cjs");
11
11
  const Text_1 = require("../Text/index.cjs");
12
12
  const SelectButton_constants_1 = require("./SelectButton.constants.cjs");
13
- const SelectButton = ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow = false, isDisabled = false, isFullWidth = false, endArrowDirectionIconProps, variant = design_system_shared_1.SelectButtonVariant.Primary, isLoading = false, size = design_system_shared_1.SelectButtonSize.Sm, twClassName = '', style, ...buttonBaseRest }) => {
13
+ const SelectButton = ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow = false, isDisabled = false, isFullWidth = false, endArrowDirectionIconProps, variant = design_system_shared_1.SelectButtonVariant.Primary, isLoading = false, size = design_system_shared_1.SelectButtonSize.Sm, twClassName = '', style, accessibilityLabel, ...buttonBaseRest }) => {
14
14
  const labelContent = value ?? placeholder;
15
+ const hasLabel = Boolean(labelContent);
16
+ if (__DEV__ && !hasLabel && !accessibilityLabel) {
17
+ console.warn('SelectButton: no label is rendered because `value` and `placeholder` are missing or empty. Provide an `accessibilityLabel` so the control has an accessible name.');
18
+ }
15
19
  const resolvedTextProps = {
20
+ // One-line ellipsis by default; callers override it through `textProps`.
21
+ numberOfLines: 1,
22
+ ellipsizeMode: 'tail',
16
23
  ...textProps,
17
24
  twClassName: (0, design_system_shared_1.mergeTwClassName)(
18
25
  // Ensure the label actually grows to push the end arrow when full width.
@@ -30,7 +37,7 @@ const SelectButton = ({ placeholder, value, textProps, startAccessory, endArrowD
30
37
  if (hideEndArrow) {
31
38
  resolvedEndArrowDirection = undefined;
32
39
  }
33
- else if (endArrowDirection !== undefined && endArrowDirection !== null) {
40
+ else if (endArrowDirection !== undefined) {
34
41
  resolvedEndArrowDirection = endArrowDirection;
35
42
  }
36
43
  else if (endAccessory) {
@@ -39,7 +46,7 @@ const SelectButton = ({ placeholder, value, textProps, startAccessory, endArrowD
39
46
  else {
40
47
  resolvedEndArrowDirection = design_system_shared_1.SelectButtonEndArrow.Down;
41
48
  }
42
- return (<ButtonBase_1.ButtonBase {...buttonBaseRest} size={size} isDisabled={isDisabled} isFullWidth={isFullWidth} isLoading={isLoading} children={labelContent} textProps={{
49
+ return (<ButtonBase_1.ButtonBase {...buttonBaseRest} size={size} isDisabled={isDisabled} isFullWidth={isFullWidth} isLoading={isLoading} accessibilityLabel={accessibilityLabel} children={hasLabel ? labelContent : undefined} textProps={{
43
50
  ...(variant === design_system_shared_1.SelectButtonVariant.Tertiary
44
51
  ? { color: Text_1.TextColor.TextAlternative }
45
52
  : {}),