@cocso-ui/react 0.0.0-beta.0 → 0.0.0-beta.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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type BodyElement = 'p' | 'span' | 'div' | 'label' | 'li' | 'td' | 'th' | 'figcaption' | 'blockquote' | 'cite';
|
|
3
|
+
export interface BodyProps<T extends React.ElementType = 'p'> {
|
|
4
|
+
as?: T & BodyElement;
|
|
5
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
|
|
6
|
+
color?: string;
|
|
7
|
+
fontWeight?: 'normal' | 'bold';
|
|
8
|
+
}
|
|
9
|
+
export type BodyPropsWithElement<T extends React.ElementType = 'p'> = BodyProps<T> & Omit<React.ComponentPropsWithoutRef<T>, keyof BodyProps<T>>;
|
|
10
|
+
export declare const Body: React.ForwardRefExoticComponent<BodyProps<BodyElement> & Omit<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">, keyof BodyProps<T>> & React.RefAttributes<HTMLElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Body';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type DisplayProps = {
|
|
3
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
4
|
+
size?: 'lg' | 'md' | 'sm';
|
|
5
|
+
color?: string;
|
|
6
|
+
} & React.HTMLAttributes<HTMLHeadingElement>;
|
|
7
|
+
export declare const Display: React.ForwardRefExoticComponent<{
|
|
8
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
9
|
+
size?: "lg" | "md" | "sm";
|
|
10
|
+
color?: string;
|
|
11
|
+
} & React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Display';
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var v=Object.create;var d=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,W=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 B(o))!W.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(N(t)):{},c(o||!t||!t.__esModule?d(r,"default",{value:t,enumerable:!0}):r,t)),M=t=>c(d({},"__esModule",{value:!0}),t);var k={};L(k,{Body:()=>x,Display:()=>g,Heading:()=>C,Primitive:()=>S,createPrimitive:()=>e});module.exports=M(k);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,H=`text-body text-body-${o}${n==="bold"?"-bold":""} ${i}`;return(0,u.jsx)(l,{ref:p,className:H,style:{"--text-color":w(r),...a},...s})});x.displayName="Body";var P=m(require("react"),1),E=require("react/jsx-runtime");function D(t){if(t)return`var(--color-${t.replace(".","-")})`}var g=P.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,E.jsx)(p,{ref:s,className:l,style:{"--text-color":D(r),...n},...i})});g.displayName="Display";var b=m(require("react"),1),T=require("react/jsx-runtime");function z(t){if(t)return`var(--color-${t.replace(".","-")})`}var C=b.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,T.jsx)(p,{ref:s,className:l,style:{"--text-color":z(r),...n},...i})});C.displayName="Heading";
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Slot 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 P}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 P(l,{ref:p,className:h,style:{"--text-color":x(r),...n},...s})});u.displayName="Body";import*as c from"react";import{jsx as b}from"react/jsx-runtime";function g(t){if(t)return`var(--color-${t.replace(".","-")})`}var E=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 b(p,{ref:s,className:l,style:{"--text-color":g(r),...a},...i})});E.displayName="Display";import*as f from"react";import{jsx as H}from"react/jsx-runtime";function C(t){if(t)return`var(--color-${t.replace(".","-")})`}var T=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 H(p,{ref:s,className:l,style:{"--text-color":C(r),...a},...i})});T.displayName="Heading";export{u as Body,E as Display,T as Heading,$ as Primitive,e as createPrimitive};
|