@metamask-previews/design-system-react-native 0.30.2-preview.25db973 → 0.30.2-preview.ba3ace4e
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/dist/components/BannerAlert/BannerAlert.cjs +2 -5
- package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.cjs +4 -7
- package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts +1 -2
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts +1 -2
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.mjs +4 -7
- package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.mjs +3 -6
- package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +5 -8
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.mjs +6 -9
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.cjs +2 -0
- package/dist/components/ButtonIcon/ButtonIcon.constants.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts +1 -0
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts +1 -0
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.mjs +2 -0
- package/dist/components/ButtonIcon/ButtonIcon.constants.mjs.map +1 -1
- package/dist/components/MainActionButton/MainActionButton.cjs +1 -1
- package/dist/components/MainActionButton/MainActionButton.cjs.map +1 -1
- package/dist/components/MainActionButton/MainActionButton.mjs +1 -1
- package/dist/components/MainActionButton/MainActionButton.mjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.cjs +10 -3
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.cts +1 -0
- package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.mts +1 -0
- package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.mjs +10 -3
- package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -5,18 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BannerAlert = void 0;
|
|
7
7
|
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
8
|
-
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
10
9
|
const BannerBase_1 = require("../BannerBase/index.cjs");
|
|
11
10
|
const Icon_1 = require("../Icon/index.cjs");
|
|
12
11
|
const BannerAlert_constants_1 = require("./BannerAlert.constants.cjs");
|
|
13
|
-
const BannerAlert = ({ severity = design_system_shared_1.BannerAlertSeverity.Info, iconProps,
|
|
14
|
-
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
12
|
+
const BannerAlert = ({ severity = design_system_shared_1.BannerAlertSeverity.Info, iconProps, ...props }) => {
|
|
15
13
|
const iconName = BannerAlert_constants_1.MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];
|
|
16
14
|
const iconColor = BannerAlert_constants_1.MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];
|
|
17
15
|
const backgroundColor = BannerAlert_constants_1.MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];
|
|
18
|
-
|
|
19
|
-
return (<BannerBase_1.BannerBase startAccessory={<Icon_1.Icon name={iconName} color={iconColor} size={design_system_shared_1.IconSize.Lg} {...iconProps}/>} backgroundColor={backgroundColor} paddingLeft={2} style={[tw.style(`border-l-4 ${borderColorClass}`), style]} {...props}/>);
|
|
16
|
+
return (<BannerBase_1.BannerBase startAccessory={<Icon_1.Icon name={iconName} color={iconColor} size={design_system_shared_1.IconSize.Lg} {...iconProps}/>} backgroundColor={backgroundColor} {...props}/>);
|
|
20
17
|
};
|
|
21
18
|
exports.BannerAlert = BannerAlert;
|
|
22
19
|
//# sourceMappingURL=BannerAlert.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAlert.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAAwF;AACxF,
|
|
1
|
+
{"version":3,"file":"BannerAlert.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAAwF;AACxF,kDAA0B;AAE1B,wDAA2C;AAC3C,4CAA+B;AAE/B,uEAIiC;AAG1B,MAAM,WAAW,GAA+B,CAAC,EACtD,QAAQ,GAAG,0CAAmB,CAAC,IAAI,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,2DAAmC,CAAC,QAAQ,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,4DAAoC,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,eAAe,GAAG,kEAA0C,CAAC,QAAQ,CAAC,CAAC;IAC7E,OAAO,CACL,CAAC,uBAAU,CACT,cAAc,CAAC,CACb,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,SAAS,CAAC,EACd,CACH,CACD,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,WAAW,eAsBtB","sourcesContent":["import { BannerAlertSeverity, IconSize } from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { BannerBase } from '../BannerBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_BANNER_ALERT_SEVERITY_BACKGROUND_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: React.FC<BannerAlertProps> = ({\n severity = BannerAlertSeverity.Info,\n iconProps,\n ...props\n}) => {\n const iconName = MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];\n const iconColor = MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];\n const backgroundColor = MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];\n return (\n <BannerBase\n startAccessory={\n <Icon\n name={iconName}\n color={iconColor}\n size={IconSize.Lg}\n {...iconProps}\n />\n }\n backgroundColor={backgroundColor}\n {...props}\n />\n );\n};\n"]}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR = exports.MAP_BANNER_ALERT_SEVERITY_ICON_COLOR = exports.MAP_BANNER_ALERT_SEVERITY_ICON_NAME = void 0;
|
|
4
4
|
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
5
|
exports.MAP_BANNER_ALERT_SEVERITY_ICON_NAME = {
|
|
6
|
+
neutral: design_system_shared_1.IconName.Info,
|
|
6
7
|
info: design_system_shared_1.IconName.Info,
|
|
7
8
|
success: design_system_shared_1.IconName.Confirmation,
|
|
8
9
|
warning: design_system_shared_1.IconName.Danger,
|
|
9
10
|
danger: design_system_shared_1.IconName.Danger,
|
|
10
11
|
};
|
|
11
12
|
exports.MAP_BANNER_ALERT_SEVERITY_ICON_COLOR = {
|
|
13
|
+
neutral: design_system_shared_1.IconColor.IconDefault,
|
|
12
14
|
info: design_system_shared_1.IconColor.PrimaryDefault,
|
|
13
15
|
success: design_system_shared_1.IconColor.SuccessDefault,
|
|
14
16
|
warning: design_system_shared_1.IconColor.WarningDefault,
|
|
15
17
|
danger: design_system_shared_1.IconColor.ErrorDefault,
|
|
16
18
|
};
|
|
17
19
|
exports.MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR = {
|
|
20
|
+
neutral: design_system_shared_1.BoxBackgroundColor.BackgroundSection,
|
|
18
21
|
info: design_system_shared_1.BoxBackgroundColor.PrimaryMuted,
|
|
19
22
|
success: design_system_shared_1.BoxBackgroundColor.SuccessMuted,
|
|
20
23
|
warning: design_system_shared_1.BoxBackgroundColor.WarningMuted,
|
|
21
24
|
danger: design_system_shared_1.BoxBackgroundColor.ErrorMuted,
|
|
22
25
|
};
|
|
23
|
-
exports.MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR = {
|
|
24
|
-
info: design_system_shared_1.BoxBorderColor.PrimaryDefault,
|
|
25
|
-
success: design_system_shared_1.BoxBorderColor.SuccessDefault,
|
|
26
|
-
warning: design_system_shared_1.BoxBorderColor.WarningDefault,
|
|
27
|
-
danger: design_system_shared_1.BoxBorderColor.ErrorDefault,
|
|
28
|
-
};
|
|
29
26
|
//# sourceMappingURL=BannerAlert.constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAlert.constants.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"BannerAlert.constants.cjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":";;;AAAA,kFAKiD;AAEpC,QAAA,mCAAmC,GAG5C;IACF,OAAO,EAAE,+BAAQ,CAAC,IAAI;IACtB,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,OAAO,EAAE,gCAAS,CAAC,WAAW;IAC9B,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,OAAO,EAAE,yCAAkB,CAAC,iBAAiB;IAC7C,IAAI,EAAE,yCAAkB,CAAC,YAAY;IACrC,OAAO,EAAE,yCAAkB,CAAC,YAAY;IACxC,OAAO,EAAE,yCAAkB,CAAC,YAAY;IACxC,MAAM,EAAE,yCAAkB,CAAC,UAAU;CACtC,CAAC","sourcesContent":["import {\n BannerAlertSeverity,\n BoxBackgroundColor,\n IconColor,\n IconName,\n} from '@metamask-previews/design-system-shared';\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconName\n> = {\n neutral: IconName.Info,\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 neutral: IconColor.IconDefault,\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 neutral: BoxBackgroundColor.BackgroundSection,\n info: BoxBackgroundColor.PrimaryMuted,\n success: BoxBackgroundColor.SuccessMuted,\n warning: BoxBackgroundColor.WarningMuted,\n danger: BoxBackgroundColor.ErrorMuted,\n};\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { BannerAlertSeverity, BoxBackgroundColor,
|
|
1
|
+
import { BannerAlertSeverity, BoxBackgroundColor, IconColor, IconName } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export declare const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconName>;
|
|
3
3
|
export declare const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconColor>;
|
|
4
4
|
export declare const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBackgroundColor>;
|
|
5
|
-
export declare const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBorderColor>;
|
|
6
5
|
//# sourceMappingURL=BannerAlert.constants.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAlert.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"BannerAlert.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACT,gDAAgD;AAEjD,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,QAAQ,CAOT,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,SAAS,CAOV,CAAC;AAEF,eAAO,MAAM,0CAA0C,EAAE,MAAM,CAC7D,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,kBAAkB,CAOnB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { BannerAlertSeverity, BoxBackgroundColor,
|
|
1
|
+
import { BannerAlertSeverity, BoxBackgroundColor, IconColor, IconName } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export declare const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconName>;
|
|
3
3
|
export declare const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], IconColor>;
|
|
4
4
|
export declare const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBackgroundColor>;
|
|
5
|
-
export declare const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR: Record<(typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity], BoxBorderColor>;
|
|
6
5
|
//# sourceMappingURL=BannerAlert.constants.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAlert.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"BannerAlert.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACT,gDAAgD;AAEjD,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,QAAQ,CAOT,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,SAAS,CAOV,CAAC;AAEF,eAAO,MAAM,0CAA0C,EAAE,MAAM,CAC7D,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,kBAAkB,CAOnB,CAAC"}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import { BannerAlertSeverity, BoxBackgroundColor,
|
|
1
|
+
import { BannerAlertSeverity, BoxBackgroundColor, IconColor, IconName } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export const MAP_BANNER_ALERT_SEVERITY_ICON_NAME = {
|
|
3
|
+
neutral: IconName.Info,
|
|
3
4
|
info: IconName.Info,
|
|
4
5
|
success: IconName.Confirmation,
|
|
5
6
|
warning: IconName.Danger,
|
|
6
7
|
danger: IconName.Danger,
|
|
7
8
|
};
|
|
8
9
|
export const MAP_BANNER_ALERT_SEVERITY_ICON_COLOR = {
|
|
10
|
+
neutral: IconColor.IconDefault,
|
|
9
11
|
info: IconColor.PrimaryDefault,
|
|
10
12
|
success: IconColor.SuccessDefault,
|
|
11
13
|
warning: IconColor.WarningDefault,
|
|
12
14
|
danger: IconColor.ErrorDefault,
|
|
13
15
|
};
|
|
14
16
|
export const MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR = {
|
|
17
|
+
neutral: BoxBackgroundColor.BackgroundSection,
|
|
15
18
|
info: BoxBackgroundColor.PrimaryMuted,
|
|
16
19
|
success: BoxBackgroundColor.SuccessMuted,
|
|
17
20
|
warning: BoxBackgroundColor.WarningMuted,
|
|
18
21
|
danger: BoxBackgroundColor.ErrorMuted,
|
|
19
22
|
};
|
|
20
|
-
export const MAP_BANNER_ALERT_SEVERITY_BORDER_COLOR = {
|
|
21
|
-
info: BoxBorderColor.PrimaryDefault,
|
|
22
|
-
success: BoxBorderColor.SuccessDefault,
|
|
23
|
-
warning: BoxBorderColor.WarningDefault,
|
|
24
|
-
danger: BoxBorderColor.ErrorDefault,
|
|
25
|
-
};
|
|
26
23
|
//# sourceMappingURL=BannerAlert.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAlert.constants.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"BannerAlert.constants.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACT,gDAAgD;AAEjD,MAAM,CAAC,MAAM,mCAAmC,GAG5C;IACF,OAAO,EAAE,QAAQ,CAAC,IAAI;IACtB,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,OAAO,EAAE,SAAS,CAAC,WAAW;IAC9B,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,OAAO,EAAE,kBAAkB,CAAC,iBAAiB;IAC7C,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","sourcesContent":["import {\n BannerAlertSeverity,\n BoxBackgroundColor,\n IconColor,\n IconName,\n} from '@metamask-previews/design-system-shared';\n\nexport const MAP_BANNER_ALERT_SEVERITY_ICON_NAME: Record<\n (typeof BannerAlertSeverity)[keyof typeof BannerAlertSeverity],\n IconName\n> = {\n neutral: IconName.Info,\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 neutral: IconColor.IconDefault,\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 neutral: BoxBackgroundColor.BackgroundSection,\n info: BoxBackgroundColor.PrimaryMuted,\n success: BoxBackgroundColor.SuccessMuted,\n warning: BoxBackgroundColor.WarningMuted,\n danger: BoxBackgroundColor.ErrorMuted,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAlert.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BannerAlert.d.cts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAsBlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAlert.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BannerAlert.d.mts","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAsBlD,CAAC"}
|
|
@@ -5,18 +5,15 @@ function $importDefault(module) {
|
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
7
|
import { BannerAlertSeverity, IconSize } from "@metamask-previews/design-system-shared";
|
|
8
|
-
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
9
8
|
import $React from "react";
|
|
10
9
|
const React = $importDefault($React);
|
|
11
10
|
import { BannerBase } from "../BannerBase/index.mjs";
|
|
12
11
|
import { Icon } from "../Icon/index.mjs";
|
|
13
|
-
import { MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR, MAP_BANNER_ALERT_SEVERITY_ICON_COLOR, MAP_BANNER_ALERT_SEVERITY_ICON_NAME
|
|
14
|
-
export const BannerAlert = ({ severity = BannerAlertSeverity.Info, iconProps,
|
|
15
|
-
const tw = useTailwind();
|
|
12
|
+
import { MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR, MAP_BANNER_ALERT_SEVERITY_ICON_COLOR, MAP_BANNER_ALERT_SEVERITY_ICON_NAME } from "./BannerAlert.constants.mjs";
|
|
13
|
+
export const BannerAlert = ({ severity = BannerAlertSeverity.Info, iconProps, ...props }) => {
|
|
16
14
|
const iconName = MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];
|
|
17
15
|
const iconColor = MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];
|
|
18
16
|
const backgroundColor = MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];
|
|
19
|
-
|
|
20
|
-
return (<BannerBase startAccessory={<Icon name={iconName} color={iconColor} size={IconSize.Lg} {...iconProps}/>} backgroundColor={backgroundColor} paddingLeft={2} style={[tw.style(`border-l-4 ${borderColorClass}`), style]} {...props}/>);
|
|
17
|
+
return (<BannerBase startAccessory={<Icon name={iconName} color={iconColor} size={IconSize.Lg} {...iconProps}/>} backgroundColor={backgroundColor} {...props}/>);
|
|
21
18
|
};
|
|
22
19
|
//# sourceMappingURL=BannerAlert.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAlert.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gDAAgD;AACxF,OAAO,
|
|
1
|
+
{"version":3,"file":"BannerAlert.mjs","sourceRoot":"","sources":["../../../src/components/BannerAlert/BannerAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gDAAgD;AACxF,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAE/B,OAAO,EACL,0CAA0C,EAC1C,oCAAoC,EACpC,mCAAmC,EACpC,oCAAgC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACtD,QAAQ,GAAG,mBAAmB,CAAC,IAAI,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,mCAAmC,CAAC,QAAQ,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,oCAAoC,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,eAAe,GAAG,0CAA0C,CAAC,QAAQ,CAAC,CAAC;IAC7E,OAAO,CACL,CAAC,UAAU,CACT,cAAc,CAAC,CACb,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,SAAS,CAAC,EACd,CACH,CACD,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BannerAlertSeverity, IconSize } from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { BannerBase } from '../BannerBase';\nimport { Icon } from '../Icon';\n\nimport {\n MAP_BANNER_ALERT_SEVERITY_BACKGROUND_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: React.FC<BannerAlertProps> = ({\n severity = BannerAlertSeverity.Info,\n iconProps,\n ...props\n}) => {\n const iconName = MAP_BANNER_ALERT_SEVERITY_ICON_NAME[severity];\n const iconColor = MAP_BANNER_ALERT_SEVERITY_ICON_COLOR[severity];\n const backgroundColor = MAP_BANNER_ALERT_SEVERITY_BACKGROUND_COLOR[severity];\n return (\n <BannerBase\n startAccessory={\n <Icon\n name={iconName}\n color={iconColor}\n size={IconSize.Lg}\n {...iconProps}\n />\n }\n backgroundColor={backgroundColor}\n {...props}\n />\n );\n};\n"]}
|
|
@@ -17,10 +17,7 @@ const BannerBase = ({ title, titleProps, description, descriptionProps, children
|
|
|
17
17
|
const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner', twClassName: closeButtonTwClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
|
|
18
18
|
const shouldShowCloseButton = Boolean(onClose);
|
|
19
19
|
const shouldShowActionButton = Boolean(actionButtonOnPress);
|
|
20
|
-
|
|
21
|
-
? `ml-3 ${closeButtonTwClassName}`
|
|
22
|
-
: 'ml-3';
|
|
23
|
-
return (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Start} gap={2} backgroundColor={design_system_shared_1.BoxBackgroundColor.BackgroundDefault} padding={3} twClassName={(0, design_system_shared_1.mergeTwClassName)('rounded-sm', twClassName)} {...props}>
|
|
20
|
+
return (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Start} gap={4} backgroundColor={design_system_shared_1.BoxBackgroundColor.BackgroundDefault} paddingVertical={3} paddingHorizontal={4} twClassName={(0, design_system_shared_1.mergeTwClassName)('rounded-xl', twClassName)} {...props}>
|
|
24
21
|
{startAccessory}
|
|
25
22
|
|
|
26
23
|
<Box_1.Box twClassName="flex-1">
|
|
@@ -29,7 +26,7 @@ const BannerBase = ({ title, titleProps, description, descriptionProps, children
|
|
|
29
26
|
{title}
|
|
30
27
|
</Text_1.Text>) : (title))}
|
|
31
28
|
|
|
32
|
-
{hasContent(description) && (<Box_1.Box
|
|
29
|
+
{hasContent(description) && (<Box_1.Box>
|
|
33
30
|
{isTextContent(description) ? (<Text_1.Text variant={design_system_shared_1.TextVariant.BodySm} {...descriptionProps}>
|
|
34
31
|
{description}
|
|
35
32
|
</Text_1.Text>) : (description)}
|
|
@@ -40,14 +37,14 @@ const BannerBase = ({ title, titleProps, description, descriptionProps, children
|
|
|
40
37
|
{children}
|
|
41
38
|
</Text_1.Text>) : (children))}
|
|
42
39
|
|
|
43
|
-
{shouldShowActionButton && (<Box_1.Box twClassName="mt-
|
|
44
|
-
<Button_1.Button size={design_system_shared_1.ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps}>
|
|
40
|
+
{shouldShowActionButton && (<Box_1.Box twClassName="mt-2">
|
|
41
|
+
<Button_1.Button size={design_system_shared_1.ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps} variant={design_system_shared_1.ButtonVariant.Secondary}>
|
|
45
42
|
{actionButtonLabel}
|
|
46
43
|
</Button_1.Button>
|
|
47
44
|
</Box_1.Box>)}
|
|
48
45
|
</Box_1.Box>
|
|
49
46
|
|
|
50
|
-
{shouldShowCloseButton && (<ButtonIcon_1.ButtonIcon twClassName={
|
|
47
|
+
{shouldShowCloseButton && (<ButtonIcon_1.ButtonIcon twClassName={(0, design_system_shared_1.mergeTwClassName)('-mt-1', closeButtonTwClassName)} iconName={design_system_shared_1.IconName.Close} size={design_system_shared_1.ButtonIconSize.Md} accessibilityLabel={closeButtonAccessibilityLabel} onPress={onClose} {...resolvedCloseButtonProps}/>)}
|
|
51
48
|
</Box_1.Box>);
|
|
52
49
|
};
|
|
53
50
|
exports.BannerBase = BannerBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../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AC,CAAC,iCAAU,CAAC,EAAE,CAAC,CACpB,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAC7B,IAAI,yBAAyB,CAAC,CAC9B,OAAO,CAAC,CAAC,oCAAa,CAAC,SAAS,CAAC,CAEjC;cAAA,CAAC,iBAAiB,CACpB;YAAA,EAAE,eAAM,CACV;UAAA,EAAE,SAAG,CAAC,CACP,CACH;MAAA,EAAE,SAAG,CAEL;;MAAA,CAAC,qBAAqB,IAAI,CACxB,CAAC,uBAAU,CACT,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAC/D,QAAQ,CAAC,CAAC,+BAAQ,CAAC,KAAK,CAAC,CACzB,IAAI,CAAC,CAAC,qCAAc,CAAC,EAAE,CAAC,CACxB,kBAAkB,CAAC,CAAC,6BAA6B,CAAC,CAClD,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,wBAAwB,CAAC,EAC7B,CACH,CACH;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AArGW,QAAA,UAAU,cAqGrB","sourcesContent":["import {\n BoxAlignItems,\n BoxBackgroundColor,\n BoxFlexDirection,\n ButtonIconSize,\n ButtonSize,\n ButtonVariant,\n FontWeight,\n IconName,\n mergeTwClassName,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\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: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={4}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n paddingVertical={3}\n paddingHorizontal={4}\n twClassName={mergeTwClassName('rounded-xl', twClassName)}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"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>\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 twClassName=\"mt-2\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n variant={ButtonVariant.Secondary}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n twClassName={mergeTwClassName('-mt-1', closeButtonTwClassName)}\n iconName={IconName.Close}\n size={ButtonIconSize.Md}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={onClose}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAQ1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqGhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BannerBase.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAQ1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqGhD,CAAC"}
|
|
@@ -4,7 +4,7 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import { BoxAlignItems, BoxBackgroundColor, BoxFlexDirection, ButtonIconSize, ButtonSize, FontWeight, IconName, mergeTwClassName, TextVariant } from "@metamask-previews/design-system-shared";
|
|
7
|
+
import { BoxAlignItems, BoxBackgroundColor, BoxFlexDirection, ButtonIconSize, ButtonSize, ButtonVariant, FontWeight, IconName, mergeTwClassName, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
8
|
import $React from "react";
|
|
9
9
|
const React = $importDefault($React);
|
|
10
10
|
import { Box } from "../Box/index.mjs";
|
|
@@ -18,10 +18,7 @@ export const BannerBase = ({ title, titleProps, description, descriptionProps, c
|
|
|
18
18
|
const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner', twClassName: closeButtonTwClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
|
|
19
19
|
const shouldShowCloseButton = Boolean(onClose);
|
|
20
20
|
const shouldShowActionButton = Boolean(actionButtonOnPress);
|
|
21
|
-
|
|
22
|
-
? `ml-3 ${closeButtonTwClassName}`
|
|
23
|
-
: 'ml-3';
|
|
24
|
-
return (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Start} gap={2} backgroundColor={BoxBackgroundColor.BackgroundDefault} padding={3} twClassName={mergeTwClassName('rounded-sm', twClassName)} {...props}>
|
|
21
|
+
return (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Start} gap={4} backgroundColor={BoxBackgroundColor.BackgroundDefault} paddingVertical={3} paddingHorizontal={4} twClassName={mergeTwClassName('rounded-xl', twClassName)} {...props}>
|
|
25
22
|
{startAccessory}
|
|
26
23
|
|
|
27
24
|
<Box twClassName="flex-1">
|
|
@@ -30,7 +27,7 @@ export const BannerBase = ({ title, titleProps, description, descriptionProps, c
|
|
|
30
27
|
{title}
|
|
31
28
|
</Text>) : (title))}
|
|
32
29
|
|
|
33
|
-
{hasContent(description) && (<Box
|
|
30
|
+
{hasContent(description) && (<Box>
|
|
34
31
|
{isTextContent(description) ? (<Text variant={TextVariant.BodySm} {...descriptionProps}>
|
|
35
32
|
{description}
|
|
36
33
|
</Text>) : (description)}
|
|
@@ -41,14 +38,14 @@ export const BannerBase = ({ title, titleProps, description, descriptionProps, c
|
|
|
41
38
|
{children}
|
|
42
39
|
</Text>) : (children))}
|
|
43
40
|
|
|
44
|
-
{shouldShowActionButton && (<Box twClassName="mt-
|
|
45
|
-
<Button size={ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps}>
|
|
41
|
+
{shouldShowActionButton && (<Box twClassName="mt-2">
|
|
42
|
+
<Button size={ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps} variant={ButtonVariant.Secondary}>
|
|
46
43
|
{actionButtonLabel}
|
|
47
44
|
</Button>
|
|
48
45
|
</Box>)}
|
|
49
46
|
</Box>
|
|
50
47
|
|
|
51
|
-
{shouldShowCloseButton && (<ButtonIcon twClassName={
|
|
48
|
+
{shouldShowCloseButton && (<ButtonIcon twClassName={mergeTwClassName('-mt-1', closeButtonTwClassName)} iconName={IconName.Close} size={ButtonIconSize.Md} accessibilityLabel={closeButtonAccessibilityLabel} onPress={onClose} {...resolvedCloseButtonProps}/>)}
|
|
52
49
|
</Box>);
|
|
53
50
|
};
|
|
54
51
|
//# sourceMappingURL=BannerBase.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,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,GAA8B,CAAC,EACpD,KAAK,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,yBAAy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,CAAC,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxBackgroundColor,\n BoxFlexDirection,\n ButtonIconSize,\n ButtonSize,\n ButtonVariant,\n FontWeight,\n IconName,\n mergeTwClassName,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\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: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={4}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n paddingVertical={3}\n paddingHorizontal={4}\n twClassName={mergeTwClassName('rounded-xl', twClassName)}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"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>\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 twClassName=\"mt-2\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n variant={ButtonVariant.Secondary}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n twClassName={mergeTwClassName('-mt-1', closeButtonTwClassName)}\n iconName={IconName.Close}\n size={ButtonIconSize.Md}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={onClose}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
|
|
@@ -21,7 +21,7 @@ const BottomSheetFooter = ({ style, twClassName, buttonsAlignment = BottomSheetF
|
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
return (<react_native_1.View style={[
|
|
24
|
-
tw.style(isHorizontal ? 'flex-row' : 'flex-col', 'px-
|
|
24
|
+
tw.style(isHorizontal ? 'flex-row' : 'flex-col', 'px-4 py-0', twClassName),
|
|
25
25
|
style,
|
|
26
26
|
]} {...props}>
|
|
27
27
|
{secondaryButtonProps && (<Button_1.Button {...secondaryButtonProps} variant={Button_1.ButtonVariant.Secondary} style={[tw.style(buttonBaseClass), secondaryButtonProps.style]}/>)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetFooter.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAoC;AAEpC,yBAAyB;AACzB,gDAAkD;AAIlD,2EAA6D;AAEtD,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,gBAAgB,GAAG,0CAAgB,CAAC,UAAU,EAC9C,kB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AAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAlDW,QAAA,iBAAiB,qBAkD5B","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\n// External dependencies.\nimport { Button, ButtonVariant } from '../Button';\n\n// Internal dependencies.\nimport type { BottomSheetFooterProps } from './BottomSheetFooter.types';\nimport { ButtonsAlignment } from './BottomSheetFooter.types';\n\nexport const BottomSheetFooter: React.FC<BottomSheetFooterProps> = ({\n style,\n twClassName,\n buttonsAlignment = ButtonsAlignment.Horizontal,\n primaryButtonProps,\n secondaryButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;\n const buttonBaseClass = isHorizontal ? 'flex-1' : 'self-stretch';\n const gapClass = isHorizontal ? 'ml-4' : 'mt-4';\n const hasBothButtons =\n Boolean(primaryButtonProps) && Boolean(secondaryButtonProps);\n\n if (!primaryButtonProps && !secondaryButtonProps) {\n return null;\n }\n\n return (\n <View\n style={[\n tw.style(\n isHorizontal ? 'flex-row' : 'flex-col',\n 'px-
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAoC;AAEpC,yBAAyB;AACzB,gDAAkD;AAIlD,2EAA6D;AAEtD,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,gBAAgB,GAAG,0CAAgB,CAAC,UAAU,EAC9C,kBAAkB,EAClB,oBAAoB,EACpB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,YAAY,GAAG,gBAAgB,KAAK,0CAAgB,CAAC,UAAU,CAAC;IACtE,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC;IACjE,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,cAAc,GAClB,OAAO,CAAC,kBAAkB,CAAC,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE/D,IAAI,CAAC,kBAAkB,IAAI,CAAC,oBAAoB,EAAE;QAChD,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EACtC,WAAW,EACX,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,oBAAoB,IAAI,CACvB,CAAC,eAAM,CACL,IAAI,oBAAoB,CAAC,CACzB,OAAO,CAAC,CAAC,sBAAa,CAAC,SAAS,CAAC,CACjC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAC/D,CACH,CACD;MAAA,CAAC,kBAAkB,IAAI,CACrB,CAAC,eAAM,CACL,IAAI,kBAAkB,CAAC,CACvB,OAAO,CAAC,CAAC,sBAAa,CAAC,OAAO,CAAC,CAC/B,KAAK,CAAC,CAAC;gBACL,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,cAAc,IAAI,QAAQ,CAAC;gBACrD,kBAAkB,CAAC,KAAK;aACzB,CAAC,EACF,CACH,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAlDW,QAAA,iBAAiB,qBAkD5B","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\n// External dependencies.\nimport { Button, ButtonVariant } from '../Button';\n\n// Internal dependencies.\nimport type { BottomSheetFooterProps } from './BottomSheetFooter.types';\nimport { ButtonsAlignment } from './BottomSheetFooter.types';\n\nexport const BottomSheetFooter: React.FC<BottomSheetFooterProps> = ({\n style,\n twClassName,\n buttonsAlignment = ButtonsAlignment.Horizontal,\n primaryButtonProps,\n secondaryButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;\n const buttonBaseClass = isHorizontal ? 'flex-1' : 'self-stretch';\n const gapClass = isHorizontal ? 'ml-4' : 'mt-4';\n const hasBothButtons =\n Boolean(primaryButtonProps) && Boolean(secondaryButtonProps);\n\n if (!primaryButtonProps && !secondaryButtonProps) {\n return null;\n }\n\n return (\n <View\n style={[\n tw.style(\n isHorizontal ? 'flex-row' : 'flex-col',\n 'px-4 py-0',\n twClassName,\n ),\n style,\n ]}\n {...props}\n >\n {secondaryButtonProps && (\n <Button\n {...secondaryButtonProps}\n variant={ButtonVariant.Secondary}\n style={[tw.style(buttonBaseClass), secondaryButtonProps.style]}\n />\n )}\n {primaryButtonProps && (\n <Button\n {...primaryButtonProps}\n variant={ButtonVariant.Primary}\n style={[\n tw.style(buttonBaseClass, hasBothButtons && gapClass),\n primaryButtonProps.style,\n ]}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -22,7 +22,7 @@ export const BottomSheetFooter = ({ style, twClassName, buttonsAlignment = Butto
|
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
24
|
return (<View style={[
|
|
25
|
-
tw.style(isHorizontal ? 'flex-row' : 'flex-col', 'px-
|
|
25
|
+
tw.style(isHorizontal ? 'flex-row' : 'flex-col', 'px-4 py-0', twClassName),
|
|
26
26
|
style,
|
|
27
27
|
]} {...props}>
|
|
28
28
|
{secondaryButtonProps && (<Button {...secondaryButtonProps} variant={ButtonVariant.Secondary} style={[tw.style(buttonBaseClass), secondaryButtonProps.style]}/>)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetFooter.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,qBAAqB;AAEpC,yBAAyB;AACzB,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,4BAAkB;AAIlD,OAAO,EAAE,gBAAgB,EAAE,sCAAkC;AAE7D,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,gBAAgB,GAAG,gBAAgB,CAAC,UAAU,EAC9C,kBAAkB,EAClB,oBAAoB,EACpB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,YAAY,GAAG,gBAAgB,KAAK,gBAAgB,CAAC,UAAU,CAAC;IACtE,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC;IACjE,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,cAAc,GAClB,OAAO,CAAC,kBAAkB,CAAC,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE/D,IAAI,CAAC,kBAAkB,IAAI,CAAC,oBAAoB,EAAE;QAChD,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EACtC,WAAW,EACX,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,oBAAoB,IAAI,CACvB,CAAC,MAAM,CACL,IAAI,oBAAoB,CAAC,CACzB,OAAO,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CACjC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAC/D,CACH,CACD;MAAA,CAAC,kBAAkB,IAAI,CACrB,CAAC,MAAM,CACL,IAAI,kBAAkB,CAAC,CACvB,OAAO,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAC/B,KAAK,CAAC,CAAC;gBACL,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,cAAc,IAAI,QAAQ,CAAC;gBACrD,kBAAkB,CAAC,KAAK;aACzB,CAAC,EACF,CACH,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\n// External dependencies.\nimport { Button, ButtonVariant } from '../Button';\n\n// Internal dependencies.\nimport type { BottomSheetFooterProps } from './BottomSheetFooter.types';\nimport { ButtonsAlignment } from './BottomSheetFooter.types';\n\nexport const BottomSheetFooter: React.FC<BottomSheetFooterProps> = ({\n style,\n twClassName,\n buttonsAlignment = ButtonsAlignment.Horizontal,\n primaryButtonProps,\n secondaryButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;\n const buttonBaseClass = isHorizontal ? 'flex-1' : 'self-stretch';\n const gapClass = isHorizontal ? 'ml-4' : 'mt-4';\n const hasBothButtons =\n Boolean(primaryButtonProps) && Boolean(secondaryButtonProps);\n\n if (!primaryButtonProps && !secondaryButtonProps) {\n return null;\n }\n\n return (\n <View\n style={[\n tw.style(\n isHorizontal ? 'flex-row' : 'flex-col',\n 'px-
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.mjs","sourceRoot":"","sources":["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,CAAC,CACjC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAC/D,CACH,CACD;MAAA,CAAC,kBAAkB,IAAI,CACrB,CAAC,MAAM,CACL,IAAI,kBAAkB,CAAC,CACvB,OAAO,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAC/B,KAAK,CAAC,CAAC;gBACL,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,cAAc,IAAI,QAAQ,CAAC;gBACrD,kBAAkB,CAAC,KAAK;aACzB,CAAC,EACF,CACH,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\n// External dependencies.\nimport { Button, ButtonVariant } from '../Button';\n\n// Internal dependencies.\nimport type { BottomSheetFooterProps } from './BottomSheetFooter.types';\nimport { ButtonsAlignment } from './BottomSheetFooter.types';\n\nexport const BottomSheetFooter: React.FC<BottomSheetFooterProps> = ({\n style,\n twClassName,\n buttonsAlignment = ButtonsAlignment.Horizontal,\n primaryButtonProps,\n secondaryButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;\n const buttonBaseClass = isHorizontal ? 'flex-1' : 'self-stretch';\n const gapClass = isHorizontal ? 'ml-4' : 'mt-4';\n const hasBothButtons =\n Boolean(primaryButtonProps) && Boolean(secondaryButtonProps);\n\n if (!primaryButtonProps && !secondaryButtonProps) {\n return null;\n }\n\n return (\n <View\n style={[\n tw.style(\n isHorizontal ? 'flex-row' : 'flex-col',\n 'px-4 py-0',\n twClassName,\n ),\n style,\n ]}\n {...props}\n >\n {secondaryButtonProps && (\n <Button\n {...secondaryButtonProps}\n variant={ButtonVariant.Secondary}\n style={[tw.style(buttonBaseClass), secondaryButtonProps.style]}\n />\n )}\n {primaryButtonProps && (\n <Button\n {...primaryButtonProps}\n variant={ButtonVariant.Primary}\n style={[\n tw.style(buttonBaseClass, hasBothButtons && gapClass),\n primaryButtonProps.style,\n ]}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -15,7 +15,7 @@ const BottomSheetHeader = ({ style, twClassName, children, onBack, backButtonPro
|
|
|
15
15
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
16
16
|
const startAccessory = onBack ? (<ButtonIcon_1.ButtonIcon iconName={Icon_1.IconName.ArrowLeft} onPress={onBack} size={ButtonIcon_1.ButtonIconSize.Md} {...backButtonProps}/>) : undefined;
|
|
17
17
|
const endAccessory = onClose ? (<ButtonIcon_1.ButtonIcon iconName={Icon_1.IconName.Close} onPress={onClose} size={ButtonIcon_1.ButtonIconSize.Md} {...closeButtonProps}/>) : undefined;
|
|
18
|
-
return (<HeaderBase_1.HeaderBase {...props} style={[tw.style('px-
|
|
18
|
+
return (<HeaderBase_1.HeaderBase {...props} style={[tw.style('px-2', twClassName), style]} startAccessory={startAccessory} endAccessory={endAccessory}>
|
|
19
19
|
{children}
|
|
20
20
|
</HeaderBase_1.HeaderBase>);
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetHeader.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,8FAA4E;AAC5E,kDAA0B;AAE1B,yBAAyB;AACzB,wDAA2D;AAC3D,wDAA2C;AAC3C,4CAAmC;AAI5B,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAC9B,CAAC,uBAAU,CACT,QAAQ,CAAC,CAAC,eAAQ,CAAC,SAAS,CAAC,CAC7B,OAAO,CAAC,CAAC,MAAM,CAAC,CAChB,IAAI,CAAC,CAAC,2BAAc,CAAC,EAAE,CAAC,CACxB,IAAI,eAAe,CAAC,EACpB,CACH,CAAC,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAC7B,CAAC,uBAAU,CACT,QAAQ,CAAC,CAAC,eAAQ,CAAC,KAAK,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,CAAC,CAAC,2BAAc,CAAC,EAAE,CAAC,CACxB,IAAI,gBAAgB,CAAC,EACrB,CACH,CAAC,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAC9C,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAE3B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,iBAAiB,qBAuC5B","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\n// External dependencies.\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { HeaderBase } from '../HeaderBase';\nimport { IconName } from '../Icon';\n\nimport type { BottomSheetHeaderProps } from './BottomSheetHeader.types';\n\nexport const BottomSheetHeader: React.FC<BottomSheetHeaderProps> = ({\n style,\n twClassName,\n children,\n onBack,\n backButtonProps,\n onClose,\n closeButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n\n const startAccessory = onBack ? (\n <ButtonIcon\n iconName={IconName.ArrowLeft}\n onPress={onBack}\n size={ButtonIconSize.Md}\n {...backButtonProps}\n />\n ) : undefined;\n\n const endAccessory = onClose ? (\n <ButtonIcon\n iconName={IconName.Close}\n onPress={onClose}\n size={ButtonIconSize.Md}\n {...closeButtonProps}\n />\n ) : undefined;\n return (\n <HeaderBase\n {...props}\n style={[tw.style('px-
|
|
1
|
+
{"version":3,"file":"BottomSheetHeader.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,8FAA4E;AAC5E,kDAA0B;AAE1B,yBAAyB;AACzB,wDAA2D;AAC3D,wDAA2C;AAC3C,4CAAmC;AAI5B,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAC9B,CAAC,uBAAU,CACT,QAAQ,CAAC,CAAC,eAAQ,CAAC,SAAS,CAAC,CAC7B,OAAO,CAAC,CAAC,MAAM,CAAC,CAChB,IAAI,CAAC,CAAC,2BAAc,CAAC,EAAE,CAAC,CACxB,IAAI,eAAe,CAAC,EACpB,CACH,CAAC,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAC7B,CAAC,uBAAU,CACT,QAAQ,CAAC,CAAC,eAAQ,CAAC,KAAK,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,CAAC,CAAC,2BAAc,CAAC,EAAE,CAAC,CACxB,IAAI,gBAAgB,CAAC,EACrB,CACH,CAAC,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAC9C,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAE3B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,iBAAiB,qBAuC5B","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\n// External dependencies.\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { HeaderBase } from '../HeaderBase';\nimport { IconName } from '../Icon';\n\nimport type { BottomSheetHeaderProps } from './BottomSheetHeader.types';\n\nexport const BottomSheetHeader: React.FC<BottomSheetHeaderProps> = ({\n style,\n twClassName,\n children,\n onBack,\n backButtonProps,\n onClose,\n closeButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n\n const startAccessory = onBack ? (\n <ButtonIcon\n iconName={IconName.ArrowLeft}\n onPress={onBack}\n size={ButtonIconSize.Md}\n {...backButtonProps}\n />\n ) : undefined;\n\n const endAccessory = onClose ? (\n <ButtonIcon\n iconName={IconName.Close}\n onPress={onClose}\n size={ButtonIconSize.Md}\n {...closeButtonProps}\n />\n ) : undefined;\n return (\n <HeaderBase\n {...props}\n style={[tw.style('px-2', twClassName), style]}\n startAccessory={startAccessory}\n endAccessory={endAccessory}\n >\n {children}\n </HeaderBase>\n );\n};\n"]}
|
|
@@ -16,7 +16,7 @@ export const BottomSheetHeader = ({ style, twClassName, children, onBack, backBu
|
|
|
16
16
|
const tw = useTailwind();
|
|
17
17
|
const startAccessory = onBack ? (<ButtonIcon iconName={IconName.ArrowLeft} onPress={onBack} size={ButtonIconSize.Md} {...backButtonProps}/>) : undefined;
|
|
18
18
|
const endAccessory = onClose ? (<ButtonIcon iconName={IconName.Close} onPress={onClose} size={ButtonIconSize.Md} {...closeButtonProps}/>) : undefined;
|
|
19
|
-
return (<HeaderBase {...props} style={[tw.style('px-
|
|
19
|
+
return (<HeaderBase {...props} style={[tw.style('px-2', twClassName), style]} startAccessory={startAccessory} endAccessory={endAccessory}>
|
|
20
20
|
{children}
|
|
21
21
|
</HeaderBase>);
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetHeader.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gCAAsB;AAC3D,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,QAAQ,EAAE,0BAAgB;AAInC,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAC9B,CAAC,UAAU,CACT,QAAQ,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAC7B,OAAO,CAAC,CAAC,MAAM,CAAC,CAChB,IAAI,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CACxB,IAAI,eAAe,CAAC,EACpB,CACH,CAAC,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAC7B,CAAC,UAAU,CACT,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CACxB,IAAI,gBAAgB,CAAC,EACrB,CACH,CAAC,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,CACL,CAAC,UAAU,CACT,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAC9C,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAE3B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\n// External dependencies.\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { HeaderBase } from '../HeaderBase';\nimport { IconName } from '../Icon';\n\nimport type { BottomSheetHeaderProps } from './BottomSheetHeader.types';\n\nexport const BottomSheetHeader: React.FC<BottomSheetHeaderProps> = ({\n style,\n twClassName,\n children,\n onBack,\n backButtonProps,\n onClose,\n closeButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n\n const startAccessory = onBack ? (\n <ButtonIcon\n iconName={IconName.ArrowLeft}\n onPress={onBack}\n size={ButtonIconSize.Md}\n {...backButtonProps}\n />\n ) : undefined;\n\n const endAccessory = onClose ? (\n <ButtonIcon\n iconName={IconName.Close}\n onPress={onClose}\n size={ButtonIconSize.Md}\n {...closeButtonProps}\n />\n ) : undefined;\n return (\n <HeaderBase\n {...props}\n style={[tw.style('px-
|
|
1
|
+
{"version":3,"file":"BottomSheetHeader.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gCAAsB;AAC3D,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,QAAQ,EAAE,0BAAgB;AAInC,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAC9B,CAAC,UAAU,CACT,QAAQ,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAC7B,OAAO,CAAC,CAAC,MAAM,CAAC,CAChB,IAAI,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CACxB,IAAI,eAAe,CAAC,EACpB,CACH,CAAC,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAC7B,CAAC,UAAU,CACT,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CACxB,IAAI,gBAAgB,CAAC,EACrB,CACH,CAAC,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,CACL,CAAC,UAAU,CACT,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAC9C,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAE3B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\n// External dependencies.\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { HeaderBase } from '../HeaderBase';\nimport { IconName } from '../Icon';\n\nimport type { BottomSheetHeaderProps } from './BottomSheetHeader.types';\n\nexport const BottomSheetHeader: React.FC<BottomSheetHeaderProps> = ({\n style,\n twClassName,\n children,\n onBack,\n backButtonProps,\n onClose,\n closeButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n\n const startAccessory = onBack ? (\n <ButtonIcon\n iconName={IconName.ArrowLeft}\n onPress={onBack}\n size={ButtonIconSize.Md}\n {...backButtonProps}\n />\n ) : undefined;\n\n const endAccessory = onClose ? (\n <ButtonIcon\n iconName={IconName.Close}\n onPress={onClose}\n size={ButtonIconSize.Md}\n {...closeButtonProps}\n />\n ) : undefined;\n return (\n <HeaderBase\n {...props}\n style={[tw.style('px-2', twClassName), style]}\n startAccessory={startAccessory}\n endAccessory={endAccessory}\n >\n {children}\n </HeaderBase>\n );\n};\n"]}
|
|
@@ -4,11 +4,13 @@ exports.MAP_BUTTONICON_SIZE_ICONSIZE = exports.TWCLASSMAP_BUTTONICON_SIZE_DIMENS
|
|
|
4
4
|
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
5
|
// Mappings
|
|
6
6
|
exports.TWCLASSMAP_BUTTONICON_SIZE_DIMENSION = {
|
|
7
|
+
[design_system_shared_1.ButtonIconSize.Xs]: 'h-5 w-5',
|
|
7
8
|
[design_system_shared_1.ButtonIconSize.Sm]: 'h-6 w-6',
|
|
8
9
|
[design_system_shared_1.ButtonIconSize.Md]: 'h-8 w-8',
|
|
9
10
|
[design_system_shared_1.ButtonIconSize.Lg]: 'h-10 w-10',
|
|
10
11
|
};
|
|
11
12
|
exports.MAP_BUTTONICON_SIZE_ICONSIZE = {
|
|
13
|
+
[design_system_shared_1.ButtonIconSize.Xs]: design_system_shared_1.IconSize.Sm,
|
|
12
14
|
[design_system_shared_1.ButtonIconSize.Sm]: design_system_shared_1.IconSize.Md,
|
|
13
15
|
[design_system_shared_1.ButtonIconSize.Md]: design_system_shared_1.IconSize.Lg,
|
|
14
16
|
[design_system_shared_1.ButtonIconSize.Lg]: design_system_shared_1.IconSize.Xl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.constants.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.constants.ts"],"names":[],"mappings":";;;AAAA,kFAAmF;AAEnF,WAAW;AACE,QAAA,oCAAoC,GAAG;IAClD,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,WAAW;CACjC,CAAC;AAEW,QAAA,4BAA4B,GAAqC;IAC5E,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;CACjC,CAAC","sourcesContent":["import { ButtonIconSize, IconSize } from '@metamask-previews/design-system-shared';\n\n// Mappings\nexport const TWCLASSMAP_BUTTONICON_SIZE_DIMENSION = {\n [ButtonIconSize.Sm]: 'h-6 w-6',\n [ButtonIconSize.Md]: 'h-8 w-8',\n [ButtonIconSize.Lg]: 'h-10 w-10',\n};\n\nexport const MAP_BUTTONICON_SIZE_ICONSIZE: Record<ButtonIconSize, IconSize> = {\n [ButtonIconSize.Sm]: IconSize.Md,\n [ButtonIconSize.Md]: IconSize.Lg,\n [ButtonIconSize.Lg]: IconSize.Xl,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ButtonIcon.constants.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.constants.ts"],"names":[],"mappings":";;;AAAA,kFAAmF;AAEnF,WAAW;AACE,QAAA,oCAAoC,GAAG;IAClD,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,WAAW;CACjC,CAAC;AAEW,QAAA,4BAA4B,GAAqC;IAC5E,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;CACjC,CAAC","sourcesContent":["import { ButtonIconSize, IconSize } from '@metamask-previews/design-system-shared';\n\n// Mappings\nexport const TWCLASSMAP_BUTTONICON_SIZE_DIMENSION = {\n [ButtonIconSize.Xs]: 'h-5 w-5',\n [ButtonIconSize.Sm]: 'h-6 w-6',\n [ButtonIconSize.Md]: 'h-8 w-8',\n [ButtonIconSize.Lg]: 'h-10 w-10',\n};\n\nexport const MAP_BUTTONICON_SIZE_ICONSIZE: Record<ButtonIconSize, IconSize> = {\n [ButtonIconSize.Xs]: IconSize.Sm,\n [ButtonIconSize.Sm]: IconSize.Md,\n [ButtonIconSize.Md]: IconSize.Lg,\n [ButtonIconSize.Lg]: IconSize.Xl,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.constants.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gDAAgD;AAGnF,eAAO,MAAM,oCAAoC
|
|
1
|
+
{"version":3,"file":"ButtonIcon.constants.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gDAAgD;AAGnF,eAAO,MAAM,oCAAoC;;;;;CAKhD,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAKzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.constants.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gDAAgD;AAGnF,eAAO,MAAM,oCAAoC
|
|
1
|
+
{"version":3,"file":"ButtonIcon.constants.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gDAAgD;AAGnF,eAAO,MAAM,oCAAoC;;;;;CAKhD,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAKzE,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ButtonIconSize, IconSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
// Mappings
|
|
3
3
|
export const TWCLASSMAP_BUTTONICON_SIZE_DIMENSION = {
|
|
4
|
+
[ButtonIconSize.Xs]: 'h-5 w-5',
|
|
4
5
|
[ButtonIconSize.Sm]: 'h-6 w-6',
|
|
5
6
|
[ButtonIconSize.Md]: 'h-8 w-8',
|
|
6
7
|
[ButtonIconSize.Lg]: 'h-10 w-10',
|
|
7
8
|
};
|
|
8
9
|
export const MAP_BUTTONICON_SIZE_ICONSIZE = {
|
|
10
|
+
[ButtonIconSize.Xs]: IconSize.Sm,
|
|
9
11
|
[ButtonIconSize.Sm]: IconSize.Md,
|
|
10
12
|
[ButtonIconSize.Md]: IconSize.Lg,
|
|
11
13
|
[ButtonIconSize.Lg]: IconSize.Xl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.constants.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gDAAgD;AAEnF,WAAW;AACX,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAqC;IAC5E,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;CACjC,CAAC","sourcesContent":["import { ButtonIconSize, IconSize } from '@metamask-previews/design-system-shared';\n\n// Mappings\nexport const TWCLASSMAP_BUTTONICON_SIZE_DIMENSION = {\n [ButtonIconSize.Sm]: 'h-6 w-6',\n [ButtonIconSize.Md]: 'h-8 w-8',\n [ButtonIconSize.Lg]: 'h-10 w-10',\n};\n\nexport const MAP_BUTTONICON_SIZE_ICONSIZE: Record<ButtonIconSize, IconSize> = {\n [ButtonIconSize.Sm]: IconSize.Md,\n [ButtonIconSize.Md]: IconSize.Lg,\n [ButtonIconSize.Lg]: IconSize.Xl,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ButtonIcon.constants.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gDAAgD;AAEnF,WAAW;AACX,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAqC;IAC5E,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;CACjC,CAAC","sourcesContent":["import { ButtonIconSize, IconSize } from '@metamask-previews/design-system-shared';\n\n// Mappings\nexport const TWCLASSMAP_BUTTONICON_SIZE_DIMENSION = {\n [ButtonIconSize.Xs]: 'h-5 w-5',\n [ButtonIconSize.Sm]: 'h-6 w-6',\n [ButtonIconSize.Md]: 'h-8 w-8',\n [ButtonIconSize.Lg]: 'h-10 w-10',\n};\n\nexport const MAP_BUTTONICON_SIZE_ICONSIZE: Record<ButtonIconSize, IconSize> = {\n [ButtonIconSize.Xs]: IconSize.Sm,\n [ButtonIconSize.Sm]: IconSize.Md,\n [ButtonIconSize.Md]: IconSize.Lg,\n [ButtonIconSize.Lg]: IconSize.Xl,\n};\n"]}
|
|
@@ -12,7 +12,7 @@ const Text_1 = require("../Text/index.cjs");
|
|
|
12
12
|
const MainActionButton = ({ iconName, label, iconProps, labelProps, onPress, onPressIn, onPressOut, style, isDisabled = false, twClassName = '', ...props }) => {
|
|
13
13
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
14
14
|
return (<ButtonAnimated_1.ButtonAnimated disabled={isDisabled} accessible onPress={!isDisabled ? onPress : undefined} onPressIn={!isDisabled ? onPressIn : undefined} onPressOut={!isDisabled ? onPressOut : undefined} style={({ pressed }) => {
|
|
15
|
-
const baseStyle = tw.style('items-center justify-center rounded-xl px-1 py-
|
|
15
|
+
const baseStyle = tw.style('items-center justify-center rounded-xl px-1 py-3 min-w-[68px]', pressed && !isDisabled ? 'bg-muted-pressed' : 'bg-muted', isDisabled ? 'opacity-50' : 'opacity-100', twClassName);
|
|
16
16
|
const additionalStyle = typeof style === 'function' ? style({ pressed }) : style;
|
|
17
17
|
return additionalStyle ? [baseStyle, additionalStyle] : [baseStyle];
|
|
18
18
|
}} {...props}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainActionButton.cjs","sourceRoot":"","sources":["../../../src/components/MainActionButton/MainActionButton.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAG1B,4CAAoD;AACpD,gFAAmE;AACnE,4CAAmE;AAI5D,MAAM,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACc,EAAE,EAAE;IAC1B,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,+BAAc,CACb,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,UAAU,CACV,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAC3C,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAC/C,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CACjD,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACrB,MAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CACxB,+DAA+D,EAC/D,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,EACxD,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACzC,WAAW,CACY,CAAC;YAE1B,MAAM,eAAe,GACnB,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YAE3D,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACtE,CAAC,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,EACE;QAAA,CAAC,WAAI,CACH,IAAI,SAAS,CAAC,CACd,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,KAAK,CAAC,CAAC,gBAAS,CAAC,eAAe,CAAC,EAEnC;QAAA,CAAC,WAAI,CACH,IAAI,UAAU,CAAC,CACf,OAAO,CAAC,CAAC,kBAAW,CAAC,MAAM,CAAC,CAC5B,UAAU,CAAC,CAAC,iBAAU,CAAC,MAAM,CAAC,CAC9B,KAAK,CAAC,CAAC,gBAAS,CAAC,WAAW,CAAC,CAC7B,WAAW,CAAC,kCAAkC,CAC9C,aAAa,CAAC,CAAC,CAAC,CAAC,CACjB,aAAa,CAAC,MAAM,CAEpB;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,WAAI,CACR;MAAA,GACF;IAAA,EAAE,+BAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AA1DW,QAAA,gBAAgB,oBA0D3B","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Icon, IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Text, FontWeight, TextColor, TextVariant } from '../Text';\n\nimport type { MainActionButtonProps } from './MainActionButton.types';\n\nexport const MainActionButton = ({\n iconName,\n label,\n iconProps,\n labelProps,\n onPress,\n onPressIn,\n onPressOut,\n style,\n isDisabled = false,\n twClassName = '',\n ...props\n}: MainActionButtonProps) => {\n const tw = useTailwind();\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n accessible\n onPress={!isDisabled ? onPress : undefined}\n onPressIn={!isDisabled ? onPressIn : undefined}\n onPressOut={!isDisabled ? onPressOut : undefined}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'items-center justify-center rounded-xl px-1 py-
|
|
1
|
+
{"version":3,"file":"MainActionButton.cjs","sourceRoot":"","sources":["../../../src/components/MainActionButton/MainActionButton.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAG1B,4CAAoD;AACpD,gFAAmE;AACnE,4CAAmE;AAI5D,MAAM,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACc,EAAE,EAAE;IAC1B,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,+BAAc,CACb,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,UAAU,CACV,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAC3C,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAC/C,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,C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c-preset';\nimport React from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Icon, IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Text, FontWeight, TextColor, TextVariant } from '../Text';\n\nimport type { MainActionButtonProps } from './MainActionButton.types';\n\nexport const MainActionButton = ({\n iconName,\n label,\n iconProps,\n labelProps,\n onPress,\n onPressIn,\n onPressOut,\n style,\n isDisabled = false,\n twClassName = '',\n ...props\n}: MainActionButtonProps) => {\n const tw = useTailwind();\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n accessible\n onPress={!isDisabled ? onPress : undefined}\n onPressIn={!isDisabled ? onPressIn : undefined}\n onPressOut={!isDisabled ? onPressOut : undefined}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'items-center justify-center rounded-xl px-1 py-3 min-w-[68px]',\n pressed && !isDisabled ? 'bg-muted-pressed' : 'bg-muted',\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ) as StyleProp<ViewStyle>;\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : [baseStyle];\n }}\n {...props}\n >\n <>\n <Icon\n {...iconProps}\n name={iconName}\n size={IconSize.Lg}\n color={IconColor.IconAlternative}\n />\n <Text\n {...labelProps}\n variant={TextVariant.BodySm}\n fontWeight={FontWeight.Medium}\n color={TextColor.TextDefault}\n twClassName=\"mt-0.5 w-full text-center shrink\"\n numberOfLines={1}\n ellipsizeMode=\"tail\"\n >\n {label}\n </Text>\n </>\n </ButtonAnimated>\n );\n};\n"]}
|
|
@@ -13,7 +13,7 @@ import { Text, FontWeight, TextColor, TextVariant } from "../Text/index.mjs";
|
|
|
13
13
|
export const MainActionButton = ({ iconName, label, iconProps, labelProps, onPress, onPressIn, onPressOut, style, isDisabled = false, twClassName = '', ...props }) => {
|
|
14
14
|
const tw = useTailwind();
|
|
15
15
|
return (<ButtonAnimated disabled={isDisabled} accessible onPress={!isDisabled ? onPress : undefined} onPressIn={!isDisabled ? onPressIn : undefined} onPressOut={!isDisabled ? onPressOut : undefined} style={({ pressed }) => {
|
|
16
|
-
const baseStyle = tw.style('items-center justify-center rounded-xl px-1 py-
|
|
16
|
+
const baseStyle = tw.style('items-center justify-center rounded-xl px-1 py-3 min-w-[68px]', pressed && !isDisabled ? 'bg-muted-pressed' : 'bg-muted', isDisabled ? 'opacity-50' : 'opacity-100', twClassName);
|
|
17
17
|
const additionalStyle = typeof style === 'function' ? style({ pressed }) : style;
|
|
18
18
|
return additionalStyle ? [baseStyle, additionalStyle] : [baseStyle];
|
|
19
19
|
}} {...props}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainActionButton.mjs","sourceRoot":"","sources":["../../../src/components/MainActionButton/MainActionButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAG1B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACpD,OAAO,EAAE,cAAc,EAAE,oDAA0C;AACnE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,0BAAgB;AAInE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACc,EAAE,EAAE;IAC1B,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,cAAc,CACb,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,UAAU,CACV,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAC3C,SAAS,CAAC,CAAC,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EAAE,IAAI,CACR;MAAA,GACF;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Icon, IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Text, FontWeight, TextColor, TextVariant } from '../Text';\n\nimport type { MainActionButtonProps } from './MainActionButton.types';\n\nexport const MainActionButton = ({\n iconName,\n label,\n iconProps,\n labelProps,\n onPress,\n onPressIn,\n onPressOut,\n style,\n isDisabled = false,\n twClassName = '',\n ...props\n}: MainActionButtonProps) => {\n const tw = useTailwind();\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n accessible\n onPress={!isDisabled ? onPress : undefined}\n onPressIn={!isDisabled ? onPressIn : undefined}\n onPressOut={!isDisabled ? onPressOut : undefined}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'items-center justify-center rounded-xl px-1 py-
|
|
1
|
+
{"version":3,"file":"MainActionButton.mjs","sourceRoot":"","sources":["../../../src/components/MainActionButton/MainActionButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAG1B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACpD,OAAO,EAAE,cAAc,EAAE,oDAA0C;AACnE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,0BAAgB;AAInE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACc,EAAE,EAAE;IAC1B,MAAM,EAAE,GA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AU,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAC9B,KAAK,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAC7B,WAAW,CAAC,kCAAkC,CAC9C,aAAa,CAAC,CAAC,CAAC,CAAC,CACjB,aAAa,CAAC,MAAM,CAEpB;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,IAAI,CACR;MAAA,GACF;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Icon, IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Text, FontWeight, TextColor, TextVariant } from '../Text';\n\nimport type { MainActionButtonProps } from './MainActionButton.types';\n\nexport const MainActionButton = ({\n iconName,\n label,\n iconProps,\n labelProps,\n onPress,\n onPressIn,\n onPressOut,\n style,\n isDisabled = false,\n twClassName = '',\n ...props\n}: MainActionButtonProps) => {\n const tw = useTailwind();\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n accessible\n onPress={!isDisabled ? onPress : undefined}\n onPressIn={!isDisabled ? onPressIn : undefined}\n onPressOut={!isDisabled ? onPressOut : undefined}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'items-center justify-center rounded-xl px-1 py-3 min-w-[68px]',\n pressed && !isDisabled ? 'bg-muted-pressed' : 'bg-muted',\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ) as StyleProp<ViewStyle>;\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : [baseStyle];\n }}\n {...props}\n >\n <>\n <Icon\n {...iconProps}\n name={iconName}\n size={IconSize.Lg}\n color={IconColor.IconAlternative}\n />\n <Text\n {...labelProps}\n variant={TextVariant.BodySm}\n fontWeight={FontWeight.Medium}\n color={TextColor.TextDefault}\n twClassName=\"mt-0.5 w-full text-center shrink\"\n numberOfLines={1}\n ellipsizeMode=\"tail\"\n >\n {label}\n </Text>\n </>\n </ButtonAnimated>\n );\n};\n"]}
|
|
@@ -8,6 +8,7 @@ const design_system_shared_1 = require("@metamask-previews/design-system-shared"
|
|
|
8
8
|
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
10
|
const react_native_1 = require("react-native");
|
|
11
|
+
const Box_1 = require("../Box/index.cjs");
|
|
11
12
|
const BoxRow_1 = require("../BoxRow/index.cjs");
|
|
12
13
|
const Icon_1 = require("../Icon/index.cjs");
|
|
13
14
|
/**
|
|
@@ -18,6 +19,7 @@ const Icon_1 = require("../Icon/index.cjs");
|
|
|
18
19
|
* @param sectionHeaderProps - Component props
|
|
19
20
|
* @param sectionHeaderProps.title - Title content for the inner row (required)
|
|
20
21
|
* @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row
|
|
22
|
+
* @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories
|
|
21
23
|
* @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
|
|
22
24
|
* @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
|
|
23
25
|
* @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
|
|
@@ -33,7 +35,7 @@ const Icon_1 = require("../Icon/index.cjs");
|
|
|
33
35
|
* @returns The rendered SectionHeader layout.
|
|
34
36
|
*/
|
|
35
37
|
const SectionHeader = (sectionHeaderProps) => {
|
|
36
|
-
const { title, titleAccessory, titleProps, titleWrapperProps, startAccessory, startIconName, startIconProps, endAccessory, endIconName, endIconProps, isInteractive, twClassName = '', style, ...props } = sectionHeaderProps;
|
|
38
|
+
const { title, children, titleAccessory, titleProps, titleWrapperProps, startAccessory, startIconName, startIconProps, endAccessory, endIconName, endIconProps, isInteractive, twClassName = '', style, ...props } = sectionHeaderProps;
|
|
37
39
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
38
40
|
const resolvedEndIconName = endIconName ??
|
|
39
41
|
(isInteractive && !endAccessory ? design_system_shared_1.IconName.ArrowRight : undefined);
|
|
@@ -46,6 +48,11 @@ const SectionHeader = (sectionHeaderProps) => {
|
|
|
46
48
|
}}>
|
|
47
49
|
{title}
|
|
48
50
|
</BoxRow_1.BoxRow>) : null;
|
|
51
|
+
const hasAccessories = Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);
|
|
52
|
+
const mainContent = titleRow || children ? (<Box_1.Box gap={1} twClassName={hasAccessories ? 'flex-1 min-w-0' : undefined}>
|
|
53
|
+
{titleRow}
|
|
54
|
+
{children}
|
|
55
|
+
</Box_1.Box>) : null;
|
|
49
56
|
if (isInteractive) {
|
|
50
57
|
const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;
|
|
51
58
|
const isDisabled = Boolean(disabled);
|
|
@@ -55,12 +62,12 @@ const SectionHeader = (sectionHeaderProps) => {
|
|
|
55
62
|
return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;
|
|
56
63
|
}} {...props}>
|
|
57
64
|
<BoxRow_1.BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
|
|
58
|
-
{
|
|
65
|
+
{mainContent}
|
|
59
66
|
</BoxRow_1.BoxRow>
|
|
60
67
|
</react_native_1.Pressable>);
|
|
61
68
|
}
|
|
62
69
|
return (<BoxRow_1.BoxRow {...props} gap={1} style={style} twClassName={(0, design_system_shared_1.mergeTwClassName)('px-4 pb-2 pt-3', twClassName)} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
|
|
63
|
-
{
|
|
70
|
+
{mainContent}
|
|
64
71
|
</BoxRow_1.BoxRow>);
|
|
65
72
|
};
|
|
66
73
|
exports.SectionHeader = SectionHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.cjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAOiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAyC;AAEzC,gDAAmC;AACnC,4CAA+B;AAI/B
|
|
1
|
+
{"version":3,"file":"SectionHeader.cjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAOiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAC1B,+CAAyC;AAEzC,0CAA6B;AAC7B,gDAAmC;AACnC,4CAA+B;AAI/B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,aAAa,GAAiC,CACzD,kBAAkB,EAClB,EAAE;IACF,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACT,GAAG,kBAAkB,CAAC;IAEvB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,mBAAmB,GACvB,WAAW;QACX,CAAC,aAAa,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,+BAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAErE,MAAM,sBAAsB,GAAG,aAAa,CAAC,CAAC,CAAC,CAC7C,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,CAClB,KAAK,CAAC,CAAC,gCAAS,CAAC,WAAW,CAAC,CAC7B,WAAW,CAAC,UAAU,CACtB,IAAI,cAAc,CAAC,CACnB,IAAI,CAAC,CAAC,aAAa,CAAC,EACpB,CACH,CAAC,CAAC,CAAC,CACF,cAAc,CACf,CAAC;IAEF,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,CAAC,CA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-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon } from '../Icon';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row\n * @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon; takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const titleRow = title ? (\n <BoxRow\n {...titleWrapperProps}\n gap={1}\n endAccessory={titleAccessory}\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null;\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const mainContent =\n titleRow || children ? (\n <Box gap={1} twClassName={hasAccessories ? 'flex-1 min-w-0' : undefined}>\n {titleRow}\n {children}\n </Box>\n ) : null;\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n <BoxRow\n gap={1}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n </Pressable>\n );\n }\n\n return (\n <BoxRow\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
|
|
@@ -8,6 +8,7 @@ import type { SectionHeaderProps } from "./SectionHeader.types.cjs";
|
|
|
8
8
|
* @param sectionHeaderProps - Component props
|
|
9
9
|
* @param sectionHeaderProps.title - Title content for the inner row (required)
|
|
10
10
|
* @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row
|
|
11
|
+
* @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories
|
|
11
12
|
* @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
|
|
12
13
|
* @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
|
|
13
14
|
* @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.d.cts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;
|
|
1
|
+
{"version":3,"file":"SectionHeader.d.cts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuHtD,CAAC"}
|
|
@@ -8,6 +8,7 @@ import type { SectionHeaderProps } from "./SectionHeader.types.mjs";
|
|
|
8
8
|
* @param sectionHeaderProps - Component props
|
|
9
9
|
* @param sectionHeaderProps.title - Title content for the inner row (required)
|
|
10
10
|
* @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row
|
|
11
|
+
* @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories
|
|
11
12
|
* @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
|
|
12
13
|
* @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
|
|
13
14
|
* @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;
|
|
1
|
+
{"version":3,"file":"SectionHeader.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuHtD,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
|
9
9
|
import $React from "react";
|
|
10
10
|
const React = $importDefault($React);
|
|
11
11
|
import { Pressable } from "react-native";
|
|
12
|
+
import { Box } from "../Box/index.mjs";
|
|
12
13
|
import { BoxRow } from "../BoxRow/index.mjs";
|
|
13
14
|
import { Icon } from "../Icon/index.mjs";
|
|
14
15
|
/**
|
|
@@ -19,6 +20,7 @@ import { Icon } from "../Icon/index.mjs";
|
|
|
19
20
|
* @param sectionHeaderProps - Component props
|
|
20
21
|
* @param sectionHeaderProps.title - Title content for the inner row (required)
|
|
21
22
|
* @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row
|
|
23
|
+
* @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories
|
|
22
24
|
* @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
|
|
23
25
|
* @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
|
|
24
26
|
* @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
|
|
@@ -34,7 +36,7 @@ import { Icon } from "../Icon/index.mjs";
|
|
|
34
36
|
* @returns The rendered SectionHeader layout.
|
|
35
37
|
*/
|
|
36
38
|
export const SectionHeader = (sectionHeaderProps) => {
|
|
37
|
-
const { title, titleAccessory, titleProps, titleWrapperProps, startAccessory, startIconName, startIconProps, endAccessory, endIconName, endIconProps, isInteractive, twClassName = '', style, ...props } = sectionHeaderProps;
|
|
39
|
+
const { title, children, titleAccessory, titleProps, titleWrapperProps, startAccessory, startIconName, startIconProps, endAccessory, endIconName, endIconProps, isInteractive, twClassName = '', style, ...props } = sectionHeaderProps;
|
|
38
40
|
const tw = useTailwind();
|
|
39
41
|
const resolvedEndIconName = endIconName ??
|
|
40
42
|
(isInteractive && !endAccessory ? IconName.ArrowRight : undefined);
|
|
@@ -47,6 +49,11 @@ export const SectionHeader = (sectionHeaderProps) => {
|
|
|
47
49
|
}}>
|
|
48
50
|
{title}
|
|
49
51
|
</BoxRow>) : null;
|
|
52
|
+
const hasAccessories = Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);
|
|
53
|
+
const mainContent = titleRow || children ? (<Box gap={1} twClassName={hasAccessories ? 'flex-1 min-w-0' : undefined}>
|
|
54
|
+
{titleRow}
|
|
55
|
+
{children}
|
|
56
|
+
</Box>) : null;
|
|
50
57
|
if (isInteractive) {
|
|
51
58
|
const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;
|
|
52
59
|
const isDisabled = Boolean(disabled);
|
|
@@ -56,12 +63,12 @@ export const SectionHeader = (sectionHeaderProps) => {
|
|
|
56
63
|
return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;
|
|
57
64
|
}} {...props}>
|
|
58
65
|
<BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
|
|
59
|
-
{
|
|
66
|
+
{mainContent}
|
|
60
67
|
</BoxRow>
|
|
61
68
|
</Pressable>);
|
|
62
69
|
}
|
|
63
70
|
return (<BoxRow {...props} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
|
|
64
|
-
{
|
|
71
|
+
{mainContent}
|
|
65
72
|
</BoxRow>);
|
|
66
73
|
};
|
|
67
74
|
SectionHeader.displayName = 'SectionHeader';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B
|
|
1
|
+
{"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM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,CAAC,CAAC,CAAC,SAAS,CAAC;YACpE,CAAC,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,MAAM,CACL,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,cAAc,CAAC,CAAC,sBAAsB,CAAC,CACvC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAEnC;UAAA,CAAC,WAAW,CACd;QAAA,EAAE,MAAM,CACV;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;KACH;IAED,OAAO,CACL,CAAC,MAAM,CACL,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAC7D,cAAc,CAAC,CAAC,sBAAsB,CAAC,CACvC,YAAY,CAAC,CAAC,oBAAoB,CAAC,CAEnC;MAAA,CAAC,WAAW,CACd;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n IconColor,\n IconName,\n IconSize,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon } from '../Icon';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional node to the right of `title` in the inner row\n * @param sectionHeaderProps.children - Optional content below the title row in the middle column, between start and end accessories\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon; takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Md}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const titleRow = title ? (\n <BoxRow\n {...titleWrapperProps}\n gap={1}\n endAccessory={titleAccessory}\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null;\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const mainContent =\n titleRow || children ? (\n <Box gap={1} twClassName={hasAccessories ? 'flex-1 min-w-0' : undefined}>\n {titleRow}\n {children}\n </Box>\n ) : null;\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n <BoxRow\n gap={1}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n </Pressable>\n );\n }\n\n return (\n <BoxRow\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/design-system-react-native",
|
|
3
|
-
"version": "0.30.2-preview.
|
|
3
|
+
"version": "0.30.2-preview.ba3ace4e",
|
|
4
4
|
"description": "Design System React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@metamask-previews/design-system-shared": "0.24.0-preview.
|
|
50
|
+
"@metamask-previews/design-system-shared": "0.24.0-preview.ba3ace4e",
|
|
51
51
|
"fast-text-encoding": "^1.0.6",
|
|
52
52
|
"react-native-jazzicon": "^0.1.2"
|
|
53
53
|
},
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@babel/preset-typescript": "^7.23.3",
|
|
59
59
|
"@figma/code-connect": "^1.4.8",
|
|
60
60
|
"@gorhom/bottom-sheet": "^5.1.3",
|
|
61
|
-
"@metamask-previews/design-system-twrnc-preset": "0.5.0-preview.
|
|
62
|
-
"@metamask-previews/design-tokens": "8.5.0-preview.
|
|
61
|
+
"@metamask-previews/design-system-twrnc-preset": "0.5.0-preview.ba3ace4e",
|
|
62
|
+
"@metamask-previews/design-tokens": "8.5.0-preview.ba3ace4e",
|
|
63
63
|
"@metamask/auto-changelog": "^6.1.1",
|
|
64
64
|
"@metamask/utils": "^11.11.0",
|
|
65
65
|
"@react-native/babel-preset": "0.81.5",
|