@metamask-previews/design-system-react-native 0.56.1-preview-7d5964a → 0.56.2-preview-473aecb
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 +13 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.cjs +13 -0
- package/dist/components/BoxColumn/BoxColumn.cjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.cts +13 -0
- package/dist/components/BoxColumn/BoxColumn.d.cts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.mts +13 -0
- package/dist/components/BoxColumn/BoxColumn.d.mts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.mjs +13 -0
- package/dist/components/BoxColumn/BoxColumn.mjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.cjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.d.cts +2 -0
- package/dist/components/BoxColumn/BoxColumn.types.d.cts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.d.mts +2 -0
- package/dist/components/BoxColumn/BoxColumn.types.d.mts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.cjs +13 -0
- package/dist/components/BoxRow/BoxRow.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.cts +13 -0
- package/dist/components/BoxRow/BoxRow.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.mts +13 -0
- package/dist/components/BoxRow/BoxRow.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.mjs +13 -0
- package/dist/components/BoxRow/BoxRow.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.d.cts +2 -0
- package/dist/components/BoxRow/BoxRow.types.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.d.mts +2 -0
- package/dist/components/BoxRow/BoxRow.types.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.cjs +9 -5
- package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.mjs +10 -6
- package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.cts +2 -3
- package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.mts +2 -3
- package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
- package/dist/components/Content/Content.cjs +40 -32
- package/dist/components/Content/Content.cjs.map +1 -1
- package/dist/components/Content/Content.d.cts.map +1 -1
- package/dist/components/Content/Content.d.mts.map +1 -1
- package/dist/components/Content/Content.mjs +40 -32
- package/dist/components/Content/Content.mjs.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.cjs +8 -5
- 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 +8 -5
- package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs +21 -12
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs +22 -13
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.cjs +19 -10
- package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.mjs +20 -11
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
- package/dist/components/ListItem/ListItem.cjs +4 -3
- package/dist/components/ListItem/ListItem.cjs.map +1 -1
- package/dist/components/ListItem/ListItem.d.cts.map +1 -1
- package/dist/components/ListItem/ListItem.d.mts.map +1 -1
- package/dist/components/ListItem/ListItem.mjs +5 -4
- package/dist/components/ListItem/ListItem.mjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.cjs +17 -10
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.cts +2 -2
- package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.mts +2 -2
- package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.mjs +18 -11
- package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.d.cts +5 -5
- package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.d.mts +5 -5
- package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -1
- package/dist/components/Switch/Switch.cjs +4 -2
- package/dist/components/Switch/Switch.cjs.map +1 -1
- package/dist/components/Switch/Switch.d.cts +1 -1
- package/dist/components/Switch/Switch.d.cts.map +1 -1
- package/dist/components/Switch/Switch.d.mts +1 -1
- package/dist/components/Switch/Switch.d.mts.map +1 -1
- package/dist/components/Switch/Switch.mjs +4 -2
- package/dist/components/Switch/Switch.mjs.map +1 -1
- package/dist/components/Tag/Tag.cjs +12 -18
- package/dist/components/Tag/Tag.cjs.map +1 -1
- package/dist/components/Tag/Tag.d.cts.map +1 -1
- package/dist/components/Tag/Tag.d.mts.map +1 -1
- package/dist/components/Tag/Tag.mjs +13 -19
- package/dist/components/Tag/Tag.mjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.cjs +20 -18
- package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.d.cts +3 -3
- package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.d.mts +3 -3
- package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.mjs +21 -19
- package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.cts +6 -7
- package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.mts +6 -7
- package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.cjs +22 -13
- package/dist/components/TitleHub/TitleHub.cjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.d.cts +3 -3
- package/dist/components/TitleHub/TitleHub.d.cts.map +1 -1
- package/dist/components/TitleHub/TitleHub.d.mts +3 -3
- package/dist/components/TitleHub/TitleHub.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.mjs +23 -14
- package/dist/components/TitleHub/TitleHub.mjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.cts +10 -10
- package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.mts +10 -10
- package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.cjs +15 -9
- package/dist/components/TitleStandard/TitleStandard.cjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.d.cts +2 -2
- package/dist/components/TitleStandard/TitleStandard.d.cts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.d.mts +2 -2
- package/dist/components/TitleStandard/TitleStandard.d.mts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.mjs +16 -10
- package/dist/components/TitleStandard/TitleStandard.mjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.cjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.cts +7 -7
- package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.mts +7 -7
- package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.mjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.cjs +31 -18
- package/dist/components/TitleSubpage/TitleSubpage.cjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.d.cts +3 -3
- package/dist/components/TitleSubpage/TitleSubpage.d.cts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.d.mts +3 -3
- package/dist/components/TitleSubpage/TitleSubpage.d.mts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.mjs +32 -19
- package/dist/components/TitleSubpage/TitleSubpage.mjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.cjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +8 -9
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +8 -9
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.mjs.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs +9 -7
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs +10 -8
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -8,37 +8,31 @@ const design_system_shared_1 = require("@metamask-previews/design-system-shared"
|
|
|
8
8
|
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
10
|
const Box_1 = require("../Box/index.cjs");
|
|
11
|
-
const BoxRow_1 = require("../BoxRow/index.cjs");
|
|
12
11
|
const Icon_1 = require("../Icon/index.cjs");
|
|
12
|
+
const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
|
|
13
13
|
const Tag_constants_1 = require("./Tag.constants.cjs");
|
|
14
14
|
const Tag = ({ children, severity = design_system_shared_1.TagSeverity.Neutral, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, twClassName, style, ...props }) => {
|
|
15
15
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
16
16
|
const backgroundColor = Tag_constants_1.MAP_TAG_SEVERITY_BACKGROUND[severity];
|
|
17
17
|
const textColor = Tag_constants_1.MAP_TAG_SEVERITY_TEXT_COLOR[severity];
|
|
18
18
|
const iconColor = Tag_constants_1.MAP_TAG_SEVERITY_ICON_COLOR[severity];
|
|
19
|
+
const resolvedStartIconName = startIconName ?? startIconProps?.name;
|
|
20
|
+
const resolvedEndIconName = endIconName ?? endIconProps?.name;
|
|
19
21
|
return (<Box_1.Box {...props} backgroundColor={backgroundColor} style={[
|
|
20
|
-
tw.style('rounded-md self-start',
|
|
22
|
+
tw.style('rounded-md self-start', resolvedStartIconName ? 'pl-1' : 'pl-1.5', resolvedEndIconName ? 'pr-1' : 'pr-1.5', twClassName),
|
|
21
23
|
style,
|
|
22
24
|
]}>
|
|
23
|
-
<
|
|
25
|
+
<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} twClassName="gap-0.5">
|
|
26
|
+
{resolvedStartIconName ? (<Icon_1.Icon name={resolvedStartIconName} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>) : ((startAccessory ?? null))}
|
|
27
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
24
28
|
color: textColor,
|
|
25
29
|
variant: design_system_shared_1.TextVariant.BodyXs,
|
|
26
30
|
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
27
|
-
}}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return (<Icon_1.Icon name={name} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>);
|
|
33
|
-
})()} endAccessory={(() => {
|
|
34
|
-
const name = endIconName ?? endIconProps?.name;
|
|
35
|
-
if (!name) {
|
|
36
|
-
return endAccessory ?? null;
|
|
37
|
-
}
|
|
38
|
-
return (<Icon_1.Icon name={name} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>);
|
|
39
|
-
})()}>
|
|
40
|
-
{children}
|
|
41
|
-
</BoxRow_1.BoxRow>
|
|
31
|
+
}}>
|
|
32
|
+
{children}
|
|
33
|
+
</TextOrChildren_1.TextOrChildren>
|
|
34
|
+
{resolvedEndIconName ? (<Icon_1.Icon name={resolvedEndIconName} color={iconColor} size={Icon_1.IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>) : ((endAccessory ?? null))}
|
|
35
|
+
</Box_1.Box>
|
|
42
36
|
</Box_1.Box>);
|
|
43
37
|
};
|
|
44
38
|
exports.Tag = Tag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.cjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Tag.cjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAMiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAE1B,0CAA6B;AAC7B,4CAAyC;AACzC,gFAAmE;AAEnE,uDAIyB;AAGlB,MAAM,GAAG,GAAuB,CAAC,EACtC,QAAQ,EACR,QAAQ,GAAG,kCAAW,CAAC,OAAO,EAC9B,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,eA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Q,CACX;QAAA,EAAE,+BAAc,CAChB;QAAA,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACrB,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAC1B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,CAAC,CAAC,eAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,UAAU,CACtB,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,CAAC,YAAY,IAAI,IAAI,CAAC,CACvB,CACH;MAAA,EAAE,SAAG,CACP;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,GAAG,OA0Ed","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n FontWeight,\n TagSeverity,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { Icon, IconSize } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n const resolvedStartIconName = startIconName ?? startIconProps?.name;\n const resolvedEndIconName = endIconName ?? endIconProps?.name;\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n resolvedStartIconName ? 'pl-1' : 'pl-1.5',\n resolvedEndIconName ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n twClassName=\"gap-0.5\"\n >\n {resolvedStartIconName ? (\n <Icon\n name={resolvedStartIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n ) : (\n (startAccessory ?? null)\n )}\n <TextOrChildren\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n >\n {children}\n </TextOrChildren>\n {resolvedEndIconName ? (\n <Icon\n name={resolvedEndIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n ) : (\n (endAccessory ?? null)\n )}\n </Box>\n </Box>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.cts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tag.d.cts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.mts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tag.d.mts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAW1B,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAoB;AAE5C,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CA0ElC,CAAC"}
|
|
@@ -4,42 +4,36 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import { FontWeight, TagSeverity, TextVariant } from "@metamask-previews/design-system-shared";
|
|
7
|
+
import { BoxAlignItems, BoxFlexDirection, FontWeight, TagSeverity, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
8
|
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
9
9
|
import $React from "react";
|
|
10
10
|
const React = $importDefault($React);
|
|
11
11
|
import { Box } from "../Box/index.mjs";
|
|
12
|
-
import { BoxRow } from "../BoxRow/index.mjs";
|
|
13
12
|
import { Icon, IconSize } from "../Icon/index.mjs";
|
|
13
|
+
import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
|
|
14
14
|
import { MAP_TAG_SEVERITY_BACKGROUND, MAP_TAG_SEVERITY_ICON_COLOR, MAP_TAG_SEVERITY_TEXT_COLOR } from "./Tag.constants.mjs";
|
|
15
15
|
export const Tag = ({ children, severity = TagSeverity.Neutral, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, twClassName, style, ...props }) => {
|
|
16
16
|
const tw = useTailwind();
|
|
17
17
|
const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];
|
|
18
18
|
const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];
|
|
19
19
|
const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];
|
|
20
|
+
const resolvedStartIconName = startIconName ?? startIconProps?.name;
|
|
21
|
+
const resolvedEndIconName = endIconName ?? endIconProps?.name;
|
|
20
22
|
return (<Box {...props} backgroundColor={backgroundColor} style={[
|
|
21
|
-
tw.style('rounded-md self-start',
|
|
23
|
+
tw.style('rounded-md self-start', resolvedStartIconName ? 'pl-1' : 'pl-1.5', resolvedEndIconName ? 'pr-1' : 'pr-1.5', twClassName),
|
|
22
24
|
style,
|
|
23
25
|
]}>
|
|
24
|
-
<
|
|
26
|
+
<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} twClassName="gap-0.5">
|
|
27
|
+
{resolvedStartIconName ? (<Icon name={resolvedStartIconName} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>) : ((startAccessory ?? null))}
|
|
28
|
+
<TextOrChildren textProps={{
|
|
25
29
|
color: textColor,
|
|
26
30
|
variant: TextVariant.BodyXs,
|
|
27
31
|
fontWeight: FontWeight.Medium,
|
|
28
|
-
}}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return (<Icon name={name} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...startIconProps}/>);
|
|
34
|
-
})()} endAccessory={(() => {
|
|
35
|
-
const name = endIconName ?? endIconProps?.name;
|
|
36
|
-
if (!name) {
|
|
37
|
-
return endAccessory ?? null;
|
|
38
|
-
}
|
|
39
|
-
return (<Icon name={name} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>);
|
|
40
|
-
})()}>
|
|
41
|
-
{children}
|
|
42
|
-
</BoxRow>
|
|
32
|
+
}}>
|
|
33
|
+
{children}
|
|
34
|
+
</TextOrChildren>
|
|
35
|
+
{resolvedEndIconName ? (<Icon name={resolvedEndIconName} color={iconColor} size={IconSize.Xs} twClassName="shrink-0" {...endIconProps}/>) : ((endAccessory ?? null))}
|
|
36
|
+
</Box>
|
|
43
37
|
</Box>);
|
|
44
38
|
};
|
|
45
39
|
//# sourceMappingURL=Tag.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.mjs","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EAA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@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { Icon, IconSize } from '../Icon';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport {\n MAP_TAG_SEVERITY_BACKGROUND,\n MAP_TAG_SEVERITY_ICON_COLOR,\n MAP_TAG_SEVERITY_TEXT_COLOR,\n} from './Tag.constants';\nimport type { TagProps } from './Tag.types';\n\nexport const Tag: React.FC<TagProps> = ({\n children,\n severity = TagSeverity.Neutral,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n const backgroundColor = MAP_TAG_SEVERITY_BACKGROUND[severity];\n const textColor = MAP_TAG_SEVERITY_TEXT_COLOR[severity];\n const iconColor = MAP_TAG_SEVERITY_ICON_COLOR[severity];\n\n const resolvedStartIconName = startIconName ?? startIconProps?.name;\n const resolvedEndIconName = endIconName ?? endIconProps?.name;\n\n return (\n <Box\n {...props}\n backgroundColor={backgroundColor}\n style={[\n tw.style(\n 'rounded-md self-start',\n resolvedStartIconName ? 'pl-1' : 'pl-1.5',\n resolvedEndIconName ? 'pr-1' : 'pr-1.5',\n twClassName,\n ),\n style,\n ]}\n >\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n twClassName=\"gap-0.5\"\n >\n {resolvedStartIconName ? (\n <Icon\n name={resolvedStartIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...startIconProps}\n />\n ) : (\n (startAccessory ?? null)\n )}\n <TextOrChildren\n textProps={{\n color: textColor,\n variant: TextVariant.BodyXs,\n fontWeight: FontWeight.Medium,\n }}\n >\n {children}\n </TextOrChildren>\n {resolvedEndIconName ? (\n <Icon\n name={resolvedEndIconName}\n color={iconColor}\n size={IconSize.Xs}\n twClassName=\"shrink-0\"\n {...endIconProps}\n />\n ) : (\n (endAccessory ?? null)\n )}\n </Box>\n </Box>\n );\n};\n"]}
|
|
@@ -7,45 +7,47 @@ exports.TitleAlert = void 0;
|
|
|
7
7
|
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const Box_1 = require("../Box/index.cjs");
|
|
10
|
-
const BoxColumn_1 = require("../BoxColumn/index.cjs");
|
|
11
|
-
const BoxRow_1 = require("../BoxRow/index.cjs");
|
|
12
10
|
const IconAlert_1 = require("../IconAlert/index.cjs");
|
|
13
11
|
const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
|
|
14
12
|
/**
|
|
15
13
|
* Displays a severity-based {@link IconAlert} above a centered title row.
|
|
16
|
-
* Remaining `View` props are forwarded to the root {@link
|
|
14
|
+
* Remaining `View` props are forwarded to the root {@link Box}.
|
|
17
15
|
*
|
|
18
16
|
* @param props - Component props
|
|
19
17
|
* @param props.severity - Passed to {@link IconAlert} for glyph and color
|
|
20
18
|
* @param props.title - Title row content; row renders only when `title` is renderable
|
|
21
|
-
* @param props.titleWrapperProps - Optional props spread onto the title row {@link
|
|
19
|
+
* @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}
|
|
22
20
|
* @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
|
|
23
21
|
* @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}
|
|
24
22
|
* @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string
|
|
25
|
-
* @param props.twClassName - Optional Tailwind classes on the root
|
|
23
|
+
* @param props.twClassName - Optional Tailwind classes on the root Box
|
|
26
24
|
*
|
|
27
25
|
* @returns The rendered TitleAlert layout.
|
|
28
26
|
*/
|
|
29
27
|
const TitleAlert = ({ severity, title, titleProps, titleWrapperProps, description, descriptionProps, twClassName = '', ...props }) => {
|
|
30
|
-
return (<
|
|
31
|
-
|
|
28
|
+
return (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Column} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} twClassName={twClassName} {...props}>
|
|
29
|
+
<IconAlert_1.IconAlert severity={severity} size={design_system_shared_1.IconSize.Xl}/>
|
|
30
|
+
{title ? (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} justifyContent={design_system_shared_1.BoxJustifyContent.Center} twClassName="self-stretch" {...titleWrapperProps}>
|
|
31
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
32
|
+
variant: design_system_shared_1.TextVariant.HeadingLg,
|
|
33
|
+
color: design_system_shared_1.TextColor.TextDefault,
|
|
34
|
+
...titleProps,
|
|
35
|
+
}}>
|
|
36
|
+
{title}
|
|
37
|
+
</TextOrChildren_1.TextOrChildren>
|
|
38
|
+
</Box_1.Box>) : null}
|
|
39
|
+
{description ? (<Box_1.Box twClassName="self-stretch">
|
|
40
|
+
<TextOrChildren_1.TextOrChildren textProps={{
|
|
32
41
|
variant: design_system_shared_1.TextVariant.BodySm,
|
|
33
42
|
color: design_system_shared_1.TextColor.TextAlternative,
|
|
34
43
|
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
35
44
|
...descriptionProps,
|
|
36
45
|
style: [{ textAlign: 'center' }, descriptionProps?.style],
|
|
37
46
|
}}>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
variant: design_system_shared_1.TextVariant.HeadingLg,
|
|
43
|
-
color: design_system_shared_1.TextColor.TextDefault,
|
|
44
|
-
...titleProps,
|
|
45
|
-
}}>
|
|
46
|
-
{title}
|
|
47
|
-
</BoxRow_1.BoxRow>) : null}
|
|
48
|
-
</BoxColumn_1.BoxColumn>);
|
|
47
|
+
{description}
|
|
48
|
+
</TextOrChildren_1.TextOrChildren>
|
|
49
|
+
</Box_1.Box>) : null}
|
|
50
|
+
</Box_1.Box>);
|
|
49
51
|
};
|
|
50
52
|
exports.TitleAlert = TitleAlert;
|
|
51
53
|
exports.TitleAlert.displayName = 'TitleAlert';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleAlert.cjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"TitleAlert.cjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAQiD;AACjD,kDAA0B;AAE1B,0CAA6B;AAC7B,sDAAyC;AACzC,gFAAmE;AAInE;;;;;;;;;;;;;;GAcG;AACI,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,CACL,CAAC,SAAG,CACF,aAAa,CAAC,CAAC,uCAAgB,CAAC,MAAM,CAAC,CACvC,UAAU,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,qBAAS,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,EACjD;MAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,SAAG,CACF,aAAa,CAAC,CAAC,uCAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,cAAc,CAAC,CAAC,wCAAiB,CAAC,MAAM,CAAC,CACzC,WAAW,CAAC,cAAc,CAC1B,IAAI,iBAAiB,CAAC,CAEtB;UAAA,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,kCAAW,CAAC,SAAS;gBAC9B,KAAK,EAAE,gCAAS,CAAC,WAAW;gBAC5B,GAAG,UAAU;aACd,CAAC,CAEF;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,+BAAc,CAClB;QAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACR;MAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,SAAG,CAAC,WAAW,CAAC,cAAc,CAC7B;UAAA,CAAC,+BAAc,CACb,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,kCAAW,CAAC,MAAM;gBAC3B,KAAK,EAAE,gCAAS,CAAC,eAAe;gBAChC,UAAU,EAAE,iCAAU,CAAC,MAAM;gBAC7B,GAAG,gBAAgB;gBACnB,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,KAAK,CAAC;aAC1D,CAAC,CAEF;YAAA,CAAC,WAAW,CACd;UAAA,EAAE,+BAAc,CAClB;QAAA,EAAE,SAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAxDW,QAAA,UAAU,cAwDrB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n BoxJustifyContent,\n FontWeight,\n IconSize,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { IconAlert } from '../IconAlert';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { TitleAlertProps } from './TitleAlert.types';\n\n/**\n * Displays a severity-based {@link IconAlert} above a centered title row.\n * Remaining `View` props are forwarded to the root {@link Box}.\n *\n * @param props - Component props\n * @param props.severity - Passed to {@link IconAlert} for glyph and color\n * @param props.title - Title row content; row renders only when `title` is renderable\n * @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}\n * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string\n * @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}\n * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string\n * @param props.twClassName - Optional Tailwind classes on the root Box\n *\n * @returns The rendered TitleAlert layout.\n */\nexport const TitleAlert: React.FC<TitleAlertProps> = ({\n severity,\n title,\n titleProps,\n titleWrapperProps,\n description,\n descriptionProps,\n twClassName = '',\n ...props\n}) => {\n return (\n <Box\n flexDirection={BoxFlexDirection.Column}\n alignItems={BoxAlignItems.Center}\n gap={1}\n twClassName={twClassName}\n {...props}\n >\n <IconAlert severity={severity} size={IconSize.Xl} />\n {title ? (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n justifyContent={BoxJustifyContent.Center}\n twClassName=\"self-stretch\"\n {...titleWrapperProps}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.HeadingLg,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </TextOrChildren>\n </Box>\n ) : null}\n {description ? (\n <Box twClassName=\"self-stretch\">\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n color: TextColor.TextAlternative,\n fontWeight: FontWeight.Medium,\n ...descriptionProps,\n style: [{ textAlign: 'center' }, descriptionProps?.style],\n }}\n >\n {description}\n </TextOrChildren>\n </Box>\n ) : null}\n </Box>\n );\n};\n\nTitleAlert.displayName = 'TitleAlert';\n"]}
|
|
@@ -2,16 +2,16 @@ import React from "react";
|
|
|
2
2
|
import type { TitleAlertProps } from "./TitleAlert.types.cjs";
|
|
3
3
|
/**
|
|
4
4
|
* Displays a severity-based {@link IconAlert} above a centered title row.
|
|
5
|
-
* Remaining `View` props are forwarded to the root {@link
|
|
5
|
+
* Remaining `View` props are forwarded to the root {@link Box}.
|
|
6
6
|
*
|
|
7
7
|
* @param props - Component props
|
|
8
8
|
* @param props.severity - Passed to {@link IconAlert} for glyph and color
|
|
9
9
|
* @param props.title - Title row content; row renders only when `title` is renderable
|
|
10
|
-
* @param props.titleWrapperProps - Optional props spread onto the title row {@link
|
|
10
|
+
* @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}
|
|
11
11
|
* @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
|
|
12
12
|
* @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}
|
|
13
13
|
* @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string
|
|
14
|
-
* @param props.twClassName - Optional Tailwind classes on the root
|
|
14
|
+
* @param props.twClassName - Optional Tailwind classes on the root Box
|
|
15
15
|
*
|
|
16
16
|
* @returns The rendered TitleAlert layout.
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleAlert.d.cts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TitleAlert.d.cts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwDhD,CAAC"}
|
|
@@ -2,16 +2,16 @@ import React from "react";
|
|
|
2
2
|
import type { TitleAlertProps } from "./TitleAlert.types.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Displays a severity-based {@link IconAlert} above a centered title row.
|
|
5
|
-
* Remaining `View` props are forwarded to the root {@link
|
|
5
|
+
* Remaining `View` props are forwarded to the root {@link Box}.
|
|
6
6
|
*
|
|
7
7
|
* @param props - Component props
|
|
8
8
|
* @param props.severity - Passed to {@link IconAlert} for glyph and color
|
|
9
9
|
* @param props.title - Title row content; row renders only when `title` is renderable
|
|
10
|
-
* @param props.titleWrapperProps - Optional props spread onto the title row {@link
|
|
10
|
+
* @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}
|
|
11
11
|
* @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
|
|
12
12
|
* @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}
|
|
13
13
|
* @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string
|
|
14
|
-
* @param props.twClassName - Optional Tailwind classes on the root
|
|
14
|
+
* @param props.twClassName - Optional Tailwind classes on the root Box
|
|
15
15
|
*
|
|
16
16
|
* @returns The rendered TitleAlert layout.
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleAlert.d.mts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TitleAlert.d.mts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwDhD,CAAC"}
|
|
@@ -4,49 +4,51 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import { BoxAlignItems, BoxJustifyContent, FontWeight, IconSize, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
7
|
+
import { BoxAlignItems, BoxFlexDirection, BoxJustifyContent, FontWeight, IconSize, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
8
|
import $React from "react";
|
|
9
9
|
const React = $importDefault($React);
|
|
10
10
|
import { Box } from "../Box/index.mjs";
|
|
11
|
-
import { BoxColumn } from "../BoxColumn/index.mjs";
|
|
12
|
-
import { BoxRow } from "../BoxRow/index.mjs";
|
|
13
11
|
import { IconAlert } from "../IconAlert/index.mjs";
|
|
14
12
|
import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
|
|
15
13
|
/**
|
|
16
14
|
* Displays a severity-based {@link IconAlert} above a centered title row.
|
|
17
|
-
* Remaining `View` props are forwarded to the root {@link
|
|
15
|
+
* Remaining `View` props are forwarded to the root {@link Box}.
|
|
18
16
|
*
|
|
19
17
|
* @param props - Component props
|
|
20
18
|
* @param props.severity - Passed to {@link IconAlert} for glyph and color
|
|
21
19
|
* @param props.title - Title row content; row renders only when `title` is renderable
|
|
22
|
-
* @param props.titleWrapperProps - Optional props spread onto the title row {@link
|
|
20
|
+
* @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}
|
|
23
21
|
* @param props.titleProps - Optional props merged into title row `Text` when `title` is a string
|
|
24
22
|
* @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}
|
|
25
23
|
* @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string
|
|
26
|
-
* @param props.twClassName - Optional Tailwind classes on the root
|
|
24
|
+
* @param props.twClassName - Optional Tailwind classes on the root Box
|
|
27
25
|
*
|
|
28
26
|
* @returns The rendered TitleAlert layout.
|
|
29
27
|
*/
|
|
30
28
|
export const TitleAlert = ({ severity, title, titleProps, titleWrapperProps, description, descriptionProps, twClassName = '', ...props }) => {
|
|
31
|
-
return (<
|
|
32
|
-
|
|
29
|
+
return (<Box flexDirection={BoxFlexDirection.Column} alignItems={BoxAlignItems.Center} gap={1} twClassName={twClassName} {...props}>
|
|
30
|
+
<IconAlert severity={severity} size={IconSize.Xl}/>
|
|
31
|
+
{title ? (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1} justifyContent={BoxJustifyContent.Center} twClassName="self-stretch" {...titleWrapperProps}>
|
|
32
|
+
<TextOrChildren textProps={{
|
|
33
|
+
variant: TextVariant.HeadingLg,
|
|
34
|
+
color: TextColor.TextDefault,
|
|
35
|
+
...titleProps,
|
|
36
|
+
}}>
|
|
37
|
+
{title}
|
|
38
|
+
</TextOrChildren>
|
|
39
|
+
</Box>) : null}
|
|
40
|
+
{description ? (<Box twClassName="self-stretch">
|
|
41
|
+
<TextOrChildren textProps={{
|
|
33
42
|
variant: TextVariant.BodySm,
|
|
34
43
|
color: TextColor.TextAlternative,
|
|
35
44
|
fontWeight: FontWeight.Medium,
|
|
36
45
|
...descriptionProps,
|
|
37
46
|
style: [{ textAlign: 'center' }, descriptionProps?.style],
|
|
38
47
|
}}>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
variant: TextVariant.HeadingLg,
|
|
44
|
-
color: TextColor.TextDefault,
|
|
45
|
-
...titleProps,
|
|
46
|
-
}}>
|
|
47
|
-
{title}
|
|
48
|
-
</BoxRow>) : null}
|
|
49
|
-
</BoxColumn>);
|
|
48
|
+
{description}
|
|
49
|
+
</TextOrChildren>
|
|
50
|
+
</Box>) : null}
|
|
51
|
+
</Box>);
|
|
50
52
|
};
|
|
51
53
|
TitleAlert.displayName = 'TitleAlert';
|
|
52
54
|
//# sourceMappingURL=TitleAlert.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleAlert.mjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,SAAS,EAAE,+BAAqB;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TitleAlert.mjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EA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G,CAAC,WAAW,CAAC,cAAc,CAC7B;UAAA,CAAC,cAAc,CACb,SAAS,CAAC,CAAC;gBACT,OAAO,EAAE,WAAW,CAAC,MAAM;gBAC3B,KAAK,EAAE,SAAS,CAAC,eAAe;gBAChC,UAAU,EAAE,UAAU,CAAC,MAAM;gBAC7B,GAAG,gBAAgB;gBACnB,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,KAAK,CAAC;aAC1D,CAAC,CAEF;YAAA,CAAC,WAAW,CACd;UAAA,EAAE,cAAc,CAClB;QAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n BoxJustifyContent,\n FontWeight,\n IconSize,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { IconAlert } from '../IconAlert';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { TitleAlertProps } from './TitleAlert.types';\n\n/**\n * Displays a severity-based {@link IconAlert} above a centered title row.\n * Remaining `View` props are forwarded to the root {@link Box}.\n *\n * @param props - Component props\n * @param props.severity - Passed to {@link IconAlert} for glyph and color\n * @param props.title - Title row content; row renders only when `title` is renderable\n * @param props.titleWrapperProps - Optional props spread onto the title row {@link Box}\n * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string\n * @param props.description - Optional text-centered description below the title; uses {@link TextOrChildren}\n * @param props.descriptionProps - Optional props merged into description `Text` when `description` is a string\n * @param props.twClassName - Optional Tailwind classes on the root Box\n *\n * @returns The rendered TitleAlert layout.\n */\nexport const TitleAlert: React.FC<TitleAlertProps> = ({\n severity,\n title,\n titleProps,\n titleWrapperProps,\n description,\n descriptionProps,\n twClassName = '',\n ...props\n}) => {\n return (\n <Box\n flexDirection={BoxFlexDirection.Column}\n alignItems={BoxAlignItems.Center}\n gap={1}\n twClassName={twClassName}\n {...props}\n >\n <IconAlert severity={severity} size={IconSize.Xl} />\n {title ? (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n justifyContent={BoxJustifyContent.Center}\n twClassName=\"self-stretch\"\n {...titleWrapperProps}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.HeadingLg,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </TextOrChildren>\n </Box>\n ) : null}\n {description ? (\n <Box twClassName=\"self-stretch\">\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n color: TextColor.TextAlternative,\n fontWeight: FontWeight.Medium,\n ...descriptionProps,\n style: [{ textAlign: 'center' }, descriptionProps?.style],\n }}\n >\n {description}\n </TextOrChildren>\n </Box>\n ) : null}\n </Box>\n );\n};\n\nTitleAlert.displayName = 'TitleAlert';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleAlert.types.cjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TitleAlertPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"TitleAlert.types.cjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TitleAlertPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleAlert component props (React Native).\n * Extends {@link TitleAlertPropsShared} with platform `Text` passthroughs, `twClassName`, and `View` props\n * forwarded to the root {@link Box}.\n */\nexport type TitleAlertProps = TitleAlertPropsShared & {\n /**\n * Optional props spread onto the title row {@link Box}. Omits `children` (TitleAlert sets it via\n * `title` and `titleProps`). Defaults to a row with centered items, `gap={1}`, `justifyContent`\n * center, and `twClassName` `self-stretch`; values on this object override those defaults when set.\n */\n titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props merged into title row `Text` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into description `Text` when `description` is a string.\n */\n descriptionProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type { TitleAlertPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import type { ViewProps } from "react-native";
|
|
3
|
-
import type {
|
|
3
|
+
import type { BoxProps } from "../Box/Box.types.cjs";
|
|
4
4
|
import type { TextProps } from "../Text/Text.types.cjs";
|
|
5
5
|
/**
|
|
6
6
|
* TitleAlert component props (React Native).
|
|
7
7
|
* Extends {@link TitleAlertPropsShared} with platform `Text` passthroughs, `twClassName`, and `View` props
|
|
8
|
-
* forwarded to the root {@link
|
|
8
|
+
* forwarded to the root {@link Box}.
|
|
9
9
|
*/
|
|
10
10
|
export type TitleAlertProps = TitleAlertPropsShared & {
|
|
11
11
|
/**
|
|
12
|
-
* Optional props spread onto the title row {@link
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
* to include `self-stretch`; values on this object override those defaults when set.
|
|
12
|
+
* Optional props spread onto the title row {@link Box}. Omits `children` (TitleAlert sets it via
|
|
13
|
+
* `title` and `titleProps`). Defaults to a row with centered items, `gap={1}`, `justifyContent`
|
|
14
|
+
* center, and `twClassName` `self-stretch`; values on this object override those defaults when set.
|
|
16
15
|
*/
|
|
17
|
-
titleWrapperProps?: Omit<Partial<
|
|
16
|
+
titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
18
17
|
/**
|
|
19
18
|
* Optional props merged into title row `Text` when `title` is a string.
|
|
20
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleAlert.types.d.cts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TitleAlert.types.d.cts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG;IACpD;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;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"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type { TitleAlertPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import type { ViewProps } from "react-native";
|
|
3
|
-
import type {
|
|
3
|
+
import type { BoxProps } from "../Box/Box.types.mjs";
|
|
4
4
|
import type { TextProps } from "../Text/Text.types.mjs";
|
|
5
5
|
/**
|
|
6
6
|
* TitleAlert component props (React Native).
|
|
7
7
|
* Extends {@link TitleAlertPropsShared} with platform `Text` passthroughs, `twClassName`, and `View` props
|
|
8
|
-
* forwarded to the root {@link
|
|
8
|
+
* forwarded to the root {@link Box}.
|
|
9
9
|
*/
|
|
10
10
|
export type TitleAlertProps = TitleAlertPropsShared & {
|
|
11
11
|
/**
|
|
12
|
-
* Optional props spread onto the title row {@link
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
* to include `self-stretch`; values on this object override those defaults when set.
|
|
12
|
+
* Optional props spread onto the title row {@link Box}. Omits `children` (TitleAlert sets it via
|
|
13
|
+
* `title` and `titleProps`). Defaults to a row with centered items, `gap={1}`, `justifyContent`
|
|
14
|
+
* center, and `twClassName` `self-stretch`; values on this object override those defaults when set.
|
|
16
15
|
*/
|
|
17
|
-
titleWrapperProps?: Omit<Partial<
|
|
16
|
+
titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
18
17
|
/**
|
|
19
18
|
* Optional props merged into title row `Text` when `title` is a string.
|
|
20
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleAlert.types.d.mts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TitleAlert.types.d.mts","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG;IACpD;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleAlert.types.mjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TitleAlertPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"TitleAlert.types.mjs","sourceRoot":"","sources":["../../../src/components/TitleAlert/TitleAlert.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TitleAlertPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleAlert component props (React Native).\n * Extends {@link TitleAlertPropsShared} with platform `Text` passthroughs, `twClassName`, and `View` props\n * forwarded to the root {@link Box}.\n */\nexport type TitleAlertProps = TitleAlertPropsShared & {\n /**\n * Optional props spread onto the title row {@link Box}. Omits `children` (TitleAlert sets it via\n * `title` and `titleProps`). Defaults to a row with centered items, `gap={1}`, `justifyContent`\n * center, and `twClassName` `self-stretch`; values on this object override those defaults when set.\n */\n titleWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props merged into title row `Text` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into description `Text` when `description` is a string.\n */\n descriptionProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
|