@metamask-previews/design-system-react 0.0.0-preview.019292f

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 (92) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +20 -0
  3. package/README.md +15 -0
  4. package/dist/components/icon/Icon.cjs +21 -0
  5. package/dist/components/icon/Icon.cjs.map +1 -0
  6. package/dist/components/icon/Icon.constants.cjs +12 -0
  7. package/dist/components/icon/Icon.constants.cjs.map +1 -0
  8. package/dist/components/icon/Icon.constants.d.cts +3 -0
  9. package/dist/components/icon/Icon.constants.d.cts.map +1 -0
  10. package/dist/components/icon/Icon.constants.d.mts +3 -0
  11. package/dist/components/icon/Icon.constants.d.mts.map +1 -0
  12. package/dist/components/icon/Icon.constants.mjs +9 -0
  13. package/dist/components/icon/Icon.constants.mjs.map +1 -0
  14. package/dist/components/icon/Icon.d.cts +4 -0
  15. package/dist/components/icon/Icon.d.cts.map +1 -0
  16. package/dist/components/icon/Icon.d.mts +4 -0
  17. package/dist/components/icon/Icon.d.mts.map +1 -0
  18. package/dist/components/icon/Icon.mjs +21 -0
  19. package/dist/components/icon/Icon.mjs.map +1 -0
  20. package/dist/components/icon/Icon.types.cjs +53 -0
  21. package/dist/components/icon/Icon.types.cjs.map +1 -0
  22. package/dist/components/icon/Icon.types.d.cts +66 -0
  23. package/dist/components/icon/Icon.types.d.cts.map +1 -0
  24. package/dist/components/icon/Icon.types.d.mts +66 -0
  25. package/dist/components/icon/Icon.types.d.mts.map +1 -0
  26. package/dist/components/icon/Icon.types.mjs +50 -0
  27. package/dist/components/icon/Icon.types.mjs.map +1 -0
  28. package/dist/components/icon/index.cjs +10 -0
  29. package/dist/components/icon/index.cjs.map +1 -0
  30. package/dist/components/icon/index.d.cts +4 -0
  31. package/dist/components/icon/index.d.cts.map +1 -0
  32. package/dist/components/icon/index.d.mts +4 -0
  33. package/dist/components/icon/index.d.mts.map +1 -0
  34. package/dist/components/icon/index.mjs +3 -0
  35. package/dist/components/icon/index.mjs.map +1 -0
  36. package/dist/components/index.cjs +20 -0
  37. package/dist/components/index.cjs.map +1 -0
  38. package/dist/components/index.d.cts +7 -0
  39. package/dist/components/index.d.cts.map +1 -0
  40. package/dist/components/index.d.mts +7 -0
  41. package/dist/components/index.d.mts.map +1 -0
  42. package/dist/components/index.mjs +5 -0
  43. package/dist/components/index.mjs.map +1 -0
  44. package/dist/components/text/Text.cjs +20 -0
  45. package/dist/components/text/Text.cjs.map +1 -0
  46. package/dist/components/text/Text.constants.cjs +27 -0
  47. package/dist/components/text/Text.constants.cjs.map +1 -0
  48. package/dist/components/text/Text.constants.d.cts +5 -0
  49. package/dist/components/text/Text.constants.d.cts.map +1 -0
  50. package/dist/components/text/Text.constants.d.mts +5 -0
  51. package/dist/components/text/Text.constants.d.mts.map +1 -0
  52. package/dist/components/text/Text.constants.mjs +24 -0
  53. package/dist/components/text/Text.constants.mjs.map +1 -0
  54. package/dist/components/text/Text.d.cts +4 -0
  55. package/dist/components/text/Text.d.cts.map +1 -0
  56. package/dist/components/text/Text.d.mts +4 -0
  57. package/dist/components/text/Text.d.mts.map +1 -0
  58. package/dist/components/text/Text.mjs +20 -0
  59. package/dist/components/text/Text.mjs.map +1 -0
  60. package/dist/components/text/Text.types.cjs +96 -0
  61. package/dist/components/text/Text.types.cjs.map +1 -0
  62. package/dist/components/text/Text.types.d.cts +147 -0
  63. package/dist/components/text/Text.types.d.cts.map +1 -0
  64. package/dist/components/text/Text.types.d.mts +147 -0
  65. package/dist/components/text/Text.types.d.mts.map +1 -0
  66. package/dist/components/text/Text.types.mjs +93 -0
  67. package/dist/components/text/Text.types.mjs.map +1 -0
  68. package/dist/components/text/index.cjs +14 -0
  69. package/dist/components/text/index.cjs.map +1 -0
  70. package/dist/components/text/index.d.cts +4 -0
  71. package/dist/components/text/index.d.cts.map +1 -0
  72. package/dist/components/text/index.d.mts +4 -0
  73. package/dist/components/text/index.d.mts.map +1 -0
  74. package/dist/components/text/index.mjs +3 -0
  75. package/dist/components/text/index.mjs.map +1 -0
  76. package/dist/index.cjs +18 -0
  77. package/dist/index.cjs.map +1 -0
  78. package/dist/index.d.cts +2 -0
  79. package/dist/index.d.cts.map +1 -0
  80. package/dist/index.d.mts +2 -0
  81. package/dist/index.d.mts.map +1 -0
  82. package/dist/index.mjs +2 -0
  83. package/dist/index.mjs.map +1 -0
  84. package/dist/utils/tw-merge.cjs +67 -0
  85. package/dist/utils/tw-merge.cjs.map +1 -0
  86. package/dist/utils/tw-merge.d.cts +13 -0
  87. package/dist/utils/tw-merge.d.cts.map +1 -0
  88. package/dist/utils/tw-merge.d.mts +13 -0
  89. package/dist/utils/tw-merge.d.mts.map +1 -0
  90. package/dist/utils/tw-merge.mjs +64 -0
  91. package/dist/utils/tw-merge.mjs.map +1 -0
  92. package/package.json +85 -0
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TEXT_DEFAULT_TAG_MAP = exports.TEXT_CLASS_MAP = void 0;
4
+ const Text_types_1 = require("./Text.types.cjs");
5
+ exports.TEXT_CLASS_MAP = {
6
+ [Text_types_1.TextVariant.DisplayLg]: 'text-[2.5rem] md:text-[4rem] font-bold md:font-medium',
7
+ [Text_types_1.TextVariant.DisplayMd]: 'text-s-display-md font-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:font-medium',
8
+ [Text_types_1.TextVariant.HeadingLg]: 'text-s-heading-lg font-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg',
9
+ [Text_types_1.TextVariant.HeadingMd]: 'text-s-heading-md font-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md',
10
+ [Text_types_1.TextVariant.HeadingSm]: 'text-s-heading-sm font-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm',
11
+ [Text_types_1.TextVariant.BodyLg]: 'text-s-body-lg font-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg',
12
+ [Text_types_1.TextVariant.BodyMd]: 'text-s-body-md font-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md',
13
+ [Text_types_1.TextVariant.BodySm]: 'text-s-body-sm font-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm',
14
+ [Text_types_1.TextVariant.BodyXs]: 'text-s-body-xs font-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs',
15
+ };
16
+ exports.TEXT_DEFAULT_TAG_MAP = {
17
+ [Text_types_1.TextVariant.DisplayLg]: 'h1',
18
+ [Text_types_1.TextVariant.DisplayMd]: 'h1',
19
+ [Text_types_1.TextVariant.HeadingLg]: 'h2',
20
+ [Text_types_1.TextVariant.HeadingMd]: 'h3',
21
+ [Text_types_1.TextVariant.HeadingSm]: 'h4',
22
+ [Text_types_1.TextVariant.BodyLg]: 'p',
23
+ [Text_types_1.TextVariant.BodyMd]: 'p',
24
+ [Text_types_1.TextVariant.BodySm]: 'p',
25
+ [Text_types_1.TextVariant.BodyXs]: 'p',
26
+ };
27
+ //# sourceMappingURL=Text.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/text/Text.constants.ts"],"names":[],"mappings":";;;AAAA,iDAA2C;AAE9B,QAAA,cAAc,GAAgC;IACzD,CAAC,wBAAW,CAAC,SAAS,CAAC,EACrB,uDAAuD;IACzD,CAAC,wBAAW,CAAC,SAAS,CAAC,EACrB,oHAAoH;IACtH,CAAC,wBAAW,CAAC,SAAS,CAAC,EACrB,qGAAqG;IACvG,CAAC,wBAAW,CAAC,SAAS,CAAC,EACrB,qGAAqG;IACvG,CAAC,wBAAW,CAAC,SAAS,CAAC,EACrB,qGAAqG;IACvG,CAAC,wBAAW,CAAC,MAAM,CAAC,EAClB,sFAAsF;IACxF,CAAC,wBAAW,CAAC,MAAM,CAAC,EAClB,sFAAsF;IACxF,CAAC,wBAAW,CAAC,MAAM,CAAC,EAClB,sFAAsF;IACxF,CAAC,wBAAW,CAAC,MAAM,CAAC,EAClB,sFAAsF;CACzF,CAAC;AAEW,QAAA,oBAAoB,GAG7B;IACF,CAAC,wBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,wBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,wBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,wBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,wBAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,wBAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,wBAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,wBAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,wBAAW,CAAC,MAAM,CAAC,EAAE,GAAG;CAC1B,CAAC","sourcesContent":["import { TextVariant } from './Text.types';\n\nexport const TEXT_CLASS_MAP: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-[2.5rem] md:text-[4rem] font-bold md:font-medium',\n [TextVariant.DisplayMd]:\n 'text-s-display-md font-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:font-medium',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg font-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md font-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm font-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg font-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md font-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm font-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs font-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs',\n};\n\nexport const TEXT_DEFAULT_TAG_MAP: 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};\n"]}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { TextVariant } from "./Text.types.cjs";
3
+ export declare const TEXT_CLASS_MAP: Record<TextVariant, string>;
4
+ export declare const TEXT_DEFAULT_TAG_MAP: Record<TextVariant, keyof JSX.IntrinsicElements>;
5
+ //# sourceMappingURL=Text.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,yBAAqB;AAE3C,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAmBtD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,GAAG,CAAC,iBAAiB,CAW5B,CAAC"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { TextVariant } from "./Text.types.mjs";
3
+ export declare const TEXT_CLASS_MAP: Record<TextVariant, string>;
4
+ export declare const TEXT_DEFAULT_TAG_MAP: Record<TextVariant, keyof JSX.IntrinsicElements>;
5
+ //# sourceMappingURL=Text.constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,yBAAqB;AAE3C,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAmBtD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,GAAG,CAAC,iBAAiB,CAW5B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { TextVariant } from "./Text.types.mjs";
2
+ export const TEXT_CLASS_MAP = {
3
+ [TextVariant.DisplayLg]: 'text-[2.5rem] md:text-[4rem] font-bold md:font-medium',
4
+ [TextVariant.DisplayMd]: 'text-s-display-md font-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:font-medium',
5
+ [TextVariant.HeadingLg]: 'text-s-heading-lg font-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg',
6
+ [TextVariant.HeadingMd]: 'text-s-heading-md font-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md',
7
+ [TextVariant.HeadingSm]: 'text-s-heading-sm font-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm',
8
+ [TextVariant.BodyLg]: 'text-s-body-lg font-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg',
9
+ [TextVariant.BodyMd]: 'text-s-body-md font-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md',
10
+ [TextVariant.BodySm]: 'text-s-body-sm font-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm',
11
+ [TextVariant.BodyXs]: 'text-s-body-xs font-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs',
12
+ };
13
+ export const TEXT_DEFAULT_TAG_MAP = {
14
+ [TextVariant.DisplayLg]: 'h1',
15
+ [TextVariant.DisplayMd]: 'h1',
16
+ [TextVariant.HeadingLg]: 'h2',
17
+ [TextVariant.HeadingMd]: 'h3',
18
+ [TextVariant.HeadingSm]: 'h4',
19
+ [TextVariant.BodyLg]: 'p',
20
+ [TextVariant.BodyMd]: 'p',
21
+ [TextVariant.BodySm]: 'p',
22
+ [TextVariant.BodyXs]: 'p',
23
+ };
24
+ //# sourceMappingURL=Text.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,yBAAqB;AAE3C,MAAM,CAAC,MAAM,cAAc,GAAgC;IACzD,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,uDAAuD;IACzD,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oHAAoH;IACtH,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,qGAAqG;IACvG,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,qGAAqG;IACvG,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,qGAAqG;IACvG,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,sFAAsF;IACxF,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,sFAAsF;IACxF,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,sFAAsF;IACxF,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,sFAAsF;CACzF,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;CAC1B,CAAC","sourcesContent":["import { TextVariant } from './Text.types';\n\nexport const TEXT_CLASS_MAP: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-[2.5rem] md:text-[4rem] font-bold md:font-medium',\n [TextVariant.DisplayMd]:\n 'text-s-display-md font-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:font-medium',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg font-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md font-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm font-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg font-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md font-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm font-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs font-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs',\n};\n\nexport const TEXT_DEFAULT_TAG_MAP: 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};\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { TextProps } from "./Text.types.cjs";
3
+ export declare const Text: React.FC<TextProps>;
4
+ //# sourceMappingURL=Text.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAG9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAmCpC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { TextProps } from "./Text.types.mjs";
3
+ export declare const Text: React.FC<TextProps>;
4
+ //# sourceMappingURL=Text.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAG9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAmCpC,CAAC"}
@@ -0,0 +1,20 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import { Slot } from "@radix-ui/react-slot";
8
+ import $React from "react";
9
+ const React = $importDefault($React);
10
+ import { twMerge } from "../../utils/tw-merge.mjs";
11
+ import { TEXT_CLASS_MAP, TEXT_DEFAULT_TAG_MAP } from "./Text.constants.mjs";
12
+ import { TextVariant, TextColor } from "./Text.types.mjs";
13
+ export const Text = ({ variant = TextVariant.BodyMd, children, className, fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = TextColor.TextDefault, style, }) => {
14
+ // When asChild is true, use Radix Slot to merge props onto the child component.
15
+ // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
16
+ const Component = asChild ? Slot : TEXT_DEFAULT_TAG_MAP[variant];
17
+ const mergedClassName = twMerge(color, TEXT_CLASS_MAP[variant], fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className);
18
+ return (React.createElement(Component, { className: mergedClassName, style: style }, children));
19
+ };
20
+ //# sourceMappingURL=Text.mjs.map
@@ -0,0 +1 @@
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,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,6BAAyB;AAExE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,yBAAqB;AAEtD,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,GACN,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,OAAO,CAC7B,KAAK,EACL,cAAc,CAAC,OAAO,CAAC,EACvB,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,IAChD,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { TEXT_CLASS_MAP, TEXT_DEFAULT_TAG_MAP } from './Text.constants';\nimport type { TextProps } from './Text.types';\nimport { TextVariant, TextColor } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\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 : TEXT_DEFAULT_TAG_MAP[variant];\n\n const mergedClassName = twMerge(\n color,\n TEXT_CLASS_MAP[variant],\n fontWeight,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n );\n\n return (\n <Component className={mergedClassName} style={style}>\n {children}\n </Component>\n );\n};\n"]}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextTransform = exports.FontStyle = exports.OverflowWrap = exports.FontWeight = exports.TextAlign = exports.TextColor = exports.TextVariant = void 0;
4
+ var TextVariant;
5
+ (function (TextVariant) {
6
+ // Display Sizes
7
+ TextVariant["DisplayLg"] = "display-lg";
8
+ TextVariant["DisplayMd"] = "display-md";
9
+ // Heading Sizes
10
+ TextVariant["HeadingLg"] = "heading-lg";
11
+ TextVariant["HeadingMd"] = "heading-md";
12
+ TextVariant["HeadingSm"] = "heading-sm";
13
+ // Font Sizes
14
+ TextVariant["BodyLg"] = "body-lg";
15
+ TextVariant["BodyMd"] = "body-md";
16
+ TextVariant["BodySm"] = "body-sm";
17
+ TextVariant["BodyXs"] = "body-xs";
18
+ })(TextVariant || (exports.TextVariant = TextVariant = {}));
19
+ var TextColor;
20
+ (function (TextColor) {
21
+ /** For default neutral text. */
22
+ TextColor["TextDefault"] = "text-default";
23
+ /** For softer contrast neutral text */
24
+ TextColor["TextAlternative"] = "text-alternative";
25
+ /** For the softest contrast neutral text (not accessible) */
26
+ TextColor["TextMuted"] = "text-muted";
27
+ /** For elements used on top of overlay/alternative. Used for text, icon or border */
28
+ TextColor["OverlayInverse"] = "text-overlay-inverse";
29
+ /** For interactive, active, and selected semantics. Used for text, background, icon or border */
30
+ TextColor["PrimaryDefault"] = "text-primary-default";
31
+ /** For elements used on top of primary/default. Used for text, icon or border */
32
+ TextColor["PrimaryInverse"] = "text-primary-inverse";
33
+ /** For the critical alert semantic elements. Used for text, background, icon or border */
34
+ TextColor["ErrorDefault"] = "text-error-default";
35
+ /** For the stronger contrast error semantic elements. */
36
+ TextColor["ErrorAlternative"] = "text-error-alternative";
37
+ /** For elements used on top of error/default. Used for text, icon or border */
38
+ TextColor["ErrorInverse"] = "text-error-inverse";
39
+ /** For the positive semantic elements. Used for text, background, icon or border */
40
+ TextColor["SuccessDefault"] = "text-success-default";
41
+ /** For elements used on top of success/default. Used for text, icon or border */
42
+ TextColor["SuccessInverse"] = "text-success-inverse";
43
+ /** For the caution alert semantic elements. Used for text, background, icon or border */
44
+ TextColor["WarningDefault"] = "text-warning-default";
45
+ /** For elements used on top of warning/default. Used for text, icon or border */
46
+ TextColor["WarningInverse"] = "text-warning-inverse";
47
+ /** For informational read-only elements. Used for text, background, icon or border */
48
+ TextColor["InfoDefault"] = "text-info-default";
49
+ /** For elements used on top of info/default. Used for text, icon or border */
50
+ TextColor["InfoInverse"] = "text-info-inverse";
51
+ /** Inherit the color of the parent element */
52
+ TextColor["Inherit"] = "text-inherit";
53
+ /** Make the text color transparent */
54
+ TextColor["Transparent"] = "text-transparent";
55
+ })(TextColor || (exports.TextColor = TextColor = {}));
56
+ var TextAlign;
57
+ (function (TextAlign) {
58
+ TextAlign["Left"] = "text-left";
59
+ TextAlign["Center"] = "text-center";
60
+ TextAlign["Right"] = "text-right";
61
+ TextAlign["Justify"] = "text-justify";
62
+ })(TextAlign || (exports.TextAlign = TextAlign = {}));
63
+ var FontWeight;
64
+ (function (FontWeight) {
65
+ /**
66
+ * Weight - 700
67
+ */
68
+ FontWeight["Bold"] = "font-bold";
69
+ /**
70
+ * Weight - 500
71
+ */
72
+ FontWeight["Medium"] = "font-medium";
73
+ /**
74
+ * Weight - 400
75
+ */
76
+ FontWeight["Normal"] = "font-normal";
77
+ })(FontWeight || (exports.FontWeight = FontWeight = {}));
78
+ var OverflowWrap;
79
+ (function (OverflowWrap) {
80
+ OverflowWrap["BreakWord"] = "break-words";
81
+ OverflowWrap["Anywhere"] = "break-all";
82
+ OverflowWrap["Normal"] = "break-normal";
83
+ })(OverflowWrap || (exports.OverflowWrap = OverflowWrap = {}));
84
+ var FontStyle;
85
+ (function (FontStyle) {
86
+ FontStyle["Italic"] = "italic";
87
+ FontStyle["Normal"] = "not-italic";
88
+ })(FontStyle || (exports.FontStyle = FontStyle = {}));
89
+ var TextTransform;
90
+ (function (TextTransform) {
91
+ TextTransform["Uppercase"] = "uppercase";
92
+ TextTransform["Lowercase"] = "lowercase";
93
+ TextTransform["Capitalize"] = "capitalize";
94
+ TextTransform["Normal"] = "normal-case";
95
+ })(TextTransform || (exports.TextTransform = TextTransform = {}));
96
+ //# sourceMappingURL=Text.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/text/Text.types.ts"],"names":[],"mappings":";;;AAgEA,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,gBAAgB;IAChB,uCAAwB,CAAA;IACxB,uCAAwB,CAAA;IAExB,gBAAgB;IAChB,uCAAwB,CAAA;IACxB,uCAAwB,CAAA;IACxB,uCAAwB,CAAA;IAExB,aAAa;IACb,iCAAkB,CAAA;IAClB,iCAAkB,CAAA;IAClB,iCAAkB,CAAA;IAClB,iCAAkB,CAAA;AACpB,CAAC,EAfW,WAAW,2BAAX,WAAW,QAetB;AAED,IAAY,SAmCX;AAnCD,WAAY,SAAS;IACnB,gCAAgC;IAChC,yCAA4B,CAAA;IAC5B,uCAAuC;IACvC,iDAAoC,CAAA;IACpC,6DAA6D;IAC7D,qCAAwB,CAAA;IACxB,qFAAqF;IACrF,oDAAuC,CAAA;IACvC,iGAAiG;IACjG,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,0FAA0F;IAC1F,gDAAmC,CAAA;IACnC,yDAAyD;IACzD,wDAA2C,CAAA;IAC3C,+EAA+E;IAC/E,gDAAmC,CAAA;IACnC,oFAAoF;IACpF,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,yFAAyF;IACzF,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,sFAAsF;IACtF,8CAAiC,CAAA;IACjC,8EAA8E;IAC9E,8CAAiC,CAAA;IACjC,8CAA8C;IAC9C,qCAAwB,CAAA;IACxB,sCAAsC;IACtC,6CAAgC,CAAA;AAClC,CAAC,EAnCW,SAAS,yBAAT,SAAS,QAmCpB;AAED,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,+BAAkB,CAAA;IAClB,mCAAsB,CAAA;IACtB,iCAAoB,CAAA;IACpB,qCAAwB,CAAA;AAC1B,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AAED,IAAY,UAaX;AAbD,WAAY,UAAU;IACpB;;OAEG;IACH,gCAAkB,CAAA;IAClB;;OAEG;IACH,oCAAsB,CAAA;IACtB;;OAEG;IACH,oCAAsB,CAAA;AACxB,CAAC,EAbW,UAAU,0BAAV,UAAU,QAarB;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,sCAAsB,CAAA;IACtB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,wCAAuB,CAAA;IACvB,0CAAyB,CAAA;IACzB,uCAAsB,CAAA;AACxB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB","sourcesContent":["export 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 * @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 * - Normal: 400\n * - Medium: 500\n * - Bold: 700\n */\n fontWeight?: FontWeight;\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 * @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 * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop that sets the color of the text using predefined theme colors.\n * @default TextColor.TextDefault\n */\n color?: TextColor;\n};\n\nexport enum TextVariant {\n // Display Sizes\n DisplayLg = 'display-lg',\n DisplayMd = 'display-md',\n\n // Heading Sizes\n HeadingLg = 'heading-lg',\n HeadingMd = 'heading-md',\n HeadingSm = 'heading-sm',\n\n // Font Sizes\n BodyLg = 'body-lg',\n BodyMd = 'body-md',\n BodySm = 'body-sm',\n BodyXs = 'body-xs',\n}\n\nexport enum TextColor {\n /** For default neutral text. */\n TextDefault = 'text-default',\n /** For softer contrast neutral text */\n TextAlternative = 'text-alternative',\n /** For the softest contrast neutral text (not accessible) */\n TextMuted = 'text-muted',\n /** For elements used on top of overlay/alternative. Used for text, icon or border */\n OverlayInverse = 'text-overlay-inverse',\n /** For interactive, active, and selected semantics. Used for text, background, icon or border */\n PrimaryDefault = 'text-primary-default',\n /** For elements used on top of primary/default. Used for text, icon or border */\n PrimaryInverse = 'text-primary-inverse',\n /** For the critical alert semantic elements. Used for text, background, icon or border */\n ErrorDefault = 'text-error-default',\n /** For the stronger contrast error semantic elements. */\n ErrorAlternative = 'text-error-alternative',\n /** For elements used on top of error/default. Used for text, icon or border */\n ErrorInverse = 'text-error-inverse',\n /** For the positive semantic elements. Used for text, background, icon or border */\n SuccessDefault = 'text-success-default',\n /** For elements used on top of success/default. Used for text, icon or border */\n SuccessInverse = 'text-success-inverse',\n /** For the caution alert semantic elements. Used for text, background, icon or border */\n WarningDefault = 'text-warning-default',\n /** For elements used on top of warning/default. Used for text, icon or border */\n WarningInverse = 'text-warning-inverse',\n /** For informational read-only elements. Used for text, background, icon or border */\n InfoDefault = 'text-info-default',\n /** For elements used on top of info/default. Used for text, icon or border */\n InfoInverse = 'text-info-inverse',\n /** Inherit the color of the parent element */\n Inherit = 'text-inherit',\n /** Make the text color transparent */\n Transparent = 'text-transparent',\n}\n\nexport enum TextAlign {\n Left = 'text-left',\n Center = 'text-center',\n Right = 'text-right',\n Justify = 'text-justify',\n}\n\nexport enum FontWeight {\n /**\n * Weight - 700\n */\n Bold = 'font-bold',\n /**\n * Weight - 500\n */\n Medium = 'font-medium',\n /**\n * Weight - 400\n */\n Normal = 'font-normal',\n}\n\nexport enum OverflowWrap {\n BreakWord = 'break-words',\n Anywhere = 'break-all',\n Normal = 'break-normal',\n}\n\nexport enum FontStyle {\n Italic = 'italic',\n Normal = 'not-italic',\n}\n\nexport enum TextTransform {\n Uppercase = 'uppercase',\n Lowercase = 'lowercase',\n Capitalize = 'capitalize',\n Normal = 'normal-case',\n}\n"]}
@@ -0,0 +1,147 @@
1
+ /// <reference types="react" />
2
+ export type TextProps = {
3
+ /**
4
+ * Optional prop for inline styles
5
+ */
6
+ style?: React.CSSProperties;
7
+ /**
8
+ * Optional prop to change the font size of the component. The Text component uses responsive font sizes.
9
+ * Different variants map to specific HTML elements by default.
10
+ * @default TextVariant.BodyMd
11
+ */
12
+ variant?: TextVariant;
13
+ /**
14
+ * The text content or elements to be rendered within the component.
15
+ */
16
+ children: React.ReactNode;
17
+ /**
18
+ * Optional prop for additional CSS classes to be applied to the Text component.
19
+ */
20
+ className?: string;
21
+ /**
22
+ * Optional prop to control the font weight of the text.
23
+ * - Normal: 400
24
+ * - Medium: 500
25
+ * - Bold: 700
26
+ */
27
+ fontWeight?: FontWeight;
28
+ /**
29
+ * Optional prop to control the font style of the text.
30
+ * Options: Normal, Italic
31
+ */
32
+ fontStyle?: FontStyle;
33
+ /**
34
+ * Optional prop to apply text transformation to the content.
35
+ * Options: Uppercase, Lowercase, Capitalize, Normal
36
+ */
37
+ textTransform?: TextTransform;
38
+ /**
39
+ * Optional prop to control the text alignment within its container.
40
+ * Options: Left, Center, Right, Justify
41
+ */
42
+ textAlign?: TextAlign;
43
+ /**
44
+ * Optional prop to determine how text should wrap when it reaches the edge of its container.
45
+ * Options: BreakWord, Anywhere, Normal
46
+ */
47
+ overflowWrap?: OverflowWrap;
48
+ /**
49
+ * Optional prop that when true, adds an ellipsis (...) when text overflows its container.
50
+ * @default false
51
+ */
52
+ ellipsis?: boolean;
53
+ /**
54
+ * Optional boolean that determines if the component should merge its props onto its immediate child
55
+ * instead of rendering a default DOM element.
56
+ * @default false
57
+ */
58
+ asChild?: boolean;
59
+ /**
60
+ * Optional prop that sets the color of the text using predefined theme colors.
61
+ * @default TextColor.TextDefault
62
+ */
63
+ color?: TextColor;
64
+ };
65
+ export declare enum TextVariant {
66
+ DisplayLg = "display-lg",
67
+ DisplayMd = "display-md",
68
+ HeadingLg = "heading-lg",
69
+ HeadingMd = "heading-md",
70
+ HeadingSm = "heading-sm",
71
+ BodyLg = "body-lg",
72
+ BodyMd = "body-md",
73
+ BodySm = "body-sm",
74
+ BodyXs = "body-xs"
75
+ }
76
+ export declare enum TextColor {
77
+ /** For default neutral text. */
78
+ TextDefault = "text-default",
79
+ /** For softer contrast neutral text */
80
+ TextAlternative = "text-alternative",
81
+ /** For the softest contrast neutral text (not accessible) */
82
+ TextMuted = "text-muted",
83
+ /** For elements used on top of overlay/alternative. Used for text, icon or border */
84
+ OverlayInverse = "text-overlay-inverse",
85
+ /** For interactive, active, and selected semantics. Used for text, background, icon or border */
86
+ PrimaryDefault = "text-primary-default",
87
+ /** For elements used on top of primary/default. Used for text, icon or border */
88
+ PrimaryInverse = "text-primary-inverse",
89
+ /** For the critical alert semantic elements. Used for text, background, icon or border */
90
+ ErrorDefault = "text-error-default",
91
+ /** For the stronger contrast error semantic elements. */
92
+ ErrorAlternative = "text-error-alternative",
93
+ /** For elements used on top of error/default. Used for text, icon or border */
94
+ ErrorInverse = "text-error-inverse",
95
+ /** For the positive semantic elements. Used for text, background, icon or border */
96
+ SuccessDefault = "text-success-default",
97
+ /** For elements used on top of success/default. Used for text, icon or border */
98
+ SuccessInverse = "text-success-inverse",
99
+ /** For the caution alert semantic elements. Used for text, background, icon or border */
100
+ WarningDefault = "text-warning-default",
101
+ /** For elements used on top of warning/default. Used for text, icon or border */
102
+ WarningInverse = "text-warning-inverse",
103
+ /** For informational read-only elements. Used for text, background, icon or border */
104
+ InfoDefault = "text-info-default",
105
+ /** For elements used on top of info/default. Used for text, icon or border */
106
+ InfoInverse = "text-info-inverse",
107
+ /** Inherit the color of the parent element */
108
+ Inherit = "text-inherit",
109
+ /** Make the text color transparent */
110
+ Transparent = "text-transparent"
111
+ }
112
+ export declare enum TextAlign {
113
+ Left = "text-left",
114
+ Center = "text-center",
115
+ Right = "text-right",
116
+ Justify = "text-justify"
117
+ }
118
+ export declare enum FontWeight {
119
+ /**
120
+ * Weight - 700
121
+ */
122
+ Bold = "font-bold",
123
+ /**
124
+ * Weight - 500
125
+ */
126
+ Medium = "font-medium",
127
+ /**
128
+ * Weight - 400
129
+ */
130
+ Normal = "font-normal"
131
+ }
132
+ export declare enum OverflowWrap {
133
+ BreakWord = "break-words",
134
+ Anywhere = "break-all",
135
+ Normal = "break-normal"
136
+ }
137
+ export declare enum FontStyle {
138
+ Italic = "italic",
139
+ Normal = "not-italic"
140
+ }
141
+ export declare enum TextTransform {
142
+ Uppercase = "uppercase",
143
+ Lowercase = "lowercase",
144
+ Capitalize = "capitalize",
145
+ Normal = "normal-case"
146
+ }
147
+ //# sourceMappingURL=Text.types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.types.d.cts","sourceRoot":"","sources":["../../../src/components/text/Text.types.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;;OAIG;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;;;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;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,oBAAY,WAAW;IAErB,SAAS,eAAe;IACxB,SAAS,eAAe;IAGxB,SAAS,eAAe;IACxB,SAAS,eAAe;IACxB,SAAS,eAAe;IAGxB,MAAM,YAAY;IAClB,MAAM,YAAY;IAClB,MAAM,YAAY;IAClB,MAAM,YAAY;CACnB;AAED,oBAAY,SAAS;IACnB,gCAAgC;IAChC,WAAW,iBAAiB;IAC5B,uCAAuC;IACvC,eAAe,qBAAqB;IACpC,6DAA6D;IAC7D,SAAS,eAAe;IACxB,qFAAqF;IACrF,cAAc,yBAAyB;IACvC,iGAAiG;IACjG,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,0FAA0F;IAC1F,YAAY,uBAAuB;IACnC,yDAAyD;IACzD,gBAAgB,2BAA2B;IAC3C,+EAA+E;IAC/E,YAAY,uBAAuB;IACnC,oFAAoF;IACpF,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,yFAAyF;IACzF,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,sFAAsF;IACtF,WAAW,sBAAsB;IACjC,8EAA8E;IAC9E,WAAW,sBAAsB;IACjC,8CAA8C;IAC9C,OAAO,iBAAiB;IACxB,sCAAsC;IACtC,WAAW,qBAAqB;CACjC;AAED,oBAAY,SAAS;IACnB,IAAI,cAAc;IAClB,MAAM,gBAAgB;IACtB,KAAK,eAAe;IACpB,OAAO,iBAAiB;CACzB;AAED,oBAAY,UAAU;IACpB;;OAEG;IACH,IAAI,cAAc;IAClB;;OAEG;IACH,MAAM,gBAAgB;IACtB;;OAEG;IACH,MAAM,gBAAgB;CACvB;AAED,oBAAY,YAAY;IACtB,SAAS,gBAAgB;IACzB,QAAQ,cAAc;IACtB,MAAM,iBAAiB;CACxB;AAED,oBAAY,SAAS;IACnB,MAAM,WAAW;IACjB,MAAM,eAAe;CACtB;AAED,oBAAY,aAAa;IACvB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,MAAM,gBAAgB;CACvB"}
@@ -0,0 +1,147 @@
1
+ /// <reference types="react" />
2
+ export type TextProps = {
3
+ /**
4
+ * Optional prop for inline styles
5
+ */
6
+ style?: React.CSSProperties;
7
+ /**
8
+ * Optional prop to change the font size of the component. The Text component uses responsive font sizes.
9
+ * Different variants map to specific HTML elements by default.
10
+ * @default TextVariant.BodyMd
11
+ */
12
+ variant?: TextVariant;
13
+ /**
14
+ * The text content or elements to be rendered within the component.
15
+ */
16
+ children: React.ReactNode;
17
+ /**
18
+ * Optional prop for additional CSS classes to be applied to the Text component.
19
+ */
20
+ className?: string;
21
+ /**
22
+ * Optional prop to control the font weight of the text.
23
+ * - Normal: 400
24
+ * - Medium: 500
25
+ * - Bold: 700
26
+ */
27
+ fontWeight?: FontWeight;
28
+ /**
29
+ * Optional prop to control the font style of the text.
30
+ * Options: Normal, Italic
31
+ */
32
+ fontStyle?: FontStyle;
33
+ /**
34
+ * Optional prop to apply text transformation to the content.
35
+ * Options: Uppercase, Lowercase, Capitalize, Normal
36
+ */
37
+ textTransform?: TextTransform;
38
+ /**
39
+ * Optional prop to control the text alignment within its container.
40
+ * Options: Left, Center, Right, Justify
41
+ */
42
+ textAlign?: TextAlign;
43
+ /**
44
+ * Optional prop to determine how text should wrap when it reaches the edge of its container.
45
+ * Options: BreakWord, Anywhere, Normal
46
+ */
47
+ overflowWrap?: OverflowWrap;
48
+ /**
49
+ * Optional prop that when true, adds an ellipsis (...) when text overflows its container.
50
+ * @default false
51
+ */
52
+ ellipsis?: boolean;
53
+ /**
54
+ * Optional boolean that determines if the component should merge its props onto its immediate child
55
+ * instead of rendering a default DOM element.
56
+ * @default false
57
+ */
58
+ asChild?: boolean;
59
+ /**
60
+ * Optional prop that sets the color of the text using predefined theme colors.
61
+ * @default TextColor.TextDefault
62
+ */
63
+ color?: TextColor;
64
+ };
65
+ export declare enum TextVariant {
66
+ DisplayLg = "display-lg",
67
+ DisplayMd = "display-md",
68
+ HeadingLg = "heading-lg",
69
+ HeadingMd = "heading-md",
70
+ HeadingSm = "heading-sm",
71
+ BodyLg = "body-lg",
72
+ BodyMd = "body-md",
73
+ BodySm = "body-sm",
74
+ BodyXs = "body-xs"
75
+ }
76
+ export declare enum TextColor {
77
+ /** For default neutral text. */
78
+ TextDefault = "text-default",
79
+ /** For softer contrast neutral text */
80
+ TextAlternative = "text-alternative",
81
+ /** For the softest contrast neutral text (not accessible) */
82
+ TextMuted = "text-muted",
83
+ /** For elements used on top of overlay/alternative. Used for text, icon or border */
84
+ OverlayInverse = "text-overlay-inverse",
85
+ /** For interactive, active, and selected semantics. Used for text, background, icon or border */
86
+ PrimaryDefault = "text-primary-default",
87
+ /** For elements used on top of primary/default. Used for text, icon or border */
88
+ PrimaryInverse = "text-primary-inverse",
89
+ /** For the critical alert semantic elements. Used for text, background, icon or border */
90
+ ErrorDefault = "text-error-default",
91
+ /** For the stronger contrast error semantic elements. */
92
+ ErrorAlternative = "text-error-alternative",
93
+ /** For elements used on top of error/default. Used for text, icon or border */
94
+ ErrorInverse = "text-error-inverse",
95
+ /** For the positive semantic elements. Used for text, background, icon or border */
96
+ SuccessDefault = "text-success-default",
97
+ /** For elements used on top of success/default. Used for text, icon or border */
98
+ SuccessInverse = "text-success-inverse",
99
+ /** For the caution alert semantic elements. Used for text, background, icon or border */
100
+ WarningDefault = "text-warning-default",
101
+ /** For elements used on top of warning/default. Used for text, icon or border */
102
+ WarningInverse = "text-warning-inverse",
103
+ /** For informational read-only elements. Used for text, background, icon or border */
104
+ InfoDefault = "text-info-default",
105
+ /** For elements used on top of info/default. Used for text, icon or border */
106
+ InfoInverse = "text-info-inverse",
107
+ /** Inherit the color of the parent element */
108
+ Inherit = "text-inherit",
109
+ /** Make the text color transparent */
110
+ Transparent = "text-transparent"
111
+ }
112
+ export declare enum TextAlign {
113
+ Left = "text-left",
114
+ Center = "text-center",
115
+ Right = "text-right",
116
+ Justify = "text-justify"
117
+ }
118
+ export declare enum FontWeight {
119
+ /**
120
+ * Weight - 700
121
+ */
122
+ Bold = "font-bold",
123
+ /**
124
+ * Weight - 500
125
+ */
126
+ Medium = "font-medium",
127
+ /**
128
+ * Weight - 400
129
+ */
130
+ Normal = "font-normal"
131
+ }
132
+ export declare enum OverflowWrap {
133
+ BreakWord = "break-words",
134
+ Anywhere = "break-all",
135
+ Normal = "break-normal"
136
+ }
137
+ export declare enum FontStyle {
138
+ Italic = "italic",
139
+ Normal = "not-italic"
140
+ }
141
+ export declare enum TextTransform {
142
+ Uppercase = "uppercase",
143
+ Lowercase = "lowercase",
144
+ Capitalize = "capitalize",
145
+ Normal = "normal-case"
146
+ }
147
+ //# sourceMappingURL=Text.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.types.d.mts","sourceRoot":"","sources":["../../../src/components/text/Text.types.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;;OAIG;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;;;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;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,oBAAY,WAAW;IAErB,SAAS,eAAe;IACxB,SAAS,eAAe;IAGxB,SAAS,eAAe;IACxB,SAAS,eAAe;IACxB,SAAS,eAAe;IAGxB,MAAM,YAAY;IAClB,MAAM,YAAY;IAClB,MAAM,YAAY;IAClB,MAAM,YAAY;CACnB;AAED,oBAAY,SAAS;IACnB,gCAAgC;IAChC,WAAW,iBAAiB;IAC5B,uCAAuC;IACvC,eAAe,qBAAqB;IACpC,6DAA6D;IAC7D,SAAS,eAAe;IACxB,qFAAqF;IACrF,cAAc,yBAAyB;IACvC,iGAAiG;IACjG,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,0FAA0F;IAC1F,YAAY,uBAAuB;IACnC,yDAAyD;IACzD,gBAAgB,2BAA2B;IAC3C,+EAA+E;IAC/E,YAAY,uBAAuB;IACnC,oFAAoF;IACpF,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,yFAAyF;IACzF,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,sFAAsF;IACtF,WAAW,sBAAsB;IACjC,8EAA8E;IAC9E,WAAW,sBAAsB;IACjC,8CAA8C;IAC9C,OAAO,iBAAiB;IACxB,sCAAsC;IACtC,WAAW,qBAAqB;CACjC;AAED,oBAAY,SAAS;IACnB,IAAI,cAAc;IAClB,MAAM,gBAAgB;IACtB,KAAK,eAAe;IACpB,OAAO,iBAAiB;CACzB;AAED,oBAAY,UAAU;IACpB;;OAEG;IACH,IAAI,cAAc;IAClB;;OAEG;IACH,MAAM,gBAAgB;IACtB;;OAEG;IACH,MAAM,gBAAgB;CACvB;AAED,oBAAY,YAAY;IACtB,SAAS,gBAAgB;IACzB,QAAQ,cAAc;IACtB,MAAM,iBAAiB;CACxB;AAED,oBAAY,SAAS;IACnB,MAAM,WAAW;IACjB,MAAM,eAAe;CACtB;AAED,oBAAY,aAAa;IACvB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,MAAM,gBAAgB;CACvB"}