@metamask-previews/design-system-react 0.14.0-preview.4ce710b → 0.15.0-preview.a73a010

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/dist/components/BannerAlert/BannerAlert.constants.cjs +8 -8
  3. package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
  4. package/dist/components/BannerAlert/BannerAlert.constants.d.cts +2 -2
  5. package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
  6. package/dist/components/BannerAlert/BannerAlert.constants.d.mts +2 -2
  7. package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
  8. package/dist/components/BannerAlert/BannerAlert.constants.mjs +2 -2
  9. package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
  10. package/dist/components/BannerBase/BannerBase.cjs +4 -4
  11. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  12. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  13. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  14. package/dist/components/BannerBase/BannerBase.mjs +2 -2
  15. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  16. package/dist/components/Box/Box.constants.cjs.map +1 -1
  17. package/dist/components/Box/Box.constants.d.cts +1 -1
  18. package/dist/components/Box/Box.constants.d.cts.map +1 -1
  19. package/dist/components/Box/Box.constants.d.mts +1 -1
  20. package/dist/components/Box/Box.constants.d.mts.map +1 -1
  21. package/dist/components/Box/Box.constants.mjs.map +1 -1
  22. package/dist/components/Box/Box.types.cjs.map +1 -1
  23. package/dist/components/Box/Box.types.d.cts +2 -106
  24. package/dist/components/Box/Box.types.d.cts.map +1 -1
  25. package/dist/components/Box/Box.types.d.mts +2 -106
  26. package/dist/components/Box/Box.types.d.mts.map +1 -1
  27. package/dist/components/Box/Box.types.mjs.map +1 -1
  28. package/dist/components/Box/index.cjs +7 -7
  29. package/dist/components/Box/index.cjs.map +1 -1
  30. package/dist/components/Box/index.d.cts +1 -2
  31. package/dist/components/Box/index.d.cts.map +1 -1
  32. package/dist/components/Box/index.d.mts +1 -2
  33. package/dist/components/Box/index.d.mts.map +1 -1
  34. package/dist/components/Box/index.mjs +1 -1
  35. package/dist/components/Box/index.mjs.map +1 -1
  36. package/dist/components/Icon/icons/NoPhotography.cjs +32 -0
  37. package/dist/components/Icon/icons/NoPhotography.cjs.map +1 -0
  38. package/dist/components/Icon/icons/NoPhotography.d.cts +4 -0
  39. package/dist/components/Icon/icons/NoPhotography.d.cts.map +1 -0
  40. package/dist/components/Icon/icons/NoPhotography.d.mts +4 -0
  41. package/dist/components/Icon/icons/NoPhotography.d.mts.map +1 -0
  42. package/dist/components/Icon/icons/NoPhotography.mjs +7 -0
  43. package/dist/components/Icon/icons/NoPhotography.mjs.map +1 -0
  44. package/dist/components/Icon/icons/index.cjs +2 -0
  45. package/dist/components/Icon/icons/index.cjs.map +1 -1
  46. package/dist/components/Icon/icons/index.d.cts +1 -0
  47. package/dist/components/Icon/icons/index.d.cts.map +1 -1
  48. package/dist/components/Icon/icons/index.d.mts +1 -0
  49. package/dist/components/Icon/icons/index.d.mts.map +1 -1
  50. package/dist/components/Icon/icons/index.mjs +2 -0
  51. package/dist/components/Icon/icons/index.mjs.map +1 -1
  52. package/dist/components/Input/Input.cjs +2 -2
  53. package/dist/components/Input/Input.cjs.map +1 -1
  54. package/dist/components/Input/Input.d.cts +1 -1
  55. package/dist/components/Input/Input.d.cts.map +1 -1
  56. package/dist/components/Input/Input.d.mts +1 -1
  57. package/dist/components/Input/Input.d.mts.map +1 -1
  58. package/dist/components/Input/Input.mjs +1 -1
  59. package/dist/components/Input/Input.mjs.map +1 -1
  60. package/dist/components/Input/Input.types.cjs.map +1 -1
  61. package/dist/components/Input/Input.types.d.cts +1 -1
  62. package/dist/components/Input/Input.types.d.cts.map +1 -1
  63. package/dist/components/Input/Input.types.d.mts +1 -1
  64. package/dist/components/Input/Input.types.d.mts.map +1 -1
  65. package/dist/components/Input/Input.types.mjs.map +1 -1
  66. package/dist/components/Text/Text.cjs +3 -5
  67. package/dist/components/Text/Text.cjs.map +1 -1
  68. package/dist/components/Text/Text.constants.cjs +44 -58
  69. package/dist/components/Text/Text.constants.cjs.map +1 -1
  70. package/dist/components/Text/Text.constants.d.cts +1 -4
  71. package/dist/components/Text/Text.constants.d.cts.map +1 -1
  72. package/dist/components/Text/Text.constants.d.mts +1 -4
  73. package/dist/components/Text/Text.constants.d.mts.map +1 -1
  74. package/dist/components/Text/Text.constants.mjs +1 -15
  75. package/dist/components/Text/Text.constants.mjs.map +1 -1
  76. package/dist/components/Text/Text.d.cts.map +1 -1
  77. package/dist/components/Text/Text.d.mts.map +1 -1
  78. package/dist/components/Text/Text.mjs +3 -5
  79. package/dist/components/Text/Text.mjs.map +1 -1
  80. package/dist/components/Text/Text.types.cjs.map +1 -1
  81. package/dist/components/Text/Text.types.d.cts +39 -4
  82. package/dist/components/Text/Text.types.d.cts.map +1 -1
  83. package/dist/components/Text/Text.types.d.mts +39 -4
  84. package/dist/components/Text/Text.types.d.mts.map +1 -1
  85. package/dist/components/Text/Text.types.mjs.map +1 -1
  86. package/dist/components/Text/index.cjs +6 -7
  87. package/dist/components/Text/index.cjs.map +1 -1
  88. package/dist/components/Text/index.d.cts +1 -2
  89. package/dist/components/Text/index.d.cts.map +1 -1
  90. package/dist/components/Text/index.d.mts +1 -2
  91. package/dist/components/Text/index.d.mts.map +1 -1
  92. package/dist/components/Text/index.mjs +1 -2
  93. package/dist/components/Text/index.mjs.map +1 -1
  94. package/dist/types/index.cjs +140 -190
  95. package/dist/types/index.cjs.map +1 -1
  96. package/dist/types/index.d.cts +124 -194
  97. package/dist/types/index.d.cts.map +1 -1
  98. package/dist/types/index.d.mts +124 -194
  99. package/dist/types/index.d.mts.map +1 -1
  100. package/dist/types/index.mjs +139 -189
  101. package/dist/types/index.mjs.map +1 -1
  102. package/package.json +3 -3
@@ -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, MAP_FONTFAMILY_CLASS, MAP_FONTSTYLE_CLASS, MAP_FONTWEIGHT_CLASS, MAP_TEXT_VARIANT_TAG } from "./Text.constants.mjs";
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,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,+BAA+B,EAC/B,gCAAgC,EAChC,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,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;QACR,CAAC,CAAC,oBAAoB,CAAC,UAAU,CAAC;QAClC,CAAC,CAAC,gCAAgC,CAAC,OAAO,CAAC,EAC7C,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EACtD,oBAAoB,CAAC,UAAU,CAAC,EAChC,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 CLASSMAP_TEXT_VARIANT_FONTSTYLE,\n CLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n MAP_FONTFAMILY_CLASS,\n MAP_FONTSTYLE_CLASS,\n MAP_FONTWEIGHT_CLASS,\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\n ? MAP_FONTWEIGHT_CLASS[fontWeight]\n : CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle ? MAP_FONTSTYLE_CLASS[fontStyle] : undefined,\n MAP_FONTFAMILY_CLASS[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
+ {"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 { 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?: React.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
+ {"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"]}
@@ -1,15 +1,44 @@
1
1
  /// <reference types="react" />
2
- import type { TextPropsShared } from "@metamask-previews/design-system-shared";
3
- import type { OverflowWrap, TextAlign, TextTransform } from "../../types/index.cjs";
4
- export type TextProps = TextPropsShared & {
2
+ import type { FontFamily, FontStyle, FontWeight, OverflowWrap, TextAlign, TextVariant, TextTransform, TextColor } from "../../types/index.cjs";
3
+ export type TextProps = {
5
4
  /**
6
5
  * Optional prop for inline styles
7
6
  */
8
7
  style?: React.CSSProperties;
8
+ /**
9
+ * Optional prop to change the font size of the component. The Text component uses responsive font sizes.
10
+ * Different variants map to specific HTML elements by default.
11
+ *
12
+ * @default TextVariant.BodyMd
13
+ */
14
+ variant?: TextVariant;
15
+ /**
16
+ * The text content or elements to be rendered within the component.
17
+ */
18
+ children: React.ReactNode;
9
19
  /**
10
20
  * Optional prop for additional CSS classes to be applied to the Text component.
11
21
  */
12
22
  className?: string;
23
+ /**
24
+ * Optional prop to control the font weight of the text.
25
+ * Regular: 400
26
+ * Medium: 500
27
+ * Bold: 600
28
+ */
29
+ fontWeight?: FontWeight;
30
+ /**
31
+ * Optional prop to adjust the font family.
32
+ * Default: Geist
33
+ * Accent: MM Sans
34
+ * Hero: MM Poly
35
+ */
36
+ fontFamily?: FontFamily;
37
+ /**
38
+ * Optional prop to control the font style of the text.
39
+ * Options: Normal, Italic
40
+ */
41
+ fontStyle?: FontStyle;
13
42
  /**
14
43
  * Optional prop to apply text transformation to the content.
15
44
  * Options: Uppercase, Lowercase, Capitalize, Normal
@@ -26,7 +55,7 @@ export type TextProps = TextPropsShared & {
26
55
  */
27
56
  overflowWrap?: OverflowWrap;
28
57
  /**
29
- * Optional boolean that adds an ellipsis (...) when text overflows its container.
58
+ * Optional prop that when true, adds an ellipsis (...) when text overflows its container.
30
59
  *
31
60
  * @default false
32
61
  */
@@ -38,6 +67,12 @@ export type TextProps = TextPropsShared & {
38
67
  * @default false
39
68
  */
40
69
  asChild?: boolean;
70
+ /**
71
+ * Optional prop that sets the color of the text using predefined theme colors.
72
+ *
73
+ * @default TextColor.TextDefault
74
+ */
75
+ color?: TextColor;
41
76
  /**
42
77
  * Optional prop for testing purposes
43
78
  */
@@ -1 +1 @@
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;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AAE1E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;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
+ {"version":3,"file":"Text.types.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,SAAS,EACV,8BAAoB;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;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;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -1,15 +1,44 @@
1
1
  /// <reference types="react" />
2
- import type { TextPropsShared } from "@metamask-previews/design-system-shared";
3
- import type { OverflowWrap, TextAlign, TextTransform } from "../../types/index.mjs";
4
- export type TextProps = TextPropsShared & {
2
+ import type { FontFamily, FontStyle, FontWeight, OverflowWrap, TextAlign, TextVariant, TextTransform, TextColor } from "../../types/index.mjs";
3
+ export type TextProps = {
5
4
  /**
6
5
  * Optional prop for inline styles
7
6
  */
8
7
  style?: React.CSSProperties;
8
+ /**
9
+ * Optional prop to change the font size of the component. The Text component uses responsive font sizes.
10
+ * Different variants map to specific HTML elements by default.
11
+ *
12
+ * @default TextVariant.BodyMd
13
+ */
14
+ variant?: TextVariant;
15
+ /**
16
+ * The text content or elements to be rendered within the component.
17
+ */
18
+ children: React.ReactNode;
9
19
  /**
10
20
  * Optional prop for additional CSS classes to be applied to the Text component.
11
21
  */
12
22
  className?: string;
23
+ /**
24
+ * Optional prop to control the font weight of the text.
25
+ * Regular: 400
26
+ * Medium: 500
27
+ * Bold: 600
28
+ */
29
+ fontWeight?: FontWeight;
30
+ /**
31
+ * Optional prop to adjust the font family.
32
+ * Default: Geist
33
+ * Accent: MM Sans
34
+ * Hero: MM Poly
35
+ */
36
+ fontFamily?: FontFamily;
37
+ /**
38
+ * Optional prop to control the font style of the text.
39
+ * Options: Normal, Italic
40
+ */
41
+ fontStyle?: FontStyle;
13
42
  /**
14
43
  * Optional prop to apply text transformation to the content.
15
44
  * Options: Uppercase, Lowercase, Capitalize, Normal
@@ -26,7 +55,7 @@ export type TextProps = TextPropsShared & {
26
55
  */
27
56
  overflowWrap?: OverflowWrap;
28
57
  /**
29
- * Optional boolean that adds an ellipsis (...) when text overflows its container.
58
+ * Optional prop that when true, adds an ellipsis (...) when text overflows its container.
30
59
  *
31
60
  * @default false
32
61
  */
@@ -38,6 +67,12 @@ export type TextProps = TextPropsShared & {
38
67
  * @default false
39
68
  */
40
69
  asChild?: boolean;
70
+ /**
71
+ * Optional prop that sets the color of the text using predefined theme colors.
72
+ *
73
+ * @default TextColor.TextDefault
74
+ */
75
+ color?: TextColor;
41
76
  /**
42
77
  * Optional prop for testing purposes
43
78
  */
@@ -1 +1 @@
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;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AAE1E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;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
+ {"version":3,"file":"Text.types.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,SAAS,EACV,8BAAoB;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;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;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,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?: React.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
+ {"version":3,"file":"Text.types.mjs","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"]}
@@ -1,16 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Text = exports.TextTransform = exports.TextAlign = exports.OverflowWrap = exports.FontWeight = exports.FontStyle = exports.FontFamily = exports.TextVariant = exports.TextColor = void 0;
4
- var design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
- Object.defineProperty(exports, "TextColor", { enumerable: true, get: function () { return design_system_shared_1.TextColor; } });
6
- Object.defineProperty(exports, "TextVariant", { enumerable: true, get: function () { return design_system_shared_1.TextVariant; } });
7
- Object.defineProperty(exports, "FontFamily", { enumerable: true, get: function () { return design_system_shared_1.FontFamily; } });
8
- Object.defineProperty(exports, "FontStyle", { enumerable: true, get: function () { return design_system_shared_1.FontStyle; } });
9
- Object.defineProperty(exports, "FontWeight", { enumerable: true, get: function () { return design_system_shared_1.FontWeight; } });
3
+ exports.Text = exports.TextColor = exports.TextTransform = exports.TextVariant = exports.TextAlign = exports.OverflowWrap = exports.FontWeight = exports.FontStyle = exports.FontFamily = void 0;
10
4
  var types_1 = require("../../types/index.cjs");
5
+ Object.defineProperty(exports, "FontFamily", { enumerable: true, get: function () { return types_1.FontFamily; } });
6
+ Object.defineProperty(exports, "FontStyle", { enumerable: true, get: function () { return types_1.FontStyle; } });
7
+ Object.defineProperty(exports, "FontWeight", { enumerable: true, get: function () { return types_1.FontWeight; } });
11
8
  Object.defineProperty(exports, "OverflowWrap", { enumerable: true, get: function () { return types_1.OverflowWrap; } });
12
9
  Object.defineProperty(exports, "TextAlign", { enumerable: true, get: function () { return types_1.TextAlign; } });
10
+ Object.defineProperty(exports, "TextVariant", { enumerable: true, get: function () { return types_1.TextVariant; } });
13
11
  Object.defineProperty(exports, "TextTransform", { enumerable: true, get: function () { return types_1.TextTransform; } });
12
+ Object.defineProperty(exports, "TextColor", { enumerable: true, get: function () { return types_1.TextColor; } });
14
13
  var Text_1 = require("./Text.cjs");
15
14
  Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return Text_1.Text; } });
16
15
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":";;;AAAA,gFAOiD;AAN/C,iHAAA,SAAS,OAAA;AACT,mHAAA,WAAW,OAAA;AACX,kHAAA,UAAU,OAAA;AACV,iHAAA,SAAS,OAAA;AACT,kHAAA,UAAU,OAAA;AAGZ,+CAAqE;AAA5D,qGAAA,YAAY,OAAA;AAAE,kGAAA,SAAS,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC/C,mCAA8B;AAArB,4FAAA,IAAI,OAAA","sourcesContent":["export {\n TextColor,\n TextVariant,\n FontFamily,\n FontStyle,\n FontWeight,\n type TextPropsShared,\n} from '@metamask-previews/design-system-shared';\nexport { OverflowWrap, TextAlign, TextTransform } from '../../types';\nexport { Text } from './Text';\nexport type { TextProps } from './Text.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":";;;AAAA,+CASqB;AARnB,mGAAA,UAAU,OAAA;AACV,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,qGAAA,YAAY,OAAA;AACZ,kGAAA,SAAS,OAAA;AACT,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,kGAAA,SAAS,OAAA;AAEX,mCAA8B;AAArB,4FAAA,IAAI,OAAA","sourcesContent":["export {\n FontFamily,\n FontStyle,\n FontWeight,\n OverflowWrap,\n TextAlign,\n TextVariant,\n TextTransform,\n TextColor,\n} from '../../types';\nexport { Text } from './Text';\nexport type { TextProps } from './Text.types';\n"]}
@@ -1,5 +1,4 @@
1
- export { TextColor, TextVariant, FontFamily, FontStyle, FontWeight, type TextPropsShared, } from "@metamask-previews/design-system-shared";
2
- export { OverflowWrap, TextAlign, TextTransform } from "../../types/index.cjs";
1
+ export { FontFamily, FontStyle, FontWeight, OverflowWrap, TextAlign, TextVariant, TextTransform, TextColor, } from "../../types/index.cjs";
3
2
  export { Text } from "./Text.cjs";
4
3
  export type { TextProps } from "./Text.types.cjs";
5
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,KAAK,eAAe,GACrB,gDAAgD;AACjD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AACrE,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,SAAS,GACV,8BAAoB;AACrB,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
@@ -1,5 +1,4 @@
1
- export { TextColor, TextVariant, FontFamily, FontStyle, FontWeight, type TextPropsShared, } from "@metamask-previews/design-system-shared";
2
- export { OverflowWrap, TextAlign, TextTransform } from "../../types/index.mjs";
1
+ export { FontFamily, FontStyle, FontWeight, OverflowWrap, TextAlign, TextVariant, TextTransform, TextColor, } from "../../types/index.mjs";
3
2
  export { Text } from "./Text.mjs";
4
3
  export type { TextProps } from "./Text.types.mjs";
5
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,KAAK,eAAe,GACrB,gDAAgD;AACjD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AACrE,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,SAAS,GACV,8BAAoB;AACrB,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
@@ -1,4 +1,3 @@
1
- export { TextColor, TextVariant, FontFamily, FontStyle, FontWeight } from "@metamask-previews/design-system-shared";
2
- export { OverflowWrap, TextAlign, TextTransform } from "../../types/index.mjs";
1
+ export { FontFamily, FontStyle, FontWeight, OverflowWrap, TextAlign, TextVariant, TextTransform, TextColor } from "../../types/index.mjs";
3
2
  export { Text } from "./Text.mjs";
4
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EAEX,gDAAgD;AACjD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AACrE,OAAO,EAAE,IAAI,EAAE,mBAAe","sourcesContent":["export {\n TextColor,\n TextVariant,\n FontFamily,\n FontStyle,\n FontWeight,\n type TextPropsShared,\n} from '@metamask-previews/design-system-shared';\nexport { OverflowWrap, TextAlign, TextTransform } from '../../types';\nexport { Text } from './Text';\nexport type { TextProps } from './Text.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,SAAS,EACV,8BAAoB;AACrB,OAAO,EAAE,IAAI,EAAE,mBAAe","sourcesContent":["export {\n FontFamily,\n FontStyle,\n FontWeight,\n OverflowWrap,\n TextAlign,\n TextVariant,\n TextTransform,\n TextColor,\n} from '../../types';\nexport { Text } from './Text';\nexport type { TextProps } from './Text.types';\n"]}