@metamask/design-system-react-native 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/dist/components/BannerBase/BannerBase.cjs +4 -3
  3. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  4. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  5. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  6. package/dist/components/BannerBase/BannerBase.mjs +4 -3
  7. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  8. package/dist/components/BoxRow/BoxRow.types.cjs.map +1 -1
  9. package/dist/components/BoxRow/BoxRow.types.d.cts +4 -3
  10. package/dist/components/BoxRow/BoxRow.types.d.cts.map +1 -1
  11. package/dist/components/BoxRow/BoxRow.types.d.mts +4 -3
  12. package/dist/components/BoxRow/BoxRow.types.d.mts.map +1 -1
  13. package/dist/components/BoxRow/BoxRow.types.mjs.map +1 -1
  14. package/dist/components/Content/Content.cjs +1 -1
  15. package/dist/components/Content/Content.cjs.map +1 -1
  16. package/dist/components/Content/Content.mjs +1 -1
  17. package/dist/components/Content/Content.mjs.map +1 -1
  18. package/dist/components/Content/Content.types.cjs.map +1 -1
  19. package/dist/components/Content/Content.types.d.cts +10 -6
  20. package/dist/components/Content/Content.types.d.cts.map +1 -1
  21. package/dist/components/Content/Content.types.d.mts +10 -6
  22. package/dist/components/Content/Content.types.d.mts.map +1 -1
  23. package/dist/components/Content/Content.types.mjs.map +1 -1
  24. package/dist/components/HelpText/HelpText.cjs +28 -0
  25. package/dist/components/HelpText/HelpText.cjs.map +1 -0
  26. package/dist/components/HelpText/HelpText.constants.cjs +11 -0
  27. package/dist/components/HelpText/HelpText.constants.cjs.map +1 -0
  28. package/dist/components/HelpText/HelpText.constants.d.cts +3 -0
  29. package/dist/components/HelpText/HelpText.constants.d.cts.map +1 -0
  30. package/dist/components/HelpText/HelpText.constants.d.mts +3 -0
  31. package/dist/components/HelpText/HelpText.constants.d.mts.map +1 -0
  32. package/dist/components/HelpText/HelpText.constants.mjs +8 -0
  33. package/dist/components/HelpText/HelpText.constants.mjs.map +1 -0
  34. package/dist/components/HelpText/HelpText.d.cts +4 -0
  35. package/dist/components/HelpText/HelpText.d.cts.map +1 -0
  36. package/dist/components/HelpText/HelpText.d.mts +4 -0
  37. package/dist/components/HelpText/HelpText.d.mts.map +1 -0
  38. package/dist/components/HelpText/HelpText.mjs +28 -0
  39. package/dist/components/HelpText/HelpText.mjs.map +1 -0
  40. package/dist/components/HelpText/HelpText.types.cjs +3 -0
  41. package/dist/components/HelpText/HelpText.types.cjs.map +1 -0
  42. package/dist/components/HelpText/HelpText.types.d.cts +4 -0
  43. package/dist/components/HelpText/HelpText.types.d.cts.map +1 -0
  44. package/dist/components/HelpText/HelpText.types.d.mts +4 -0
  45. package/dist/components/HelpText/HelpText.types.d.mts.map +1 -0
  46. package/dist/components/HelpText/HelpText.types.mjs +2 -0
  47. package/dist/components/HelpText/HelpText.types.mjs.map +1 -0
  48. package/dist/components/HelpText/index.cjs +8 -0
  49. package/dist/components/HelpText/index.cjs.map +1 -0
  50. package/dist/components/HelpText/index.d.cts +4 -0
  51. package/dist/components/HelpText/index.d.cts.map +1 -0
  52. package/dist/components/HelpText/index.d.mts +4 -0
  53. package/dist/components/HelpText/index.d.mts.map +1 -0
  54. package/dist/components/HelpText/index.mjs +3 -0
  55. package/dist/components/HelpText/index.mjs.map +1 -0
  56. package/dist/components/KeyValueRow/KeyValueRow.cjs +1 -1
  57. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
  58. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
  59. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
  60. package/dist/components/KeyValueRow/KeyValueRow.mjs +1 -1
  61. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
  62. package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -1
  63. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +6 -2
  64. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -1
  65. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +6 -2
  66. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -1
  67. package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -1
  68. package/dist/components/KeyValueSelect/KeyValueSelect.cjs +55 -0
  69. package/dist/components/KeyValueSelect/KeyValueSelect.cjs.map +1 -0
  70. package/dist/components/KeyValueSelect/KeyValueSelect.d.cts +11 -0
  71. package/dist/components/KeyValueSelect/KeyValueSelect.d.cts.map +1 -0
  72. package/dist/components/KeyValueSelect/KeyValueSelect.d.mts +11 -0
  73. package/dist/components/KeyValueSelect/KeyValueSelect.d.mts.map +1 -0
  74. package/dist/components/KeyValueSelect/KeyValueSelect.mjs +36 -0
  75. package/dist/components/KeyValueSelect/KeyValueSelect.mjs.map +1 -0
  76. package/dist/components/KeyValueSelect/KeyValueSelect.types.cjs +3 -0
  77. package/dist/components/KeyValueSelect/KeyValueSelect.types.cjs.map +1 -0
  78. package/dist/components/KeyValueSelect/KeyValueSelect.types.d.cts +47 -0
  79. package/dist/components/KeyValueSelect/KeyValueSelect.types.d.cts.map +1 -0
  80. package/dist/components/KeyValueSelect/KeyValueSelect.types.d.mts +47 -0
  81. package/dist/components/KeyValueSelect/KeyValueSelect.types.d.mts.map +1 -0
  82. package/dist/components/KeyValueSelect/KeyValueSelect.types.mjs +2 -0
  83. package/dist/components/KeyValueSelect/KeyValueSelect.types.mjs.map +1 -0
  84. package/dist/components/KeyValueSelect/index.cjs +8 -0
  85. package/dist/components/KeyValueSelect/index.cjs.map +1 -0
  86. package/dist/components/KeyValueSelect/index.d.cts +4 -0
  87. package/dist/components/KeyValueSelect/index.d.cts.map +1 -0
  88. package/dist/components/KeyValueSelect/index.d.mts +4 -0
  89. package/dist/components/KeyValueSelect/index.d.mts.map +1 -0
  90. package/dist/components/KeyValueSelect/index.mjs +3 -0
  91. package/dist/components/KeyValueSelect/index.mjs.map +1 -0
  92. package/dist/components/Slider/useSliderGesture.cjs +126 -10
  93. package/dist/components/Slider/useSliderGesture.cjs.map +1 -1
  94. package/dist/components/Slider/useSliderGesture.d.cts +11 -1
  95. package/dist/components/Slider/useSliderGesture.d.cts.map +1 -1
  96. package/dist/components/Slider/useSliderGesture.d.mts +11 -1
  97. package/dist/components/Slider/useSliderGesture.d.mts.map +1 -1
  98. package/dist/components/Slider/useSliderGesture.mjs +126 -10
  99. package/dist/components/Slider/useSliderGesture.mjs.map +1 -1
  100. package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -1
  101. package/dist/components/TitleHub/TitleHub.types.d.cts +5 -2
  102. package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
  103. package/dist/components/TitleHub/TitleHub.types.d.mts +5 -2
  104. package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
  105. package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -1
  106. package/dist/components/Toast/Toast.cjs +12 -3
  107. package/dist/components/Toast/Toast.cjs.map +1 -1
  108. package/dist/components/Toast/Toast.constants.cjs +10 -2
  109. package/dist/components/Toast/Toast.constants.cjs.map +1 -1
  110. package/dist/components/Toast/Toast.constants.d.cts +7 -1
  111. package/dist/components/Toast/Toast.constants.d.cts.map +1 -1
  112. package/dist/components/Toast/Toast.constants.d.mts +7 -1
  113. package/dist/components/Toast/Toast.constants.d.mts.map +1 -1
  114. package/dist/components/Toast/Toast.constants.mjs +9 -1
  115. package/dist/components/Toast/Toast.constants.mjs.map +1 -1
  116. package/dist/components/Toast/Toast.d.cts.map +1 -1
  117. package/dist/components/Toast/Toast.d.mts.map +1 -1
  118. package/dist/components/Toast/Toast.mjs +13 -4
  119. package/dist/components/Toast/Toast.mjs.map +1 -1
  120. package/dist/components/Toast/Toast.types.cjs.map +1 -1
  121. package/dist/components/Toast/Toast.types.d.cts +1 -1
  122. package/dist/components/Toast/Toast.types.d.cts.map +1 -1
  123. package/dist/components/Toast/Toast.types.d.mts +1 -1
  124. package/dist/components/Toast/Toast.types.d.mts.map +1 -1
  125. package/dist/components/Toast/Toast.types.mjs.map +1 -1
  126. package/dist/components/Toast/Toaster.cjs +18 -14
  127. package/dist/components/Toast/Toaster.cjs.map +1 -1
  128. package/dist/components/Toast/Toaster.d.cts.map +1 -1
  129. package/dist/components/Toast/Toaster.d.mts.map +1 -1
  130. package/dist/components/Toast/Toaster.mjs +20 -16
  131. package/dist/components/Toast/Toaster.mjs.map +1 -1
  132. package/dist/components/Toast/index.cjs +2 -2
  133. package/dist/components/Toast/index.cjs.map +1 -1
  134. package/dist/components/Toast/index.d.cts +1 -1
  135. package/dist/components/Toast/index.d.cts.map +1 -1
  136. package/dist/components/Toast/index.d.mts +1 -1
  137. package/dist/components/Toast/index.d.mts.map +1 -1
  138. package/dist/components/Toast/index.mjs +1 -1
  139. package/dist/components/Toast/index.mjs.map +1 -1
  140. package/dist/components/index.cjs +8 -2
  141. package/dist/components/index.cjs.map +1 -1
  142. package/dist/components/index.d.cts +4 -0
  143. package/dist/components/index.d.cts.map +1 -1
  144. package/dist/components/index.d.mts +4 -0
  145. package/dist/components/index.d.mts.map +1 -1
  146. package/dist/components/index.mjs +2 -0
  147. package/dist/components/index.mjs.map +1 -1
  148. package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs +2 -2
  149. package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs.map +1 -1
  150. package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs +2 -2
  151. package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs.map +1 -1
  152. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
  153. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +4 -3
  154. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts.map +1 -1
  155. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +4 -3
  156. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts.map +1 -1
  157. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
  158. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"useSliderGesture.mjs","sourceRoot":"","sources":["../../../src/components/Slider/useSliderGesture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc;AAChE,OAAO,EAAE,OAAO,EAAE,qCAAqC;AACvD,OAAO,EACL,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,UAAU,EACX,gCAAgC;AAEjC,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EACjB,+BAA2B;AAK5B,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACvB,+BAA2B;AAE5B;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAA8B;IAE9B,MAAM,EACJ,KAAK,EACL,YAAY,GAAG,CAAC,EAChB,YAAY,GAAG,GAAG,EAClB,IAAI,GAAG,CAAC,EACR,UAAU,GAAG,KAAK,EAClB,aAAa,EACb,SAAS,EACT,MAAM,EACN,MAAM,EACN,KAAK,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,GAAG,MAAM,CAAC;IAEX,MAAM,gBAAgB,GAAG,OAAO,CAC9B,GAAG,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC,EACpC,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,yBAAyB;IAEzB,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,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AAE;QACpB,IAAI,UAAU,EAAE;YACd,OAAO;SACR;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,EAAE;YACT,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;QAChE,aAAa,CAAC,QAAQ,CAAC,CAAC;QACxB,MAAM,YAAY,GAAG,wBAAwB,CAC3C,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,sBAAsB,CACvB,CAAC;QACF,sBAAsB,CAAC,YAAY,CAAC,CAAC;QACrC,SAAS,EAAE,CAAC,QAAQ,CAAC,CAAC;QACtB,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC,EACD;QACE,sBAAsB;QACtB,UAAU;QACV,sBAAsB;QACtB,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,aAAa;QACb,qBAAqB;QACrB,KAAK;KACN,CACF,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,aAAa;QACb,UAAU;QACV,OAAO;QACP,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { Gesture } from 'react-native-gesture-handler';\nimport {\n Easing,\n runOnJS,\n useAnimatedReaction,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport {\n THUMB_GRIP_ANIMATION_DURATION,\n THUMB_GRIP_SCALE,\n} from './Slider.constants';\nimport type {\n UseSliderGestureParams,\n UseSliderGestureResult,\n} from './Slider.types';\nimport {\n clampGesturePosition,\n getMarkHapticThresholds,\n getMarkValue,\n getTrackPercentFromValue,\n interpolateMarkColor,\n positionToTrackPercent,\n resolveTrackPercentToValue,\n resolveValueToTrackPercent,\n trackPercentToPosition,\n} from './Slider.utilities';\n\n/**\n * Owns Slider gesture handling, animated thumb/fill position, and range-label taps.\n *\n * Flow during drag (UI thread):\n * touch X → clamp to track width → trackPercent → domain value → callbacks\n *\n * Flow when `value` prop changes (JS thread → UI thread via useAnimatedReaction):\n * domain value → trackPercent → translateX (skipped while dragging)\n *\n * `mapValueToTrackPercent` / `mapTrackPercentToValue` must be worklets when provided.\n *\n * @param params - Gesture configuration and callbacks.\n * @returns Gesture state and handlers for Slider.\n */\nexport function useSliderGesture(\n params: UseSliderGestureParams,\n): UseSliderGestureResult {\n const {\n value,\n minimumValue = 0,\n maximumValue = 100,\n step = 1,\n isDisabled = false,\n onValueChange,\n onDragEnd,\n onGrip,\n onMark,\n marks,\n fillColorStops,\n thumbColorStops,\n hasThemedColors,\n mapValueToTrackPercent,\n mapTrackPercentToValue,\n } = params;\n\n const hapticThresholds = useMemo(\n () => getMarkHapticThresholds(marks),\n [marks],\n );\n\n // --- Animated state ---\n\n const sliderWidth = useSharedValue(0);\n const translateX = useSharedValue(0);\n const thumbScale = useSharedValue(1);\n const isDragging = useSharedValue(false);\n const propValue = useSharedValue(value);\n const previousTrackPercentRef = useRef(\n getTrackPercentFromValue(\n value,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n ),\n );\n const isDraggingRef = useRef(false);\n\n // --- Position sync (domain value → thumb pixels) ---\n\n const syncPositionFromValue = useCallback(\n (nextValue: number, width = sliderWidth.value) => {\n const trackPercent = getTrackPercentFromValue(\n nextValue,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n translateX.value = trackPercentToPosition(trackPercent, width);\n },\n [\n mapValueToTrackPercent,\n maximumValue,\n minimumValue,\n sliderWidth,\n translateX,\n ],\n );\n\n const handleLayout = useCallback(\n (event: { nativeEvent: { layout: { width: number } } }) => {\n const { width } = event.nativeEvent.layout;\n sliderWidth.value = width;\n syncPositionFromValue(value, width);\n },\n [sliderWidth, syncPositionFromValue, value],\n );\n\n useEffect(() => {\n propValue.value = value;\n if (!isDraggingRef.current) {\n previousTrackPercentRef.current = getTrackPercentFromValue(\n value,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n }\n }, [mapValueToTrackPercent, maximumValue, minimumValue, propValue, value]);\n\n useAnimatedReaction(\n () => propValue.value,\n (currentValue, previousValue) => {\n if (isDragging.value) {\n return;\n }\n\n if (previousValue !== null && currentValue === previousValue) {\n return;\n }\n\n const trackPercent = resolveValueToTrackPercent(\n currentValue,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n translateX.value = trackPercentToPosition(\n trackPercent,\n sliderWidth.value,\n );\n },\n [mapValueToTrackPercent, maximumValue, minimumValue],\n );\n\n // --- JS-thread bridges (stable refs for runOnJS from worklets) ---\n\n const emitValueChange = useCallback(\n (nextValue: number) => {\n onValueChange(nextValue);\n },\n [onValueChange],\n );\n\n const emitDragEnd = useCallback(\n (nextValue: number) => {\n onDragEnd?.(nextValue);\n },\n [onDragEnd],\n );\n\n const triggerGrip = useCallback(() => {\n if (!isDisabled) {\n onGrip?.();\n }\n }, [isDisabled, onGrip]);\n\n const setDragging = useCallback((dragging: boolean) => {\n isDraggingRef.current = dragging;\n }, []);\n\n const checkThresholdCrossing = useCallback(\n (newTrackPercent: number) => {\n const prevTrackPercent = previousTrackPercentRef.current;\n\n for (const threshold of hapticThresholds) {\n if (\n (prevTrackPercent < threshold && newTrackPercent >= threshold) ||\n (prevTrackPercent > threshold && newTrackPercent <= threshold)\n ) {\n onMark?.();\n break;\n }\n }\n\n previousTrackPercentRef.current = newTrackPercent;\n },\n [hapticThresholds, onMark],\n );\n\n // --- Animated styles (thumb + fill width follow translateX) ---\n\n const activeFillColor = useDerivedValue(() => {\n if (!hasThemedColors) {\n return undefined;\n }\n\n return interpolateMarkColor(\n positionToTrackPercent(translateX.value, sliderWidth.value),\n fillColorStops,\n );\n });\n\n const activeThumbColor = useDerivedValue(() => {\n if (!hasThemedColors) {\n return undefined;\n }\n\n return interpolateMarkColor(\n positionToTrackPercent(translateX.value, sliderWidth.value),\n thumbColorStops,\n );\n });\n\n const progressStyle = useAnimatedStyle(\n () => ({\n width: translateX.value,\n ...(hasThemedColors && {\n backgroundColor: activeFillColor.value,\n }),\n }),\n [fillColorStops, hasThemedColors],\n );\n\n const thumbStyle = useAnimatedStyle(\n () => ({\n transform: [\n { translateX: translateX.value },\n { scale: thumbScale.value },\n ],\n ...(hasThemedColors && {\n backgroundColor: activeThumbColor.value,\n }),\n }),\n [hasThemedColors, thumbColorStops],\n );\n\n // --- Pan + tap gestures ---\n\n const gesture = useMemo(() => {\n // Gesture callbacks need explicit 'worklet' directives because this package\n // ships pre-built dist compiled by ts-bridge. The consumer's Reanimated Babel\n // plugin does not auto-detect the compiled namespaced Gesture form.\n\n const gripEasing = Easing.bezier(0.3, 0.8, 0.3, 1);\n\n const positionToDomainValue = (position: number) => {\n 'worklet';\n\n const trackPercent = positionToTrackPercent(position, sliderWidth.value);\n const domainValue = resolveTrackPercentToValue(\n trackPercent,\n minimumValue,\n maximumValue,\n step,\n mapTrackPercentToValue,\n );\n\n return { trackPercent, domainValue };\n };\n\n const snapThumbToValue = (domainValue: number) => {\n 'worklet';\n\n const snappedTrackPercent = resolveValueToTrackPercent(\n domainValue,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n translateX.value = trackPercentToPosition(\n snappedTrackPercent,\n sliderWidth.value,\n );\n };\n\n // Finalize a gesture: emit callbacks, then re-sync thumb to stepped value.\n const commitAtPosition = (\n position: number,\n options: { checkThreshold: boolean; triggerGrip: boolean },\n ) => {\n 'worklet';\n\n translateX.value = position;\n const { trackPercent, domainValue } = positionToDomainValue(position);\n\n runOnJS(emitValueChange)(domainValue);\n if (options.checkThreshold) {\n runOnJS(checkThresholdCrossing)(trackPercent);\n }\n runOnJS(emitDragEnd)(domainValue);\n if (options.triggerGrip) {\n runOnJS(triggerGrip)();\n }\n snapThumbToValue(domainValue);\n };\n\n const panGesture = Gesture.Pan()\n .enabled(!isDisabled)\n .onStart(() => {\n 'worklet';\n\n isDragging.value = true;\n thumbScale.value = withTiming(THUMB_GRIP_SCALE, {\n duration: THUMB_GRIP_ANIMATION_DURATION,\n easing: gripEasing,\n });\n runOnJS(setDragging)(true);\n runOnJS(triggerGrip)();\n })\n .onUpdate((event) => {\n 'worklet';\n\n const position = clampGesturePosition(event.x, sliderWidth.value);\n translateX.value = position;\n const { trackPercent, domainValue } = positionToDomainValue(position);\n\n runOnJS(emitValueChange)(domainValue);\n runOnJS(checkThresholdCrossing)(trackPercent);\n })\n .onEnd(() => {\n 'worklet';\n\n // Thresholds already checked during onUpdate; grip fires again on release.\n commitAtPosition(translateX.value, {\n checkThreshold: false,\n triggerGrip: true,\n });\n })\n .onFinalize(() => {\n 'worklet';\n\n isDragging.value = false;\n thumbScale.value = withTiming(1, {\n duration: THUMB_GRIP_ANIMATION_DURATION,\n easing: gripEasing,\n });\n runOnJS(setDragging)(false);\n });\n\n const tapGesture = Gesture.Tap()\n .enabled(!isDisabled)\n .onEnd((event) => {\n 'worklet';\n\n const position = clampGesturePosition(event.x, sliderWidth.value);\n commitAtPosition(position, {\n checkThreshold: true,\n triggerGrip: false,\n });\n });\n\n return Gesture.Simultaneous(tapGesture, panGesture);\n }, [\n checkThresholdCrossing,\n emitDragEnd,\n emitValueChange,\n isDisabled,\n isDragging,\n mapTrackPercentToValue,\n mapValueToTrackPercent,\n maximumValue,\n minimumValue,\n setDragging,\n sliderWidth,\n step,\n thumbScale,\n translateX,\n triggerGrip,\n ]);\n\n // --- Range label tap (JS thread) ---\n\n const handlePressStep = useCallback(\n (rangeStep: number) => {\n if (isDisabled) {\n return;\n }\n\n const mark = marks.find((entry) => entry.step === rangeStep);\n if (!mark) {\n return;\n }\n\n const newValue = getMarkValue(mark, minimumValue, maximumValue);\n onValueChange(newValue);\n const trackPercent = getTrackPercentFromValue(\n newValue,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n checkThresholdCrossing(trackPercent);\n onDragEnd?.(newValue);\n syncPositionFromValue(newValue);\n },\n [\n checkThresholdCrossing,\n isDisabled,\n mapValueToTrackPercent,\n maximumValue,\n minimumValue,\n onDragEnd,\n onValueChange,\n syncPositionFromValue,\n marks,\n ],\n );\n\n return {\n handleLayout,\n progressStyle,\n thumbStyle,\n gesture,\n handlePressStep,\n };\n}\n"]}
1
+ {"version":3,"file":"useSliderGesture.mjs","sourceRoot":"","sources":["../../../src/components/Slider/useSliderGesture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc;AAChE,OAAO,EAAE,OAAO,EAAE,qCAAqC;AACvD,OAAO,EACL,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,UAAU,EACX,gCAAgC;AAEjC,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EACjB,+BAA2B;AAK5B,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACvB,+BAA2B;AAE5B;;;;;GAKG;AACH,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAcxC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAA8B;IAE9B,MAAM,EACJ,KAAK,EACL,YAAY,GAAG,CAAC,EAChB,YAAY,GAAG,GAAG,EAClB,IAAI,GAAG,CAAC,EACR,UAAU,GAAG,KAAK,EAClB,aAAa,EACb,SAAS,EACT,MAAM,EACN,MAAM,EACN,KAAK,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,GAAG,MAAM,CAAC;IAEX,MAAM,gBAAgB,GAAG,OAAO,CAC9B,GAAG,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC,EACpC,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,yBAA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qB,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC,EACD;QACE,sBAAsB;QACtB,eAAe;QACf,UAAU;QACV,sBAAsB;QACtB,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,qBAAqB;QACrB,KAAK;KACN,CACF,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,aAAa;QACb,UAAU;QACV,OAAO;QACP,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { Gesture } from 'react-native-gesture-handler';\nimport {\n Easing,\n runOnJS,\n useAnimatedReaction,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport {\n THUMB_GRIP_ANIMATION_DURATION,\n THUMB_GRIP_SCALE,\n} from './Slider.constants';\nimport type {\n UseSliderGestureParams,\n UseSliderGestureResult,\n} from './Slider.types';\nimport {\n clampGesturePosition,\n getMarkHapticThresholds,\n getMarkValue,\n getTrackPercentFromValue,\n interpolateMarkColor,\n positionToTrackPercent,\n resolveTrackPercentToValue,\n resolveValueToTrackPercent,\n trackPercentToPosition,\n} from './Slider.utilities';\n\n/**\n * Cap on remembered local updates used to spot late `value` echoes.\n * Pan `onUpdate` records every intermediate position, so a fast drag can\n * produce many entries; 256 is large enough for a long scrub without\n * growing unbounded.\n */\nconst RECENT_COMMIT_HISTORY_LIMIT = 256;\n\ntype CommitEntry = {\n value: number;\n generation: number;\n};\n\ntype PropReconciliation = {\n /** Write `value` into `propValue` for the UI-thread reaction. */\n syncPropValue: boolean;\n /** Update haptic baseline from the prop (external updates only). */\n syncBaseline: boolean;\n};\n\n/**\n * Owns Slider gesture handling, animated thumb/fill position, and range-label taps.\n *\n * Flow during drag (UI thread):\n * touch X → clamp to track width → trackPercent → domain value → callbacks\n *\n * Flow when `value` prop changes (JS thread → UI thread via useAnimatedReaction):\n * domain value → trackPercent → translateX (skipped while dragging).\n *\n * Stale controlled self-echoes (gesture → onValueChange → parent state → value\n * prop) are suppressed with a monotonically increasing commit generation — the\n * same sequence principle as React Native TextInput's `mostRecentEventCount`,\n * kept local so the public API stays a plain `value` number. Direct commits\n * record `{ value, generation }`; incoming props that match a recent emit are\n * acknowledged and must not rewind thumb position or the haptic baseline\n * (including late echoes that arrive after a newer commit was already acked).\n * Props that do not match any recent emit are treated as external updates and\n * applied immediately.\n *\n * `mapValueToTrackPercent` / `mapTrackPercentToValue` must be worklets when provided.\n *\n * @param params - Gesture configuration and callbacks.\n * @returns Gesture state and handlers for Slider.\n */\nexport function useSliderGesture(\n params: UseSliderGestureParams,\n): UseSliderGestureResult {\n const {\n value,\n minimumValue = 0,\n maximumValue = 100,\n step = 1,\n isDisabled = false,\n onValueChange,\n onDragEnd,\n onGrip,\n onMark,\n marks,\n fillColorStops,\n thumbColorStops,\n hasThemedColors,\n mapValueToTrackPercent,\n mapTrackPercentToValue,\n } = params;\n\n const hapticThresholds = useMemo(\n () => getMarkHapticThresholds(marks),\n [marks],\n );\n\n // --- Animated state ---\n\n const sliderWidth = useSharedValue(0);\n const translateX = useSharedValue(0);\n const thumbScale = useSharedValue(1);\n const isDragging = useSharedValue(false);\n const propValue = useSharedValue(value);\n // True while commitGeneration > ackedGeneration — UI thread skips prop→thumb.\n const hasInflightCommits = useSharedValue(false);\n const previousTrackPercentRef = useRef(\n getTrackPercentFromValue(\n value,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n ),\n );\n const isDraggingRef = useRef(false);\n const commitGenerationRef = useRef(0);\n const ackedGenerationRef = useRef(0);\n const lastEmittedValueRef = useRef<number | null>(null);\n const lastEmittedGenerationRef = useRef(0);\n const recentCommitsRef = useRef<CommitEntry[]>([]);\n\n // --- Commit generation tracking (sequence ack, not a time heuristic) ---\n\n const recordDirectCommit = useCallback(\n (domainValue: number) => {\n commitGenerationRef.current += 1;\n const generation = commitGenerationRef.current;\n lastEmittedValueRef.current = domainValue;\n lastEmittedGenerationRef.current = generation;\n recentCommitsRef.current.push({ value: domainValue, generation });\n if (recentCommitsRef.current.length > RECENT_COMMIT_HISTORY_LIMIT) {\n recentCommitsRef.current.shift();\n }\n hasInflightCommits.value = true;\n },\n [hasInflightCommits],\n );\n\n /**\n * Reconciles an incoming controlled `value` against recent local commits.\n *\n * @param incoming - Next `value` prop.\n * @returns Whether to sync `propValue` / haptic baseline from the prop.\n */\n const reconcilePropValue = useCallback(\n (incoming: number): PropReconciliation => {\n const recent = recentCommitsRef.current;\n let match: CommitEntry | undefined;\n for (let index = recent.length - 1; index >= 0; index -= 1) {\n if (recent[index].value === incoming) {\n match = recent[index];\n break;\n }\n }\n\n if (match) {\n // Late echo of an already-acked commit — do not write propValue or the\n // reaction will snap the thumb backward after a fast pan.\n if (match.generation <= ackedGenerationRef.current) {\n return { syncPropValue: false, syncBaseline: false };\n }\n\n // If the value we get back is the latest one we sent up through\n // onValueChange, we treat the parent as fully caught up and stop\n // waiting on any older updates still in flight (those often get\n // batched away during a fast pan anyway). If it's an older value\n // instead, we only count that one as handled and keep waiting for\n // the newer ones.\n if (incoming === lastEmittedValueRef.current) {\n ackedGenerationRef.current = lastEmittedGenerationRef.current;\n } else {\n ackedGenerationRef.current = match.generation;\n }\n\n hasInflightCommits.value =\n ackedGenerationRef.current < commitGenerationRef.current;\n\n // Sync propValue only when catching up to the latest emit (correct\n // position). Intermediate echoes must not overwrite propValue.\n const isLatestAck =\n ackedGenerationRef.current === lastEmittedGenerationRef.current;\n return { syncPropValue: isLatestAck, syncBaseline: false };\n }\n\n // Not a recent local emit — external update or parent transform.\n ackedGenerationRef.current = commitGenerationRef.current;\n lastEmittedValueRef.current = null;\n hasInflightCommits.value = false;\n return { syncPropValue: true, syncBaseline: true };\n },\n [hasInflightCommits],\n );\n\n // --- Position sync (domain value → thumb pixels) ---\n\n const syncPositionFromValue = useCallback(\n (nextValue: number, width = sliderWidth.value) => {\n const trackPercent = getTrackPercentFromValue(\n nextValue,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n translateX.value = trackPercentToPosition(trackPercent, width);\n },\n [\n mapValueToTrackPercent,\n maximumValue,\n minimumValue,\n sliderWidth,\n translateX,\n ],\n );\n\n const handleLayout = useCallback(\n (event: { nativeEvent: { layout: { width: number } } }) => {\n const { width } = event.nativeEvent.layout;\n const previousWidth = sliderWidth.value;\n sliderWidth.value = width;\n\n // After the first layout, never re-apply the raw `value` prop. A layout\n // pass can land while props still hold a lagged stale controlled echo\n // that useEffect intentionally kept out of `propValue`; syncing from\n // that echo would snap the thumb backward. Remap the current thumb\n // across the (possibly new) width instead.\n if (previousWidth > 0) {\n translateX.value = trackPercentToPosition(\n positionToTrackPercent(translateX.value, previousWidth),\n width,\n );\n return;\n }\n\n // First layout: `propValue` is initialized from `value` and only updated\n // when reconcilePropValue allows it.\n syncPositionFromValue(propValue.value, width);\n },\n [propValue, sliderWidth, syncPositionFromValue, translateX],\n );\n\n useEffect(() => {\n const { syncPropValue, syncBaseline } = reconcilePropValue(value);\n\n // Never push stale echoes into propValue — the animated reaction would\n // otherwise move the thumb even when syncBaseline is false.\n if (syncPropValue) {\n propValue.value = value;\n }\n\n if (isDraggingRef.current || !syncBaseline) {\n return;\n }\n\n previousTrackPercentRef.current = getTrackPercentFromValue(\n value,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n }, [\n mapValueToTrackPercent,\n maximumValue,\n minimumValue,\n propValue,\n reconcilePropValue,\n value,\n ]);\n\n useAnimatedReaction(\n () => propValue.value,\n (currentValue, previousValue) => {\n if (isDragging.value) {\n return;\n }\n\n if (previousValue !== null && currentValue === previousValue) {\n return;\n }\n\n // Skip while newer local commits are unacked. Stale echoes are kept out\n // of propValue on the JS thread; this is a second guard for races.\n if (hasInflightCommits.value) {\n return;\n }\n\n const trackPercent = resolveValueToTrackPercent(\n currentValue,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n translateX.value = trackPercentToPosition(\n trackPercent,\n sliderWidth.value,\n );\n },\n [mapValueToTrackPercent, maximumValue, minimumValue],\n );\n\n // --- JS-thread bridges (stable refs for runOnJS from worklets) ---\n\n // Called from pan onUpdate as well as tap/end — each move is recorded on\n // purpose so a lagged older `value` after a fast drag can still be ignored\n // (see RECENT_COMMIT_HISTORY_LIMIT).\n const emitValueChange = useCallback(\n (nextValue: number) => {\n recordDirectCommit(nextValue);\n onValueChange(nextValue);\n },\n [onValueChange, recordDirectCommit],\n );\n\n const emitDragEnd = useCallback(\n (nextValue: number) => {\n onDragEnd?.(nextValue);\n },\n [onDragEnd],\n );\n\n const triggerGrip = useCallback(() => {\n if (!isDisabled) {\n onGrip?.();\n }\n }, [isDisabled, onGrip]);\n\n const setDragging = useCallback((dragging: boolean) => {\n isDraggingRef.current = dragging;\n }, []);\n\n const checkThresholdCrossing = useCallback(\n (newTrackPercent: number) => {\n const prevTrackPercent = previousTrackPercentRef.current;\n\n for (const threshold of hapticThresholds) {\n if (\n (prevTrackPercent < threshold && newTrackPercent >= threshold) ||\n (prevTrackPercent > threshold && newTrackPercent <= threshold)\n ) {\n onMark?.();\n break;\n }\n }\n\n previousTrackPercentRef.current = newTrackPercent;\n },\n [hapticThresholds, onMark],\n );\n\n // --- Animated styles (thumb + fill width follow translateX) ---\n\n const activeFillColor = useDerivedValue(() => {\n if (!hasThemedColors) {\n return undefined;\n }\n\n return interpolateMarkColor(\n positionToTrackPercent(translateX.value, sliderWidth.value),\n fillColorStops,\n );\n });\n\n const activeThumbColor = useDerivedValue(() => {\n if (!hasThemedColors) {\n return undefined;\n }\n\n return interpolateMarkColor(\n positionToTrackPercent(translateX.value, sliderWidth.value),\n thumbColorStops,\n );\n });\n\n const progressStyle = useAnimatedStyle(\n () => ({\n width: translateX.value,\n ...(hasThemedColors && {\n backgroundColor: activeFillColor.value,\n }),\n }),\n [fillColorStops, hasThemedColors],\n );\n\n const thumbStyle = useAnimatedStyle(\n () => ({\n transform: [\n { translateX: translateX.value },\n { scale: thumbScale.value },\n ],\n ...(hasThemedColors && {\n backgroundColor: activeThumbColor.value,\n }),\n }),\n [hasThemedColors, thumbColorStops],\n );\n\n // --- Pan + tap gestures ---\n\n const gesture = useMemo(() => {\n // Gesture callbacks need explicit 'worklet' directives because this package\n // ships pre-built dist compiled by ts-bridge. The consumer's Reanimated Babel\n // plugin does not auto-detect the compiled namespaced Gesture form.\n\n const gripEasing = Easing.bezier(0.3, 0.8, 0.3, 1);\n\n const positionToDomainValue = (position: number) => {\n 'worklet';\n\n const trackPercent = positionToTrackPercent(position, sliderWidth.value);\n const domainValue = resolveTrackPercentToValue(\n trackPercent,\n minimumValue,\n maximumValue,\n step,\n mapTrackPercentToValue,\n );\n\n return { trackPercent, domainValue };\n };\n\n const snapThumbToValue = (domainValue: number) => {\n 'worklet';\n\n const snappedTrackPercent = resolveValueToTrackPercent(\n domainValue,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n translateX.value = trackPercentToPosition(\n snappedTrackPercent,\n sliderWidth.value,\n );\n };\n\n // Finalize a gesture: emit callbacks, then re-sync thumb to stepped value.\n const commitAtPosition = (\n position: number,\n options: { checkThreshold: boolean; triggerGrip: boolean },\n ) => {\n 'worklet';\n\n translateX.value = position;\n const { trackPercent, domainValue } = positionToDomainValue(position);\n\n runOnJS(emitValueChange)(domainValue);\n if (options.checkThreshold) {\n runOnJS(checkThresholdCrossing)(trackPercent);\n }\n runOnJS(emitDragEnd)(domainValue);\n if (options.triggerGrip) {\n runOnJS(triggerGrip)();\n }\n snapThumbToValue(domainValue);\n };\n\n const panGesture = Gesture.Pan()\n .enabled(!isDisabled)\n .onStart(() => {\n 'worklet';\n\n isDragging.value = true;\n thumbScale.value = withTiming(THUMB_GRIP_SCALE, {\n duration: THUMB_GRIP_ANIMATION_DURATION,\n easing: gripEasing,\n });\n runOnJS(setDragging)(true);\n runOnJS(triggerGrip)();\n })\n .onUpdate((event) => {\n 'worklet';\n\n const position = clampGesturePosition(event.x, sliderWidth.value);\n translateX.value = position;\n const { trackPercent, domainValue } = positionToDomainValue(position);\n\n runOnJS(emitValueChange)(domainValue);\n runOnJS(checkThresholdCrossing)(trackPercent);\n })\n .onEnd(() => {\n 'worklet';\n\n // Thresholds already checked during onUpdate; grip fires again on release.\n commitAtPosition(translateX.value, {\n checkThreshold: false,\n triggerGrip: true,\n });\n })\n .onFinalize(() => {\n 'worklet';\n\n isDragging.value = false;\n thumbScale.value = withTiming(1, {\n duration: THUMB_GRIP_ANIMATION_DURATION,\n easing: gripEasing,\n });\n runOnJS(setDragging)(false);\n });\n\n const tapGesture = Gesture.Tap()\n .enabled(!isDisabled)\n .onEnd((event) => {\n 'worklet';\n\n const position = clampGesturePosition(event.x, sliderWidth.value);\n commitAtPosition(position, {\n checkThreshold: true,\n triggerGrip: false,\n });\n });\n\n return Gesture.Simultaneous(tapGesture, panGesture);\n }, [\n checkThresholdCrossing,\n emitDragEnd,\n emitValueChange,\n isDisabled,\n isDragging,\n mapTrackPercentToValue,\n mapValueToTrackPercent,\n maximumValue,\n minimumValue,\n setDragging,\n sliderWidth,\n step,\n thumbScale,\n translateX,\n triggerGrip,\n ]);\n\n // --- Range label tap (JS thread) ---\n\n const handlePressStep = useCallback(\n (rangeStep: number) => {\n if (isDisabled) {\n return;\n }\n\n const mark = marks.find((entry) => entry.step === rangeStep);\n if (!mark) {\n return;\n }\n\n const newValue = getMarkValue(mark, minimumValue, maximumValue);\n emitValueChange(newValue);\n const trackPercent = getTrackPercentFromValue(\n newValue,\n minimumValue,\n maximumValue,\n mapValueToTrackPercent,\n );\n checkThresholdCrossing(trackPercent);\n onDragEnd?.(newValue);\n syncPositionFromValue(newValue);\n },\n [\n checkThresholdCrossing,\n emitValueChange,\n isDisabled,\n mapValueToTrackPercent,\n maximumValue,\n minimumValue,\n onDragEnd,\n syncPositionFromValue,\n marks,\n ],\n );\n\n return {\n handleLayout,\n progressStyle,\n thumbStyle,\n gesture,\n handlePressStep,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TitleHub.types.cjs","sourceRoot":"","sources":["../../../src/components/TitleHub/TitleHub.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleHubPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleHub component props (React Native).\n * Extends {@link TitleHubPropsShared} (requires `title`) with platform `Text` passthroughs, `twClassName`, and `View` props.\n */\nexport type TitleHubProps = TitleHubPropsShared & {\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` (TitleHub sets those via `title`, `titleEndAccessory`, and `titleProps`).\n */\n titleWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.\n */\n amountProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props spread onto the amount row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `amount`, `amountEndAccessory`, and `amountProps`).\n */\n amountWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.\n */\n bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props spread onto the bottom label row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `bottomLabel`, `bottomLabelEndAccessory`, and `bottomLabelProps`).\n */\n bottomLabelWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
1
+ {"version":3,"file":"TitleHub.types.cjs","sourceRoot":"","sources":["../../../src/components/TitleHub/TitleHub.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleHubPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { SensitiveTextProps } from '../SensitiveText';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleHub component props (React Native).\n * Extends {@link TitleHubPropsShared} (requires `title`) with platform `Text` passthroughs, `twClassName`, and `View` props.\n */\nexport type TitleHubProps = TitleHubPropsShared & {\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` (TitleHub sets those via `title`, `titleEndAccessory`, and `titleProps`).\n */\n titleWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.\n * Supports Text props plus `isHidden` / `length`.\n */\n amountProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n /**\n * Optional props spread onto the amount row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `amount`, `amountEndAccessory`, and `amountProps`).\n */\n amountWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.\n * Supports Text props plus `isHidden` / `length`.\n */\n bottomLabelProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n /**\n * Optional props spread onto the bottom label row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `bottomLabel`, `bottomLabelEndAccessory`, and `bottomLabelProps`).\n */\n bottomLabelWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
@@ -1,6 +1,7 @@
1
1
  import type { TitleHubPropsShared } from "@metamask/design-system-shared";
2
2
  import type { ViewProps } from "react-native";
3
3
  import type { BoxRowProps } from "../BoxRow/BoxRow.types.cjs";
4
+ import type { SensitiveTextProps } from "../SensitiveText/index.cjs";
4
5
  import type { TextProps } from "../Text/Text.types.cjs";
5
6
  /**
6
7
  * TitleHub component props (React Native).
@@ -17,16 +18,18 @@ export type TitleHubProps = TitleHubPropsShared & {
17
18
  titleWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
18
19
  /**
19
20
  * Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.
21
+ * Supports Text props plus `isHidden` / `length`.
20
22
  */
21
- amountProps?: Omit<Partial<TextProps>, 'children'>;
23
+ amountProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
22
24
  /**
23
25
  * Optional props spread onto the amount row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `amount`, `amountEndAccessory`, and `amountProps`).
24
26
  */
25
27
  amountWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
26
28
  /**
27
29
  * Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.
30
+ * Supports Text props plus `isHidden` / `length`.
28
31
  */
29
- bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;
32
+ bottomLabelProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
30
33
  /**
31
34
  * Optional props spread onto the bottom label row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `bottomLabel`, `bottomLabelEndAccessory`, and `bottomLabelProps`).
32
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TitleHub.types.d.cts","sourceRoot":"","sources":["../../../src/components/TitleHub/TitleHub.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,uCAAuC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CAAyB;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;IAChD;;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;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5D;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,CACvB,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,cAAc,GAAG,WAAW,CAC1C,CAAC;IACF;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IACjE;;OAEG;IACH,uBAAuB,CAAC,EAAE,IAAI,CAC5B,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,cAAc,GAAG,WAAW,CAC1C,CAAC;IACF;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import type { TitleHubPropsShared } from "@metamask/design-system-shared";
2
2
  import type { ViewProps } from "react-native";
3
3
  import type { BoxRowProps } from "../BoxRow/BoxRow.types.mjs";
4
+ import type { SensitiveTextProps } from "../SensitiveText/index.mjs";
4
5
  import type { TextProps } from "../Text/Text.types.mjs";
5
6
  /**
6
7
  * TitleHub component props (React Native).
@@ -17,16 +18,18 @@ export type TitleHubProps = TitleHubPropsShared & {
17
18
  titleWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
18
19
  /**
19
20
  * Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.
21
+ * Supports Text props plus `isHidden` / `length`.
20
22
  */
21
- amountProps?: Omit<Partial<TextProps>, 'children'>;
23
+ amountProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
22
24
  /**
23
25
  * Optional props spread onto the amount row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `amount`, `amountEndAccessory`, and `amountProps`).
24
26
  */
25
27
  amountWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
26
28
  /**
27
29
  * Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.
30
+ * Supports Text props plus `isHidden` / `length`.
28
31
  */
29
- bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;
32
+ bottomLabelProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
30
33
  /**
31
34
  * Optional props spread onto the bottom label row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `bottomLabel`, `bottomLabelEndAccessory`, and `bottomLabelProps`).
32
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TitleHub.types.d.mts","sourceRoot":"","sources":["../../../src/components/TitleHub/TitleHub.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,uCAAuC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAG9C,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;IAChD;;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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kB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5D;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,CACvB,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,cAAc,GAAG,WAAW,CAC1C,CAAC;IACF;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IACjE;;OAEG;IACH,uBAAuB,CAAC,EAAE,IAAI,CAC5B,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,cAAc,GAAG,WAAW,CAC1C,CAAC;IACF;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TitleHub.types.mjs","sourceRoot":"","sources":["../../../src/components/TitleHub/TitleHub.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleHubPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleHub component props (React Native).\n * Extends {@link TitleHubPropsShared} (requires `title`) with platform `Text` passthroughs, `twClassName`, and `View` props.\n */\nexport type TitleHubProps = TitleHubPropsShared & {\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` (TitleHub sets those via `title`, `titleEndAccessory`, and `titleProps`).\n */\n titleWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.\n */\n amountProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props spread onto the amount row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `amount`, `amountEndAccessory`, and `amountProps`).\n */\n amountWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.\n */\n bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props spread onto the bottom label row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `bottomLabel`, `bottomLabelEndAccessory`, and `bottomLabelProps`).\n */\n bottomLabelWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
1
+ {"version":3,"file":"TitleHub.types.mjs","sourceRoot":"","sources":["../../../src/components/TitleHub/TitleHub.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleHubPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { SensitiveTextProps } from '../SensitiveText';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleHub component props (React Native).\n * Extends {@link TitleHubPropsShared} (requires `title`) with platform `Text` passthroughs, `twClassName`, and `View` props.\n */\nexport type TitleHubProps = TitleHubPropsShared & {\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` (TitleHub sets those via `title`, `titleEndAccessory`, and `titleProps`).\n */\n titleWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.\n * Supports Text props plus `isHidden` / `length`.\n */\n amountProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n /**\n * Optional props spread onto the amount row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `amount`, `amountEndAccessory`, and `amountProps`).\n */\n amountWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.\n * Supports Text props plus `isHidden` / `length`.\n */\n bottomLabelProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n /**\n * Optional props spread onto the bottom label row {@link BoxRow}. Omits `children`, `endAccessory`, and `textProps` (TitleHub sets those via `bottomLabel`, `bottomLabelEndAccessory`, and `bottomLabelProps`).\n */\n bottomLabelWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Toast = void 0;
7
7
  // Third party dependencies.
8
8
  const design_system_shared_1 = require("@metamask/design-system-shared");
9
+ const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
10
+ const design_tokens_1 = require("@metamask/design-tokens");
9
11
  const react_1 = __importDefault(require("react"));
10
12
  // External dependencies.
11
13
  const BannerBase_1 = require("../BannerBase/index.cjs");
@@ -23,7 +25,9 @@ const renderSeverityAccessory = ({ iconAlertProps, severity, startAccessory, })
23
25
  const iconAlertSeverity = Toast_constants_1.TOAST_SEVERITY_ICON_MAP[severity];
24
26
  return (<IconAlert_1.IconAlert severity={iconAlertSeverity} size={design_system_shared_1.IconSize.Lg} {...iconAlertProps}/>);
25
27
  };
26
- const Toast = ({ actionButtonLabel, actionButtonOnPress, actionButtonProps, children, childrenWrapperProps, closeButtonProps, description, descriptionProps, onClose, iconAlertProps, severity = Toast_types_1.ToastSeverity.Default, startAccessory, title, titleProps, twClassName, ...props }) => {
28
+ const Toast = ({ actionButtonLabel, actionButtonOnPress, actionButtonProps, children, childrenWrapperProps, closeButtonProps, description, descriptionProps, onClose, iconAlertProps, severity = Toast_types_1.ToastSeverity.Default, startAccessory, style, title, titleProps, twClassName, ...props }) => {
29
+ const theme = (0, design_system_twrnc_preset_1.useTheme)();
30
+ const isLightTheme = theme === design_system_twrnc_preset_1.Theme.Light;
27
31
  const actionProps = actionButtonLabel && actionButtonOnPress
28
32
  ? {
29
33
  actionButtonLabel,
@@ -42,11 +46,16 @@ const Toast = ({ actionButtonLabel, actionButtonOnPress, actionButtonProps, chil
42
46
  ...closeButtonProps,
43
47
  }
44
48
  : undefined;
45
- return (<BannerBase_1.BannerBase {...actionProps} {...props} backgroundColor={design_system_shared_1.BoxBackgroundColor.BackgroundSection} borderColor={design_system_shared_1.BoxBorderColor.BorderMuted} borderWidth={1} children={children} childrenWrapperProps={childrenWrapperProps} closeButtonProps={resolvedCloseButtonProps} description={description} descriptionProps={descriptionProps} onClose={onClose} startAccessory={renderSeverityAccessory({
49
+ return (<BannerBase_1.BannerBase {...actionProps} {...props} backgroundColor={isLightTheme
50
+ ? design_system_shared_1.BoxBackgroundColor.BackgroundDefault
51
+ : design_system_shared_1.BoxBackgroundColor.BackgroundSection} borderColor={design_system_shared_1.BoxBorderColor.BorderMuted} borderWidth={1} children={children} childrenWrapperProps={childrenWrapperProps} closeButtonProps={resolvedCloseButtonProps} description={description} descriptionProps={{
52
+ color: design_system_shared_1.TextColor.TextAlternative,
53
+ ...descriptionProps,
54
+ }} onClose={onClose} startAccessory={renderSeverityAccessory({
46
55
  iconAlertProps,
47
56
  severity,
48
57
  startAccessory,
49
- })} title={title} titleProps={titleProps} twClassName={(0, design_system_shared_1.mergeTwClassName)('rounded-xl', twClassName)}/>);
58
+ })} style={[isLightTheme ? design_tokens_1.lightTheme.shadows.size.md : undefined, style]} title={title} titleProps={titleProps} twClassName={(0, design_system_shared_1.mergeTwClassName)('rounded-2xl', twClassName)}/>);
50
59
  };
51
60
  exports.Toast = Toast;
52
61
  //# sourceMappingURL=Toast.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,yEAMwC;AACxC,kDAA0B;AAE1B,yBAAyB;AACzB,wDAA2C;AAC3C,sDAAyC;AAEzC,yBAAyB;AACzB,2DAA4D;AAC5D,mDAA8C;AAG9C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,cAAc,EACd,QAAQ,EACR,cAAc,GACqD,EAAE,EAAE;IACvE,IAAI,cAAc,KAAK,IAAI,IAAI,cAAc,KAAK,SAAS,EAAE;QAC3D,OAAO,cAAc,CAAC;KACvB;IAED,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,2BAAa,CAAC,OAAO,EAAE;QACnD,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,iBAAiB,GAAG,yCAAuB,CAAC,QAAQ,CAAC,CAAC;IAE5D,OAAO,CACL,CAAC,qBAAS,CACR,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAC5B,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,cAAc,CAAC,EACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,KAAK,GAAyB,CAAC,EAC1C,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,QAAQ,GAAG,2BAAa,CAAC,OAAO,EAChC,cAAc,EACd,KAAK,EACL,UAAU,EACV,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,WAAW,GACf,iBAAiB,IAAI,mBAAmB;QACtC,CAAC,CAAC;YACE,iBAAiB;YACjB,mBAAmB;YACnB,iBAAiB,EAAE;gBACjB,IAAI,EAAE,iCAAU,CAAC,EAAE;gBACnB,GAAG,iBAAiB;aACrB;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IACT,4EAA4E;IAC5E,wEAAwE;IACxE,MAAM,wBAAwB,GAC5B,OAAO,IAAI,gBAAgB;QACzB,CAAC,CAAC;YACE,kBAAkB,EAAE,aAAa;YACjC,GAAG,gBAAgB;SACpB;QACH,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,WAAW,CAAC,CAChB,IAAI,KAAK,CAAC,CACV,eAAe,CAAC,CAAC,yCAAkB,CAAC,iBAAiB,CAAC,CACtD,WAAW,CAAC,CAAC,qCAAc,CAAC,WAAW,CAAC,CACxC,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,gBAAgB,CAAC,CAAC,wBAAwB,CAAC,CAC3C,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,cAAc,CAAC,CAAC,uBAAuB,CAAC;YACtC,cAAc;YACd,QAAQ;YACR,cAAc;SACf,CAAC,CAAC,CACH,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC,EACzD,CACH,CAAC;AACJ,CAAC,CAAC;AA9DW,QAAA,KAAK,SA8DhB","sourcesContent":["// Third party dependencies.\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n ButtonSize,\n IconSize,\n mergeTwClassName,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\n// External dependencies.\nimport { BannerBase } from '../BannerBase';\nimport { IconAlert } from '../IconAlert';\n\n// Internal dependencies.\nimport { TOAST_SEVERITY_ICON_MAP } from './Toast.constants';\nimport { ToastSeverity } from './Toast.types';\nimport type { ToastProps } from './Toast.types';\n\nconst renderSeverityAccessory = ({\n iconAlertProps,\n severity,\n startAccessory,\n}: Pick<ToastProps, 'iconAlertProps' | 'severity' | 'startAccessory'>) => {\n if (startAccessory !== null && startAccessory !== undefined) {\n return startAccessory;\n }\n\n if (!severity || severity === ToastSeverity.Default) {\n return undefined;\n }\n\n const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];\n\n return (\n <IconAlert\n severity={iconAlertSeverity}\n size={IconSize.Lg}\n {...iconAlertProps}\n />\n );\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n children,\n childrenWrapperProps,\n closeButtonProps,\n description,\n descriptionProps,\n onClose,\n iconAlertProps,\n severity = ToastSeverity.Default,\n startAccessory,\n title,\n titleProps,\n twClassName,\n ...props\n}) => {\n const actionProps =\n actionButtonLabel && actionButtonOnPress\n ? {\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps: {\n size: ButtonSize.Sm,\n ...actionButtonProps,\n },\n }\n : {};\n // TODO: Remove this conditional once BannerBase only renders a close button\n // from onClose. At that point Toast can pass closeButtonProps directly.\n const resolvedCloseButtonProps =\n onClose || closeButtonProps\n ? {\n accessibilityLabel: 'Close toast',\n ...closeButtonProps,\n }\n : undefined;\n\n return (\n <BannerBase\n {...actionProps}\n {...props}\n backgroundColor={BoxBackgroundColor.BackgroundSection}\n borderColor={BoxBorderColor.BorderMuted}\n borderWidth={1}\n children={children}\n childrenWrapperProps={childrenWrapperProps}\n closeButtonProps={resolvedCloseButtonProps}\n description={description}\n descriptionProps={descriptionProps}\n onClose={onClose}\n startAccessory={renderSeverityAccessory({\n iconAlertProps,\n severity,\n startAccessory,\n })}\n title={title}\n titleProps={titleProps}\n twClassName={mergeTwClassName('rounded-xl', twClassName)}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"Toast.cjs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W,CAAC,CAAC,EAC1D,CACH,CAAC;AACJ,CAAC,CAAC;AAzEW,QAAA,KAAK,SAyEhB","sourcesContent":["// Third party dependencies.\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n ButtonSize,\n IconSize,\n mergeTwClassName,\n TextColor,\n} from '@metamask/design-system-shared';\nimport { Theme, useTheme } from '@metamask/design-system-twrnc-preset';\nimport { lightTheme } from '@metamask/design-tokens';\nimport React from 'react';\n\n// External dependencies.\nimport { BannerBase } from '../BannerBase';\nimport { IconAlert } from '../IconAlert';\n\n// Internal dependencies.\nimport { TOAST_SEVERITY_ICON_MAP } from './Toast.constants';\nimport { ToastSeverity } from './Toast.types';\nimport type { ToastProps } from './Toast.types';\n\nconst renderSeverityAccessory = ({\n iconAlertProps,\n severity,\n startAccessory,\n}: Pick<ToastProps, 'iconAlertProps' | 'severity' | 'startAccessory'>) => {\n if (startAccessory !== null && startAccessory !== undefined) {\n return startAccessory;\n }\n\n if (!severity || severity === ToastSeverity.Default) {\n return undefined;\n }\n\n const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];\n\n return (\n <IconAlert\n severity={iconAlertSeverity}\n size={IconSize.Lg}\n {...iconAlertProps}\n />\n );\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n children,\n childrenWrapperProps,\n closeButtonProps,\n description,\n descriptionProps,\n onClose,\n iconAlertProps,\n severity = ToastSeverity.Default,\n startAccessory,\n style,\n title,\n titleProps,\n twClassName,\n ...props\n}) => {\n const theme = useTheme();\n const isLightTheme = theme === Theme.Light;\n const actionProps =\n actionButtonLabel && actionButtonOnPress\n ? {\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps: {\n size: ButtonSize.Sm,\n ...actionButtonProps,\n },\n }\n : {};\n // TODO: Remove this conditional once BannerBase only renders a close button\n // from onClose. At that point Toast can pass closeButtonProps directly.\n const resolvedCloseButtonProps =\n onClose || closeButtonProps\n ? {\n accessibilityLabel: 'Close toast',\n ...closeButtonProps,\n }\n : undefined;\n\n return (\n <BannerBase\n {...actionProps}\n {...props}\n backgroundColor={\n isLightTheme\n ? BoxBackgroundColor.BackgroundDefault\n : BoxBackgroundColor.BackgroundSection\n }\n borderColor={BoxBorderColor.BorderMuted}\n borderWidth={1}\n children={children}\n childrenWrapperProps={childrenWrapperProps}\n closeButtonProps={resolvedCloseButtonProps}\n description={description}\n descriptionProps={{\n color: TextColor.TextAlternative,\n ...descriptionProps,\n }}\n onClose={onClose}\n startAccessory={renderSeverityAccessory({\n iconAlertProps,\n severity,\n startAccessory,\n })}\n style={[isLightTheme ? lightTheme.shadows.size.md : undefined, style]}\n title={title}\n titleProps={titleProps}\n twClassName={mergeTwClassName('rounded-2xl', twClassName)}\n />\n );\n};\n"]}
@@ -1,13 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TOAST_SEVERITY_ICON_MAP = exports.TOAST_BOTTOM_PADDING = exports.TOAST_VISIBILITY_DURATION = exports.TOAST_ANIMATION_DURATION = void 0;
3
+ exports.TOAST_SEVERITY_ICON_MAP = exports.TOAST_SPRING_CONFIG = exports.TOAST_TOP_PADDING = exports.TOAST_VISIBILITY_DURATION = exports.TOAST_ANIMATION_DURATION = void 0;
4
4
  // External dependencies.
5
5
  const design_system_shared_1 = require("@metamask/design-system-shared");
6
6
  const Toast_types_1 = require("./Toast.types.cjs");
7
7
  var design_system_shared_2 = require("@metamask/design-system-shared");
8
8
  Object.defineProperty(exports, "TOAST_ANIMATION_DURATION", { enumerable: true, get: function () { return design_system_shared_2.TOAST_ANIMATION_DURATION; } });
9
9
  Object.defineProperty(exports, "TOAST_VISIBILITY_DURATION", { enumerable: true, get: function () { return design_system_shared_2.TOAST_VISIBILITY_DURATION; } });
10
- exports.TOAST_BOTTOM_PADDING = 36;
10
+ exports.TOAST_TOP_PADDING = 8;
11
+ /**
12
+ * Spring tuned to approximate iOS system banner motion (inspired by UIKit
13
+ * spring with dampingRatio ~0.7-0.85 / SwiftUI .snappy).
14
+ */
15
+ exports.TOAST_SPRING_CONFIG = {
16
+ dampingRatio: 0.85,
17
+ duration: 500,
18
+ };
11
19
  exports.TOAST_SEVERITY_ICON_MAP = {
12
20
  [Toast_types_1.ToastSeverity.Success]: design_system_shared_1.IconAlertSeverity.Success,
13
21
  [Toast_types_1.ToastSeverity.Warning]: design_system_shared_1.IconAlertSeverity.Warning,
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.constants.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,yEAAmE;AAEnE,mDAA8C;AAE9C,uEAGwC;AAFtC,gIAAA,wBAAwB,OAAA;AACxB,iIAAA,yBAAyB,OAAA;AAGd,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAE1B,QAAA,uBAAuB,GAAG;IACrC,CAAC,2BAAa,CAAC,OAAO,CAAC,EAAE,wCAAiB,CAAC,OAAO;IAClD,CAAC,2BAAa,CAAC,OAAO,CAAC,EAAE,wCAAiB,CAAC,OAAO;IAClD,CAAC,2BAAa,CAAC,MAAM,CAAC,EAAE,wCAAiB,CAAC,MAAM;CACxC,CAAC","sourcesContent":["// External dependencies.\nimport { IconAlertSeverity } from '@metamask/design-system-shared';\n\nimport { ToastSeverity } from './Toast.types';\n\nexport {\n TOAST_ANIMATION_DURATION,\n TOAST_VISIBILITY_DURATION,\n} from '@metamask/design-system-shared';\n\nexport const TOAST_BOTTOM_PADDING = 36;\n\nexport const TOAST_SEVERITY_ICON_MAP = {\n [ToastSeverity.Success]: IconAlertSeverity.Success,\n [ToastSeverity.Warning]: IconAlertSeverity.Warning,\n [ToastSeverity.Danger]: IconAlertSeverity.Danger,\n} as const;\n"]}
1
+ {"version":3,"file":"Toast.constants.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,yEAAmE;AAGnE,mDAA8C;AAE9C,uEAGwC;AAFtC,gIAAA,wBAAwB,OAAA;AACxB,iIAAA,yBAAyB,OAAA;AAGd,QAAA,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;;GAGG;AACU,QAAA,mBAAmB,GAAqB;IACnD,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,GAAG;CACd,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACrC,CAAC,2BAAa,CAAC,OAAO,CAAC,EAAE,wCAAiB,CAAC,OAAO;IAClD,CAAC,2BAAa,CAAC,OAAO,CAAC,EAAE,wCAAiB,CAAC,OAAO;IAClD,CAAC,2BAAa,CAAC,MAAM,CAAC,EAAE,wCAAiB,CAAC,MAAM;CACxC,CAAC","sourcesContent":["// External dependencies.\nimport { IconAlertSeverity } from '@metamask/design-system-shared';\nimport type { WithSpringConfig } from 'react-native-reanimated';\n\nimport { ToastSeverity } from './Toast.types';\n\nexport {\n TOAST_ANIMATION_DURATION,\n TOAST_VISIBILITY_DURATION,\n} from '@metamask/design-system-shared';\n\nexport const TOAST_TOP_PADDING = 8;\n\n/**\n * Spring tuned to approximate iOS system banner motion (inspired by UIKit\n * spring with dampingRatio ~0.7-0.85 / SwiftUI .snappy).\n */\nexport const TOAST_SPRING_CONFIG: WithSpringConfig = {\n dampingRatio: 0.85,\n duration: 500,\n};\n\nexport const TOAST_SEVERITY_ICON_MAP = {\n [ToastSeverity.Success]: IconAlertSeverity.Success,\n [ToastSeverity.Warning]: IconAlertSeverity.Warning,\n [ToastSeverity.Danger]: IconAlertSeverity.Danger,\n} as const;\n"]}
@@ -1,5 +1,11 @@
1
+ import type { WithSpringConfig } from "react-native-reanimated";
1
2
  export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION, } from "@metamask/design-system-shared";
2
- export declare const TOAST_BOTTOM_PADDING = 36;
3
+ export declare const TOAST_TOP_PADDING = 8;
4
+ /**
5
+ * Spring tuned to approximate iOS system banner motion (inspired by UIKit
6
+ * spring with dampingRatio ~0.7-0.85 / SwiftUI .snappy).
7
+ */
8
+ export declare const TOAST_SPRING_CONFIG: WithSpringConfig;
3
9
  export declare const TOAST_SEVERITY_ICON_MAP: {
4
10
  readonly success: "success";
5
11
  readonly warning: "warning";
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,uCAAuC;AAExC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
1
+ {"version":3,"file":"Toast.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAAgC;AAIhE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,uCAAuC;AAExC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAGjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
@@ -1,5 +1,11 @@
1
+ import type { WithSpringConfig } from "react-native-reanimated";
1
2
  export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION, } from "@metamask/design-system-shared";
2
- export declare const TOAST_BOTTOM_PADDING = 36;
3
+ export declare const TOAST_TOP_PADDING = 8;
4
+ /**
5
+ * Spring tuned to approximate iOS system banner motion (inspired by UIKit
6
+ * spring with dampingRatio ~0.7-0.85 / SwiftUI .snappy).
7
+ */
8
+ export declare const TOAST_SPRING_CONFIG: WithSpringConfig;
3
9
  export declare const TOAST_SEVERITY_ICON_MAP: {
4
10
  readonly success: "success";
5
11
  readonly warning: "warning";
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,uCAAuC;AAExC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
1
+ {"version":3,"file":"Toast.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAAgC;AAIhE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,uCAAuC;AAExC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAGjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
@@ -2,7 +2,15 @@
2
2
  import { IconAlertSeverity } from "@metamask/design-system-shared";
3
3
  import { ToastSeverity } from "./Toast.types.mjs";
4
4
  export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION } from "@metamask/design-system-shared";
5
- export const TOAST_BOTTOM_PADDING = 36;
5
+ export const TOAST_TOP_PADDING = 8;
6
+ /**
7
+ * Spring tuned to approximate iOS system banner motion (inspired by UIKit
8
+ * spring with dampingRatio ~0.7-0.85 / SwiftUI .snappy).
9
+ */
10
+ export const TOAST_SPRING_CONFIG = {
11
+ dampingRatio: 0.85,
12
+ duration: 500,
13
+ };
6
14
  export const TOAST_SEVERITY_ICON_MAP = {
7
15
  [ToastSeverity.Success]: IconAlertSeverity.Success,
8
16
  [ToastSeverity.Warning]: IconAlertSeverity.Warning,
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.constants.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAE9C,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EAC1B,uCAAuC;AAExC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO;IAClD,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO;IAClD,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,MAAM;CACxC,CAAC","sourcesContent":["// External dependencies.\nimport { IconAlertSeverity } from '@metamask/design-system-shared';\n\nimport { ToastSeverity } from './Toast.types';\n\nexport {\n TOAST_ANIMATION_DURATION,\n TOAST_VISIBILITY_DURATION,\n} from '@metamask/design-system-shared';\n\nexport const TOAST_BOTTOM_PADDING = 36;\n\nexport const TOAST_SEVERITY_ICON_MAP = {\n [ToastSeverity.Success]: IconAlertSeverity.Success,\n [ToastSeverity.Warning]: IconAlertSeverity.Warning,\n [ToastSeverity.Danger]: IconAlertSeverity.Danger,\n} as const;\n"]}
1
+ {"version":3,"file":"Toast.constants.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAGnE,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAE9C,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EAC1B,uCAAuC;AAExC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,GAAG;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO;IAClD,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO;IAClD,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,MAAM;CACxC,CAAC","sourcesContent":["// External dependencies.\nimport { IconAlertSeverity } from '@metamask/design-system-shared';\nimport type { WithSpringConfig } from 'react-native-reanimated';\n\nimport { ToastSeverity } from './Toast.types';\n\nexport {\n TOAST_ANIMATION_DURATION,\n TOAST_VISIBILITY_DURATION,\n} from '@metamask/design-system-shared';\n\nexport const TOAST_TOP_PADDING = 8;\n\n/**\n * Spring tuned to approximate iOS system banner motion (inspired by UIKit\n * spring with dampingRatio ~0.7-0.85 / SwiftUI .snappy).\n */\nexport const TOAST_SPRING_CONFIG: WithSpringConfig = {\n dampingRatio: 0.85,\n duration: 500,\n};\n\nexport const TOAST_SEVERITY_ICON_MAP = {\n [ToastSeverity.Success]: IconAlertSeverity.Success,\n [ToastSeverity.Warning]: IconAlertSeverity.Warning,\n [ToastSeverity.Danger]: IconAlertSeverity.Danger,\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,UAAU,EAAE,0BAAsB;AA0BhD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA8DtC,CAAC"}
1
+ {"version":3,"file":"Toast.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,UAAU,EAAE,0BAAsB;AA0BhD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAyEtC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,UAAU,EAAE,0BAAsB;AA0BhD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA8DtC,CAAC"}
1
+ {"version":3,"file":"Toast.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,UAAU,EAAE,0BAAsB;AA0BhD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAyEtC,CAAC"}
@@ -5,7 +5,9 @@ function $importDefault(module) {
5
5
  return module;
6
6
  }
7
7
  // Third party dependencies.
8
- import { BoxBackgroundColor, BoxBorderColor, ButtonSize, IconSize, mergeTwClassName } from "@metamask/design-system-shared";
8
+ import { BoxBackgroundColor, BoxBorderColor, ButtonSize, IconSize, mergeTwClassName, TextColor } from "@metamask/design-system-shared";
9
+ import { Theme, useTheme } from "@metamask/design-system-twrnc-preset";
10
+ import { lightTheme } from "@metamask/design-tokens";
9
11
  import $React from "react";
10
12
  const React = $importDefault($React);
11
13
  // External dependencies.
@@ -24,7 +26,9 @@ const renderSeverityAccessory = ({ iconAlertProps, severity, startAccessory, })
24
26
  const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];
25
27
  return (<IconAlert severity={iconAlertSeverity} size={IconSize.Lg} {...iconAlertProps}/>);
26
28
  };
27
- export const Toast = ({ actionButtonLabel, actionButtonOnPress, actionButtonProps, children, childrenWrapperProps, closeButtonProps, description, descriptionProps, onClose, iconAlertProps, severity = ToastSeverity.Default, startAccessory, title, titleProps, twClassName, ...props }) => {
29
+ export const Toast = ({ actionButtonLabel, actionButtonOnPress, actionButtonProps, children, childrenWrapperProps, closeButtonProps, description, descriptionProps, onClose, iconAlertProps, severity = ToastSeverity.Default, startAccessory, style, title, titleProps, twClassName, ...props }) => {
30
+ const theme = useTheme();
31
+ const isLightTheme = theme === Theme.Light;
28
32
  const actionProps = actionButtonLabel && actionButtonOnPress
29
33
  ? {
30
34
  actionButtonLabel,
@@ -43,10 +47,15 @@ export const Toast = ({ actionButtonLabel, actionButtonOnPress, actionButtonProp
43
47
  ...closeButtonProps,
44
48
  }
45
49
  : undefined;
46
- return (<BannerBase {...actionProps} {...props} backgroundColor={BoxBackgroundColor.BackgroundSection} borderColor={BoxBorderColor.BorderMuted} borderWidth={1} children={children} childrenWrapperProps={childrenWrapperProps} closeButtonProps={resolvedCloseButtonProps} description={description} descriptionProps={descriptionProps} onClose={onClose} startAccessory={renderSeverityAccessory({
50
+ return (<BannerBase {...actionProps} {...props} backgroundColor={isLightTheme
51
+ ? BoxBackgroundColor.BackgroundDefault
52
+ : BoxBackgroundColor.BackgroundSection} borderColor={BoxBorderColor.BorderMuted} borderWidth={1} children={children} childrenWrapperProps={childrenWrapperProps} closeButtonProps={resolvedCloseButtonProps} description={description} descriptionProps={{
53
+ color: TextColor.TextAlternative,
54
+ ...descriptionProps,
55
+ }} onClose={onClose} startAccessory={renderSeverityAccessory({
47
56
  iconAlertProps,
48
57
  severity,
49
58
  startAccessory,
50
- })} title={title} titleProps={titleProps} twClassName={mergeTwClassName('rounded-xl', twClassName)}/>);
59
+ })} style={[isLightTheme ? lightTheme.shadows.size.md : undefined, style]} title={title} titleProps={titleProps} twClassName={mergeTwClassName('rounded-2xl', twClassName)}/>);
51
60
  };
52
61
  //# sourceMappingURL=Toast.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,gBAAgB,EACjB,uCAAuC;AACxC,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,SAAS,EAAE,+BAAqB;AAEzC,yBAAyB;AACzB,OAAO,EAAE,uBAAuB,EAAE,8BAA0B;AAC5D,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAG9C,M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C,CAChB,IAAI,KAAK,CAAC,CACV,eAAe,CAAC,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CACtD,WAAW,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CACxC,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,gBAAgB,CAAC,CAAC,wBAAwB,CAAC,CAC3C,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,cAAc,CAAC,CAAC,uBAAuB,CAAC;YACtC,cAAc;YACd,QAAQ;YACR,cAAc;SACf,CAAC,CAAC,CACH,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAAW,CAAC,CAAC,gBAAgB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,EACzD,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n ButtonSize,\n IconSize,\n mergeTwClassName,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\n// External dependencies.\nimport { BannerBase } from '../BannerBase';\nimport { IconAlert } from '../IconAlert';\n\n// Internal dependencies.\nimport { TOAST_SEVERITY_ICON_MAP } from './Toast.constants';\nimport { ToastSeverity } from './Toast.types';\nimport type { ToastProps } from './Toast.types';\n\nconst renderSeverityAccessory = ({\n iconAlertProps,\n severity,\n startAccessory,\n}: Pick<ToastProps, 'iconAlertProps' | 'severity' | 'startAccessory'>) => {\n if (startAccessory !== null && startAccessory !== undefined) {\n return startAccessory;\n }\n\n if (!severity || severity === ToastSeverity.Default) {\n return undefined;\n }\n\n const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];\n\n return (\n <IconAlert\n severity={iconAlertSeverity}\n size={IconSize.Lg}\n {...iconAlertProps}\n />\n );\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n children,\n childrenWrapperProps,\n closeButtonProps,\n description,\n descriptionProps,\n onClose,\n iconAlertProps,\n severity = ToastSeverity.Default,\n startAccessory,\n title,\n titleProps,\n twClassName,\n ...props\n}) => {\n const actionProps =\n actionButtonLabel && actionButtonOnPress\n ? {\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps: {\n size: ButtonSize.Sm,\n ...actionButtonProps,\n },\n }\n : {};\n // TODO: Remove this conditional once BannerBase only renders a close button\n // from onClose. At that point Toast can pass closeButtonProps directly.\n const resolvedCloseButtonProps =\n onClose || closeButtonProps\n ? {\n accessibilityLabel: 'Close toast',\n ...closeButtonProps,\n }\n : undefined;\n\n return (\n <BannerBase\n {...actionProps}\n {...props}\n backgroundColor={BoxBackgroundColor.BackgroundSection}\n borderColor={BoxBorderColor.BorderMuted}\n borderWidth={1}\n children={children}\n childrenWrapperProps={childrenWrapperProps}\n closeButtonProps={resolvedCloseButtonProps}\n description={description}\n descriptionProps={descriptionProps}\n onClose={onClose}\n startAccessory={renderSeverityAccessory({\n iconAlertProps,\n severity,\n startAccessory,\n })}\n title={title}\n titleProps={titleProps}\n twClassName={mergeTwClassName('rounded-xl', twClassName)}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"Toast.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACV,uCAAuC;AACxC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,6CAA6C;AACvE,OAAO,EAAE,UAAU,EAAE,gCAAgC;AACrD,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,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Size,\n mergeTwClassName,\n TextColor,\n} from '@metamask/design-system-shared';\nimport { Theme, useTheme } from '@metamask/design-system-twrnc-preset';\nimport { lightTheme } from '@metamask/design-tokens';\nimport React from 'react';\n\n// External dependencies.\nimport { BannerBase } from '../BannerBase';\nimport { IconAlert } from '../IconAlert';\n\n// Internal dependencies.\nimport { TOAST_SEVERITY_ICON_MAP } from './Toast.constants';\nimport { ToastSeverity } from './Toast.types';\nimport type { ToastProps } from './Toast.types';\n\nconst renderSeverityAccessory = ({\n iconAlertProps,\n severity,\n startAccessory,\n}: Pick<ToastProps, 'iconAlertProps' | 'severity' | 'startAccessory'>) => {\n if (startAccessory !== null && startAccessory !== undefined) {\n return startAccessory;\n }\n\n if (!severity || severity === ToastSeverity.Default) {\n return undefined;\n }\n\n const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];\n\n return (\n <IconAlert\n severity={iconAlertSeverity}\n size={IconSize.Lg}\n {...iconAlertProps}\n />\n );\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n children,\n childrenWrapperProps,\n closeButtonProps,\n description,\n descriptionProps,\n onClose,\n iconAlertProps,\n severity = ToastSeverity.Default,\n startAccessory,\n style,\n title,\n titleProps,\n twClassName,\n ...props\n}) => {\n const theme = useTheme();\n const isLightTheme = theme === Theme.Light;\n const actionProps =\n actionButtonLabel && actionButtonOnPress\n ? {\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps: {\n size: ButtonSize.Sm,\n ...actionButtonProps,\n },\n }\n : {};\n // TODO: Remove this conditional once BannerBase only renders a close button\n // from onClose. At that point Toast can pass closeButtonProps directly.\n const resolvedCloseButtonProps =\n onClose || closeButtonProps\n ? {\n accessibilityLabel: 'Close toast',\n ...closeButtonProps,\n }\n : undefined;\n\n return (\n <BannerBase\n {...actionProps}\n {...props}\n backgroundColor={\n isLightTheme\n ? BoxBackgroundColor.BackgroundDefault\n : BoxBackgroundColor.BackgroundSection\n }\n borderColor={BoxBorderColor.BorderMuted}\n borderWidth={1}\n children={children}\n childrenWrapperProps={childrenWrapperProps}\n closeButtonProps={resolvedCloseButtonProps}\n description={description}\n descriptionProps={{\n color: TextColor.TextAlternative,\n ...descriptionProps,\n }}\n onClose={onClose}\n startAccessory={renderSeverityAccessory({\n iconAlertProps,\n severity,\n startAccessory,\n })}\n style={[isLightTheme ? lightTheme.shadows.size.md : undefined, style]}\n title={title}\n titleProps={titleProps}\n twClassName={mergeTwClassName('rounded-2xl', twClassName)}\n />\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.types.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":";;;AACA,yEAA+D;AAMtD,8FANA,oCAAa,OAMA","sourcesContent":["import type { ToastPropsShared } from '@metamask/design-system-shared';\nimport { ToastSeverity } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\nexport { ToastSeverity };\nexport type { ToastPropsShared };\n\n/**\n * Optional props for the leading severity `Icon`.\n */\nexport type ToastIconProps = Omit<IconProps, 'name' | 'size' | 'color'>;\n\n/**\n * Shared toast props aligned with BannerBase, plus optional severity/icon props.\n */\nexport type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {\n closeButtonProps?: Omit<\n NonNullable<BannerBaseProps['closeButtonProps']>,\n 'onPress'\n >;\n severity?: ToastSeverity;\n iconAlertProps?: ToastIconProps;\n};\n\n/**\n * Toast options used by the imperative `toast(...)` API.\n */\nexport type ToastOptions = ToastSharedProps & {\n hasNoTimeout?: boolean;\n bottomOffset?: number;\n};\n\n/**\n * Toaster component reference.\n */\nexport type ToasterRef = {\n showToast: (toastOptions: ToastOptions) => void;\n closeToast: () => void;\n};\n\n/**\n * Toast component props intended for direct rendering of a single toast surface.\n */\nexport type ToastProps = ToastSharedProps;\n\n/**\n * Toaster component props.\n * Extends ViewProps to inherit standard React Native props such as testID and accessibilityLabel.\n */\nexport type ToasterProps = {\n /**\n * Optional Tailwind CSS classes for the toast container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'style'>;\n"]}
1
+ {"version":3,"file":"Toast.types.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":";;;AACA,yEAA+D;AAMtD,8FANA,oCAAa,OAMA","sourcesContent":["import type { ToastPropsShared } from '@metamask/design-system-shared';\nimport { ToastSeverity } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\nexport { ToastSeverity };\nexport type { ToastPropsShared };\n\n/**\n * Optional props for the leading severity `Icon`.\n */\nexport type ToastIconProps = Omit<IconProps, 'name' | 'size' | 'color'>;\n\n/**\n * Shared toast props aligned with BannerBase, plus optional severity/icon props.\n */\nexport type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {\n closeButtonProps?: Omit<\n NonNullable<BannerBaseProps['closeButtonProps']>,\n 'onPress'\n >;\n severity?: ToastSeverity;\n iconAlertProps?: ToastIconProps;\n};\n\n/**\n * Toast options used by the imperative `toast(...)` API.\n */\nexport type ToastOptions = ToastSharedProps & {\n hasNoTimeout?: boolean;\n topOffset?: number;\n};\n\n/**\n * Toaster component reference.\n */\nexport type ToasterRef = {\n showToast: (toastOptions: ToastOptions) => void;\n closeToast: () => void;\n};\n\n/**\n * Toast component props intended for direct rendering of a single toast surface.\n */\nexport type ToastProps = ToastSharedProps;\n\n/**\n * Toaster component props.\n * Extends ViewProps to inherit standard React Native props such as testID and accessibilityLabel.\n */\nexport type ToasterProps = {\n /**\n * Optional Tailwind CSS classes for the toast container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'style'>;\n"]}
@@ -22,7 +22,7 @@ export type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {
22
22
  */
23
23
  export type ToastOptions = ToastSharedProps & {
24
24
  hasNoTimeout?: boolean;
25
- bottomOffset?: number;
25
+ topOffset?: number;
26
26
  };
27
27
  /**
28
28
  * Toaster component reference.
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.types.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uCAAuC;AACvE,OAAO,EAAE,aAAa,EAAE,uCAAuC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG;IACzE,gBAAgB,CAAC,EAAE,IAAI,CACrB,WAAW,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,EAChD,SAAS,CACV,CAAC;IACF,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,gBAAgB,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ACH,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC"}
@@ -22,7 +22,7 @@ export type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {
22
22
  */
23
23
  export type ToastOptions = ToastSharedProps & {
24
24
  hasNoTimeout?: boolean;
25
- bottomOffset?: number;
25
+ topOffset?: number;
26
26
  };
27
27
  /**
28
28
  * Toaster component reference.
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.types.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uCAAuC;AACvE,OAAO,EAAE,aAAa,EAAE,uCAAuC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG;IACzE,gBAAgB,CAAC,EAAE,IAAI,CACrB,WAAW,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,EAChD,SAAS,CACV,CAAC;IACF,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG;IAC5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AAM,YAAY,GAAG,gBAAgB,GAAG;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.types.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,uCAAuC;AAM/D,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import type { ToastPropsShared } from '@metamask/design-system-shared';\nimport { ToastSeverity } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\nexport { ToastSeverity };\nexport type { ToastPropsShared };\n\n/**\n * Optional props for the leading severity `Icon`.\n */\nexport type ToastIconProps = Omit<IconProps, 'name' | 'size' | 'color'>;\n\n/**\n * Shared toast props aligned with BannerBase, plus optional severity/icon props.\n */\nexport type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {\n closeButtonProps?: Omit<\n NonNullable<BannerBaseProps['closeButtonProps']>,\n 'onPress'\n >;\n severity?: ToastSeverity;\n iconAlertProps?: ToastIconProps;\n};\n\n/**\n * Toast options used by the imperative `toast(...)` API.\n */\nexport type ToastOptions = ToastSharedProps & {\n hasNoTimeout?: boolean;\n bottomOffset?: number;\n};\n\n/**\n * Toaster component reference.\n */\nexport type ToasterRef = {\n showToast: (toastOptions: ToastOptions) => void;\n closeToast: () => void;\n};\n\n/**\n * Toast component props intended for direct rendering of a single toast surface.\n */\nexport type ToastProps = ToastSharedProps;\n\n/**\n * Toaster component props.\n * Extends ViewProps to inherit standard React Native props such as testID and accessibilityLabel.\n */\nexport type ToasterProps = {\n /**\n * Optional Tailwind CSS classes for the toast container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'style'>;\n"]}
1
+ {"version":3,"file":"Toast.types.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,uCAAuC;AAM/D,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import type { ToastPropsShared } from '@metamask/design-system-shared';\nimport { ToastSeverity } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\nexport { ToastSeverity };\nexport type { ToastPropsShared };\n\n/**\n * Optional props for the leading severity `Icon`.\n */\nexport type ToastIconProps = Omit<IconProps, 'name' | 'size' | 'color'>;\n\n/**\n * Shared toast props aligned with BannerBase, plus optional severity/icon props.\n */\nexport type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {\n closeButtonProps?: Omit<\n NonNullable<BannerBaseProps['closeButtonProps']>,\n 'onPress'\n >;\n severity?: ToastSeverity;\n iconAlertProps?: ToastIconProps;\n};\n\n/**\n * Toast options used by the imperative `toast(...)` API.\n */\nexport type ToastOptions = ToastSharedProps & {\n hasNoTimeout?: boolean;\n topOffset?: number;\n};\n\n/**\n * Toaster component reference.\n */\nexport type ToasterRef = {\n showToast: (toastOptions: ToastOptions) => void;\n closeToast: () => void;\n};\n\n/**\n * Toast component props intended for direct rendering of a single toast surface.\n */\nexport type ToastProps = ToastSharedProps;\n\n/**\n * Toaster component props.\n * Extends ViewProps to inherit standard React Native props such as testID and accessibilityLabel.\n */\nexport type ToasterProps = {\n /**\n * Optional Tailwind CSS classes for the toast container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'style'>;\n"]}