@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
@@ -1 +1 @@
1
- {"version":3,"file":"SelectButton.cjs","sourceRoot":"","sources":["../../../src/components/SelectButton/SelectButton.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAKiD;AACjD,kDAA0B;AAE1B,wDAA2C;AAC3C,4CAAoC;AACpC,4CAAoC;AAEpC,yEAA6F;AAGtF,MAAM,YAAY,GAAG,CAAC,EAC3B,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,YAAY,GAAG,KAAK,EACpB,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,KAAK,EACnB,0BAA0B,EAC1B,OAAO,GAAG,0CAAmB,CAAC,OAAO,EACrC,SAAS,GAAG,KAAK,EAC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AC,CAAC,GAAG,EAAE,CAClB,OAAO,KAAK,0CAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAClD,CAAC,CACD,aAAa,CAAC,CAAC,GAAG,EAAE,CAClB,OAAO,KAAK,0CAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAClD,CAAC,CACD,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,YAAY,gBA2GvB;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import {\n mergeTwClassName,\n SelectButtonEndArrow,\n SelectButtonSize,\n SelectButtonVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\nimport { IconColor } from '../Icon';\nimport { TextColor } from '../Text';\n\nimport { MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME } from './SelectButton.constants';\nimport type { SelectButtonProps } from './SelectButton.types';\n\nexport const SelectButton = ({\n placeholder,\n value,\n textProps,\n startAccessory,\n endArrowDirection,\n endAccessory,\n hideEndArrow = false,\n isDisabled = false,\n isFullWidth = false,\n endArrowDirectionIconProps,\n variant = SelectButtonVariant.Primary,\n isLoading = false,\n size = SelectButtonSize.Sm,\n twClassName = '',\n style,\n ...buttonBaseRest\n}: SelectButtonProps) => {\n const labelContent = value ?? placeholder;\n const resolvedTextProps = {\n ...textProps,\n twClassName: mergeTwClassName(\n // Ensure the label actually grows to push the end arrow when full width.\n // ButtonBase applies 'grow-0' by default; add 'grow' here to override it.\n // Keep 'flex-1' for existing expectations/tests.\n isFullWidth ? 'text-left flex-1 grow' : 'text-left',\n textProps?.twClassName,\n ),\n };\n const resolvedContentWrapperProps = isFullWidth\n ? {\n ...buttonBaseRest.contentWrapperProps,\n twClassName: mergeTwClassName(\n 'w-full',\n buttonBaseRest.contentWrapperProps?.twClassName,\n ),\n }\n : buttonBaseRest.contentWrapperProps;\n\n let resolvedEndArrowDirection: SelectButtonEndArrow | undefined;\n if (hideEndArrow) {\n resolvedEndArrowDirection = undefined;\n } else if (endArrowDirection !== undefined && endArrowDirection !== null) {\n resolvedEndArrowDirection = endArrowDirection;\n } else if (endAccessory) {\n resolvedEndArrowDirection = undefined;\n } else {\n resolvedEndArrowDirection = SelectButtonEndArrow.Down;\n }\n\n return (\n <ButtonBase\n {...buttonBaseRest}\n size={size}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n children={labelContent}\n textProps={{\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: TextColor.TextAlternative }\n : {}),\n ...resolvedTextProps,\n }}\n contentWrapperProps={resolvedContentWrapperProps}\n startAccessory={startAccessory}\n endAccessory={resolvedEndArrowDirection ? undefined : endAccessory}\n endIconName={\n resolvedEndArrowDirection\n ? MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME[\n resolvedEndArrowDirection\n ]\n : undefined\n }\n endIconProps={\n resolvedEndArrowDirection\n ? {\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: IconColor.IconAlternative }\n : {}),\n ...endArrowDirectionIconProps,\n }\n : undefined\n }\n twClassName={(pressed) =>\n variant === SelectButtonVariant.Secondary ||\n variant === SelectButtonVariant.Tertiary\n ? `min-w-0 ${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n : `min-w-0 ${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} border-transparent border ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n }\n textClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n iconClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n style={style}\n />\n );\n};\n\nSelectButton.displayName = 'SelectButton';\n"]}
1
+ {"version":3,"file":"SelectButton.cj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BACE,GAAG,CAAC,OAAO,KAAK,0CAAmB,CAAC,QAAQ;oBAC1C,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAS,CAAC,eAAe,EAAE;oBACtC,CAAC,CAAC,EAAE,CAAC;gBACP,GAAG,0BAA0B;aAC9B;YACH,CAAC,CAAC,SACN,CAAC,CACD,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CACvB,OAAO,KAAK,0CAAmB,CAAC,SAAS;YACzC,OAAO,KAAK,0CAAmB,CAAC,QAAQ;YACtC,CAAC,CAAC,WAAW,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,aAC/D,OAAO,WAAW,KAAK,UAAU;gBAC/B,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC;gBACtB,CAAC,CAAC,WACN,EAAE;YACJ,CAAC,CAAC,WAAW,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,8BAC/D,OAAO,WAAW,KAAK,UAAU;gBAC/B,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC;gBACtB,CAAC,CAAC,WACN,EACN,CAAC,CACD,aAAa,CAAC,CAAC,GAAG,EAAE,CAClB,OAAO,KAAK,0CAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAClD,CAAC,CACD,aAAa,CAAC,CAAC,GAAG,EAAE,CAClB,OAAO,KAAK,0CAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAClD,CAAC,CACD,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAxHW,QAAA,YAAY,gBAwHvB;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import {\n mergeTwClassName,\n SelectButtonEndArrow,\n SelectButtonSize,\n SelectButtonVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\nimport { IconColor } from '../Icon';\nimport { TextColor } from '../Text';\n\nimport { MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME } from './SelectButton.constants';\nimport type { SelectButtonProps } from './SelectButton.types';\n\nexport const SelectButton = ({\n placeholder,\n value,\n textProps,\n startAccessory,\n endArrowDirection,\n endAccessory,\n hideEndArrow = false,\n isDisabled = false,\n isFullWidth = false,\n endArrowDirectionIconProps,\n variant = SelectButtonVariant.Primary,\n isLoading = false,\n size = SelectButtonSize.Sm,\n twClassName = '',\n style,\n accessibilityLabel,\n ...buttonBaseRest\n}: SelectButtonProps) => {\n const labelContent = value ?? placeholder;\n const hasLabel = Boolean(labelContent);\n\n if (__DEV__ && !hasLabel && !accessibilityLabel) {\n console.warn(\n 'SelectButton: no label is rendered because `value` and `placeholder` are missing or empty. Provide an `accessibilityLabel` so the control has an accessible name.',\n );\n }\n\n const resolvedTextProps = {\n // One-line ellipsis by default; callers override it through `textProps`.\n numberOfLines: 1,\n ellipsizeMode: 'tail' as const,\n ...textProps,\n twClassName: mergeTwClassName(\n // Ensure the label actually grows to push the end arrow when full width.\n // ButtonBase applies 'grow-0' by default; add 'grow' here to override it.\n // Keep 'flex-1' for existing expectations/tests.\n isFullWidth ? 'text-left flex-1 grow' : 'text-left',\n textProps?.twClassName,\n ),\n };\n const resolvedContentWrapperProps = isFullWidth\n ? {\n ...buttonBaseRest.contentWrapperProps,\n twClassName: mergeTwClassName(\n 'w-full',\n buttonBaseRest.contentWrapperProps?.twClassName,\n ),\n }\n : buttonBaseRest.contentWrapperProps;\n\n let resolvedEndArrowDirection: SelectButtonEndArrow | undefined;\n if (hideEndArrow) {\n resolvedEndArrowDirection = undefined;\n } else if (endArrowDirection !== undefined) {\n resolvedEndArrowDirection = endArrowDirection;\n } else if (endAccessory) {\n resolvedEndArrowDirection = undefined;\n } else {\n resolvedEndArrowDirection = SelectButtonEndArrow.Down;\n }\n\n return (\n <ButtonBase\n {...buttonBaseRest}\n size={size}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n accessibilityLabel={accessibilityLabel}\n children={hasLabel ? labelContent : undefined}\n textProps={{\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: TextColor.TextAlternative }\n : {}),\n ...resolvedTextProps,\n }}\n contentWrapperProps={resolvedContentWrapperProps}\n startAccessory={startAccessory}\n endAccessory={resolvedEndArrowDirection ? undefined : endAccessory}\n endIconName={\n resolvedEndArrowDirection\n ? MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME[\n resolvedEndArrowDirection\n ]\n : undefined\n }\n endIconProps={\n resolvedEndArrowDirection\n ? {\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: IconColor.IconAlternative }\n : {}),\n ...endArrowDirectionIconProps,\n }\n : undefined\n }\n twClassName={(pressed) =>\n variant === SelectButtonVariant.Secondary ||\n variant === SelectButtonVariant.Tertiary\n ? `min-w-0 ${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n : `min-w-0 ${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} border-transparent border ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n }\n textClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n iconClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n style={style}\n />\n );\n};\n\nSelectButton.displayName = 'SelectButton';\n"]}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { SelectButtonProps } from "./SelectButton.types.cjs";
3
3
  export declare const SelectButton: {
4
- ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow, isDisabled, isFullWidth, endArrowDirectionIconProps, variant, isLoading, size, twClassName, style, ...buttonBaseRest }: SelectButtonProps): React.JSX.Element;
4
+ ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow, isDisabled, isFullWidth, endArrowDirectionIconProps, variant, isLoading, size, twClassName, style, accessibilityLabel, ...buttonBaseRest }: SelectButtonProps): React.JSX.Element;
5
5
  displayName: string;
6
6
  };
7
7
  //# sourceMappingURL=SelectButton.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectButton.d.cts","sourceRoot":"","sources":["../../../src/components/SelectButton/SelectButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY;6NAiBtB,iBAAiB;;CA0FnB,CAAC"}
1
+ {"version":3,"file":"SelectButton.d.cts","sourceRoot":"","sources":["../../../src/components/SelectButton/SelectButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY;iPAkBtB,iBAAiB;;CAsGnB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { SelectButtonProps } from "./SelectButton.types.mjs";
3
3
  export declare const SelectButton: {
4
- ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow, isDisabled, isFullWidth, endArrowDirectionIconProps, variant, isLoading, size, twClassName, style, ...buttonBaseRest }: SelectButtonProps): React.JSX.Element;
4
+ ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow, isDisabled, isFullWidth, endArrowDirectionIconProps, variant, isLoading, size, twClassName, style, accessibilityLabel, ...buttonBaseRest }: SelectButtonProps): React.JSX.Element;
5
5
  displayName: string;
6
6
  };
7
7
  //# sourceMappingURL=SelectButton.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectButton.d.mts","sourceRoot":"","sources":["../../../src/components/SelectButton/SelectButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY;6NAiBtB,iBAAiB;;CA0FnB,CAAC"}
1
+ {"version":3,"file":"SelectButton.d.mts","sourceRoot":"","sources":["../../../src/components/SelectButton/SelectButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY;iPAkBtB,iBAAiB;;CAsGnB,CAAC"}
@@ -11,9 +11,16 @@ import { ButtonBase } from "../ButtonBase/index.mjs";
11
11
  import { IconColor } from "../Icon/index.mjs";
12
12
  import { TextColor } from "../Text/index.mjs";
13
13
  import { MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME } from "./SelectButton.constants.mjs";
14
- export const SelectButton = ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow = false, isDisabled = false, isFullWidth = false, endArrowDirectionIconProps, variant = SelectButtonVariant.Primary, isLoading = false, size = SelectButtonSize.Sm, twClassName = '', style, ...buttonBaseRest }) => {
14
+ export const SelectButton = ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow = false, isDisabled = false, isFullWidth = false, endArrowDirectionIconProps, variant = SelectButtonVariant.Primary, isLoading = false, size = SelectButtonSize.Sm, twClassName = '', style, accessibilityLabel, ...buttonBaseRest }) => {
15
15
  const labelContent = value ?? placeholder;
16
+ const hasLabel = Boolean(labelContent);
17
+ if (__DEV__ && !hasLabel && !accessibilityLabel) {
18
+ 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.');
19
+ }
16
20
  const resolvedTextProps = {
21
+ // One-line ellipsis by default; callers override it through `textProps`.
22
+ numberOfLines: 1,
23
+ ellipsizeMode: 'tail',
17
24
  ...textProps,
18
25
  twClassName: mergeTwClassName(
19
26
  // Ensure the label actually grows to push the end arrow when full width.
@@ -31,7 +38,7 @@ export const SelectButton = ({ placeholder, value, textProps, startAccessory, en
31
38
  if (hideEndArrow) {
32
39
  resolvedEndArrowDirection = undefined;
33
40
  }
34
- else if (endArrowDirection !== undefined && endArrowDirection !== null) {
41
+ else if (endArrowDirection !== undefined) {
35
42
  resolvedEndArrowDirection = endArrowDirection;
36
43
  }
37
44
  else if (endAccessory) {
@@ -40,7 +47,7 @@ export const SelectButton = ({ placeholder, value, textProps, startAccessory, en
40
47
  else {
41
48
  resolvedEndArrowDirection = SelectButtonEndArrow.Down;
42
49
  }
43
- return (<ButtonBase {...buttonBaseRest} size={size} isDisabled={isDisabled} isFullWidth={isFullWidth} isLoading={isLoading} children={labelContent} textProps={{
50
+ return (<ButtonBase {...buttonBaseRest} size={size} isDisabled={isDisabled} isFullWidth={isFullWidth} isLoading={isLoading} accessibilityLabel={accessibilityLabel} children={hasLabel ? labelContent : undefined} textProps={{
44
51
  ...(variant === SelectButtonVariant.Tertiary
45
52
  ? { color: TextColor.TextAlternative }
46
53
  : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"SelectButton.mjs","sourceRoot":"","sources":["../../../src/components/SelectButton/SelectButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACpB,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,SAAS,EAAE,0BAAgB;AACpC,OAAO,EAAE,SAAS,EAAE,0BAAgB;AAEpC,OAAO,EAAE,iDAAiD,EAAE,qCAAiC;AAG7F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,YAAY,GAAG,KAAK,EACpB,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,KAAK,EACnB,0BAA0B,EAC1B,OAAO,GAAG,mBAAmB,CA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,CAAC,CACD,aAAa,CAAC,CAAC,GAAG,EAAE,CAClB,OAAO,KAAK,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAClD,CAAC,CACD,aAAa,CAAC,CAAC,GAAG,EAAE,CAClB,OAAO,KAAK,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAClD,CAAC,CACD,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import {\n mergeTwClassName,\n SelectButtonEndArrow,\n SelectButtonSize,\n SelectButtonVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\nimport { IconColor } from '../Icon';\nimport { TextColor } from '../Text';\n\nimport { MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME } from './SelectButton.constants';\nimport type { SelectButtonProps } from './SelectButton.types';\n\nexport const SelectButton = ({\n placeholder,\n value,\n textProps,\n startAccessory,\n endArrowDirection,\n endAccessory,\n hideEndArrow = false,\n isDisabled = false,\n isFullWidth = false,\n endArrowDirectionIconProps,\n variant = SelectButtonVariant.Primary,\n isLoading = false,\n size = SelectButtonSize.Sm,\n twClassName = '',\n style,\n ...buttonBaseRest\n}: SelectButtonProps) => {\n const labelContent = value ?? placeholder;\n const resolvedTextProps = {\n ...textProps,\n twClassName: mergeTwClassName(\n // Ensure the label actually grows to push the end arrow when full width.\n // ButtonBase applies 'grow-0' by default; add 'grow' here to override it.\n // Keep 'flex-1' for existing expectations/tests.\n isFullWidth ? 'text-left flex-1 grow' : 'text-left',\n textProps?.twClassName,\n ),\n };\n const resolvedContentWrapperProps = isFullWidth\n ? {\n ...buttonBaseRest.contentWrapperProps,\n twClassName: mergeTwClassName(\n 'w-full',\n buttonBaseRest.contentWrapperProps?.twClassName,\n ),\n }\n : buttonBaseRest.contentWrapperProps;\n\n let resolvedEndArrowDirection: SelectButtonEndArrow | undefined;\n if (hideEndArrow) {\n resolvedEndArrowDirection = undefined;\n } else if (endArrowDirection !== undefined && endArrowDirection !== null) {\n resolvedEndArrowDirection = endArrowDirection;\n } else if (endAccessory) {\n resolvedEndArrowDirection = undefined;\n } else {\n resolvedEndArrowDirection = SelectButtonEndArrow.Down;\n }\n\n return (\n <ButtonBase\n {...buttonBaseRest}\n size={size}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n children={labelContent}\n textProps={{\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: TextColor.TextAlternative }\n : {}),\n ...resolvedTextProps,\n }}\n contentWrapperProps={resolvedContentWrapperProps}\n startAccessory={startAccessory}\n endAccessory={resolvedEndArrowDirection ? undefined : endAccessory}\n endIconName={\n resolvedEndArrowDirection\n ? MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME[\n resolvedEndArrowDirection\n ]\n : undefined\n }\n endIconProps={\n resolvedEndArrowDirection\n ? {\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: IconColor.IconAlternative }\n : {}),\n ...endArrowDirectionIconProps,\n }\n : undefined\n }\n twClassName={(pressed) =>\n variant === SelectButtonVariant.Secondary ||\n variant === SelectButtonVariant.Tertiary\n ? `min-w-0 ${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n : `min-w-0 ${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} border-transparent border ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n }\n textClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n iconClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n style={style}\n />\n );\n};\n\nSelectButton.displayName = 'SelectButton';\n"]}
1
+ {"version":3,"file":"SelectButton.mjs","sourceRoot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CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import {\n mergeTwClassName,\n SelectButtonEndArrow,\n SelectButtonSize,\n SelectButtonVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\nimport { IconColor } from '../Icon';\nimport { TextColor } from '../Text';\n\nimport { MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME } from './SelectButton.constants';\nimport type { SelectButtonProps } from './SelectButton.types';\n\nexport const SelectButton = ({\n placeholder,\n value,\n textProps,\n startAccessory,\n endArrowDirection,\n endAccessory,\n hideEndArrow = false,\n isDisabled = false,\n isFullWidth = false,\n endArrowDirectionIconProps,\n variant = SelectButtonVariant.Primary,\n isLoading = false,\n size = SelectButtonSize.Sm,\n twClassName = '',\n style,\n accessibilityLabel,\n ...buttonBaseRest\n}: SelectButtonProps) => {\n const labelContent = value ?? placeholder;\n const hasLabel = Boolean(labelContent);\n\n if (__DEV__ && !hasLabel && !accessibilityLabel) {\n console.warn(\n 'SelectButton: no label is rendered because `value` and `placeholder` are missing or empty. Provide an `accessibilityLabel` so the control has an accessible name.',\n );\n }\n\n const resolvedTextProps = {\n // One-line ellipsis by default; callers override it through `textProps`.\n numberOfLines: 1,\n ellipsizeMode: 'tail' as const,\n ...textProps,\n twClassName: mergeTwClassName(\n // Ensure the label actually grows to push the end arrow when full width.\n // ButtonBase applies 'grow-0' by default; add 'grow' here to override it.\n // Keep 'flex-1' for existing expectations/tests.\n isFullWidth ? 'text-left flex-1 grow' : 'text-left',\n textProps?.twClassName,\n ),\n };\n const resolvedContentWrapperProps = isFullWidth\n ? {\n ...buttonBaseRest.contentWrapperProps,\n twClassName: mergeTwClassName(\n 'w-full',\n buttonBaseRest.contentWrapperProps?.twClassName,\n ),\n }\n : buttonBaseRest.contentWrapperProps;\n\n let resolvedEndArrowDirection: SelectButtonEndArrow | undefined;\n if (hideEndArrow) {\n resolvedEndArrowDirection = undefined;\n } else if (endArrowDirection !== undefined) {\n resolvedEndArrowDirection = endArrowDirection;\n } else if (endAccessory) {\n resolvedEndArrowDirection = undefined;\n } else {\n resolvedEndArrowDirection = SelectButtonEndArrow.Down;\n }\n\n return (\n <ButtonBase\n {...buttonBaseRest}\n size={size}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n accessibilityLabel={accessibilityLabel}\n children={hasLabel ? labelContent : undefined}\n textProps={{\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: TextColor.TextAlternative }\n : {}),\n ...resolvedTextProps,\n }}\n contentWrapperProps={resolvedContentWrapperProps}\n startAccessory={startAccessory}\n endAccessory={resolvedEndArrowDirection ? undefined : endAccessory}\n endIconName={\n resolvedEndArrowDirection\n ? MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME[\n resolvedEndArrowDirection\n ]\n : undefined\n }\n endIconProps={\n resolvedEndArrowDirection\n ? {\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: IconColor.IconAlternative }\n : {}),\n ...endArrowDirectionIconProps,\n }\n : undefined\n }\n twClassName={(pressed) =>\n variant === SelectButtonVariant.Secondary ||\n variant === SelectButtonVariant.Tertiary\n ? `min-w-0 ${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n : `min-w-0 ${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} border-transparent border ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n }\n textClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n iconClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n style={style}\n />\n );\n};\n\nSelectButton.displayName = 'SelectButton';\n"]}
@@ -9,8 +9,10 @@ const react_1 = __importDefault(require("react"));
9
9
  const react_native_1 = require("react-native");
10
10
  const Text_1 = require("../Text/index.cjs");
11
11
  const IOS_SWITCH_MARGIN_FIX = 4;
12
- const Switch = ({ isOn, isDisabled = false, onValueChange, label, style, testID, ...props }) => {
12
+ const Switch = ({ isOn, isDisabled = false, onValueChange, label, style, testID, accessibilityLabel, ...props }) => {
13
13
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
14
+ // Blank accessibilityLabel is omitted so the visible label can name the switch.
15
+ const resolvedLabel = accessibilityLabel || label || undefined;
14
16
  return (<react_native_1.View testID={testID} style={tw.style('flex-row items-center', isDisabled && 'opacity-50')}>
15
17
  {label ? (<Text_1.Text variant={Text_1.TextVariant.BodyMd} color={Text_1.TextColor.TextDefault} style={tw `mr-2 flex-1`}>
16
18
  {label}
@@ -18,7 +20,7 @@ const Switch = ({ isOn, isDisabled = false, onValueChange, label, style, testID,
18
20
  <react_native_1.Switch {...props} value={isOn} disabled={isDisabled} onValueChange={onValueChange} accessibilityRole="switch" accessibilityState={{
19
21
  checked: isOn,
20
22
  disabled: isDisabled,
21
- }} accessibilityLabel={label} style={[
23
+ }} accessibilityLabel={resolvedLabel} style={[
22
24
  react_native_1.Platform.OS === 'ios' && { marginRight: IOS_SWITCH_MARGIN_FIX },
23
25
  style,
24
26
  ]}/>
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.cjs","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAkE;AAElE,4CAAuD;AAIvD,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEzB,MAAM,MAAM,GAAG,CAAC,EACrB,IAAI,EACJ,UAAU,GAAG,KAAK,EAClB,aAAa,EACb,KAAK,EACL,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,EAAE,UAAU,IAAI,YAAY,CAAC,CAAC,CAErE;MAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,WAAI,CACH,OAAO,CAAC,CAAC,kBAAW,CAAC,MAAM,CAAC,CAC5B,KAAK,CAAC,CAAC,gBAAS,CAAC,WAAW,CAAC,CAC7B,KAAK,CAAC,CAAC,EAAE,CAAA,aAAa,CAAC,CAEvB;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,WAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;MAAA,CAAC,qBAAQ,CACP,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,IAAI,CAAC,CACZ,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,iBAAiB,CAAC,QAAQ,CAC1B,kBAAkB,CAAC,CAAC;YAClB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,UAAU;SACrB,CAAC,CACF,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAC1B,KAAK,CAAC,CAAC;YACL,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE;YAC/D,KAAK;SACN,CAAC,EAEN;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA3CW,QAAA,MAAM,UA2CjB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Switch as RNSwitch, Platform, View } from 'react-native';\n\nimport { Text, TextVariant, TextColor } from '../Text';\n\nimport type { SwitchProps } from './Switch.types';\n\nconst IOS_SWITCH_MARGIN_FIX = 4;\n\nexport const Switch = ({\n isOn,\n isDisabled = false,\n onValueChange,\n label,\n style,\n testID,\n ...props\n}: SwitchProps) => {\n const tw = useTailwind();\n\n return (\n <View\n testID={testID}\n style={tw.style('flex-row items-center', isDisabled && 'opacity-50')}\n >\n {label ? (\n <Text\n variant={TextVariant.BodyMd}\n color={TextColor.TextDefault}\n style={tw`mr-2 flex-1`}\n >\n {label}\n </Text>\n ) : null}\n <RNSwitch\n {...props}\n value={isOn}\n disabled={isDisabled}\n onValueChange={onValueChange}\n accessibilityRole=\"switch\"\n accessibilityState={{\n checked: isOn,\n disabled: isDisabled,\n }}\n accessibilityLabel={label}\n style={[\n Platform.OS === 'ios' && { marginRight: IOS_SWITCH_MARGIN_FIX },\n style,\n ]}\n />\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"Switch.cjs","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAkE;AAElE,4CAAuD;AAIvD,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEzB,MAAM,MAAM,GAAG,CAAC,EACrB,IAAI,EACJ,UAAU,GAAG,KAAK,EAClB,aAAa,EACb,KAAK,EACL,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,gFAAgF;IAChF,MAAM,aAAa,GAAG,kBAAkB,IAAI,KAAK,IAAI,SAAS,CAAC;IAE/D,OAAO,CACL,CAAC,mBAAI,CACH,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,EAAE,UAAU,IAAI,YAAY,CAAC,CAAC,CAErE;MAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,WAAI,CACH,OAAO,CAAC,CAAC,kBAAW,CAAC,MAAM,CAAC,CAC5B,KAAK,CAAC,CAAC,gBAAS,CAAC,WAAW,CAAC,CAC7B,KAAK,CAAC,CAAC,EAAE,CAAA,aAAa,CAAC,CAEvB;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,WAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;MAAA,CAAC,qBAAQ,CACP,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,IAAI,CAAC,CACZ,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,iBAAiB,CAAC,QAAQ,CAC1B,kBAAkB,CAAC,CAAC;YAClB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,UAAU;SACrB,CAAC,CACF,kBAAkB,CAAC,CAAC,aAAa,CAAC,CAClC,KAAK,CAAC,CAAC;YACL,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE;YAC/D,KAAK;SACN,CAAC,EAEN;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,MAAM,UA8CjB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Switch as RNSwitch, Platform, View } from 'react-native';\n\nimport { Text, TextVariant, TextColor } from '../Text';\n\nimport type { SwitchProps } from './Switch.types';\n\nconst IOS_SWITCH_MARGIN_FIX = 4;\n\nexport const Switch = ({\n isOn,\n isDisabled = false,\n onValueChange,\n label,\n style,\n testID,\n accessibilityLabel,\n ...props\n}: SwitchProps) => {\n const tw = useTailwind();\n // Blank accessibilityLabel is omitted so the visible label can name the switch.\n const resolvedLabel = accessibilityLabel || label || undefined;\n\n return (\n <View\n testID={testID}\n style={tw.style('flex-row items-center', isDisabled && 'opacity-50')}\n >\n {label ? (\n <Text\n variant={TextVariant.BodyMd}\n color={TextColor.TextDefault}\n style={tw`mr-2 flex-1`}\n >\n {label}\n </Text>\n ) : null}\n <RNSwitch\n {...props}\n value={isOn}\n disabled={isDisabled}\n onValueChange={onValueChange}\n accessibilityRole=\"switch\"\n accessibilityState={{\n checked: isOn,\n disabled: isDisabled,\n }}\n accessibilityLabel={resolvedLabel}\n style={[\n Platform.OS === 'ios' && { marginRight: IOS_SWITCH_MARGIN_FIX },\n style,\n ]}\n />\n </View>\n );\n};\n"]}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { SwitchProps } from "./Switch.types.cjs";
3
- export declare const Switch: ({ isOn, isDisabled, onValueChange, label, style, testID, ...props }: SwitchProps) => React.JSX.Element;
3
+ export declare const Switch: ({ isOn, isDisabled, onValueChange, label, style, testID, accessibilityLabel, ...props }: SwitchProps) => React.JSX.Element;
4
4
  //# sourceMappingURL=Switch.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.cts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAK1B,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAIlD,eAAO,MAAM,MAAM,GAAI,qEAQpB,WAAW,sBAmCb,CAAC"}
1
+ {"version":3,"file":"Switch.d.cts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAK1B,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAIlD,eAAO,MAAM,MAAM,GAAI,yFASpB,WAAW,sBAqCb,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { SwitchProps } from "./Switch.types.mjs";
3
- export declare const Switch: ({ isOn, isDisabled, onValueChange, label, style, testID, ...props }: SwitchProps) => React.JSX.Element;
3
+ export declare const Switch: ({ isOn, isDisabled, onValueChange, label, style, testID, accessibilityLabel, ...props }: SwitchProps) => React.JSX.Element;
4
4
  //# sourceMappingURL=Switch.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.mts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAK1B,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAIlD,eAAO,MAAM,MAAM,GAAI,qEAQpB,WAAW,sBAmCb,CAAC"}
1
+ {"version":3,"file":"Switch.d.mts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAK1B,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAIlD,eAAO,MAAM,MAAM,GAAI,yFASpB,WAAW,sBAqCb,CAAC"}
@@ -10,8 +10,10 @@ const React = $importDefault($React);
10
10
  import { Switch as RNSwitch, Platform, View } from "react-native";
11
11
  import { Text, TextVariant, TextColor } from "../Text/index.mjs";
12
12
  const IOS_SWITCH_MARGIN_FIX = 4;
13
- export const Switch = ({ isOn, isDisabled = false, onValueChange, label, style, testID, ...props }) => {
13
+ export const Switch = ({ isOn, isDisabled = false, onValueChange, label, style, testID, accessibilityLabel, ...props }) => {
14
14
  const tw = useTailwind();
15
+ // Blank accessibilityLabel is omitted so the visible label can name the switch.
16
+ const resolvedLabel = accessibilityLabel || label || undefined;
15
17
  return (<View testID={testID} style={tw.style('flex-row items-center', isDisabled && 'opacity-50')}>
16
18
  {label ? (<Text variant={TextVariant.BodyMd} color={TextColor.TextDefault} style={tw `mr-2 flex-1`}>
17
19
  {label}
@@ -19,7 +21,7 @@ export const Switch = ({ isOn, isDisabled = false, onValueChange, label, style,
19
21
  <RNSwitch {...props} value={isOn} disabled={isDisabled} onValueChange={onValueChange} accessibilityRole="switch" accessibilityState={{
20
22
  checked: isOn,
21
23
  disabled: isDisabled,
22
- }} accessibilityLabel={label} style={[
24
+ }} accessibilityLabel={resolvedLabel} style={[
23
25
  Platform.OS === 'ios' && { marginRight: IOS_SWITCH_MARGIN_FIX },
24
26
  style,
25
27
  ]}/>
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.mjs","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB;AAElE,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sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Switch as RNSwitch, Platform, View } from 'react-native';\n\nimport { Text, TextVariant, TextColor } from '../Text';\n\nimport type { SwitchProps } from './Switch.types';\n\nconst IOS_SWITCH_MARGIN_FIX = 4;\n\nexport const Switch = ({\n isOn,\n isDisabled = false,\n onValueChange,\n label,\n style,\n testID,\n ...props\n}: SwitchProps) => {\n const tw = useTailwind();\n\n return (\n <View\n testID={testID}\n style={tw.style('flex-row items-center', isDisabled && 'opacity-50')}\n >\n {label ? (\n <Text\n variant={TextVariant.BodyMd}\n color={TextColor.TextDefault}\n style={tw`mr-2 flex-1`}\n >\n {label}\n </Text>\n ) : null}\n <RNSwitch\n {...props}\n value={isOn}\n disabled={isDisabled}\n onValueChange={onValueChange}\n accessibilityRole=\"switch\"\n accessibilityState={{\n checked: isOn,\n disabled: isDisabled,\n }}\n accessibilityLabel={label}\n style={[\n Platform.OS === 'ios' && { marginRight: IOS_SWITCH_MARGIN_FIX },\n style,\n ]}\n />\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"Switch.mjs","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB;AAElE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,0BAAgB;AAIvD,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,IAAI,EACJ,UAAU,GAAG,KAAK,EAClB,aAAa,EACb,KAAK,EACL,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,gFAAgF;IAChF,MAAM,aAAa,GAAG,kBAAkB,IAAI,KAAK,IAAI,SAAS,CAAC;IAE/D,OAAO,CACL,CAAC,IAAI,CACH,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,EAAE,UAAU,IAAI,YAAY,CAAC,CAAC,CAErE;MAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,IAAI,CACH,OAAO,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAC5B,KAAK,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAC7B,KAAK,CAAC,CAAC,EAAE,CAAA,aAAa,CAAC,CAEvB;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;MAAA,CAAC,QAAQ,CACP,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,IAAI,CAAC,CACZ,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,iBAAiB,CAAC,QAAQ,CAC1B,kBAAkB,CAAC,CAAC;YAClB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,UAAU;SACrB,CAAC,CACF,kBAAkB,CAAC,CAAC,aAAa,CAAC,CAClC,KAAK,CAAC,CAAC;YACL,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE;YAC/D,KAAK;SACN,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Switch as RNSwitch, Platform, View } from 'react-native';\n\nimport { Text, TextVariant, TextColor } from '../Text';\n\nimport type { SwitchProps } from './Switch.types';\n\nconst IOS_SWITCH_MARGIN_FIX = 4;\n\nexport const Switch = ({\n isOn,\n isDisabled = false,\n onValueChange,\n label,\n style,\n testID,\n accessibilityLabel,\n ...props\n}: SwitchProps) => {\n const tw = useTailwind();\n // Blank accessibilityLabel is omitted so the visible label can name the switch.\n const resolvedLabel = accessibilityLabel || label || undefined;\n\n return (\n <View\n testID={testID}\n style={tw.style('flex-row items-center', isDisabled && 'opacity-50')}\n >\n {label ? (\n <Text\n variant={TextVariant.BodyMd}\n color={TextColor.TextDefault}\n style={tw`mr-2 flex-1`}\n >\n {label}\n </Text>\n ) : null}\n <RNSwitch\n {...props}\n value={isOn}\n disabled={isDisabled}\n onValueChange={onValueChange}\n accessibilityRole=\"switch\"\n accessibilityState={{\n checked: isOn,\n disabled: isDisabled,\n }}\n accessibilityLabel={resolvedLabel}\n style={[\n Platform.OS === 'ios' && { marginRight: IOS_SWITCH_MARGIN_FIX },\n style,\n ]}\n />\n </View>\n );\n};\n"]}
@@ -8,37 +8,31 @@ const design_system_shared_1 = require("@metamask-previews/design-system-shared"
8
8
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
9
9
  const react_1 = __importDefault(require("react"));
10
10
  const Box_1 = require("../Box/index.cjs");
11
- const BoxRow_1 = require("../BoxRow/index.cjs");
12
11
  const Icon_1 = require("../Icon/index.cjs");
12
+ const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
13
13
  const Tag_constants_1 = require("./Tag.constants.cjs");
14
14
  const Tag = ({ children, severity = design_system_shared_1.TagSeverity.Neutral, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, twClassName, style, ...props }) => {
15
15
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
16
16
  const backgroundColor = Tag_constants_1.MAP_TAG_SEVERITY_BACKGROUND[severity];
17
17
  const textColor = Tag_constants_1.MAP_TAG_SEVERITY_TEXT_COLOR[severity];
18
18
  const iconColor = Tag_constants_1.MAP_TAG_SEVERITY_ICON_COLOR[severity];
19
+ const resolvedStartIconName = startIconName ?? startIconProps?.name;
20
+ const resolvedEndIconName = endIconName ?? endIconProps?.name;
19
21
  return (<Box_1.Box {...props} backgroundColor={backgroundColor} style={[
20
- tw.style('rounded-md self-start', (startIconName ?? startIconProps?.name) ? 'pl-1' : 'pl-1.5', (endIconName ?? endIconProps?.name) ? 'pr-1' : 'pr-1.5', twClassName),
22
+ tw.style('rounded-md self-start', resolvedStartIconName ? 'pl-1' : 'pl-1.5', resolvedEndIconName ? 'pr-1' : 'pr-1.5', twClassName),
21
23
  style,
22
24
  ]}>
23
- <BoxRow_1.BoxRow twClassName="gap-0.5" textProps={{
25
+ <Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} twClassName="gap-0.5">
26
+ {resolvedStartIconName ? (<Icon_1.Icon name={resolvedStartIconName} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>) : ((startAccessory ?? null))}
27
+ <TextOrChildren_1.TextOrChildren textProps={{
24
28
  color: textColor,
25
29
  variant: design_system_shared_1.TextVariant.BodyXs,
26
30
  fontWeight: design_system_shared_1.FontWeight.Medium,
27
- }} startAccessory={(() => {
28
- const name = startIconName ?? startIconProps?.name;
29
- if (!name) {
30
- return startAccessory ?? null;
31
- }
32
- return (<Icon_1.Icon name={name} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>);
33
- })()} endAccessory={(() => {
34
- const name = endIconName ?? endIconProps?.name;
35
- if (!name) {
36
- return endAccessory ?? null;
37
- }
38
- return (<Icon_1.Icon name={name} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>);
39
- })()}>
40
- {children}
41
- </BoxRow_1.BoxRow>
31
+ }}>
32
+ {children}
33
+ </TextOrChildren_1.TextOrChildren>
34
+ {resolvedEndIconName ? (<Icon_1.Icon name={resolvedEndIconName} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>) : ((endAccessory ?? null))}
35
+ </Box_1.Box>
42
36
  </Box_1.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C,CACF,cAAc,CAAC,CAAC,CAAC,GAAG,EAAE;YACpB,MAAM,IAAI,GAAG,aAAa,IAAI,cAAc,EAAE,IAAI,CAAC;YACnD,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,cAAc,IAAI,IAAI,CAAC;YAChC,CAAC;YACD,OAAO,CACL,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,cAAc,CAAC,EACnB,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC,CACL,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE;YAClB,MAAM,IAAI,GAAG,WAAW,IAAI,YAAY,EAAE,IAAI,CAAC;YAC/C,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,YAAY,IAAI,IAAI,CAAC;YAC9B,CAAC;YACD,OAAO,CACL,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC,CAEL;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,eAAM,CACV;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,GAAG,OA0Ed","sourcesContent":["import {\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon, IconSize } from '../Icon';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n (startIconName ?? startIconProps?.name) ? 'pl-1' : 'pl-1.5',\n (endIconName ?? endIconProps?.name) ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <BoxRow\n twClassName=\"gap-0.5\"\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n startAccessory={(() => {\n const name = startIconName ?? startIconProps?.name;\n if (!name) {\n return startAccessory ?? null;\n }\n return (\n <Icon\n name={name}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n );\n })()}\n endAccessory={(() => {\n const name = endIconName ?? endIconProps?.name;\n if (!name) {\n return endAccessory ?? null;\n }\n return (\n <Icon\n name={name}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n );\n })()}\n >\n {children}\n </BoxRow>\n </Box>\n );\n};\n"]}
1
+ {"version":3,"file":"Tag.cjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAMiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAE1B,0CAA6B;AAC7B,4CAAyC;AACzC,gFAAmE;AAEnE,uDAIyB;AAGlB,MAAM,GAAG,GAAuB,CAAC,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AAC,CAAC,CAAC,CACF,CAAC,cAAc,IAAI,IAAI,CAAC,CACzB,CACD;QAAA,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC;YACT,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,kCAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,iCAAU,CAAC,MAAM;SAC9B,CAAC,CAEF;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,+BAAc,CAChB;QAAA,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACrB,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAC1B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,CAAC,YAAY,IAAI,IAAI,CAAC,CACvB,CACH;MAAA,EAAE,SAAG,CACP;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,GAAG,OA0Ed","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { Icon, IconSize } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n const resolvedStartIconName = startIconName ?? startIconProps?.name;\n const resolvedEndIconName = endIconName ?? endIconProps?.name;\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n resolvedStartIconName ? 'pl-1' : 'pl-1.5',\n resolvedEndIconName ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n twClassName=\"gap-0.5\"\n >\n {resolvedStartIconName ? (\n <Icon\n name={resolvedStartIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n ) : (\n (startAccessory ?? null)\n )}\n <TextOrChildren\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n >\n {children}\n </TextOrChildren>\n {resolvedEndIconName ? (\n <Icon\n name={resolvedEndIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n ) : (\n (endAccessory ?? null)\n )}\n </Box>\n </Box>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.cts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
1
+ {"version":3,"file":"Tag.d.cts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.mts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
1
+ {"version":3,"file":"Tag.d.mts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
@@ -4,42 +4,36 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { FontWeight, TagSeverity, TextVariant } from "@metamask-previews/design-system-shared";
7
+ import { BoxAlignItems, BoxFlexDirection, FontWeight, TagSeverity, TextVariant } from "@metamask-previews/design-system-shared";
8
8
  import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
9
9
  import $React from "react";
10
10
  const React = $importDefault($React);
11
11
  import { Box } from "../Box/index.mjs";
12
- import { BoxRow } from "../BoxRow/index.mjs";
13
12
  import { Icon, IconSize } from "../Icon/index.mjs";
13
+ import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
14
14
  import { MAP_TAG_SEVERITY_BACKGROUND, MAP_TAG_SEVERITY_ICON_COLOR, MAP_TAG_SEVERITY_TEXT_COLOR } from "./Tag.constants.mjs";
15
15
  export const Tag = ({ children, severity = TagSeverity.Neutral, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, twClassName, style, ...props }) => {
16
16
  const tw = useTailwind();
17
17
  const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];
18
18
  const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];
19
19
  const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];
20
+ const resolvedStartIconName = startIconName ?? startIconProps?.name;
21
+ const resolvedEndIconName = endIconName ?? endIconProps?.name;
20
22
  return (<Box {...props} backgroundColor={backgroundColor} style={[
21
- tw.style('rounded-md self-start', (startIconName ?? startIconProps?.name) ? 'pl-1' : 'pl-1.5', (endIconName ?? endIconProps?.name) ? 'pr-1' : 'pr-1.5', twClassName),
23
+ tw.style('rounded-md self-start', resolvedStartIconName ? 'pl-1' : 'pl-1.5', resolvedEndIconName ? 'pr-1' : 'pr-1.5', twClassName),
22
24
  style,
23
25
  ]}>
24
- <BoxRow twClassName="gap-0.5" textProps={{
26
+ <Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} twClassName="gap-0.5">
27
+ {resolvedStartIconName ? (<Icon name={resolvedStartIconName} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>) : ((startAccessory ?? null))}
28
+ <TextOrChildren textProps={{
25
29
  color: textColor,
26
30
  variant: TextVariant.BodyXs,
27
31
  fontWeight: FontWeight.Medium,
28
- }} startAccessory={(() => {
29
- const name = startIconName ?? startIconProps?.name;
30
- if (!name) {
31
- return startAccessory ?? null;
32
- }
33
- return (<Icon name={name} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>);
34
- })()} endAccessory={(() => {
35
- const name = endIconName ?? endIconProps?.name;
36
- if (!name) {
37
- return endAccessory ?? null;
38
- }
39
- return (<Icon name={name} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>);
40
- })()}>
41
- {children}
42
- </BoxRow>
32
+ }}>
33
+ {children}
34
+ </TextOrChildren>
35
+ {resolvedEndIconName ? (<Icon name={resolvedEndIconName} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>) : ((endAccessory ?? null))}
36
+ </Box>
43
37
  </Box>);
44
38
  };
45
39
  //# sourceMappingURL=Tag.m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KAAK;SACN,CAAC,CAEF;MAAA,CAAC,MAAM,CACL,WAAW,CAAC,SAAS,CACrB,SAAS,CAAC,CAAC;YACT,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;SAC9B,CAAC,CACF,cAAc,CAAC,CAAC,CAAC,GAAG,EAAE;YACpB,MAAM,IAAI,GAAG,aAAa,IAAI,cAAc,EAAE,IAAI,CAAC;YACnD,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,cAAc,IAAI,IAAI,CAAC;YAChC,CAAC;YACD,OAAO,CACL,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,cAAc,CAAC,EACnB,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC,CACL,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE;YAClB,MAAM,IAAI,GAAG,WAAW,IAAI,YAAY,EAAE,IAAI,CAAC;YAC/C,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,YAAY,IAAI,IAAI,CAAC;YAC9B,CAAC;YACD,OAAO,CACL,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC,CAEL;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,MAAM,CACV;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon, IconSize } from '../Icon';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n (startIconName ?? startIconProps?.name) ? 'pl-1' : 'pl-1.5',\n (endIconName ?? endIconProps?.name) ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <BoxRow\n twClassName=\"gap-0.5\"\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n startAccessory={(() => {\n const name = startIconName ?? startIconProps?.name;\n if (!name) {\n return startAccessory ?? null;\n }\n return (\n <Icon\n name={name}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n );\n })()}\n endAccessory={(() => {\n const name = endIconName ?? endIconProps?.name;\n if (!name) {\n return endAccessory ?? null;\n }\n return (\n <Icon\n name={name}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n );\n })()}\n >\n {children}\n </BoxRow>\n </Box>\n );\n};\n"]}
1
+ {"version":3,"file":"Tag.mjs","sourceRoot":"","sources":["../../../src/components/Tag/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;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,GAAG,CACF,aAAa,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CACjC,WAAW,CAAC,SAAS,CAErB;QAAA,CAAC,qBAAqB,CAAC,CAAC,CAAC,CACvB,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,qBAAqB,CAAC,CAC5B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,cAAc,CAAC,EACnB,CACH,CAAC,CAAC,CAAC,CACF,CAAC,cAAc,IAAI,IAAI,CAAC,CACzB,CACD;QAAA,CAAC,cAAc,CACb,SAAS,CAAC,CAAC;YACT,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;SAC9B,CAAC,CAEF;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,cAAc,CAChB;QAAA,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACrB,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAC1B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,CAAC,YAAY,IAAI,IAAI,CAAC,CACvB,CACH;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { Icon, IconSize } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n const resolvedStartIconName = startIconName ?? startIconProps?.name;\n const resolvedEndIconName = endIconName ?? endIconProps?.name;\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n resolvedStartIconName ? 'pl-1' : 'pl-1.5',\n resolvedEndIconName ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n twClassName=\"gap-0.5\"\n >\n {resolvedStartIconName ? (\n <Icon\n name={resolvedStartIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n ) : (\n (startAccessory ?? null)\n )}\n <TextOrChildren\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n >\n {children}\n </TextOrChildren>\n {resolvedEndIconName ? (\n <Icon\n name={resolvedEndIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n ) : (\n (endAccessory ?? null)\n )}\n </Box>\n </Box>\n );\n};\n"]}
@@ -7,45 +7,47 @@ exports.TitleAlert = void 0;
7
7
  const design_system_shared_1 = require("@metamask-previews/design-system-shared");
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const Box_1 = require("../Box/index.cjs");
10
- const BoxColumn_1 = require("../BoxColumn/index.cjs");
11
- const BoxRow_1 = require("../BoxRow/index.cjs");
12
10
  const IconAlert_1 = require("../IconAlert/index.cjs");
13
11
  const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
14
12
  /**
15
13
  * Displays a severity-based {@link IconAlert} above a centered title row.
16
- * Remaining `View` props are forwarded to the root {@link BoxColumn}.
14
+ * Remaining `View` props are forwarded to the root {@link Box}.
17
15
  *
18
16
  * @param props - Component props
19
17
  * @param props.severity - Passed to {@link IconAlert} for glyph and color
20
18
  * @param props.title - Title row content; row renders only when `title` is renderable
21
- * @param props.titleWrapperProps - Optional props spread onto the title row {@link BoxRow}
19
+ * @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}
22
20
  * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
23
21
  * @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}
24
22
  * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string
25
- * @param props.twClassName - Optional Tailwind classes on the root BoxColumn
23
+ * @param props.twClassName - Optional Tailwind classes on the root Box
26
24
  *
27
25
  * @returns The rendered TitleAlert layout.
28
26
  */
29
27
  const TitleAlert = ({ severity, title, titleProps, titleWrapperProps, description, descriptionProps, twClassName = '', ...props }) => {
30
- return (<BoxColumn_1.BoxColumn alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} topAccessory={<IconAlert_1.IconAlert severity={severity} size={design_system_shared_1.IconSize.Xl}/>} bottomAccessory={description ? (<Box_1.Box twClassName="self-stretch">
31
- <TextOrChildren_1.TextOrChildren textProps={{
28
+ return (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Column} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} twClassName={twClassName} {...props}>
29
+ <IconAlert_1.IconAlert severity={severity} size={design_system_shared_1.IconSize.Xl}/>
30
+ {title ? (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} justifyContent={design_system_shared_1.BoxJustifyContent.Center} twClassName="self-stretch" {...titleWrapperProps}>
31
+ <TextOrChildren_1.TextOrChildren textProps={{
32
+ variant: design_system_shared_1.TextVariant.HeadingLg,
33
+ color: design_system_shared_1.TextColor.TextDefault,
34
+ ...titleProps,
35
+ }}>
36
+ {title}
37
+ </TextOrChildren_1.TextOrChildren>
38
+ </Box_1.Box>) : null}
39
+ {description ? (<Box_1.Box twClassName="self-stretch">
40
+ <TextOrChildren_1.TextOrChildren textProps={{
32
41
  variant: design_system_shared_1.TextVariant.BodySm,
33
42
  color: design_system_shared_1.TextColor.TextAlternative,
34
43
  fontWeight: design_system_shared_1.FontWeight.Medium,
35
44
  ...descriptionProps,
36
45
  style: [{ textAlign: 'center' }, descriptionProps?.style],
37
46
  }}>
38
- {description}
39
- </TextOrChildren_1.TextOrChildren>
40
- </Box_1.Box>) : undefined} twClassName={twClassName} {...props}>
41
- {title ? (<BoxRow_1.BoxRow justifyContent={design_system_shared_1.BoxJustifyContent.Center} twClassName="self-stretch" {...titleWrapperProps} textProps={{
42
- variant: design_system_shared_1.TextVariant.HeadingLg,
43
- color: design_system_shared_1.TextColor.TextDefault,
44
- ...titleProps,
45
- }}>
46
- {title}
47
- </BoxRow_1.BoxRow>) : null}
48
- </BoxColumn_1.BoxColumn>);
47
+ {description}
48
+ </TextOrChildren_1.TextOrChildren>
49
+ </Box_1.Box>) : null}
50
+ </Box_1.Box>);
49
51
  };
50
52
  exports.TitleAlert = TitleAlert;
51
53
  exports.TitleAlert.displayName = 'TitleAlert';
@@ -1 +1 @@
1
- {"version":3,"file":"TitleAlert.cjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAOiD;AACjD,kDAA0B;AAE1B,0CAA6B;AAC7B,sDAAyC;AACz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kCAAW,CAAC,SAAS;gBAC9B,KAAK,EAAE,gCAAS,CAAC,WAAW;gBAC5B,GAAG,UAAU;aACd,CAAC,CAEF;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,eAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,qBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AAnDW,QAAA,UAAU,cAmDrB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxJustifyContent,\n FontWeight,\n IconSize,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { IconAlert } from '../IconAlert';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { TitleAlertProps } from './TitleAlert.types';\n\n/**\n * Displays a severity-based {@link IconAlert} above a centered title row.\n * Remaining `View` props are forwarded to the root {@link BoxColumn}.\n *\n * @param props - Component props\n * @param props.severity - Passed to {@link IconAlert} for glyph and color\n * @param props.title - Title row content; row renders only when `title` is renderable\n * @param props.titleWrapperProps - Optional props spread onto the title row {@link BoxRow}\n * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string\n * @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}\n * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string\n * @param props.twClassName - Optional Tailwind classes on the root BoxColumn\n *\n * @returns The rendered TitleAlert layout.\n */\nexport const TitleAlert: React.FC<TitleAlertProps> = ({\n severity,\n title,\n titleProps,\n titleWrapperProps,\n description,\n descriptionProps,\n twClassName = '',\n ...props\n}) => {\n return (\n <BoxColumn\n alignItems={BoxAlignItems.Center}\n gap={1}\n topAccessory={<IconAlert severity={severity} size={IconSize.Xl} />}\n bottomAccessory={\n description ? (\n <Box twClassName=\"self-stretch\">\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n color: TextColor.TextAlternative,\n fontWeight: FontWeight.Medium,\n ...descriptionProps,\n style: [{ textAlign: 'center' }, descriptionProps?.style],\n }}\n >\n {description}\n </TextOrChildren>\n </Box>\n ) : undefined\n }\n twClassName={twClassName}\n {...props}\n >\n {title ? (\n <BoxRow\n justifyContent={BoxJustifyContent.Center}\n twClassName=\"self-stretch\"\n {...titleWrapperProps}\n textProps={{\n variant: TextVariant.HeadingLg,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null}\n </BoxColumn>\n );\n};\n\nTitleAlert.displayName = 'TitleAlert';\n"]}
1
+ {"version":3,"file":"TitleAlert.cjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAQiD;AACjD,kDAA0B;AAE1B,0CAA6B;AAC7B,sDAAyC;AACzC,gFAAmE;AAInE;;;;;;;;;;;;;;GAcG;AACI,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,CACL,CAAC,SAAG,CACF,aAAa,CAAC,CAAC,uCAAgB,CAAC,MAAM,CAAC,CACvC,UAAU,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,qBAAS,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,EACjD;MAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,SAAG,CACF,aAAa,CAAC,CAAC,uCAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,cAAc,CAAC,CAAC,wCAAiB,CAAC,MAAM,CAAC,CACzC,WAAW,CAAC,cAAc,CAC1B,IAAI,iBAAiB,CAAC,CAEtB;UAAA,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,kCAAW,CAAC,SAAS;gBAC9B,KAAK,EAAE,gCAAS,CAAC,WAAW;gBAC5B,GAAG,UAAU;aACd,CAAC,CAEF;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,+BAAc,CAClB;QAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACR;MAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,SAAG,CAAC,WAAW,CAAC,cAAc,CAC7B;UAAA,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,kCAAW,CAAC,MAAM;gBAC3B,KAAK,EAAE,gCAAS,CAAC,eAAe;gBAChC,UAAU,EAAE,iCAAU,CAAC,MAAM;gBAC7B,GAAG,gBAAgB;gBACnB,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,KAAK,CAAC;aAC1D,CAAC,CAEF;YAAA,CAAC,WAAW,CACd;UAAA,EAAE,+BAAc,CAClB;QAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAxDW,QAAA,UAAU,cAwDrB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n BoxJustifyContent,\n FontWeight,\n IconSize,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { IconAlert } from '../IconAlert';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { TitleAlertProps } from './TitleAlert.types';\n\n/**\n * Displays a severity-based {@link IconAlert} above a centered title row.\n * Remaining `View` props are forwarded to the root {@link Box}.\n *\n * @param props - Component props\n * @param props.severity - Passed to {@link IconAlert} for glyph and color\n * @param props.title - Title row content; row renders only when `title` is renderable\n * @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}\n * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string\n * @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}\n * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string\n * @param props.twClassName - Optional Tailwind classes on the root Box\n *\n * @returns The rendered TitleAlert layout.\n */\nexport const TitleAlert: React.FC<TitleAlertProps> = ({\n severity,\n title,\n titleProps,\n titleWrapperProps,\n description,\n descriptionProps,\n twClassName = '',\n ...props\n}) => {\n return (\n <Box\n flexDirection={BoxFlexDirection.Column}\n alignItems={BoxAlignItems.Center}\n gap={1}\n twClassName={twClassName}\n {...props}\n >\n <IconAlert severity={severity} size={IconSize.Xl} />\n {title ? (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n justifyContent={BoxJustifyContent.Center}\n twClassName=\"self-stretch\"\n {...titleWrapperProps}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.HeadingLg,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </TextOrChildren>\n </Box>\n ) : null}\n {description ? (\n <Box twClassName=\"self-stretch\">\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n color: TextColor.TextAlternative,\n fontWeight: FontWeight.Medium,\n ...descriptionProps,\n style: [{ textAlign: 'center' }, descriptionProps?.style],\n }}\n >\n {description}\n </TextOrChildren>\n </Box>\n ) : null}\n </Box>\n );\n};\n\nTitleAlert.displayName = 'TitleAlert';\n"]}
@@ -2,16 +2,16 @@ import React from "react";
2
2
  import type { TitleAlertProps } from "./TitleAlert.types.cjs";
3
3
  /**
4
4
  * Displays a severity-based {@link IconAlert} above a centered title row.
5
- * Remaining `View` props are forwarded to the root {@link BoxColumn}.
5
+ * Remaining `View` props are forwarded to the root {@link Box}.
6
6
  *
7
7
  * @param props - Component props
8
8
  * @param props.severity - Passed to {@link IconAlert} for glyph and color
9
9
  * @param props.title - Title row content; row renders only when `title` is renderable
10
- * @param props.titleWrapperProps - Optional props spread onto the title row {@link BoxRow}
10
+ * @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}
11
11
  * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
12
12
  * @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}
13
13
  * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string
14
- * @param props.twClassName - Optional Tailwind classes on the root BoxColumn
14
+ * @param props.twClassName - Optional Tailwind classes on the root Box
15
15
  *
16
16
  * @returns The rendered TitleAlert layout.
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TitleAlert.d.cts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAQ1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmDhD,CAAC"}
1
+ {"version":3,"file":"TitleAlert.d.cts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwDhD,CAAC"}
@@ -2,16 +2,16 @@ import React from "react";
2
2
  import type { TitleAlertProps } from "./TitleAlert.types.mjs";
3
3
  /**
4
4
  * Displays a severity-based {@link IconAlert} above a centered title row.
5
- * Remaining `View` props are forwarded to the root {@link BoxColumn}.
5
+ * Remaining `View` props are forwarded to the root {@link Box}.
6
6
  *
7
7
  * @param props - Component props
8
8
  * @param props.severity - Passed to {@link IconAlert} for glyph and color
9
9
  * @param props.title - Title row content; row renders only when `title` is renderable
10
- * @param props.titleWrapperProps - Optional props spread onto the title row {@link BoxRow}
10
+ * @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}
11
11
  * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
12
12
  * @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}
13
13
  * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string
14
- * @param props.twClassName - Optional Tailwind classes on the root BoxColumn
14
+ * @param props.twClassName - Optional Tailwind classes on the root Box
15
15
  *
16
16
  * @returns The rendered TitleAlert layout.
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TitleAlert.d.mts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAQ1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmDhD,CAAC"}
1
+ {"version":3,"file":"TitleAlert.d.mts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwDhD,CAAC"}