@cocso-ui/react 0.0.0-beta.1 → 0.0.1-beta.2
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/lib/components/Body/Body.d.ts +10 -6
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
type BodyElement = 'p' | 'span' | 'div' | 'label' | 'li' | 'td' | 'th' | 'figcaption' | 'blockquote' | 'cite';
|
|
3
|
-
export
|
|
2
|
+
type BodyElement = 'p' | 'a' | 'span' | 'div' | 'label' | 'li' | 'td' | 'th' | 'figcaption' | 'blockquote' | 'cite';
|
|
3
|
+
export type BodyProps<T extends React.ElementType = 'p'> = {
|
|
4
4
|
as?: T & BodyElement;
|
|
5
|
-
size?: '
|
|
5
|
+
size?: 'lg' | 'md' | 'sm' | 'xs';
|
|
6
6
|
color?: string;
|
|
7
7
|
fontWeight?: 'normal' | 'bold';
|
|
8
|
-
}
|
|
9
|
-
export
|
|
10
|
-
|
|
8
|
+
} & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color' | 'fontWeight'>;
|
|
9
|
+
export declare const Body: React.ForwardRefExoticComponent<{
|
|
10
|
+
as?: BodyElement | undefined;
|
|
11
|
+
size?: "lg" | "md" | "sm" | "xs";
|
|
12
|
+
color?: string;
|
|
13
|
+
fontWeight?: "normal" | "bold";
|
|
14
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> | Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> | Omit<React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> | Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> | Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> | Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> | Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> | Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> | Omit<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref"> | Omit<React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref">, "size" | "color" | "fontWeight"> & React.RefAttributes<HTMLElement>>;
|
|
11
15
|
export {};
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=Object.create;var d=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var v=Object.create;var d=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var L=(t,o)=>{for(var r in o)d(t,r,{get:o[r],enumerable:!0})},c=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of N(o))!B.call(t,a)&&a!==r&&d(t,a,{get:()=>o[a],enumerable:!(n=$(o,a))||n.enumerable});return t};var m=(t,o,r)=>(r=t!=null?v(W(t)):{},c(o||!t||!t.__esModule?d(r,"default",{value:t,enumerable:!0}):r,t)),M=t=>c(d({},"__esModule",{value:!0}),t);var A={};L(A,{Body:()=>x,Display:()=>P,Heading:()=>E,Primitive:()=>S,createPrimitive:()=>e});module.exports=M(A);var f=require("@radix-ui/react-slot"),h=m(require("react"),1),y=require("react/jsx-runtime");function e(t){let o=h.forwardRef((r,n)=>{let{asChild:a,...i}=r;return(0,y.jsx)(a?f.Slot:t,{...i,ref:n})});return o.displayName=`Primitive.${t}`,o}var S={div:e("div"),span:e("span"),button:e("button"),input:e("input"),form:e("form"),label:e("label"),p:e("p"),h1:e("h1"),h2:e("h2"),h3:e("h3"),h4:e("h4"),h5:e("h5"),h6:e("h6"),section:e("section"),article:e("article"),header:e("header"),footer:e("footer"),main:e("main"),nav:e("nav"),aside:e("aside"),ul:e("ul"),ol:e("ol"),li:e("li"),img:e("img"),a:e("a"),strong:e("strong"),em:e("em"),small:e("small"),table:e("table"),thead:e("thead"),tbody:e("tbody"),tr:e("tr"),td:e("td"),th:e("th")};var R=m(require("react"),1),u=require("react/jsx-runtime");function w(t){if(t)return`var(--color-${t.replace(".","-")})`}var x=R.forwardRef(({as:t="p",size:o="md",color:r="",fontWeight:n="normal",style:a,className:i,...s},p)=>{let l=t,T=`text-body text-body-${o}${n==="bold"?"-bold":""} ${i}`;return(0,u.jsx)(l,{ref:p,className:T,style:{"--text-color":w(r),...a},...s})});x.displayName="Body";var g=m(require("react"),1),b=require("react/jsx-runtime");function z(t){if(t)return`var(--color-${t.replace(".","-")})`}var P=g.forwardRef(({as:t="h1",size:o="md",color:r="",style:n,className:a,...i},s)=>{let p=t,l=`text-display text-display-${o} ${a}`;return(0,b.jsx)(p,{ref:s,className:l,style:{"--text-color":z(r),...n},...i})});P.displayName="Display";var C=m(require("react"),1),H=require("react/jsx-runtime");function D(t){if(t)return`var(--color-${t.replace(".","-")})`}var E=C.forwardRef(({as:t="h2",size:o="md",color:r="",style:n,className:a,...i},s)=>{let p=t,l=`text-heading text-heading-${o} ${a}`;return(0,H.jsx)(p,{ref:s,className:l,style:{"--text-color":D(r),...n},...i})});E.displayName="Heading";
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Slot as y}from"@radix-ui/react-slot";import*as d from"react";import{jsx as R}from"react/jsx-runtime";function e(t){let o=d.forwardRef((r,a)=>{let{asChild:n,...i}=r;return R(n?y:t,{...i,ref:a})});return o.displayName=`Primitive.${t}`,o}var $={div:e("div"),span:e("span"),button:e("button"),input:e("input"),form:e("form"),label:e("label"),p:e("p"),h1:e("h1"),h2:e("h2"),h3:e("h3"),h4:e("h4"),h5:e("h5"),h6:e("h6"),section:e("section"),article:e("article"),header:e("header"),footer:e("footer"),main:e("main"),nav:e("nav"),aside:e("aside"),ul:e("ul"),ol:e("ol"),li:e("li"),img:e("img"),a:e("a"),strong:e("strong"),em:e("em"),small:e("small"),table:e("table"),thead:e("thead"),tbody:e("tbody"),tr:e("tr"),td:e("td"),th:e("th")};import*as m from"react";import{jsx as
|
|
1
|
+
import{Slot as y}from"@radix-ui/react-slot";import*as d from"react";import{jsx as R}from"react/jsx-runtime";function e(t){let o=d.forwardRef((r,a)=>{let{asChild:n,...i}=r;return R(n?y:t,{...i,ref:a})});return o.displayName=`Primitive.${t}`,o}var $={div:e("div"),span:e("span"),button:e("button"),input:e("input"),form:e("form"),label:e("label"),p:e("p"),h1:e("h1"),h2:e("h2"),h3:e("h3"),h4:e("h4"),h5:e("h5"),h6:e("h6"),section:e("section"),article:e("article"),header:e("header"),footer:e("footer"),main:e("main"),nav:e("nav"),aside:e("aside"),ul:e("ul"),ol:e("ol"),li:e("li"),img:e("img"),a:e("a"),strong:e("strong"),em:e("em"),small:e("small"),table:e("table"),thead:e("thead"),tbody:e("tbody"),tr:e("tr"),td:e("td"),th:e("th")};import*as m from"react";import{jsx as g}from"react/jsx-runtime";function x(t){if(t)return`var(--color-${t.replace(".","-")})`}var u=m.forwardRef(({as:t="p",size:o="md",color:r="",fontWeight:a="normal",style:n,className:i,...s},p)=>{let l=t,h=`text-body text-body-${o}${a==="bold"?"-bold":""} ${i}`;return g(l,{ref:p,className:h,style:{"--text-color":x(r),...n},...s})});u.displayName="Body";import*as c from"react";import{jsx as C}from"react/jsx-runtime";function P(t){if(t)return`var(--color-${t.replace(".","-")})`}var b=c.forwardRef(({as:t="h1",size:o="md",color:r="",style:a,className:n,...i},s)=>{let p=t,l=`text-display text-display-${o} ${n}`;return C(p,{ref:s,className:l,style:{"--text-color":P(r),...a},...i})});b.displayName="Display";import*as f from"react";import{jsx as T}from"react/jsx-runtime";function E(t){if(t)return`var(--color-${t.replace(".","-")})`}var H=f.forwardRef(({as:t="h2",size:o="md",color:r="",style:a,className:n,...i},s)=>{let p=t,l=`text-heading text-heading-${o} ${n}`;return T(p,{ref:s,className:l,style:{"--text-color":E(r),...a},...i})});H.displayName="Heading";export{u as Body,b as Display,H as Heading,$ as Primitive,e as createPrimitive};
|