@metamask-previews/design-system-react-native 0.30.2-preview.f77a5d5 → 0.32.0-preview.cf8aa2e4

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 (97) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +5 -6
  3. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
  4. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +6 -7
  5. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
  6. package/dist/components/ButtonSemantic/index.cjs +3 -1
  7. package/dist/components/ButtonSemantic/index.cjs.map +1 -1
  8. package/dist/components/ButtonSemantic/index.d.cts +1 -0
  9. package/dist/components/ButtonSemantic/index.d.cts.map +1 -1
  10. package/dist/components/ButtonSemantic/index.d.mts +1 -0
  11. package/dist/components/ButtonSemantic/index.d.mts.map +1 -1
  12. package/dist/components/ButtonSemantic/index.mjs +1 -0
  13. package/dist/components/ButtonSemantic/index.mjs.map +1 -1
  14. package/dist/components/FilterButton/FilterButton.cjs +1 -1
  15. package/dist/components/FilterButton/FilterButton.cjs.map +1 -1
  16. package/dist/components/FilterButton/FilterButton.mjs +2 -2
  17. package/dist/components/FilterButton/FilterButton.mjs.map +1 -1
  18. package/dist/components/FilterButton/index.cjs +2 -1
  19. package/dist/components/FilterButton/index.cjs.map +1 -1
  20. package/dist/components/FilterButton/index.d.cts +1 -1
  21. package/dist/components/FilterButton/index.d.cts.map +1 -1
  22. package/dist/components/FilterButton/index.d.mts +1 -1
  23. package/dist/components/FilterButton/index.d.mts.map +1 -1
  24. package/dist/components/FilterButton/index.mjs +1 -1
  25. package/dist/components/FilterButton/index.mjs.map +1 -1
  26. package/dist/components/Icon/Icon.assets.cjs +2 -0
  27. package/dist/components/Icon/Icon.assets.cjs.map +1 -1
  28. package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
  29. package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
  30. package/dist/components/Icon/Icon.assets.mjs +2 -0
  31. package/dist/components/Icon/Icon.assets.mjs.map +1 -1
  32. package/dist/components/Icon/assets/hard-drive.svg +1 -0
  33. package/dist/components/SectionHeader/SectionHeader.cjs +25 -14
  34. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
  35. package/dist/components/SectionHeader/SectionHeader.d.cts +3 -3
  36. package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
  37. package/dist/components/SectionHeader/SectionHeader.d.mts +3 -3
  38. package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
  39. package/dist/components/SectionHeader/SectionHeader.mjs +25 -14
  40. package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
  41. package/dist/components/SegmentedControl/SegmentedControl.cjs +1 -1
  42. package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  43. package/dist/components/SegmentedControl/SegmentedControl.constants.cjs +3 -3
  44. package/dist/components/SegmentedControl/SegmentedControl.constants.cjs.map +1 -1
  45. package/dist/components/SegmentedControl/SegmentedControl.constants.d.cts +3 -3
  46. package/dist/components/SegmentedControl/SegmentedControl.constants.d.cts.map +1 -1
  47. package/dist/components/SegmentedControl/SegmentedControl.constants.d.mts +3 -3
  48. package/dist/components/SegmentedControl/SegmentedControl.constants.d.mts.map +1 -1
  49. package/dist/components/SegmentedControl/SegmentedControl.constants.mjs +4 -4
  50. package/dist/components/SegmentedControl/SegmentedControl.constants.mjs.map +1 -1
  51. package/dist/components/SegmentedControl/SegmentedControl.mjs +2 -2
  52. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  53. package/dist/components/SegmentedControl/index.cjs +3 -1
  54. package/dist/components/SegmentedControl/index.cjs.map +1 -1
  55. package/dist/components/SegmentedControl/index.d.cts +1 -0
  56. package/dist/components/SegmentedControl/index.d.cts.map +1 -1
  57. package/dist/components/SegmentedControl/index.d.mts +1 -0
  58. package/dist/components/SegmentedControl/index.d.mts.map +1 -1
  59. package/dist/components/SegmentedControl/index.mjs +1 -0
  60. package/dist/components/SegmentedControl/index.mjs.map +1 -1
  61. package/dist/components/Toast/Toast.constants.cjs +14 -2
  62. package/dist/components/Toast/Toast.constants.cjs.map +1 -1
  63. package/dist/components/Toast/Toast.constants.d.cts +11 -1
  64. package/dist/components/Toast/Toast.constants.d.cts.map +1 -1
  65. package/dist/components/Toast/Toast.constants.d.mts +11 -1
  66. package/dist/components/Toast/Toast.constants.d.mts.map +1 -1
  67. package/dist/components/Toast/Toast.constants.mjs +13 -1
  68. package/dist/components/Toast/Toast.constants.mjs.map +1 -1
  69. package/dist/components/Toast/Toast.types.cjs.map +1 -1
  70. package/dist/components/Toast/Toast.types.d.cts +1 -1
  71. package/dist/components/Toast/Toast.types.d.cts.map +1 -1
  72. package/dist/components/Toast/Toast.types.d.mts +1 -1
  73. package/dist/components/Toast/Toast.types.d.mts.map +1 -1
  74. package/dist/components/Toast/Toast.types.mjs.map +1 -1
  75. package/dist/components/Toast/Toaster.cjs +17 -19
  76. package/dist/components/Toast/Toaster.cjs.map +1 -1
  77. package/dist/components/Toast/Toaster.d.cts.map +1 -1
  78. package/dist/components/Toast/Toaster.d.mts.map +1 -1
  79. package/dist/components/Toast/Toaster.mjs +19 -21
  80. package/dist/components/Toast/Toaster.mjs.map +1 -1
  81. package/dist/components/Toast/index.cjs +2 -2
  82. package/dist/components/Toast/index.cjs.map +1 -1
  83. package/dist/components/Toast/index.d.cts +1 -1
  84. package/dist/components/Toast/index.d.cts.map +1 -1
  85. package/dist/components/Toast/index.d.mts +1 -1
  86. package/dist/components/Toast/index.d.mts.map +1 -1
  87. package/dist/components/Toast/index.mjs +1 -1
  88. package/dist/components/Toast/index.mjs.map +1 -1
  89. package/dist/components/index.cjs +5 -2
  90. package/dist/components/index.cjs.map +1 -1
  91. package/dist/components/index.d.cts +3 -3
  92. package/dist/components/index.d.cts.map +1 -1
  93. package/dist/components/index.d.mts +3 -3
  94. package/dist/components/index.d.mts.map +1 -1
  95. package/dist/components/index.mjs +3 -3
  96. package/dist/components/index.mjs.map +1 -1
  97. package/package.json +9 -10
@@ -7,15 +7,15 @@ import type { SectionHeaderProps } from "./SectionHeader.types.mjs";
7
7
  *
8
8
  * @param sectionHeaderProps - Component props
9
9
  * @param sectionHeaderProps.title - Title content for the inner row (required)
10
- * @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row
11
- * @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories
10
+ * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)
11
+ * @param sectionHeaderProps.children - Optional full-width content below the header row
12
12
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
13
13
  * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
14
14
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
15
15
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
16
16
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
17
17
  * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved
18
- * @param sectionHeaderProps.endIconName - Optional end icon; takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided
18
+ * @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided
19
19
  * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`
20
20
  * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press
21
21
  * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuHtD,CAAC"}
1
+ {"version":3,"file":"SectionHeader.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuJtD,CAAC"}
@@ -19,15 +19,15 @@ import { Icon } from "../Icon/index.mjs";
19
19
  *
20
20
  * @param sectionHeaderProps - Component props
21
21
  * @param sectionHeaderProps.title - Title content for the inner row (required)
22
- * @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row
23
- * @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories
22
+ * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)
23
+ * @param sectionHeaderProps.children - Optional full-width content below the header row
24
24
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
25
25
  * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
26
26
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
27
27
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
28
28
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
29
29
  * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved
30
- * @param sectionHeaderProps.endIconName - Optional end icon; takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided
30
+ * @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided
31
31
  * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`
32
32
  * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press
33
33
  * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)
@@ -40,20 +40,27 @@ export const SectionHeader = (sectionHeaderProps) => {
40
40
  const tw = useTailwind();
41
41
  const resolvedEndIconName = endIconName ??
42
42
  (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);
43
- const resolvedStartAccessory = startIconName ? (<Icon size={IconSize.Md} color={IconColor.IconDefault} twClassName="shrink-0" {...startIconProps} name={startIconName}/>) : (startAccessory);
44
- const resolvedEndAccessory = resolvedEndIconName ? (<Icon size={IconSize.Md} color={IconColor.IconAlternative} twClassName="shrink-0" {...endIconProps} name={resolvedEndIconName}/>) : (endAccessory);
45
- const titleRow = title ? (<BoxRow {...titleWrapperProps} gap={1} endAccessory={titleAccessory} textProps={{
43
+ const resolvedStartAccessory = startIconName ? (<Icon size={IconSize.Sm} color={IconColor.IconDefault} twClassName="shrink-0" {...startIconProps} name={startIconName}/>) : (startAccessory);
44
+ const resolvedEndAccessory = resolvedEndIconName ? (<Icon size={IconSize.Sm} color={IconColor.IconAlternative} twClassName="shrink-0" {...endIconProps} name={resolvedEndIconName}/>) : (endAccessory);
45
+ const hasAccessories = Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);
46
+ const titleRow = title ? (<BoxRow {...titleWrapperProps} gap={1} endAccessory={titleAccessory} twClassName={mergeTwClassName(hasAccessories ? 'w-full shrink min-w-0' : '', titleWrapperProps?.twClassName)} textProps={{
46
47
  variant: TextVariant.HeadingMd,
47
48
  color: TextColor.TextDefault,
48
49
  ...titleProps,
49
50
  }}>
50
51
  {title}
51
52
  </BoxRow>) : null;
52
- const hasAccessories = Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);
53
- const mainContent = titleRow || children ? (<Box gap={1} twClassName={hasAccessories ? 'flex-1 min-w-0' : undefined}>
54
- {titleRow}
55
- {children}
56
- </Box>) : null;
53
+ let mainContent = null;
54
+ if (titleRow) {
55
+ mainContent = hasAccessories ? (<Box twClassName="shrink min-w-0">{titleRow}</Box>) : (titleRow);
56
+ }
57
+ const headerRow = (<BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
58
+ {mainContent}
59
+ </BoxRow>);
60
+ const body = children ? (<Box gap={1}>
61
+ {headerRow}
62
+ {children}
63
+ </Box>) : (headerRow);
57
64
  if (isInteractive) {
58
65
  const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;
59
66
  const isDisabled = Boolean(disabled);
@@ -62,11 +69,15 @@ export const SectionHeader = (sectionHeaderProps) => {
62
69
  const additionalStyle = typeof style === 'function' ? style({ pressed }) : style;
63
70
  return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;
64
71
  }} {...props}>
65
- <BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
66
- {mainContent}
67
- </BoxRow>
72
+ {body}
68
73
  </Pressable>);
69
74
  }
75
+ if (children) {
76
+ return (<Box {...props} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}>
77
+ {headerRow}
78
+ {children}
79
+ </Box>);
80
+ }
70
81
  return (<BoxRow {...props} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
71
82
  {mainContent}
72
83
  </BoxRow>);
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.mjs","sourceRoot":"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S,CACR,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;gBACrB,MAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CACxB,gBAAgB,EAChB,WAAW,EACX,OAAO,IAAI,CAAC,UAAU,IAAI,YAAY,CACvC,CAAC;gBACF,MAAM,eAAe,GACnB,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;gBAE3D,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACpE,CAAC,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,MAAM,CACL,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,cAAc,CAAC,CAAC,sBAAsB,CAAC,CACvC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAEnC;UAAA,CAAC,WAAW,CACd;QAAA,EAAE,MAAM,CACV;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;KACH;IAED,OAAO,CACL,CAAC,MAAM,CACL,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAC7D,cAAc,CAAC,CAAC,sBAAsB,CAAC,CACvC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAEnC;MAAA,CAAC,WAAW,CACd;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon } from '../Icon';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row\n * @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon; takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const titleRow = title ? (\n <BoxRow\n {...titleWrapperProps}\n gap={1}\n endAccessory={titleAccessory}\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null;\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const mainContent =\n titleRow || children ? (\n <Box gap={1} twClassName={hasAccessories ? 'flex-1 min-w-0' : undefined}>\n {titleRow}\n {children}\n </Box>\n ) : null;\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n <BoxRow\n gap={1}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n </Pressable>\n );\n }\n\n return (\n <BoxRow\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
1
+ {"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiC,CACzD,kBAAkB,EAClB,EAAE;IACF,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACT,GAAG,kBAAkB,CAAC;IAEvB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,mBAAmB,GACvB,WAAW;QACX,CAAC,aAAa,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAErE,MAAM,sBAAsB,GAAG,aAAa,CAAC,CAAC,CAAC,CAC7C,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,KAAK,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAC7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,CAAC;KACH;IAED,IAAI,QAAQ,EAAE;QACZ,OAAO,CACL,CAAC,GAAG,CACF,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAE7D;QAAA,CAAC,SAAS,CACV;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,GAAG,CAAC,CACP,CAAC;KACH;IAED,OAAO,CACL,CAAC,MAAM,CACL,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAC7D,cAAc,CAAC,CAAC,sBAAsB,CAAC,CACvC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAEnC;MAAA,CAAC,WAAW,CACd;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon } from '../Icon';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)\n * @param sectionHeaderProps.children - Optional full-width content below the header row\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Sm}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Sm}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const titleRow = title ? (\n <BoxRow\n {...titleWrapperProps}\n gap={1}\n endAccessory={titleAccessory}\n twClassName={mergeTwClassName(\n hasAccessories ? 'w-full shrink min-w-0' : '',\n titleWrapperProps?.twClassName,\n )}\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null;\n\n let mainContent = null;\n if (titleRow) {\n mainContent = hasAccessories ? (\n <Box twClassName=\"shrink min-w-0\">{titleRow}</Box>\n ) : (\n titleRow\n );\n }\n\n const headerRow = (\n <BoxRow\n gap={1}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n\n const body = children ? (\n <Box gap={1}>\n {headerRow}\n {children}\n </Box>\n ) : (\n headerRow\n );\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n {body}\n </Pressable>\n );\n }\n\n if (children) {\n return (\n <Box\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n >\n {headerRow}\n {children}\n </Box>\n );\n }\n\n return (\n <BoxRow\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
@@ -28,7 +28,7 @@ const design_system_shared_1 = require("@metamask-previews/design-system-shared"
28
28
  const react_1 = __importStar(require("react"));
29
29
  const Box_1 = require("../Box/index.cjs");
30
30
  const SegmentedControl_constants_1 = require("./SegmentedControl.constants.cjs");
31
- const SegmentedControl = ({ value, onChange, size = design_system_shared_1.ButtonBaseSize.Sm, isFullWidth = false, children, twClassName, style, ...rest }) => {
31
+ const SegmentedControl = ({ value, onChange, size = design_system_shared_1.SegmentedControlSize.Sm, isFullWidth = false, children, twClassName, style, ...rest }) => {
32
32
  const contextValue = (0, react_1.useMemo)(() => ({
33
33
  value,
34
34
  onChange,
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAKiD;AACjD,+CAAiD;AAEjD,0CAA6B;AAE7B,iFAAsF;AAG/E,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,qCAAc,CAAC,EAAE,EACxB,WAAW,GAAG,KAAK,EACnB,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACe,EAAE,EAAE;IAC1B,MAAM,YAAY,GAAG,IAAA,eAAO,EAC1B,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,QAAQ;QACR,OAAO,EAAE,0CAAmB,CAAC,SAAS;QACtC,IAAI;QACJ,YAAY,EAAE,WAAW;KAC1B,CAAC,EACF,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CACrC,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;IAE/D,OAAO,CACL,CAAC,+CAAwB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACrD;MAAA,CAAC,SAAG,CACF,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,SAAS,CAC3B,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAC3B,IAAA,uCAAgB,EACd,GAAG,UAAU,sDAAsD,EACnE,IAAA,mEAAsC,EAAC,IAAI,CAAC,CAC7C,EACD,WAAW,CACZ,CAAC,CACF,KAAK,CAAC,CAAC,KAAK,CAAC,CAEb;QAAA,CAAC,gBAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACvC,WAAW,CAAC,CAAC,CAAC,CACZ,CAAC,SAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,QAAQ,CACnC;cAAA,CAAC,KAAK,CACR;YAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,CACF,CAAC,eAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,eAAK,CAAC,QAAQ,CAAC,CACrD,CACF,CACH;MAAA,EAAE,SAAG,CACP;IAAA,EAAE,+CAAwB,CAAC,QAAQ,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,gBAAgB,oBAiD3B;AAEF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n FilterButtonGroupContext,\n FilterButtonVariant,\n mergeTwClassName,\n} from '@metamask-previews/design-system-shared';\nimport React, { Children, useMemo } from 'react';\n\nimport { Box } from '../Box';\n\nimport { getSegmentedControlBorderRadiusTwClass } from './SegmentedControl.constants';\nimport type { SegmentedControlProps } from './SegmentedControl.types';\n\nexport const SegmentedControl = ({\n value,\n onChange,\n size = ButtonBaseSize.Sm,\n isFullWidth = false,\n children,\n twClassName,\n style,\n ...rest\n}: SegmentedControlProps) => {\n const contextValue = useMemo(\n () => ({\n value,\n onChange,\n variant: FilterButtonVariant.Secondary,\n size,\n isEqualWidth: isFullWidth,\n }),\n [value, onChange, size, isFullWidth],\n );\n\n const widthClass = isFullWidth ? 'self-stretch' : 'self-start';\n\n return (\n <FilterButtonGroupContext.Provider value={contextValue}>\n <Box\n {...rest}\n accessibilityRole=\"tablist\"\n twClassName={mergeTwClassName(\n mergeTwClassName(\n `${widthClass} flex-row items-center gap-1 border border-muted p-1`,\n getSegmentedControlBorderRadiusTwClass(size),\n ),\n twClassName,\n )}\n style={style}\n >\n {Children.map(children, (child, index) =>\n isFullWidth ? (\n <Box key={index} twClassName=\"flex-1\">\n {child}\n </Box>\n ) : (\n <React.Fragment key={index}>{child}</React.Fragment>\n ),\n )}\n </Box>\n </FilterButtonGroupContext.Provider>\n );\n};\n\nSegmentedControl.displayName = 'SegmentedControl';\n"]}
1
+ {"version":3,"file":"SegmentedControl.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAKiD;AACjD,+CAAiD;AAEjD,0CAA6B;AAE7B,iFAAsF;AAG/E,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,2CAAoB,CAAC,EAAE,EAC9B,WAAW,GAAG,KAAK,EACnB,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACe,EAAE,EAAE;IAC1B,MAAM,YAAY,GAAG,IAAA,eAAO,EAC1B,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,QAAQ;QACR,OAAO,EAAE,0CAAmB,CAAC,SAAS;QACtC,IAAI;QACJ,YAAY,EAAE,WAAW;KAC1B,CAAC,EACF,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CACrC,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;IAE/D,OAAO,CACL,CAAC,+CAAwB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACrD;MAAA,CAAC,SAAG,CACF,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,SAAS,CAC3B,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAC3B,IAAA,uCAAgB,EACd,GAAG,UAAU,sDAAsD,EACnE,IAAA,mEAAsC,EAAC,IAAI,CAAC,CAC7C,EACD,WAAW,CACZ,CAAC,CACF,KAAK,CAAC,CAAC,KAAK,CAAC,CAEb;QAAA,CAAC,gBAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACvC,WAAW,CAAC,CAAC,CAAC,CACZ,CAAC,SAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,QAAQ,CACnC;cAAA,CAAC,KAAK,CACR;YAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,CACF,CAAC,eAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,eAAK,CAAC,QAAQ,CAAC,CACrD,CACF,CACH;MAAA,EAAE,SAAG,CACP;IAAA,EAAE,+CAAwB,CAAC,QAAQ,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,gBAAgB,oBAiD3B;AAEF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["import {\n FilterButtonGroupContext,\n FilterButtonVariant,\n SegmentedControlSize,\n mergeTwClassName,\n} from '@metamask-previews/design-system-shared';\nimport React, { Children, useMemo } from 'react';\n\nimport { Box } from '../Box';\n\nimport { getSegmentedControlBorderRadiusTwClass } from './SegmentedControl.constants';\nimport type { SegmentedControlProps } from './SegmentedControl.types';\n\nexport const SegmentedControl = ({\n value,\n onChange,\n size = SegmentedControlSize.Sm,\n isFullWidth = false,\n children,\n twClassName,\n style,\n ...rest\n}: SegmentedControlProps) => {\n const contextValue = useMemo(\n () => ({\n value,\n onChange,\n variant: FilterButtonVariant.Secondary,\n size,\n isEqualWidth: isFullWidth,\n }),\n [value, onChange, size, isFullWidth],\n );\n\n const widthClass = isFullWidth ? 'self-stretch' : 'self-start';\n\n return (\n <FilterButtonGroupContext.Provider value={contextValue}>\n <Box\n {...rest}\n accessibilityRole=\"tablist\"\n twClassName={mergeTwClassName(\n mergeTwClassName(\n `${widthClass} flex-row items-center gap-1 border border-muted p-1`,\n getSegmentedControlBorderRadiusTwClass(size),\n ),\n twClassName,\n )}\n style={style}\n >\n {Children.map(children, (child, index) =>\n isFullWidth ? (\n <Box key={index} twClassName=\"flex-1\">\n {child}\n </Box>\n ) : (\n <React.Fragment key={index}>{child}</React.Fragment>\n ),\n )}\n </Box>\n </FilterButtonGroupContext.Provider>\n );\n};\n\nSegmentedControl.displayName = 'SegmentedControl';\n"]}
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSegmentedControlBorderRadiusTwClass = exports.TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS = void 0;
4
4
  const design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
5
  exports.TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS = {
6
- [design_system_shared_1.ButtonBaseSize.Sm]: 'rounded-xl',
7
- [design_system_shared_1.ButtonBaseSize.Md]: 'rounded-2xl',
8
- [design_system_shared_1.ButtonBaseSize.Lg]: 'rounded-2xl',
6
+ [design_system_shared_1.SegmentedControlSize.Sm]: 'rounded-xl',
7
+ [design_system_shared_1.SegmentedControlSize.Md]: 'rounded-2xl',
8
+ [design_system_shared_1.SegmentedControlSize.Lg]: 'rounded-2xl',
9
9
  };
10
10
  const getSegmentedControlBorderRadiusTwClass = (size) => exports.TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];
11
11
  exports.getSegmentedControlBorderRadiusTwClass = getSegmentedControlBorderRadiusTwClass;
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.constants.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":";;;AAAA,kFAAyE;AAE5D,QAAA,yCAAyC,GAGlD;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,YAAY;IACjC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,aAAa;IAClC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,aAAa;CACnC,CAAC;AAEK,MAAM,sCAAsC,GAAG,CACpD,IAAoB,EACZ,EAAE,CAAC,iDAAyC,CAAC,IAAI,CAAC,CAAC;AAFhD,QAAA,sCAAsC,0CAEU","sourcesContent":["import { ButtonBaseSize } from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<\n ButtonBaseSize,\n string\n> = {\n [ButtonBaseSize.Sm]: 'rounded-xl',\n [ButtonBaseSize.Md]: 'rounded-2xl',\n [ButtonBaseSize.Lg]: 'rounded-2xl',\n};\n\nexport const getSegmentedControlBorderRadiusTwClass = (\n size: ButtonBaseSize,\n): string => TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];\n"]}
1
+ {"version":3,"file":"SegmentedControl.constants.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":";;;AAAA,kFAA+E;AAElE,QAAA,yCAAyC,GAGlD;IACF,CAAC,2CAAoB,CAAC,EAAE,CAAC,EAAE,YAAY;IACvC,CAAC,2CAAoB,CAAC,EAAE,CAAC,EAAE,aAAa;IACxC,CAAC,2CAAoB,CAAC,EAAE,CAAC,EAAE,aAAa;CACzC,CAAC;AAEK,MAAM,sCAAsC,GAAG,CACpD,IAA0B,EAClB,EAAE,CAAC,iDAAyC,CAAC,IAAI,CAAC,CAAC;AAFhD,QAAA,sCAAsC,0CAEU","sourcesContent":["import { SegmentedControlSize } from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<\n SegmentedControlSize,\n string\n> = {\n [SegmentedControlSize.Sm]: 'rounded-xl',\n [SegmentedControlSize.Md]: 'rounded-2xl',\n [SegmentedControlSize.Lg]: 'rounded-2xl',\n};\n\nexport const getSegmentedControlBorderRadiusTwClass = (\n size: SegmentedControlSize,\n): string => TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];\n"]}
@@ -1,4 +1,4 @@
1
- import { ButtonBaseSize } from "@metamask-previews/design-system-shared";
2
- export declare const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<ButtonBaseSize, string>;
3
- export declare const getSegmentedControlBorderRadiusTwClass: (size: ButtonBaseSize) => string;
1
+ import { SegmentedControlSize } from "@metamask-previews/design-system-shared";
2
+ export declare const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<SegmentedControlSize, string>;
3
+ export declare const getSegmentedControlBorderRadiusTwClass: (size: SegmentedControlSize) => string;
4
4
  //# sourceMappingURL=SegmentedControl.constants.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.constants.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AAEzE,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAC5D,cAAc,EACd,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,sCAAsC,SAC3C,cAAc,KACnB,MAAyD,CAAC"}
1
+ {"version":3,"file":"SegmentedControl.constants.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAE/E,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAC5D,oBAAoB,EACpB,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,sCAAsC,SAC3C,oBAAoB,KACzB,MAAyD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ButtonBaseSize } from "@metamask-previews/design-system-shared";
2
- export declare const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<ButtonBaseSize, string>;
3
- export declare const getSegmentedControlBorderRadiusTwClass: (size: ButtonBaseSize) => string;
1
+ import { SegmentedControlSize } from "@metamask-previews/design-system-shared";
2
+ export declare const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<SegmentedControlSize, string>;
3
+ export declare const getSegmentedControlBorderRadiusTwClass: (size: SegmentedControlSize) => string;
4
4
  //# sourceMappingURL=SegmentedControl.constants.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.constants.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AAEzE,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAC5D,cAAc,EACd,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,sCAAsC,SAC3C,cAAc,KACnB,MAAyD,CAAC"}
1
+ {"version":3,"file":"SegmentedControl.constants.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAE/E,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAC5D,oBAAoB,EACpB,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,sCAAsC,SAC3C,oBAAoB,KACzB,MAAyD,CAAC"}
@@ -1,8 +1,8 @@
1
- import { ButtonBaseSize } from "@metamask-previews/design-system-shared";
1
+ import { SegmentedControlSize } from "@metamask-previews/design-system-shared";
2
2
  export const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS = {
3
- [ButtonBaseSize.Sm]: 'rounded-xl',
4
- [ButtonBaseSize.Md]: 'rounded-2xl',
5
- [ButtonBaseSize.Lg]: 'rounded-2xl',
3
+ [SegmentedControlSize.Sm]: 'rounded-xl',
4
+ [SegmentedControlSize.Md]: 'rounded-2xl',
5
+ [SegmentedControlSize.Lg]: 'rounded-2xl',
6
6
  };
7
7
  export const getSegmentedControlBorderRadiusTwClass = (size) => TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];
8
8
  //# sourceMappingURL=SegmentedControl.constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.constants.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AAEzE,MAAM,CAAC,MAAM,yCAAyC,GAGlD;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,YAAY;IACjC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,aAAa;IAClC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,aAAa;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,CACpD,IAAoB,EACZ,EAAE,CAAC,yCAAyC,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { ButtonBaseSize } from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<\n ButtonBaseSize,\n string\n> = {\n [ButtonBaseSize.Sm]: 'rounded-xl',\n [ButtonBaseSize.Md]: 'rounded-2xl',\n [ButtonBaseSize.Lg]: 'rounded-2xl',\n};\n\nexport const getSegmentedControlBorderRadiusTwClass = (\n size: ButtonBaseSize,\n): string => TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];\n"]}
1
+ {"version":3,"file":"SegmentedControl.constants.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAE/E,MAAM,CAAC,MAAM,yCAAyC,GAGlD;IACF,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,YAAY;IACvC,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,aAAa;IACxC,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,aAAa;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,CACpD,IAA0B,EAClB,EAAE,CAAC,yCAAyC,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { SegmentedControlSize } from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<\n SegmentedControlSize,\n string\n> = {\n [SegmentedControlSize.Sm]: 'rounded-xl',\n [SegmentedControlSize.Md]: 'rounded-2xl',\n [SegmentedControlSize.Lg]: 'rounded-2xl',\n};\n\nexport const getSegmentedControlBorderRadiusTwClass = (\n size: SegmentedControlSize,\n): string => TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];\n"]}
@@ -4,12 +4,12 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { ButtonBaseSize, FilterButtonGroupContext, FilterButtonVariant, mergeTwClassName } from "@metamask-previews/design-system-shared";
7
+ import { FilterButtonGroupContext, FilterButtonVariant, SegmentedControlSize, mergeTwClassName } from "@metamask-previews/design-system-shared";
8
8
  import $React, { Children, useMemo } from "react";
9
9
  const React = $importDefault($React);
10
10
  import { Box } from "../Box/index.mjs";
11
11
  import { getSegmentedControlBorderRadiusTwClass } from "./SegmentedControl.constants.mjs";
12
- export const SegmentedControl = ({ value, onChange, size = ButtonBaseSize.Sm, isFullWidth = false, children, twClassName, style, ...rest }) => {
12
+ export const SegmentedControl = ({ value, onChange, size = SegmentedControlSize.Sm, isFullWidth = false, children, twClassName, style, ...rest }) => {
13
13
  const contextValue = useMemo(() => ({
14
14
  value,
15
15
  onChange,
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.mjs","sourceRoot":"","sources":["../../../src/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,CAAC,CACZ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,QAAQ,CACnC;cAAA,CAAC,KAAK,CACR;YAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,CACF,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CACrD,CACF,CACH;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n FilterButtonGroupContext,\n FilterButtonVariant,\n mergeTwClassName,\n} from '@metamask-previews/design-system-shared';\nimport React, { Children, useMemo } from 'react';\n\nimport { Box } from '../Box';\n\nimport { getSegmentedControlBorderRadiusTwClass } from './SegmentedControl.constants';\nimport type { SegmentedControlProps } from './SegmentedControl.types';\n\nexport const SegmentedControl = ({\n value,\n onChange,\n size = ButtonBaseSize.Sm,\n isFullWidth = false,\n children,\n twClassName,\n style,\n ...rest\n}: SegmentedControlProps) => {\n const contextValue = useMemo(\n () => ({\n value,\n onChange,\n variant: FilterButtonVariant.Secondary,\n size,\n isEqualWidth: isFullWidth,\n }),\n [value, onChange, size, isFullWidth],\n );\n\n const widthClass = isFullWidth ? 'self-stretch' : 'self-start';\n\n return (\n <FilterButtonGroupContext.Provider value={contextValue}>\n <Box\n {...rest}\n accessibilityRole=\"tablist\"\n twClassName={mergeTwClassName(\n mergeTwClassName(\n `${widthClass} flex-row items-center gap-1 border border-muted p-1`,\n getSegmentedControlBorderRadiusTwClass(size),\n ),\n twClassName,\n )}\n style={style}\n >\n {Children.map(children, (child, index) =>\n isFullWidth ? (\n <Box key={index} twClassName=\"flex-1\">\n {child}\n </Box>\n ) : (\n <React.Fragment key={index}>{child}</React.Fragment>\n ),\n )}\n </Box>\n </FilterButtonGroupContext.Provider>\n );\n};\n\nSegmentedControl.displayName = 'SegmentedControl';\n"]}
1
+ {"version":3,"file":"SegmentedControl.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EACjB,gDAAgD;AACjD,OAAO,QAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;;AAEjD,OAAO,EAAE,GAAG,EAAE,yBAAe;AAE7B,OAAO,EAAE,sCAAsC,EAAE,yCAAqC;AAGtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,oBAAoB,CAAC,EAAE,EAC9B,WAAW,GAAG,KAAK,EACnB,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACe,EAAE,EAAE;IAC1B,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,QAAQ;QACR,OAAO,EAAE,mBAAmB,CAAC,SAAS;QACtC,IAAI;QACJ,YAAY,EAAE,WAAW;KAC1B,CAAC,EACF,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CACrC,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;IAE/D,OAAO,CACL,CAAC,wBAAwB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACrD;MAAA,CAAC,GAAG,CACF,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,SAAS,CAC3B,WAAW,CAAC,CAAC,gBAAgB,CAC3B,gBAAgB,CACd,GAAG,UAAU,sDAAsD,EACnE,sCAAsC,CAAC,IAAI,CAAC,CAC7C,EACD,WAAW,CACZ,CAAC,CACF,KAAK,CAAC,CAAC,KAAK,CAAC,CAEb;QAAA,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACvC,WAAW,CAAC,CAAC,CAAC,CACZ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,QAAQ,CACnC;cAAA,CAAC,KAAK,CACR;YAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,CACF,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CACrD,CACF,CACH;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["import {\n FilterButtonGroupContext,\n FilterButtonVariant,\n SegmentedControlSize,\n mergeTwClassName,\n} from '@metamask-previews/design-system-shared';\nimport React, { Children, useMemo } from 'react';\n\nimport { Box } from '../Box';\n\nimport { getSegmentedControlBorderRadiusTwClass } from './SegmentedControl.constants';\nimport type { SegmentedControlProps } from './SegmentedControl.types';\n\nexport const SegmentedControl = ({\n value,\n onChange,\n size = SegmentedControlSize.Sm,\n isFullWidth = false,\n children,\n twClassName,\n style,\n ...rest\n}: SegmentedControlProps) => {\n const contextValue = useMemo(\n () => ({\n value,\n onChange,\n variant: FilterButtonVariant.Secondary,\n size,\n isEqualWidth: isFullWidth,\n }),\n [value, onChange, size, isFullWidth],\n );\n\n const widthClass = isFullWidth ? 'self-stretch' : 'self-start';\n\n return (\n <FilterButtonGroupContext.Provider value={contextValue}>\n <Box\n {...rest}\n accessibilityRole=\"tablist\"\n twClassName={mergeTwClassName(\n mergeTwClassName(\n `${widthClass} flex-row items-center gap-1 border border-muted p-1`,\n getSegmentedControlBorderRadiusTwClass(size),\n ),\n twClassName,\n )}\n style={style}\n >\n {Children.map(children, (child, index) =>\n isFullWidth ? (\n <Box key={index} twClassName=\"flex-1\">\n {child}\n </Box>\n ) : (\n <React.Fragment key={index}>{child}</React.Fragment>\n ),\n )}\n </Box>\n </FilterButtonGroupContext.Provider>\n );\n};\n\nSegmentedControl.displayName = 'SegmentedControl';\n"]}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SegmentedControl = void 0;
3
+ exports.SegmentedControl = exports.SegmentedControlSize = void 0;
4
+ var design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
+ Object.defineProperty(exports, "SegmentedControlSize", { enumerable: true, get: function () { return design_system_shared_1.SegmentedControlSize; } });
4
6
  var SegmentedControl_1 = require("./SegmentedControl.cjs");
5
7
  Object.defineProperty(exports, "SegmentedControl", { enumerable: true, get: function () { return SegmentedControl_1.SegmentedControl; } });
6
8
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAA7C,oHAAA,gBAAgB,OAAA","sourcesContent":["export { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":";;;AAAA,gFAA+E;AAAtE,4HAAA,oBAAoB,OAAA;AAC7B,2DAAsD;AAA7C,oHAAA,gBAAgB,OAAA","sourcesContent":["export { SegmentedControlSize } from '@metamask-previews/design-system-shared';\nexport { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
@@ -1,3 +1,4 @@
1
+ export { SegmentedControlSize } from "@metamask-previews/design-system-shared";
1
2
  export { SegmentedControl } from "./SegmentedControl.cjs";
2
3
  export type { SegmentedControlProps } from "./SegmentedControl.types.cjs";
3
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
@@ -1,3 +1,4 @@
1
+ export { SegmentedControlSize } from "@metamask-previews/design-system-shared";
1
2
  export { SegmentedControl } from "./SegmentedControl.mjs";
2
3
  export type { SegmentedControlProps } from "./SegmentedControl.types.mjs";
3
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
@@ -1,2 +1,3 @@
1
+ export { SegmentedControlSize } from "@metamask-previews/design-system-shared";
1
2
  export { SegmentedControl } from "./SegmentedControl.mjs";
2
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,+BAA2B","sourcesContent":["export { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,gBAAgB,EAAE,+BAA2B","sourcesContent":["export { SegmentedControlSize } from '@metamask-previews/design-system-shared';\nexport { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
@@ -1,13 +1,25 @@
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-previews/design-system-shared");
6
6
  const Toast_types_1 = require("./Toast.types.cjs");
7
7
  var design_system_shared_2 = require("@metamask-previews/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.
13
+ *
14
+ * UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,
15
+ * initialSpringVelocity: 1)`
16
+ *
17
+ * SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.
18
+ */
19
+ exports.TOAST_SPRING_CONFIG = {
20
+ dampingRatio: 0.85,
21
+ duration: 500,
22
+ };
11
23
  exports.TOAST_SEVERITY_ICON_MAP = {
12
24
  [Toast_types_1.ToastSeverity.Success]: design_system_shared_1.IconAlertSeverity.Success,
13
25
  [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,kFAA4E;AAE5E,mDAA8C;AAE9C,gFAGiD;AAF/C,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-previews/design-system-shared';\n\nimport { ToastSeverity } from './Toast.types';\n\nexport {\n TOAST_ANIMATION_DURATION,\n TOAST_VISIBILITY_DURATION,\n} from '@metamask-previews/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,kFAA4E;AAG5E,mDAA8C;AAE9C,gFAGiD;AAF/C,gIAAA,wBAAwB,OAAA;AACxB,iIAAA,yBAAyB,OAAA;AAGd,QAAA,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;;;;;;GAOG;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-previews/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-previews/design-system-shared';\n\nexport const TOAST_TOP_PADDING = 8;\n\n/**\n * Spring tuned to approximate iOS system banner motion.\n *\n * UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,\n * initialSpringVelocity: 1)`\n *\n * SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.\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,15 @@
1
+ import type { WithSpringConfig } from "react-native-reanimated";
1
2
  export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION, } from "@metamask-previews/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.
6
+ *
7
+ * UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,
8
+ * initialSpringVelocity: 1)`
9
+ *
10
+ * SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.
11
+ */
12
+ export declare const TOAST_SPRING_CONFIG: WithSpringConfig;
3
13
  export declare const TOAST_SEVERITY_ICON_MAP: {
4
14
  readonly success: "success";
5
15
  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,gDAAgD;AAEjD,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,gDAAgD;AAEjD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAGjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
@@ -1,5 +1,15 @@
1
+ import type { WithSpringConfig } from "react-native-reanimated";
1
2
  export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION, } from "@metamask-previews/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.
6
+ *
7
+ * UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,
8
+ * initialSpringVelocity: 1)`
9
+ *
10
+ * SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.
11
+ */
12
+ export declare const TOAST_SPRING_CONFIG: WithSpringConfig;
3
13
  export declare const TOAST_SEVERITY_ICON_MAP: {
4
14
  readonly success: "success";
5
15
  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,gDAAgD;AAEjD,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,gDAAgD;AAEjD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAGjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
@@ -2,7 +2,19 @@
2
2
  import { IconAlertSeverity } from "@metamask-previews/design-system-shared";
3
3
  import { ToastSeverity } from "./Toast.types.mjs";
4
4
  export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION } from "@metamask-previews/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.
8
+ *
9
+ * UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,
10
+ * initialSpringVelocity: 1)`
11
+ *
12
+ * SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.
13
+ */
14
+ export const TOAST_SPRING_CONFIG = {
15
+ dampingRatio: 0.85,
16
+ duration: 500,
17
+ };
6
18
  export const TOAST_SEVERITY_ICON_MAP = {
7
19
  [ToastSeverity.Success]: IconAlertSeverity.Success,
8
20
  [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,gDAAgD;AAE5E,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAE9C,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EAC1B,gDAAgD;AAEjD,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-previews/design-system-shared';\n\nimport { ToastSeverity } from './Toast.types';\n\nexport {\n TOAST_ANIMATION_DURATION,\n TOAST_VISIBILITY_DURATION,\n} from '@metamask-previews/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,gDAAgD;AAG5E,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAE9C,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EAC1B,gDAAgD;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;;;;;;GAOG;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-previews/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-previews/design-system-shared';\n\nexport const TOAST_TOP_PADDING = 8;\n\n/**\n * Spring tuned to approximate iOS system banner motion.\n *\n * UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,\n * initialSpringVelocity: 1)`\n *\n * SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.\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.types.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":";;;AACA,kFAAwE;AAM/D,8FANA,oCAAa,OAMA","sourcesContent":["import type { ToastPropsShared } from '@metamask-previews/design-system-shared';\nimport { ToastSeverity } from '@metamask-previews/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,kFAAwE;AAM/D,8FANA,oCAAa,OAMA","sourcesContent":["import type { ToastPropsShared } from '@metamask-previews/design-system-shared';\nimport { ToastSeverity } from '@metamask-previews/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,gDAAgD;AAChF,OAAO,EAAE,aAAa,EAAE,gDAAgD;AACxE,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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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,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"}
@@ -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,gDAAgD;AAChF,OAAO,EAAE,aAAa,EAAE,gDAAgD;AACxE,OAAO,KAAK,EAAE,SAAS,EAA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AAMxE,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import type { ToastPropsShared } from '@metamask-previews/design-system-shared';\nimport { ToastSeverity } from '@metamask-previews/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,gDAAgD;AAMxE,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import type { ToastPropsShared } from '@metamask-previews/design-system-shared';\nimport { ToastSeverity } from '@metamask-previews/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"]}