@fvc/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.
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import t,{useMemo as r}from"react";import{Typography as o}from"antd";import{cssVarResolver as e}from"@fvc/utils";var n=function(){return n=Object.assign||function(t){for(var r,o=1,e=arguments.length;o<e;o++)for(var n in r=arguments[o])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},n.apply(this,arguments)};function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}"function"==typeof SuppressedError&&SuppressedError;var p,l={exports:{}};
|
|
2
|
+
/*!
|
|
3
|
+
Copyright (c) 2018 Jed Watson.
|
|
4
|
+
Licensed under the MIT License (MIT), see
|
|
5
|
+
http://jedwatson.github.io/classnames
|
|
6
|
+
*/var y,i=a((p||(p=1,y=l,function(){var t={}.hasOwnProperty;function r(){for(var t="",r=0;r<arguments.length;r++){var n=arguments[r];n&&(t=e(t,o(n)))}return t}function o(o){if("string"==typeof o||"number"==typeof o)return o;if("object"!=typeof o)return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var n="";for(var a in o)t.call(o,a)&&o[a]&&(n=e(n,a));return n}function e(t,r){return r?t?t+" "+r:t+r:t}y.exports?(r.default=r,y.exports=r):window.classNames=r}()),l.exports));var h={"fvc-typography":"Typography-module_fvc-typography__JliF6"};!function(t,r){void 0===r&&(r={});var o=r.insertAt;if("undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}('.Typography-module_fvc-typography__JliF6 + h1.Typography-module_fvc-typography__JliF6, .Typography-module_fvc-typography__JliF6 + h2.Typography-module_fvc-typography__JliF6, .Typography-module_fvc-typography__JliF6 + h3.Typography-module_fvc-typography__JliF6, .Typography-module_fvc-typography__JliF6 + h4.Typography-module_fvc-typography__JliF6, .Typography-module_fvc-typography__JliF6 + h5.Typography-module_fvc-typography__JliF6,\n.Typography-module_fvc-typography__JliF6 p,\n.Typography-module_fvc-typography__JliF6 div {\n margin: 0;\n}\n\n.Typography-module_fvc-typography__JliF6 {\n color: var(--text-color, var(--body-text-color-1000));\n font-family: var(--text-ff, "Roboto", sans-serif);\n}\n\narticle.Typography-module_fvc-typography__JliF6,\nspan.Typography-module_fvc-typography__JliF6,\ndiv.Typography-module_fvc-typography__JliF6 {\n color: var(--text-color, var(--body-text-color-1000));\n font-size: var(--text-fz, 16px);\n font-weight: var(--text-fw, 400);\n line-height: var(--text-lh, 20px);\n}\n\na.Typography-module_fvc-typography__JliF6 {\n color: var(--text-color, var(--body-text-color-1000));\n font-size: var(--text-fz, 16px);\n font-weight: var(--text-fw, 400);\n line-height: var(--text-lh, 20px);\n color: var(--text-color, var(--link-on-light-bg-color-500));\n text-decoration: underline;\n}\na.Typography-module_fvc-typography__JliF6:hover {\n color: var(--text-color, var(--link-on-light-bg-color-500));\n}\n\nh1.Typography-module_fvc-typography__JliF6 {\n color: var(--text-color, var(--body-text-color-1000));\n font-size: var(--text-fz, 32px);\n font-weight: var(--text-fw, 700);\n line-height: var(--text-lh, 32px);\n}\n\nh2.Typography-module_fvc-typography__JliF6 {\n color: var(--text-color, var(--body-text-color-1000));\n font-size: var(--text-fz, 24px);\n font-weight: var(--text-fw, 700);\n line-height: var(--text-lh, 32px);\n}\n\nh3.Typography-module_fvc-typography__JliF6 {\n color: var(--text-color, var(--body-text-color-1000));\n font-size: var(--text-fz, 20px);\n font-weight: var(--text-fw, 700);\n line-height: var(--text-lh, 20px);\n}\n\nh4.Typography-module_fvc-typography__JliF6 {\n color: var(--text-color, var(--body-text-color-1000));\n font-size: var(--text-fz, 13px);\n font-weight: var(--text-fw, 700);\n line-height: var(--text-lh, 17px);\n text-transform: uppercase;\n}\n\nh5.Typography-module_fvc-typography__JliF6 {\n color: var(--text-color, var(--body-text-color-1000));\n font-size: var(--text-fz, 14px);\n font-weight: var(--text-fw, 700);\n line-height: var(--text-lh, 17px);\n}');var f="fvc-typography";function c(o){var a=function(a){var p,l=a.align,y=a.color,c=a.className,v=a.font,g=a.lineHeight,d=a.size,u=a.testId,x=a.underline,_=void 0!==x&&x,s=a.weight,m=function(t,r){var o={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.indexOf(e)<0&&(o[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(t);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(o[e[n]]=t[e[n]])}return o}(a,["align","color","className","font","lineHeight","size","testId","underline","weight"]),T=i(h[f],c,((p={})["".concat(f,"-underline")]=_,p)),w=r((function(){return n({"--text-color":y,"--text-ff":v,"--text-lh":e(g),"--text-fz":e(d),"--text-fw":s,"--text-align":l},m.style)}),[l,y,v,g,m.style,d,s]);return t.createElement(o,n({},m,{prefixCls:f,className:T,"data-test-id":u,style:w}))};return a.displayName=o.displayName,a}var v=c(o),g=c(o.Title),d=c(o.Text),u=c(o.Paragraph),x=c(o.Link);v.Title=g,v.Text=d,v.Paragraph=u,v.Link=x;export{v as Typography};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Typography } from './Typography';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { JSX, ForwardRefExoticComponent, RefAttributes, CSSProperties } from 'react';
|
|
2
|
+
import { LinkProps as DefaultLinkProps } from 'antd/es/typography/Link';
|
|
3
|
+
import { ParagraphProps as DefaultParagraphProps } from 'antd/es/typography/Paragraph';
|
|
4
|
+
import { TextProps as DefaultTextProps } from 'antd/es/typography/Text';
|
|
5
|
+
import { TitleProps as DefaultTitleProps } from 'antd/es/typography/Title';
|
|
6
|
+
import OriginTypography, { TypographyProps as DefaultTypographyProps } from 'antd/es/typography/Typography';
|
|
7
|
+
type BaseType = 'black' | 'white' | 'blue' | 'gray' | 'green' | 'light-gray' | 'dark-gray' | 'darker-gray' | 'label' | 'bold';
|
|
8
|
+
type BaseFontType = 'Roboto' | 'Montserrat';
|
|
9
|
+
type BaseSizeType = '12' | '13' | '14' | '16' | '20' | '24' | '32' | number;
|
|
10
|
+
type BaseLineHeightType = 'base' | '12' | '13' | '14' | '16' | '20' | '24' | '32' | number;
|
|
11
|
+
type BaseWeightType = '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number;
|
|
12
|
+
export type GenericTypographyProps<T> = T & {
|
|
13
|
+
align?: CSSProperties['textAlign'];
|
|
14
|
+
color?: string;
|
|
15
|
+
font?: BaseFontType;
|
|
16
|
+
lineHeight?: BaseLineHeightType;
|
|
17
|
+
size?: BaseSizeType;
|
|
18
|
+
testId?: string;
|
|
19
|
+
type?: BaseType;
|
|
20
|
+
underline?: boolean;
|
|
21
|
+
weight?: BaseWeightType;
|
|
22
|
+
};
|
|
23
|
+
export type TypographyProps = GenericTypographyProps<DefaultTypographyProps<keyof JSX.IntrinsicElements>>;
|
|
24
|
+
export type TextProps = GenericTypographyProps<DefaultTextProps>;
|
|
25
|
+
export type LinkProps = GenericTypographyProps<DefaultLinkProps>;
|
|
26
|
+
export type TitleProps = GenericTypographyProps<DefaultTitleProps>;
|
|
27
|
+
export type ParagraphProps = GenericTypographyProps<DefaultParagraphProps>;
|
|
28
|
+
type OriginTypography = ForwardRefExoticComponent<TypographyProps & RefAttributes<HTMLElement>>;
|
|
29
|
+
export type TypographyComponent = OriginTypography & {
|
|
30
|
+
Text: ForwardRefExoticComponent<TextProps & RefAttributes<HTMLSpanElement>>;
|
|
31
|
+
Link: ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLElement>>;
|
|
32
|
+
Title: ForwardRefExoticComponent<TitleProps & RefAttributes<HTMLElement>>;
|
|
33
|
+
Paragraph: ForwardRefExoticComponent<ParagraphProps & RefAttributes<HTMLElement>>;
|
|
34
|
+
};
|
|
35
|
+
export type ComponentProps = TypographyProps & TitleProps & ParagraphProps & TextProps & LinkProps;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Typography.types';
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fvc/typography",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "./dist/lib/index.js",
|
|
5
|
+
"types": "./dist/lib/typography/src/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/lib/index.js",
|
|
8
|
+
"dist/lib/typography",
|
|
9
|
+
"package.json"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/lib/index.js",
|
|
14
|
+
"types": "./dist/lib/typography/src/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./types/*": "./dist/lib/typography/src/types/*"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "rm -rf dist && eslint --config ../../eslint.config.js . && bunx tsc --noEmit && rollup -c ./rollup.config.mjs"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"react": "^18.0.0",
|
|
23
|
+
"antd": "^5.0.0",
|
|
24
|
+
"@fvc/utils": "file:../utils"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@fvc/utils": "*",
|
|
28
|
+
"react": "^18.0.0",
|
|
29
|
+
"antd": "^5.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|