@metamask-previews/design-system-react 0.0.0-preview.04cb60f

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 (76) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +20 -0
  3. package/README.md +15 -0
  4. package/dist/components/button/Button.cjs +10 -0
  5. package/dist/components/button/Button.cjs.map +1 -0
  6. package/dist/components/button/Button.d.cts +7 -0
  7. package/dist/components/button/Button.d.cts.map +1 -0
  8. package/dist/components/button/Button.d.mts +7 -0
  9. package/dist/components/button/Button.d.mts.map +1 -0
  10. package/dist/components/button/Button.mjs +10 -0
  11. package/dist/components/button/Button.mjs.map +1 -0
  12. package/dist/components/button/index.cjs +6 -0
  13. package/dist/components/button/index.cjs.map +1 -0
  14. package/dist/components/button/index.d.cts +3 -0
  15. package/dist/components/button/index.d.cts.map +1 -0
  16. package/dist/components/button/index.d.mts +3 -0
  17. package/dist/components/button/index.d.mts.map +1 -0
  18. package/dist/components/button/index.mjs +2 -0
  19. package/dist/components/button/index.mjs.map +1 -0
  20. package/dist/components/index.cjs +16 -0
  21. package/dist/components/index.cjs.map +1 -0
  22. package/dist/components/index.d.cts +6 -0
  23. package/dist/components/index.d.cts.map +1 -0
  24. package/dist/components/index.d.mts +6 -0
  25. package/dist/components/index.d.mts.map +1 -0
  26. package/dist/components/index.mjs +4 -0
  27. package/dist/components/index.mjs.map +1 -0
  28. package/dist/components/text/Text.cjs +20 -0
  29. package/dist/components/text/Text.cjs.map +1 -0
  30. package/dist/components/text/Text.constants.cjs +27 -0
  31. package/dist/components/text/Text.constants.cjs.map +1 -0
  32. package/dist/components/text/Text.constants.d.cts +5 -0
  33. package/dist/components/text/Text.constants.d.cts.map +1 -0
  34. package/dist/components/text/Text.constants.d.mts +5 -0
  35. package/dist/components/text/Text.constants.d.mts.map +1 -0
  36. package/dist/components/text/Text.constants.mjs +24 -0
  37. package/dist/components/text/Text.constants.mjs.map +1 -0
  38. package/dist/components/text/Text.d.cts +4 -0
  39. package/dist/components/text/Text.d.cts.map +1 -0
  40. package/dist/components/text/Text.d.mts +4 -0
  41. package/dist/components/text/Text.d.mts.map +1 -0
  42. package/dist/components/text/Text.mjs +20 -0
  43. package/dist/components/text/Text.mjs.map +1 -0
  44. package/dist/components/text/Text.types.cjs +96 -0
  45. package/dist/components/text/Text.types.cjs.map +1 -0
  46. package/dist/components/text/Text.types.d.cts +147 -0
  47. package/dist/components/text/Text.types.d.cts.map +1 -0
  48. package/dist/components/text/Text.types.d.mts +147 -0
  49. package/dist/components/text/Text.types.d.mts.map +1 -0
  50. package/dist/components/text/Text.types.mjs +93 -0
  51. package/dist/components/text/Text.types.mjs.map +1 -0
  52. package/dist/components/text/index.cjs +14 -0
  53. package/dist/components/text/index.cjs.map +1 -0
  54. package/dist/components/text/index.d.cts +4 -0
  55. package/dist/components/text/index.d.cts.map +1 -0
  56. package/dist/components/text/index.d.mts +4 -0
  57. package/dist/components/text/index.d.mts.map +1 -0
  58. package/dist/components/text/index.mjs +3 -0
  59. package/dist/components/text/index.mjs.map +1 -0
  60. package/dist/index.cjs +18 -0
  61. package/dist/index.cjs.map +1 -0
  62. package/dist/index.d.cts +2 -0
  63. package/dist/index.d.cts.map +1 -0
  64. package/dist/index.d.mts +2 -0
  65. package/dist/index.d.mts.map +1 -0
  66. package/dist/index.mjs +2 -0
  67. package/dist/index.mjs.map +1 -0
  68. package/dist/utils/tw-merge.cjs +67 -0
  69. package/dist/utils/tw-merge.cjs.map +1 -0
  70. package/dist/utils/tw-merge.d.cts +13 -0
  71. package/dist/utils/tw-merge.d.cts.map +1 -0
  72. package/dist/utils/tw-merge.d.mts +13 -0
  73. package/dist/utils/tw-merge.d.mts.map +1 -0
  74. package/dist/utils/tw-merge.mjs +64 -0
  75. package/dist/utils/tw-merge.mjs.map +1 -0
  76. package/package.json +81 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ [Unreleased]: https://github.com/MetaMask/metamask-design-system/
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 MetaMask
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # `@metamask/design-system-react`
2
+
3
+ Design system react ui components
4
+
5
+ ## Installation
6
+
7
+ `yarn add @metamask/design-system-react`
8
+
9
+ or
10
+
11
+ `npm install @metamask/design-system-react`
12
+
13
+ ## Contributing
14
+
15
+ This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/metamask-design-system#readme).
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Button = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const Button = ({ children, ...props }) => (react_1.default.createElement("button", { className: "px-4 h-8 rounded-full bg-primary-default text-primary-inverse", ...props }, children));
9
+ exports.Button = Button;
10
+ //# sourceMappingURL=Button.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.cjs","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,MAAM,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAe,EAAE,EAAE,CAAC,CAC7D,0CACE,SAAS,EAAC,+DAA+D,KACrE,KAAK,IAER,QAAQ,CACF,CACV,CAAC;AAPW,QAAA,MAAM,UAOjB","sourcesContent":["import React from 'react';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Button contents */\n children: React.ReactNode;\n}\n\nexport const Button = ({ children, ...props }: ButtonProps) => (\n <button\n className=\"px-4 h-8 rounded-full bg-primary-default text-primary-inverse\"\n {...props}\n >\n {children}\n </button>\n);\n"]}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
+ /** Button contents */
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const Button: ({ children, ...props }: ButtonProps) => React.JSX.Element;
7
+ //# sourceMappingURL=Button.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.cts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc;AAE1B,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,sBAAsB;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,2BAA4B,WAAW,sBAOzD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
+ /** Button contents */
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const Button: ({ children, ...props }: ButtonProps) => React.JSX.Element;
7
+ //# sourceMappingURL=Button.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.mts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc;AAE1B,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,sBAAsB;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,2BAA4B,WAAW,sBAOzD,CAAC"}
@@ -0,0 +1,10 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import $React from "react";
8
+ const React = $importDefault($React);
9
+ export const Button = ({ children, ...props }) => (React.createElement("button", { className: "px-4 h-8 rounded-full bg-primary-default text-primary-inverse", ...props }, children));
10
+ //# sourceMappingURL=Button.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.mjs","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAK,cAAc;;AAQ1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAe,EAAE,EAAE,CAAC,CAC7D,gCACE,SAAS,EAAC,+DAA+D,KACrE,KAAK,IAER,QAAQ,CACF,CACV,CAAC","sourcesContent":["import React from 'react';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Button contents */\n children: React.ReactNode;\n}\n\nexport const Button = ({ children, ...props }: ButtonProps) => (\n <button\n className=\"px-4 h-8 rounded-full bg-primary-default text-primary-inverse\"\n {...props}\n >\n {children}\n </button>\n);\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Button = void 0;
4
+ var Button_1 = require("./Button.cjs");
5
+ Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
6
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAAzB,gGAAA,MAAM,OAAA","sourcesContent":["export { Button } from './Button';\nexport type { ButtonProps } from './Button';\n"]}
@@ -0,0 +1,3 @@
1
+ export { Button } from "./Button.cjs";
2
+ export type { ButtonProps } from "./Button.cjs";
3
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,qBAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,qBAAiB"}
@@ -0,0 +1,3 @@
1
+ export { Button } from "./Button.mjs";
2
+ export type { ButtonProps } from "./Button.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,qBAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,qBAAiB"}
@@ -0,0 +1,2 @@
1
+ export { Button } from "./Button.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,qBAAiB","sourcesContent":["export { Button } from './Button';\nexport type { ButtonProps } from './Button';\n"]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Button = exports.OverflowWrap = exports.TextTransform = exports.FontStyle = exports.FontWeight = exports.TextAlign = exports.TextColor = exports.TextVariant = exports.Text = void 0;
4
+ var text_1 = require("./text/index.cjs");
5
+ Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return text_1.Text; } });
6
+ var text_2 = require("./text/index.cjs");
7
+ Object.defineProperty(exports, "TextVariant", { enumerable: true, get: function () { return text_2.TextVariant; } });
8
+ Object.defineProperty(exports, "TextColor", { enumerable: true, get: function () { return text_2.TextColor; } });
9
+ Object.defineProperty(exports, "TextAlign", { enumerable: true, get: function () { return text_2.TextAlign; } });
10
+ Object.defineProperty(exports, "FontWeight", { enumerable: true, get: function () { return text_2.FontWeight; } });
11
+ Object.defineProperty(exports, "FontStyle", { enumerable: true, get: function () { return text_2.FontStyle; } });
12
+ Object.defineProperty(exports, "TextTransform", { enumerable: true, get: function () { return text_2.TextTransform; } });
13
+ Object.defineProperty(exports, "OverflowWrap", { enumerable: true, get: function () { return text_2.OverflowWrap; } });
14
+ var button_1 = require("./button/index.cjs");
15
+ Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return button_1.Button; } });
16
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,yCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,yCAQgB;AAPd,mGAAA,WAAW,OAAA;AACX,iGAAA,SAAS,OAAA;AACT,iGAAA,SAAS,OAAA;AACT,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,qGAAA,aAAa,OAAA;AACb,oGAAA,YAAY,OAAA;AAId,6CAAkC;AAAzB,gGAAA,MAAM,OAAA","sourcesContent":["export { Text } from './text';\nexport {\n TextVariant,\n TextColor,\n TextAlign,\n FontWeight,\n FontStyle,\n TextTransform,\n OverflowWrap,\n} from './text';\nexport type { TextProps } from './text';\n\nexport { Button } from './button';\nexport type { ButtonProps } from './button';\n"]}
@@ -0,0 +1,6 @@
1
+ export { Text } from "./text/index.cjs";
2
+ export { TextVariant, TextColor, TextAlign, FontWeight, FontStyle, TextTransform, OverflowWrap, } from "./text/index.cjs";
3
+ export type { TextProps } from "./text/index.cjs";
4
+ export { Button } from "./button/index.cjs";
5
+ export type { ButtonProps } from "./button/index.cjs";
6
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,GACb,yBAAe;AAChB,YAAY,EAAE,SAAS,EAAE,yBAAe;AAExC,OAAO,EAAE,MAAM,EAAE,2BAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAiB"}
@@ -0,0 +1,6 @@
1
+ export { Text } from "./text/index.mjs";
2
+ export { TextVariant, TextColor, TextAlign, FontWeight, FontStyle, TextTransform, OverflowWrap, } from "./text/index.mjs";
3
+ export type { TextProps } from "./text/index.mjs";
4
+ export { Button } from "./button/index.mjs";
5
+ export type { ButtonProps } from "./button/index.mjs";
6
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,GACb,yBAAe;AAChB,YAAY,EAAE,SAAS,EAAE,yBAAe;AAExC,OAAO,EAAE,MAAM,EAAE,2BAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAiB"}
@@ -0,0 +1,4 @@
1
+ export { Text } from "./text/index.mjs";
2
+ export { TextVariant, TextColor, TextAlign, FontWeight, FontStyle, TextTransform, OverflowWrap } from "./text/index.mjs";
3
+ export { Button } from "./button/index.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACb,yBAAe;AAGhB,OAAO,EAAE,MAAM,EAAE,2BAAiB","sourcesContent":["export { Text } from './text';\nexport {\n TextVariant,\n TextColor,\n TextAlign,\n FontWeight,\n FontStyle,\n TextTransform,\n OverflowWrap,\n} from './text';\nexport type { TextProps } from './text';\n\nexport { Button } from './button';\nexport type { ButtonProps } from './button';\n"]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Text = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_slot_1 = require("@radix-ui/react-slot");
9
+ const tw_merge_1 = require("../../utils/tw-merge.cjs");
10
+ const Text_types_1 = require("./Text.types.cjs");
11
+ const Text_constants_1 = require("./Text.constants.cjs");
12
+ const Text = ({ variant = Text_types_1.TextVariant.BodyMd, children, className, fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = Text_types_1.TextColor.TextDefault, style, }) => {
13
+ // When asChild is true, use Radix Slot to merge props onto the child component.
14
+ // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
15
+ const Component = asChild ? react_slot_1.Slot : Text_constants_1.TEXT_DEFAULT_TAG_MAP[variant];
16
+ const mergedClassName = (0, tw_merge_1.twMerge)(color, Text_constants_1.TEXT_CLASS_MAP[variant], fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className);
17
+ return (react_1.default.createElement(Component, { className: mergedClassName, style: style }, children));
18
+ };
19
+ exports.Text = Text;
20
+ //# sourceMappingURL=Text.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qDAA4C;AAC5C,uDAA+C;AAC/C,iDAAiE;AACjE,yDAAwE;AAEjE,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,wBAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,sBAAS,CAAC,WAAW,EAC7B,KAAK,GACN,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,IAAA,kBAAO,EAC7B,KAAK,EACL,+BAAc,CAAC,OAAO,CAAC,EACvB,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,IAChD,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AAnCW,QAAA,IAAI,QAmCf","sourcesContent":["import React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { twMerge } from '../../utils/tw-merge';\nimport { TextVariant, TextProps, TextColor } from './Text.types';\nimport { TEXT_CLASS_MAP, TEXT_DEFAULT_TAG_MAP } from './Text.constants';\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,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 { 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":"AAAA,OAAO,KAAK,cAAc;AAG1B,OAAO,EAAe,SAAS,EAAa,yBAAqB;AAGjE,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAmCpC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { 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":"AAAA,OAAO,KAAK,cAAc;AAG1B,OAAO,EAAe,SAAS,EAAa,yBAAqB;AAGjE,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 $React from "react";
8
+ const React = $importDefault($React);
9
+ import { Slot } from "@radix-ui/react-slot";
10
+ import { twMerge } from "../../utils/tw-merge.mjs";
11
+ import { TextVariant, TextProps, TextColor } from "./Text.types.mjs";
12
+ import { TEXT_CLASS_MAP, TEXT_DEFAULT_TAG_MAP } from "./Text.constants.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,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,yBAAqB;AACjE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,6BAAyB;AAExE,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 React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { twMerge } from '../../utils/tw-merge';\nimport { TextVariant, TextProps, TextColor } from './Text.types';\nimport { TEXT_CLASS_MAP, TEXT_DEFAULT_TAG_MAP } from './Text.constants';\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"]}