@metamask-previews/design-system-react-native 0.56.1-preview-00dfeb8 → 0.56.1-preview-7d5964a
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/BoxColumn/BoxColumn.cjs +0 -13
- package/dist/components/BoxColumn/BoxColumn.cjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.cts +0 -13
- package/dist/components/BoxColumn/BoxColumn.d.cts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.mts +0 -13
- package/dist/components/BoxColumn/BoxColumn.d.mts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.mjs +0 -13
- package/dist/components/BoxColumn/BoxColumn.mjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.cjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.d.cts +0 -2
- package/dist/components/BoxColumn/BoxColumn.types.d.cts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.d.mts +0 -2
- package/dist/components/BoxColumn/BoxColumn.types.d.mts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.cjs +0 -13
- package/dist/components/BoxRow/BoxRow.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.cts +0 -13
- package/dist/components/BoxRow/BoxRow.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.mts +0 -13
- package/dist/components/BoxRow/BoxRow.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.mjs +0 -13
- package/dist/components/BoxRow/BoxRow.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.d.cts +0 -2
- package/dist/components/BoxRow/BoxRow.types.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.d.mts +0 -2
- package/dist/components/BoxRow/BoxRow.types.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.cjs +5 -9
- package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.mjs +6 -10
- package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.cts +3 -2
- package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.mts +3 -2
- package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
- package/dist/components/Content/Content.cjs +32 -40
- package/dist/components/Content/Content.cjs.map +1 -1
- package/dist/components/Content/Content.d.cts.map +1 -1
- package/dist/components/Content/Content.d.mts.map +1 -1
- package/dist/components/Content/Content.mjs +32 -40
- package/dist/components/Content/Content.mjs.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.cjs +5 -8
- package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.mjs +5 -8
- package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs +12 -21
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs +13 -22
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.cjs +10 -19
- package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.mjs +11 -20
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
- package/dist/components/ListItem/ListItem.cjs +3 -4
- package/dist/components/ListItem/ListItem.cjs.map +1 -1
- package/dist/components/ListItem/ListItem.d.cts.map +1 -1
- package/dist/components/ListItem/ListItem.d.mts.map +1 -1
- package/dist/components/ListItem/ListItem.mjs +4 -5
- package/dist/components/ListItem/ListItem.mjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.cjs +10 -17
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.cts +2 -2
- package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.mts +2 -2
- package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.mjs +11 -18
- package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.d.cts +5 -5
- package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.d.mts +5 -5
- package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -1
- package/dist/components/Tag/Tag.cjs +18 -12
- package/dist/components/Tag/Tag.cjs.map +1 -1
- package/dist/components/Tag/Tag.d.cts.map +1 -1
- package/dist/components/Tag/Tag.d.mts.map +1 -1
- package/dist/components/Tag/Tag.mjs +19 -13
- package/dist/components/Tag/Tag.mjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.cjs +18 -20
- package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.d.cts +3 -3
- package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.d.mts +3 -3
- package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.mjs +19 -21
- package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.cts +7 -6
- package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.mts +7 -6
- package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.cjs +13 -22
- package/dist/components/TitleHub/TitleHub.cjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.d.cts +3 -3
- package/dist/components/TitleHub/TitleHub.d.cts.map +1 -1
- package/dist/components/TitleHub/TitleHub.d.mts +3 -3
- package/dist/components/TitleHub/TitleHub.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.mjs +14 -23
- package/dist/components/TitleHub/TitleHub.mjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.cts +10 -10
- package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.mts +10 -10
- package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.cjs +9 -15
- package/dist/components/TitleStandard/TitleStandard.cjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.d.cts +2 -2
- package/dist/components/TitleStandard/TitleStandard.d.cts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.d.mts +2 -2
- package/dist/components/TitleStandard/TitleStandard.d.mts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.mjs +10 -16
- package/dist/components/TitleStandard/TitleStandard.mjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.cjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.cts +7 -7
- package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.mts +7 -7
- package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.mjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.cjs +18 -31
- package/dist/components/TitleSubpage/TitleSubpage.cjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.d.cts +3 -3
- package/dist/components/TitleSubpage/TitleSubpage.d.cts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.d.mts +3 -3
- package/dist/components/TitleSubpage/TitleSubpage.d.mts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.mjs +19 -32
- package/dist/components/TitleSubpage/TitleSubpage.mjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.cjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +9 -8
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +9 -8
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.mjs.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs +7 -9
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs +8 -10
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonBasePropsShared,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { IconProps } from '../Icon';\nimport type { SpinnerProps } from '../Spinner';\nimport type { TextProps } from '../Text';\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = ButtonBasePropsShared & {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Props passed to the loading overlay wrapper (`Box` around the spinner).\n * Defaults include `twClassName` for full-area centered layout; merge your own `twClassName` to extend.\n * Pass `testID` here for tests — there is no default test id on this wrapper.\n */\n loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Props passed to the label row (`
|
|
1
|
+
{"version":3,"file":"ButtonBase.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonBasePropsShared,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { IconProps } from '../Icon';\nimport type { SpinnerProps } from '../Spinner';\nimport type { TextProps } from '../Text';\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = ButtonBasePropsShared & {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Props passed to the loading overlay wrapper (`Box` around the spinner).\n * Defaults include `twClassName` for full-area centered layout; merge your own `twClassName` to extend.\n * Pass `testID` here for tests — there is no default test id on this wrapper.\n */\n loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Props passed to the label row (`BoxRow`). Label typography remains controlled via `textProps` on ButtonBase.\n */\n contentWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'textProps'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n * Can be a string or a function that receives pressed state and returns a string.\n */\n twClassName?: string | ((pressed: boolean) => string);\n /**\n * Optional prop to control text className based on pressed state.\n */\n textClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control icon className based on pressed state.\n */\n iconClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional accessibility label to describe the button for screen readers.\n * If not provided, the button content will be used as the label.\n */\n accessibilityLabel?: string;\n /**\n * Optional accessibility hint to provide additional context about the button's action.\n * Should describe what happens when the button is pressed.\n */\n accessibilityHint?: string;\n /**\n * Optional accessibility role. Defaults to 'button'.\n * Can be overridden for specific use cases.\n */\n accessibilityRole?: 'button' | 'link' | 'menuitem' | 'tab' | 'none';\n /**\n * Optional accessibility actions for custom interactions.\n * Use sparingly and only when default button behavior is insufficient.\n */\n accessibilityActions?: {\n name: string;\n label?: string;\n }[];\n /**\n * Optional callback for handling accessibility action events.\n */\n onAccessibilityAction?: (event: {\n nativeEvent: { actionName: string };\n }) => void;\n} & Omit<\n PressableProps,\n | 'accessibilityRole'\n | 'accessibilityLabel'\n | 'accessibilityHint'\n | 'accessibilityActions'\n | 'onAccessibilityAction'\n >;\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ButtonBasePropsShared, IconName } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import type { PressableProps, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import type { BoxProps } from "../Box/Box.types.cjs";
|
|
4
|
+
import type { BoxRowProps } from "../BoxRow/BoxRow.types.cjs";
|
|
4
5
|
import type { IconProps } from "../Icon/index.cjs";
|
|
5
6
|
import type { SpinnerProps } from "../Spinner/index.cjs";
|
|
6
7
|
import type { TextProps } from "../Text/index.cjs";
|
|
@@ -27,9 +28,9 @@ export type ButtonBaseProps = ButtonBasePropsShared & {
|
|
|
27
28
|
*/
|
|
28
29
|
loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
29
30
|
/**
|
|
30
|
-
* Props passed to the label row (`
|
|
31
|
+
* Props passed to the label row (`BoxRow`). Label typography remains controlled via `textProps` on ButtonBase.
|
|
31
32
|
*/
|
|
32
|
-
contentWrapperProps?: Omit<Partial<
|
|
33
|
+
contentWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'textProps'>;
|
|
33
34
|
/**
|
|
34
35
|
* Optional prop to specify an icon to show at the start of the button
|
|
35
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,QAAQ,EACT,gDAAgD;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,6BAAmB;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG;IACpD;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjD;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IAC1D;;OAEG;IACH,mBAAmB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"ButtonBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase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C/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC;IACtD;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IAC7C;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IAC7C;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;IACpE;;;OAGG;IACH,oBAAoB,CAAC,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;IACJ;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC9B,WAAW,EAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;KACrC,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CACJ,cAAc,EACZ,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,GACnB,sBAAsB,GACtB,uBAAuB,CAC1B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ButtonBasePropsShared, IconName } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import type { PressableProps, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import type { BoxProps } from "../Box/Box.types.mjs";
|
|
4
|
+
import type { BoxRowProps } from "../BoxRow/BoxRow.types.mjs";
|
|
4
5
|
import type { IconProps } from "../Icon/index.mjs";
|
|
5
6
|
import type { SpinnerProps } from "../Spinner/index.mjs";
|
|
6
7
|
import type { TextProps } from "../Text/index.mjs";
|
|
@@ -27,9 +28,9 @@ export type ButtonBaseProps = ButtonBasePropsShared & {
|
|
|
27
28
|
*/
|
|
28
29
|
loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
29
30
|
/**
|
|
30
|
-
* Props passed to the label row (`
|
|
31
|
+
* Props passed to the label row (`BoxRow`). Label typography remains controlled via `textProps` on ButtonBase.
|
|
31
32
|
*/
|
|
32
|
-
contentWrapperProps?: Omit<Partial<
|
|
33
|
+
contentWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'textProps'>;
|
|
33
34
|
/**
|
|
34
35
|
* Optional prop to specify an icon to show at the start of the button
|
|
35
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,QAAQ,EACT,gDAAgD;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,6BAAmB;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG;IACpD;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjD;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,C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C;;OAEG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC;IACtD;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IAC7C;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IAC7C;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;IACpE;;;OAGG;IACH,oBAAoB,CAAC,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;IACJ;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC9B,WAAW,EAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;KACrC,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CACJ,cAAc,EACZ,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,GACnB,sBAAsB,GACtB,uBAAuB,CAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.types.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonBasePropsShared,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { IconProps } from '../Icon';\nimport type { SpinnerProps } from '../Spinner';\nimport type { TextProps } from '../Text';\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = ButtonBasePropsShared & {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Props passed to the loading overlay wrapper (`Box` around the spinner).\n * Defaults include `twClassName` for full-area centered layout; merge your own `twClassName` to extend.\n * Pass `testID` here for tests — there is no default test id on this wrapper.\n */\n loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Props passed to the label row (`
|
|
1
|
+
{"version":3,"file":"ButtonBase.types.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonBasePropsShared,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { IconProps } from '../Icon';\nimport type { SpinnerProps } from '../Spinner';\nimport type { TextProps } from '../Text';\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = ButtonBasePropsShared & {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Props passed to the loading overlay wrapper (`Box` around the spinner).\n * Defaults include `twClassName` for full-area centered layout; merge your own `twClassName` to extend.\n * Pass `testID` here for tests — there is no default test id on this wrapper.\n */\n loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Props passed to the label row (`BoxRow`). Label typography remains controlled via `textProps` on ButtonBase.\n */\n contentWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'textProps'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n * Can be a string or a function that receives pressed state and returns a string.\n */\n twClassName?: string | ((pressed: boolean) => string);\n /**\n * Optional prop to control text className based on pressed state.\n */\n textClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control icon className based on pressed state.\n */\n iconClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional accessibility label to describe the button for screen readers.\n * If not provided, the button content will be used as the label.\n */\n accessibilityLabel?: string;\n /**\n * Optional accessibility hint to provide additional context about the button's action.\n * Should describe what happens when the button is pressed.\n */\n accessibilityHint?: string;\n /**\n * Optional accessibility role. Defaults to 'button'.\n * Can be overridden for specific use cases.\n */\n accessibilityRole?: 'button' | 'link' | 'menuitem' | 'tab' | 'none';\n /**\n * Optional accessibility actions for custom interactions.\n * Use sparingly and only when default button behavior is insufficient.\n */\n accessibilityActions?: {\n name: string;\n label?: string;\n }[];\n /**\n * Optional callback for handling accessibility action events.\n */\n onAccessibilityAction?: (event: {\n nativeEvent: { actionName: string };\n }) => void;\n} & Omit<\n PressableProps,\n | 'accessibilityRole'\n | 'accessibilityLabel'\n | 'accessibilityHint'\n | 'accessibilityActions'\n | 'onAccessibilityAction'\n >;\n"]}
|
|
@@ -7,6 +7,8 @@ exports.Content = void 0;
|
|
|
7
7
|
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const Box_1 = require("../Box/index.cjs");
|
|
10
|
+
const BoxColumn_1 = require("../BoxColumn/index.cjs");
|
|
11
|
+
const BoxRow_1 = require("../BoxRow/index.cjs");
|
|
10
12
|
const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
|
|
11
13
|
const Content = ({ variant = design_system_shared_1.ContentVariant.TwoLines, avatar, twClassName, title, titleProps, titleStartAccessory, titleEndAccessory, description, descriptionProps, descriptionStartAccessory, descriptionEndAccessory, value, valueProps, valueStartAccessory, valueEndAccessory, subvalue, subvalueProps, subvalueStartAccessory, subvalueEndAccessory, ...props }) => {
|
|
12
14
|
const isOneLine = variant === design_system_shared_1.ContentVariant.OneLine;
|
|
@@ -24,9 +26,19 @@ const Content = ({ variant = design_system_shared_1.ContentVariant.TwoLines, ava
|
|
|
24
26
|
}
|
|
25
27
|
return (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={alignItems} gap={4} twClassName={twClassName} {...props}>
|
|
26
28
|
{avatar}
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
<BoxColumn_1.BoxColumn twClassName="flex-1 min-w-0" bottomAccessory={showDescription ? (<BoxRow_1.BoxRow twClassName="w-full" alignItems={alignItems} startAccessory={descriptionStartAccessory} endAccessory={descriptionEndAccessory} gap={1}>
|
|
30
|
+
<BoxColumn_1.BoxColumn twClassName="min-w-0">
|
|
31
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
32
|
+
variant: design_system_shared_1.TextVariant.BodySm,
|
|
33
|
+
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
34
|
+
color: design_system_shared_1.TextColor.TextAlternative,
|
|
35
|
+
...descriptionProps,
|
|
36
|
+
}}>
|
|
37
|
+
{description}
|
|
38
|
+
</TextOrChildren_1.TextOrChildren>
|
|
39
|
+
</BoxColumn_1.BoxColumn>
|
|
40
|
+
</BoxRow_1.BoxRow>) : null}>
|
|
41
|
+
{title ? (<BoxRow_1.BoxRow twClassName="w-full" startAccessory={titleStartAccessory} endAccessory={titleEndAccessory} gap={1}>
|
|
30
42
|
<TextOrChildren_1.TextOrChildren textProps={{
|
|
31
43
|
variant: design_system_shared_1.TextVariant.BodyMd,
|
|
32
44
|
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
@@ -35,26 +47,21 @@ const Content = ({ variant = design_system_shared_1.ContentVariant.TwoLines, ava
|
|
|
35
47
|
}}>
|
|
36
48
|
{title}
|
|
37
49
|
</TextOrChildren_1.TextOrChildren>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</Box_1.Box>) : null}
|
|
54
|
-
</Box_1.Box>
|
|
55
|
-
{value || showSubvalue ? (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Column} alignItems={design_system_shared_1.BoxAlignItems.End} twClassName="min-w-0">
|
|
56
|
-
{value ? (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1}>
|
|
57
|
-
{valueStartAccessory}
|
|
50
|
+
</BoxRow_1.BoxRow>) : null}
|
|
51
|
+
</BoxColumn_1.BoxColumn>
|
|
52
|
+
{value || showSubvalue ? (<BoxColumn_1.BoxColumn alignItems={design_system_shared_1.BoxAlignItems.End} twClassName="min-w-0" bottomAccessory={showSubvalue ? (<BoxRow_1.BoxRow alignItems={alignItems} startAccessory={subvalueStartAccessory} endAccessory={subvalueEndAccessory} gap={1}>
|
|
53
|
+
<BoxColumn_1.BoxColumn twClassName="min-w-0">
|
|
54
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
55
|
+
variant: design_system_shared_1.TextVariant.BodySm,
|
|
56
|
+
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
57
|
+
color: design_system_shared_1.TextColor.TextAlternative,
|
|
58
|
+
...subvalueProps,
|
|
59
|
+
}}>
|
|
60
|
+
{subvalue}
|
|
61
|
+
</TextOrChildren_1.TextOrChildren>
|
|
62
|
+
</BoxColumn_1.BoxColumn>
|
|
63
|
+
</BoxRow_1.BoxRow>) : null}>
|
|
64
|
+
{value ? (<BoxRow_1.BoxRow startAccessory={valueStartAccessory} endAccessory={valueEndAccessory} gap={1}>
|
|
58
65
|
<TextOrChildren_1.TextOrChildren textProps={{
|
|
59
66
|
variant: design_system_shared_1.TextVariant.BodyMd,
|
|
60
67
|
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
@@ -63,23 +70,8 @@ const Content = ({ variant = design_system_shared_1.ContentVariant.TwoLines, ava
|
|
|
63
70
|
}}>
|
|
64
71
|
{value}
|
|
65
72
|
</TextOrChildren_1.TextOrChildren>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{showSubvalue ? (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={alignItems} gap={1}>
|
|
69
|
-
{subvalueStartAccessory}
|
|
70
|
-
<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Column} twClassName="min-w-0">
|
|
71
|
-
<TextOrChildren_1.TextOrChildren textProps={{
|
|
72
|
-
variant: design_system_shared_1.TextVariant.BodySm,
|
|
73
|
-
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
74
|
-
color: design_system_shared_1.TextColor.TextAlternative,
|
|
75
|
-
...subvalueProps,
|
|
76
|
-
}}>
|
|
77
|
-
{subvalue}
|
|
78
|
-
</TextOrChildren_1.TextOrChildren>
|
|
79
|
-
</Box_1.Box>
|
|
80
|
-
{subvalueEndAccessory}
|
|
81
|
-
</Box_1.Box>) : null}
|
|
82
|
-
</Box_1.Box>) : null}
|
|
73
|
+
</BoxRow_1.BoxRow>) : null}
|
|
74
|
+
</BoxColumn_1.BoxColumn>) : null}
|
|
83
75
|
</Box_1.Box>);
|
|
84
76
|
};
|
|
85
77
|
exports.Content = Content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.cjs","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAOiD;AACjD,kDAA0B;AAE1B,0CAA6B;AAC7B,gFAAmE;AAI5D,MAAM,OAAO,GAA2B,CAAC,EAC9C,OAAO,GAAG,qCAAc,CAAC,QAAQ,EACjC,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,SAAS,GAAG,OAAO,KAAK,qCAAc,CAAC,OAAO,CAAC;IACrD,MAAM,WAAW,GAAG,OAAO,KAAK,qCAAc,CAAC,SAAS,CAAC;IACzD,MAAM,eAAe,GAAG,CAAC,SAAS,IAAI,WAAW,CAAC;IAClD,MAAM,YAAY,GAAG,CAAC,SAAS,IAAI,QAAQ,CAAC;IAC5C,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,oCAAa,CAAC,KAAK,CAAC,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC;IAE5E,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,SAAS,IAAI,WAAW,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,CACV,+EAA+E,CAChF,CAAC;QACJ,CAAC;QACD,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CACV,4EAA4E,CAC7E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,CACL,CAAC,SAAG,CACF,aAAa,CAAC,CAAC,uCAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,MAAM,CACP;MAAA,CAAC,
|
|
1
|
+
{"version":3,"file":"Content.cjs","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAOiD;AACjD,kDAA0B;AAE1B,0CAA6B;AAC7B,sDAAyC;AACzC,gDAAmC;AACnC,gFAAmE;AAI5D,MAAM,OAAO,GAA2B,CAAC,EAC9C,OAAO,GAAG,qCAAc,CAAC,QAAQ,EACjC,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,SAAS,GAAG,OAAO,KAAK,qCAAc,CAAC,OAAO,CAAC;IACrD,MAAM,WAAW,GAAG,OAAO,KAAK,qCAAc,CAAC,SAAS,CAAC;IACzD,MAAM,eAAe,GAAG,CAAC,SAAS,IAAI,WAAW,CAAC;IAClD,MAAM,YAAY,GAAG,CAAC,SAAS,IAAI,QAAQ,CAAC;IAC5C,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,oCAAa,CAAC,KAAK,CAAC,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC;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AAC,CAAC,CACP,CAAC,eAAM,CACL,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,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAnJW,QAAA,OAAO,WAmJlB;AAEF,eAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n ContentVariant,\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { ContentProps } from './Content.types';\n\nexport const Content: React.FC<ContentProps> = ({\n variant = ContentVariant.TwoLines,\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 isOneLine = variant === ContentVariant.OneLine;\n const isMultiLine = variant === ContentVariant.MultiLine;\n const showDescription = !isOneLine && description;\n const showSubvalue = !isOneLine && subvalue;\n const alignItems = isMultiLine ? BoxAlignItems.Start : BoxAlignItems.Center;\n\n if (__DEV__) {\n if (isOneLine && description) {\n console.warn(\n 'Content: `description` is ignored when `variant` is `ContentVariant.OneLine`.',\n );\n }\n if (isOneLine && subvalue) {\n console.warn(\n 'Content: `subvalue` is ignored when `variant` is `ContentVariant.OneLine`.',\n );\n }\n }\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={alignItems}\n gap={4}\n twClassName={twClassName}\n {...props}\n >\n {avatar}\n <BoxColumn\n twClassName=\"flex-1 min-w-0\"\n bottomAccessory={\n showDescription ? (\n <BoxRow\n twClassName=\"w-full\"\n alignItems={alignItems}\n startAccessory={descriptionStartAccessory}\n endAccessory={descriptionEndAccessory}\n gap={1}\n >\n <BoxColumn twClassName=\"min-w-0\">\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 </BoxColumn>\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 || showSubvalue ? (\n <BoxColumn\n alignItems={BoxAlignItems.End}\n twClassName=\"min-w-0\"\n bottomAccessory={\n showSubvalue ? (\n <BoxRow\n alignItems={alignItems}\n startAccessory={subvalueStartAccessory}\n endAccessory={subvalueEndAccessory}\n gap={1}\n >\n <BoxColumn twClassName=\"min-w-0\">\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 </BoxColumn>\n </BoxRow>\n ) : null\n }\n >\n {value ? (\n <BoxRow\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 </Box>\n );\n};\n\nContent.displayName = 'Content';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.cts","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;
|
|
1
|
+
{"version":3,"file":"Content.d.cts","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,YAAY,EAAE,4BAAwB;AAEpD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAmJ1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.mts","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;
|
|
1
|
+
{"version":3,"file":"Content.d.mts","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,YAAY,EAAE,4BAAwB;AAEpD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAmJ1C,CAAC"}
|
|
@@ -8,6 +8,8 @@ import { BoxAlignItems, BoxFlexDirection, ContentVariant, FontWeight, TextColor,
|
|
|
8
8
|
import $React from "react";
|
|
9
9
|
const React = $importDefault($React);
|
|
10
10
|
import { Box } from "../Box/index.mjs";
|
|
11
|
+
import { BoxColumn } from "../BoxColumn/index.mjs";
|
|
12
|
+
import { BoxRow } from "../BoxRow/index.mjs";
|
|
11
13
|
import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
|
|
12
14
|
export const Content = ({ variant = ContentVariant.TwoLines, avatar, twClassName, title, titleProps, titleStartAccessory, titleEndAccessory, description, descriptionProps, descriptionStartAccessory, descriptionEndAccessory, value, valueProps, valueStartAccessory, valueEndAccessory, subvalue, subvalueProps, subvalueStartAccessory, subvalueEndAccessory, ...props }) => {
|
|
13
15
|
const isOneLine = variant === ContentVariant.OneLine;
|
|
@@ -25,9 +27,19 @@ export const Content = ({ variant = ContentVariant.TwoLines, avatar, twClassName
|
|
|
25
27
|
}
|
|
26
28
|
return (<Box flexDirection={BoxFlexDirection.Row} alignItems={alignItems} gap={4} twClassName={twClassName} {...props}>
|
|
27
29
|
{avatar}
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
<BoxColumn twClassName="flex-1 min-w-0" bottomAccessory={showDescription ? (<BoxRow twClassName="w-full" alignItems={alignItems} startAccessory={descriptionStartAccessory} endAccessory={descriptionEndAccessory} gap={1}>
|
|
31
|
+
<BoxColumn twClassName="min-w-0">
|
|
32
|
+
<TextOrChildren textProps={{
|
|
33
|
+
variant: TextVariant.BodySm,
|
|
34
|
+
fontWeight: FontWeight.Medium,
|
|
35
|
+
color: TextColor.TextAlternative,
|
|
36
|
+
...descriptionProps,
|
|
37
|
+
}}>
|
|
38
|
+
{description}
|
|
39
|
+
</TextOrChildren>
|
|
40
|
+
</BoxColumn>
|
|
41
|
+
</BoxRow>) : null}>
|
|
42
|
+
{title ? (<BoxRow twClassName="w-full" startAccessory={titleStartAccessory} endAccessory={titleEndAccessory} gap={1}>
|
|
31
43
|
<TextOrChildren textProps={{
|
|
32
44
|
variant: TextVariant.BodyMd,
|
|
33
45
|
fontWeight: FontWeight.Medium,
|
|
@@ -36,26 +48,21 @@ export const Content = ({ variant = ContentVariant.TwoLines, avatar, twClassName
|
|
|
36
48
|
}}>
|
|
37
49
|
{title}
|
|
38
50
|
</TextOrChildren>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</Box>) : null}
|
|
55
|
-
</Box>
|
|
56
|
-
{value || showSubvalue ? (<Box flexDirection={BoxFlexDirection.Column} alignItems={BoxAlignItems.End} twClassName="min-w-0">
|
|
57
|
-
{value ? (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1}>
|
|
58
|
-
{valueStartAccessory}
|
|
51
|
+
</BoxRow>) : null}
|
|
52
|
+
</BoxColumn>
|
|
53
|
+
{value || showSubvalue ? (<BoxColumn alignItems={BoxAlignItems.End} twClassName="min-w-0" bottomAccessory={showSubvalue ? (<BoxRow alignItems={alignItems} startAccessory={subvalueStartAccessory} endAccessory={subvalueEndAccessory} gap={1}>
|
|
54
|
+
<BoxColumn twClassName="min-w-0">
|
|
55
|
+
<TextOrChildren textProps={{
|
|
56
|
+
variant: TextVariant.BodySm,
|
|
57
|
+
fontWeight: FontWeight.Medium,
|
|
58
|
+
color: TextColor.TextAlternative,
|
|
59
|
+
...subvalueProps,
|
|
60
|
+
}}>
|
|
61
|
+
{subvalue}
|
|
62
|
+
</TextOrChildren>
|
|
63
|
+
</BoxColumn>
|
|
64
|
+
</BoxRow>) : null}>
|
|
65
|
+
{value ? (<BoxRow startAccessory={valueStartAccessory} endAccessory={valueEndAccessory} gap={1}>
|
|
59
66
|
<TextOrChildren textProps={{
|
|
60
67
|
variant: TextVariant.BodyMd,
|
|
61
68
|
fontWeight: FontWeight.Medium,
|
|
@@ -64,23 +71,8 @@ export const Content = ({ variant = ContentVariant.TwoLines, avatar, twClassName
|
|
|
64
71
|
}}>
|
|
65
72
|
{value}
|
|
66
73
|
</TextOrChildren>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{showSubvalue ? (<Box flexDirection={BoxFlexDirection.Row} alignItems={alignItems} gap={1}>
|
|
70
|
-
{subvalueStartAccessory}
|
|
71
|
-
<Box flexDirection={BoxFlexDirection.Column} twClassName="min-w-0">
|
|
72
|
-
<TextOrChildren textProps={{
|
|
73
|
-
variant: TextVariant.BodySm,
|
|
74
|
-
fontWeight: FontWeight.Medium,
|
|
75
|
-
color: TextColor.TextAlternative,
|
|
76
|
-
...subvalueProps,
|
|
77
|
-
}}>
|
|
78
|
-
{subvalue}
|
|
79
|
-
</TextOrChildren>
|
|
80
|
-
</Box>
|
|
81
|
-
{subvalueEndAccessory}
|
|
82
|
-
</Box>) : null}
|
|
83
|
-
</Box>) : null}
|
|
74
|
+
</BoxRow>) : null}
|
|
75
|
+
</BoxColumn>) : null}
|
|
84
76
|
</Box>);
|
|
85
77
|
};
|
|
86
78
|
Content.displayName = 'Content';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.mjs","sourceRoot":"","sources":["../../../src/components/Content/Content.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,cAAc,EAAE,oDAA0C;AAInE,MAAM,CAAC,MAAM,OAAO,GAA2B,CAAC,EAC9C,OAAO,GAAG,cAAc,CAAC,QAAQ,EACjC,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,EAC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S,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n ContentVariant,\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { ContentProps } from './Content.types';\n\nexport const Content: React.FC<ContentProps> = ({\n variant = ContentVariant.TwoLines,\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 isOneLine = variant === ContentVariant.OneLine;\n const isMultiLine = variant === ContentVariant.MultiLine;\n const showDescription = !isOneLine && description;\n const showSubvalue = !isOneLine && subvalue;\n const alignItems = isMultiLine ? BoxAlignItems.Start : BoxAlignItems.Center;\n\n if (__DEV__) {\n if (isOneLine && description) {\n console.warn(\n 'Content: `description` is ignored when `variant` is `ContentVariant.OneLine`.',\n );\n }\n if (isOneLine && subvalue) {\n console.warn(\n 'Content: `subvalue` is ignored when `variant` is `ContentVariant.OneLine`.',\n );\n }\n }\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={alignItems}\n gap={4}\n twClassName={twClassName}\n {...props}\n >\n {avatar}\n <BoxColumn\n twClassName=\"flex-1 min-w-0\"\n bottomAccessory={\n showDescription ? (\n <BoxRow\n twClassName=\"w-full\"\n alignItems={alignItems}\n startAccessory={descriptionStartAccessory}\n endAccessory={descriptionEndAccessory}\n gap={1}\n >\n <BoxColumn twClassName=\"min-w-0\">\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 </BoxColumn>\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 || showSubvalue ? (\n <BoxColumn\n alignItems={BoxAlignItems.End}\n twClassName=\"min-w-0\"\n bottomAccessory={\n showSubvalue ? (\n <BoxRow\n alignItems={alignItems}\n startAccessory={subvalueStartAccessory}\n endAccessory={subvalueEndAccessory}\n gap={1}\n >\n <BoxColumn twClassName=\"min-w-0\">\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 </BoxColumn>\n </BoxRow>\n ) : null\n }\n >\n {value ? (\n <BoxRow\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 </Box>\n );\n};\n\nContent.displayName = 'Content';\n"]}
|
|
@@ -10,8 +10,8 @@ const react_1 = __importDefault(require("react"));
|
|
|
10
10
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
11
11
|
// External dependencies.
|
|
12
12
|
const Box_1 = require("../Box/index.cjs");
|
|
13
|
+
const BoxRow_1 = require("../BoxRow/index.cjs");
|
|
13
14
|
const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
|
|
14
|
-
const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
|
|
15
15
|
const Text_1 = require("../Text/index.cjs");
|
|
16
16
|
const HeaderRoot = ({ children, title, titleProps, titleAccessory, endAccessory, endButtonIconProps, includesTopInset = false, style, testID, twClassName, ...viewProps }) => {
|
|
17
17
|
const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
@@ -32,15 +32,12 @@ const HeaderRoot = ({ children, title, titleProps, titleAccessory, endAccessory,
|
|
|
32
32
|
return children;
|
|
33
33
|
}
|
|
34
34
|
if (title) {
|
|
35
|
-
return (<
|
|
36
|
-
<TextOrChildren_1.TextOrChildren textProps={{
|
|
35
|
+
return (<BoxRow_1.BoxRow endAccessory={titleAccessory} textProps={{
|
|
37
36
|
variant: Text_1.TextVariant.HeadingLg,
|
|
38
37
|
...titleProps,
|
|
39
|
-
}}>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{titleAccessory}
|
|
43
|
-
</Box_1.Box>);
|
|
38
|
+
}} twClassName="flex-1">
|
|
39
|
+
{title}
|
|
40
|
+
</BoxRow_1.BoxRow>);
|
|
44
41
|
}
|
|
45
42
|
return null;
|
|
46
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderRoot.cjs","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,kFAA2E;AAC3E,kDAA0B;AAC1B,mFAAmE;AAEnE,yBAAyB;AACzB,0CAA8D;AAC9D,wDAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"HeaderRoot.cjs","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,kFAA2E;AAC3E,kDAA0B;AAC1B,mFAAmE;AAEnE,yBAAyB;AACzB,0CAA8D;AAC9D,gDAAmC;AACnC,wDAA2D;AAC3D,4CAAsC;AAK/B,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,UAAU,EAC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CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,SAAG,CACF,aAAa,CAAC,CAAC,sBAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,mBAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,YAAY,CAAC,CAAC,CAAC,CAAC,CAChB,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CACvD,KAAK,CAAC,CAAC,CAAC,gBAAgB,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC,CAC9D,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,iBAAiB,EAAE,CACpB;MAAA,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACnB,CAAC,SAAG,CAAC,aAAa,CAAC,CAAC,sBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CACrE;UAAA,CAAC,iBAAiB,CACpB;QAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA3EW,QAAA,UAAU,cA2ErB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["// Third party dependencies.\nimport { mergeTwClassName } from '@metamask-previews/design-system-shared';\nimport React from 'react';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { Box, BoxAlignItems, BoxFlexDirection } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { TextVariant } from '../Text';\n\n// Internal dependencies.\nimport type { HeaderRootProps } from './HeaderRoot.types';\n\nexport const HeaderRoot = ({\n children,\n title,\n titleProps,\n titleAccessory,\n endAccessory,\n endButtonIconProps,\n includesTopInset = false,\n style,\n testID,\n twClassName,\n ...viewProps\n}: HeaderRootProps) => {\n const insets = useSafeAreaInsets();\n\n const endSectionContent = (() => {\n if (endAccessory) {\n return endAccessory;\n }\n if (endButtonIconProps && endButtonIconProps.length > 0) {\n const reversedProps = endButtonIconProps\n .map((props, originalIndex) => ({ props, originalIndex }))\n .reverse();\n return reversedProps.map(({ props, originalIndex }) => (\n <ButtonIcon\n key={`end-button-icon-${originalIndex}`}\n size={ButtonIconSize.Md}\n {...props}\n />\n ));\n }\n return null;\n })();\n\n const renderLeftSection = () => {\n if (children) {\n return children;\n }\n if (title) {\n return (\n <BoxRow\n endAccessory={titleAccessory}\n textProps={{\n variant: TextVariant.HeadingLg,\n ...titleProps,\n }}\n twClassName=\"flex-1\"\n >\n {title}\n </BoxRow>\n );\n }\n return null;\n };\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={4}\n paddingLeft={4}\n paddingRight={2}\n twClassName={mergeTwClassName('min-h-14', twClassName)}\n style={[includesTopInset && { marginTop: insets.top }, style]}\n testID={testID}\n {...viewProps}\n >\n {renderLeftSection()}\n {endSectionContent ? (\n <Box flexDirection={BoxFlexDirection.Row} gap={2} twClassName=\"ml-auto\">\n {endSectionContent}\n </Box>\n ) : null}\n </Box>\n );\n};\n\nHeaderRoot.displayName = 'HeaderRoot';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderRoot.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU;oJAYpB,eAAe;;
|
|
1
|
+
{"version":3,"file":"HeaderRoot.d.cts","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU;oJAYpB,eAAe;;CA+DjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderRoot.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU;oJAYpB,eAAe;;
|
|
1
|
+
{"version":3,"file":"HeaderRoot.d.mts","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU;oJAYpB,eAAe;;CA+DjB,CAAC"}
|
|
@@ -11,8 +11,8 @@ const React = $importDefault($React);
|
|
|
11
11
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
12
12
|
// External dependencies.
|
|
13
13
|
import { Box, BoxAlignItems, BoxFlexDirection } from "../Box/index.mjs";
|
|
14
|
+
import { BoxRow } from "../BoxRow/index.mjs";
|
|
14
15
|
import { ButtonIcon, ButtonIconSize } from "../ButtonIcon/index.mjs";
|
|
15
|
-
import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
|
|
16
16
|
import { TextVariant } from "../Text/index.mjs";
|
|
17
17
|
export const HeaderRoot = ({ children, title, titleProps, titleAccessory, endAccessory, endButtonIconProps, includesTopInset = false, style, testID, twClassName, ...viewProps }) => {
|
|
18
18
|
const insets = useSafeAreaInsets();
|
|
@@ -33,15 +33,12 @@ export const HeaderRoot = ({ children, title, titleProps, titleAccessory, endAcc
|
|
|
33
33
|
return children;
|
|
34
34
|
}
|
|
35
35
|
if (title) {
|
|
36
|
-
return (<
|
|
37
|
-
<TextOrChildren textProps={{
|
|
36
|
+
return (<BoxRow endAccessory={titleAccessory} textProps={{
|
|
38
37
|
variant: TextVariant.HeadingLg,
|
|
39
38
|
...titleProps,
|
|
40
|
-
}}>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{titleAccessory}
|
|
44
|
-
</Box>);
|
|
39
|
+
}} twClassName="flex-1">
|
|
40
|
+
{title}
|
|
41
|
+
</BoxRow>);
|
|
45
42
|
}
|
|
46
43
|
return null;
|
|
47
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderRoot.mjs","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,gBAAgB,EAAE,gDAAgD;AAC3E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,yBAAyB;AACzB,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,gBAAgB,EAAE,yBAAe;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"HeaderRoot.mjs","sourceRoot":"","sources":["../../../src/components/HeaderRoot/HeaderRoot.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,gBAAgB,EAAE,gDAAgD;AAC3E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,yBAAyB;AACzB,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,gBAAgB,EAAE,yBAAe;AAC9D,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gCAAsB;AAC3D,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAKtC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,UAAU,EACV,cAAc,EAC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I,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,GAAG,CACF,aAAa,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,YAAY,CAAC,CAAC,CAAC,CAAC,CAChB,WAAW,CAAC,CAAC,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CACvD,KAAK,CAAC,CAAC,CAAC,gBAAgB,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC,CAC9D,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,iBAAiB,EAAE,CACpB;MAAA,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACnB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CACrE;UAAA,CAAC,iBAAiB,CACpB;QAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["// Third party dependencies.\nimport { mergeTwClassName } from '@metamask-previews/design-system-shared';\nimport React from 'react';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { Box, BoxAlignItems, BoxFlexDirection } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { ButtonIcon, ButtonIconSize } from '../ButtonIcon';\nimport { TextVariant } from '../Text';\n\n// Internal dependencies.\nimport type { HeaderRootProps } from './HeaderRoot.types';\n\nexport const HeaderRoot = ({\n children,\n title,\n titleProps,\n titleAccessory,\n endAccessory,\n endButtonIconProps,\n includesTopInset = false,\n style,\n testID,\n twClassName,\n ...viewProps\n}: HeaderRootProps) => {\n const insets = useSafeAreaInsets();\n\n const endSectionContent = (() => {\n if (endAccessory) {\n return endAccessory;\n }\n if (endButtonIconProps && endButtonIconProps.length > 0) {\n const reversedProps = endButtonIconProps\n .map((props, originalIndex) => ({ props, originalIndex }))\n .reverse();\n return reversedProps.map(({ props, originalIndex }) => (\n <ButtonIcon\n key={`end-button-icon-${originalIndex}`}\n size={ButtonIconSize.Md}\n {...props}\n />\n ));\n }\n return null;\n })();\n\n const renderLeftSection = () => {\n if (children) {\n return children;\n }\n if (title) {\n return (\n <BoxRow\n endAccessory={titleAccessory}\n textProps={{\n variant: TextVariant.HeadingLg,\n ...titleProps,\n }}\n twClassName=\"flex-1\"\n >\n {title}\n </BoxRow>\n );\n }\n return null;\n };\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={4}\n paddingLeft={4}\n paddingRight={2}\n twClassName={mergeTwClassName('min-h-14', twClassName)}\n style={[includesTopInset && { marginTop: insets.top }, style]}\n testID={testID}\n {...viewProps}\n >\n {renderLeftSection()}\n {endSectionContent ? (\n <Box flexDirection={BoxFlexDirection.Row} gap={2} twClassName=\"ml-auto\">\n {endSectionContent}\n </Box>\n ) : null}\n </Box>\n );\n};\n\nHeaderRoot.displayName = 'HeaderRoot';\n"]}
|