@metamask-previews/design-system-react-native 0.30.2-preview.f77a5d5 → 0.32.0-preview.cf8aa2e4
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 +31 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +5 -6
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +6 -7
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
- package/dist/components/ButtonSemantic/index.cjs +3 -1
- package/dist/components/ButtonSemantic/index.cjs.map +1 -1
- package/dist/components/ButtonSemantic/index.d.cts +1 -0
- package/dist/components/ButtonSemantic/index.d.cts.map +1 -1
- package/dist/components/ButtonSemantic/index.d.mts +1 -0
- package/dist/components/ButtonSemantic/index.d.mts.map +1 -1
- package/dist/components/ButtonSemantic/index.mjs +1 -0
- package/dist/components/ButtonSemantic/index.mjs.map +1 -1
- package/dist/components/FilterButton/FilterButton.cjs +1 -1
- package/dist/components/FilterButton/FilterButton.cjs.map +1 -1
- package/dist/components/FilterButton/FilterButton.mjs +2 -2
- package/dist/components/FilterButton/FilterButton.mjs.map +1 -1
- package/dist/components/FilterButton/index.cjs +2 -1
- package/dist/components/FilterButton/index.cjs.map +1 -1
- package/dist/components/FilterButton/index.d.cts +1 -1
- package/dist/components/FilterButton/index.d.cts.map +1 -1
- package/dist/components/FilterButton/index.d.mts +1 -1
- package/dist/components/FilterButton/index.d.mts.map +1 -1
- package/dist/components/FilterButton/index.mjs +1 -1
- package/dist/components/FilterButton/index.mjs.map +1 -1
- package/dist/components/Icon/Icon.assets.cjs +2 -0
- package/dist/components/Icon/Icon.assets.cjs.map +1 -1
- package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
- package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
- package/dist/components/Icon/Icon.assets.mjs +2 -0
- package/dist/components/Icon/Icon.assets.mjs.map +1 -1
- package/dist/components/Icon/assets/hard-drive.svg +1 -0
- package/dist/components/SectionHeader/SectionHeader.cjs +25 -14
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.cts +3 -3
- package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.mts +3 -3
- package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.mjs +25 -14
- package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.constants.cjs +3 -3
- package/dist/components/SegmentedControl/SegmentedControl.constants.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.constants.d.cts +3 -3
- package/dist/components/SegmentedControl/SegmentedControl.constants.d.cts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.constants.d.mts +3 -3
- package/dist/components/SegmentedControl/SegmentedControl.constants.d.mts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.constants.mjs +4 -4
- package/dist/components/SegmentedControl/SegmentedControl.constants.mjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +2 -2
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/SegmentedControl/index.cjs +3 -1
- package/dist/components/SegmentedControl/index.cjs.map +1 -1
- package/dist/components/SegmentedControl/index.d.cts +1 -0
- package/dist/components/SegmentedControl/index.d.cts.map +1 -1
- package/dist/components/SegmentedControl/index.d.mts +1 -0
- package/dist/components/SegmentedControl/index.d.mts.map +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -0
- package/dist/components/SegmentedControl/index.mjs.map +1 -1
- package/dist/components/Toast/Toast.constants.cjs +14 -2
- package/dist/components/Toast/Toast.constants.cjs.map +1 -1
- package/dist/components/Toast/Toast.constants.d.cts +11 -1
- package/dist/components/Toast/Toast.constants.d.cts.map +1 -1
- package/dist/components/Toast/Toast.constants.d.mts +11 -1
- package/dist/components/Toast/Toast.constants.d.mts.map +1 -1
- package/dist/components/Toast/Toast.constants.mjs +13 -1
- package/dist/components/Toast/Toast.constants.mjs.map +1 -1
- package/dist/components/Toast/Toast.types.cjs.map +1 -1
- package/dist/components/Toast/Toast.types.d.cts +1 -1
- package/dist/components/Toast/Toast.types.d.cts.map +1 -1
- package/dist/components/Toast/Toast.types.d.mts +1 -1
- package/dist/components/Toast/Toast.types.d.mts.map +1 -1
- package/dist/components/Toast/Toast.types.mjs.map +1 -1
- package/dist/components/Toast/Toaster.cjs +17 -19
- package/dist/components/Toast/Toaster.cjs.map +1 -1
- package/dist/components/Toast/Toaster.d.cts.map +1 -1
- package/dist/components/Toast/Toaster.d.mts.map +1 -1
- package/dist/components/Toast/Toaster.mjs +19 -21
- package/dist/components/Toast/Toaster.mjs.map +1 -1
- package/dist/components/Toast/index.cjs +2 -2
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts +1 -1
- package/dist/components/Toast/index.d.cts.map +1 -1
- package/dist/components/Toast/index.d.mts +1 -1
- package/dist/components/Toast/index.d.mts.map +1 -1
- package/dist/components/Toast/index.mjs +1 -1
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/index.cjs +5 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +3 -3
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +3 -3
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +3 -3
- package/dist/components/index.mjs.map +1 -1
- package/package.json +9 -10
|
@@ -7,15 +7,15 @@ import type { SectionHeaderProps } from "./SectionHeader.types.mjs";
|
|
|
7
7
|
*
|
|
8
8
|
* @param sectionHeaderProps - Component props
|
|
9
9
|
* @param sectionHeaderProps.title - Title content for the inner row (required)
|
|
10
|
-
* @param sectionHeaderProps.titleAccessory - Optional
|
|
11
|
-
* @param sectionHeaderProps.children - Optional content below the
|
|
10
|
+
* @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)
|
|
11
|
+
* @param sectionHeaderProps.children - Optional full-width content below the header row
|
|
12
12
|
* @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
|
|
13
13
|
* @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
|
|
14
14
|
* @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
|
|
15
15
|
* @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
|
|
16
16
|
* @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
|
|
17
17
|
* @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved
|
|
18
|
-
* @param sectionHeaderProps.endIconName - Optional end icon; takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided
|
|
18
|
+
* @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided
|
|
19
19
|
* @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`
|
|
20
20
|
* @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press
|
|
21
21
|
* @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"SectionHeader.d.mts","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuJtD,CAAC"}
|
|
@@ -19,15 +19,15 @@ import { Icon } from "../Icon/index.mjs";
|
|
|
19
19
|
*
|
|
20
20
|
* @param sectionHeaderProps - Component props
|
|
21
21
|
* @param sectionHeaderProps.title - Title content for the inner row (required)
|
|
22
|
-
* @param sectionHeaderProps.titleAccessory - Optional
|
|
23
|
-
* @param sectionHeaderProps.children - Optional content below the
|
|
22
|
+
* @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)
|
|
23
|
+
* @param sectionHeaderProps.children - Optional full-width content below the header row
|
|
24
24
|
* @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string
|
|
25
25
|
* @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`
|
|
26
26
|
* @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved
|
|
27
27
|
* @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set
|
|
28
28
|
* @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)
|
|
29
29
|
* @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved
|
|
30
|
-
* @param sectionHeaderProps.endIconName - Optional end icon; takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided
|
|
30
|
+
* @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided
|
|
31
31
|
* @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`
|
|
32
32
|
* @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press
|
|
33
33
|
* @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)
|
|
@@ -40,20 +40,27 @@ export const SectionHeader = (sectionHeaderProps) => {
|
|
|
40
40
|
const tw = useTailwind();
|
|
41
41
|
const resolvedEndIconName = endIconName ??
|
|
42
42
|
(isInteractive && !endAccessory ? IconName.ArrowRight : undefined);
|
|
43
|
-
const resolvedStartAccessory = startIconName ? (<Icon size={IconSize.
|
|
44
|
-
const resolvedEndAccessory = resolvedEndIconName ? (<Icon size={IconSize.
|
|
45
|
-
const
|
|
43
|
+
const resolvedStartAccessory = startIconName ? (<Icon size={IconSize.Sm} color={IconColor.IconDefault} twClassName="shrink-0" {...startIconProps} name={startIconName}/>) : (startAccessory);
|
|
44
|
+
const resolvedEndAccessory = resolvedEndIconName ? (<Icon size={IconSize.Sm} color={IconColor.IconAlternative} twClassName="shrink-0" {...endIconProps} name={resolvedEndIconName}/>) : (endAccessory);
|
|
45
|
+
const hasAccessories = Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);
|
|
46
|
+
const titleRow = title ? (<BoxRow {...titleWrapperProps} gap={1} endAccessory={titleAccessory} twClassName={mergeTwClassName(hasAccessories ? 'w-full shrink min-w-0' : '', titleWrapperProps?.twClassName)} textProps={{
|
|
46
47
|
variant: TextVariant.HeadingMd,
|
|
47
48
|
color: TextColor.TextDefault,
|
|
48
49
|
...titleProps,
|
|
49
50
|
}}>
|
|
50
51
|
{title}
|
|
51
52
|
</BoxRow>) : null;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{titleRow}
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
let mainContent = null;
|
|
54
|
+
if (titleRow) {
|
|
55
|
+
mainContent = hasAccessories ? (<Box twClassName="shrink min-w-0">{titleRow}</Box>) : (titleRow);
|
|
56
|
+
}
|
|
57
|
+
const headerRow = (<BoxRow gap={1} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
|
|
58
|
+
{mainContent}
|
|
59
|
+
</BoxRow>);
|
|
60
|
+
const body = children ? (<Box gap={1}>
|
|
61
|
+
{headerRow}
|
|
62
|
+
{children}
|
|
63
|
+
</Box>) : (headerRow);
|
|
57
64
|
if (isInteractive) {
|
|
58
65
|
const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;
|
|
59
66
|
const isDisabled = Boolean(disabled);
|
|
@@ -62,11 +69,15 @@ export const SectionHeader = (sectionHeaderProps) => {
|
|
|
62
69
|
const additionalStyle = typeof style === 'function' ? style({ pressed }) : style;
|
|
63
70
|
return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;
|
|
64
71
|
}} {...props}>
|
|
65
|
-
|
|
66
|
-
{mainContent}
|
|
67
|
-
</BoxRow>
|
|
72
|
+
{body}
|
|
68
73
|
</Pressable>);
|
|
69
74
|
}
|
|
75
|
+
if (children) {
|
|
76
|
+
return (<Box {...props} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}>
|
|
77
|
+
{headerRow}
|
|
78
|
+
{children}
|
|
79
|
+
</Box>);
|
|
80
|
+
}
|
|
70
81
|
return (<BoxRow {...props} gap={1} style={style} twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)} startAccessory={resolvedStartAccessory} endAccessory={resolvedEndAccessory}>
|
|
71
82
|
{mainContent}
|
|
72
83
|
</BoxRow>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names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CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,KAAK,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CACjC,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,CACjB,IAAI,CAAC,CAAC,mBAAmB,CAAC,EAC1B,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CAAC;IAEF,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CACvB,CAAC,MAAM,CACL,IAAI,iBAAiB,CAAC,CACtB,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,YAAY,CAAC,CAAC,cAAc,CAAC,CAC7B,SAAS,CAAC,CAAC;YACT,OAAO,EAAE,WAAW,CAAC,SAAS;YAC9B,KAAK,EAAE,SAAS,CAAC,WAAW;YAC5B,GAAG,UAAU;SACd,CAAC,CAEF;MAAA,CAAC,KAAK,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CAAC;IAET,
|
|
1
|
+
{"version":3,"file":"SectionHeader.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiC,CACzD,kBAAkB,EAClB,EAAE;IACF,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,c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,\n mergeTwClassName,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon } from '../Icon';\n\nimport type { SectionHeaderProps } from './SectionHeader.types';\n\n/**\n * Horizontal section header: optional start/end icons or accessories, and a title row with optional inline accessory.\n * When `isInteractive` is `true`, the header is wrapped in a `Pressable` and remaining `PressableProps` are forwarded to it.\n * Otherwise, remaining `View` props are forwarded to the outer {@link BoxRow}.\n *\n * @param sectionHeaderProps - Component props\n * @param sectionHeaderProps.title - Title content for the inner row (required)\n * @param sectionHeaderProps.titleAccessory - Optional inline metadata beside `title` in the inner row (not for trailing chevrons; use `endIconName` / `endIconProps`)\n * @param sectionHeaderProps.children - Optional full-width content below the header row\n * @param sectionHeaderProps.titleProps - Optional props merged into inner row `Text` when `title` is a string\n * @param sectionHeaderProps.titleWrapperProps - Optional props spread onto the inner `BoxRow`\n * @param sectionHeaderProps.startAccessory - Optional custom node before the title row on the outer row; used when no start icon is resolved\n * @param sectionHeaderProps.startIconName - Optional start icon; takes precedence over `startAccessory` when set\n * @param sectionHeaderProps.startIconProps - Props merged into the start `Icon` (defaults include medium size and default icon color)\n * @param sectionHeaderProps.endAccessory - Optional custom node after the title row on the outer row; used when no end icon is resolved\n * @param sectionHeaderProps.endIconName - Optional end icon on the outer header row (trailing chevrons, disclosure arrows); takes precedence over `endAccessory` when set. Defaults to `IconName.ArrowRight` when `isInteractive` is `true` and no end icon or `endAccessory` is provided\n * @param sectionHeaderProps.endIconProps - Props merged into the end `Icon`\n * @param sectionHeaderProps.isInteractive - When `true`, wraps the header in a `Pressable` with reduced opacity on press\n * @param sectionHeaderProps.style - Optional style on the outer wrapper (`View` or `Pressable` style, including function form when interactive)\n * @param sectionHeaderProps.twClassName - Optional Tailwind classes on the outer row\n *\n * @returns The rendered SectionHeader layout.\n */\nexport const SectionHeader: React.FC<SectionHeaderProps> = (\n sectionHeaderProps,\n) => {\n const {\n title,\n children,\n titleAccessory,\n titleProps,\n titleWrapperProps,\n startAccessory,\n startIconName,\n startIconProps,\n endAccessory,\n endIconName,\n endIconProps,\n isInteractive,\n twClassName = '',\n style,\n ...props\n } = sectionHeaderProps;\n\n const tw = useTailwind();\n const resolvedEndIconName =\n endIconName ??\n (isInteractive && !endAccessory ? IconName.ArrowRight : undefined);\n\n const resolvedStartAccessory = startIconName ? (\n <Icon\n size={IconSize.Sm}\n color={IconColor.IconDefault}\n twClassName=\"shrink-0\"\n {...startIconProps}\n name={startIconName}\n />\n ) : (\n startAccessory\n );\n\n const resolvedEndAccessory = resolvedEndIconName ? (\n <Icon\n size={IconSize.Sm}\n color={IconColor.IconAlternative}\n twClassName=\"shrink-0\"\n {...endIconProps}\n name={resolvedEndIconName}\n />\n ) : (\n endAccessory\n );\n\n const hasAccessories =\n Boolean(resolvedStartAccessory) || Boolean(resolvedEndAccessory);\n\n const titleRow = title ? (\n <BoxRow\n {...titleWrapperProps}\n gap={1}\n endAccessory={titleAccessory}\n twClassName={mergeTwClassName(\n hasAccessories ? 'w-full shrink min-w-0' : '',\n titleWrapperProps?.twClassName,\n )}\n textProps={{\n variant: TextVariant.HeadingMd,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </BoxRow>\n ) : null;\n\n let mainContent = null;\n if (titleRow) {\n mainContent = hasAccessories ? (\n <Box twClassName=\"shrink min-w-0\">{titleRow}</Box>\n ) : (\n titleRow\n );\n }\n\n const headerRow = (\n <BoxRow\n gap={1}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n\n const body = children ? (\n <Box gap={1}>\n {headerRow}\n {children}\n </Box>\n ) : (\n headerRow\n );\n\n if (isInteractive) {\n const { disabled, accessibilityRole = 'button' } = sectionHeaderProps;\n const isDisabled = Boolean(disabled);\n\n return (\n <Pressable\n accessibilityRole={accessibilityRole}\n style={({ pressed }) => {\n const baseStyle = tw.style(\n 'px-4 pb-2 pt-3',\n twClassName,\n pressed && !isDisabled && 'opacity-70',\n );\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return additionalStyle ? [baseStyle, additionalStyle] : baseStyle;\n }}\n {...props}\n >\n {body}\n </Pressable>\n );\n }\n\n if (children) {\n return (\n <Box\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n >\n {headerRow}\n {children}\n </Box>\n );\n }\n\n return (\n <BoxRow\n {...props}\n gap={1}\n style={style}\n twClassName={mergeTwClassName('px-4 pb-2 pt-3', twClassName)}\n startAccessory={resolvedStartAccessory}\n endAccessory={resolvedEndAccessory}\n >\n {mainContent}\n </BoxRow>\n );\n};\n\nSectionHeader.displayName = 'SectionHeader';\n"]}
|
|
@@ -28,7 +28,7 @@ const design_system_shared_1 = require("@metamask-previews/design-system-shared"
|
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
29
|
const Box_1 = require("../Box/index.cjs");
|
|
30
30
|
const SegmentedControl_constants_1 = require("./SegmentedControl.constants.cjs");
|
|
31
|
-
const SegmentedControl = ({ value, onChange, size = design_system_shared_1.
|
|
31
|
+
const SegmentedControl = ({ value, onChange, size = design_system_shared_1.SegmentedControlSize.Sm, isFullWidth = false, children, twClassName, style, ...rest }) => {
|
|
32
32
|
const contextValue = (0, react_1.useMemo)(() => ({
|
|
33
33
|
value,
|
|
34
34
|
onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAKiD;AACjD,+CAAiD;AAEjD,0CAA6B;AAE7B,iFAAsF;AAG/E,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,I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CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,QAAQ,CACnC;cAAA,CAAC,KAAK,CACR;YAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,CACF,CAAC,eAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,eAAK,CAAC,QAAQ,CAAC,CACrD,CACF,CACH;MAAA,EAAE,SAAG,CACP;IAAA,EAAE,+CAAwB,CAAC,QAAQ,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,gBAAgB,oBAiD3B;AAEF,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["import {\n FilterButtonGroupContext,\n FilterButtonVariant,\n SegmentedControlSize,\n mergeTwClassName,\n} from '@metamask-previews/design-system-shared';\nimport React, { Children, useMemo } from 'react';\n\nimport { Box } from '../Box';\n\nimport { getSegmentedControlBorderRadiusTwClass } from './SegmentedControl.constants';\nimport type { SegmentedControlProps } from './SegmentedControl.types';\n\nexport const SegmentedControl = ({\n value,\n onChange,\n size = SegmentedControlSize.Sm,\n isFullWidth = false,\n children,\n twClassName,\n style,\n ...rest\n}: SegmentedControlProps) => {\n const contextValue = useMemo(\n () => ({\n value,\n onChange,\n variant: FilterButtonVariant.Secondary,\n size,\n isEqualWidth: isFullWidth,\n }),\n [value, onChange, size, isFullWidth],\n );\n\n const widthClass = isFullWidth ? 'self-stretch' : 'self-start';\n\n return (\n <FilterButtonGroupContext.Provider value={contextValue}>\n <Box\n {...rest}\n accessibilityRole=\"tablist\"\n twClassName={mergeTwClassName(\n mergeTwClassName(\n `${widthClass} flex-row items-center gap-1 border border-muted p-1`,\n getSegmentedControlBorderRadiusTwClass(size),\n ),\n twClassName,\n )}\n style={style}\n >\n {Children.map(children, (child, index) =>\n isFullWidth ? (\n <Box key={index} twClassName=\"flex-1\">\n {child}\n </Box>\n ) : (\n <React.Fragment key={index}>{child}</React.Fragment>\n ),\n )}\n </Box>\n </FilterButtonGroupContext.Provider>\n );\n};\n\nSegmentedControl.displayName = 'SegmentedControl';\n"]}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getSegmentedControlBorderRadiusTwClass = exports.TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS = void 0;
|
|
4
4
|
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
5
|
exports.TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS = {
|
|
6
|
-
[design_system_shared_1.
|
|
7
|
-
[design_system_shared_1.
|
|
8
|
-
[design_system_shared_1.
|
|
6
|
+
[design_system_shared_1.SegmentedControlSize.Sm]: 'rounded-xl',
|
|
7
|
+
[design_system_shared_1.SegmentedControlSize.Md]: 'rounded-2xl',
|
|
8
|
+
[design_system_shared_1.SegmentedControlSize.Lg]: 'rounded-2xl',
|
|
9
9
|
};
|
|
10
10
|
const getSegmentedControlBorderRadiusTwClass = (size) => exports.TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];
|
|
11
11
|
exports.getSegmentedControlBorderRadiusTwClass = getSegmentedControlBorderRadiusTwClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.constants.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.constants.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":";;;AAAA,kFAA+E;AAElE,QAAA,yCAAyC,GAGlD;IACF,CAAC,2CAAoB,CAAC,EAAE,CAAC,EAAE,YAAY;IACvC,CAAC,2CAAoB,CAAC,EAAE,CAAC,EAAE,aAAa;IACxC,CAAC,2CAAoB,CAAC,EAAE,CAAC,EAAE,aAAa;CACzC,CAAC;AAEK,MAAM,sCAAsC,GAAG,CACpD,IAA0B,EAClB,EAAE,CAAC,iDAAyC,CAAC,IAAI,CAAC,CAAC;AAFhD,QAAA,sCAAsC,0CAEU","sourcesContent":["import { SegmentedControlSize } from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<\n SegmentedControlSize,\n string\n> = {\n [SegmentedControlSize.Sm]: 'rounded-xl',\n [SegmentedControlSize.Md]: 'rounded-2xl',\n [SegmentedControlSize.Lg]: 'rounded-2xl',\n};\n\nexport const getSegmentedControlBorderRadiusTwClass = (\n size: SegmentedControlSize,\n): string => TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<
|
|
3
|
-
export declare const getSegmentedControlBorderRadiusTwClass: (size:
|
|
1
|
+
import { SegmentedControlSize } from "@metamask-previews/design-system-shared";
|
|
2
|
+
export declare const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<SegmentedControlSize, string>;
|
|
3
|
+
export declare const getSegmentedControlBorderRadiusTwClass: (size: SegmentedControlSize) => string;
|
|
4
4
|
//# sourceMappingURL=SegmentedControl.constants.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.constants.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.constants.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAE/E,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAC5D,oBAAoB,EACpB,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,sCAAsC,SAC3C,oBAAoB,KACzB,MAAyD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<
|
|
3
|
-
export declare const getSegmentedControlBorderRadiusTwClass: (size:
|
|
1
|
+
import { SegmentedControlSize } from "@metamask-previews/design-system-shared";
|
|
2
|
+
export declare const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<SegmentedControlSize, string>;
|
|
3
|
+
export declare const getSegmentedControlBorderRadiusTwClass: (size: SegmentedControlSize) => string;
|
|
4
4
|
//# sourceMappingURL=SegmentedControl.constants.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.constants.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.constants.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAE/E,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAC5D,oBAAoB,EACpB,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,sCAAsC,SAC3C,oBAAoB,KACzB,MAAyD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SegmentedControlSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS = {
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
3
|
+
[SegmentedControlSize.Sm]: 'rounded-xl',
|
|
4
|
+
[SegmentedControlSize.Md]: 'rounded-2xl',
|
|
5
|
+
[SegmentedControlSize.Lg]: 'rounded-2xl',
|
|
6
6
|
};
|
|
7
7
|
export const getSegmentedControlBorderRadiusTwClass = (size) => TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];
|
|
8
8
|
//# sourceMappingURL=SegmentedControl.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.constants.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.constants.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAE/E,MAAM,CAAC,MAAM,yCAAyC,GAGlD;IACF,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,YAAY;IACvC,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,aAAa;IACxC,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,aAAa;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,CACpD,IAA0B,EAClB,EAAE,CAAC,yCAAyC,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { SegmentedControlSize } from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS: Record<\n SegmentedControlSize,\n string\n> = {\n [SegmentedControlSize.Sm]: 'rounded-xl',\n [SegmentedControlSize.Md]: 'rounded-2xl',\n [SegmentedControlSize.Lg]: 'rounded-2xl',\n};\n\nexport const getSegmentedControlBorderRadiusTwClass = (\n size: SegmentedControlSize,\n): string => TWCLASSMAP_SEGMENTEDCONTROL_BORDER_RADIUS[size];\n"]}
|
|
@@ -4,12 +4,12 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import {
|
|
7
|
+
import { FilterButtonGroupContext, FilterButtonVariant, SegmentedControlSize, mergeTwClassName } from "@metamask-previews/design-system-shared";
|
|
8
8
|
import $React, { Children, useMemo } from "react";
|
|
9
9
|
const React = $importDefault($React);
|
|
10
10
|
import { Box } from "../Box/index.mjs";
|
|
11
11
|
import { getSegmentedControlBorderRadiusTwClass } from "./SegmentedControl.constants.mjs";
|
|
12
|
-
export const SegmentedControl = ({ value, onChange, size =
|
|
12
|
+
export const SegmentedControl = ({ value, onChange, size = SegmentedControlSize.Sm, isFullWidth = false, children, twClassName, style, ...rest }) => {
|
|
13
13
|
const contextValue = useMemo(() => ({
|
|
14
14
|
value,
|
|
15
15
|
onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EACjB,gDAAgD;AACjD,OAAO,QAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;;AAEjD,OAAO,EAAE,GAAG,EAAE,yBAAe;AAE7B,OAAO,EAAE,sCAAsC,EAAE,yCAAqC;AAGtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,oBAAoB,CAAC,EAAE,EAC9B,WAAW,GAAG,KAAK,EACnB,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACe,EAAE,EAAE;IAC1B,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,QAAQ;QACR,OAAO,EAAE,mBAAmB,CAAC,SAAS;QACtC,IAAI;QACJ,YAAY,EAAE,WAAW;KAC1B,CAAC,EACF,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CACrC,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;IAE/D,OAAO,CACL,CAAC,wBAAwB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACrD;MAAA,CAAC,GAAG,CACF,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,SAAS,CAC3B,WAAW,CAAC,CAAC,gBAAgB,CAC3B,gBAAgB,CACd,GAAG,UAAU,sDAAsD,EACnE,sCAAsC,CAAC,IAAI,CAAC,CAC7C,EACD,WAAW,CACZ,CAAC,CACF,KAAK,CAAC,CAAC,KAAK,CAAC,CAEb;QAAA,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACvC,WAAW,CAAC,CAAC,CAAC,CACZ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,QAAQ,CACnC;cAAA,CAAC,KAAK,CACR;YAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,CACF,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CACrD,CACF,CACH;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["import {\n FilterButtonGroupContext,\n FilterButtonVariant,\n SegmentedControlSize,\n mergeTwClassName,\n} from '@metamask-previews/design-system-shared';\nimport React, { Children, useMemo } from 'react';\n\nimport { Box } from '../Box';\n\nimport { getSegmentedControlBorderRadiusTwClass } from './SegmentedControl.constants';\nimport type { SegmentedControlProps } from './SegmentedControl.types';\n\nexport const SegmentedControl = ({\n value,\n onChange,\n size = SegmentedControlSize.Sm,\n isFullWidth = false,\n children,\n twClassName,\n style,\n ...rest\n}: SegmentedControlProps) => {\n const contextValue = useMemo(\n () => ({\n value,\n onChange,\n variant: FilterButtonVariant.Secondary,\n size,\n isEqualWidth: isFullWidth,\n }),\n [value, onChange, size, isFullWidth],\n );\n\n const widthClass = isFullWidth ? 'self-stretch' : 'self-start';\n\n return (\n <FilterButtonGroupContext.Provider value={contextValue}>\n <Box\n {...rest}\n accessibilityRole=\"tablist\"\n twClassName={mergeTwClassName(\n mergeTwClassName(\n `${widthClass} flex-row items-center gap-1 border border-muted p-1`,\n getSegmentedControlBorderRadiusTwClass(size),\n ),\n twClassName,\n )}\n style={style}\n >\n {Children.map(children, (child, index) =>\n isFullWidth ? (\n <Box key={index} twClassName=\"flex-1\">\n {child}\n </Box>\n ) : (\n <React.Fragment key={index}>{child}</React.Fragment>\n ),\n )}\n </Box>\n </FilterButtonGroupContext.Provider>\n );\n};\n\nSegmentedControl.displayName = 'SegmentedControl';\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SegmentedControl = void 0;
|
|
3
|
+
exports.SegmentedControl = exports.SegmentedControlSize = void 0;
|
|
4
|
+
var design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "SegmentedControlSize", { enumerable: true, get: function () { return design_system_shared_1.SegmentedControlSize; } });
|
|
4
6
|
var SegmentedControl_1 = require("./SegmentedControl.cjs");
|
|
5
7
|
Object.defineProperty(exports, "SegmentedControl", { enumerable: true, get: function () { return SegmentedControl_1.SegmentedControl; } });
|
|
6
8
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAA7C,oHAAA,gBAAgB,OAAA","sourcesContent":["export { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":";;;AAAA,gFAA+E;AAAtE,4HAAA,oBAAoB,OAAA;AAC7B,2DAAsD;AAA7C,oHAAA,gBAAgB,OAAA","sourcesContent":["export { SegmentedControlSize } from '@metamask-previews/design-system-shared';\nexport { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,YAAY,EAAE,qBAAqB,EAAE,qCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,+BAA2B","sourcesContent":["export { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,gBAAgB,EAAE,+BAA2B","sourcesContent":["export { SegmentedControlSize } from '@metamask-previews/design-system-shared';\nexport { SegmentedControl } from './SegmentedControl';\nexport type { SegmentedControlProps } from './SegmentedControl.types';\n"]}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TOAST_SEVERITY_ICON_MAP = exports.
|
|
3
|
+
exports.TOAST_SEVERITY_ICON_MAP = exports.TOAST_SPRING_CONFIG = exports.TOAST_TOP_PADDING = exports.TOAST_VISIBILITY_DURATION = exports.TOAST_ANIMATION_DURATION = void 0;
|
|
4
4
|
// External dependencies.
|
|
5
5
|
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
6
6
|
const Toast_types_1 = require("./Toast.types.cjs");
|
|
7
7
|
var design_system_shared_2 = require("@metamask-previews/design-system-shared");
|
|
8
8
|
Object.defineProperty(exports, "TOAST_ANIMATION_DURATION", { enumerable: true, get: function () { return design_system_shared_2.TOAST_ANIMATION_DURATION; } });
|
|
9
9
|
Object.defineProperty(exports, "TOAST_VISIBILITY_DURATION", { enumerable: true, get: function () { return design_system_shared_2.TOAST_VISIBILITY_DURATION; } });
|
|
10
|
-
exports.
|
|
10
|
+
exports.TOAST_TOP_PADDING = 8;
|
|
11
|
+
/**
|
|
12
|
+
* Spring tuned to approximate iOS system banner motion.
|
|
13
|
+
*
|
|
14
|
+
* UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,
|
|
15
|
+
* initialSpringVelocity: 1)`
|
|
16
|
+
*
|
|
17
|
+
* SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.
|
|
18
|
+
*/
|
|
19
|
+
exports.TOAST_SPRING_CONFIG = {
|
|
20
|
+
dampingRatio: 0.85,
|
|
21
|
+
duration: 500,
|
|
22
|
+
};
|
|
11
23
|
exports.TOAST_SEVERITY_ICON_MAP = {
|
|
12
24
|
[Toast_types_1.ToastSeverity.Success]: design_system_shared_1.IconAlertSeverity.Success,
|
|
13
25
|
[Toast_types_1.ToastSeverity.Warning]: design_system_shared_1.IconAlertSeverity.Warning,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.constants.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,kFAA4E;
|
|
1
|
+
{"version":3,"file":"Toast.constants.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,kFAA4E;AAG5E,mDAA8C;AAE9C,gFAGiD;AAF/C,gIAAA,wBAAwB,OAAA;AACxB,iIAAA,yBAAyB,OAAA;AAGd,QAAA,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;;;;;;GAOG;AACU,QAAA,mBAAmB,GAAqB;IACnD,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,GAAG;CACd,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACrC,CAAC,2BAAa,CAAC,OAAO,CAAC,EAAE,wCAAiB,CAAC,OAAO;IAClD,CAAC,2BAAa,CAAC,OAAO,CAAC,EAAE,wCAAiB,CAAC,OAAO;IAClD,CAAC,2BAAa,CAAC,MAAM,CAAC,EAAE,wCAAiB,CAAC,MAAM;CACxC,CAAC","sourcesContent":["// External dependencies.\nimport { IconAlertSeverity } from '@metamask-previews/design-system-shared';\nimport type { WithSpringConfig } from 'react-native-reanimated';\n\nimport { ToastSeverity } from './Toast.types';\n\nexport {\n TOAST_ANIMATION_DURATION,\n TOAST_VISIBILITY_DURATION,\n} from '@metamask-previews/design-system-shared';\n\nexport const TOAST_TOP_PADDING = 8;\n\n/**\n * Spring tuned to approximate iOS system banner motion.\n *\n * UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,\n * initialSpringVelocity: 1)`\n *\n * SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.\n */\nexport const TOAST_SPRING_CONFIG: WithSpringConfig = {\n dampingRatio: 0.85,\n duration: 500,\n};\n\nexport const TOAST_SEVERITY_ICON_MAP = {\n [ToastSeverity.Success]: IconAlertSeverity.Success,\n [ToastSeverity.Warning]: IconAlertSeverity.Warning,\n [ToastSeverity.Danger]: IconAlertSeverity.Danger,\n} as const;\n"]}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import type { WithSpringConfig } from "react-native-reanimated";
|
|
1
2
|
export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION, } from "@metamask-previews/design-system-shared";
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const TOAST_TOP_PADDING = 8;
|
|
4
|
+
/**
|
|
5
|
+
* Spring tuned to approximate iOS system banner motion.
|
|
6
|
+
*
|
|
7
|
+
* UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,
|
|
8
|
+
* initialSpringVelocity: 1)`
|
|
9
|
+
*
|
|
10
|
+
* SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TOAST_SPRING_CONFIG: WithSpringConfig;
|
|
3
13
|
export declare const TOAST_SEVERITY_ICON_MAP: {
|
|
4
14
|
readonly success: "success";
|
|
5
15
|
readonly warning: "warning";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toast.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAAgC;AAIhE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,gDAAgD;AAEjD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAGjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import type { WithSpringConfig } from "react-native-reanimated";
|
|
1
2
|
export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION, } from "@metamask-previews/design-system-shared";
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const TOAST_TOP_PADDING = 8;
|
|
4
|
+
/**
|
|
5
|
+
* Spring tuned to approximate iOS system banner motion.
|
|
6
|
+
*
|
|
7
|
+
* UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,
|
|
8
|
+
* initialSpringVelocity: 1)`
|
|
9
|
+
*
|
|
10
|
+
* SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TOAST_SPRING_CONFIG: WithSpringConfig;
|
|
3
13
|
export declare const TOAST_SEVERITY_ICON_MAP: {
|
|
4
14
|
readonly success: "success";
|
|
5
15
|
readonly warning: "warning";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toast.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAAgC;AAIhE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,gDAAgD;AAEjD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAGjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
|
|
@@ -2,7 +2,19 @@
|
|
|
2
2
|
import { IconAlertSeverity } from "@metamask-previews/design-system-shared";
|
|
3
3
|
import { ToastSeverity } from "./Toast.types.mjs";
|
|
4
4
|
export { TOAST_ANIMATION_DURATION, TOAST_VISIBILITY_DURATION } from "@metamask-previews/design-system-shared";
|
|
5
|
-
export const
|
|
5
|
+
export const TOAST_TOP_PADDING = 8;
|
|
6
|
+
/**
|
|
7
|
+
* Spring tuned to approximate iOS system banner motion.
|
|
8
|
+
*
|
|
9
|
+
* UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,
|
|
10
|
+
* initialSpringVelocity: 1)`
|
|
11
|
+
*
|
|
12
|
+
* SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.
|
|
13
|
+
*/
|
|
14
|
+
export const TOAST_SPRING_CONFIG = {
|
|
15
|
+
dampingRatio: 0.85,
|
|
16
|
+
duration: 500,
|
|
17
|
+
};
|
|
6
18
|
export const TOAST_SEVERITY_ICON_MAP = {
|
|
7
19
|
[ToastSeverity.Success]: IconAlertSeverity.Success,
|
|
8
20
|
[ToastSeverity.Warning]: IconAlertSeverity.Warning,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.constants.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,iBAAiB,EAAE,gDAAgD;
|
|
1
|
+
{"version":3,"file":"Toast.constants.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,iBAAiB,EAAE,gDAAgD;AAG5E,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAE9C,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EAC1B,gDAAgD;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,GAAG;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO;IAClD,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO;IAClD,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,MAAM;CACxC,CAAC","sourcesContent":["// External dependencies.\nimport { IconAlertSeverity } from '@metamask-previews/design-system-shared';\nimport type { WithSpringConfig } from 'react-native-reanimated';\n\nimport { ToastSeverity } from './Toast.types';\n\nexport {\n TOAST_ANIMATION_DURATION,\n TOAST_VISIBILITY_DURATION,\n} from '@metamask-previews/design-system-shared';\n\nexport const TOAST_TOP_PADDING = 8;\n\n/**\n * Spring tuned to approximate iOS system banner motion.\n *\n * UIKit reference: `animate(withDuration: 0.5, usingSpringWithDamping: 0.7,\n * initialSpringVelocity: 1)`\n *\n * SwiftUI reference: `.snappy` / `.smooth` with minimal bounce.\n */\nexport const TOAST_SPRING_CONFIG: WithSpringConfig = {\n dampingRatio: 0.85,\n duration: 500,\n};\n\nexport const TOAST_SEVERITY_ICON_MAP = {\n [ToastSeverity.Success]: IconAlertSeverity.Success,\n [ToastSeverity.Warning]: IconAlertSeverity.Warning,\n [ToastSeverity.Danger]: IconAlertSeverity.Danger,\n} as const;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.types.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":";;;AACA,kFAAwE;AAM/D,8FANA,oCAAa,OAMA","sourcesContent":["import type { ToastPropsShared } from '@metamask-previews/design-system-shared';\nimport { ToastSeverity } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\nexport { ToastSeverity };\nexport type { ToastPropsShared };\n\n/**\n * Optional props for the leading severity `Icon`.\n */\nexport type ToastIconProps = Omit<IconProps, 'name' | 'size' | 'color'>;\n\n/**\n * Shared toast props aligned with BannerBase, plus optional severity/icon props.\n */\nexport type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {\n closeButtonProps?: Omit<\n NonNullable<BannerBaseProps['closeButtonProps']>,\n 'onPress'\n >;\n severity?: ToastSeverity;\n iconAlertProps?: ToastIconProps;\n};\n\n/**\n * Toast options used by the imperative `toast(...)` API.\n */\nexport type ToastOptions = ToastSharedProps & {\n hasNoTimeout?: boolean;\n
|
|
1
|
+
{"version":3,"file":"Toast.types.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":";;;AACA,kFAAwE;AAM/D,8FANA,oCAAa,OAMA","sourcesContent":["import type { ToastPropsShared } from '@metamask-previews/design-system-shared';\nimport { ToastSeverity } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\nexport { ToastSeverity };\nexport type { ToastPropsShared };\n\n/**\n * Optional props for the leading severity `Icon`.\n */\nexport type ToastIconProps = Omit<IconProps, 'name' | 'size' | 'color'>;\n\n/**\n * Shared toast props aligned with BannerBase, plus optional severity/icon props.\n */\nexport type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {\n closeButtonProps?: Omit<\n NonNullable<BannerBaseProps['closeButtonProps']>,\n 'onPress'\n >;\n severity?: ToastSeverity;\n iconAlertProps?: ToastIconProps;\n};\n\n/**\n * Toast options used by the imperative `toast(...)` API.\n */\nexport type ToastOptions = ToastSharedProps & {\n hasNoTimeout?: boolean;\n topOffset?: number;\n};\n\n/**\n * Toaster component reference.\n */\nexport type ToasterRef = {\n showToast: (toastOptions: ToastOptions) => void;\n closeToast: () => void;\n};\n\n/**\n * Toast component props intended for direct rendering of a single toast surface.\n */\nexport type ToastProps = ToastSharedProps;\n\n/**\n * Toaster component props.\n * Extends ViewProps to inherit standard React Native props such as testID and accessibilityLabel.\n */\nexport type ToasterProps = {\n /**\n * Optional Tailwind CSS classes for the toast container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'style'>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.types.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gDAAgD;AAChF,OAAO,EAAE,aAAa,EAAE,gDAAgD;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG;IACzE,gBAAgB,CAAC,EAAE,IAAI,CACrB,WAAW,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,EAChD,SAAS,CACV,CAAC;IACF,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,
|
|
1
|
+
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AS,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.types.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gDAAgD;AAChF,OAAO,EAAE,aAAa,EAAE,gDAAgD;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG;IACzE,gBAAgB,CAAC,EAAE,IAAI,CACrB,WAAW,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,EAChD,SAAS,CACV,CAAC;IACF,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,
|
|
1
|
+
{"version":3,"file":"Toast.types.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gDAAgD;AAChF,OAAO,EAAE,aAAa,EAAE,gDAAgD;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG;IACzE,gBAAgB,CAAC,EAAE,IAAI,CACrB,WAAW,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,EAChD,SAAS,CACV,CAAC;IACF,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.types.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gDAAgD;AAMxE,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import type { ToastPropsShared } from '@metamask-previews/design-system-shared';\nimport { ToastSeverity } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\nexport { ToastSeverity };\nexport type { ToastPropsShared };\n\n/**\n * Optional props for the leading severity `Icon`.\n */\nexport type ToastIconProps = Omit<IconProps, 'name' | 'size' | 'color'>;\n\n/**\n * Shared toast props aligned with BannerBase, plus optional severity/icon props.\n */\nexport type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {\n closeButtonProps?: Omit<\n NonNullable<BannerBaseProps['closeButtonProps']>,\n 'onPress'\n >;\n severity?: ToastSeverity;\n iconAlertProps?: ToastIconProps;\n};\n\n/**\n * Toast options used by the imperative `toast(...)` API.\n */\nexport type ToastOptions = ToastSharedProps & {\n hasNoTimeout?: boolean;\n
|
|
1
|
+
{"version":3,"file":"Toast.types.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gDAAgD;AAMxE,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import type { ToastPropsShared } from '@metamask-previews/design-system-shared';\nimport { ToastSeverity } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BannerBaseProps } from '../BannerBase';\nimport type { IconProps } from '../Icon/Icon.types';\n\nexport { ToastSeverity };\nexport type { ToastPropsShared };\n\n/**\n * Optional props for the leading severity `Icon`.\n */\nexport type ToastIconProps = Omit<IconProps, 'name' | 'size' | 'color'>;\n\n/**\n * Shared toast props aligned with BannerBase, plus optional severity/icon props.\n */\nexport type ToastSharedProps = Omit<BannerBaseProps, 'closeButtonProps'> & {\n closeButtonProps?: Omit<\n NonNullable<BannerBaseProps['closeButtonProps']>,\n 'onPress'\n >;\n severity?: ToastSeverity;\n iconAlertProps?: ToastIconProps;\n};\n\n/**\n * Toast options used by the imperative `toast(...)` API.\n */\nexport type ToastOptions = ToastSharedProps & {\n hasNoTimeout?: boolean;\n topOffset?: number;\n};\n\n/**\n * Toaster component reference.\n */\nexport type ToasterRef = {\n showToast: (toastOptions: ToastOptions) => void;\n closeToast: () => void;\n};\n\n/**\n * Toast component props intended for direct rendering of a single toast surface.\n */\nexport type ToastProps = ToastSharedProps;\n\n/**\n * Toaster component props.\n * Extends ViewProps to inherit standard React Native props such as testID and accessibilityLabel.\n */\nexport type ToasterProps = {\n /**\n * Optional Tailwind CSS classes for the toast container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'style'>;\n"]}
|