@metamask-previews/design-system-react 0.16.0-preview.d854123 → 0.17.0-preview.9d477a9

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 (100) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/dist/components/AvatarFavicon/AvatarFavicon.cjs +1 -2
  3. package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
  4. package/dist/components/AvatarFavicon/AvatarFavicon.d.cts.map +1 -1
  5. package/dist/components/AvatarFavicon/AvatarFavicon.d.mts.map +1 -1
  6. package/dist/components/AvatarFavicon/AvatarFavicon.mjs +1 -2
  7. package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
  8. package/dist/components/AvatarFavicon/AvatarFavicon.types.cjs.map +1 -1
  9. package/dist/components/AvatarFavicon/AvatarFavicon.types.d.cts +6 -6
  10. package/dist/components/AvatarFavicon/AvatarFavicon.types.d.cts.map +1 -1
  11. package/dist/components/AvatarFavicon/AvatarFavicon.types.d.mts +6 -6
  12. package/dist/components/AvatarFavicon/AvatarFavicon.types.d.mts.map +1 -1
  13. package/dist/components/AvatarFavicon/AvatarFavicon.types.mjs.map +1 -1
  14. package/dist/components/AvatarFavicon/index.cjs +2 -2
  15. package/dist/components/AvatarFavicon/index.cjs.map +1 -1
  16. package/dist/components/AvatarFavicon/index.d.cts +1 -1
  17. package/dist/components/AvatarFavicon/index.d.cts.map +1 -1
  18. package/dist/components/AvatarFavicon/index.d.mts +1 -1
  19. package/dist/components/AvatarFavicon/index.d.mts.map +1 -1
  20. package/dist/components/AvatarFavicon/index.mjs +1 -1
  21. package/dist/components/AvatarFavicon/index.mjs.map +1 -1
  22. package/dist/components/BannerAlert/BannerAlert.constants.cjs +8 -8
  23. package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
  24. package/dist/components/BannerAlert/BannerAlert.constants.d.cts +2 -2
  25. package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
  26. package/dist/components/BannerAlert/BannerAlert.constants.d.mts +2 -2
  27. package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
  28. package/dist/components/BannerAlert/BannerAlert.constants.mjs +2 -2
  29. package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
  30. package/dist/components/BannerBase/BannerBase.cjs +5 -4
  31. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  32. package/dist/components/BannerBase/BannerBase.d.cts +2 -1
  33. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  34. package/dist/components/BannerBase/BannerBase.d.mts +2 -1
  35. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  36. package/dist/components/BannerBase/BannerBase.mjs +2 -1
  37. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  38. package/dist/components/Checkbox/Checkbox.types.cjs.map +1 -1
  39. package/dist/components/Checkbox/Checkbox.types.d.cts +2 -28
  40. package/dist/components/Checkbox/Checkbox.types.d.cts.map +1 -1
  41. package/dist/components/Checkbox/Checkbox.types.d.mts +2 -28
  42. package/dist/components/Checkbox/Checkbox.types.d.mts.map +1 -1
  43. package/dist/components/Checkbox/Checkbox.types.mjs.map +1 -1
  44. package/dist/components/Icon/Icon.types.cjs.map +1 -1
  45. package/dist/components/Icon/Icon.types.d.cts +1 -19
  46. package/dist/components/Icon/Icon.types.d.cts.map +1 -1
  47. package/dist/components/Icon/Icon.types.d.mts +1 -19
  48. package/dist/components/Icon/Icon.types.d.mts.map +1 -1
  49. package/dist/components/Icon/Icon.types.mjs.map +1 -1
  50. package/dist/components/Input/Input.cjs +3 -3
  51. package/dist/components/Input/Input.cjs.map +1 -1
  52. package/dist/components/Input/Input.d.cts +1 -1
  53. package/dist/components/Input/Input.d.cts.map +1 -1
  54. package/dist/components/Input/Input.d.mts +1 -1
  55. package/dist/components/Input/Input.d.mts.map +1 -1
  56. package/dist/components/Input/Input.mjs +3 -3
  57. package/dist/components/Input/Input.mjs.map +1 -1
  58. package/dist/components/Input/Input.types.cjs.map +1 -1
  59. package/dist/components/Input/Input.types.d.cts +1 -1
  60. package/dist/components/Input/Input.types.d.cts.map +1 -1
  61. package/dist/components/Input/Input.types.d.mts +1 -1
  62. package/dist/components/Input/Input.types.d.mts.map +1 -1
  63. package/dist/components/Input/Input.types.mjs.map +1 -1
  64. package/dist/components/Text/Text.cjs +5 -3
  65. package/dist/components/Text/Text.cjs.map +1 -1
  66. package/dist/components/Text/Text.constants.cjs +60 -46
  67. package/dist/components/Text/Text.constants.cjs.map +1 -1
  68. package/dist/components/Text/Text.constants.d.cts +6 -3
  69. package/dist/components/Text/Text.constants.d.cts.map +1 -1
  70. package/dist/components/Text/Text.constants.d.mts +6 -3
  71. package/dist/components/Text/Text.constants.d.mts.map +1 -1
  72. package/dist/components/Text/Text.constants.mjs +17 -3
  73. package/dist/components/Text/Text.constants.mjs.map +1 -1
  74. package/dist/components/Text/Text.d.cts.map +1 -1
  75. package/dist/components/Text/Text.d.mts.map +1 -1
  76. package/dist/components/Text/Text.mjs +5 -3
  77. package/dist/components/Text/Text.mjs.map +1 -1
  78. package/dist/components/Text/Text.types.cjs.map +1 -1
  79. package/dist/components/Text/Text.types.d.cts +4 -39
  80. package/dist/components/Text/Text.types.d.cts.map +1 -1
  81. package/dist/components/Text/Text.types.d.mts +4 -39
  82. package/dist/components/Text/Text.types.d.mts.map +1 -1
  83. package/dist/components/Text/Text.types.mjs.map +1 -1
  84. package/dist/components/Text/index.cjs +7 -6
  85. package/dist/components/Text/index.cjs.map +1 -1
  86. package/dist/components/Text/index.d.cts +2 -1
  87. package/dist/components/Text/index.d.cts.map +1 -1
  88. package/dist/components/Text/index.d.mts +2 -1
  89. package/dist/components/Text/index.d.mts.map +1 -1
  90. package/dist/components/Text/index.mjs +2 -1
  91. package/dist/components/Text/index.mjs.map +1 -1
  92. package/dist/types/index.cjs +22 -149
  93. package/dist/types/index.cjs.map +1 -1
  94. package/dist/types/index.d.cts +20 -125
  95. package/dist/types/index.d.cts.map +1 -1
  96. package/dist/types/index.d.mts +20 -125
  97. package/dist/types/index.d.mts.map +1 -1
  98. package/dist/types/index.mjs +17 -140
  99. package/dist/types/index.mjs.map +1 -1
  100. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.17.0]
11
+
12
+ ### Changed
13
+
14
+ - Updated `AvatarFavicon` type internals to use ADR-0003/ADR-0004 shared types; imports from `@metamask/design-system-react` are unchanged ([#1062](https://github.com/MetaMask/metamask-design-system/pull/1062))
15
+ - **BREAKING:** Migrated `Text` typography types (`TextVariant`, `TextColor`, `FontWeight`, `FontStyle`, `FontFamily`) to `@metamask/design-system-shared`; all imports through `@metamask/design-system-react` continue to work without change ([#1047](https://github.com/MetaMask/metamask-design-system/pull/1047))
16
+ - `FontWeight`, `FontStyle`, and `FontFamily` underlying string values changed to semantic identifiers (e.g. `FontWeight.Bold` was `'font-bold'`, now `'bold'`); idiomatic usage is unaffected
17
+ - Projects scanning `node_modules` for Tailwind class names must also scan `@metamask/design-system-shared`
18
+ - See [Migration Guide](./MIGRATION.md#from-version-0160-to-0170)
19
+
10
20
  ## [0.16.0]
11
21
 
12
22
  ### Changed
@@ -231,7 +241,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
231
241
  - Full TypeScript support with type definitions and enums
232
242
  - Tailwind CSS integration with design token support
233
243
 
234
- [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.16.0...HEAD
244
+ [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.17.0...HEAD
245
+ [0.17.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.16.0...@metamask/design-system-react@0.17.0
235
246
  [0.16.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.15.0...@metamask/design-system-react@0.16.0
236
247
  [0.15.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.14.0...@metamask/design-system-react@0.15.0
237
248
  [0.14.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.13.0...@metamask/design-system-react@0.14.0
@@ -26,9 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.AvatarFavicon = void 0;
27
27
  const design_system_shared_1 = require("@metamask-previews/design-system-shared");
28
28
  const react_1 = __importStar(require("react"));
29
- const types_1 = require("../../types/index.cjs");
30
29
  const AvatarBase_1 = require("../AvatarBase/index.cjs");
31
- exports.AvatarFavicon = (0, react_1.forwardRef)(({ src, name = '', fallbackText, fallbackTextProps, className, size = types_1.AvatarFaviconSize.Md, imageProps, ...props }, ref) => {
30
+ exports.AvatarFavicon = (0, react_1.forwardRef)(({ src, name = '', fallbackText, fallbackTextProps, className, size = design_system_shared_1.AvatarFaviconSize.Md, imageProps, ...props }, ref) => {
32
31
  const [finalFallbackText, setFinalFallbackText] = (0, react_1.useState)('');
33
32
  const backupFallbackText = fallbackText || name?.[0] || '';
34
33
  const altText = name || 'Dapp logo'; // TBC: Add localization for default text
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarFavicon.cjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAA0E;AAC1E,+CAAoD;AAEpD,iDAAgD;AAChD,wDAA2C;AAI9B,QAAA,aAAa,GAAG,IAAA,kBAAU,EACrC,CACE,EACE,GAAG,EACH,IAAI,GAAG,EAAE,EACT,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,IAAI,GAAG,yBAAiB,CAAC,EAAE,EAC3B,UAAU,EACV,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IACvE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,yCAAyC;IAE9E,MAAM,cAAc,GAAG,CAAC,CAAyC,EAAE,EAAE;QACnE,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;QACzC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,uBAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,sCAAe,CAAC,MAAM,EAC7B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,EAC1D,iBAAiB,EAAE,iBAAiB,KAChC,KAAK,IAER,GAAG,IAAI,CACN,uCACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,OAAO,EACZ,SAAS,EAAC,0BAA0B,KAChC,UAAU,EACd,OAAO,EAAE,cAAc,GACvB,CACH,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import { AvatarBaseShape } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef, useState } from 'react';\n\nimport { AvatarFaviconSize } from '../../types';\nimport { AvatarBase } from '../AvatarBase';\n\nimport type { AvatarFaviconProps } from './AvatarFavicon.types';\n\nexport const AvatarFavicon = forwardRef<HTMLDivElement, AvatarFaviconProps>(\n (\n {\n src,\n name = '',\n fallbackText,\n fallbackTextProps,\n className,\n size = AvatarFaviconSize.Md,\n imageProps,\n ...props\n },\n ref,\n ) => {\n const [finalFallbackText, setFinalFallbackText] = useState<string>('');\n const backupFallbackText = fallbackText || name?.[0] || '';\n const altText = name || 'Dapp logo'; // TBC: Add localization for default text\n\n const onErrorHandler = (e: React.SyntheticEvent<HTMLImageElement>) => {\n setFinalFallbackText(backupFallbackText);\n imageProps?.onError?.(e);\n };\n\n return (\n <AvatarBase\n ref={ref}\n shape={AvatarBaseShape.Circle}\n size={size}\n className={className}\n fallbackText={src ? finalFallbackText : backupFallbackText}\n fallbackTextProps={fallbackTextProps}\n {...props}\n >\n {src && (\n <img\n src={src}\n alt={altText}\n className=\"size-full object-contain\"\n {...imageProps}\n onError={onErrorHandler}\n />\n )}\n </AvatarBase>\n );\n },\n);\n\nAvatarFavicon.displayName = 'AvatarFavicon';\n"]}
1
+ {"version":3,"file":"AvatarFavicon.cjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAGiD;AACjD,+CAAoD;AAEpD,wDAA2C;AAI9B,QAAA,aAAa,GAAG,IAAA,kBAAU,EACrC,CACE,EACE,GAAG,EACH,IAAI,GAAG,EAAE,EACT,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,IAAI,GAAG,wCAAiB,CAAC,EAAE,EAC3B,UAAU,EACV,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IACvE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,yCAAyC;IAE9E,MAAM,cAAc,GAAG,CAAC,CAAyC,EAAE,EAAE;QACnE,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;QACzC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,uBAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,sCAAe,CAAC,MAAM,EAC7B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,EAC1D,iBAAiB,EAAE,iBAAiB,KAChC,KAAK,IAER,GAAG,IAAI,CACN,uCACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,OAAO,EACZ,SAAS,EAAC,0BAA0B,KAChC,UAAU,EACd,OAAO,EAAE,cAAc,GACvB,CACH,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n AvatarBaseShape,\n AvatarFaviconSize,\n} from '@metamask-previews/design-system-shared';\nimport React, { forwardRef, useState } from 'react';\n\nimport { AvatarBase } from '../AvatarBase';\n\nimport type { AvatarFaviconProps } from './AvatarFavicon.types';\n\nexport const AvatarFavicon = forwardRef<HTMLDivElement, AvatarFaviconProps>(\n (\n {\n src,\n name = '',\n fallbackText,\n fallbackTextProps,\n className,\n size = AvatarFaviconSize.Md,\n imageProps,\n ...props\n },\n ref,\n ) => {\n const [finalFallbackText, setFinalFallbackText] = useState<string>('');\n const backupFallbackText = fallbackText || name?.[0] || '';\n const altText = name || 'Dapp logo'; // TBC: Add localization for default text\n\n const onErrorHandler = (e: React.SyntheticEvent<HTMLImageElement>) => {\n setFinalFallbackText(backupFallbackText);\n imageProps?.onError?.(e);\n };\n\n return (\n <AvatarBase\n ref={ref}\n shape={AvatarBaseShape.Circle}\n size={size}\n className={className}\n fallbackText={src ? finalFallbackText : backupFallbackText}\n fallbackTextProps={fallbackTextProps}\n {...props}\n >\n {src && (\n <img\n src={src}\n alt={altText}\n className=\"size-full object-contain\"\n {...imageProps}\n onError={onErrorHandler}\n />\n )}\n </AvatarBase>\n );\n },\n);\n\nAvatarFavicon.displayName = 'AvatarFavicon';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarFavicon.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,cAAc;AAKpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,wGA6CzB,CAAC"}
1
+ {"version":3,"file":"AvatarFavicon.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,cAAc;AAIpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,wGA6CzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarFavicon.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,cAAc;AAKpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,wGA6CzB,CAAC"}
1
+ {"version":3,"file":"AvatarFavicon.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,cAAc;AAIpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,wGA6CzB,CAAC"}
@@ -4,10 +4,9 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { AvatarBaseShape } from "@metamask-previews/design-system-shared";
7
+ import { AvatarBaseShape, AvatarFaviconSize } from "@metamask-previews/design-system-shared";
8
8
  import $React, { forwardRef, useState } from "react";
9
9
  const React = $importDefault($React);
10
- import { AvatarFaviconSize } from "../../types/index.mjs";
11
10
  import { AvatarBase } from "../AvatarBase/index.mjs";
12
11
  export const AvatarFavicon = forwardRef(({ src, name = '', fallbackText, fallbackTextProps, className, size = AvatarFaviconSize.Md, imageProps, ...props }, ref) => {
13
12
  const [finalFallbackText, setFinalFallbackText] = useState('');
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarFavicon.mjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,gDAAgD;AAC1E,OAAO,QAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc;;AAEpD,OAAO,EAAE,iBAAiB,EAAE,8BAAoB;AAChD,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,CACE,EACE,GAAG,EACH,IAAI,GAAG,EAAE,EACT,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,IAAI,GAAG,iBAAiB,CAAC,EAAE,EAC3B,UAAU,EACV,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IACvE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,yCAAyC;IAE9E,MAAM,cAAc,GAAG,CAAC,CAAyC,EAAE,EAAE;QACnE,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;QACzC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,eAAe,CAAC,MAAM,EAC7B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,EAC1D,iBAAiB,EAAE,iBAAiB,KAChC,KAAK,IAER,GAAG,IAAI,CACN,6BACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,OAAO,EACZ,SAAS,EAAC,0BAA0B,KAChC,UAAU,EACd,OAAO,EAAE,cAAc,GACvB,CACH,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import { AvatarBaseShape } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef, useState } from 'react';\n\nimport { AvatarFaviconSize } from '../../types';\nimport { AvatarBase } from '../AvatarBase';\n\nimport type { AvatarFaviconProps } from './AvatarFavicon.types';\n\nexport const AvatarFavicon = forwardRef<HTMLDivElement, AvatarFaviconProps>(\n (\n {\n src,\n name = '',\n fallbackText,\n fallbackTextProps,\n className,\n size = AvatarFaviconSize.Md,\n imageProps,\n ...props\n },\n ref,\n ) => {\n const [finalFallbackText, setFinalFallbackText] = useState<string>('');\n const backupFallbackText = fallbackText || name?.[0] || '';\n const altText = name || 'Dapp logo'; // TBC: Add localization for default text\n\n const onErrorHandler = (e: React.SyntheticEvent<HTMLImageElement>) => {\n setFinalFallbackText(backupFallbackText);\n imageProps?.onError?.(e);\n };\n\n return (\n <AvatarBase\n ref={ref}\n shape={AvatarBaseShape.Circle}\n size={size}\n className={className}\n fallbackText={src ? finalFallbackText : backupFallbackText}\n fallbackTextProps={fallbackTextProps}\n {...props}\n >\n {src && (\n <img\n src={src}\n alt={altText}\n className=\"size-full object-contain\"\n {...imageProps}\n onError={onErrorHandler}\n />\n )}\n </AvatarBase>\n );\n },\n);\n\nAvatarFavicon.displayName = 'AvatarFavicon';\n"]}
1
+ {"version":3,"file":"AvatarFavicon.mjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,gDAAgD;AACjD,OAAO,QAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc;;AAEpD,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,CACE,EACE,GAAG,EACH,IAAI,GAAG,EAAE,EACT,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,IAAI,GAAG,iBAAiB,CAAC,EAAE,EAC3B,UAAU,EACV,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IACvE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,yCAAyC;IAE9E,MAAM,cAAc,GAAG,CAAC,CAAyC,EAAE,EAAE;QACnE,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;QACzC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,eAAe,CAAC,MAAM,EAC7B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,EAC1D,iBAAiB,EAAE,iBAAiB,KAChC,KAAK,IAER,GAAG,IAAI,CACN,6BACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,OAAO,EACZ,SAAS,EAAC,0BAA0B,KAChC,UAAU,EACd,OAAO,EAAE,cAAc,GACvB,CACH,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n AvatarBaseShape,\n AvatarFaviconSize,\n} from '@metamask-previews/design-system-shared';\nimport React, { forwardRef, useState } from 'react';\n\nimport { AvatarBase } from '../AvatarBase';\n\nimport type { AvatarFaviconProps } from './AvatarFavicon.types';\n\nexport const AvatarFavicon = forwardRef<HTMLDivElement, AvatarFaviconProps>(\n (\n {\n src,\n name = '',\n fallbackText,\n fallbackTextProps,\n className,\n size = AvatarFaviconSize.Md,\n imageProps,\n ...props\n },\n ref,\n ) => {\n const [finalFallbackText, setFinalFallbackText] = useState<string>('');\n const backupFallbackText = fallbackText || name?.[0] || '';\n const altText = name || 'Dapp logo'; // TBC: Add localization for default text\n\n const onErrorHandler = (e: React.SyntheticEvent<HTMLImageElement>) => {\n setFinalFallbackText(backupFallbackText);\n imageProps?.onError?.(e);\n };\n\n return (\n <AvatarBase\n ref={ref}\n shape={AvatarBaseShape.Circle}\n size={size}\n className={className}\n fallbackText={src ? finalFallbackText : backupFallbackText}\n fallbackTextProps={fallbackTextProps}\n {...props}\n >\n {src && (\n <img\n src={src}\n alt={altText}\n className=\"size-full object-contain\"\n {...imageProps}\n onError={onErrorHandler}\n />\n )}\n </AvatarBase>\n );\n },\n);\n\nAvatarFavicon.displayName = 'AvatarFavicon';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarFavicon.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\n\nexport type AvatarFaviconProps = Omit<\n ComponentProps<'img'>,\n 'children' | 'size'\n> &\n Omit<AvatarBaseProps, 'children'> & {\n /**\n * Optional name of the dapp\n * Used as alt text for image and first letter is used as fallback if no fallbackText provided\n */\n name?: string;\n /**\n * Optional URL for the dapp favicon/logo\n * When provided, displays the image instead of fallback text\n */\n src?: string;\n /**\n * Optional prop to pass to the underlying img element\n * Useful for overriding the default alt text which is the dapp name\n */\n imageProps?: ComponentProps<'img'> & {\n 'data-testid'?: string;\n };\n };\n"]}
1
+ {"version":3,"file":"AvatarFavicon.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarFaviconPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ComponentProps } from 'react';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\n\n/**\n * AvatarFavicon component props (React platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns\n */\nexport type AvatarFaviconProps = Omit<\n ComponentProps<'img'>,\n 'children' | 'size'\n> &\n Omit<AvatarBaseProps, 'children'> &\n AvatarFaviconPropsShared & {\n /**\n * Optional URL for the dapp favicon/logo\n * When provided, displays the image instead of fallback text\n */\n src?: string;\n /**\n * Optional prop to pass to the underlying img element\n * Useful for overriding the default alt text which is the dapp name\n */\n imageProps?: ComponentProps<'img'> & {\n 'data-testid'?: string;\n };\n };\n"]}
@@ -1,11 +1,11 @@
1
+ import type { AvatarFaviconPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { ComponentProps } from "react";
2
3
  import type { AvatarBaseProps } from "../AvatarBase/index.cjs";
3
- export type AvatarFaviconProps = Omit<ComponentProps<'img'>, 'children' | 'size'> & Omit<AvatarBaseProps, 'children'> & {
4
- /**
5
- * Optional name of the dapp
6
- * Used as alt text for image and first letter is used as fallback if no fallbackText provided
7
- */
8
- name?: string;
4
+ /**
5
+ * AvatarFavicon component props (React platform-specific)
6
+ * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns
7
+ */
8
+ export type AvatarFaviconProps = Omit<ComponentProps<'img'>, 'children' | 'size'> & Omit<AvatarBaseProps, 'children'> & AvatarFaviconPropsShared & {
9
9
  /**
10
10
  * Optional URL for the dapp favicon/logo
11
11
  * When provided, displays the image instead of fallback text
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarFavicon.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,MAAM,CACpB,GACC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"AvatarFavicon.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,MAAM,CACpB,GACC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GACjC,wBAAwB,GAAG;IACzB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC"}
@@ -1,11 +1,11 @@
1
+ import type { AvatarFaviconPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { ComponentProps } from "react";
2
3
  import type { AvatarBaseProps } from "../AvatarBase/index.mjs";
3
- export type AvatarFaviconProps = Omit<ComponentProps<'img'>, 'children' | 'size'> & Omit<AvatarBaseProps, 'children'> & {
4
- /**
5
- * Optional name of the dapp
6
- * Used as alt text for image and first letter is used as fallback if no fallbackText provided
7
- */
8
- name?: string;
4
+ /**
5
+ * AvatarFavicon component props (React platform-specific)
6
+ * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns
7
+ */
8
+ export type AvatarFaviconProps = Omit<ComponentProps<'img'>, 'children' | 'size'> & Omit<AvatarBaseProps, 'children'> & AvatarFaviconPropsShared & {
9
9
  /**
10
10
  * Optional URL for the dapp favicon/logo
11
11
  * When provided, displays the image instead of fallback text
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarFavicon.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,MAAM,CACpB,GACC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"AvatarFavicon.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,MAAM,CACpB,GACC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GACjC,wBAAwB,GAAG;IACzB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarFavicon.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\n\nexport type AvatarFaviconProps = Omit<\n ComponentProps<'img'>,\n 'children' | 'size'\n> &\n Omit<AvatarBaseProps, 'children'> & {\n /**\n * Optional name of the dapp\n * Used as alt text for image and first letter is used as fallback if no fallbackText provided\n */\n name?: string;\n /**\n * Optional URL for the dapp favicon/logo\n * When provided, displays the image instead of fallback text\n */\n src?: string;\n /**\n * Optional prop to pass to the underlying img element\n * Useful for overriding the default alt text which is the dapp name\n */\n imageProps?: ComponentProps<'img'> & {\n 'data-testid'?: string;\n };\n };\n"]}
1
+ {"version":3,"file":"AvatarFavicon.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarFaviconPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ComponentProps } from 'react';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\n\n/**\n * AvatarFavicon component props (React platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns\n */\nexport type AvatarFaviconProps = Omit<\n ComponentProps<'img'>,\n 'children' | 'size'\n> &\n Omit<AvatarBaseProps, 'children'> &\n AvatarFaviconPropsShared & {\n /**\n * Optional URL for the dapp favicon/logo\n * When provided, displays the image instead of fallback text\n */\n src?: string;\n /**\n * Optional prop to pass to the underlying img element\n * Useful for overriding the default alt text which is the dapp name\n */\n imageProps?: ComponentProps<'img'> & {\n 'data-testid'?: string;\n };\n };\n"]}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AvatarFavicon = exports.AvatarFaviconSize = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "AvatarFaviconSize", { enumerable: true, get: function () { return types_1.AvatarFaviconSize; } });
4
+ var design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
+ Object.defineProperty(exports, "AvatarFaviconSize", { enumerable: true, get: function () { return design_system_shared_1.AvatarFaviconSize; } });
6
6
  var AvatarFavicon_1 = require("./AvatarFavicon.cjs");
7
7
  Object.defineProperty(exports, "AvatarFavicon", { enumerable: true, get: function () { return AvatarFavicon_1.AvatarFavicon; } });
8
8
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/index.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAAvC,0GAAA,iBAAiB,OAAA;AAC1B,qDAAgD;AAAvC,8GAAA,aAAa,OAAA","sourcesContent":["export { AvatarFaviconSize } from '../../types';\nexport { AvatarFavicon } from './AvatarFavicon';\nexport type { AvatarFaviconProps } from './AvatarFavicon.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/index.ts"],"names":[],"mappings":";;;AAAA,gFAA4E;AAAnE,yHAAA,iBAAiB,OAAA;AAC1B,qDAAgD;AAAvC,8GAAA,aAAa,OAAA","sourcesContent":["export { AvatarFaviconSize } from '@metamask-previews/design-system-shared';\nexport { AvatarFavicon } from './AvatarFavicon';\nexport type { AvatarFaviconProps } from './AvatarFavicon.types';\n"]}
@@ -1,4 +1,4 @@
1
- export { AvatarFaviconSize } from "../../types/index.cjs";
1
+ export { AvatarFaviconSize } from "@metamask-previews/design-system-shared";
2
2
  export { AvatarFavicon } from "./AvatarFavicon.cjs";
3
3
  export type { AvatarFaviconProps } from "./AvatarFavicon.types.cjs";
4
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,8BAAoB;AAChD,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gDAAgD;AAC5E,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
@@ -1,4 +1,4 @@
1
- export { AvatarFaviconSize } from "../../types/index.mjs";
1
+ export { AvatarFaviconSize } from "@metamask-previews/design-system-shared";
2
2
  export { AvatarFavicon } from "./AvatarFavicon.mjs";
3
3
  export type { AvatarFaviconProps } from "./AvatarFavicon.types.mjs";
4
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,8BAAoB;AAChD,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gDAAgD;AAC5E,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
@@ -1,3 +1,3 @@
1
- export { AvatarFaviconSize } from "../../types/index.mjs";
1
+ export { AvatarFaviconSize } from "@metamask-previews/design-system-shared";
2
2
  export { AvatarFavicon } from "./AvatarFavicon.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,8BAAoB;AAChD,OAAO,EAAE,aAAa,EAAE,4BAAwB","sourcesContent":["export { AvatarFaviconSize } from '../../types';\nexport { AvatarFavicon } from './AvatarFavicon';\nexport type { AvatarFaviconProps } from './AvatarFavicon.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gDAAgD;AAC5E,OAAO,EAAE,aAAa,EAAE,4BAAwB","sourcesContent":["export { AvatarFaviconSize } from '@metamask-previews/design-system-shared';\nexport { AvatarFavicon } from './AvatarFavicon';\nexport type { AvatarFaviconProps } from './AvatarFavicon.types';\n"]}
@@ -4,16 +4,16 @@ exports.MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR = exports.MAP_BANNER_ALERT_SEVERI
4
4
  const design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
5
  const types_1 = require("../../types/index.cjs");
6
6
  exports.MAP_BANNER_ALERT_SEVERITY_ICON_NAME = {
7
- info: types_1.IconName.Info,
8
- success: types_1.IconName.Confirmation,
9
- warning: types_1.IconName.Danger,
10
- danger: types_1.IconName.Danger,
7
+ info: design_system_shared_1.IconName.Info,
8
+ success: design_system_shared_1.IconName.Confirmation,
9
+ warning: design_system_shared_1.IconName.Danger,
10
+ danger: design_system_shared_1.IconName.Danger,
11
11
  };
12
12
  exports.MAP_BANNER_ALERT_SEVERITY_ICON_COLOR = {
13
- info: types_1.IconColor.PrimaryDefault,
14
- success: types_1.IconColor.SuccessDefault,
15
- warning: types_1.IconColor.WarningDefault,
16
- danger: types_1.IconColor.ErrorDefault,
13
+ info: design_system_shared_1.IconColor.PrimaryDefault,
14
+ success: design_system_shared_1.IconColor.SuccessDefault,
15
+ warning: design_system_shared_1.IconColor.WarningDefault,
16
+ danger: design_system_shared_1.IconColor.ErrorDefault,
17
17
  };
18
18
  exports.MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR = {
19
19
  info: types_1.BoxBackgroundColor.PrimaryMuted,
@@ -1 +1 @@
1
- {"version":3,"file":"BannerAlert.constants.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":";;;AAAA,kFAA8E;AAE9E,iDAKqB;AAER,QAAA,mCAAmC,GAG5C;IACF,IAAI,EAAE,gBAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,gBAAQ,CAAC,YAAY;IAC9B,OAAO,EAAE,gBAAQ,CAAC,MAAM;IACxB,MAAM,EAAE,gBAAQ,CAAC,MAAM;CACxB,CAAC;AAEW,QAAA,oCAAoC,GAG7C;IACF,IAAI,EAAE,iBAAS,CAAC,cAAc;IAC9B,OAAO,EAAE,iBAAS,CAAC,cAAc;IACjC,OAAO,EAAE,iBAAS,CAAC,cAAc;IACjC,MAAM,EAAE,iBAAS,CAAC,YAAY;CAC/B,CAAC;AAEW,QAAA,0CAA0C,GAGnD;IACF,IAAI,EAAE,0BAAkB,CAAC,YAAY;IACrC,OAAO,EAAE,0BAAkB,CAAC,YAAY;IACxC,OAAO,EAAE,0BAAkB,CAAC,YAAY;IACxC,MAAM,EAAE,0BAAkB,CAAC,UAAU;CACtC,CAAC;AAEW,QAAA,sCAAsC,GAG/C;IACF,IAAI,EAAE,sBAAc,CAAC,cAAc;IACnC,OAAO,EAAE,sBAAc,CAAC,cAAc;IACtC,OAAO,EAAE,sBAAc,CAAC,cAAc;IACtC,MAAM,EAAE,sBAAc,CAAC,YAAY;CACpC,CAAC","sourcesContent":["import { BannerAlertSeverity } from '@metamask-previews/design-system-shared';\n\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n IconColor,\n IconName,\n} from '../../types';\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconName\n> = {\n info: IconName.Info,\n success: IconName.Confirmation,\n warning: IconName.Danger,\n danger: IconName.Danger,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconColor\n> = {\n info: IconColor.PrimaryDefault,\n success: IconColor.SuccessDefault,\n warning: IconColor.WarningDefault,\n danger: IconColor.ErrorDefault,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBackgroundColor\n> = {\n info: BoxBackgroundColor.PrimaryMuted,\n success: BoxBackgroundColor.SuccessMuted,\n warning: BoxBackgroundColor.WarningMuted,\n danger: BoxBackgroundColor.ErrorMuted,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBorderColor\n> = {\n info: BoxBorderColor.PrimaryDefault,\n success: BoxBorderColor.SuccessDefault,\n warning: BoxBorderColor.WarningDefault,\n danger: BoxBorderColor.ErrorDefault,\n};\n"]}
1
+ {"version":3,"file":"BannerAlert.constants.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":";;;AAAA,kFAIiD;AAEjD,iDAAiE;AAEpD,QAAA,mCAAmC,GAG5C;IACF,IAAI,EAAE,+BAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,+BAAQ,CAAC,YAAY;IAC9B,OAAO,EAAE,+BAAQ,CAAC,MAAM;IACxB,MAAM,EAAE,+BAAQ,CAAC,MAAM;CACxB,CAAC;AAEW,QAAA,oCAAoC,GAG7C;IACF,IAAI,EAAE,gCAAS,CAAC,cAAc;IAC9B,OAAO,EAAE,gCAAS,CAAC,cAAc;IACjC,OAAO,EAAE,gCAAS,CAAC,cAAc;IACjC,MAAM,EAAE,gCAAS,CAAC,YAAY;CAC/B,CAAC;AAEW,QAAA,0CAA0C,GAGnD;IACF,IAAI,EAAE,0BAAkB,CAAC,YAAY;IACrC,OAAO,EAAE,0BAAkB,CAAC,YAAY;IACxC,OAAO,EAAE,0BAAkB,CAAC,YAAY;IACxC,MAAM,EAAE,0BAAkB,CAAC,UAAU;CACtC,CAAC;AAEW,QAAA,sCAAsC,GAG/C;IACF,IAAI,EAAE,sBAAc,CAAC,cAAc;IACnC,OAAO,EAAE,sBAAc,CAAC,cAAc;IACtC,OAAO,EAAE,sBAAc,CAAC,cAAc;IACtC,MAAM,EAAE,sBAAc,CAAC,YAAY;CACpC,CAAC","sourcesContent":["import {\n BannerAlertSeverity,\n IconColor,\n IconName,\n} from '@metamask-previews/design-system-shared';\n\nimport { BoxBackgroundColor, BoxBorderColor } from '../../types';\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconName\n> = {\n info: IconName.Info,\n success: IconName.Confirmation,\n warning: IconName.Danger,\n danger: IconName.Danger,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconColor\n> = {\n info: IconColor.PrimaryDefault,\n success: IconColor.SuccessDefault,\n warning: IconColor.WarningDefault,\n danger: IconColor.ErrorDefault,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBackgroundColor\n> = {\n info: BoxBackgroundColor.PrimaryMuted,\n success: BoxBackgroundColor.SuccessMuted,\n warning: BoxBackgroundColor.WarningMuted,\n danger: BoxBackgroundColor.ErrorMuted,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBorderColor\n> = {\n info: BoxBorderColor.PrimaryDefault,\n success: BoxBorderColor.SuccessDefault,\n warning: BoxBorderColor.WarningDefault,\n danger: BoxBorderColor.ErrorDefault,\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { BannerAlertSeverity } from "@metamask-previews/design-system-shared";
2
- import { BoxBackgroundColor, BoxBorderColor, IconColor, IconName } from "../../types/index.cjs";
1
+ import { BannerAlertSeverity, IconColor, IconName } from "@metamask-previews/design-system-shared";
2
+ import { BoxBackgroundColor, BoxBorderColor } from "../../types/index.cjs";
3
3
  export declare const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconName>;
4
4
  export declare const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconColor>;
5
5
  export declare const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBackgroundColor>;
@@ -1 +1 @@
1
- {"version":3,"file":"BannerAlert.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAE9E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,QAAQ,EACT,8BAAoB;AAErB,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,QAAQ,CAMT,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,SAAS,CAMV,CAAC;AAEF,eAAO,MAAM,0CAA0C,EAAE,MAAM,CAC7D,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,kBAAkB,CAMnB,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CACzD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,cAAc,CAMf,CAAC"}
1
+ {"version":3,"file":"BannerAlert.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACT,gDAAgD;AAEjD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,8BAAoB;AAEjE,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,QAAQ,CAMT,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,SAAS,CAMV,CAAC;AAEF,eAAO,MAAM,0CAA0C,EAAE,MAAM,CAC7D,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,kBAAkB,CAMnB,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CACzD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,cAAc,CAMf,CAAC"}
@@ -1,5 +1,5 @@
1
- import { BannerAlertSeverity } from "@metamask-previews/design-system-shared";
2
- import { BoxBackgroundColor, BoxBorderColor, IconColor, IconName } from "../../types/index.mjs";
1
+ import { BannerAlertSeverity, IconColor, IconName } from "@metamask-previews/design-system-shared";
2
+ import { BoxBackgroundColor, BoxBorderColor } from "../../types/index.mjs";
3
3
  export declare const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconName>;
4
4
  export declare const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconColor>;
5
5
  export declare const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBackgroundColor>;
@@ -1 +1 @@
1
- {"version":3,"file":"BannerAlert.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAE9E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,QAAQ,EACT,8BAAoB;AAErB,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,QAAQ,CAMT,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,SAAS,CAMV,CAAC;AAEF,eAAO,MAAM,0CAA0C,EAAE,MAAM,CAC7D,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,kBAAkB,CAMnB,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CACzD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,cAAc,CAMf,CAAC"}
1
+ {"version":3,"file":"BannerAlert.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACT,gDAAgD;AAEjD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,8BAAoB;AAEjE,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,QAAQ,CAMT,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,SAAS,CAMV,CAAC;AAEF,eAAO,MAAM,0CAA0C,EAAE,MAAM,CAC7D,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,kBAAkB,CAMnB,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CACzD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,cAAc,CAMf,CAAC"}
@@ -1,5 +1,5 @@
1
- import { BannerAlertSeverity } from "@metamask-previews/design-system-shared";
2
- import { BoxBackgroundColor, BoxBorderColor, IconColor, IconName } from "../../types/index.mjs";
1
+ import { BannerAlertSeverity, IconColor, IconName } from "@metamask-previews/design-system-shared";
2
+ import { BoxBackgroundColor, BoxBorderColor } from "../../types/index.mjs";
3
3
  export const MAP_BANNER_ALERT_SEVERITY_ICON_NAME = {
4
4
  info: IconName.Info,
5
5
  success: IconName.Confirmation,
@@ -1 +1 @@
1
- {"version":3,"file":"BannerAlert.constants.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAE9E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,QAAQ,EACT,8BAAoB;AAErB,MAAM,CAAC,MAAM,mCAAmC,GAG5C;IACF,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,QAAQ,CAAC,YAAY;IAC9B,OAAO,EAAE,QAAQ,CAAC,MAAM;IACxB,MAAM,EAAE,QAAQ,CAAC,MAAM;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,IAAI,EAAE,SAAS,CAAC,cAAc;IAC9B,OAAO,EAAE,SAAS,CAAC,cAAc;IACjC,OAAO,EAAE,SAAS,CAAC,cAAc;IACjC,MAAM,EAAE,SAAS,CAAC,YAAY;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,0CAA0C,GAGnD;IACF,IAAI,EAAE,kBAAkB,CAAC,YAAY;IACrC,OAAO,EAAE,kBAAkB,CAAC,YAAY;IACxC,OAAO,EAAE,kBAAkB,CAAC,YAAY;IACxC,MAAM,EAAE,kBAAkB,CAAC,UAAU;CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAG/C;IACF,IAAI,EAAE,cAAc,CAAC,cAAc;IACnC,OAAO,EAAE,cAAc,CAAC,cAAc;IACtC,OAAO,EAAE,cAAc,CAAC,cAAc;IACtC,MAAM,EAAE,cAAc,CAAC,YAAY;CACpC,CAAC","sourcesContent":["import { BannerAlertSeverity } from '@metamask-previews/design-system-shared';\n\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n IconColor,\n IconName,\n} from '../../types';\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconName\n> = {\n info: IconName.Info,\n success: IconName.Confirmation,\n warning: IconName.Danger,\n danger: IconName.Danger,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconColor\n> = {\n info: IconColor.PrimaryDefault,\n success: IconColor.SuccessDefault,\n warning: IconColor.WarningDefault,\n danger: IconColor.ErrorDefault,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBackgroundColor\n> = {\n info: BoxBackgroundColor.PrimaryMuted,\n success: BoxBackgroundColor.SuccessMuted,\n warning: BoxBackgroundColor.WarningMuted,\n danger: BoxBackgroundColor.ErrorMuted,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBorderColor\n> = {\n info: BoxBorderColor.PrimaryDefault,\n success: BoxBorderColor.SuccessDefault,\n warning: BoxBorderColor.WarningDefault,\n danger: BoxBorderColor.ErrorDefault,\n};\n"]}
1
+ {"version":3,"file":"BannerAlert.constants.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACT,gDAAgD;AAEjD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,8BAAoB;AAEjE,MAAM,CAAC,MAAM,mCAAmC,GAG5C;IACF,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,QAAQ,CAAC,YAAY;IAC9B,OAAO,EAAE,QAAQ,CAAC,MAAM;IACxB,MAAM,EAAE,QAAQ,CAAC,MAAM;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,IAAI,EAAE,SAAS,CAAC,cAAc;IAC9B,OAAO,EAAE,SAAS,CAAC,cAAc;IACjC,OAAO,EAAE,SAAS,CAAC,cAAc;IACjC,MAAM,EAAE,SAAS,CAAC,YAAY;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,0CAA0C,GAGnD;IACF,IAAI,EAAE,kBAAkB,CAAC,YAAY;IACrC,OAAO,EAAE,kBAAkB,CAAC,YAAY;IACxC,OAAO,EAAE,kBAAkB,CAAC,YAAY;IACxC,MAAM,EAAE,kBAAkB,CAAC,UAAU;CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAG/C;IACF,IAAI,EAAE,cAAc,CAAC,cAAc;IACnC,OAAO,EAAE,cAAc,CAAC,cAAc;IACtC,OAAO,EAAE,cAAc,CAAC,cAAc;IACtC,MAAM,EAAE,cAAc,CAAC,YAAY;CACpC,CAAC","sourcesContent":["import {\n BannerAlertSeverity,\n IconColor,\n IconName,\n} from '@metamask-previews/design-system-shared';\n\nimport { BoxBackgroundColor, BoxBorderColor } from '../../types';\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconName\n> = {\n info: IconName.Info,\n success: IconName.Confirmation,\n warning: IconName.Danger,\n danger: IconName.Danger,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconColor\n> = {\n info: IconColor.PrimaryDefault,\n success: IconColor.SuccessDefault,\n warning: IconColor.WarningDefault,\n danger: IconColor.ErrorDefault,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBackgroundColor\n> = {\n info: BoxBackgroundColor.PrimaryMuted,\n success: BoxBackgroundColor.SuccessMuted,\n warning: BoxBackgroundColor.WarningMuted,\n danger: BoxBackgroundColor.ErrorMuted,\n};\n\nexport const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n BoxBorderColor\n> = {\n info: BoxBorderColor.PrimaryDefault,\n success: BoxBorderColor.SuccessDefault,\n warning: BoxBorderColor.WarningDefault,\n danger: BoxBorderColor.ErrorDefault,\n};\n"]}
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.BannerBase = void 0;
27
+ const design_system_shared_1 = require("@metamask-previews/design-system-shared");
27
28
  const react_1 = __importStar(require("react"));
28
29
  const types_1 = require("../../types/index.cjs");
29
30
  const tw_merge_1 = require("../../utils/tw-merge.cjs");
@@ -42,13 +43,13 @@ exports.BannerBase = (0, react_1.forwardRef)(({ title, titleProps, description,
42
43
  startAccessory,
43
44
  react_1.default.createElement(Box_1.Box, { className: "min-w-0 flex-1" },
44
45
  hasContent(title) &&
45
- (isTextContent(title) ? (react_1.default.createElement(Text_1.Text, { variant: types_1.TextVariant.BodyMd, fontWeight: types_1.FontWeight.Medium, ...titleProps }, title)) : (title)),
46
- hasContent(description) && (react_1.default.createElement(Box_1.Box, { className: hasContent(title) ? 'mt-1' : undefined }, isTextContent(description) ? (react_1.default.createElement(Text_1.Text, { variant: types_1.TextVariant.BodySm, ...descriptionProps }, description)) : (description))),
46
+ (isTextContent(title) ? (react_1.default.createElement(Text_1.Text, { variant: design_system_shared_1.TextVariant.BodyMd, fontWeight: design_system_shared_1.FontWeight.Medium, ...titleProps }, title)) : (title)),
47
+ hasContent(description) && (react_1.default.createElement(Box_1.Box, { className: hasContent(title) ? 'mt-1' : undefined }, isTextContent(description) ? (react_1.default.createElement(Text_1.Text, { variant: design_system_shared_1.TextVariant.BodySm, ...descriptionProps }, description)) : (description))),
47
48
  hasContent(children) &&
48
- (isTextContent(children) ? (react_1.default.createElement(Text_1.Text, { variant: types_1.TextVariant.BodyMd, ...childrenWrapperProps }, children)) : (children)),
49
+ (isTextContent(children) ? (react_1.default.createElement(Text_1.Text, { variant: design_system_shared_1.TextVariant.BodyMd, ...childrenWrapperProps }, children)) : (children)),
49
50
  shouldShowActionButton && (react_1.default.createElement(Box_1.Box, { className: "mt-4" },
50
51
  react_1.default.createElement(Button_1.Button, { size: types_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: types_1.IconName.Close, size: types_1.ButtonIconSize.Sm, ariaLabel: closeButtonAriaLabel, onClick: onClose ?? closeButtonPropsOnClick, ...resolvedCloseButtonProps }))));
52
+ 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: types_1.ButtonIconSize.Sm, ariaLabel: closeButtonAriaLabel, onClick: onClose ?? closeButtonPropsOnClick, ...resolvedCloseButtonProps }))));
52
53
  });
53
54
  exports.BannerBase.displayName = 'BannerBase';
54
55
  //# sourceMappingURL=BannerBase.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,iDASqB;AACrB,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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AAsB,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 React, { forwardRef } from 'react';\n\nimport {\n BoxAlignItems,\n BoxBackgroundColor,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n BoxFlexDirection,\n IconName,\n TextVariant,\n} 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,kFAIiD;AACjD,+CAA0C;AAE1C,iDAMqB;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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 FontWeight,\n TextVariant,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport {\n BoxAlignItems,\n BoxBackgroundColor,\n ButtonIconSize,\n ButtonSize,\n BoxFlexDirection,\n} 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,5 +1,6 @@
1
+ import { IconName } from "@metamask-previews/design-system-shared";
1
2
  import React from "react";
2
- import { ButtonSize, IconName } from "../../types/index.cjs";
3
+ import { ButtonSize } from "../../types/index.cjs";
3
4
  export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@metamask-previews/design-system-shared").BannerBasePropsShared & Omit<import("../Box/index.cjs").BoxProps, "children"> & {
4
5
  titleProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
5
6
  descriptionProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAE1C,OAAO,EAIL,UAAU,EAGV,QAAQ,EAET,8BAAoB;AAerB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA0GtB,CAAC"}
@@ -1,5 +1,6 @@
1
+ import { IconName } from "@metamask-previews/design-system-shared";
1
2
  import React from "react";
2
- import { ButtonSize, IconName } from "../../types/index.mjs";
3
+ import { ButtonSize } from "../../types/index.mjs";
3
4
  export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@metamask-previews/design-system-shared").BannerBasePropsShared & Omit<import("../Box/index.mjs").BoxProps, "children"> & {
4
5
  titleProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
5
6
  descriptionProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAE1C,OAAO,EAIL,UAAU,EAGV,QAAQ,EAET,8BAAoB;AAerB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA0GtB,CAAC"}
@@ -4,9 +4,10 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
+ import { FontWeight, TextVariant, IconName } from "@metamask-previews/design-system-shared";
7
8
  import $React, { forwardRef } from "react";
8
9
  const React = $importDefault($React);
9
- import { BoxAlignItems, BoxBackgroundColor, ButtonIconSize, ButtonSize, FontWeight, BoxFlexDirection, IconName, TextVariant } from "../../types/index.mjs";
10
+ import { BoxAlignItems, BoxBackgroundColor, ButtonIconSize, ButtonSize, BoxFlexDirection } from "../../types/index.mjs";
10
11
  import { twMerge } from "../../utils/tw-merge.mjs";
11
12
  import { Box } from "../Box/index.mjs";
12
13
  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,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,8BAAoB;AACrB,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,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W,GAAG,YAAY,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n BoxAlignItems,\n BoxBackgroundColor,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n BoxFlexDirection,\n IconName,\n TextVariant,\n} 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,UAAU,EACV,WAAW,EACX,QAAQ,EACT,gDAAgD;AACjD,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,gBAAgB,EACjB,8BAAoB;AACrB,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,OAAO,OAAO,KAAK,QAAQ,CAAC;AAE7D,MAAM,UAAU,GAAG,CAAC,OAAwB,EAAE,EAAE,CAC9C,OAAO,KAAK,IAAI,IAAI,OAAO,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AC,WAAW,CAAC,IAAI,CAC1B,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,IACnD,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAC5B,oBAAC,IAAI,IAAC,OAAO,EAAE,WAAW,CAAC,MAAM,KAAM,gBAAgB,IACpD,WAAW,CACP,CACR,CAAC,CAAC,CAAC,CACF,WAAW,CACZ,CACG,CACP;YAEA,UAAU,CAAC,QAAQ,CAAC;gBACnB,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACzB,oBAAC,IAAI,IAAC,OAAO,EAAE,WAAW,CAAC,MAAM,KAAM,oBAAoB,IACxD,QAAQ,CACJ,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC;YAEH,sBAAsB,IAAI,CACzB,oBAAC,GAAG,IAAC,SAAS,EAAC,MAAM;gBACnB,oBAAC,MAAM,IACL,IAAI,EAAE,UAAU,CAAC,EAAE,EACnB,OAAO,EAAE,mBAAmB,KACxB,yBAAyB,IAE5B,iBAAiB,CACX,CACL,CACP,CACG;QAEL,qBAAqB,IAAI,CACxB,oBAAC,UAAU,IACT,SAAS,EAAE,OAAO,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,EAC3D,QAAQ,EAAE,QAAQ,CAAC,KAAK,EACxB,IAAI,EAAE,cAAc,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,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n FontWeight,\n TextVariant,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport {\n BoxAlignItems,\n BoxBackgroundColor,\n ButtonIconSize,\n ButtonSize,\n BoxFlexDirection,\n} 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 +1 @@
1
- {"version":3,"file":"Checkbox.types.cjs","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport type { IconProps } from '../Icon';\nimport type { TextProps } from '../Text';\n\nexport type CheckboxProps = Omit<\n ComponentProps<'label'>,\n 'style' | 'className' | 'children' | 'htmlFor'\n> & {\n /**\n * Required unique identifier for the checkbox input element.\n * This is used for the input's ID and the label's htmlFor attributes.\n */\n id: string;\n\n /**\n * Required prop to determine whether the checkbox is currently selected.\n * This component is fully controlled, so you must manage this state\n * in your parent component.\n */\n isSelected: boolean;\n\n /**\n * Optional prop that when true, disables the checkbox.\n *\n * @default false\n */\n isDisabled?: boolean;\n\n /**\n * Optional prop that when true, displays the invalid/error state of the checkbox.\n *\n * @default false\n */\n isInvalid?: boolean;\n\n /**\n * Optional label prop that renders text or a React node as a label beside the checkbox.\n */\n label?: React.ReactNode | string;\n\n /**\n * Optional props to be passed to the label's Text component\n */\n labelProps?: Omit<Partial<TextProps>, 'children'>;\n\n /**\n * Required callback for when the checked state changes.\n * Use this to update your state.\n */\n onChange: (isSelected: boolean) => void;\n\n /**\n * Optional props passed to the input element.\n */\n inputProps?: Omit<\n ComponentProps<'input'>,\n 'type' | 'checked' | 'onChange' | 'disabled'\n > & {\n [key: `data-${string}`]: string;\n };\n\n /**\n * Optional props passed to the container div wrapping the checkbox icon.\n */\n checkboxContainerProps?: (Omit<ComponentProps<'div'>, 'children'> & {\n className?: string;\n }) &\n Record<string, unknown>;\n\n /**\n * Optional props to be passed to the check Icon component\n */\n checkedIconProps?: Partial<IconProps>;\n /**\n * Optional prop for additional CSS classes to be applied to the Checkbox component.\n * These classes will be merged with the component's default classes using twMerge.\n */\n className?: string;\n /**\n * Optional CSS styles for the outer container.\n */\n style?: React.CSSProperties;\n};\n"]}
1
+ {"version":3,"file":"Checkbox.types.cjs","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CheckboxPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ComponentProps } from 'react';\n\nimport type { IconProps } from '../Icon';\nimport type { TextProps } from '../Text';\n\nexport type CheckboxProps = Omit<\n ComponentProps<'label'>,\n 'style' | 'className' | 'children' | 'htmlFor'\n> &\n CheckboxPropsShared & {\n /**\n * Required unique identifier for the checkbox input element.\n * This is used for the input's ID and the label's htmlFor attributes.\n */\n id: string;\n\n /**\n * Optional props to be passed to the label's Text component\n */\n labelProps?: Omit<Partial<TextProps>, 'children'>;\n\n /**\n * Optional props passed to the input element.\n */\n inputProps?: Omit<\n ComponentProps<'input'>,\n 'type' | 'checked' | 'onChange' | 'disabled'\n > & {\n [key: `data-${string}`]: string;\n };\n\n /**\n * Optional props passed to the container div wrapping the checkbox icon.\n */\n checkboxContainerProps?: (Omit<ComponentProps<'div'>, 'children'> & {\n className?: string;\n }) &\n Record<string, unknown>;\n\n /**\n * Optional props to be passed to the check Icon component\n */\n checkedIconProps?: Partial<IconProps>;\n /**\n * Optional prop for additional CSS classes to be applied to the Checkbox component.\n * These classes will be merged with the component's default classes using twMerge.\n */\n className?: string;\n /**\n * Optional CSS styles for the outer container.\n */\n style?: React.CSSProperties;\n };\n"]}
@@ -1,43 +1,17 @@
1
+ import type { CheckboxPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { ComponentProps } from "react";
2
3
  import type { IconProps } from "../Icon/index.cjs";
3
4
  import type { TextProps } from "../Text/index.cjs";
4
- export type CheckboxProps = Omit<ComponentProps<'label'>, 'style' | 'className' | 'children' | 'htmlFor'> & {
5
+ export type CheckboxProps = Omit<ComponentProps<'label'>, 'style' | 'className' | 'children' | 'htmlFor'> & CheckboxPropsShared & {
5
6
  /**
6
7
  * Required unique identifier for the checkbox input element.
7
8
  * This is used for the input's ID and the label's htmlFor attributes.
8
9
  */
9
10
  id: string;
10
- /**
11
- * Required prop to determine whether the checkbox is currently selected.
12
- * This component is fully controlled, so you must manage this state
13
- * in your parent component.
14
- */
15
- isSelected: boolean;
16
- /**
17
- * Optional prop that when true, disables the checkbox.
18
- *
19
- * @default false
20
- */
21
- isDisabled?: boolean;
22
- /**
23
- * Optional prop that when true, displays the invalid/error state of the checkbox.
24
- *
25
- * @default false
26
- */
27
- isInvalid?: boolean;
28
- /**
29
- * Optional label prop that renders text or a React node as a label beside the checkbox.
30
- */
31
- label?: React.ReactNode | string;
32
11
  /**
33
12
  * Optional props to be passed to the label's Text component
34
13
  */
35
14
  labelProps?: Omit<Partial<TextProps>, 'children'>;
36
- /**
37
- * Required callback for when the checked state changes.
38
- * Use this to update your state.
39
- */
40
- onChange: (isSelected: boolean) => void;
41
15
  /**
42
16
  * Optional props passed to the input element.
43
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.types.d.cts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,cAAc,CAAC,OAAO,CAAC,EACvB,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAC/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