@nild/components 0.0.35 → 0.0.37

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.
Files changed (51) hide show
  1. package/dist/button/Button.js +1 -1
  2. package/dist/button/Group.js +1 -1
  3. package/dist/button/style/index.d.ts +9 -6
  4. package/dist/button/style/index.js +1 -1
  5. package/dist/checkbox/Checkbox.js +1 -1
  6. package/dist/checkbox/Group.js +1 -1
  7. package/dist/checkbox/Indicator.js +1 -1
  8. package/dist/checkbox/Label.js +1 -1
  9. package/dist/checkbox/style/index.d.ts +10 -7
  10. package/dist/checkbox/style/index.js +1 -1
  11. package/dist/divider/Divider.js +1 -1
  12. package/dist/divider/style/index.d.ts +6 -3
  13. package/dist/divider/style/index.js +1 -1
  14. package/dist/input/Append.js +1 -1
  15. package/dist/input/Composite.js +1 -1
  16. package/dist/input/Input.js +1 -1
  17. package/dist/input/OTP.js +1 -1
  18. package/dist/input/Prefix.js +1 -1
  19. package/dist/input/Prepend.js +1 -1
  20. package/dist/input/Search.js +1 -1
  21. package/dist/input/Suffix.js +1 -1
  22. package/dist/input/style/index.d.ts +23 -23
  23. package/dist/input/style/index.js +1 -1
  24. package/dist/popup/Arrow.js +1 -1
  25. package/dist/popup/Portal.js +1 -1
  26. package/dist/popup/Trigger.js +1 -1
  27. package/dist/popup/style/index.d.ts +9 -6
  28. package/dist/popup/style/index.js +1 -1
  29. package/dist/radio/Group.js +1 -1
  30. package/dist/radio/Indicator.js +1 -1
  31. package/dist/radio/Label.js +1 -1
  32. package/dist/radio/Radio.js +1 -1
  33. package/dist/radio/style/index.d.ts +10 -7
  34. package/dist/radio/style/index.js +1 -1
  35. package/dist/switch/Switch.js +1 -1
  36. package/dist/switch/Thumb.js +1 -1
  37. package/dist/switch/Track.js +1 -1
  38. package/dist/switch/style/index.d.ts +8 -5
  39. package/dist/switch/style/index.js +1 -1
  40. package/dist/tailwind.css +1 -1
  41. package/dist/transition/Transition.js +1 -1
  42. package/dist/transition/style/index.d.ts +6 -3
  43. package/dist/transition/style/index.js +1 -1
  44. package/dist/typography/Link.js +1 -1
  45. package/dist/typography/Paragraph.js +1 -1
  46. package/dist/typography/Text.js +1 -1
  47. package/dist/typography/Title.js +1 -1
  48. package/dist/typography/Typography.js +1 -1
  49. package/dist/typography/style/index.d.ts +11 -8
  50. package/dist/typography/style/index.js +1 -1
  51. package/package.json +4 -4
@@ -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 N}from"./contexts/index.js";import{buttonClassNames as h}from"./style/index.js";const x=a=>q(a)&&a.type===s,s=f((a,r)=>{const e=N(),{className:o,children:i,variant:l=e.variant,size:n=e.size,shape:m="square",equal:d=e.equal,disabled:t=e.disabled,block:u,...p}=a;return b("button",{type:"button",...p,disabled:t,className:c(h({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};
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};
@@ -1 +1 @@
1
- import{jsxs as f,jsx as h}from"react/jsx-runtime";import{isEmpty as g,cnMerge as v}from"@nild/shared";import{forwardRef as N,Children as y,cloneElement as B}from"react";import{isButtonElement as C}from"./Button.js";import{GroupProvider as E}from"./contexts/index.js";import{groupedButtonClassNames as j,groupClassNames as x}from"./style/index.js";const o=N(({className:l,children:n,variant:a="solid",size:m="medium",equal:d=!1,disabled:p,direction:s="horizontal",...c},u)=>{const e=y.toArray(n);if(g(e))return null;const r=e.filter(C);return f(E,{value:{variant:a,size:m,equal:d,disabled:p},children:[r.length===1&&r[0],r.length>1&&h("div",{...c,className:v(x({direction:s}),l),ref:u,children:r.map((t,i)=>B(t,{...t.props,className:j({first:i===0,last:i===r.length-1,direction:s,variant:a})}))})]})});o.displayName="Button.Group";export{o as default};
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
- export declare const buttonClassNames: (props?: ButtonProps | undefined) => string;
3
- export declare const groupClassNames: (props?: GroupProps | undefined) => string;
4
- export declare const groupedButtonClassNames: (props?: (GroupProps & {
5
- first?: boolean;
6
- last?: boolean;
7
- }) | undefined) => string;
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-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"]}]});export{r as buttonClassNames,t as groupClassNames,n as groupedButtonClassNames};
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 s from"./Indicator.js";import r from"./Label.js";import{checkboxClassNames as I}from"./style/index.js";const m=S((u,p)=>{const i=[],l=new Map,a=P(),{className:f,children:h,variant:v=a?.variant??"solid",size:d=a?.size??"medium",disabled:n=a?.disabled??!1,checked:C,defaultChecked:b,value:o,onChange:c,...k}=u,[y,x]=E(a?a.value.includes(o):C,b??!1),N=g(()=>{n||x(e=>(a?a.setValue(e?a.value.filter(z=>z!==o):a.value.concat(o)):c?.(!e),!e))});return V.forEach(h,e=>{j(e)?e.type===s?(l.delete(s),l.set(s,e)):e.type===r&&(l.delete(r),l.set(r,e)):w(e)&&(l.has(r)||l.set(r,t(r,{children:e})))}),i.push(...l.values()),l.has(s)||i.unshift(t(s,{})),t(R,{value:{variant:v,size:d,checked:y,setChecked:N},children:t("label",{...k,className:M(I({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};
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};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{useControllableState as b,useEffectCallback as C}from"@nild/hooks";import{forwardRefWithGenerics as N,cnMerge as x}from"@nild/shared";import{GroupProvider as G}from"./contexts/index.js";import{groupClassNames as g}from"./style/index.js";const o=N(({className:s,children:i,direction:l="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=C(a=>{v(()=>(e?.(a),a))});return r(G,{value:{variant:t,size:d,disabled:n,value:p,setValue:h},children:r("div",{...c,className:x(g({direction:l}),s),ref:f,children:i})})});o.displayName="Checkbox.Group";export{o as default};
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 f,jsx as a}from"react/jsx-runtime";import{Icon as p}from"@nild/icons";import h from"@nild/icons/CheckSmall";import{cnMerge as N}from"@nild/shared";import{forwardRef as C}from"react";import{useCheckboxContext as k}from"./contexts/index.js";import{indicatorInputClassNames as u,indicatorClassNames as x,defaultIndicatorBlockClassNames as I,defaultIndicatorIconClassNames as b}from"./style/index.js";const e=C(({className:o,children:c,...r},t)=>{const{variant:i,size:m,checked:s,setChecked:n}=k(),d=c??(l=>a("div",{className:I({variant:i,checked:l}),children:a(p,{className:b(),component:h})}));return f("div",{...r,className:N(x({size:m}),o),ref:t,children:[d(!!s),a("input",{type:"checkbox",className:u(),checked:s,onChange:n})]})});e.displayName="Checkbox.Indicator";export{e as default};
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};
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{isFunction as l,cnMerge as n}from"@nild/shared";import{forwardRef as f}from"react";import{useCheckboxContext as p}from"./contexts/index.js";import{labelClassNames as d}from"./style/index.js";const s=f(({className:a,children:e,...r},o)=>{const{size:m,checked:t}=p(),c=l(e)?e(!!t):e;return i("span",{...r,className:n(d({size:m}),a),ref:o,children:c})});s.displayName="Checkbox.Label";export{s as default};
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
- export declare const checkboxClassNames: (props?: Pick<CheckboxProps, "size" | "disabled"> | undefined) => string;
3
- export declare const indicatorClassNames: (props?: Pick<CheckboxProps, "size"> | undefined) => string;
4
- export declare const indicatorInputClassNames: (props?: object | undefined) => string;
5
- export declare const defaultIndicatorBlockClassNames: (props?: Pick<CheckboxProps, "variant" | "checked"> | undefined) => string;
6
- export declare const defaultIndicatorIconClassNames: (props?: object | undefined) => string;
7
- export declare const labelClassNames: (props?: Pick<CheckboxProps, "size"> | undefined) => string;
8
- export declare const groupClassNames: (props?: Pick<GroupProps<unknown>, "direction"> | undefined) => string;
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 a}from"../../_shared/style/index.js";const r=e(["nd-checkbox","group",["flex","items-center"],"cursor-pointer",a],{variants:{size:{small:"gap-1.5",medium:"gap-2",large:"gap-2.5"},disabled:{true:"disabled",false:""}}}),s=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"]]),t=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"]}]}),l=e(["w-full"]),n=e(["text-sm"],{variants:{size:{small:"text-sm",medium:"text-md",large:"text-lg"}}}),d=e(["nd-checkbox-group",["flex","gap-x-4","gap-y-2"]],{variants:{direction:{horizontal:"flex-row flex-wrap",vertical:"flex-col"}}});export{r as checkboxClassNames,t as defaultIndicatorBlockClassNames,l as defaultIndicatorIconClassNames,d as groupClassNames,s as indicatorClassNames,o as indicatorInputClassNames,n as labelClassNames};
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};
@@ -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{dividerClassNames as h}from"./style/index.js";const a=f(({className:i,children:e,variant:s="solid",direction:o="horizontal",align:t="center",...n},d)=>{const r=p.toArray(e);return l("div",{...n,className:m(h({emptyChildren:c(r),variant:s,direction:o,align:t}),i),ref:d,children:r})});a.displayName="Divider";export{a as default};
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
- export declare const dividerClassNames: (props?: (DividerProps & {
3
- emptyChildren: boolean;
4
- }) | undefined) => string;
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-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"]}]});export{r as dividerClassNames};
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};
@@ -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{appendClassNames as l}from"./style/index.js";const y=e=>o(e)&&e.type===i,i=({children:e})=>{var n;const{size:a,variant:r,disabled:p}=v();if(c(e))return d("span",{className:t(l({type:"string",size:a,variant:r})),children:e});const s=u.toArray(e).find(m=>o(m));return f(s,{...s?.props,className:t(l({type:"element",size:a,variant:r}),(n=s?.props)==null?void 0:n.className),size:a,disabled:p})};i.displayName="Input.Append";export{i as default,y as isAppendElement};
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};
@@ -1 +1 @@
1
- import{jsx as f,jsxs as u}from"react/jsx-runtime";import{cnMerge as v}from"@nild/shared";import{forwardRef as N,Children as C,cloneElement as E}from"react";import{isAppendElement as b}from"./Append.js";import{CompositeProvider as h}from"./contexts/index.js";import{isInputElement as x}from"./Input.js";import{isPrependElement as I}from"./Prepend.js";import{compositedInputWrapperClassNames as j,compositeClassNames as k}from"./style/index.js";const m=N(({className:p,children:l,variant:r="outlined",size:t="medium",block:i=!1,disabled:n=!1,...d},c)=>{let a,o,s;return C.forEach(l,e=>{I(e)?a=e:b(e)?o=e:x(e)&&(s=e)}),s?f(h,{value:{variant:r,size:t,block:i,disabled:n},children:u("span",{ref:c,className:v(k({block:i}),p),...d,children:[a,E(s,{...s?.props,className:j({variant:r,prepended:!!a,appended:!!o})}),o]})}):null});m.displayName="Input.Composite";export{m as default};
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};
@@ -1 +1 @@
1
- import{jsx as p,jsxs as z}from"react/jsx-runtime";import{useControllableState as E}from"@nild/hooks";import{cnMerge as y}from"@nild/shared";import{forwardRef as k,Children as I,isValidElement as j}from"react";import{useCompositeContext as P,InputProvider as S}from"./contexts/index.js";import{isPrefixElement as V}from"./Prefix.js";import{inputClassNames as w,inputWrapperClassNames as M}from"./style/index.js";import{isSuffixElement as R}from"./Suffix.js";const J=e=>j(e)&&e.type===r,r=k((e,d)=>{const s=P(),{className:u,children:f,variant:i=s.variant,size:t=s.size,block:c=s.block,disabled:l=s.disabled,type:v="text",value:b,defaultValue:C="",onChange:n,...h}=e;let o=null,m=null;I.forEach(f,a=>{V(a)?o=a:R(a)&&(m=a)});const[x,N]=E(b,C),g=a=>{N(a.target.value),n?.(a.target.value,a)};return p(S,{value:{size:t,disabled:l,variant:i},children:z("span",{className:y(M({variant:i,size:t,block:c,disabled:l}),u),children:[o,p("input",{ref:d,type:v,value:x,onChange:g,disabled:l,className:w({size:t}),...h}),m]})})});r.displayName="Input";export{r as default,J as isInputElement};
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 P}from"react/jsx-runtime";import{useControllableState as q}from"@nild/hooks";import{isNumber as G,cnMerge as J,isFunction as K,isEmpty as v}from"@nild/shared";import{forwardRef as Q,useRef as F,useImperativeHandle as U,Fragment as V}from"react";import X from"./Input.js";import{otpInputWrapperClassNames as Y,otpWrapperClassNames as Z}from"./style/index.js";const z=Q(({className:B,placeholder:y,length:u=6,separator:d,block:k=!1,size:x="medium",type:b,value:I,defaultValue:R,onFocus:C,onBlur:D,onChange:N,onComplete:M,...w},S)=>{const[g,T]=q(I,R??[]),o=F([]),h=F(g);h.current=g;const p=()=>Array.from({length:u},(e,n)=>h.current[n]??""),m=(e,n)=>{h.current=e,T(e),N?.(e,n),e.every(a=>!v(a))&&M?.(e,n)},W=(e,n,a)=>{var l;const t=String(n??"");if(!t)return;const r=p(),c=t.split("");for(let s=0;s<c.length;s++)e+s<u&&(r[e+s]=c[s]);m(r,a);const f=Math.min(e+c.length,u-1);(l=o.current[f])==null||l.focus()},j=(e,n)=>{var a;const l=p(),t=l.findIndex(r=>r==="");v(l[e])&&t!==-1&&e>t?(n.preventDefault(),(a=o.current[t])==null||a.focus()):(n.target.select(),C?.(e,n))},E=e=>{e.currentTarget.contains(e.relatedTarget)||D==null||D(e)},H=(e,n)=>{var a,l,t;if(n.key==="Backspace"||n.keyCode===8){n.preventDefault();const r=p();v(r[e])?e>0&&(r[e-1]="",m(r,n),(a=o.current[e-1])==null||a.focus()):(r[e]="",m(r,n))}else n.key==="ArrowLeft"?(n.preventDefault(),(l=o.current[Math.max(0,e-1)])==null||l.focus()):n.key==="ArrowRight"&&(n.preventDefault(),(t=o.current[Math.min(u-1,e+1)])==null||t.focus())},L=e=>{var n,a,l;e.preventDefault();const t=((a=(n=e.clipboardData)==null?void 0:n.getData)==null?void 0:a.call(n,"text"))??"",r=b==="number"?t.replace(/\D/g,""):t.replace(/\s/g,"");if(!r)return;const c=Math.max(0,o.current.findIndex(i=>i===document.activeElement)),f=p(),s=r.split("");for(let i=0;i<s.length;i++)c+i<u&&(f[c+i]=s[i]);m(f,e);const O=Math.min(c+s.length,u-1);(l=o.current[O])==null||l.focus()};return U(S,()=>({focus:e=>{var n,a;if(G(e))(n=o.current[e])==null||n.focus();else{const l=p().findIndex(r=>r===""),t=l!==-1?l:0;(a=o.current[t])==null||a.focus()}},blur:()=>{o.current.forEach(e=>e?.blur())}})),A("span",{className:J(Z({block:k}),B),onPasteCapture:L,onBlur:E,children:Array.from({length:u}).map((e,n)=>P(V,{children:[A(X,{className:Y({block:k,size:x}),type:b,size:x,placeholder:y?.[n],value:g[n]??"",autoComplete:"one-time-code",ref:a=>{o.current[n]=a},onChange:(a,l)=>W(n,a,l),onFocus:a=>j(n,a),onKeyDown:a=>H(n,a),...w}),n<u-1&&(K(d)?d(n):d)]},n))})});z.displayName="Input.OTP";export{z as default};
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};
@@ -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{prefixClassNames as c}from"./style/index.js";const d=s=>p(s)&&s.type===e,e=n((s,r)=>{const{size:a}=l(),{className:t,children:i,...m}=s;return o("span",{...m,className:f(c({size:a}),t),ref:r,children:i})});e.displayName="Input.Prefix";export{e as default,d as isPrefixElement};
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};
@@ -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{prependClassNames as l}from"./style/index.js";const y=e=>o(e)&&e.type===r,r=({children:e})=>{var i;const{size:a,variant:n,disabled:p}=v();if(c(e))return d("span",{className:t(l({type:"string",size:a,variant:n})),children:e});const s=u.toArray(e).find(m=>o(m));return f(s,{...s?.props,className:t(l({type:"element",size:a,variant:n}),(i=s?.props)==null?void 0:i.className),size:a,disabled:p})};r.displayName="Input.Prepend";export{r as default,y as isPrependElement};
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};
@@ -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{searchIconClassNames as y}from"./style/index.js";const e=S(({value:t,defaultValue:m="",keyword:n,defaultKeyword:s,onChange:r,...l},f)=>{const[i,p]=c(n??t,s??m);return o(g,{ref:f,value:i,onChange:(a,u)=>{p(String(a)),r?.(String(a),u)},...l,children:o(w,{children:o(d,{component:h,className:y()})})})});e.displayName="Input.Search";export{e as default};
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};
@@ -1 +1 @@
1
- import{jsx as f}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{suffixClassNames as 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,...m}=s;return f("span",{...m,className:o(u({size:r}),t),ref:a,children:i})});e.displayName="Input.Suffix";export{e as default,c as isSuffixElement};
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
- export declare const compositeClassNames: (props?: {
3
- block?: boolean;
4
- } | undefined) => string;
5
- export declare const compositedInputWrapperClassNames: (props?: (Pick<InputProps, "variant"> & {
6
- prepended?: boolean;
7
- appended?: boolean;
8
- }) | undefined) => string;
9
- export declare const inputWrapperClassNames: (props?: InputProps | undefined) => string;
10
- export declare const inputClassNames: (props?: InputProps | undefined) => string;
11
- export declare const prefixClassNames: (props?: InputProps | undefined) => string;
12
- export declare const suffixClassNames: (props?: InputProps | undefined) => string;
13
- export declare const prependClassNames: (props?: (Pick<InputProps, "variant" | "size"> & {
14
- type: "string" | "element";
15
- }) | undefined) => string;
16
- export declare const appendClassNames: (props?: (Pick<InputProps, "variant" | "size"> & {
17
- type: "string" | "element";
18
- }) | undefined) => string;
19
- /**
20
- * Preset component styles
21
- */
22
- export declare const searchIconClassNames: (props?: InputProps | undefined) => string;
23
- export declare const otpWrapperClassNames: (props?: Pick<OTPProps, "block"> | undefined) => string;
24
- export declare const otpInputWrapperClassNames: (props?: Pick<InputProps, "size" | "block"> | undefined) => string;
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 a=e(["nd-input-composite","inline-flex","items-stretch"],{variants:{block:{true:["flex","w-full"],false:""}}}),s=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"]}]}),n=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:""}}}),r=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"]}}}),l=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"]}}}),i=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"]}]}),m=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"]}]}),o=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"]}]});export{m as appendClassNames,a as compositeClassNames,s as compositedInputWrapperClassNames,r as inputClassNames,n as inputWrapperClassNames,u as otpInputWrapperClassNames,p as otpWrapperClassNames,l as prefixClassNames,d as prependClassNames,o as searchIconClassNames,i as suffixClassNames};
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};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{usePopupContext as m,useArrowContext as p}from"./contexts/index.js";import{arrowClassNames as f}from"./style/index.js";const r=()=>{const{size:e,arrowed:o,inverse:s,refs:a}=m(),{style:t,orientation:i}=p();return n("div",{className:f({size:e,arrowed:o,inverse:s,orientation:i}),style:t,ref:a.arrow})};r.displayName="Popup.Arrow";export{r as default};
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};
@@ -1 +1 @@
1
- import{jsxs as M,jsx as P}from"react/jsx-runtime";import{useEffectCallback as t}from"@nild/hooks";import{mergeRefs as g,cnMerge as n,getDPR as h}from"@nild/shared";import{forwardRef as R,Children as b,isValidElement as j,cloneElement as w}from"react";import{createPortal as z}from"react-dom";import L from"./Arrow.js";import{usePopupContext as $,usePortalContext as k}from"./contexts/index.js";import{portalContentClassNames as A,portalClassNames as D}from"./style/index.js";const m=R(({className:i,style:p,children:f,container:u=document.body,...s},c)=>{var r;const{size:d,inverse:v,refs:x,enter:C,leave:N}=$(),{coords:l}=k(),a=b.toArray(f).find(e=>j(e)),y=t(e=>{var o;(o=s?.onMouseEnter)==null||o.call(s,e),C()}),E=t(e=>{var o;(o=s?.onMouseLeave)==null||o.call(s,e),N()});return a?z(M("div",{...s,className:n(D(),i),style:{transform:`translate(${l.x}px, ${l.y}px)`,...h()>=1.5&&{willChange:"transform"},...p},onMouseEnter:y,onMouseLeave:E,ref:g(x.portal,c),children:[w(a,{...a.props,className:n(A({size:d,inverse:v}),(r=a?.props)==null?void 0:r.className)}),P(L,{})]}),u):null});m.displayName="Popup.Portal";export{m as default};
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};
@@ -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{triggerClassNames as b}from"./style/index.js";const f=({children:g})=>{var p,v;const{actions:r,refs:a,setOpen:s,enter:h,leave:x}=P(),n=y.toArray(g).find(e=>B(e)),d=r.has("click")||r.has("contextMenu")?window:null,E=u(e=>{var o,l;(l=(o=n?.props)==null?void 0:o.onMouseEnter)==null||l.call(o,e),h()}),M=u(e=>{var o,l;(l=(o=n?.props)==null?void 0:o.onMouseLeave)==null||l.call(o,e),x()}),k=u(e=>{var o,l;(l=(o=n?.props)==null?void 0:o.onFocus)==null||l.call(o,e),r.has("focus")&&s(!0)}),C=u(e=>{var o,l;(l=(o=n?.props)==null?void 0:o.onBlur)==null||l.call(o,e),r.has("focus")&&s(!1)});return m(d,"click",e=>{var o,l;const t=e.target,i=(o=a.trigger.current)==null?void 0:o.contains(t),c=(l=a.portal.current)==null?void 0:l.contains(t);i?(r.has("click")&&s(L=>!L),r.has("contextMenu")&&s(!1)):!c&&s(!1)}),m(d,"contextmenu",e=>{var o,l;const t=e.target,i=(o=a.trigger.current)==null?void 0:o.contains(t),c=(l=a.portal.current)==null?void 0:l.contains(t);i?r.has("contextMenu")&&(e.preventDefault(),s(!0)):!c&&s(!1)}),n?F(n,{...n?.props,className:w(b(),(p=n?.props)==null?void 0:p.className),onMouseEnter:E,onMouseLeave:M,onFocus:k,onBlur:C,ref:N(a.trigger,(v=n?.props)==null?void 0:v.ref)}):null};f.displayName="Popup.Trigger";export{f as default};
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,10 @@
1
1
  import { ArrowOrientation, PopupProps, PortalProps } from '../interfaces';
2
- export declare const triggerClassNames: (props?: object | undefined) => string;
3
- export declare const portalClassNames: (props?: PortalProps | undefined) => string;
4
- export declare const portalContentClassNames: (props?: Pick<PopupProps, "size" | "inverse"> | undefined) => string;
5
- export declare const arrowClassNames: (props?: (Pick<PopupProps, "size" | "arrowed" | "inverse"> & {
6
- orientation: ArrowOrientation;
7
- }) | undefined) => string;
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 a}from"@nild/shared";const e=a(["nd-popup-trigger"]),r=a(["nd-popup-portal",["absolute","top-0","left-0"]]),s=a(["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"]}}}),t=a(["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)]"]}]});export{t as arrowClassNames,r as portalClassNames,s as portalContentClassNames,e as triggerClassNames};
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};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{useControllableState as b,useEffectCallback as N}from"@nild/hooks";import{forwardRefWithGenerics as C,cnMerge as G}from"@nild/shared";import{GroupProvider as g}from"./contexts/index.js";import{groupClassNames as x}from"./style/index.js";const o=C(({className:s,children:i,direction:l="horizontal",variant:t="solid",size:d="medium",disabled:n=!1,value:m,defaultValue:u,onChange:a,...c},f)=>{const[p,v]=b(m,u),h=N(e=>{v(()=>(a?.(e),e))});return r(g,{value:{variant:t,size:d,disabled:n,value:p,setValue:h},children:r("div",{...c,className:G(x({direction:l}),s),ref:f,children:i})})});o.displayName="Radio.Group";export{o as default};
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};
@@ -1 +1 @@
1
- import{jsxs as c,jsx as a}from"react/jsx-runtime";import{cnMerge as i}from"@nild/shared";import{forwardRef as h}from"react";import{useRadioContext as N}from"./contexts/index.js";import{indicatorInputClassNames as C,indicatorClassNames as u,defaultIndicatorOuterCircleClassNames as x,defaultIndicatorInnerCircleClassNames as v}from"./style/index.js";const t=h(({className:o,children:n,...d},l)=>{const{variant:e,size:m,checked:s,setChecked:f}=N(),p=n??(r=>c("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a("circle",{cx:"10",cy:"10",className:i(x({variant:e,checked:r}))}),a("circle",{cx:"10",cy:"10",className:v({variant:e,checked:r})})]}));return c("div",{...d,className:i(u({size:m}),o),ref:l,children:[p(!!s),a("input",{type:"radio",className:C(),checked:s,onChange:f})]})});t.displayName="Radio.Indicator";export{t as default};
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};
@@ -1 +1 @@
1
- import{jsx as c}from"react/jsx-runtime";import{isFunction as l,cnMerge as n}from"@nild/shared";import{forwardRef as f}from"react";import{useRadioContext as d}from"./contexts/index.js";import{labelClassNames as p}from"./style/index.js";const a=f(({className:e,children:s,...r},o)=>{const{size:i,checked:m}=d(),t=l(s)?s(!!m):s;return c("span",{...r,className:n(p({size:i}),e),ref:o,children:t})});a.displayName="Radio.Label";export{a as default};
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};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{useControllableState as E,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{radioClassNames as 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:m,onChange:n,...k}=p,[y,N]=E(a?a.value===m:C,b??!1),z=R(()=>{d||N(e=>e||(a?a.setValue(m):n?.(!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:z},children:r("label",{...k,className:w(P({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
+ 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
- export declare const radioClassNames: (props?: Pick<RadioProps, "size" | "disabled"> | undefined) => string;
3
- export declare const indicatorClassNames: (props?: Pick<RadioProps, "size"> | undefined) => string;
4
- export declare const indicatorInputClassNames: (props?: object | undefined) => string;
5
- export declare const defaultIndicatorOuterCircleClassNames: (props?: Pick<RadioProps, "variant" | "checked"> | undefined) => string;
6
- export declare const defaultIndicatorInnerCircleClassNames: (props?: Pick<RadioProps, "variant" | "checked"> | undefined) => string;
7
- export declare const labelClassNames: (props?: Pick<RadioProps, "size"> | undefined) => string;
8
- export declare const groupClassNames: (props?: Pick<GroupProps<unknown>, "direction"> | undefined) => string;
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 a}from"@nild/shared";import{DISABLED_CLS as e}from"../../_shared/style/index.js";const r=a(["nd-radio","group",["flex","items-center"],"cursor-pointer",e],{variants:{size:{small:"gap-1.5",medium:"gap-2",large:"gap-2.5"},disabled:{true:"disabled",false:""}}}),s=a(["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=a([["absolute","inset-0","opacity-0"],["group-enabled:cursor-pointer","group-disabled:cursor-not-allowed"]]),t=a(["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"]}]}),i=a(["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"]}]}),o=a(["text-sm"],{variants:{size:{small:"text-sm",medium:"text-md",large:"text-lg"}}}),n=a(["nd-radio-group",["flex","gap-x-4","gap-y-2"]],{variants:{direction:{horizontal:"flex-row flex-wrap",vertical:"flex-col"}}});export{i as defaultIndicatorInnerCircleClassNames,t as defaultIndicatorOuterCircleClassNames,n as groupClassNames,s as indicatorClassNames,l as indicatorInputClassNames,o as labelClassNames,r as radioClassNames};
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};
@@ -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{switchClassNames as q}from"./style/index.js";import n from"./Thumb.js";import t from"./Track.js";const h=z(({className:p,children:f,variant:r="solid",size:c="medium",shape:i="round",checked:u,defaultChecked:k,value:v,defaultValue:y,disabled:g,onChange:l,style:C,...w},b)=>{let o,d,m;M.forEach(f,e=>{P(e)&&(e.type===t?e.props.type==="checked"?o=e:d=e:e.type===n&&(m=e))});const N={"--nd-switch-height":{small:"calc(var(--spacing) * 4)",medium:"calc(var(--spacing) * 6)",large:"calc(var(--spacing) * 8)"}[c]},[s,x]=E(u??v,k??y??!1),S=()=>{x(e=>(l?.(!e),!e))};return a(R,{value:{variant:r,shape:i,checked:s},children:j("button",{...w,type:"button",role:"switch","aria-checked":s,disabled:g,className:V(q({variant:r,size:c,shape:i,checked:s}),p),style:{...N,...C},ref:b,onClick:S,children:[o||a(t,{type:"checked"}),d||a(t,{type:"unchecked"}),m||a(n,{})]})})});h.displayName="Switch";export{h as default};
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};
@@ -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{thumbClassNames as p}from"./style/index.js";const r=f(({className:s,children:a,...t},o)=>{const{variant:i,shape:m,checked:e}=n();return c("div",{...t,className:h(p({variant:i,shape:m,checked:e}),s),ref:o,children:a?.(!!e)})});r.displayName="Switch.Thumb";export{r as default};
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};
@@ -1 +1 @@
1
- import{jsx as i}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{trackClassNames as d}from"./style/index.js";const r=n(({className:a,children:e,type:s,...t},c)=>{const{variant:m,checked:o}=p();return i("div",{...t,className:f(d({type:s,variant:m,checked:o}),a),ref:c,children:e})});r.displayName="Switch.Track";export{r as default};
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
- export declare const switchClassNames: (props?: (SwitchProps & {
3
- checked: boolean;
4
- }) | undefined) => string;
5
- export declare const trackClassNames: (props?: (Pick<SwitchProps, "variant" | "checked"> & Pick<TrackProps, "type">) | undefined) => string;
6
- export declare const thumbClassNames: (props?: Pick<SwitchProps, "variant" | "shape" | "checked"> | undefined) => string;
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 a}from"../../_shared/style/index.js";const t=e(["nd-switch","group","h-[var(--nd-switch-height)]","transition-[outline-color]",["relative","inline-block","font-nd","overflow-hidden","cursor-pointer"],a],{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"}}});export{t as switchClassNames,r as thumbClassNames,n as trackClassNames};
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: .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;}}
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; --radius-xl: .5rem; --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;}}
@@ -1 +1 @@
1
- import{useEffectCallback as o}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{transitionClassNames as G}from"./style/index.js";const I=({className:U,children:f,visible:i=!0})=>{const a=X.toArray(f).find(N=>M(N)),c=a?i?r.ENTERED:r.EXITED:r.UNMOUNTED,[t,E]=O(c),e=m(),n=m(a);n.current=t===r.UNMOUNTED?a:a??n.current;const s=o(N=>{u();let T=!0;const l=()=>{T&&(T=!1,e.current=void 0,N?.())};l.cancel=()=>{T=!1},e.current=l}),d=o(()=>{e.current&&(e.current(),e.current=void 0)}),u=o(()=>{e.current&&(e.current.cancel(),e.current=void 0)}),p=o(()=>{c===r.UNMOUNTED&&t===r.EXITED&&E(r.UNMOUNTED)});return D(()=>{d()},[t]),D(()=>{switch(c){case r.ENTERED:t!==r.ENTERING&&t!==r.ENTERED&&(t===r.UNMOUNTED?E(r.EXITED):(u(),E(r.ENTERING),s(()=>{s(()=>{E(r.ENTERED)}),e.current&&setTimeout(e.current,0)})));break;case r.EXITED:(t===r.ENTERING||t===r.ENTERED)&&(u(),E(r.EXITING),s(()=>{s(()=>{E(r.EXITED)}),e.current&&setTimeout(e.current,0)}));break;case r.UNMOUNTED:default:t!==r.EXITED&&t!==r.UNMOUNTED&&(u(),E(r.EXITING),s(()=>{s(()=>{E(r.EXITED)}),e.current&&setTimeout(e.current,0)}));break}},[i,c,t]),n.current?b(n.current,{...n.current.props,className:R(n.current.props.className,G({status:t}),U),onTransitionEnd:p}):null};I.displayName="Transition";export{I as default};
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
- export declare const transitionClassNames: (props?: {
3
- status: Status;
4
- } | undefined) => string;
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 s}from"../interfaces/index.js";const i=a(["transition-[opacity,visibility]"],{compoundVariants:[{status:s.ENTERED,className:["opacity-100","visible"]},{status:[s.UNMOUNTED,s.ENTERING,s.EXITING,s.EXITED],className:["opacity-0","invisible"]}]});export{i as transitionClassNames};
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};
@@ -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{linkClassNames as p}from"./style/index.js";const a=f(({className:r,children:s,underlined:i=!1,disabled:e=!1,href:d="#",...l},o)=>m("a",{...l,href:e?void 0:d,className:n(p({underlined:i,disabled:e}),r),ref:o,children:s}));a.displayName="Typography.Link";export{a as default};
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 o}from"react/jsx-runtime";import{cnMerge as p}from"@nild/shared";import{forwardRef as f}from"react";import{paragraphClassNames as t}from"./style/index.js";const a=f(({className:r,children:s,...e},m)=>o("p",{...e,className:p(t(),r),ref:m,children:s}));a.displayName="Typography.Paragraph";export{a as default};
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};
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{cnMerge as p}from"@nild/shared";import{forwardRef as f}from"react";import{textTagClassNames as N,textClassNames as x}from"./style/index.js";const e=f(({className:r,children:t,tags:o=[],secondary:d=!1,disabled:m=!1,...c},l)=>{const i=[...new Set(o)].reduce((n,a)=>s(a,{className:N({tag:a}),children:n}),t);return s("span",{...c,className:p(x({secondary:d,disabled:m}),r),ref:l,children:i})});e.displayName="Typography.Text";export{e as default};
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};
@@ -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{titleClassNames as p}from"./style/index.js";const r=f(({className:s,children:a,level:e=1,...l},m)=>{const o=`h${e}`;return t(o,{...l,className:i(p({level:e}),s),ref:m,children:a})});r.displayName="Typography.Title";export{r as default};
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 o}from"react/jsx-runtime";import{cnMerge as p}from"@nild/shared";import{forwardRef as t}from"react";import{typographyClassNames as f}from"./style/index.js";const a=t(({className:r,children:s,...e},m)=>o("article",{...e,className:p(f(),r),ref:m,children:s}));a.displayName="Typography";export{a as default};
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
- export declare const linkClassNames: (props?: LinkProps | undefined) => string;
3
- export declare const paragraphClassNames: (props?: ParagraphProps | undefined) => string;
4
- export declare const textClassNames: (props?: TextProps | undefined) => string;
5
- export declare const textTagClassNames: (props?: {
6
- tag: TextTag;
7
- } | undefined) => string;
8
- export declare const titleClassNames: (props?: TitleProps | undefined) => string;
9
- export declare const typographyClassNames: (props?: TypographyProps | undefined) => string;
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 e}from"@nild/shared";import{DISABLED_CLS as t}from"../../_shared/style/index.js";const a=e(["nd-link",["font-nd","text-brand","text-[length:inherit]","cursor-pointer","enabled:hover:text-brand-hover","enabled:active:text-brand-active"],t],{variants:{disabled:{true:"disabled",false:""},underlined:{true:"underline",false:"no-underline"}}}),n=e(["nd-paragraph",["font-nd","text-main","text-[length:inherit]"],["mt-0","mb-[1em]"]]),r=e(["nd-text",["font-nd","text-[length:inherit]"],t],{variants:{secondary:{true:"text-muted",false:"text-main"},disabled:{true:"disabled",false:""}}}),s=e("",{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"]]}}}),d=e(["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"]}}}),l=e(["nd-typography",["font-nd","text-md"]]);export{a as linkClassNames,n as paragraphClassNames,r as textClassNames,s as textTagClassNames,d as titleClassNames,l as typographyClassNames};
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.35",
4
+ "version": "0.0.37",
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/hooks": "0.0.16",
35
- "@nild/icons": "0.0.16",
36
- "@nild/shared": "0.0.14"
34
+ "@nild/shared": "0.0.16",
35
+ "@nild/icons": "0.0.18",
36
+ "@nild/hooks": "0.0.18"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "vite build --mode PROD",