@metamask/design-system-react-native 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -18
- 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 -1
- 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 +2 -2
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.cts +10 -5
- package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.mts +10 -5
- package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +0 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +10 -5
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +10 -5
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +0 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -1
- package/dist/components/Box/Box.cjs +35 -12
- package/dist/components/Box/Box.cjs.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.d.cts +4 -2
- package/dist/components/Box/Box.d.cts.map +1 -1
- package/dist/components/Box/Box.d.mts +4 -2
- package/dist/components/Box/Box.d.mts.map +1 -1
- package/dist/components/Box/Box.mjs +13 -9
- package/dist/components/Box/Box.mjs.map +1 -1
- package/dist/components/Box/Box.types.cjs.map +1 -1
- package/dist/components/Box/Box.types.d.cts +3 -107
- package/dist/components/Box/Box.types.d.cts.map +1 -1
- package/dist/components/Box/Box.types.d.mts +3 -107
- 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 +1 -2
- package/dist/components/Box/index.d.cts.map +1 -1
- package/dist/components/Box/index.d.mts +1 -2
- 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/BoxColumn/BoxColumn.cjs +2 -2
- package/dist/components/BoxColumn/BoxColumn.cjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.cts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.mts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.mjs +1 -1
- package/dist/components/BoxColumn/BoxColumn.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.cjs +2 -2
- package/dist/components/BoxRow/BoxRow.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.mjs +1 -1
- package/dist/components/BoxRow/BoxRow.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +2 -3
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs +2 -3
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.cts +1 -0
- package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.mts +1 -0
- package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.cts +1 -6
- package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.mts +1 -6
- package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.cts +2 -28
- package/dist/components/Checkbox/Checkbox.types.d.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.mts +2 -28
- package/dist/components/Checkbox/Checkbox.types.d.mts.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.mjs.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.cjs +6 -15
- 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 +6 -15
- package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -1
- package/dist/components/Icon/Icon.assets.cjs +284 -281
- package/dist/components/Icon/Icon.assets.cjs.map +1 -1
- package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
- package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
- package/dist/components/Icon/Icon.assets.mjs +284 -281
- package/dist/components/Icon/Icon.assets.mjs.map +1 -1
- package/dist/components/Icon/Icon.types.cjs.map +1 -1
- package/dist/components/Icon/Icon.types.d.cts +3 -21
- package/dist/components/Icon/Icon.types.d.cts.map +1 -1
- package/dist/components/Icon/Icon.types.d.mts +3 -21
- package/dist/components/Icon/Icon.types.d.mts.map +1 -1
- package/dist/components/Icon/Icon.types.mjs.map +1 -1
- package/dist/components/Icon/assets/after-hours.svg +1 -1
- package/dist/components/Icon/assets/pop-up.svg +1 -0
- package/dist/components/Icon/assets/side-panel.svg +1 -0
- package/dist/components/Input/Input.d.cts +2 -1
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts +2 -1
- package/dist/components/Input/Input.d.mts.map +1 -1
- package/dist/components/RadioButton/RadioButton.types.d.cts +1 -0
- package/dist/components/RadioButton/RadioButton.types.d.cts.map +1 -1
- package/dist/components/RadioButton/RadioButton.types.d.mts +1 -0
- package/dist/components/RadioButton/RadioButton.types.d.mts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.d.cts +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.cts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.d.mts +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.mts.map +1 -1
- package/dist/components/Tag/Tag.cjs +45 -0
- package/dist/components/Tag/Tag.cjs.map +1 -0
- package/dist/components/Tag/Tag.constants.cjs +27 -0
- package/dist/components/Tag/Tag.constants.cjs.map +1 -0
- package/dist/components/Tag/Tag.constants.d.cts +6 -0
- package/dist/components/Tag/Tag.constants.d.cts.map +1 -0
- package/dist/components/Tag/Tag.constants.d.mts +6 -0
- package/dist/components/Tag/Tag.constants.d.mts.map +1 -0
- package/dist/components/Tag/Tag.constants.mjs +24 -0
- package/dist/components/Tag/Tag.constants.mjs.map +1 -0
- package/dist/components/Tag/Tag.d.cts +4 -0
- package/dist/components/Tag/Tag.d.cts.map +1 -0
- package/dist/components/Tag/Tag.d.mts +4 -0
- package/dist/components/Tag/Tag.d.mts.map +1 -0
- package/dist/components/Tag/Tag.mjs +45 -0
- package/dist/components/Tag/Tag.mjs.map +1 -0
- package/dist/components/Tag/Tag.types.cjs +3 -0
- package/dist/components/Tag/Tag.types.cjs.map +1 -0
- package/dist/components/Tag/Tag.types.d.cts +38 -0
- package/dist/components/Tag/Tag.types.d.cts.map +1 -0
- package/dist/components/Tag/Tag.types.d.mts +38 -0
- package/dist/components/Tag/Tag.types.d.mts.map +1 -0
- package/dist/components/Tag/Tag.types.mjs +2 -0
- package/dist/components/Tag/Tag.types.mjs.map +1 -0
- package/dist/components/Tag/index.cjs +8 -0
- package/dist/components/Tag/index.cjs.map +1 -0
- package/dist/components/Tag/index.d.cts +4 -0
- package/dist/components/Tag/index.d.cts.map +1 -0
- package/dist/components/Tag/index.d.mts +4 -0
- package/dist/components/Tag/index.d.mts.map +1 -0
- package/dist/components/Tag/index.mjs +3 -0
- package/dist/components/Tag/index.mjs.map +1 -0
- package/dist/components/TextButton/TextButton.types.d.cts +1 -0
- package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
- package/dist/components/TextButton/TextButton.types.d.mts +1 -0
- package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
- package/dist/components/TextField/TextField.d.cts +1 -0
- package/dist/components/TextField/TextField.d.cts.map +1 -1
- package/dist/components/TextField/TextField.d.mts +1 -0
- package/dist/components/TextField/TextField.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.cjs +65 -0
- package/dist/components/TitleHub/TitleHub.cjs.map +1 -0
- package/dist/components/TitleHub/TitleHub.d.cts +26 -0
- package/dist/components/TitleHub/TitleHub.d.cts.map +1 -0
- package/dist/components/TitleHub/TitleHub.d.mts +26 -0
- package/dist/components/TitleHub/TitleHub.d.mts.map +1 -0
- package/dist/components/TitleHub/TitleHub.mjs +65 -0
- package/dist/components/TitleHub/TitleHub.mjs.map +1 -0
- package/dist/components/TitleHub/TitleHub.types.cjs +3 -0
- package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -0
- package/dist/components/TitleHub/TitleHub.types.d.cts +39 -0
- package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -0
- package/dist/components/TitleHub/TitleHub.types.d.mts +39 -0
- package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -0
- package/dist/components/TitleHub/TitleHub.types.mjs +2 -0
- package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -0
- package/dist/components/TitleHub/index.cjs +6 -0
- package/dist/components/TitleHub/index.cjs.map +1 -0
- package/dist/components/TitleHub/index.d.cts +4 -0
- package/dist/components/TitleHub/index.d.cts.map +1 -0
- package/dist/components/TitleHub/index.d.mts +4 -0
- package/dist/components/TitleHub/index.d.mts.map +1 -0
- package/dist/components/TitleHub/index.mjs +2 -0
- package/dist/components/TitleHub/index.mjs.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.cjs +58 -0
- package/dist/components/TitleStandard/TitleStandard.cjs.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.d.cts +23 -0
- package/dist/components/TitleStandard/TitleStandard.d.cts.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.d.mts +23 -0
- package/dist/components/TitleStandard/TitleStandard.d.mts.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.mjs +58 -0
- package/dist/components/TitleStandard/TitleStandard.mjs.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.types.cjs +3 -0
- package/dist/components/TitleStandard/TitleStandard.types.cjs.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.types.d.cts +31 -0
- package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.types.d.mts +31 -0
- package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.types.mjs +2 -0
- package/dist/components/TitleStandard/TitleStandard.types.mjs.map +1 -0
- package/dist/components/TitleStandard/index.cjs +6 -0
- package/dist/components/TitleStandard/index.cjs.map +1 -0
- package/dist/components/TitleStandard/index.d.cts +3 -0
- package/dist/components/TitleStandard/index.d.cts.map +1 -0
- package/dist/components/TitleStandard/index.d.mts +3 -0
- package/dist/components/TitleStandard/index.d.mts.map +1 -0
- package/dist/components/TitleStandard/index.mjs +2 -0
- package/dist/components/TitleStandard/index.mjs.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.cjs +85 -0
- package/dist/components/TitleSubpage/TitleSubpage.cjs.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.d.cts +30 -0
- package/dist/components/TitleSubpage/TitleSubpage.d.cts.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.d.mts +30 -0
- package/dist/components/TitleSubpage/TitleSubpage.d.mts.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.mjs +85 -0
- package/dist/components/TitleSubpage/TitleSubpage.mjs.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.cjs +3 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.cjs.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +44 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +44 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.mjs +2 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.mjs.map +1 -0
- package/dist/components/TitleSubpage/index.cjs +6 -0
- package/dist/components/TitleSubpage/index.cjs.map +1 -0
- package/dist/components/TitleSubpage/index.d.cts +3 -0
- package/dist/components/TitleSubpage/index.d.cts.map +1 -0
- package/dist/components/TitleSubpage/index.d.mts +3 -0
- package/dist/components/TitleSubpage/index.d.mts.map +1 -0
- package/dist/components/TitleSubpage/index.mjs +2 -0
- package/dist/components/TitleSubpage/index.mjs.map +1 -0
- package/dist/components/Toast/Toast.cjs +0 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts +1 -1
- package/dist/components/Toast/Toast.d.cts.map +1 -1
- package/dist/components/Toast/Toast.d.mts +1 -1
- package/dist/components/Toast/Toast.d.mts.map +1 -1
- package/dist/components/Toast/Toast.mjs +0 -1
- package/dist/components/Toast/Toast.mjs.map +1 -1
- package/dist/components/index.cjs +11 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +8 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +8 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +4 -0
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts +1 -0
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts +1 -0
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts.map +1 -1
- package/dist/types/index.cjs +12 -530
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +4 -518
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +4 -518
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +4 -525
- package/dist/types/index.mjs.map +1 -1
- package/package.json +21 -20
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
// Third party dependencies.
|
|
8
|
+
import { FontWeight, TextColor, TextVariant } from "@metamask/design-system-shared";
|
|
9
|
+
import $React from "react";
|
|
10
|
+
const React = $importDefault($React);
|
|
11
|
+
// Internal dependencies.
|
|
12
|
+
import { Box } from "../Box/index.mjs";
|
|
13
|
+
import { BoxRow } from "../BoxRow/index.mjs";
|
|
14
|
+
/**
|
|
15
|
+
* Displays a required identity row (avatar + title stack) with optional subtitle, amount, inline accessories, and bottom rows in a left-aligned layout.
|
|
16
|
+
* Remaining `View` props are forwarded to the root `Box`.
|
|
17
|
+
*
|
|
18
|
+
* @param props - Component props
|
|
19
|
+
* @param props.title - Title row content (required)
|
|
20
|
+
* @param props.titleAvatar - Leading visual for the identity row (required); passed through as the identity `BoxRow` `startAccessory` so callers control layout and composition (for example badges that extend past the token)
|
|
21
|
+
* @param props.identityRowProps - Optional props spread onto the identity `BoxRow` after defaults (`children`, `startAccessory`, and `textProps` are reserved)
|
|
22
|
+
* @param props.titleColumnProps - Optional props spread onto the title/subtitle column `Box` (`children` is reserved)
|
|
23
|
+
* @param props.bottomLabelWrapperProps - Optional props spread onto the bottom label `BoxRow` after defaults (`children`, `endAccessory`, and `textProps` are reserved)
|
|
24
|
+
* @param props.titleEndAccessory - Optional inline accessory to the right of `title`
|
|
25
|
+
* @param props.subtitle - Optional subtitle row below the title and above the amount
|
|
26
|
+
* @param props.subtitleEndAccessory - Optional inline accessory to the right of `subtitle`
|
|
27
|
+
* @param props.amount - Optional primary amount below the title
|
|
28
|
+
* @param props.amountEndAccessory - Optional inline accessory to the right of the amount
|
|
29
|
+
* @param props.bottomAccessory - Optional custom bottom row when the bottom label row is not shown
|
|
30
|
+
* @param props.bottomLabel - Optional secondary label below the amount row
|
|
31
|
+
* @param props.bottomLabelEndAccessory - Optional inline accessory to the right of `bottomLabel`
|
|
32
|
+
* @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
|
|
33
|
+
* @param props.subtitleProps - Optional props merged into subtitle row `Text` when `subtitle` is a string
|
|
34
|
+
* @param props.amountProps - Optional props merged into amount `Text` when `amount` is a string
|
|
35
|
+
* @param props.bottomLabelProps - Optional props merged into bottom label `Text` when `bottomLabel` is a string
|
|
36
|
+
* @param props.twClassName - Optional Tailwind classes on the root container
|
|
37
|
+
*
|
|
38
|
+
* @returns The rendered TitleSubpage layout.
|
|
39
|
+
*/
|
|
40
|
+
export const TitleSubpage = ({ amount, amountEndAccessory, title, titleAvatar, titleEndAccessory, subtitle, subtitleEndAccessory, bottomAccessory, bottomLabel, bottomLabelEndAccessory, amountProps, titleProps, subtitleProps, bottomLabelProps, identityRowProps, titleColumnProps, bottomLabelWrapperProps, twClassName = '', ...props }) => {
|
|
41
|
+
return (<Box twClassName={twClassName} gap={1} {...props}>
|
|
42
|
+
{/* Identity Row */}
|
|
43
|
+
<BoxRow gap={4} twClassName="h-14" {...identityRowProps} startAccessory={titleAvatar}>
|
|
44
|
+
{/* Title and Subtitle Column */}
|
|
45
|
+
<Box {...titleColumnProps}>
|
|
46
|
+
{/* Title Row */}
|
|
47
|
+
{title && (<BoxRow endAccessory={titleEndAccessory} textProps={{
|
|
48
|
+
variant: TextVariant.HeadingSm,
|
|
49
|
+
color: TextColor.TextDefault,
|
|
50
|
+
...titleProps,
|
|
51
|
+
}}>
|
|
52
|
+
{title}
|
|
53
|
+
</BoxRow>)}
|
|
54
|
+
{/* Subtitle Row */}
|
|
55
|
+
{subtitle && (<BoxRow endAccessory={subtitleEndAccessory} textProps={{
|
|
56
|
+
variant: TextVariant.BodySm,
|
|
57
|
+
fontWeight: FontWeight.Medium,
|
|
58
|
+
color: TextColor.TextAlternative,
|
|
59
|
+
...subtitleProps,
|
|
60
|
+
}}>
|
|
61
|
+
{subtitle}
|
|
62
|
+
</BoxRow>)}
|
|
63
|
+
</Box>
|
|
64
|
+
</BoxRow>
|
|
65
|
+
{/* Amount Row */}
|
|
66
|
+
{amount && (<BoxRow endAccessory={amountEndAccessory} textProps={{
|
|
67
|
+
variant: TextVariant.DisplayLg,
|
|
68
|
+
...amountProps,
|
|
69
|
+
}}>
|
|
70
|
+
{amount}
|
|
71
|
+
</BoxRow>)}
|
|
72
|
+
{/* Bottom Label Row */}
|
|
73
|
+
{bottomLabel && (<BoxRow {...bottomLabelWrapperProps} endAccessory={bottomLabelEndAccessory} textProps={{
|
|
74
|
+
variant: TextVariant.BodySm,
|
|
75
|
+
fontWeight: FontWeight.Medium,
|
|
76
|
+
color: TextColor.TextAlternative,
|
|
77
|
+
...bottomLabelProps,
|
|
78
|
+
}}>
|
|
79
|
+
{bottomLabel}
|
|
80
|
+
</BoxRow>)}
|
|
81
|
+
{!bottomLabel && bottomAccessory}
|
|
82
|
+
</Box>);
|
|
83
|
+
};
|
|
84
|
+
TitleSubpage.displayName = 'TitleSubpage';
|
|
85
|
+
//# sourceMappingURL=TitleSubpage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleSubpage.mjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACZ,uCAAuC;AACxC,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AAInC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EACxD,MAAM,EACN,kBAAkB,EAClB,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,WAAW,EACX,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,GAAG,EAAE,EACh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AAE,WAAW,CAAC,SAAS;gBAC9B,GAAG,WAAW;aACf,CAAC,CAEF;UAAA,CAAC,MAAM,CACT;QAAA,EAAE,MAAM,CAAC,CACV,CACD;MAAA,CAAC,sBAAsB,CACvB;MAAA,CAAC,WAAW,IAAI,CACd,CAAC,MAAM,CACL,IAAI,uBAAuB,CAAC,CAC5B,YAAY,CAAC,CAAC,uBAAuB,CAAC,CACtC,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,WAAW,CAAC,MAAM;gBAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;gBAC7B,KAAK,EAAE,SAAS,CAAC,eAAe;gBAChC,GAAG,gBAAgB;aACpB,CAAC,CAEF;UAAA,CAAC,WAAW,CACd;QAAA,EAAE,MAAM,CAAC,CACV,CACD;MAAA,CAAC,CAAC,WAAW,IAAI,eAAe,CAClC;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// Third party dependencies.\nimport {\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\n// Internal dependencies.\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\n\nimport type { TitleSubpageProps } from './TitleSubpage.types';\n\n/**\n * Displays a required identity row (avatar + title stack) with optional subtitle, amount, inline accessories, and bottom rows in a left-aligned layout.\n * Remaining `View` props are forwarded to the root `Box`.\n *\n * @param props - Component props\n * @param props.title - Title row content (required)\n * @param props.titleAvatar - Leading visual for the identity row (required); passed through as the identity `BoxRow` `startAccessory` so callers control layout and composition (for example badges that extend past the token)\n * @param props.identityRowProps - Optional props spread onto the identity `BoxRow` after defaults (`children`, `startAccessory`, and `textProps` are reserved)\n * @param props.titleColumnProps - Optional props spread onto the title/subtitle column `Box` (`children` is reserved)\n * @param props.bottomLabelWrapperProps - Optional props spread onto the bottom label `BoxRow` after defaults (`children`, `endAccessory`, and `textProps` are reserved)\n * @param props.titleEndAccessory - Optional inline accessory to the right of `title`\n * @param props.subtitle - Optional subtitle row below the title and above the amount\n * @param props.subtitleEndAccessory - Optional inline accessory to the right of `subtitle`\n * @param props.amount - Optional primary amount below the title\n * @param props.amountEndAccessory - Optional inline accessory to the right of the amount\n * @param props.bottomAccessory - Optional custom bottom row when the bottom label row is not shown\n * @param props.bottomLabel - Optional secondary label below the amount row\n * @param props.bottomLabelEndAccessory - Optional inline accessory to the right of `bottomLabel`\n * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string\n * @param props.subtitleProps - Optional props merged into subtitle row `Text` when `subtitle` is a string\n * @param props.amountProps - Optional props merged into amount `Text` when `amount` is a string\n * @param props.bottomLabelProps - Optional props merged into bottom label `Text` when `bottomLabel` is a string\n * @param props.twClassName - Optional Tailwind classes on the root container\n *\n * @returns The rendered TitleSubpage layout.\n */\nexport const TitleSubpage: React.FC<TitleSubpageProps> = ({\n amount,\n amountEndAccessory,\n title,\n titleAvatar,\n titleEndAccessory,\n subtitle,\n subtitleEndAccessory,\n bottomAccessory,\n bottomLabel,\n bottomLabelEndAccessory,\n amountProps,\n titleProps,\n subtitleProps,\n bottomLabelProps,\n identityRowProps,\n titleColumnProps,\n bottomLabelWrapperProps,\n twClassName = '',\n ...props\n}) => {\n return (\n <Box twClassName={twClassName} gap={1} {...props}>\n {/* Identity Row */}\n <BoxRow\n gap={4}\n twClassName=\"h-14\"\n {...identityRowProps}\n startAccessory={titleAvatar}\n >\n {/* Title and Subtitle Column */}\n <Box {...titleColumnProps}>\n {/* Title Row */}\n {title && (\n <BoxRow\n endAccessory={titleEndAccessory}\n textProps={{\n variant: TextVariant.HeadingSm,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n )}\n {/* Subtitle Row */}\n {subtitle && (\n <BoxRow\n endAccessory={subtitleEndAccessory}\n textProps={{\n variant: TextVariant.BodySm,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n ...subtitleProps,\n }}\n >\n {subtitle}\n </BoxRow>\n )}\n </Box>\n </BoxRow>\n {/* Amount Row */}\n {amount && (\n <BoxRow\n endAccessory={amountEndAccessory}\n textProps={{\n variant: TextVariant.DisplayLg,\n ...amountProps,\n }}\n >\n {amount}\n </BoxRow>\n )}\n {/* Bottom Label Row */}\n {bottomLabel && (\n <BoxRow\n {...bottomLabelWrapperProps}\n endAccessory={bottomLabelEndAccessory}\n textProps={{\n variant: TextVariant.BodySm,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n ...bottomLabelProps,\n }}\n >\n {bottomLabel}\n </BoxRow>\n )}\n {!bottomLabel && bottomAccessory}\n </Box>\n );\n};\n\nTitleSubpage.displayName = 'TitleSubpage';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleSubpage.types.cjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleSubpagePropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxProps } from '../Box/Box.types';\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleSubpage component props (React Native).\n * Extends {@link TitleSubpagePropsShared} (requires `title` and `titleAvatar`) with platform `Text` passthroughs, `twClassName`, and `View` props.\n */\nexport type TitleSubpageProps = TitleSubpagePropsShared & {\n /**\n * Optional props spread onto the identity {@link BoxRow} (excluding `children`, `startAccessory`, and `textProps`, which the component owns).\n */\n identityRowProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'startAccessory' | 'textProps'\n >;\n /**\n * Optional props spread onto the title/subtitle column {@link Box} (excluding `children`, which the component owns).\n */\n titleColumnProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props spread onto the bottom label {@link BoxRow} (excluding `children`, `endAccessory`, and `textProps`, which the component owns).\n */\n bottomLabelWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.\n */\n amountProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `subtitle` is a string.\n */\n subtitleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.\n */\n bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { TitleSubpagePropsShared } from "@metamask/design-system-shared";
|
|
2
|
+
import type { ViewProps } from "react-native/index.js";
|
|
3
|
+
import type { BoxProps } from "../Box/Box.types.cjs";
|
|
4
|
+
import type { BoxRowProps } from "../BoxRow/BoxRow.types.cjs";
|
|
5
|
+
import type { TextProps } from "../Text/Text.types.cjs";
|
|
6
|
+
/**
|
|
7
|
+
* TitleSubpage component props (React Native).
|
|
8
|
+
* Extends {@link TitleSubpagePropsShared} (requires `title` and `titleAvatar`) with platform `Text` passthroughs, `twClassName`, and `View` props.
|
|
9
|
+
*/
|
|
10
|
+
export type TitleSubpageProps = TitleSubpagePropsShared & {
|
|
11
|
+
/**
|
|
12
|
+
* Optional props spread onto the identity {@link BoxRow} (excluding `children`, `startAccessory`, and `textProps`, which the component owns).
|
|
13
|
+
*/
|
|
14
|
+
identityRowProps?: Omit<Partial<BoxRowProps>, 'children' | 'startAccessory' | 'textProps'>;
|
|
15
|
+
/**
|
|
16
|
+
* Optional props spread onto the title/subtitle column {@link Box} (excluding `children`, which the component owns).
|
|
17
|
+
*/
|
|
18
|
+
titleColumnProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
19
|
+
/**
|
|
20
|
+
* Optional props spread onto the bottom label {@link BoxRow} (excluding `children`, `endAccessory`, and `textProps`, which the component owns).
|
|
21
|
+
*/
|
|
22
|
+
bottomLabelWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.
|
|
25
|
+
*/
|
|
26
|
+
amountProps?: Omit<Partial<TextProps>, 'children'>;
|
|
27
|
+
/**
|
|
28
|
+
* Optional props merged into {@link BoxRow} `textProps` when `title` is a string.
|
|
29
|
+
*/
|
|
30
|
+
titleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional props merged into {@link BoxRow} `textProps` when `subtitle` is a string.
|
|
33
|
+
*/
|
|
34
|
+
subtitleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
35
|
+
/**
|
|
36
|
+
* Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.
|
|
37
|
+
*/
|
|
38
|
+
bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;
|
|
39
|
+
/**
|
|
40
|
+
* Optional Tailwind class name to apply to the container.
|
|
41
|
+
*/
|
|
42
|
+
twClassName?: string;
|
|
43
|
+
} & Omit<ViewProps, 'children'>;
|
|
44
|
+
//# sourceMappingURL=TitleSubpage.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleSubpage.types.d.cts","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,uCAAuC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CACrB,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,gBAAgB,GAAG,WAAW,CAC5C,CAAC;IACF;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACvD;;OAEG;IACH,uBAAuB,CAAC,EAAE,IAAI,CAC5B,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,cAAc,GAAG,WAAW,CAC1C,CAAC;IACF;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACnD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACrD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { TitleSubpagePropsShared } from "@metamask/design-system-shared";
|
|
2
|
+
import type { ViewProps } from "react-native/index.js";
|
|
3
|
+
import type { BoxProps } from "../Box/Box.types.mjs";
|
|
4
|
+
import type { BoxRowProps } from "../BoxRow/BoxRow.types.mjs";
|
|
5
|
+
import type { TextProps } from "../Text/Text.types.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* TitleSubpage component props (React Native).
|
|
8
|
+
* Extends {@link TitleSubpagePropsShared} (requires `title` and `titleAvatar`) with platform `Text` passthroughs, `twClassName`, and `View` props.
|
|
9
|
+
*/
|
|
10
|
+
export type TitleSubpageProps = TitleSubpagePropsShared & {
|
|
11
|
+
/**
|
|
12
|
+
* Optional props spread onto the identity {@link BoxRow} (excluding `children`, `startAccessory`, and `textProps`, which the component owns).
|
|
13
|
+
*/
|
|
14
|
+
identityRowProps?: Omit<Partial<BoxRowProps>, 'children' | 'startAccessory' | 'textProps'>;
|
|
15
|
+
/**
|
|
16
|
+
* Optional props spread onto the title/subtitle column {@link Box} (excluding `children`, which the component owns).
|
|
17
|
+
*/
|
|
18
|
+
titleColumnProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
19
|
+
/**
|
|
20
|
+
* Optional props spread onto the bottom label {@link BoxRow} (excluding `children`, `endAccessory`, and `textProps`, which the component owns).
|
|
21
|
+
*/
|
|
22
|
+
bottomLabelWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'endAccessory' | 'textProps'>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.
|
|
25
|
+
*/
|
|
26
|
+
amountProps?: Omit<Partial<TextProps>, 'children'>;
|
|
27
|
+
/**
|
|
28
|
+
* Optional props merged into {@link BoxRow} `textProps` when `title` is a string.
|
|
29
|
+
*/
|
|
30
|
+
titleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional props merged into {@link BoxRow} `textProps` when `subtitle` is a string.
|
|
33
|
+
*/
|
|
34
|
+
subtitleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
35
|
+
/**
|
|
36
|
+
* Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.
|
|
37
|
+
*/
|
|
38
|
+
bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;
|
|
39
|
+
/**
|
|
40
|
+
* Optional Tailwind class name to apply to the container.
|
|
41
|
+
*/
|
|
42
|
+
twClassName?: string;
|
|
43
|
+
} & Omit<ViewProps, 'children'>;
|
|
44
|
+
//# sourceMappingURL=TitleSubpage.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleSubpage.types.d.mts","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,uCAAuC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CACrB,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,gBAAgB,GAAG,WAAW,CAC5C,CAAC;IACF;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACvD;;OAEG;IACH,uBAAuB,CAAC,EAAE,IAAI,CAC5B,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,cAAc,GAAG,WAAW,CAC1C,CAAC;IACF;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACnD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACrD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleSubpage.types.mjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleSubpagePropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxProps } from '../Box/Box.types';\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleSubpage component props (React Native).\n * Extends {@link TitleSubpagePropsShared} (requires `title` and `titleAvatar`) with platform `Text` passthroughs, `twClassName`, and `View` props.\n */\nexport type TitleSubpageProps = TitleSubpagePropsShared & {\n /**\n * Optional props spread onto the identity {@link BoxRow} (excluding `children`, `startAccessory`, and `textProps`, which the component owns).\n */\n identityRowProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'startAccessory' | 'textProps'\n >;\n /**\n * Optional props spread onto the title/subtitle column {@link Box} (excluding `children`, which the component owns).\n */\n titleColumnProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props spread onto the bottom label {@link BoxRow} (excluding `children`, `endAccessory`, and `textProps`, which the component owns).\n */\n bottomLabelWrapperProps?: Omit<\n Partial<BoxRowProps>,\n 'children' | 'endAccessory' | 'textProps'\n >;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `amount` is a string.\n */\n amountProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `subtitle` is a string.\n */\n subtitleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into {@link BoxRow} `textProps` when `bottomLabel` is a string.\n */\n bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TitleSubpage = void 0;
|
|
4
|
+
var TitleSubpage_1 = require("./TitleSubpage.cjs");
|
|
5
|
+
Object.defineProperty(exports, "TitleSubpage", { enumerable: true, get: function () { return TitleSubpage_1.TitleSubpage; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAArC,4GAAA,YAAY,OAAA","sourcesContent":["export { TitleSubpage } from './TitleSubpage';\nexport type { TitleSubpageProps } from './TitleSubpage.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TitleSubpage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TitleSubpage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB","sourcesContent":["export { TitleSubpage } from './TitleSubpage';\nexport type { TitleSubpageProps } from './TitleSubpage.types';\n"]}
|
|
@@ -28,7 +28,6 @@ exports.Toast = void 0;
|
|
|
28
28
|
const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
30
|
const react_native_1 = require("react-native/index.js");
|
|
31
|
-
// eslint-disable-next-line import-x/default
|
|
32
31
|
const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
33
32
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
34
33
|
// External dependencies.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,qFAAmE;AACnE,+CAOe;AACf,wDAAgD;AAEhD,4CAA4C;AAC5C,mFAOiC;AACjC,mFAAmE;AAEnE,yBAAyB;AACzB,8DAAoE;AACpE,8DAAoE;AACpE,wDAA2D;AAC3D,8DAAoE;AACpE,gDAAkD;AAClD,wDAA2C;AAC3C,4CAAmE;AAEnE,yBAAyB;AACzB,2DAI2B;AAW3B,mDAA6C;AAE7C,MAAM,YAAY,GAAG,yBAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;AAExC,QAAA,KAAK,GAAG,IAAA,kBAAU,EAC7B,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACvD,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAC9C,SAAS,CACV,CAAC;IACF,MAAM,mBAAmB,GAAG,IAAA,cAAM,EAChC,IAAI,CACL,CAAC;IACF,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,IAAA,kDAAiB,GAAE,CAAC;IAC3D,MAAM,kBAAkB,GAAG,IAAA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from '@metamask/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n isValidElement,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type { LayoutChangeEvent, StyleProp, ViewStyle } from 'react-native';\n// eslint-disable-next-line import-x/default\nimport Animated, {\n cancelAnimation,\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { AvatarAccount, AvatarAccountSize } from '../AvatarAccount';\nimport { AvatarFavicon, AvatarFaviconSize } from '../AvatarFavicon';\nimport { AvatarIcon, AvatarIconSize } from '../AvatarIcon';\nimport { AvatarNetwork, AvatarNetworkSize } from '../AvatarNetwork';\nimport { Button, ButtonVariant } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text, TextVariant, TextColor, FontWeight } from '../Text';\n\n// Internal dependencies.\nimport {\n TOAST_VISIBILITY_DURATION,\n TOAST_ANIMATION_DURATION,\n TOAST_BOTTOM_PADDING,\n} from './Toast.constants';\nimport type {\n ToastCloseButtonIconOptions,\n ToastCloseButtonOptions,\n ToastDescriptionOptions,\n ToastLabelOptions,\n ToastLinkButtonOptions,\n ToastOptions,\n ToastProps,\n ToastRef,\n} from './Toast.types';\nimport { ToastVariant } from './Toast.types';\n\nconst screenHeight = Dimensions.get('window').height;\n\nexport const Toast = forwardRef<ToastRef, ToastProps>(\n ({ twClassName, labelsContainerProps, ...props }, ref) => {\n const tw = useTailwind();\n const [toastOptions, setToastOptions] = useState<ToastOptions | undefined>(\n undefined,\n );\n const replacementTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const { bottom: bottomNotchSpacing } = useSafeAreaInsets();\n const translateYProgress = useSharedValue(screenHeight);\n const bottomOffset = toastOptions?.bottomOffset ?? 0;\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: translateYProgress.value - bottomOffset }],\n }));\n const baseStyle: StyleProp<ViewStyle> = useMemo(\n () => [\n tw.style(\n 'absolute left-4 right-4 bottom-0 bg-background-section border border-border-muted rounded-xl p-3 flex-row items-center',\n twClassName,\n ),\n animatedStyle,\n ],\n [tw, animatedStyle, twClassName],\n );\n\n const resetState = () => setToastOptions(undefined);\n\n const showToast = (options: ToastOptions) => {\n let timeoutDuration = 0;\n if (toastOptions) {\n cancelAnimation(translateYProgress);\n timeoutDuration = 100;\n // Clear existing toast state to prevent animation conflicts when showing rapid successive toasts\n setToastOptions(undefined);\n }\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n }\n replacementTimerRef.current = setTimeout(() => {\n replacementTimerRef.current = null;\n setToastOptions(options);\n }, timeoutDuration);\n };\n\n const closeToast = () => {\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n replacementTimerRef.current = null;\n }\n translateYProgress.value = withTiming(\n screenHeight,\n { duration: TOAST_ANIMATION_DURATION },\n () => {\n runOnJS(resetState)();\n },\n );\n };\n\n useImperativeHandle(ref, () => ({\n showToast,\n closeToast,\n }));\n\n const onAnimatedViewLayout = (e: LayoutChangeEvent) => {\n /* istanbul ignore next - guard only; layout fires when toastOptions is set */\n if (toastOptions) {\n const { height } = e.nativeEvent.layout;\n const translateYToValue = -(TOAST_BOTTOM_PADDING + bottomNotchSpacing);\n\n translateYProgress.value = height;\n\n if (toastOptions.hasNoTimeout) {\n translateYProgress.value = withTiming(translateYToValue, {\n duration: TOAST_ANIMATION_DURATION,\n });\n } else {\n translateYProgress.value = withTiming(\n translateYToValue,\n { duration: TOAST_ANIMATION_DURATION },\n () => {\n translateYProgress.value = withDelay(\n TOAST_VISIBILITY_DURATION,\n withTiming(\n height,\n { duration: TOAST_ANIMATION_DURATION },\n runOnJS(resetState),\n ),\n );\n },\n );\n }\n }\n };\n\n const renderLabel = (labelOptions: ToastLabelOptions) => (\n <Text variant={TextVariant.BodyMd}>\n {labelOptions.map(({ label, isBold }, index) => (\n <Text\n key={`toast-label-${index}`}\n variant={TextVariant.BodyMd}\n fontWeight={isBold ? FontWeight.Bold : undefined}\n color={TextColor.TextDefault}\n >\n {label}\n </Text>\n ))}\n </Text>\n );\n\n const renderDescription = (descriptionOptions?: ToastDescriptionOptions) =>\n descriptionOptions && (\n <Text\n variant={TextVariant.BodySm}\n color={TextColor.TextAlternative}\n style={tw.style('mt-1')}\n >\n {descriptionOptions.description}\n </Text>\n );\n\n const renderActionButton = (linkButtonOptions?: ToastLinkButtonOptions) =>\n linkButtonOptions && (\n <Button\n variant={ButtonVariant.Secondary}\n onPress={linkButtonOptions.onPress}\n style={tw.style('mt-2')}\n >\n {linkButtonOptions.label}\n </Button>\n );\n\n const renderCloseButton = (\n closeButtonOptions?: ToastCloseButtonOptions,\n ) => {\n if (closeButtonOptions && 'iconName' in closeButtonOptions) {\n const iconOptions = closeButtonOptions as ToastCloseButtonIconOptions;\n return (\n <ButtonIcon\n iconName={iconOptions.iconName}\n onPress={(e) => iconOptions.onPress?.(e)}\n size={iconOptions.size}\n isDisabled={iconOptions.isDisabled}\n twClassName={iconOptions.twClassName}\n style={iconOptions.style}\n iconProps={iconOptions.iconProps}\n />\n );\n }\n return (\n <Button\n variant={ButtonVariant.Primary}\n onPress={(e) => closeButtonOptions?.onPress?.(e)}\n startIconName={closeButtonOptions?.startIconName}\n endIconName={closeButtonOptions?.endIconName}\n style={closeButtonOptions?.style}\n >\n {closeButtonOptions?.children}\n </Button>\n );\n };\n\n const renderAvatar = () => {\n switch (toastOptions?.variant) {\n case ToastVariant.Plain:\n return null;\n case ToastVariant.Account: {\n const { accountAddress, accountAvatarType } = toastOptions;\n return (\n <AvatarAccount\n address={accountAddress}\n variant={accountAvatarType}\n size={AvatarAccountSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.Network: {\n const { networkImageSource, networkName } = toastOptions;\n return (\n <AvatarNetwork\n name={networkName}\n src={networkImageSource}\n size={AvatarNetworkSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.App: {\n const { appIconSource } = toastOptions;\n return (\n <AvatarFavicon\n src={appIconSource}\n size={AvatarFaviconSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.Icon: {\n const { iconName, severity } = toastOptions;\n return (\n <AvatarIcon\n iconName={iconName}\n severity={severity}\n size={AvatarIconSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n /* istanbul ignore next - all variants handled above */\n default:\n return null;\n }\n };\n\n const renderToastContent = (options: ToastOptions) => {\n const {\n labelOptions,\n descriptionOptions,\n linkButtonOptions,\n closeButtonOptions,\n startAccessory,\n } = options;\n\n const isStartAccessoryValid =\n startAccessory !== null &&\n startAccessory !== undefined &&\n isValidElement(startAccessory);\n\n return (\n <>\n {isStartAccessoryValid ? startAccessory : renderAvatar()}\n <View\n style={tw.style('flex-1 justify-center')}\n {...labelsContainerProps}\n >\n {renderLabel(labelOptions)}\n {renderDescription(descriptionOptions)}\n {renderActionButton(linkButtonOptions)}\n </View>\n {closeButtonOptions ? renderCloseButton(closeButtonOptions) : null}\n </>\n );\n };\n\n if (!toastOptions) {\n return null;\n }\n\n return (\n <Animated.View\n onLayout={onAnimatedViewLayout}\n style={baseStyle}\n {...props}\n >\n {renderToastContent(toastOptions)}\n </Animated.View>\n );\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"Toast.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,qFAAmE;AACnE,+CAOe;AACf,wDAAgD;AAEhD,mFAOiC;AACjC,mFAAmE;AAEnE,yBAAyB;AACzB,8DAAoE;AACpE,8DAAoE;AACpE,wDAA2D;AAC3D,8DAAoE;AACpE,gDAAkD;AAClD,wDAA2C;AAC3C,4CAAmE;AAEnE,yBAAyB;AACzB,2DAI2B;AAW3B,mDAA6C;AAE7C,MAAM,YAAY,GAAG,yB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AkB,CAAC,CAAC,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CACpE;QAAA,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,iCAAQ,CAAC,IAAI,CACZ,QAAQ,CAAC,CAAC,oBAAoB,CAAC,CAC/B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,kBAAkB,CAAC,YAAY,CAAC,CACnC;MAAA,EAAE,iCAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n isValidElement,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type { LayoutChangeEvent, StyleProp, ViewStyle } from 'react-native';\nimport Animated, {\n cancelAnimation,\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { AvatarAccount, AvatarAccountSize } from '../AvatarAccount';\nimport { AvatarFavicon, AvatarFaviconSize } from '../AvatarFavicon';\nimport { AvatarIcon, AvatarIconSize } from '../AvatarIcon';\nimport { AvatarNetwork, AvatarNetworkSize } from '../AvatarNetwork';\nimport { Button, ButtonVariant } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text, TextVariant, TextColor, FontWeight } from '../Text';\n\n// Internal dependencies.\nimport {\n TOAST_VISIBILITY_DURATION,\n TOAST_ANIMATION_DURATION,\n TOAST_BOTTOM_PADDING,\n} from './Toast.constants';\nimport type {\n ToastCloseButtonIconOptions,\n ToastCloseButtonOptions,\n ToastDescriptionOptions,\n ToastLabelOptions,\n ToastLinkButtonOptions,\n ToastOptions,\n ToastProps,\n ToastRef,\n} from './Toast.types';\nimport { ToastVariant } from './Toast.types';\n\nconst screenHeight = Dimensions.get('window').height;\n\nexport const Toast = forwardRef<ToastRef, ToastProps>(\n ({ twClassName, labelsContainerProps, ...props }, ref) => {\n const tw = useTailwind();\n const [toastOptions, setToastOptions] = useState<ToastOptions | undefined>(\n undefined,\n );\n const replacementTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const { bottom: bottomNotchSpacing } = useSafeAreaInsets();\n const translateYProgress = useSharedValue(screenHeight);\n const bottomOffset = toastOptions?.bottomOffset ?? 0;\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: translateYProgress.value - bottomOffset }],\n }));\n const baseStyle: StyleProp<ViewStyle> = useMemo(\n () => [\n tw.style(\n 'absolute left-4 right-4 bottom-0 bg-background-section border border-border-muted rounded-xl p-3 flex-row items-center',\n twClassName,\n ),\n animatedStyle,\n ],\n [tw, animatedStyle, twClassName],\n );\n\n const resetState = () => setToastOptions(undefined);\n\n const showToast = (options: ToastOptions) => {\n let timeoutDuration = 0;\n if (toastOptions) {\n cancelAnimation(translateYProgress);\n timeoutDuration = 100;\n // Clear existing toast state to prevent animation conflicts when showing rapid successive toasts\n setToastOptions(undefined);\n }\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n }\n replacementTimerRef.current = setTimeout(() => {\n replacementTimerRef.current = null;\n setToastOptions(options);\n }, timeoutDuration);\n };\n\n const closeToast = () => {\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n replacementTimerRef.current = null;\n }\n translateYProgress.value = withTiming(\n screenHeight,\n { duration: TOAST_ANIMATION_DURATION },\n () => {\n runOnJS(resetState)();\n },\n );\n };\n\n useImperativeHandle(ref, () => ({\n showToast,\n closeToast,\n }));\n\n const onAnimatedViewLayout = (e: LayoutChangeEvent) => {\n /* istanbul ignore next - guard only; layout fires when toastOptions is set */\n if (toastOptions) {\n const { height } = e.nativeEvent.layout;\n const translateYToValue = -(TOAST_BOTTOM_PADDING + bottomNotchSpacing);\n\n translateYProgress.value = height;\n\n if (toastOptions.hasNoTimeout) {\n translateYProgress.value = withTiming(translateYToValue, {\n duration: TOAST_ANIMATION_DURATION,\n });\n } else {\n translateYProgress.value = withTiming(\n translateYToValue,\n { duration: TOAST_ANIMATION_DURATION },\n () => {\n translateYProgress.value = withDelay(\n TOAST_VISIBILITY_DURATION,\n withTiming(\n height,\n { duration: TOAST_ANIMATION_DURATION },\n runOnJS(resetState),\n ),\n );\n },\n );\n }\n }\n };\n\n const renderLabel = (labelOptions: ToastLabelOptions) => (\n <Text variant={TextVariant.BodyMd}>\n {labelOptions.map(({ label, isBold }, index) => (\n <Text\n key={`toast-label-${index}`}\n variant={TextVariant.BodyMd}\n fontWeight={isBold ? FontWeight.Bold : undefined}\n color={TextColor.TextDefault}\n >\n {label}\n </Text>\n ))}\n </Text>\n );\n\n const renderDescription = (descriptionOptions?: ToastDescriptionOptions) =>\n descriptionOptions && (\n <Text\n variant={TextVariant.BodySm}\n color={TextColor.TextAlternative}\n style={tw.style('mt-1')}\n >\n {descriptionOptions.description}\n </Text>\n );\n\n const renderActionButton = (linkButtonOptions?: ToastLinkButtonOptions) =>\n linkButtonOptions && (\n <Button\n variant={ButtonVariant.Secondary}\n onPress={linkButtonOptions.onPress}\n style={tw.style('mt-2')}\n >\n {linkButtonOptions.label}\n </Button>\n );\n\n const renderCloseButton = (\n closeButtonOptions?: ToastCloseButtonOptions,\n ) => {\n if (closeButtonOptions && 'iconName' in closeButtonOptions) {\n const iconOptions = closeButtonOptions as ToastCloseButtonIconOptions;\n return (\n <ButtonIcon\n iconName={iconOptions.iconName}\n onPress={(e) => iconOptions.onPress?.(e)}\n size={iconOptions.size}\n isDisabled={iconOptions.isDisabled}\n twClassName={iconOptions.twClassName}\n style={iconOptions.style}\n iconProps={iconOptions.iconProps}\n />\n );\n }\n return (\n <Button\n variant={ButtonVariant.Primary}\n onPress={(e) => closeButtonOptions?.onPress?.(e)}\n startIconName={closeButtonOptions?.startIconName}\n endIconName={closeButtonOptions?.endIconName}\n style={closeButtonOptions?.style}\n >\n {closeButtonOptions?.children}\n </Button>\n );\n };\n\n const renderAvatar = () => {\n switch (toastOptions?.variant) {\n case ToastVariant.Plain:\n return null;\n case ToastVariant.Account: {\n const { accountAddress, accountAvatarType } = toastOptions;\n return (\n <AvatarAccount\n address={accountAddress}\n variant={accountAvatarType}\n size={AvatarAccountSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.Network: {\n const { networkImageSource, networkName } = toastOptions;\n return (\n <AvatarNetwork\n name={networkName}\n src={networkImageSource}\n size={AvatarNetworkSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.App: {\n const { appIconSource } = toastOptions;\n return (\n <AvatarFavicon\n src={appIconSource}\n size={AvatarFaviconSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.Icon: {\n const { iconName, severity } = toastOptions;\n return (\n <AvatarIcon\n iconName={iconName}\n severity={severity}\n size={AvatarIconSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n /* istanbul ignore next - all variants handled above */\n default:\n return null;\n }\n };\n\n const renderToastContent = (options: ToastOptions) => {\n const {\n labelOptions,\n descriptionOptions,\n linkButtonOptions,\n closeButtonOptions,\n startAccessory,\n } = options;\n\n const isStartAccessoryValid =\n startAccessory !== null &&\n startAccessory !== undefined &&\n isValidElement(startAccessory);\n\n return (\n <>\n {isStartAccessoryValid ? startAccessory : renderAvatar()}\n <View\n style={tw.style('flex-1 justify-center')}\n {...labelsContainerProps}\n >\n {renderLabel(labelOptions)}\n {renderDescription(descriptionOptions)}\n {renderActionButton(linkButtonOptions)}\n </View>\n {closeButtonOptions ? renderCloseButton(closeButtonOptions) : null}\n </>\n );\n };\n\n if (!toastOptions) {\n return null;\n }\n\n return (\n <Animated.View\n onLayout={onAnimatedViewLayout}\n style={baseStyle}\n {...props}\n >\n {renderToastContent(toastOptions)}\n </Animated.View>\n );\n },\n);\n"]}
|
|
@@ -2,6 +2,6 @@ import React from "react";
|
|
|
2
2
|
import type { ToastRef } from "./Toast.types.cjs";
|
|
3
3
|
export declare const Toast: React.ForwardRefExoticComponent<{
|
|
4
4
|
twClassName?: string | undefined;
|
|
5
|
-
labelsContainerProps?: Omit<import("react-native").ViewProps, "
|
|
5
|
+
labelsContainerProps?: Omit<import("react-native").ViewProps, "children" | "style"> | undefined;
|
|
6
6
|
} & Omit<import("react-native").ViewProps, "style"> & React.RefAttributes<ToastRef>>;
|
|
7
7
|
//# sourceMappingURL=Toast.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,cAAc;
|
|
1
|
+
{"version":3,"file":"Toast.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,cAAc;AA4Bf,OAAO,KAAK,EAQV,QAAQ,EACT,0BAAsB;AAKvB,eAAO,MAAM,KAAK;;;oFAmQjB,CAAC"}
|
|
@@ -2,6 +2,6 @@ import React from "react";
|
|
|
2
2
|
import type { ToastRef } from "./Toast.types.mjs";
|
|
3
3
|
export declare const Toast: React.ForwardRefExoticComponent<{
|
|
4
4
|
twClassName?: string | undefined;
|
|
5
|
-
labelsContainerProps?: Omit<import("react-native").ViewProps, "
|
|
5
|
+
labelsContainerProps?: Omit<import("react-native").ViewProps, "children" | "style"> | undefined;
|
|
6
6
|
} & Omit<import("react-native").ViewProps, "style"> & React.RefAttributes<ToastRef>>;
|
|
7
7
|
//# sourceMappingURL=Toast.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,cAAc;
|
|
1
|
+
{"version":3,"file":"Toast.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,cAAc;AA4Bf,OAAO,KAAK,EAQV,QAAQ,EACT,0BAAsB;AAKvB,eAAO,MAAM,KAAK;;;oFAmQjB,CAAC"}
|
|
@@ -9,7 +9,6 @@ import { useTailwind } from "@metamask/design-system-twrnc-preset";
|
|
|
9
9
|
import $React, { forwardRef, isValidElement, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
10
10
|
const React = $importDefault($React);
|
|
11
11
|
import { Dimensions, View } from "react-native/index.js";
|
|
12
|
-
// eslint-disable-next-line import-x/default
|
|
13
12
|
import Animated, { cancelAnimation, runOnJS, useAnimatedStyle, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
|
|
14
13
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
15
14
|
// External dependencies.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,QAAO,EACZ,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,EACT,cAAc;;AACf,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,8BAAqB;AAEhD,4CAA4C;AAC5C,OAAO,QAAQ,EAAE,EACf,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,UAAU,EACX,gCAAgC;AACjC,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,yBAAyB;AACzB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,mCAAyB;AACpE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,mCAAyB;AACpE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gCAAsB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AC,uBAAuB,CAAC,CAAC,CACzC,IAAI,oBAAoB,CAAC,CAEzB;YAAA,CAAC,WAAW,CAAC,YAAY,CAAC,CAC1B;YAAA,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CACtC;YAAA,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CACxC;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CACpE;QAAA,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,QAAQ,CAAC,IAAI,CACZ,QAAQ,CAAC,CAAC,oBAAoB,CAAC,CAC/B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,kBAAkB,CAAC,YAAY,CAAC,CACnC;MAAA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n isValidElement,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type { LayoutChangeEvent, StyleProp, ViewStyle } from 'react-native';\n// eslint-disable-next-line import-x/default\nimport Animated, {\n cancelAnimation,\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { AvatarAccount, AvatarAccountSize } from '../AvatarAccount';\nimport { AvatarFavicon, AvatarFaviconSize } from '../AvatarFavicon';\nimport { AvatarIcon, AvatarIconSize } from '../AvatarIcon';\nimport { AvatarNetwork, AvatarNetworkSize } from '../AvatarNetwork';\nimport { Button, ButtonVariant } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text, TextVariant, TextColor, FontWeight } from '../Text';\n\n// Internal dependencies.\nimport {\n TOAST_VISIBILITY_DURATION,\n TOAST_ANIMATION_DURATION,\n TOAST_BOTTOM_PADDING,\n} from './Toast.constants';\nimport type {\n ToastCloseButtonIconOptions,\n ToastCloseButtonOptions,\n ToastDescriptionOptions,\n ToastLabelOptions,\n ToastLinkButtonOptions,\n ToastOptions,\n ToastProps,\n ToastRef,\n} from './Toast.types';\nimport { ToastVariant } from './Toast.types';\n\nconst screenHeight = Dimensions.get('window').height;\n\nexport const Toast = forwardRef<ToastRef, ToastProps>(\n ({ twClassName, labelsContainerProps, ...props }, ref) => {\n const tw = useTailwind();\n const [toastOptions, setToastOptions] = useState<ToastOptions | undefined>(\n undefined,\n );\n const replacementTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const { bottom: bottomNotchSpacing } = useSafeAreaInsets();\n const translateYProgress = useSharedValue(screenHeight);\n const bottomOffset = toastOptions?.bottomOffset ?? 0;\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: translateYProgress.value - bottomOffset }],\n }));\n const baseStyle: StyleProp<ViewStyle> = useMemo(\n () => [\n tw.style(\n 'absolute left-4 right-4 bottom-0 bg-background-section border border-border-muted rounded-xl p-3 flex-row items-center',\n twClassName,\n ),\n animatedStyle,\n ],\n [tw, animatedStyle, twClassName],\n );\n\n const resetState = () => setToastOptions(undefined);\n\n const showToast = (options: ToastOptions) => {\n let timeoutDuration = 0;\n if (toastOptions) {\n cancelAnimation(translateYProgress);\n timeoutDuration = 100;\n // Clear existing toast state to prevent animation conflicts when showing rapid successive toasts\n setToastOptions(undefined);\n }\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n }\n replacementTimerRef.current = setTimeout(() => {\n replacementTimerRef.current = null;\n setToastOptions(options);\n }, timeoutDuration);\n };\n\n const closeToast = () => {\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n replacementTimerRef.current = null;\n }\n translateYProgress.value = withTiming(\n screenHeight,\n { duration: TOAST_ANIMATION_DURATION },\n () => {\n runOnJS(resetState)();\n },\n );\n };\n\n useImperativeHandle(ref, () => ({\n showToast,\n closeToast,\n }));\n\n const onAnimatedViewLayout = (e: LayoutChangeEvent) => {\n /* istanbul ignore next - guard only; layout fires when toastOptions is set */\n if (toastOptions) {\n const { height } = e.nativeEvent.layout;\n const translateYToValue = -(TOAST_BOTTOM_PADDING + bottomNotchSpacing);\n\n translateYProgress.value = height;\n\n if (toastOptions.hasNoTimeout) {\n translateYProgress.value = withTiming(translateYToValue, {\n duration: TOAST_ANIMATION_DURATION,\n });\n } else {\n translateYProgress.value = withTiming(\n translateYToValue,\n { duration: TOAST_ANIMATION_DURATION },\n () => {\n translateYProgress.value = withDelay(\n TOAST_VISIBILITY_DURATION,\n withTiming(\n height,\n { duration: TOAST_ANIMATION_DURATION },\n runOnJS(resetState),\n ),\n );\n },\n );\n }\n }\n };\n\n const renderLabel = (labelOptions: ToastLabelOptions) => (\n <Text variant={TextVariant.BodyMd}>\n {labelOptions.map(({ label, isBold }, index) => (\n <Text\n key={`toast-label-${index}`}\n variant={TextVariant.BodyMd}\n fontWeight={isBold ? FontWeight.Bold : undefined}\n color={TextColor.TextDefault}\n >\n {label}\n </Text>\n ))}\n </Text>\n );\n\n const renderDescription = (descriptionOptions?: ToastDescriptionOptions) =>\n descriptionOptions && (\n <Text\n variant={TextVariant.BodySm}\n color={TextColor.TextAlternative}\n style={tw.style('mt-1')}\n >\n {descriptionOptions.description}\n </Text>\n );\n\n const renderActionButton = (linkButtonOptions?: ToastLinkButtonOptions) =>\n linkButtonOptions && (\n <Button\n variant={ButtonVariant.Secondary}\n onPress={linkButtonOptions.onPress}\n style={tw.style('mt-2')}\n >\n {linkButtonOptions.label}\n </Button>\n );\n\n const renderCloseButton = (\n closeButtonOptions?: ToastCloseButtonOptions,\n ) => {\n if (closeButtonOptions && 'iconName' in closeButtonOptions) {\n const iconOptions = closeButtonOptions as ToastCloseButtonIconOptions;\n return (\n <ButtonIcon\n iconName={iconOptions.iconName}\n onPress={(e) => iconOptions.onPress?.(e)}\n size={iconOptions.size}\n isDisabled={iconOptions.isDisabled}\n twClassName={iconOptions.twClassName}\n style={iconOptions.style}\n iconProps={iconOptions.iconProps}\n />\n );\n }\n return (\n <Button\n variant={ButtonVariant.Primary}\n onPress={(e) => closeButtonOptions?.onPress?.(e)}\n startIconName={closeButtonOptions?.startIconName}\n endIconName={closeButtonOptions?.endIconName}\n style={closeButtonOptions?.style}\n >\n {closeButtonOptions?.children}\n </Button>\n );\n };\n\n const renderAvatar = () => {\n switch (toastOptions?.variant) {\n case ToastVariant.Plain:\n return null;\n case ToastVariant.Account: {\n const { accountAddress, accountAvatarType } = toastOptions;\n return (\n <AvatarAccount\n address={accountAddress}\n variant={accountAvatarType}\n size={AvatarAccountSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.Network: {\n const { networkImageSource, networkName } = toastOptions;\n return (\n <AvatarNetwork\n name={networkName}\n src={networkImageSource}\n size={AvatarNetworkSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.App: {\n const { appIconSource } = toastOptions;\n return (\n <AvatarFavicon\n src={appIconSource}\n size={AvatarFaviconSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.Icon: {\n const { iconName, severity } = toastOptions;\n return (\n <AvatarIcon\n iconName={iconName}\n severity={severity}\n size={AvatarIconSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n /* istanbul ignore next - all variants handled above */\n default:\n return null;\n }\n };\n\n const renderToastContent = (options: ToastOptions) => {\n const {\n labelOptions,\n descriptionOptions,\n linkButtonOptions,\n closeButtonOptions,\n startAccessory,\n } = options;\n\n const isStartAccessoryValid =\n startAccessory !== null &&\n startAccessory !== undefined &&\n isValidElement(startAccessory);\n\n return (\n <>\n {isStartAccessoryValid ? startAccessory : renderAvatar()}\n <View\n style={tw.style('flex-1 justify-center')}\n {...labelsContainerProps}\n >\n {renderLabel(labelOptions)}\n {renderDescription(descriptionOptions)}\n {renderActionButton(linkButtonOptions)}\n </View>\n {closeButtonOptions ? renderCloseButton(closeButtonOptions) : null}\n </>\n );\n };\n\n if (!toastOptions) {\n return null;\n }\n\n return (\n <Animated.View\n onLayout={onAnimatedViewLayout}\n style={baseStyle}\n {...props}\n >\n {renderToastContent(toastOptions)}\n </Animated.View>\n );\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"Toast.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,QAAO,EACZ,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,EACT,cAAc;;AACf,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,8BAAqB;AAEhD,OAAO,QAAQ,EAAE,EACf,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,UAAU,EACX,gCAAgC;AACjC,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,yBAAyB;AACzB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,mCAAyB;AACpE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,mCAAyB;AACpE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gCAAsB;AAC3D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,mCAAyB;AACpE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,4BAAkB;AAClD,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,0BAAgB;AAEnE,yBAAyB;AACzB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACrB,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,CAAC,IAAI,CACpE;QAAA,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,QAAQ,CAAC,IAAI,CACZ,QAAQ,CAAC,CAAC,oBAAoB,CAAC,CAC/B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,kBAAkB,CAAC,YAAY,CAAC,CACnC;MAAA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n isValidElement,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type { LayoutChangeEvent, StyleProp, ViewStyle } from 'react-native';\nimport Animated, {\n cancelAnimation,\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\n// External dependencies.\nimport { AvatarAccount, AvatarAccountSize } from '../AvatarAccount';\nimport { AvatarFavicon, AvatarFaviconSize } from '../AvatarFavicon';\nimport { AvatarIcon, AvatarIconSize } from '../AvatarIcon';\nimport { AvatarNetwork, AvatarNetworkSize } from '../AvatarNetwork';\nimport { Button, ButtonVariant } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text, TextVariant, TextColor, FontWeight } from '../Text';\n\n// Internal dependencies.\nimport {\n TOAST_VISIBILITY_DURATION,\n TOAST_ANIMATION_DURATION,\n TOAST_BOTTOM_PADDING,\n} from './Toast.constants';\nimport type {\n ToastCloseButtonIconOptions,\n ToastCloseButtonOptions,\n ToastDescriptionOptions,\n ToastLabelOptions,\n ToastLinkButtonOptions,\n ToastOptions,\n ToastProps,\n ToastRef,\n} from './Toast.types';\nimport { ToastVariant } from './Toast.types';\n\nconst screenHeight = Dimensions.get('window').height;\n\nexport const Toast = forwardRef<ToastRef, ToastProps>(\n ({ twClassName, labelsContainerProps, ...props }, ref) => {\n const tw = useTailwind();\n const [toastOptions, setToastOptions] = useState<ToastOptions | undefined>(\n undefined,\n );\n const replacementTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const { bottom: bottomNotchSpacing } = useSafeAreaInsets();\n const translateYProgress = useSharedValue(screenHeight);\n const bottomOffset = toastOptions?.bottomOffset ?? 0;\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: translateYProgress.value - bottomOffset }],\n }));\n const baseStyle: StyleProp<ViewStyle> = useMemo(\n () => [\n tw.style(\n 'absolute left-4 right-4 bottom-0 bg-background-section border border-border-muted rounded-xl p-3 flex-row items-center',\n twClassName,\n ),\n animatedStyle,\n ],\n [tw, animatedStyle, twClassName],\n );\n\n const resetState = () => setToastOptions(undefined);\n\n const showToast = (options: ToastOptions) => {\n let timeoutDuration = 0;\n if (toastOptions) {\n cancelAnimation(translateYProgress);\n timeoutDuration = 100;\n // Clear existing toast state to prevent animation conflicts when showing rapid successive toasts\n setToastOptions(undefined);\n }\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n }\n replacementTimerRef.current = setTimeout(() => {\n replacementTimerRef.current = null;\n setToastOptions(options);\n }, timeoutDuration);\n };\n\n const closeToast = () => {\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n replacementTimerRef.current = null;\n }\n translateYProgress.value = withTiming(\n screenHeight,\n { duration: TOAST_ANIMATION_DURATION },\n () => {\n runOnJS(resetState)();\n },\n );\n };\n\n useImperativeHandle(ref, () => ({\n showToast,\n closeToast,\n }));\n\n const onAnimatedViewLayout = (e: LayoutChangeEvent) => {\n /* istanbul ignore next - guard only; layout fires when toastOptions is set */\n if (toastOptions) {\n const { height } = e.nativeEvent.layout;\n const translateYToValue = -(TOAST_BOTTOM_PADDING + bottomNotchSpacing);\n\n translateYProgress.value = height;\n\n if (toastOptions.hasNoTimeout) {\n translateYProgress.value = withTiming(translateYToValue, {\n duration: TOAST_ANIMATION_DURATION,\n });\n } else {\n translateYProgress.value = withTiming(\n translateYToValue,\n { duration: TOAST_ANIMATION_DURATION },\n () => {\n translateYProgress.value = withDelay(\n TOAST_VISIBILITY_DURATION,\n withTiming(\n height,\n { duration: TOAST_ANIMATION_DURATION },\n runOnJS(resetState),\n ),\n );\n },\n );\n }\n }\n };\n\n const renderLabel = (labelOptions: ToastLabelOptions) => (\n <Text variant={TextVariant.BodyMd}>\n {labelOptions.map(({ label, isBold }, index) => (\n <Text\n key={`toast-label-${index}`}\n variant={TextVariant.BodyMd}\n fontWeight={isBold ? FontWeight.Bold : undefined}\n color={TextColor.TextDefault}\n >\n {label}\n </Text>\n ))}\n </Text>\n );\n\n const renderDescription = (descriptionOptions?: ToastDescriptionOptions) =>\n descriptionOptions && (\n <Text\n variant={TextVariant.BodySm}\n color={TextColor.TextAlternative}\n style={tw.style('mt-1')}\n >\n {descriptionOptions.description}\n </Text>\n );\n\n const renderActionButton = (linkButtonOptions?: ToastLinkButtonOptions) =>\n linkButtonOptions && (\n <Button\n variant={ButtonVariant.Secondary}\n onPress={linkButtonOptions.onPress}\n style={tw.style('mt-2')}\n >\n {linkButtonOptions.label}\n </Button>\n );\n\n const renderCloseButton = (\n closeButtonOptions?: ToastCloseButtonOptions,\n ) => {\n if (closeButtonOptions && 'iconName' in closeButtonOptions) {\n const iconOptions = closeButtonOptions as ToastCloseButtonIconOptions;\n return (\n <ButtonIcon\n iconName={iconOptions.iconName}\n onPress={(e) => iconOptions.onPress?.(e)}\n size={iconOptions.size}\n isDisabled={iconOptions.isDisabled}\n twClassName={iconOptions.twClassName}\n style={iconOptions.style}\n iconProps={iconOptions.iconProps}\n />\n );\n }\n return (\n <Button\n variant={ButtonVariant.Primary}\n onPress={(e) => closeButtonOptions?.onPress?.(e)}\n startIconName={closeButtonOptions?.startIconName}\n endIconName={closeButtonOptions?.endIconName}\n style={closeButtonOptions?.style}\n >\n {closeButtonOptions?.children}\n </Button>\n );\n };\n\n const renderAvatar = () => {\n switch (toastOptions?.variant) {\n case ToastVariant.Plain:\n return null;\n case ToastVariant.Account: {\n const { accountAddress, accountAvatarType } = toastOptions;\n return (\n <AvatarAccount\n address={accountAddress}\n variant={accountAvatarType}\n size={AvatarAccountSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.Network: {\n const { networkImageSource, networkName } = toastOptions;\n return (\n <AvatarNetwork\n name={networkName}\n src={networkImageSource}\n size={AvatarNetworkSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.App: {\n const { appIconSource } = toastOptions;\n return (\n <AvatarFavicon\n src={appIconSource}\n size={AvatarFaviconSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n case ToastVariant.Icon: {\n const { iconName, severity } = toastOptions;\n return (\n <AvatarIcon\n iconName={iconName}\n severity={severity}\n size={AvatarIconSize.Md}\n style={tw.style('mr-4')}\n />\n );\n }\n /* istanbul ignore next - all variants handled above */\n default:\n return null;\n }\n };\n\n const renderToastContent = (options: ToastOptions) => {\n const {\n labelOptions,\n descriptionOptions,\n linkButtonOptions,\n closeButtonOptions,\n startAccessory,\n } = options;\n\n const isStartAccessoryValid =\n startAccessory !== null &&\n startAccessory !== undefined &&\n isValidElement(startAccessory);\n\n return (\n <>\n {isStartAccessoryValid ? startAccessory : renderAvatar()}\n <View\n style={tw.style('flex-1 justify-center')}\n {...labelsContainerProps}\n >\n {renderLabel(labelOptions)}\n {renderDescription(descriptionOptions)}\n {renderActionButton(linkButtonOptions)}\n </View>\n {closeButtonOptions ? renderCloseButton(closeButtonOptions) : null}\n </>\n );\n };\n\n if (!toastOptions) {\n return null;\n }\n\n return (\n <Animated.View\n onLayout={onAnimatedViewLayout}\n style={baseStyle}\n {...props}\n >\n {renderToastContent(toastOptions)}\n </Animated.View>\n );\n },\n);\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ButtonBase = exports.ButtonAnimated = exports.Card = exports.BoxColumn = exports.BoxRow = exports.BoxBorderColor = exports.BoxBackgroundColor = exports.BoxJustifyContent = exports.BoxAlignItems = exports.BoxFlexWrap = exports.BoxFlexDirection = exports.Box = exports.Blockies = exports.BottomSheetOverlay = exports.BottomSheetHeaderVariant = exports.BottomSheetHeader = exports.ButtonsAlignment = exports.BottomSheetFooter = exports.BottomSheetDialog = exports.BottomSheet = exports.BannerBase = exports.BadgeWrapperPositionAnchorShape = exports.BadgeWrapperPosition = exports.BadgeWrapper = exports.BadgeStatusSize = exports.BadgeStatusStatus = exports.BadgeStatus = exports.BadgeNetwork = exports.BadgeIcon = exports.BadgeCountSize = exports.BadgeCount = exports.AvatarTokenSize = exports.AvatarToken = exports.AvatarNetworkSize = exports.AvatarNetwork = exports.AvatarIconSize = exports.AvatarIconSeverity = exports.AvatarIcon = exports.AvatarGroupVariant = exports.AvatarGroupSize = exports.AvatarGroup = exports.AvatarFaviconSize = exports.AvatarFavicon = exports.AvatarBaseShape = exports.AvatarBaseSize = exports.AvatarBase = exports.AvatarAccountSize = exports.AvatarAccountVariant = exports.AvatarAccount = exports.ActionListItem = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.BannerAlertSeverity = exports.BannerAlert = exports.Spinner = exports.ImageOrSvg = exports.ButtonFilter = exports.ButtonHeroSize = exports.ButtonHero = exports.ToastContextWrapper = exports.ToastContext = void 0;
|
|
4
|
+
exports.TitleSubpage = exports.TitleStandard = exports.TitleHub = exports.TextOrChildren = exports.TextFieldSearch = exports.TextField = exports.TextVariant = exports.TextColor = exports.FontStyle = exports.FontFamily = exports.FontWeight = exports.Text = exports.TextButton = exports.TabEmptyState = exports.SensitiveTextLength = exports.SensitiveText = exports.Skeleton = exports.MainActionButton = exports.Maskicon = exports.Jazzicon = exports.RadioButton = exports.ListItemVerticalAlignment = exports.ListItem = exports.Label = exports.KeyValueRowVariant = exports.KeyValueRow = exports.KeyValueColumn = exports.Input = exports.IconAlertSeverity = exports.IconAlert = exports.IconSize = exports.IconName = exports.IconColor = exports.Icon = exports.HeaderStandard = exports.HeaderSearchVariant = exports.HeaderSearch = exports.HeaderRoot = exports.HeaderBaseVariant = exports.HeaderBase = exports.Checkbox = exports.ButtonSemanticSeverity = exports.ButtonSemantic = exports.ButtonIconVariant = exports.ButtonIconSize = exports.ButtonIcon = exports.ButtonVariant = exports.ButtonSize = exports.Button = exports.ButtonBaseSize = void 0;
|
|
5
|
+
exports.TagSeverity = exports.Tag = exports.BannerAlertSeverity = exports.BannerAlert = exports.Spinner = exports.ImageOrSvg = exports.ButtonFilter = exports.ButtonHeroSize = exports.ButtonHero = exports.ToastContextWrapper = exports.ToastContext = exports.ToastCloseButtonVariant = exports.ToastVariant = exports.Toast = void 0;
|
|
6
6
|
var ActionListItem_1 = require("./ActionListItem/index.cjs");
|
|
7
7
|
Object.defineProperty(exports, "ActionListItem", { enumerable: true, get: function () { return ActionListItem_1.ActionListItem; } });
|
|
8
8
|
var AvatarAccount_1 = require("./AvatarAccount/index.cjs");
|
|
@@ -153,6 +153,12 @@ var TextFieldSearch_1 = require("./TextFieldSearch/index.cjs");
|
|
|
153
153
|
Object.defineProperty(exports, "TextFieldSearch", { enumerable: true, get: function () { return TextFieldSearch_1.TextFieldSearch; } });
|
|
154
154
|
var TextOrChildren_1 = require("./temp-components/TextOrChildren/index.cjs");
|
|
155
155
|
Object.defineProperty(exports, "TextOrChildren", { enumerable: true, get: function () { return TextOrChildren_1.TextOrChildren; } });
|
|
156
|
+
var TitleHub_1 = require("./TitleHub/index.cjs");
|
|
157
|
+
Object.defineProperty(exports, "TitleHub", { enumerable: true, get: function () { return TitleHub_1.TitleHub; } });
|
|
158
|
+
var TitleStandard_1 = require("./TitleStandard/index.cjs");
|
|
159
|
+
Object.defineProperty(exports, "TitleStandard", { enumerable: true, get: function () { return TitleStandard_1.TitleStandard; } });
|
|
160
|
+
var TitleSubpage_1 = require("./TitleSubpage/index.cjs");
|
|
161
|
+
Object.defineProperty(exports, "TitleSubpage", { enumerable: true, get: function () { return TitleSubpage_1.TitleSubpage; } });
|
|
156
162
|
var Toast_1 = require("./Toast/index.cjs");
|
|
157
163
|
Object.defineProperty(exports, "Toast", { enumerable: true, get: function () { return Toast_1.Toast; } });
|
|
158
164
|
Object.defineProperty(exports, "ToastVariant", { enumerable: true, get: function () { return Toast_1.ToastVariant; } });
|
|
@@ -171,4 +177,7 @@ Object.defineProperty(exports, "Spinner", { enumerable: true, get: function () {
|
|
|
171
177
|
var BannerAlert_1 = require("./BannerAlert/index.cjs");
|
|
172
178
|
Object.defineProperty(exports, "BannerAlert", { enumerable: true, get: function () { return BannerAlert_1.BannerAlert; } });
|
|
173
179
|
Object.defineProperty(exports, "BannerAlertSeverity", { enumerable: true, get: function () { return BannerAlert_1.BannerAlertSeverity; } });
|
|
180
|
+
var Tag_1 = require("./Tag/index.cjs");
|
|
181
|
+
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return Tag_1.Tag; } });
|
|
182
|
+
Object.defineProperty(exports, "TagSeverity", { enumerable: true, get: function () { return Tag_1.TagSeverity; } });
|
|
174
183
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;;AAAA,6DAAkD;AAAzC,gHAAA,cAAc,OAAA;AAGvB,2DAIyB;AAHvB,8GAAA,aAAa,OAAA;AACb,qHAAA,oBAAoB,OAAA;AACpB,kHAAA,iBAAiB,OAAA;AAInB,qDAA2E;AAAlE,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AAAE,6GAAA,eAAe,OAAA;AAGpD,2DAAmE;AAA1D,8GAAA,aAAa,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAGzC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AAGpB,iEAAsD;AAA7C,oGAAA,QAAQ,OAAA;AAGjB,iEAAsD;AAA7C,oGAAA,QAAQ,OAAA;AAGjB,iEAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AAGzB,iDAAsC;AAA7B,oGAAA,QAAQ,OAAA;AAGjB,2DAAqE;AAA5D,8GAAA,aAAa,OAAA;AAAE,oHAAA,mBAAmB,OAAA;AAG3C,2DAAgD;AAAvC,8GAAA,aAAa,OAAA;AAGtB,qDAA0C;AAAjC,wGAAA,UAAU,OAAA;AAGnB,yCAOgB;AANd,4FAAA,IAAI,OAAA;AACJ,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,iGAAA,SAAS,OAAA;AACT,mGAAA,WAAW,OAAA;AAIb,mDAAwC;AAA/B,sGAAA,SAAS,OAAA;AAGlB,+DAAoD;AAA3C,kHAAA,eAAe,OAAA;AAGxB,6EAAkE;AAAzD,gHAAA,cAAc,OAAA;AAGvB,2CAMiB;AALf,8FAAA,KAAK,OAAA;AACL,qGAAA,YAAY,OAAA;AACZ,gHAAA,uBAAuB,OAAA;AACvB,qGAAA,YAAY,OAAA;AACZ,4GAAA,mBAAmB,OAAA;AAarB,qDAA0D;AAAjD,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AAGnC,yDAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,qEAA0D;AAAjD,wGAAA,UAAU,OAAA;AAMnB,+DAAoD;AAA3C,kGAAA,OAAO,OAAA;AAGhB,uDAAiE;AAAxD,0GAAA,WAAW,OAAA;AAAE,kHAAA,mBAAmB,OAAA","sourcesContent":["export { ActionListItem } from './ActionListItem';\nexport type { ActionListItemProps } from './ActionListItem';\n\nexport {\n AvatarAccount,\n AvatarAccountVariant,\n AvatarAccountSize,\n} from './AvatarAccount';\nexport type { AvatarAccountProps } from './AvatarAccount';\n\nexport { AvatarBase, AvatarBaseSize, AvatarBaseShape } from './AvatarBase';\nexport type { AvatarBaseProps } from './AvatarBase';\n\nexport { AvatarFavicon, AvatarFaviconSize } from './AvatarFavicon';\nexport type { AvatarFaviconProps } from './AvatarFavicon';\n\nexport {\n AvatarGroup,\n AvatarGroupSize,\n AvatarGroupVariant,\n} from './AvatarGroup';\nexport type { AvatarGroupProps } from './AvatarGroup';\n\nexport { AvatarIcon, AvatarIconSeverity, AvatarIconSize } from './AvatarIcon';\nexport type { AvatarIconProps } from './AvatarIcon';\n\nexport { AvatarNetwork, AvatarNetworkSize } from './AvatarNetwork';\nexport type { AvatarNetworkProps } from './AvatarNetwork';\n\nexport { AvatarToken, AvatarTokenSize } from './AvatarToken';\nexport type { AvatarTokenProps } from './AvatarToken';\n\nexport { BadgeCount, BadgeCountSize } from './BadgeCount';\nexport type { BadgeCountProps } from './BadgeCount';\n\nexport { BadgeIcon } from './BadgeIcon';\nexport type { BadgeIconProps } from './BadgeIcon';\n\nexport { BadgeNetwork } from './BadgeNetwork';\nexport type { BadgeNetworkProps } from './BadgeNetwork';\n\nexport { BadgeStatus, BadgeStatusStatus, BadgeStatusSize } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus';\n\nexport {\n BadgeWrapper,\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from './BadgeWrapper';\nexport type {\n BadgeWrapperProps,\n BadgeWrapperCustomPosition,\n} from './BadgeWrapper';\n\nexport { BannerBase } from './BannerBase';\nexport type { BannerBaseProps } from './BannerBase';\n\nexport { BottomSheet } from './BottomSheet';\nexport type {\n BottomSheetProps,\n BottomSheetRef,\n BottomSheetPostCallback,\n} from './BottomSheet';\n\nexport { BottomSheetDialog } from './BottomSheetDialog';\nexport type {\n BottomSheetDialogProps,\n BottomSheetDialogRef,\n} from './BottomSheetDialog';\n\nexport { BottomSheetFooter, ButtonsAlignment } from './BottomSheetFooter';\nexport type {\n BottomSheetFooterProps,\n BottomSheetFooterButtonProps,\n} from './BottomSheetFooter';\n\nexport {\n BottomSheetHeader,\n BottomSheetHeaderVariant,\n} from './BottomSheetHeader';\nexport type { BottomSheetHeaderProps } from './BottomSheetHeader';\n\nexport { BottomSheetOverlay } from './BottomSheetOverlay';\nexport type { BottomSheetOverlayProps } from './BottomSheetOverlay';\n\nexport { Blockies } from './temp-components/Blockies';\nexport type { BlockiesProps } from './temp-components/Blockies';\n\nexport {\n Box,\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from './Box';\nexport type { BoxProps, BoxSpacing, BoxBorderWidth } from './Box';\n\nexport { BoxRow } from './BoxRow';\nexport type { BoxRowProps } from './BoxRow';\n\nexport { BoxColumn } from './BoxColumn';\nexport type { BoxColumnProps } from './BoxColumn';\n\nexport { Card } from './Card';\nexport type { CardProps } from './Card';\n\nexport { ButtonAnimated } from './temp-components/ButtonAnimated';\nexport type { ButtonAnimatedProps } from './temp-components/ButtonAnimated';\n\nexport { ButtonBase, ButtonBaseSize } from './ButtonBase';\nexport type { ButtonBaseProps } from './ButtonBase';\n\nexport { Button, ButtonSize, ButtonVariant } from './Button';\nexport type { ButtonProps } from './Button';\n\nexport { ButtonIcon, ButtonIconSize, ButtonIconVariant } from './ButtonIcon';\nexport type { ButtonIconProps } from './ButtonIcon';\n\nexport { ButtonSemantic, ButtonSemanticSeverity } from './ButtonSemantic';\nexport type { ButtonSemanticProps } from './ButtonSemantic';\n\nexport { Checkbox } from './Checkbox';\nexport type { CheckboxProps } from './Checkbox';\n\nexport { HeaderBase, HeaderBaseVariant } from './HeaderBase';\nexport type { HeaderBaseProps } from './HeaderBase';\n\nexport { HeaderRoot } from './HeaderRoot';\nexport type { HeaderRootProps } from './HeaderRoot';\n\nexport { HeaderSearch, HeaderSearchVariant } from './HeaderSearch';\nexport type {\n HeaderSearchProps,\n HeaderSearchScreenProps,\n HeaderSearchInlineProps,\n} from './HeaderSearch';\n\nexport { HeaderStandard } from './HeaderStandard';\nexport type { HeaderStandardProps } from './HeaderStandard';\n\nexport { Icon, IconColor, IconName, IconSize } from './Icon';\nexport type { IconProps } from './Icon';\n\nexport { IconAlert, IconAlertSeverity } from './IconAlert';\nexport type { IconAlertProps } from './IconAlert';\n\nexport { Input } from './Input';\nexport type { InputProps } from './Input';\n\nexport { KeyValueColumn } from './KeyValueColumn';\nexport type { KeyValueColumnProps } from './KeyValueColumn';\n\nexport { KeyValueRow, KeyValueRowVariant } from './KeyValueRow';\nexport type { KeyValueRowProps } from './KeyValueRow';\n\nexport { Label } from './Label';\nexport type { LabelProps } from './Label';\n\nexport { ListItem, ListItemVerticalAlignment } from './ListItem';\nexport type { ListItemProps } from './ListItem';\n\nexport { RadioButton } from './RadioButton';\nexport type { RadioButtonProps } from './RadioButton';\n\nexport { Jazzicon } from './temp-components/Jazzicon';\nexport type { JazziconProps } from './temp-components/Jazzicon';\n\nexport { Maskicon } from './temp-components/Maskicon';\nexport type { MaskiconProps } from './temp-components/Maskicon';\n\nexport { MainActionButton } from './MainActionButton';\nexport type { MainActionButtonProps } from './MainActionButton';\n\nexport { Skeleton } from './Skeleton';\nexport type { SkeletonProps } from './Skeleton';\n\nexport { SensitiveText, SensitiveTextLength } from './SensitiveText';\nexport type { SensitiveTextProps } from './SensitiveText';\n\nexport { TabEmptyState } from './TabEmptyState';\nexport type { TabEmptyStateProps } from './TabEmptyState';\n\nexport { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton';\n\nexport {\n Text,\n FontWeight,\n FontFamily,\n FontStyle,\n TextColor,\n TextVariant,\n} from './Text';\nexport type { TextProps } from './Text';\n\nexport { TextField } from './TextField';\nexport type { TextFieldProps } from './TextField';\n\nexport { TextFieldSearch } from './TextFieldSearch';\nexport type { TextFieldSearchProps } from './TextFieldSearch';\n\nexport { TextOrChildren } from './temp-components/TextOrChildren';\nexport type { TextOrChildrenProps } from './temp-components/TextOrChildren';\n\nexport {\n Toast,\n ToastVariant,\n ToastCloseButtonVariant,\n ToastContext,\n ToastContextWrapper,\n} from './Toast';\nexport type {\n ToastOptions,\n ToastProps,\n ToastRef,\n ToastContextParams,\n ToastLabelOptions,\n ToastDescriptionOptions,\n ToastLinkButtonOptions,\n ToastCloseButtonOptions,\n} from './Toast';\n\nexport { ButtonHero, ButtonHeroSize } from './ButtonHero';\nexport type { ButtonHeroProps } from './ButtonHero';\n\nexport { ButtonFilter } from './ButtonFilter';\nexport type { ButtonFilterProps } from './ButtonFilter';\n\nexport { ImageOrSvg } from './temp-components/ImageOrSvg';\nexport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from './temp-components/ImageOrSvg';\n\nexport { Spinner } from './temp-components/Spinner';\nexport type { SpinnerProps } from './temp-components/Spinner';\n\nexport { BannerAlert, BannerAlertSeverity } from './BannerAlert';\nexport type { BannerAlertProps } from './BannerAlert';\n"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;;AAAA,6DAAkD;AAAzC,gHAAA,cAAc,OAAA;AAGvB,2DAIyB;AAHvB,8GAAA,aAAa,OAAA;AACb,qHAAA,oBAAoB,OAAA;AACpB,kHAAA,iBAAiB,OAAA;AAInB,qDAA2E;AAAlE,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AAAE,6GAAA,eAAe,OAAA;AAGpD,2DAAmE;AAA1D,8GAAA,aAAa,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAGzC,uDAIuB;AAHrB,0GAAA,WAAW,OAAA;AACX,8GAAA,eAAe,OAAA;AACf,iHAAA,kBAAkB,OAAA;AAIpB,qDAA8E;AAArE,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAAE,4GAAA,cAAc,OAAA;AAGvD,2DAAmE;AAA1D,8GAAA,aAAa,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAGzC,uDAA6D;AAApD,0GAAA,WAAW,OAAA;AAAE,8GAAA,eAAe,OAAA;AAGrC,qDAA0D;AAAjD,wGAAA,UA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4FAAA,IAAI,OAAA;AACJ,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,iGAAA,SAAS,OAAA;AACT,mGAAA,WAAW,OAAA;AAIb,mDAAwC;AAA/B,sGAAA,SAAS,OAAA;AAGlB,+DAAoD;AAA3C,kHAAA,eAAe,OAAA;AAGxB,6EAAkE;AAAzD,gHAAA,cAAc,OAAA;AAGvB,iDAAsC;AAA7B,oGAAA,QAAQ,OAAA;AAGjB,2DAAgD;AAAvC,8GAAA,aAAa,OAAA;AAGtB,yDAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,2CAMiB;AALf,8FAAA,KAAK,OAAA;AACL,qGAAA,YAAY,OAAA;AACZ,gHAAA,uBAAuB,OAAA;AACvB,qGAAA,YAAY,OAAA;AACZ,4GAAA,mBAAmB,OAAA;AAarB,qDAA0D;AAAjD,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AAGnC,yDAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,qEAA0D;AAAjD,wGAAA,UAAU,OAAA;AAMnB,+DAAoD;AAA3C,kGAAA,OAAO,OAAA;AAGhB,uDAAiE;AAAxD,0GAAA,WAAW,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAGzC,uCAAyC;AAAhC,0FAAA,GAAG,OAAA;AAAE,kGAAA,WAAW,OAAA","sourcesContent":["export { ActionListItem } from './ActionListItem';\nexport type { ActionListItemProps } from './ActionListItem';\n\nexport {\n AvatarAccount,\n AvatarAccountVariant,\n AvatarAccountSize,\n} from './AvatarAccount';\nexport type { AvatarAccountProps } from './AvatarAccount';\n\nexport { AvatarBase, AvatarBaseSize, AvatarBaseShape } from './AvatarBase';\nexport type { AvatarBaseProps } from './AvatarBase';\n\nexport { AvatarFavicon, AvatarFaviconSize } from './AvatarFavicon';\nexport type { AvatarFaviconProps } from './AvatarFavicon';\n\nexport {\n AvatarGroup,\n AvatarGroupSize,\n AvatarGroupVariant,\n} from './AvatarGroup';\nexport type { AvatarGroupProps } from './AvatarGroup';\n\nexport { AvatarIcon, AvatarIconSeverity, AvatarIconSize } from './AvatarIcon';\nexport type { AvatarIconProps } from './AvatarIcon';\n\nexport { AvatarNetwork, AvatarNetworkSize } from './AvatarNetwork';\nexport type { AvatarNetworkProps } from './AvatarNetwork';\n\nexport { AvatarToken, AvatarTokenSize } from './AvatarToken';\nexport type { AvatarTokenProps } from './AvatarToken';\n\nexport { BadgeCount, BadgeCountSize } from './BadgeCount';\nexport type { BadgeCountProps } from './BadgeCount';\n\nexport { BadgeIcon } from './BadgeIcon';\nexport type { BadgeIconProps } from './BadgeIcon';\n\nexport { BadgeNetwork } from './BadgeNetwork';\nexport type { BadgeNetworkProps } from './BadgeNetwork';\n\nexport { BadgeStatus, BadgeStatusStatus, BadgeStatusSize } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus';\n\nexport {\n BadgeWrapper,\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from './BadgeWrapper';\nexport type {\n BadgeWrapperProps,\n BadgeWrapperCustomPosition,\n} from './BadgeWrapper';\n\nexport { BannerBase } from './BannerBase';\nexport type { BannerBaseProps } from './BannerBase';\n\nexport { BottomSheet } from './BottomSheet';\nexport type {\n BottomSheetProps,\n BottomSheetRef,\n BottomSheetPostCallback,\n} from './BottomSheet';\n\nexport { BottomSheetDialog } from './BottomSheetDialog';\nexport type {\n BottomSheetDialogProps,\n BottomSheetDialogRef,\n} from './BottomSheetDialog';\n\nexport { BottomSheetFooter, ButtonsAlignment } from './BottomSheetFooter';\nexport type {\n BottomSheetFooterProps,\n BottomSheetFooterButtonProps,\n} from './BottomSheetFooter';\n\nexport {\n BottomSheetHeader,\n BottomSheetHeaderVariant,\n} from './BottomSheetHeader';\nexport type { BottomSheetHeaderProps } from './BottomSheetHeader';\n\nexport { BottomSheetOverlay } from './BottomSheetOverlay';\nexport type { BottomSheetOverlayProps } from './BottomSheetOverlay';\n\nexport { Blockies } from './temp-components/Blockies';\nexport type { BlockiesProps } from './temp-components/Blockies';\n\nexport {\n Box,\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n BoxBackgroundColor,\n BoxBorderColor,\n} from './Box';\nexport type { BoxProps, BoxSpacing, BoxBorderWidth } from './Box';\n\nexport { BoxRow } from './BoxRow';\nexport type { BoxRowProps } from './BoxRow';\n\nexport { BoxColumn } from './BoxColumn';\nexport type { BoxColumnProps } from './BoxColumn';\n\nexport { Card } from './Card';\nexport type { CardProps } from './Card';\n\nexport { ButtonAnimated } from './temp-components/ButtonAnimated';\nexport type { ButtonAnimatedProps } from './temp-components/ButtonAnimated';\n\nexport { ButtonBase, ButtonBaseSize } from './ButtonBase';\nexport type { ButtonBaseProps } from './ButtonBase';\n\nexport { Button, ButtonSize, ButtonVariant } from './Button';\nexport type { ButtonProps } from './Button';\n\nexport { ButtonIcon, ButtonIconSize, ButtonIconVariant } from './ButtonIcon';\nexport type { ButtonIconProps } from './ButtonIcon';\n\nexport { ButtonSemantic, ButtonSemanticSeverity } from './ButtonSemantic';\nexport type { ButtonSemanticProps } from './ButtonSemantic';\n\nexport { Checkbox } from './Checkbox';\nexport type { CheckboxProps } from './Checkbox';\n\nexport { HeaderBase, HeaderBaseVariant } from './HeaderBase';\nexport type { HeaderBaseProps } from './HeaderBase';\n\nexport { HeaderRoot } from './HeaderRoot';\nexport type { HeaderRootProps } from './HeaderRoot';\n\nexport { HeaderSearch, HeaderSearchVariant } from './HeaderSearch';\nexport type {\n HeaderSearchProps,\n HeaderSearchScreenProps,\n HeaderSearchInlineProps,\n} from './HeaderSearch';\n\nexport { HeaderStandard } from './HeaderStandard';\nexport type { HeaderStandardProps } from './HeaderStandard';\n\nexport { Icon, IconColor, IconName, IconSize } from './Icon';\nexport type { IconProps } from './Icon';\n\nexport { IconAlert, IconAlertSeverity } from './IconAlert';\nexport type { IconAlertProps } from './IconAlert';\n\nexport { Input } from './Input';\nexport type { InputProps } from './Input';\n\nexport { KeyValueColumn } from './KeyValueColumn';\nexport type { KeyValueColumnProps } from './KeyValueColumn';\n\nexport { KeyValueRow, KeyValueRowVariant } from './KeyValueRow';\nexport type { KeyValueRowProps } from './KeyValueRow';\n\nexport { Label } from './Label';\nexport type { LabelProps } from './Label';\n\nexport { ListItem, ListItemVerticalAlignment } from './ListItem';\nexport type { ListItemProps } from './ListItem';\n\nexport { RadioButton } from './RadioButton';\nexport type { RadioButtonProps } from './RadioButton';\n\nexport { Jazzicon } from './temp-components/Jazzicon';\nexport type { JazziconProps } from './temp-components/Jazzicon';\n\nexport { Maskicon } from './temp-components/Maskicon';\nexport type { MaskiconProps } from './temp-components/Maskicon';\n\nexport { MainActionButton } from './MainActionButton';\nexport type { MainActionButtonProps } from './MainActionButton';\n\nexport { Skeleton } from './Skeleton';\nexport type { SkeletonProps } from './Skeleton';\n\nexport { SensitiveText, SensitiveTextLength } from './SensitiveText';\nexport type { SensitiveTextProps } from './SensitiveText';\n\nexport { TabEmptyState } from './TabEmptyState';\nexport type { TabEmptyStateProps } from './TabEmptyState';\n\nexport { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton';\n\nexport {\n Text,\n FontWeight,\n FontFamily,\n FontStyle,\n TextColor,\n TextVariant,\n} from './Text';\nexport type { TextProps } from './Text';\n\nexport { TextField } from './TextField';\nexport type { TextFieldProps } from './TextField';\n\nexport { TextFieldSearch } from './TextFieldSearch';\nexport type { TextFieldSearchProps } from './TextFieldSearch';\n\nexport { TextOrChildren } from './temp-components/TextOrChildren';\nexport type { TextOrChildrenProps } from './temp-components/TextOrChildren';\n\nexport { TitleHub } from './TitleHub';\nexport type { TitleHubProps, TitleHubPropsShared } from './TitleHub';\n\nexport { TitleStandard } from './TitleStandard';\nexport type { TitleStandardProps } from './TitleStandard';\n\nexport { TitleSubpage } from './TitleSubpage';\nexport type { TitleSubpageProps } from './TitleSubpage';\n\nexport {\n Toast,\n ToastVariant,\n ToastCloseButtonVariant,\n ToastContext,\n ToastContextWrapper,\n} from './Toast';\nexport type {\n ToastOptions,\n ToastProps,\n ToastRef,\n ToastContextParams,\n ToastLabelOptions,\n ToastDescriptionOptions,\n ToastLinkButtonOptions,\n ToastCloseButtonOptions,\n} from './Toast';\n\nexport { ButtonHero, ButtonHeroSize } from './ButtonHero';\nexport type { ButtonHeroProps } from './ButtonHero';\n\nexport { ButtonFilter } from './ButtonFilter';\nexport type { ButtonFilterProps } from './ButtonFilter';\n\nexport { ImageOrSvg } from './temp-components/ImageOrSvg';\nexport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from './temp-components/ImageOrSvg';\n\nexport { Spinner } from './temp-components/Spinner';\nexport type { SpinnerProps } from './temp-components/Spinner';\n\nexport { BannerAlert, BannerAlertSeverity } from './BannerAlert';\nexport type { BannerAlertProps } from './BannerAlert';\n\nexport { Tag, TagSeverity } from './Tag';\nexport type { TagProps } from './Tag';\n"]}
|