@metamask-previews/design-system-react 0.14.0-preview.dff9dce → 0.16.0-preview.d854123
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 +19 -1
- package/dist/components/BadgeNetwork/BadgeNetwork.types.cjs.map +1 -1
- package/dist/components/BadgeNetwork/BadgeNetwork.types.d.cts +6 -16
- package/dist/components/BadgeNetwork/BadgeNetwork.types.d.cts.map +1 -1
- package/dist/components/BadgeNetwork/BadgeNetwork.types.d.mts +6 -16
- package/dist/components/BadgeNetwork/BadgeNetwork.types.d.mts.map +1 -1
- package/dist/components/BadgeNetwork/BadgeNetwork.types.mjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.cjs +1 -2
- package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.cts +6 -6
- package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.mts +6 -6
- package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.mjs +1 -2
- package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +3 -4
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.mjs +1 -2
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts +3 -4
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts +3 -4
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts.map +1 -1
- package/dist/components/Icon/Icon.cjs +2 -2
- package/dist/components/Icon/Icon.cjs.map +1 -1
- package/dist/components/Icon/Icon.constants.cjs +6 -6
- package/dist/components/Icon/Icon.constants.cjs.map +1 -1
- package/dist/components/Icon/Icon.constants.d.cts +1 -1
- package/dist/components/Icon/Icon.constants.d.cts.map +1 -1
- package/dist/components/Icon/Icon.constants.d.mts +1 -1
- package/dist/components/Icon/Icon.constants.d.mts.map +1 -1
- package/dist/components/Icon/Icon.constants.mjs +1 -1
- package/dist/components/Icon/Icon.constants.mjs.map +1 -1
- package/dist/components/Icon/Icon.d.cts.map +1 -1
- package/dist/components/Icon/Icon.d.mts.map +1 -1
- package/dist/components/Icon/Icon.mjs +1 -1
- package/dist/components/Icon/Icon.mjs.map +1 -1
- package/dist/components/Icon/Icon.types.cjs.map +1 -1
- package/dist/components/Icon/Icon.types.d.cts +3 -2
- package/dist/components/Icon/Icon.types.d.cts.map +1 -1
- package/dist/components/Icon/Icon.types.d.mts +3 -2
- package/dist/components/Icon/Icon.types.d.mts.map +1 -1
- package/dist/components/Icon/Icon.types.mjs.map +1 -1
- package/dist/components/Icon/icons/NoPhotography.cjs +32 -0
- package/dist/components/Icon/icons/NoPhotography.cjs.map +1 -0
- package/dist/components/Icon/icons/NoPhotography.d.cts +4 -0
- package/dist/components/Icon/icons/NoPhotography.d.cts.map +1 -0
- package/dist/components/Icon/icons/NoPhotography.d.mts +4 -0
- package/dist/components/Icon/icons/NoPhotography.d.mts.map +1 -0
- package/dist/components/Icon/icons/NoPhotography.mjs +7 -0
- package/dist/components/Icon/icons/NoPhotography.mjs.map +1 -0
- package/dist/components/Icon/icons/index.cjs +78 -76
- package/dist/components/Icon/icons/index.cjs.map +1 -1
- package/dist/components/Icon/icons/index.d.cts +39 -38
- package/dist/components/Icon/icons/index.d.cts.map +1 -1
- package/dist/components/Icon/icons/index.d.mts +39 -38
- package/dist/components/Icon/icons/index.d.mts.map +1 -1
- package/dist/components/Icon/icons/index.mjs +78 -76
- package/dist/components/Icon/icons/index.mjs.map +1 -1
- package/dist/components/Icon/index.cjs +5 -5
- package/dist/components/Icon/index.cjs.map +1 -1
- package/dist/components/Icon/index.d.cts +1 -1
- package/dist/components/Icon/index.d.cts.map +1 -1
- package/dist/components/Icon/index.d.mts +1 -1
- package/dist/components/Icon/index.d.mts.map +1 -1
- package/dist/components/Icon/index.mjs +1 -1
- package/dist/components/Icon/index.mjs.map +1 -1
- package/dist/components/Input/Input.cjs +2 -2
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.cts +1 -1
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts +1 -1
- package/dist/components/Input/Input.d.mts.map +1 -1
- package/dist/components/Input/Input.mjs +1 -1
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/Input/Input.types.cjs.map +1 -1
- package/dist/components/Input/Input.types.d.cts +1 -1
- package/dist/components/Input/Input.types.d.cts.map +1 -1
- package/dist/components/Input/Input.types.d.mts +1 -1
- package/dist/components/Input/Input.types.d.mts.map +1 -1
- package/dist/components/Input/Input.types.mjs.map +1 -1
- package/dist/components/Text/Text.cjs +3 -5
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.constants.cjs +44 -58
- package/dist/components/Text/Text.constants.cjs.map +1 -1
- package/dist/components/Text/Text.constants.d.cts +1 -4
- package/dist/components/Text/Text.constants.d.cts.map +1 -1
- package/dist/components/Text/Text.constants.d.mts +1 -4
- package/dist/components/Text/Text.constants.d.mts.map +1 -1
- package/dist/components/Text/Text.constants.mjs +1 -15
- 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 -5
- 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 +20 -4
- package/dist/components/Text/Text.types.d.cts.map +1 -1
- package/dist/components/Text/Text.types.d.mts +20 -4
- package/dist/components/Text/Text.types.d.mts.map +1 -1
- package/dist/components/Text/Text.types.mjs.map +1 -1
- package/dist/components/Text/index.cjs +6 -7
- package/dist/components/Text/index.cjs.map +1 -1
- package/dist/components/Text/index.d.cts +1 -2
- package/dist/components/Text/index.d.cts.map +1 -1
- package/dist/components/Text/index.d.mts +1 -2
- package/dist/components/Text/index.d.mts.map +1 -1
- package/dist/components/Text/index.mjs +1 -2
- package/dist/components/Text/index.mjs.map +1 -1
- package/dist/types/index.cjs +143 -360
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +107 -340
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +107 -340
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +139 -359
- package/dist/types/index.mjs.map +1 -1
- package/package.json +4 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Icon = exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.Icon = exports.IconSize = exports.IconName = exports.IconColor = void 0;
|
|
4
|
+
var design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "IconColor", { enumerable: true, get: function () { return design_system_shared_1.IconColor; } });
|
|
6
|
+
Object.defineProperty(exports, "IconName", { enumerable: true, get: function () { return design_system_shared_1.IconName; } });
|
|
7
|
+
Object.defineProperty(exports, "IconSize", { enumerable: true, get: function () { return design_system_shared_1.IconSize; } });
|
|
8
8
|
var Icon_1 = require("./Icon.cjs");
|
|
9
9
|
Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return Icon_1.Icon; } });
|
|
10
10
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":";;;AAAA,gFAAwF;AAA/E,iHAAA,SAAS,OAAA;AAAE,gHAAA,QAAQ,OAAA;AAAE,gHAAA,QAAQ,OAAA;AACtC,mCAA8B;AAArB,4FAAA,IAAI,OAAA","sourcesContent":["export { IconColor, IconName, IconSize } from '@metamask-previews/design-system-shared';\nexport { Icon } from './Icon';\nexport type { IconProps } from './Icon.types';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { IconName, IconSize
|
|
1
|
+
export { IconColor, IconName, IconSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { Icon } from "./Icon.cjs";
|
|
3
3
|
export type { IconProps } from "./Icon.types.cjs";
|
|
4
4
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,gDAAgD;AACxF,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { IconName, IconSize
|
|
1
|
+
export { IconColor, IconName, IconSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { Icon } from "./Icon.mjs";
|
|
3
3
|
export type { IconProps } from "./Icon.types.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,gDAAgD;AACxF,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,gDAAgD;AACxF,OAAO,EAAE,IAAI,EAAE,mBAAe","sourcesContent":["export { IconColor, IconName, IconSize } from '@metamask-previews/design-system-shared';\nexport { Icon } from './Icon';\nexport type { IconProps } from './Icon.types';\n"]}
|
|
@@ -24,11 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Input = void 0;
|
|
27
|
-
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
28
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
+
const types_1 = require("../../types/index.cjs");
|
|
29
29
|
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
30
30
|
const Text_constants_1 = require("../Text/Text.constants.cjs");
|
|
31
|
-
exports.Input = (0, react_1.forwardRef)(({ textVariant =
|
|
31
|
+
exports.Input = (0, react_1.forwardRef)(({ textVariant = types_1.TextVariant.BodyMd, isDisabled = false, isReadonly = false, className, style, ...rest }, ref) => {
|
|
32
32
|
const mergedClassName = (0, tw_merge_1.twMerge)('w-full rounded border bg-default text-default outline-none transition-colors', 'border-transparent focus:border-primary-default focus:outline-none', 'placeholder:text-alternative', Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTSTYLE[textVariant], Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTWEIGHT[textVariant], isDisabled && 'cursor-not-allowed opacity-50', className);
|
|
33
33
|
return (react_1.default.createElement("input", { ref: ref, className: mergedClassName, style: style, ...rest, disabled: isDisabled, readOnly: isReadonly }));
|
|
34
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,iDAA0C;AAC1C,uDAA+C;AAC/C,+DAGgC;AAInB,QAAA,KAAK,GAAG,IAAA,kBAAU,EAC7B,CACE,EACE,WAAW,GAAG,mBAAW,CAAC,MAAM,EAChC,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,IAAA,kBAAO,EAC7B,8EAA8E,EAC9E,oEAAoE,EACpE,8BAA8B,EAC9B,gDAA+B,CAAC,WAAW,CAAC,EAC5C,iDAAgC,CAAC,WAAW,CAAC,EAC7C,UAAU,IAAI,+BAA+B,EAC7C,SAAS,CACV,CAAC;IAEF,OAAO,CACL,yCACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,KACR,IAAI,EACR,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,GACpB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { TextVariant } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport {\n CLASSMAP_TEXT_VARIANT_FONTSTYLE,\n CLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n textVariant = TextVariant.BodyMd,\n isDisabled = false,\n isReadonly = false,\n className,\n style,\n ...rest\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n 'w-full rounded border bg-default text-default outline-none transition-colors',\n 'border-transparent focus:border-primary-default focus:outline-none',\n 'placeholder:text-alternative',\n CLASSMAP_TEXT_VARIANT_FONTSTYLE[textVariant],\n CLASSMAP_TEXT_VARIANT_FONTWEIGHT[textVariant],\n isDisabled && 'cursor-not-allowed opacity-50',\n className,\n );\n\n return (\n <input\n ref={ref}\n className={mergedClassName}\n style={style}\n {...rest}\n disabled={isDisabled}\n readOnly={isReadonly}\n />\n );\n },\n);\n\nInput.displayName = 'Input';\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TextVariant } from "@metamask-previews/design-system-shared";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { TextVariant } from "../../types/index.cjs";
|
|
3
3
|
export declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "disabled" | "readOnly"> & {
|
|
4
4
|
textVariant?: TextVariant | undefined;
|
|
5
5
|
isDisabled?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAE1C,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAS1C,eAAO,MAAM,KAAK;;;;;;0CAiCjB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TextVariant } from "@metamask-previews/design-system-shared";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { TextVariant } from "../../types/index.mjs";
|
|
3
3
|
export declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "disabled" | "readOnly"> & {
|
|
4
4
|
textVariant?: TextVariant | undefined;
|
|
5
5
|
isDisabled?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,cAAc;AAE1C,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAS1C,eAAO,MAAM,KAAK;;;;;;0CAiCjB,CAAC"}
|
|
@@ -4,9 +4,9 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import { TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
7
|
import $React, { forwardRef } from "react";
|
|
9
8
|
const React = $importDefault($React);
|
|
9
|
+
import { TextVariant } from "../../types/index.mjs";
|
|
10
10
|
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
11
11
|
import { CLASSMAP_TEXT_VARIANT_FONTSTYLE, CLASSMAP_TEXT_VARIANT_FONTWEIGHT } from "../Text/Text.constants.mjs";
|
|
12
12
|
export const Input = forwardRef(({ textVariant = TextVariant.BodyMd, isDisabled = false, isReadonly = false, className, style, ...rest }, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAC1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EACjC,mCAA+B;AAIhC,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EACE,WAAW,GAAG,WAAW,CAAC,MAAM,EAChC,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,OAAO,CAC7B,8EAA8E,EAC9E,oEAAoE,EACpE,8BAA8B,EAC9B,+BAA+B,CAAC,WAAW,CAAC,EAC5C,gCAAgC,CAAC,WAAW,CAAC,EAC7C,UAAU,IAAI,+BAA+B,EAC7C,SAAS,CACV,CAAC;IAEF,OAAO,CACL,+BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,KACR,IAAI,EACR,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,GACpB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { TextVariant } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\nimport {\n CLASSMAP_TEXT_VARIANT_FONTSTYLE,\n CLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n textVariant = TextVariant.BodyMd,\n isDisabled = false,\n isReadonly = false,\n className,\n style,\n ...rest\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n 'w-full rounded border bg-default text-default outline-none transition-colors',\n 'border-transparent focus:border-primary-default focus:outline-none',\n 'placeholder:text-alternative',\n CLASSMAP_TEXT_VARIANT_FONTSTYLE[textVariant],\n CLASSMAP_TEXT_VARIANT_FONTWEIGHT[textVariant],\n isDisabled && 'cursor-not-allowed opacity-50',\n className,\n );\n\n return (\n <input\n ref={ref}\n className={mergedClassName}\n style={style}\n {...rest}\n disabled={isDisabled}\n readOnly={isReadonly}\n />\n );\n },\n);\n\nInput.displayName = 'Input';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Input.types.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { TextVariant } from '../../types';\n\nexport type InputProps = Omit<\n ComponentPropsWithoutRef<'input'>,\n 'disabled' | 'readOnly'\n> & {\n /**\n * Optional enum to select between Typography variants.\n *\n * @default TextVariant.BodyMd\n */\n textVariant?: TextVariant;\n /**\n * Optional boolean to disable Input.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional boolean to show readonly input.\n *\n * @default false\n */\n isReadonly?: boolean;\n /**\n * Optional prop for additional CSS classes.\n */\n className?: string;\n /**\n * Optional inline styles.\n */\n style?: React.CSSProperties;\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TextVariant } from "@metamask-previews/design-system-shared";
|
|
2
1
|
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import type { TextVariant } from "../../types/index.cjs";
|
|
3
3
|
export type InputProps = Omit<ComponentPropsWithoutRef<'input'>, 'disabled' | 'readOnly'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Optional enum to select between Typography variants.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.types.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,8BAAoB;AAE/C,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,wBAAwB,CAAC,OAAO,CAAC,EACjC,UAAU,GAAG,UAAU,CACxB,GAAG;IACF;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TextVariant } from "@metamask-previews/design-system-shared";
|
|
2
1
|
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import type { TextVariant } from "../../types/index.mjs";
|
|
3
3
|
export type InputProps = Omit<ComponentPropsWithoutRef<'input'>, 'disabled' | 'readOnly'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Optional enum to select between Typography variants.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.types.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,8BAAoB;AAE/C,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,wBAAwB,CAAC,OAAO,CAAC,EACjC,UAAU,GAAG,UAAU,CACxB,GAAG;IACF;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Input.types.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { TextVariant } from '../../types';\n\nexport type InputProps = Omit<\n ComponentPropsWithoutRef<'input'>,\n 'disabled' | 'readOnly'\n> & {\n /**\n * Optional enum to select between Typography variants.\n *\n * @default TextVariant.BodyMd\n */\n textVariant?: TextVariant;\n /**\n * Optional boolean to disable Input.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional boolean to show readonly input.\n *\n * @default false\n */\n isReadonly?: boolean;\n /**\n * Optional prop for additional CSS classes.\n */\n className?: string;\n /**\n * Optional inline styles.\n */\n style?: React.CSSProperties;\n};\n"]}
|
|
@@ -4,18 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Text = void 0;
|
|
7
|
-
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
8
7
|
const react_slot_1 = require("@radix-ui/react-slot");
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const types_1 = require("../../types/index.cjs");
|
|
10
10
|
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
11
11
|
const Text_constants_1 = require("./Text.constants.cjs");
|
|
12
|
-
const Text = ({ variant =
|
|
12
|
+
const Text = ({ variant = types_1.TextVariant.BodyMd, children, className, fontWeight, fontFamily = types_1.FontFamily.Default, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = types_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
15
|
const Component = asChild ? react_slot_1.Slot : Text_constants_1.MAP_TEXT_VARIANT_TAG[variant];
|
|
16
|
-
const mergedClassName = `${(0, tw_merge_1.twMerge)(color, Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight
|
|
17
|
-
? Text_constants_1.MAP_FONTWEIGHT_CLASS[fontWeight]
|
|
18
|
-
: Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle ? Text_constants_1.MAP_FONTSTYLE_CLASS[fontStyle] : undefined, Text_constants_1.MAP_FONTFAMILY_CLASS[fontFamily], textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
|
|
16
|
+
const mergedClassName = `${(0, tw_merge_1.twMerge)(color, Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight || Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle, fontFamily, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
|
|
19
17
|
return (react_1.default.createElement(Component, { className: mergedClassName, style: style, ...props }, children));
|
|
20
18
|
};
|
|
21
19
|
exports.Text = Text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,qDAA4C;AAC5C,kDAA0B;AAE1B,iDAAiE;AACjE,uDAA+C;AAE/C,yDAI0B;AAGnB,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,mBAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,kBAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,iBAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,qCAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,GAAG,IAAA,kBAAO,EAChC,KAAK,EACL,gDAA+B,CAAC,OAAO,CAAC,EACxC,UAAU,IAAI,iDAAgC,CAAC,OAAO,CAAC,EACvD,SAAS,EACT,UAAU,EACV,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;AAtCW,QAAA,IAAI,QAsCf","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { FontFamily, TextColor, TextVariant } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n CLASSMAP_TEXT_VARIANT_FONTSTYLE,\n CLASSMAP_TEXT_VARIANT_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 = asChild ? Slot : MAP_TEXT_VARIANT_TAG[variant];\n\n const mergedClassName = `${twMerge(\n color,\n CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant],\n fontWeight || CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle,\n 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,67 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAP_TEXT_VARIANT_TAG = exports.CLASSMAP_TEXT_VARIANT_FONTWEIGHT = exports.CLASSMAP_TEXT_VARIANT_FONTSTYLE =
|
|
4
|
-
const
|
|
5
|
-
exports.MAP_FONTWEIGHT_CLASS = {
|
|
6
|
-
[design_system_shared_1.FontWeight.Bold]: 'font-bold',
|
|
7
|
-
[design_system_shared_1.FontWeight.Medium]: 'font-medium',
|
|
8
|
-
[design_system_shared_1.FontWeight.Regular]: 'font-regular',
|
|
9
|
-
};
|
|
10
|
-
exports.MAP_FONTFAMILY_CLASS = {
|
|
11
|
-
[design_system_shared_1.FontFamily.Default]: 'font-default',
|
|
12
|
-
[design_system_shared_1.FontFamily.Accent]: 'font-accent',
|
|
13
|
-
[design_system_shared_1.FontFamily.Hero]: 'font-hero',
|
|
14
|
-
};
|
|
15
|
-
exports.MAP_FONTSTYLE_CLASS = {
|
|
16
|
-
[design_system_shared_1.FontStyle.Italic]: 'italic',
|
|
17
|
-
[design_system_shared_1.FontStyle.Normal]: 'not-italic',
|
|
18
|
-
};
|
|
3
|
+
exports.MAP_TEXT_VARIANT_TAG = exports.CLASSMAP_TEXT_VARIANT_FONTWEIGHT = exports.CLASSMAP_TEXT_VARIANT_FONTSTYLE = void 0;
|
|
4
|
+
const types_1 = require("../../types/index.cjs");
|
|
19
5
|
exports.CLASSMAP_TEXT_VARIANT_FONTSTYLE = {
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
6
|
+
[types_1.TextVariant.DisplayLg]: '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',
|
|
7
|
+
[types_1.TextVariant.DisplayMd]: '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',
|
|
8
|
+
[types_1.TextVariant.HeadingLg]: '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',
|
|
9
|
+
[types_1.TextVariant.HeadingMd]: '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',
|
|
10
|
+
[types_1.TextVariant.HeadingSm]: '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',
|
|
11
|
+
[types_1.TextVariant.BodyLg]: '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',
|
|
12
|
+
[types_1.TextVariant.BodyMd]: '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',
|
|
13
|
+
[types_1.TextVariant.BodySm]: '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',
|
|
14
|
+
[types_1.TextVariant.BodyXs]: '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',
|
|
15
|
+
[types_1.TextVariant.PageHeading]: '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',
|
|
16
|
+
[types_1.TextVariant.SectionHeading]: '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',
|
|
17
|
+
[types_1.TextVariant.ButtonLabelMd]: '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',
|
|
18
|
+
[types_1.TextVariant.ButtonLabelLg]: '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',
|
|
19
|
+
[types_1.TextVariant.AmountDisplayLg]: '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',
|
|
34
20
|
};
|
|
35
21
|
exports.CLASSMAP_TEXT_VARIANT_FONTWEIGHT = {
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
22
|
+
[types_1.TextVariant.DisplayLg]: 'font-bold md:font-medium',
|
|
23
|
+
[types_1.TextVariant.DisplayMd]: 'font-bold md:font-medium',
|
|
24
|
+
[types_1.TextVariant.HeadingLg]: 'font-bold',
|
|
25
|
+
[types_1.TextVariant.HeadingMd]: 'font-bold',
|
|
26
|
+
[types_1.TextVariant.HeadingSm]: 'font-bold',
|
|
27
|
+
[types_1.TextVariant.BodyLg]: 'font-medium',
|
|
28
|
+
[types_1.TextVariant.BodyMd]: 'font-regular',
|
|
29
|
+
[types_1.TextVariant.BodySm]: 'font-regular',
|
|
30
|
+
[types_1.TextVariant.BodyXs]: 'font-regular',
|
|
31
|
+
[types_1.TextVariant.PageHeading]: 'font-bold',
|
|
32
|
+
[types_1.TextVariant.SectionHeading]: 'font-bold',
|
|
33
|
+
[types_1.TextVariant.ButtonLabelMd]: 'font-medium',
|
|
34
|
+
[types_1.TextVariant.ButtonLabelLg]: 'font-medium',
|
|
35
|
+
[types_1.TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',
|
|
50
36
|
};
|
|
51
37
|
exports.MAP_TEXT_VARIANT_TAG = {
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
38
|
+
[types_1.TextVariant.DisplayLg]: 'h1',
|
|
39
|
+
[types_1.TextVariant.DisplayMd]: 'h1',
|
|
40
|
+
[types_1.TextVariant.HeadingLg]: 'h2',
|
|
41
|
+
[types_1.TextVariant.HeadingMd]: 'h3',
|
|
42
|
+
[types_1.TextVariant.HeadingSm]: 'h4',
|
|
43
|
+
[types_1.TextVariant.BodyLg]: 'p',
|
|
44
|
+
[types_1.TextVariant.BodyMd]: 'p',
|
|
45
|
+
[types_1.TextVariant.BodySm]: 'p',
|
|
46
|
+
[types_1.TextVariant.BodyXs]: 'p',
|
|
47
|
+
[types_1.TextVariant.PageHeading]: 'h1',
|
|
48
|
+
[types_1.TextVariant.SectionHeading]: 'h2',
|
|
49
|
+
[types_1.TextVariant.ButtonLabelMd]: 'span',
|
|
50
|
+
[types_1.TextVariant.ButtonLabelLg]: 'span',
|
|
51
|
+
[types_1.TextVariant.AmountDisplayLg]: 'span',
|
|
66
52
|
};
|
|
67
53
|
//# sourceMappingURL=Text.constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";;;AAAA,iDAA0C;AAE7B,QAAA,+BAA+B,GAAgC;IAC1E,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,mBAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,mBAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,mBAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,mBAAW,CAAC,WAAW,CAAC,EACvB,gJAAgJ;IAClJ,CAAC,mBAAW,CAAC,cAAc,CAAC,EAC1B,kKAAkK;IACpK,CAAC,mBAAW,CAAC,aAAa,CAAC,EACzB,kKAAkK;IACpK,CAAC,mBAAW,CAAC,aAAa,CAAC,EACzB,kKAAkK;IACpK,CAAC,mBAAW,CAAC,eAAe,CAAC,EAC3B,8KAA8K;CACjL,CAAC;AAEW,QAAA,gCAAgC,GAAgC;IAC3E,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAA0B;IACnD,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAA0B;IACnD,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,aAAa;IACnC,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,mBAAW,CAAC,WAAW,CAAC,EAAE,WAAW;IACtC,CAAC,mBAAW,CAAC,cAAc,CAAC,EAAE,WAAW;IACzC,CAAC,mBAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,mBAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,mBAAW,CAAC,eAAe,CAAC,EAAE,0BAA0B;CAC1D,CAAC;AAEW,QAAA,oBAAoB,GAG7B;IACF,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,mBAAW,CAAC,WAAW,CAAC,EAAE,IAAI;IAC/B,CAAC,mBAAW,CAAC,cAAc,CAAC,EAAE,IAAI;IAClC,CAAC,mBAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,mBAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,mBAAW,CAAC,eAAe,CAAC,EAAE,MAAM;CACtC,CAAC","sourcesContent":["import { TextVariant } from '../../types';\n\nexport const CLASSMAP_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 CLASSMAP_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,8 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare const MAP_FONTWEIGHT_CLASS: Record<FontWeight, string>;
|
|
4
|
-
export declare const MAP_FONTFAMILY_CLASS: Record<FontFamily, string>;
|
|
5
|
-
export declare const MAP_FONTSTYLE_CLASS: Record<FontStyle, string>;
|
|
2
|
+
import { TextVariant } from "../../types/index.cjs";
|
|
6
3
|
export declare const CLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string>;
|
|
7
4
|
export declare const CLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string>;
|
|
8
5
|
export declare const MAP_TEXT_VARIANT_TAG: Record<TextVariant, keyof JSX.IntrinsicElements>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BvE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAexE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,GAAG,CAAC,iBAAiB,CAgB5B,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare const MAP_FONTWEIGHT_CLASS: Record<FontWeight, string>;
|
|
4
|
-
export declare const MAP_FONTFAMILY_CLASS: Record<FontFamily, string>;
|
|
5
|
-
export declare const MAP_FONTSTYLE_CLASS: Record<FontStyle, string>;
|
|
2
|
+
import { TextVariant } from "../../types/index.mjs";
|
|
6
3
|
export declare const CLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string>;
|
|
7
4
|
export declare const CLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string>;
|
|
8
5
|
export declare const MAP_TEXT_VARIANT_TAG: Record<TextVariant, keyof JSX.IntrinsicElements>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BvE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAexE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,GAAG,CAAC,iBAAiB,CAgB5B,CAAC"}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const MAP_FONTWEIGHT_CLASS = {
|
|
3
|
-
[FontWeight.Bold]: 'font-bold',
|
|
4
|
-
[FontWeight.Medium]: 'font-medium',
|
|
5
|
-
[FontWeight.Regular]: 'font-regular',
|
|
6
|
-
};
|
|
7
|
-
export const MAP_FONTFAMILY_CLASS = {
|
|
8
|
-
[FontFamily.Default]: 'font-default',
|
|
9
|
-
[FontFamily.Accent]: 'font-accent',
|
|
10
|
-
[FontFamily.Hero]: 'font-hero',
|
|
11
|
-
};
|
|
12
|
-
export const MAP_FONTSTYLE_CLASS = {
|
|
13
|
-
[FontStyle.Italic]: 'italic',
|
|
14
|
-
[FontStyle.Normal]: 'not-italic',
|
|
15
|
-
};
|
|
1
|
+
import { TextVariant } from "../../types/index.mjs";
|
|
16
2
|
export const CLASSMAP_TEXT_VARIANT_FONTSTYLE = {
|
|
17
3
|
[TextVariant.DisplayLg]: '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',
|
|
18
4
|
[TextVariant.DisplayMd]: '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',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,MAAM,CAAC,MAAM,+BAA+B,GAAgC;IAC1E,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,WAAW,CAAC,WAAW,CAAC,EACvB,gJAAgJ;IAClJ,CAAC,WAAW,CAAC,cAAc,CAAC,EAC1B,kKAAkK;IACpK,CAAC,WAAW,CAAC,aAAa,CAAC,EACzB,kKAAkK;IACpK,CAAC,WAAW,CAAC,aAAa,CAAC,EACzB,kKAAkK;IACpK,CAAC,WAAW,CAAC,eAAe,CAAC,EAC3B,8KAA8K;CACjL,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAgC;IAC3E,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,0BAA0B;IACnD,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,0BAA0B;IACnD,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,aAAa;IACnC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,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 { TextVariant } from '../../types';\n\nexport const CLASSMAP_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 CLASSMAP_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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsCpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsCpC,CAAC"}
|
|
@@ -4,19 +4,17 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import { FontFamily, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
7
|
import { Slot } from "@radix-ui/react-slot";
|
|
9
8
|
import $React from "react";
|
|
10
9
|
const React = $importDefault($React);
|
|
10
|
+
import { FontFamily, TextColor, TextVariant } from "../../types/index.mjs";
|
|
11
11
|
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
12
|
-
import { CLASSMAP_TEXT_VARIANT_FONTSTYLE, CLASSMAP_TEXT_VARIANT_FONTWEIGHT,
|
|
12
|
+
import { CLASSMAP_TEXT_VARIANT_FONTSTYLE, CLASSMAP_TEXT_VARIANT_FONTWEIGHT, MAP_TEXT_VARIANT_TAG } from "./Text.constants.mjs";
|
|
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
16
|
const Component = asChild ? Slot : MAP_TEXT_VARIANT_TAG[variant];
|
|
17
|
-
const mergedClassName = `${twMerge(color, CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight
|
|
18
|
-
? MAP_FONTWEIGHT_CLASS[fontWeight]
|
|
19
|
-
: CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle ? MAP_FONTSTYLE_CLASS[fontStyle] : undefined, MAP_FONTFAMILY_CLASS[fontFamily], textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
|
|
17
|
+
const mergedClassName = `${twMerge(color, CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight || CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle, fontFamily, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
|
|
20
18
|
return (React.createElement(Component, { className: mergedClassName, style: style, ...props }, children));
|
|
21
19
|
};
|
|
22
20
|
//# sourceMappingURL=Text.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,8BAAoB;AACjE,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,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,EACR,OAAO,EACP,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,GAAG,OAAO,CAChC,KAAK,EACL,+BAA+B,CAAC,OAAO,CAAC,EACxC,UAAU,IAAI,gCAAgC,CAAC,OAAO,CAAC,EACvD,SAAS,EACT,UAAU,EACV,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 { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { FontFamily, TextColor, TextVariant } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n CLASSMAP_TEXT_VARIANT_FONTSTYLE,\n CLASSMAP_TEXT_VARIANT_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 = asChild ? Slot : MAP_TEXT_VARIANT_TAG[variant];\n\n const mergedClassName = `${twMerge(\n color,\n CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant],\n fontWeight || CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle,\n 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 {\n FontFamily,\n FontStyle,\n FontWeight,\n
|
|
1
|
+
{"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n FontFamily,\n FontStyle,\n FontWeight,\n OverflowWrap,\n TextAlign,\n TextVariant,\n TextTransform,\n TextColor,\n} from '../../types';\n\nexport type TextProps = {\n /**\n * Optional prop for inline styles\n */\n style?: React.CSSProperties;\n /**\n * Optional prop to change the font size of the component. The Text component uses responsive font sizes.\n * Different variants map to specific HTML elements by default.\n *\n * @default TextVariant.BodyMd\n */\n variant?: TextVariant;\n /**\n * The text content or elements to be rendered within the component.\n */\n children: React.ReactNode;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to control the font weight of the text.\n * Regular: 400\n * Medium: 500\n * Bold: 600\n */\n fontWeight?: FontWeight;\n /**\n * Optional prop to adjust the font family.\n * Default: Geist\n * Accent: MM Sans\n * Hero: MM Poly\n */\n fontFamily?: FontFamily;\n /**\n * Optional prop to control the font style of the text.\n * Options: Normal, Italic\n */\n fontStyle?: FontStyle;\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 prop that when true, 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 that sets the color of the text using predefined theme colors.\n *\n * @default TextColor.TextDefault\n */\n color?: TextColor;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n"]}
|