@purr-react-styled-components/components.typography 0.0.8 → 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 CHANGED
@@ -1 +1,34 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),d=require("clsx"),g=require("react"),m=require("@purr-core/utils.helpers"),t=require("styled-components"),u=require("@purr-react-styled-components/utils.helpers"),e=({$size:o,$color:r,$bold:n,$font:i,$align:s})=>t.css(["transition:inherit;font-size:",";font-weight:",";color:",";font-family:",";text-align:",";"],typeof o=="number"?`${o}px`:o,n,r,i,s),f={H1:t.h1.withConfig({displayName:"_style__H1",componentId:"sc-rhhv96-0"})(["",";"],e),H2:t.h2.withConfig({displayName:"_style__H2",componentId:"sc-rhhv96-1"})(["",";"],e),H3:t.h3.withConfig({displayName:"_style__H3",componentId:"sc-rhhv96-2"})(["",";"],e),H4:t.h4.withConfig({displayName:"_style__H4",componentId:"sc-rhhv96-3"})(["",";"],e),H5:t.h5.withConfig({displayName:"_style__H5",componentId:"sc-rhhv96-4"})(["",";"],e),H6:t.h6.withConfig({displayName:"_style__H6",componentId:"sc-rhhv96-5"})(["",";"],e),Span:t.span.withConfig({displayName:"_style__Span",componentId:"sc-rhhv96-6"})(["",";"],e),Caption:t.caption.withConfig({displayName:"_style__Caption",componentId:"sc-rhhv96-7"})(["",";"],e),Button:t.button.withConfig({displayName:"_style__Button",componentId:"sc-rhhv96-8"})(["",";",";"],e,u.getInvisibleButton),A:t.a.withConfig({displayName:"_style__A",componentId:"sc-rhhv96-9"})(["",";cursor:pointer;text-decoration-line:none;"],e),P:t.p.withConfig({displayName:"_style__P",componentId:"sc-rhhv96-10"})(["",";margin-block:0;"],e)},C=({variant:o="span",children:r,size:n="inherit",bold:i=400,color:s="inherit",font:p="inherit",className:a="",align:h="inherit",htmlAttributes:y})=>{const _=g.useMemo(()=>{const c=m.capitalize(o);return f[c]},[o]);return l.jsx(_,{...y,$size:n,$color:s,$bold:i,$font:p,$align:h,className:d("typography",`typography__variant--${o}`,`typography__size--${n}`,`typography__bold--${i}`,`typography__color--${s}`,`typography__font--${p}`,`typography__align--${h}`,a),children:r})};exports.Typography=C;
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;
@@ -1,8 +1,8 @@
1
+ import React, { JSX, ReactNode, HTMLAttributes } from 'react';
1
2
  import { Property } from 'csstype';
2
- import { HTMLAttributes, JSX, ReactNode } from 'react';
3
3
  import { IExtendable } from '@purr-core/utils.definitions';
4
4
 
5
- export interface ITypographyProps {
5
+ interface ITypographyProps {
6
6
  variant?: keyof JSX.IntrinsicElements;
7
7
  children?: ReactNode;
8
8
  size?: number | string;
@@ -13,10 +13,14 @@ export interface ITypographyProps {
13
13
  align?: Property.TextAlign;
14
14
  htmlAttributes?: HTMLAttributes<HTMLElement> & IExtendable;
15
15
  }
16
- export interface IStyledTypographyProps extends HTMLAttributes<HTMLElement>, IExtendable {
16
+ interface IStyledTypographyProps extends HTMLAttributes<HTMLElement>, IExtendable {
17
17
  $size?: number | string;
18
18
  $color?: string;
19
19
  $bold?: number;
20
20
  $font?: string;
21
21
  $align?: Property.TextAlign;
22
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 CHANGED
@@ -1,2 +1,26 @@
1
- export * from './_components';
2
- export * from './_types';
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 CHANGED
@@ -1,77 +1,34 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import c from "clsx";
3
- import { useMemo as d } from "react";
4
- import { capitalize as g } from "@purr-core/utils.helpers";
5
- import t, { css as f } from "styled-components";
6
- import { getInvisibleButton as C } from "@purr-react-styled-components/utils.helpers";
7
- const o = ({
8
- $size: n,
9
- $color: h,
10
- $bold: i,
11
- $font: e,
12
- $align: p
13
- }) => f(["transition:inherit;font-size:", ";font-weight:", ";color:", ";font-family:", ";text-align:", ";"], typeof n == "number" ? `${n}px` : n, i, h, e, p), w = {
14
- H1: t.h1.withConfig({
15
- displayName: "_style__H1",
16
- componentId: "sc-rhhv96-0"
17
- })(["", ";"], o),
18
- H2: t.h2.withConfig({
19
- displayName: "_style__H2",
20
- componentId: "sc-rhhv96-1"
21
- })(["", ";"], o),
22
- H3: t.h3.withConfig({
23
- displayName: "_style__H3",
24
- componentId: "sc-rhhv96-2"
25
- })(["", ";"], o),
26
- H4: t.h4.withConfig({
27
- displayName: "_style__H4",
28
- componentId: "sc-rhhv96-3"
29
- })(["", ";"], o),
30
- H5: t.h5.withConfig({
31
- displayName: "_style__H5",
32
- componentId: "sc-rhhv96-4"
33
- })(["", ";"], o),
34
- H6: t.h6.withConfig({
35
- displayName: "_style__H6",
36
- componentId: "sc-rhhv96-5"
37
- })(["", ";"], o),
38
- Span: t.span.withConfig({
39
- displayName: "_style__Span",
40
- componentId: "sc-rhhv96-6"
41
- })(["", ";"], o),
42
- Caption: t.caption.withConfig({
43
- displayName: "_style__Caption",
44
- componentId: "sc-rhhv96-7"
45
- })(["", ";"], o),
46
- Button: t.button.withConfig({
47
- displayName: "_style__Button",
48
- componentId: "sc-rhhv96-8"
49
- })(["", ";", ";"], o, C),
50
- A: t.a.withConfig({
51
- displayName: "_style__A",
52
- componentId: "sc-rhhv96-9"
53
- })(["", ";cursor:pointer;text-decoration-line:none;"], o),
54
- P: t.p.withConfig({
55
- displayName: "_style__P",
56
- componentId: "sc-rhhv96-10"
57
- })(["", ";margin-block:0;"], o)
58
- }, x = ({
59
- variant: n = "span",
60
- children: h,
61
- size: i = "inherit",
62
- bold: e = 400,
63
- color: p = "inherit",
64
- font: r = "inherit",
65
- className: a = "",
66
- align: s = "inherit",
67
- htmlAttributes: y
68
- }) => {
69
- const _ = d(() => {
70
- const m = g(n);
71
- return w[m];
72
- }, [n]);
73
- return /* @__PURE__ */ l(_, { ...y, $size: i, $color: p, $bold: e, $font: r, $align: s, className: c("typography", `typography__variant--${n}`, `typography__size--${i}`, `typography__bold--${e}`, `typography__color--${p}`, `typography__font--${r}`, `typography__align--${s}`, a), children: h });
74
- };
75
- export {
76
- x as Typography
77
- };
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.8",
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.10",
29
- "@purr-core/utils.helpers": "0.0.10",
30
- "@purr-react-styled-components/utils.helpers": "0.0.6"
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",
@@ -36,6 +36,8 @@
36
36
  "scripts": {
37
37
  "dev": "vite build --watch",
38
38
  "build": "tsc && vite build",
39
+ "build:vite": "tsc && vite build",
40
+ "build:tsup": "tsup",
39
41
  "lint": "eslint . --ext ts,tsx --max-warnings 0"
40
42
  }
41
43
  }
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ITypographyProps } from './_types';
3
-
4
- export declare const Typography: ({ variant, children, size, bold, color, font, className, align, htmlAttributes, }: ITypographyProps) => React.JSX.Element;
package/dist/_style.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { IStyledTypographyProps } from './_types';
2
-
3
- export declare const Styled: {
4
- H1: React.FC<IStyledTypographyProps>;
5
- H2: React.FC<IStyledTypographyProps>;
6
- H3: React.FC<IStyledTypographyProps>;
7
- H4: React.FC<IStyledTypographyProps>;
8
- H5: React.FC<IStyledTypographyProps>;
9
- H6: React.FC<IStyledTypographyProps>;
10
- Span: React.FC<IStyledTypographyProps>;
11
- Caption: React.FC<IStyledTypographyProps>;
12
- Button: React.FC<IStyledTypographyProps>;
13
- A: React.FC<IStyledTypographyProps>;
14
- P: React.FC<IStyledTypographyProps>;
15
- };