@nice2dev/ui 1.0.21 → 1.0.23

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 (123) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/dist/NiceErrorBoundary-B0262Ffc.js +770 -0
  3. package/dist/NiceErrorBoundary-BNhkOZtq.cjs +1 -0
  4. package/dist/NiceErrorBoundary-BXOLv-zG.cjs +1 -0
  5. package/dist/NiceErrorBoundary-DsreAsON.cjs +1 -0
  6. package/dist/NiceErrorBoundary-DyPWyuki.js +770 -0
  7. package/dist/NiceErrorBoundary-HMfrXIir.js +770 -0
  8. package/dist/NiceForm-B7D1MASh.js +5383 -0
  9. package/dist/NiceForm-BA9zZdm8.cjs +382 -0
  10. package/dist/NiceForm-Ba9rvBoT.cjs +382 -0
  11. package/dist/NiceForm-DAGMJpgx.js +5383 -0
  12. package/dist/NiceForm-D_ifvkIf.js +5386 -0
  13. package/dist/NiceForm-kd4essRP.cjs +382 -0
  14. package/dist/NiceForm.css +1 -1
  15. package/dist/NiceModal-4DLpDmAl.js +95 -0
  16. package/dist/NiceModal-BVT9cZbf.cjs +1 -0
  17. package/dist/NiceModal-CiOYOWJy.cjs +1 -0
  18. package/dist/NiceModal-D2xJTZZf.cjs +1 -0
  19. package/dist/NiceModal-DZbHCdKq.js +95 -0
  20. package/dist/NiceModal-MeC1cNtW.js +95 -0
  21. package/dist/NiceModuleLifecyclePanel-BZMUuDad.js +6807 -0
  22. package/dist/NiceModuleLifecyclePanel-BiX4KxaK.js +6781 -0
  23. package/dist/NiceModuleLifecyclePanel-C54g5eV_.cjs +1 -0
  24. package/dist/NiceModuleLifecyclePanel-CDo0iVfr.js +6781 -0
  25. package/dist/NiceModuleLifecyclePanel-DEJpoz5a.cjs +1 -0
  26. package/dist/NiceModuleLifecyclePanel-DrDTpH6K.cjs +1 -0
  27. package/dist/NiceModuleLifecyclePanel.css +1 -1
  28. package/dist/NicePagination-3be3_sVK.js +171 -0
  29. package/dist/NicePagination-BCRsVzkR.cjs +1 -0
  30. package/dist/NicePagination-C8gx6Bcl.js +171 -0
  31. package/dist/NicePagination-CNxEAb4C.cjs +1 -0
  32. package/dist/NicePagination-Cg_WEf-R.cjs +1 -0
  33. package/dist/NicePagination-DQXdzx7W.js +171 -0
  34. package/dist/NicePinCodeInput-3WugpLHi.js +12240 -0
  35. package/dist/NicePinCodeInput-BD2bMmVF.cjs +696 -0
  36. package/dist/NicePinCodeInput-CSfRHs4v.cjs +419 -0
  37. package/dist/NicePinCodeInput-CjwFvOEQ.js +13092 -0
  38. package/dist/NicePinCodeInput-DCLRLR8a.js +13097 -0
  39. package/dist/NicePinCodeInput-DoBQnMj9.cjs +694 -0
  40. package/dist/NiceSavedQueryPanel-DFDDuKWd.js +6597 -0
  41. package/dist/NiceSavedQueryPanel-DT9v7kUB.cjs +596 -0
  42. package/dist/NiceSavedQueryPanel-DTU4eiIH.cjs +596 -0
  43. package/dist/NiceSavedQueryPanel-RLj3BnDR.js +6866 -0
  44. package/dist/NiceSavedQueryPanel-qtWETcRP.cjs +596 -0
  45. package/dist/NiceSavedQueryPanel-z29D7N_A.js +6584 -0
  46. package/dist/NiceTabs-B4dM77y_.js +1657 -0
  47. package/dist/NiceTabs-BTVTtRZR.cjs +1 -0
  48. package/dist/NiceTabs-BXGmot7J.cjs +1 -0
  49. package/dist/NiceTabs-CFA8DGYR.cjs +1 -0
  50. package/dist/NiceTabs-Cx9DN6QD.js +1657 -0
  51. package/dist/NiceTabs-DJdhKste.js +1657 -0
  52. package/dist/NiceWindow-5VCSBJrc.js +1592 -0
  53. package/dist/NiceWindow-BEFAUTLp.cjs +1 -0
  54. package/dist/NiceWindow-Cs6-Dbci.js +1592 -0
  55. package/dist/NiceWindow-DYw4NCeb.js +1592 -0
  56. package/dist/NiceWindow-O_g8StvA.cjs +1 -0
  57. package/dist/NiceWindow-a4wB_m30.cjs +1 -0
  58. package/dist/NiceWindow.css +1 -0
  59. package/dist/charts-BDr6B81L.js +4657 -0
  60. package/dist/charts-Ci_KrAoU.cjs +761 -0
  61. package/dist/charts-ClxW-i5q.js +4657 -0
  62. package/dist/charts-De7FYS1U.cjs +761 -0
  63. package/dist/charts-DjFvhCdD.js +4657 -0
  64. package/dist/charts-Dr_FIPZT.cjs +761 -0
  65. package/dist/charts.cjs +1 -1
  66. package/dist/charts.mjs +1 -1
  67. package/dist/core-BIz6zQ5u.cjs +122 -0
  68. package/dist/core-BYxnKGOi.js +23141 -0
  69. package/dist/core-CT5vpy5U.js +25248 -0
  70. package/dist/core-CZE5v34h.cjs +122 -0
  71. package/dist/core-Cjw8oBvC.cjs +96 -0
  72. package/dist/core-xcuNJ-DB.js +24948 -0
  73. package/dist/data-branching-B7dCyaWr.cjs +1 -0
  74. package/dist/data-branching-BPAeL45o.js +6133 -0
  75. package/dist/data-branching-Byz79mmA.cjs +1 -0
  76. package/dist/data-branching-DjuerHfS.js +6133 -0
  77. package/dist/data-branching.cjs +1 -1
  78. package/dist/data-branching.d.ts +3 -0
  79. package/dist/data-branching.mjs +1 -1
  80. package/dist/data.cjs +1 -1
  81. package/dist/data.d.ts +45 -7
  82. package/dist/data.mjs +1 -1
  83. package/dist/devops-C3Pmbnxc.js +7684 -0
  84. package/dist/devops-CrXz348W.cjs +17 -0
  85. package/dist/devops-DYFov8j3.js +7684 -0
  86. package/dist/devops-g4qcLXah.cjs +17 -0
  87. package/dist/devops.cjs +1 -1
  88. package/dist/devops.d.ts +5 -0
  89. package/dist/devops.mjs +1 -1
  90. package/dist/editors.cjs +1 -1
  91. package/dist/editors.d.ts +175 -1
  92. package/dist/editors.mjs +44 -41
  93. package/dist/feedback.cjs +1 -1
  94. package/dist/feedback.d.ts +1 -2
  95. package/dist/feedback.mjs +2 -2
  96. package/dist/index-9Gi1mNY7.js +67912 -0
  97. package/dist/index-AEO3cK4T.cjs +5194 -0
  98. package/dist/index-BMQ-F0zE.js +65054 -0
  99. package/dist/index-BNb9q4Ll.cjs +5490 -0
  100. package/dist/index-CjdfogVa.js +66711 -0
  101. package/dist/index-Di3Cgr1P.cjs +5518 -0
  102. package/dist/index.cjs +1 -1
  103. package/dist/index.css +1 -1
  104. package/dist/index.d.ts +752 -62
  105. package/dist/index.mjs +982 -963
  106. package/dist/lazy.cjs +1 -1
  107. package/dist/lazy.d.ts +11 -0
  108. package/dist/lazy.mjs +24 -24
  109. package/dist/navigation.cjs +1 -1
  110. package/dist/navigation.d.ts +30 -4
  111. package/dist/navigation.mjs +34 -34
  112. package/dist/no-code-CHvv1KjZ.cjs +332 -0
  113. package/dist/no-code-CyvddsYt.js +7133 -0
  114. package/dist/no-code-Dl3ima61.cjs +332 -0
  115. package/dist/no-code-ktRzFaET.js +7133 -0
  116. package/dist/no-code.cjs +1 -1
  117. package/dist/no-code.d.ts +11 -0
  118. package/dist/no-code.mjs +1 -1
  119. package/dist/overlays.cjs +1 -1
  120. package/dist/overlays.d.ts +38 -0
  121. package/dist/overlays.mjs +52 -52
  122. package/dist/style.css +7 -4
  123. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),o=require("./core-Cjw8oBvC.cjs"),l=require("react"),Ie=require("react-dom"),Ce=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,readOnly:i,size:d="md",name:y,id:h,className:f,style:_,accessMode:S,displayStyle:z,variant:x,value:w,defaultValue:E,onChange:m,onBlur:Y,onKeyDown:D,placeholder:$,type:F="text",maxLength:g,prefix:I,suffix:U,clearable:R,autoFocus:T,submitOnEnter:k,onSubmit:A,showKeyboardHints:Z,labelPlacement:L,errorPlacement:W,loading:re,labelWidth:le,controlWidth:G,displayMode:P,...de},b)=>{const N=o.Zs(S,h),J=N==="hidden";N==="disabled"&&(n=!0),N==="readOnly"&&(i=!0);const{t:H}=o.Jo(),M=o.Hs(h),ee=o.vs("input",z),ae=o.Ss("input",z),ue=x==="filled"?"filled":x==="underlined"?"underlined":"",X=l.useCallback(()=>m?.(""),[m]),V=o.Ms({enabled:P,readOnly:i,disabled:n}),oe=o.gc({enabled:k,onSubmit:A}),ie=l.useCallback(v=>{oe(v),D?.(v)},[oe,D]),a=l.useMemo(()=>{const v=[];return k&&v.push({key:"Enter",description:H("shortcuts.submit","Submit")}),R&&v.push({key:"Escape",description:H("shortcuts.clear","Clear")}),v},[k,R,H]);return J?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${L==="left"?"nice-field--label-left":""} ${L==="inside"?"nice-field--label-inside":""} ${re?"nice-field--loading":""} ${f||""}`,style:{..._,...le!=null&&{"--nice-field-label-width":typeof le=="number"?`${le}px`:le},...G!=null&&{"--nice-field-control-width":typeof G=="number"?`${G}px`:G}},"aria-busy":re||void 0,"data-floating":L==="inside"&&w?"true":void 0,children:[t&&L!=="inside"&&e.jsxs("label",{htmlFor:M,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,Z&&a.length>0&&e.jsx(o.Kr,{shortcuts:a,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[V.isDisplay?e.jsx(o.Cs,{value:w??E??"",placeholder:$,disabled:n,readOnly:i,onActivate:V.enterEdit,ariaLabel:t}):e.jsxs("div",{className:`nice-input nice-input--${d} nice-input--ds-${ue||ae} ${s?"nice-input--error":""} ${n?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:x?void 0:ee,children:[I&&e.jsx("span",{className:"nice-input__icon",children:I}),e.jsx("input",{ref:v=>{typeof b=="function"?b(v):b&&(b.current=v),V.autoFocusRef(v)},id:M,className:"nice-input__native",type:F,name:y,value:w,defaultValue:E,placeholder:$,disabled:n||re,readOnly:i,maxLength:g,autoFocus:T,"aria-invalid":!!s,"aria-describedby":s?`${M}-error`:p?`${M}-helper`:void 0,onChange:v=>m?.(v.target.value),onBlur:v=>{P&&V.exitEdit(),Y?.(v)},onKeyDown:ie,...de}),R&&w&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:X,"aria-label":H("controls.clear","Clear"),children:"✕"}),U&&e.jsx("span",{className:"nice-input__icon",children:U}),t&&L==="inside"&&e.jsx("label",{htmlFor:M,className:`nice-input__floating-label ${u?"nice-input__floating-label--required":""}`,children:t})]}),re&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),W==="right"&&s&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:s}),W==="right"&&!s&&p&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:p})]}),W!=="right"&&s&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:s}),W!=="right"&&!s&&p&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:p})]})});Ce.displayName="NiceTextInput";const He=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:Ce},Symbol.toStringTag,{value:"Module"})),Se=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,readOnly:i,size:d="md",name:y,id:h,className:f,style:_,accessMode:S,displayStyle:z,value:x,onChange:w,onBlur:E,onKeyDown:m,placeholder:Y,min:D,max:$,step:F=1,precision:g,prefix:I,prefixType:U="label",prefixOptions:R,prefixValue:T,onPrefixChange:k,suffix:A,showStepper:Z=!0,submitOnEnter:L,onSubmit:W,showKeyboardHints:re,labelPlacement:le,errorPlacement:G,loading:P,labelWidth:de,controlWidth:b,formatPreset:N,format:J,suffixType:H="label",suffixOptions:M,suffixValue:ee,onSuffixChange:ae,displayMode:ue},X)=>{const V=o.Zs(S,h),oe=V==="hidden";V==="disabled"&&(n=!0),V==="readOnly"&&(i=!0);const{t:ie}=o.Jo(),a=o.Hs(h),v=o.vs("input",z),q=o.Ss("input",z),[C,Q]=l.useState(!1),[O,xe]=l.useState(null),ve=o.Ms({enabled:ue,readOnly:i,disabled:n}),pe=l.useMemo(()=>{let c=3;return $!=null&&(c=String(Math.abs(Math.floor($))).length),D!=null&&D<0&&(c+=1),g&&(c+=g+1),Math.max(3,c)+1},[$,D,g]),je=l.useCallback(c=>{if(J)return J(c);if(!N)return g!=null?c.toFixed(g):String(c);switch(N){case"integer":return Math.round(c).toLocaleString();case"decimal":return c.toLocaleString(void 0,{minimumFractionDigits:g??2,maximumFractionDigits:g??2});case"money":return c.toLocaleString(void 0,{minimumFractionDigits:g??2,maximumFractionDigits:g??2,useGrouping:!0});case"percent":return(c*100).toLocaleString(void 0,{minimumFractionDigits:g??0,maximumFractionDigits:g??2})+"%";default:return String(c)}},[J,N,g]),ye=l.useMemo(()=>C&&O!==null?O:x==null?"":C?g!=null?x.toFixed(g):String(x):je(x),[x,C,O,je,g]),fe=x!=null&&x<0,se=!!(I||U==="select"&&R&&R.length>0),ne=fe&&se&&!C,we=ne?ye.replace(/^[-−]/,""):ye,he=l.useCallback(c=>{let j=c;return D!==void 0&&(j=Math.max(D,j)),$!==void 0&&(j=Math.min($,j)),g!==void 0&&(j=parseFloat(j.toFixed(g))),j},[D,$,g]),Me=l.useCallback(c=>{const j=c.target.value;if(xe(j),j===""||j==="-"||j==="."||j==="-."){j===""&&w?.(null);return}const ce=parseFloat(j);if(!isNaN(ce)){let _e=ce;D!==void 0&&(_e=Math.max(D,_e)),$!==void 0&&(_e=Math.min($,_e)),w?.(_e)}},[w,D,$]),ge=l.useCallback(()=>{const c=be.current,j=he((c??0)+F);be.current=j,w?.(j)},[F,w,he]),$e=l.useCallback(()=>{const c=be.current,j=he((c??0)-F);be.current=j,w?.(j)},[F,w,he]),be=l.useRef(x);be.current=x;const r=l.useRef(null),B=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),K=l.useCallback(c=>{B();let j=300;const ce=()=>{c(),j=Math.max(30,j*.82),r.current=setTimeout(ce,j)};r.current=setTimeout(ce,400)},[B]),me=o.gc({enabled:L,onSubmit:W}),ke=l.useCallback(c=>{me(c),c.key==="ArrowUp"?(c.preventDefault(),ge()):c.key==="ArrowDown"&&(c.preventDefault(),$e()),m?.(c)},[me,m,ge,$e]),te=l.useMemo(()=>{const c=[];return L&&c.push(o.mc.submit),Z&&(c.push({key:"ArrowUp",description:ie("shortcuts.increment","Increase value")}),c.push({key:"ArrowDown",description:ie("shortcuts.decrement","Decrease value")})),c},[L,Z,ie]);return oe?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${le==="left"?"nice-field--label-left":""} ${P?"nice-field--loading":""} ${f||""}`,style:{..._,...de!=null&&{"--nice-field-label-width":typeof de=="number"?`${de}px`:de},...b!=null&&{"--nice-field-control-width":typeof b=="number"?`${b}px`:b}},"aria-busy":P||void 0,children:[t&&e.jsxs("label",{htmlFor:a,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,re&&te.length>0&&e.jsx(o.Kr,{shortcuts:te,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ve.isDisplay?e.jsx(o.Cs,{value:x==null?"":I?e.jsxs(e.Fragment,{children:[I,ye]}):ye,placeholder:Y,disabled:n,readOnly:i,onActivate:ve.enterEdit,ariaLabel:t}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${d} nice-input--ds-${q} ${s?"nice-input--error":""} ${n?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:v,children:[Z&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:$e,onMouseDown:()=>K($e),onMouseUp:B,onMouseLeave:B,disabled:n,"aria-label":ie("controls.decrement","Decrement"),children:"−"}),U==="select"&&R&&R.length>0?e.jsxs(e.Fragment,{children:[ne&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:T??R[0]?.value,disabled:n,onChange:c=>{const j=c.target.value,ce=R.find(Ne=>Ne.value===(T??R[0]?.value)),_e=R.find(Ne=>Ne.value===j);k?.(j,ce?.weight,_e?.weight)},children:R.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))})]}):I?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[ne&&e.jsx("span",{className:"nice-input__sign",children:"−"}),I]}):null,e.jsx("input",{ref:c=>{typeof X=="function"?X(c):X&&(X.current=c),ve.autoFocusRef(c)},id:a,className:"nice-input__native",type:!C&&(J||N)?"text":"number",name:y,value:we,placeholder:Y,min:D,max:$,step:F,disabled:n||P,readOnly:i,"aria-invalid":!!s,onChange:Me,onFocus:c=>{Q(!0),xe(null),c.target.select()},onBlur:c=>{if(Q(!1),xe(null),x!=null&&g!==void 0){const j=parseFloat(x.toFixed(g));j!==x&&w?.(j)}ue&&ve.exitEdit(),E?.(c)},onKeyDown:ke,style:{width:`${pe}ch`}}),H==="select"&&M&&M.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:ee??M[0]?.value,disabled:n,onChange:c=>{const j=c.target.value,ce=M.find(Ne=>Ne.value===(ee??M[0]?.value)),_e=M.find(Ne=>Ne.value===j);ae?.(j,ce?.weight,_e?.weight)},children:M.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))}):A?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:A}):null,Z&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:ge,onMouseDown:()=>K(ge),onMouseUp:B,onMouseLeave:B,disabled:n,"aria-label":ie("controls.increment","Increment"),children:"+"})]})}),P&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),G==="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),G==="right"&&!s&&p&&e.jsx("div",{className:"nice-field__helper",children:p})]}),G!=="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),G!=="right"&&!s&&p&&e.jsx("div",{className:"nice-field__helper",children:p})]})});Se.displayName="NiceNumberInput";const Te=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:Se},Symbol.toStringTag,{value:"Module"})),Re=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,size:i="md",name:d,id:y,className:h,style:f,accessMode:_,displayStyle:S,options:z,value:x,onChange:w,placeholder:E,multiple:m=!1,searchable:Y=!1,clearable:D=!1,emptyText:$,maxHeight:F=240,optionsSource:g,valueField:I,labelField:U,virtualScroll:R,optionHeight:T=36,onSearch:k,loading:A,renderOption:Z,multipleAutosize:L=!1,showKeyboardHints:W,labelPlacement:re,errorPlacement:le,labelWidth:G,controlWidth:P,displayMode:de},b)=>{const N=o.Zs(_,y),J=N==="hidden";(N==="disabled"||N==="readOnly")&&(n=!0);const{t:H}=o.Jo(),M=o.vs("input",S),ee=o.Ss("input",S),ae=o.Hs(y),ue=o.Ms({enabled:de,disabled:n}),[X,V]=l.useState(!1),[oe,ie]=l.useState(""),[a,v]=l.useState(-1),[q,C]=l.useState(0),Q=l.useRef(null),O=l.useRef(null),[xe,ve]=l.useState(null);l.useLayoutEffect(()=>{!A&&O.current&&ve(O.current.offsetWidth)},[A,x,S]);const[pe,je]=l.useState(null);l.useLayoutEffect(()=>{m&&!L&&O.current&&pe==null&&je(O.current.offsetWidth)},[m,L,pe]);const ye=o.od(g??null,I??g?.keyField??"id",U??"name"),fe=g?ye.options:(z??[]).map(r=>typeof r=="string"?{value:r,label:r}:r);o.$s(Q,()=>{V(!1),ie("")});const se=l.useMemo(()=>x?Array.isArray(x)?x:[x]:[],[x]),ne=l.useMemo(()=>{if(!oe&&!k||k)return fe;const r=oe.toLowerCase();return fe.filter(B=>B.label.toLowerCase().includes(r)||String(B.value).toLowerCase().includes(r))},[fe,oe,k]),we=l.useMemo(()=>{const r=new Map;for(const B of ne){const K=B.group||"";r.has(K)||r.set(K,[]),r.get(K).push(B)}return r},[ne]),he=l.useCallback(r=>{if(m){const B=se.includes(r)?se.filter(K=>K!==r):[...se,r];w?.(B)}else w?.(r),V(!1),ie("")},[m,se,w]),Me=l.useCallback(r=>{if(r.key==="Escape"){V(!1),ie("");return}if(r.key==="Enter"||r.key===" "){if(!X){V(!0),r.preventDefault();return}a>=0&&ne[a]&&(he(ne[a].value),r.preventDefault());return}r.key==="ArrowDown"&&(r.preventDefault(),v(B=>Math.min(B+1,ne.length-1))),r.key==="ArrowUp"&&(r.preventDefault(),v(B=>Math.max(B-1,0)))},[X,a,ne,he]),ge=l.useMemo(()=>se.length===0?null:m?se.map(r=>fe.find(B=>B.value===r)?.label||r).join(", "):fe.find(r=>r.value===se[0])?.label||se[0],[se,fe,m]),$e=l.useCallback(r=>{r.stopPropagation(),w?.(m?[]:"")},[w,m]),be=l.useMemo(()=>[{key:"Enter",description:H("shortcuts.select","Select")},{key:"Space",description:H("shortcuts.openDropdown","Open dropdown")},o.mc.moveUp,o.mc.moveDown,o.mc.cancel],[H]);return J?null:e.jsxs("div",{className:`nice-field ${P==null?"nice-field--select-auto":""} nice-field--${i} ${re==="left"?"nice-field--label-left":""} ${A?"nice-field--loading":""} ${h||""}`,style:{...f,...G!=null&&{"--nice-field-label-width":typeof G=="number"?`${G}px`:G},...P!=null&&{"--nice-field-control-width":typeof P=="number"?`${P}px`:P},...A&&xe!=null&&{"--nice-select-locked-width":`${xe}px`}},"aria-busy":A||void 0,children:[t&&e.jsxs("label",{htmlFor:ae,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,W&&e.jsx(o.Kr,{shortcuts:be,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ue.isDisplay?e.jsx(o.Cs,{value:ge,placeholder:E||H("controls.select","Select..."),disabled:n,onActivate:()=>{ue.enterEdit(),V(!0)},ariaLabel:t}):e.jsxs("div",{className:"nice-select",ref:Q,children:[e.jsxs("button",{ref:r=>{O.current=r,typeof b=="function"?b(r):b&&(b.current=r)},type:"button",id:ae,role:"combobox","aria-expanded":X,"aria-haspopup":"listbox","aria-invalid":!!s,className:`nice-select__trigger nice-select__trigger--${i} nice-select--ds-${ee} ${X?"nice-select__trigger--open":""} ${s?"nice-select__trigger--error":""} ${n?"nice-select__trigger--disabled":""}`,style:{...M,...m&&!L&&pe!=null?{width:pe,maxWidth:pe,overflow:"hidden"}:{}},disabled:n,onClick:()=>V(!X),onKeyDown:Me,children:[ge?e.jsx("span",{style:m&&!L?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:ge}):e.jsx("span",{className:"nice-select__placeholder",children:E||H("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[D&&se.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:$e,role:"button","aria-label":H("controls.clear","Clear"),children:"✕"}),e.jsx("svg",{className:`nice-select__chevron ${X?"nice-select__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]})]}),X&&e.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:F},onScroll:R?r=>C(r.currentTarget.scrollTop):void 0,children:[(Y||k)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:oe,onChange:r=>{ie(r.target.value),v(0),k?.(r.target.value)},placeholder:H("controls.search","Search..."),autoFocus:!0})}),A&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!A&&ne.length===0?e.jsx("div",{className:"nice-select__empty",children:$||H("controls.noResults","No results found")}):R&&!Array.from(we.keys()).some(r=>r!=="")?(()=>{const B=ne.length*T,K=Math.max(0,Math.floor(q/T)-3),me=Math.min(ne.length,Math.ceil((q+F)/T)+3),ke=ne.slice(K,me);return e.jsx("div",{style:{height:B,position:"relative"},children:ke.map((te,c)=>{const j=K+c,ce=se.includes(te.value);return e.jsx("div",{role:"option","aria-selected":ce,className:`nice-select__option ${ce?"nice-select__option--selected":""} ${j===a?"nice-select__option--highlighted":""} ${te.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:j*T,left:0,right:0,height:T,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!te.disabled&&he(String(te.value)),onMouseEnter:()=>v(j),children:Z?Z(te,ce):e.jsxs(e.Fragment,{children:[te.icon&&e.jsx("span",{children:te.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:te.label}),te.description&&e.jsx("div",{className:"nice-select__option-desc",children:te.description})]}),ce&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},te.value)})})})():Array.from(we.entries()).map(([r,B])=>e.jsxs(l.Fragment,{children:[r&&e.jsx("div",{className:"nice-select__group-label",children:r}),B.map(K=>{const me=se.includes(K.value),ke=ne.indexOf(K);return e.jsx("div",{role:"option","aria-selected":me,className:`nice-select__option ${me?"nice-select__option--selected":""} ${ke===a?"nice-select__option--highlighted":""} ${K.disabled?"nice-select__option--disabled":""}`,onClick:()=>!K.disabled&&he(String(K.value)),onMouseEnter:()=>v(ke),children:Z?Z(K,me):e.jsxs(e.Fragment,{children:[K.icon&&e.jsx("span",{children:K.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:K.label}),K.description&&e.jsx("div",{className:"nice-select__option-desc",children:K.description})]}),me&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},K.value)})]},r))]})]}),A&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),le==="right"&&s&&e.jsx("div",{id:`${ae}-error`,className:"nice-field__error",role:"alert",children:s}),le==="right"&&!s&&p&&e.jsx("div",{id:`${ae}-helper`,className:"nice-field__helper",children:p})]}),le!=="right"&&s&&e.jsx("div",{id:`${ae}-error`,className:"nice-field__error",role:"alert",children:s}),le!=="right"&&!s&&p&&e.jsx("div",{id:`${ae}-helper`,className:"nice-field__helper",children:p})]})});Re.displayName="NiceSelect";const Ae=Object.freeze(Object.defineProperty({__proto__:null,NiceSelect:Re},Symbol.toStringTag,{value:"Module"})),De=l.forwardRef(({label:t,checked:p=!1,indeterminate:s=!1,onChange:u,disabled:n,readOnly:i,loading:d,required:y,size:h="md",name:f,id:_,className:S,style:z,error:x,helperText:w,accessMode:E,displayStyle:m,showKeyboardHints:Y,labelPlacement:D,errorPlacement:$,labelWidth:F,controlWidth:g},I)=>{const U=o.Zs(E,_),R=U==="hidden";(U==="disabled"||U==="readOnly")&&(n=!0);const{t:T}=o.Jo(),k=o.Hs(_);o.Ss("toggle",m);const A=l.useMemo(()=>[{key:"Space",description:T("shortcuts.toggle","Toggle")}],[T]),Z=l.useCallback(L=>{L&&(L.indeterminate=s),typeof I=="function"?I(L):I&&(I.current=L)},[s,I]);return R?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${h} ${D==="left"?"nice-field--label-left":""} ${$==="right"?"nice-field--error-right":""} ${d?"nice-field--loading":""} ${S||""}`,style:{...z,...F!=null&&{"--nice-field-label-width":typeof F=="number"?`${F}px`:F},...g!=null&&{"--nice-field-control-width":typeof g=="number"?`${g}px`:g}},"aria-busy":d||void 0,children:[D==="left"&&t&&e.jsx("span",{className:`nice-field__label ${y?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${h!=="md"?`nice-checkbox--${h}`:""} ${n||d?"nice-checkbox--disabled":""}`,htmlFor:k,children:[e.jsx("input",{ref:Z,id:k,type:"checkbox",className:"nice-checkbox__input",name:f,checked:p,disabled:n||d,readOnly:i,"aria-invalid":!!x,onChange:L=>{i||d||u?.(L.target.checked)}}),e.jsx("span",{className:"nice-checkbox__box",children:e.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s?e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):e.jsx("polyline",{points:"2 6 5 9 10 3"})})}),D!=="left"&&t&&e.jsx("span",{children:t}),Y&&e.jsx(o.Kr,{shortcuts:A,size:"sm"})]}),d&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),$==="right"&&x&&e.jsx("div",{id:`${k}-error`,className:"nice-field__error",role:"alert",children:x}),$==="right"&&!x&&w&&e.jsx("div",{id:`${k}-helper`,className:"nice-field__helper",children:w})]}),$!=="right"&&x&&e.jsx("div",{id:`${k}-error`,className:"nice-field__error",role:"alert",children:x}),$!=="right"&&!x&&w&&e.jsx("div",{id:`${k}-helper`,className:"nice-field__helper",children:w})]})});De.displayName="NiceCheckbox";const Be=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:De},Symbol.toStringTag,{value:"Module"})),Le=l.forwardRef(({label:t,checked:p=!1,onChange:s,disabled:u,readOnly:n,loading:i,required:d,size:y="md",name:h,id:f,className:_,style:S,accessMode:z,displayStyle:x,showKeyboardHints:w,error:E,helperText:m,labelPlacement:Y,errorPlacement:D,labelWidth:$,controlWidth:F},g)=>{const I=o.Zs(z,f),U=I==="hidden";(I==="disabled"||I==="readOnly")&&(u=!0);const{t:R}=o.Jo(),T=o.Hs(f);o.vs("toggle",x);const k=o.Ss("toggle",x),A=l.useMemo(()=>[{key:"Space",description:R("shortcuts.toggle","Toggle on/off")}],[R]);return U?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${y} ${Y==="left"?"nice-field--label-left":""} ${i?"nice-field--loading":""} ${_||""}`,style:{...S,...$!=null&&{"--nice-field-label-width":typeof $=="number"?`${$}px`:$},...F!=null&&{"--nice-field-control-width":typeof F=="number"?`${F}px`:F}},"aria-busy":i||void 0,children:[Y==="left"&&t&&e.jsx("span",{className:`nice-field__label ${d?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${k} ${y!=="md"?`nice-toggle--${y}`:""} ${u||i?"nice-toggle--disabled":""}`,htmlFor:T,children:[e.jsx("input",{ref:g,id:T,type:"checkbox",className:"nice-toggle__input",name:h,checked:p,disabled:u||i,readOnly:n,role:"switch","aria-checked":p,"aria-invalid":!!E,onChange:Z=>{n||i||s?.(Z.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),Y!=="left"&&t&&e.jsx("span",{children:t}),w&&e.jsx(o.Kr,{shortcuts:A,size:"sm"})]}),i&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),D==="right"&&E&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:E}),D==="right"&&!E&&m&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:m})]}),D!=="right"&&E&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:E}),D!=="right"&&!E&&m&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:m})]})});Le.displayName="NiceToggle";const Ke=["var(--nice-danger, #ef4444)","var(--nice-warning, #f97316)","var(--nice-warning, #f59e0b)","var(--nice-success, #84cc16)","var(--nice-success, #10b981)","var(--nice-info, #06b6d4)","var(--nice-primary, #3b82f6)","var(--nice-info, #6366f1)","var(--nice-accent, #8b5cf6)","var(--nice-accent-pink, #ec4899)","var(--nice-text-secondary, #64748b)","var(--nice-text, #1e293b)"];function qe(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function Ue(t){const p=/^#?([0-9a-f]{6})$/i.exec(t.trim());if(!p)return{r:0,g:0,b:0};const s=parseInt(p[1],16);return{r:s>>16&255,g:s>>8&255,b:s&255}}function Ze(t,p,s){const u=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${u(t)}${u(p)}${u(s)}`}function Je(t,p,s){const u=t/255,n=p/255,i=s/255,d=Math.max(u,n,i),y=Math.min(u,n,i),h=(d+y)/2;let f=0,_=0;if(d!==y){const S=d-y;switch(_=h>.5?S/(2-d-y):S/(d+y),d){case u:f=(n-i)/S+(n<i?6:0);break;case n:f=(i-u)/S+2;break;case i:f=(u-n)/S+4;break}f*=60}return{h:Math.round(f),s:Math.round(_*100),l:Math.round(h*100)}}function ze(t,p,s){const u=p/100,n=s/100,i=(1-Math.abs(2*n-1))*u,d=i*(1-Math.abs(t/60%2-1)),y=n-i/2;let h=0,f=0,_=0;return t<60?[h,f,_]=[i,d,0]:t<120?[h,f,_]=[d,i,0]:t<180?[h,f,_]=[0,i,d]:t<240?[h,f,_]=[0,d,i]:t<300?[h,f,_]=[d,0,i]:[h,f,_]=[i,0,d],{r:Math.round((h+y)*255),g:Math.round((f+y)*255),b:Math.round((_+y)*255)}}function Pe(t,p,s){const u=t/255,n=p/255,i=s/255,d=Math.max(u,n,i),y=Math.min(u,n,i),h=d-y;let f=0;h!==0&&(d===u?f=(n-i)/h%6:d===n?f=(i-u)/h+2:f=(u-n)/h+4,f*=60,f<0&&(f+=360));const _=d===0?0:h/d;return{h:Math.round(f),s:Math.round(_*100),v:Math.round(d*100)}}function Ve(t,p,s){const u=p/100,n=s/100,i=n*u,d=i*(1-Math.abs(t/60%2-1)),y=n-i;let h=0,f=0,_=0;return t<60?[h,f,_]=[i,d,0]:t<120?[h,f,_]=[d,i,0]:t<180?[h,f,_]=[0,i,d]:t<240?[h,f,_]=[0,d,i]:t<300?[h,f,_]=[d,0,i]:[h,f,_]=[i,0,d],{r:Math.round((h+y)*255),g:Math.round((f+y)*255),b:Math.round((_+y)*255)}}function Ge(t){const p=/^#?([0-9a-f]{6})$/i.exec(t.trim()),s=/^#?([0-9a-f]{8})$/i.exec(t.trim());if(s){const u=s[1];return{r:parseInt(u.slice(0,2),16),g:parseInt(u.slice(2,4),16),b:parseInt(u.slice(4,6),16),a:parseInt(u.slice(6,8),16)/255}}if(p){const u=parseInt(p[1],16);return{r:u>>16&255,g:u>>8&255,b:u&255,a:1}}return{r:0,g:0,b:0,a:1}}function Xe(t,p,s,u,n){const i=y=>Math.max(0,Math.min(255,Math.round(y))).toString(16).padStart(2,"0"),d=`#${i(t)}${i(p)}${i(s)}`;return n?`${d}${i(u*255)}`:d}const Fe=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,id:i,className:d,style:y,accessMode:h,displayStyle:f,value:_="var(--nice-primary, #3b82f6)",onChange:S,presets:z=Ke,showInput:x=!0,showRandom:w=!0,withAlpha:E=!1,showKeyboardHints:m,size:Y="md",labelPlacement:D,errorPlacement:$,labelWidth:F,controlWidth:g,loading:I},U)=>{const R=o.Zs(h,i),T=R==="hidden";(R==="disabled"||R==="readOnly")&&(n=!0);const{t:k}=o.Jo(),A=o.Hs(i);o.Ss("input",f);const Z=l.useCallback(()=>{n||S?.(qe())},[n,S]),[L,W]=l.useState(!1),[re,le]=l.useState(null),G=l.useRef(null),P=l.useRef(null);l.useLayoutEffect(()=>{if(!L||!P.current)return;const b=()=>{const N=P.current?.getBoundingClientRect();if(!N)return;const J=280,H=360;let M=N.left,ee=N.bottom+6;M+J>window.innerWidth-8&&(M=Math.max(8,window.innerWidth-J-8)),ee+H>window.innerHeight-8&&(ee=Math.max(8,N.top-H-6)),le({left:M,top:ee})};return b(),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[L]),l.useEffect(()=>{if(!L)return;const b=J=>{const H=J.target;G.current?.contains(H)||P.current?.contains(H)||W(!1)},N=J=>{J.key==="Escape"&&W(!1)};return document.addEventListener("mousedown",b),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",N)}},[L]);const de=l.useMemo(()=>[{key:"Enter",description:k("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:k("shortcuts.navigatePresets","Navigate presets")}],[k]);return T?null:e.jsxs("div",{className:`nice-field nice-field--${Y} ${D==="left"?"nice-field--label-left":""} ${I?"nice-field--loading":""} ${d||""}`,style:{...y,...F!=null&&{"--nice-field-label-width":typeof F=="number"?`${F}px`:F},...g!=null&&{"--nice-field-control-width":typeof g=="number"?`${g}px`:g}},"aria-busy":I||void 0,children:[t&&e.jsxs("label",{htmlFor:A,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,m&&e.jsx(o.Kr,{shortcuts:de,size:"sm"})]}),e.jsx("div",{className:"nice-field__control",children:e.jsxs("div",{className:"nice-color-picker",children:[e.jsxs("div",{className:"nice-color-picker__preview-row",children:[e.jsx("div",{ref:P,className:"nice-color-picker__swatch",id:A,style:{background:_},onClick:b=>{b.stopPropagation(),n||W(N=>!N)},onKeyDown:b=>{!n&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),W(N=>!N))},role:"button",tabIndex:0,"aria-label":k("colorPicker.openPalette","Open color palette"),"aria-haspopup":"dialog","aria-expanded":L,children:e.jsx("input",{ref:b=>{typeof U=="function"?U(b):U&&(U.current=b)},type:"hidden",value:_,disabled:n,readOnly:!0})}),x&&e.jsx("div",{className:"nice-input nice-input--sm",style:{width:100},children:e.jsx("input",{className:"nice-input__native",type:"text",value:_,disabled:n,onChange:b=>S?.(b.target.value),maxLength:7})}),w&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:Z,disabled:n,title:k("colorPicker.random","Random"),"aria-label":k("colorPicker.random","Random"),style:{fontSize:"0.65rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:k("colorPicker.random","Random")}),I&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),$==="right"&&s&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:s}),$==="right"&&!s&&p&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:p})]}),L&&re&&typeof document<"u"&&Ie.createPortal(e.jsx("div",{ref:G,className:"nice-color-picker__popup nice-color-picker__popup--portal",role:"dialog","aria-label":k("colorPicker.palette","Color palette"),style:{position:"fixed",left:re.left,top:re.top},onClick:b=>b.stopPropagation(),children:(()=>{const b=Ge(_),N={r:b.r,g:b.g,b:b.b},J=E?b.a:1,H=Je(N.r,N.g,N.b),M=Pe(N.r,N.g,N.b),ee=(a,v,q,C=J)=>S?.(Xe(a,v,q,C,E)),ae=(a,v,q)=>ee(a,v,q),ue=(a,v,q)=>{const C=ze(a,v,q);ee(C.r,C.g,C.b)},X=(a,v,q)=>{const C=Ve(a,v,q);ee(C.r,C.g,C.b)},V=a=>ee(N.r,N.g,N.b,a),oe=a=>{if(n)return;const v=a.currentTarget,q=Q=>{const O=v.getBoundingClientRect(),xe=Math.max(0,Math.min(O.width,Q.clientX-O.left)),ve=Math.max(0,Math.min(O.height,Q.clientY-O.top)),pe=Math.round(xe/O.width*100),je=100-Math.round(ve/O.height*100);X(M.h,pe,je)};q(a);const C=()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",q),document.addEventListener("pointerup",C)},ie=`hsl(${M.h}, 100%, 50%)`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-color-picker__popup-header",children:e.jsx("input",{type:"text",className:"nice-input__native nice-color-picker__popup-hex",value:_,disabled:n,onChange:a=>S?.(a.target.value),maxLength:E?9:7,"aria-label":k("colorPicker.hexValue","Hex value")})}),e.jsx("input",{type:"range",min:0,max:360,value:M.h,disabled:n,onChange:a=>X(Number(a.target.value),M.s,M.v),className:"nice-color-picker__hue-slider","aria-label":k("colorPicker.hue","Hue")}),e.jsx("div",{className:"nice-color-picker__sv",style:{background:`linear-gradient(to top, var(--nice-text, #000), transparent), linear-gradient(to right, var(--nice-bg, #FFF), ${ie})`},onPointerDown:oe,role:"application","aria-label":k("colorPicker.svPalette","Saturation/value palette"),children:e.jsx("span",{className:"nice-color-picker__sv-marker",style:{left:`${M.s}%`,top:`${100-M.v}%`}})}),e.jsxs("div",{className:"nice-color-picker__sliders",children:[e.jsx("div",{className:"nice-color-picker__slider-col",children:["h","s","l"].map(a=>{const v=a==="h"?360:100,q=H[a],C=Q=>ue(a==="h"?Q:H.h,a==="s"?Q:H.s,a==="l"?Q:H.l);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:a.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:v,value:q,disabled:n,onChange:Q=>C(Number(Q.target.value))}),e.jsx("input",{type:"number",min:0,max:v,value:q,disabled:n,onChange:Q=>C(Number(Q.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},a)})}),e.jsx("div",{className:"nice-color-picker__slider-col",children:["r","g","b"].map(a=>{const v=N[a],q=C=>ae(a==="r"?C:N.r,a==="g"?C:N.g,a==="b"?C:N.b);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:a.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:255,value:v,disabled:n,onChange:C=>q(Number(C.target.value))}),e.jsx("input",{type:"number",min:0,max:255,value:v,disabled:n,onChange:C=>q(Number(C.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},a)})})]}),E&&e.jsxs("div",{className:"nice-color-picker__alpha-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:"A"}),e.jsx("input",{type:"range",min:0,max:100,value:Math.round(J*100),disabled:n,onChange:a=>V(Number(a.target.value)/100),className:"nice-color-picker__alpha-slider",style:{background:`linear-gradient(to right, transparent, rgb(${N.r},${N.g},${N.b}))`},"aria-label":k("colorPicker.alpha","Alpha")}),e.jsx("input",{type:"number",min:0,max:100,value:Math.round(J*100),disabled:n,onChange:a=>V((Number(a.target.value)||0)/100),className:"nice-input__native nice-color-picker__slider-num"})]}),z.length>0&&e.jsx("div",{className:"nice-color-picker__popup-presets",children:z.map(a=>e.jsx("div",{className:`nice-color-picker__preset ${_===a?"nice-color-picker__preset--active":""}`,style:{background:a},onClick:()=>{S?.(a),W(!1)},role:"button",tabIndex:0,"aria-label":a,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),S?.(a),W(!1))}},a))})]})})()}),document.body)]})}),$!=="right"&&s&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:s}),$!=="right"&&!s&&p&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:p})]})});Fe.displayName="NiceColorPicker";const Ye=Object.freeze(Object.defineProperty({__proto__:null,NiceColorPicker:Fe,hexToRgb:Ue,rgbToHex:Ze},Symbol.toStringTag,{value:"Module"})),Ee=l.forwardRef(({children:t,variant:p="primary",size:s="md",type:u="button",disabled:n,loading:i,fullWidth:d,onClick:y,leftIcon:h,rightIcon:f,error:_,errorPlacement:S="bottom",className:z,style:x,id:w,accessMode:E,displayStyle:m,...Y},D)=>{const $=o.Zs(E,w),F=$==="hidden";($==="disabled"||$==="readOnly")&&(n=!0);const g=o.vs("button",m),I=o.Ss("button",m),U=p!=="primary"?(({background:k,color:A,...Z})=>Z)(g):g,R=e.jsxs("button",{ref:D,type:u,id:w,className:`nice-btn nice-btn--${p} nice-btn--${s} nice-btn--ds-${I} ${d?"nice-btn--full-width":""} ${i?"nice-btn--loading":""} ${_&&!S?"nice-btn--has-error":""} ${z||""}`,style:{...U,...x},disabled:n||i,"aria-busy":i||void 0,"aria-disabled":n||i||void 0,onClick:y,...Y,children:[i&&e.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!i&&h&&e.jsx("span",{"aria-hidden":"true",children:h}),!i&&e.jsx("span",{children:t}),i&&e.jsx("span",{style:{visibility:"hidden"},"aria-hidden":"true",children:t}),!i&&f&&e.jsx("span",{"aria-hidden":"true",children:f})]});if(F)return null;if(!_)return R;const T=e.jsx("div",{className:"nice-field__error",role:"alert",children:_});return S==="right"?e.jsxs("span",{className:`nice-btn-field nice-btn-field--right nice-field--${s}`,style:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:"8px",width:"fit-content"},children:[R,T]}):F?null:e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${s}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",width:"fit-content"},children:[R,T]})});Ee.displayName="NiceButton";const Qe=({tabs:t,activeTab:p,onChange:s,variant:u="default",vertical:n,size:i="md",className:d,style:y,displayStyle:h})=>{const f=o.vs("tab",h),_=o.Ss("tab",h),[S,z]=l.useState(p||t[0]?.id),x=p??S,w=l.useCallback(m=>{z(m),s?.(m)},[s]),E=t.find(m=>m.id===x)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${i} nice-tabs--ds-${_} ${d||""}`,style:{...f,...y,...n?{display:"flex",gap:16}:{}},children:[e.jsx("div",{className:`nice-tabs__list ${u!=="default"?`nice-tabs__list--${u}`:""} ${n?"nice-tabs__list--vertical":""}`,role:"tablist",children:t.map(m=>e.jsxs("button",{type:"button",role:"tab","aria-selected":x===m.id,className:`nice-tabs__tab ${x===m.id?"nice-tabs__tab--active":""} ${m.disabled?"nice-tabs__tab--disabled":""}`,disabled:m.disabled,onClick:()=>w(m.id),children:[m.icon,e.jsx("span",{children:m.label}),m.badge!==void 0&&e.jsx("span",{className:"nice-tabs__badge",children:m.badge})]},m.id))}),E&&e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:E})]})};exports.NiceButton=Ee;exports.NiceCheckbox=De;exports.NiceCheckbox$1=Be;exports.NiceColorPicker=Fe;exports.NiceColorPicker$1=Ye;exports.NiceNumberInput=Se;exports.NiceNumberInput$1=Te;exports.NiceSelect=Re;exports.NiceSelect$1=Ae;exports.NiceTabs=Qe;exports.NiceTextInput=Ce;exports.NiceTextInput$1=He;exports.NiceToggle=Le;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),o=require("./core-BIz6zQ5u.cjs"),l=require("react"),Ie=require("react-dom"),Ce=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,readOnly:i,size:d="md",name:y,id:h,className:f,style:_,accessMode:S,displayStyle:z,variant:x,value:w,defaultValue:F,onChange:m,onBlur:J,onKeyDown:R,placeholder:$,type:L="text",maxLength:g,prefix:I,suffix:Y,clearable:D,autoFocus:H,submitOnEnter:k,onSubmit:A,showKeyboardHints:K,labelPlacement:E,errorPlacement:W,loading:re,labelWidth:le,controlWidth:G,displayMode:P,...de},b)=>{const N=o.ac(S,h),Z=N==="hidden";N==="disabled"&&(n=!0),N==="readOnly"&&(i=!0);const{t:T}=o.Zt(),M=o.Ds(h),ee=o.ks("input",z),ae=o.Ms("input",z),ue=x==="filled"?"filled":x==="underlined"?"underlined":"",X=l.useCallback(()=>m?.(""),[m]),V=o.Es({enabled:P,readOnly:i,disabled:n}),oe=o.vc({enabled:k,onSubmit:A}),ie=l.useCallback(v=>{oe(v),R?.(v)},[oe,R]),a=l.useMemo(()=>{const v=[];return k&&v.push({key:"Enter",description:T("shortcuts.submit","Submit")}),D&&v.push({key:"Escape",description:T("shortcuts.clear","Clear")}),v},[k,D,T]);return Z?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${E==="left"?"nice-field--label-left":""} ${E==="inside"?"nice-field--label-inside":""} ${re?"nice-field--loading":""} ${f||""}`,style:{..._,...le!=null&&{"--nice-field-label-width":typeof le=="number"?`${le}px`:le},...G!=null&&{"--nice-field-control-width":typeof G=="number"?`${G}px`:G}},"aria-busy":re||void 0,"data-floating":E==="inside"&&w?"true":void 0,children:[t&&E!=="inside"&&e.jsxs("label",{htmlFor:M,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,K&&a.length>0&&e.jsx(o.Yr,{shortcuts:a,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[V.isDisplay?e.jsx(o.Ls,{value:w??F??"",placeholder:$,disabled:n,readOnly:i,onActivate:V.enterEdit,ariaLabel:t}):e.jsxs("div",{className:`nice-input nice-input--${d} nice-input--ds-${ue||ae} ${s?"nice-input--error":""} ${n?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:x?void 0:ee,children:[I&&e.jsx("span",{className:"nice-input__icon",children:I}),e.jsx("input",{ref:v=>{typeof b=="function"?b(v):b&&(b.current=v),V.autoFocusRef(v)},id:M,className:"nice-input__native",type:L,name:y,value:w,defaultValue:F,placeholder:$,disabled:n||re,readOnly:i,maxLength:g,autoFocus:H,"aria-invalid":!!s,"aria-describedby":s?`${M}-error`:p?`${M}-helper`:void 0,onChange:v=>m?.(v.target.value),onBlur:v=>{P&&V.exitEdit(),J?.(v)},onKeyDown:ie,...de}),D&&w&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:X,"aria-label":T("controls.clear","Clear"),children:"✕"}),Y&&e.jsx("span",{className:"nice-input__icon",children:Y}),t&&E==="inside"&&e.jsx("label",{htmlFor:M,className:`nice-input__floating-label ${u?"nice-input__floating-label--required":""}`,children:t})]}),re&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),W==="right"&&s&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:s}),W==="right"&&!s&&p&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:p})]}),W!=="right"&&s&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:s}),W!=="right"&&!s&&p&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:p})]})});Ce.displayName="NiceTextInput";const Te=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:Ce},Symbol.toStringTag,{value:"Module"})),Se=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,readOnly:i,size:d="md",name:y,id:h,className:f,style:_,accessMode:S,displayStyle:z,value:x,onChange:w,onBlur:F,onKeyDown:m,placeholder:J,min:R,max:$,step:L=1,precision:g,prefix:I,prefixType:Y="label",prefixOptions:D,prefixValue:H,onPrefixChange:k,suffix:A,showStepper:K=!0,submitOnEnter:E,onSubmit:W,showKeyboardHints:re,labelPlacement:le,errorPlacement:G,loading:P,labelWidth:de,controlWidth:b,formatPreset:N,format:Z,suffixType:T="label",suffixOptions:M,suffixValue:ee,onSuffixChange:ae,displayMode:ue},X)=>{const V=o.ac(S,h),oe=V==="hidden";V==="disabled"&&(n=!0),V==="readOnly"&&(i=!0);const{t:ie}=o.Zt(),a=o.Ds(h),v=o.ks("input",z),U=o.Ms("input",z),[C,Q]=l.useState(!1),[O,xe]=l.useState(null),ve=o.Es({enabled:ue,readOnly:i,disabled:n}),pe=l.useMemo(()=>{let c=3;return $!=null&&(c=String(Math.abs(Math.floor($))).length),R!=null&&R<0&&(c+=1),g&&(c+=g+1),Math.max(3,c)+1},[$,R,g]),je=l.useCallback(c=>{if(Z)return Z(c);if(!N)return g!=null?c.toFixed(g):String(c);switch(N){case"integer":return Math.round(c).toLocaleString();case"decimal":return c.toLocaleString(void 0,{minimumFractionDigits:g??2,maximumFractionDigits:g??2});case"money":return c.toLocaleString(void 0,{minimumFractionDigits:g??2,maximumFractionDigits:g??2,useGrouping:!0});case"percent":return(c*100).toLocaleString(void 0,{minimumFractionDigits:g??0,maximumFractionDigits:g??2})+"%";default:return String(c)}},[Z,N,g]),ye=l.useMemo(()=>C&&O!==null?O:x==null?"":C?g!=null?x.toFixed(g):String(x):je(x),[x,C,O,je,g]),fe=x!=null&&x<0,se=!!(I||Y==="select"&&D&&D.length>0),ne=fe&&se&&!C,we=ne?ye.replace(/^[-−]/,""):ye,he=l.useCallback(c=>{let j=c;return R!==void 0&&(j=Math.max(R,j)),$!==void 0&&(j=Math.min($,j)),g!==void 0&&(j=parseFloat(j.toFixed(g))),j},[R,$,g]),Me=l.useCallback(c=>{const j=c.target.value;if(xe(j),j===""||j==="-"||j==="."||j==="-."){j===""&&w?.(null);return}const ce=parseFloat(j);if(!isNaN(ce)){let _e=ce;R!==void 0&&(_e=Math.max(R,_e)),$!==void 0&&(_e=Math.min($,_e)),w?.(_e)}},[w,R,$]),ge=l.useCallback(()=>{const c=be.current,j=he((c??0)+L);be.current=j,w?.(j)},[L,w,he]),$e=l.useCallback(()=>{const c=be.current,j=he((c??0)-L);be.current=j,w?.(j)},[L,w,he]),be=l.useRef(x);be.current=x;const r=l.useRef(null),B=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),q=l.useCallback(c=>{B();let j=300;const ce=()=>{c(),j=Math.max(30,j*.82),r.current=setTimeout(ce,j)};r.current=setTimeout(ce,400)},[B]),me=o.vc({enabled:E,onSubmit:W}),ke=l.useCallback(c=>{me(c),c.key==="ArrowUp"?(c.preventDefault(),ge()):c.key==="ArrowDown"&&(c.preventDefault(),$e()),m?.(c)},[me,m,ge,$e]),te=l.useMemo(()=>{const c=[];return E&&c.push(o.hc.submit),K&&(c.push({key:"ArrowUp",description:ie("shortcuts.increment","Increase value")}),c.push({key:"ArrowDown",description:ie("shortcuts.decrement","Decrease value")})),c},[E,K,ie]);return oe?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${le==="left"?"nice-field--label-left":""} ${P?"nice-field--loading":""} ${f||""}`,style:{..._,...de!=null&&{"--nice-field-label-width":typeof de=="number"?`${de}px`:de},...b!=null&&{"--nice-field-control-width":typeof b=="number"?`${b}px`:b}},"aria-busy":P||void 0,children:[t&&e.jsxs("label",{htmlFor:a,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,re&&te.length>0&&e.jsx(o.Yr,{shortcuts:te,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ve.isDisplay?e.jsx(o.Ls,{value:x==null?"":I?e.jsxs(e.Fragment,{children:[I,ye]}):ye,placeholder:J,disabled:n,readOnly:i,onActivate:ve.enterEdit,ariaLabel:t}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${d} nice-input--ds-${U} ${s?"nice-input--error":""} ${n?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:v,children:[K&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:$e,onMouseDown:()=>q($e),onMouseUp:B,onMouseLeave:B,disabled:n,"aria-label":ie("controls.decrement","Decrement"),children:"−"}),Y==="select"&&D&&D.length>0?e.jsxs(e.Fragment,{children:[ne&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:H??D[0]?.value,disabled:n,onChange:c=>{const j=c.target.value,ce=D.find(Ne=>Ne.value===(H??D[0]?.value)),_e=D.find(Ne=>Ne.value===j);k?.(j,ce?.weight,_e?.weight)},children:D.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))})]}):I?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[ne&&e.jsx("span",{className:"nice-input__sign",children:"−"}),I]}):null,e.jsx("input",{ref:c=>{typeof X=="function"?X(c):X&&(X.current=c),ve.autoFocusRef(c)},id:a,className:"nice-input__native",type:!C&&(Z||N)?"text":"number",name:y,value:we,placeholder:J,min:R,max:$,step:L,disabled:n||P,readOnly:i,"aria-invalid":!!s,onChange:Me,onFocus:c=>{Q(!0),xe(null),c.target.select()},onBlur:c=>{if(Q(!1),xe(null),x!=null&&g!==void 0){const j=parseFloat(x.toFixed(g));j!==x&&w?.(j)}ue&&ve.exitEdit(),F?.(c)},onKeyDown:ke,style:{width:`${pe}ch`}}),T==="select"&&M&&M.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:ee??M[0]?.value,disabled:n,onChange:c=>{const j=c.target.value,ce=M.find(Ne=>Ne.value===(ee??M[0]?.value)),_e=M.find(Ne=>Ne.value===j);ae?.(j,ce?.weight,_e?.weight)},children:M.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))}):A?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:A}):null,K&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:ge,onMouseDown:()=>q(ge),onMouseUp:B,onMouseLeave:B,disabled:n,"aria-label":ie("controls.increment","Increment"),children:"+"})]})}),P&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),G==="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),G==="right"&&!s&&p&&e.jsx("div",{className:"nice-field__helper",children:p})]}),G!=="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),G!=="right"&&!s&&p&&e.jsx("div",{className:"nice-field__helper",children:p})]})});Se.displayName="NiceNumberInput";const He=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:Se},Symbol.toStringTag,{value:"Module"})),De=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,size:i="md",name:d,id:y,className:h,style:f,accessMode:_,displayStyle:S,options:z,value:x,onChange:w,placeholder:F,multiple:m=!1,searchable:J=!1,clearable:R=!1,emptyText:$,maxHeight:L=240,optionsSource:g,valueField:I,labelField:Y,virtualScroll:D,optionHeight:H=36,onSearch:k,loading:A,renderOption:K,multipleAutosize:E=!1,showKeyboardHints:W,labelPlacement:re,errorPlacement:le,labelWidth:G,controlWidth:P,displayMode:de},b)=>{const N=o.ac(_,y),Z=N==="hidden";(N==="disabled"||N==="readOnly")&&(n=!0);const{t:T}=o.Zt(),M=o.ks("input",S),ee=o.Ms("input",S),ae=o.Ds(y),ue=o.Es({enabled:de,disabled:n}),[X,V]=l.useState(!1),[oe,ie]=l.useState(""),[a,v]=l.useState(-1),[U,C]=l.useState(0),Q=l.useRef(null),O=l.useRef(null),[xe,ve]=l.useState(null);l.useLayoutEffect(()=>{!A&&O.current&&ve(O.current.offsetWidth)},[A,x,S]);const[pe,je]=l.useState(null);l.useLayoutEffect(()=>{m&&!E&&O.current&&pe==null&&je(O.current.offsetWidth)},[m,E,pe]);const ye=o.md(g??null,I??g?.keyField??"id",Y??"name"),fe=g?ye.options:(z??[]).map(r=>typeof r=="string"?{value:r,label:r}:r);o.Os(Q,()=>{V(!1),ie("")});const se=l.useMemo(()=>x?Array.isArray(x)?x:[x]:[],[x]),ne=l.useMemo(()=>{if(!oe&&!k||k)return fe;const r=oe.toLowerCase();return fe.filter(B=>B.label.toLowerCase().includes(r)||String(B.value).toLowerCase().includes(r))},[fe,oe,k]),we=l.useMemo(()=>{const r=new Map;for(const B of ne){const q=B.group||"";r.has(q)||r.set(q,[]),r.get(q).push(B)}return r},[ne]),he=l.useCallback(r=>{if(m){const B=se.includes(r)?se.filter(q=>q!==r):[...se,r];w?.(B)}else w?.(r),V(!1),ie("")},[m,se,w]),Me=l.useCallback(r=>{if(r.key==="Escape"){V(!1),ie("");return}if(r.key==="Enter"||r.key===" "){if(!X){V(!0),r.preventDefault();return}a>=0&&ne[a]&&(he(ne[a].value),r.preventDefault());return}r.key==="ArrowDown"&&(r.preventDefault(),v(B=>Math.min(B+1,ne.length-1))),r.key==="ArrowUp"&&(r.preventDefault(),v(B=>Math.max(B-1,0)))},[X,a,ne,he]),ge=l.useMemo(()=>se.length===0?null:m?se.map(r=>fe.find(B=>B.value===r)?.label||r).join(", "):fe.find(r=>r.value===se[0])?.label||se[0],[se,fe,m]),$e=l.useCallback(r=>{r.stopPropagation(),w?.(m?[]:"")},[w,m]),be=l.useMemo(()=>[{key:"Enter",description:T("shortcuts.select","Select")},{key:"Space",description:T("shortcuts.openDropdown","Open dropdown")},o.hc.moveUp,o.hc.moveDown,o.hc.cancel],[T]);return Z?null:e.jsxs("div",{className:`nice-field ${P==null?"nice-field--select-auto":""} nice-field--${i} ${re==="left"?"nice-field--label-left":""} ${A?"nice-field--loading":""} ${h||""}`,style:{...f,...G!=null&&{"--nice-field-label-width":typeof G=="number"?`${G}px`:G},...P!=null&&{"--nice-field-control-width":typeof P=="number"?`${P}px`:P},...A&&xe!=null&&{"--nice-select-locked-width":`${xe}px`}},"aria-busy":A||void 0,children:[t&&e.jsxs("label",{htmlFor:ae,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,W&&e.jsx(o.Yr,{shortcuts:be,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ue.isDisplay?e.jsx(o.Ls,{value:ge,placeholder:F||T("controls.select","Select..."),disabled:n,onActivate:()=>{ue.enterEdit(),V(!0)},ariaLabel:t}):e.jsxs("div",{className:"nice-select",ref:Q,children:[e.jsxs("button",{ref:r=>{O.current=r,typeof b=="function"?b(r):b&&(b.current=r)},type:"button",id:ae,role:"combobox","aria-expanded":X,"aria-haspopup":"listbox","aria-invalid":!!s,className:`nice-select__trigger nice-select__trigger--${i} nice-select--ds-${ee} ${X?"nice-select__trigger--open":""} ${s?"nice-select__trigger--error":""} ${n?"nice-select__trigger--disabled":""}`,style:{...M,...m&&!E&&pe!=null?{width:pe,maxWidth:pe,overflow:"hidden"}:{}},disabled:n,onClick:()=>V(!X),onKeyDown:Me,children:[ge?e.jsx("span",{style:m&&!E?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:ge}):e.jsx("span",{className:"nice-select__placeholder",children:F||T("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[R&&se.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:$e,role:"button","aria-label":T("controls.clear","Clear"),children:"✕"}),e.jsx("svg",{className:`nice-select__chevron ${X?"nice-select__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]})]}),X&&e.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:L},onScroll:D?r=>C(r.currentTarget.scrollTop):void 0,children:[(J||k)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:oe,onChange:r=>{ie(r.target.value),v(0),k?.(r.target.value)},placeholder:T("controls.search","Search..."),autoFocus:!0})}),A&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!A&&ne.length===0?e.jsx("div",{className:"nice-select__empty",children:$||T("controls.noResults","No results found")}):D&&!Array.from(we.keys()).some(r=>r!=="")?(()=>{const B=ne.length*H,q=Math.max(0,Math.floor(U/H)-3),me=Math.min(ne.length,Math.ceil((U+L)/H)+3),ke=ne.slice(q,me);return e.jsx("div",{style:{height:B,position:"relative"},children:ke.map((te,c)=>{const j=q+c,ce=se.includes(te.value);return e.jsx("div",{role:"option","aria-selected":ce,className:`nice-select__option ${ce?"nice-select__option--selected":""} ${j===a?"nice-select__option--highlighted":""} ${te.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:j*H,left:0,right:0,height:H,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!te.disabled&&he(String(te.value)),onMouseEnter:()=>v(j),children:K?K(te,ce):e.jsxs(e.Fragment,{children:[te.icon&&e.jsx("span",{children:te.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:te.label}),te.description&&e.jsx("div",{className:"nice-select__option-desc",children:te.description})]}),ce&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},te.value)})})})():Array.from(we.entries()).map(([r,B])=>e.jsxs(l.Fragment,{children:[r&&e.jsx("div",{className:"nice-select__group-label",children:r}),B.map(q=>{const me=se.includes(q.value),ke=ne.indexOf(q);return e.jsx("div",{role:"option","aria-selected":me,className:`nice-select__option ${me?"nice-select__option--selected":""} ${ke===a?"nice-select__option--highlighted":""} ${q.disabled?"nice-select__option--disabled":""}`,onClick:()=>!q.disabled&&he(String(q.value)),onMouseEnter:()=>v(ke),children:K?K(q,me):e.jsxs(e.Fragment,{children:[q.icon&&e.jsx("span",{children:q.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:q.label}),q.description&&e.jsx("div",{className:"nice-select__option-desc",children:q.description})]}),me&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},q.value)})]},r))]})]}),A&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),le==="right"&&s&&e.jsx("div",{id:`${ae}-error`,className:"nice-field__error",role:"alert",children:s}),le==="right"&&!s&&p&&e.jsx("div",{id:`${ae}-helper`,className:"nice-field__helper",children:p})]}),le!=="right"&&s&&e.jsx("div",{id:`${ae}-error`,className:"nice-field__error",role:"alert",children:s}),le!=="right"&&!s&&p&&e.jsx("div",{id:`${ae}-helper`,className:"nice-field__helper",children:p})]})});De.displayName="NiceSelect";const Ae=Object.freeze(Object.defineProperty({__proto__:null,NiceSelect:De},Symbol.toStringTag,{value:"Module"})),Re=l.forwardRef(({label:t,checked:p=!1,indeterminate:s=!1,onChange:u,disabled:n,readOnly:i,loading:d,required:y,size:h="md",name:f,id:_,className:S,style:z,error:x,helperText:w,accessMode:F,displayStyle:m,showKeyboardHints:J,labelPlacement:R,errorPlacement:$,labelWidth:L,controlWidth:g},I)=>{const Y=o.ac(F,_),D=Y==="hidden";(Y==="disabled"||Y==="readOnly")&&(n=!0);const{t:H}=o.Zt(),k=o.Ds(_);o.Ms("toggle",m);const A=l.useMemo(()=>[{key:"Space",description:H("shortcuts.toggle","Toggle")}],[H]),K=l.useCallback(E=>{E&&(E.indeterminate=s),typeof I=="function"?I(E):I&&(I.current=E)},[s,I]);return D?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${h} ${R==="left"?"nice-field--label-left":""} ${$==="right"?"nice-field--error-right":""} ${d?"nice-field--loading":""} ${S||""}`,style:{...z,...L!=null&&{"--nice-field-label-width":typeof L=="number"?`${L}px`:L},...g!=null&&{"--nice-field-control-width":typeof g=="number"?`${g}px`:g}},"aria-busy":d||void 0,children:[R==="left"&&t&&e.jsx("span",{className:`nice-field__label ${y?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${h!=="md"?`nice-checkbox--${h}`:""} ${n||d?"nice-checkbox--disabled":""}`,htmlFor:k,children:[e.jsx("input",{ref:K,id:k,type:"checkbox",className:"nice-checkbox__input",name:f,checked:p,disabled:n||d,readOnly:i,"aria-invalid":!!x,onChange:E=>{i||d||u?.(E.target.checked)}}),e.jsx("span",{className:"nice-checkbox__box",children:e.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s?e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):e.jsx("polyline",{points:"2 6 5 9 10 3"})})}),R!=="left"&&t&&e.jsx("span",{children:t}),J&&e.jsx(o.Yr,{shortcuts:A,size:"sm"})]}),d&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),$==="right"&&x&&e.jsx("div",{id:`${k}-error`,className:"nice-field__error",role:"alert",children:x}),$==="right"&&!x&&w&&e.jsx("div",{id:`${k}-helper`,className:"nice-field__helper",children:w})]}),$!=="right"&&x&&e.jsx("div",{id:`${k}-error`,className:"nice-field__error",role:"alert",children:x}),$!=="right"&&!x&&w&&e.jsx("div",{id:`${k}-helper`,className:"nice-field__helper",children:w})]})});Re.displayName="NiceCheckbox";const Be=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:Re},Symbol.toStringTag,{value:"Module"})),Ee=l.forwardRef(({label:t,checked:p=!1,onChange:s,disabled:u,readOnly:n,loading:i,required:d,size:y="md",name:h,id:f,className:_,style:S,accessMode:z,displayStyle:x,showKeyboardHints:w,error:F,helperText:m,labelPlacement:J,errorPlacement:R,labelWidth:$,controlWidth:L},g)=>{const I=o.ac(z,f),Y=I==="hidden";(I==="disabled"||I==="readOnly")&&(u=!0);const{t:D}=o.Zt(),H=o.Ds(f);o.ks("toggle",x);const k=o.Ms("toggle",x),A=l.useMemo(()=>[{key:"Space",description:D("shortcuts.toggle","Toggle on/off")}],[D]);return Y?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${y} ${J==="left"?"nice-field--label-left":""} ${i?"nice-field--loading":""} ${_||""}`,style:{...S,...$!=null&&{"--nice-field-label-width":typeof $=="number"?`${$}px`:$},...L!=null&&{"--nice-field-control-width":typeof L=="number"?`${L}px`:L}},"aria-busy":i||void 0,children:[J==="left"&&t&&e.jsx("span",{className:`nice-field__label ${d?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${k} ${y!=="md"?`nice-toggle--${y}`:""} ${u||i?"nice-toggle--disabled":""}`,htmlFor:H,children:[e.jsx("input",{ref:g,id:H,type:"checkbox",className:"nice-toggle__input",name:h,checked:p,disabled:u||i,readOnly:n,role:"switch","aria-checked":p,"aria-invalid":!!F,onChange:K=>{n||i||s?.(K.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),J!=="left"&&t&&e.jsx("span",{children:t}),w&&e.jsx(o.Yr,{shortcuts:A,size:"sm"})]}),i&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),R==="right"&&F&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:F}),R==="right"&&!F&&m&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:m})]}),R!=="right"&&F&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:F}),R!=="right"&&!F&&m&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:m})]})});Ee.displayName="NiceToggle";const qe=["var(--nice-danger, #ef4444)","var(--nice-warning, #f97316)","var(--nice-warning, #f59e0b)","var(--nice-success, #84cc16)","var(--nice-success, #10b981)","var(--nice-info, #06b6d4)","var(--nice-primary, #3b82f6)","var(--nice-info, #6366f1)","var(--nice-accent, #8b5cf6)","var(--nice-accent-pink, #ec4899)","var(--nice-text-secondary, #64748b)","var(--nice-text, #1e293b)"];function Ue(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function Ye(t){const p=/^#?([0-9a-f]{6})$/i.exec(t.trim());if(!p)return{r:0,g:0,b:0};const s=parseInt(p[1],16);return{r:s>>16&255,g:s>>8&255,b:s&255}}function Ke(t,p,s){const u=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${u(t)}${u(p)}${u(s)}`}function Ze(t,p,s){const u=t/255,n=p/255,i=s/255,d=Math.max(u,n,i),y=Math.min(u,n,i),h=(d+y)/2;let f=0,_=0;if(d!==y){const S=d-y;switch(_=h>.5?S/(2-d-y):S/(d+y),d){case u:f=(n-i)/S+(n<i?6:0);break;case n:f=(i-u)/S+2;break;case i:f=(u-n)/S+4;break}f*=60}return{h:Math.round(f),s:Math.round(_*100),l:Math.round(h*100)}}function ze(t,p,s){const u=p/100,n=s/100,i=(1-Math.abs(2*n-1))*u,d=i*(1-Math.abs(t/60%2-1)),y=n-i/2;let h=0,f=0,_=0;return t<60?[h,f,_]=[i,d,0]:t<120?[h,f,_]=[d,i,0]:t<180?[h,f,_]=[0,i,d]:t<240?[h,f,_]=[0,d,i]:t<300?[h,f,_]=[d,0,i]:[h,f,_]=[i,0,d],{r:Math.round((h+y)*255),g:Math.round((f+y)*255),b:Math.round((_+y)*255)}}function Pe(t,p,s){const u=t/255,n=p/255,i=s/255,d=Math.max(u,n,i),y=Math.min(u,n,i),h=d-y;let f=0;h!==0&&(d===u?f=(n-i)/h%6:d===n?f=(i-u)/h+2:f=(u-n)/h+4,f*=60,f<0&&(f+=360));const _=d===0?0:h/d;return{h:Math.round(f),s:Math.round(_*100),v:Math.round(d*100)}}function Ve(t,p,s){const u=p/100,n=s/100,i=n*u,d=i*(1-Math.abs(t/60%2-1)),y=n-i;let h=0,f=0,_=0;return t<60?[h,f,_]=[i,d,0]:t<120?[h,f,_]=[d,i,0]:t<180?[h,f,_]=[0,i,d]:t<240?[h,f,_]=[0,d,i]:t<300?[h,f,_]=[d,0,i]:[h,f,_]=[i,0,d],{r:Math.round((h+y)*255),g:Math.round((f+y)*255),b:Math.round((_+y)*255)}}function Ge(t){const p=/^#?([0-9a-f]{6})$/i.exec(t.trim()),s=/^#?([0-9a-f]{8})$/i.exec(t.trim());if(s){const u=s[1];return{r:parseInt(u.slice(0,2),16),g:parseInt(u.slice(2,4),16),b:parseInt(u.slice(4,6),16),a:parseInt(u.slice(6,8),16)/255}}if(p){const u=parseInt(p[1],16);return{r:u>>16&255,g:u>>8&255,b:u&255,a:1}}return{r:0,g:0,b:0,a:1}}function Xe(t,p,s,u,n){const i=y=>Math.max(0,Math.min(255,Math.round(y))).toString(16).padStart(2,"0"),d=`#${i(t)}${i(p)}${i(s)}`;return n?`${d}${i(u*255)}`:d}const Le=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,id:i,className:d,style:y,accessMode:h,displayStyle:f,value:_="var(--nice-primary, #3b82f6)",onChange:S,presets:z=qe,showInput:x=!0,showRandom:w=!0,withAlpha:F=!1,showKeyboardHints:m,size:J="md",labelPlacement:R,errorPlacement:$,labelWidth:L,controlWidth:g,loading:I},Y)=>{const D=o.ac(h,i),H=D==="hidden";(D==="disabled"||D==="readOnly")&&(n=!0);const{t:k}=o.Zt(),A=o.Ds(i);o.Ms("input",f);const K=l.useCallback(()=>{n||S?.(Ue())},[n,S]),[E,W]=l.useState(!1),[re,le]=l.useState(null),G=l.useRef(null),P=l.useRef(null);l.useLayoutEffect(()=>{if(!E||!P.current)return;const b=()=>{const N=P.current?.getBoundingClientRect();if(!N)return;const Z=280,T=360;let M=N.left,ee=N.bottom+6;M+Z>window.innerWidth-8&&(M=Math.max(8,window.innerWidth-Z-8)),ee+T>window.innerHeight-8&&(ee=Math.max(8,N.top-T-6)),le({left:M,top:ee})};return b(),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[E]),l.useEffect(()=>{if(!E)return;const b=Z=>{const T=Z.target;G.current?.contains(T)||P.current?.contains(T)||W(!1)},N=Z=>{Z.key==="Escape"&&W(!1)};return document.addEventListener("mousedown",b),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",N)}},[E]);const de=l.useMemo(()=>[{key:"Enter",description:k("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:k("shortcuts.navigatePresets","Navigate presets")}],[k]);return H?null:e.jsxs("div",{className:`nice-field nice-field--${J} ${R==="left"?"nice-field--label-left":""} ${I?"nice-field--loading":""} ${d||""}`,style:{...y,...L!=null&&{"--nice-field-label-width":typeof L=="number"?`${L}px`:L},...g!=null&&{"--nice-field-control-width":typeof g=="number"?`${g}px`:g}},"aria-busy":I||void 0,children:[t&&e.jsxs("label",{htmlFor:A,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,m&&e.jsx(o.Yr,{shortcuts:de,size:"sm"})]}),e.jsx("div",{className:"nice-field__control",children:e.jsxs("div",{className:"nice-color-picker",children:[e.jsxs("div",{className:"nice-color-picker__preview-row",children:[e.jsx("div",{ref:P,className:"nice-color-picker__swatch",id:A,style:{background:_},onClick:b=>{b.stopPropagation(),n||W(N=>!N)},onKeyDown:b=>{!n&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),W(N=>!N))},role:"button",tabIndex:0,"aria-label":k("colorPicker.openPalette","Open color palette"),"aria-haspopup":"dialog","aria-expanded":E,children:e.jsx("input",{ref:b=>{typeof Y=="function"?Y(b):Y&&(Y.current=b)},type:"hidden",value:_,disabled:n,readOnly:!0})}),x&&e.jsx("div",{className:"nice-input nice-input--sm",style:{width:100},children:e.jsx("input",{className:"nice-input__native",type:"text",value:_,disabled:n,onChange:b=>S?.(b.target.value),maxLength:7})}),w&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:K,disabled:n,title:k("colorPicker.random","Random"),"aria-label":k("colorPicker.random","Random"),style:{fontSize:"0.65rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:k("colorPicker.random","Random")}),I&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),$==="right"&&s&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:s}),$==="right"&&!s&&p&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:p})]}),E&&re&&typeof document<"u"&&Ie.createPortal(e.jsx("div",{ref:G,className:"nice-color-picker__popup nice-color-picker__popup--portal",role:"dialog","aria-label":k("colorPicker.palette","Color palette"),style:{position:"fixed",left:re.left,top:re.top},onClick:b=>b.stopPropagation(),children:(()=>{const b=Ge(_),N={r:b.r,g:b.g,b:b.b},Z=F?b.a:1,T=Ze(N.r,N.g,N.b),M=Pe(N.r,N.g,N.b),ee=(a,v,U,C=Z)=>S?.(Xe(a,v,U,C,F)),ae=(a,v,U)=>ee(a,v,U),ue=(a,v,U)=>{const C=ze(a,v,U);ee(C.r,C.g,C.b)},X=(a,v,U)=>{const C=Ve(a,v,U);ee(C.r,C.g,C.b)},V=a=>ee(N.r,N.g,N.b,a),oe=a=>{if(n)return;const v=a.currentTarget,U=Q=>{const O=v.getBoundingClientRect(),xe=Math.max(0,Math.min(O.width,Q.clientX-O.left)),ve=Math.max(0,Math.min(O.height,Q.clientY-O.top)),pe=Math.round(xe/O.width*100),je=100-Math.round(ve/O.height*100);X(M.h,pe,je)};U(a);const C=()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",U),document.addEventListener("pointerup",C)},ie=`hsl(${M.h}, 100%, 50%)`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-color-picker__popup-header",children:e.jsx("input",{type:"text",className:"nice-input__native nice-color-picker__popup-hex",value:_,disabled:n,onChange:a=>S?.(a.target.value),maxLength:F?9:7,"aria-label":k("colorPicker.hexValue","Hex value")})}),e.jsx("input",{type:"range",min:0,max:360,value:M.h,disabled:n,onChange:a=>X(Number(a.target.value),M.s,M.v),className:"nice-color-picker__hue-slider","aria-label":k("colorPicker.hue","Hue")}),e.jsx("div",{className:"nice-color-picker__sv",style:{background:`linear-gradient(to top, var(--nice-text, #000), transparent), linear-gradient(to right, var(--nice-bg, #FFF), ${ie})`},onPointerDown:oe,role:"application","aria-label":k("colorPicker.svPalette","Saturation/value palette"),children:e.jsx("span",{className:"nice-color-picker__sv-marker",style:{left:`${M.s}%`,top:`${100-M.v}%`}})}),e.jsxs("div",{className:"nice-color-picker__sliders",children:[e.jsx("div",{className:"nice-color-picker__slider-col",children:["h","s","l"].map(a=>{const v=a==="h"?360:100,U=T[a],C=Q=>ue(a==="h"?Q:T.h,a==="s"?Q:T.s,a==="l"?Q:T.l);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:a.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:v,value:U,disabled:n,onChange:Q=>C(Number(Q.target.value))}),e.jsx("input",{type:"number",min:0,max:v,value:U,disabled:n,onChange:Q=>C(Number(Q.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},a)})}),e.jsx("div",{className:"nice-color-picker__slider-col",children:["r","g","b"].map(a=>{const v=N[a],U=C=>ae(a==="r"?C:N.r,a==="g"?C:N.g,a==="b"?C:N.b);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:a.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:255,value:v,disabled:n,onChange:C=>U(Number(C.target.value))}),e.jsx("input",{type:"number",min:0,max:255,value:v,disabled:n,onChange:C=>U(Number(C.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},a)})})]}),F&&e.jsxs("div",{className:"nice-color-picker__alpha-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:"A"}),e.jsx("input",{type:"range",min:0,max:100,value:Math.round(Z*100),disabled:n,onChange:a=>V(Number(a.target.value)/100),className:"nice-color-picker__alpha-slider",style:{background:`linear-gradient(to right, transparent, rgb(${N.r},${N.g},${N.b}))`},"aria-label":k("colorPicker.alpha","Alpha")}),e.jsx("input",{type:"number",min:0,max:100,value:Math.round(Z*100),disabled:n,onChange:a=>V((Number(a.target.value)||0)/100),className:"nice-input__native nice-color-picker__slider-num"})]}),z.length>0&&e.jsx("div",{className:"nice-color-picker__popup-presets",children:z.map(a=>e.jsx("div",{className:`nice-color-picker__preset ${_===a?"nice-color-picker__preset--active":""}`,style:{background:a},onClick:()=>{S?.(a),W(!1)},role:"button",tabIndex:0,"aria-label":a,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),S?.(a),W(!1))}},a))})]})})()}),document.body)]})}),$!=="right"&&s&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:s}),$!=="right"&&!s&&p&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:p})]})});Le.displayName="NiceColorPicker";const Je=Object.freeze(Object.defineProperty({__proto__:null,NiceColorPicker:Le,hexToRgb:Ye,rgbToHex:Ke},Symbol.toStringTag,{value:"Module"})),Fe=l.forwardRef(({children:t,variant:p="primary",size:s="md",type:u="button",disabled:n,loading:i,fullWidth:d,onClick:y,leftIcon:h,rightIcon:f,error:_,errorPlacement:S="bottom",className:z,style:x,id:w,accessMode:F,displayStyle:m,...J},R)=>{const $=o.ac(F,w),L=$==="hidden";($==="disabled"||$==="readOnly")&&(n=!0);const g=o.ks("button",m),I=o.Ms("button",m),Y=p!=="primary"?(({background:k,color:A,...K})=>K)(g):g,D=e.jsxs("button",{ref:R,type:u,id:w,className:`nice-btn nice-btn--${p} nice-btn--${s} nice-btn--ds-${I} ${d?"nice-btn--full-width":""} ${i?"nice-btn--loading":""} ${_&&!S?"nice-btn--has-error":""} ${z||""}`,style:{...Y,...x},disabled:n||i,"aria-busy":i||void 0,"aria-disabled":n||i||void 0,onClick:y,...J,children:[i&&e.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!i&&h&&e.jsx("span",{"aria-hidden":"true",children:h}),!i&&e.jsx("span",{children:t}),i&&e.jsx("span",{style:{visibility:"hidden"},"aria-hidden":"true",children:t}),!i&&f&&e.jsx("span",{"aria-hidden":"true",children:f})]});if(L)return null;if(!_)return D;const H=e.jsx("div",{className:"nice-field__error",role:"alert",children:_});return S==="right"?e.jsxs("span",{className:`nice-btn-field nice-btn-field--right nice-field--${s}`,style:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:"8px",width:"fit-content"},children:[D,H]}):L?null:e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${s}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",width:"fit-content"},children:[D,H]})});Fe.displayName="NiceButton";const Qe=({tabs:t,activeTab:p,onChange:s,variant:u="default",vertical:n,size:i="md",className:d,style:y,displayStyle:h})=>{const f=o.ks("tab",h),_=o.Ms("tab",h),[S,z]=l.useState(p||t[0]?.id),x=p??S,w=l.useCallback(m=>{z(m),s?.(m)},[s]),F=t.find(m=>m.id===x)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${i} nice-tabs--ds-${_} ${d||""}`,style:{...f,...y,...n?{display:"flex",gap:16}:{}},children:[e.jsx("div",{className:`nice-tabs__list ${u!=="default"?`nice-tabs__list--${u}`:""} ${n?"nice-tabs__list--vertical":""}`,role:"tablist",children:t.map(m=>e.jsxs("button",{type:"button",role:"tab","aria-selected":x===m.id,className:`nice-tabs__tab ${x===m.id?"nice-tabs__tab--active":""} ${m.disabled?"nice-tabs__tab--disabled":""}`,disabled:m.disabled,onClick:()=>w(m.id),children:[m.icon,e.jsx("span",{children:m.label}),m.badge!==void 0&&e.jsx("span",{className:"nice-tabs__badge",children:m.badge})]},m.id))}),F&&e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:F})]})};exports.NiceButton=Fe;exports.NiceCheckbox=Re;exports.NiceCheckbox$1=Be;exports.NiceColorPicker=Le;exports.NiceColorPicker$1=Je;exports.NiceNumberInput=Se;exports.NiceNumberInput$1=He;exports.NiceSelect=De;exports.NiceSelect$1=Ae;exports.NiceTabs=Qe;exports.NiceTextInput=Ce;exports.NiceTextInput$1=Te;exports.NiceToggle=Ee;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),o=require("./core-CZE5v34h.cjs"),l=require("react"),Ie=require("react-dom"),Ce=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,readOnly:i,size:d="md",name:$,id:h,className:f,style:_,accessMode:S,displayStyle:Q,variant:x,value:w,defaultValue:F,onChange:m,onBlur:J,onKeyDown:D,placeholder:k,type:E="text",maxLength:v,prefix:L,suffix:U,clearable:I,autoFocus:A,submitOnEnter:y,onSubmit:T,showKeyboardHints:V,labelPlacement:R,errorPlacement:G,loading:re,labelWidth:le,controlWidth:X,displayMode:Z,...de},b)=>{const N=o.sc(S,h),K=N==="hidden";N==="disabled"&&(n=!0),N==="readOnly"&&(i=!0);const{t:H}=o.Zt(),M=o._s(h),ee=o.Ns("input",Q),ae=o.Es("input",Q),ue=x==="filled"?"filled":x==="underlined"?"underlined":"",Y=l.useCallback(()=>m?.(""),[m]),P=o.zs({enabled:Z,readOnly:i,disabled:n}),oe=o.kc({enabled:y,onSubmit:T}),ie=l.useCallback(g=>{oe(g),D?.(g)},[oe,D]),a=l.useMemo(()=>{const g=[];return y&&g.push({key:"Enter",description:H("shortcuts.submit","Submit")}),I&&g.push({key:"Escape",description:H("shortcuts.clear","Clear")}),g},[y,I,H]);return K?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${R==="left"?"nice-field--label-left":""} ${R==="inside"?"nice-field--label-inside":""} ${re?"nice-field--loading":""} ${f||""}`,style:{..._,...le!=null&&{"--nice-field-label-width":typeof le=="number"?`${le}px`:le},...X!=null&&{"--nice-field-control-width":typeof X=="number"?`${X}px`:X}},"aria-busy":re||void 0,"data-floating":R==="inside"&&w?"true":void 0,children:[t&&R!=="inside"&&e.jsxs("label",{htmlFor:M,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,V&&a.length>0&&e.jsx(o.Qr,{shortcuts:a,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[P.isDisplay?e.jsx(o.Fs,{value:w??F??"",placeholder:k,disabled:n,readOnly:i,onActivate:P.enterEdit,ariaLabel:t}):e.jsxs("div",{className:`nice-input nice-input--${d} nice-input--ds-${ue||ae} ${s?"nice-input--error":""} ${n?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:x?void 0:ee,children:[L&&e.jsx("span",{className:"nice-input__icon",children:L}),e.jsx("input",{ref:g=>{typeof b=="function"?b(g):b&&(b.current=g),P.autoFocusRef(g)},id:M,className:"nice-input__native",type:E,name:$,value:w,defaultValue:F,placeholder:k,disabled:n||re,readOnly:i,maxLength:v,autoFocus:A,"aria-invalid":!!s,"aria-describedby":s?`${M}-error`:p?`${M}-helper`:void 0,onChange:g=>m?.(g.target.value),onBlur:g=>{Z&&P.exitEdit(),J?.(g)},onKeyDown:ie,...de}),I&&w&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:Y,"aria-label":H("controls.clear","Clear"),children:"✕"}),U&&e.jsx("span",{className:"nice-input__icon",children:U}),t&&R==="inside"&&e.jsx("label",{htmlFor:M,className:`nice-input__floating-label ${u?"nice-input__floating-label--required":""}`,children:t})]}),re&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),G==="right"&&s&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:s}),G==="right"&&!s&&p&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:p})]}),G!=="right"&&s&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:s}),G!=="right"&&!s&&p&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:p})]})});Ce.displayName="NiceTextInput";const Te=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:Ce},Symbol.toStringTag,{value:"Module"})),Se=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,readOnly:i,size:d="md",name:$,id:h,className:f,style:_,accessMode:S,displayStyle:Q,value:x,onChange:w,onBlur:F,onKeyDown:m,placeholder:J,min:D,max:k,step:E=1,precision:v,prefix:L,prefixType:U="label",prefixOptions:I,prefixValue:A,onPrefixChange:y,suffix:T,showStepper:V=!0,submitOnEnter:R,onSubmit:G,showKeyboardHints:re,labelPlacement:le,errorPlacement:X,loading:Z,labelWidth:de,controlWidth:b,formatPreset:N,format:K,suffixType:H="label",suffixOptions:M,suffixValue:ee,onSuffixChange:ae,displayMode:ue},Y)=>{const P=o.sc(S,h),oe=P==="hidden";P==="disabled"&&(n=!0),P==="readOnly"&&(i=!0);const{t:ie}=o.Zt(),a=o._s(h),g=o.Ns("input",Q),z=o.Es("input",Q),[C,O]=l.useState(!1),[W,xe]=l.useState(null),ve=o.zs({enabled:ue,readOnly:i,disabled:n}),pe=l.useMemo(()=>{let c=3;return k!=null&&(c=String(Math.abs(Math.floor(k))).length),D!=null&&D<0&&(c+=1),v&&(c+=v+1),Math.max(3,c)+1},[k,D,v]),je=l.useCallback(c=>{if(K)return K(c);if(!N)return v!=null?c.toFixed(v):String(c);switch(N){case"integer":return Math.round(c).toLocaleString();case"decimal":return c.toLocaleString(void 0,{minimumFractionDigits:v??2,maximumFractionDigits:v??2});case"money":return c.toLocaleString(void 0,{minimumFractionDigits:v??2,maximumFractionDigits:v??2,useGrouping:!0});case"percent":return(c*100).toLocaleString(void 0,{minimumFractionDigits:v??0,maximumFractionDigits:v??2})+"%";default:return String(c)}},[K,N,v]),ye=l.useMemo(()=>C&&W!==null?W:x==null?"":C?v!=null?x.toFixed(v):String(x):je(x),[x,C,W,je,v]),fe=x!=null&&x<0,se=!!(L||U==="select"&&I&&I.length>0),ne=fe&&se&&!C,we=ne?ye.replace(/^[-−]/,""):ye,he=l.useCallback(c=>{let j=c;return D!==void 0&&(j=Math.max(D,j)),k!==void 0&&(j=Math.min(k,j)),v!==void 0&&(j=parseFloat(j.toFixed(v))),j},[D,k,v]),Me=l.useCallback(c=>{const j=c.target.value;if(xe(j),j===""||j==="-"||j==="."||j==="-."){j===""&&w?.(null);return}const ce=parseFloat(j);if(!isNaN(ce)){let _e=ce;D!==void 0&&(_e=Math.max(D,_e)),k!==void 0&&(_e=Math.min(k,_e)),w?.(_e)}},[w,D,k]),ge=l.useCallback(()=>{const c=be.current,j=he((c??0)+E);be.current=j,w?.(j)},[E,w,he]),$e=l.useCallback(()=>{const c=be.current,j=he((c??0)-E);be.current=j,w?.(j)},[E,w,he]),be=l.useRef(x);be.current=x;const r=l.useRef(null),B=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),q=l.useCallback(c=>{B();let j=300;const ce=()=>{c(),j=Math.max(30,j*.82),r.current=setTimeout(ce,j)};r.current=setTimeout(ce,400)},[B]),me=o.kc({enabled:R,onSubmit:G}),ke=l.useCallback(c=>{me(c),c.key==="ArrowUp"?(c.preventDefault(),ge()):c.key==="ArrowDown"&&(c.preventDefault(),$e()),m?.(c)},[me,m,ge,$e]),te=l.useMemo(()=>{const c=[];return R&&c.push(o.xc.submit),V&&(c.push({key:"ArrowUp",description:ie("shortcuts.increment","Increase value")}),c.push({key:"ArrowDown",description:ie("shortcuts.decrement","Decrease value")})),c},[R,V,ie]);return oe?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${le==="left"?"nice-field--label-left":""} ${Z?"nice-field--loading":""} ${f||""}`,style:{..._,...de!=null&&{"--nice-field-label-width":typeof de=="number"?`${de}px`:de},...b!=null&&{"--nice-field-control-width":typeof b=="number"?`${b}px`:b}},"aria-busy":Z||void 0,children:[t&&e.jsxs("label",{htmlFor:a,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,re&&te.length>0&&e.jsx(o.Qr,{shortcuts:te,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ve.isDisplay?e.jsx(o.Fs,{value:x==null?"":L?e.jsxs(e.Fragment,{children:[L,ye]}):ye,placeholder:J,disabled:n,readOnly:i,onActivate:ve.enterEdit,ariaLabel:t}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${d} nice-input--ds-${z} ${s?"nice-input--error":""} ${n?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:g,children:[V&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:$e,onMouseDown:()=>q($e),onMouseUp:B,onMouseLeave:B,disabled:n,"aria-label":ie("controls.decrement","Decrement"),children:"−"}),U==="select"&&I&&I.length>0?e.jsxs(e.Fragment,{children:[ne&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:A??I[0]?.value,disabled:n,onChange:c=>{const j=c.target.value,ce=I.find(Ne=>Ne.value===(A??I[0]?.value)),_e=I.find(Ne=>Ne.value===j);y?.(j,ce?.weight,_e?.weight)},children:I.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))})]}):L?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[ne&&e.jsx("span",{className:"nice-input__sign",children:"−"}),L]}):null,e.jsx("input",{ref:c=>{typeof Y=="function"?Y(c):Y&&(Y.current=c),ve.autoFocusRef(c)},id:a,className:"nice-input__native",type:!C&&(K||N)?"text":"number",name:$,value:we,placeholder:J,min:D,max:k,step:E,disabled:n||Z,readOnly:i,"aria-invalid":!!s,onChange:Me,onFocus:c=>{O(!0),xe(null),c.target.select()},onBlur:c=>{if(O(!1),xe(null),x!=null&&v!==void 0){const j=parseFloat(x.toFixed(v));j!==x&&w?.(j)}ue&&ve.exitEdit(),F?.(c)},onKeyDown:ke,style:{width:`${pe}ch`}}),H==="select"&&M&&M.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:ee??M[0]?.value,disabled:n,onChange:c=>{const j=c.target.value,ce=M.find(Ne=>Ne.value===(ee??M[0]?.value)),_e=M.find(Ne=>Ne.value===j);ae?.(j,ce?.weight,_e?.weight)},children:M.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))}):T?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:T}):null,V&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:ge,onMouseDown:()=>q(ge),onMouseUp:B,onMouseLeave:B,disabled:n,"aria-label":ie("controls.increment","Increment"),children:"+"})]})}),Z&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),X==="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),X==="right"&&!s&&p&&e.jsx("div",{className:"nice-field__helper",children:p})]}),X!=="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),X!=="right"&&!s&&p&&e.jsx("div",{className:"nice-field__helper",children:p})]})});Se.displayName="NiceNumberInput";const He=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:Se},Symbol.toStringTag,{value:"Module"})),Ee=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,size:i="md",name:d,id:$,className:h,style:f,accessMode:_,displayStyle:S,options:Q,value:x,onChange:w,placeholder:F,multiple:m=!1,searchable:J=!1,clearable:D=!1,emptyText:k,maxHeight:E=240,optionsSource:v,valueField:L,labelField:U,virtualScroll:I,optionHeight:A=36,onSearch:y,loading:T,renderOption:V,multipleAutosize:R=!1,showKeyboardHints:G,labelPlacement:re,errorPlacement:le,labelWidth:X,controlWidth:Z,displayMode:de},b)=>{const N=o.sc(_,$),K=N==="hidden";(N==="disabled"||N==="readOnly")&&(n=!0);const{t:H}=o.Zt(),M=o.Ns("input",S),ee=o.Es("input",S),ae=o._s($),ue=o.zs({enabled:de,disabled:n}),[Y,P]=l.useState(!1),[oe,ie]=l.useState(""),[a,g]=l.useState(-1),[z,C]=l.useState(0),O=l.useRef(null),W=l.useRef(null),[xe,ve]=l.useState(null);l.useLayoutEffect(()=>{!T&&W.current&&ve(W.current.offsetWidth)},[T,x,S]);const[pe,je]=l.useState(null);l.useLayoutEffect(()=>{m&&!R&&W.current&&pe==null&&je(W.current.offsetWidth)},[m,R,pe]);const ye=o.vd(v??null,L??v?.keyField??"id",U??"name"),fe=v?ye.options:(Q??[]).map(r=>typeof r=="string"?{value:r,label:r}:r);o.Vs(O,()=>{P(!1),ie("")});const se=l.useMemo(()=>x?Array.isArray(x)?x:[x]:[],[x]),ne=l.useMemo(()=>{if(!oe&&!y||y)return fe;const r=oe.toLowerCase();return fe.filter(B=>B.label.toLowerCase().includes(r)||String(B.value).toLowerCase().includes(r))},[fe,oe,y]),we=l.useMemo(()=>{const r=new Map;for(const B of ne){const q=B.group||"";r.has(q)||r.set(q,[]),r.get(q).push(B)}return r},[ne]),he=l.useCallback(r=>{if(m){const B=se.includes(r)?se.filter(q=>q!==r):[...se,r];w?.(B)}else w?.(r),P(!1),ie("")},[m,se,w]),Me=l.useCallback(r=>{if(r.key==="Escape"){P(!1),ie("");return}if(r.key==="Enter"||r.key===" "){if(!Y){P(!0),r.preventDefault();return}a>=0&&ne[a]&&(he(ne[a].value),r.preventDefault());return}r.key==="ArrowDown"&&(r.preventDefault(),g(B=>Math.min(B+1,ne.length-1))),r.key==="ArrowUp"&&(r.preventDefault(),g(B=>Math.max(B-1,0)))},[Y,a,ne,he]),ge=l.useMemo(()=>se.length===0?null:m?se.map(r=>fe.find(B=>B.value===r)?.label||r).join(", "):fe.find(r=>r.value===se[0])?.label||se[0],[se,fe,m]),$e=l.useCallback(r=>{r.stopPropagation(),w?.(m?[]:"")},[w,m]),be=l.useMemo(()=>[{key:"Enter",description:H("shortcuts.select","Select")},{key:"Space",description:H("shortcuts.openDropdown","Open dropdown")},o.xc.moveUp,o.xc.moveDown,o.xc.cancel],[H]);return K?null:e.jsxs("div",{className:`nice-field ${Z==null?"nice-field--select-auto":""} nice-field--${i} ${re==="left"?"nice-field--label-left":""} ${T?"nice-field--loading":""} ${h||""}`,style:{...f,...X!=null&&{"--nice-field-label-width":typeof X=="number"?`${X}px`:X},...Z!=null&&{"--nice-field-control-width":typeof Z=="number"?`${Z}px`:Z},...T&&xe!=null&&{"--nice-select-locked-width":`${xe}px`}},"aria-busy":T||void 0,children:[t&&e.jsxs("label",{htmlFor:ae,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,G&&e.jsx(o.Qr,{shortcuts:be,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ue.isDisplay?e.jsx(o.Fs,{value:ge,placeholder:F||H("controls.select","Select..."),disabled:n,onActivate:()=>{ue.enterEdit(),P(!0)},ariaLabel:t}):e.jsxs("div",{className:"nice-select",ref:O,children:[e.jsxs("button",{ref:r=>{W.current=r,typeof b=="function"?b(r):b&&(b.current=r)},type:"button",id:ae,role:"combobox","aria-expanded":Y,"aria-haspopup":"listbox","aria-invalid":!!s,className:`nice-select__trigger nice-select__trigger--${i} nice-select--ds-${ee} ${Y?"nice-select__trigger--open":""} ${s?"nice-select__trigger--error":""} ${n?"nice-select__trigger--disabled":""}`,style:{...M,...m&&!R&&pe!=null?{width:pe,maxWidth:pe,overflow:"hidden"}:{}},disabled:n,onClick:()=>P(!Y),onKeyDown:Me,children:[ge?e.jsx("span",{style:m&&!R?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:ge}):e.jsx("span",{className:"nice-select__placeholder",children:F||H("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[D&&se.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:$e,role:"button","aria-label":H("controls.clear","Clear"),children:"✕"}),e.jsx("svg",{className:`nice-select__chevron ${Y?"nice-select__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]})]}),Y&&e.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:E},onScroll:I?r=>C(r.currentTarget.scrollTop):void 0,children:[(J||y)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:oe,onChange:r=>{ie(r.target.value),g(0),y?.(r.target.value)},placeholder:H("controls.search","Search..."),autoFocus:!0})}),T&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!T&&ne.length===0?e.jsx("div",{className:"nice-select__empty",children:k||H("controls.noResults","No results found")}):I&&!Array.from(we.keys()).some(r=>r!=="")?(()=>{const B=ne.length*A,q=Math.max(0,Math.floor(z/A)-3),me=Math.min(ne.length,Math.ceil((z+E)/A)+3),ke=ne.slice(q,me);return e.jsx("div",{style:{height:B,position:"relative"},children:ke.map((te,c)=>{const j=q+c,ce=se.includes(te.value);return e.jsx("div",{role:"option","aria-selected":ce,className:`nice-select__option ${ce?"nice-select__option--selected":""} ${j===a?"nice-select__option--highlighted":""} ${te.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:j*A,left:0,right:0,height:A,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!te.disabled&&he(String(te.value)),onMouseEnter:()=>g(j),children:V?V(te,ce):e.jsxs(e.Fragment,{children:[te.icon&&e.jsx("span",{children:te.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:te.label}),te.description&&e.jsx("div",{className:"nice-select__option-desc",children:te.description})]}),ce&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},te.value)})})})():Array.from(we.entries()).map(([r,B])=>e.jsxs(l.Fragment,{children:[r&&e.jsx("div",{className:"nice-select__group-label",children:r}),B.map(q=>{const me=se.includes(q.value),ke=ne.indexOf(q);return e.jsx("div",{role:"option","aria-selected":me,className:`nice-select__option ${me?"nice-select__option--selected":""} ${ke===a?"nice-select__option--highlighted":""} ${q.disabled?"nice-select__option--disabled":""}`,onClick:()=>!q.disabled&&he(String(q.value)),onMouseEnter:()=>g(ke),children:V?V(q,me):e.jsxs(e.Fragment,{children:[q.icon&&e.jsx("span",{children:q.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:q.label}),q.description&&e.jsx("div",{className:"nice-select__option-desc",children:q.description})]}),me&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},q.value)})]},r))]})]}),T&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),le==="right"&&s&&e.jsx("div",{id:`${ae}-error`,className:"nice-field__error",role:"alert",children:s}),le==="right"&&!s&&p&&e.jsx("div",{id:`${ae}-helper`,className:"nice-field__helper",children:p})]}),le!=="right"&&s&&e.jsx("div",{id:`${ae}-error`,className:"nice-field__error",role:"alert",children:s}),le!=="right"&&!s&&p&&e.jsx("div",{id:`${ae}-helper`,className:"nice-field__helper",children:p})]})});Ee.displayName="NiceSelect";const Ae=Object.freeze(Object.defineProperty({__proto__:null,NiceSelect:Ee},Symbol.toStringTag,{value:"Module"})),Re=l.forwardRef(({label:t,checked:p=!1,indeterminate:s=!1,onChange:u,disabled:n,readOnly:i,loading:d,required:$,size:h="md",name:f,id:_,className:S,style:Q,error:x,helperText:w,accessMode:F,displayStyle:m,showKeyboardHints:J,labelPlacement:D,errorPlacement:k,labelWidth:E,controlWidth:v},L)=>{const U=o.sc(F,_),I=U==="hidden";(U==="disabled"||U==="readOnly")&&(n=!0);const{t:A}=o.Zt(),y=o._s(_);o.Es("toggle",m);const T=l.useMemo(()=>[{key:"Space",description:A("shortcuts.toggle","Toggle")}],[A]),V=l.useCallback(R=>{R&&(R.indeterminate=s),typeof L=="function"?L(R):L&&(L.current=R)},[s,L]);return I?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${h} ${D==="left"?"nice-field--label-left":""} ${k==="right"?"nice-field--error-right":""} ${d?"nice-field--loading":""} ${S||""}`,style:{...Q,...E!=null&&{"--nice-field-label-width":typeof E=="number"?`${E}px`:E},...v!=null&&{"--nice-field-control-width":typeof v=="number"?`${v}px`:v}},"aria-busy":d||void 0,children:[D==="left"&&t&&e.jsx("span",{className:`nice-field__label ${$?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${h!=="md"?`nice-checkbox--${h}`:""} ${n||d?"nice-checkbox--disabled":""}`,htmlFor:y,children:[e.jsx("input",{ref:V,id:y,type:"checkbox",className:"nice-checkbox__input",name:f,checked:p,disabled:n||d,readOnly:i,"aria-invalid":!!x,onChange:R=>{i||d||u?.(R.target.checked)}}),e.jsx("span",{className:"nice-checkbox__box",children:e.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s?e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):e.jsx("polyline",{points:"2 6 5 9 10 3"})})}),D!=="left"&&t&&e.jsx("span",{children:t}),J&&e.jsx(o.Qr,{shortcuts:T,size:"sm"})]}),d&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),k==="right"&&x&&e.jsx("div",{id:`${y}-error`,className:"nice-field__error",role:"alert",children:x}),k==="right"&&!x&&w&&e.jsx("div",{id:`${y}-helper`,className:"nice-field__helper",children:w})]}),k!=="right"&&x&&e.jsx("div",{id:`${y}-error`,className:"nice-field__error",role:"alert",children:x}),k!=="right"&&!x&&w&&e.jsx("div",{id:`${y}-helper`,className:"nice-field__helper",children:w})]})});Re.displayName="NiceCheckbox";const Be=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:Re},Symbol.toStringTag,{value:"Module"})),Fe=l.forwardRef(({label:t,checked:p=!1,onChange:s,disabled:u,readOnly:n,loading:i,required:d,size:$="md",name:h,id:f,className:_,style:S,accessMode:Q,displayStyle:x,showKeyboardHints:w,error:F,helperText:m,labelPlacement:J,errorPlacement:D,labelWidth:k,controlWidth:E},v)=>{const L=o.sc(Q,f),U=L==="hidden";(L==="disabled"||L==="readOnly")&&(u=!0);const{t:I}=o.Zt(),A=o._s(f);o.Ns("toggle",x);const y=o.Es("toggle",x),T=l.useMemo(()=>[{key:"Space",description:I("shortcuts.toggle","Toggle on/off")}],[I]);return U?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${$} ${J==="left"?"nice-field--label-left":""} ${i?"nice-field--loading":""} ${_||""}`,style:{...S,...k!=null&&{"--nice-field-label-width":typeof k=="number"?`${k}px`:k},...E!=null&&{"--nice-field-control-width":typeof E=="number"?`${E}px`:E}},"aria-busy":i||void 0,children:[J==="left"&&t&&e.jsx("span",{className:`nice-field__label ${d?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${y} ${$!=="md"?`nice-toggle--${$}`:""} ${u||i?"nice-toggle--disabled":""}`,htmlFor:A,children:[e.jsx("input",{ref:v,id:A,type:"checkbox",className:"nice-toggle__input",name:h,checked:p,disabled:u||i,readOnly:n,role:"switch","aria-checked":p,"aria-invalid":!!F,onChange:V=>{n||i||s?.(V.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),J!=="left"&&t&&e.jsx("span",{children:t}),w&&e.jsx(o.Qr,{shortcuts:T,size:"sm"})]}),i&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),D==="right"&&F&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:F}),D==="right"&&!F&&m&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:m})]}),D!=="right"&&F&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:F}),D!=="right"&&!F&&m&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:m})]})});Fe.displayName="NiceToggle";const qe=["var(--nice-danger, #ef4444)","var(--nice-warning, #f97316)","var(--nice-warning, #f59e0b)","var(--nice-success, #84cc16)","var(--nice-success, #10b981)","var(--nice-info, #06b6d4)","var(--nice-primary, #3b82f6)","var(--nice-info, #6366f1)","var(--nice-accent, #8b5cf6)","var(--nice-accent-pink, #ec4899)","var(--nice-text-secondary, #64748b)","var(--nice-text, #1e293b)"];function ze(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function Ue(t){const p=/^#?([0-9a-f]{6})$/i.exec(t.trim());if(!p)return{r:0,g:0,b:0};const s=parseInt(p[1],16);return{r:s>>16&255,g:s>>8&255,b:s&255}}function Ke(t,p,s){const u=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${u(t)}${u(p)}${u(s)}`}function Qe(t,p,s){const u=t/255,n=p/255,i=s/255,d=Math.max(u,n,i),$=Math.min(u,n,i),h=(d+$)/2;let f=0,_=0;if(d!==$){const S=d-$;switch(_=h>.5?S/(2-d-$):S/(d+$),d){case u:f=(n-i)/S+(n<i?6:0);break;case n:f=(i-u)/S+2;break;case i:f=(u-n)/S+4;break}f*=60}return{h:Math.round(f),s:Math.round(_*100),l:Math.round(h*100)}}function Ve(t,p,s){const u=p/100,n=s/100,i=(1-Math.abs(2*n-1))*u,d=i*(1-Math.abs(t/60%2-1)),$=n-i/2;let h=0,f=0,_=0;return t<60?[h,f,_]=[i,d,0]:t<120?[h,f,_]=[d,i,0]:t<180?[h,f,_]=[0,i,d]:t<240?[h,f,_]=[0,d,i]:t<300?[h,f,_]=[d,0,i]:[h,f,_]=[i,0,d],{r:Math.round((h+$)*255),g:Math.round((f+$)*255),b:Math.round((_+$)*255)}}function Ze(t,p,s){const u=t/255,n=p/255,i=s/255,d=Math.max(u,n,i),$=Math.min(u,n,i),h=d-$;let f=0;h!==0&&(d===u?f=(n-i)/h%6:d===n?f=(i-u)/h+2:f=(u-n)/h+4,f*=60,f<0&&(f+=360));const _=d===0?0:h/d;return{h:Math.round(f),s:Math.round(_*100),v:Math.round(d*100)}}function Pe(t,p,s){const u=p/100,n=s/100,i=n*u,d=i*(1-Math.abs(t/60%2-1)),$=n-i;let h=0,f=0,_=0;return t<60?[h,f,_]=[i,d,0]:t<120?[h,f,_]=[d,i,0]:t<180?[h,f,_]=[0,i,d]:t<240?[h,f,_]=[0,d,i]:t<300?[h,f,_]=[d,0,i]:[h,f,_]=[i,0,d],{r:Math.round((h+$)*255),g:Math.round((f+$)*255),b:Math.round((_+$)*255)}}function Ge(t){const p=/^#?([0-9a-f]{6})$/i.exec(t.trim()),s=/^#?([0-9a-f]{8})$/i.exec(t.trim());if(s){const u=s[1];return{r:parseInt(u.slice(0,2),16),g:parseInt(u.slice(2,4),16),b:parseInt(u.slice(4,6),16),a:parseInt(u.slice(6,8),16)/255}}if(p){const u=parseInt(p[1],16);return{r:u>>16&255,g:u>>8&255,b:u&255,a:1}}return{r:0,g:0,b:0,a:1}}function Xe(t,p,s,u,n){const i=$=>Math.max(0,Math.min(255,Math.round($))).toString(16).padStart(2,"0"),d=`#${i(t)}${i(p)}${i(s)}`;return n?`${d}${i(u*255)}`:d}const De=l.forwardRef(({label:t,helperText:p,error:s,required:u,disabled:n,id:i,className:d,style:$,accessMode:h,displayStyle:f,value:_="var(--nice-primary, #3b82f6)",onChange:S,presets:Q=qe,showInput:x=!0,showRandom:w=!0,withAlpha:F=!1,showKeyboardHints:m,size:J="md",labelPlacement:D,errorPlacement:k,labelWidth:E,controlWidth:v,loading:L},U)=>{const I=o.sc(h,i),A=I==="hidden";(I==="disabled"||I==="readOnly")&&(n=!0);const{t:y}=o.Zt(),T=o._s(i);o.Es("input",f);const V=l.useCallback(()=>{n||S?.(ze())},[n,S]),[R,G]=l.useState(!1),[re,le]=l.useState(null),X=l.useRef(null),Z=l.useRef(null);l.useLayoutEffect(()=>{if(!R||!Z.current)return;const b=()=>{const N=Z.current?.getBoundingClientRect();if(!N)return;const K=280,H=360;let M=N.left,ee=N.bottom+6;M+K>window.innerWidth-8&&(M=Math.max(8,window.innerWidth-K-8)),ee+H>window.innerHeight-8&&(ee=Math.max(8,N.top-H-6)),le({left:M,top:ee})};return b(),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[R]),l.useEffect(()=>{if(!R)return;const b=K=>{const H=K.target;X.current?.contains(H)||Z.current?.contains(H)||G(!1)},N=K=>{K.key==="Escape"&&G(!1)};return document.addEventListener("mousedown",b),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",N)}},[R]);const de=l.useMemo(()=>[{key:"Enter",description:y("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:y("shortcuts.navigatePresets","Navigate presets")}],[y]);return A?null:e.jsxs("div",{className:`nice-field nice-field--${J} ${D==="left"?"nice-field--label-left":""} ${L?"nice-field--loading":""} ${d||""}`,style:{...$,...E!=null&&{"--nice-field-label-width":typeof E=="number"?`${E}px`:E},...v!=null&&{"--nice-field-control-width":typeof v=="number"?`${v}px`:v}},"aria-busy":L||void 0,children:[t&&e.jsxs("label",{htmlFor:T,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:[t,m&&e.jsx(o.Qr,{shortcuts:de,size:"sm"})]}),e.jsx("div",{className:"nice-field__control",children:e.jsxs("div",{className:"nice-color-picker",children:[e.jsxs("div",{className:"nice-color-picker__preview-row",children:[e.jsx("div",{ref:Z,className:"nice-color-picker__swatch",id:T,style:{background:_},onClick:b=>{b.stopPropagation(),n||G(N=>!N)},onKeyDown:b=>{!n&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),G(N=>!N))},role:"button",tabIndex:0,"aria-label":y("colorPicker.openPalette","Open color palette"),"aria-haspopup":"dialog","aria-expanded":R,children:e.jsx("input",{ref:b=>{typeof U=="function"?U(b):U&&(U.current=b)},type:"hidden",value:_,disabled:n,readOnly:!0})}),x&&e.jsx("div",{className:"nice-input nice-input--sm",style:{width:100},children:e.jsx("input",{className:"nice-input__native",type:"text",value:_,disabled:n,onChange:b=>S?.(b.target.value),maxLength:7})}),w&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:V,disabled:n,title:y("colorPicker.random","Random"),"aria-label":y("colorPicker.random","Random"),style:{fontSize:"0.65rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:y("colorPicker.random","Random")}),L&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),k==="right"&&s&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:s}),k==="right"&&!s&&p&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:p})]}),R&&re&&typeof document<"u"&&Ie.createPortal(e.jsx("div",{ref:X,className:"nice-color-picker__popup nice-color-picker__popup--portal",role:"dialog","aria-label":y("colorPicker.palette","Color palette"),style:{position:"fixed",left:re.left,top:re.top},onClick:b=>b.stopPropagation(),children:(()=>{const b=Ge(_),N={r:b.r,g:b.g,b:b.b},K=F?b.a:1,H=Qe(N.r,N.g,N.b),M=Ze(N.r,N.g,N.b),ee=(a,g,z,C=K)=>S?.(Xe(a,g,z,C,F)),ae=(a,g,z)=>ee(a,g,z),ue=(a,g,z)=>{const C=Ve(a,g,z);ee(C.r,C.g,C.b)},Y=(a,g,z)=>{const C=Pe(a,g,z);ee(C.r,C.g,C.b)},P=a=>ee(N.r,N.g,N.b,a),oe=a=>{if(n)return;const g=a.currentTarget,z=O=>{const W=g.getBoundingClientRect(),xe=Math.max(0,Math.min(W.width,O.clientX-W.left)),ve=Math.max(0,Math.min(W.height,O.clientY-W.top)),pe=Math.round(xe/W.width*100),je=100-Math.round(ve/W.height*100);Y(M.h,pe,je)};z(a);const C=()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",z),document.addEventListener("pointerup",C)},ie=`hsl(${M.h}, 100%, 50%)`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-color-picker__popup-header",children:e.jsx("input",{type:"text",className:"nice-input__native nice-color-picker__popup-hex",value:_,disabled:n,onChange:a=>S?.(a.target.value),maxLength:F?9:7,"aria-label":y("colorPicker.hexValue","Hex value")})}),e.jsx("input",{type:"range",min:0,max:360,value:M.h,disabled:n,onChange:a=>Y(Number(a.target.value),M.s,M.v),className:"nice-color-picker__hue-slider","aria-label":y("colorPicker.hue","Hue")}),e.jsx("div",{className:"nice-color-picker__sv",style:{background:`linear-gradient(to top, var(--nice-text, #000), transparent), linear-gradient(to right, var(--nice-bg, #FFF), ${ie})`},onPointerDown:oe,role:"application","aria-label":y("colorPicker.svPalette","Saturation/value palette"),children:e.jsx("span",{className:"nice-color-picker__sv-marker",style:{left:`${M.s}%`,top:`${100-M.v}%`}})}),e.jsxs("div",{className:"nice-color-picker__sliders",children:[e.jsx("div",{className:"nice-color-picker__slider-col",children:["h","s","l"].map(a=>{const g=a==="h"?360:100,z=H[a],C=O=>ue(a==="h"?O:H.h,a==="s"?O:H.s,a==="l"?O:H.l);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:a.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:g,value:z,disabled:n,onChange:O=>C(Number(O.target.value))}),e.jsx("input",{type:"number",min:0,max:g,value:z,disabled:n,onChange:O=>C(Number(O.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},a)})}),e.jsx("div",{className:"nice-color-picker__slider-col",children:["r","g","b"].map(a=>{const g=N[a],z=C=>ae(a==="r"?C:N.r,a==="g"?C:N.g,a==="b"?C:N.b);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:a.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:255,value:g,disabled:n,onChange:C=>z(Number(C.target.value))}),e.jsx("input",{type:"number",min:0,max:255,value:g,disabled:n,onChange:C=>z(Number(C.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},a)})})]}),F&&e.jsxs("div",{className:"nice-color-picker__alpha-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:"A"}),e.jsx("input",{type:"range",min:0,max:100,value:Math.round(K*100),disabled:n,onChange:a=>P(Number(a.target.value)/100),className:"nice-color-picker__alpha-slider",style:{background:`linear-gradient(to right, transparent, rgb(${N.r},${N.g},${N.b}))`},"aria-label":y("colorPicker.alpha","Alpha")}),e.jsx("input",{type:"number",min:0,max:100,value:Math.round(K*100),disabled:n,onChange:a=>P((Number(a.target.value)||0)/100),className:"nice-input__native nice-color-picker__slider-num"})]}),Q.length>0&&e.jsx("div",{className:"nice-color-picker__popup-presets",children:Q.map(a=>e.jsx("div",{className:`nice-color-picker__preset ${_===a?"nice-color-picker__preset--active":""}`,style:{background:a},onClick:()=>{S?.(a),G(!1)},role:"button",tabIndex:0,"aria-label":a,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),S?.(a),G(!1))}},a))})]})})()}),document.body)]})}),k!=="right"&&s&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:s}),k!=="right"&&!s&&p&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:p})]})});De.displayName="NiceColorPicker";const Ye=Object.freeze(Object.defineProperty({__proto__:null,NiceColorPicker:De,hexToRgb:Ue,rgbToHex:Ke},Symbol.toStringTag,{value:"Module"})),Le=l.forwardRef(({children:t,variant:p="primary",size:s="md",type:u="button",disabled:n,loading:i,fullWidth:d,onClick:$,leftIcon:h,rightIcon:f,error:_,errorPlacement:S="bottom",className:Q,style:x,id:w,accessMode:F,displayStyle:m,...J},D)=>{const k=o.ws(p),E=o.xs(s),v=o.sc(F,w),L=v==="hidden";(v==="disabled"||v==="readOnly")&&(n=!0);const U=o.Ns("button",m),I=o.Es("button",m),A=k!=="primary"?(({background:V,color:R,...G})=>G)(U):U,y=e.jsxs("button",{ref:D,type:u,id:w,className:`nice-btn nice-btn--${k} nice-btn--${E} nice-btn--ds-${I} ${d?"nice-btn--full-width":""} ${i?"nice-btn--loading":""} ${_&&!S?"nice-btn--has-error":""} ${Q||""}`,style:{...A,...x},disabled:n||i,"aria-busy":i||void 0,"aria-disabled":n||i||void 0,onClick:$,...J,children:[i&&e.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!i&&h&&e.jsx("span",{"aria-hidden":"true",children:h}),!i&&e.jsx("span",{children:t}),i&&e.jsx("span",{style:{visibility:"hidden"},"aria-hidden":"true",children:t}),!i&&f&&e.jsx("span",{"aria-hidden":"true",children:f})]});if(L)return null;if(!_)return y;const T=e.jsx("div",{className:"nice-field__error",role:"alert",children:_});return S==="right"?e.jsxs("span",{className:`nice-btn-field nice-btn-field--right nice-field--${E}`,style:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:"8px",width:"fit-content"},children:[y,T]}):L?null:e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${E}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",width:"fit-content"},children:[y,T]})});Le.displayName="NiceButton";const Je=({tabs:t,activeTab:p,onChange:s,variant:u="default",vertical:n,size:i="md",className:d,style:$,displayStyle:h})=>{const f=o.Ns("tab",h),_=o.Es("tab",h),[S,Q]=l.useState(p||t[0]?.id),x=p??S,w=l.useCallback(m=>{Q(m),s?.(m)},[s]),F=t.find(m=>m.id===x)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${i} nice-tabs--ds-${_} ${d||""}`,style:{...f,...$,...n?{display:"flex",gap:16}:{}},children:[e.jsx("div",{className:`nice-tabs__list ${u!=="default"?`nice-tabs__list--${u}`:""} ${n?"nice-tabs__list--vertical":""}`,role:"tablist",children:t.map(m=>e.jsxs("button",{type:"button",role:"tab","aria-selected":x===m.id,className:`nice-tabs__tab ${x===m.id?"nice-tabs__tab--active":""} ${m.disabled?"nice-tabs__tab--disabled":""}`,disabled:m.disabled,onClick:()=>w(m.id),children:[m.icon,e.jsx("span",{children:m.label}),m.badge!==void 0&&e.jsx("span",{className:"nice-tabs__badge",children:m.badge})]},m.id))}),F&&e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:F})]})};exports.NiceButton=Le;exports.NiceCheckbox=Re;exports.NiceCheckbox$1=Be;exports.NiceColorPicker=De;exports.NiceColorPicker$1=Ye;exports.NiceNumberInput=Se;exports.NiceNumberInput$1=He;exports.NiceSelect=Ee;exports.NiceSelect$1=Ae;exports.NiceTabs=Je;exports.NiceTextInput=Ce;exports.NiceTextInput$1=Te;exports.NiceToggle=Fe;