@nild/components 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,2 @@
1
- import { default as isEmptyChildren } from './isEmptyChildren';
2
1
  import { default as isPlainChildren } from './isPlainChildren';
3
- export { isEmptyChildren, isPlainChildren };
2
+ export { isPlainChildren };
@@ -1 +1 @@
1
- import{jsx as t,Fragment as A}from"react/jsx-runtime";import{cnMerge as p,isArray as S,cnJoin as b}from"@nild/shared";import{forwardRef as f}from"react";import{DISABLED_CLS as L}from"../_shared/style/index.js";import P from"../_shared/utils/isEmptyChildren.js";import h from"../_shared/utils/isPlainChildren.js";import{VARIANT_CLS_MAP as C,SIZE_CLS_MAP as M,SHAPE_CLS_MAP as N,EQUAL_CLS_MAP as R,GROUP_FIRST_CLS_MAP as I,GROUP_LAST_CLS_MAP as g,GROUP_DIVIDER_CLS_MAP as z}from"./style/index.js";const i=f(({className:r,children:n,variant:s="solid",size:o="medium",shape:l="square",equal:e=!1,disabled:m,block:c,...d},u)=>{const a=h(n);return t("button",{type:"button",...d,disabled:m,className:p("nd-button","font-sans cursor-pointer transition-colors",L,c&&"w-full",a&&"whitespace-nowrap truncate",C[s],M[o][`${a}`],N[l],e&&R[o],r),ref:u,children:n})});i.displayName="Button";const _=f(({children:r,className:n,variant:s="solid",size:o="medium",disabled:l,direction:e="horizontal",...m},c)=>{if(!r||P(r))return t(A,{});if(!S(r))return t(i,{...r.props,variant:s,size:o,disabled:l});const d=e==="horizontal";return t("div",{...m,className:p("nd-button-group","flex",!d&&"flex-col",n),ref:c,children:r.map((u,a)=>t(i,{...u.props,className:b(a===0?I[e]:a===r.length-1?g[e]:"rounded-none",a!==0&&(d?"border-l-0":"border-t-0"),a!==r.length-1&&z[e][s]),variant:s,size:o,disabled:l},a))})});_.displayName="Button.Group",i.Group=_;export{i as default};
1
+ import{jsx as c}from"react/jsx-runtime";import{cnMerge as _,isEmpty as h,cnJoin as L}from"@nild/shared";import{forwardRef as A,Children as P,isValidElement as C}from"react";import{DISABLED_CLS as M}from"../_shared/style/index.js";import N from"../_shared/utils/isPlainChildren.js";import{VARIANT_CLS_MAP as E,SIZE_CLS_MAP as R,SHAPE_CLS_MAP as y,EQUAL_CLS_MAP as I,GROUP_FIRST_CLS_MAP as g,GROUP_LAST_CLS_MAP as z,GROUP_DIVIDER_CLS_MAP as G}from"./style/index.js";const t=A(({className:r,children:l,variant:s="solid",size:n="medium",shape:d="square",equal:e=!1,disabled:p,block:f,...a},m)=>{const o=N(l);return c("button",{type:"button",...a,disabled:p,className:_("nd-button","font-nd cursor-pointer transition-colors",M,f&&"w-full",o&&"whitespace-nowrap truncate",E[s],R[n][`${o}`],y[d],e&&I[n],r),ref:m,children:l})});t.displayName="Button";const S=r=>C(r)&&r.type===t,b=A(({className:r,children:l,variant:s="solid",size:n="medium",disabled:d,direction:e="horizontal",...p},f)=>{const a=P.toArray(l);if(!a||h(a))return null;if(a.length===1){const[u]=a;return S(u)?c(t,{...u.props,variant:s,size:n,disabled:d}):null}const m=e==="horizontal",o=a.filter(S);return c("div",{...p,className:_("nd-button-group","flex",!m&&"flex-col",r),ref:f,children:o.map((u,i)=>c(t,{...u.props,className:L(i===0?g[e]:i===o.length-1?z[e]:"rounded-none",i!==0&&(m?"border-l-0":"border-t-0"),i!==o.length-1&&G[e][s]),variant:s,size:n,disabled:d},i))})});b.displayName="Button.Group",t.Group=b;export{t as default};
@@ -0,0 +1,27 @@
1
+ import { HTMLAttributes, ForwardRefExoticComponent, RefAttributes, ChangeEventHandler } from 'react';
2
+ import { CheckboxSize } from './style';
3
+ export interface CheckboxProps extends Omit<HTMLAttributes<HTMLLabelElement>, 'onChange' | 'defaultValue'> {
4
+ size?: CheckboxSize;
5
+ checked?: boolean;
6
+ defaultChecked?: boolean;
7
+ value?: boolean;
8
+ defaultValue?: boolean;
9
+ indeterminate?: boolean;
10
+ disabled?: boolean;
11
+ onChange?: (checked: boolean) => void;
12
+ }
13
+ /**
14
+ * @category Components
15
+ */
16
+ declare const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<HTMLDivElement>> & {
17
+ Indicator: typeof Indicator;
18
+ Label: typeof Label;
19
+ };
20
+ interface IndicatorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
21
+ checked?: boolean;
22
+ onChange?: ChangeEventHandler<HTMLInputElement>;
23
+ }
24
+ declare const Indicator: ForwardRefExoticComponent<IndicatorProps & RefAttributes<HTMLDivElement>>;
25
+ type LabelProps = HTMLAttributes<HTMLSpanElement>;
26
+ declare const Label: ForwardRefExoticComponent<LabelProps & RefAttributes<HTMLSpanElement>>;
27
+ export default Checkbox;
@@ -0,0 +1 @@
1
+ import{jsx as o,jsxs as j}from"react/jsx-runtime";import{useControllableState as A,useEffectCallback as M,usePureCallback as x}from"@nild/hooks";import{Icon as D}from"@nild/icons";import P from"@nild/icons/CheckSmall";import{cnJoin as d,isString as y,cnMerge as E}from"@nild/shared";import{forwardRef as b,Children as R,isValidElement as B,cloneElement as I}from"react";import{DISABLED_CLS as H}from"../_shared/style/index.js";import{SIZE_CLS_MAP as t,INDICATOR_CHECKED_CLS_MAP as J}from"./style/index.js";const m=b(({className:n,children:l,size:a="medium",checked:p,defaultChecked:h,value:u,defaultValue:L,indeterminate:K,disabled:C,onChange:N,...S},v)=>{const i=[],s=new Map,[f,w]=A(p??u,h??L??!1),k=M(()=>{C||w(e=>(N?.(!e),!e))}),_=x(()=>o(c,{className:t[a].indicator,checked:f,onChange:k,children:o("div",{className:d("flex items-center justify-center","w-full h-full rounded-sm border-solid border-1 border-primary","transition-[background-color,color]",J[`${f}`]),children:o(D,{component:P})})})),g=x(e=>o(r,{className:t[a].label,children:e}));return R.forEach(l,e=>{B(e)?e.type===c?(s.delete(c),s.set(c,I(e,{...e.props,className:d(t[a].indicator,e.props.className),checked:f,onChange:k}))):e.type===r&&(s.delete(r),s.set(r,I(e,{...e.props,className:d(t[a].label,e.props.className)}))):y(e)&&(s.has(r)||s.set(r,g(e)))}),i.push(...s.values()),s.has(c)||i.unshift(_()),!s.has(r)&&y(l)&&i.push(g(l)),o("label",{...S,className:E("nd-checkbox","group","flex items-center","cursor-pointer",t[a].wrapper,H,C&&"disabled",n),ref:v,children:i})}),c=b(({className:n,children:l,checked:a,onChange:p,...h},u)=>j("div",{...h,className:E("relative","flex items-center justify-center",n),ref:u,children:[l,o("input",{type:"checkbox",className:d("absolute inset-0 opacity-0","group-enabled:cursor-pointer","group-disabled:cursor-not-allowed"),checked:a,onChange:p})]}));c.displayName="Checkbox.Indicator";const r=b(({children:n,...l},a)=>o("span",{...l,ref:a,children:n}));r.displayName="Checkbox.Label",m.Indicator=c,m.Label=r,m.displayName="Checkbox";export{m as default};
@@ -0,0 +1,3 @@
1
+ import { default as Checkbox, CheckboxProps } from './Checkbox';
2
+ export type { CheckboxProps };
3
+ export default Checkbox;
@@ -0,0 +1 @@
1
+ import e from"./Checkbox.js";export{e as default};
@@ -0,0 +1,6 @@
1
+ export type CheckboxSize = 'small' | 'medium' | 'large';
2
+ export declare const SIZE_CLS_MAP: Record<CheckboxSize, Record<'wrapper' | 'indicator' | 'label', string>>;
3
+ export declare const INDICATOR_CHECKED_CLS_MAP: {
4
+ readonly true: readonly ["bg-primary text-contrast", "group-enabled:group-hover:bg-primary-hover"];
5
+ readonly false: readonly ["bg-transparent text-transparent", "group-enabled:group-hover:bg-tertiary-hover"];
6
+ };
@@ -0,0 +1 @@
1
+ const r={small:{wrapper:"gap-1.5",indicator:"w-3.5 h-3.5 text-sm",label:"text-sm"},medium:{wrapper:"gap-2",indicator:"w-4 h-4 text-md",label:"text-md"},large:{wrapper:"gap-2.5",indicator:"w-4.5 h-4.5 text-lg",label:"text-lg"}},t={true:["bg-primary text-contrast","group-enabled:group-hover:bg-primary-hover"],false:["bg-transparent text-transparent","group-enabled:group-hover:bg-tertiary-hover"]};export{t as INDICATOR_CHECKED_CLS_MAP,r as SIZE_CLS_MAP};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{cnMerge as c}from"@nild/shared";import{forwardRef as _}from"react";import f from"../_shared/utils/isEmptyChildren.js";import{DIRECTION_WITH_CHILDREN_CLS_MAP as p,DIRECTION_WITHOUT_CHILDREN_CLS_MAP as I,ALIGN_CLS_MAP as N}from"./style/index.js";const o=_(({className:e,children:a,variant:i="solid",direction:r="horizontal",align:t="center",...s},n)=>{const d=r==="horizontal",m=!f(a);return l("div",{...s,className:c("nd-divider","border-split","text-primary",d&&m?p[r][i].concat(N[t]):I[r][i],e),ref:n,children:a})});o.displayName="Divider";export{o as default};
1
+ import{jsx as m}from"react/jsx-runtime";import{cnMerge as c,isEmpty as _}from"@nild/shared";import{forwardRef as p,Children as I}from"react";import{DIRECTION_WITH_CHILDREN_CLS_MAP as f,DIRECTION_WITHOUT_CHILDREN_CLS_MAP as C,ALIGN_CLS_MAP as N}from"./style/index.js";const s=p(({className:e,children:o,variant:a="solid",direction:r="horizontal",align:t="center",...n},d)=>{const l=r==="horizontal",i=I.toArray(o);return m("div",{...n,className:c("nd-divider","border-split","text-primary",l&&!_(i)?f[r][a].concat(N[t]):C[r][a],e),ref:d,children:i})});s.displayName="Divider";export{s as default};
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { default as Button } from './button';
2
+ import { default as Checkbox } from './checkbox';
2
3
  import { default as Divider } from './divider';
3
4
  import { default as Popover } from './popover';
4
5
  import { default as Switch } from './switch';
5
6
  import { default as Transition } from './transition';
6
7
  import { default as Typography } from './typography';
7
- export { Button, Divider, Popover, Switch, Transition, Typography };
8
+ export { Button, Checkbox, Divider, Popover, Switch, Transition, Typography };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{default as a}from"./button/Button.js";import{default as o}from"./divider/Divider.js";import{default as r}from"./popover/Popover.js";import{default as t}from"./switch/Switch.js";import{default as s}from"./transition/Transition.js";import{default as f}from"./typography/Typography.js";/* empty css */export{a as Button,o as Divider,r as Popover,t as Switch,s as Transition,f as Typography};
1
+ import{default as a}from"./button/Button.js";import{default as o}from"./checkbox/Checkbox.js";import{default as r}from"./divider/Divider.js";import{default as t}from"./popover/Popover.js";import{default as s}from"./switch/Switch.js";import{default as f}from"./transition/Transition.js";import{default as m}from"./typography/Typography.js";/* empty css */export{a as Button,o as Checkbox,r as Divider,t as Popover,s as Switch,f as Transition,m as Typography};
@@ -1 +1 @@
1
- import{jsxs as j,jsx as r}from"react/jsx-runtime";import{useControllableState as U}from"@nild/hooks";import{cnJoin as n,cnMerge as d}from"@nild/shared";import{forwardRef as p,Children as B,isValidElement as D,cloneElement as g}from"react";import{DISABLED_CLS as H}from"../_shared/style/index.js";import{VARIANT_TRACK_CLS_MAP as y,VARIANT_THUMB_CLS_MAP as Z,SHAPE_CLS_MAP as k,SIZE_VAR_MAP as $,VARIANT_CLS_MAP as q,SIZE_CLS_MAP as J}from"./style/index.js";const m=p(({className:t,children:c,variant:e="solid",size:a="medium",shape:w="round",checked:C,defaultChecked:b,value:x,defaultValue:M,disabled:E,onChange:v,style:I,...L},P)=>{let l,h,o;B.forEach(c,s=>{D(s)&&(s.type===f?l=s:s.type===u?h=s:s.type===N&&(o=s))});const R={"--nd-switch-height":$[a]},[i,T]=U(C??x,b??M??!1),A=n("h-[var(--nd-switch-height)]","ps-[calc(var(--nd-switch-height)/3)] pe-[calc(var(--nd-switch-height)*1.1)]",y[e][`${i}`].concat(i?"ms-0 me-0":"-ms-[100%] me-[100%]")),S=n("h-[var(--nd-switch-height)]","-mt-[var(--nd-switch-height)]","ps-[calc(var(--nd-switch-height)*1.1)] pe-[calc(var(--nd-switch-height)/3)]",y[e][`${i}`].concat(i?"ms-[100%] -me-[100%]":"ms-0 me-0")),_=n("h-[var(--nd-switch-height)]",Z[e],k[w],i?"left-[calc(100%-var(--nd-switch-height))]":"left-0"),V=()=>{T(s=>(v?.(!s),!s))};return j("button",{...L,type:"button",role:"switch","aria-checked":i,disabled:E,className:d("nd-switch","h-[var(--nd-switch-height)]","group","relative inline-block font-sans overflow-hidden cursor-pointer",H,q[e],J[a],k[w],t),style:{...R,...I},ref:P,onClick:V,children:[l?g(l,{...l.props,className:n(A,l.props.className)}):r(f,{className:A}),h?g(h,{...h.props,className:n(S,h.props.className)}):r(u,{className:S}),o?g(o,{...o.props,className:n(_,o.props.className)}):r(N,{className:_})]})});m.displayName="Switch";const f=p(({className:t,children:c,...e},a)=>r("div",{...e,className:d("flex justify-center items-center","text-center text-contrast","transition-[margin-inline,background-color]",t),ref:a,children:c}));f.displayName="Switch.Checked";const u=p(({className:t,children:c,...e},a)=>r("div",{...e,className:d("flex justify-center items-center","text-center text-contrast","transition-[margin-inline,background-color]",t),ref:a,children:c}));u.displayName="Switch.Unchecked";const N=p(({className:t,children:c,...e},a)=>r("div",{...e,className:d("flex justify-center items-center","absolute aspect-square scale-80","text-contrast transition-[left,background-color]",t),ref:a,children:c}));N.displayName="Switch.Thumb",m.Checked=f,m.Unchecked=u,m.Thumb=N;export{m as default};
1
+ import{jsxs as j,jsx as r}from"react/jsx-runtime";import{useControllableState as U}from"@nild/hooks";import{cnJoin as n,cnMerge as m}from"@nild/shared";import{forwardRef as p,Children as B,isValidElement as D,cloneElement as g}from"react";import{DISABLED_CLS as H}from"../_shared/style/index.js";import{VARIANT_TRACK_CLS_MAP as y,VARIANT_THUMB_CLS_MAP as Z,SHAPE_CLS_MAP as k,SIZE_VAR_MAP as $,VARIANT_CLS_MAP as q,SIZE_CLS_MAP as J}from"./style/index.js";const d=p(({className:t,children:c,variant:e="solid",size:a="medium",shape:w="round",checked:C,defaultChecked:b,value:x,defaultValue:M,disabled:E,onChange:v,style:I,...L},P)=>{let l,h,o;B.forEach(c,s=>{D(s)&&(s.type===f?l=s:s.type===u?h=s:s.type===N&&(o=s))});const R={"--nd-switch-height":$[a]},[i,T]=U(C??x,b??M??!1),A=n("h-[var(--nd-switch-height)]","ps-[calc(var(--nd-switch-height)/3)] pe-[calc(var(--nd-switch-height)*1.1)]",y[e][`${i}`].concat(i?"ms-0 me-0":"-ms-[100%] me-[100%]")),S=n("h-[var(--nd-switch-height)]","-mt-[var(--nd-switch-height)]","ps-[calc(var(--nd-switch-height)*1.1)] pe-[calc(var(--nd-switch-height)/3)]",y[e][`${i}`].concat(i?"ms-[100%] -me-[100%]":"ms-0 me-0")),_=n("h-[var(--nd-switch-height)]",Z[e],k[w],i?"left-[calc(100%-var(--nd-switch-height))]":"left-0"),V=()=>{T(s=>(v?.(!s),!s))};return j("button",{...L,type:"button",role:"switch","aria-checked":i,disabled:E,className:m("nd-switch","h-[var(--nd-switch-height)]","group","relative inline-block font-nd overflow-hidden cursor-pointer",H,q[e],J[a],k[w],t),style:{...R,...I},ref:P,onClick:V,children:[l?g(l,{...l.props,className:n(A,l.props.className)}):r(f,{className:A}),h?g(h,{...h.props,className:n(S,h.props.className)}):r(u,{className:S}),o?g(o,{...o.props,className:n(_,o.props.className)}):r(N,{className:_})]})});d.displayName="Switch";const f=p(({className:t,children:c,...e},a)=>r("div",{...e,className:m("flex justify-center items-center","text-center text-contrast","transition-[margin-inline,background-color]",t),ref:a,children:c}));f.displayName="Switch.Checked";const u=p(({className:t,children:c,...e},a)=>r("div",{...e,className:m("flex justify-center items-center","text-center text-contrast","transition-[margin-inline,background-color]",t),ref:a,children:c}));u.displayName="Switch.Unchecked";const N=p(({className:t,children:c,...e},a)=>r("div",{...e,className:m("flex justify-center items-center","absolute aspect-square scale-80","text-contrast transition-[left,background-color]",t),ref:a,children:c}));N.displayName="Switch.Thumb",d.Checked=f,d.Unchecked=u,d.Thumb=N;export{d as default};
package/dist/tailwind.css CHANGED
@@ -1 +1 @@
1
- @theme static{ --nd-color-primary-0: light-dark(#fafafa, #171717); --nd-color-primary-5: light-dark(#f7f7f7, #1e1e1e); --nd-color-primary-10: light-dark(#f4f4f4, #242424); --nd-color-primary-15: light-dark(#ededed, #2c2c2c); --nd-color-primary-20: light-dark(#e5e5e5, #333333); --nd-color-primary-30: light-dark(#cecece, #434343); --nd-color-primary-40: light-dark(#aeaeae, #575757); --nd-color-primary-50: light-dark(#888888, #888888); --nd-color-primary-60: light-dark(#626262, #b9b9b9); --nd-color-primary-70: light-dark(#424242, #cdcdcd); --nd-color-primary-80: light-dark(#2b2b2b, #dedede); --nd-color-primary-90: light-dark(#1d1d1d, #ececec); --nd-color-primary-100: light-dark(#171717, #fafafa); }@theme{ --color-primary: var(--nd-color-primary-80); --color-primary-hover: var(--nd-color-primary-70); --color-primary-active: var(--nd-color-primary-90); --color-secondary: var(--nd-color-primary-20); --color-secondary-hover: var(--nd-color-primary-30); --color-secondary-active: var(--nd-color-primary-40); --color-tertiary: var(--nd-color-primary-15); --color-tertiary-hover: var(--nd-color-primary-20); --color-tertiary-active: var(--nd-color-primary-30); --color-contrast: var(--nd-color-primary-0); --color-split: var(--nd-color-primary-20); --color-edge: var(--nd-color-primary-30); --text-color-primary: var(--nd-color-primary-100); --text-color-secondary: var(--nd-color-primary-60); --text-color-link: var(--color-primary); --text-color-link-hover: var(--color-primary-hover); --text-color-link-active: var(--color-primary-active); --background-color-container: light-dark(var(--nd-color-primary-0), var(--nd-color-primary-5)); --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.25rem; --text-xl--line-height: 1.75rem; --text-2xl: 1.5rem; --text-2xl--line-height: 2rem; --text-3xl: 1.875rem; --text-3xl--line-height: 2.375rem; --text-4xl: 2.375rem; --text-4xl--line-height: 2.875rem; --text-5xl: 2.875rem; --text-5xl--line-height: 3.375rem; --radius-sm: .125rem; --radius-md: .25rem; --radius-lg: .375rem; --default-transition-duration: .2s; }@utility underline{text-decoration: underline; text-underline-offset: .125rem;}@custom-variant disabled{&.disabled,&:disabled {@slot;}}
1
+ @theme static{ --nd-color-primary-0: light-dark(#fafafa, #171717); --nd-color-primary-5: light-dark(#f7f7f7, #1e1e1e); --nd-color-primary-10: light-dark(#f4f4f4, #242424); --nd-color-primary-15: light-dark(#ededed, #2c2c2c); --nd-color-primary-20: light-dark(#e5e5e5, #333333); --nd-color-primary-30: light-dark(#cecece, #434343); --nd-color-primary-40: light-dark(#aeaeae, #575757); --nd-color-primary-50: light-dark(#888888, #888888); --nd-color-primary-60: light-dark(#626262, #b9b9b9); --nd-color-primary-70: light-dark(#424242, #cdcdcd); --nd-color-primary-80: light-dark(#2b2b2b, #dedede); --nd-color-primary-90: light-dark(#1d1d1d, #ececec); --nd-color-primary-100: light-dark(#171717, #fafafa); }@theme{ --color-primary: var(--nd-color-primary-80); --color-primary-hover: var(--nd-color-primary-70); --color-primary-active: var(--nd-color-primary-90); --color-secondary: var(--nd-color-primary-20); --color-secondary-hover: var(--nd-color-primary-30); --color-secondary-active: var(--nd-color-primary-40); --color-tertiary: var(--nd-color-primary-15); --color-tertiary-hover: var(--nd-color-primary-20); --color-tertiary-active: var(--nd-color-primary-30); --color-contrast: var(--nd-color-primary-0); --color-split: var(--nd-color-primary-20); --color-edge: var(--nd-color-primary-30); --background-color-container: light-dark(var(--nd-color-primary-0), var(--nd-color-primary-5)); --text-color-primary: var(--nd-color-primary-100); --text-color-secondary: var(--nd-color-primary-60); --text-color-link: var(--color-primary); --text-color-link-hover: var(--color-primary-hover); --text-color-link-active: var(--color-primary-active); --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.25rem; --text-xl--line-height: 1.75rem; --text-2xl: 1.5rem; --text-2xl--line-height: 2rem; --text-3xl: 1.875rem; --text-3xl--line-height: 2.375rem; --text-4xl: 2.375rem; --text-4xl--line-height: 2.875rem; --text-5xl: 2.875rem; --text-5xl--line-height: 3.375rem; --radius-sm: .125rem; --radius-md: .25rem; --radius-lg: .375rem; --font-nd: -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"; --default-transition-duration: .2s; }@utility underline{text-decoration: underline; text-underline-offset: .125rem;}@custom-variant disabled{&.disabled,&:disabled {@slot;}}@custom-variant enabled{&:not(.disabled,:disabled) {@slot;}}
@@ -1 +1 @@
1
- import{jsx as d}from"react/jsx-runtime";import{cnMerge as s}from"@nild/shared";import{forwardRef as f}from"react";import{DISABLED_CLS as m}from"../_shared/style/index.js";const r=f(({className:n,children:i,disabled:e,underlined:a,href:t="#",...l},o)=>d("a",{...l,href:e?void 0:t,className:s("nd-link",["font-sans","text-link","text-[length:inherit]","cursor-pointer","enabled:hover:text-link-hover","enabled:active:text-link-active"],m,a?"underline":"no-underline",e&&"disabled",n),ref:o,children:i}));r.displayName="Typography.Link";export{r as default};
1
+ import{jsx as l}from"react/jsx-runtime";import{cnMerge as s}from"@nild/shared";import{forwardRef as f}from"react";import{DISABLED_CLS as m}from"../_shared/style/index.js";const r=f(({className:n,children:i,disabled:e,underlined:a,href:t="#",...d},o)=>l("a",{...d,href:e?void 0:t,className:s("nd-link",["font-nd","text-link","text-[length:inherit]","cursor-pointer","enabled:hover:text-link-hover","enabled:active:text-link-active"],m,a?"underline":"no-underline",e&&"disabled",n),ref:o,children:i}));r.displayName="Typography.Link";export{r as default};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{cnJoin as d,cnMerge as x}from"@nild/shared";import{forwardRef as g}from"react";import{DISABLED_CLS as u}from"../_shared/style/index.js";const s=g(({className:a,children:o,disabled:n,secondary:t,strong:i,deleted:l,underlined:c,italic:m,marked:p,coded:b,keyboarded:h,...y},f)=>{let e=o;return i&&(e=r("strong",{children:e})),l&&(e=r("del",{children:e})),c&&(e=r("u",{className:"underline",children:e})),m&&(e=r("i",{children:e})),p&&(e=r("mark",{className:"text-contrast bg-primary",children:e})),b&&(e=r("code",{className:d("text-sm","ps-1.5 pe-1.5","bg-secondary rounded-sm border border-solid border-secondary"),children:e})),h&&(e=r("kbd",{className:d("text-sm","ps-1.5 pe-1.5","rounded-sm border border-b-2 border-solid border-secondary"),children:e})),r("span",{...y,className:x("nd-text","font-sans text-[length:inherit]",u,n&&"disabled",t?"text-secondary":"text-primary",a),ref:f,children:e})});s.displayName="Typography.Text";export{s as default};
1
+ import{jsx as r}from"react/jsx-runtime";import{cnJoin as d,cnMerge as x}from"@nild/shared";import{forwardRef as g}from"react";import{DISABLED_CLS as u}from"../_shared/style/index.js";const s=g(({className:a,children:o,disabled:n,secondary:t,strong:i,deleted:l,underlined:c,italic:m,marked:p,coded:b,keyboarded:h,...y},f)=>{let e=o;return i&&(e=r("strong",{children:e})),l&&(e=r("del",{children:e})),c&&(e=r("u",{className:"underline",children:e})),m&&(e=r("i",{children:e})),p&&(e=r("mark",{className:"text-contrast bg-primary",children:e})),b&&(e=r("code",{className:d("text-sm","ps-1.5 pe-1.5","bg-secondary rounded-sm border border-solid border-secondary"),children:e})),h&&(e=r("kbd",{className:d("text-sm","ps-1.5 pe-1.5","rounded-sm border border-b-2 border-solid border-secondary"),children:e})),r("span",{...y,className:x("nd-text","font-nd text-[length:inherit]",u,n&&"disabled",t?"text-secondary":"text-primary",a),ref:f,children:e})});s.displayName="Typography.Text";export{s as default};
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{cnMerge as f}from"@nild/shared";import{forwardRef as l}from"react";import{HEADING_LEVEL_CLS_MAP as n}from"./style/index.js";const r=l(({className:a,children:m,level:e=1,...s},o)=>{const t=`h${e}`;return i(t,{...s,className:f(["nd-title","font-sans font-semibold text-primary","mt-[1em] mb-[0.5em]"],n[e],a),ref:o,children:m})});r.displayName="Typography.Title";export{r as default};
1
+ import{jsx as i}from"react/jsx-runtime";import{cnMerge as f}from"@nild/shared";import{forwardRef as l}from"react";import{HEADING_LEVEL_CLS_MAP as n}from"./style/index.js";const r=l(({className:m,children:a,level:e=1,...o},t)=>{const s=`h${e}`;return i(s,{...o,className:f(["nd-title","font-nd font-semibold text-primary","mt-[1em] mb-[0.5em]"],n[e],m),ref:t,children:a})});r.displayName="Typography.Title";export{r as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{cnMerge as p}from"@nild/shared";import{forwardRef as i}from"react";import s from"./Link.js";import f from"./Paragraph.js";import n from"./Text.js";import l from"./Title.js";const r=i(({className:o,children:a,...m},t)=>e("article",{...m,className:p("nd-typography","font-sans text-md",o),ref:t,children:a}));r.Link=s,r.Paragraph=f,r.Text=n,r.Title=l,r.displayName="Typography";export{r as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{cnMerge as p}from"@nild/shared";import{forwardRef as i}from"react";import f from"./Link.js";import s from"./Paragraph.js";import d from"./Text.js";import n from"./Title.js";const r=i(({className:o,children:a,...m},t)=>e("article",{...m,className:p("nd-typography","font-nd text-md",o),ref:t,children:a}));r.Link=f,r.Paragraph=s,r.Text=d,r.Title=n,r.displayName="Typography";export{r 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.11",
4
+ "version": "0.0.13",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
7
7
  "exports": {
@@ -31,8 +31,9 @@
31
31
  "peerDependencies": {
32
32
  "react": ">=18.2.0",
33
33
  "react-dom": ">=18.2.0",
34
- "@nild/hooks": "0.0.9",
35
- "@nild/shared": "0.0.7"
34
+ "@nild/shared": "0.0.7",
35
+ "@nild/icons": "0.0.8",
36
+ "@nild/hooks": "0.0.9"
36
37
  },
37
38
  "scripts": {
38
39
  "build": "vite build --mode PROD",
@@ -1,3 +0,0 @@
1
- import { ReactNode } from 'react';
2
- declare const isEmptyChildren: (children: ReactNode) => boolean;
3
- export default isEmptyChildren;
@@ -1 +0,0 @@
1
- import{isNil as p,isArray as s,isEmpty as e}from"@nild/shared";import{Fragment as a}from"react";const o=r=>!!(p(r)||s(r)&&e(r)||typeof r=="object"&&"type"in r&&r.type===a&&o(r.props.children));export{o as default};