@metamask/design-system-react 0.19.0 → 0.20.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 (144) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/dist/components/BannerAlert/BannerAlert.d.cts +6 -6
  3. package/dist/components/BannerAlert/BannerAlert.d.mts +6 -6
  4. package/dist/components/BannerBase/BannerBase.cjs +2 -3
  5. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  6. package/dist/components/BannerBase/BannerBase.d.cts +7 -7
  7. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  8. package/dist/components/BannerBase/BannerBase.d.mts +7 -7
  9. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  10. package/dist/components/BannerBase/BannerBase.mjs +1 -2
  11. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  12. package/dist/components/Button/Button.cjs +5 -5
  13. package/dist/components/Button/Button.cjs.map +1 -1
  14. package/dist/components/Button/Button.d.cts.map +1 -1
  15. package/dist/components/Button/Button.d.mts.map +1 -1
  16. package/dist/components/Button/Button.mjs +1 -1
  17. package/dist/components/Button/Button.mjs.map +1 -1
  18. package/dist/components/Button/Button.types.cjs.map +1 -1
  19. package/dist/components/Button/Button.types.d.cts +5 -12
  20. package/dist/components/Button/Button.types.d.cts.map +1 -1
  21. package/dist/components/Button/Button.types.d.mts +5 -12
  22. package/dist/components/Button/Button.types.d.mts.map +1 -1
  23. package/dist/components/Button/Button.types.mjs.map +1 -1
  24. package/dist/components/Button/index.cjs +3 -3
  25. package/dist/components/Button/index.cjs.map +1 -1
  26. package/dist/components/Button/index.d.cts +1 -1
  27. package/dist/components/Button/index.d.cts.map +1 -1
  28. package/dist/components/Button/index.d.mts +1 -1
  29. package/dist/components/Button/index.d.mts.map +1 -1
  30. package/dist/components/Button/index.mjs +1 -1
  31. package/dist/components/Button/index.mjs.map +1 -1
  32. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs +2 -0
  33. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs.map +1 -1
  34. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.cts.map +1 -1
  35. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.mts.map +1 -1
  36. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs +2 -0
  37. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
  38. package/dist/components/Button/variants/ButtonPrimary/index.cjs +1 -3
  39. package/dist/components/Button/variants/ButtonPrimary/index.cjs.map +1 -1
  40. package/dist/components/Button/variants/ButtonPrimary/index.d.cts +0 -1
  41. package/dist/components/Button/variants/ButtonPrimary/index.d.cts.map +1 -1
  42. package/dist/components/Button/variants/ButtonPrimary/index.d.mts +0 -1
  43. package/dist/components/Button/variants/ButtonPrimary/index.d.mts.map +1 -1
  44. package/dist/components/Button/variants/ButtonPrimary/index.mjs +0 -1
  45. package/dist/components/Button/variants/ButtonPrimary/index.mjs.map +1 -1
  46. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +2 -0
  47. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs.map +1 -1
  48. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.cts.map +1 -1
  49. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.mts.map +1 -1
  50. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs +2 -0
  51. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
  52. package/dist/components/Button/variants/ButtonSecondary/index.cjs +1 -3
  53. package/dist/components/Button/variants/ButtonSecondary/index.cjs.map +1 -1
  54. package/dist/components/Button/variants/ButtonSecondary/index.d.cts +0 -1
  55. package/dist/components/Button/variants/ButtonSecondary/index.d.cts.map +1 -1
  56. package/dist/components/Button/variants/ButtonSecondary/index.d.mts +0 -1
  57. package/dist/components/Button/variants/ButtonSecondary/index.d.mts.map +1 -1
  58. package/dist/components/Button/variants/ButtonSecondary/index.mjs +0 -1
  59. package/dist/components/Button/variants/ButtonSecondary/index.mjs.map +1 -1
  60. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +2 -0
  61. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
  62. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts.map +1 -1
  63. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts.map +1 -1
  64. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs +2 -0
  65. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
  66. package/dist/components/Button/variants/ButtonTertiary/index.cjs +1 -3
  67. package/dist/components/Button/variants/ButtonTertiary/index.cjs.map +1 -1
  68. package/dist/components/Button/variants/ButtonTertiary/index.d.cts +0 -1
  69. package/dist/components/Button/variants/ButtonTertiary/index.d.cts.map +1 -1
  70. package/dist/components/Button/variants/ButtonTertiary/index.d.mts +0 -1
  71. package/dist/components/Button/variants/ButtonTertiary/index.d.mts.map +1 -1
  72. package/dist/components/Button/variants/ButtonTertiary/index.mjs +0 -1
  73. package/dist/components/Button/variants/ButtonTertiary/index.mjs.map +1 -1
  74. package/dist/components/ButtonBase/ButtonBase.cjs +3 -3
  75. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  76. package/dist/components/ButtonBase/ButtonBase.constants.cjs +4 -4
  77. package/dist/components/ButtonBase/ButtonBase.constants.cjs.map +1 -1
  78. package/dist/components/ButtonBase/ButtonBase.constants.d.cts +1 -1
  79. package/dist/components/ButtonBase/ButtonBase.constants.d.cts.map +1 -1
  80. package/dist/components/ButtonBase/ButtonBase.constants.d.mts +1 -1
  81. package/dist/components/ButtonBase/ButtonBase.constants.d.mts.map +1 -1
  82. package/dist/components/ButtonBase/ButtonBase.constants.mjs +1 -1
  83. package/dist/components/ButtonBase/ButtonBase.constants.mjs.map +1 -1
  84. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  85. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  86. package/dist/components/ButtonBase/ButtonBase.mjs +2 -2
  87. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  88. package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
  89. package/dist/components/ButtonBase/ButtonBase.types.d.cts +3 -35
  90. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  91. package/dist/components/ButtonBase/ButtonBase.types.d.mts +3 -35
  92. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  93. package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
  94. package/dist/components/ButtonBase/index.cjs +2 -2
  95. package/dist/components/ButtonBase/index.cjs.map +1 -1
  96. package/dist/components/ButtonBase/index.d.cts +1 -1
  97. package/dist/components/ButtonBase/index.d.cts.map +1 -1
  98. package/dist/components/ButtonBase/index.d.mts +1 -1
  99. package/dist/components/ButtonBase/index.d.mts.map +1 -1
  100. package/dist/components/ButtonBase/index.mjs +1 -1
  101. package/dist/components/ButtonBase/index.mjs.map +1 -1
  102. package/dist/components/ButtonHero/index.cjs +2 -2
  103. package/dist/components/ButtonHero/index.cjs.map +1 -1
  104. package/dist/components/ButtonHero/index.d.cts +1 -1
  105. package/dist/components/ButtonHero/index.d.cts.map +1 -1
  106. package/dist/components/ButtonHero/index.d.mts +1 -1
  107. package/dist/components/ButtonHero/index.d.mts.map +1 -1
  108. package/dist/components/ButtonHero/index.mjs +1 -1
  109. package/dist/components/ButtonHero/index.mjs.map +1 -1
  110. package/dist/components/ButtonIcon/ButtonIcon.cjs +5 -5
  111. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  112. package/dist/components/ButtonIcon/ButtonIcon.constants.cjs +7 -8
  113. package/dist/components/ButtonIcon/ButtonIcon.constants.cjs.map +1 -1
  114. package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts.map +1 -1
  115. package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts.map +1 -1
  116. package/dist/components/ButtonIcon/ButtonIcon.constants.mjs +1 -2
  117. package/dist/components/ButtonIcon/ButtonIcon.constants.mjs.map +1 -1
  118. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  119. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  120. package/dist/components/ButtonIcon/ButtonIcon.mjs +1 -1
  121. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  122. package/dist/components/ButtonIcon/ButtonIcon.types.cjs.map +1 -1
  123. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +5 -27
  124. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
  125. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +5 -27
  126. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
  127. package/dist/components/ButtonIcon/ButtonIcon.types.mjs.map +1 -1
  128. package/dist/components/ButtonIcon/index.cjs +3 -3
  129. package/dist/components/ButtonIcon/index.cjs.map +1 -1
  130. package/dist/components/ButtonIcon/index.d.cts +1 -1
  131. package/dist/components/ButtonIcon/index.d.cts.map +1 -1
  132. package/dist/components/ButtonIcon/index.d.mts +1 -1
  133. package/dist/components/ButtonIcon/index.d.mts.map +1 -1
  134. package/dist/components/ButtonIcon/index.mjs +1 -1
  135. package/dist/components/ButtonIcon/index.mjs.map +1 -1
  136. package/dist/types/index.cjs +1 -64
  137. package/dist/types/index.cjs.map +1 -1
  138. package/dist/types/index.d.cts +0 -64
  139. package/dist/types/index.d.cts.map +1 -1
  140. package/dist/types/index.d.mts +0 -64
  141. package/dist/types/index.d.mts.map +1 -1
  142. package/dist/types/index.mjs +0 -68
  143. package/dist/types/index.mjs.map +1 -1
  144. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.20.0]
11
+
12
+ ### Changed
13
+
14
+ - **BREAKING:** Updated `Button`, `ButtonBase`, and `ButtonHero` size and variant exports to use shared const-object + string-union types rather than platform-local enum-based definitions, aligning React with the shared cross-platform type contracts ([#1034](https://github.com/MetaMask/metamask-design-system/pull/1034))
15
+ - No migration required for typical usage; continue importing from `@metamask/design-system-react` as before.
16
+ - Runtime values remain stable while type definitions follow ADR-0003/ADR-0004.
17
+ - **BREAKING:** Updated `ButtonIconSize` and `ButtonIconVariant` to use shared const-object + string-union types rather than platform-local enum-based definitions, aligning React with the shared cross-platform type contracts ([#1038](https://github.com/MetaMask/metamask-design-system/pull/1038))
18
+ - No migration required for typical usage; continue importing from `@metamask/design-system-react` as before.
19
+ - Runtime values remain stable while type definitions follow ADR-0003/ADR-0004.
20
+ - Updated Figma Code Connect to the live `MMDS Components` file and aligned `ButtonIcon` and `TextButton` mappings with the current component APIs shown in Dev Mode ([#1109](https://github.com/MetaMask/metamask-design-system/pull/1109))
21
+ - Expanded the `TextButton` migration guide for extension consumers replacing `ButtonLink` and `ButtonVariant.Link` with the current design-system APIs ([#1098](https://github.com/MetaMask/metamask-design-system/pull/1098))
22
+
10
23
  ## [0.19.0]
11
24
 
12
25
  ### Added
@@ -269,7 +282,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
269
282
  - Full TypeScript support with type definitions and enums
270
283
  - Tailwind CSS integration with design token support
271
284
 
272
- [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.19.0...HEAD
285
+ [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.20.0...HEAD
286
+ [0.20.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.19.0...@metamask/design-system-react@0.20.0
273
287
  [0.19.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.18.0...@metamask/design-system-react@0.19.0
274
288
  [0.18.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.17.1...@metamask/design-system-react@0.18.0
275
289
  [0.17.1]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.17.0...@metamask/design-system-react@0.17.1
@@ -42,7 +42,7 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
42
42
  nonce?: string | undefined;
43
43
  tabIndex?: number | undefined;
44
44
  disabled?: boolean | undefined;
45
- size?: import("../../types/index.cjs").ButtonBaseSize | undefined;
45
+ size?: import("@metamask/design-system-shared").ButtonBaseSize | undefined;
46
46
  formAction?: string | undefined;
47
47
  formEncType?: string | undefined;
48
48
  formMethod?: string | undefined;
@@ -293,9 +293,10 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
293
293
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
294
294
  asChild?: boolean | undefined;
295
295
  textProps?: Partial<import("../index.cjs").TextProps> | undefined;
296
- isFullWidth?: boolean | undefined;
297
296
  isLoading?: boolean | undefined;
298
297
  loadingText?: string | undefined;
298
+ isDisabled?: boolean | undefined;
299
+ isFullWidth?: boolean | undefined;
299
300
  loadingTextProps?: Partial<import("../index.cjs").TextProps> | undefined;
300
301
  startIconName?: import("@metamask/design-system-shared").IconName | undefined;
301
302
  startIconProps?: Partial<import("../Icon/index.cjs").IconProps> | undefined;
@@ -303,7 +304,6 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
303
304
  endIconName?: import("@metamask/design-system-shared").IconName | undefined;
304
305
  endIconProps?: Partial<import("../Icon/index.cjs").IconProps> | undefined;
305
306
  endAccessory?: React.ReactNode;
306
- isDisabled?: boolean | undefined;
307
307
  loadingIconProps?: Partial<import("../Icon/index.cjs").IconProps> | undefined;
308
308
  isDanger?: boolean | undefined;
309
309
  isInverse?: boolean | undefined;
@@ -352,7 +352,7 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
352
352
  nonce?: string | undefined;
353
353
  tabIndex?: number | undefined;
354
354
  disabled?: boolean | undefined;
355
- size?: import("../../types/index.cjs").ButtonBaseSize | undefined;
355
+ size?: import("@metamask/design-system-shared").ButtonBaseSize | undefined;
356
356
  formAction?: string | undefined;
357
357
  formEncType?: string | undefined;
358
358
  formMethod?: string | undefined;
@@ -603,9 +603,10 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
603
603
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
604
604
  asChild?: boolean | undefined;
605
605
  textProps?: Partial<import("../index.cjs").TextProps> | undefined;
606
- isFullWidth?: boolean | undefined;
607
606
  isLoading?: boolean | undefined;
608
607
  loadingText?: string | undefined;
608
+ isDisabled?: boolean | undefined;
609
+ isFullWidth?: boolean | undefined;
609
610
  loadingTextProps?: Partial<import("../index.cjs").TextProps> | undefined;
610
611
  startIconName?: import("@metamask/design-system-shared").IconName | undefined;
611
612
  startIconProps?: Partial<import("../Icon/index.cjs").IconProps> | undefined;
@@ -613,7 +614,6 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
613
614
  endIconName?: import("@metamask/design-system-shared").IconName | undefined;
614
615
  endIconProps?: Partial<import("../Icon/index.cjs").IconProps> | undefined;
615
616
  endAccessory?: React.ReactNode;
616
- isDisabled?: boolean | undefined;
617
617
  loadingIconProps?: Partial<import("../Icon/index.cjs").IconProps> | undefined;
618
618
  isDanger?: boolean | undefined;
619
619
  isInverse?: boolean | undefined;
@@ -42,7 +42,7 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
42
42
  nonce?: string | undefined;
43
43
  tabIndex?: number | undefined;
44
44
  disabled?: boolean | undefined;
45
- size?: import("../../types/index.mjs").ButtonBaseSize | undefined;
45
+ size?: import("@metamask/design-system-shared").ButtonBaseSize | undefined;
46
46
  formAction?: string | undefined;
47
47
  formEncType?: string | undefined;
48
48
  formMethod?: string | undefined;
@@ -293,9 +293,10 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
293
293
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
294
294
  asChild?: boolean | undefined;
295
295
  textProps?: Partial<import("../index.mjs").TextProps> | undefined;
296
- isFullWidth?: boolean | undefined;
297
296
  isLoading?: boolean | undefined;
298
297
  loadingText?: string | undefined;
298
+ isDisabled?: boolean | undefined;
299
+ isFullWidth?: boolean | undefined;
299
300
  loadingTextProps?: Partial<import("../index.mjs").TextProps> | undefined;
300
301
  startIconName?: import("@metamask/design-system-shared").IconName | undefined;
301
302
  startIconProps?: Partial<import("../Icon/index.mjs").IconProps> | undefined;
@@ -303,7 +304,6 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
303
304
  endIconName?: import("@metamask/design-system-shared").IconName | undefined;
304
305
  endIconProps?: Partial<import("../Icon/index.mjs").IconProps> | undefined;
305
306
  endAccessory?: React.ReactNode;
306
- isDisabled?: boolean | undefined;
307
307
  loadingIconProps?: Partial<import("../Icon/index.mjs").IconProps> | undefined;
308
308
  isDanger?: boolean | undefined;
309
309
  isInverse?: boolean | undefined;
@@ -352,7 +352,7 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
352
352
  nonce?: string | undefined;
353
353
  tabIndex?: number | undefined;
354
354
  disabled?: boolean | undefined;
355
- size?: import("../../types/index.mjs").ButtonBaseSize | undefined;
355
+ size?: import("@metamask/design-system-shared").ButtonBaseSize | undefined;
356
356
  formAction?: string | undefined;
357
357
  formEncType?: string | undefined;
358
358
  formMethod?: string | undefined;
@@ -603,9 +603,10 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
603
603
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
604
604
  asChild?: boolean | undefined;
605
605
  textProps?: Partial<import("../index.mjs").TextProps> | undefined;
606
- isFullWidth?: boolean | undefined;
607
606
  isLoading?: boolean | undefined;
608
607
  loadingText?: string | undefined;
608
+ isDisabled?: boolean | undefined;
609
+ isFullWidth?: boolean | undefined;
609
610
  loadingTextProps?: Partial<import("../index.mjs").TextProps> | undefined;
610
611
  startIconName?: import("@metamask/design-system-shared").IconName | undefined;
611
612
  startIconProps?: Partial<import("../Icon/index.mjs").IconProps> | undefined;
@@ -613,7 +614,6 @@ export declare const BannerAlert: React.ForwardRefExoticComponent<(Omit<import("
613
614
  endIconName?: import("@metamask/design-system-shared").IconName | undefined;
614
615
  endIconProps?: Partial<import("../Icon/index.mjs").IconProps> | undefined;
615
616
  endAccessory?: React.ReactNode;
616
- isDisabled?: boolean | undefined;
617
617
  loadingIconProps?: Partial<import("../Icon/index.mjs").IconProps> | undefined;
618
618
  isDanger?: boolean | undefined;
619
619
  isInverse?: boolean | undefined;
@@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.BannerBase = void 0;
27
27
  const design_system_shared_1 = require("@metamask/design-system-shared");
28
28
  const react_1 = __importStar(require("react"));
29
- const types_1 = require("../../types/index.cjs");
30
29
  const tw_merge_1 = require("../../utils/tw-merge.cjs");
31
30
  const Box_1 = require("../Box/index.cjs");
32
31
  const Button_1 = require("../Button/index.cjs");
@@ -48,8 +47,8 @@ exports.BannerBase = (0, react_1.forwardRef)(({ title, titleProps, description,
48
47
  hasContent(children) &&
49
48
  (isTextContent(children) ? (react_1.default.createElement(Text_1.Text, { variant: design_system_shared_1.TextVariant.BodyMd, ...childrenWrapperProps }, children)) : (children)),
50
49
  shouldShowActionButton && (react_1.default.createElement(Box_1.Box, { className: "mt-4" },
51
- react_1.default.createElement(Button_1.Button, { size: types_1.ButtonSize.Md, onClick: actionButtonOnClick, ...resolvedActionButtonProps }, actionButtonLabel)))),
52
- shouldShowCloseButton && (react_1.default.createElement(ButtonIcon_1.ButtonIcon, { className: (0, tw_merge_1.twMerge)('ml-3 self-start', closeButtonClassName), iconName: types_1.IconName.Close, size: types_1.ButtonIconSize.Sm, ariaLabel: closeButtonAriaLabel, onClick: onClose ?? closeButtonPropsOnClick, ...resolvedCloseButtonProps }))));
50
+ react_1.default.createElement(Button_1.Button, { size: design_system_shared_1.ButtonSize.Md, onClick: actionButtonOnClick, ...resolvedActionButtonProps }, actionButtonLabel)))),
51
+ shouldShowCloseButton && (react_1.default.createElement(ButtonIcon_1.ButtonIcon, { className: (0, tw_merge_1.twMerge)('ml-3 self-start', closeButtonClassName), iconName: design_system_shared_1.IconName.Close, size: design_system_shared_1.ButtonIconSize.Sm, ariaLabel: closeButtonAriaLabel, onClick: onClose ?? closeButtonPropsOnClick, ...resolvedCloseButtonProps }))));
53
52
  });
54
53
  exports.BannerBase.displayName = 'BannerBase';
55
54
  //# sourceMappingURL=BannerBase.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAMwC;AACxC,+CAA0C;AAE1C,iDAAmE;AACnE,uDAA+C;AAC/C,0CAA6B;AAC7B,gDAAmC;AACnC,wDAA2C;AAC3C,4CAA+B;AAI/B,MAAM,aAAa,GAAG,CAAC,OAAwB,EAA8B,EAAE,CAC7E,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC;AAE7D,MAAM,UAAU,GAAG,CAAC,OAAwB,EAAE,EAAE,CAC9C,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC;AAE/B,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,KAAK,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,yBAAyB,GAAG,iBAAiB,IAAI,EAAE,CAAC;IAE1D,MAAM,EACJ,SAAS,EAAE,oBAAoB,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AC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACzB,8BAAC,WAAI,IAAC,OAAO,EAAE,kCAAW,CAAC,MAAM,KAAM,oBAAoB,IACxD,QAAQ,CACJ,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC;YAEH,sBAAsB,IAAI,CACzB,8BAAC,SAAG,IAAC,SAAS,EAAC,MAAM;gBACnB,8BAAC,eAAM,IACL,IAAI,EAAE,kBAAU,CAAC,EAAE,EACnB,OAAO,EAAE,mBAAmB,KACxB,yBAAyB,IAE5B,iBAAiB,CACX,CACL,CACP,CACG;QAEL,qBAAqB,IAAI,CACxB,8BAAC,uBAAU,IACT,SAAS,EAAE,IAAA,kBAAO,EAAC,iBAAiB,EAAE,oBAAoB,CAAC,EAC3D,QAAQ,EAAE,gBAAQ,CAAC,KAAK,EACxB,IAAI,EAAE,sBAAc,CAAC,EAAE,EACvB,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,OAAO,IAAI,uBAAuB,KACvC,wBAAwB,GAC5B,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxBackgroundColor,\n BoxFlexDirection,\n FontWeight,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { ButtonIconSize, ButtonSize, IconName } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase = forwardRef<HTMLDivElement, BannerBaseProps>(\n (\n {\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnClick,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n className,\n ...props\n },\n ref,\n ) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n ariaLabel: closeButtonAriaLabel = 'Close banner',\n onClick: closeButtonPropsOnClick,\n className: closeButtonClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnClick);\n\n return (\n <Box\n ref={ref}\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n className={twMerge('rounded-sm', className)}\n {...props}\n >\n {startAccessory}\n\n <Box className=\"min-w-0 flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box className={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box className=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onClick={actionButtonOnClick}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n className={twMerge('ml-3 self-start', closeButtonClassName)}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n ariaLabel={closeButtonAriaLabel}\n onClick={onClose ?? closeButtonPropsOnClick}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n },\n);\n\nBannerBase.displayName = 'BannerBase';\n"]}
1
+ {"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEASwC;AACxC,+CAA0C;AAE1C,uDAA+C;AAC/C,0CAA6B;AAC7B,gDAAmC;AACnC,wDAA2C;AAC3C,4CAA+B;AAI/B,MAAM,aAAa,GAAG,CAAC,OAAwB,EAA8B,EAAE,CAC7E,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC;AAE7D,MAAM,UAAU,GAAG,CAAC,OAAwB,EAAE,EAAE,CAC9C,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC;AAE/B,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,KAAK,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,yBAAyB,GAAG,iBAAiB,IAAI,EAAE,CAAC;IAE1D,MAAM,EACJ,SAAS,EAAE,oBAAoB,GAAG,cAAc,EAChD,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAE,oBAAoB,EAC/B,GAAG,wBAAwB,EAC5B,GAAG,gBAAgB,IAAI,EAAE,CAAC;IAE3B,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC;IACnE,MAAM,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE5D,OAAO,CACL,8BAAC,SAAG,IACF,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,uCAAgB,CAAC,GAAG,EACnC,UAAU,EAAE,oCAAa,CAAC,KAAK,EAC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qB,IAAI,CACxB,8BAAC,uBAAU,IACT,SAAS,EAAE,IAAA,kBAAO,EAAC,iBAAiB,EAAE,oBAAoB,CAAC,EAC3D,QAAQ,EAAE,+BAAQ,CAAC,KAAK,EACxB,IAAI,EAAE,qCAAc,CAAC,EAAE,EACvB,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,OAAO,IAAI,uBAAuB,KACvC,wBAAwB,GAC5B,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxBackgroundColor,\n BoxFlexDirection,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n IconName,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase = forwardRef<HTMLDivElement, BannerBaseProps>(\n (\n {\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnClick,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n className,\n ...props\n },\n ref,\n ) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n ariaLabel: closeButtonAriaLabel = 'Close banner',\n onClick: closeButtonPropsOnClick,\n className: closeButtonClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnClick);\n\n return (\n <Box\n ref={ref}\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n className={twMerge('rounded-sm', className)}\n {...props}\n >\n {startAccessory}\n\n <Box className=\"min-w-0 flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box className={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box className=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onClick={actionButtonOnClick}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n className={twMerge('ml-3 self-start', closeButtonClassName)}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n ariaLabel={closeButtonAriaLabel}\n onClick={onClose ?? closeButtonPropsOnClick}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n },\n);\n\nBannerBase.displayName = 'BannerBase';\n"]}
@@ -1,5 +1,5 @@
1
+ import { IconName } from "@metamask/design-system-shared";
1
2
  import React from "react";
2
- import { ButtonSize, IconName } from "../../types/index.cjs";
3
3
  export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@metamask/design-system-shared").BannerBasePropsShared & Omit<import("../Box/index.cjs").BoxProps, "children"> & {
4
4
  titleProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
5
5
  descriptionProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
@@ -40,7 +40,7 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
40
40
  nonce?: string | undefined;
41
41
  tabIndex?: number | undefined;
42
42
  disabled?: boolean | undefined;
43
- size?: ButtonSize | undefined;
43
+ size?: import("@metamask/design-system-shared").ButtonBaseSize | undefined;
44
44
  formAction?: string | undefined;
45
45
  formEncType?: string | undefined;
46
46
  formMethod?: string | undefined;
@@ -291,9 +291,10 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
291
291
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
292
292
  asChild?: boolean | undefined;
293
293
  textProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
294
- isFullWidth?: boolean | undefined;
295
294
  isLoading?: boolean | undefined;
296
295
  loadingText?: string | undefined;
296
+ isDisabled?: boolean | undefined;
297
+ isFullWidth?: boolean | undefined;
297
298
  loadingTextProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
298
299
  startIconName?: IconName | undefined;
299
300
  startIconProps?: Partial<import("../index.cjs").IconProps> | undefined;
@@ -301,7 +302,6 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
301
302
  endIconName?: IconName | undefined;
302
303
  endIconProps?: Partial<import("../index.cjs").IconProps> | undefined;
303
304
  endAccessory?: React.ReactNode;
304
- isDisabled?: boolean | undefined;
305
305
  loadingIconProps?: Partial<import("../index.cjs").IconProps> | undefined;
306
306
  isDanger?: boolean | undefined;
307
307
  isInverse?: boolean | undefined;
@@ -346,7 +346,7 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
346
346
  nonce?: string | undefined;
347
347
  tabIndex?: number | undefined;
348
348
  disabled?: boolean | undefined;
349
- size?: ButtonSize | undefined;
349
+ size?: import("@metamask/design-system-shared").ButtonBaseSize | undefined;
350
350
  formAction?: string | undefined;
351
351
  formEncType?: string | undefined;
352
352
  formMethod?: string | undefined;
@@ -597,9 +597,10 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
597
597
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
598
598
  asChild?: boolean | undefined;
599
599
  textProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
600
- isFullWidth?: boolean | undefined;
601
600
  isLoading?: boolean | undefined;
602
601
  loadingText?: string | undefined;
602
+ isDisabled?: boolean | undefined;
603
+ isFullWidth?: boolean | undefined;
603
604
  loadingTextProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
604
605
  startIconName?: IconName | undefined;
605
606
  startIconProps?: Partial<import("../index.cjs").IconProps> | undefined;
@@ -607,7 +608,6 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
607
608
  endIconName?: IconName | undefined;
608
609
  endIconProps?: Partial<import("../index.cjs").IconProps> | undefined;
609
610
  endAccessory?: React.ReactNode;
610
- isDisabled?: boolean | undefined;
611
611
  loadingIconProps?: Partial<import("../index.cjs").IconProps> | undefined;
612
612
  isDanger?: boolean | undefined;
613
613
  isInverse?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqB,cAAc;AAE1C,OAAO,EAAkB,UAAU,EAAE,QAAQ,EAAE,8BAAoB;AAenE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;iDA0GtB,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { IconName } from "@metamask/design-system-shared";
1
2
  import React from "react";
2
- import { ButtonSize, IconName } from "../../types/index.mjs";
3
3
  export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@metamask/design-system-shared").BannerBasePropsShared & Omit<import("../Box/index.mjs").BoxProps, "children"> & {
4
4
  titleProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
5
5
  descriptionProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
@@ -40,7 +40,7 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
40
40
  nonce?: string | undefined;
41
41
  tabIndex?: number | undefined;
42
42
  disabled?: boolean | undefined;
43
- size?: ButtonSize | undefined;
43
+ size?: import("@metamask/design-system-shared").ButtonBaseSize | undefined;
44
44
  formAction?: string | undefined;
45
45
  formEncType?: string | undefined;
46
46
  formMethod?: string | undefined;
@@ -291,9 +291,10 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
291
291
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
292
292
  asChild?: boolean | undefined;
293
293
  textProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
294
- isFullWidth?: boolean | undefined;
295
294
  isLoading?: boolean | undefined;
296
295
  loadingText?: string | undefined;
296
+ isDisabled?: boolean | undefined;
297
+ isFullWidth?: boolean | undefined;
297
298
  loadingTextProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
298
299
  startIconName?: IconName | undefined;
299
300
  startIconProps?: Partial<import("../index.mjs").IconProps> | undefined;
@@ -301,7 +302,6 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
301
302
  endIconName?: IconName | undefined;
302
303
  endIconProps?: Partial<import("../index.mjs").IconProps> | undefined;
303
304
  endAccessory?: React.ReactNode;
304
- isDisabled?: boolean | undefined;
305
305
  loadingIconProps?: Partial<import("../index.mjs").IconProps> | undefined;
306
306
  isDanger?: boolean | undefined;
307
307
  isInverse?: boolean | undefined;
@@ -346,7 +346,7 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
346
346
  nonce?: string | undefined;
347
347
  tabIndex?: number | undefined;
348
348
  disabled?: boolean | undefined;
349
- size?: ButtonSize | undefined;
349
+ size?: import("@metamask/design-system-shared").ButtonBaseSize | undefined;
350
350
  formAction?: string | undefined;
351
351
  formEncType?: string | undefined;
352
352
  formMethod?: string | undefined;
@@ -597,9 +597,10 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
597
597
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
598
598
  asChild?: boolean | undefined;
599
599
  textProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
600
- isFullWidth?: boolean | undefined;
601
600
  isLoading?: boolean | undefined;
602
601
  loadingText?: string | undefined;
602
+ isDisabled?: boolean | undefined;
603
+ isFullWidth?: boolean | undefined;
603
604
  loadingTextProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
604
605
  startIconName?: IconName | undefined;
605
606
  startIconProps?: Partial<import("../index.mjs").IconProps> | undefined;
@@ -607,7 +608,6 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
607
608
  endIconName?: IconName | undefined;
608
609
  endIconProps?: Partial<import("../index.mjs").IconProps> | undefined;
609
610
  endAccessory?: React.ReactNode;
610
- isDisabled?: boolean | undefined;
611
611
  loadingIconProps?: Partial<import("../index.mjs").IconProps> | undefined;
612
612
  isDanger?: boolean | undefined;
613
613
  isInverse?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqB,cAAc;AAE1C,OAAO,EAAkB,UAAU,EAAE,QAAQ,EAAE,8BAAoB;AAenE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA0GtB,CAAC"}
@@ -4,10 +4,9 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { BoxAlignItems, BoxBackgroundColor, BoxFlexDirection, FontWeight, TextVariant } from "@metamask/design-system-shared";
7
+ import { BoxAlignItems, BoxBackgroundColor, BoxFlexDirection, ButtonIconSize, ButtonSize, FontWeight, IconName, TextVariant } from "@metamask/design-system-shared";
8
8
  import $React, { forwardRef } from "react";
9
9
  const React = $importDefault($React);
10
- import { ButtonIconSize, ButtonSize, IconName } from "../../types/index.mjs";
11
10
  import { twMerge } from "../../utils/tw-merge.mjs";
12
11
  import { Box } from "../Box/index.mjs";
13
12
  import { Button } from "../Button/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACZ,uCAAuC;AACxC,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,8BAAoB;AACnE,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4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C/B,OAAO,EAAE,OAAO,IAAI,uBAAuB,KACvC,wBAAwB,GAC5B,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxBackgroundColor,\n BoxFlexDirection,\n FontWeight,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { ButtonIconSize, ButtonSize, IconName } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase = forwardRef<HTMLDivElement, BannerBaseProps>(\n (\n {\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnClick,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n className,\n ...props\n },\n ref,\n ) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n ariaLabel: closeButtonAriaLabel = 'Close banner',\n onClick: closeButtonPropsOnClick,\n className: closeButtonClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnClick);\n\n return (\n <Box\n ref={ref}\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n className={twMerge('rounded-sm', className)}\n {...props}\n >\n {startAccessory}\n\n <Box className=\"min-w-0 flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box className={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box className=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onClick={actionButtonOnClick}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n className={twMerge('ml-3 self-start', closeButtonClassName)}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n ariaLabel={closeButtonAriaLabel}\n onClick={onClose ?? closeButtonPropsOnClick}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n },\n);\n\nBannerBase.displayName = 'BannerBase';\n"]}
1
+ {"version":3,"file":"BannerBase.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,uCAAuC;AACxC,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,aAAa,GAAG,CAAC,OAAwB,EAA8B,EAAE,CAC7E,OAAO,OAAO,KAAK,QAAQ,IAAI,OAA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roundColor,\n BoxFlexDirection,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n IconName,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase = forwardRef<HTMLDivElement, BannerBaseProps>(\n (\n {\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnClick,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n className,\n ...props\n },\n ref,\n ) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n ariaLabel: closeButtonAriaLabel = 'Close banner',\n onClick: closeButtonPropsOnClick,\n className: closeButtonClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnClick);\n\n return (\n <Box\n ref={ref}\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n className={twMerge('rounded-sm', className)}\n {...props}\n >\n {startAccessory}\n\n <Box className=\"min-w-0 flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box className={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box className=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onClick={actionButtonOnClick}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n className={twMerge('ml-3 self-start', closeButtonClassName)}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n ariaLabel={closeButtonAriaLabel}\n onClick={onClose ?? closeButtonPropsOnClick}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n },\n);\n\nBannerBase.displayName = 'BannerBase';\n"]}
@@ -24,18 +24,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Button = void 0;
27
+ const design_system_shared_1 = require("@metamask/design-system-shared");
27
28
  const react_1 = __importStar(require("react"));
28
- const types_1 = require("../../types/index.cjs");
29
29
  const ButtonPrimary_1 = require("./variants/ButtonPrimary/index.cjs");
30
30
  const ButtonSecondary_1 = require("./variants/ButtonSecondary/index.cjs");
31
31
  const ButtonTertiary_1 = require("./variants/ButtonTertiary/index.cjs");
32
- exports.Button = (0, react_1.forwardRef)(({ variant = types_1.ButtonVariant.Primary, ...props }, ref) => {
32
+ exports.Button = (0, react_1.forwardRef)(({ variant = design_system_shared_1.ButtonVariant.Primary, ...props }, ref) => {
33
33
  switch (variant) {
34
- case types_1.ButtonVariant.Primary:
34
+ case design_system_shared_1.ButtonVariant.Primary:
35
35
  return react_1.default.createElement(ButtonPrimary_1.ButtonPrimary, { ref: ref, ...props });
36
- case types_1.ButtonVariant.Secondary:
36
+ case design_system_shared_1.ButtonVariant.Secondary:
37
37
  return (react_1.default.createElement(ButtonSecondary_1.ButtonSecondary, { ref: ref, ...props }));
38
- case types_1.ButtonVariant.Tertiary:
38
+ case design_system_shared_1.ButtonVariant.Tertiary:
39
39
  return react_1.default.createElement(ButtonTertiary_1.ButtonTertiary, { ref: ref, ...props });
40
40
  default:
41
41
  return react_1.default.createElement(ButtonPrimary_1.ButtonPrimary, { ref: ref, ...props });
@@ -1 +1 @@
1
- {"version":3,"file":"Button.cjs","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,iDAA4C;AAG5C,sEAAyD;AAEzD,0EAA6D;AAE7D,wEAA2D;AAG9C,QAAA,MAAM,GAAG,IAAA,kBAAU,EAC9B,CAAC,EAAE,OAAO,GAAG,qBAAa,CAAC,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrD,QAAQ,OAAO,EAAE;QACf,KAAK,qBAAa,CAAC,OAAO;YACxB,OAAO,8BAAC,6BAAa,IAAC,GAAG,EAAE,GAAG,KAAO,KAA4B,GAAI,CAAC;QACxE,KAAK,qBAAa,CAAC,SAAS;YAC1B,OAAO,CACL,8BAAC,iCAAe,IAAC,GAAG,EAAE,GAAG,KAAO,KAA8B,GAAI,CACnE,CAAC;QACJ,KAAK,qBAAa,CAAC,QAAQ;YACzB,OAAO,8BAAC,+BAAc,IAAC,GAAG,EAAE,GAAG,KAAO,KAA6B,GAAI,CAAC;QAC1E;YACE,OAAO,8BAAC,6BAAa,IAAC,GAAG,EAAE,GAAG,KAAO,KAA4B,GAAI,CAAC;KACzE;AACH,CAAC,CACF,CAAC;AAEF,cAAM,CAAC,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { ButtonVariant } from '../../types';\n\nimport type { ButtonProps } from './Button.types';\nimport { ButtonPrimary } from './variants/ButtonPrimary';\nimport type { ButtonPrimaryProps } from './variants/ButtonPrimary';\nimport { ButtonSecondary } from './variants/ButtonSecondary';\nimport type { ButtonSecondaryProps } from './variants/ButtonSecondary';\nimport { ButtonTertiary } from './variants/ButtonTertiary';\nimport type { ButtonTertiaryProps } from './variants/ButtonTertiary';\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = ButtonVariant.Primary, ...props }, ref) => {\n switch (variant) {\n case ButtonVariant.Primary:\n return <ButtonPrimary ref={ref} {...(props as ButtonPrimaryProps)} />;\n case ButtonVariant.Secondary:\n return (\n <ButtonSecondary ref={ref} {...(props as ButtonSecondaryProps)} />\n );\n case ButtonVariant.Tertiary:\n return <ButtonTertiary ref={ref} {...(props as ButtonTertiaryProps)} />;\n default:\n return <ButtonPrimary ref={ref} {...(props as ButtonPrimaryProps)} />;\n }\n },\n);\n\nButton.displayName = 'Button';\n"]}
1
+ {"version":3,"file":"Button.cjs","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAA+D;AAC/D,+CAA0C;AAG1C,sEAAyD;AAEzD,0EAA6D;AAE7D,wEAA2D;AAG9C,QAAA,MAAM,GAAG,IAAA,kBAAU,EAC9B,CAAC,EAAE,OAAO,GAAG,oCAAa,CAAC,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrD,QAAQ,OAAO,EAAE;QACf,KAAK,oCAAa,CAAC,OAAO;YACxB,OAAO,8BAAC,6BAAa,IAAC,GAAG,EAAE,GAAG,KAAO,KAA4B,GAAI,CAAC;QACxE,KAAK,oCAAa,CAAC,SAAS;YAC1B,OAAO,CACL,8BAAC,iCAAe,IAAC,GAAG,EAAE,GAAG,KAAO,KAA8B,GAAI,CACnE,CAAC;QACJ,KAAK,oCAAa,CAAC,QAAQ;YACzB,OAAO,8BAAC,+BAAc,IAAC,GAAG,EAAE,GAAG,KAAO,KAA6B,GAAI,CAAC;QAC1E;YACE,OAAO,8BAAC,6BAAa,IAAC,GAAG,EAAE,GAAG,KAAO,KAA4B,GAAI,CAAC;KACzE;AACH,CAAC,CACF,CAAC;AAEF,cAAM,CAAC,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["import { ButtonVariant } from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport type { ButtonProps } from './Button.types';\nimport { ButtonPrimary } from './variants/ButtonPrimary';\nimport type { ButtonPrimaryProps } from './variants/ButtonPrimary';\nimport { ButtonSecondary } from './variants/ButtonSecondary';\nimport type { ButtonSecondaryProps } from './variants/ButtonSecondary';\nimport { ButtonTertiary } from './variants/ButtonTertiary';\nimport type { ButtonTertiaryProps } from './variants/ButtonTertiary';\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = ButtonVariant.Primary, ...props }, ref) => {\n switch (variant) {\n case ButtonVariant.Primary:\n return <ButtonPrimary ref={ref} {...(props as ButtonPrimaryProps)} />;\n case ButtonVariant.Secondary:\n return (\n <ButtonSecondary ref={ref} {...(props as ButtonSecondaryProps)} />\n );\n case ButtonVariant.Tertiary:\n return <ButtonTertiary ref={ref} {...(props as ButtonTertiaryProps)} />;\n default:\n return <ButtonPrimary ref={ref} {...(props as ButtonPrimaryProps)} />;\n }\n },\n);\n\nButton.displayName = 'Button';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.cts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAI1C,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAQlD,eAAO,MAAM,MAAM,uFAelB,CAAC"}
1
+ {"version":3,"file":"Button.d.cts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,cAAc;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAQlD,eAAO,MAAM,MAAM,uFAelB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.mts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAI1C,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAQlD,eAAO,MAAM,MAAM,uFAelB,CAAC"}
1
+ {"version":3,"file":"Button.d.mts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,cAAc;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAQlD,eAAO,MAAM,MAAM,uFAelB,CAAC"}
@@ -4,9 +4,9 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
+ import { ButtonVariant } from "@metamask/design-system-shared";
7
8
  import $React, { forwardRef } from "react";
8
9
  const React = $importDefault($React);
9
- import { ButtonVariant } from "../../types/index.mjs";
10
10
  import { ButtonPrimary } from "./variants/ButtonPrimary/index.mjs";
11
11
  import { ButtonSecondary } from "./variants/ButtonSecondary/index.mjs";
12
12
  import { ButtonTertiary } from "./variants/ButtonTertiary/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,aAAa,EAAE,8BAAoB;AAG5C,OAAO,EAAE,aAAa,EAAE,2CAAiC;AAEzD,OAAO,EAAE,eAAe,EAAE,6CAAmC;AAE7D,OAAO,EAAE,cAAc,EAAE,4CAAkC;AAG3D,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrD,QAAQ,OAAO,EAAE;QACf,KAAK,aAAa,CAAC,OAAO;YACxB,OAAO,oBAAC,aAAa,IAAC,GAAG,EAAE,GAAG,KAAO,KAA4B,GAAI,CAAC;QACxE,KAAK,aAAa,CAAC,SAAS;YAC1B,OAAO,CACL,oBAAC,eAAe,IAAC,GAAG,EAAE,GAAG,KAAO,KAA8B,GAAI,CACnE,CAAC;QACJ,KAAK,aAAa,CAAC,QAAQ;YACzB,OAAO,oBAAC,cAAc,IAAC,GAAG,EAAE,GAAG,KAAO,KAA6B,GAAI,CAAC;QAC1E;YACE,OAAO,oBAAC,aAAa,IAAC,GAAG,EAAE,GAAG,KAAO,KAA4B,GAAI,CAAC;KACzE;AACH,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { ButtonVariant } from '../../types';\n\nimport type { ButtonProps } from './Button.types';\nimport { ButtonPrimary } from './variants/ButtonPrimary';\nimport type { ButtonPrimaryProps } from './variants/ButtonPrimary';\nimport { ButtonSecondary } from './variants/ButtonSecondary';\nimport type { ButtonSecondaryProps } from './variants/ButtonSecondary';\nimport { ButtonTertiary } from './variants/ButtonTertiary';\nimport type { ButtonTertiaryProps } from './variants/ButtonTertiary';\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = ButtonVariant.Primary, ...props }, ref) => {\n switch (variant) {\n case ButtonVariant.Primary:\n return <ButtonPrimary ref={ref} {...(props as ButtonPrimaryProps)} />;\n case ButtonVariant.Secondary:\n return (\n <ButtonSecondary ref={ref} {...(props as ButtonSecondaryProps)} />\n );\n case ButtonVariant.Tertiary:\n return <ButtonTertiary ref={ref} {...(props as ButtonTertiaryProps)} />;\n default:\n return <ButtonPrimary ref={ref} {...(props as ButtonPrimaryProps)} />;\n }\n },\n);\n\nButton.displayName = 'Button';\n"]}
1
+ {"version":3,"file":"Button.mjs","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,uCAAuC;AAC/D,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAG1C,OAAO,EAAE,aAAa,EAAE,2CAAiC;AAEzD,OAAO,EAAE,eAAe,EAAE,6CAAmC;AAE7D,OAAO,EAAE,cAAc,EAAE,4CAAkC;AAG3D,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrD,QAAQ,OAAO,EAAE;QACf,KAAK,aAAa,CAAC,OAAO;YACxB,OAAO,oBAAC,aAAa,IAAC,GAAG,EAAE,GAAG,KAAO,KAA4B,GAAI,CAAC;QACxE,KAAK,aAAa,CAAC,SAAS;YAC1B,OAAO,CACL,oBAAC,eAAe,IAAC,GAAG,EAAE,GAAG,KAAO,KAA8B,GAAI,CACnE,CAAC;QACJ,KAAK,aAAa,CAAC,QAAQ;YACzB,OAAO,oBAAC,cAAc,IAAC,GAAG,EAAE,GAAG,KAAO,KAA6B,GAAI,CAAC;QAC1E;YACE,OAAO,oBAAC,aAAa,IAAC,GAAG,EAAE,GAAG,KAAO,KAA4B,GAAI,CAAC;KACzE;AACH,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["import { ButtonVariant } from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport type { ButtonProps } from './Button.types';\nimport { ButtonPrimary } from './variants/ButtonPrimary';\nimport type { ButtonPrimaryProps } from './variants/ButtonPrimary';\nimport { ButtonSecondary } from './variants/ButtonSecondary';\nimport type { ButtonSecondaryProps } from './variants/ButtonSecondary';\nimport { ButtonTertiary } from './variants/ButtonTertiary';\nimport type { ButtonTertiaryProps } from './variants/ButtonTertiary';\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = ButtonVariant.Primary, ...props }, ref) => {\n switch (variant) {\n case ButtonVariant.Primary:\n return <ButtonPrimary ref={ref} {...(props as ButtonPrimaryProps)} />;\n case ButtonVariant.Secondary:\n return (\n <ButtonSecondary ref={ref} {...(props as ButtonSecondaryProps)} />\n );\n case ButtonVariant.Tertiary:\n return <ButtonTertiary ref={ref} {...(props as ButtonTertiaryProps)} />;\n default:\n return <ButtonPrimary ref={ref} {...(props as ButtonPrimaryProps)} />;\n }\n },\n);\n\nButton.displayName = 'Button';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.types.cjs","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonVariant } from '../../types';\n\nimport type { ButtonPrimaryProps } from './variants/ButtonPrimary';\nimport type { ButtonSecondaryProps } from './variants/ButtonSecondary';\nimport type { ButtonTertiaryProps } from './variants/ButtonTertiary';\n\nexport type ButtonProps = {\n /**\n * Optional prop to control the variant of the Button\n *\n * @default ButtonVariant.Primary\n */\n variant?: ButtonVariant;\n} & (\n | (Omit<ButtonPrimaryProps, 'ref'> & {\n variant?: ButtonVariant.Primary;\n })\n | (Omit<ButtonSecondaryProps, 'ref'> & {\n variant?: ButtonVariant.Secondary;\n })\n | (Omit<ButtonTertiaryProps, 'ref'> & {\n variant?: ButtonVariant.Tertiary;\n })\n);\n"]}
1
+ {"version":3,"file":"Button.types.cjs","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonPropsShared,\n ButtonVariant,\n} from '@metamask/design-system-shared';\n\nimport type { ButtonPrimaryProps } from './variants/ButtonPrimary';\nimport type { ButtonSecondaryProps } from './variants/ButtonSecondary';\nimport type { ButtonTertiaryProps } from './variants/ButtonTertiary';\n\nexport type ButtonProps = ButtonPropsShared &\n (\n | (Omit<ButtonPrimaryProps, 'ref'> & {\n variant?: typeof ButtonVariant.Primary;\n })\n | (Omit<ButtonSecondaryProps, 'ref'> & {\n variant?: typeof ButtonVariant.Secondary;\n })\n | (Omit<ButtonTertiaryProps, 'ref'> & {\n variant?: typeof ButtonVariant.Tertiary;\n })\n );\n"]}
@@ -1,19 +1,12 @@
1
- import type { ButtonVariant } from "../../types/index.cjs";
1
+ import type { ButtonPropsShared, ButtonVariant } from "@metamask/design-system-shared";
2
2
  import type { ButtonPrimaryProps } from "./variants/ButtonPrimary/index.cjs";
3
3
  import type { ButtonSecondaryProps } from "./variants/ButtonSecondary/index.cjs";
4
4
  import type { ButtonTertiaryProps } from "./variants/ButtonTertiary/index.cjs";
5
- export type ButtonProps = {
6
- /**
7
- * Optional prop to control the variant of the Button
8
- *
9
- * @default ButtonVariant.Primary
10
- */
11
- variant?: ButtonVariant;
12
- } & ((Omit<ButtonPrimaryProps, 'ref'> & {
13
- variant?: ButtonVariant.Primary;
5
+ export type ButtonProps = ButtonPropsShared & ((Omit<ButtonPrimaryProps, 'ref'> & {
6
+ variant?: typeof ButtonVariant.Primary;
14
7
  }) | (Omit<ButtonSecondaryProps, 'ref'> & {
15
- variant?: ButtonVariant.Secondary;
8
+ variant?: typeof ButtonVariant.Secondary;
16
9
  }) | (Omit<ButtonTertiaryProps, 'ref'> & {
17
- variant?: ButtonVariant.Tertiary;
10
+ variant?: typeof ButtonVariant.Tertiary;
18
11
  }));
19
12
  //# sourceMappingURL=Button.types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.types.d.cts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,8BAAoB;AAEjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,2CAAiC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,6CAAmC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,4CAAkC;AAErE,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,GAAG,CACA,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,GAAG;IACjC,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;CACjC,CAAC,GACF,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,GAAG;IACnC,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC;CACnC,CAAC,GACF,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,GAAG;IAClC,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC;CAClC,CAAC,CACL,CAAC"}
1
+ {"version":3,"file":"Button.types.d.cts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACd,uCAAuC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAE,2CAAiC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,6CAAmC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,4CAAkC;AAErE,MAAM,MAAM,WAAW,GAAG,iBAAiB,GACzC,CACI,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,GAAG;IACjC,OAAO,CAAC,EAAE,OAAO,aAAa,CAAC,OAAO,CAAC;CACxC,CAAC,GACF,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,GAAG;IACnC,OAAO,CAAC,EAAE,OAAO,aAAa,CAAC,SAAS,CAAC;CAC1C,CAAC,GACF,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,GAAG;IAClC,OAAO,CAAC,EAAE,OAAO,aAAa,CAAC,QAAQ,CAAC;CACzC,CAAC,CACL,CAAC"}
@@ -1,19 +1,12 @@
1
- import type { ButtonVariant } from "../../types/index.mjs";
1
+ import type { ButtonPropsShared, ButtonVariant } from "@metamask/design-system-shared";
2
2
  import type { ButtonPrimaryProps } from "./variants/ButtonPrimary/index.mjs";
3
3
  import type { ButtonSecondaryProps } from "./variants/ButtonSecondary/index.mjs";
4
4
  import type { ButtonTertiaryProps } from "./variants/ButtonTertiary/index.mjs";
5
- export type ButtonProps = {
6
- /**
7
- * Optional prop to control the variant of the Button
8
- *
9
- * @default ButtonVariant.Primary
10
- */
11
- variant?: ButtonVariant;
12
- } & ((Omit<ButtonPrimaryProps, 'ref'> & {
13
- variant?: ButtonVariant.Primary;
5
+ export type ButtonProps = ButtonPropsShared & ((Omit<ButtonPrimaryProps, 'ref'> & {
6
+ variant?: typeof ButtonVariant.Primary;
14
7
  }) | (Omit<ButtonSecondaryProps, 'ref'> & {
15
- variant?: ButtonVariant.Secondary;
8
+ variant?: typeof ButtonVariant.Secondary;
16
9
  }) | (Omit<ButtonTertiaryProps, 'ref'> & {
17
- variant?: ButtonVariant.Tertiary;
10
+ variant?: typeof ButtonVariant.Tertiary;
18
11
  }));
19
12
  //# sourceMappingURL=Button.types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.types.d.mts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,8BAAoB;AAEjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,2CAAiC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,6CAAmC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,4CAAkC;AAErE,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,GAAG,CACA,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,GAAG;IACjC,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;CACjC,CAAC,GACF,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,GAAG;IACnC,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC;CACnC,CAAC,GACF,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,GAAG;IAClC,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC;CAClC,CAAC,CACL,CAAC"}
1
+ {"version":3,"file":"Button.types.d.mts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACd,uCAAuC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAE,2CAAiC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,6CAAmC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,4CAAkC;AAErE,MAAM,MAAM,WAAW,GAAG,iBAAiB,GACzC,CACI,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,GAAG;IACjC,OAAO,CAAC,EAAE,OAAO,aAAa,CAAC,OAAO,CAAC;CACxC,CAAC,GACF,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,GAAG;IACnC,OAAO,CAAC,EAAE,OAAO,aAAa,CAAC,SAAS,CAAC;CAC1C,CAAC,GACF,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,GAAG;IAClC,OAAO,CAAC,EAAE,OAAO,aAAa,CAAC,QAAQ,CAAC;CACzC,CAAC,CACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.types.mjs","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonVariant } from '../../types';\n\nimport type { ButtonPrimaryProps } from './variants/ButtonPrimary';\nimport type { ButtonSecondaryProps } from './variants/ButtonSecondary';\nimport type { ButtonTertiaryProps } from './variants/ButtonTertiary';\n\nexport type ButtonProps = {\n /**\n * Optional prop to control the variant of the Button\n *\n * @default ButtonVariant.Primary\n */\n variant?: ButtonVariant;\n} & (\n | (Omit<ButtonPrimaryProps, 'ref'> & {\n variant?: ButtonVariant.Primary;\n })\n | (Omit<ButtonSecondaryProps, 'ref'> & {\n variant?: ButtonVariant.Secondary;\n })\n | (Omit<ButtonTertiaryProps, 'ref'> & {\n variant?: ButtonVariant.Tertiary;\n })\n);\n"]}
1
+ {"version":3,"file":"Button.types.mjs","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonPropsShared,\n ButtonVariant,\n} from '@metamask/design-system-shared';\n\nimport type { ButtonPrimaryProps } from './variants/ButtonPrimary';\nimport type { ButtonSecondaryProps } from './variants/ButtonSecondary';\nimport type { ButtonTertiaryProps } from './variants/ButtonTertiary';\n\nexport type ButtonProps = ButtonPropsShared &\n (\n | (Omit<ButtonPrimaryProps, 'ref'> & {\n variant?: typeof ButtonVariant.Primary;\n })\n | (Omit<ButtonSecondaryProps, 'ref'> & {\n variant?: typeof ButtonVariant.Secondary;\n })\n | (Omit<ButtonTertiaryProps, 'ref'> & {\n variant?: typeof ButtonVariant.Tertiary;\n })\n );\n"]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Button = exports.ButtonSize = exports.ButtonVariant = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "ButtonVariant", { enumerable: true, get: function () { return types_1.ButtonVariant; } });
6
- Object.defineProperty(exports, "ButtonSize", { enumerable: true, get: function () { return types_1.ButtonSize; } });
4
+ var design_system_shared_1 = require("@metamask/design-system-shared");
5
+ Object.defineProperty(exports, "ButtonVariant", { enumerable: true, get: function () { return design_system_shared_1.ButtonVariant; } });
6
+ Object.defineProperty(exports, "ButtonSize", { enumerable: true, get: function () { return design_system_shared_1.ButtonSize; } });
7
7
  var Button_1 = require("./Button.cjs");
8
8
  Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
9
9
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":";;;AAAA,+CAAwD;AAA/C,sGAAA,aAAa,OAAA;AAAE,mGAAA,UAAU,OAAA;AAClC,uCAAkC;AAAzB,gGAAA,MAAM,OAAA","sourcesContent":["export { ButtonVariant, ButtonSize } from '../../types';\nexport { Button } from './Button';\nexport type { ButtonProps } from './Button.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":";;;AAAA,uEAA2E;AAAlE,qHAAA,aAAa,OAAA;AAAE,kHAAA,UAAU,OAAA;AAClC,uCAAkC;AAAzB,gGAAA,MAAM,OAAA","sourcesContent":["export { ButtonVariant, ButtonSize } from '@metamask/design-system-shared';\nexport { Button } from './Button';\nexport type { ButtonProps } from './Button.types';\n"]}
@@ -1,4 +1,4 @@
1
- export { ButtonVariant, ButtonSize } from "../../types/index.cjs";
1
+ export { ButtonVariant, ButtonSize } from "@metamask/design-system-shared";
2
2
  export { Button } from "./Button.cjs";
3
3
  export type { ButtonProps } from "./Button.types.cjs";
4
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,8BAAoB;AACxD,OAAO,EAAE,MAAM,EAAE,qBAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAuB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,uCAAuC;AAC3E,OAAO,EAAE,MAAM,EAAE,qBAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAuB"}
@@ -1,4 +1,4 @@
1
- export { ButtonVariant, ButtonSize } from "../../types/index.mjs";
1
+ export { ButtonVariant, ButtonSize } from "@metamask/design-system-shared";
2
2
  export { Button } from "./Button.mjs";
3
3
  export type { ButtonProps } from "./Button.types.mjs";
4
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,8BAAoB;AACxD,OAAO,EAAE,MAAM,EAAE,qBAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAuB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,uCAAuC;AAC3E,OAAO,EAAE,MAAM,EAAE,qBAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAuB"}