@metamask-previews/design-system-react 0.22.0-preview.178e60f → 0.23.1-preview.620b9f3
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 +25 -1
- package/dist/components/BannerAlert/BannerAlert.d.cts +58 -30
- package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.mts +58 -30
- package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.cts +58 -30
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.mts +58 -30
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
- package/dist/components/HelpText/HelpText.cjs +13 -0
- package/dist/components/HelpText/HelpText.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.constants.cjs +11 -0
- package/dist/components/HelpText/HelpText.constants.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.constants.d.cts +3 -0
- package/dist/components/HelpText/HelpText.constants.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.constants.d.mts +3 -0
- package/dist/components/HelpText/HelpText.constants.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.constants.mjs +8 -0
- package/dist/components/HelpText/HelpText.constants.mjs.map +1 -0
- package/dist/components/HelpText/HelpText.d.cts +4 -0
- package/dist/components/HelpText/HelpText.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.d.mts +4 -0
- package/dist/components/HelpText/HelpText.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.mjs +13 -0
- package/dist/components/HelpText/HelpText.mjs.map +1 -0
- package/dist/components/HelpText/HelpText.types.cjs +3 -0
- package/dist/components/HelpText/HelpText.types.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.types.d.cts +9 -0
- package/dist/components/HelpText/HelpText.types.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.types.d.mts +9 -0
- package/dist/components/HelpText/HelpText.types.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.types.mjs +2 -0
- package/dist/components/HelpText/HelpText.types.mjs.map +1 -0
- package/dist/components/HelpText/index.cjs +8 -0
- package/dist/components/HelpText/index.cjs.map +1 -0
- package/dist/components/HelpText/index.d.cts +4 -0
- package/dist/components/HelpText/index.d.cts.map +1 -0
- package/dist/components/HelpText/index.d.mts +4 -0
- package/dist/components/HelpText/index.d.mts.map +1 -0
- package/dist/components/HelpText/index.mjs +3 -0
- package/dist/components/HelpText/index.mjs.map +1 -0
- package/dist/components/Icon/icons/Telegram.cjs +1 -1
- package/dist/components/Icon/icons/Telegram.cjs.map +1 -1
- package/dist/components/Icon/icons/Telegram.mjs +1 -1
- package/dist/components/Icon/icons/Telegram.mjs.map +1 -1
- package/dist/components/Label/Label.cjs +38 -0
- package/dist/components/Label/Label.cjs.map +1 -0
- package/dist/components/Label/Label.d.cts +4 -0
- package/dist/components/Label/Label.d.cts.map +1 -0
- package/dist/components/Label/Label.d.mts +4 -0
- package/dist/components/Label/Label.d.mts.map +1 -0
- package/dist/components/Label/Label.mjs +19 -0
- package/dist/components/Label/Label.mjs.map +1 -0
- package/dist/components/Label/Label.types.cjs +3 -0
- package/dist/components/Label/Label.types.cjs.map +1 -0
- package/dist/components/Label/Label.types.d.cts +27 -0
- package/dist/components/Label/Label.types.d.cts.map +1 -0
- package/dist/components/Label/Label.types.d.mts +27 -0
- package/dist/components/Label/Label.types.d.mts.map +1 -0
- package/dist/components/Label/Label.types.mjs +2 -0
- package/dist/components/Label/Label.types.mjs.map +1 -0
- package/dist/components/Label/index.cjs +6 -0
- package/dist/components/Label/index.cjs.map +1 -0
- package/dist/components/Label/index.d.cts +3 -0
- package/dist/components/Label/index.d.cts.map +1 -0
- package/dist/components/Label/index.d.mts +3 -0
- package/dist/components/Label/index.d.mts.map +1 -0
- package/dist/components/Label/index.mjs +2 -0
- package/dist/components/Label/index.mjs.map +1 -0
- package/dist/components/Modal/Modal.types.cjs.map +1 -1
- package/dist/components/Modal/Modal.types.d.cts +2 -2
- package/dist/components/Modal/Modal.types.d.cts.map +1 -1
- package/dist/components/Modal/Modal.types.d.mts +2 -2
- package/dist/components/Modal/Modal.types.d.mts.map +1 -1
- package/dist/components/Modal/Modal.types.mjs.map +1 -1
- package/dist/components/ModalFocus/ModalFocus.types.cjs.map +1 -1
- package/dist/components/ModalFocus/ModalFocus.types.d.cts +2 -2
- package/dist/components/ModalFocus/ModalFocus.types.d.cts.map +1 -1
- package/dist/components/ModalFocus/ModalFocus.types.d.mts +2 -2
- package/dist/components/ModalFocus/ModalFocus.types.d.mts.map +1 -1
- package/dist/components/ModalFocus/ModalFocus.types.mjs.map +1 -1
- package/dist/components/ModalHeader/ModalHeader.cjs +55 -0
- package/dist/components/ModalHeader/ModalHeader.cjs.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.d.cts +55 -0
- package/dist/components/ModalHeader/ModalHeader.d.cts.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.d.mts +55 -0
- package/dist/components/ModalHeader/ModalHeader.d.mts.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.mjs +36 -0
- package/dist/components/ModalHeader/ModalHeader.mjs.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.types.cjs +3 -0
- package/dist/components/ModalHeader/ModalHeader.types.cjs.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.types.d.cts +69 -0
- package/dist/components/ModalHeader/ModalHeader.types.d.cts.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.types.d.mts +69 -0
- package/dist/components/ModalHeader/ModalHeader.types.d.mts.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.types.mjs +2 -0
- package/dist/components/ModalHeader/ModalHeader.types.mjs.map +1 -0
- package/dist/components/ModalHeader/index.cjs +6 -0
- package/dist/components/ModalHeader/index.cjs.map +1 -0
- package/dist/components/ModalHeader/index.d.cts +3 -0
- package/dist/components/ModalHeader/index.d.cts.map +1 -0
- package/dist/components/ModalHeader/index.d.mts +3 -0
- package/dist/components/ModalHeader/index.d.mts.map +1 -0
- package/dist/components/ModalHeader/index.mjs +2 -0
- package/dist/components/ModalHeader/index.mjs.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.cjs +60 -0
- package/dist/components/PopoverHeader/PopoverHeader.cjs.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.d.cts +55 -0
- package/dist/components/PopoverHeader/PopoverHeader.d.cts.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.d.mts +55 -0
- package/dist/components/PopoverHeader/PopoverHeader.d.mts.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.mjs +41 -0
- package/dist/components/PopoverHeader/PopoverHeader.mjs.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.cjs +3 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.cjs.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.d.cts +70 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.d.cts.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.d.mts +70 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.d.mts.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.mjs +2 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.mjs.map +1 -0
- package/dist/components/PopoverHeader/index.cjs +6 -0
- package/dist/components/PopoverHeader/index.cjs.map +1 -0
- package/dist/components/PopoverHeader/index.d.cts +3 -0
- package/dist/components/PopoverHeader/index.d.cts.map +1 -0
- package/dist/components/PopoverHeader/index.d.mts +3 -0
- package/dist/components/PopoverHeader/index.d.mts.map +1 -0
- package/dist/components/PopoverHeader/index.mjs +2 -0
- package/dist/components/PopoverHeader/index.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.cjs +47 -0
- package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.d.cts +4 -0
- package/dist/components/SensitiveText/SensitiveText.d.cts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.d.mts +4 -0
- package/dist/components/SensitiveText/SensitiveText.d.mts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.mjs +27 -0
- package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.cjs +3 -0
- package/dist/components/SensitiveText/SensitiveText.types.cjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.cts +11 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.cts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.mts +11 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.mts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.mjs +2 -0
- package/dist/components/SensitiveText/SensitiveText.types.mjs.map +1 -0
- package/dist/components/SensitiveText/index.cjs +8 -0
- package/dist/components/SensitiveText/index.cjs.map +1 -0
- package/dist/components/SensitiveText/index.d.cts +4 -0
- package/dist/components/SensitiveText/index.d.cts.map +1 -0
- package/dist/components/SensitiveText/index.d.mts +4 -0
- package/dist/components/SensitiveText/index.d.mts.map +1 -0
- package/dist/components/SensitiveText/index.mjs +3 -0
- package/dist/components/SensitiveText/index.mjs.map +1 -0
- package/dist/components/Text/Text.cjs +3 -1
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.constants.cjs.map +1 -1
- package/dist/components/Text/Text.constants.d.cts +1 -1
- package/dist/components/Text/Text.constants.d.cts.map +1 -1
- package/dist/components/Text/Text.constants.d.mts +1 -1
- package/dist/components/Text/Text.constants.d.mts.map +1 -1
- package/dist/components/Text/Text.constants.mjs.map +1 -1
- package/dist/components/Text/Text.d.cts.map +1 -1
- package/dist/components/Text/Text.d.mts.map +1 -1
- package/dist/components/Text/Text.mjs +3 -1
- package/dist/components/Text/Text.mjs.map +1 -1
- package/dist/components/Text/Text.types.cjs.map +1 -1
- package/dist/components/Text/Text.types.d.cts +2 -2
- package/dist/components/Text/Text.types.d.cts.map +1 -1
- package/dist/components/Text/Text.types.d.mts +2 -2
- package/dist/components/Text/Text.types.d.mts.map +1 -1
- package/dist/components/Text/Text.types.mjs.map +1 -1
- package/dist/components/index.cjs +14 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +10 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +10 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +5 -0
- package/dist/components/index.mjs.map +1 -1
- package/package.json +8 -6
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Props accepted by the auto-rendered back / close `ButtonIcon`. The
|
|
5
|
+
* component owns `iconName` (ArrowLeft / Close) and `size`
|
|
6
|
+
* (ButtonIconSize.Sm), so consumers cannot override them. The `data-*` index
|
|
7
|
+
* signature lets test ids and other dataset attributes pass through
|
|
8
|
+
* `Partial`/`Omit` indirection.
|
|
9
|
+
*
|
|
10
|
+
* `ariaLabel` is preserved as **required** (it is required on
|
|
11
|
+
* `ButtonIconProps`). The component does not pull from any i18n context, so
|
|
12
|
+
* consumers must pass a localized label explicitly:
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* closeButtonProps={{ ariaLabel: t('close') }}
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
type PopoverHeaderButtonProps = Omit<ButtonIconProps, 'iconName' | 'size' | 'onClick'> & {
|
|
19
|
+
[key: `data-${string}`]: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Discriminated pair: `onBack` and `backButtonProps` are co-required. If
|
|
23
|
+
* `onBack` is set, the consumer must also provide `backButtonProps` with a
|
|
24
|
+
* (required) `ariaLabel`. This enforces the no-i18n-fallback contract at
|
|
25
|
+
* compile time without an internal English default.
|
|
26
|
+
*/
|
|
27
|
+
type PopoverHeaderBackProps = {
|
|
28
|
+
onBack?: undefined;
|
|
29
|
+
backButtonProps?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
onBack: () => void;
|
|
32
|
+
backButtonProps: PopoverHeaderButtonProps;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Discriminated pair: `onClose` and `closeButtonProps` are co-required. Same
|
|
36
|
+
* shape and rationale as `PopoverHeaderBackProps`.
|
|
37
|
+
*/
|
|
38
|
+
type PopoverHeaderCloseProps = {
|
|
39
|
+
onClose?: undefined;
|
|
40
|
+
closeButtonProps?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
onClose: () => void;
|
|
43
|
+
closeButtonProps: PopoverHeaderButtonProps;
|
|
44
|
+
};
|
|
45
|
+
export type PopoverHeaderProps = Omit<ComponentProps<'header'>, 'children'> & PopoverHeaderBackProps & PopoverHeaderCloseProps & {
|
|
46
|
+
/**
|
|
47
|
+
* Header title content. When a string, it is auto-wrapped in a
|
|
48
|
+
* `Text` with `TextVariant.HeadingSm`, `TextAlign.Center`, and
|
|
49
|
+
* `TextColor.Inherit` so the title picks up the popover surface color.
|
|
50
|
+
* When a `ReactNode`, it is rendered as-is.
|
|
51
|
+
*/
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Optional override for the start (left in LTR) slot. When provided, it
|
|
55
|
+
* replaces the auto-rendered back button — even if `onBack` is set.
|
|
56
|
+
*/
|
|
57
|
+
startAccessory?: ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Optional override for the end (right in LTR) slot. When provided, it
|
|
60
|
+
* replaces the auto-rendered close button — even if `onClose` is set.
|
|
61
|
+
*/
|
|
62
|
+
endAccessory?: ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* Optional override for additional CSS classes applied to the
|
|
65
|
+
* PopoverHeader root. Merged with the component's defaults via `twMerge`.
|
|
66
|
+
*/
|
|
67
|
+
className?: string;
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=PopoverHeader.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverHeader.types.d.mts","sourceRoot":"","sources":["../../../src/components/PopoverHeader/PopoverHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD;;;;;;;;;;;;;;GAcG;AACH,KAAK,wBAAwB,GAAG,IAAI,CAClC,eAAe,EACf,UAAU,GAAG,MAAM,GAAG,SAAS,CAChC,GAAG;IACF,CAAC,GAAG,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF;;;;;GAKG;AACH,KAAK,sBAAsB,GACvB;IAAE,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,eAAe,CAAC,EAAE,SAAS,CAAA;CAAE,GACnD;IAAE,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,eAAe,EAAE,wBAAwB,CAAA;CAAE,CAAC;AAEtE;;;GAGG;AACH,KAAK,uBAAuB,GACxB;IAAE,OAAO,CAAC,EAAE,SAAS,CAAC;IAAC,gBAAgB,CAAC,EAAE,SAAS,CAAA;CAAE,GACrD;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,gBAAgB,EAAE,wBAAwB,CAAA;CAAE,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GACzE,sBAAsB,GACtB,uBAAuB,GAAG;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverHeader.types.mjs","sourceRoot":"","sources":["../../../src/components/PopoverHeader/PopoverHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport type { ButtonIconProps } from '../ButtonIcon';\n\n/**\n * Props accepted by the auto-rendered back / close `ButtonIcon`. The\n * component owns `iconName` (ArrowLeft / Close) and `size`\n * (ButtonIconSize.Sm), so consumers cannot override them. The `data-*` index\n * signature lets test ids and other dataset attributes pass through\n * `Partial`/`Omit` indirection.\n *\n * `ariaLabel` is preserved as **required** (it is required on\n * `ButtonIconProps`). The component does not pull from any i18n context, so\n * consumers must pass a localized label explicitly:\n *\n * ```tsx\n * closeButtonProps={{ ariaLabel: t('close') }}\n * ```\n */\ntype PopoverHeaderButtonProps = Omit<\n ButtonIconProps,\n 'iconName' | 'size' | 'onClick'\n> & {\n [key: `data-${string}`]: string | undefined;\n};\n\n/**\n * Discriminated pair: `onBack` and `backButtonProps` are co-required. If\n * `onBack` is set, the consumer must also provide `backButtonProps` with a\n * (required) `ariaLabel`. This enforces the no-i18n-fallback contract at\n * compile time without an internal English default.\n */\ntype PopoverHeaderBackProps =\n | { onBack?: undefined; backButtonProps?: undefined }\n | { onBack: () => void; backButtonProps: PopoverHeaderButtonProps };\n\n/**\n * Discriminated pair: `onClose` and `closeButtonProps` are co-required. Same\n * shape and rationale as `PopoverHeaderBackProps`.\n */\ntype PopoverHeaderCloseProps =\n | { onClose?: undefined; closeButtonProps?: undefined }\n | { onClose: () => void; closeButtonProps: PopoverHeaderButtonProps };\n\nexport type PopoverHeaderProps = Omit<ComponentProps<'header'>, 'children'> &\n PopoverHeaderBackProps &\n PopoverHeaderCloseProps & {\n /**\n * Header title content. When a string, it is auto-wrapped in a\n * `Text` with `TextVariant.HeadingSm`, `TextAlign.Center`, and\n * `TextColor.Inherit` so the title picks up the popover surface color.\n * When a `ReactNode`, it is rendered as-is.\n */\n children?: ReactNode;\n /**\n * Optional override for the start (left in LTR) slot. When provided, it\n * replaces the auto-rendered back button — even if `onBack` is set.\n */\n startAccessory?: ReactNode;\n /**\n * Optional override for the end (right in LTR) slot. When provided, it\n * replaces the auto-rendered close button — even if `onClose` is set.\n */\n endAccessory?: ReactNode;\n /**\n * Optional override for additional CSS classes applied to the\n * PopoverHeader root. Merged with the component's defaults via `twMerge`.\n */\n className?: string;\n };\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PopoverHeader = void 0;
|
|
4
|
+
var PopoverHeader_1 = require("./PopoverHeader.cjs");
|
|
5
|
+
Object.defineProperty(exports, "PopoverHeader", { enumerable: true, get: function () { return PopoverHeader_1.PopoverHeader; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/PopoverHeader/index.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAAvC,8GAAA,aAAa,OAAA","sourcesContent":["export { PopoverHeader } from './PopoverHeader';\nexport type { PopoverHeaderProps } from './PopoverHeader.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/PopoverHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/PopoverHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/PopoverHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,4BAAwB","sourcesContent":["export { PopoverHeader } from './PopoverHeader';\nexport type { PopoverHeaderProps } from './PopoverHeader.types';\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SensitiveText = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const Text_1 = require("../Text/index.cjs");
|
|
30
|
+
const isValidLength = (value) => {
|
|
31
|
+
const num = Number(value);
|
|
32
|
+
return !Number.isNaN(num) && num > 0;
|
|
33
|
+
};
|
|
34
|
+
const SensitiveText = ({ isHidden = false, length = design_system_shared_1.SensitiveTextLength.Short, children, ...props }) => {
|
|
35
|
+
const fallback = (0, react_1.useMemo)(() => {
|
|
36
|
+
let resolvedLength = length;
|
|
37
|
+
if (!(length in design_system_shared_1.SensitiveTextLength) && !isValidLength(length)) {
|
|
38
|
+
console.warn(`Invalid length provided: ${length}. Falling back to Short.`);
|
|
39
|
+
resolvedLength = design_system_shared_1.SensitiveTextLength.Short;
|
|
40
|
+
}
|
|
41
|
+
const numLength = Number(resolvedLength);
|
|
42
|
+
return '•'.repeat(Number.isNaN(numLength) ? 0 : numLength);
|
|
43
|
+
}, [length]);
|
|
44
|
+
return react_1.default.createElement(Text_1.Text, { ...props }, isHidden ? fallback : children);
|
|
45
|
+
};
|
|
46
|
+
exports.SensitiveText = SensitiveText;
|
|
47
|
+
//# sourceMappingURL=SensitiveText.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensitiveText.cjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAA8E;AAC9E,+CAAuC;AAEvC,4CAA+B;AAI/B,MAAM,aAAa,GAAG,CAAC,KAAa,EAAW,EAAE;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AAEK,MAAM,aAAa,GAAiC,CAAC,EAC1D,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,0CAAmB,CAAC,KAAK,EAClC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC5B,IAAI,cAAc,GAAG,MAAM,CAAC;QAE5B,IAAI,CAAC,CAAC,MAAM,IAAI,0CAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;YAC9D,OAAO,CAAC,IAAI,CACV,4BAA4B,MAAM,0BAA0B,CAC7D,CAAC;YACF,cAAc,GAAG,0CAAmB,CAAC,KAAK,CAAC;SAC5C;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QACzC,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,8BAAC,WAAI,OAAK,KAAK,IAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAQ,CAAC;AAClE,CAAC,CAAC;AArBW,QAAA,aAAa,iBAqBxB","sourcesContent":["import { SensitiveTextLength } from '@metamask-previews/design-system-shared';\nimport React, { useMemo } from 'react';\n\nimport { Text } from '../Text';\n\nimport type { SensitiveTextProps } from './SensitiveText.types';\n\nconst isValidLength = (value: string): boolean => {\n const num = Number(value);\n return !Number.isNaN(num) && num > 0;\n};\n\nexport const SensitiveText: React.FC<SensitiveTextProps> = ({\n isHidden = false,\n length = SensitiveTextLength.Short,\n children,\n ...props\n}) => {\n const fallback = useMemo(() => {\n let resolvedLength = length;\n\n if (!(length in SensitiveTextLength) && !isValidLength(length)) {\n console.warn(\n `Invalid length provided: ${length}. Falling back to Short.`,\n );\n resolvedLength = SensitiveTextLength.Short;\n }\n\n const numLength = Number(resolvedLength);\n return '•'.repeat(Number.isNaN(numLength) ? 0 : numLength);\n }, [length]);\n\n return <Text {...props}>{isHidden ? fallback : children}</Text>;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensitiveText.d.cts","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,cAAc;AAIvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAOhE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqBtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensitiveText.d.mts","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,cAAc;AAIvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAOhE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqBtD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { SensitiveTextLength } from "@metamask-previews/design-system-shared";
|
|
8
|
+
import $React, { useMemo } from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { Text } from "../Text/index.mjs";
|
|
11
|
+
const isValidLength = (value) => {
|
|
12
|
+
const num = Number(value);
|
|
13
|
+
return !Number.isNaN(num) && num > 0;
|
|
14
|
+
};
|
|
15
|
+
export const SensitiveText = ({ isHidden = false, length = SensitiveTextLength.Short, children, ...props }) => {
|
|
16
|
+
const fallback = useMemo(() => {
|
|
17
|
+
let resolvedLength = length;
|
|
18
|
+
if (!(length in SensitiveTextLength) && !isValidLength(length)) {
|
|
19
|
+
console.warn(`Invalid length provided: ${length}. Falling back to Short.`);
|
|
20
|
+
resolvedLength = SensitiveTextLength.Short;
|
|
21
|
+
}
|
|
22
|
+
const numLength = Number(resolvedLength);
|
|
23
|
+
return '•'.repeat(Number.isNaN(numLength) ? 0 : numLength);
|
|
24
|
+
}, [length]);
|
|
25
|
+
return React.createElement(Text, { ...props }, isHidden ? fallback : children);
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=SensitiveText.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensitiveText.mjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAC9E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AAEvC,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,aAAa,GAAG,CAAC,KAAa,EAAW,EAAE;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAClC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,IAAI,cAAc,GAAG,MAAM,CAAC;QAE5B,IAAI,CAAC,CAAC,MAAM,IAAI,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;YAC9D,OAAO,CAAC,IAAI,CACV,4BAA4B,MAAM,0BAA0B,CAC7D,CAAC;YACF,cAAc,GAAG,mBAAmB,CAAC,KAAK,CAAC;SAC5C;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QACzC,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,oBAAC,IAAI,OAAK,KAAK,IAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAQ,CAAC;AAClE,CAAC,CAAC","sourcesContent":["import { SensitiveTextLength } from '@metamask-previews/design-system-shared';\nimport React, { useMemo } from 'react';\n\nimport { Text } from '../Text';\n\nimport type { SensitiveTextProps } from './SensitiveText.types';\n\nconst isValidLength = (value: string): boolean => {\n const num = Number(value);\n return !Number.isNaN(num) && num > 0;\n};\n\nexport const SensitiveText: React.FC<SensitiveTextProps> = ({\n isHidden = false,\n length = SensitiveTextLength.Short,\n children,\n ...props\n}) => {\n const fallback = useMemo(() => {\n let resolvedLength = length;\n\n if (!(length in SensitiveTextLength) && !isValidLength(length)) {\n console.warn(\n `Invalid length provided: ${length}. Falling back to Short.`,\n );\n resolvedLength = SensitiveTextLength.Short;\n }\n\n const numLength = Number(resolvedLength);\n return '•'.repeat(Number.isNaN(numLength) ? 0 : numLength);\n }, [length]);\n\n return <Text {...props}>{isHidden ? fallback : children}</Text>;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensitiveText.types.cjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SensitiveTextPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * SensitiveText component props (React platform-specific).\n *\n * Extends shared props from `@metamask-previews/design-system-shared` with the platform\n * `TextProps` so consumers inherit `variant`, `color`, `fontWeight`, `className`,\n * `style`, `data-testid`, etc.\n */\nexport type SensitiveTextProps = SensitiveTextPropsShared & TextProps;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SensitiveTextPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { TextProps } from "../Text/Text.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* SensitiveText component props (React platform-specific).
|
|
5
|
+
*
|
|
6
|
+
* Extends shared props from `@metamask-previews/design-system-shared` with the platform
|
|
7
|
+
* `TextProps` so consumers inherit `variant`, `color`, `fontWeight`, `className`,
|
|
8
|
+
* `style`, `data-testid`, etc.
|
|
9
|
+
*/
|
|
10
|
+
export type SensitiveTextProps = SensitiveTextPropsShared & TextProps;
|
|
11
|
+
//# sourceMappingURL=SensitiveText.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensitiveText.types.d.cts","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AAExF,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SensitiveTextPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { TextProps } from "../Text/Text.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* SensitiveText component props (React platform-specific).
|
|
5
|
+
*
|
|
6
|
+
* Extends shared props from `@metamask-previews/design-system-shared` with the platform
|
|
7
|
+
* `TextProps` so consumers inherit `variant`, `color`, `fontWeight`, `className`,
|
|
8
|
+
* `style`, `data-testid`, etc.
|
|
9
|
+
*/
|
|
10
|
+
export type SensitiveTextProps = SensitiveTextPropsShared & TextProps;
|
|
11
|
+
//# sourceMappingURL=SensitiveText.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensitiveText.types.d.mts","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AAExF,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SensitiveText.types.mjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/SensitiveText.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SensitiveTextPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * SensitiveText component props (React platform-specific).\n *\n * Extends shared props from `@metamask-previews/design-system-shared` with the platform\n * `TextProps` so consumers inherit `variant`, `color`, `fontWeight`, `className`,\n * `style`, `data-testid`, etc.\n */\nexport type SensitiveTextProps = SensitiveTextPropsShared & TextProps;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SensitiveText = exports.SensitiveTextLength = void 0;
|
|
4
|
+
var design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "SensitiveTextLength", { enumerable: true, get: function () { return design_system_shared_1.SensitiveTextLength; } });
|
|
6
|
+
var SensitiveText_1 = require("./SensitiveText.cjs");
|
|
7
|
+
Object.defineProperty(exports, "SensitiveText", { enumerable: true, get: function () { return SensitiveText_1.SensitiveText; } });
|
|
8
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/index.ts"],"names":[],"mappings":";;;AAAA,gFAA8E;AAArE,2HAAA,mBAAmB,OAAA;AAC5B,qDAAgD;AAAvC,8GAAA,aAAa,OAAA","sourcesContent":["export { SensitiveTextLength } from '@metamask-previews/design-system-shared';\nexport { SensitiveText } from './SensitiveText';\nexport type { SensitiveTextProps } from './SensitiveText.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SensitiveText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAC9E,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/SensitiveText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAC9E,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/SensitiveText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gDAAgD;AAC9E,OAAO,EAAE,aAAa,EAAE,4BAAwB","sourcesContent":["export { SensitiveTextLength } from '@metamask-previews/design-system-shared';\nexport { SensitiveText } from './SensitiveText';\nexport type { SensitiveTextProps } from './SensitiveText.types';\n"]}
|
|
@@ -12,7 +12,9 @@ const Text_constants_1 = require("./Text.constants.cjs");
|
|
|
12
12
|
const Text = ({ variant = design_system_shared_1.TextVariant.BodyMd, children, className, fontWeight, fontFamily = design_system_shared_1.FontFamily.Default, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = design_system_shared_1.TextColor.TextDefault, style, ...props }) => {
|
|
13
13
|
// When asChild is true, use Radix Slot to merge props onto the child component.
|
|
14
14
|
// Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
|
|
15
|
-
const Component = asChild
|
|
15
|
+
const Component = asChild
|
|
16
|
+
? react_slot_1.Slot
|
|
17
|
+
: Text_constants_1.MAP_TEXT_VARIANT_TAG[variant];
|
|
16
18
|
const mergedClassName = `${(0, tw_merge_1.twMerge)(color, Text_constants_1.TWCLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight
|
|
17
19
|
? Text_constants_1.TWCLASSMAP_TEXT_FONTWEIGHT[fontWeight]
|
|
18
20
|
: Text_constants_1.TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle ? Text_constants_1.TWCLASSMAP_TEXT_FONTSTYLE[fontStyle] : undefined, Text_constants_1.TWCLASSMAP_TEXT_FONTFAMILY[fontFamily], textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAIiD;AACjD,qDAA4C;AAC5C,kDAA0B;AAE1B,uDAA+C;AAE/C,yDAO0B;AAGnB,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,kCAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,iCAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,gCAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAIiD;AACjD,qDAA4C;AAC5C,kDAA0B;AAE1B,uDAA+C;AAE/C,yDAO0B;AAGnB,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,kCAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,iCAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,gCAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAsB,OAAO;QAC1C,CAAC,CAAC,iBAAI;QACN,CAAC,CAAC,qCAAoB,CAAC,OAAO,CAAC,CAAC;IAElC,MAAM,eAAe,GAAG,GAAG,IAAA,kBAAO,EAChC,KAAK,EACL,kDAAiC,CAAC,OAAO,CAAC,EAC1C,UAAU;QACR,CAAC,CAAC,2CAA0B,CAAC,UAAU,CAAC;QACxC,CAAC,CAAC,mDAAkC,CAAC,OAAO,CAAC,EAC/C,SAAS,CAAC,CAAC,CAAC,0CAAyB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAC5D,2CAA0B,CAAC,UAAU,CAAC,EACtC,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,EAAE,CAAC;IAEJ,OAAO,CACL,8BAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IAC3D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AA1CW,QAAA,IAAI,QA0Cf","sourcesContent":["import {\n FontFamily,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n TWCLASSMAP_TEXT_VARIANT_FONTSTYLE,\n TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTFAMILY,\n TWCLASSMAP_TEXT_FONTSTYLE,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n MAP_TEXT_VARIANT_TAG,\n} from './Text.constants';\nimport type { TextProps } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontFamily = FontFamily.Default,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\n ...props\n}) => {\n // When asChild is true, use Radix Slot to merge props onto the child component.\n // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).\n const Component: React.ElementType = asChild\n ? Slot\n : MAP_TEXT_VARIANT_TAG[variant];\n\n const mergedClassName = `${twMerge(\n color,\n TWCLASSMAP_TEXT_VARIANT_FONTSTYLE[variant],\n fontWeight\n ? TWCLASSMAP_TEXT_FONTWEIGHT[fontWeight]\n : TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle ? TWCLASSMAP_TEXT_FONTSTYLE[fontStyle] : undefined,\n TWCLASSMAP_TEXT_FONTFAMILY[fontFamily],\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n )}`;\n\n return (\n <Component className={mergedClassName} style={style} {...props}>\n {children}\n </Component>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";;;AAAA,kFAKiD;AAEpC,QAAA,0BAA0B,GAA+B;IACpE,CAAC,iCAAU,CAAC,IAAI,CAAC,EAAE,WAAW;IAC9B,CAAC,iCAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,iCAAU,CAAC,OAAO,CAAC,EAAE,cAAc;CACrC,CAAC;AAEW,QAAA,0BAA0B,GAA+B;IACpE,CAAC,iCAAU,CAAC,OAAO,CAAC,EAAE,cAAc;IACpC,CAAC,iCAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,iCAAU,CAAC,IAAI,CAAC,EAAE,WAAW;CAC/B,CAAC;AAEW,QAAA,yBAAyB,GAA8B;IAClE,CAAC,gCAAS,CAAC,MAAM,CAAC,EAAE,QAAQ;IAC5B,CAAC,gCAAS,CAAC,MAAM,CAAC,EAAE,YAAY;CACjC,CAAC;AAEW,QAAA,iCAAiC,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,CAAC,kCAAW,CAAC,WAAW,CAAC,EAAE,WAAW;IACtC,CAAC,kCAAW,CAAC,cAAc,CAAC,EAAE,WAAW;IACzC,CAAC,kCAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,kCAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,kCAAW,CAAC,eAAe,CAAC,EAAE,0BAA0B;CAC1D,CAAC;AAEW,QAAA,oBAAoB,GAG7B;IACF,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,kCAAW,CAAC,WAAW,CAAC,EAAE,IAAI;IAC/B,CAAC,kCAAW,CAAC,cAAc,CAAC,EAAE,IAAI;IAClC,CAAC,kCAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,kCAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,kCAAW,CAAC,eAAe,CAAC,EAAE,MAAM;CACtC,CAAC","sourcesContent":["import {\n FontFamily,\n FontStyle,\n FontWeight,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_TEXT_FONTWEIGHT: Record<FontWeight, string> = {\n [FontWeight.Bold]: 'font-bold',\n [FontWeight.Medium]: 'font-medium',\n [FontWeight.Regular]: 'font-regular',\n};\n\nexport const TWCLASSMAP_TEXT_FONTFAMILY: Record<FontFamily, string> = {\n [FontFamily.Default]: 'font-default',\n [FontFamily.Accent]: 'font-accent',\n [FontFamily.Hero]: 'font-hero',\n};\n\nexport const TWCLASSMAP_TEXT_FONTSTYLE: Record<FontStyle, string> = {\n [FontStyle.Italic]: 'italic',\n [FontStyle.Normal]: 'not-italic',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-s-display-lg leading-s-display-lg tracking-s-display-lg md:text-l-display-lg md:leading-l-display-lg md:tracking-l-display-lg',\n [TextVariant.DisplayMd]:\n 'text-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:leading-l-display-md md:tracking-l-display-md',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg md:leading-l-heading-lg md:tracking-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md md:leading-l-heading-md md:tracking-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm md:leading-l-heading-sm md:tracking-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg md:leading-l-body-lg md:tracking-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm md:leading-l-body-sm md:tracking-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs md:leading-l-body-xs md:tracking-l-body-xs',\n [TextVariant.PageHeading]:\n 'text-s-page-heading leading-s-page-heading tracking-s-page-heading md:text-l-page-heading md:leading-l-page-heading md:tracking-l-page-heading',\n [TextVariant.SectionHeading]:\n 'text-s-section-heading leading-s-section-heading tracking-s-section-heading md:text-l-section-heading md:leading-l-section-heading md:tracking-l-section-heading',\n [TextVariant.ButtonLabelMd]:\n 'text-s-button-label-md leading-s-button-label-md tracking-s-button-label-md md:text-l-button-label-md md:leading-l-button-label-md md:tracking-l-button-label-md',\n [TextVariant.ButtonLabelLg]:\n 'text-s-button-label-lg leading-s-button-label-lg tracking-s-button-label-lg md:text-l-button-label-lg md:leading-l-button-label-lg md:tracking-l-button-label-lg',\n [TextVariant.AmountDisplayLg]:\n 'text-s-amount-display-lg leading-s-amount-display-lg tracking-s-amount-display-lg md:text-l-amount-display-lg md:leading-l-amount-display-lg md:tracking-l-amount-display-lg',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]: 'font-bold md:font-medium',\n [TextVariant.DisplayMd]: 'font-bold md:font-medium',\n [TextVariant.HeadingLg]: 'font-bold',\n [TextVariant.HeadingMd]: 'font-bold',\n [TextVariant.HeadingSm]: 'font-bold',\n [TextVariant.BodyLg]: 'font-medium',\n [TextVariant.BodyMd]: 'font-regular',\n [TextVariant.BodySm]: 'font-regular',\n [TextVariant.BodyXs]: 'font-regular',\n [TextVariant.PageHeading]: 'font-bold',\n [TextVariant.SectionHeading]: 'font-bold',\n [TextVariant.ButtonLabelMd]: 'font-medium',\n [TextVariant.ButtonLabelLg]: 'font-medium',\n [TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',\n};\n\nexport const MAP_TEXT_VARIANT_TAG: Record<\n TextVariant,\n keyof JSX.IntrinsicElements\n> = {\n [TextVariant.DisplayLg]: 'h1',\n [TextVariant.DisplayMd]: 'h1',\n [TextVariant.HeadingLg]: 'h2',\n [TextVariant.HeadingMd]: 'h3',\n [TextVariant.HeadingSm]: 'h4',\n [TextVariant.BodyLg]: 'p',\n [TextVariant.BodyMd]: 'p',\n [TextVariant.BodySm]: 'p',\n [TextVariant.BodyXs]: 'p',\n [TextVariant.PageHeading]: 'h1',\n [TextVariant.SectionHeading]: 'h2',\n [TextVariant.ButtonLabelMd]: 'span',\n [TextVariant.ButtonLabelLg]: 'span',\n [TextVariant.AmountDisplayLg]: 'span',\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";;;AAAA,kFAKiD;AAEpC,QAAA,0BAA0B,GAA+B;IACpE,CAAC,iCAAU,CAAC,IAAI,CAAC,EAAE,WAAW;IAC9B,CAAC,iCAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,iCAAU,CAAC,OAAO,CAAC,EAAE,cAAc;CACrC,CAAC;AAEW,QAAA,0BAA0B,GAA+B;IACpE,CAAC,iCAAU,CAAC,OAAO,CAAC,EAAE,cAAc;IACpC,CAAC,iCAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,iCAAU,CAAC,IAAI,CAAC,EAAE,WAAW;CAC/B,CAAC;AAEW,QAAA,yBAAyB,GAA8B;IAClE,CAAC,gCAAS,CAAC,MAAM,CAAC,EAAE,QAAQ;IAC5B,CAAC,gCAAS,CAAC,MAAM,CAAC,EAAE,YAAY;CACjC,CAAC;AAEW,QAAA,iCAAiC,GAAgC;IAC5E,CAAC,kCAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,kCAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,kCAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,kCAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,kCAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,kCAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,kCAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,kCAAW,CAAC,MAAM,CAAC,E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AC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,kCAAW,CAAC,WAAW,CAAC,EAAE,IAAI;IAC/B,CAAC,kCAAW,CAAC,cAAc,CAAC,EAAE,IAAI;IAClC,CAAC,kCAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,kCAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,kCAAW,CAAC,eAAe,CAAC,EAAE,MAAM;CACtC,CAAC","sourcesContent":["import {\n FontFamily,\n FontStyle,\n FontWeight,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_TEXT_FONTWEIGHT: Record<FontWeight, string> = {\n [FontWeight.Bold]: 'font-bold',\n [FontWeight.Medium]: 'font-medium',\n [FontWeight.Regular]: 'font-regular',\n};\n\nexport const TWCLASSMAP_TEXT_FONTFAMILY: Record<FontFamily, string> = {\n [FontFamily.Default]: 'font-default',\n [FontFamily.Accent]: 'font-accent',\n [FontFamily.Hero]: 'font-hero',\n};\n\nexport const TWCLASSMAP_TEXT_FONTSTYLE: Record<FontStyle, string> = {\n [FontStyle.Italic]: 'italic',\n [FontStyle.Normal]: 'not-italic',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-s-display-lg leading-s-display-lg tracking-s-display-lg md:text-l-display-lg md:leading-l-display-lg md:tracking-l-display-lg',\n [TextVariant.DisplayMd]:\n 'text-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:leading-l-display-md md:tracking-l-display-md',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg md:leading-l-heading-lg md:tracking-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md md:leading-l-heading-md md:tracking-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm md:leading-l-heading-sm md:tracking-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg md:leading-l-body-lg md:tracking-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm md:leading-l-body-sm md:tracking-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs md:leading-l-body-xs md:tracking-l-body-xs',\n [TextVariant.PageHeading]:\n 'text-s-page-heading leading-s-page-heading tracking-s-page-heading md:text-l-page-heading md:leading-l-page-heading md:tracking-l-page-heading',\n [TextVariant.SectionHeading]:\n 'text-s-section-heading leading-s-section-heading tracking-s-section-heading md:text-l-section-heading md:leading-l-section-heading md:tracking-l-section-heading',\n [TextVariant.ButtonLabelMd]:\n 'text-s-button-label-md leading-s-button-label-md tracking-s-button-label-md md:text-l-button-label-md md:leading-l-button-label-md md:tracking-l-button-label-md',\n [TextVariant.ButtonLabelLg]:\n 'text-s-button-label-lg leading-s-button-label-lg tracking-s-button-label-lg md:text-l-button-label-lg md:leading-l-button-label-lg md:tracking-l-button-label-lg',\n [TextVariant.AmountDisplayLg]:\n 'text-s-amount-display-lg leading-s-amount-display-lg tracking-s-amount-display-lg md:text-l-amount-display-lg md:leading-l-amount-display-lg md:tracking-l-amount-display-lg',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]: 'font-bold md:font-medium',\n [TextVariant.DisplayMd]: 'font-bold md:font-medium',\n [TextVariant.HeadingLg]: 'font-bold',\n [TextVariant.HeadingMd]: 'font-bold',\n [TextVariant.HeadingSm]: 'font-bold',\n [TextVariant.BodyLg]: 'font-medium',\n [TextVariant.BodyMd]: 'font-regular',\n [TextVariant.BodySm]: 'font-regular',\n [TextVariant.BodyXs]: 'font-regular',\n [TextVariant.PageHeading]: 'font-bold',\n [TextVariant.SectionHeading]: 'font-bold',\n [TextVariant.ButtonLabelMd]: 'font-medium',\n [TextVariant.ButtonLabelLg]: 'font-medium',\n [TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',\n};\n\nexport const MAP_TEXT_VARIANT_TAG: Record<\n TextVariant,\n keyof React.JSX.IntrinsicElements\n> = {\n [TextVariant.DisplayLg]: 'h1',\n [TextVariant.DisplayMd]: 'h1',\n [TextVariant.HeadingLg]: 'h2',\n [TextVariant.HeadingMd]: 'h3',\n [TextVariant.HeadingSm]: 'h4',\n [TextVariant.BodyLg]: 'p',\n [TextVariant.BodyMd]: 'p',\n [TextVariant.BodySm]: 'p',\n [TextVariant.BodyXs]: 'p',\n [TextVariant.PageHeading]: 'h1',\n [TextVariant.SectionHeading]: 'h2',\n [TextVariant.ButtonLabelMd]: 'span',\n [TextVariant.ButtonLabelLg]: 'span',\n [TextVariant.AmountDisplayLg]: 'span',\n};\n"]}
|
|
@@ -5,5 +5,5 @@ export declare const TWCLASSMAP_TEXT_FONTFAMILY: Record<FontFamily, string>;
|
|
|
5
5
|
export declare const TWCLASSMAP_TEXT_FONTSTYLE: Record<FontStyle, string>;
|
|
6
6
|
export declare const TWCLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string>;
|
|
7
7
|
export declare const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string>;
|
|
8
|
-
export declare const MAP_TEXT_VARIANT_TAG: Record<TextVariant, keyof JSX.IntrinsicElements>;
|
|
8
|
+
export declare const MAP_TEXT_VARIANT_TAG: Record<TextVariant, keyof React.JSX.IntrinsicElements>;
|
|
9
9
|
//# sourceMappingURL=Text.constants.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACZ,gDAAgD;AAEjD,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIjE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIjE,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG/D,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BzE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAe1E,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,GAAG,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACZ,gDAAgD;AAEjD,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIjE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIjE,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG/D,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BzE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAe1E,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAgBlC,CAAC"}
|
|
@@ -5,5 +5,5 @@ export declare const TWCLASSMAP_TEXT_FONTFAMILY: Record<FontFamily, string>;
|
|
|
5
5
|
export declare const TWCLASSMAP_TEXT_FONTSTYLE: Record<FontStyle, string>;
|
|
6
6
|
export declare const TWCLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string>;
|
|
7
7
|
export declare const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string>;
|
|
8
|
-
export declare const MAP_TEXT_VARIANT_TAG: Record<TextVariant, keyof JSX.IntrinsicElements>;
|
|
8
|
+
export declare const MAP_TEXT_VARIANT_TAG: Record<TextVariant, keyof React.JSX.IntrinsicElements>;
|
|
9
9
|
//# sourceMappingURL=Text.constants.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACZ,gDAAgD;AAEjD,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIjE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIjE,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG/D,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BzE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAe1E,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,GAAG,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACZ,gDAAgD;AAEjD,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIjE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIjE,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG/D,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BzE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAe1E,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAgBlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACZ,gDAAgD;AAEjD,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,WAAW;IAC9B,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,cAAc;CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,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AW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,MAAM;CACtC,CAAC","sourcesContent":["import {\n FontFamily,\n FontStyle,\n FontWeight,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_TEXT_FONTWEIGHT: Record<FontWeight, string> = {\n [FontWeight.Bold]: 'font-bold',\n [FontWeight.Medium]: 'font-medium',\n [FontWeight.Regular]: 'font-regular',\n};\n\nexport const TWCLASSMAP_TEXT_FONTFAMILY: Record<FontFamily, string> = {\n [FontFamily.Default]: 'font-default',\n [FontFamily.Accent]: 'font-accent',\n [FontFamily.Hero]: 'font-hero',\n};\n\nexport const TWCLASSMAP_TEXT_FONTSTYLE: Record<FontStyle, string> = {\n [FontStyle.Italic]: 'italic',\n [FontStyle.Normal]: 'not-italic',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-s-display-lg leading-s-display-lg tracking-s-display-lg md:text-l-display-lg md:leading-l-display-lg md:tracking-l-display-lg',\n [TextVariant.DisplayMd]:\n 'text-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:leading-l-display-md md:tracking-l-display-md',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg md:leading-l-heading-lg md:tracking-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md md:leading-l-heading-md md:tracking-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm md:leading-l-heading-sm md:tracking-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg md:leading-l-body-lg md:tracking-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm md:leading-l-body-sm md:tracking-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs md:leading-l-body-xs md:tracking-l-body-xs',\n [TextVariant.PageHeading]:\n 'text-s-page-heading leading-s-page-heading tracking-s-page-heading md:text-l-page-heading md:leading-l-page-heading md:tracking-l-page-heading',\n [TextVariant.SectionHeading]:\n 'text-s-section-heading leading-s-section-heading tracking-s-section-heading md:text-l-section-heading md:leading-l-section-heading md:tracking-l-section-heading',\n [TextVariant.ButtonLabelMd]:\n 'text-s-button-label-md leading-s-button-label-md tracking-s-button-label-md md:text-l-button-label-md md:leading-l-button-label-md md:tracking-l-button-label-md',\n [TextVariant.ButtonLabelLg]:\n 'text-s-button-label-lg leading-s-button-label-lg tracking-s-button-label-lg md:text-l-button-label-lg md:leading-l-button-label-lg md:tracking-l-button-label-lg',\n [TextVariant.AmountDisplayLg]:\n 'text-s-amount-display-lg leading-s-amount-display-lg tracking-s-amount-display-lg md:text-l-amount-display-lg md:leading-l-amount-display-lg md:tracking-l-amount-display-lg',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]: 'font-bold md:font-medium',\n [TextVariant.DisplayMd]: 'font-bold md:font-medium',\n [TextVariant.HeadingLg]: 'font-bold',\n [TextVariant.HeadingMd]: 'font-bold',\n [TextVariant.HeadingSm]: 'font-bold',\n [TextVariant.BodyLg]: 'font-medium',\n [TextVariant.BodyMd]: 'font-regular',\n [TextVariant.BodySm]: 'font-regular',\n [TextVariant.BodyXs]: 'font-regular',\n [TextVariant.PageHeading]: 'font-bold',\n [TextVariant.SectionHeading]: 'font-bold',\n [TextVariant.ButtonLabelMd]: 'font-medium',\n [TextVariant.ButtonLabelLg]: 'font-medium',\n [TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',\n};\n\nexport const MAP_TEXT_VARIANT_TAG: Record<\n TextVariant,\n keyof JSX.IntrinsicElements\n> = {\n [TextVariant.DisplayLg]: 'h1',\n [TextVariant.DisplayMd]: 'h1',\n [TextVariant.HeadingLg]: 'h2',\n [TextVariant.HeadingMd]: 'h3',\n [TextVariant.HeadingSm]: 'h4',\n [TextVariant.BodyLg]: 'p',\n [TextVariant.BodyMd]: 'p',\n [TextVariant.BodySm]: 'p',\n [TextVariant.BodyXs]: 'p',\n [TextVariant.PageHeading]: 'h1',\n [TextVariant.SectionHeading]: 'h2',\n [TextVariant.ButtonLabelMd]: 'span',\n [TextVariant.ButtonLabelLg]: 'span',\n [TextVariant.AmountDisplayLg]: 'span',\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACZ,gDAAgD;AAEjD,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,WAAW;IAC9B,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,cAAc;CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,cAAc;IACpC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,WAAW;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAA8B;IAClE,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,QAAQ;IAC5B,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,YAAY;CACjC,CAAC;AAEF,MAAM,CAAC,MA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AC,WAAW,CAAC,WAAW,CAAC,EAAE,WAAW;IACtC,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,WAAW;IACzC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,0BAA0B;CAC1D,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAG7B;IACF,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,IAAI;IAC/B,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,IAAI;IAClC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,MAAM;CACtC,CAAC","sourcesContent":["import {\n FontFamily,\n FontStyle,\n FontWeight,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_TEXT_FONTWEIGHT: Record<FontWeight, string> = {\n [FontWeight.Bold]: 'font-bold',\n [FontWeight.Medium]: 'font-medium',\n [FontWeight.Regular]: 'font-regular',\n};\n\nexport const TWCLASSMAP_TEXT_FONTFAMILY: Record<FontFamily, string> = {\n [FontFamily.Default]: 'font-default',\n [FontFamily.Accent]: 'font-accent',\n [FontFamily.Hero]: 'font-hero',\n};\n\nexport const TWCLASSMAP_TEXT_FONTSTYLE: Record<FontStyle, string> = {\n [FontStyle.Italic]: 'italic',\n [FontStyle.Normal]: 'not-italic',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-s-display-lg leading-s-display-lg tracking-s-display-lg md:text-l-display-lg md:leading-l-display-lg md:tracking-l-display-lg',\n [TextVariant.DisplayMd]:\n 'text-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:leading-l-display-md md:tracking-l-display-md',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg md:leading-l-heading-lg md:tracking-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md md:leading-l-heading-md md:tracking-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm md:leading-l-heading-sm md:tracking-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg md:leading-l-body-lg md:tracking-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm md:leading-l-body-sm md:tracking-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs md:leading-l-body-xs md:tracking-l-body-xs',\n [TextVariant.PageHeading]:\n 'text-s-page-heading leading-s-page-heading tracking-s-page-heading md:text-l-page-heading md:leading-l-page-heading md:tracking-l-page-heading',\n [TextVariant.SectionHeading]:\n 'text-s-section-heading leading-s-section-heading tracking-s-section-heading md:text-l-section-heading md:leading-l-section-heading md:tracking-l-section-heading',\n [TextVariant.ButtonLabelMd]:\n 'text-s-button-label-md leading-s-button-label-md tracking-s-button-label-md md:text-l-button-label-md md:leading-l-button-label-md md:tracking-l-button-label-md',\n [TextVariant.ButtonLabelLg]:\n 'text-s-button-label-lg leading-s-button-label-lg tracking-s-button-label-lg md:text-l-button-label-lg md:leading-l-button-label-lg md:tracking-l-button-label-lg',\n [TextVariant.AmountDisplayLg]:\n 'text-s-amount-display-lg leading-s-amount-display-lg tracking-s-amount-display-lg md:text-l-amount-display-lg md:leading-l-amount-display-lg md:tracking-l-amount-display-lg',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]: 'font-bold md:font-medium',\n [TextVariant.DisplayMd]: 'font-bold md:font-medium',\n [TextVariant.HeadingLg]: 'font-bold',\n [TextVariant.HeadingMd]: 'font-bold',\n [TextVariant.HeadingSm]: 'font-bold',\n [TextVariant.BodyLg]: 'font-medium',\n [TextVariant.BodyMd]: 'font-regular',\n [TextVariant.BodySm]: 'font-regular',\n [TextVariant.BodyXs]: 'font-regular',\n [TextVariant.PageHeading]: 'font-bold',\n [TextVariant.SectionHeading]: 'font-bold',\n [TextVariant.ButtonLabelMd]: 'font-medium',\n [TextVariant.ButtonLabelLg]: 'font-medium',\n [TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',\n};\n\nexport const MAP_TEXT_VARIANT_TAG: Record<\n TextVariant,\n keyof React.JSX.IntrinsicElements\n> = {\n [TextVariant.DisplayLg]: 'h1',\n [TextVariant.DisplayMd]: 'h1',\n [TextVariant.HeadingLg]: 'h2',\n [TextVariant.HeadingMd]: 'h3',\n [TextVariant.HeadingSm]: 'h4',\n [TextVariant.BodyLg]: 'p',\n [TextVariant.BodyMd]: 'p',\n [TextVariant.BodySm]: 'p',\n [TextVariant.BodyXs]: 'p',\n [TextVariant.PageHeading]: 'h1',\n [TextVariant.SectionHeading]: 'h2',\n [TextVariant.ButtonLabelMd]: 'span',\n [TextVariant.ButtonLabelLg]: 'span',\n [TextVariant.AmountDisplayLg]: 'span',\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA0CpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA0CpC,CAAC"}
|
|
@@ -13,7 +13,9 @@ import { TWCLASSMAP_TEXT_VARIANT_FONTSTYLE, TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,
|
|
|
13
13
|
export const Text = ({ variant = TextVariant.BodyMd, children, className, fontWeight, fontFamily = FontFamily.Default, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = TextColor.TextDefault, style, ...props }) => {
|
|
14
14
|
// When asChild is true, use Radix Slot to merge props onto the child component.
|
|
15
15
|
// Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
|
|
16
|
-
const Component = asChild
|
|
16
|
+
const Component = asChild
|
|
17
|
+
? Slot
|
|
18
|
+
: MAP_TEXT_VARIANT_TAG[variant];
|
|
17
19
|
const mergedClassName = `${twMerge(color, TWCLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight
|
|
18
20
|
? TWCLASSMAP_TEXT_FONTWEIGHT[fontWeight]
|
|
19
21
|
: TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle ? TWCLASSMAP_TEXT_FONTSTYLE[fontStyle] : undefined, TWCLASSMAP_TEXT_FONTFAMILY[fontFamily], textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACrB,6BAAyB;AAG1B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,UAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,E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,CAAC,EACtC,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,EAAE,CAAC;IAEJ,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IAC3D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n FontFamily,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n TWCLASSMAP_TEXT_VARIANT_FONTSTYLE,\n TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTFAMILY,\n TWCLASSMAP_TEXT_FONTSTYLE,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n MAP_TEXT_VARIANT_TAG,\n} from './Text.constants';\nimport type { TextProps } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontFamily = FontFamily.Default,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\n ...props\n}) => {\n // When asChild is true, use Radix Slot to merge props onto the child component.\n // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).\n const Component: React.ElementType = asChild\n ? Slot\n : MAP_TEXT_VARIANT_TAG[variant];\n\n const mergedClassName = `${twMerge(\n color,\n TWCLASSMAP_TEXT_VARIANT_FONTSTYLE[variant],\n fontWeight\n ? TWCLASSMAP_TEXT_FONTWEIGHT[fontWeight]\n : TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle ? TWCLASSMAP_TEXT_FONTSTYLE[fontStyle] : undefined,\n TWCLASSMAP_TEXT_FONTFAMILY[fontFamily],\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n )}`;\n\n return (\n <Component className={mergedClassName} style={style} {...props}>\n {children}\n </Component>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { OverflowWrap, TextAlign, TextTransform } from '../../types';\n\nexport type TextProps = TextPropsShared & {\n /**\n * Optional prop for inline styles\n */\n style?:
|
|
1
|
+
{"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask-previews/design-system-shared';\nimport type { CSSProperties } from 'react';\n\nimport type { OverflowWrap, TextAlign, TextTransform } from '../../types';\n\nexport type TextProps = TextPropsShared & {\n /**\n * Optional prop for inline styles\n */\n style?: CSSProperties;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to apply text transformation to the content.\n * Options: Uppercase, Lowercase, Capitalize, Normal\n */\n textTransform?: TextTransform;\n /**\n * Optional prop to control the text alignment within its container.\n * Options: Left, Center, Right, Justify\n */\n textAlign?: TextAlign;\n /**\n * Optional prop to determine how text should wrap when it reaches the edge of its container.\n * Options: BreakWord, Anywhere, Normal\n */\n overflowWrap?: OverflowWrap;\n /**\n * Optional boolean that adds an ellipsis (...) when text overflows its container.\n *\n * @default false\n */\n ellipsis?: boolean;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a default DOM element.\n *\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { TextPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { CSSProperties } from "react";
|
|
3
3
|
import type { OverflowWrap, TextAlign, TextTransform } from "../../types/index.cjs";
|
|
4
4
|
export type TextProps = TextPropsShared & {
|
|
5
5
|
/**
|
|
6
6
|
* Optional prop for inline styles
|
|
7
7
|
*/
|
|
8
|
-
style?:
|
|
8
|
+
style?: CSSProperties;
|
|
9
9
|
/**
|
|
10
10
|
* Optional prop for additional CSS classes to be applied to the Text component.
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.types.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gDAAgD;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AAE1E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { TextPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { CSSProperties } from "react";
|
|
3
3
|
import type { OverflowWrap, TextAlign, TextTransform } from "../../types/index.mjs";
|
|
4
4
|
export type TextProps = TextPropsShared & {
|
|
5
5
|
/**
|
|
6
6
|
* Optional prop for inline styles
|
|
7
7
|
*/
|
|
8
|
-
style?:
|
|
8
|
+
style?: CSSProperties;
|
|
9
9
|
/**
|
|
10
10
|
* Optional prop for additional CSS classes to be applied to the Text component.
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.types.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gDAAgD;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AAE1E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { OverflowWrap, TextAlign, TextTransform } from '../../types';\n\nexport type TextProps = TextPropsShared & {\n /**\n * Optional prop for inline styles\n */\n style?:
|
|
1
|
+
{"version":3,"file":"Text.types.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask-previews/design-system-shared';\nimport type { CSSProperties } from 'react';\n\nimport type { OverflowWrap, TextAlign, TextTransform } from '../../types';\n\nexport type TextProps = TextPropsShared & {\n /**\n * Optional prop for inline styles\n */\n style?: CSSProperties;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to apply text transformation to the content.\n * Options: Uppercase, Lowercase, Capitalize, Normal\n */\n textTransform?: TextTransform;\n /**\n * Optional prop to control the text alignment within its container.\n * Options: Left, Center, Right, Justify\n */\n textAlign?: TextAlign;\n /**\n * Optional prop to determine how text should wrap when it reaches the edge of its container.\n * Options: BreakWord, Anywhere, Normal\n */\n overflowWrap?: OverflowWrap;\n /**\n * Optional boolean that adds an ellipsis (...) when text overflows its container.\n *\n * @default false\n */\n ellipsis?: boolean;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a default DOM element.\n *\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n"]}
|