@purr-react-styled-components/components.typography 0.0.9 → 0.0.10
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/index.cjs +34 -0
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +34 -0
- package/package.json +4 -4
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';var P=require('clsx'),I=require('react'),utils_helpers$1=require('@purr-core/utils.helpers'),p=require('styled-components'),utils_helpers=require('@purr-react-styled-components/utils.helpers');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var P__default=/*#__PURE__*/_interopDefault(P);var I__default=/*#__PURE__*/_interopDefault(I);var p__default=/*#__PURE__*/_interopDefault(p);var o=({$size:y,$color:e,$bold:r,$font:t,$align:a})=>p.css`
|
|
2
|
+
transition: inherit;
|
|
3
|
+
font-size: ${typeof y=="number"?`${y}px`:y};
|
|
4
|
+
font-weight: ${r};
|
|
5
|
+
color: ${e};
|
|
6
|
+
font-family: ${t};
|
|
7
|
+
text-align: ${a};
|
|
8
|
+
`,g={H1:p__default.default.h1`
|
|
9
|
+
${o};
|
|
10
|
+
`,H2:p__default.default.h2`
|
|
11
|
+
${o};
|
|
12
|
+
`,H3:p__default.default.h3`
|
|
13
|
+
${o};
|
|
14
|
+
`,H4:p__default.default.h4`
|
|
15
|
+
${o};
|
|
16
|
+
`,H5:p__default.default.h5`
|
|
17
|
+
${o};
|
|
18
|
+
`,H6:p__default.default.h6`
|
|
19
|
+
${o};
|
|
20
|
+
`,Span:p__default.default.span`
|
|
21
|
+
${o};
|
|
22
|
+
`,Caption:p__default.default.caption`
|
|
23
|
+
${o};
|
|
24
|
+
`,Button:p__default.default.button`
|
|
25
|
+
${o};
|
|
26
|
+
${utils_helpers.getInvisibleButton};
|
|
27
|
+
`,A:p__default.default.a`
|
|
28
|
+
${o};
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
text-decoration-line: none;
|
|
31
|
+
`,P:p__default.default.p`
|
|
32
|
+
${o};
|
|
33
|
+
margin-block: 0;
|
|
34
|
+
`};var H=({variant:y="span",children:e,size:r="inherit",bold:t=400,color:a="inherit",font:s="inherit",className:l="",align:h="inherit",htmlAttributes:d})=>{let n=I.useMemo(()=>{let i=utils_helpers$1.capitalize(y);return g[i]},[y]);return I__default.default.createElement(n,{...d,$size:r,$color:a,$bold:t,$font:s,$align:h,className:P__default.default("typography",`typography__variant--${y}`,`typography__size--${r}`,`typography__bold--${t}`,`typography__color--${a}`,`typography__font--${s}`,`typography__align--${h}`,l)},e)};exports.Typography=H;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { JSX, ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
4
|
+
|
|
5
|
+
interface ITypographyProps {
|
|
6
|
+
variant?: keyof JSX.IntrinsicElements;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
size?: number | string;
|
|
9
|
+
bold?: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
font?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
align?: Property.TextAlign;
|
|
14
|
+
htmlAttributes?: HTMLAttributes<HTMLElement> & IExtendable;
|
|
15
|
+
}
|
|
16
|
+
interface IStyledTypographyProps extends HTMLAttributes<HTMLElement>, IExtendable {
|
|
17
|
+
$size?: number | string;
|
|
18
|
+
$color?: string;
|
|
19
|
+
$bold?: number;
|
|
20
|
+
$font?: string;
|
|
21
|
+
$align?: Property.TextAlign;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare const Typography: ({ variant, children, size, bold, color, font, className, align, htmlAttributes, }: ITypographyProps) => React.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { type IStyledTypographyProps, type ITypographyProps, Typography };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { JSX, ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
4
|
+
|
|
5
|
+
interface ITypographyProps {
|
|
6
|
+
variant?: keyof JSX.IntrinsicElements;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
size?: number | string;
|
|
9
|
+
bold?: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
font?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
align?: Property.TextAlign;
|
|
14
|
+
htmlAttributes?: HTMLAttributes<HTMLElement> & IExtendable;
|
|
15
|
+
}
|
|
16
|
+
interface IStyledTypographyProps extends HTMLAttributes<HTMLElement>, IExtendable {
|
|
17
|
+
$size?: number | string;
|
|
18
|
+
$color?: string;
|
|
19
|
+
$bold?: number;
|
|
20
|
+
$font?: string;
|
|
21
|
+
$align?: Property.TextAlign;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare const Typography: ({ variant, children, size, bold, color, font, className, align, htmlAttributes, }: ITypographyProps) => React.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { type IStyledTypographyProps, type ITypographyProps, Typography };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import P from'clsx';import I,{useMemo}from'react';import {capitalize}from'@purr-core/utils.helpers';import p,{css}from'styled-components';import {getInvisibleButton}from'@purr-react-styled-components/utils.helpers';var o=({$size:y,$color:e,$bold:r,$font:t,$align:a})=>css`
|
|
2
|
+
transition: inherit;
|
|
3
|
+
font-size: ${typeof y=="number"?`${y}px`:y};
|
|
4
|
+
font-weight: ${r};
|
|
5
|
+
color: ${e};
|
|
6
|
+
font-family: ${t};
|
|
7
|
+
text-align: ${a};
|
|
8
|
+
`,g={H1:p.h1`
|
|
9
|
+
${o};
|
|
10
|
+
`,H2:p.h2`
|
|
11
|
+
${o};
|
|
12
|
+
`,H3:p.h3`
|
|
13
|
+
${o};
|
|
14
|
+
`,H4:p.h4`
|
|
15
|
+
${o};
|
|
16
|
+
`,H5:p.h5`
|
|
17
|
+
${o};
|
|
18
|
+
`,H6:p.h6`
|
|
19
|
+
${o};
|
|
20
|
+
`,Span:p.span`
|
|
21
|
+
${o};
|
|
22
|
+
`,Caption:p.caption`
|
|
23
|
+
${o};
|
|
24
|
+
`,Button:p.button`
|
|
25
|
+
${o};
|
|
26
|
+
${getInvisibleButton};
|
|
27
|
+
`,A:p.a`
|
|
28
|
+
${o};
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
text-decoration-line: none;
|
|
31
|
+
`,P:p.p`
|
|
32
|
+
${o};
|
|
33
|
+
margin-block: 0;
|
|
34
|
+
`};var H=({variant:y="span",children:e,size:r="inherit",bold:t=400,color:a="inherit",font:s="inherit",className:l="",align:h="inherit",htmlAttributes:d})=>{let n=useMemo(()=>{let i=capitalize(y);return g[i]},[y]);return I.createElement(n,{...d,$size:r,$color:a,$bold:t,$font:s,$align:h,className:P("typography",`typography__variant--${y}`,`typography__size--${r}`,`typography__bold--${t}`,`typography__color--${a}`,`typography__font--${s}`,`typography__align--${h}`,l)},e)};export{H as Typography};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purr-react-styled-components/components.typography",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"react": "*",
|
|
26
26
|
"styled-components": "*",
|
|
27
27
|
"clsx": "*",
|
|
28
|
-
"@purr-core/utils.definitions": "0.0.
|
|
29
|
-
"@purr-core/utils.helpers": "0.0.
|
|
30
|
-
"@purr-react-styled-components/utils.helpers": "0.0.
|
|
28
|
+
"@purr-core/utils.definitions": "0.0.12",
|
|
29
|
+
"@purr-core/utils.helpers": "0.0.12",
|
|
30
|
+
"@purr-react-styled-components/utils.helpers": "0.0.8"
|
|
31
31
|
},
|
|
32
32
|
"author": "@DinhThienPhuc",
|
|
33
33
|
"license": "ISC",
|