@nice2dev/ui 1.0.30 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +495 -0
- package/README.md +30 -31
- package/dist/NiceCalendarScheduler.doc-BEtQkZjV.cjs +9 -0
- package/dist/NiceCalendarScheduler.doc-D__LRgOx.js +33 -0
- package/dist/NiceConfirmDialog-B57cl_F7.cjs +1 -0
- package/dist/NiceConfirmDialog-N9fBTLYm.js +81 -0
- package/dist/NiceDrawingCanvas.doc-Dv5vB4gY.js +32 -0
- package/dist/NiceDrawingCanvas.doc-Ww9zz17x.cjs +8 -0
- package/dist/NiceErrorBoundary-BD-uqk_q.js +709 -0
- package/dist/NiceErrorBoundary-CIPXaYik.cjs +1 -0
- package/dist/NiceFileManagerViews.doc-CKlnm6cX.cjs +1 -0
- package/dist/NiceFileManagerViews.doc-Cg21DArG.js +25 -0
- package/dist/NiceForm-BNZB31Pg.js +4499 -0
- package/dist/NiceForm-CPyAXxBO.cjs +1 -0
- package/dist/NiceMegaMenu.doc-7UyOCd3l.cjs +7 -0
- package/dist/NiceMegaMenu.doc-zeIyVa65.js +31 -0
- package/dist/NiceModal-Bj53SKLI.js +95 -0
- package/dist/NiceModal-DC0UlQhc.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BBOg9g0b.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DtuXRiLR.js +6991 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-Bjxy9aEc.js +172 -0
- package/dist/NicePagination-CfFfNwrg.cjs +1 -0
- package/dist/NiceSavedQueryPanel-CH5c3rUG.js +6988 -0
- package/dist/NiceSavedQueryPanel-aQrEmmcC.cjs +596 -0
- package/dist/NiceScannerControl-Cd5KXJA9.js +12769 -0
- package/dist/NiceScannerControl-DZsERSw_.cjs +698 -0
- package/dist/NiceScannerControl.css +1 -0
- package/dist/NiceWindow-BoDzlGk-.js +1621 -0
- package/dist/NiceWindow-DgONWxBm.cjs +1 -0
- package/dist/charts-Bs0aDM0X.js +4671 -0
- package/dist/charts-DjjKkw0q.cjs +761 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-BUsZ7_vI.js +27914 -0
- package/dist/core-CLfcCDKc.cjs +122 -0
- package/dist/data-branching-D7l_kILW.cjs +1 -0
- package/dist/data-branching-lJ07lDN-.js +6255 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +41 -37
- package/dist/data.mjs +18 -19
- package/dist/devops-Bi8MXtko.js +8165 -0
- package/dist/devops-On_1wRf9.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +215 -431
- package/dist/editors.mjs +48 -56
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index-BDH1yDSg.js +69235 -0
- package/dist/index-C9njkNOD.cjs +5470 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +441 -916
- package/dist/index.mjs +908 -933
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +25 -213
- package/dist/navigation.mjs +105 -113
- package/dist/no-code-8lO7o6xi.js +7425 -0
- package/dist/no-code-K8tOLNew.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +8 -0
- package/dist/overlays.mjs +36 -36
- package/dist/pickerCommons-CORo9j2a.js +2119 -0
- package/dist/pickerCommons-D3WShRrR.cjs +1 -0
- package/dist/style.css +5 -5
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),r=require("./core-CLfcCDKc.cjs"),l=require("react"),Ie=require("react-dom"),Ue=require("./vendor-DHEorsoy.cjs"),Ee=l.forwardRef(({label:t,helperText:f,error:s,required:d,disabled:i,readOnly:n,size:c="md",name:x,id:o,className:u,style:h,accessMode:w,displayStyle:G,variant:m,value:y,defaultValue:k,onChange:v,onBlur:P,onKeyDown:M,placeholder:b,type:C="text",maxLength:N,prefix:L,suffix:V,clearable:R,autoFocus:A,submitOnEnter:I,onSubmit:S,showKeyboardHints:H,labelPlacement:T,errorPlacement:J,loading:U,labelWidth:le,controlWidth:se,displayMode:ee,...he},ne)=>{const O=r.Dc(w,o),me=O==="hidden";O==="disabled"&&(i=!0),O==="readOnly"&&(n=!0);const{t:j}=r.Gt(),_=r.bc(o),te=r.rc("input",G),Y=r.ac("input",G),Q=m==="filled"?"filled":m==="underlined"?"underlined":"",z=l.useCallback(()=>v?.(""),[v]),X=r.sc({enabled:ee,readOnly:n,disabled:i}),re=r.Zc({enabled:I,onSubmit:S}),de=l.useCallback(B=>{re(B),M?.(B)},[re,M]),W=l.useMemo(()=>{const B=[];return I&&B.push({key:"Enter",description:j("shortcuts.submit","Submit")}),R&&B.push({key:"Escape",description:j("shortcuts.clear","Clear")}),B},[I,R,j]);return me?null:e.jsxs("div",{className:`nice-field nice-field--${c} ${T==="left"?"nice-field--label-left":""} ${T==="inside"?"nice-field--label-inside":""} ${U?"nice-field--loading":""} ${u||""}`,style:{...h,...le!=null&&{"--nice-field-label-width":typeof le=="number"?`${le}px`:le},...se!=null&&{"--nice-field-control-width":typeof se=="number"?`${se}px`:se}},"aria-busy":U||void 0,"data-floating":T==="inside"&&y?"true":void 0,children:[t&&T!=="inside"&&e.jsxs("label",{htmlFor:_,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:[t,H&&W.length>0&&e.jsx(r.ha,{shortcuts:W,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[X.isDisplay?e.jsx(r.cc,{value:y??k??"",placeholder:b,disabled:i,readOnly:n,onActivate:X.enterEdit,ariaLabel:t}):e.jsxs("div",{className:`nice-input nice-input--${c} nice-input--ds-${Q||Y} ${s?"nice-input--error":""} ${i?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:m?void 0:te,children:[L&&e.jsx("span",{className:"nice-input__icon",children:L}),e.jsx("input",{ref:B=>{typeof ne=="function"?ne(B):ne&&(ne.current=B),X.autoFocusRef(B)},id:_,className:"nice-input__native",type:C,name:x,value:y,defaultValue:k,placeholder:b,disabled:i||U,readOnly:n,maxLength:N,autoFocus:A,"aria-invalid":!!s,"aria-describedby":s?`${_}-error`:f?`${_}-helper`:void 0,onChange:B=>v?.(B.target.value),onBlur:B=>{ee&&X.exitEdit(),P?.(B)},onKeyDown:de,...he}),R&&y&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:z,"aria-label":j("controls.clear","Clear"),children:e.jsx(r.oa,{name:"close",size:14})}),V&&e.jsx("span",{className:"nice-input__icon",children:V}),t&&T==="inside"&&e.jsx("label",{htmlFor:_,className:`nice-input__floating-label ${d?"nice-input__floating-label--required":""}`,children:t})]}),U&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),J==="right"&&s&&e.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:s}),J==="right"&&!s&&f&&e.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:f})]}),J!=="right"&&s&&e.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:s}),J!=="right"&&!s&&f&&e.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:f})]})});Ee.displayName="NiceTextInput";const Ke=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:Ee},Symbol.toStringTag,{value:"Module"})),Le=l.forwardRef(({label:t,helperText:f,error:s,required:d,disabled:i,readOnly:n,size:c="md",name:x,id:o,className:u,style:h,accessMode:w,displayStyle:G,value:m,onChange:y,onBlur:k,onKeyDown:v,placeholder:P,min:M,max:b,step:C=1,precision:N,prefix:L,prefixType:V="label",prefixOptions:R,prefixValue:A,onPrefixChange:I,suffix:S,showStepper:H=!0,submitOnEnter:T,onSubmit:J,showKeyboardHints:U,labelPlacement:le,errorPlacement:se,loading:ee,labelWidth:he,controlWidth:ne,formatPreset:O,format:me,suffixType:j="label",suffixOptions:_,suffixValue:te,onSuffixChange:Y,suffixSeparator:Q=!1,displayMode:z},X)=>{const re=r.Dc(w,o),de=re==="hidden";re==="disabled"&&(i=!0),re==="readOnly"&&(n=!0);const{t:W}=r.Gt(),B=r.bc(o),ye=r.rc("input",G),g=r.ac("input",G),[D,F]=l.useState(!1),[E,fe]=l.useState(null),ie=r.sc({enabled:z,readOnly:n,disabled:i}),we=l.useMemo(()=>{let a=3;return b!=null&&(a=String(Math.abs(Math.floor(b))).length),M!=null&&M<0&&(a+=1),N&&(a+=N+1),Math.max(3,a)+1},[b,M,N]),ke=l.useCallback(a=>{if(me)return me(a);if(!O)return N!=null?a.toFixed(N):String(a);switch(O){case"integer":return Math.round(a).toLocaleString();case"decimal":return a.toLocaleString(void 0,{minimumFractionDigits:N??2,maximumFractionDigits:N??2});case"money":return a.toLocaleString(void 0,{minimumFractionDigits:N??2,maximumFractionDigits:N??2,useGrouping:!0});case"percent":return(a*100).toLocaleString(void 0,{minimumFractionDigits:N??0,maximumFractionDigits:N??2})+"%";default:return String(a)}},[me,O,N]),ae=l.useMemo(()=>D&&E!==null?E:m==null?"":D?N!=null?m.toFixed(N):String(m):ke(m),[m,D,E,ke,N]),$e=m!=null&&m<0,ve=!!(L||V==="select"&&R&&R.length>0),xe=$e&&ve&&!D,Me=xe?ae.replace(/^[-−]/,""):ae,ce=l.useCallback(a=>{let $=a;return M!==void 0&&($=Math.max(M,$)),b!==void 0&&($=Math.min(b,$)),N!==void 0&&($=parseFloat($.toFixed(N))),$},[M,b,N]),oe=l.useCallback(a=>{const $=a.target.value;if(fe($),$===""||$==="-"||$==="."||$==="-."){$===""&&y?.(null);return}const Z=parseFloat($);if(!isNaN(Z)){let ue=Z;M!==void 0&&(ue=Math.max(M,ue)),b!==void 0&&(ue=Math.min(b,ue)),y?.(ue)}},[y,M,b]),Ne=l.useCallback(()=>{const a=je.current,$=ce((a??0)+C);je.current=$,y?.($)},[C,y,ce]),be=l.useCallback(()=>{const a=je.current,$=ce((a??0)-C);je.current=$,y?.($)},[C,y,ce]),je=l.useRef(m);je.current=m;const _e=l.useRef(null),ge=l.useCallback(()=>{_e.current&&(clearTimeout(_e.current),_e.current=null)},[]),Se=l.useCallback(a=>{ge();let $=300;const Z=()=>{a(),$=Math.max(30,$*.82),_e.current=setTimeout(Z,$)};_e.current=setTimeout(Z,400)},[ge]),p=r.Zc({enabled:T,onSubmit:J}),q=l.useCallback(a=>{p(a),a.key==="ArrowUp"?(a.preventDefault(),Ne()):a.key==="ArrowDown"&&(a.preventDefault(),be()),v?.(a)},[p,v,Ne,be]),K=l.useMemo(()=>{const a=[];return T&&a.push(r.Yc.submit),H&&(a.push({key:"ArrowUp",description:W("shortcuts.increment","Increase value")}),a.push({key:"ArrowDown",description:W("shortcuts.decrement","Decrease value")})),a},[T,H,W]);return de?null:e.jsxs("div",{className:`nice-field nice-field--${c} ${le==="left"?"nice-field--label-left":""} ${ee?"nice-field--loading":""} ${u||""}`,style:{...h,...he!=null&&{"--nice-field-label-width":typeof he=="number"?`${he}px`:he},...ne!=null&&{"--nice-field-control-width":typeof ne=="number"?`${ne}px`:ne}},"aria-busy":ee||void 0,children:[t&&e.jsxs("label",{htmlFor:B,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:[t,U&&K.length>0&&e.jsx(r.ha,{shortcuts:K,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[ie.isDisplay?e.jsx(r.cc,{value:m==null?"":L?e.jsxs(e.Fragment,{children:[L,ae]}):ae,placeholder:P,disabled:i,readOnly:n,onActivate:ie.enterEdit,ariaLabel:t}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${c} nice-input--ds-${g} ${Q?"nice-input--suffix-sep":""} ${s?"nice-input--error":""} ${i?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:ye,children:[H&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:be,onMouseDown:()=>Se(be),onMouseUp:ge,onMouseLeave:ge,disabled:i,"aria-label":W("controls.decrement","Decrement"),children:e.jsx(r.oa,{name:"minus",size:16})}),V==="select"&&R&&R.length>0?e.jsxs(e.Fragment,{children:[xe&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:A??R[0]?.value,disabled:i,onChange:a=>{const $=a.target.value,Z=R.find(pe=>pe.value===(A??R[0]?.value)),ue=R.find(pe=>pe.value===$);I?.($,Z?.weight,ue?.weight)},children:R.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})]}):L?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[xe&&e.jsx("span",{className:"nice-input__sign",children:"−"}),L]}):null,e.jsx("input",{ref:a=>{typeof X=="function"?X(a):X&&(X.current=a),ie.autoFocusRef(a)},id:B,className:"nice-input__native",type:!D&&(me||O)?"text":"number",name:x,value:Me,placeholder:P,min:M,max:b,step:C,disabled:i||ee,readOnly:n,"aria-invalid":!!s,onChange:oe,onFocus:a=>{F(!0),fe(null),a.target.select()},onBlur:a=>{if(F(!1),fe(null),m!=null&&N!==void 0){const $=parseFloat(m.toFixed(N));$!==m&&y?.($)}z&&ie.exitEdit(),k?.(a)},onKeyDown:q,style:{width:`${we}ch`}}),j==="select"&&_&&_.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:te??_[0]?.value,disabled:i,onChange:a=>{const $=a.target.value,Z=_.find(pe=>pe.value===(te??_[0]?.value)),ue=_.find(pe=>pe.value===$);Y?.($,Z?.weight,ue?.weight)},children:_.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))}):S?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:S}):null,H&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:Ne,onMouseDown:()=>Se(Ne),onMouseUp:ge,onMouseLeave:ge,disabled:i,"aria-label":W("controls.increment","Increment"),children:e.jsx(r.oa,{name:"plus",size:16})})]})}),ee&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),se==="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),se==="right"&&!s&&f&&e.jsx("div",{className:"nice-field__helper",children:f})]}),se!=="right"&&s&&e.jsx("div",{className:"nice-field__error",role:"alert",children:s}),se!=="right"&&!s&&f&&e.jsx("div",{className:"nice-field__helper",children:f})]})});Le.displayName="NiceNumberInput";const ze=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:Le},Symbol.toStringTag,{value:"Module"}));function Re(t){const f=t?.closest?.("[data-theme], .nice-dark, .nice-light, .dark");if(!f)return"";const s=f.getAttribute("data-theme");return s==="dark"||f.classList.contains("nice-dark")||f.classList.contains("dark")?"nice-dark":s==="light"||f.classList.contains("nice-light")?"nice-light":""}function He(t,f,s,d){const n=l.useRef(null),[c,x]=l.useState(null),[o,u]=l.useState(""),w=l.useContext(r.Er)?.portalTarget??(typeof document<"u"?document.body:null),G=l.useRef(s);return G.current=s,l.useLayoutEffect(()=>{if(!t||!f.current)return;u(Re(f.current));const m=()=>{const y=f.current;if(!y)return;const k=y.getBoundingClientRect(),v=n.current?.offsetHeight??320;let P=k.bottom;P+v>window.innerHeight-8&&k.top-v>8&&(P=k.top-v);let M=k.left;M+k.width>window.innerWidth-8&&(M=Math.max(8,window.innerWidth-k.width-8)),x({left:M,top:P,width:k.width})};return m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[t,f,320]),l.useEffect(()=>{if(!t)return;const m=k=>{const v=k.target;f.current?.contains(v)||n.current?.contains(v)||(v instanceof Element?v:v?.parentElement??null)?.closest('.nice-select__dropdown, [role="listbox"], [role="option"]')||G.current()},y=k=>{k.key==="Escape"&&G.current()};return document.addEventListener("mousedown",m),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",y)}},[t,f]),{popupRef:n,coords:c,themeClass:o,portalTarget:w}}const De=l.forwardRef(({label:t,helperText:f,error:s,required:d,disabled:i,size:n="md",name:c,id:x,className:o,style:u,accessMode:h,displayStyle:w,options:G,value:m,onChange:y,placeholder:k,multiple:v=!1,searchable:P=!0,clearable:M=!1,emptyText:b,maxHeight:C=240,optionsSource:N,valueField:L,labelField:V,virtualScroll:R,optionHeight:A=36,onSearch:I,loading:S,renderOption:H,multipleAutosize:T=!1,showKeyboardHints:J,labelPlacement:U,errorPlacement:le,labelWidth:se,controlWidth:ee,displayMode:he},ne)=>{const O=r.Dc(h,x),me=O==="hidden";(O==="disabled"||O==="readOnly")&&(i=!0);const{t:j}=r.Gt(),_=r.rc("input",w),te=r.ac("input",w),Y=r.bc(x),Q=r.sc({enabled:he,disabled:i}),[z,X]=l.useState(!1),[re,de]=l.useState(""),[W,B]=l.useState(-1),[ye,g]=l.useState(0),D=l.useRef(null),F=l.useRef(null),[E,fe]=l.useState(null);l.useLayoutEffect(()=>{!S&&F.current&&fe(F.current.offsetWidth)},[S,m,w]);const[ie,we]=l.useState(null);l.useLayoutEffect(()=>{v&&!T&&F.current&&ie==null&&we(F.current.offsetWidth)},[v,T,ie]);const ke=r.Jd(N??null,L??N?.keyField??"id",V??"name"),ae=N?ke.options:(G??[]).map(p=>typeof p=="string"?{value:p,label:p}:p),{popupRef:$e,coords:ve,themeClass:xe,portalTarget:Me}=He(z,D,()=>{X(!1),de("")}),ce=l.useMemo(()=>m?Array.isArray(m)?m:[m]:[],[m]),oe=l.useMemo(()=>{if(!re&&!I||I)return ae;const p=re.toLowerCase();return ae.filter(q=>q.label.toLowerCase().includes(p)||String(q.value).toLowerCase().includes(p))},[ae,re,I]),Ne=l.useMemo(()=>{const p=new Map;for(const q of oe){const K=q.group||"";p.has(K)||p.set(K,[]),p.get(K).push(q)}return p},[oe]),be=l.useCallback(p=>{if(v){const q=ce.includes(p)?ce.filter(K=>K!==p):[...ce,p];y?.(q)}else y?.(p),X(!1),de("")},[v,ce,y]),je=l.useCallback(p=>{if(p.key==="Escape"){X(!1),de("");return}if(p.key==="Enter"||p.key===" "){if(!z){X(!0),p.preventDefault();return}W>=0&&oe[W]&&(be(oe[W].value),p.preventDefault());return}p.key==="ArrowDown"&&(p.preventDefault(),B(q=>Math.min(q+1,oe.length-1))),p.key==="ArrowUp"&&(p.preventDefault(),B(q=>Math.max(q-1,0)))},[z,W,oe,be]),_e=l.useMemo(()=>ce.length===0?null:v?ce.map(p=>ae.find(q=>q.value===p)?.label||p).join(", "):ae.find(p=>p.value===ce[0])?.label||ce[0],[ce,ae,v]),ge=l.useCallback(p=>{p.stopPropagation(),y?.(v?[]:"")},[y,v]),Se=l.useMemo(()=>[{key:"Enter",description:j("shortcuts.select","Select")},{key:"Space",description:j("shortcuts.openDropdown","Open dropdown")},r.Yc.moveUp,r.Yc.moveDown,r.Yc.cancel],[j]);return me?null:e.jsxs("div",{className:`nice-field ${ee==null?"nice-field--select-auto":""} nice-field--${n} ${U==="left"?"nice-field--label-left":""} ${S?"nice-field--loading":""} ${o||""}`,style:{...u,...se!=null&&{"--nice-field-label-width":typeof se=="number"?`${se}px`:se},...ee!=null&&{"--nice-field-control-width":typeof ee=="number"?`${ee}px`:ee},...S&&E!=null&&{"--nice-select-locked-width":`${E}px`}},"aria-busy":S||void 0,children:[t&&e.jsxs("label",{htmlFor:Y,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:[t,J&&e.jsx(r.ha,{shortcuts:Se,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[Q.isDisplay?e.jsx(r.cc,{value:_e,placeholder:k||j("controls.select","Select..."),disabled:i,onActivate:()=>{Q.enterEdit(),X(!0)},ariaLabel:t}):e.jsxs("div",{className:"nice-select",ref:D,children:[e.jsxs("button",{ref:p=>{F.current=p,typeof ne=="function"?ne(p):ne&&(ne.current=p)},type:"button",id:Y,role:"combobox","aria-expanded":z,"aria-haspopup":"listbox","aria-invalid":!!s,className:`nice-select__trigger nice-select__trigger--${n} nice-select--ds-${te} ${z?"nice-select__trigger--open":""} ${s?"nice-select__trigger--error":""} ${i?"nice-select__trigger--disabled":""}`,style:{..._,...v&&!T&&ie!=null?{width:ie,maxWidth:ie,overflow:"hidden"}:{}},disabled:i,onClick:()=>X(!z),onKeyDown:je,children:[_e?e.jsx("span",{style:v&&!T?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:_e}):e.jsx("span",{className:"nice-select__placeholder",children:k||j("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[M&&ce.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:ge,role:"button","aria-label":j("controls.clear","Clear"),children:e.jsx(r.oa,{name:"close",size:14})}),e.jsx("span",{className:`nice-select__chevron ${z?"nice-select__chevron--open":""}`,children:e.jsx(r.oa,{name:"chevron-down",size:16})})]})]}),z&&ve&&Me&&Ie.createPortal(e.jsxs("div",{ref:$e,className:`nice-select__dropdown${xe?` ${xe}`:""}`,"data-theme":xe==="nice-dark"?"dark":xe==="nice-light"?"light":void 0,role:"listbox",style:{maxHeight:C,position:"fixed",left:ve.left,top:ve.top,width:ve.width,minWidth:ve.width,zIndex:1e3},onScroll:R?p=>g(p.currentTarget.scrollTop):void 0,children:[(P||I)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:re,onChange:p=>{de(p.target.value),B(0),I?.(p.target.value)},placeholder:j("controls.search","Search..."),autoFocus:!0})}),S&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!S&&oe.length===0?e.jsx("div",{className:"nice-select__empty",children:b||j("controls.noResults","No results found")}):R&&!Array.from(Ne.keys()).some(p=>p!=="")?(()=>{const q=oe.length*A,K=Math.max(0,Math.floor(ye/A)-3),a=Math.min(oe.length,Math.ceil((ye+C)/A)+3),$=oe.slice(K,a);return e.jsx("div",{style:{height:q,position:"relative"},children:$.map((Z,ue)=>{const pe=K+ue,Ce=ce.includes(Z.value);return e.jsx("div",{role:"option","aria-selected":Ce,className:`nice-select__option ${Ce?"nice-select__option--selected":""} ${pe===W?"nice-select__option--highlighted":""} ${Z.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:pe*A,left:0,right:0,height:A,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!Z.disabled&&be(String(Z.value)),onMouseEnter:()=>B(pe),children:H?H(Z,Ce):e.jsxs(e.Fragment,{children:[Z.icon&&e.jsx("span",{children:Z.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:Z.label}),Z.description&&e.jsx("div",{className:"nice-select__option-desc",children:Z.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"})})]})},Z.value)})})})():Array.from(Ne.entries()).map(([p,q])=>e.jsxs(l.Fragment,{children:[p&&e.jsx("div",{className:"nice-select__group-label",children:p}),q.map(K=>{const a=ce.includes(K.value),$=oe.indexOf(K);return e.jsx("div",{role:"option","aria-selected":a,className:`nice-select__option ${a?"nice-select__option--selected":""} ${$===W?"nice-select__option--highlighted":""} ${K.disabled?"nice-select__option--disabled":""}`,onClick:()=>!K.disabled&&be(String(K.value)),onMouseEnter:()=>B($),children:H?H(K,a):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})]}),a&&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)})]},p))]}),Me)]}),S&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),le==="right"&&s&&e.jsx("div",{id:`${Y}-error`,className:"nice-field__error",role:"alert",children:s}),le==="right"&&!s&&f&&e.jsx("div",{id:`${Y}-helper`,className:"nice-field__helper",children:f})]}),le!=="right"&&s&&e.jsx("div",{id:`${Y}-error`,className:"nice-field__error",role:"alert",children:s}),le!=="right"&&!s&&f&&e.jsx("div",{id:`${Y}-helper`,className:"nice-field__helper",children:f})]})});De.displayName="NiceSelect";const Ye=Object.freeze(Object.defineProperty({__proto__:null,NiceSelect:De},Symbol.toStringTag,{value:"Module"})),Te=l.forwardRef(({label:t,checked:f=!1,indeterminate:s=!1,onChange:d,disabled:i,readOnly:n,loading:c,required:x,size:o="md",name:u,id:h,className:w,style:G,error:m,helperText:y,accessMode:k,displayStyle:v,showKeyboardHints:P,labelPlacement:M,errorPlacement:b,labelWidth:C,controlWidth:N},L)=>{const V=r.Dc(k,h),R=V==="hidden";(V==="disabled"||V==="readOnly")&&(i=!0);const{t:A}=r.Gt(),I=r.bc(h);r.ac("toggle",v);const S=l.useMemo(()=>[{key:"Space",description:A("shortcuts.toggle","Toggle")}],[A]),H=l.useCallback(T=>{T&&(T.indeterminate=s),typeof L=="function"?L(T):L&&(L.current=T)},[s,L]);return R?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${o} ${M==="left"?"nice-field--label-left":""} ${b==="right"?"nice-field--error-right":""} ${c?"nice-field--loading":""} ${w||""}`,style:{...G,...C!=null&&{"--nice-field-label-width":typeof C=="number"?`${C}px`:C},...N!=null&&{"--nice-field-control-width":typeof N=="number"?`${N}px`:N}},"aria-busy":c||void 0,children:[M==="left"&&t&&e.jsx("span",{className:`nice-field__label ${x?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${o!=="md"?`nice-checkbox--${o}`:""} ${i||c?"nice-checkbox--disabled":""}`,htmlFor:I,children:[e.jsx("input",{ref:H,id:I,type:"checkbox",className:"nice-checkbox__input",name:u,checked:f,disabled:i||c,readOnly:n,"aria-invalid":!!m,onChange:T=>{n||c||d?.(T.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:f?e.jsx("polyline",{points:"2 6 5 9 10 3"}):e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"})})}),M!=="left"&&t&&e.jsx("span",{children:t}),P&&e.jsx(r.ha,{shortcuts:S,size:"sm"})]}),c&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),b==="right"&&m&&e.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:m}),b==="right"&&!m&&y&&e.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:y})]}),b!=="right"&&m&&e.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:m}),b!=="right"&&!m&&y&&e.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:y})]})});Te.displayName="NiceCheckbox";const Ze=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:Te},Symbol.toStringTag,{value:"Module"})),Be=l.forwardRef(({label:t,checked:f=!1,onChange:s,disabled:d,readOnly:i,loading:n,required:c,size:x="md",name:o,id:u,className:h,style:w,accessMode:G,displayStyle:m,showKeyboardHints:y,error:k,helperText:v,labelPlacement:P,errorPlacement:M,labelWidth:b,controlWidth:C},N)=>{const L=r.Dc(G,u),V=L==="hidden";(L==="disabled"||L==="readOnly")&&(d=!0);const{t:R}=r.Gt(),A=r.bc(u);r.rc("toggle",m);const I=r.ac("toggle",m),S=l.useMemo(()=>[{key:"Space",description:R("shortcuts.toggle","Toggle on/off")}],[R]);return V?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${x} ${P==="left"?"nice-field--label-left":""} ${n?"nice-field--loading":""} ${h||""}`,style:{...w,...b!=null&&{"--nice-field-label-width":typeof b=="number"?`${b}px`:b},...C!=null&&{"--nice-field-control-width":typeof C=="number"?`${C}px`:C}},"aria-busy":n||void 0,children:[P==="left"&&t&&e.jsx("span",{className:`nice-field__label ${c?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${I} ${x!=="md"?`nice-toggle--${x}`:""} ${d||n?"nice-toggle--disabled":""}`,htmlFor:A,children:[e.jsx("input",{ref:N,id:A,type:"checkbox",className:"nice-toggle__input",name:o,checked:f,disabled:d||n,readOnly:i,role:"switch","aria-checked":f,"aria-invalid":!!k,onChange:H=>{i||n||s?.(H.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),P!=="left"&&t&&e.jsx("span",{children:t}),y&&e.jsx(r.ha,{shortcuts:S,size:"sm"})]}),n&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),M==="right"&&k&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:k}),M==="right"&&!k&&v&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:v})]}),M!=="right"&&k&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:k}),M!=="right"&&!k&&v&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:v})]})});Be.displayName="NiceToggle";const Ve=["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 Je(t){const f=/^#?([0-9a-f]{6})$/i.exec(t.trim());if(!f)return{r:0,g:0,b:0};const s=parseInt(f[1],16);return{r:s>>16&255,g:s>>8&255,b:s&255}}function Oe(t,f,s){const d=i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0");return`#${d(t)}${d(f)}${d(s)}`}function Qe(t,f,s){const d=t/255,i=f/255,n=s/255,c=Math.max(d,i,n),x=Math.min(d,i,n),o=(c+x)/2;let u=0,h=0;if(c!==x){const w=c-x;switch(h=o>.5?w/(2-c-x):w/(c+x),c){case d:u=(i-n)/w+(i<n?6:0);break;case i:u=(n-d)/w+2;break;case n:u=(d-i)/w+4;break}u*=60}return{h:Math.round(u),s:Math.round(h*100),l:Math.round(o*100)}}function Xe(t,f,s){const d=f/100,i=s/100,n=(1-Math.abs(2*i-1))*d,c=n*(1-Math.abs(t/60%2-1)),x=i-n/2;let o=0,u=0,h=0;return t<60?[o,u,h]=[n,c,0]:t<120?[o,u,h]=[c,n,0]:t<180?[o,u,h]=[0,n,c]:t<240?[o,u,h]=[0,c,n]:t<300?[o,u,h]=[c,0,n]:[o,u,h]=[n,0,c],{r:Math.round((o+x)*255),g:Math.round((u+x)*255),b:Math.round((h+x)*255)}}function We(t,f,s){const d=t/255,i=f/255,n=s/255,c=Math.max(d,i,n),x=Math.min(d,i,n),o=c-x;let u=0;o!==0&&(c===d?u=(i-n)/o%6:c===i?u=(n-d)/o+2:u=(d-i)/o+4,u*=60,u<0&&(u+=360));const h=c===0?0:o/c;return{h:Math.round(u),s:Math.round(h*100),v:Math.round(c*100)}}function en(t,f,s){const d=f/100,i=s/100,n=i*d,c=n*(1-Math.abs(t/60%2-1)),x=i-n;let o=0,u=0,h=0;return t<60?[o,u,h]=[n,c,0]:t<120?[o,u,h]=[c,n,0]:t<180?[o,u,h]=[0,n,c]:t<240?[o,u,h]=[0,c,n]:t<300?[o,u,h]=[c,0,n]:[o,u,h]=[n,0,c],{r:Math.round((o+x)*255),g:Math.round((u+x)*255),b:Math.round((h+x)*255)}}function nn(t){let f=t.trim();const s=/var\([^,]+,\s*(#[0-9a-fA-F]{3,8})\s*\)/.exec(f);s&&(f=s[1]);const d=/^#?([0-9a-f]{3})$/i.exec(f);d&&(f=`#${d[1].split("").map(c=>c+c).join("")}`);const i=/^#?([0-9a-f]{6})$/i.exec(f),n=/^#?([0-9a-f]{8})$/i.exec(f);if(n){const c=n[1];return{r:parseInt(c.slice(0,2),16),g:parseInt(c.slice(2,4),16),b:parseInt(c.slice(4,6),16),a:parseInt(c.slice(6,8),16)/255}}if(i){const c=parseInt(i[1],16);return{r:c>>16&255,g:c>>8&255,b:c&255,a:1}}return{r:0,g:0,b:0,a:1}}function tn(t,f,s,d,i){const n=x=>Math.max(0,Math.min(255,Math.round(x))).toString(16).padStart(2,"0"),c=`#${n(t)}${n(f)}${n(s)}`;return i?`${c}${n(d*255)}`:c}const Ae=l.forwardRef(({label:t,helperText:f,error:s,required:d,disabled:i,id:n,className:c,style:x,accessMode:o,displayStyle:u,value:h="var(--nice-primary, #3b82f6)",onChange:w,presets:G=Ve,showInput:m=!1,showRandom:y=!1,withAlpha:k=!1,compact:v=!1,showKeyboardHints:P,size:M="md",labelPlacement:b,errorPlacement:C,labelWidth:N,controlWidth:L,loading:V},R)=>{const A=r.Dc(o,n),I=A==="hidden";(A==="disabled"||A==="readOnly")&&(i=!0);const{t:S}=r.Gt(),H=r.bc(n);r.ac("input",u);const T=l.useCallback(()=>{i||w?.(qe())},[i,w]),[J,U]=l.useState(!1),[le,se]=l.useState(null),[ee,he]=l.useState(""),ne=l.useRef(null),O=l.useRef(null);l.useLayoutEffect(()=>{if(!J||!O.current)return;he(Re(O.current));const j=()=>{const _=O.current?.getBoundingClientRect();if(!_)return;const te=280,Y=360;let Q=_.left,z=_.bottom+6;Q+te>window.innerWidth-8&&(Q=Math.max(8,window.innerWidth-te-8)),z+Y>window.innerHeight-8&&(z=Math.max(8,_.top-Y-6)),se({left:Q,top:z})};return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[J]),l.useEffect(()=>{if(!J)return;const j=te=>{const Y=te.target;ne.current?.contains(Y)||O.current?.contains(Y)||U(!1)},_=te=>{te.key==="Escape"&&U(!1)};return document.addEventListener("mousedown",j),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",_)}},[J]);const me=l.useMemo(()=>[{key:"Enter",description:S("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:S("shortcuts.navigatePresets","Navigate presets")}],[S]);return I?null:e.jsxs("div",{className:`nice-field nice-field--${M} ${b==="left"?"nice-field--label-left":""} ${v?"nice-color-picker--compact":""} ${V?"nice-field--loading":""} ${c||""}`,style:{...x,...N!=null&&{"--nice-field-label-width":typeof N=="number"?`${N}px`:N},...L!=null&&{"--nice-field-control-width":typeof L=="number"?`${L}px`:L}},"aria-busy":V||void 0,children:[t&&e.jsxs("label",{htmlFor:H,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:[t,P&&e.jsx(r.ha,{shortcuts:me,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:O,className:"nice-color-picker__swatch",id:H,style:{background:h},onClick:j=>{j.stopPropagation(),i||U(_=>!_)},onKeyDown:j=>{!i&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),U(_=>!_))},role:"button",tabIndex:0,"aria-label":S("colorPicker.openPalette","Open color palette"),"aria-haspopup":"dialog","aria-expanded":J,children:e.jsx("input",{ref:j=>{typeof R=="function"?R(j):R&&(R.current=j)},type:"hidden",value:h,disabled:i,readOnly:!0})}),m&&e.jsx("div",{className:"nice-input nice-input--sm",style:v?{flex:1,minWidth:0}:{width:100},children:e.jsx("input",{className:"nice-input__native",type:"text",value:h,disabled:i,onChange:j=>w?.(j.target.value),maxLength:k?9:7})}),y&&!v&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:T,disabled:i,title:S("colorPicker.random","Random"),"aria-label":S("colorPicker.random","Random"),style:{fontSize:"0.65rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:S("colorPicker.random","Random")}),V&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),C==="right"&&s&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:s}),C==="right"&&!s&&f&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:f})]}),J&&le&&typeof document<"u"&&Ie.createPortal(e.jsx("div",{ref:ne,className:`nice-color-picker__popup nice-color-picker__popup--portal ${ee}`,"data-theme":ee==="nice-dark"?"dark":ee==="nice-light"?"light":void 0,role:"dialog","aria-label":S("colorPicker.palette","Color palette"),style:{position:"fixed",left:le.left,top:le.top},onClick:j=>j.stopPropagation(),children:(()=>{const j=nn(h),_={r:j.r,g:j.g,b:j.b},te=k?j.a:1,Y=Qe(_.r,_.g,_.b),Q=We(_.r,_.g,_.b),z=(g,D,F,E=te)=>w?.(tn(g,D,F,E,k)),X=(g,D,F)=>z(g,D,F),re=(g,D,F)=>{const E=Xe(g,D,F);z(E.r,E.g,E.b)},de=(g,D,F)=>{const E=en(g,D,F);z(E.r,E.g,E.b)},W=g=>z(_.r,_.g,_.b,g),B=g=>{if(i)return;const D=g.currentTarget,F=fe=>{const ie=D.getBoundingClientRect(),we=Math.max(0,Math.min(ie.width,fe.clientX-ie.left)),ke=Math.max(0,Math.min(ie.height,fe.clientY-ie.top)),ae=Math.round(we/ie.width*100),$e=100-Math.round(ke/ie.height*100);de(Q.h,ae,$e)};F(g);const E=()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",E)};document.addEventListener("pointermove",F),document.addEventListener("pointerup",E)},ye=`hsl(${Q.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:h,disabled:i,onChange:g=>w?.(g.target.value),maxLength:k?9:7,"aria-label":S("colorPicker.hexValue","Hex value")})}),e.jsx("input",{type:"range",min:0,max:360,value:Q.h,disabled:i,onChange:g=>de(Number(g.target.value),Q.s,Q.v),className:"nice-color-picker__hue-slider","aria-label":S("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), ${ye})`},onPointerDown:B,role:"application","aria-label":S("colorPicker.svPalette","Saturation/value palette"),children:e.jsx("span",{className:"nice-color-picker__sv-marker",style:{left:`${Q.s}%`,top:`${100-Q.v}%`}})}),e.jsxs("div",{className:"nice-color-picker__sliders",children:[e.jsx("div",{className:"nice-color-picker__slider-col",children:["h","s","l"].map(g=>{const D=g==="h"?360:100,F=Y[g],E=fe=>re(g==="h"?fe:Y.h,g==="s"?fe:Y.s,g==="l"?fe:Y.l);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:g.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:D,value:F,disabled:i,onChange:fe=>E(Number(fe.target.value))}),e.jsx("input",{type:"number",min:0,max:D,value:F,disabled:i,onChange:fe=>E(Number(fe.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},g)})}),e.jsx("div",{className:"nice-color-picker__slider-col",children:["r","g","b"].map(g=>{const D=_[g],F=E=>X(g==="r"?E:_.r,g==="g"?E:_.g,g==="b"?E:_.b);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:g.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:255,value:D,disabled:i,onChange:E=>F(Number(E.target.value))}),e.jsx("input",{type:"number",min:0,max:255,value:D,disabled:i,onChange:E=>F(Number(E.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},g)})})]}),k&&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(te*100),disabled:i,onChange:g=>W(Number(g.target.value)/100),className:"nice-color-picker__alpha-slider",style:{background:`linear-gradient(to right, transparent, rgb(${_.r},${_.g},${_.b}))`},"aria-label":S("colorPicker.alpha","Alpha")}),e.jsx("input",{type:"number",min:0,max:100,value:Math.round(te*100),disabled:i,onChange:g=>W((Number(g.target.value)||0)/100),className:"nice-input__native nice-color-picker__slider-num"})]}),G.length>0&&e.jsx("div",{className:"nice-color-picker__popup-presets",children:G.map(g=>e.jsx("div",{className:`nice-color-picker__preset ${h===g?"nice-color-picker__preset--active":""}`,style:{background:g},onClick:()=>{w?.(g),U(!1)},role:"button",tabIndex:0,"aria-label":g,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),w?.(g),U(!1))}},g))})]})})()}),document.body)]})}),C!=="right"&&s&&e.jsx("div",{id:`${H}-error`,className:"nice-field__error",role:"alert",children:s}),C!=="right"&&!s&&f&&e.jsx("div",{id:`${H}-helper`,className:"nice-field__helper",children:f})]})});Ae.displayName="NiceColorPicker";const cn=Object.freeze(Object.defineProperty({__proto__:null,NiceColorPicker:Ae,hexToRgb:Je,rgbToHex:Oe},Symbol.toStringTag,{value:"Module"})),sn=({tabs:t,activeTab:f,onChange:s,variant:d="default",vertical:i,size:n="md",iconOnly:c=!1,centered:x="auto",className:o,style:u,displayStyle:h})=>{const w=x==="auto"?c:x,G=r.rc("tab",h),m=r.ac("tab",h),[y,k]=l.useState(f||t[0]?.id),v=f??y,P=l.useCallback(b=>{k(b),s?.(b)},[s]),M=t.find(b=>b.id===v)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${n} ${i?"nice-tabs--vertical":""} ${c?"nice-tabs--icon-only":""} nice-tabs--ds-${m} ${o||""}`,style:{...G,...u},children:[e.jsx("div",{className:`nice-tabs__list ${d!=="default"?`nice-tabs__list--${d}`:""} ${i?"nice-tabs__list--vertical":""} ${w?"nice-tabs__list--centered":""}`,role:"tablist",children:t.map(b=>e.jsxs("button",{type:"button",role:"tab","aria-selected":v===b.id,"aria-label":c?b.label:void 0,title:c?b.label:void 0,className:`nice-tabs__tab ${v===b.id?"nice-tabs__tab--active":""} ${b.disabled?"nice-tabs__tab--disabled":""}`,disabled:b.disabled,onClick:()=>P(b.id),children:[b.icon,!c&&e.jsx("span",{children:b.label}),b.badge!==void 0&&e.jsx("span",{className:"nice-tabs__badge",children:b.badge})]},b.id))}),e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:M})]})},Ge=l.forwardRef(({children:t,variant:f="primary",size:s="md",type:d="button",disabled:i,loading:n,fullWidth:c,onClick:x,leftIcon:o,rightIcon:u,error:h,errorPlacement:w="bottom",ariaLabel:G,className:m,style:y,id:k,accessMode:v,displayStyle:P,...M},b)=>{const C=r.Ys(f),N=r.Js(s),L=r.Dc(v,k),V=L==="hidden";(L==="disabled"||L==="readOnly")&&(i=!0);const R=r.rc("button",P),A=r.ac("button",P);let I=R;if(C!=="primary"){const U={...R};delete U.background,delete U.color,(C==="outline"||C==="ghost")&&(delete U.border,delete U.borderColor,delete U.borderWidth,delete U.borderStyle,delete U.boxShadow),I=U}const S=t!=null&&t!==!1&&!(typeof t=="string"&&t.trim()===""),H=!S&&!!(o||u),T=e.jsxs("button",{ref:b,type:d,id:k,className:`nice-btn nice-btn--${C} nice-btn--${N} nice-btn--ds-${A} ${H?"nice-btn--icon-only":""} ${c?"nice-btn--full-width":""} ${n?"nice-btn--loading":""} ${h&&!w?"nice-btn--has-error":""} ${m||""}`,style:{...I,...y},disabled:i||n,"aria-busy":n||void 0,"aria-disabled":i||n||void 0,"aria-label":G,onClick:x,...M,children:[n&&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"})}),!n&&o&&e.jsx("span",{className:"nice-btn__icon","aria-hidden":"true",children:o}),!n&&S&&e.jsx("span",{children:t}),n&&S&&e.jsx("span",{style:{visibility:"hidden"},"aria-hidden":"true",children:t}),n&&H&&e.jsx("span",{className:"nice-btn__icon",style:{visibility:"hidden"},"aria-hidden":"true",children:o||u}),!n&&u&&e.jsx("span",{className:"nice-btn__icon","aria-hidden":"true",children:u})]});if(V)return null;if(!h)return T;const J=e.jsx("div",{className:"nice-field__error",role:"alert",children:h});return w==="right"?e.jsxs("span",{className:`nice-btn-field nice-btn-field--right nice-field--${N}`,style:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:"8px",width:"fit-content"},children:[T,J]}):V?null:e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${N}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",width:"fit-content"},children:[T,J]})});Ge.displayName="NiceButton";const fn=Object.freeze({AR:["#74acdf","#ffffff","#74acdf"],AT:["#ed2939","#ffffff","#ed2939"],AU:["#012169","#ffffff","#e4002b"],BE:["#000000","#fae042","#ed2939"],BR:["#009c3b","#ffdf00","#002776"],CA:["#ff0000","#ffffff","#ff0000"],CH:["#d52b1e","#ffffff","#d52b1e"],CN:["#de2910","#ffde00","#de2910"],CZ:["#11457e","#ffffff","#d7141a"],DE:["#000000","#dd0000","#ffce00"],DK:["#c8102e","#ffffff","#c8102e"],EE:["#0072ce","#000000","#ffffff"],EG:["#ce1126","#ffffff","#000000"],ES:["#aa151b","#f1bf00","#aa151b"],FI:["#ffffff","#003580","#ffffff"],FR:["#0055a4","#ffffff","#ef4135"],GB:["#012169","#ffffff","#c8102e"],GR:["#0d5eaf","#ffffff","#0d5eaf"],HR:["#171796","#ffffff","#ff0000"],HU:["#ce2939","#ffffff","#477050"],IE:["#169b62","#ffffff","#ff883e"],IL:["#ffffff","#0038b8","#ffffff"],IN:["#ff9933","#ffffff","#138808"],IS:["#02529c","#ffffff","#dc1e35"],IT:["#009246","#ffffff","#ce2b37"],JP:["#ffffff","#bc002d","#ffffff"],KR:["#ffffff","#cd2e3a","#0047a0"],LT:["#fdb913","#006a44","#c1272d"],LU:["#ed2939","#ffffff","#00a1de"],LV:["#9e3039","#ffffff","#9e3039"],MX:["#006847","#ffffff","#ce1126"],NL:["#ae1c28","#ffffff","#21468b"],NO:["#ef2b2d","#ffffff","#002868"],NZ:["#012169","#ffffff","#cc142b"],PL:["#ffffff","#dc143c"],PT:["#006600","#ff0000"],RO:["#002b7f","#fcd116","#ce1126"],RU:["#ffffff","#0039a6","#d52b1e"],SE:["#006aa7","#fecc00","#006aa7"],SK:["#ffffff","#0b4ea2","#ee1c25"],TR:["#e30a17","#ffffff","#e30a17"],UA:["#005bbb","#ffd500"],US:["#b22234","#ffffff","#3c3b6e"],VN:["#da251d","#ffff00","#da251d"],ZA:["#007a4d","#ffffff","#de3831"],AD:["#10069f","#fedf00","#d50032"],AE:["#00732f","#ffffff","#000000"],AF:["#000000","#d32011","#007a36"],AG:["#ce1126","#fcd116","#000000"],AL:["#e41e20","#000000","#e41e20"],AM:["#d90012","#0033a0","#f2a800"],AO:["#ce1126","#000000","#ffc500"],AZ:["#0092bc","#ed2939","#509e2f"],BA:["#002395","#fecb00","#ffffff"],BB:["#00267f","#ffc726","#00267f"],BD:["#006a4e","#f42a41","#006a4e"],BF:["#ef2b2d","#009e49","#fcd116"],BG:["#ffffff","#00966e","#d62612"],BH:["#ffffff","#ce1126","#ce1126"],BI:["#1eb53a","#ffffff","#ce1126"],BJ:["#008751","#fcd116","#e8112d"],BN:["#f7e017","#ffffff","#000000"],BO:["#d52b1e","#f9e300","#007934"],BS:["#00778b","#ffc72c","#000000"],BT:["#ffcc33","#ff4e12","#ffcc33"],BW:["#75aadb","#ffffff","#000000"],BY:["#c8313e","#007c30","#ffffff"],BZ:["#003f87","#ce1126","#003f87"],CD:["#007fff","#f7d618","#ce1021"],CF:["#003082","#ffffff","#289728"],CG:["#009543","#fbde4a","#dc241f"],CI:["#f77f00","#ffffff","#009e60"],CM:["#007a5e","#ce1126","#fcd116"],CO:["#fcd116","#003893","#ce1126"],CR:["#002b7f","#ffffff","#ce1126"],CU:["#002590","#ffffff","#cf142b"],CV:["#003893","#ffffff","#cf2027"],CY:["#ffffff","#d57800","#ffffff"],DJ:["#6ab2e7","#ffffff","#12ad2b"],DM:["#006b3f","#ffffff","#000000"],DO:["#002d62","#ffffff","#ce1126"],DZ:["#006233","#ffffff","#d21034"],EC:["#ffd100","#034ea2","#ed1c24"],ER:["#ea0437","#0084c9","#418fde"],ET:["#078930","#fcdd09","#da121a"],FJ:["#68bfe5","#cc0000","#ffffff"],GA:["#3a75c4","#ffe700","#009e60"],GD:["#ce1126","#fcd116","#007a5e"],GE:["#ffffff","#ff0000","#ffffff"],GH:["#ce1126","#fcd116","#006b3f"],GM:["#ce1126","#ffffff","#0c1c8c"],GN:["#ce1126","#fcd116","#009460"],GQ:["#3e9a00","#ffffff","#e32118"],GT:["#4997d0","#ffffff","#4997d0"],GW:["#ce1126","#fcd116","#009e49"],GY:["#009e49","#ffffff","#fcd116"],HK:["#de2910","#ffffff","#de2910"],HN:["#0073cf","#ffffff","#0073cf"],HT:["#00209f","#d21034","#00209f"],ID:["#ff0000","#ffffff","#ff0000"],IQ:["#ce1126","#ffffff","#000000"],IR:["#239f40","#ffffff","#da0000"],JM:["#000000","#fed100","#009b3a"],JO:["#000000","#ffffff","#007a3d"],KE:["#000000","#bb0000","#006600"],KG:["#ff0000","#fcd116","#ff0000"],KH:["#032ea1","#e00025","#032ea1"],KM:["#fcd116","#ffffff","#ce1126"],KP:["#024fa2","#ed1c27","#024fa2"],KW:["#007a3d","#ffffff","#ce1126"],KZ:["#00afca","#fec50c","#00afca"],LA:["#ce1126","#002868","#ce1126"],LB:["#ed1c24","#ffffff","#ed1c24"],LI:["#002780","#ce1126","#002780"],LK:["#ffbe29","#8d153a","#00534e"],LR:["#bf0a30","#ffffff","#002868"],LS:["#00209f","#ffffff","#009543"],LY:["#e70013","#000000","#239e46"],MA:["#c1272d","#006233","#c1272d"],MD:["#0046ae","#ffd200","#cc092f"],ME:["#d4af37","#cc0033","#d4af37"],MG:["#ffffff","#fc3d32","#007e3a"],MH:["#003893","#dd7500","#ffffff"],MK:["#d20000","#ffe600","#d20000"],ML:["#14b53a","#fcd116","#ce1126"],MM:["#fecb00","#34b233","#ea2839"],MN:["#c4272f","#015197","#c4272f"],MO:["#00785a","#ffd700","#ffffff"],MR:["#006233","#ffc400","#d01c1f"],MT:["#ffffff","#cf142b","#ffffff"],MU:["#ea2839","#1a206d","#00a04d"],MV:["#d21034","#007e3a","#ffffff"],MW:["#000000","#ce1126","#339e35"],MY:["#cc0000","#ffffff","#010066"],MZ:["#009a44","#ffffff","#000000"],NA:["#003580","#ffffff","#009543"],NE:["#ff8000","#ffffff","#0db02b"],NG:["#008753","#ffffff","#008753"],NI:["#0067c6","#ffffff","#0067c6"],NP:["#dc143c","#003893","#dc143c"],OM:["#dc241f","#ffffff","#008000"],PA:["#ffffff","#cc0033","#005aa7"],PE:["#d91023","#ffffff","#d91023"],PG:["#ce1126","#000000","#fcd116"],PH:["#0038a8","#ffffff","#ce1126"],PK:["#ffffff","#01411c","#01411c"],PS:["#000000","#ffffff","#007a3d"],PY:["#d52b1e","#ffffff","#0038a8"],QA:["#ffffff","#8a1538","#8a1538"],RS:["#c6363c","#0c4076","#ffffff"],RW:["#00a1de","#fad201","#00a651"],SA:["#006c35","#ffffff","#006c35"],SB:["#0051ba","#fcd116","#215b33"],SC:["#003f87","#fcd116","#d62828"],SD:["#d21034","#ffffff","#000000"],SG:["#ed2939","#ffffff","#ed2939"],SI:["#ffffff","#0000ff","#ff0000"],SL:["#1eb53a","#ffffff","#0072c6"],SM:["#ffffff","#5eb6e4","#ffffff"],SN:["#00853f","#fdef42","#e31b23"],SO:["#4189dd","#ffffff","#4189dd"],SR:["#377e3f","#ffffff","#b40a2d"],SS:["#000000","#ce1126","#078930"],ST:["#12ad2b","#ffce00","#d21034"],SV:["#0047ab","#ffffff","#0047ab"],SY:["#ce1126","#ffffff","#000000"],SZ:["#3e5eb9","#ffd900","#b10c0c"],TD:["#002664","#fecb00","#c60c30"],TG:["#006a4e","#fcd116","#d21034"],TH:["#ed1c24","#ffffff","#241d4f"],TJ:["#cc0000","#ffffff","#006600"],TL:["#dc241f","#ffc726","#000000"],TM:["#00853e","#ffffff","#cc0000"],TN:["#e70013","#ffffff","#e70013"],TO:["#ffffff","#c10000","#c10000"],TT:["#ce1126","#ffffff","#000000"],TW:["#fe0000","#000095","#fe0000"],TZ:["#1eb53a","#fcd116","#00a3dd"],UG:["#000000","#fcdc04","#d90000"],UY:["#ffffff","#0038a8","#ffffff"],UZ:["#1eb53a","#ffffff","#0099b5"],VA:["#ffe000","#ffffff","#ffe000"],VE:["#fcd116","#00247d","#cf142b"],VU:["#000000","#ce1126","#009543"],WS:["#002b7f","#ffffff","#cc0033"],YE:["#ce1126","#ffffff","#000000"],ZM:["#198a00","#de2010","#ef7d00"],ZW:["#078930","#fcd116","#cf2027"]}),Fe=["#cbd5e1","#94a3b8","#cbd5e1"];function ln(t){return t?fn[t.toUpperCase()]??Fe:Fe}const an=Ue.Flags3x2,rn=({code:t,size:f=22,className:s})=>{const d=t?.toUpperCase(),i=d?an[d]:void 0,n=f,c=Math.round(f*2/3);return i?e.jsx("span",{className:s,role:"img","aria-label":`${d} flag`,style:{display:"inline-block",width:n,height:c,boxSizing:"content-box",border:"1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle",lineHeight:0},dangerouslySetInnerHTML:{__html:i.replace("<svg ",`<svg width="${n}" height="${c}" preserveAspectRatio="xMidYMid slice" `)}}):e.jsx(Pe,{code:t,size:f,className:s})},Pe=({code:t,size:f=18,className:s})=>{const d=ln(t);return e.jsx("span",{className:s,role:"img","aria-label":`${t} flag`,style:{display:"inline-flex",width:f,height:Math.round(f*.7),boxSizing:"content-box",border:"1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:d.map((i,n)=>e.jsx("span",{style:{flex:1,background:i}},n))})};function on(t,f,s,d=280){const[i,n]=l.useState(s==="left"?"left":"right"),c=l.useCallback(()=>{if(s!=="auto"){n(s);return}const x=f.current;if(!x||typeof window>"u")return;const o=x.getBoundingClientRect(),h=window.innerWidth-o.left,w=o.right;h>=d&&h>w?n("left"):n("right")},[s,f,d]);return l.useEffect(()=>{if(t)return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[t,c]),i}const dn=({colors:t,size:f=28,shape:s="page",className:d})=>{const i=f,n=Math.round(f*.75),c=t.border??"color-mix(in srgb, currentColor 30%, transparent)";if(s==="swatch"){const G=[t.primary,t.background,t.backgroundSecondary??t.background,t.textColor];return e.jsx("span",{className:d,role:"img","aria-label":"Theme preview",style:{display:"inline-flex",width:i,height:n,border:`1px solid ${c}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:G.map((m,y)=>e.jsx("span",{style:{flex:1,background:m}},y))})}const x=Math.max(2,Math.round(n*.22)),o=t.backgroundSecondary?Math.max(3,Math.round(i*.28)):0,u=Math.max(1,Math.round(n*.08)),h=Math.max(1,Math.round(n*.05)),w=Math.max(2,Math.round(i*.08));return e.jsxs("span",{className:d,role:"img","aria-label":"Theme preview",style:{position:"relative",display:"inline-block",width:i,height:n,boxSizing:"content-box",background:t.background,border:`1px solid ${c}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[e.jsx("span",{style:{position:"absolute",top:0,left:0,right:0,height:x,background:t.primary}}),o>0&&e.jsx("span",{style:{position:"absolute",top:x,left:0,bottom:0,width:o,background:t.backgroundSecondary}}),e.jsx("span",{style:{position:"absolute",top:x+h,left:o+w,right:w,height:u,background:t.textColor,opacity:.8,borderRadius:1}}),e.jsx("span",{style:{position:"absolute",top:x+h*2+u,left:o+w,width:`${Math.max(20,i-o-w*2-4)}px`,height:u,background:t.textColor,opacity:.5,borderRadius:1}})]})};exports.FlagIcon=rn;exports.FlagSwatch=Pe;exports.NiceButton=Ge;exports.NiceCheckbox=Te;exports.NiceCheckbox$1=Ze;exports.NiceColorPicker=Ae;exports.NiceColorPicker$1=cn;exports.NiceNumberInput=Le;exports.NiceNumberInput$1=ze;exports.NiceSelect=De;exports.NiceSelect$1=Ye;exports.NiceTabs=sn;exports.NiceTextInput=Ee;exports.NiceTextInput$1=Ke;exports.NiceToggle=Be;exports.ThemePreviewSwatch=dn;exports.scopeThemeClass=Re;exports.useAnchoredPopup=He;exports.useDropdownAlignment=on;
|