@cocso-ui/react 0.0.0-beta.0

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
+ export type HeadingProps = {
3
+ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
4
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
5
+ color?: string;
6
+ } & React.HTMLAttributes<HTMLHeadingElement>;
7
+ export declare const Heading: React.ForwardRefExoticComponent<{
8
+ as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
9
+ size?: "xl" | "lg" | "md" | "sm" | "xs" | "2xs";
10
+ color?: string;
11
+ } & React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
@@ -0,0 +1 @@
1
+ export * from './Heading';
package/lib/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.create;var n=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var v=(t,o)=>{for(var r in o)n(t,r,{get:o[r],enumerable:!0})},m=(t,o,r,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of C(o))!y.call(t,a)&&a!==r&&n(t,a,{get:()=>o[a],enumerable:!(i=E(o,a))||i.enumerable});return t};var d=(t,o,r)=>(r=t!=null?u(b(t)):{},m(o||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),H=t=>m(n({},"__esModule",{value:!0}),t);var w={};v(w,{Heading:()=>R,Primitive:()=>T,createPrimitive:()=>e});module.exports=H(w);var l=require("@radix-ui/react-slot"),h=d(require("react"),1),c=require("react/jsx-runtime");function e(t){let o=h.forwardRef((r,i)=>{let{asChild:a,...s}=r;return(0,c.jsx)(a?l.Slot:t,{...s,ref:i})});return o.displayName=`Primitive.${t}`,o}var T={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 f=d(require("react"),1),x=require("react/jsx-runtime");function W(t){if(t)return`var(--color-${t.replace(".","-")})`}var R=f.forwardRef(({as:t="h2",size:o="md",color:r="",style:i,className:a,...s},p)=>{let P=t||"h2",g=`text-heading text-heading-${o} ${a}`;return(0,x.jsx)(P,{ref:p,className:g,style:{"--text-color":W(r),...i},...s})});R.displayName="Heading";
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './primitive';
2
+ export * from './components/Heading';
package/lib/index.js ADDED
@@ -0,0 +1 @@
1
+ import{Slot as h}from"@radix-ui/react-slot";import*as p from"react";import{jsx as c}from"react/jsx-runtime";function e(t){let o=p.forwardRef((r,a)=>{let{asChild:i,...n}=r;return c(i?h:t,{...n,ref:a})});return o.displayName=`Primitive.${t}`,o}var g={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 x}from"react/jsx-runtime";function f(t){if(t)return`var(--color-${t.replace(".","-")})`}var R=m.forwardRef(({as:t="h2",size:o="md",color:r="",style:a,className:i,...n},s)=>{let d=t||"h2",l=`text-heading text-heading-${o} ${i}`;return x(d,{ref:s,className:l,style:{"--text-color":f(r),...a},...n})});R.displayName="Heading";export{R as Heading,g as Primitive,e as createPrimitive};
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ export interface PrimitiveProps {
3
+ asChild?: boolean;
4
+ }
5
+ type PropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & PrimitiveProps;
6
+ declare function createPrimitive<E extends React.ElementType>(element: E): React.ForwardRefExoticComponent<PropsWithRef<E>>;
7
+ declare const Primitive: {
8
+ div: React.ForwardRefExoticComponent<PropsWithRef<"div">>;
9
+ span: React.ForwardRefExoticComponent<PropsWithRef<"span">>;
10
+ button: React.ForwardRefExoticComponent<PropsWithRef<"button">>;
11
+ input: React.ForwardRefExoticComponent<PropsWithRef<"input">>;
12
+ form: React.ForwardRefExoticComponent<PropsWithRef<"form">>;
13
+ label: React.ForwardRefExoticComponent<PropsWithRef<"label">>;
14
+ p: React.ForwardRefExoticComponent<PropsWithRef<"p">>;
15
+ h1: React.ForwardRefExoticComponent<PropsWithRef<"h1">>;
16
+ h2: React.ForwardRefExoticComponent<PropsWithRef<"h2">>;
17
+ h3: React.ForwardRefExoticComponent<PropsWithRef<"h3">>;
18
+ h4: React.ForwardRefExoticComponent<PropsWithRef<"h4">>;
19
+ h5: React.ForwardRefExoticComponent<PropsWithRef<"h5">>;
20
+ h6: React.ForwardRefExoticComponent<PropsWithRef<"h6">>;
21
+ section: React.ForwardRefExoticComponent<PropsWithRef<"section">>;
22
+ article: React.ForwardRefExoticComponent<PropsWithRef<"article">>;
23
+ header: React.ForwardRefExoticComponent<PropsWithRef<"header">>;
24
+ footer: React.ForwardRefExoticComponent<PropsWithRef<"footer">>;
25
+ main: React.ForwardRefExoticComponent<PropsWithRef<"main">>;
26
+ nav: React.ForwardRefExoticComponent<PropsWithRef<"nav">>;
27
+ aside: React.ForwardRefExoticComponent<PropsWithRef<"aside">>;
28
+ ul: React.ForwardRefExoticComponent<PropsWithRef<"ul">>;
29
+ ol: React.ForwardRefExoticComponent<PropsWithRef<"ol">>;
30
+ li: React.ForwardRefExoticComponent<PropsWithRef<"li">>;
31
+ img: React.ForwardRefExoticComponent<PropsWithRef<"img">>;
32
+ a: React.ForwardRefExoticComponent<PropsWithRef<"a">>;
33
+ strong: React.ForwardRefExoticComponent<PropsWithRef<"strong">>;
34
+ em: React.ForwardRefExoticComponent<PropsWithRef<"em">>;
35
+ small: React.ForwardRefExoticComponent<PropsWithRef<"small">>;
36
+ table: React.ForwardRefExoticComponent<PropsWithRef<"table">>;
37
+ thead: React.ForwardRefExoticComponent<PropsWithRef<"thead">>;
38
+ tbody: React.ForwardRefExoticComponent<PropsWithRef<"tbody">>;
39
+ tr: React.ForwardRefExoticComponent<PropsWithRef<"tr">>;
40
+ td: React.ForwardRefExoticComponent<PropsWithRef<"td">>;
41
+ th: React.ForwardRefExoticComponent<PropsWithRef<"th">>;
42
+ };
43
+ export { createPrimitive, Primitive };
44
+ export type { PropsWithRef };
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@cocso-ui/react",
3
+ "version": "0.0.0-beta.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/cocso/cocso-ui.git",
7
+ "directory": "packages/react"
8
+ },
9
+ "scripts": {
10
+ "build": "rm -rf lib && bun run build.js && bun x tsc",
11
+ "dev": "bun run build.js --watch"
12
+ },
13
+ "type": "module",
14
+ "main": "./lib/index.cjs",
15
+ "module": "./lib/index.js",
16
+ "types": "./lib/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./lib/index.d.ts",
20
+ "import": "./lib/index.js",
21
+ "require": "./lib/index.cjs"
22
+ }
23
+ },
24
+ "files": [
25
+ "lib"
26
+ ],
27
+ "dependencies": {
28
+ "@radix-ui/react-slot": "^1.2.3"
29
+ },
30
+ "peerDependencies": {
31
+ "react": "^18 || ^19",
32
+ "react-dom": "^18 || ^19"
33
+ },
34
+ "devDependencies": {
35
+ "@types/react": "^19",
36
+ "@types/react-dom": "^19",
37
+ "esbuild": "^0.24.0",
38
+ "typescript": "^5.0.0"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }