@metamask-previews/design-system-react 0.9.0-preview.694a8ed → 0.11.0-preview.23cc337
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.
- package/CHANGELOG.md +28 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +8 -13
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +8 -13
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.cjs +43 -0
- package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.cjs +30 -0
- package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts +7 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts +7 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.mjs +27 -0
- package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.d.cts +624 -0
- package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.d.mts +624 -0
- package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.mjs +24 -0
- package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.cjs +3 -0
- package/dist/components/BannerAlert/BannerAlert.types.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.cts +10 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.mts +10 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.mjs +2 -0
- package/dist/components/BannerAlert/BannerAlert.types.mjs.map +1 -0
- package/dist/components/BannerAlert/index.cjs +8 -0
- package/dist/components/BannerAlert/index.cjs.map +1 -0
- package/dist/components/BannerAlert/index.d.cts +4 -0
- package/dist/components/BannerAlert/index.d.cts.map +1 -0
- package/dist/components/BannerAlert/index.d.mts +4 -0
- package/dist/components/BannerAlert/index.d.mts.map +1 -0
- package/dist/components/BannerAlert/index.mjs +3 -0
- package/dist/components/BannerAlert/index.mjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.cjs +1 -1
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.cts +2 -0
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.mts +2 -0
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.mjs +1 -1
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.cts +4 -0
- package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.mts +4 -0
- package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -1
- package/dist/components/ButtonFilter/ButtonFilter.cjs +37 -0
- package/dist/components/ButtonFilter/ButtonFilter.cjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.cts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.cts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.mts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.mts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.mjs +18 -0
- package/dist/components/ButtonFilter/ButtonFilter.mjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.cjs +3 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.cjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.cts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.cts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.mts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.mts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.mjs +2 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.mjs.map +1 -0
- package/dist/components/ButtonFilter/index.cjs +6 -0
- package/dist/components/ButtonFilter/index.cjs.map +1 -0
- package/dist/components/ButtonFilter/index.d.cts +3 -0
- package/dist/components/ButtonFilter/index.d.cts.map +1 -0
- package/dist/components/ButtonFilter/index.d.mts +3 -0
- package/dist/components/ButtonFilter/index.d.mts.map +1 -0
- package/dist/components/ButtonFilter/index.mjs +2 -0
- package/dist/components/ButtonFilter/index.mjs.map +1 -0
- package/dist/components/ButtonIcon/ButtonIcon.cjs +11 -12
- package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.mjs +12 -13
- package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +4 -10
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +4 -10
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.mjs.map +1 -1
- package/dist/components/ButtonIcon/index.cjs +2 -1
- package/dist/components/ButtonIcon/index.cjs.map +1 -1
- package/dist/components/ButtonIcon/index.d.cts +1 -1
- package/dist/components/ButtonIcon/index.d.cts.map +1 -1
- package/dist/components/ButtonIcon/index.d.mts +1 -1
- package/dist/components/ButtonIcon/index.d.mts.map +1 -1
- package/dist/components/ButtonIcon/index.mjs +1 -1
- package/dist/components/ButtonIcon/index.mjs.map +1 -1
- package/dist/components/Icon/icons/Ai.cjs +1 -1
- package/dist/components/Icon/icons/Ai.cjs.map +1 -1
- package/dist/components/Icon/icons/Ai.mjs +1 -1
- package/dist/components/Icon/icons/Ai.mjs.map +1 -1
- package/dist/components/index.cjs +8 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +5 -1
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +5 -1
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +10 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +8 -0
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +8 -0
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +9 -0
- package/dist/types/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { BannerAlertSeverity } from "@metamask-previews/design-system-shared";
|
|
8
|
+
import $React, { forwardRef } from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { IconSize } from "../../types/index.mjs";
|
|
11
|
+
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
12
|
+
import { BannerBase } from "../BannerBase/index.mjs";
|
|
13
|
+
import { Icon } from "../Icon/index.mjs";
|
|
14
|
+
import { MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR, MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR, MAP_BANNER_ALERT_SEVERITY_ICON_COLOR, MAP_BANNER_ALERT_SEVERITY_ICON_NAME } from "./BannerAlert.constants.mjs";
|
|
15
|
+
export const BannerAlert = forwardRef(({ severity = BannerAlertSeverity.Info, iconProps, className, ...props }, ref) => {
|
|
16
|
+
const iconName = MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];
|
|
17
|
+
const iconColor = MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];
|
|
18
|
+
const backgroundColor = MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];
|
|
19
|
+
const borderColorClass = MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR[severity];
|
|
20
|
+
const mergedClassName = twMerge('border-l-4', borderColorClass, className);
|
|
21
|
+
return (React.createElement(BannerBase, { ref: ref, startAccessory: React.createElement(Icon, { name: iconName, color: iconColor, size: IconSize.Lg, ...iconProps }), backgroundColor: backgroundColor, paddingLeft: 2, className: mergedClassName, ...props }));
|
|
22
|
+
});
|
|
23
|
+
BannerAlert.displayName = 'BannerAlert';
|
|
24
|
+
//# sourceMappingURL=BannerAlert.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerAlert.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAC9E,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,QAAQ,EAAE,8BAAoB;AACvC,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAE/B,OAAO,EACL,0CAA0C,EAC1C,sCAAsC,EACtC,oCAAoC,EACpC,mCAAmC,EACpC,oCAAgC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CACE,EAAE,QAAQ,GAAG,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACvE,GAAG,EACH,EAAE;IACF,MAAM,QAAQ,GAAG,mCAAmC,CAAC,QAAQ,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,oCAAoC,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,eAAe,GACnB,0CAA0C,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,sCAAsC,CAAC,QAAQ,CAAC,CAAC;IAC1E,MAAM,eAAe,GAAG,OAAO,CAAC,YAAY,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC;IAE3E,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,cAAc,EACZ,oBAAC,IAAI,IACH,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,CAAC,EAAE,KACb,SAAS,GACb,EAEJ,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,CAAC,EACd,SAAS,EAAE,eAAe,KACtB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { BannerAlertSeverity } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { IconSize } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { BannerBase } from '../BannerBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR,\n MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR,\n MAP_BANNER_ALERT_SEVERITY_ICON_COLOR,\n MAP_BANNER_ALERT_SEVERITY_ICON_NAME,\n} from './BannerAlert.constants';\nimport type { BannerAlertProps } from './BannerAlert.types';\n\nexport const BannerAlert = forwardRef<HTMLDivElement, BannerAlertProps>(\n (\n { severity = BannerAlertSeverity.Info, iconProps, className, ...props },\n ref,\n ) => {\n const iconName = MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];\n const iconColor = MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];\n const backgroundColor =\n MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];\n const borderColorClass = MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR[severity];\n const mergedClassName = twMerge('border-l-4', borderColorClass, className);\n\n return (\n <BannerBase\n ref={ref}\n startAccessory={\n <Icon\n name={iconName}\n color={iconColor}\n size={IconSize.Lg}\n {...iconProps}\n />\n }\n backgroundColor={backgroundColor}\n paddingLeft={2}\n className={mergedClassName}\n {...props}\n />\n );\n },\n);\n\nBannerAlert.displayName = 'BannerAlert';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerAlert.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerAlertPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\n/**\n * BannerAlert component props (React platform-specific).\n */\nexport type BannerAlertProps = BannerAlertPropsShared &\n BannerBaseProps & {\n iconProps?: Omit<IconProps, 'name' | 'size' | 'color'>;\n };\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BannerAlertPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { BannerBaseProps } from "../BannerBase/index.cjs";
|
|
3
|
+
import type { IconProps } from "../Icon/Icon.types.cjs";
|
|
4
|
+
/**
|
|
5
|
+
* BannerAlert component props (React platform-specific).
|
|
6
|
+
*/
|
|
7
|
+
export type BannerAlertProps = BannerAlertPropsShared & BannerBaseProps & {
|
|
8
|
+
iconProps?: Omit<IconProps, 'name' | 'size' | 'color'>;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=BannerAlert.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerAlert.types.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AAEtF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,eAAe,GAAG;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACxD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BannerAlertPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { BannerBaseProps } from "../BannerBase/index.mjs";
|
|
3
|
+
import type { IconProps } from "../Icon/Icon.types.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* BannerAlert component props (React platform-specific).
|
|
6
|
+
*/
|
|
7
|
+
export type BannerAlertProps = BannerAlertPropsShared & BannerBaseProps & {
|
|
8
|
+
iconProps?: Omit<IconProps, 'name' | 'size' | 'color'>;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=BannerAlert.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerAlert.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AAEtF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,eAAe,GAAG;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerAlert.types.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerAlertPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\n/**\n * BannerAlert component props (React platform-specific).\n */\nexport type BannerAlertProps = BannerAlertPropsShared &\n BannerBaseProps & {\n iconProps?: Omit<IconProps, 'name' | 'size' | 'color'>;\n };\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BannerAlert = exports.BannerAlertSeverity = void 0;
|
|
4
|
+
var design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "BannerAlertSeverity", { enumerable: true, get: function () { return design_system_shared_1.BannerAlertSeverity; } });
|
|
6
|
+
var BannerAlert_1 = require("./BannerAlert.cjs");
|
|
7
|
+
Object.defineProperty(exports, "BannerAlert", { enumerable: true, get: function () { return BannerAlert_1.BannerAlert; } });
|
|
8
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/index.ts"],"names":[],"mappings":";;;AAAA,gFAA8E;AAArE,2HAAA,mBAAmB,OAAA;AAC5B,iDAA4C;AAAnC,0GAAA,WAAW,OAAA","sourcesContent":["export { BannerAlertSeverity } from '@metamask-previews/design-system-shared';\nexport { BannerAlert } from './BannerAlert';\nexport type { BannerAlertProps } from './BannerAlert.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAC9E,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAC9E,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAC9E,OAAO,EAAE,WAAW,EAAE,0BAAsB","sourcesContent":["export { BannerAlertSeverity } from '@metamask-previews/design-system-shared';\nexport { BannerAlert } from './BannerAlert';\nexport type { BannerAlertProps } from './BannerAlert.types';\n"]}
|
|
@@ -48,7 +48,7 @@ exports.BannerBase = (0, react_1.forwardRef)(({ title, titleProps, description,
|
|
|
48
48
|
(isTextContent(children) ? (react_1.default.createElement(Text_1.Text, { variant: types_1.TextVariant.BodyMd, ...childrenWrapperProps }, children)) : (children)),
|
|
49
49
|
shouldShowActionButton && (react_1.default.createElement(Box_1.Box, { className: "mt-4" },
|
|
50
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, {
|
|
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
52
|
});
|
|
53
53
|
exports.BannerBase.displayName = 'BannerBase';
|
|
54
54
|
//# 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,CAAC;IACnE,MAAM,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE5D,OAAO,CACL,8BAAC,SAAG,IACF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AAC,EAAE,EACnB,OAAO,EAAE,mBAAmB,KACxB,yBAAyB,IAE5B,iBAAiB,CACX,CACL,CACP,CACG;QAEL,qBAAqB,IAAI,CACxB,8BAAC,uBAAU,
|
|
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,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AE,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"]}
|
|
@@ -6,6 +6,7 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
|
|
|
6
6
|
childrenWrapperProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
|
|
7
7
|
onClose?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
8
8
|
closeButtonProps?: (Omit<Partial<import("../ButtonIcon/index.cjs").ButtonIconProps>, "onClick" | "iconName"> & {
|
|
9
|
+
'data-testid'?: string | undefined;
|
|
9
10
|
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
10
11
|
}) | undefined;
|
|
11
12
|
} & {
|
|
@@ -311,6 +312,7 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
|
|
|
311
312
|
childrenWrapperProps?: Partial<import("../Text/index.cjs").TextProps> | undefined;
|
|
312
313
|
onClose?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
313
314
|
closeButtonProps?: (Omit<Partial<import("../ButtonIcon/index.cjs").ButtonIconProps>, "onClick" | "iconName"> & {
|
|
315
|
+
'data-testid'?: string | undefined;
|
|
314
316
|
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
315
317
|
}) | undefined;
|
|
316
318
|
} & {
|
|
@@ -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,eAAO,MAAM,UAAU
|
|
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,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA0GtB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
|
|
|
6
6
|
childrenWrapperProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
|
|
7
7
|
onClose?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
8
8
|
closeButtonProps?: (Omit<Partial<import("../ButtonIcon/index.mjs").ButtonIconProps>, "onClick" | "iconName"> & {
|
|
9
|
+
'data-testid'?: string | undefined;
|
|
9
10
|
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
10
11
|
}) | undefined;
|
|
11
12
|
} & {
|
|
@@ -311,6 +312,7 @@ export declare const BannerBase: React.ForwardRefExoticComponent<(Omit<import("@
|
|
|
311
312
|
childrenWrapperProps?: Partial<import("../Text/index.mjs").TextProps> | undefined;
|
|
312
313
|
onClose?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
313
314
|
closeButtonProps?: (Omit<Partial<import("../ButtonIcon/index.mjs").ButtonIconProps>, "onClick" | "iconName"> & {
|
|
315
|
+
'data-testid'?: string | undefined;
|
|
314
316
|
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
315
317
|
}) | undefined;
|
|
316
318
|
} & {
|
|
@@ -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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA0GtB,CAAC"}
|
|
@@ -29,7 +29,7 @@ export const BannerBase = forwardRef(({ title, titleProps, description, descript
|
|
|
29
29
|
(isTextContent(children) ? (React.createElement(Text, { variant: TextVariant.BodyMd, ...childrenWrapperProps }, children)) : (children)),
|
|
30
30
|
shouldShowActionButton && (React.createElement(Box, { className: "mt-4" },
|
|
31
31
|
React.createElement(Button, { size: ButtonSize.Md, onClick: actionButtonOnClick, ...resolvedActionButtonProps }, actionButtonLabel)))),
|
|
32
|
-
shouldShowCloseButton && (React.createElement(ButtonIcon, {
|
|
32
|
+
shouldShowCloseButton && (React.createElement(ButtonIcon, { className: twMerge('ml-3 self-start', closeButtonClassName), iconName: IconName.Close, size: ButtonIconSize.Sm, ariaLabel: closeButtonAriaLabel, onClick: onClose ?? closeButtonPropsOnClick, ...resolvedCloseButtonProps }))));
|
|
33
33
|
});
|
|
34
34
|
BannerBase.displayName = 'BannerBase';
|
|
35
35
|
//# sourceMappingURL=BannerBase.mjs.map
|
|
@@ -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,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;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,C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","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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask-previews/design-system-shared';\nimport type { MouseEventHandler } from 'react';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onClick' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onClick'\n> & {\n /**\n * Optional click handler for the close button.\n */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when the title is a string.\n */\n titleProps?: Partial<TextProps>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Partial<TextProps>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Partial<TextProps>;\n /**\n * Optional click handler for the close button.\n * If provided, a close button is shown.\n */\n onClose?: MouseEventHandler<HTMLButtonElement>;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnClick: MouseEventHandler<HTMLButtonElement>;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnClick?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
1
|
+
{"version":3,"file":"BannerBase.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask-previews/design-system-shared';\nimport type { MouseEventHandler } from 'react';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onClick' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onClick'\n> & {\n /**\n * Optional test id for the close button element.\n */\n 'data-testid'?: string;\n /**\n * Optional click handler for the close button.\n */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when the title is a string.\n */\n titleProps?: Partial<TextProps>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Partial<TextProps>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Partial<TextProps>;\n /**\n * Optional click handler for the close button.\n * If provided, a close button is shown.\n */\n onClose?: MouseEventHandler<HTMLButtonElement>;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnClick: MouseEventHandler<HTMLButtonElement>;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnClick?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
@@ -6,6 +6,10 @@ import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
|
|
|
6
6
|
import type { TextProps } from "../Text/index.cjs";
|
|
7
7
|
type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onClick' | 'variant'>;
|
|
8
8
|
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onClick'> & {
|
|
9
|
+
/**
|
|
10
|
+
* Optional test id for the close button element.
|
|
11
|
+
*/
|
|
12
|
+
'data-testid'?: string;
|
|
9
13
|
/**
|
|
10
14
|
* Optional click handler for the close button.
|
|
11
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc;AAE/C,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAA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C;CACjD,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
|
|
@@ -6,6 +6,10 @@ import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
|
|
|
6
6
|
import type { TextProps } from "../Text/index.mjs";
|
|
7
7
|
type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onClick' | 'variant'>;
|
|
8
8
|
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onClick'> & {
|
|
9
|
+
/**
|
|
10
|
+
* Optional test id for the close button element.
|
|
11
|
+
*/
|
|
12
|
+
'data-testid'?: string;
|
|
9
13
|
/**
|
|
10
14
|
* Optional click handler for the close button.
|
|
11
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc;AAE/C,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,KAAK,2BAA2B,GAAG,IAAI,CACrC,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,SAAS,GAAG,SAAS,CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACpC,OAAO,CAAC,eAAe,CAAC,EACxB,UAAU,GA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AC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask-previews/design-system-shared';\nimport type { MouseEventHandler } from 'react';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onClick' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onClick'\n> & {\n /**\n * Optional click handler for the close button.\n */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when the title is a string.\n */\n titleProps?: Partial<TextProps>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Partial<TextProps>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Partial<TextProps>;\n /**\n * Optional click handler for the close button.\n * If provided, a close button is shown.\n */\n onClose?: MouseEventHandler<HTMLButtonElement>;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnClick: MouseEventHandler<HTMLButtonElement>;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnClick?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
1
|
+
{"version":3,"file":"BannerBase.types.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask-previews/design-system-shared';\nimport type { MouseEventHandler } from 'react';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onClick' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onClick'\n> & {\n /**\n * Optional test id for the close button element.\n */\n 'data-testid'?: string;\n /**\n * Optional click handler for the close button.\n */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when the title is a string.\n */\n titleProps?: Partial<TextProps>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Partial<TextProps>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Partial<TextProps>;\n /**\n * Optional click handler for the close button.\n * If provided, a close button is shown.\n */\n onClose?: MouseEventHandler<HTMLButtonElement>;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnClick: MouseEventHandler<HTMLButtonElement>;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnClick?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.ButtonFilter = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
29
|
+
const ButtonBase_1 = require("../ButtonBase/index.cjs");
|
|
30
|
+
exports.ButtonFilter = (0, react_1.forwardRef)(({ className, isActive = false, ...props }, ref) => {
|
|
31
|
+
const mergedClassName = (0, tw_merge_1.twMerge)(isActive
|
|
32
|
+
? 'bg-icon-default text-icon-inverse'
|
|
33
|
+
: 'bg-background-muted text-default', className);
|
|
34
|
+
return react_1.default.createElement(ButtonBase_1.ButtonBase, { ref: ref, className: mergedClassName, ...props });
|
|
35
|
+
});
|
|
36
|
+
exports.ButtonFilter.displayName = 'ButtonFilter';
|
|
37
|
+
//# sourceMappingURL=ButtonFilter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,uDAA+C;AAC/C,wDAA2C;AAI9B,QAAA,YAAY,GAAG,IAAA,kBAAU,EACpC,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjD,MAAM,eAAe,GAAG,IAAA,kBAAO,EAC7B,QAAQ;QACN,CAAC,CAAC,mCAAmC;QACrC,CAAC,CAAC,kCAAkC,EACtC,SAAS,CACV,CAAC;IAEF,OAAO,8BAAC,uBAAU,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,KAAM,KAAK,GAAI,CAAC;AACzE,CAAC,CACF,CAAC;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\nexport const ButtonFilter = forwardRef<HTMLButtonElement, ButtonFilterProps>(\n ({ className, isActive = false, ...props }, ref) => {\n const mergedClassName = twMerge(\n isActive\n ? 'bg-icon-default text-icon-inverse'\n : 'bg-background-muted text-default',\n className,\n );\n\n return <ButtonBase ref={ref} className={mergedClassName} {...props} />;\n },\n);\n\nButtonFilter.displayName = 'ButtonFilter';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ButtonFilterProps } from "./ButtonFilter.types.cjs";
|
|
3
|
+
export declare const ButtonFilter: React.ForwardRefExoticComponent<Omit<ButtonFilterProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
//# sourceMappingURL=ButtonFilter.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAK1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,0GAWxB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ButtonFilterProps } from "./ButtonFilter.types.mjs";
|
|
3
|
+
export declare const ButtonFilter: React.ForwardRefExoticComponent<Omit<ButtonFilterProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
//# sourceMappingURL=ButtonFilter.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAK1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,0GAWxB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $React, { forwardRef } from "react";
|
|
8
|
+
const React = $importDefault($React);
|
|
9
|
+
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
10
|
+
import { ButtonBase } from "../ButtonBase/index.mjs";
|
|
11
|
+
export const ButtonFilter = forwardRef(({ className, isActive = false, ...props }, ref) => {
|
|
12
|
+
const mergedClassName = twMerge(isActive
|
|
13
|
+
? 'bg-icon-default text-icon-inverse'
|
|
14
|
+
: 'bg-background-muted text-default', className);
|
|
15
|
+
return React.createElement(ButtonBase, { ref: ref, className: mergedClassName, ...props });
|
|
16
|
+
});
|
|
17
|
+
ButtonFilter.displayName = 'ButtonFilter';
|
|
18
|
+
//# sourceMappingURL=ButtonFilter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjD,MAAM,eAAe,GAAG,OAAO,CAC7B,QAAQ;QACN,CAAC,CAAC,mCAAmC;QACrC,CAAC,CAAC,kCAAkC,EACtC,SAAS,CACV,CAAC;IAEF,OAAO,oBAAC,UAAU,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,KAAM,KAAK,GAAI,CAAC;AACzE,CAAC,CACF,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\nexport const ButtonFilter = forwardRef<HTMLButtonElement, ButtonFilterProps>(\n ({ className, isActive = false, ...props }, ref) => {\n const mergedClassName = twMerge(\n isActive\n ? 'bg-icon-default text-icon-inverse'\n : 'bg-background-muted text-default',\n className,\n );\n\n return <ButtonBase ref={ref} className={mergedClassName} {...props} />;\n },\n);\n\nButtonFilter.displayName = 'ButtonFilter';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonFilterPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport type ButtonFilterProps = ButtonBaseProps & ButtonFilterPropsShared;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ButtonFilterPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ButtonBaseProps } from "../ButtonBase/index.cjs";
|
|
3
|
+
export type ButtonFilterProps = ButtonBaseProps & ButtonFilterPropsShared;
|
|
4
|
+
//# sourceMappingURL=ButtonFilter.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ButtonFilterPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ButtonBaseProps } from "../ButtonBase/index.mjs";
|
|
3
|
+
export type ButtonFilterProps = ButtonBaseProps & ButtonFilterPropsShared;
|
|
4
|
+
//# sourceMappingURL=ButtonFilter.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonFilterPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport type ButtonFilterProps = ButtonBaseProps & ButtonFilterPropsShared;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonFilter = void 0;
|
|
4
|
+
var ButtonFilter_1 = require("./ButtonFilter.cjs");
|
|
5
|
+
Object.defineProperty(exports, "ButtonFilter", { enumerable: true, get: function () { return ButtonFilter_1.ButtonFilter; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAArC,4GAAA,YAAY,OAAA","sourcesContent":["export { ButtonFilter } from './ButtonFilter';\nexport type { ButtonFilterProps } from './ButtonFilter.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB","sourcesContent":["export { ButtonFilter } from './ButtonFilter';\nexport type { ButtonFilterProps } from './ButtonFilter.types';\n"]}
|
|
@@ -29,26 +29,25 @@ const types_1 = require("../../types/index.cjs");
|
|
|
29
29
|
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
30
30
|
const Icon_1 = require("../Icon/index.cjs");
|
|
31
31
|
const ButtonIcon_constants_1 = require("./ButtonIcon.constants.cjs");
|
|
32
|
-
exports.ButtonIcon = (0, react_1.forwardRef)(({ className, iconName, iconProps, ariaLabel, isDisabled = false,
|
|
32
|
+
exports.ButtonIcon = (0, react_1.forwardRef)(({ className, iconName, iconProps, ariaLabel, isDisabled = false, variant = types_1.ButtonIconVariant.Default, size = types_1.ButtonIconSize.Md, style, ...props }, ref) => {
|
|
33
33
|
const isInteractive = !isDisabled;
|
|
34
34
|
const mergedClassName = (0, tw_merge_1.twMerge)(
|
|
35
35
|
// Base styles
|
|
36
36
|
'inline-flex items-center justify-center p-0',
|
|
37
37
|
// Size styles
|
|
38
38
|
ButtonIcon_constants_1.TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
'rounded-full',
|
|
42
|
-
!isInverse && 'bg-icon-default text-background-default',
|
|
43
|
-
isInverse && 'bg-icon-default text-background-default',
|
|
44
|
-
],
|
|
45
|
-
// Non-floating styles
|
|
46
|
-
!isFloating && [
|
|
39
|
+
// Variant styles
|
|
40
|
+
variant === types_1.ButtonIconVariant.Default && [
|
|
47
41
|
'rounded-lg bg-transparent',
|
|
48
|
-
// Only apply hover/active styles when interactive
|
|
49
42
|
isInteractive && 'hover:bg-hover active:bg-pressed',
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
'text-icon-default',
|
|
44
|
+
], variant === types_1.ButtonIconVariant.Floating && [
|
|
45
|
+
'rounded-full',
|
|
46
|
+
'bg-icon-default text-background-default',
|
|
47
|
+
], variant === types_1.ButtonIconVariant.Filled && [
|
|
48
|
+
'rounded-full',
|
|
49
|
+
'bg-muted text-icon-default',
|
|
50
|
+
isInteractive && 'hover:bg-muted-hover active:bg-muted-pressed',
|
|
52
51
|
],
|
|
53
52
|
// Disabled state
|
|
54
53
|
isDisabled && 'cursor-not-allowed opacity-50', className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,
|
|
1
|
+
{"version":3,"file":"ButtonIcon.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,iDAAgE;AAChE,uDAA+C;AAC/C,4CAA+B;AAE/B,qEAGgC;AAGnB,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,yBAAiB,CAAC,OAAO,EACnC,IAAI,GAAG,sBAAc,CAAC,EAAE,EACxB,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,aAAa,GAAG,CAAC,UAAU,CAAC;IAElC,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,cAAc;IACd,6CAA6C;IAC7C,cAAc;IACd,2DAAoC,CAAC,IAAI,CAAC;IAC1C,iBAAiB;IACjB,OAAO,KAAK,yBAAiB,CAAC,OAAO,IAAI;QACvC,2BAA2B;QAC3B,aAAa,IAAI,kCAAkC;QACnD,mBAAmB;KACpB,EACD,OAAO,KAAK,yBAAiB,CAAC,QAAQ,IAAI;QACxC,cAAc;QACd,yCAAyC;KAC1C,EACD,OAAO,KAAK,yBAAiB,CAAC,MAAM,IAAI;QACtC,cAAc;QACd,4BAA4B;QAC5B,aAAa,IAAI,8CAA8C;KAChE;IACD,iBAAiB;IACjB,UAAU,IAAI,+BAA+B,EAC7C,SAAS,CACV,CAAC;IAEF,OAAO,CACL,0CACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,QAAQ,EAAE,UAAU,gBACR,SAAS,EACrB,KAAK,EAAE,KAAK,KACR,KAAK;QAET,8BAAC,WAAI,IACH,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,mDAA4B,CAAC,IAAI,CAAC,EACxC,SAAS,EAAE,IAAA,kBAAO,EAAC,cAAc,EAAE,SAAS,EAAE,SAAS,CAAC,KACpD,SAAS,GACb,CACK,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { ButtonIconSize, ButtonIconVariant } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport { Icon } from '../Icon';\n\nimport {\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION,\n MAP_BUTTONICON_SIZE_ICONSIZE,\n} from './ButtonIcon.constants';\nimport type { ButtonIconProps } from './ButtonIcon.types';\n\nexport const ButtonIcon = forwardRef<HTMLButtonElement, ButtonIconProps>(\n (\n {\n className,\n iconName,\n iconProps,\n ariaLabel,\n isDisabled = false,\n variant = ButtonIconVariant.Default,\n size = ButtonIconSize.Md,\n style,\n ...props\n },\n ref,\n ) => {\n const isInteractive = !isDisabled;\n\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex items-center justify-center p-0',\n // Size styles\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],\n // Variant styles\n variant === ButtonIconVariant.Default && [\n 'rounded-lg bg-transparent',\n isInteractive && 'hover:bg-hover active:bg-pressed',\n 'text-icon-default',\n ],\n variant === ButtonIconVariant.Floating && [\n 'rounded-full',\n 'bg-icon-default text-background-default',\n ],\n variant === ButtonIconVariant.Filled && [\n 'rounded-full',\n 'bg-muted text-icon-default',\n isInteractive && 'hover:bg-muted-hover active:bg-muted-pressed',\n ],\n // Disabled state\n isDisabled && 'cursor-not-allowed opacity-50',\n className,\n );\n\n return (\n <button\n ref={ref}\n className={mergedClassName}\n disabled={isDisabled}\n aria-label={ariaLabel}\n style={style}\n {...props}\n >\n <Icon\n name={iconName}\n size={MAP_BUTTONICON_SIZE_ICONSIZE[size]}\n className={twMerge('text-inherit', iconProps?.className)}\n {...iconProps}\n />\n </button>\n );\n },\n);\n\nButtonIcon.displayName = 'ButtonIcon';\n"]}
|