@metamask-previews/design-system-react-native 0.13.0-preview.69c659c → 0.13.0-preview.8028c20
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/AvatarAccount/AvatarAccount.cjs +4 -3
- package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.cjs +9 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts +2 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts +2 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.mjs +8 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.mjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.mjs +4 -3
- package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.cjs +3 -3
- package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.cjs +21 -21
- package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.cts +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.mts +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.cts +3 -39
- package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.mts +3 -39
- package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.mjs.map +1 -1
- package/dist/components/AvatarBase/index.cjs +3 -3
- package/dist/components/AvatarBase/index.cjs.map +1 -1
- package/dist/components/AvatarBase/index.d.cts +1 -1
- package/dist/components/AvatarBase/index.d.cts.map +1 -1
- package/dist/components/AvatarBase/index.d.mts +1 -1
- package/dist/components/AvatarBase/index.d.mts.map +1 -1
- package/dist/components/AvatarBase/index.mjs +1 -1
- package/dist/components/AvatarBase/index.mjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.cjs +8 -8
- package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts +2 -2
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts +2 -2
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.mjs +2 -2
- package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +1 -2
- 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 +1 -2
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +7 -10
- package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.cts +1 -2
- package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.mts +1 -2
- package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.mjs +5 -5
- package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.types.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.types.d.cts +3 -8
- package/dist/components/BottomSheet/BottomSheet.types.d.cts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.types.d.mts +3 -8
- package/dist/components/BottomSheet/BottomSheet.types.d.mts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.types.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +2 -2
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +1 -2
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +1 -2
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +1 -2
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/index.cjs +2 -5
- package/dist/components/BottomSheetDialog/index.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/index.d.cts +1 -1
- package/dist/components/BottomSheetDialog/index.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/index.d.mts +1 -1
- package/dist/components/BottomSheetDialog/index.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/index.mjs +1 -1
- package/dist/components/BottomSheetDialog/index.mjs.map +1 -1
- package/dist/components/Box/Box.constants.cjs.map +1 -1
- package/dist/components/Box/Box.constants.d.cts +1 -1
- package/dist/components/Box/Box.constants.d.cts.map +1 -1
- package/dist/components/Box/Box.constants.d.mts +1 -1
- package/dist/components/Box/Box.constants.d.mts.map +1 -1
- package/dist/components/Box/Box.constants.mjs.map +1 -1
- package/dist/components/Box/Box.types.cjs.map +1 -1
- package/dist/components/Box/Box.types.d.cts +107 -3
- package/dist/components/Box/Box.types.d.cts.map +1 -1
- package/dist/components/Box/Box.types.d.mts +107 -3
- package/dist/components/Box/Box.types.d.mts.map +1 -1
- package/dist/components/Box/Box.types.mjs.map +1 -1
- package/dist/components/Box/index.cjs +7 -7
- package/dist/components/Box/index.cjs.map +1 -1
- package/dist/components/Box/index.d.cts +2 -1
- package/dist/components/Box/index.d.cts.map +1 -1
- package/dist/components/Box/index.d.mts +2 -1
- package/dist/components/Box/index.d.mts.map +1 -1
- package/dist/components/Box/index.mjs +1 -1
- package/dist/components/Box/index.mjs.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.cjs +2 -2
- package/dist/components/BoxHorizontal/BoxHorizontal.cjs.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.d.cts.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.d.mts.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.mjs +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.mjs.map +1 -1
- package/dist/components/BoxVertical/BoxVertical.cjs +2 -2
- package/dist/components/BoxVertical/BoxVertical.cjs.map +1 -1
- package/dist/components/BoxVertical/BoxVertical.d.cts.map +1 -1
- package/dist/components/BoxVertical/BoxVertical.d.mts.map +1 -1
- package/dist/components/BoxVertical/BoxVertical.mjs +1 -1
- package/dist/components/BoxVertical/BoxVertical.mjs.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.cjs +61 -0
- package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.d.cts +7 -0
- package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.d.mts +7 -0
- package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.mjs +61 -0
- package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.cjs +3 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.cjs.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.d.cts +60 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.d.cts.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.d.mts +60 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.d.mts.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.mjs +2 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.mjs.map +1 -0
- package/dist/components/HeaderRoot/index.cjs +6 -0
- package/dist/components/HeaderRoot/index.cjs.map +1 -0
- package/dist/components/HeaderRoot/index.d.cts +3 -0
- package/dist/components/HeaderRoot/index.d.cts.map +1 -0
- package/dist/components/HeaderRoot/index.d.mts +3 -0
- package/dist/components/HeaderRoot/index.d.mts.map +1 -0
- package/dist/components/HeaderRoot/index.mjs +2 -0
- package/dist/components/HeaderRoot/index.mjs.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.cjs +101 -0
- package/dist/components/HeaderStandard/HeaderStandard.cjs.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.d.cts +4 -0
- package/dist/components/HeaderStandard/HeaderStandard.d.cts.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.d.mts +4 -0
- package/dist/components/HeaderStandard/HeaderStandard.d.mts.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.mjs +81 -0
- package/dist/components/HeaderStandard/HeaderStandard.mjs.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.cjs +8 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.cjs.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.d.cts +55 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.d.cts.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.d.mts +55 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.d.mts.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.mjs +10 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.mjs.map +1 -0
- package/dist/components/HeaderStandard/index.cjs +6 -0
- package/dist/components/HeaderStandard/index.cjs.map +1 -0
- package/dist/components/HeaderStandard/index.d.cts +3 -0
- package/dist/components/HeaderStandard/index.d.cts.map +1 -0
- package/dist/components/HeaderStandard/index.d.mts +3 -0
- package/dist/components/HeaderStandard/index.d.mts.map +1 -0
- package/dist/components/HeaderStandard/index.mjs +2 -0
- package/dist/components/HeaderStandard/index.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +2 -1
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +1 -2
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +1 -2
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +1 -2
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +2 -1
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +1 -2
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +1 -2
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +1 -2
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.cjs +17 -17
- package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.cts +1 -2
- package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.mts +1 -2
- package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.mjs +4 -5
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +2 -1
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +1 -2
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +1 -2
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +1 -2
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -1
- package/dist/components/KeyValueRow/index.cjs +2 -5
- package/dist/components/KeyValueRow/index.cjs.map +1 -1
- package/dist/components/KeyValueRow/index.d.cts +1 -1
- package/dist/components/KeyValueRow/index.d.cts.map +1 -1
- package/dist/components/KeyValueRow/index.d.mts +1 -1
- package/dist/components/KeyValueRow/index.d.mts.map +1 -1
- package/dist/components/KeyValueRow/index.mjs +1 -1
- package/dist/components/KeyValueRow/index.mjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.cjs +2 -1
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.cts +1 -2
- package/dist/components/Skeleton/Skeleton.d.cts.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.mts +1 -2
- package/dist/components/Skeleton/Skeleton.d.mts.map +1 -1
- package/dist/components/Skeleton/Skeleton.mjs +1 -2
- package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
- package/dist/components/Skeleton/index.cjs +1 -4
- package/dist/components/Skeleton/index.cjs.map +1 -1
- package/dist/components/Skeleton/index.d.cts +1 -1
- package/dist/components/Skeleton/index.d.cts.map +1 -1
- package/dist/components/Skeleton/index.d.mts +1 -1
- package/dist/components/Skeleton/index.d.mts.map +1 -1
- package/dist/components/Skeleton/index.mjs +1 -1
- package/dist/components/Skeleton/index.mjs.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.cjs +45 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +14 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +14 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.mjs +26 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs +3 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts +17 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts +17 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs +2 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs.map +1 -0
- package/dist/components/TextFieldSearch/index.cjs +6 -0
- package/dist/components/TextFieldSearch/index.cjs.map +1 -0
- package/dist/components/TextFieldSearch/index.d.cts +3 -0
- package/dist/components/TextFieldSearch/index.d.cts.map +1 -0
- package/dist/components/TextFieldSearch/index.d.mts +3 -0
- package/dist/components/TextFieldSearch/index.d.mts.map +1 -0
- package/dist/components/TextFieldSearch/index.mjs +2 -0
- package/dist/components/TextFieldSearch/index.mjs.map +1 -0
- package/dist/components/Toast/Toast.cjs +2 -2
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts +1 -2
- package/dist/components/Toast/Toast.d.cts.map +1 -1
- package/dist/components/Toast/Toast.d.mts +1 -2
- package/dist/components/Toast/Toast.d.mts.map +1 -1
- package/dist/components/Toast/Toast.mjs +1 -2
- package/dist/components/Toast/Toast.mjs.map +1 -1
- package/dist/components/Toast/index.cjs +1 -4
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts +1 -1
- package/dist/components/Toast/index.d.cts.map +1 -1
- package/dist/components/Toast/index.d.mts +1 -1
- package/dist/components/Toast/index.d.mts.map +1 -1
- package/dist/components/Toast/index.mjs +1 -1
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/index.cjs +9 -5
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +7 -1
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +7 -1
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +4 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +190 -41
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +182 -46
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +182 -46
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +180 -48
- package/dist/types/index.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
|
|
3
|
+
import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
|
|
4
|
+
import type { TextProps } from "../Text/index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* HeaderRoot component props.
|
|
7
|
+
* Left section renders either children or a title row (mutually exclusive).
|
|
8
|
+
* End section matches HeaderBase (endAccessory or endButtonIconProps).
|
|
9
|
+
*/
|
|
10
|
+
export type HeaderRootProps = ViewProps & {
|
|
11
|
+
/**
|
|
12
|
+
* Optional custom content for the left section.
|
|
13
|
+
* When provided, title/titleAccessory are not rendered (mutually exclusive).
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Optional content displayed after the title in the title row.
|
|
18
|
+
* Only used when children is not provided and title or titleAccessory is set.
|
|
19
|
+
*/
|
|
20
|
+
titleAccessory?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Optional main title. Can be a string or a React node.
|
|
23
|
+
* Only used when children is not provided.
|
|
24
|
+
* When string: rendered via TextOrChildren with TextVariant.HeadingLg; titleProps apply.
|
|
25
|
+
* When node: rendered via TextOrChildren as-is; titleProps are not applied to the node.
|
|
26
|
+
*/
|
|
27
|
+
title?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Optional props passed to the Text component when title is a string (TextOrChildren textProps).
|
|
30
|
+
*/
|
|
31
|
+
titleProps?: Partial<TextProps>;
|
|
32
|
+
/**
|
|
33
|
+
* Optional content to be displayed in the end section.
|
|
34
|
+
* Takes priority over endButtonIconProps if both are provided.
|
|
35
|
+
*/
|
|
36
|
+
endAccessory?: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Optional array of ButtonIcon props to render multiple ButtonIcons as end accessories.
|
|
39
|
+
* Rendered in reverse order (first item appears rightmost).
|
|
40
|
+
* Only used if endAccessory is not provided.
|
|
41
|
+
*/
|
|
42
|
+
endButtonIconProps?: ButtonIconProps[];
|
|
43
|
+
/**
|
|
44
|
+
* Optional prop to include the top inset so the header is visible below the device safe area.
|
|
45
|
+
*/
|
|
46
|
+
includesTopInset?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Optional style for the header container.
|
|
49
|
+
*/
|
|
50
|
+
style?: StyleProp<ViewStyle>;
|
|
51
|
+
/**
|
|
52
|
+
* Optional test ID for the header container.
|
|
53
|
+
*/
|
|
54
|
+
testID?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Optional Tailwind class names for the header container.
|
|
57
|
+
*/
|
|
58
|
+
twClassName?: string;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=HeaderRoot.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderRoot.types.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,cAAc;AAClC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAG/D,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;IACvC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderRoot.types.mjs","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport { ReactNode } from 'react';\nimport { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\n// External dependencies.\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\n/**\n * HeaderRoot component props.\n * Left section renders either children or a title row (mutually exclusive).\n * End section matches HeaderBase (endAccessory or endButtonIconProps).\n */\nexport type HeaderRootProps = ViewProps & {\n /**\n * Optional custom content for the left section.\n * When provided, title/titleAccessory are not rendered (mutually exclusive).\n */\n children?: ReactNode;\n /**\n * Optional content displayed after the title in the title row.\n * Only used when children is not provided and title or titleAccessory is set.\n */\n titleAccessory?: ReactNode;\n /**\n * Optional main title. Can be a string or a React node.\n * Only used when children is not provided.\n * When string: rendered via TextOrChildren with TextVariant.HeadingLg; titleProps apply.\n * When node: rendered via TextOrChildren as-is; titleProps are not applied to the node.\n */\n title?: ReactNode;\n /**\n * Optional props passed to the Text component when title is a string (TextOrChildren textProps).\n */\n titleProps?: Partial<TextProps>;\n /**\n * Optional content to be displayed in the end section.\n * Takes priority over endButtonIconProps if both are provided.\n */\n endAccessory?: ReactNode;\n /**\n * Optional array of ButtonIcon props to render multiple ButtonIcons as end accessories.\n * Rendered in reverse order (first item appears rightmost).\n * Only used if endAccessory is not provided.\n */\n endButtonIconProps?: ButtonIconProps[];\n /**\n * Optional prop to include the top inset so the header is visible below the device safe area.\n */\n includesTopInset?: boolean;\n /**\n * Optional style for the header container.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional test ID for the header container.\n */\n testID?: string;\n /**\n * Optional Tailwind class names for the header container.\n */\n twClassName?: string;\n};\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HeaderRoot = void 0;
|
|
4
|
+
var HeaderRoot_1 = require("./HeaderRoot.cjs");
|
|
5
|
+
Object.defineProperty(exports, "HeaderRoot", { enumerable: true, get: function () { return HeaderRoot_1.HeaderRoot; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/HeaderRoot/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { HeaderRoot } from './HeaderRoot';\nexport type { HeaderRootProps } from './HeaderRoot.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderRoot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderRoot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/HeaderRoot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { HeaderRoot } from './HeaderRoot';\nexport type { HeaderRootProps } from './HeaderRoot.types';\n"]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.HeaderStandard = void 0;
|
|
27
|
+
// Third party dependencies.
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
// External dependencies.
|
|
30
|
+
const Box_1 = require("../Box/index.cjs");
|
|
31
|
+
const BoxVertical_1 = require("../BoxVertical/index.cjs");
|
|
32
|
+
const HeaderBase_1 = require("../HeaderBase/index.cjs");
|
|
33
|
+
const Icon_1 = require("../Icon/index.cjs");
|
|
34
|
+
const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
|
|
35
|
+
const Text_1 = require("../Text/index.cjs");
|
|
36
|
+
const HeaderStandard = ({ title, titleProps, subtitle, subtitleProps, children, onBack, backButtonProps, onClose, closeButtonProps, endButtonIconProps, startButtonIconProps, twClassName = '', testID, ...headerBaseProps }) => {
|
|
37
|
+
const resolvedStartButtonIconProps = (0, react_1.useMemo)(() => {
|
|
38
|
+
if (startButtonIconProps) {
|
|
39
|
+
return startButtonIconProps;
|
|
40
|
+
}
|
|
41
|
+
if (onBack || backButtonProps) {
|
|
42
|
+
const startProps = {
|
|
43
|
+
iconName: Icon_1.IconName.ArrowLeft,
|
|
44
|
+
...(backButtonProps ?? {}),
|
|
45
|
+
onPress: backButtonProps?.onPress ?? onBack,
|
|
46
|
+
};
|
|
47
|
+
return startProps;
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}, [onBack, backButtonProps, startButtonIconProps]);
|
|
51
|
+
const resolvedEndButtonIconProps = (0, react_1.useMemo)(() => {
|
|
52
|
+
const props = [];
|
|
53
|
+
if (onClose || closeButtonProps) {
|
|
54
|
+
const closeProps = {
|
|
55
|
+
iconName: Icon_1.IconName.Close,
|
|
56
|
+
...(closeButtonProps || {}),
|
|
57
|
+
onPress: closeButtonProps?.onPress ?? onClose,
|
|
58
|
+
};
|
|
59
|
+
props.push(closeProps);
|
|
60
|
+
}
|
|
61
|
+
if (endButtonIconProps) {
|
|
62
|
+
props.push(...endButtonIconProps);
|
|
63
|
+
}
|
|
64
|
+
return props.length > 0 ? props : undefined;
|
|
65
|
+
}, [endButtonIconProps, onClose, closeButtonProps]);
|
|
66
|
+
const renderContent = () => {
|
|
67
|
+
if (children) {
|
|
68
|
+
return children;
|
|
69
|
+
}
|
|
70
|
+
if (title) {
|
|
71
|
+
let subtitleTextProps;
|
|
72
|
+
if (subtitle && typeof subtitle === 'string') {
|
|
73
|
+
const { twClassName: subtitleTwClassName, ...subtitleTextRest } = subtitleProps ?? {};
|
|
74
|
+
subtitleTextProps = {
|
|
75
|
+
variant: Text_1.TextVariant.BodySm,
|
|
76
|
+
color: Text_1.TextColor.TextAlternative,
|
|
77
|
+
...subtitleTextRest,
|
|
78
|
+
twClassName: ['-mt-0.5', subtitleTwClassName]
|
|
79
|
+
.filter(Boolean)
|
|
80
|
+
.join(' '),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return (<BoxVertical_1.BoxVertical alignItems={Box_1.BoxAlignItems.Center} textProps={{
|
|
84
|
+
variant: Text_1.TextVariant.BodyMd,
|
|
85
|
+
fontWeight: Text_1.FontWeight.Bold,
|
|
86
|
+
...titleProps,
|
|
87
|
+
}} bottomAccessory={subtitle ? (<TextOrChildren_1.TextOrChildren textProps={subtitleTextProps}>
|
|
88
|
+
{subtitle}
|
|
89
|
+
</TextOrChildren_1.TextOrChildren>) : undefined}>
|
|
90
|
+
{title}
|
|
91
|
+
</BoxVertical_1.BoxVertical>);
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
};
|
|
95
|
+
return (<HeaderBase_1.HeaderBase testID={testID} startButtonIconProps={resolvedStartButtonIconProps} endButtonIconProps={resolvedEndButtonIconProps} {...headerBaseProps} twClassName={`px-2 ${twClassName}`}>
|
|
96
|
+
{renderContent()}
|
|
97
|
+
</HeaderBase_1.HeaderBase>);
|
|
98
|
+
};
|
|
99
|
+
exports.HeaderStandard = HeaderStandard;
|
|
100
|
+
exports.HeaderStandard.displayName = 'HeaderStandard';
|
|
101
|
+
//# sourceMappingURL=HeaderStandard.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderStandard.cjs","sourceRoot":"","sources":["../../../src/components/HeaderStandard/HeaderStandard.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,+CAAuC;AAEvC,yBAAyB;AACzB,0CAAuC;AACvC,0DAA6C;AAE7C,wDAA2C;AAC3C,4CAAmC;AACnC,gFAAmE;AAEnE,4CAA6D;AAKtD,MAAM,cAAc,GAAkC,CAAC,EAC5D,KAAK,EACL,UAAU,EACV,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,MAAM,EACN,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,oBA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a,EAAE,CAClB;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAtGW,QAAA,cAAc,kBAsGzB;AAEF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["// Third party dependencies.\nimport React, { useMemo } from 'react';\n\n// External dependencies.\nimport { BoxAlignItems } from '../Box';\nimport { BoxVertical } from '../BoxVertical';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport { HeaderBase } from '../HeaderBase';\nimport { IconName } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\nimport type { TextProps } from '../Text';\nimport { FontWeight, TextColor, TextVariant } from '../Text';\n\n// Internal dependencies.\nimport type { HeaderStandardProps } from './HeaderStandard.types';\n\nexport const HeaderStandard: React.FC<HeaderStandardProps> = ({\n title,\n titleProps,\n subtitle,\n subtitleProps,\n children,\n onBack,\n backButtonProps,\n onClose,\n closeButtonProps,\n endButtonIconProps,\n startButtonIconProps,\n twClassName = '',\n testID,\n ...headerBaseProps\n}) => {\n const resolvedStartButtonIconProps = useMemo(() => {\n if (startButtonIconProps) {\n return startButtonIconProps;\n }\n if (onBack || backButtonProps) {\n const startProps: ButtonIconProps = {\n iconName: IconName.ArrowLeft,\n ...(backButtonProps ?? {}),\n onPress: backButtonProps?.onPress ?? onBack,\n };\n return startProps;\n }\n return undefined;\n }, [onBack, backButtonProps, startButtonIconProps]);\n\n const resolvedEndButtonIconProps = useMemo(() => {\n const props: ButtonIconProps[] = [];\n\n if (onClose || closeButtonProps) {\n const closeProps: ButtonIconProps = {\n iconName: IconName.Close,\n ...(closeButtonProps || {}),\n onPress: closeButtonProps?.onPress ?? onClose,\n };\n props.push(closeProps);\n }\n\n if (endButtonIconProps) {\n props.push(...endButtonIconProps);\n }\n return props.length > 0 ? props : undefined;\n }, [endButtonIconProps, onClose, closeButtonProps]);\n\n const renderContent = () => {\n if (children) {\n return children;\n }\n if (title) {\n let subtitleTextProps: Omit<Partial<TextProps>, 'children'> | undefined;\n if (subtitle && typeof subtitle === 'string') {\n const { twClassName: subtitleTwClassName, ...subtitleTextRest } =\n subtitleProps ?? {};\n subtitleTextProps = {\n variant: TextVariant.BodySm,\n color: TextColor.TextAlternative,\n ...subtitleTextRest,\n twClassName: ['-mt-0.5', subtitleTwClassName]\n .filter(Boolean)\n .join(' '),\n };\n }\n\n return (\n <BoxVertical\n alignItems={BoxAlignItems.Center}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Bold,\n ...titleProps,\n }}\n bottomAccessory={\n subtitle ? (\n <TextOrChildren textProps={subtitleTextProps}>\n {subtitle}\n </TextOrChildren>\n ) : undefined\n }\n >\n {title}\n </BoxVertical>\n );\n }\n return null;\n };\n\n return (\n <HeaderBase\n testID={testID}\n startButtonIconProps={resolvedStartButtonIconProps}\n endButtonIconProps={resolvedEndButtonIconProps}\n {...headerBaseProps}\n twClassName={`px-2 ${twClassName}`}\n >\n {renderContent()}\n </HeaderBase>\n );\n};\n\nHeaderStandard.displayName = 'HeaderStandard';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderStandard.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderStandard/HeaderStandard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,cAAc;AAavC,OAAO,KAAK,EAAE,mBAAmB,EAAE,mCAA+B;AAElE,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsGxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderStandard.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderStandard/HeaderStandard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,cAAc;AAavC,OAAO,KAAK,EAAE,mBAAmB,EAAE,mCAA+B;AAElE,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsGxD,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
// Third party dependencies.
|
|
8
|
+
import $React, { useMemo } from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
// External dependencies.
|
|
11
|
+
import { BoxAlignItems } from "../Box/index.mjs";
|
|
12
|
+
import { BoxVertical } from "../BoxVertical/index.mjs";
|
|
13
|
+
import { HeaderBase } from "../HeaderBase/index.mjs";
|
|
14
|
+
import { IconName } from "../Icon/index.mjs";
|
|
15
|
+
import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
|
|
16
|
+
import { FontWeight, TextColor, TextVariant } from "../Text/index.mjs";
|
|
17
|
+
export const HeaderStandard = ({ title, titleProps, subtitle, subtitleProps, children, onBack, backButtonProps, onClose, closeButtonProps, endButtonIconProps, startButtonIconProps, twClassName = '', testID, ...headerBaseProps }) => {
|
|
18
|
+
const resolvedStartButtonIconProps = useMemo(() => {
|
|
19
|
+
if (startButtonIconProps) {
|
|
20
|
+
return startButtonIconProps;
|
|
21
|
+
}
|
|
22
|
+
if (onBack || backButtonProps) {
|
|
23
|
+
const startProps = {
|
|
24
|
+
iconName: IconName.ArrowLeft,
|
|
25
|
+
...(backButtonProps ?? {}),
|
|
26
|
+
onPress: backButtonProps?.onPress ?? onBack,
|
|
27
|
+
};
|
|
28
|
+
return startProps;
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}, [onBack, backButtonProps, startButtonIconProps]);
|
|
32
|
+
const resolvedEndButtonIconProps = useMemo(() => {
|
|
33
|
+
const props = [];
|
|
34
|
+
if (onClose || closeButtonProps) {
|
|
35
|
+
const closeProps = {
|
|
36
|
+
iconName: IconName.Close,
|
|
37
|
+
...(closeButtonProps || {}),
|
|
38
|
+
onPress: closeButtonProps?.onPress ?? onClose,
|
|
39
|
+
};
|
|
40
|
+
props.push(closeProps);
|
|
41
|
+
}
|
|
42
|
+
if (endButtonIconProps) {
|
|
43
|
+
props.push(...endButtonIconProps);
|
|
44
|
+
}
|
|
45
|
+
return props.length > 0 ? props : undefined;
|
|
46
|
+
}, [endButtonIconProps, onClose, closeButtonProps]);
|
|
47
|
+
const renderContent = () => {
|
|
48
|
+
if (children) {
|
|
49
|
+
return children;
|
|
50
|
+
}
|
|
51
|
+
if (title) {
|
|
52
|
+
let subtitleTextProps;
|
|
53
|
+
if (subtitle && typeof subtitle === 'string') {
|
|
54
|
+
const { twClassName: subtitleTwClassName, ...subtitleTextRest } = subtitleProps ?? {};
|
|
55
|
+
subtitleTextProps = {
|
|
56
|
+
variant: TextVariant.BodySm,
|
|
57
|
+
color: TextColor.TextAlternative,
|
|
58
|
+
...subtitleTextRest,
|
|
59
|
+
twClassName: ['-mt-0.5', subtitleTwClassName]
|
|
60
|
+
.filter(Boolean)
|
|
61
|
+
.join(' '),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return (<BoxVertical alignItems={BoxAlignItems.Center} textProps={{
|
|
65
|
+
variant: TextVariant.BodyMd,
|
|
66
|
+
fontWeight: FontWeight.Bold,
|
|
67
|
+
...titleProps,
|
|
68
|
+
}} bottomAccessory={subtitle ? (<TextOrChildren textProps={subtitleTextProps}>
|
|
69
|
+
{subtitle}
|
|
70
|
+
</TextOrChildren>) : undefined}>
|
|
71
|
+
{title}
|
|
72
|
+
</BoxVertical>);
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
return (<HeaderBase testID={testID} startButtonIconProps={resolvedStartButtonIconProps} endButtonIconProps={resolvedEndButtonIconProps} {...headerBaseProps} twClassName={`px-2 ${twClassName}`}>
|
|
77
|
+
{renderContent()}
|
|
78
|
+
</HeaderBase>);
|
|
79
|
+
};
|
|
80
|
+
HeaderStandard.displayName = 'HeaderStandard';
|
|
81
|
+
//# sourceMappingURL=HeaderStandard.mjs.map
|
|
@@ -0,0 +1 @@
|
|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,CAAC,IAAI;oBAC3B,GAAG,UAAU;iBACd,CAAC,CACF,eAAe,CAAC,CACd,QAAQ,CAAC,CAAC,CAAC,CACT,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAC3C;gBAAA,CAAC,QAAQ,CACX;cAAA,EAAE,cAAc,CAAC,CAClB,CAAC,CAAC,CAAC,SAAS,CACd,CAED;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,WAAW,CAAC,CACf,CAAC;SACH;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CACT,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,oBAAoB,CAAC,CAAC,4BAA4B,CAAC,CACnD,kBAAkB,CAAC,CAAC,0BAA0B,CAAC,CAC/C,IAAI,eAAe,CAAC,CACpB,WAAW,CAAC,CAAC,QAAQ,WAAW,EAAE,CAAC,CAEnC;MAAA,CAAC,aAAa,EAAE,CAClB;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["// Third party dependencies.\nimport React, { useMemo } from 'react';\n\n// External dependencies.\nimport { BoxAlignItems } from '../Box';\nimport { BoxVertical } from '../BoxVertical';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport { HeaderBase } from '../HeaderBase';\nimport { IconName } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\nimport type { TextProps } from '../Text';\nimport { FontWeight, TextColor, TextVariant } from '../Text';\n\n// Internal dependencies.\nimport type { HeaderStandardProps } from './HeaderStandard.types';\n\nexport const HeaderStandard: React.FC<HeaderStandardProps> = ({\n title,\n titleProps,\n subtitle,\n subtitleProps,\n children,\n onBack,\n backButtonProps,\n onClose,\n closeButtonProps,\n endButtonIconProps,\n startButtonIconProps,\n twClassName = '',\n testID,\n ...headerBaseProps\n}) => {\n const resolvedStartButtonIconProps = useMemo(() => {\n if (startButtonIconProps) {\n return startButtonIconProps;\n }\n if (onBack || backButtonProps) {\n const startProps: ButtonIconProps = {\n iconName: IconName.ArrowLeft,\n ...(backButtonProps ?? {}),\n onPress: backButtonProps?.onPress ?? onBack,\n };\n return startProps;\n }\n return undefined;\n }, [onBack, backButtonProps, startButtonIconProps]);\n\n const resolvedEndButtonIconProps = useMemo(() => {\n const props: ButtonIconProps[] = [];\n\n if (onClose || closeButtonProps) {\n const closeProps: ButtonIconProps = {\n iconName: IconName.Close,\n ...(closeButtonProps || {}),\n onPress: closeButtonProps?.onPress ?? onClose,\n };\n props.push(closeProps);\n }\n\n if (endButtonIconProps) {\n props.push(...endButtonIconProps);\n }\n return props.length > 0 ? props : undefined;\n }, [endButtonIconProps, onClose, closeButtonProps]);\n\n const renderContent = () => {\n if (children) {\n return children;\n }\n if (title) {\n let subtitleTextProps: Omit<Partial<TextProps>, 'children'> | undefined;\n if (subtitle && typeof subtitle === 'string') {\n const { twClassName: subtitleTwClassName, ...subtitleTextRest } =\n subtitleProps ?? {};\n subtitleTextProps = {\n variant: TextVariant.BodySm,\n color: TextColor.TextAlternative,\n ...subtitleTextRest,\n twClassName: ['-mt-0.5', subtitleTwClassName]\n .filter(Boolean)\n .join(' '),\n };\n }\n\n return (\n <BoxVertical\n alignItems={BoxAlignItems.Center}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Bold,\n ...titleProps,\n }}\n bottomAccessory={\n subtitle ? (\n <TextOrChildren textProps={subtitleTextProps}>\n {subtitle}\n </TextOrChildren>\n ) : undefined\n }\n >\n {title}\n </BoxVertical>\n );\n }\n return null;\n };\n\n return (\n <HeaderBase\n testID={testID}\n startButtonIconProps={resolvedStartButtonIconProps}\n endButtonIconProps={resolvedEndButtonIconProps}\n {...headerBaseProps}\n twClassName={`px-2 ${twClassName}`}\n >\n {renderContent()}\n </HeaderBase>\n );\n};\n\nHeaderStandard.displayName = 'HeaderStandard';\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
// Third party dependencies.
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
//# sourceMappingURL=HeaderStandard.types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderStandard.types.cjs","sourceRoot":"","sources":["../../../src/components/HeaderStandard/HeaderStandard.types.ts"],"names":[],"mappings":";;;;;AAAA,4BAA4B;AAC5B,kDAA0B","sourcesContent":["// Third party dependencies.\nimport React from 'react';\n\n// External dependencies.\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { HeaderBaseProps } from '../HeaderBase';\nimport type { TextProps } from '../Text';\n\n/**\n * HeaderStandard component props.\n */\nexport type HeaderStandardProps = HeaderBaseProps & {\n /**\n * Title to display in the header. Can be a string or a React node.\n * Used as children if children prop is not provided.\n * When string: rendered with TextVariant.BodyMd and FontWeight.Bold by default; titleProps apply.\n * When node: rendered as-is; titleProps are not applied.\n */\n title?: string | React.ReactNode;\n /**\n * Additional props to pass to the title Text component.\n * Props are spread to the Text component and can override default values.\n * Only applied when title is a string.\n */\n titleProps?: Partial<TextProps>;\n /**\n * Subtitle to display below the title. Can be a string or a React node.\n * When string: rendered with TextVariant.BodySm and TextColor.TextAlternative by default; subtitleProps apply.\n * When node: rendered as-is; subtitleProps are not applied (add spacing on your root if needed, e.g. twClassName).\n */\n subtitle?: string | React.ReactNode;\n /**\n * Additional props to pass to the subtitle Text component.\n * Props are spread to the Text component and can override default values.\n * Only applied when subtitle is a string.\n */\n subtitleProps?: Partial<TextProps>;\n /**\n * Callback when the back button is pressed.\n * If provided, a back button will be rendered as startButtonIconProps.\n */\n onBack?: () => void;\n /**\n * Additional props to pass to the back ButtonIcon.\n * If provided, a back button will be rendered as startButtonIconProps with these props spread.\n */\n backButtonProps?: Omit<ButtonIconProps, 'iconName'>;\n /**\n * Callback when the close button is pressed.\n * If provided, a close button will be added to endButtonIconProps.\n */\n onClose?: () => void;\n /**\n * Additional props to pass to the close ButtonIcon.\n * If provided, a close button will be added to endButtonIconProps with these props spread.\n */\n closeButtonProps?: Omit<ButtonIconProps, 'iconName'>;\n};\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
|
|
3
|
+
import type { HeaderBaseProps } from "../HeaderBase/index.cjs";
|
|
4
|
+
import type { TextProps } from "../Text/index.cjs";
|
|
5
|
+
/**
|
|
6
|
+
* HeaderStandard component props.
|
|
7
|
+
*/
|
|
8
|
+
export type HeaderStandardProps = HeaderBaseProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Title to display in the header. Can be a string or a React node.
|
|
11
|
+
* Used as children if children prop is not provided.
|
|
12
|
+
* When string: rendered with TextVariant.BodyMd and FontWeight.Bold by default; titleProps apply.
|
|
13
|
+
* When node: rendered as-is; titleProps are not applied.
|
|
14
|
+
*/
|
|
15
|
+
title?: string | React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Additional props to pass to the title Text component.
|
|
18
|
+
* Props are spread to the Text component and can override default values.
|
|
19
|
+
* Only applied when title is a string.
|
|
20
|
+
*/
|
|
21
|
+
titleProps?: Partial<TextProps>;
|
|
22
|
+
/**
|
|
23
|
+
* Subtitle to display below the title. Can be a string or a React node.
|
|
24
|
+
* When string: rendered with TextVariant.BodySm and TextColor.TextAlternative by default; subtitleProps apply.
|
|
25
|
+
* When node: rendered as-is; subtitleProps are not applied (add spacing on your root if needed, e.g. twClassName).
|
|
26
|
+
*/
|
|
27
|
+
subtitle?: string | React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Additional props to pass to the subtitle Text component.
|
|
30
|
+
* Props are spread to the Text component and can override default values.
|
|
31
|
+
* Only applied when subtitle is a string.
|
|
32
|
+
*/
|
|
33
|
+
subtitleProps?: Partial<TextProps>;
|
|
34
|
+
/**
|
|
35
|
+
* Callback when the back button is pressed.
|
|
36
|
+
* If provided, a back button will be rendered as startButtonIconProps.
|
|
37
|
+
*/
|
|
38
|
+
onBack?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Additional props to pass to the back ButtonIcon.
|
|
41
|
+
* If provided, a back button will be rendered as startButtonIconProps with these props spread.
|
|
42
|
+
*/
|
|
43
|
+
backButtonProps?: Omit<ButtonIconProps, 'iconName'>;
|
|
44
|
+
/**
|
|
45
|
+
* Callback when the close button is pressed.
|
|
46
|
+
* If provided, a close button will be added to endButtonIconProps.
|
|
47
|
+
*/
|
|
48
|
+
onClose?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Additional props to pass to the close ButtonIcon.
|
|
51
|
+
* If provided, a close button will be added to endButtonIconProps with these props spread.
|
|
52
|
+
*/
|
|
53
|
+
closeButtonProps?: Omit<ButtonIconProps, 'iconName'>;
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=HeaderStandard.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderStandard.types.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderStandard/HeaderStandard.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACpC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;CACtD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
|
|
3
|
+
import type { HeaderBaseProps } from "../HeaderBase/index.mjs";
|
|
4
|
+
import type { TextProps } from "../Text/index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* HeaderStandard component props.
|
|
7
|
+
*/
|
|
8
|
+
export type HeaderStandardProps = HeaderBaseProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Title to display in the header. Can be a string or a React node.
|
|
11
|
+
* Used as children if children prop is not provided.
|
|
12
|
+
* When string: rendered with TextVariant.BodyMd and FontWeight.Bold by default; titleProps apply.
|
|
13
|
+
* When node: rendered as-is; titleProps are not applied.
|
|
14
|
+
*/
|
|
15
|
+
title?: string | React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Additional props to pass to the title Text component.
|
|
18
|
+
* Props are spread to the Text component and can override default values.
|
|
19
|
+
* Only applied when title is a string.
|
|
20
|
+
*/
|
|
21
|
+
titleProps?: Partial<TextProps>;
|
|
22
|
+
/**
|
|
23
|
+
* Subtitle to display below the title. Can be a string or a React node.
|
|
24
|
+
* When string: rendered with TextVariant.BodySm and TextColor.TextAlternative by default; subtitleProps apply.
|
|
25
|
+
* When node: rendered as-is; subtitleProps are not applied (add spacing on your root if needed, e.g. twClassName).
|
|
26
|
+
*/
|
|
27
|
+
subtitle?: string | React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Additional props to pass to the subtitle Text component.
|
|
30
|
+
* Props are spread to the Text component and can override default values.
|
|
31
|
+
* Only applied when subtitle is a string.
|
|
32
|
+
*/
|
|
33
|
+
subtitleProps?: Partial<TextProps>;
|
|
34
|
+
/**
|
|
35
|
+
* Callback when the back button is pressed.
|
|
36
|
+
* If provided, a back button will be rendered as startButtonIconProps.
|
|
37
|
+
*/
|
|
38
|
+
onBack?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Additional props to pass to the back ButtonIcon.
|
|
41
|
+
* If provided, a back button will be rendered as startButtonIconProps with these props spread.
|
|
42
|
+
*/
|
|
43
|
+
backButtonProps?: Omit<ButtonIconProps, 'iconName'>;
|
|
44
|
+
/**
|
|
45
|
+
* Callback when the close button is pressed.
|
|
46
|
+
* If provided, a close button will be added to endButtonIconProps.
|
|
47
|
+
*/
|
|
48
|
+
onClose?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Additional props to pass to the close ButtonIcon.
|
|
51
|
+
* If provided, a close button will be added to endButtonIconProps with these props spread.
|
|
52
|
+
*/
|
|
53
|
+
closeButtonProps?: Omit<ButtonIconProps, 'iconName'>;
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=HeaderStandard.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderStandard.types.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderStandard/HeaderStandard.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACpC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;CACtD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
// Third party dependencies.
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
//# sourceMappingURL=HeaderStandard.types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderStandard.types.mjs","sourceRoot":"","sources":["../../../src/components/HeaderStandard/HeaderStandard.types.ts"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,MAAK,cAAc","sourcesContent":["// Third party dependencies.\nimport React from 'react';\n\n// External dependencies.\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { HeaderBaseProps } from '../HeaderBase';\nimport type { TextProps } from '../Text';\n\n/**\n * HeaderStandard component props.\n */\nexport type HeaderStandardProps = HeaderBaseProps & {\n /**\n * Title to display in the header. Can be a string or a React node.\n * Used as children if children prop is not provided.\n * When string: rendered with TextVariant.BodyMd and FontWeight.Bold by default; titleProps apply.\n * When node: rendered as-is; titleProps are not applied.\n */\n title?: string | React.ReactNode;\n /**\n * Additional props to pass to the title Text component.\n * Props are spread to the Text component and can override default values.\n * Only applied when title is a string.\n */\n titleProps?: Partial<TextProps>;\n /**\n * Subtitle to display below the title. Can be a string or a React node.\n * When string: rendered with TextVariant.BodySm and TextColor.TextAlternative by default; subtitleProps apply.\n * When node: rendered as-is; subtitleProps are not applied (add spacing on your root if needed, e.g. twClassName).\n */\n subtitle?: string | React.ReactNode;\n /**\n * Additional props to pass to the subtitle Text component.\n * Props are spread to the Text component and can override default values.\n * Only applied when subtitle is a string.\n */\n subtitleProps?: Partial<TextProps>;\n /**\n * Callback when the back button is pressed.\n * If provided, a back button will be rendered as startButtonIconProps.\n */\n onBack?: () => void;\n /**\n * Additional props to pass to the back ButtonIcon.\n * If provided, a back button will be rendered as startButtonIconProps with these props spread.\n */\n backButtonProps?: Omit<ButtonIconProps, 'iconName'>;\n /**\n * Callback when the close button is pressed.\n * If provided, a close button will be added to endButtonIconProps.\n */\n onClose?: () => void;\n /**\n * Additional props to pass to the close ButtonIcon.\n * If provided, a close button will be added to endButtonIconProps with these props spread.\n */\n closeButtonProps?: Omit<ButtonIconProps, 'iconName'>;\n};\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HeaderStandard = void 0;
|
|
4
|
+
var HeaderStandard_1 = require("./HeaderStandard.cjs");
|
|
5
|
+
Object.defineProperty(exports, "HeaderStandard", { enumerable: true, get: function () { return HeaderStandard_1.HeaderStandard; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/HeaderStandard/index.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAAzC,gHAAA,cAAc,OAAA","sourcesContent":["export { HeaderStandard } from './HeaderStandard';\nexport type { HeaderStandardProps } from './HeaderStandard.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderStandard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,6BAAyB;AAClD,YAAY,EAAE,mBAAmB,EAAE,mCAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderStandard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,6BAAyB;AAClD,YAAY,EAAE,mBAAmB,EAAE,mCAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/HeaderStandard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,6BAAyB","sourcesContent":["export { HeaderStandard } from './HeaderStandard';\nexport type { HeaderStandardProps } from './HeaderStandard.types';\n"]}
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.KeyValueRowLabel = void 0;
|
|
6
7
|
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
7
8
|
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const react_native_1 = require("react-native/index.js");
|
|
@@ -29,5 +30,5 @@ const KeyValueRowLabel = ({ label, tooltip, }) => {
|
|
|
29
30
|
{hasTooltip && tooltip && (<ButtonIcon_1.ButtonIcon size={tooltip.size ?? ButtonIcon_1.ButtonIconSize.Md} iconName={tooltip.iconName ?? Icon_1.IconName.Question} accessibilityLabel={`${tooltip.title} tooltip`} onPress={() => tooltip?.onPress?.()}/>)}
|
|
30
31
|
</react_native_1.View>);
|
|
31
32
|
};
|
|
32
|
-
exports.
|
|
33
|
+
exports.KeyValueRowLabel = KeyValueRowLabel;
|
|
33
34
|
//# sourceMappingURL=KeyValueLabel.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueLabel.cjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyValueLabel.cjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAEpC,2DAA8D;AAC9D,+CAAsC;AACtC,+CAA0D;AAE1D,gEAAoE;AAEpE;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAoC,CAAC,EAChE,KAAK,EACL,OAAO,GACR,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;IAE/D,OAAO,CACL,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAC7C;MAAA,CAAC,IAAA,gDAA4B,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACrC,CAAC,WAAI,CACH,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,kBAAW,CAAC,MAAM,CAAC,CAC7C,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,gBAAS,CAAC,WAAW,CAAC,CAE5C;UAAA,CAAC,KAAK,CAAC,IAAI,CACb;QAAA,EAAE,WAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CACD;MAAA,CAAC,UAAU,IAAI,OAAO,IAAI,CACxB,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,2BAAc,CAAC,EAAE,CAAC,CACxC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,IAAI,eAAQ,CAAC,QAAQ,CAAC,CAChD,kBAAkB,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,UAAU,CAAC,CAC/C,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EACpC,CACH,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,gBAAgB,oBA8B3B","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { ButtonIcon, ButtonIconSize } from '../../ButtonIcon';\nimport { IconName } from '../../Icon';\nimport { Text, TextColor, TextVariant } from '../../Text';\nimport type { KeyValueRowLabelProps } from '../KeyValueRow.types';\nimport { isPreDefinedKeyValueRowLabel } from '../KeyValueRow.utils';\n\n/**\n * A label and optional tooltip button component.\n *\n * @param props - Component props.\n * @param props.label - The label content to display.\n * @param props.tooltip - Optional tooltip to render to the right of the label.\n *\n * @returns The rendered KeyValueRowLabel component.\n */\nexport const KeyValueRowLabel: React.FC<KeyValueRowLabelProps> = ({\n label,\n tooltip,\n}) => {\n const tw = useTailwind();\n\n const hasTooltip = Boolean(tooltip?.title && tooltip?.content);\n\n return (\n <View style={tw.style('flex-row items-center')}>\n {isPreDefinedKeyValueRowLabel(label) ? (\n <Text\n variant={label.variant ?? TextVariant.BodyMd}\n color={label.color ?? TextColor.TextDefault}\n >\n {label.text}\n </Text>\n ) : (\n label\n )}\n {hasTooltip && tooltip && (\n <ButtonIcon\n size={tooltip.size ?? ButtonIconSize.Md}\n iconName={tooltip.iconName ?? IconName.Question}\n accessibilityLabel={`${tooltip.title} tooltip`}\n onPress={() => tooltip?.onPress?.()}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -9,6 +9,5 @@ import type { KeyValueRowLabelProps } from "../KeyValueRow.types.cjs";
|
|
|
9
9
|
*
|
|
10
10
|
* @returns The rendered KeyValueRowLabel component.
|
|
11
11
|
*/
|
|
12
|
-
declare const KeyValueRowLabel: React.FC<KeyValueRowLabelProps>;
|
|
13
|
-
export default KeyValueRowLabel;
|
|
12
|
+
export declare const KeyValueRowLabel: React.FC<KeyValueRowLabelProps>;
|
|
14
13
|
//# sourceMappingURL=KeyValueLabel.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueLabel.d.cts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,iCAA6B;AAGlE;;;;;;;;GAQG;AACH,
|
|
1
|
+
{"version":3,"file":"KeyValueLabel.d.cts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,iCAA6B;AAGlE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8B5D,CAAC"}
|
|
@@ -9,6 +9,5 @@ import type { KeyValueRowLabelProps } from "../KeyValueRow.types.mjs";
|
|
|
9
9
|
*
|
|
10
10
|
* @returns The rendered KeyValueRowLabel component.
|
|
11
11
|
*/
|
|
12
|
-
declare const KeyValueRowLabel: React.FC<KeyValueRowLabelProps>;
|
|
13
|
-
export default KeyValueRowLabel;
|
|
12
|
+
export declare const KeyValueRowLabel: React.FC<KeyValueRowLabelProps>;
|
|
14
13
|
//# sourceMappingURL=KeyValueLabel.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueLabel.d.mts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,iCAA6B;AAGlE;;;;;;;;GAQG;AACH,
|
|
1
|
+
{"version":3,"file":"KeyValueLabel.d.mts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,iCAA6B;AAGlE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8B5D,CAAC"}
|