@cocso-ui/react 0.0.1-beta.10 → 0.0.1-beta.12
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 +3 -3
- package/lib/components/Button/Button.d.ts +12 -6
- package/lib/components/Checkbox/Checkbox.d.ts +20 -0
- package/lib/components/Checkbox/index.d.ts +1 -0
- package/lib/components/Display/Display.d.ts +9 -6
- package/lib/components/Heading/Heading.d.ts +9 -6
- package/lib/components/Spinner/Spinner.d.ts +6 -3
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/utils/polymorphic.d.ts +9 -0
- package/package.json +4 -2
- /package/lib/utils/{tokens.d.ts → token.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type FontWeightToken } from '../../utils/
|
|
2
|
+
import { type FontWeightToken } from '../../utils/token';
|
|
3
3
|
declare const tags: readonly ["p", "a", "span", "div", "label", "li", "td", "th", "figcaption", "blockquote", "cite"];
|
|
4
4
|
type Element = (typeof tags)[number];
|
|
5
5
|
type Default = (typeof tags)[0];
|
|
@@ -7,8 +7,8 @@ export type BodyProps<T extends Element = Default> = {
|
|
|
7
7
|
as?: T;
|
|
8
8
|
size?: 'lg' | 'md' | 'sm' | 'xs';
|
|
9
9
|
color?: string;
|
|
10
|
-
|
|
11
|
-
} &
|
|
10
|
+
weight?: FontWeightToken;
|
|
11
|
+
} & React.ComponentPropsWithoutRef<T>;
|
|
12
12
|
export declare const Body: (<T extends Element = "p">(props: BodyProps<T> & {
|
|
13
13
|
ref?: React.ForwardedRef<React.ComponentRef<T>>;
|
|
14
14
|
}) => React.ReactElement) & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type FontWeightToken } from '../../utils/
|
|
2
|
+
import { type FontWeightToken } from '../../utils/token';
|
|
3
3
|
declare const tags: readonly ["button"];
|
|
4
4
|
type Element = (typeof tags)[number];
|
|
5
5
|
type Default = (typeof tags)[0];
|
|
@@ -10,11 +10,17 @@ export type ButtonProps<T extends Element = Default> = {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
loading?: boolean;
|
|
12
12
|
color?: string;
|
|
13
|
-
|
|
14
|
-
} &
|
|
15
|
-
export declare const Button:
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
weight?: FontWeightToken;
|
|
14
|
+
} & React.ComponentPropsWithoutRef<T>;
|
|
15
|
+
export declare const Button: React.ForwardRefExoticComponent<{
|
|
16
|
+
as?: "button" | undefined;
|
|
17
|
+
variant?: "primary" | "secondary" | "tertiary" | "danger" | "success" | "text";
|
|
18
|
+
size?: "xl" | "lg" | "md" | "sm" | "xs" | "2xs";
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
color?: string;
|
|
22
|
+
weight?: FontWeightToken;
|
|
23
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>> & {
|
|
18
24
|
displayName: string;
|
|
19
25
|
};
|
|
20
26
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CheckboxStatus = 'on' | 'off' | 'intermediate';
|
|
3
|
+
export type CheckboxProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
size?: 'md' | 'lg';
|
|
6
|
+
status: CheckboxStatus;
|
|
7
|
+
onChange: (next: CheckboxStatus) => void;
|
|
8
|
+
label?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
} & Omit<React.ComponentPropsWithoutRef<'div'>, 'id'>;
|
|
11
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<{
|
|
12
|
+
id: string;
|
|
13
|
+
size?: "md" | "lg";
|
|
14
|
+
status: CheckboxStatus;
|
|
15
|
+
onChange: (next: CheckboxStatus) => void;
|
|
16
|
+
label?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "id"> & React.RefAttributes<HTMLDivElement>> & {
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Checkbox';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type FontWeightToken } from '../../utils/
|
|
2
|
+
import { type FontWeightToken } from '../../utils/token';
|
|
3
3
|
declare const tags: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
4
4
|
type Element = (typeof tags)[number];
|
|
5
5
|
type Default = (typeof tags)[0];
|
|
@@ -7,11 +7,14 @@ export type DisplayProps<T extends Element = Default> = {
|
|
|
7
7
|
as?: T;
|
|
8
8
|
size?: 'lg' | 'md' | 'sm';
|
|
9
9
|
color?: string;
|
|
10
|
-
|
|
11
|
-
} &
|
|
12
|
-
export declare const Display:
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
weight?: FontWeightToken;
|
|
11
|
+
} & React.ComponentPropsWithoutRef<T>;
|
|
12
|
+
export declare const Display: React.ForwardRefExoticComponent<{
|
|
13
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
14
|
+
size?: "lg" | "md" | "sm";
|
|
15
|
+
color?: string;
|
|
16
|
+
weight?: FontWeightToken;
|
|
17
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>> & {
|
|
15
18
|
displayName: string;
|
|
16
19
|
};
|
|
17
20
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type FontWeightToken } from '../../utils/
|
|
2
|
+
import { type FontWeightToken } from '../../utils/token';
|
|
3
3
|
declare const tags: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
4
4
|
type Element = (typeof tags)[number];
|
|
5
5
|
type Default = (typeof tags)[1];
|
|
@@ -7,11 +7,14 @@ export type HeadingProps<T extends Element = Default> = {
|
|
|
7
7
|
as?: T;
|
|
8
8
|
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
|
|
9
9
|
color?: string;
|
|
10
|
-
|
|
11
|
-
} &
|
|
12
|
-
export declare const Heading:
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
weight?: FontWeightToken;
|
|
11
|
+
} & React.ComponentPropsWithoutRef<T>;
|
|
12
|
+
export declare const Heading: React.ForwardRefExoticComponent<{
|
|
13
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
14
|
+
size?: "xl" | "lg" | "md" | "sm" | "xs" | "2xs";
|
|
15
|
+
color?: string;
|
|
16
|
+
weight?: FontWeightToken;
|
|
17
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>> & {
|
|
15
18
|
displayName: string;
|
|
16
19
|
};
|
|
17
20
|
export {};
|
|
@@ -8,9 +8,12 @@ export type SpinnerProps<T extends Element = Default> = {
|
|
|
8
8
|
color?: string;
|
|
9
9
|
bg?: string;
|
|
10
10
|
} & Omit<React.ComponentPropsWithoutRef<T>, 'size' | 'color'>;
|
|
11
|
-
export declare const Spinner:
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export declare const Spinner: React.ForwardRefExoticComponent<{
|
|
12
|
+
as?: "div" | undefined;
|
|
13
|
+
size?: "xl" | "lg" | "md" | "sm" | "xs";
|
|
14
|
+
color?: string;
|
|
15
|
+
bg?: string;
|
|
16
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "color" | "size"> & React.RefAttributes<HTMLDivElement>> & {
|
|
14
17
|
displayName: string;
|
|
15
18
|
};
|
|
16
19
|
export {};
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var I=Object.create;var k=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var J=(e,o)=>{for(var t in o)k(e,t,{get:o[t],enumerable:!0})},N=(e,o,t,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of A(o))!q.call(e,n)&&n!==t&&k(e,n,{get:()=>o[n],enumerable:!(a=V(o,n))||a.enumerable});return e};var x=(e,o,t)=>(t=e!=null?I(G(e)):{},N(o||!e||!e.__esModule?k(t,"default",{value:e,enumerable:!0}):t,e)),Q=e=>N(k({},"__esModule",{value:!0}),e);var ge={};J(ge,{Body:()=>Z,Button:()=>re,Checkbox:()=>fe,Display:()=>ie,Heading:()=>me,Spinner:()=>E});module.exports=Q(ge);var D=x(require("react"),1);function d(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var P={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function u(e){if(e)return e in P?P[e]:e}var U=(...e)=>e.filter(Boolean).join(" ").trim(),p=(e,o,t=[],...a)=>{let n=Object.entries(o).filter(([,s])=>s!==!1&&s!==null&&s!==void 0).map(([s,c])=>`${e}--${s}_${c}`).join(" "),r=t.filter(s=>Object.entries(s).every(([c,i])=>o[c]===i)).map(s=>{let c=Object.entries(s).map(([i,f])=>`${i}_${f}`).join("-");return`${e}--${c}`}).join(" ");return U(e,n,r,...a)};var W=require("react/jsx-runtime"),X=["p","a","span","div","label","li","td","th","figcaption","blockquote","cite"],Y=D.forwardRef(({as:e=X[0],size:o="md",color:t,weight:a="normal",className:n,style:r,...s},c)=>{let i=e,l=p("cocso-body",{size:o},[],n);return(0,W.jsx)(i,{ref:c,className:l,style:{"--cocso-body-color":d(t),"--cocso-body-weight":u(a),...r},...s})}),Z=Object.assign(Y,{displayName:"Body"});var C=x(require("react"),1);var S=x(require("react"),1);var R=require("react/jsx-runtime"),ee=["div"],te=S.forwardRef(({as:e=ee[0],size:o="md",color:t="palette.primary-500",bg:a="palette.gray-200",className:n,style:r,...s},c)=>{let i=e,l=p("cocso-spinner",{size:o},[],n);return(0,R.jsx)(i,{ref:c,className:l,style:{"--cocso-spinner-bg":d(a),"--cocso-spinner-color":d(t),...r},...s,children:(0,R.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,R.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),(0,R.jsx)("path",{className:"opacity-75",fill:"var(--cocso-spinner-color, currentColor)",d:"M12 2a10 10 0 0110 10 10 10 0 01-5 8.66l-1-1.73a8 8 0 004-6.93 8 8 0 00-8-8V2z"})]})})}),E=Object.assign(te,{displayName:"Spinner"});var w=require("react/jsx-runtime"),oe=["button"],ne=e=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[e],se=C.forwardRef(({as:e=oe[0],variant:o="primary",size:t="md",disabled:a=!1,loading:n=!1,color:r,weight:s="normal",className:c,style:i,children:f,onClick:l,onKeyDown:T,...b},v)=>{let y=e,h=a||n,H=C.useCallback(g=>{if(h){g.preventDefault();return}l?.(g)},[h,l]),j=C.useCallback(g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),h||g.currentTarget.click()),T?.(g)},[h,T]),$={variant:o,size:t,loading:n,disabled:h},K=[...a?[{variant:o,disabled:a}]:[],...n?[{variant:o,loading:n}]:[]],_=p("cocso-button",$,K,c),L={"--cocso-button-color":d(r),"--cocso-button-weight":u(s),...i};return(0,w.jsx)(y,{ref:v,className:_,onClick:H,onKeyDown:j,role:"button",disabled:h,"aria-disabled":h,"aria-busy":n,style:L,...b,children:n?(0,w.jsx)(E,{className:"cocso-button-spinner",size:ne(t),color:"currentColor"}):f})}),re=Object.assign(se,{displayName:"Button"});var B=x(require("react"),1);var F=require("react/jsx-runtime"),ae=["h1","h2","h3","h4","h5","h6"],ce=B.forwardRef(({as:e=ae[0],size:o="md",color:t,weight:a="bold",className:n,style:r,...s},c)=>{let i=e,l=p("cocso-display",{size:o},[],n);return(0,F.jsx)(i,{ref:c,className:l,style:{"--cocso-display-color":d(t),"--cocso-display-weight":u(a),...r},...s})}),ie=Object.assign(ce,{displayName:"Display"});var O=x(require("react"),1);var z=require("react/jsx-runtime"),le=["h1","h2","h3","h4","h5","h6"],pe=O.forwardRef(({as:e=le[1],size:o="md",color:t,weight:a="bold",className:n,style:r,...s},c)=>{let i=e,l=p("cocso-heading",{size:o},[],n);return(0,z.jsx)(i,{ref:c,className:l,style:{"--cocso-heading-color":d(t),"--cocso-heading-weight":u(a),...r},...s})}),me=Object.assign(pe,{displayName:"Heading"});var M=x(require("react"),1);var m=require("react/jsx-runtime"),de=M.forwardRef(({id:e,size:o="md",status:t,onChange:a,label:n,disabled:r=!1,className:s,...c},i)=>{let f={size:o,disabled:r,status:t},l=[...r?[{status:t,disabled:r}]:[]],T=p("cocso-checkbox-inner",f,l,s),b=()=>{r||a(t==="on"?"off":"on")};return(0,m.jsxs)("div",{ref:i,className:"cocso-checkbox",tabIndex:r?-1:0,role:"checkbox","aria-checked":t==="on"?"true":t==="intermediate"?"mixed":"false","aria-disabled":r,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),b())},...c,children:[(0,m.jsxs)("div",{className:T,onClick:b,children:[(0,m.jsx)("div",{className:"cocso-checkbox-icon",style:{opacity:t==="on"?1:0},children:(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-check-icon lucide-check",children:(0,m.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,m.jsx)("div",{className:"cocso-checkbox-icon",style:{opacity:t==="intermediate"?1:0},children:(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-minus-icon lucide-minus",children:(0,m.jsx)("path",{d:"M5 12h14"})})}),(0,m.jsx)("input",{type:"checkbox",id:e,checked:t==="on",onChange:b,disabled:r})]}),n&&(0,m.jsx)("label",{htmlFor:e,children:n})]})}),fe=Object.assign(de,{displayName:"Checkbox"});
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as E from"react";function m(e){if(e)return e.includes(".")?`var(--color-${e.replace(/\./g,"-")})`:e}var k={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};function g(e){if(e)return e in k?k[e]:e}var j=(...e)=>e.filter(Boolean).join(" ").trim(),p=(e,r,t=[],...c)=>{let n=Object.entries(r).filter(([,o])=>o!==!1&&o!==null&&o!==void 0).map(([o,a])=>`${e}--${o}_${a}`).join(" "),s=t.filter(o=>Object.entries(o).every(([a,i])=>r[a]===i)).map(o=>{let a=Object.entries(o).map(([i,d])=>`${i}_${d}`).join("-");return`${e}--${a}`}).join(" ");return j(e,n,s,...c)};import{jsx as _}from"react/jsx-runtime";var $=["p","a","span","div","label","li","td","th","figcaption","blockquote","cite"],K=E.forwardRef(({as:e=$[0],size:r="md",color:t,weight:c="normal",className:n,style:s,...o},a)=>{let i=e,l=p("cocso-body",{size:r},[],n);return _(i,{ref:a,className:l,style:{"--cocso-body-color":m(t),"--cocso-body-weight":g(c),...s},...o})}),ae=Object.assign(K,{displayName:"Body"});import*as R from"react";import*as w from"react";import{jsx as C,jsxs as V}from"react/jsx-runtime";var L=["div"],I=w.forwardRef(({as:e=L[0],size:r="md",color:t="palette.primary-500",bg:c="palette.gray-200",className:n,style:s,...o},a)=>{let i=e,l=p("cocso-spinner",{size:r},[],n);return C(i,{ref:a,className:l,style:{"--cocso-spinner-bg":m(c),"--cocso-spinner-color":m(t),...s},...o,children:V("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[C("circle",{className:"opacity-25",cx:"12",cy:"12",r:"9",stroke:"var(--cocso-spinner-bg, currentColor)",strokeWidth:"3"}),C("path",{className:"opacity-75",fill:"var(--cocso-spinner-color, currentColor)",d:"M12 2a10 10 0 0110 10 10 10 0 01-5 8.66l-1-1.73a8 8 0 004-6.93 8 8 0 00-8-8V2z"})]})})}),v=Object.assign(I,{displayName:"Spinner"});import{jsx as N}from"react/jsx-runtime";var A=["button"],G=e=>({"2xs":"xs",xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"md"})[e],q=R.forwardRef(({as:e=A[0],variant:r="primary",size:t="md",disabled:c=!1,loading:n=!1,color:s,weight:o="normal",className:a,style:i,children:d,onClick:l,onKeyDown:b,...x},T)=>{let y=e,h=c||n,B=R.useCallback(f=>{if(h){f.preventDefault();return}l?.(f)},[h,l]),F=R.useCallback(f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),h||f.currentTarget.click()),b?.(f)},[h,b]),O={variant:r,size:t,loading:n,disabled:h},z=[...c?[{variant:r,disabled:c}]:[],...n?[{variant:r,loading:n}]:[]],M=p("cocso-button",O,z,a),H={"--cocso-button-color":m(s),"--cocso-button-weight":g(o),...i};return N(y,{ref:T,className:M,onClick:B,onKeyDown:F,role:"button",disabled:h,"aria-disabled":h,"aria-busy":n,style:H,...x,children:n?N(v,{className:"cocso-button-spinner",size:G(t),color:"currentColor"}):d})}),be=Object.assign(q,{displayName:"Button"});import*as P from"react";import{jsx as U}from"react/jsx-runtime";var J=["h1","h2","h3","h4","h5","h6"],Q=P.forwardRef(({as:e=J[0],size:r="md",color:t,weight:c="bold",className:n,style:s,...o},a)=>{let i=e,l=p("cocso-display",{size:r},[],n);return U(i,{ref:a,className:l,style:{"--cocso-display-color":m(t),"--cocso-display-weight":g(c),...s},...o})}),Ne=Object.assign(Q,{displayName:"Display"});import*as D from"react";import{jsx as Z}from"react/jsx-runtime";var X=["h1","h2","h3","h4","h5","h6"],Y=D.forwardRef(({as:e=X[1],size:r="md",color:t,weight:c="bold",className:n,style:s,...o},a)=>{let i=e,l=p("cocso-heading",{size:r},[],n);return Z(i,{ref:a,className:l,style:{"--cocso-heading-color":m(t),"--cocso-heading-weight":g(c),...s},...o})}),Oe=Object.assign(Y,{displayName:"Heading"});import*as S from"react";import{jsx as u,jsxs as W}from"react/jsx-runtime";var ee=S.forwardRef(({id:e,size:r="md",status:t,onChange:c,label:n,disabled:s=!1,className:o,...a},i)=>{let d={size:r,disabled:s,status:t},l=[...s?[{status:t,disabled:s}]:[]],b=p("cocso-checkbox-inner",d,l,o),x=()=>{s||c(t==="on"?"off":"on")};return W("div",{ref:i,className:"cocso-checkbox",tabIndex:s?-1:0,role:"checkbox","aria-checked":t==="on"?"true":t==="intermediate"?"mixed":"false","aria-disabled":s,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),x())},...a,children:[W("div",{className:b,onClick:x,children:[u("div",{className:"cocso-checkbox-icon",style:{opacity:t==="on"?1:0},children:u("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-check-icon lucide-check",children:u("path",{d:"M20 6 9 17l-5-5"})})}),u("div",{className:"cocso-checkbox-icon",style:{opacity:t==="intermediate"?1:0},children:u("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-minus-icon lucide-minus",children:u("path",{d:"M5 12h14"})})}),u("input",{type:"checkbox",id:e,checked:t==="on",onChange:x,disabled:s})]}),n&&u("label",{htmlFor:e,children:n})]})}),Ke=Object.assign(ee,{displayName:"Checkbox"});export{ae as Body,be as Button,Ke as Checkbox,Ne as Display,Oe as Heading,v as Spinner};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type AsProp<T extends React.ElementType> = {
|
|
3
|
+
as?: T;
|
|
4
|
+
};
|
|
5
|
+
export type PolymorphicRef<T extends React.ElementType> = React.ComponentPropsWithRef<T>['ref'];
|
|
6
|
+
export type PolymorphicComponentProps<T extends React.ElementType, Props = {}> = AsProp<T> & React.ComponentPropsWithoutRef<T> & Props & {
|
|
7
|
+
ref?: PolymorphicRef<T>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocso-ui/react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.12",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cocso/cocso-ui.git",
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"lib"
|
|
26
26
|
],
|
|
27
|
-
"dependencies": {
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@radix-ui/react-checkbox": "^1.3.2"
|
|
29
|
+
},
|
|
28
30
|
"peerDependencies": {
|
|
29
31
|
"react": "^19.1.0",
|
|
30
32
|
"react-dom": "^19.1.0"
|
|
File without changes
|