@metamask/design-system-react-native 0.30.1 → 0.31.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 (126) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/dist/components/BannerAlert/BannerAlert.cjs +2 -5
  3. package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -1
  4. package/dist/components/BannerAlert/BannerAlert.constants.cjs +4 -7
  5. package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
  6. package/dist/components/BannerAlert/BannerAlert.constants.d.cts +1 -2
  7. package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
  8. package/dist/components/BannerAlert/BannerAlert.constants.d.mts +1 -2
  9. package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
  10. package/dist/components/BannerAlert/BannerAlert.constants.mjs +4 -7
  11. package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
  12. package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
  13. package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
  14. package/dist/components/BannerAlert/BannerAlert.mjs +3 -6
  15. package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -1
  16. package/dist/components/BannerBase/BannerBase.cjs +5 -8
  17. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  18. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  19. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  20. package/dist/components/BannerBase/BannerBase.mjs +6 -9
  21. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  22. package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs +1 -1
  23. package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -1
  24. package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs +1 -1
  25. package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -1
  26. package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +1 -1
  27. package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -1
  28. package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +1 -1
  29. package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -1
  30. package/dist/components/ButtonIcon/ButtonIcon.constants.cjs +2 -0
  31. package/dist/components/ButtonIcon/ButtonIcon.constants.cjs.map +1 -1
  32. package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts +1 -0
  33. package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts.map +1 -1
  34. package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts +1 -0
  35. package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts.map +1 -1
  36. package/dist/components/ButtonIcon/ButtonIcon.constants.mjs +2 -0
  37. package/dist/components/ButtonIcon/ButtonIcon.constants.mjs.map +1 -1
  38. package/dist/components/ButtonSemantic/index.cjs +3 -1
  39. package/dist/components/ButtonSemantic/index.cjs.map +1 -1
  40. package/dist/components/ButtonSemantic/index.d.cts +1 -0
  41. package/dist/components/ButtonSemantic/index.d.cts.map +1 -1
  42. package/dist/components/ButtonSemantic/index.d.mts +1 -0
  43. package/dist/components/ButtonSemantic/index.d.mts.map +1 -1
  44. package/dist/components/ButtonSemantic/index.mjs +1 -0
  45. package/dist/components/ButtonSemantic/index.mjs.map +1 -1
  46. package/dist/components/Content/Content.cjs +2 -2
  47. package/dist/components/Content/Content.cjs.map +1 -1
  48. package/dist/components/Content/Content.d.cts.map +1 -1
  49. package/dist/components/Content/Content.d.mts.map +1 -1
  50. package/dist/components/Content/Content.mjs +3 -3
  51. package/dist/components/Content/Content.mjs.map +1 -1
  52. package/dist/components/FilterButton/FilterButton.cjs +1 -1
  53. package/dist/components/FilterButton/FilterButton.cjs.map +1 -1
  54. package/dist/components/FilterButton/FilterButton.mjs +2 -2
  55. package/dist/components/FilterButton/FilterButton.mjs.map +1 -1
  56. package/dist/components/FilterButton/index.cjs +2 -1
  57. package/dist/components/FilterButton/index.cjs.map +1 -1
  58. package/dist/components/FilterButton/index.d.cts +1 -1
  59. package/dist/components/FilterButton/index.d.cts.map +1 -1
  60. package/dist/components/FilterButton/index.d.mts +1 -1
  61. package/dist/components/FilterButton/index.d.mts.map +1 -1
  62. package/dist/components/FilterButton/index.mjs +1 -1
  63. package/dist/components/FilterButton/index.mjs.map +1 -1
  64. package/dist/components/MainActionButton/MainActionButton.cjs +1 -1
  65. package/dist/components/MainActionButton/MainActionButton.cjs.map +1 -1
  66. package/dist/components/MainActionButton/MainActionButton.mjs +1 -1
  67. package/dist/components/MainActionButton/MainActionButton.mjs.map +1 -1
  68. package/dist/components/SectionHeader/SectionHeader.cjs +28 -10
  69. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
  70. package/dist/components/SectionHeader/SectionHeader.d.cts +3 -2
  71. package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
  72. package/dist/components/SectionHeader/SectionHeader.d.mts +3 -2
  73. package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
  74. package/dist/components/SectionHeader/SectionHeader.mjs +28 -10
  75. package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
  76. package/dist/components/SegmentedControl/SegmentedControl.cjs +1 -1
  77. package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  78. package/dist/components/SegmentedControl/SegmentedControl.constants.cjs +3 -3
  79. package/dist/components/SegmentedControl/SegmentedControl.constants.cjs.map +1 -1
  80. package/dist/components/SegmentedControl/SegmentedControl.constants.d.cts +3 -3
  81. package/dist/components/SegmentedControl/SegmentedControl.constants.d.cts.map +1 -1
  82. package/dist/components/SegmentedControl/SegmentedControl.constants.d.mts +3 -3
  83. package/dist/components/SegmentedControl/SegmentedControl.constants.d.mts.map +1 -1
  84. package/dist/components/SegmentedControl/SegmentedControl.constants.mjs +4 -4
  85. package/dist/components/SegmentedControl/SegmentedControl.constants.mjs.map +1 -1
  86. package/dist/components/SegmentedControl/SegmentedControl.mjs +2 -2
  87. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  88. package/dist/components/SegmentedControl/index.cjs +3 -1
  89. package/dist/components/SegmentedControl/index.cjs.map +1 -1
  90. package/dist/components/SegmentedControl/index.d.cts +1 -0
  91. package/dist/components/SegmentedControl/index.d.cts.map +1 -1
  92. package/dist/components/SegmentedControl/index.d.mts +1 -0
  93. package/dist/components/SegmentedControl/index.d.mts.map +1 -1
  94. package/dist/components/SegmentedControl/index.mjs +1 -0
  95. package/dist/components/SegmentedControl/index.mjs.map +1 -1
  96. package/dist/components/Tag/Tag.constants.cjs +2 -2
  97. package/dist/components/Tag/Tag.constants.cjs.map +1 -1
  98. package/dist/components/Tag/Tag.constants.mjs +2 -2
  99. package/dist/components/Tag/Tag.constants.mjs.map +1 -1
  100. package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
  101. package/dist/components/TextButton/TextButton.types.d.cts +5 -2
  102. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  103. package/dist/components/TextButton/TextButton.types.d.mts +5 -2
  104. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  105. package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
  106. package/dist/components/TitleAlert/TitleAlert.cjs +3 -5
  107. package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -1
  108. package/dist/components/TitleAlert/TitleAlert.d.cts +1 -3
  109. package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -1
  110. package/dist/components/TitleAlert/TitleAlert.d.mts +1 -3
  111. package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -1
  112. package/dist/components/TitleAlert/TitleAlert.mjs +3 -5
  113. package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -1
  114. package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -1
  115. package/dist/components/TitleAlert/TitleAlert.types.d.cts +2 -2
  116. package/dist/components/TitleAlert/TitleAlert.types.d.mts +2 -2
  117. package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -1
  118. package/dist/components/index.cjs +5 -2
  119. package/dist/components/index.cjs.map +1 -1
  120. package/dist/components/index.d.cts +3 -3
  121. package/dist/components/index.d.cts.map +1 -1
  122. package/dist/components/index.d.mts +3 -3
  123. package/dist/components/index.d.mts.map +1 -1
  124. package/dist/components/index.mjs +3 -3
  125. package/dist/components/index.mjs.map +1 -1
  126. package/package.json +7 -7
@@ -7,14 +7,15 @@ import type { SectionHeaderProps } from "./SectionHeader.types.cjs";
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
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
11
12
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
12
13
  * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
13
14
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
14
15
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
15
16
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
16
17
  * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved
17
- * @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
18
19
  * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`
19
20
  * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press
20
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.cts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2GtD,CAAC"}
1
+ {"version":3,"file":"SectionHeader.d.cts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuJtD,CAAC"}
@@ -7,14 +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
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
11
12
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
12
13
  * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
13
14
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
14
15
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
15
16
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
16
17
  * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved
17
- * @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
18
19
  * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`
19
20
  * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press
20
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;AAM1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2GtD,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"}
@@ -9,6 +9,7 @@ import { useTailwind } from "@metamask/design-system-twrnc-preset";
9
9
  import $React from "react";
10
10
  const React = $importDefault($React);
11
11
  import { Pressable } from "react-native";
12
+ import { Box } from "../Box/index.mjs";
12
13
  import { BoxRow } from "../BoxRow/index.mjs";
13
14
  import { Icon } from "../Icon/index.mjs";
14
15
  /**
@@ -18,14 +19,15 @@ import { Icon } from "../Icon/index.mjs";
18
19
  *
19
20
  * @param sectionHeaderProps - Component props
20
21
  * @param sectionHeaderProps.title - Title content for the inner row (required)
21
- * @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row
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
22
24
  * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
23
25
  * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
24
26
  * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
25
27
  * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
26
28
  * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
27
29
  * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved
28
- * @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
29
31
  * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`
30
32
  * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press
31
33
  * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)
@@ -34,19 +36,31 @@ import { Icon } from "../Icon/index.mjs";
34
36
  * @returns The rendered SectionHeader layout.
35
37
  */
36
38
  export const SectionHeader = (sectionHeaderProps) => {
37
- const { title, titleAccessory, titleProps, titleWrapperProps, startAccessory, startIconName, startIconProps, endAccessory, endIconName, endIconProps, isInteractive, twClassName = '', style, ...props } = sectionHeaderProps;
39
+ const { title, children, titleAccessory, titleProps, titleWrapperProps, startAccessory, startIconName, startIconProps, endAccessory, endIconName, endIconProps, isInteractive, twClassName = '', style, ...props } = sectionHeaderProps;
38
40
  const tw = useTailwind();
39
41
  const resolvedEndIconName = endIconName ??
40
42
  (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);
41
- const resolvedStartAccessory = startIconName ? (<Icon size={IconSize.Md} color={IconColor.IconDefault} twClassName="shrink-0" {...startIconProps} name={startIconName}/>) : (startAccessory);
42
- const resolvedEndAccessory = resolvedEndIconName ? (<Icon size={IconSize.Md} color={IconColor.IconAlternative} twClassName="shrink-0" {...endIconProps} name={resolvedEndIconName}/>) : (endAccessory);
43
- 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={{
44
47
  variant: TextVariant.HeadingMd,
45
48
  color: TextColor.TextDefault,
46
49
  ...titleProps,
47
50
  }}>
48
51
  {title}
49
52
  </BoxRow>) : 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);
50
64
  if (isInteractive) {
51
65
  const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;
52
66
  const isDisabled = Boolean(disabled);
@@ -55,13 +69,17 @@ export const SectionHeader = (sectionHeaderProps) => {
55
69
  const additionalStyle = typeof style === 'function' ? style({ pressed }) : style;
56
70
  return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;
57
71
  }} {...props}>
58
- <BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
59
- {titleRow}
60
- </BoxRow>
72
+ {body}
61
73
  </Pressable>);
62
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
+ }
63
81
  return (<BoxRow {...props} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
64
- {titleRow}
82
+ {mainContent}
65
83
  </BoxRow>);
66
84
  };
67
85
  SectionHeader.displayName = 'SectionHeader';
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\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.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 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 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 {titleRow}\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 {titleRow}\n </BoxRow>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
1
+ {"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/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/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,yEAKwC;AACxC,+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/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,yEAKwC;AACxC,+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/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/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,yEAAgE;AAEnD,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/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,yEAAsE;AAEzD,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/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/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/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,uCAAuC;AAEhE,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,uCAAuC;AAEtE,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/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/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,uCAAuC;AAEhE,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,uCAAuC;AAEtE,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/design-system-shared";
1
+ import { SegmentedControlSize } from "@metamask/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,uCAAuC;AAEhE,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/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,uCAAuC;AAEtE,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/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/design-system-shared";
7
+ import { FilterButtonGroupContext, FilterButtonVariant, SegmentedControlSize, mergeTwClassName } from "@metamask/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/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EACjB,uCAAuC;AACxC,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,cAAc,CAAC,EAAE,EACxB,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 ButtonBaseSize,\n FilterButtonGroupContext,\n FilterButtonVariant,\n mergeTwClassName,\n} from '@metamask/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,uCAAuC;AACxC,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/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/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,uEAAsE;AAA7D,4HAAA,oBAAoB,OAAA;AAC7B,2DAAsD;AAA7C,oHAAA,gBAAgB,OAAA","sourcesContent":["export { SegmentedControlSize } from '@metamask/design-system-shared';\nexport { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
@@ -1,3 +1,4 @@
1
+ export { SegmentedControlSize } from "@metamask/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,uCAAuC;AACtE,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
@@ -1,3 +1,4 @@
1
+ export { SegmentedControlSize } from "@metamask/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,uCAAuC;AACtE,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
@@ -1,2 +1,3 @@
1
+ export { SegmentedControlSize } from "@metamask/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,uCAAuC;AACtE,OAAO,EAAE,gBAAgB,EAAE,+BAA2B","sourcesContent":["export { SegmentedControlSize } from '@metamask/design-system-shared';\nexport { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
@@ -10,14 +10,14 @@ exports.MAP_TAG_SEVERITY_BACKGROUND = {
10
10
  [design_system_shared_1.TagSeverity.Info]: design_system_shared_1.BoxBackgroundColor.InfoMuted,
11
11
  };
12
12
  exports.MAP_TAG_SEVERITY_TEXT_COLOR = {
13
- [design_system_shared_1.TagSeverity.Neutral]: design_system_shared_1.TextColor.TextDefault,
13
+ [design_system_shared_1.TagSeverity.Neutral]: design_system_shared_1.TextColor.TextAlternative,
14
14
  [design_system_shared_1.TagSeverity.Success]: design_system_shared_1.TextColor.SuccessDefault,
15
15
  [design_system_shared_1.TagSeverity.Danger]: design_system_shared_1.TextColor.ErrorDefault,
16
16
  [design_system_shared_1.TagSeverity.Warning]: design_system_shared_1.TextColor.WarningDefault,
17
17
  [design_system_shared_1.TagSeverity.Info]: design_system_shared_1.TextColor.InfoDefault,
18
18
  };
19
19
  exports.MAP_TAG_SEVERITY_ICON_COLOR = {
20
- [design_system_shared_1.TagSeverity.Neutral]: design_system_shared_1.IconColor.IconDefault,
20
+ [design_system_shared_1.TagSeverity.Neutral]: design_system_shared_1.IconColor.IconAlternative,
21
21
  [design_system_shared_1.TagSeverity.Success]: design_system_shared_1.IconColor.SuccessDefault,
22
22
  [design_system_shared_1.TagSeverity.Danger]: design_system_shared_1.IconColor.ErrorDefault,
23
23
  [design_system_shared_1.TagSeverity.Warning]: design_system_shared_1.IconColor.WarningDefault,
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.constants.cjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.constants.ts"],"names":[],"mappings":";;;AAAA,yEAKwC;AAE3B,QAAA,2BAA2B,GAGpC;IACF,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,yCAAkB,CAAC,eAAe;IACzD,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,yCAAkB,CAAC,YAAY;IACtD,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,yCAAkB,CAAC,UAAU;IACnD,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,yCAAkB,CAAC,YAAY;IACtD,CAAC,kCAAW,CAAC,IAAI,CAAC,EAAE,yCAAkB,CAAC,SAAS;CACjD,CAAC;AAEW,QAAA,2BAA2B,GAAmC;IACzE,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,WAAW;IAC5C,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IAC/C,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,gCAAS,CAAC,YAAY;IAC5C,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IAC/C,CAAC,kCAAW,CAAC,IAAI,CAAC,EAAE,gCAAS,CAAC,WAAW;CAC1C,CAAC;AAEW,QAAA,2BAA2B,GAAmC;IACzE,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,WAAW;IAC5C,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IAC/C,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,gCAAS,CAAC,YAAY;IAC5C,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IAC/C,CAAC,kCAAW,CAAC,IAAI,CAAC,EAAE,gCAAS,CAAC,WAAW;CAC1C,CAAC","sourcesContent":["import {\n BoxBackgroundColor,\n IconColor,\n TagSeverity,\n TextColor,\n} from '@metamask/design-system-shared';\n\nexport const MAP_TAG_SEVERITY_BACKGROUND: Record<\n TagSeverity,\n BoxBackgroundColor\n> = {\n [TagSeverity.Neutral]: BoxBackgroundColor.BackgroundMuted,\n [TagSeverity.Success]: BoxBackgroundColor.SuccessMuted,\n [TagSeverity.Danger]: BoxBackgroundColor.ErrorMuted,\n [TagSeverity.Warning]: BoxBackgroundColor.WarningMuted,\n [TagSeverity.Info]: BoxBackgroundColor.InfoMuted,\n};\n\nexport const MAP_TAG_SEVERITY_TEXT_COLOR: Record<TagSeverity, TextColor> = {\n [TagSeverity.Neutral]: TextColor.TextDefault,\n [TagSeverity.Success]: TextColor.SuccessDefault,\n [TagSeverity.Danger]: TextColor.ErrorDefault,\n [TagSeverity.Warning]: TextColor.WarningDefault,\n [TagSeverity.Info]: TextColor.InfoDefault,\n};\n\nexport const MAP_TAG_SEVERITY_ICON_COLOR: Record<TagSeverity, IconColor> = {\n [TagSeverity.Neutral]: IconColor.IconDefault,\n [TagSeverity.Success]: IconColor.SuccessDefault,\n [TagSeverity.Danger]: IconColor.ErrorDefault,\n [TagSeverity.Warning]: IconColor.WarningDefault,\n [TagSeverity.Info]: IconColor.InfoDefault,\n};\n"]}
1
+ {"version":3,"file":"Tag.constants.cjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.constants.ts"],"names":[],"mappings":";;;AAAA,yEAKwC;AAE3B,QAAA,2BAA2B,GAGpC;IACF,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,yCAAkB,CAAC,eAAe;IACzD,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,yCAAkB,CAAC,YAAY;IACtD,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,yCAAkB,CAAC,UAAU;IACnD,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,yCAAkB,CAAC,YAAY;IACtD,CAAC,kCAAW,CAAC,IAAI,CAAC,EAAE,yCAAkB,CAAC,SAAS;CACjD,CAAC;AAEW,QAAA,2BAA2B,GAAmC;IACzE,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,eAAe;IAChD,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IAC/C,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,gCAAS,CAAC,YAAY;IAC5C,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IAC/C,CAAC,kCAAW,CAAC,IAAI,CAAC,EAAE,gCAAS,CAAC,WAAW;CAC1C,CAAC;AAEW,QAAA,2BAA2B,GAAmC;IACzE,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,eAAe;IAChD,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IAC/C,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,gCAAS,CAAC,YAAY;IAC5C,CAAC,kCAAW,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IAC/C,CAAC,kCAAW,CAAC,IAAI,CAAC,EAAE,gCAAS,CAAC,WAAW;CAC1C,CAAC","sourcesContent":["import {\n BoxBackgroundColor,\n IconColor,\n TagSeverity,\n TextColor,\n} from '@metamask/design-system-shared';\n\nexport const MAP_TAG_SEVERITY_BACKGROUND: Record<\n TagSeverity,\n BoxBackgroundColor\n> = {\n [TagSeverity.Neutral]: BoxBackgroundColor.BackgroundMuted,\n [TagSeverity.Success]: BoxBackgroundColor.SuccessMuted,\n [TagSeverity.Danger]: BoxBackgroundColor.ErrorMuted,\n [TagSeverity.Warning]: BoxBackgroundColor.WarningMuted,\n [TagSeverity.Info]: BoxBackgroundColor.InfoMuted,\n};\n\nexport const MAP_TAG_SEVERITY_TEXT_COLOR: Record<TagSeverity, TextColor> = {\n [TagSeverity.Neutral]: TextColor.TextAlternative,\n [TagSeverity.Success]: TextColor.SuccessDefault,\n [TagSeverity.Danger]: TextColor.ErrorDefault,\n [TagSeverity.Warning]: TextColor.WarningDefault,\n [TagSeverity.Info]: TextColor.InfoDefault,\n};\n\nexport const MAP_TAG_SEVERITY_ICON_COLOR: Record<TagSeverity, IconColor> = {\n [TagSeverity.Neutral]: IconColor.IconAlternative,\n [TagSeverity.Success]: IconColor.SuccessDefault,\n [TagSeverity.Danger]: IconColor.ErrorDefault,\n [TagSeverity.Warning]: IconColor.WarningDefault,\n [TagSeverity.Info]: IconColor.InfoDefault,\n};\n"]}
@@ -7,14 +7,14 @@ export const MAP_TAG_SEVERITY_BACKGROUND = {
7
7
  [TagSeverity.Info]: BoxBackgroundColor.InfoMuted,
8
8
  };
9
9
  export const MAP_TAG_SEVERITY_TEXT_COLOR = {
10
- [TagSeverity.Neutral]: TextColor.TextDefault,
10
+ [TagSeverity.Neutral]: TextColor.TextAlternative,
11
11
  [TagSeverity.Success]: TextColor.SuccessDefault,
12
12
  [TagSeverity.Danger]: TextColor.ErrorDefault,
13
13
  [TagSeverity.Warning]: TextColor.WarningDefault,
14
14
  [TagSeverity.Info]: TextColor.InfoDefault,
15
15
  };
16
16
  export const MAP_TAG_SEVERITY_ICON_COLOR = {
17
- [TagSeverity.Neutral]: IconColor.IconDefault,
17
+ [TagSeverity.Neutral]: IconColor.IconAlternative,
18
18
  [TagSeverity.Success]: IconColor.SuccessDefault,
19
19
  [TagSeverity.Danger]: IconColor.ErrorDefault,
20
20
  [TagSeverity.Warning]: IconColor.WarningDefault,
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.constants.mjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,SAAS,EACV,uCAAuC;AAExC,MAAM,CAAC,MAAM,2BAA2B,GAGpC;IACF,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,eAAe;IACzD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,YAAY;IACtD,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC,UAAU;IACnD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,YAAY;IACtD,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,SAAS;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAmC;IACzE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,WAAW;IAC5C,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IAC/C,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY;IAC5C,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IAC/C,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,WAAW;CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAmC;IACzE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,WAAW;IAC5C,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IAC/C,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY;IAC5C,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IAC/C,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,WAAW;CAC1C,CAAC","sourcesContent":["import {\n BoxBackgroundColor,\n IconColor,\n TagSeverity,\n TextColor,\n} from '@metamask/design-system-shared';\n\nexport const MAP_TAG_SEVERITY_BACKGROUND: Record<\n TagSeverity,\n BoxBackgroundColor\n> = {\n [TagSeverity.Neutral]: BoxBackgroundColor.BackgroundMuted,\n [TagSeverity.Success]: BoxBackgroundColor.SuccessMuted,\n [TagSeverity.Danger]: BoxBackgroundColor.ErrorMuted,\n [TagSeverity.Warning]: BoxBackgroundColor.WarningMuted,\n [TagSeverity.Info]: BoxBackgroundColor.InfoMuted,\n};\n\nexport const MAP_TAG_SEVERITY_TEXT_COLOR: Record<TagSeverity, TextColor> = {\n [TagSeverity.Neutral]: TextColor.TextDefault,\n [TagSeverity.Success]: TextColor.SuccessDefault,\n [TagSeverity.Danger]: TextColor.ErrorDefault,\n [TagSeverity.Warning]: TextColor.WarningDefault,\n [TagSeverity.Info]: TextColor.InfoDefault,\n};\n\nexport const MAP_TAG_SEVERITY_ICON_COLOR: Record<TagSeverity, IconColor> = {\n [TagSeverity.Neutral]: IconColor.IconDefault,\n [TagSeverity.Success]: IconColor.SuccessDefault,\n [TagSeverity.Danger]: IconColor.ErrorDefault,\n [TagSeverity.Warning]: IconColor.WarningDefault,\n [TagSeverity.Info]: IconColor.InfoDefault,\n};\n"]}
1
+ {"version":3,"file":"Tag.constants.mjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,SAAS,EACV,uCAAuC;AAExC,MAAM,CAAC,MAAM,2BAA2B,GAGpC;IACF,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,eAAe;IACzD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,YAAY;IACtD,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC,UAAU;IACnD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,YAAY;IACtD,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,SAAS;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAmC;IACzE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,eAAe;IAChD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IAC/C,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY;IAC5C,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IAC/C,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,WAAW;CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAmC;IACzE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,eAAe;IAChD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IAC/C,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY;IAC5C,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IAC/C,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,WAAW;CAC1C,CAAC","sourcesContent":["import {\n BoxBackgroundColor,\n IconColor,\n TagSeverity,\n TextColor,\n} from '@metamask/design-system-shared';\n\nexport const MAP_TAG_SEVERITY_BACKGROUND: Record<\n TagSeverity,\n BoxBackgroundColor\n> = {\n [TagSeverity.Neutral]: BoxBackgroundColor.BackgroundMuted,\n [TagSeverity.Success]: BoxBackgroundColor.SuccessMuted,\n [TagSeverity.Danger]: BoxBackgroundColor.ErrorMuted,\n [TagSeverity.Warning]: BoxBackgroundColor.WarningMuted,\n [TagSeverity.Info]: BoxBackgroundColor.InfoMuted,\n};\n\nexport const MAP_TAG_SEVERITY_TEXT_COLOR: Record<TagSeverity, TextColor> = {\n [TagSeverity.Neutral]: TextColor.TextAlternative,\n [TagSeverity.Success]: TextColor.SuccessDefault,\n [TagSeverity.Danger]: TextColor.ErrorDefault,\n [TagSeverity.Warning]: TextColor.WarningDefault,\n [TagSeverity.Info]: TextColor.InfoDefault,\n};\n\nexport const MAP_TAG_SEVERITY_ICON_COLOR: Record<TagSeverity, IconColor> = {\n [TagSeverity.Neutral]: IconColor.IconAlternative,\n [TagSeverity.Success]: IconColor.SuccessDefault,\n [TagSeverity.Danger]: IconColor.ErrorDefault,\n [TagSeverity.Warning]: IconColor.WarningDefault,\n [TagSeverity.Info]: IconColor.InfoDefault,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextButtonPropsShared } from '@metamask/design-system-shared';\n\nimport type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> &\n TextButtonPropsShared & {\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n };\n"]}
1
+ {"version":3,"file":"TextButton.types.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> & {\n /**\n * Content shown as the label.\n */\n children: React.ReactNode;\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n};\n"]}
@@ -1,10 +1,13 @@
1
- import type { TextButtonPropsShared } from "@metamask/design-system-shared";
2
1
  import type { TextProps } from "../Text/index.cjs";
3
2
  /**
4
3
  * Props for `TextButton`, a text-only control for links and inline actions.
5
4
  * Extends {@link Text} props.
6
5
  */
7
- export type TextButtonProps = Omit<TextProps, 'children' | 'color' | 'onPress'> & TextButtonPropsShared & {
6
+ export type TextButtonProps = Omit<TextProps, 'children' | 'color' | 'onPress'> & {
7
+ /**
8
+ * Content shown as the label.
9
+ */
10
+ children: React.ReactNode;
8
11
  /**
9
12
  * Called when the user presses the label. Primary interaction for this control.
10
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAE5E,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,UAAU,GAAG,OAAO,GAAG,SAAS,CACjC,GACC,qBAAqB,GAAG;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC"}
1
+ {"version":3,"file":"TextButton.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,UAAU,GAAG,OAAO,GAAG,SAAS,CACjC,GAAG;IACF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC"}
@@ -1,10 +1,13 @@
1
- import type { TextButtonPropsShared } from "@metamask/design-system-shared";
2
1
  import type { TextProps } from "../Text/index.mjs";
3
2
  /**
4
3
  * Props for `TextButton`, a text-only control for links and inline actions.
5
4
  * Extends {@link Text} props.
6
5
  */
7
- export type TextButtonProps = Omit<TextProps, 'children' | 'color' | 'onPress'> & TextButtonPropsShared & {
6
+ export type TextButtonProps = Omit<TextProps, 'children' | 'color' | 'onPress'> & {
7
+ /**
8
+ * Content shown as the label.
9
+ */
10
+ children: React.ReactNode;
8
11
  /**
9
12
  * Called when the user presses the label. Primary interaction for this control.
10
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAE5E,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,UAAU,GAAG,OAAO,GAAG,SAAS,CACjC,GACC,qBAAqB,GAAG;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC"}
1
+ {"version":3,"file":"TextButton.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,UAAU,GAAG,OAAO,GAAG,SAAS,CACjC,GAAG;IACF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextButtonPropsShared } from '@metamask/design-system-shared';\n\nimport type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> &\n TextButtonPropsShared & {\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n };\n"]}
1
+ {"version":3,"file":"TextButton.types.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> & {\n /**\n * Content shown as the label.\n */\n children: React.ReactNode;\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n};\n"]}
@@ -12,14 +12,12 @@ const BoxRow_1 = require("../BoxRow/index.cjs");
12
12
  const IconAlert_1 = require("../IconAlert/index.cjs");
13
13
  const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
14
14
  /**
15
- * Displays a severity-based {@link IconAlert} above a centered title row with optional inline accessories.
15
+ * Displays a severity-based {@link IconAlert} above a centered title row.
16
16
  * Remaining `View` props are forwarded to the root {@link BoxColumn}.
17
17
  *
18
18
  * @param props - Component props
19
19
  * @param props.severity - Passed to {@link IconAlert} for glyph and color
20
20
  * @param props.title - Title row content; row renders only when `title` is renderable
21
- * @param props.titleStartAccessory - Optional inline accessory to the left of `title`
22
- * @param props.titleEndAccessory - Optional inline accessory to the right of `title`
23
21
  * @param props.titleWrapperProps - Optional props spread onto the title row {@link BoxRow}
24
22
  * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
25
23
  * @param props.description - Optional description below the title; uses {@link TextOrChildren}
@@ -28,7 +26,7 @@ const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
28
26
  *
29
27
  * @returns The rendered TitleAlert layout.
30
28
  */
31
- const TitleAlert = ({ severity, title, titleStartAccessory, titleEndAccessory, titleProps, titleWrapperProps, description, descriptionProps, twClassName = '', ...props }) => {
29
+ const TitleAlert = ({ severity, title, titleProps, titleWrapperProps, description, descriptionProps, twClassName = '', ...props }) => {
32
30
  return (<BoxColumn_1.BoxColumn alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} topAccessory={<IconAlert_1.IconAlert severity={severity} size={design_system_shared_1.IconSize.Xl}/>} bottomAccessory={description ? (<Box_1.Box twClassName="self-stretch">
33
31
  <TextOrChildren_1.TextOrChildren textProps={{
34
32
  variant: design_system_shared_1.TextVariant.BodySm,
@@ -40,7 +38,7 @@ const TitleAlert = ({ severity, title, titleStartAccessory, titleEndAccessory, t
40
38
  {description}
41
39
  </TextOrChildren_1.TextOrChildren>
42
40
  </Box_1.Box>) : undefined} twClassName={twClassName} {...props}>
43
- {title ? (<BoxRow_1.BoxRow justifyContent={design_system_shared_1.BoxJustifyContent.Center} twClassName="self-stretch" {...titleWrapperProps} startAccessory={titleStartAccessory} endAccessory={titleEndAccessory} textProps={{
41
+ {title ? (<BoxRow_1.BoxRow justifyContent={design_system_shared_1.BoxJustifyContent.Center} twClassName="self-stretch" {...titleWrapperProps} textProps={{
44
42
  variant: design_system_shared_1.TextVariant.HeadingLg,
45
43
  color: design_system_shared_1.TextColor.TextDefault,
46
44
  ...titleProps,
@@ -1 +1 @@
1
- {"version":3,"file":"TitleAlert.cjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAOwC;AACxC,kDAA0B;AAE1B,0CAA6B;AAC7B,sDAAyC;AACzC,gDAAmC;AACnC,sDAAyC;AACzC,gFAAmE;AAInE;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,KAAK,EACL,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,CACL,CAAC,qBAAS,CACR,UAAU,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,YAAY,CAAC,CAAC,CAAC,qBAAS,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,EAAG,CAAC,CACnE,eAAe,CAAC,CACd,WAAW,CAAC,CAAC,CAAC,CACZ,CAAC,SAAG,CAAC,WAAW,CAAC,cAAc,CAC7B;YAAA,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,kCAAW,CAAC,MAAM;gBAC3B,KAAK,EAAE,gCAAS,CAAC,eAAe;gBAChC,UAAU,EAAE,iCAAU,CAAC,MAAM;gBAC7B,GAAG,gBAAgB;gBACnB,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,KAAK,CAAC;aAC1D,CAAC,CAEF;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,+BAAc,CAClB;UAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,SAAS,CACd,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,eAAM,CACL,cAAc,CAAC,CAAC,wCAAiB,CAAC,MAAM,CAAC,CACzC,WAAW,CAAC,cAAc,CAC1B,IAAI,iBAAiB,CAAC,CACtB,cAAc,CAAC,CAAC,mBAAmB,CAAC,CACpC,YAAY,CAAC,CAAC,iBAAiB,CAAC,CAChC,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,kCAAW,CAAC,SAAS;gBAC9B,KAAK,EAAE,gCAAS,CAAC,WAAW;gBAC5B,GAAG,UAAU;aACd,CAAC,CAEF;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,eAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,qBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AAvDW,QAAA,UAAU,cAuDrB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxJustifyContent,\n FontWeight,\n IconSize,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { IconAlert } from '../IconAlert';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { TitleAlertProps } from './TitleAlert.types';\n\n/**\n * Displays a severity-based {@link IconAlert} above a centered title row with optional inline accessories.\n * Remaining `View` props are forwarded to the root {@link BoxColumn}.\n *\n * @param props - Component props\n * @param props.severity - Passed to {@link IconAlert} for glyph and color\n * @param props.title - Title row content; row renders only when `title` is renderable\n * @param props.titleStartAccessory - Optional inline accessory to the left of `title`\n * @param props.titleEndAccessory - Optional inline accessory to the right of `title`\n * @param props.titleWrapperProps - Optional props spread onto the title row {@link BoxRow}\n * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string\n * @param props.description - Optional description below the title; uses {@link TextOrChildren}\n * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string\n * @param props.twClassName - Optional Tailwind classes on the root BoxColumn\n *\n * @returns The rendered TitleAlert layout.\n */\nexport const TitleAlert: React.FC<TitleAlertProps> = ({\n severity,\n title,\n titleStartAccessory,\n titleEndAccessory,\n titleProps,\n titleWrapperProps,\n description,\n descriptionProps,\n twClassName = '',\n ...props\n}) => {\n return (\n <BoxColumn\n alignItems={BoxAlignItems.Center}\n gap={1}\n topAccessory={<IconAlert severity={severity} size={IconSize.Xl} />}\n bottomAccessory={\n description ? (\n <Box twClassName=\"self-stretch\">\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n color: TextColor.TextAlternative,\n fontWeight: FontWeight.Medium,\n ...descriptionProps,\n style: [{ textAlign: 'center' }, descriptionProps?.style],\n }}\n >\n {description}\n </TextOrChildren>\n </Box>\n ) : undefined\n }\n twClassName={twClassName}\n {...props}\n >\n {title ? (\n <BoxRow\n justifyContent={BoxJustifyContent.Center}\n twClassName=\"self-stretch\"\n {...titleWrapperProps}\n startAccessory={titleStartAccessory}\n endAccessory={titleEndAccessory}\n textProps={{\n variant: TextVariant.HeadingLg,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null}\n </BoxColumn>\n );\n};\n\nTitleAlert.displayName = 'TitleAlert';\n"]}
1
+ {"version":3,"file":"TitleAlert.cjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAOwC;AACxC,kDAA0B;AAE1B,0CAA6B;AAC7B,sDAAyC;AACzC,gDAAmC;AACnC,sDAAyC;AACzC,gFAAmE;AAInE;;;;;;;;;;;;;;GAcG;AACI,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,CACL,CAAC,qBAAS,CACR,UAAU,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,YAAY,CAAC,CAAC,CAAC,qBAAS,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,EAAG,CAAC,CACnE,eAAe,CAAC,CACd,WAAW,CAAC,CAAC,CAAC,CACZ,CAAC,SAAG,CAAC,WAAW,CAAC,cAAc,CAC7B;YAAA,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,kCAAW,CAAC,MAAM;gBAC3B,KAAK,EAAE,gCAAS,CAAC,eAAe;gBAChC,UAAU,EAAE,iCAAU,CAAC,MAAM;gBAC7B,GAAG,gBAAgB;gBACnB,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,KAAK,CAAC;aAC1D,CAAC,CAEF;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,+BAAc,CAClB;UAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,SAAS,CACd,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,eAAM,CACL,cAAc,CAAC,CAAC,wCAAiB,CAAC,MAAM,CAAC,CACzC,WAAW,CAAC,cAAc,CAC1B,IAAI,iBAAiB,CAAC,CACtB,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,kCAAW,CAAC,SAAS;gBAC9B,KAAK,EAAE,gCAAS,CAAC,WAAW;gBAC5B,GAAG,UAAU;aACd,CAAC,CAEF;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,eAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,qBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AAnDW,QAAA,UAAU,cAmDrB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxJustifyContent,\n FontWeight,\n IconSize,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { IconAlert } from '../IconAlert';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { TitleAlertProps } from './TitleAlert.types';\n\n/**\n * Displays a severity-based {@link IconAlert} above a centered title row.\n * Remaining `View` props are forwarded to the root {@link BoxColumn}.\n *\n * @param props - Component props\n * @param props.severity - Passed to {@link IconAlert} for glyph and color\n * @param props.title - Title row content; row renders only when `title` is renderable\n * @param props.titleWrapperProps - Optional props spread onto the title row {@link BoxRow}\n * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string\n * @param props.description - Optional description below the title; uses {@link TextOrChildren}\n * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string\n * @param props.twClassName - Optional Tailwind classes on the root BoxColumn\n *\n * @returns The rendered TitleAlert layout.\n */\nexport const TitleAlert: React.FC<TitleAlertProps> = ({\n severity,\n title,\n titleProps,\n titleWrapperProps,\n description,\n descriptionProps,\n twClassName = '',\n ...props\n}) => {\n return (\n <BoxColumn\n alignItems={BoxAlignItems.Center}\n gap={1}\n topAccessory={<IconAlert severity={severity} size={IconSize.Xl} />}\n bottomAccessory={\n description ? (\n <Box twClassName=\"self-stretch\">\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n color: TextColor.TextAlternative,\n fontWeight: FontWeight.Medium,\n ...descriptionProps,\n style: [{ textAlign: 'center' }, descriptionProps?.style],\n }}\n >\n {description}\n </TextOrChildren>\n </Box>\n ) : undefined\n }\n twClassName={twClassName}\n {...props}\n >\n {title ? (\n <BoxRow\n justifyContent={BoxJustifyContent.Center}\n twClassName=\"self-stretch\"\n {...titleWrapperProps}\n textProps={{\n variant: TextVariant.HeadingLg,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null}\n </BoxColumn>\n );\n};\n\nTitleAlert.displayName = 'TitleAlert';\n"]}