@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 React.ElementType = 'p'> = {
4
- as?: T & BodyElement;
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
- export type DisplayProps = {
3
- as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
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.HTMLAttributes<HTMLHeadingElement>;
7
+ } & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color'>;
7
8
  export declare const Display: React.ForwardRefExoticComponent<{
8
- as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
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
- export type HeadingProps = {
3
- as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
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.HTMLAttributes<HTMLHeadingElement>;
7
+ } & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color'>;
7
8
  export declare const Heading: React.ForwardRefExoticComponent<{
8
- as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
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 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";
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 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};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocso-ui/react",
3
- "version": "0.0.1-beta.2",
3
+ "version": "0.0.1-beta.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cocso/cocso-ui.git",