@nild/components 0.0.36 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_shared/utils/index.d.ts +5 -2
- package/dist/_shared/utils/is-plain-children/__tests__/index.test.d.ts +1 -0
- package/dist/_shared/utils/merge-handlers/__tests__/index.test.d.ts +1 -0
- package/dist/_shared/utils/merge-handlers/index.d.ts +3 -0
- package/dist/_shared/utils/merge-props/__tests__/index.test.d.ts +1 -0
- package/dist/_shared/utils/merge-props/index.d.ts +3 -0
- package/dist/_shared/utils/register-slots/__tests__/index.test.d.ts +1 -0
- package/dist/_shared/utils/register-slots/index.d.ts +28 -0
- package/dist/_shared/utils/register-slots/index.js +1 -0
- package/dist/button/__tests__/Button.test.d.ts +0 -0
- package/dist/button/style/index.js +1 -1
- package/dist/checkbox/Checkbox.js +1 -1
- package/dist/checkbox/Indicator.js +1 -1
- package/dist/checkbox/__tests__/Checkbox.test.d.ts +0 -0
- package/dist/checkbox/contexts/index.d.ts +2 -2
- package/dist/checkbox/style/index.d.ts +3 -1
- package/dist/checkbox/style/index.js +1 -1
- package/dist/input/Composite.js +1 -1
- package/dist/input/Input.js +1 -1
- package/dist/input/__tests__/Input.test.d.ts +0 -0
- package/dist/input/style/index.js +1 -1
- package/dist/popup/Popup.js +1 -1
- package/dist/popup/__tests__/Popup.test.d.ts +0 -0
- package/dist/popup/style/index.js +1 -1
- package/dist/radio/Indicator.js +1 -1
- package/dist/radio/Radio.js +1 -1
- package/dist/radio/__tests__/Radio.test.d.ts +0 -0
- package/dist/radio/contexts/index.d.ts +2 -2
- package/dist/radio/style/index.d.ts +4 -1
- package/dist/radio/style/index.js +1 -1
- package/dist/switch/Switch.js +1 -1
- package/dist/switch/__tests__/Switch.test.d.ts +0 -0
- package/dist/switch/style/index.js +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +4 -4
- /package/dist/_shared/utils/{isPlainChildren.d.ts → is-plain-children/index.d.ts} +0 -0
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { default as isPlainChildren } from './
|
|
2
|
-
|
|
1
|
+
import { default as isPlainChildren } from './is-plain-children';
|
|
2
|
+
import { default as mergeHandlers } from './merge-handlers';
|
|
3
|
+
import { default as mergeProps } from './merge-props';
|
|
4
|
+
import { default as registerSlots } from './register-slots';
|
|
5
|
+
export { registerSlots, isPlainChildren, mergeHandlers, mergeProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
interface SlotDefinition {
|
|
3
|
+
isMatched: (child: ReactElement) => boolean;
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
strategy?: 'first' | 'last';
|
|
6
|
+
}
|
|
7
|
+
type SlotSchema = Record<string, SlotDefinition>;
|
|
8
|
+
interface SingleSlot {
|
|
9
|
+
el: ReactElement | null;
|
|
10
|
+
seq: number;
|
|
11
|
+
}
|
|
12
|
+
interface MultipleSlot {
|
|
13
|
+
el: ReactElement[];
|
|
14
|
+
seq: number[];
|
|
15
|
+
}
|
|
16
|
+
interface PlainChild {
|
|
17
|
+
content: string | number;
|
|
18
|
+
seq: number;
|
|
19
|
+
}
|
|
20
|
+
type SlotValue<T extends SlotDefinition> = T['multiple'] extends true ? MultipleSlot : SingleSlot;
|
|
21
|
+
interface CollectSlotsResult<Schema extends SlotSchema> {
|
|
22
|
+
slots: {
|
|
23
|
+
[K in keyof Schema]: SlotValue<Schema[K]>;
|
|
24
|
+
};
|
|
25
|
+
plainChildren: PlainChild[];
|
|
26
|
+
}
|
|
27
|
+
declare const registerSlots: <Schema extends SlotSchema>(schema: Schema) => (children: ReactNode) => CollectSlotsResult<Schema>;
|
|
28
|
+
export default registerSlots;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Children as c,isValidElement as a,Fragment as h}from"react";const m=f=>{const o=Object.entries(f);return p=>{const l=o.reduce((n,[t,e])=>(n[t]=e.multiple?{el:[],seq:[]}:{el:null,seq:-1},n),{}),i=[];let r=0;const u=n=>{c.forEach(n,t=>{if(!(t==null||typeof t=="boolean")){if(a(t)&&t.type===h){u(t.props.children);return}if(typeof t=="string"||typeof t=="number"){i.push({content:t,seq:r}),r+=1;return}if(!a(t)){r+=1;return}for(const[e,s]of o)if(s.isMatched(t)){s.multiple?(l[e].el.push(t),l[e].seq.push(r)):(l[e].el===null||(s.strategy??"last")==="last")&&(l[e].el=t,l[e].seq=r);break}r+=1}})};return u(p),{slots:l,plainChildren:i}}};export{m as default};
|
|
File without changes
|
|
@@ -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"]}]}),o={button:r,group:t,groupedButton:n};export{o as default};
|
|
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"],"focus-visible:ring-focused",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("focus-visible:z-1",{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
|
|
1
|
+
import{jsx as d,jsxs as E}from"react/jsx-runtime";import{useControllableState as G,useEffectCallback as P}from"@nild/hooks";import{cnMerge as R}from"@nild/shared";import{forwardRef as S}from"react";import V from"../_shared/utils/register-slots/index.js";import{useGroupContext as A,CheckboxProvider as B}from"./contexts/index.js";import h from"./Indicator.js";import b from"./Label.js";import F from"./style/index.js";const I=V({indicator:{isMatched:a=>a.type===h},label:{isMatched:a=>a.type===b}}),p=S((a,v)=>{var n;const e=A(),{className:C,children:k,variant:x=e?.variant??"solid",size:c=e?.size??"medium",disabled:i=e?.disabled??!1,checked:q,defaultChecked:y,value:r,onChange:m,...z}=a,{slots:l,plainChildren:s}=I(k),[M,N]=G(e?e.value.includes(r):q,y??!1),g=P(()=>{i||N(t=>(e?e.setValue(t?e.value.filter(w=>w!==r):e.value.concat(r)):m?.(!t),!t))}),u=l.indicator.el??d(h,{}),o=l.label.el??(s.length>0?d(b,{children:s[0].content}):null),j=l.label.el?l.label.seq:((n=s[0])==null?void 0:n.seq)??-1,f=!!l.indicator.el&&!!o&&j<l.indicator.seq;return d(B,{value:{variant:x,size:c,checked:M,disabled:i,setChecked:g},children:E("label",{...z,className:R(F.checkbox({size:c,disabled:i}),C),ref:v,children:[f?o:u,f?u:o]})})});p.displayName="Checkbox";export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as k,jsx as a}from"react/jsx-runtime";import{Icon as u}from"@nild/icons";import x from"@nild/icons/CheckSmall";import{cnMerge as I}from"@nild/shared";import{forwardRef as N}from"react";import{useCheckboxContext as C}from"./contexts/index.js";import e from"./style/index.js";const c=N(({className:s,children:o,...i},t)=>{const{variant:d,size:n,checked:r,disabled:m,setChecked:l}=C(),f=!o,p=o??(h=>a("div",{className:e.defaultIndicatorBlock({variant:d,checked:h}),children:a(u,{className:e.defaultIndicatorIcon(),component:x})}));return k("div",{...i,className:I(e.indicator({size:n,default:f}),s),ref:t,children:[p(!!r),a("input",{type:"checkbox",className:e.indicatorInput(),checked:r,disabled:m,onChange:l})]})});c.displayName="Checkbox.Indicator";export{c as default};
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CheckboxProps, GroupProps } from '../interfaces';
|
|
2
|
-
declare const CheckboxProvider: import('react').Provider<Pick<CheckboxProps, "variant" | "size" | "checked"> & {
|
|
2
|
+
declare const CheckboxProvider: import('react').Provider<Pick<CheckboxProps, "variant" | "size" | "disabled" | "checked"> & {
|
|
3
3
|
setChecked?: () => void;
|
|
4
|
-
}>, useCheckboxContext: () => Pick<CheckboxProps, "variant" | "size" | "checked"> & {
|
|
4
|
+
}>, useCheckboxContext: () => Pick<CheckboxProps, "variant" | "size" | "disabled" | "checked"> & {
|
|
5
5
|
setChecked?: () => void;
|
|
6
6
|
};
|
|
7
7
|
declare const GroupProvider: import('react').Provider<(Pick<GroupProps<unknown>, "variant" | "size" | "disabled"> & {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CheckboxProps, GroupProps } from '../interfaces';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
checkbox: (props?: Pick<CheckboxProps, "size" | "disabled"> | undefined) => string;
|
|
4
|
-
indicator: (props?: Pick<CheckboxProps, "size">
|
|
4
|
+
indicator: (props?: (Pick<CheckboxProps, "size"> & {
|
|
5
|
+
default?: boolean;
|
|
6
|
+
}) | undefined) => string;
|
|
5
7
|
indicatorInput: (props?: object | undefined) => string;
|
|
6
8
|
defaultIndicatorBlock: (props?: Pick<CheckboxProps, "variant" | "checked"> | undefined) => string;
|
|
7
9
|
defaultIndicatorIcon: (props?: object | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
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:
|
|
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(["nd-checkbox-indicator","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"},default:{true:["rounded-sm","transition-[box-shadow]","group-enabled:focus-visible-within:ring-focused"],false:""}}}),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]","group-enabled:group-hover:border-brand-hover"],{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:text-brand-hover"]},{checked:!1,className:["bg-transparent border-main text-transparent"]}]}),d=e(["w-full"]),i=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"}}}),l={checkbox:a,indicator:t,indicatorInput:o,defaultIndicatorBlock:n,defaultIndicatorIcon:d,label:i,group:s};export{l as default};
|
package/dist/input/Composite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as c,jsxs as u}from"react/jsx-runtime";import{cnMerge as f}from"@nild/shared";import{forwardRef as h,cloneElement as v}from"react";import b from"../_shared/utils/register-slots/index.js";import{isAppendElement as E}from"./Append.js";import{CompositeProvider as M}from"./contexts/index.js";import{isInputElement as N}from"./Input.js";import{isPrependElement as x}from"./Prepend.js";import o from"./style/index.js";const I=b({prepend:{isMatched:x},input:{isMatched:N},append:{isMatched:E}}),s=h(({className:i,children:n,variant:p="outlined",size:t="medium",block:r=!1,disabled:l=!1,...m},d)=>{var a;const{slots:e}=I(n);return e.input.el?c(M,{value:{variant:p,size:t,block:r,disabled:l},children:u("span",{ref:d,className:f(o.composite({block:r}),i),...m,children:[e.prepend.el,v(e.input.el,{...(a=e.input.el)==null?void 0:a.props,className:o.compositedInputWrapper({variant:p,prepended:!!e.prepend.el,appended:!!e.append.el})}),e.append.el]})}):null});s.displayName="Input.Composite";export{s as default};
|
package/dist/input/Input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as m,jsxs as y}from"react/jsx-runtime";import{useControllableState as E}from"@nild/hooks";import{cnMerge as N}from"@nild/shared";import{forwardRef as k,isValidElement as I}from"react";import M from"../_shared/utils/register-slots/index.js";import{useCompositeContext as j,InputProvider as P}from"./contexts/index.js";import{isPrefixElement as S}from"./Prefix.js";import p from"./style/index.js";import{isSuffixElement as V}from"./Suffix.js";const w=e=>I(e)&&e.type===r,J=M({prefix:{isMatched:S},suffix:{isMatched:V}}),r=k((e,f)=>{const a=j(),{className:d,children:u,variant:l=a.variant,size:s=a.size,block:c=a.block,disabled:t=a.disabled,type:x="text",value:v,defaultValue:b="",onChange:o,...h}=e,{slots:n}=J(u),[g,z]=E(v,b),C=i=>{z(i.target.value),o?.(i.target.value,i)};return m(P,{value:{size:s,disabled:t,variant:l},children:y("span",{className:N(p.inputWrapper({variant:l,size:s,block:c,disabled:t}),d),children:[n.prefix.el,m("input",{ref:f,type:x,value:g,onChange:C,disabled:t,className:p.input({size:s}),...h}),n.suffix.el]})})});r.displayName="Input";export{r as default,w as isInputElement};
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
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"
|
|
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"]}]}),a=e(["nd-input-wrapper","group",["inline-flex","items-center","box-border","font-nd","transition-colors","overflow-hidden"],["border","enabled:focus-within:border-brand","enabled:focus-within:z-1"],"enabled:focus-visible-within:ring-focused",t],{variants:{variant:{outlined:["bg-transparent","border-main","enabled:hover:border-brand-hover"],filled:["bg-muted","border-subtle","enabled:[&:hover:not(:focus-within)]:bg-muted-hover","enabled:[&:hover:not(:focus-within)]:border-muted"]},size:{small:["h-6","text-sm","rounded-sm"],medium:["h-8","text-md","rounded-md"],large:["h-10","text-lg","rounded-md"]},block:{true:["flex","w-full"],false:""},disabled:{true:"disabled",false:""}}}),i=e(["nd-input","flex-auto","h-full","bg-transparent","border-none","outline-none","p-0","m-0","text-main","placeholder:text-subtle","disabled:cursor-not-allowed","[&::-ms-reveal]:hidden","[&::-ms-clear]:hidden","[&::-webkit-inner-spin-button]:appearance-none","[&::-webkit-outer-spin-button]:appearance-none","[&::-webkit-inner-spin-button]:m-0","[&::-webkit-outer-spin-button]:m-0","[-moz-appearance:textfield]"],{variants:{size:{small:["px-2","text-sm"],medium:["px-3","text-md"],large:["px-4","text-lg"]}}}),s=e(["nd-input-prefix","shrink-0","h-full","inline-flex","items-center","text-muted"],{variants:{size:{small:["pl-2","text-sm"],medium:["pl-3","text-md"],large:["pl-4","text-lg"]}}}),l=e(["nd-input-suffix","shrink-0","h-full","inline-flex","items-center","text-muted"],{variants:{size:{small:["pr-2","text-sm"],medium:["pr-3","text-md"],large:["pr-4","text-lg"]}}}),d=e(["shrink-0"],{variants:{variant:{outlined:["mr-[-1px]","hover:z-1","focus:z-1","focus-within:z-1"],filled:[]},type:{string:["inline-flex","items-center","border"],element:["rounded-r-none"]},size:{small:["h-6","text-sm","rounded-l-sm"],medium:["h-8","text-md","rounded-l-md"],large:["h-10","text-lg","rounded-l-md"]}},compoundVariants:[{type:"string",variant:"outlined",className:["bg-muted","border-main","text-muted"]},{type:"string",variant:"filled",className:["bg-brand","border-transparent","text-brand-contrast"]},{type:"string",size:"small",className:["px-2"]},{type:"string",size:"medium",className:["px-3"]},{type:"string",size:"large",className:["px-4"]}]}),o=e(["shrink-0"],{variants:{type:{string:["inline-flex","items-center","border"],element:["rounded-l-none","h-auto"]},size:{small:["h-6","text-sm","rounded-r-sm"],medium:["h-8","text-md","rounded-r-md"],large:["h-10","text-lg","rounded-r-md"]}},compoundVariants:[{type:"string",variant:"outlined",className:["bg-muted","border-main","text-muted"]},{type:"string",variant:"filled",className:["bg-brand","border-transparent","text-brand-contrast"]},{type:"string",size:"small",className:["px-2"]},{type:"string",size:"medium",className:["px-3"]},{type:"string",size:"large",className:["px-4"]}]}),m=e(["group-focus-within:text-brand"]),p=e(["gap-2","items-center"],{variants:{block:{true:["flex","w-full"],false:["inline-flex"]}}}),u=e(["flex-auto","min-w-0","text-center"],{compoundVariants:[{size:"small",block:!1,className:["w-6"]},{size:"medium",block:!1,className:["w-8"]},{size:"large",block:!1,className:["w-10"]}]}),x={composite:n,compositedInputWrapper:r,inputWrapper:a,input:i,prefix:s,suffix:l,prepend:d,append:o,searchIcon:m,otpWrapper:p,otpInputWrapper:u};export{x as default};
|
package/dist/popup/Popup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as H,jsx as l}from"react/jsx-runtime";import{useControllableState as J,useEffectCallback as f,useIsomorphicLayoutEffect as K}from"@nild/hooks";import{isArray as Q,makeArray as V,isFunction as W}from"@nild/shared";import{useState as X,useMemo as P,useRef as Y}from"react";import Z from"../_shared/utils/register-slots/index.js";import _ from"../transition/Transition.js";import{PopupProvider as $,PortalProvider as G,ArrowProvider as ee}from"./contexts/index.js";import re from"./hooks/usePopup.js";import R from"./Portal.js";import m from"./Trigger.js";const te=Z({trigger:{isMatched:e=>e.type===m},portal:{isMatched:e=>e.type===R},firstBare:{isMatched:e=>e.type!==m&&e.type!==R,strategy:"first"}}),T=({children:e,placement:b,offset:x,action:d="click",size:h="medium",arrowed:v=!0,inverse:y=!1,delay:a=100,open:A,defaultOpen:g=!1,disabled:B,onOpen:w,onClose:C})=>{const{slots:t}=te(e),[o,O]=X(g),[s,j]=J(A,g),[k,z=100]=Q(a)?a:[a,a],i=P(()=>new Set(V(d)),[d]),r=Y(),[{triggerRef:n,portalRef:u,portalContext:E,arrowRef:S,arrowContext:F},{update:I,autoUpdate:L}]=re({placement:b,offset:x}),p=f(c=>{B||j(D=>{const M=W(c)?c(D):c;return M?w?.():C?.(),M})}),N=f(()=>{i.has("hover")&&(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{p(!0)},k))}),U=f(()=>{i.has("hover")&&(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{p(!1)},z))}),q=P(()=>({actions:i,size:h,arrowed:v,inverse:y,refs:{trigger:n,portal:u,arrow:S},setOpen:p,enter:N,leave:U}),[i,h,v,y]);return K(()=>{if(s&&!o)O(!0);else if(s&&o&&n.current&&u.current)return L(n.current,u.current,I)},[s,o]),H($,{value:q,children:[t.trigger.el??(t.firstBare.el&&l(m,{children:t.firstBare.el})),l(G,{value:E,children:l(ee,{value:F,children:t.portal.el&&l(_,{visible:s,children:o&&t.portal.el})})})]})};T.displayName="Popup";export{T as default};
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
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-
|
|
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-muted)]"]},{orientation:"down",className:["shadow-[1px_1px_0_0_var(--border-color-muted)]"]},{orientation:"left",className:["shadow-[-1px_1px_0_0_var(--border-color-muted)]"]},{orientation:"right",className:["shadow-[1px_-1px_0_0_var(--border-color-muted)]"]}]}),s={trigger:e,portal:a,portalContent:t,arrow:o};export{s as default};
|
package/dist/radio/Indicator.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as t,jsx as a}from"react/jsx-runtime";import{cnMerge as d}from"@nild/shared";import{forwardRef as x}from"react";import{useRadioContext as g}from"./contexts/index.js";import e from"./style/index.js";const o=x(({className:n,children:c,...l},m)=>{const{variant:r,size:f,checked:i,disabled:p,setChecked:u}=g(),h=!c,v=c??(s=>t("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e.defaultIndicatorSvg(),children:[a("circle",{cx:"10",cy:"10",className:d(e.defaultIndicatorOuterCircle({variant:r,checked:s}))}),a("circle",{cx:"10",cy:"10",className:e.defaultIndicatorInnerCircle({variant:r,checked:s})})]}));return t("div",{...l,className:d(e.indicator({size:f,default:h}),n),ref:m,children:[v(!!i),a("input",{type:"radio",className:e.indicatorInput(),checked:i,disabled:p,onChange:u})]})});o.displayName="Radio.Indicator";export{o as default};
|
package/dist/radio/Radio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as j}from"react/jsx-runtime";import{useControllableState as w,useEffectCallback as E}from"@nild/hooks";import{cnMerge as G}from"@nild/shared";import{forwardRef as P}from"react";import S from"../_shared/utils/register-slots/index.js";import{useGroupContext as V,RadioProvider as A}from"./contexts/index.js";import p from"./Indicator.js";import h from"./Label.js";import F from"./style/index.js";const I=S({indicator:{isMatched:a=>a.type===p},label:{isMatched:a=>a.type===h}}),v=P((a,b)=>{var d;const e=V(),{className:C,children:k,variant:x=e?.variant??"solid",size:n=e?.size??"medium",disabled:i=e?.disabled??!1,checked:z,defaultChecked:q,value:c,onChange:m,...y}=a,{slots:l,plainChildren:o}=I(k),[M,N]=w(e?e.value===c:z,q??!1),R=E(()=>{i||N(s=>s||(e?e.setValue(c):m?.(!s),!s))}),u=l.indicator.el??t(p,{}),r=l.label.el??(o.length>0?t(h,{children:o[0].content}):null),g=l.label.el?l.label.seq:((d=o[0])==null?void 0:d.seq)??-1,f=!!l.indicator.el&&!!r&&g<l.indicator.seq;return t(A,{value:{variant:x,size:n,checked:M,disabled:i,setChecked:R},children:j("label",{...y,className:G(F.radio({size:n,disabled:i}),C),ref:b,children:[f?r:u,f?u:r]})})});v.displayName="Radio";export{v as default};
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RadioProps, GroupProps } from '../interfaces';
|
|
2
|
-
declare const RadioProvider: import('react').Provider<Pick<RadioProps, "variant" | "size" | "checked"> & {
|
|
2
|
+
declare const RadioProvider: import('react').Provider<Pick<RadioProps, "variant" | "size" | "disabled" | "checked"> & {
|
|
3
3
|
setChecked?: () => void;
|
|
4
|
-
}>, useRadioContext: () => Pick<RadioProps, "variant" | "size" | "checked"> & {
|
|
4
|
+
}>, useRadioContext: () => Pick<RadioProps, "variant" | "size" | "disabled" | "checked"> & {
|
|
5
5
|
setChecked?: () => void;
|
|
6
6
|
};
|
|
7
7
|
declare const GroupProvider: import('react').Provider<(Pick<GroupProps<unknown>, "variant" | "size" | "disabled"> & {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { RadioProps, GroupProps } from '../interfaces';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
radio: (props?: Pick<RadioProps, "size" | "disabled"> | undefined) => string;
|
|
4
|
-
indicator: (props?: Pick<RadioProps, "size">
|
|
4
|
+
indicator: (props?: (Pick<RadioProps, "size"> & {
|
|
5
|
+
default?: boolean;
|
|
6
|
+
}) | undefined) => string;
|
|
5
7
|
indicatorInput: (props?: object | undefined) => string;
|
|
8
|
+
defaultIndicatorSvg: (props?: object | undefined) => string;
|
|
6
9
|
defaultIndicatorOuterCircle: (props?: Pick<RadioProps, "variant" | "checked"> | undefined) => string;
|
|
7
10
|
defaultIndicatorInnerCircle: (props?: Pick<RadioProps, "variant" | "checked"> | undefined) => string;
|
|
8
11
|
label: (props?: Pick<RadioProps, "size"> | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
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"}}}),
|
|
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(["nd-radio-indicator","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"},default:{true:["rounded-full","transition-[box-shadow]","group-enabled:focus-visible-within:ring-focused"],false:""}}}),i=e([["absolute","inset-0","opacity-0"],["group-enabled:cursor-pointer","group-disabled:cursor-not-allowed"]]),l=e(["size-full"]),o=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"]}]}),n=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"}}}),d=e(["nd-radio-group",["flex","gap-x-4","gap-y-2"]],{variants:{direction:{horizontal:"flex-row flex-wrap",vertical:"flex-col"}}}),c={radio:r,indicator:t,indicatorInput:i,defaultIndicatorSvg:l,defaultIndicatorOuterCircle:o,defaultIndicatorInnerCircle:n,label:s,group:d};export{c as default};
|
package/dist/switch/Switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as c,jsxs as x}from"react/jsx-runtime";import{useControllableState as C}from"@nild/hooks";import{cnMerge as N}from"@nild/shared";import{forwardRef as S}from"react";import j from"../_shared/utils/register-slots/index.js";import{SwitchProvider as z}from"./contexts/index.js";import P from"./style/index.js";import h from"./Thumb.js";import a from"./Track.js";const R=j({checkedTrack:{isMatched:e=>e.type===a&&e.props.type==="checked"},uncheckedTrack:{isMatched:e=>e.type===a&&e.props.type==="unchecked"},thumb:{isMatched:e=>e.type===h}}),p=S(({className:e,children:m,variant:s="solid",size:i="medium",shape:o="round",checked:n,defaultChecked:u,value:k,defaultValue:f,disabled:y,onChange:d,style:v,...g},b)=>{const{slots:t}=R(m),w={"--nd-switch-height":{small:"calc(var(--spacing) * 4)",medium:"calc(var(--spacing) * 6)",large:"calc(var(--spacing) * 8)"}[i]},[r,M]=C(n??k,u??f??!1),T=()=>{M(l=>(d?.(!l),!l))};return c(z,{value:{variant:s,shape:o,checked:r},children:x("button",{...g,type:"button",role:"switch","aria-checked":r,disabled:y,className:N(P.switch({variant:s,size:i,shape:o,checked:r}),e),style:{...w,...v},ref:b,onClick:T,children:[t.checkedTrack.el??c(a,{type:"checked"}),t.uncheckedTrack.el??c(a,{type:"unchecked"}),t.thumb.el??c(h,{})]})})});p.displayName="Switch";export{p as default};
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cva as e}from"@nild/shared";import{DISABLED_CLS as
|
|
1
|
+
import{cva as e}from"@nild/shared";import{DISABLED_CLS as a}from"../../_shared/style/index.js";const t=e(["nd-switch","group","h-[var(--nd-switch-height)]",["relative","inline-block","font-nd","overflow-hidden","cursor-pointer"],"transition-[outline-color,box-shadow]",a],{variants:{variant:{solid:"focus-visible:ring-focused",outlined:["outline","focus-visible:ring-focused-with-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","top-0","aspect-square","scale-80"],["text-brand-contrast","transition-[left,background-color]"]],{variants:{variant:{solid:["bg-brand-contrast"],outlined:["bg-emphasized","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"}},compoundVariants:[{variant:"outlined",checked:!0,className:["bg-brand"]}]}),c={switch:t,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(
|
|
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(95% var(--nd-brand-c) var(--nd-brand-h)), oklch(20% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-15: light-dark( oklch(92% var(--nd-brand-c) var(--nd-brand-h)), oklch(25% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-20: light-dark( oklch(88% var(--nd-brand-c) var(--nd-brand-h)), oklch(30% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-30: light-dark( oklch(80% var(--nd-brand-c) var(--nd-brand-h)), oklch(38% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-40: light-dark( oklch(72% var(--nd-brand-c) var(--nd-brand-h)), oklch(46% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-50: light-dark( oklch(64% var(--nd-brand-c) var(--nd-brand-h)), oklch(52% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-60: oklch(58% var(--nd-brand-c) var(--nd-brand-h)); --nd-color-brand-70: light-dark( oklch(50% var(--nd-brand-c) var(--nd-brand-h)), oklch(66% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-80: light-dark( oklch(40% var(--nd-brand-c) var(--nd-brand-h)), oklch(76% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-90: light-dark( oklch(30% var(--nd-brand-c) var(--nd-brand-h)), oklch(88% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-brand-100: light-dark( oklch(20% var(--nd-brand-c) var(--nd-brand-h)), oklch(96% var(--nd-brand-c) var(--nd-brand-h)) ); --nd-color-neutral-0: light-dark( oklch(99% 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(97.5% 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(95.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(92.5% 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(89% 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(81% 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(72% 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(32% 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(22% 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: light-dark(var(--nd-color-brand-50), var(--nd-color-brand-70)); --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)); --color-brand-ring: light-dark( color-mix(in oklch, var(--nd-color-brand-60) 28%, transparent), color-mix(in oklch, var(--nd-color-brand-60) 36%, transparent) ); --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-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --shadow-sm: 0 0 0 .8px var(--border-color-muted), 0 1px 2px 0 var(--nd-color-shadow-key); --shadow-md: 0 0 0 .8px var(--border-color-muted), 0 4px 6px -1px var(--nd-color-shadow-key), 0 2px 4px -2px var(--nd-color-shadow-ambient); --shadow-lg: 0 0 0 .8px var(--border-color-muted), 0 10px 15px -3px var(--nd-color-shadow-key), 0 4px 6px -4px var(--nd-color-shadow-ambient); --shadow-xl: 0 0 0 .8px var(--border-color-muted), 0 20px 25px -5px var(--nd-color-shadow-key), 0 8px 10px -6px var(--nd-color-shadow-ambient); --shadow-2xl: 0 0 0 .8px var(--border-color-muted), 0 25px 50px -12px var(--nd-color-shadow-key), 0 12px 24px -12px 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 ring-focused{outline: none; box-shadow: 0 0 0 .2rem var(--color-brand-ring),var(--tw-shadow, 0 0 #00000000);}@utility ring-focused-with-outline{box-shadow: 0 0 0 .2rem var(--color-brand-ring),var(--tw-shadow, 0 0 #00000000);}@utility r-*{r: --value(number);}@custom-variant focus-visible-within{&:has(:focus-visible) {@slot;}}@custom-variant disabled{&.disabled,&:disabled {@slot;}}@custom-variant enabled{&:not(.disabled,:disabled) {@slot;}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nild/components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.38",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^18.2.0",
|
|
33
33
|
"react-dom": "^18.2.0",
|
|
34
|
-
"@nild/shared": "0.0.
|
|
35
|
-
"@nild/hooks": "0.0.
|
|
36
|
-
"@nild/icons": "0.0.
|
|
34
|
+
"@nild/shared": "0.0.16",
|
|
35
|
+
"@nild/hooks": "0.0.18",
|
|
36
|
+
"@nild/icons": "0.0.18"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "vite build --mode PROD",
|
|
File without changes
|