@metamask-previews/design-system-react 0.6.1-preview.abc15cd → 0.9.0-preview.694a8ed

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 (154) hide show
  1. package/CHANGELOG.md +38 -1
  2. package/dist/components/BadgeCount/BadgeCount.cjs +2 -2
  3. package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
  4. package/dist/components/BadgeCount/BadgeCount.constants.cjs +5 -5
  5. package/dist/components/BadgeCount/BadgeCount.constants.cjs.map +1 -1
  6. package/dist/components/BadgeCount/BadgeCount.constants.d.cts +1 -1
  7. package/dist/components/BadgeCount/BadgeCount.constants.d.cts.map +1 -1
  8. package/dist/components/BadgeCount/BadgeCount.constants.d.mts +1 -1
  9. package/dist/components/BadgeCount/BadgeCount.constants.d.mts.map +1 -1
  10. package/dist/components/BadgeCount/BadgeCount.constants.mjs +3 -3
  11. package/dist/components/BadgeCount/BadgeCount.constants.mjs.map +1 -1
  12. package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
  13. package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
  14. package/dist/components/BadgeCount/BadgeCount.mjs +1 -1
  15. package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
  16. package/dist/components/BadgeCount/BadgeCount.types.cjs.map +1 -1
  17. package/dist/components/BadgeCount/BadgeCount.types.d.cts +4 -21
  18. package/dist/components/BadgeCount/BadgeCount.types.d.cts.map +1 -1
  19. package/dist/components/BadgeCount/BadgeCount.types.d.mts +4 -21
  20. package/dist/components/BadgeCount/BadgeCount.types.d.mts.map +1 -1
  21. package/dist/components/BadgeCount/BadgeCount.types.mjs.map +1 -1
  22. package/dist/components/BadgeCount/index.cjs +2 -2
  23. package/dist/components/BadgeCount/index.cjs.map +1 -1
  24. package/dist/components/BadgeCount/index.d.cts +1 -1
  25. package/dist/components/BadgeCount/index.d.cts.map +1 -1
  26. package/dist/components/BadgeCount/index.d.mts +1 -1
  27. package/dist/components/BadgeCount/index.d.mts.map +1 -1
  28. package/dist/components/BadgeCount/index.mjs +1 -1
  29. package/dist/components/BadgeCount/index.mjs.map +1 -1
  30. package/dist/components/BadgeStatus/BadgeStatus.cjs +2 -2
  31. package/dist/components/BadgeStatus/BadgeStatus.cjs.map +1 -1
  32. package/dist/components/BadgeStatus/BadgeStatus.constants.cjs +8 -8
  33. package/dist/components/BadgeStatus/BadgeStatus.constants.cjs.map +1 -1
  34. package/dist/components/BadgeStatus/BadgeStatus.constants.d.cts +1 -1
  35. package/dist/components/BadgeStatus/BadgeStatus.constants.d.cts.map +1 -1
  36. package/dist/components/BadgeStatus/BadgeStatus.constants.d.mts +1 -1
  37. package/dist/components/BadgeStatus/BadgeStatus.constants.d.mts.map +1 -1
  38. package/dist/components/BadgeStatus/BadgeStatus.constants.mjs +1 -1
  39. package/dist/components/BadgeStatus/BadgeStatus.constants.mjs.map +1 -1
  40. package/dist/components/BadgeStatus/BadgeStatus.d.cts.map +1 -1
  41. package/dist/components/BadgeStatus/BadgeStatus.d.mts.map +1 -1
  42. package/dist/components/BadgeStatus/BadgeStatus.mjs +1 -1
  43. package/dist/components/BadgeStatus/BadgeStatus.mjs.map +1 -1
  44. package/dist/components/BadgeStatus/BadgeStatus.types.cjs.map +1 -1
  45. package/dist/components/BadgeStatus/BadgeStatus.types.d.cts +4 -28
  46. package/dist/components/BadgeStatus/BadgeStatus.types.d.cts.map +1 -1
  47. package/dist/components/BadgeStatus/BadgeStatus.types.d.mts +4 -28
  48. package/dist/components/BadgeStatus/BadgeStatus.types.d.mts.map +1 -1
  49. package/dist/components/BadgeStatus/BadgeStatus.types.mjs.map +1 -1
  50. package/dist/components/BadgeStatus/index.cjs +3 -3
  51. package/dist/components/BadgeStatus/index.cjs.map +1 -1
  52. package/dist/components/BadgeStatus/index.d.cts +1 -1
  53. package/dist/components/BadgeStatus/index.d.cts.map +1 -1
  54. package/dist/components/BadgeStatus/index.d.mts +1 -1
  55. package/dist/components/BadgeStatus/index.d.mts.map +1 -1
  56. package/dist/components/BadgeStatus/index.mjs +1 -1
  57. package/dist/components/BadgeStatus/index.mjs.map +1 -1
  58. package/dist/components/BannerBase/BannerBase.cjs +54 -0
  59. package/dist/components/BannerBase/BannerBase.cjs.map +1 -0
  60. package/dist/components/BannerBase/BannerBase.d.cts +614 -0
  61. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -0
  62. package/dist/components/BannerBase/BannerBase.d.mts +614 -0
  63. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -0
  64. package/dist/components/BannerBase/BannerBase.mjs +35 -0
  65. package/dist/components/BannerBase/BannerBase.mjs.map +1 -0
  66. package/dist/components/BannerBase/BannerBase.types.cjs +3 -0
  67. package/dist/components/BannerBase/BannerBase.types.cjs.map +1 -0
  68. package/dist/components/BannerBase/BannerBase.types.d.cts +50 -0
  69. package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -0
  70. package/dist/components/BannerBase/BannerBase.types.d.mts +50 -0
  71. package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -0
  72. package/dist/components/BannerBase/BannerBase.types.mjs +2 -0
  73. package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -0
  74. package/dist/components/BannerBase/index.cjs +6 -0
  75. package/dist/components/BannerBase/index.cjs.map +1 -0
  76. package/dist/components/BannerBase/index.d.cts +3 -0
  77. package/dist/components/BannerBase/index.d.cts.map +1 -0
  78. package/dist/components/BannerBase/index.d.mts +3 -0
  79. package/dist/components/BannerBase/index.d.mts.map +1 -0
  80. package/dist/components/BannerBase/index.mjs +2 -0
  81. package/dist/components/BannerBase/index.mjs.map +1 -0
  82. package/dist/components/Icon/icons/CorporateFare.cjs +32 -0
  83. package/dist/components/Icon/icons/CorporateFare.cjs.map +1 -0
  84. package/dist/components/Icon/icons/CorporateFare.d.cts +4 -0
  85. package/dist/components/Icon/icons/CorporateFare.d.cts.map +1 -0
  86. package/dist/components/Icon/icons/CorporateFare.d.mts +4 -0
  87. package/dist/components/Icon/icons/CorporateFare.d.mts.map +1 -0
  88. package/dist/components/Icon/icons/CorporateFare.mjs +7 -0
  89. package/dist/components/Icon/icons/CorporateFare.mjs.map +1 -0
  90. package/dist/components/Icon/icons/PopUp.cjs +32 -0
  91. package/dist/components/Icon/icons/PopUp.cjs.map +1 -0
  92. package/dist/components/Icon/icons/PopUp.d.cts +4 -0
  93. package/dist/components/Icon/icons/PopUp.d.cts.map +1 -0
  94. package/dist/components/Icon/icons/PopUp.d.mts +4 -0
  95. package/dist/components/Icon/icons/PopUp.d.mts.map +1 -0
  96. package/dist/components/Icon/icons/PopUp.mjs +7 -0
  97. package/dist/components/Icon/icons/PopUp.mjs.map +1 -0
  98. package/dist/components/Icon/icons/SidePanel.cjs +32 -0
  99. package/dist/components/Icon/icons/SidePanel.cjs.map +1 -0
  100. package/dist/components/Icon/icons/SidePanel.d.cts +4 -0
  101. package/dist/components/Icon/icons/SidePanel.d.cts.map +1 -0
  102. package/dist/components/Icon/icons/SidePanel.d.mts +4 -0
  103. package/dist/components/Icon/icons/SidePanel.d.mts.map +1 -0
  104. package/dist/components/Icon/icons/SidePanel.mjs +7 -0
  105. package/dist/components/Icon/icons/SidePanel.mjs.map +1 -0
  106. package/dist/components/Icon/icons/index.cjs +6 -0
  107. package/dist/components/Icon/icons/index.cjs.map +1 -1
  108. package/dist/components/Icon/icons/index.d.cts +3 -0
  109. package/dist/components/Icon/icons/index.d.cts.map +1 -1
  110. package/dist/components/Icon/icons/index.d.mts +3 -0
  111. package/dist/components/Icon/icons/index.d.mts.map +1 -1
  112. package/dist/components/Icon/icons/index.mjs +6 -0
  113. package/dist/components/Icon/icons/index.mjs.map +1 -1
  114. package/dist/components/Input/Input.cjs +36 -0
  115. package/dist/components/Input/Input.cjs.map +1 -0
  116. package/dist/components/Input/Input.d.cts +10 -0
  117. package/dist/components/Input/Input.d.cts.map +1 -0
  118. package/dist/components/Input/Input.d.mts +10 -0
  119. package/dist/components/Input/Input.d.mts.map +1 -0
  120. package/dist/components/Input/Input.mjs +17 -0
  121. package/dist/components/Input/Input.mjs.map +1 -0
  122. package/dist/components/Input/Input.types.cjs +3 -0
  123. package/dist/components/Input/Input.types.cjs.map +1 -0
  124. package/dist/components/Input/Input.types.d.cts +31 -0
  125. package/dist/components/Input/Input.types.d.cts.map +1 -0
  126. package/dist/components/Input/Input.types.d.mts +31 -0
  127. package/dist/components/Input/Input.types.d.mts.map +1 -0
  128. package/dist/components/Input/Input.types.mjs +2 -0
  129. package/dist/components/Input/Input.types.mjs.map +1 -0
  130. package/dist/components/Input/index.cjs +6 -0
  131. package/dist/components/Input/index.cjs.map +1 -0
  132. package/dist/components/Input/index.d.cts +3 -0
  133. package/dist/components/Input/index.d.cts.map +1 -0
  134. package/dist/components/Input/index.d.mts +3 -0
  135. package/dist/components/Input/index.d.mts.map +1 -0
  136. package/dist/components/Input/index.mjs +2 -0
  137. package/dist/components/Input/index.mjs.map +1 -0
  138. package/dist/components/index.cjs +6 -2
  139. package/dist/components/index.cjs.map +1 -1
  140. package/dist/components/index.d.cts +4 -0
  141. package/dist/components/index.d.cts.map +1 -1
  142. package/dist/components/index.d.mts +4 -0
  143. package/dist/components/index.d.mts.map +1 -1
  144. package/dist/components/index.mjs +2 -0
  145. package/dist/components/index.mjs.map +1 -1
  146. package/dist/types/index.cjs +14 -50
  147. package/dist/types/index.cjs.map +1 -1
  148. package/dist/types/index.d.cts +13 -46
  149. package/dist/types/index.d.cts.map +1 -1
  150. package/dist/types/index.d.mts +13 -46
  151. package/dist/types/index.d.mts.map +1 -1
  152. package/dist/types/index.mjs +13 -49
  153. package/dist/types/index.mjs.map +1 -1
  154. package/package.json +6 -6
@@ -1,34 +1,10 @@
1
+ import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { ComponentProps } from "react";
2
- import type { BadgeStatusSize, BadgeStatusStatus } from "../../types/index.mjs";
3
3
  /**
4
- * BadgeStatus component props.
4
+ * BadgeStatus component props (React platform-specific)
5
+ * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns
5
6
  */
6
- export type BadgeStatusProps = ComponentProps<'div'> & {
7
- /**
8
- * Optional prop to control the status of the badge
9
- * Possible values:
10
- * - BadgeStatusStatus.Active. (Connected)
11
- * - BadgeStatusStatus.Inactive. (Connected)
12
- * - BadgeStatusStatus.Disconnected.
13
- * - BadgeStatusStatus.New.
14
- * - BadgeStatusStatus.Attention.
15
- */
16
- status: BadgeStatusStatus;
17
- /**
18
- * Optional prop to determine whether the badge should display a border
19
- *
20
- * @default true
21
- */
22
- hasBorder?: boolean;
23
- /**
24
- * Optional prop to control the size of the BadgeStatus
25
- * Possible values:
26
- * - BadgeStatusSize.Md (8px),
27
- * - BadgeStatusSize.Lg (10px),
28
- *
29
- * @default AvatarBaseSize.Md
30
- */
31
- size?: BadgeStatusSize;
7
+ export type BadgeStatusProps = ComponentProps<'div'> & BadgeStatusPropsShared & {
32
8
  /**
33
9
  * Optional prop for additional CSS classes to be applied to the BadgeStatus component.
34
10
  * These classes will be merged with the component's default classes using twMerge.
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,8BAAoB;AAEtE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACrD;;;;;;;;OAQG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC"}
1
+ {"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,GAClD,sBAAsB,GAAG;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeStatus.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport type { BadgeStatusSize, BadgeStatusStatus } from '../../types';\n\n/**\n * BadgeStatus component props.\n */\nexport type BadgeStatusProps = ComponentProps<'div'> & {\n /**\n * Optional prop to control the status of the badge\n * Possible values:\n * - BadgeStatusStatus.Active. (Connected)\n * - BadgeStatusStatus.Inactive. (Connected)\n * - BadgeStatusStatus.Disconnected.\n * - BadgeStatusStatus.New.\n * - BadgeStatusStatus.Attention.\n */\n status: BadgeStatusStatus;\n /**\n * Optional prop to determine whether the badge should display a border\n *\n * @default true\n */\n hasBorder?: boolean;\n /**\n * Optional prop to control the size of the BadgeStatus\n * Possible values:\n * - BadgeStatusSize.Md (8px),\n * - BadgeStatusSize.Lg (10px),\n *\n * @default AvatarBaseSize.Md\n */\n size?: BadgeStatusSize;\n /**\n * Optional prop for additional CSS classes to be applied to the BadgeStatus component.\n * These classes will be merged with the component's default classes using twMerge.\n */\n className?: string;\n /**\n * Optional CSS styles to be applied to the component.\n * Should be used sparingly and only for dynamic styles that can't be achieved with className.\n */\n style?: React.CSSProperties;\n};\n"]}
1
+ {"version":3,"file":"BadgeStatus.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeStatusPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ComponentProps } from 'react';\n\n/**\n * BadgeStatus component props (React platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns\n */\nexport type BadgeStatusProps = ComponentProps<'div'> &\n BadgeStatusPropsShared & {\n /**\n * Optional prop for additional CSS classes to be applied to the BadgeStatus component.\n * These classes will be merged with the component's default classes using twMerge.\n */\n className?: string;\n /**\n * Optional CSS styles to be applied to the component.\n * Should be used sparingly and only for dynamic styles that can't be achieved with className.\n */\n style?: React.CSSProperties;\n };\n"]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BadgeStatus = exports.BadgeStatusStatus = exports.BadgeStatusSize = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "BadgeStatusSize", { enumerable: true, get: function () { return types_1.BadgeStatusSize; } });
6
- Object.defineProperty(exports, "BadgeStatusStatus", { enumerable: true, get: function () { return types_1.BadgeStatusStatus; } });
4
+ var design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
+ Object.defineProperty(exports, "BadgeStatusSize", { enumerable: true, get: function () { return design_system_shared_1.BadgeStatusSize; } });
6
+ Object.defineProperty(exports, "BadgeStatusStatus", { enumerable: true, get: function () { return design_system_shared_1.BadgeStatusStatus; } });
7
7
  var BadgeStatus_1 = require("./BadgeStatus.cjs");
8
8
  Object.defineProperty(exports, "BadgeStatus", { enumerable: true, get: function () { return BadgeStatus_1.BadgeStatus; } });
9
9
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":";;;AAAA,+CAAiE;AAAxD,wGAAA,eAAe,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AAC3C,iDAA4C;AAAnC,0GAAA,WAAW,OAAA","sourcesContent":["export { BadgeStatusSize, BadgeStatusStatus } from '../../types';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":";;;AAAA,gFAGiD;AAF/C,uHAAA,eAAe,OAAA;AACf,yHAAA,iBAAiB,OAAA;AAEnB,iDAA4C;AAAnC,0GAAA,WAAW,OAAA","sourcesContent":["export {\n BadgeStatusSize,\n BadgeStatusStatus,\n} from '@metamask-previews/design-system-shared';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
@@ -1,4 +1,4 @@
1
- export { BadgeStatusSize, BadgeStatusStatus } from "../../types/index.cjs";
1
+ export { BadgeStatusSize, BadgeStatusStatus, } from "@metamask-previews/design-system-shared";
2
2
  export { BadgeStatus } from "./BadgeStatus.cjs";
3
3
  export type { BadgeStatusProps } from "./BadgeStatus.types.cjs";
4
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,8BAAoB;AACjE,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,GAClB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
@@ -1,4 +1,4 @@
1
- export { BadgeStatusSize, BadgeStatusStatus } from "../../types/index.mjs";
1
+ export { BadgeStatusSize, BadgeStatusStatus, } from "@metamask-previews/design-system-shared";
2
2
  export { BadgeStatus } from "./BadgeStatus.mjs";
3
3
  export type { BadgeStatusProps } from "./BadgeStatus.types.mjs";
4
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,8BAAoB;AACjE,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,GAClB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
@@ -1,3 +1,3 @@
1
- export { BadgeStatusSize, BadgeStatusStatus } from "../../types/index.mjs";
1
+ export { BadgeStatusSize, BadgeStatusStatus } from "@metamask-previews/design-system-shared";
2
2
  export { BadgeStatus } from "./BadgeStatus.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,8BAAoB;AACjE,OAAO,EAAE,WAAW,EAAE,0BAAsB","sourcesContent":["export { BadgeStatusSize, BadgeStatusStatus } from '../../types';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,0BAAsB","sourcesContent":["export {\n BadgeStatusSize,\n BadgeStatusStatus,\n} from '@metamask-previews/design-system-shared';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.BannerBase = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const types_1 = require("../../types/index.cjs");
29
+ const tw_merge_1 = require("../../utils/tw-merge.cjs");
30
+ const Box_1 = require("../Box/index.cjs");
31
+ const Button_1 = require("../Button/index.cjs");
32
+ const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
33
+ const Text_1 = require("../Text/index.cjs");
34
+ const isTextContent = (content) => typeof content === 'string' || typeof content === 'number';
35
+ const hasContent = (content) => content !== null && content !== undefined;
36
+ exports.BannerBase = (0, react_1.forwardRef)(({ title, titleProps, description, descriptionProps, children, childrenWrapperProps, actionButtonLabel, actionButtonOnClick, actionButtonProps, startAccessory, onClose, closeButtonProps, className, ...props }, ref) => {
37
+ const resolvedActionButtonProps = actionButtonProps ?? {};
38
+ const { ariaLabel: closeButtonAriaLabel = 'Close banner', onClick: closeButtonPropsOnClick, className: closeButtonClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
39
+ const shouldShowCloseButton = Boolean(onClose || closeButtonProps);
40
+ const shouldShowActionButton = Boolean(actionButtonOnClick);
41
+ return (react_1.default.createElement(Box_1.Box, { ref: ref, flexDirection: types_1.BoxFlexDirection.Row, alignItems: types_1.BoxAlignItems.Start, gap: 2, backgroundColor: types_1.BoxBackgroundColor.BackgroundDefault, padding: 3, className: (0, tw_merge_1.twMerge)('rounded-sm', className), ...props },
42
+ startAccessory,
43
+ react_1.default.createElement(Box_1.Box, { className: "min-w-0 flex-1" },
44
+ 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))),
47
+ hasContent(children) &&
48
+ (isTextContent(children) ? (react_1.default.createElement(Text_1.Text, { variant: types_1.TextVariant.BodyMd, ...childrenWrapperProps }, children)) : (children)),
49
+ shouldShowActionButton && (react_1.default.createElement(Box_1.Box, { className: "mt-4" },
50
+ 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, { "data-testid": "banner-base-close-button", 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
+ });
53
+ exports.BannerBase.displayName = 'BannerBase';
54
+ //# sourceMappingURL=BannerBase.cjs.map
@@ -0,0 +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,CAAC;IACnE,MAAM,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE5D,OAAO,CACL,8BAAC,SAAG,IACF,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,wBAAgB,CAAC,GAAG,EACnC,UAAU,EAAE,qBAAa,CAAC,KAAK,EAC/B,GAAG,EAAE,CAAC,EACN,eAAe,EAAE,0BAAkB,CAAC,iBAAiB,EACrD,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,IAAA,kBAAO,EAAC,YAAY,EAAE,SAAS,CAAC,KACvC,KAAK;QAER,cAAc;QAEf,8BAAC,SAAG,IAAC,SAAS,EAAC,gBAAgB;YAC5B,UAAU,CAAC,KAAK,CAAC;gBAChB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,8BAAC,WAAI,IACH,OAAO,EAAE,mBAAW,CAAC,MAAM,EAC3B,UAAU,EAAE,kBAAU,CAAC,MAAM,KACzB,UAAU,IAEb,KAAK,CACD,CACR,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CAAC;YAEH,UAAU,CAAC,WAAW,CAAC,IAAI,CAC1B,8BAAC,SAAG,IAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,IACnD,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAC5B,8BAAC,WAAI,IAAC,OAAO,EAAE,mBAAW,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,8BAAC,WAAI,IAAC,OAAO,EAAE,mBAAW,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,mBACG,0BAA0B,EACtC,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 data-testid=\"banner-base-close-button\"\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"]}