@mysetup/typography 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Typography/Typography.d.ts +38 -0
- package/dist/Typography/Typography.d.ts.map +1 -0
- package/dist/Typography/Typography.js +48 -0
- package/dist/Typography/index.d.ts +2 -0
- package/dist/Typography/index.d.ts.map +1 -0
- package/dist/Typography/index.js +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/styles.css +86 -0
- package/package.json +52 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "../styles.css";
|
|
2
|
+
import { type ReactNode, type ElementType, type HTMLAttributes } from "react";
|
|
3
|
+
export declare const TypographyVariant: {
|
|
4
|
+
headline1: string;
|
|
5
|
+
headline2: string;
|
|
6
|
+
headline3: string;
|
|
7
|
+
headline4: string;
|
|
8
|
+
headline5: string;
|
|
9
|
+
headline6: string;
|
|
10
|
+
headline7: string;
|
|
11
|
+
paragraph: string;
|
|
12
|
+
"paragraph-small": string;
|
|
13
|
+
eyebrow: string;
|
|
14
|
+
disclaimer: string;
|
|
15
|
+
usecode: string;
|
|
16
|
+
quotes: string;
|
|
17
|
+
};
|
|
18
|
+
export type TypographyVariant = keyof typeof TypographyVariant;
|
|
19
|
+
export type TypographyProps<T extends HTMLElement = any> = HTMLAttributes<T> & {
|
|
20
|
+
/**
|
|
21
|
+
* The html element or component to render
|
|
22
|
+
*/
|
|
23
|
+
as?: ElementType<T>;
|
|
24
|
+
/**
|
|
25
|
+
* The text to render
|
|
26
|
+
*/
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Use alternate display font
|
|
30
|
+
*/
|
|
31
|
+
display?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The visual variant to display
|
|
34
|
+
*/
|
|
35
|
+
variant?: TypographyVariant;
|
|
36
|
+
};
|
|
37
|
+
export declare const Typography: ({ as, children, className, display, variant, ...props }: TypographyProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
38
|
+
//# sourceMappingURL=Typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../Typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAI9E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;CAc7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAG/D,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG;IAC3E;;OAEG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,UAAU,4DAOpB,eAAe,2FASjB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Typography = exports.TypographyVariant = void 0;
|
|
26
|
+
require("../styles.css");
|
|
27
|
+
var react_1 = require("react");
|
|
28
|
+
var classnames_1 = require("@mysetup/classnames");
|
|
29
|
+
exports.TypographyVariant = {
|
|
30
|
+
headline1: "headline1",
|
|
31
|
+
headline2: "headline2",
|
|
32
|
+
headline3: "headline3",
|
|
33
|
+
headline4: "headline4",
|
|
34
|
+
headline5: "headline5",
|
|
35
|
+
headline6: "headline6",
|
|
36
|
+
headline7: "headline7",
|
|
37
|
+
paragraph: "paragraph",
|
|
38
|
+
"paragraph-small": "paragraph-small",
|
|
39
|
+
eyebrow: "eyebrow",
|
|
40
|
+
disclaimer: "disclaimer",
|
|
41
|
+
usecode: "usecode",
|
|
42
|
+
quotes: "quotes",
|
|
43
|
+
};
|
|
44
|
+
var Typography = function (_a) {
|
|
45
|
+
var _b = _a.as, as = _b === void 0 ? "p" : _b, children = _a.children, className = _a.className, _c = _a.display, display = _c === void 0 ? false : _c, _d = _a.variant, variant = _d === void 0 ? "paragraph" : _d, props = __rest(_a, ["as", "children", "className", "display", "variant"]);
|
|
46
|
+
return (0, react_1.createElement)(as, __assign({ className: (0, classnames_1.classNames)(variant, display && "display", className) }, props), children);
|
|
47
|
+
};
|
|
48
|
+
exports.Typography = Typography;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Typography/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Typography"), exports);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Typography"), exports);
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
:root {
|
|
7
|
+
--font-poppins: var(--next-font-poppins, "Poppins", sans-serif);
|
|
8
|
+
|
|
9
|
+
--font-sans: var(--font-poppins);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-brand="MYPROFILE"] {
|
|
13
|
+
--font-display: var(--font-poppins);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.headline1 {
|
|
17
|
+
@apply lg:text-[34px] lg:leading-[42px] text-[30px] leading-[36px];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.headline2 {
|
|
21
|
+
@apply lg:text-[28px] lg:leading-[36px] text-[22px] leading-[26px];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.headline3 {
|
|
25
|
+
@apply lg:text-[24px] lg:leading-[28px] text-[20px] leading-[25px];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.headline4 {
|
|
29
|
+
@apply lg:text-[17px] lg:leading-[23px] uppercase text-[15px] leading-[22px];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.headline5 {
|
|
33
|
+
@apply lg:text-[17px] lg:leading-[25px] text-[15px] leading-[22px];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.headline6 {
|
|
37
|
+
@apply lg:text-[16px] lg:leading-[24px] text-[13px] leading-[20px];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.headline7 {
|
|
41
|
+
@apply lg:text-[12px] lg:leading-[18px] text-[11px] leading-[26px];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.paragraph {
|
|
45
|
+
@apply text-[14px] leading-[21px] tracking-[0.3px];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.paragraph-small {
|
|
49
|
+
@apply text-[12px] leading-[18px] tracking-[0.6px];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.eyebrow {
|
|
53
|
+
@apply text-[11px] leading-[21px] tracking-[1.09px];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.disclaimer {
|
|
57
|
+
@apply text-[12px] leading-[18px] tracking-[0.13px];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.disclaimer-small {
|
|
61
|
+
@apply text-[10px] leading-[18px] tracking-[0.11px];
|
|
62
|
+
}
|
|
63
|
+
.usecode {
|
|
64
|
+
@apply text-[14px] leading-[21px] tracking-[0.3px];
|
|
65
|
+
}
|
|
66
|
+
.quotes {
|
|
67
|
+
@apply text-[24px] leading-[21px] tracking-[0.3px] italic;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/*Update leading for headline display classes*/
|
|
71
|
+
[class*="headline"].display {
|
|
72
|
+
font-family: var(--font-display);
|
|
73
|
+
@apply leading-[44px];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/*TODO - TEMP Style - Remove once links SB component is created*/
|
|
77
|
+
.link {
|
|
78
|
+
@apply text-[14px] leading-[21px];
|
|
79
|
+
}
|
|
80
|
+
.link-small {
|
|
81
|
+
@apply !text-[10px] leading-[21px];
|
|
82
|
+
}
|
|
83
|
+
.text-default-color {
|
|
84
|
+
@apply text-[#3F51B5];
|
|
85
|
+
}
|
|
86
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mysetup/typography",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./style.css": "./style.css",
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "rm -rf ./dist && tsc -p tsconfig.build.json && cp 'styles.css' 'dist/'",
|
|
20
|
+
"lint": "eslint .",
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"test": "jest",
|
|
23
|
+
"test:coverage": "jest --coverage",
|
|
24
|
+
"format": "prettier --write \"**/*.{ts,tsx,md,js,mjs,json}\"",
|
|
25
|
+
"checks": "pnpm typecheck && pnpm lint && pnpm test",
|
|
26
|
+
"clean": "rm -rf node_modules .swc dist pnpm-lock.yaml && echo \"✅ Successfully removed \""
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@mysetup/classnames": "latest",
|
|
30
|
+
"react": "^18.3.1"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@mysetup/eslint-config": "latest",
|
|
34
|
+
"@mysetup/jest-config": "latest",
|
|
35
|
+
"@mysetup/prettier-config": "latest",
|
|
36
|
+
"@mysetup/tsconfig": "latest",
|
|
37
|
+
"@testing-library/react": "^16.0.1",
|
|
38
|
+
"@types/jest": "^29.5.14",
|
|
39
|
+
"@types/jest-axe": "^3.5.9",
|
|
40
|
+
"@types/react": "^18.3.12",
|
|
41
|
+
"eslint": "8.57.0",
|
|
42
|
+
"jest": "^29.7.0",
|
|
43
|
+
"jest-axe": "^9.0.0",
|
|
44
|
+
"react-dom": "^18.3.1",
|
|
45
|
+
"typescript": "^5.6.3"
|
|
46
|
+
},
|
|
47
|
+
"prettier": "@mysetup/prettier-config",
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18.0.0"
|
|
50
|
+
},
|
|
51
|
+
"packageManager": "pnpm@9.9.0"
|
|
52
|
+
}
|