@nild/components 0.0.34 → 0.0.36
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/dist/button/Button.js +1 -1
- package/dist/button/Group.js +1 -1
- package/dist/button/style/index.d.ts +9 -6
- package/dist/button/style/index.js +1 -1
- package/dist/checkbox/Checkbox.js +1 -1
- package/dist/checkbox/Group.js +1 -1
- package/dist/checkbox/Indicator.js +1 -1
- package/dist/checkbox/Label.js +1 -1
- package/dist/checkbox/style/index.d.ts +10 -7
- package/dist/checkbox/style/index.js +1 -1
- package/dist/divider/Divider.js +1 -1
- package/dist/divider/style/index.d.ts +6 -3
- package/dist/divider/style/index.js +1 -1
- package/dist/input/Append.js +1 -1
- package/dist/input/Composite.js +1 -1
- package/dist/input/Input.js +1 -1
- package/dist/input/OTP.js +1 -1
- package/dist/input/Prefix.js +1 -1
- package/dist/input/Prepend.js +1 -1
- package/dist/input/Search.js +1 -1
- package/dist/input/Suffix.js +1 -1
- package/dist/input/style/index.d.ts +23 -23
- package/dist/input/style/index.js +1 -1
- package/dist/popup/Arrow.js +1 -1
- package/dist/popup/Popup.js +1 -1
- package/dist/popup/Portal.js +1 -1
- package/dist/popup/Trigger.js +1 -1
- package/dist/popup/contexts/index.d.ts +1 -1
- package/dist/popup/style/index.d.ts +9 -6
- package/dist/popup/style/index.js +1 -1
- package/dist/radio/Group.js +1 -1
- package/dist/radio/Indicator.js +1 -1
- package/dist/radio/Label.js +1 -1
- package/dist/radio/Radio.js +1 -1
- package/dist/radio/style/index.d.ts +10 -7
- package/dist/radio/style/index.js +1 -1
- package/dist/switch/Switch.js +1 -1
- package/dist/switch/Thumb.js +1 -1
- package/dist/switch/Track.js +1 -1
- package/dist/switch/style/index.d.ts +8 -5
- package/dist/switch/style/index.js +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tooltip/Tooltip.js +1 -1
- package/dist/transition/Transition.js +1 -1
- package/dist/transition/style/index.d.ts +6 -3
- package/dist/transition/style/index.js +1 -1
- package/dist/typography/Link.js +1 -1
- package/dist/typography/Paragraph.js +1 -1
- package/dist/typography/Text.js +1 -1
- package/dist/typography/Title.js +1 -1
- package/dist/typography/Typography.js +1 -1
- package/dist/typography/style/index.d.ts +11 -8
- package/dist/typography/style/index.js +1 -1
- package/package.json +4 -4
package/dist/button/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as b}from"react/jsx-runtime";import{cnMerge as c}from"@nild/shared";import{forwardRef as f,isValidElement as q}from"react";import{useGroupContext as
|
|
1
|
+
import{jsx as b}from"react/jsx-runtime";import{cnMerge as c}from"@nild/shared";import{forwardRef as f,isValidElement as q}from"react";import{useGroupContext as h}from"./contexts/index.js";import v from"./style/index.js";const x=e=>q(e)&&e.type===s,s=f((e,r)=>{const a=h(),{className:o,children:i,variant:l=a.variant,size:n=a.size,shape:m="square",equal:d=a.equal,disabled:t=a.disabled,block:u,...p}=e;return b("button",{type:"button",...p,disabled:t,className:c(v.button({variant:l,size:n,shape:m,equal:d,block:u,disabled:t}),o),ref:r,children:i})});s.displayName="Button";export{s as default,x as isButtonElement};
|
package/dist/button/Group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as h,jsx as g}from"react/jsx-runtime";import{isEmpty as v,cnMerge as N}from"@nild/shared";import{forwardRef as y,Children as B,cloneElement as E}from"react";import{isButtonElement as j}from"./Button.js";import{GroupProvider as x}from"./contexts/index.js";import s from"./style/index.js";const n=y(({className:l,children:m,variant:e="solid",size:d="medium",equal:p=!1,disabled:c,direction:a="horizontal",...u},f)=>{const t=B.toArray(m);if(v(t))return null;const r=t.filter(j);return h(x,{value:{variant:e,size:d,equal:p,disabled:c},children:[r.length===1&&r[0],r.length>1&&g("div",{...u,className:N(s.group({direction:a}),l),ref:f,children:r.map((i,o)=>E(i,{...i.props,className:s.groupedButton({first:o===0,last:o===r.length-1,direction:a,variant:e})}))})]})});n.displayName="Button.Group";export{n as default};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ButtonProps, GroupProps } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
button: (props?: ButtonProps | undefined) => string;
|
|
4
|
+
group: (props?: GroupProps | undefined) => string;
|
|
5
|
+
groupedButton: (props?: (GroupProps & {
|
|
6
|
+
first?: boolean;
|
|
7
|
+
last?: boolean;
|
|
8
|
+
}) | undefined) => string;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as e}from"@nild/shared";import{DISABLED_CLS as a}from"../../_shared/style/index.js";const r=e(["nd-button",["font-nd","cursor-pointer","transition-colors"],["whitespace-nowrap","truncate"],a],{variants:{variant:{solid:["bg-brand","text-
|
|
1
|
+
import{cva as e}from"@nild/shared";import{DISABLED_CLS as a}from"../../_shared/style/index.js";const r=e(["nd-button",["font-nd","cursor-pointer","transition-colors"],["whitespace-nowrap","truncate"],a],{variants:{variant:{solid:["bg-brand","text-brand-contrast","enabled:hover:bg-brand-hover","enabled:active:bg-brand-active"],outlined:["bg-transparent","border","border-main","text-main","enabled:hover:border-brand-hover","enabled:hover:text-brand-hover","enabled:active:border-brand-active","enabled:active:text-brand-active"],filled:["bg-muted","text-main","enabled:hover:bg-muted-hover","enabled:active:bg-muted-active"],text:["bg-transparent","text-main","enabled:hover:bg-muted-hover","enabled:active:bg-muted-active"]},shape:{round:["rounded-full"],square:["rounded-md"]},size:{small:["px-2","h-6","text-sm"],medium:["px-4","h-8","text-md"],large:["px-6","h-10","text-lg"]},block:{true:"w-full",false:""},disabled:{true:"disabled",false:""},equal:{true:["flex","justify-center","items-center"],false:""}},compoundVariants:[{size:"small",equal:!0,className:["w-6 h-6","p-1"]},{size:"medium",equal:!0,className:["w-8 h-8","p-1.5"]},{size:"large",equal:!0,className:["w-10 h-10","p-2"]}]}),t=e(["nd-button-group",["flex"]],{variants:{direction:{horizontal:"",vertical:"flex-col"}}}),n=e("",{compoundVariants:[{first:!0,direction:"horizontal",className:"rounded-r-none"},{first:!0,direction:"vertical",className:"rounded-b-none"},{last:!0,direction:"horizontal",className:"rounded-l-none"},{last:!0,direction:"vertical",className:"rounded-t-none"},{first:!1,last:!1,className:"rounded-none"},{last:!1,direction:"horizontal",variant:"outlined",className:["mr-[-1px]","hover:z-1"]},{last:!1,direction:"vertical",variant:"outlined",className:["mb-[-1px]","hover:z-1"]},{last:!1,direction:"horizontal",variant:"solid",className:["border-r","border-r-brand-hover"]},{last:!1,direction:"horizontal",variant:["filled","text"],className:["border-r","border-r-muted"]},{last:!1,direction:"vertical",variant:"solid",className:["border-b","border-b-brand-hover"]},{last:!1,direction:"vertical",variant:["filled","text"],className:["border-b","border-b-muted"]}]}),o={button:r,group:t,groupedButton:n};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useControllableState as E,useEffectCallback as g}from"@nild/hooks";import{isString as w,cnMerge as M}from"@nild/shared";import{forwardRef as S,Children as V,isValidElement as j,cloneElement as G}from"react";import{useGroupContext as P,CheckboxProvider as R}from"./contexts/index.js";import
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useControllableState as E,useEffectCallback as g}from"@nild/hooks";import{isString as w,cnMerge as M}from"@nild/shared";import{forwardRef as S,Children as V,isValidElement as j,cloneElement as G}from"react";import{useGroupContext as P,CheckboxProvider as R}from"./contexts/index.js";import r from"./Indicator.js";import a from"./Label.js";import I from"./style/index.js";const m=S((u,p)=>{const i=[],l=new Map,s=P(),{className:f,children:h,variant:v=s?.variant??"solid",size:d=s?.size??"medium",disabled:n=s?.disabled??!1,checked:b,defaultChecked:k,value:o,onChange:c,...C}=u,[x,y]=E(s?s.value.includes(o):b,k??!1),z=g(()=>{n||y(e=>(s?s.setValue(e?s.value.filter(N=>N!==o):s.value.concat(o)):c?.(!e),!e))});return V.forEach(h,e=>{j(e)?e.type===r?(l.delete(r),l.set(r,e)):e.type===a&&(l.delete(a),l.set(a,e)):w(e)&&(l.has(a)||l.set(a,t(a,{children:e})))}),i.push(...l.values()),l.has(r)||i.unshift(t(r,{})),t(R,{value:{variant:v,size:d,checked:x,setChecked:z},children:t("label",{...C,className:M(I.checkbox({size:d,disabled:n}),f),ref:p,children:i.map(e=>G(e,{key:e.type.displayName,...e.props}))})})});m.displayName="Checkbox";export{m as default};
|
package/dist/checkbox/Group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{useControllableState as b,useEffectCallback as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{useControllableState as b,useEffectCallback as x}from"@nild/hooks";import{forwardRefWithGenerics as C,cnMerge as G}from"@nild/shared";import{GroupProvider as N}from"./contexts/index.js";import g from"./style/index.js";const o=C(({className:i,children:l,direction:s="horizontal",variant:t="solid",size:d="medium",disabled:n=!1,value:m,defaultValue:u=[],onChange:e,...c},f)=>{const[p,v]=b(m,u),h=x(a=>{v(()=>(e?.(a),a))});return r(N,{value:{variant:t,size:d,disabled:n,value:p,setValue:h},children:r("div",{...c,className:G(g.group({direction:s}),i),ref:f,children:l})})});o.displayName="Checkbox.Group";export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as l,jsx as o}from"react/jsx-runtime";import{Icon as h}from"@nild/icons";import k from"@nild/icons/CheckSmall";import{cnMerge as u}from"@nild/shared";import{forwardRef as x}from"react";import{useCheckboxContext as I}from"./contexts/index.js";import e from"./style/index.js";const r=x(({className:c,children:s,...t},i)=>{const{variant:n,size:m,checked:a,setChecked:d}=I(),f=s??(p=>o("div",{className:e.defaultIndicatorBlock({variant:n,checked:p}),children:o(h,{className:e.defaultIndicatorIcon(),component:k})}));return l("div",{...t,className:u(e.indicator({size:m}),c),ref:i,children:[f(!!a),o("input",{type:"checkbox",className:e.indicatorInput(),checked:a,onChange:d})]})});r.displayName="Checkbox.Indicator";export{r as default};
|
package/dist/checkbox/Label.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{isFunction as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{isFunction as n,cnMerge as f}from"@nild/shared";import{forwardRef as l}from"react";import{useCheckboxContext as p}from"./contexts/index.js";import d from"./style/index.js";const r=l(({className:s,children:e,...a},o)=>{const{size:m,checked:t}=p(),c=n(e)?e(!!t):e;return i("span",{...a,className:f(d.label({size:m}),s),ref:o,children:c})});r.displayName="Checkbox.Label";export{r as default};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { CheckboxProps, GroupProps } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
checkbox: (props?: Pick<CheckboxProps, "size" | "disabled"> | undefined) => string;
|
|
4
|
+
indicator: (props?: Pick<CheckboxProps, "size"> | undefined) => string;
|
|
5
|
+
indicatorInput: (props?: object | undefined) => string;
|
|
6
|
+
defaultIndicatorBlock: (props?: Pick<CheckboxProps, "variant" | "checked"> | undefined) => string;
|
|
7
|
+
defaultIndicatorIcon: (props?: object | undefined) => string;
|
|
8
|
+
label: (props?: Pick<CheckboxProps, "size"> | undefined) => string;
|
|
9
|
+
group: (props?: Pick<GroupProps<unknown>, "direction"> | undefined) => string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as e}from"@nild/shared";import{DISABLED_CLS as
|
|
1
|
+
import{cva as e}from"@nild/shared";import{DISABLED_CLS as r}from"../../_shared/style/index.js";const a=e(["nd-checkbox","group",["flex","items-center"],"cursor-pointer",r],{variants:{size:{small:"gap-1.5",medium:"gap-2",large:"gap-2.5"},disabled:{true:"disabled",false:""}}}),t=e(["relative",["flex","items-center","justify-center"]],{variants:{size:{small:"size-3.5 text-sm",medium:"size-4 text-md",large:"size-4.5 text-lg"}}}),o=e([["absolute","inset-0","opacity-0"],["group-enabled:cursor-pointer","group-disabled:cursor-not-allowed"]]),n=e([["flex","items-center","justify-center"],["size-full","rounded-sm","border"],"transition-[background-color,color,border-color]"],{compoundVariants:[{checked:!0,variant:"solid",className:["bg-brand border-brand text-brand-contrast","group-enabled:group-hover:bg-brand-hover"]},{checked:!0,variant:"outlined",className:["bg-transparent border-brand text-brand","group-enabled:group-hover:border-brand-hover","group-enabled:group-hover:text-brand-hover"]},{checked:!1,className:["bg-transparent border-main text-transparent","group-enabled:group-hover:border-brand-hover"]}]}),d=e(["w-full"]),l=e(["text-sm"],{variants:{size:{small:"text-sm",medium:"text-md",large:"text-lg"}}}),s=e(["nd-checkbox-group",["flex","gap-x-4","gap-y-2"]],{variants:{direction:{horizontal:"flex-row flex-wrap",vertical:"flex-col"}}}),i={checkbox:a,indicator:t,indicatorInput:o,defaultIndicatorBlock:n,defaultIndicatorIcon:d,label:l,group:s};export{i as default};
|
package/dist/divider/Divider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import{cnMerge as m,isEmpty as c}from"@nild/shared";import{forwardRef as f,Children as p}from"react";import
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{cnMerge as m,isEmpty as c}from"@nild/shared";import{forwardRef as f,Children as p}from"react";import h from"./style/index.js";const i=f(({className:a,children:e,variant:o="solid",direction:t="horizontal",align:n="center",...s},d)=>{const r=p.toArray(e);return l("div",{...s,className:m(h.divider({emptyChildren:c(r),variant:o,direction:t,align:n}),a),ref:d,children:r})});i.displayName="Divider";export{i as default};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { DividerProps } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
divider: (props?: (DividerProps & {
|
|
4
|
+
emptyChildren: boolean;
|
|
5
|
+
}) | undefined) => string;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as e}from"@nild/shared";const r=e(["nd-divider","border-
|
|
1
|
+
import{cva as e}from"@nild/shared";const r=e(["nd-divider","border-muted","text-main"],{compoundVariants:[{emptyChildren:!0,direction:"horizontal",className:["w-full","min-w-full","border-b","my-6"]},{emptyChildren:!0,direction:"vertical",className:["inline-block","h-[1em]","align-middle","border-r","ms-3 me-3"]},{emptyChildren:!0,variant:"solid",className:[]},{emptyChildren:!0,variant:"dashed",className:["border-dashed"]},{emptyChildren:!0,variant:"dotted",className:["border-dotted"]},{emptyChildren:!1,direction:"horizontal",className:["flex items-center text-center",'before:h-0 before:content-[""] before:border-b before:border-[color:inherit]','after:h-0 after:content-[""] after:border-b after:border-[color:inherit]',"my-6"]},{emptyChildren:!1,direction:"horizontal",variant:"solid",className:["before:border-solid","after:border-solid"]},{emptyChildren:!1,direction:"horizontal",variant:"dashed",className:["before:border-dashed","after:border-dashed"]},{emptyChildren:!1,direction:"horizontal",variant:"dotted",className:["before:border-dotted","after:border-dotted"]},{emptyChildren:!1,direction:"horizontal",align:"left",className:["before:basis-1/12","before:grow-0","after:flex-1"]},{emptyChildren:!1,direction:"horizontal",align:"center",className:["before:flex-1","after:flex-1"]},{emptyChildren:!1,direction:"horizontal",align:"right",className:["before:flex-1","after:basis-1/12","after:grow-0"]}]}),t={divider:r};export{t as default};
|
package/dist/input/Append.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as d}from"react/jsx-runtime";import{isString as c,cnMerge as
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import{isString as c,cnMerge as p}from"@nild/shared";import{isValidElement as t,Children as u,cloneElement as f}from"react";import{useCompositeContext as v}from"./contexts/index.js";import o from"./style/index.js";const y=e=>t(e)&&e.type===i,i=({children:e})=>{var n;const{size:a,variant:r,disabled:l}=v();if(c(e))return d("span",{className:p(o.append({type:"string",size:a,variant:r})),children:e});const s=u.toArray(e).find(m=>t(m));return f(s,{...s?.props,className:p(o.append({type:"element",size:a,variant:r}),(n=s?.props)==null?void 0:n.className),size:a,disabled:l})};i.displayName="Input.Append";export{i as default,y as isAppendElement};
|
package/dist/input/Composite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u,jsxs as v}from"react/jsx-runtime";import{cnMerge as E}from"@nild/shared";import{forwardRef as b,Children as h,cloneElement as N}from"react";import{isAppendElement as x}from"./Append.js";import{CompositeProvider as C}from"./contexts/index.js";import{isInputElement as I}from"./Input.js";import{isPrependElement as j}from"./Prepend.js";import p from"./style/index.js";const m=b(({className:t,children:l,variant:r="outlined",size:n="medium",block:i=!1,disabled:d=!1,...c},f)=>{let s,a,o;return h.forEach(l,e=>{j(e)?s=e:x(e)?a=e:I(e)&&(o=e)}),o?u(C,{value:{variant:r,size:n,block:i,disabled:d},children:v("span",{ref:f,className:E(p.composite({block:i}),t),...c,children:[s,N(o,{...o?.props,className:p.compositedInputWrapper({variant:r,prepended:!!s,appended:!!a})}),a]})}):null});m.displayName="Input.Composite";export{m as default};
|
package/dist/input/Input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as p,jsxs as
|
|
1
|
+
import{jsx as p,jsxs as y}from"react/jsx-runtime";import{useControllableState as N}from"@nild/hooks";import{cnMerge as k}from"@nild/shared";import{forwardRef as I,Children as j,isValidElement as P}from"react";import{useCompositeContext as S,InputProvider as V}from"./contexts/index.js";import{isPrefixElement as w}from"./Prefix.js";import u from"./style/index.js";import{isSuffixElement as M}from"./Suffix.js";const H=e=>P(e)&&e.type===i,i=I((e,d)=>{const s=S(),{className:f,children:c,variant:l=s.variant,size:t=s.size,block:v=s.block,disabled:r=s.disabled,type:b="text",value:h,defaultValue:x="",onChange:n,...C}=e;let o=null,m=null;j.forEach(c,a=>{w(a)?o=a:M(a)&&(m=a)});const[g,z]=N(h,x),E=a=>{z(a.target.value),n?.(a.target.value,a)};return p(V,{value:{size:t,disabled:r,variant:l},children:y("span",{className:k(u.inputWrapper({variant:l,size:t,block:v,disabled:r}),f),children:[o,p("input",{ref:d,type:b,value:g,onChange:E,disabled:r,className:u.input({size:t}),...C}),m]})})});i.displayName="Input";export{i as default,H as isInputElement};
|
package/dist/input/OTP.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as A,jsxs as
|
|
1
|
+
import{jsx as A,jsxs as G}from"react/jsx-runtime";import{useControllableState as J}from"@nild/hooks";import{isNumber as K,cnMerge as L,isFunction as Q,isEmpty as g}from"@nild/shared";import{forwardRef as U,useRef as F,useImperativeHandle as V,Fragment as X}from"react";import Y from"./Input.js";import z from"./style/index.js";const I=U(({className:w,placeholder:y,length:s=6,separator:d,block:b=!1,size:k="medium",type:x,value:B,defaultValue:P,onFocus:C,onBlur:D,onChange:M,onComplete:N,...S},T)=>{const[h,W]=J(B,P??[]),o=F([]),v=F(h);v.current=h;const p=()=>Array.from({length:s},(e,n)=>v.current[n]??""),m=(e,n)=>{v.current=e,W(e),M?.(e,n),e.every(l=>!g(l))&&N?.(e,n)},j=(e,n,l)=>{var r;const a=String(n??"");if(!a)return;const t=p(),c=a.split("");for(let u=0;u<c.length;u++)e+u<s&&(t[e+u]=c[u]);m(t,l);const f=Math.min(e+c.length,s-1);(r=o.current[f])==null||r.focus()},E=(e,n)=>{var l;const r=p(),a=r.findIndex(t=>t==="");g(r[e])&&a!==-1&&e>a?(n.preventDefault(),(l=o.current[a])==null||l.focus()):(n.target.select(),C?.(e,n))},H=e=>{e.currentTarget.contains(e.relatedTarget)||D==null||D(e)},O=(e,n)=>{var l,r,a;if(n.key==="Backspace"||n.keyCode===8){n.preventDefault();const t=p();g(t[e])?e>0&&(t[e-1]="",m(t,n),(l=o.current[e-1])==null||l.focus()):(t[e]="",m(t,n))}else n.key==="ArrowLeft"?(n.preventDefault(),(r=o.current[Math.max(0,e-1)])==null||r.focus()):n.key==="ArrowRight"&&(n.preventDefault(),(a=o.current[Math.min(s-1,e+1)])==null||a.focus())},R=e=>{var n,l,r;e.preventDefault();const a=((l=(n=e.clipboardData)==null?void 0:n.getData)==null?void 0:l.call(n,"text"))??"",t=x==="number"?a.replace(/\D/g,""):a.replace(/\s/g,"");if(!t)return;const c=Math.max(0,o.current.findIndex(i=>i===document.activeElement)),f=p(),u=t.split("");for(let i=0;i<u.length;i++)c+i<s&&(f[c+i]=u[i]);m(f,e);const q=Math.min(c+u.length,s-1);(r=o.current[q])==null||r.focus()};return V(T,()=>({focus:e=>{var n,l;if(K(e))(n=o.current[e])==null||n.focus();else{const r=p().findIndex(t=>t===""),a=r!==-1?r:0;(l=o.current[a])==null||l.focus()}},blur:()=>{o.current.forEach(e=>e?.blur())}})),A("span",{className:L(z.otpWrapper({block:b}),w),onPasteCapture:R,onBlur:H,children:Array.from({length:s}).map((e,n)=>G(X,{children:[A(Y,{className:z.otpInputWrapper({block:b,size:k}),type:x,size:k,placeholder:y?.[n],value:h[n]??"",autoComplete:"one-time-code",ref:l=>{o.current[n]=l},onChange:(l,r)=>j(n,l,r),onFocus:l=>E(n,l),onKeyDown:l=>O(n,l),...S}),n<s-1&&(Q(d)?d(n):d)]},n))})});I.displayName="Input.OTP";export{I as default};
|
package/dist/input/Prefix.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{cnMerge as f}from"@nild/shared";import{forwardRef as n,isValidElement as p}from"react";import{useInputContext as l}from"./contexts/index.js";import
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{cnMerge as f}from"@nild/shared";import{forwardRef as n,isValidElement as p}from"react";import{useInputContext as l}from"./contexts/index.js";import c from"./style/index.js";const d=e=>p(e)&&e.type===s,s=n((e,r)=>{const{size:a}=l(),{className:i,children:t,...m}=e;return o("span",{...m,className:f(c.prefix({size:a}),i),ref:r,children:t})});s.displayName="Input.Prefix";export{s as default,d as isPrefixElement};
|
package/dist/input/Prepend.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as d}from"react/jsx-runtime";import{isString as c,cnMerge as t}from"@nild/shared";import{isValidElement as o,Children as u,cloneElement as f}from"react";import{useCompositeContext as v}from"./contexts/index.js";import
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import{isString as c,cnMerge as t}from"@nild/shared";import{isValidElement as o,Children as u,cloneElement as f}from"react";import{useCompositeContext as v}from"./contexts/index.js";import p from"./style/index.js";const y=e=>o(e)&&e.type===i,i=({children:e})=>{var n;const{size:a,variant:r,disabled:l}=v();if(c(e))return d("span",{className:t(p.prepend({type:"string",size:a,variant:r})),children:e});const s=u.toArray(e).find(m=>o(m));return f(s,{...s?.props,className:t(p.prepend({type:"element",size:a,variant:r}),(n=s?.props)==null?void 0:n.className),size:a,disabled:l})};i.displayName="Input.Prepend";export{i as default,y as isPrependElement};
|
package/dist/input/Search.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{useControllableState as c}from"@nild/hooks";import{Icon as d}from"@nild/icons";import h from"@nild/icons/Search";import{forwardRef as S}from"react";import g from"./Input.js";import w from"./Prefix.js";import
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useControllableState as c}from"@nild/hooks";import{Icon as d}from"@nild/icons";import h from"@nild/icons/Search";import{forwardRef as S}from"react";import g from"./Input.js";import w from"./Prefix.js";import y from"./style/index.js";const a=S(({value:t,defaultValue:m="",keyword:n,defaultKeyword:f,onChange:r,...l},s)=>{const[i,p]=c(n??t,f??m);return o(g,{ref:s,value:i,onChange:(e,u)=>{p(String(e)),r?.(String(e),u)},...l,children:o(w,{children:o(d,{component:h,className:y.searchIcon()})})})});a.displayName="Input.Search";export{a as default};
|
package/dist/input/Suffix.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{cnMerge as o}from"@nild/shared";import{forwardRef as n,isValidElement as p}from"react";import{useInputContext as l}from"./contexts/index.js";import u from"./style/index.js";const c=s=>p(s)&&s.type===e,e=n((s,a)=>{const{size:r}=l(),{className:t,children:i,...f}=s;return m("span",{...f,className:o(u.suffix({size:r}),t),ref:a,children:i})});e.displayName="Input.Suffix";export{e as default,c as isSuffixElement};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { InputProps, OTPProps } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
2
|
+
declare const _default: {
|
|
3
|
+
composite: (props?: {
|
|
4
|
+
block?: boolean;
|
|
5
|
+
} | undefined) => string;
|
|
6
|
+
compositedInputWrapper: (props?: (Pick<InputProps, "variant"> & {
|
|
7
|
+
prepended?: boolean;
|
|
8
|
+
appended?: boolean;
|
|
9
|
+
}) | undefined) => string;
|
|
10
|
+
inputWrapper: (props?: InputProps | undefined) => string;
|
|
11
|
+
input: (props?: InputProps | undefined) => string;
|
|
12
|
+
prefix: (props?: InputProps | undefined) => string;
|
|
13
|
+
suffix: (props?: InputProps | undefined) => string;
|
|
14
|
+
prepend: (props?: (Pick<InputProps, "variant" | "size"> & {
|
|
15
|
+
type: "string" | "element";
|
|
16
|
+
}) | undefined) => string;
|
|
17
|
+
append: (props?: (Pick<InputProps, "variant" | "size"> & {
|
|
18
|
+
type: "string" | "element";
|
|
19
|
+
}) | undefined) => string;
|
|
20
|
+
searchIcon: (props?: InputProps | undefined) => string;
|
|
21
|
+
otpWrapper: (props?: Pick<OTPProps, "block"> | undefined) => string;
|
|
22
|
+
otpInputWrapper: (props?: Pick<InputProps, "size" | "block"> | undefined) => string;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as e}from"@nild/shared";import{DISABLED_CLS as t}from"../../_shared/style/index.js";const
|
|
1
|
+
import{cva as e}from"@nild/shared";import{DISABLED_CLS as t}from"../../_shared/style/index.js";const n=e(["nd-input-composite","inline-flex","items-stretch"],{variants:{block:{true:["flex","w-full"],false:""}}}),r=e(["flex-auto"],{variants:{prepended:{true:["rounded-l-none"],false:""},appended:{true:["rounded-r-none"],false:""}},compoundVariants:[{variant:"outlined",appended:!0,className:["mr-[-1px]","hover:z-1","focus-within:z-1"]}]}),a=e(["nd-input-wrapper","group",["inline-flex","items-center","box-border","font-nd","transition-colors","overflow-hidden"],["border","enabled:focus-within:border-brand"],t],{variants:{variant:{outlined:["bg-transparent","border-main","enabled:hover:border-brand-hover"],filled:["bg-muted","border-subtle","enabled:[&:hover:not(:focus-within)]:bg-muted-hover","enabled:[&:hover:not(:focus-within)]:border-muted"]},size:{small:["h-6","text-sm","rounded-sm"],medium:["h-8","text-md","rounded-md"],large:["h-10","text-lg","rounded-md"]},block:{true:["flex","w-full"],false:""},disabled:{true:"disabled",false:""}}}),i=e(["nd-input","flex-auto","h-full","bg-transparent","border-none","outline-none","p-0","m-0","text-main","placeholder:text-subtle","disabled:cursor-not-allowed","[&::-ms-reveal]:hidden","[&::-ms-clear]:hidden","[&::-webkit-inner-spin-button]:appearance-none","[&::-webkit-outer-spin-button]:appearance-none","[&::-webkit-inner-spin-button]:m-0","[&::-webkit-outer-spin-button]:m-0","[-moz-appearance:textfield]"],{variants:{size:{small:["px-2","text-sm"],medium:["px-3","text-md"],large:["px-4","text-lg"]}}}),s=e(["nd-input-prefix","shrink-0","h-full","inline-flex","items-center","text-muted"],{variants:{size:{small:["pl-2","text-sm"],medium:["pl-3","text-md"],large:["pl-4","text-lg"]}}}),l=e(["nd-input-suffix","shrink-0","h-full","inline-flex","items-center","text-muted"],{variants:{size:{small:["pr-2","text-sm"],medium:["pr-3","text-md"],large:["pr-4","text-lg"]}}}),d=e(["shrink-0"],{variants:{variant:{outlined:["mr-[-1px]","hover:z-1","focus:z-1","focus-within:z-1"],filled:[]},type:{string:["inline-flex","items-center","border"],element:["rounded-r-none"]},size:{small:["h-6","text-sm","rounded-l-sm"],medium:["h-8","text-md","rounded-l-md"],large:["h-10","text-lg","rounded-l-md"]}},compoundVariants:[{type:"string",variant:"outlined",className:["bg-muted","border-main","text-muted"]},{type:"string",variant:"filled",className:["bg-brand","border-transparent","text-brand-contrast"]},{type:"string",size:"small",className:["px-2"]},{type:"string",size:"medium",className:["px-3"]},{type:"string",size:"large",className:["px-4"]}]}),o=e(["shrink-0"],{variants:{type:{string:["inline-flex","items-center","border"],element:["rounded-l-none","h-auto"]},size:{small:["h-6","text-sm","rounded-r-sm"],medium:["h-8","text-md","rounded-r-md"],large:["h-10","text-lg","rounded-r-md"]}},compoundVariants:[{type:"string",variant:"outlined",className:["bg-muted","border-main","text-muted"]},{type:"string",variant:"filled",className:["bg-brand","border-transparent","text-brand-contrast"]},{type:"string",size:"small",className:["px-2"]},{type:"string",size:"medium",className:["px-3"]},{type:"string",size:"large",className:["px-4"]}]}),m=e(["group-focus-within:text-brand"]),p=e(["gap-2","items-center"],{variants:{block:{true:["flex","w-full"],false:["inline-flex"]}}}),u=e(["flex-auto","min-w-0","text-center"],{compoundVariants:[{size:"small",block:!1,className:["w-6"]},{size:"medium",block:!1,className:["w-8"]},{size:"large",block:!1,className:["w-10"]}]}),x={composite:n,compositedInputWrapper:r,inputWrapper:a,input:i,prefix:s,suffix:l,prepend:d,append:o,searchIcon:m,otpWrapper:p,otpInputWrapper:u};export{x as default};
|
package/dist/popup/Arrow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{usePopupContext as p,useArrowContext as m}from"./contexts/index.js";import f from"./style/index.js";const r=()=>{const{size:e,arrowed:o,inverse:s,refs:t}=p(),{style:a,orientation:i}=m();return n("div",{className:f.arrow({size:e,arrowed:o,inverse:s,orientation:i}),style:a,ref:t.arrow})};r.displayName="Popup.Arrow";export{r as default};
|
package/dist/popup/Popup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as J,jsx as i}from"react/jsx-runtime";import{useControllableState as K,useEffectCallback as f,useIsomorphicLayoutEffect as M}from"@nild/hooks";import{isArray as Q,makeArray as W,isFunction as X}from"@nild/shared";import{Children as Y,isValidElement as Z,useState as _,useMemo as P,useRef as $}from"react";import G from"../transition/Transition.js";import{PopupProvider as ee,PortalProvider as re,ArrowProvider as te}from"./contexts/index.js";import ae from"./hooks/usePopup.js";import oe from"./Portal.js";import x from"./Trigger.js";const A=({children:E,placement:O,offset:R,action:p="click",size:d="medium",arrowed:h=!0,inverse:v=!1,delay:t=100,open:S,defaultOpen:w=!1,disabled:g,onOpen:b,onClose:k})=>{let n,y,l;Y.forEach(E,e=>{if(Z(e))switch(e.type){case x:y=e;break;case oe:l=e;break;default:n=e;break}});const[a,j]=_(w),[o,z]=K(S,w),[T,F=100]=Q(t)?t:[t,t],s=P(()=>new Set(W(p)),[p]),r=$(),[{triggerRef:u,portalRef:c,portalContext:I,arrowRef:L,arrowContext:N},{update:U,autoUpdate:V}]=ae({placement:O,offset:R}),m=f(e=>{g||z(H=>{const C=X(e)?e(H):e;return C?b?.():k?.(),C})}),q=f(()=>{s.has("hover")&&(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{m(!0)},T))}),B=f(()=>{s.has("hover")&&(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{m(!1)},F))}),D=P(()=>({actions:s,size:d,arrowed:h,inverse:v,refs:{trigger:u,portal:c,arrow:L},setOpen:m,enter:q,leave:B}),[s,d,h,v]);return M(()=>{if(o&&!a)j(!0);else if(o&&a&&u.current&&c.current)return V(u.current,c.current,U)},[o,a]),J(ee,{value:D,children:[y||n&&i(x,{children:n}),i(re,{value:I,children:i(te,{value:N,children:l&&i(G,{visible:o,children:a&&l})})})]})};A.displayName="Popup";export{A as default};
|
package/dist/popup/Portal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as P,jsx as
|
|
1
|
+
import{jsxs as P,jsx as g}from"react/jsx-runtime";import{useEffectCallback as t}from"@nild/hooks";import{mergeRefs as h,cnMerge as n,getDPR as R}from"@nild/shared";import{forwardRef as b,Children as j,isValidElement as w,cloneElement as z}from"react";import{createPortal as L}from"react-dom";import $ from"./Arrow.js";import{usePopupContext as k,usePortalContext as A}from"./contexts/index.js";import m from"./style/index.js";const i=b(({className:p,style:f,children:u,container:c=document.body,...o},d)=>{var s;const{size:v,inverse:x,refs:y,enter:C,leave:E}=k(),{coords:l}=A(),e=j.toArray(u).find(r=>w(r)),M=t(r=>{var a;(a=o?.onMouseEnter)==null||a.call(o,r),C()}),N=t(r=>{var a;(a=o?.onMouseLeave)==null||a.call(o,r),E()});return e?L(P("div",{...o,className:n(m.portal(),p),style:{transform:`translate(${l.x}px, ${l.y}px)`,...R()>=1.5&&{willChange:"transform"},...f},onMouseEnter:M,onMouseLeave:N,ref:h(y.portal,d),children:[z(e,{...e.props,className:n(m.portalContent({size:v,inverse:x}),(s=e?.props)==null?void 0:s.className)}),g($,{})]}),c):null});i.displayName="Popup.Portal";export{i as default};
|
package/dist/popup/Trigger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffectCallback as u,useEventListener as m}from"@nild/hooks";import{mergeRefs as N,cnJoin as w}from"@nild/shared";import{Children as y,isValidElement as B,cloneElement as F}from"react";import{usePopupContext as P}from"./contexts/index.js";import
|
|
1
|
+
import{useEffectCallback as u,useEventListener as m}from"@nild/hooks";import{mergeRefs as N,cnJoin as w}from"@nild/shared";import{Children as y,isValidElement as B,cloneElement as F}from"react";import{usePopupContext as P}from"./contexts/index.js";import b from"./style/index.js";const f=({children:g})=>{var p,v;const{actions:r,refs:a,setOpen:s,enter:h,leave:x}=P(),o=y.toArray(g).find(e=>B(e)),d=r.has("click")||r.has("contextMenu")?window:null,E=u(e=>{var l,n;(n=(l=o?.props)==null?void 0:l.onMouseEnter)==null||n.call(l,e),h()}),M=u(e=>{var l,n;(n=(l=o?.props)==null?void 0:l.onMouseLeave)==null||n.call(l,e),x()}),k=u(e=>{var l,n;(n=(l=o?.props)==null?void 0:l.onFocus)==null||n.call(l,e),r.has("focus")&&s(!0)}),C=u(e=>{var l,n;(n=(l=o?.props)==null?void 0:l.onBlur)==null||n.call(l,e),r.has("focus")&&s(!1)});return m(d,"click",e=>{var l,n;const t=e.target,i=(l=a.trigger.current)==null?void 0:l.contains(t),c=(n=a.portal.current)==null?void 0:n.contains(t);i?(r.has("click")&&s(L=>!L),r.has("contextMenu")&&s(!1)):!c&&s(!1)}),m(d,"contextmenu",e=>{var l,n;const t=e.target,i=(l=a.trigger.current)==null?void 0:l.contains(t),c=(n=a.portal.current)==null?void 0:n.contains(t);i?r.has("contextMenu")&&(e.preventDefault(),s(!0)):!c&&s(!1)}),o?F(o,{...o?.props,className:w(b.trigger(),(p=o?.props)==null?void 0:p.className),onMouseEnter:E,onMouseLeave:M,onFocus:k,onBlur:C,ref:N(a.trigger,(v=o?.props)==null?void 0:v.ref)}):null};f.displayName="Popup.Trigger";export{f as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, Dispatch, RefObject, SetStateAction } from 'react';
|
|
2
2
|
import { ArrowOrientation, PopupProps, TriggerAction } from '../interfaces';
|
|
3
3
|
import { Coords } from '@floating-ui/dom';
|
|
4
|
-
export interface PopupContextValue extends Pick<PopupProps, 'size' | 'arrowed' | 'inverse'
|
|
4
|
+
export interface PopupContextValue extends Pick<PopupProps, 'size' | 'arrowed' | 'inverse'> {
|
|
5
5
|
actions: Set<TriggerAction>;
|
|
6
6
|
refs: {
|
|
7
7
|
trigger: RefObject<Element>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ArrowOrientation, PopupProps, PortalProps } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
trigger: (props?: object | undefined) => string;
|
|
4
|
+
portal: (props?: PortalProps | undefined) => string;
|
|
5
|
+
portalContent: (props?: Pick<PopupProps, "size" | "inverse"> | undefined) => string;
|
|
6
|
+
arrow: (props?: (Pick<PopupProps, "size" | "arrowed" | "inverse"> & {
|
|
7
|
+
orientation: ArrowOrientation;
|
|
8
|
+
}) | undefined) => string;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as
|
|
1
|
+
import{cva as r}from"@nild/shared";const e=r(["nd-popup-trigger"]),a=r(["nd-popup-portal",["absolute","top-0","left-0"]]),t=r(["rounded-md","shadow-lg"],{variants:{size:{small:["px-2","py-1"],medium:["px-4","py-3"],large:["px-6","py-5"]},inverse:{true:["bg-page-inverse","text-main-inverse"],false:["bg-panel","text-main"]}}}),o=r(["nd-popup-arrow","absolute"],{variants:{size:{small:["w-1.5","h-1.5"],medium:["w-3","h-3"],large:["w-4.5","h-4.5"]},arrowed:{true:"",false:["opacity-0","invisible"]},inverse:{true:["bg-page-inverse"],false:["bg-panel"]},orientation:{up:["transform-[translateY(-50%)_rotate(45deg)]","rounded-tl-sm"],down:["transform-[translateY(50%)_rotate(45deg)]","rounded-br-sm"],left:["transform-[translateX(-50%)_rotate(45deg)]","rounded-bl-sm"],right:["transform-[translateX(50%)_rotate(45deg)]","rounded-tr-sm"]}},compoundVariants:[{orientation:"up",className:["shadow-[-1px_-1px_0_0_var(--border-color-subtle)]"]},{orientation:"down",className:["shadow-[1px_1px_0_0_var(--border-color-subtle)]"]},{orientation:"left",className:["shadow-[-1px_1px_0_0_var(--border-color-subtle)]"]},{orientation:"right",className:["shadow-[1px_-1px_0_0_var(--border-color-subtle)]"]}]}),s={trigger:e,portal:a,portalContent:t,arrow:o};export{s as default};
|
package/dist/radio/Group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{useControllableState as b,useEffectCallback as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{useControllableState as b,useEffectCallback as G}from"@nild/hooks";import{forwardRefWithGenerics as N,cnMerge as g}from"@nild/shared";import{GroupProvider as x}from"./contexts/index.js";import z from"./style/index.js";const o=N(({className:i,children:l,direction:s="horizontal",variant:t="solid",size:d="medium",disabled:n=!1,value:m,defaultValue:u,onChange:e,...c},f)=>{const[p,v]=b(m,u),h=G(a=>{v(()=>(e?.(a),a))});return r(x,{value:{variant:t,size:d,disabled:n,value:p,setValue:h},children:r("div",{...c,className:g(z.group({direction:s}),i),ref:f,children:l})})});o.displayName="Radio.Group";export{o as default};
|
package/dist/radio/Indicator.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as s,jsx as a}from"react/jsx-runtime";import{cnMerge as o}from"@nild/shared";import{forwardRef as u}from"react";import{useRadioContext as x}from"./contexts/index.js";import e from"./style/index.js";const t=u(({className:n,children:d,...l},m)=>{const{variant:r,size:f,checked:c,setChecked:p}=x(),h=d??(i=>s("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a("circle",{cx:"10",cy:"10",className:o(e.defaultIndicatorOuterCircle({variant:r,checked:i}))}),a("circle",{cx:"10",cy:"10",className:e.defaultIndicatorInnerCircle({variant:r,checked:i})})]}));return s("div",{...l,className:o(e.indicator({size:f}),n),ref:m,children:[h(!!c),a("input",{type:"radio",className:e.indicatorInput(),checked:c,onChange:p})]})});t.displayName="Radio.Indicator";export{t as default};
|
package/dist/radio/Label.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as c}from"react/jsx-runtime";import{isFunction as
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";import{isFunction as n,cnMerge as f}from"@nild/shared";import{forwardRef as l}from"react";import{useRadioContext as d}from"./contexts/index.js";import p from"./style/index.js";const a=l(({className:r,children:e,...s},o)=>{const{size:i,checked:m}=d(),t=n(e)?e(!!m):e;return c("span",{...s,className:f(p.label({size:i}),r),ref:o,children:t})});a.displayName="Radio.Label";export{a as default};
|
package/dist/radio/Radio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{useControllableState as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{useControllableState as N,useEffectCallback as R}from"@nild/hooks";import{isString as g,cnMerge as w}from"@nild/shared";import{forwardRef as x,Children as M,isValidElement as S,cloneElement as V}from"react";import{useGroupContext as j,RadioProvider as G}from"./contexts/index.js";import i from"./Indicator.js";import l from"./Label.js";import P from"./style/index.js";const c=x((p,u)=>{const t=[],s=new Map,a=j(),{className:f,children:h,variant:v=a?.variant??"solid",size:o=a?.size??"medium",disabled:d=a?.disabled??!1,checked:C,defaultChecked:b,value:n,onChange:m,...k}=p,[y,z]=N(a?a.value===n:C,b??!1),E=R(()=>{d||z(e=>e||(a?a.setValue(n):m?.(!e),!e))});return M.forEach(h,e=>{S(e)?e.type===i?(s.delete(i),s.set(i,e)):e.type===l&&(s.delete(l),s.set(l,e)):g(e)&&(s.has(l)||s.set(l,r(l,{children:e})))}),t.push(...s.values()),s.has(i)||t.unshift(r(i,{})),r(G,{value:{variant:v,size:o,checked:y,setChecked:E},children:r("label",{...k,className:w(P.radio({size:o,disabled:d}),f),ref:u,children:t.map(e=>V(e,{key:e.type.displayName,...e.props}))})})});c.displayName="Radio";export{c as default};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { RadioProps, GroupProps } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
radio: (props?: Pick<RadioProps, "size" | "disabled"> | undefined) => string;
|
|
4
|
+
indicator: (props?: Pick<RadioProps, "size"> | undefined) => string;
|
|
5
|
+
indicatorInput: (props?: object | undefined) => string;
|
|
6
|
+
defaultIndicatorOuterCircle: (props?: Pick<RadioProps, "variant" | "checked"> | undefined) => string;
|
|
7
|
+
defaultIndicatorInnerCircle: (props?: Pick<RadioProps, "variant" | "checked"> | undefined) => string;
|
|
8
|
+
label: (props?: Pick<RadioProps, "size"> | undefined) => string;
|
|
9
|
+
group: (props?: Pick<GroupProps<unknown>, "direction"> | undefined) => string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as
|
|
1
|
+
import{cva as e}from"@nild/shared";import{DISABLED_CLS as a}from"../../_shared/style/index.js";const r=e(["nd-radio","group",["flex","items-center"],"cursor-pointer",a],{variants:{size:{small:"gap-1.5",medium:"gap-2",large:"gap-2.5"},disabled:{true:"disabled",false:""}}}),t=e(["relative",["flex","items-center","justify-center"]],{variants:{size:{small:"size-3.5 text-sm",medium:"size-4 text-md",large:"size-4.5 text-lg"}}}),l=e([["absolute","inset-0","opacity-0"],["group-enabled:cursor-pointer","group-disabled:cursor-not-allowed"]]),i=e(["stroke-1","r-9","transition-[stroke,fill]","group-enabled:group-hover:stroke-brand-hover"],{compoundVariants:[{checked:!0,variant:"solid",className:["fill-brand stroke-brand","group-enabled:group-hover:fill-brand-hover"]},{checked:!0,variant:"outlined",className:["fill-transparent stroke-brand"]},{checked:!1,className:["fill-transparent stroke-main"]}]}),o=e(["transition-[fill]"],{variants:{variant:{solid:"r-4.5",outlined:"r-5.5"}},compoundVariants:[{checked:!0,variant:"solid",className:["fill-brand-contrast"]},{checked:!0,variant:"outlined",className:["fill-brand","group-enabled:group-hover:fill-brand-hover"]},{checked:!1,className:["fill-transparent"]}]}),s=e(["text-sm"],{variants:{size:{small:"text-sm",medium:"text-md",large:"text-lg"}}}),n=e(["nd-radio-group",["flex","gap-x-4","gap-y-2"]],{variants:{direction:{horizontal:"flex-row flex-wrap",vertical:"flex-col"}}}),d={radio:r,indicator:t,indicatorInput:l,defaultIndicatorOuterCircle:i,defaultIndicatorInnerCircle:o,label:s,group:n};export{d as default};
|
package/dist/switch/Switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a,jsxs as j}from"react/jsx-runtime";import{useControllableState as E}from"@nild/hooks";import{cnMerge as V}from"@nild/shared";import{forwardRef as z,Children as M,isValidElement as P}from"react";import{SwitchProvider as R}from"./contexts/index.js";import
|
|
1
|
+
import{jsx as a,jsxs as j}from"react/jsx-runtime";import{useControllableState as E}from"@nild/hooks";import{cnMerge as V}from"@nild/shared";import{forwardRef as z,Children as M,isValidElement as P}from"react";import{SwitchProvider as R}from"./contexts/index.js";import q from"./style/index.js";import h from"./Thumb.js";import r from"./Track.js";const m=z(({className:p,children:f,variant:c="solid",size:s="medium",shape:i="round",checked:u,defaultChecked:k,value:v,defaultValue:y,disabled:g,onChange:l,style:w,...C},b)=>{let o,d,n;M.forEach(f,e=>{P(e)&&(e.type===r?e.props.type==="checked"?o=e:d=e:e.type===h&&(n=e))});const x={"--nd-switch-height":{small:"calc(var(--spacing) * 4)",medium:"calc(var(--spacing) * 6)",large:"calc(var(--spacing) * 8)"}[s]},[t,N]=E(u??v,k??y??!1),S=()=>{N(e=>(l?.(!e),!e))};return a(R,{value:{variant:c,shape:i,checked:t},children:j("button",{...C,type:"button",role:"switch","aria-checked":t,disabled:g,className:V(q.switch({variant:c,size:s,shape:i,checked:t}),p),style:{...x,...w},ref:b,onClick:S,children:[o||a(r,{type:"checked"}),d||a(r,{type:"unchecked"}),n||a(h,{})]})})});m.displayName="Switch";export{m as default};
|
package/dist/switch/Thumb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as c}from"react/jsx-runtime";import{cnMerge as h}from"@nild/shared";import{forwardRef as f}from"react";import{useSwitchContext as n}from"./contexts/index.js";import
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";import{cnMerge as h}from"@nild/shared";import{forwardRef as f}from"react";import{useSwitchContext as n}from"./contexts/index.js";import p from"./style/index.js";const a=f(({className:s,children:e,...m},o)=>{const{variant:t,shape:i,checked:r}=n();return c("div",{...m,className:h(p.thumb({variant:t,shape:i,checked:r}),s),ref:o,children:e?.(!!r)})});a.displayName="Switch.Thumb";export{a as default};
|
package/dist/switch/Track.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{cnMerge as f}from"@nild/shared";import{forwardRef as n}from"react";import{useSwitchContext as p}from"./contexts/index.js";import d from"./style/index.js";const r=n(({className:e,children:a,type:t,...c},o)=>{const{variant:s,checked:i}=p();return m("div",{...c,className:f(d.track({type:t,variant:s,checked:i}),e),ref:o,children:a})});r.displayName="Switch.Track";export{r as default};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { SwitchProps, TrackProps } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
switch: (props?: (SwitchProps & {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
}) | undefined) => string;
|
|
6
|
+
track: (props?: (Pick<SwitchProps, "variant" | "checked"> & Pick<TrackProps, "type">) | undefined) => string;
|
|
7
|
+
thumb: (props?: Pick<SwitchProps, "variant" | "shape" | "checked"> | undefined) => string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as e}from"@nild/shared";import{DISABLED_CLS as
|
|
1
|
+
import{cva as e}from"@nild/shared";import{DISABLED_CLS as t}from"../../_shared/style/index.js";const a=e(["nd-switch","group","h-[var(--nd-switch-height)]","transition-[outline-color]",["relative","inline-block","font-nd","overflow-hidden","cursor-pointer"],t],{variants:{variant:{solid:"",outlined:["outline-solid","outline"]},size:{small:["min-w-8","text-sm"],medium:["min-w-10","text-md"],large:["min-w-12","text-lg"]},shape:{round:"rounded-full",square:"rounded-md"}},compoundVariants:[{checked:!0,variant:"outlined",className:["outline-brand"]},{checked:!1,variant:"outlined",className:["outline-main","enabled:hover:outline-brand-hover"]}]}),n=e(["h-[var(--nd-switch-height)]","transition-[margin-inline,background-color]",["flex","justify-center","items-center"],["text-center","text-brand-contrast"]],{variants:{type:{checked:["ps-[calc(var(--nd-switch-height)/3)]","pe-[calc(var(--nd-switch-height)*1.1)]"],unchecked:["ps-[calc(var(--nd-switch-height)*1.1)]","pe-[calc(var(--nd-switch-height)/3)]","-mt-[var(--nd-switch-height)]"]}},compoundVariants:[{type:"checked",checked:!0,className:["ms-0","me-0"]},{type:"checked",checked:!1,className:["-ms-[100%]","me-[100%]"]},{type:"unchecked",checked:!0,className:["ms-[100%]","-me-[100%]"]},{type:"unchecked",checked:!1,className:["ms-0","me-0"]},{variant:"solid",checked:!0,className:["bg-brand","group-enabled:group-hover:bg-brand-hover"]},{variant:"solid",checked:!1,className:["bg-emphasized","group-enabled:group-hover:bg-emphasized-hover"]},{variant:"outlined",className:["bg-transparent"]}]}),r=e(["h-[var(--nd-switch-height)]",["flex","justify-center","items-center"],["absolute","aspect-square","scale-80"],["text-brand-contrast","transition-[left,background-color]"]],{variants:{variant:{solid:["bg-brand-contrast","top-0"],outlined:["bg-brand","top-0","group-enabled:group-hover:bg-brand-hover"]},shape:{round:"rounded-full",square:"rounded-md"},checked:{true:"left-[calc(100%-var(--nd-switch-height))]",false:"left-0"}}}),c={switch:a,track:n,thumb:r};export{c as default};
|
package/dist/tailwind.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@theme static{ --nd-brand-h: 158; --nd-brand-c: .14; --nd-neutral-c: .
|
|
1
|
+
@theme static{ --nd-brand-h: 158; --nd-brand-c: .14; --nd-neutral-c: .001; --nd-shadow-l: 15%; --nd-shadow-c: .008; --nd-color-brand-0: light-dark( oklch(99% var(--nd-brand-c) var(--nd-brand-h)), oklch(14% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-5: light-dark( oklch(97% var(--nd-brand-c) var(--nd-brand-h)), oklch(17% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-10: light-dark( oklch(94% var(--nd-brand-c) var(--nd-brand-h)), oklch(21% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-15: light-dark( oklch(90% var(--nd-brand-c) var(--nd-brand-h)), oklch(26% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-20: light-dark( oklch(85% var(--nd-brand-c) var(--nd-brand-h)), oklch(32% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-30: light-dark( oklch(76% var(--nd-brand-c) var(--nd-brand-h)), oklch(42% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-40: light-dark( oklch(67% var(--nd-brand-c) var(--nd-brand-h)), oklch(50% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-50: light-dark( oklch(58% var(--nd-brand-c) var(--nd-brand-h)), oklch(58% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-60: light-dark( oklch(50% var(--nd-brand-c) var(--nd-brand-h)), oklch(67% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-70: light-dark( oklch(42% var(--nd-brand-c) var(--nd-brand-h)), oklch(76% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-80: light-dark( oklch(35% var(--nd-brand-c) var(--nd-brand-h)), oklch(85% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-90: light-dark( oklch(25% var(--nd-brand-c) var(--nd-brand-h)), oklch(93% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-100: light-dark( oklch(15% var(--nd-brand-c) var(--nd-brand-h)), oklch(98% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-neutral-0: light-dark( oklch(99.5% var(--nd-neutral-c) var(--nd-brand-h)), oklch(14% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-5: light-dark( oklch(98% var(--nd-neutral-c) var(--nd-brand-h)), oklch(17% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-10: light-dark( oklch(96.5% var(--nd-neutral-c) var(--nd-brand-h)), oklch(21% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-15: light-dark( oklch(94% var(--nd-neutral-c) var(--nd-brand-h)), oklch(26% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-20: light-dark( oklch(91% var(--nd-neutral-c) var(--nd-brand-h)), oklch(32% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-30: light-dark( oklch(84% var(--nd-neutral-c) var(--nd-brand-h)), oklch(42% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-40: light-dark( oklch(73% var(--nd-neutral-c) var(--nd-brand-h)), oklch(50% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-50: light-dark( oklch(60% var(--nd-neutral-c) var(--nd-brand-h)), oklch(58% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-60: light-dark( oklch(50% var(--nd-neutral-c) var(--nd-brand-h)), oklch(67% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-70: light-dark( oklch(40% var(--nd-neutral-c) var(--nd-brand-h)), oklch(76% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-80: light-dark( oklch(30% var(--nd-neutral-c) var(--nd-brand-h)), oklch(85% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-90: light-dark( oklch(20% var(--nd-neutral-c) var(--nd-brand-h)), oklch(93% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-100: light-dark( oklch(15% var(--nd-neutral-c) var(--nd-brand-h)), oklch(98% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-shadow-key: light-dark( oklch(var(--nd-shadow-l) var(--nd-shadow-c) var(--nd-brand-h) / 16%), oklch(0% 0 0deg / 65%) ); --nd-color-shadow-ambient: light-dark( oklch(var(--nd-shadow-l) var(--nd-shadow-c) var(--nd-brand-h) / 4%), oklch(0% 0 0deg / 30%) ); --nd-font-family: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }@theme{ --color-brand: var(--nd-color-brand-60); --color-brand-hover: var(--nd-color-brand-50); --color-brand-active: var(--nd-color-brand-60); --color-brand-subtle: var(--nd-color-brand-15); --color-brand-subtle-hover: var(--nd-color-brand-20); --color-brand-subtle-active: var(--nd-color-brand-30); --color-brand-contrast: light-dark(var(--nd-color-neutral-0), var(--nd-color-neutral-100)); --border-color-main: var(--nd-color-neutral-20); --border-color-muted: var(--nd-color-neutral-15); --border-color-subtle: var(--nd-color-neutral-10); --outline-color-main: var(--border-color-main); --outline-color-muted: var(--border-color-muted); --outline-color-subtle: var(--border-color-subtle); --background-color-page: var(--nd-color-neutral-0); --background-color-page-inverse: var(--nd-color-neutral-100); --background-color-subtle: var(--nd-color-neutral-5); --background-color-subtle-hover: var(--nd-color-neutral-10); --background-color-muted: var(--nd-color-neutral-10); --background-color-muted-hover: var(--nd-color-neutral-15); --background-color-muted-active: var(--nd-color-neutral-20); --background-color-emphasized: var(--nd-color-neutral-20); --background-color-emphasized-hover: var(--nd-color-neutral-30); --background-color-panel: light-dark( var(--background-color-page), var(--background-color-muted) ); --text-color-main: var(--nd-color-neutral-100); --text-color-main-inverse: var(--nd-color-neutral-0); --text-color-muted: var(--nd-color-neutral-70); --text-color-subtle: var(--nd-color-neutral-50); --text-sm: .75rem; --text-sm--line-height: 1.25rem; --text-md: .875rem; --text-md--line-height: 1.375rem; --text-lg: 1rem; --text-lg--line-height: 1.5rem; --text-xl: 1.125rem; --text-xl--line-height: 1.625rem; --text-2xl: 1.25rem; --text-2xl--line-height: 1.75rem; --text-3xl: 1.5rem; --text-3xl--line-height: 2rem; --text-4xl: 1.875rem; --text-4xl--line-height: 2.375rem; --text-5xl: 2.375rem; --text-5xl--line-height: 2.875rem; --text-6xl: 2.875rem; --text-6xl--line-height: 3.375rem; --radius-sm: .125rem; --radius-md: .25rem; --radius-lg: .375rem; --shadow-sm: 0 0 0 1px var(--border-color-subtle), 0 1px 2px 0 var(--nd-color-shadow-key); --shadow-md: 0 0 0 1px var(--border-color-subtle), 0 3px 6px -1px var(--nd-color-shadow-key), 0 1px 3px -1px var(--nd-color-shadow-ambient); --shadow-lg: 0 0 0 1px var(--border-color-subtle), 0 8px 16px -2px var(--nd-color-shadow-key), 0 3px 6px -2px var(--nd-color-shadow-ambient); --shadow-xl: 0 0 0 1px var(--border-color-subtle), 0 16px 24px -4px var(--nd-color-shadow-key), 0 6px 12px -4px var(--nd-color-shadow-ambient); --shadow-2xl: 0 0 0 1px var(--border-color-subtle), 0 24px 36px -6px var(--nd-color-shadow-key), 0 10px 16px -6px var(--nd-color-shadow-ambient); --font-nd: var(--nd-font-family); --default-transition-duration: .2s; }@utility stroke-main{stroke: var(--border-color-main);}@utility stroke-muted{stroke: var(--border-color-muted);}@utility stroke-subtle{stroke: var(--border-color-subtle);}@utility underline{text-decoration: underline; text-underline-offset: .125rem;}@utility r-*{r: --value(number);}@custom-variant disabled{&.disabled,&:disabled {@slot;}}@custom-variant enabled{&:not(.disabled,:disabled) {@slot;}}
|
package/dist/tooltip/Tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import a from"../popup/index.js";const o=e=>t(a,{size:"small",placement:"top",...e,inverse:!0,action:"hover"});o.displayName="Tooltip";export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffectCallback as
|
|
1
|
+
import{useEffectCallback as N}from"@nild/hooks";import{cnMerge as R}from"@nild/shared";import{Children as X,isValidElement as M,useState as O,useRef as m,useEffect as D,cloneElement as b}from"react";import{Status as r}from"./interfaces/index.js";import G from"./style/index.js";const I=({className:U,children:f,visible:i=!0})=>{const s=X.toArray(f).find(o=>M(o)),a=s?i?r.ENTERED:r.EXITED:r.UNMOUNTED,[t,E]=O(a),e=m(),n=m(s);n.current=t===r.UNMOUNTED?s:s??n.current;const c=N(o=>{u();let T=!0;const l=()=>{T&&(T=!1,e.current=void 0,o?.())};l.cancel=()=>{T=!1},e.current=l}),d=N(()=>{e.current&&(e.current(),e.current=void 0)}),u=N(()=>{e.current&&(e.current.cancel(),e.current=void 0)}),p=N(()=>{a===r.UNMOUNTED&&t===r.EXITED&&E(r.UNMOUNTED)});return D(()=>{d()},[t]),D(()=>{switch(a){case r.ENTERED:t!==r.ENTERING&&t!==r.ENTERED&&(t===r.UNMOUNTED?E(r.EXITED):(u(),E(r.ENTERING),c(()=>{c(()=>{E(r.ENTERED)}),e.current&&setTimeout(e.current,0)})));break;case r.EXITED:(t===r.ENTERING||t===r.ENTERED)&&(u(),E(r.EXITING),c(()=>{c(()=>{E(r.EXITED)}),e.current&&setTimeout(e.current,0)}));break;case r.UNMOUNTED:default:t!==r.EXITED&&t!==r.UNMOUNTED&&(u(),E(r.EXITING),c(()=>{c(()=>{E(r.EXITED)}),e.current&&setTimeout(e.current,0)}));break}},[i,a,t]),n.current?b(n.current,{...n.current.props,className:R(n.current.props.className,G.transition({status:t}),U),onTransitionEnd:p}):null};I.displayName="Transition";export{I as default};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Status } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
transition: (props?: {
|
|
4
|
+
status: Status;
|
|
5
|
+
} | undefined) => string;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as a}from"@nild/shared";import{Status as
|
|
1
|
+
import{cva as a}from"@nild/shared";import{Status as t}from"../interfaces/index.js";const i=a(["transition-[opacity,visibility]"],{compoundVariants:[{status:t.ENTERED,className:["opacity-100","visible"]},{status:[t.UNMOUNTED,t.ENTERING,t.EXITING,t.EXITED],className:["opacity-0","invisible"]}]}),s={transition:i};export{s as default};
|
package/dist/typography/Link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as m}from"react/jsx-runtime";import{cnMerge as n}from"@nild/shared";import{forwardRef as f}from"react";import
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{cnMerge as n}from"@nild/shared";import{forwardRef as f}from"react";import p from"./style/index.js";const r=f(({className:a,children:i,underlined:d=!1,disabled:e=!1,href:o="#",...s},l)=>m("a",{...s,href:e?void 0:o,className:n(p.link({underlined:d,disabled:e}),a),ref:l,children:i}));r.displayName="Typography.Link";export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as p}from"react/jsx-runtime";import{cnMerge as s}from"@nild/shared";import{forwardRef as f}from"react";import t from"./style/index.js";const r=f(({className:a,children:e,...m},o)=>p("p",{...m,className:s(t.paragraph(),a),ref:o,children:e}));r.displayName="Typography.Paragraph";export{r as default};
|
package/dist/typography/Text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{cnMerge as f}from"@nild/shared";import{forwardRef as x}from"react";import r from"./style/index.js";const s=x(({className:t,children:o,tags:d=[],secondary:c=!1,disabled:m=!1,...i},n)=>{const l=[...new Set(d)].reduce((p,e)=>a(e,{className:r.textTag({tag:e}),children:p}),o);return a("span",{...i,className:f(r.text({secondary:c,disabled:m}),t),ref:n,children:l})});s.displayName="Typography.Text";export{s as default};
|
package/dist/typography/Title.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{cnMerge as i}from"@nild/shared";import{forwardRef as f}from"react";import
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{cnMerge as i}from"@nild/shared";import{forwardRef as f}from"react";import p from"./style/index.js";const r=f(({className:a,children:o,level:e=1,...s},l)=>{const m=`h${e}`;return t(m,{...s,className:i(p.title({level:e}),a),ref:l,children:o})});r.displayName="Typography.Title";export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{cnMerge as p}from"@nild/shared";import{forwardRef as t}from"react";import f from"./style/index.js";const r=t(({className:a,children:e,...o},m)=>s("article",{...o,className:p(f.typography(),a),ref:m,children:e}));r.displayName="Typography";export{r as default};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { LinkProps, ParagraphProps, TextProps, TextTag, TitleProps, TypographyProps } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
link: (props?: LinkProps | undefined) => string;
|
|
4
|
+
paragraph: (props?: ParagraphProps | undefined) => string;
|
|
5
|
+
text: (props?: TextProps | undefined) => string;
|
|
6
|
+
textTag: (props?: {
|
|
7
|
+
tag: TextTag;
|
|
8
|
+
} | undefined) => string;
|
|
9
|
+
title: (props?: TitleProps | undefined) => string;
|
|
10
|
+
typography: (props?: TypographyProps | undefined) => string;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as
|
|
1
|
+
import{cva as t}from"@nild/shared";import{DISABLED_CLS as e}from"../../_shared/style/index.js";const n=t(["nd-link",["font-nd","text-brand","text-[length:inherit]","cursor-pointer","enabled:hover:text-brand-hover","enabled:active:text-brand-active"],e],{variants:{disabled:{true:"disabled",false:""},underlined:{true:"underline",false:"no-underline"}}}),r=t(["nd-paragraph",["font-nd","text-main","text-[length:inherit]"],["mt-0","mb-[1em]"]]),d=t(["nd-text",["font-nd","text-[length:inherit]"],e],{variants:{secondary:{true:"text-muted",false:"text-main"},disabled:{true:"disabled",false:""}}}),a=t("",{variants:{tag:{strong:"",del:"",u:["underline"],i:"",mark:["bg-brand","text-brand-contrast"],code:[["ps-1.5","pe-1.5"],["bg-brand-subtle","text-sm","rounded-sm"],["border","border-brand-subtle"]],kbd:[["ps-1.5","pe-1.5"],["text-sm","rounded-sm"],["border","border-b-2","border-brand-subtle"]]}}}),l=t(["nd-title",["font-nd","font-semibold","text-main"],["mt-[1em]","mb-[0.5em]"]],{variants:{level:{1:["text-6xl"],2:["text-5xl"],3:["text-4xl"],4:["text-3xl"],5:["text-2xl"],6:["text-lg"]}}}),i=t(["nd-typography",["font-nd","text-md"]]),o={link:n,paragraph:r,text:d,textTag:a,title:l,typography:i};export{o as default};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nild/components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.36",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^18.2.0",
|
|
33
33
|
"react-dom": "^18.2.0",
|
|
34
|
-
"@nild/shared": "0.0.
|
|
35
|
-
"@nild/hooks": "0.0.
|
|
36
|
-
"@nild/icons": "0.0.
|
|
34
|
+
"@nild/shared": "0.0.15",
|
|
35
|
+
"@nild/hooks": "0.0.17",
|
|
36
|
+
"@nild/icons": "0.0.17"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "vite build --mode PROD",
|