@fvc/typography 1.2.0 → 1.2.1

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