@metamask-previews/design-system-react-native 0.26.0-preview.620b9f3 → 0.27.0-preview.a0fe3894
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +2 -6
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.d.cts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.d.mts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +2 -6
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.cjs +0 -11
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.cjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.cts +6 -20
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.cts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.mts +6 -20
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.mts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.mjs +1 -10
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.mjs.map +1 -1
- package/dist/components/BottomSheetHeader/index.cjs +1 -3
- package/dist/components/BottomSheetHeader/index.cjs.map +1 -1
- package/dist/components/BottomSheetHeader/index.d.cts +0 -1
- package/dist/components/BottomSheetHeader/index.d.cts.map +1 -1
- package/dist/components/BottomSheetHeader/index.d.mts +0 -1
- package/dist/components/BottomSheetHeader/index.d.mts.map +1 -1
- package/dist/components/BottomSheetHeader/index.mjs +0 -1
- package/dist/components/BottomSheetHeader/index.mjs.map +1 -1
- package/dist/components/Content/Content.cjs +71 -0
- package/dist/components/Content/Content.cjs.map +1 -0
- package/dist/components/Content/Content.constants.cjs +9 -0
- package/dist/components/Content/Content.constants.cjs.map +1 -0
- package/dist/components/Content/Content.constants.d.cts +3 -0
- package/dist/components/Content/Content.constants.d.cts.map +1 -0
- package/dist/components/Content/Content.constants.d.mts +3 -0
- package/dist/components/Content/Content.constants.d.mts.map +1 -0
- package/dist/components/Content/Content.constants.mjs +6 -0
- package/dist/components/Content/Content.constants.mjs.map +1 -0
- package/dist/components/Content/Content.d.cts +4 -0
- package/dist/components/Content/Content.d.cts.map +1 -0
- package/dist/components/Content/Content.d.mts +4 -0
- package/dist/components/Content/Content.d.mts.map +1 -0
- package/dist/components/Content/Content.mjs +71 -0
- package/dist/components/Content/Content.mjs.map +1 -0
- package/dist/components/Content/Content.types.cjs +3 -0
- package/dist/components/Content/Content.types.cjs.map +1 -0
- package/dist/components/Content/Content.types.d.cts +31 -0
- package/dist/components/Content/Content.types.d.cts.map +1 -0
- package/dist/components/Content/Content.types.d.mts +31 -0
- package/dist/components/Content/Content.types.d.mts.map +1 -0
- package/dist/components/Content/Content.types.mjs +2 -0
- package/dist/components/Content/Content.types.mjs.map +1 -0
- package/dist/components/Content/index.cjs +8 -0
- package/dist/components/Content/index.cjs.map +1 -0
- package/dist/components/Content/index.d.cts +4 -0
- package/dist/components/Content/index.d.cts.map +1 -0
- package/dist/components/Content/index.d.mts +4 -0
- package/dist/components/Content/index.d.mts.map +1 -0
- package/dist/components/Content/index.mjs +3 -0
- package/dist/components/Content/index.mjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.cjs +93 -72
- package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.d.cts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.d.mts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.mjs +93 -72
- package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.cjs +0 -12
- package/dist/components/HeaderBase/HeaderBase.types.cjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.d.cts +11 -19
- package/dist/components/HeaderBase/HeaderBase.types.d.cts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.d.mts +11 -19
- package/dist/components/HeaderBase/HeaderBase.types.d.mts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.mjs +1 -11
- package/dist/components/HeaderBase/HeaderBase.types.mjs.map +1 -1
- package/dist/components/HeaderBase/index.cjs +1 -3
- package/dist/components/HeaderBase/index.cjs.map +1 -1
- package/dist/components/HeaderBase/index.d.cts +0 -1
- package/dist/components/HeaderBase/index.d.cts.map +1 -1
- package/dist/components/HeaderBase/index.d.mts +0 -1
- package/dist/components/HeaderBase/index.d.mts.map +1 -1
- package/dist/components/HeaderBase/index.mjs +0 -1
- package/dist/components/HeaderBase/index.mjs.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs +4 -12
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.cts +0 -8
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.cts.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.mts +0 -8
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.mts.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.mjs +3 -10
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.mjs.map +1 -1
- package/dist/components/Icon/Icon.assets.cjs +2 -0
- package/dist/components/Icon/Icon.assets.cjs.map +1 -1
- package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
- package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
- package/dist/components/Icon/Icon.assets.mjs +2 -0
- package/dist/components/Icon/Icon.assets.mjs.map +1 -1
- package/dist/components/Icon/assets/flash-filled.svg +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.cjs +4 -6
- package/dist/components/SegmentGroup/SegmentGroup.cjs.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.d.cts.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.d.mts.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.mjs +5 -7
- package/dist/components/SegmentGroup/SegmentGroup.mjs.map +1 -1
- package/dist/components/Toast/Toast.constants.cjs +4 -7
- package/dist/components/Toast/Toast.constants.cjs.map +1 -1
- package/dist/components/Toast/Toast.constants.d.cts +1 -6
- package/dist/components/Toast/Toast.constants.d.cts.map +1 -1
- package/dist/components/Toast/Toast.constants.d.mts +1 -6
- package/dist/components/Toast/Toast.constants.d.mts.map +1 -1
- package/dist/components/Toast/Toast.constants.mjs +1 -6
- package/dist/components/Toast/Toast.constants.mjs.map +1 -1
- package/dist/components/Toast/Toast.types.cjs +2 -10
- package/dist/components/Toast/Toast.types.cjs.map +1 -1
- package/dist/components/Toast/Toast.types.d.cts +4 -11
- package/dist/components/Toast/Toast.types.d.cts.map +1 -1
- package/dist/components/Toast/Toast.types.d.mts +4 -11
- package/dist/components/Toast/Toast.types.d.mts.map +1 -1
- package/dist/components/Toast/Toast.types.mjs +2 -10
- package/dist/components/Toast/Toast.types.mjs.map +1 -1
- package/dist/components/Toast/index.cjs +3 -5
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts +2 -2
- package/dist/components/Toast/index.d.cts.map +1 -1
- package/dist/components/Toast/index.d.mts +2 -2
- package/dist/components/Toast/index.d.mts.map +1 -1
- package/dist/components/Toast/index.mjs +2 -2
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/index.cjs +5 -4
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +4 -2
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +4 -2
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +3 -2
- package/dist/components/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.cjs +0 -15
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.cjs.map +0 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.cts +0 -7
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.cts.map +0 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.mts +0 -7
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.mts.map +0 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.mjs +0 -12
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.mjs.map +0 -1
- package/dist/components/HeaderBase/HeaderBase.constants.cjs +0 -15
- package/dist/components/HeaderBase/HeaderBase.constants.cjs.map +0 -1
- package/dist/components/HeaderBase/HeaderBase.constants.d.cts +0 -7
- package/dist/components/HeaderBase/HeaderBase.constants.d.cts.map +0 -1
- package/dist/components/HeaderBase/HeaderBase.constants.d.mts +0 -7
- package/dist/components/HeaderBase/HeaderBase.constants.d.mts.map +0 -1
- package/dist/components/HeaderBase/HeaderBase.constants.mjs +0 -12
- package/dist/components/HeaderBase/HeaderBase.constants.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.27.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Added `FlashFilled` icon (filled lightning bolt) to `IconName` ([#1191](https://github.com/MetaMask/metamask-design-system/pull/1191))
|
|
15
|
+
- Added `SelectButtonSize` so `SelectButton` exposes a semantic size type ([#1177](https://github.com/MetaMask/metamask-design-system/pull/1177))
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **BREAKING:** Removed `panGestureHandlerProps` from `BottomSheet` and `BottomSheetDialog` following the migration to the `react-native-gesture-handler` v2 `GestureDetector`/`Gesture.Pan()` API ([#1165](https://github.com/MetaMask/metamask-design-system/pull/1165))
|
|
20
|
+
- See [Migration Guide](./MIGRATION.md#from-version-0260-to-0270)
|
|
21
|
+
- **BREAKING:** Removed the variant-based title API from `HeaderBase` and `BottomSheetHeader` ([#1103](https://github.com/MetaMask/metamask-design-system/pull/1103))
|
|
22
|
+
- Removed `variant`, `HeaderBaseVariant`, and `BottomSheetHeaderVariant`, plus `HeaderBase`'s `titleTestID`
|
|
23
|
+
- String titles now render with a centered `HeadingSm` treatment; pass custom `children` for bespoke title layouts and use `textProps.testID` in place of `titleTestID`
|
|
24
|
+
- See [Migration Guide](./MIGRATION.md#from-version-0260-to-0270)
|
|
25
|
+
- Reduced the default `SegmentGroup` segment spacing from `gap-3` to `gap-1` for tighter grouped segments ([#1194](https://github.com/MetaMask/metamask-design-system/pull/1194))
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Fixed a `HeaderStandardAnimated` runtime crash under React Native Reanimated 4 by inlining the scroll-handler worklet ([#1185](https://github.com/MetaMask/metamask-design-system/pull/1185))
|
|
30
|
+
- Fixed React Native Web rendering for `BottomSheet`, `BottomSheetOverlay`, `Icon`, and the animated `ButtonAnimated` and `Spinner` components ([#1187](https://github.com/MetaMask/metamask-design-system/pull/1187))
|
|
31
|
+
|
|
10
32
|
## [0.26.0]
|
|
11
33
|
|
|
12
34
|
### Added
|
|
@@ -446,7 +468,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
446
468
|
- Full TypeScript support with type definitions and enums
|
|
447
469
|
- React Native integration with TWRNC preset support
|
|
448
470
|
|
|
449
|
-
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.
|
|
471
|
+
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.27.0...HEAD
|
|
472
|
+
[0.27.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.26.0...@metamask/design-system-react-native@0.27.0
|
|
450
473
|
[0.26.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.25.0...@metamask/design-system-react-native@0.26.0
|
|
451
474
|
[0.25.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.24.0...@metamask/design-system-react-native@0.25.0
|
|
452
475
|
[0.24.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.23.0...@metamask/design-system-react-native@0.24.0
|
|
@@ -11,15 +11,11 @@ const react_1 = __importDefault(require("react"));
|
|
|
11
11
|
const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
|
|
12
12
|
const HeaderBase_1 = require("../HeaderBase/index.cjs");
|
|
13
13
|
const Icon_1 = require("../Icon/index.cjs");
|
|
14
|
-
|
|
15
|
-
const BottomSheetHeader_constants_1 = require("./BottomSheetHeader.constants.cjs");
|
|
16
|
-
const BottomSheetHeader_types_1 = require("./BottomSheetHeader.types.cjs");
|
|
17
|
-
const BottomSheetHeader = ({ style, twClassName, children, onBack, backButtonProps, onClose, closeButtonProps, variant = BottomSheetHeader_types_1.BottomSheetHeaderVariant.Compact, ...props }) => {
|
|
14
|
+
const BottomSheetHeader = ({ style, twClassName, children, onBack, backButtonProps, onClose, closeButtonProps, ...props }) => {
|
|
18
15
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
19
16
|
const startAccessory = onBack ? (<ButtonIcon_1.ButtonIcon iconName={Icon_1.IconName.ArrowLeft} onPress={onBack} size={ButtonIcon_1.ButtonIconSize.Md} {...backButtonProps}/>) : undefined;
|
|
20
17
|
const endAccessory = onClose ? (<ButtonIcon_1.ButtonIcon iconName={Icon_1.IconName.Close} onPress={onClose} size={ButtonIcon_1.ButtonIconSize.Md} {...closeButtonProps}/>) : undefined;
|
|
21
|
-
|
|
22
|
-
return (<HeaderBase_1.HeaderBase {...props} style={[tw.style('px-4', twClassName), style]} startAccessory={startAccessory} endAccessory={endAccessory} variant={headerBaseVariant}>
|
|
18
|
+
return (<HeaderBase_1.HeaderBase {...props} style={[tw.style('px-4', twClassName), style]} startAccessory={startAccessory} endAccessory={endAccessory}>
|
|
23
19
|
{children}
|
|
24
20
|
</HeaderBase_1.HeaderBase>);
|
|
25
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;
|
|
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-4', twClassName), style]}\n startAccessory={startAccessory}\n endAccessory={endAccessory}\n >\n {children}\n </HeaderBase>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetHeader.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;
|
|
1
|
+
{"version":3,"file":"BottomSheetHeader.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,sCAAkC;AAExE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuC9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetHeader.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;
|
|
1
|
+
{"version":3,"file":"BottomSheetHeader.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,sCAAkC;AAExE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuC9D,CAAC"}
|
|
@@ -12,15 +12,11 @@ const React = $importDefault($React);
|
|
|
12
12
|
import { ButtonIcon, ButtonIconSize } from "../ButtonIcon/index.mjs";
|
|
13
13
|
import { HeaderBase } from "../HeaderBase/index.mjs";
|
|
14
14
|
import { IconName } from "../Icon/index.mjs";
|
|
15
|
-
|
|
16
|
-
import { BOTTOM_SHEET_HEADER_VARIANT_MAP } from "./BottomSheetHeader.constants.mjs";
|
|
17
|
-
import { BottomSheetHeaderVariant } from "./BottomSheetHeader.types.mjs";
|
|
18
|
-
export const BottomSheetHeader = ({ style, twClassName, children, onBack, backButtonProps, onClose, closeButtonProps, variant = BottomSheetHeaderVariant.Compact, ...props }) => {
|
|
15
|
+
export const BottomSheetHeader = ({ style, twClassName, children, onBack, backButtonProps, onClose, closeButtonProps, ...props }) => {
|
|
19
16
|
const tw = useTailwind();
|
|
20
17
|
const startAccessory = onBack ? (<ButtonIcon iconName={IconName.ArrowLeft} onPress={onBack} size={ButtonIconSize.Md} {...backButtonProps}/>) : undefined;
|
|
21
18
|
const endAccessory = onClose ? (<ButtonIcon iconName={IconName.Close} onPress={onClose} size={ButtonIconSize.Md} {...closeButtonProps}/>) : undefined;
|
|
22
|
-
|
|
23
|
-
return (<HeaderBase {...props} style={[tw.style('px-4', twClassName), style]} startAccessory={startAccessory} endAccessory={endAccessory} variant={headerBaseVariant}>
|
|
19
|
+
return (<HeaderBase {...props} style={[tw.style('px-4', twClassName), style]} startAccessory={startAccessory} endAccessory={endAccessory}>
|
|
24
20
|
{children}
|
|
25
21
|
</HeaderBase>);
|
|
26
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;
|
|
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-4', twClassName), style]}\n startAccessory={startAccessory}\n endAccessory={endAccessory}\n >\n {children}\n </HeaderBase>\n );\n};\n"]}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BottomSheetHeaderVariant = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Variant options for BottomSheetHeader component.
|
|
6
|
-
* - Compact: Center-aligned title with HeadingSm text (default)
|
|
7
|
-
* - Display: Left-aligned title with HeadingLg text
|
|
8
|
-
*/
|
|
9
|
-
var BottomSheetHeaderVariant;
|
|
10
|
-
(function (BottomSheetHeaderVariant) {
|
|
11
|
-
BottomSheetHeaderVariant["Display"] = "display";
|
|
12
|
-
BottomSheetHeaderVariant["Compact"] = "compact";
|
|
13
|
-
})(BottomSheetHeaderVariant || (exports.BottomSheetHeaderVariant = BottomSheetHeaderVariant = {}));
|
|
14
3
|
//# sourceMappingURL=BottomSheetHeader.types.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetHeader.types.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomSheetHeader.types.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconProps } from '../ButtonIcon/ButtonIcon.types';\nimport type { HeaderBaseProps } from '../HeaderBase/HeaderBase.types';\n\n/**\n * BottomSheetHeader component props.\n *\n * Extends HeaderBase's root and title props to inherit standard props such as\n * `testID`, `accessibilityLabel`, `textProps`, and other View props.\n * Start and end accessories are controlled internally via `onBack` and\n * `onClose`, so `startAccessory`, `endAccessory`, `startButtonIconProps`,\n * and `endButtonIconProps` are not part of this API.\n */\nexport type BottomSheetHeaderProps = {\n /**\n * Callback function triggered when the back button is pressed.\n * When provided, a back arrow ButtonIcon is rendered as the start accessory.\n */\n onBack?: () => void;\n /**\n * Props spread to the back ButtonIcon component for additional properties\n * like `testID` or `accessibilityLabel`. Use this for testing or accessibility purposes.\n * Note: `iconName` and `onPress` are managed internally and excluded.\n */\n backButtonProps?: Partial<Omit<ButtonIconProps, 'iconName' | 'onPress'>>;\n /**\n * Callback function triggered when the close button is pressed.\n * When provided, a close ButtonIcon is rendered as the end accessory.\n */\n onClose?: () => void;\n /**\n * Props spread to the close ButtonIcon component for additional properties\n * like `testID` or `accessibilityLabel`. Use this for testing or accessibility purposes.\n * Note: `iconName` and `onPress` are managed internally and excluded.\n */\n closeButtonProps?: Partial<Omit<ButtonIconProps, 'iconName' | 'onPress'>>;\n} & Omit<\n HeaderBaseProps,\n | 'startAccessory'\n | 'endAccessory'\n | 'startButtonIconProps'\n | 'endButtonIconProps'\n>;\n"]}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import type { ButtonIconProps } from "../ButtonIcon/ButtonIcon.types.cjs";
|
|
2
2
|
import type { HeaderBaseProps } from "../HeaderBase/HeaderBase.types.cjs";
|
|
3
|
-
/**
|
|
4
|
-
* Variant options for BottomSheetHeader component.
|
|
5
|
-
* - Compact: Center-aligned title with HeadingSm text (default)
|
|
6
|
-
* - Display: Left-aligned title with HeadingLg text
|
|
7
|
-
*/
|
|
8
|
-
export declare enum BottomSheetHeaderVariant {
|
|
9
|
-
Display = "display",
|
|
10
|
-
Compact = "compact"
|
|
11
|
-
}
|
|
12
3
|
/**
|
|
13
4
|
* BottomSheetHeader component props.
|
|
14
5
|
*
|
|
15
|
-
* Extends HeaderBase's
|
|
16
|
-
*
|
|
6
|
+
* Extends HeaderBase's root and title props to inherit standard props such as
|
|
7
|
+
* `testID`, `accessibilityLabel`, `textProps`, and other View props.
|
|
8
|
+
* Start and end accessories are controlled internally via `onBack` and
|
|
9
|
+
* `onClose`, so `startAccessory`, `endAccessory`, `startButtonIconProps`,
|
|
10
|
+
* and `endButtonIconProps` are not part of this API.
|
|
17
11
|
*/
|
|
18
12
|
export type BottomSheetHeaderProps = {
|
|
19
13
|
/**
|
|
@@ -38,13 +32,5 @@ export type BottomSheetHeaderProps = {
|
|
|
38
32
|
* Note: `iconName` and `onPress` are managed internally and excluded.
|
|
39
33
|
*/
|
|
40
34
|
closeButtonProps?: Partial<Omit<ButtonIconProps, 'iconName' | 'onPress'>>;
|
|
41
|
-
|
|
42
|
-
* Variant controlling header alignment and text size.
|
|
43
|
-
* - Compact: center-aligned with HeadingSm text
|
|
44
|
-
* - Display: left-aligned with HeadingLg text
|
|
45
|
-
*
|
|
46
|
-
* @default BottomSheetHeaderVariant.Compact
|
|
47
|
-
*/
|
|
48
|
-
variant?: BottomSheetHeaderVariant;
|
|
49
|
-
} & Omit<HeaderBaseProps, 'variant'>;
|
|
35
|
+
} & Omit<HeaderBaseProps, 'startAccessory' | 'endAccessory' | 'startButtonIconProps' | 'endButtonIconProps'>;
|
|
50
36
|
//# sourceMappingURL=BottomSheetHeader.types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetHeader.types.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AAEtE
|
|
1
|
+
{"version":3,"file":"BottomSheetHeader.types.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AAEtE;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC;IACzE;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC;CAC3E,GAAG,IAAI,CACN,eAAe,EACb,gBAAgB,GAChB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,CACvB,CAAC"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import type { ButtonIconProps } from "../ButtonIcon/ButtonIcon.types.mjs";
|
|
2
2
|
import type { HeaderBaseProps } from "../HeaderBase/HeaderBase.types.mjs";
|
|
3
|
-
/**
|
|
4
|
-
* Variant options for BottomSheetHeader component.
|
|
5
|
-
* - Compact: Center-aligned title with HeadingSm text (default)
|
|
6
|
-
* - Display: Left-aligned title with HeadingLg text
|
|
7
|
-
*/
|
|
8
|
-
export declare enum BottomSheetHeaderVariant {
|
|
9
|
-
Display = "display",
|
|
10
|
-
Compact = "compact"
|
|
11
|
-
}
|
|
12
3
|
/**
|
|
13
4
|
* BottomSheetHeader component props.
|
|
14
5
|
*
|
|
15
|
-
* Extends HeaderBase's
|
|
16
|
-
*
|
|
6
|
+
* Extends HeaderBase's root and title props to inherit standard props such as
|
|
7
|
+
* `testID`, `accessibilityLabel`, `textProps`, and other View props.
|
|
8
|
+
* Start and end accessories are controlled internally via `onBack` and
|
|
9
|
+
* `onClose`, so `startAccessory`, `endAccessory`, `startButtonIconProps`,
|
|
10
|
+
* and `endButtonIconProps` are not part of this API.
|
|
17
11
|
*/
|
|
18
12
|
export type BottomSheetHeaderProps = {
|
|
19
13
|
/**
|
|
@@ -38,13 +32,5 @@ export type BottomSheetHeaderProps = {
|
|
|
38
32
|
* Note: `iconName` and `onPress` are managed internally and excluded.
|
|
39
33
|
*/
|
|
40
34
|
closeButtonProps?: Partial<Omit<ButtonIconProps, 'iconName' | 'onPress'>>;
|
|
41
|
-
|
|
42
|
-
* Variant controlling header alignment and text size.
|
|
43
|
-
* - Compact: center-aligned with HeadingSm text
|
|
44
|
-
* - Display: left-aligned with HeadingLg text
|
|
45
|
-
*
|
|
46
|
-
* @default BottomSheetHeaderVariant.Compact
|
|
47
|
-
*/
|
|
48
|
-
variant?: BottomSheetHeaderVariant;
|
|
49
|
-
} & Omit<HeaderBaseProps, 'variant'>;
|
|
35
|
+
} & Omit<HeaderBaseProps, 'startAccessory' | 'endAccessory' | 'startButtonIconProps' | 'endButtonIconProps'>;
|
|
50
36
|
//# sourceMappingURL=BottomSheetHeader.types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetHeader.types.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AAEtE
|
|
1
|
+
{"version":3,"file":"BottomSheetHeader.types.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AAEtE;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC;IACzE;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC;CAC3E,GAAG,IAAI,CACN,eAAe,EACb,gBAAgB,GAChB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,CACvB,CAAC"}
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Variant options for BottomSheetHeader component.
|
|
3
|
-
* - Compact: Center-aligned title with HeadingSm text (default)
|
|
4
|
-
* - Display: Left-aligned title with HeadingLg text
|
|
5
|
-
*/
|
|
6
|
-
export var BottomSheetHeaderVariant;
|
|
7
|
-
(function (BottomSheetHeaderVariant) {
|
|
8
|
-
BottomSheetHeaderVariant["Display"] = "display";
|
|
9
|
-
BottomSheetHeaderVariant["Compact"] = "compact";
|
|
10
|
-
})(BottomSheetHeaderVariant || (BottomSheetHeaderVariant = {}));
|
|
1
|
+
export {};
|
|
11
2
|
//# sourceMappingURL=BottomSheetHeader.types.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetHeader.types.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomSheetHeader.types.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/BottomSheetHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconProps } from '../ButtonIcon/ButtonIcon.types';\nimport type { HeaderBaseProps } from '../HeaderBase/HeaderBase.types';\n\n/**\n * BottomSheetHeader component props.\n *\n * Extends HeaderBase's root and title props to inherit standard props such as\n * `testID`, `accessibilityLabel`, `textProps`, and other View props.\n * Start and end accessories are controlled internally via `onBack` and\n * `onClose`, so `startAccessory`, `endAccessory`, `startButtonIconProps`,\n * and `endButtonIconProps` are not part of this API.\n */\nexport type BottomSheetHeaderProps = {\n /**\n * Callback function triggered when the back button is pressed.\n * When provided, a back arrow ButtonIcon is rendered as the start accessory.\n */\n onBack?: () => void;\n /**\n * Props spread to the back ButtonIcon component for additional properties\n * like `testID` or `accessibilityLabel`. Use this for testing or accessibility purposes.\n * Note: `iconName` and `onPress` are managed internally and excluded.\n */\n backButtonProps?: Partial<Omit<ButtonIconProps, 'iconName' | 'onPress'>>;\n /**\n * Callback function triggered when the close button is pressed.\n * When provided, a close ButtonIcon is rendered as the end accessory.\n */\n onClose?: () => void;\n /**\n * Props spread to the close ButtonIcon component for additional properties\n * like `testID` or `accessibilityLabel`. Use this for testing or accessibility purposes.\n * Note: `iconName` and `onPress` are managed internally and excluded.\n */\n closeButtonProps?: Partial<Omit<ButtonIconProps, 'iconName' | 'onPress'>>;\n} & Omit<\n HeaderBaseProps,\n | 'startAccessory'\n | 'endAccessory'\n | 'startButtonIconProps'\n | 'endButtonIconProps'\n>;\n"]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.BottomSheetHeader = void 0;
|
|
4
4
|
var BottomSheetHeader_1 = require("./BottomSheetHeader.cjs");
|
|
5
5
|
Object.defineProperty(exports, "BottomSheetHeader", { enumerable: true, get: function () { return BottomSheetHeader_1.BottomSheetHeader; } });
|
|
6
|
-
var BottomSheetHeader_types_1 = require("./BottomSheetHeader.types.cjs");
|
|
7
|
-
Object.defineProperty(exports, "BottomSheetHeaderVariant", { enumerable: true, get: function () { return BottomSheetHeader_types_1.BottomSheetHeaderVariant; } });
|
|
8
6
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/index.ts"],"names":[],"mappings":";;;AAAA,6DAAwD;AAA/C,sHAAA,iBAAiB,OAAA
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/index.ts"],"names":[],"mappings":";;;AAAA,6DAAwD;AAA/C,sHAAA,iBAAiB,OAAA","sourcesContent":["export { BottomSheetHeader } from './BottomSheetHeader';\nexport type { BottomSheetHeaderProps } from './BottomSheetHeader.types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B;AACxD,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B;AACxD,YAAY,EAAE,sBAAsB,EAAE,sCAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B;AACxD,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B;AACxD,YAAY,EAAE,sBAAsB,EAAE,sCAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B","sourcesContent":["export { BottomSheetHeader } from './BottomSheetHeader';\nexport type { BottomSheetHeaderProps } from './BottomSheetHeader.types';\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Content = void 0;
|
|
7
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const BoxColumn_1 = require("../BoxColumn/index.cjs");
|
|
10
|
+
const BoxRow_1 = require("../BoxRow/index.cjs");
|
|
11
|
+
const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
|
|
12
|
+
const Content_constants_1 = require("./Content.constants.cjs");
|
|
13
|
+
const Content = ({ startAccessory, endAccessory, topAccessory, bottomAccessory, verticalAlignment = design_system_shared_1.ContentVerticalAlignment.Center, avatar, twClassName, title, titleProps, titleStartAccessory, titleEndAccessory, description, descriptionProps, descriptionStartAccessory, descriptionEndAccessory, value, valueProps, valueStartAccessory, valueEndAccessory, subvalue, subvalueProps, subvalueStartAccessory, subvalueEndAccessory, ...props }) => {
|
|
14
|
+
const hasColumnShell = Boolean(topAccessory) || Boolean(bottomAccessory);
|
|
15
|
+
const contentRow = (<BoxRow_1.BoxRow startAccessory={startAccessory} endAccessory={endAccessory} alignItems={Content_constants_1.VERTICAL_ALIGNMENT_MAP[verticalAlignment]} gap={4} twClassName={`min-h-[46px] ${hasColumnShell ? 'min-w-0' : (twClassName ?? '')}`.trim()} {...(hasColumnShell ? {} : props)}>
|
|
16
|
+
{avatar}
|
|
17
|
+
{/* Title and description Column */}
|
|
18
|
+
<BoxColumn_1.BoxColumn twClassName="flex-1 min-w-0" bottomAccessory={description ? (<BoxRow_1.BoxRow twClassName="w-full" startAccessory={descriptionStartAccessory} endAccessory={descriptionEndAccessory} gap={1}>
|
|
19
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
20
|
+
variant: design_system_shared_1.TextVariant.BodySm,
|
|
21
|
+
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
22
|
+
color: design_system_shared_1.TextColor.TextAlternative,
|
|
23
|
+
...descriptionProps,
|
|
24
|
+
}}>
|
|
25
|
+
{description}
|
|
26
|
+
</TextOrChildren_1.TextOrChildren>
|
|
27
|
+
</BoxRow_1.BoxRow>) : null}>
|
|
28
|
+
{title ? (<BoxRow_1.BoxRow twClassName="w-full" startAccessory={titleStartAccessory} endAccessory={titleEndAccessory} gap={1}>
|
|
29
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
30
|
+
variant: design_system_shared_1.TextVariant.BodyMd,
|
|
31
|
+
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
32
|
+
color: design_system_shared_1.TextColor.TextDefault,
|
|
33
|
+
...titleProps,
|
|
34
|
+
}}>
|
|
35
|
+
{title}
|
|
36
|
+
</TextOrChildren_1.TextOrChildren>
|
|
37
|
+
</BoxRow_1.BoxRow>) : null}
|
|
38
|
+
</BoxColumn_1.BoxColumn>
|
|
39
|
+
{/* Value and subvalue Column */}
|
|
40
|
+
{value || subvalue ? (<BoxColumn_1.BoxColumn twClassName="min-w-0" bottomAccessory={subvalue ? (<BoxRow_1.BoxRow twClassName="w-full" startAccessory={subvalueStartAccessory} endAccessory={subvalueEndAccessory} gap={1}>
|
|
41
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
42
|
+
variant: design_system_shared_1.TextVariant.BodySm,
|
|
43
|
+
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
44
|
+
color: design_system_shared_1.TextColor.TextAlternative,
|
|
45
|
+
...subvalueProps,
|
|
46
|
+
}}>
|
|
47
|
+
{subvalue}
|
|
48
|
+
</TextOrChildren_1.TextOrChildren>
|
|
49
|
+
</BoxRow_1.BoxRow>) : null}>
|
|
50
|
+
{value ? (<BoxRow_1.BoxRow twClassName="w-full" startAccessory={valueStartAccessory} endAccessory={valueEndAccessory} gap={1}>
|
|
51
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
52
|
+
variant: design_system_shared_1.TextVariant.BodyMd,
|
|
53
|
+
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
54
|
+
color: design_system_shared_1.TextColor.TextDefault,
|
|
55
|
+
...valueProps,
|
|
56
|
+
}}>
|
|
57
|
+
{value}
|
|
58
|
+
</TextOrChildren_1.TextOrChildren>
|
|
59
|
+
</BoxRow_1.BoxRow>) : null}
|
|
60
|
+
</BoxColumn_1.BoxColumn>) : null}
|
|
61
|
+
</BoxRow_1.BoxRow>);
|
|
62
|
+
if (hasColumnShell) {
|
|
63
|
+
return (<BoxColumn_1.BoxColumn gap={1} topAccessory={topAccessory} bottomAccessory={bottomAccessory} twClassName={twClassName} {...props}>
|
|
64
|
+
{contentRow}
|
|
65
|
+
</BoxColumn_1.BoxColumn>);
|
|
66
|
+
}
|
|
67
|
+
return contentRow;
|
|
68
|
+
};
|
|
69
|
+
exports.Content = Content;
|
|
70
|
+
exports.Content.displayName = 'Content';
|
|
71
|
+
//# sourceMappingURL=Content.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.cjs","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAKiD;AACjD,kDAA0B;AAE1B,sDAAyC;AACzC,gDAAmC;AACnC,gFAAmE;AAEnE,+DAA6D;AAGtD,MAAM,OAAO,GAA2B,CAAC,EAC9C,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,GAAG,+CAAwB,CAAC,MAAM,EACnD,MAAM,EACN,WAAW,EACX,K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c,CAClB;cAAA,EAAE,eAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACT,CAED;UAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,eAAM,CACL,WAAW,CAAC,QAAQ,CACpB,cAAc,CAAC,CAAC,mBAAmB,CAAC,CACpC,YAAY,CAAC,CAAC,iBAAiB,CAAC,CAChC,GAAG,CAAC,CAAC,CAAC,CAAC,CAEP;cAAA,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC;oBACT,OAAO,EAAE,kCAAW,CAAC,MAAM;oBAC3B,UAAU,EAAE,iCAAU,CAAC,MAAM;oBAC7B,KAAK,EAAE,gCAAS,CAAC,WAAW;oBAC5B,GAAG,UAAU;iBACd,CAAC,CAEF;gBAAA,CAAC,KAAK,CACR;cAAA,EAAE,+BAAc,CAClB;YAAA,EAAE,eAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,qBAAS,CAAC,CACb,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,eAAM,CAAC,CACV,CAAC;IAEF,IAAI,cAAc,EAAE;QAClB,OAAO,CACL,CAAC,qBAAS,CACR,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,UAAU,CACb;MAAA,EAAE,qBAAS,CAAC,CACb,CAAC;KACH;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AApJW,QAAA,OAAO,WAoJlB;AAEF,eAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import {\n ContentVerticalAlignment,\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport { VERTICAL_ALIGNMENT_MAP } from './Content.constants';\nimport type { ContentProps } from './Content.types';\n\nexport const Content: React.FC<ContentProps> = ({\n startAccessory,\n endAccessory,\n topAccessory,\n bottomAccessory,\n verticalAlignment = ContentVerticalAlignment.Center,\n avatar,\n twClassName,\n title,\n titleProps,\n titleStartAccessory,\n titleEndAccessory,\n description,\n descriptionProps,\n descriptionStartAccessory,\n descriptionEndAccessory,\n value,\n valueProps,\n valueStartAccessory,\n valueEndAccessory,\n subvalue,\n subvalueProps,\n subvalueStartAccessory,\n subvalueEndAccessory,\n ...props\n}) => {\n const hasColumnShell = Boolean(topAccessory) || Boolean(bottomAccessory);\n\n const contentRow = (\n <BoxRow\n startAccessory={startAccessory}\n endAccessory={endAccessory}\n alignItems={VERTICAL_ALIGNMENT_MAP[verticalAlignment]}\n gap={4}\n twClassName={`min-h-[46px] ${hasColumnShell ? 'min-w-0' : (twClassName ?? '')}`.trim()}\n {...(hasColumnShell ? {} : props)}\n >\n {avatar}\n {/* Title and description Column */}\n <BoxColumn\n twClassName=\"flex-1 min-w-0\"\n bottomAccessory={\n description ? (\n <BoxRow\n twClassName=\"w-full\"\n startAccessory={descriptionStartAccessory}\n endAccessory={descriptionEndAccessory}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n ...descriptionProps,\n }}\n >\n {description}\n </TextOrChildren>\n </BoxRow>\n ) : null\n }\n >\n {title ? (\n <BoxRow\n twClassName=\"w-full\"\n startAccessory={titleStartAccessory}\n endAccessory={titleEndAccessory}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </TextOrChildren>\n </BoxRow>\n ) : null}\n </BoxColumn>\n {/* Value and subvalue Column */}\n {value || subvalue ? (\n <BoxColumn\n twClassName=\"min-w-0\"\n bottomAccessory={\n subvalue ? (\n <BoxRow\n twClassName=\"w-full\"\n startAccessory={subvalueStartAccessory}\n endAccessory={subvalueEndAccessory}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n ...subvalueProps,\n }}\n >\n {subvalue}\n </TextOrChildren>\n </BoxRow>\n ) : null\n }\n >\n {value ? (\n <BoxRow\n twClassName=\"w-full\"\n startAccessory={valueStartAccessory}\n endAccessory={valueEndAccessory}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n ...valueProps,\n }}\n >\n {value}\n </TextOrChildren>\n </BoxRow>\n ) : null}\n </BoxColumn>\n ) : null}\n </BoxRow>\n );\n\n if (hasColumnShell) {\n return (\n <BoxColumn\n gap={1}\n topAccessory={topAccessory}\n bottomAccessory={bottomAccessory}\n twClassName={twClassName}\n {...props}\n >\n {contentRow}\n </BoxColumn>\n );\n }\n\n return contentRow;\n};\n\nContent.displayName = 'Content';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VERTICAL_ALIGNMENT_MAP = void 0;
|
|
4
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
exports.VERTICAL_ALIGNMENT_MAP = {
|
|
6
|
+
[design_system_shared_1.ContentVerticalAlignment.Top]: design_system_shared_1.BoxAlignItems.Start,
|
|
7
|
+
[design_system_shared_1.ContentVerticalAlignment.Center]: design_system_shared_1.BoxAlignItems.Center,
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=Content.constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.constants.cjs","sourceRoot":"","sources":["../../../src/components/Content/Content.constants.ts"],"names":[],"mappings":";;;AAAA,kFAGiD;AAEpC,QAAA,sBAAsB,GAG/B;IACF,CAAC,+CAAwB,CAAC,GAAG,CAAC,EAAE,oCAAa,CAAC,KAAK;IACnD,CAAC,+CAAwB,CAAC,MAAM,CAAC,EAAE,oCAAa,CAAC,MAAM;CACxD,CAAC","sourcesContent":["import {\n BoxAlignItems,\n ContentVerticalAlignment,\n} from '@metamask-previews/design-system-shared';\n\nexport const VERTICAL_ALIGNMENT_MAP: Record<\n ContentVerticalAlignment,\n BoxAlignItems\n> = {\n [ContentVerticalAlignment.Top]: BoxAlignItems.Start,\n [ContentVerticalAlignment.Center]: BoxAlignItems.Center,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Content/Content.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,wBAAwB,EACzB,gDAAgD;AAEjD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,wBAAwB,EACxB,aAAa,CAId,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Content/Content.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,wBAAwB,EACzB,gDAAgD;AAEjD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,wBAAwB,EACxB,aAAa,CAId,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BoxAlignItems, ContentVerticalAlignment } from "@metamask-previews/design-system-shared";
|
|
2
|
+
export const VERTICAL_ALIGNMENT_MAP = {
|
|
3
|
+
[ContentVerticalAlignment.Top]: BoxAlignItems.Start,
|
|
4
|
+
[ContentVerticalAlignment.Center]: BoxAlignItems.Center,
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=Content.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.constants.mjs","sourceRoot":"","sources":["../../../src/components/Content/Content.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,wBAAwB,EACzB,gDAAgD;AAEjD,MAAM,CAAC,MAAM,sBAAsB,GAG/B;IACF,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,KAAK;IACnD,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM;CACxD,CAAC","sourcesContent":["import {\n BoxAlignItems,\n ContentVerticalAlignment,\n} from '@metamask-previews/design-system-shared';\n\nexport const VERTICAL_ALIGNMENT_MAP: Record<\n ContentVerticalAlignment,\n BoxAlignItems\n> = {\n [ContentVerticalAlignment.Top]: BoxAlignItems.Start,\n [ContentVerticalAlignment.Center]: BoxAlignItems.Center,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.d.cts","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,YAAY,EAAE,4BAAwB;AAEpD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAoJ1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.d.mts","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,YAAY,EAAE,4BAAwB;AAEpD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAoJ1C,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { ContentVerticalAlignment, FontWeight, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { BoxColumn } from "../BoxColumn/index.mjs";
|
|
11
|
+
import { BoxRow } from "../BoxRow/index.mjs";
|
|
12
|
+
import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
|
|
13
|
+
import { VERTICAL_ALIGNMENT_MAP } from "./Content.constants.mjs";
|
|
14
|
+
export const Content = ({ startAccessory, endAccessory, topAccessory, bottomAccessory, verticalAlignment = ContentVerticalAlignment.Center, avatar, twClassName, title, titleProps, titleStartAccessory, titleEndAccessory, description, descriptionProps, descriptionStartAccessory, descriptionEndAccessory, value, valueProps, valueStartAccessory, valueEndAccessory, subvalue, subvalueProps, subvalueStartAccessory, subvalueEndAccessory, ...props }) => {
|
|
15
|
+
const hasColumnShell = Boolean(topAccessory) || Boolean(bottomAccessory);
|
|
16
|
+
const contentRow = (<BoxRow startAccessory={startAccessory} endAccessory={endAccessory} alignItems={VERTICAL_ALIGNMENT_MAP[verticalAlignment]} gap={4} twClassName={`min-h-[46px] ${hasColumnShell ? 'min-w-0' : (twClassName ?? '')}`.trim()} {...(hasColumnShell ? {} : props)}>
|
|
17
|
+
{avatar}
|
|
18
|
+
{/* Title and description Column */}
|
|
19
|
+
<BoxColumn twClassName="flex-1 min-w-0" bottomAccessory={description ? (<BoxRow twClassName="w-full" startAccessory={descriptionStartAccessory} endAccessory={descriptionEndAccessory} gap={1}>
|
|
20
|
+
<TextOrChildren textProps={{
|
|
21
|
+
variant: TextVariant.BodySm,
|
|
22
|
+
fontWeight: FontWeight.Medium,
|
|
23
|
+
color: TextColor.TextAlternative,
|
|
24
|
+
...descriptionProps,
|
|
25
|
+
}}>
|
|
26
|
+
{description}
|
|
27
|
+
</TextOrChildren>
|
|
28
|
+
</BoxRow>) : null}>
|
|
29
|
+
{title ? (<BoxRow twClassName="w-full" startAccessory={titleStartAccessory} endAccessory={titleEndAccessory} gap={1}>
|
|
30
|
+
<TextOrChildren textProps={{
|
|
31
|
+
variant: TextVariant.BodyMd,
|
|
32
|
+
fontWeight: FontWeight.Medium,
|
|
33
|
+
color: TextColor.TextDefault,
|
|
34
|
+
...titleProps,
|
|
35
|
+
}}>
|
|
36
|
+
{title}
|
|
37
|
+
</TextOrChildren>
|
|
38
|
+
</BoxRow>) : null}
|
|
39
|
+
</BoxColumn>
|
|
40
|
+
{/* Value and subvalue Column */}
|
|
41
|
+
{value || subvalue ? (<BoxColumn twClassName="min-w-0" bottomAccessory={subvalue ? (<BoxRow twClassName="w-full" startAccessory={subvalueStartAccessory} endAccessory={subvalueEndAccessory} gap={1}>
|
|
42
|
+
<TextOrChildren textProps={{
|
|
43
|
+
variant: TextVariant.BodySm,
|
|
44
|
+
fontWeight: FontWeight.Medium,
|
|
45
|
+
color: TextColor.TextAlternative,
|
|
46
|
+
...subvalueProps,
|
|
47
|
+
}}>
|
|
48
|
+
{subvalue}
|
|
49
|
+
</TextOrChildren>
|
|
50
|
+
</BoxRow>) : null}>
|
|
51
|
+
{value ? (<BoxRow twClassName="w-full" startAccessory={valueStartAccessory} endAccessory={valueEndAccessory} gap={1}>
|
|
52
|
+
<TextOrChildren textProps={{
|
|
53
|
+
variant: TextVariant.BodyMd,
|
|
54
|
+
fontWeight: FontWeight.Medium,
|
|
55
|
+
color: TextColor.TextDefault,
|
|
56
|
+
...valueProps,
|
|
57
|
+
}}>
|
|
58
|
+
{value}
|
|
59
|
+
</TextOrChildren>
|
|
60
|
+
</BoxRow>) : null}
|
|
61
|
+
</BoxColumn>) : null}
|
|
62
|
+
</BoxRow>);
|
|
63
|
+
if (hasColumnShell) {
|
|
64
|
+
return (<BoxColumn gap={1} topAccessory={topAccessory} bottomAccessory={bottomAccessory} twClassName={twClassName} {...props}>
|
|
65
|
+
{contentRow}
|
|
66
|
+
</BoxColumn>);
|
|
67
|
+
}
|
|
68
|
+
return contentRow;
|
|
69
|
+
};
|
|
70
|
+
Content.displayName = 'Content';
|
|
71
|
+
//# sourceMappingURL=Content.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.mjs","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,wBAAwB,EACxB,UAAU,EACV,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,SAAS,EAAE,+BAAqB;AACzC,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,cAAc,EAAE,oDAA0C;AAEnE,OAAO,EAAE,sBAAsB,EAAE,gCAA4B;AAG7D,MAAM,CAAC,MAAM,OAAO,GAA2B,CAAC,EAC9C,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,GAAG,wBAAwB,CAAC,MAAM,EACnD,MAAM,EACN,WAAW,EACX,KAAK,EACL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,KAAK,EACL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IAEzE,MAAM,UAAU,GAAG,CACjB,CAAC,MAAM,CACL,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,UAAU,CAAC,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CACtD,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,WAAW,CAAC,CAAC,gBAAgB,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CACvF,IAAI,CAAC,cAAc,CA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AAG,CAAC,CAAC,CAAC,CAAC,CACP,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,UAAU,CACb;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;KACH;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import {\n ContentVerticalAlignment,\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport { VERTICAL_ALIGNMENT_MAP } from './Content.constants';\nimport type { ContentProps } from './Content.types';\n\nexport const Content: React.FC<ContentProps> = ({\n startAccessory,\n endAccessory,\n topAccessory,\n bottomAccessory,\n verticalAlignment = ContentVerticalAlignment.Center,\n avatar,\n twClassName,\n title,\n titleProps,\n titleStartAccessory,\n titleEndAccessory,\n description,\n descriptionProps,\n descriptionStartAccessory,\n descriptionEndAccessory,\n value,\n valueProps,\n valueStartAccessory,\n valueEndAccessory,\n subvalue,\n subvalueProps,\n subvalueStartAccessory,\n subvalueEndAccessory,\n ...props\n}) => {\n const hasColumnShell = Boolean(topAccessory) || Boolean(bottomAccessory);\n\n const contentRow = (\n <BoxRow\n startAccessory={startAccessory}\n endAccessory={endAccessory}\n alignItems={VERTICAL_ALIGNMENT_MAP[verticalAlignment]}\n gap={4}\n twClassName={`min-h-[46px] ${hasColumnShell ? 'min-w-0' : (twClassName ?? '')}`.trim()}\n {...(hasColumnShell ? {} : props)}\n >\n {avatar}\n {/* Title and description Column */}\n <BoxColumn\n twClassName=\"flex-1 min-w-0\"\n bottomAccessory={\n description ? (\n <BoxRow\n twClassName=\"w-full\"\n startAccessory={descriptionStartAccessory}\n endAccessory={descriptionEndAccessory}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n ...descriptionProps,\n }}\n >\n {description}\n </TextOrChildren>\n </BoxRow>\n ) : null\n }\n >\n {title ? (\n <BoxRow\n twClassName=\"w-full\"\n startAccessory={titleStartAccessory}\n endAccessory={titleEndAccessory}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </TextOrChildren>\n </BoxRow>\n ) : null}\n </BoxColumn>\n {/* Value and subvalue Column */}\n {value || subvalue ? (\n <BoxColumn\n twClassName=\"min-w-0\"\n bottomAccessory={\n subvalue ? (\n <BoxRow\n twClassName=\"w-full\"\n startAccessory={subvalueStartAccessory}\n endAccessory={subvalueEndAccessory}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n ...subvalueProps,\n }}\n >\n {subvalue}\n </TextOrChildren>\n </BoxRow>\n ) : null\n }\n >\n {value ? (\n <BoxRow\n twClassName=\"w-full\"\n startAccessory={valueStartAccessory}\n endAccessory={valueEndAccessory}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n ...valueProps,\n }}\n >\n {value}\n </TextOrChildren>\n </BoxRow>\n ) : null}\n </BoxColumn>\n ) : null}\n </BoxRow>\n );\n\n if (hasColumnShell) {\n return (\n <BoxColumn\n gap={1}\n topAccessory={topAccessory}\n bottomAccessory={bottomAccessory}\n twClassName={twClassName}\n {...props}\n >\n {contentRow}\n </BoxColumn>\n );\n }\n\n return contentRow;\n};\n\nContent.displayName = 'Content';\n"]}
|