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