@nice2dev/ui 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NiceErrorBoundary-B5nF-OVn.cjs +1 -0
- package/dist/NiceErrorBoundary-D75yr_WE.js +762 -0
- package/dist/NiceForm-CKoJA6NG.js +5131 -0
- package/dist/NiceForm-D7xnpnRJ.cjs +382 -0
- package/dist/NiceForm.css +1 -0
- package/dist/NiceModal-1QX7NhyH.js +95 -0
- package/dist/NiceModal-CAwsKVQ2.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-C9xMSjOF.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5249 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -0
- package/dist/NicePagination-DbE-uOkl.js +171 -0
- package/dist/NicePagination-DlealakT.cjs +1 -0
- package/dist/NicePinCodeInput-B8cI8zu8.js +11830 -0
- package/dist/NicePinCodeInput-SGQaHvpE.cjs +419 -0
- package/dist/NicePinCodeInput.css +1 -1
- package/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6449 -0
- package/dist/NiceSavedQueryPanel-Ce2s060j.cjs +596 -0
- package/dist/NiceTabs-DvOmxKyQ.cjs +1 -0
- package/dist/NiceTabs-DzLHzwuA.js +1636 -0
- package/dist/NiceWindow-CVgkxcCz.cjs +1 -0
- package/dist/NiceWindow-DeC83yfE.js +1409 -0
- package/dist/charts-BAS21jkC.js +4621 -0
- package/dist/charts-DShUbWrP.cjs +759 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +42 -45
- package/dist/charts.mjs +1 -1
- package/dist/core-C2ZmWe_u.cjs +96 -0
- package/dist/core-Da43q-pO.js +22094 -0
- package/dist/data-branching-CJlrg8qf.cjs +1 -0
- package/dist/data-branching-DCUwI53s.js +6121 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.d.ts +1 -38
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +206 -192
- package/dist/data.mjs +1 -1
- package/dist/devops-CXynFG3X.cjs +17 -0
- package/dist/devops-D0TfzV5B.js +7660 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +1 -38
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +311 -393
- package/dist/editors.mjs +61 -64
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +3 -44
- package/dist/feedback.mjs +11 -10
- package/dist/index-B8wxZ8Ps.cjs +5192 -0
- package/dist/index-pAuGTbuB.js +57319 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2248 -11140
- package/dist/index.mjs +880 -1018
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +7 -39
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +151 -216
- package/dist/navigation.mjs +46 -40
- package/dist/no-code-B5bzduNP.cjs +332 -0
- package/dist/no-code-D8RJ7lx0.js +7064 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +1 -38
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +13 -45
- package/dist/overlays.mjs +260 -250
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),c=require("react"),o=require("./core-C2ZmWe_u.cjs"),Fe=require("react-dom"),Ce=c.forwardRef(({label:l,helperText:m,error:i,required:p,disabled:s,readOnly:n,size:d="md",name:j,id:f,className:u,style:_,accessMode:S,displayStyle:z,variant:x,value:k,defaultValue:L,onChange:h,onBlur:J,onKeyDown:R,placeholder:y,type:E="text",maxLength:b,prefix:F,suffix:U,clearable:w,autoFocus:C,submitOnEnter:B,onSubmit:V,showKeyboardHints:I,labelPlacement:O,errorPlacement:re,loading:oe,labelWidth:ne,controlWidth:X,displayMode:P,...$},v)=>{const K=o.useNiceAccessMode(S,f);if(K==="hidden")return null;K==="disabled"&&(s=!0),K==="readOnly"&&(n=!0);const{t:D}=o.Wo(),A=o.useControlId(f),G=o.useComponentDisplayStyle("input",z),le=o.useComponentDisplayClass("input",z),me=x==="filled"?"filled":x==="underlined"?"underlined":"",W=c.useCallback(()=>h?.(""),[h]),Y=o.useDisplayModeEdit({enabled:P,readOnly:n,disabled:s}),ae=o.useSubmitOnEnter({enabled:B,onSubmit:V}),se=c.useCallback(g=>{ae(g),R?.(g)},[ae,R]),r=c.useMemo(()=>{const g=[];return B&&g.push({key:"Enter",description:D("shortcuts.submit","Submit")}),w&&g.push({key:"Escape",description:D("shortcuts.clear","Clear")}),g},[B,w,D]);return e.jsxs("div",{className:`nice-field nice-field--${d} ${O==="left"?"nice-field--label-left":""} ${O==="inside"?"nice-field--label-inside":""} ${oe?"nice-field--loading":""} ${u||""}`,style:{..._,...ne!=null&&{"--nice-field-label-width":typeof ne=="number"?`${ne}px`:ne},...X!=null&&{"--nice-field-control-width":typeof X=="number"?`${X}px`:X}},"aria-busy":oe||void 0,"data-floating":O==="inside"&&k?"true":void 0,children:[l&&O!=="inside"&&e.jsxs("label",{htmlFor:A,className:`nice-field__label ${p?"nice-field__label--required":""}`,children:[l,I&&r.length>0&&e.jsx(o.NiceKeyboardHint,{shortcuts:r,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[Y.isDisplay?e.jsx(o.DisplayModeView,{value:k??L??"",placeholder:y,disabled:s,readOnly:n,onActivate:Y.enterEdit,ariaLabel:l}):e.jsxs("div",{className:`nice-input nice-input--${d} nice-input--ds-${me||le} ${i?"nice-input--error":""} ${s?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:x?void 0:G,children:[F&&e.jsx("span",{className:"nice-input__icon",children:F}),e.jsx("input",{ref:g=>{typeof v=="function"?v(g):v&&(v.current=g),Y.autoFocusRef(g)},id:A,className:"nice-input__native",type:E,name:j,value:k,defaultValue:L,placeholder:y,disabled:s||oe,readOnly:n,maxLength:b,autoFocus:C,"aria-invalid":!!i,"aria-describedby":i?`${A}-error`:m?`${A}-helper`:void 0,onChange:g=>h?.(g.target.value),onBlur:g=>{P&&Y.exitEdit(),J?.(g)},onKeyDown:se,...$}),w&&k&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:W,"aria-label":D("controls.clear","Clear"),children:"✕"}),U&&e.jsx("span",{className:"nice-input__icon",children:U}),l&&O==="inside"&&e.jsx("label",{htmlFor:A,className:`nice-input__floating-label ${p?"nice-input__floating-label--required":""}`,children:l})]}),oe&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),re==="right"&&i&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:i}),re==="right"&&!i&&m&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:m})]}),re!=="right"&&i&&e.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:i}),re!=="right"&&!i&&m&&e.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:m})]})});Ce.displayName="NiceTextInput";const Me=c.forwardRef(({label:l,helperText:m,error:i,required:p,disabled:s,readOnly:n,size:d="md",name:j,id:f,className:u,style:_,accessMode:S,displayStyle:z,value:x,onChange:k,onBlur:L,onKeyDown:h,placeholder:J,min:R,max:y,step:E=1,precision:b,prefix:F,prefixType:U="label",prefixOptions:w,prefixValue:C,onPrefixChange:B,suffix:V,showStepper:I=!0,submitOnEnter:O,onSubmit:re,showKeyboardHints:oe,labelPlacement:ne,errorPlacement:X,loading:P,labelWidth:$,controlWidth:v,formatPreset:K,format:D,suffixType:A="label",suffixOptions:G,suffixValue:le,onSuffixChange:me,displayMode:W},Y)=>{const ae=o.useNiceAccessMode(S,f);if(ae==="hidden")return null;ae==="disabled"&&(s=!0),ae==="readOnly"&&(n=!0);const{t:se}=o.Wo(),r=o.useControlId(f),g=o.useComponentDisplayStyle("input",z),q=o.useComponentDisplayClass("input",z),[M,Q]=c.useState(!1),[Z,_e]=c.useState(null),xe=o.useDisplayModeEdit({enabled:W,readOnly:n,disabled:s}),de=c.useMemo(()=>{let t=3;return y!=null&&(t=String(Math.abs(Math.floor(y))).length),R!=null&&R<0&&(t+=1),b&&(t+=b+1),Math.max(3,t)+1},[y,R,b]),Ne=c.useCallback(t=>{if(D)return D(t);if(!K)return b!=null?t.toFixed(b):String(t);switch(K){case"integer":return Math.round(t).toLocaleString();case"decimal":return t.toLocaleString(void 0,{minimumFractionDigits:b??2,maximumFractionDigits:b??2});case"money":return t.toLocaleString(void 0,{minimumFractionDigits:b??2,maximumFractionDigits:b??2,useGrouping:!0});case"percent":return(t*100).toLocaleString(void 0,{minimumFractionDigits:b??0,maximumFractionDigits:b??2})+"%";default:return String(t)}},[D,K,b]),je=c.useMemo(()=>M&&Z!==null?Z:x==null?"":M?b!=null?x.toFixed(b):String(x):Ne(x),[x,M,Z,Ne,b]),ue=x!=null&&x<0,ie=!!(F||U==="select"&&w&&w.length>0),ee=ue&&ie&&!M,ke=ee?je.replace(/^[-−]/,""):je,pe=c.useCallback(t=>{let N=t;return R!==void 0&&(N=Math.max(R,N)),y!==void 0&&(N=Math.min(y,N)),b!==void 0&&(N=parseFloat(N.toFixed(b))),N},[R,y,b]),we=c.useCallback(t=>{const N=t.target.value;if(_e(N),N===""||N==="-"||N==="."||N==="-."){N===""&&k?.(null);return}const ce=parseFloat(N);if(!isNaN(ce)){let he=ce;R!==void 0&&(he=Math.max(R,he)),y!==void 0&&(he=Math.min(y,he)),k?.(he)}},[k,R,y]),ve=c.useCallback(()=>{const t=ge.current,N=pe((t??0)+E);ge.current=N,k?.(N)},[E,k,pe]),ye=c.useCallback(()=>{const t=ge.current,N=pe((t??0)-E);ge.current=N,k?.(N)},[E,k,pe]),ge=c.useRef(x);ge.current=x;const a=c.useRef(null),H=c.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]),T=c.useCallback(t=>{H();let N=300;const ce=()=>{t(),N=Math.max(30,N*.82),a.current=setTimeout(ce,N)};a.current=setTimeout(ce,400)},[H]),fe=o.useSubmitOnEnter({enabled:O,onSubmit:re}),$e=c.useCallback(t=>{fe(t),t.key==="ArrowUp"?(t.preventDefault(),ve()):t.key==="ArrowDown"&&(t.preventDefault(),ye()),h?.(t)},[fe,h,ve,ye]),te=c.useMemo(()=>{const t=[];return O&&t.push(o.COMMON_SHORTCUTS.submit),I&&(t.push({key:"ArrowUp",description:se("shortcuts.increment","Increase value")}),t.push({key:"ArrowDown",description:se("shortcuts.decrement","Decrease value")})),t},[O,I,se]);return e.jsxs("div",{className:`nice-field nice-field--${d} ${ne==="left"?"nice-field--label-left":""} ${P?"nice-field--loading":""} ${u||""}`,style:{..._,...$!=null&&{"--nice-field-label-width":typeof $=="number"?`${$}px`:$},...v!=null&&{"--nice-field-control-width":typeof v=="number"?`${v}px`:v}},"aria-busy":P||void 0,children:[l&&e.jsxs("label",{htmlFor:r,className:`nice-field__label ${p?"nice-field__label--required":""}`,children:[l,oe&&te.length>0&&e.jsx(o.NiceKeyboardHint,{shortcuts:te,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[xe.isDisplay?e.jsx(o.DisplayModeView,{value:x==null?"":F?e.jsxs(e.Fragment,{children:[F,je]}):je,placeholder:J,disabled:s,readOnly:n,onActivate:xe.enterEdit,ariaLabel:l}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${d} nice-input--ds-${q} ${i?"nice-input--error":""} ${s?"nice-input--disabled":""} ${n?"nice-input--readonly":""}`,style:g,children:[I&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:ye,onMouseDown:()=>T(ye),onMouseUp:H,onMouseLeave:H,disabled:s,"aria-label":se("controls.decrement","Decrement"),children:"−"}),U==="select"&&w&&w.length>0?e.jsxs(e.Fragment,{children:[ee&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:C??w[0]?.value,disabled:s,onChange:t=>{const N=t.target.value,ce=w.find(be=>be.value===(C??w[0]?.value)),he=w.find(be=>be.value===N);B?.(N,ce?.weight,he?.weight)},children:w.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}):F?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[ee&&e.jsx("span",{className:"nice-input__sign",children:"−"}),F]}):null,e.jsx("input",{ref:t=>{typeof Y=="function"?Y(t):Y&&(Y.current=t),xe.autoFocusRef(t)},id:r,className:"nice-input__native",type:!M&&(D||K)?"text":"number",name:j,value:ke,placeholder:J,min:R,max:y,step:E,disabled:s||P,readOnly:n,"aria-invalid":!!i,onChange:we,onFocus:t=>{Q(!0),_e(null),t.target.select()},onBlur:t=>{if(Q(!1),_e(null),x!=null&&b!==void 0){const N=parseFloat(x.toFixed(b));N!==x&&k?.(N)}W&&xe.exitEdit(),L?.(t)},onKeyDown:$e,style:{width:`${de}ch`}}),A==="select"&&G&&G.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:le??G[0]?.value,disabled:s,onChange:t=>{const N=t.target.value,ce=G.find(be=>be.value===(le??G[0]?.value)),he=G.find(be=>be.value===N);me?.(N,ce?.weight,he?.weight)},children:G.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}):V?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:V}):null,I&&!n&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:ve,onMouseDown:()=>T(ve),onMouseUp:H,onMouseLeave:H,disabled:s,"aria-label":se("controls.increment","Increment"),children:"+"})]})}),P&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),X==="right"&&i&&e.jsx("div",{className:"nice-field__error",role:"alert",children:i}),X==="right"&&!i&&m&&e.jsx("div",{className:"nice-field__helper",children:m})]}),X!=="right"&&i&&e.jsx("div",{className:"nice-field__error",role:"alert",children:i}),X!=="right"&&!i&&m&&e.jsx("div",{className:"nice-field__helper",children:m})]})});Me.displayName="NiceNumberInput";const Se=c.forwardRef(({label:l,helperText:m,error:i,required:p,disabled:s,size:n="md",name:d,id:j,className:f,style:u,accessMode:_,displayStyle:S,options:z,value:x,onChange:k,placeholder:L,multiple:h=!1,searchable:J=!1,clearable:R=!1,emptyText:y,maxHeight:E=240,optionsSource:b,valueField:F,labelField:U,virtualScroll:w,optionHeight:C=36,onSearch:B,loading:V,renderOption:I,multipleAutosize:O=!1,showKeyboardHints:re,labelPlacement:oe,errorPlacement:ne,labelWidth:X,controlWidth:P,displayMode:$},v)=>{const K=o.useNiceAccessMode(_,j);if(K==="hidden")return null;(K==="disabled"||K==="readOnly")&&(s=!0);const{t:D}=o.Wo(),A=o.useComponentDisplayStyle("input",S),G=o.useComponentDisplayClass("input",S),le=o.useControlId(j),me=o.useDisplayModeEdit({enabled:$,disabled:s}),[W,Y]=c.useState(!1),[ae,se]=c.useState(""),[r,g]=c.useState(-1),[q,M]=c.useState(0),Q=c.useRef(null),Z=c.useRef(null),[_e,xe]=c.useState(null);c.useLayoutEffect(()=>{!V&&Z.current&&xe(Z.current.offsetWidth)},[V,x,S]);const[de,Ne]=c.useState(null);c.useLayoutEffect(()=>{h&&!O&&Z.current&&de==null&&Ne(Z.current.offsetWidth)},[h,O,de]);const je=o.useNiceLookupSource(b??null,F??b?.keyField??"id",U??"name"),ue=b?je.options:(z??[]).map(a=>typeof a=="string"?{value:a,label:a}:a);o.useClickOutside(Q,()=>{Y(!1),se("")});const ie=c.useMemo(()=>x?Array.isArray(x)?x:[x]:[],[x]),ee=c.useMemo(()=>{if(!ae&&!B||B)return ue;const a=ae.toLowerCase();return ue.filter(H=>H.label.toLowerCase().includes(a)||String(H.value).toLowerCase().includes(a))},[ue,ae,B]),ke=c.useMemo(()=>{const a=new Map;for(const H of ee){const T=H.group||"";a.has(T)||a.set(T,[]),a.get(T).push(H)}return a},[ee]),pe=c.useCallback(a=>{if(h){const H=ie.includes(a)?ie.filter(T=>T!==a):[...ie,a];k?.(H)}else k?.(a),Y(!1),se("")},[h,ie,k]),we=c.useCallback(a=>{if(a.key==="Escape"){Y(!1),se("");return}if(a.key==="Enter"||a.key===" "){if(!W){Y(!0),a.preventDefault();return}r>=0&&ee[r]&&(pe(ee[r].value),a.preventDefault());return}a.key==="ArrowDown"&&(a.preventDefault(),g(H=>Math.min(H+1,ee.length-1))),a.key==="ArrowUp"&&(a.preventDefault(),g(H=>Math.max(H-1,0)))},[W,r,ee,pe]),ve=c.useMemo(()=>ie.length===0?null:h?ie.map(a=>ue.find(H=>H.value===a)?.label||a).join(", "):ue.find(a=>a.value===ie[0])?.label||ie[0],[ie,ue,h]),ye=c.useCallback(a=>{a.stopPropagation(),k?.(h?[]:"")},[k,h]),ge=c.useMemo(()=>[{key:"Enter",description:D("shortcuts.select","Select")},{key:"Space",description:D("shortcuts.openDropdown","Open dropdown")},o.COMMON_SHORTCUTS.moveUp,o.COMMON_SHORTCUTS.moveDown,o.COMMON_SHORTCUTS.cancel],[D]);return e.jsxs("div",{className:`nice-field ${P==null?"nice-field--select-auto":""} nice-field--${n} ${oe==="left"?"nice-field--label-left":""} ${V?"nice-field--loading":""} ${f||""}`,style:{...u,...X!=null&&{"--nice-field-label-width":typeof X=="number"?`${X}px`:X},...P!=null&&{"--nice-field-control-width":typeof P=="number"?`${P}px`:P},...V&&_e!=null&&{"--nice-select-locked-width":`${_e}px`}},"aria-busy":V||void 0,children:[l&&e.jsxs("label",{htmlFor:le,className:`nice-field__label ${p?"nice-field__label--required":""}`,children:[l,re&&e.jsx(o.NiceKeyboardHint,{shortcuts:ge,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[me.isDisplay?e.jsx(o.DisplayModeView,{value:ve,placeholder:L||D("controls.select","Select..."),disabled:s,onActivate:()=>{me.enterEdit(),Y(!0)},ariaLabel:l}):e.jsxs("div",{className:"nice-select",ref:Q,children:[e.jsxs("button",{ref:a=>{Z.current=a,typeof v=="function"?v(a):v&&(v.current=a)},type:"button",id:le,role:"combobox","aria-expanded":W,"aria-haspopup":"listbox","aria-invalid":!!i,className:`nice-select__trigger nice-select__trigger--${n} nice-select--ds-${G} ${W?"nice-select__trigger--open":""} ${i?"nice-select__trigger--error":""} ${s?"nice-select__trigger--disabled":""}`,style:{...A,...h&&!O&&de!=null?{width:de,maxWidth:de,overflow:"hidden"}:{}},disabled:s,onClick:()=>Y(!W),onKeyDown:we,children:[ve?e.jsx("span",{style:h&&!O?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:ve}):e.jsx("span",{className:"nice-select__placeholder",children:L||D("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[R&&ie.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:ye,role:"button","aria-label":D("controls.clear","Clear"),children:"✕"}),e.jsx("svg",{className:`nice-select__chevron ${W?"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"})})]})]}),W&&e.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:E},onScroll:w?a=>M(a.currentTarget.scrollTop):void 0,children:[(J||B)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:ae,onChange:a=>{se(a.target.value),g(0),B?.(a.target.value)},placeholder:D("controls.search","Search..."),autoFocus:!0})}),V&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!V&&ee.length===0?e.jsx("div",{className:"nice-select__empty",children:y||D("controls.noResults","No results found")}):w&&!Array.from(ke.keys()).some(a=>a!=="")?(()=>{const H=ee.length*C,T=Math.max(0,Math.floor(q/C)-3),fe=Math.min(ee.length,Math.ceil((q+E)/C)+3),$e=ee.slice(T,fe);return e.jsx("div",{style:{height:H,position:"relative"},children:$e.map((te,t)=>{const N=T+t,ce=ie.includes(te.value);return e.jsx("div",{role:"option","aria-selected":ce,className:`nice-select__option ${ce?"nice-select__option--selected":""} ${N===r?"nice-select__option--highlighted":""} ${te.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:N*C,left:0,right:0,height:C,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!te.disabled&&pe(String(te.value)),onMouseEnter:()=>g(N),children:I?I(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(ke.entries()).map(([a,H])=>e.jsxs(c.Fragment,{children:[a&&e.jsx("div",{className:"nice-select__group-label",children:a}),H.map(T=>{const fe=ie.includes(T.value),$e=ee.indexOf(T);return e.jsx("div",{role:"option","aria-selected":fe,className:`nice-select__option ${fe?"nice-select__option--selected":""} ${$e===r?"nice-select__option--highlighted":""} ${T.disabled?"nice-select__option--disabled":""}`,onClick:()=>!T.disabled&&pe(String(T.value)),onMouseEnter:()=>g($e),children:I?I(T,fe):e.jsxs(e.Fragment,{children:[T.icon&&e.jsx("span",{children:T.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:T.label}),T.description&&e.jsx("div",{className:"nice-select__option-desc",children:T.description})]}),fe&&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"})})]})},T.value)})]},a))]})]}),V&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),ne==="right"&&i&&e.jsx("div",{id:`${le}-error`,className:"nice-field__error",role:"alert",children:i}),ne==="right"&&!i&&m&&e.jsx("div",{id:`${le}-helper`,className:"nice-field__helper",children:m})]}),ne!=="right"&&i&&e.jsx("div",{id:`${le}-error`,className:"nice-field__error",role:"alert",children:i}),ne!=="right"&&!i&&m&&e.jsx("div",{id:`${le}-helper`,className:"nice-field__helper",children:m})]})});Se.displayName="NiceSelect";const De=c.forwardRef(({label:l,checked:m=!1,indeterminate:i=!1,onChange:p,disabled:s,readOnly:n,loading:d,required:j,size:f="md",name:u,id:_,className:S,style:z,error:x,helperText:k,accessMode:L,displayStyle:h,showKeyboardHints:J,labelPlacement:R,errorPlacement:y,labelWidth:E,controlWidth:b},F)=>{const U=o.useNiceAccessMode(L,_);if(U==="hidden")return null;(U==="disabled"||U==="readOnly")&&(s=!0);const{t:w}=o.Wo(),C=o.useControlId(_);o.useComponentDisplayClass("toggle",h);const B=c.useMemo(()=>[{key:"Space",description:w("shortcuts.toggle","Toggle")}],[w]),V=c.useCallback(I=>{I&&(I.indeterminate=i),typeof F=="function"?F(I):F&&(F.current=I)},[i,F]);return e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${f} ${R==="left"?"nice-field--label-left":""} ${y==="right"?"nice-field--error-right":""} ${d?"nice-field--loading":""} ${S||""}`,style:{...z,...E!=null&&{"--nice-field-label-width":typeof E=="number"?`${E}px`:E},...b!=null&&{"--nice-field-control-width":typeof b=="number"?`${b}px`:b}},"aria-busy":d||void 0,children:[R==="left"&&l&&e.jsx("span",{className:`nice-field__label ${j?"nice-field__label--required":""}`,children:l}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${f!=="md"?`nice-checkbox--${f}`:""} ${s||d?"nice-checkbox--disabled":""}`,htmlFor:C,children:[e.jsx("input",{ref:V,id:C,type:"checkbox",className:"nice-checkbox__input",name:u,checked:m,disabled:s||d,readOnly:n,"aria-invalid":!!x,onChange:I=>{n||d||p?.(I.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:i?e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):e.jsx("polyline",{points:"2 6 5 9 10 3"})})}),R!=="left"&&l&&e.jsx("span",{children:l}),J&&e.jsx(o.NiceKeyboardHint,{shortcuts:B,size:"sm"})]}),d&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),y==="right"&&x&&e.jsx("div",{id:`${C}-error`,className:"nice-field__error",role:"alert",children:x}),y==="right"&&!x&&k&&e.jsx("div",{id:`${C}-helper`,className:"nice-field__helper",children:k})]}),y!=="right"&&x&&e.jsx("div",{id:`${C}-error`,className:"nice-field__error",role:"alert",children:x}),y!=="right"&&!x&&k&&e.jsx("div",{id:`${C}-helper`,className:"nice-field__helper",children:k})]})});De.displayName="NiceCheckbox";const Re=c.forwardRef(({label:l,checked:m=!1,onChange:i,disabled:p,readOnly:s,loading:n,required:d,size:j="md",name:f,id:u,className:_,style:S,accessMode:z,displayStyle:x,showKeyboardHints:k,error:L,helperText:h,labelPlacement:J,errorPlacement:R,labelWidth:y,controlWidth:E},b)=>{const F=o.useNiceAccessMode(z,u);if(F==="hidden")return null;(F==="disabled"||F==="readOnly")&&(p=!0);const{t:U}=o.Wo(),w=o.useControlId(u);o.useComponentDisplayStyle("toggle",x);const C=o.useComponentDisplayClass("toggle",x),B=c.useMemo(()=>[{key:"Space",description:U("shortcuts.toggle","Toggle on/off")}],[U]);return e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${j} ${J==="left"?"nice-field--label-left":""} ${n?"nice-field--loading":""} ${_||""}`,style:{...S,...y!=null&&{"--nice-field-label-width":typeof y=="number"?`${y}px`:y},...E!=null&&{"--nice-field-control-width":typeof E=="number"?`${E}px`:E}},"aria-busy":n||void 0,children:[J==="left"&&l&&e.jsx("span",{className:`nice-field__label ${d?"nice-field__label--required":""}`,children:l}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${C} ${j!=="md"?`nice-toggle--${j}`:""} ${p||n?"nice-toggle--disabled":""}`,htmlFor:w,children:[e.jsx("input",{ref:b,id:w,type:"checkbox",className:"nice-toggle__input",name:f,checked:m,disabled:p||n,readOnly:s,role:"switch","aria-checked":m,"aria-invalid":!!L,onChange:V=>{s||n||i?.(V.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),J!=="left"&&l&&e.jsx("span",{children:l}),k&&e.jsx(o.NiceKeyboardHint,{shortcuts:B,size:"sm"})]}),n&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),R==="right"&&L&&e.jsx("div",{id:`${w}-error`,className:"nice-field__error",role:"alert",children:L}),R==="right"&&!L&&h&&e.jsx("div",{id:`${w}-helper`,className:"nice-field__helper",children:h})]}),R!=="right"&&L&&e.jsx("div",{id:`${w}-error`,className:"nice-field__error",role:"alert",children:L}),R!=="right"&&!L&&h&&e.jsx("div",{id:`${w}-helper`,className:"nice-field__helper",children:h})]})});Re.displayName="NiceToggle";const Ie=["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#ec4899","#64748b","#1e293b"];function Ae(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function He(l,m,i){const p=l/255,s=m/255,n=i/255,d=Math.max(p,s,n),j=Math.min(p,s,n),f=(d+j)/2;let u=0,_=0;if(d!==j){const S=d-j;switch(_=f>.5?S/(2-d-j):S/(d+j),d){case p:u=(s-n)/S+(s<n?6:0);break;case s:u=(n-p)/S+2;break;case n:u=(p-s)/S+4;break}u*=60}return{h:Math.round(u),s:Math.round(_*100),l:Math.round(f*100)}}function Te(l,m,i){const p=m/100,s=i/100,n=(1-Math.abs(2*s-1))*p,d=n*(1-Math.abs(l/60%2-1)),j=s-n/2;let f=0,u=0,_=0;return l<60?[f,u,_]=[n,d,0]:l<120?[f,u,_]=[d,n,0]:l<180?[f,u,_]=[0,n,d]:l<240?[f,u,_]=[0,d,n]:l<300?[f,u,_]=[d,0,n]:[f,u,_]=[n,0,d],{r:Math.round((f+j)*255),g:Math.round((u+j)*255),b:Math.round((_+j)*255)}}function Ue(l,m,i){const p=l/255,s=m/255,n=i/255,d=Math.max(p,s,n),j=Math.min(p,s,n),f=d-j;let u=0;f!==0&&(d===p?u=(s-n)/f%6:d===s?u=(n-p)/f+2:u=(p-s)/f+4,u*=60,u<0&&(u+=360));const _=d===0?0:f/d;return{h:Math.round(u),s:Math.round(_*100),v:Math.round(d*100)}}function Be(l,m,i){const p=m/100,s=i/100,n=s*p,d=n*(1-Math.abs(l/60%2-1)),j=s-n;let f=0,u=0,_=0;return l<60?[f,u,_]=[n,d,0]:l<120?[f,u,_]=[d,n,0]:l<180?[f,u,_]=[0,n,d]:l<240?[f,u,_]=[0,d,n]:l<300?[f,u,_]=[d,0,n]:[f,u,_]=[n,0,d],{r:Math.round((f+j)*255),g:Math.round((u+j)*255),b:Math.round((_+j)*255)}}function Ke(l){const m=/^#?([0-9a-f]{6})$/i.exec(l.trim()),i=/^#?([0-9a-f]{8})$/i.exec(l.trim());if(i){const p=i[1];return{r:parseInt(p.slice(0,2),16),g:parseInt(p.slice(2,4),16),b:parseInt(p.slice(4,6),16),a:parseInt(p.slice(6,8),16)/255}}if(m){const p=parseInt(m[1],16);return{r:p>>16&255,g:p>>8&255,b:p&255,a:1}}return{r:0,g:0,b:0,a:1}}function qe(l,m,i,p,s){const n=j=>Math.max(0,Math.min(255,Math.round(j))).toString(16).padStart(2,"0"),d=`#${n(l)}${n(m)}${n(i)}`;return s?`${d}${n(p*255)}`:d}const Ee=c.forwardRef(({label:l,helperText:m,error:i,required:p,disabled:s,id:n,className:d,style:j,accessMode:f,displayStyle:u,value:_="#3b82f6",onChange:S,presets:z=Ie,showInput:x=!0,showRandom:k=!0,withAlpha:L=!1,showKeyboardHints:h,size:J="md",labelPlacement:R,errorPlacement:y,labelWidth:E,controlWidth:b,loading:F},U)=>{const w=o.useNiceAccessMode(f,n);if(w==="hidden")return null;(w==="disabled"||w==="readOnly")&&(s=!0);const{t:C}=o.Wo(),B=o.useControlId(n);o.useComponentDisplayClass("input",u);const V=c.useCallback(()=>{s||S?.(Ae())},[s,S]),[I,O]=c.useState(!1),[re,oe]=c.useState(null),ne=c.useRef(null),X=c.useRef(null);c.useLayoutEffect(()=>{if(!I||!X.current)return;const $=()=>{const v=X.current?.getBoundingClientRect();if(!v)return;const K=280,D=360;let A=v.left,G=v.bottom+6;A+K>window.innerWidth-8&&(A=Math.max(8,window.innerWidth-K-8)),G+D>window.innerHeight-8&&(G=Math.max(8,v.top-D-6)),oe({left:A,top:G})};return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[I]),c.useEffect(()=>{if(!I)return;const $=K=>{const D=K.target;ne.current?.contains(D)||X.current?.contains(D)||O(!1)},v=K=>{K.key==="Escape"&&O(!1)};return document.addEventListener("mousedown",$),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",$),document.removeEventListener("keydown",v)}},[I]);const P=c.useMemo(()=>[{key:"Enter",description:C("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:C("shortcuts.navigatePresets","Navigate presets")}],[C]);return e.jsxs("div",{className:`nice-field nice-field--${J} ${R==="left"?"nice-field--label-left":""} ${F?"nice-field--loading":""} ${d||""}`,style:{...j,...E!=null&&{"--nice-field-label-width":typeof E=="number"?`${E}px`:E},...b!=null&&{"--nice-field-control-width":typeof b=="number"?`${b}px`:b}},"aria-busy":F||void 0,children:[l&&e.jsxs("label",{htmlFor:B,className:`nice-field__label ${p?"nice-field__label--required":""}`,children:[l,h&&e.jsx(o.NiceKeyboardHint,{shortcuts:P,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:X,className:"nice-color-picker__swatch",id:B,style:{background:_},onClick:$=>{$.stopPropagation(),s||O(v=>!v)},onKeyDown:$=>{!s&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),O(v=>!v))},role:"button",tabIndex:0,"aria-label":C("colorPicker.openPalette","Open color palette"),"aria-haspopup":"dialog","aria-expanded":I,children:e.jsx("input",{ref:$=>{typeof U=="function"?U($):U&&(U.current=$)},type:"hidden",value:_,disabled:s,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:s,onChange:$=>S?.($.target.value),maxLength:7})}),k&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:V,disabled:s,title:C("colorPicker.random","Random"),"aria-label":C("colorPicker.random","Random"),style:{fontSize:"0.65rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:C("colorPicker.random","Random")}),F&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),y==="right"&&i&&e.jsx("div",{id:`${B}-error`,className:"nice-field__error",role:"alert",children:i}),y==="right"&&!i&&m&&e.jsx("div",{id:`${B}-helper`,className:"nice-field__helper",children:m})]}),I&&re&&typeof document<"u"&&Fe.createPortal(e.jsx("div",{ref:ne,className:"nice-color-picker__popup nice-color-picker__popup--portal",role:"dialog","aria-label":C("colorPicker.palette","Color palette"),style:{position:"fixed",left:re.left,top:re.top},onClick:$=>$.stopPropagation(),children:(()=>{const $=Ke(_),v={r:$.r,g:$.g,b:$.b},K=L?$.a:1,D=He(v.r,v.g,v.b),A=Ue(v.r,v.g,v.b),G=(r,g,q,M=K)=>S?.(qe(r,g,q,M,L)),le=(r,g,q)=>G(r,g,q),me=(r,g,q)=>{const M=Te(r,g,q);G(M.r,M.g,M.b)},W=(r,g,q)=>{const M=Be(r,g,q);G(M.r,M.g,M.b)},Y=r=>G(v.r,v.g,v.b,r),ae=r=>{if(s)return;const g=r.currentTarget,q=Q=>{const Z=g.getBoundingClientRect(),_e=Math.max(0,Math.min(Z.width,Q.clientX-Z.left)),xe=Math.max(0,Math.min(Z.height,Q.clientY-Z.top)),de=Math.round(_e/Z.width*100),Ne=100-Math.round(xe/Z.height*100);W(A.h,de,Ne)};q(r);const M=()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",M)};document.addEventListener("pointermove",q),document.addEventListener("pointerup",M)},se=`hsl(${A.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:s,onChange:r=>S?.(r.target.value),maxLength:L?9:7,"aria-label":C("colorPicker.hexValue","Hex value")})}),e.jsx("input",{type:"range",min:0,max:360,value:A.h,disabled:s,onChange:r=>W(Number(r.target.value),A.s,A.v),className:"nice-color-picker__hue-slider","aria-label":C("colorPicker.hue","Hue")}),e.jsx("div",{className:"nice-color-picker__sv",style:{background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${se})`},onPointerDown:ae,role:"application","aria-label":C("colorPicker.svPalette","Saturation/value palette"),children:e.jsx("span",{className:"nice-color-picker__sv-marker",style:{left:`${A.s}%`,top:`${100-A.v}%`}})}),e.jsxs("div",{className:"nice-color-picker__sliders",children:[e.jsx("div",{className:"nice-color-picker__slider-col",children:["h","s","l"].map(r=>{const g=r==="h"?360:100,q=D[r],M=Q=>me(r==="h"?Q:D.h,r==="s"?Q:D.s,r==="l"?Q:D.l);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:r.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:g,value:q,disabled:s,onChange:Q=>M(Number(Q.target.value))}),e.jsx("input",{type:"number",min:0,max:g,value:q,disabled:s,onChange:Q=>M(Number(Q.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},r)})}),e.jsx("div",{className:"nice-color-picker__slider-col",children:["r","g","b"].map(r=>{const g=v[r],q=M=>le(r==="r"?M:v.r,r==="g"?M:v.g,r==="b"?M:v.b);return e.jsxs("div",{className:"nice-color-picker__slider-row",children:[e.jsx("label",{className:"nice-color-picker__slider-label",children:r.toUpperCase()}),e.jsx("input",{type:"range",min:0,max:255,value:g,disabled:s,onChange:M=>q(Number(M.target.value))}),e.jsx("input",{type:"number",min:0,max:255,value:g,disabled:s,onChange:M=>q(Number(M.target.value)||0),className:"nice-input__native nice-color-picker__slider-num"})]},r)})})]}),L&&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:s,onChange:r=>Y(Number(r.target.value)/100),className:"nice-color-picker__alpha-slider",style:{background:`linear-gradient(to right, transparent, rgb(${v.r},${v.g},${v.b}))`},"aria-label":C("colorPicker.alpha","Alpha")}),e.jsx("input",{type:"number",min:0,max:100,value:Math.round(K*100),disabled:s,onChange:r=>Y((Number(r.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(r=>e.jsx("div",{className:`nice-color-picker__preset ${_===r?"nice-color-picker__preset--active":""}`,style:{background:r},onClick:()=>{S?.(r),O(!1)},role:"button",tabIndex:0,"aria-label":r,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),S?.(r),O(!1))}},r))})]})})()}),document.body)]})}),y!=="right"&&i&&e.jsx("div",{id:`${B}-error`,className:"nice-field__error",role:"alert",children:i}),y!=="right"&&!i&&m&&e.jsx("div",{id:`${B}-helper`,className:"nice-field__helper",children:m})]})});Ee.displayName="NiceColorPicker";const Le=c.forwardRef(({children:l,variant:m="primary",size:i="md",type:p="button",disabled:s,loading:n,fullWidth:d,onClick:j,leftIcon:f,rightIcon:u,error:_,errorPlacement:S="bottom",className:z,style:x,id:k,accessMode:L,displayStyle:h,...J},R)=>{const y=o.useNiceAccessMode(L,k);if(y==="hidden")return null;(y==="disabled"||y==="readOnly")&&(s=!0);const E=o.useComponentDisplayStyle("button",h),b=o.useComponentDisplayClass("button",h),F=m!=="primary"?(({background:C,color:B,...V})=>V)(E):E,U=e.jsxs("button",{ref:R,type:p,id:k,className:`nice-btn nice-btn--${m} nice-btn--${i} nice-btn--ds-${b} ${d?"nice-btn--full-width":""} ${n?"nice-btn--loading":""} ${_&&!S?"nice-btn--has-error":""} ${z||""}`,style:{...F,...x},disabled:s||n,"aria-busy":n||void 0,"aria-disabled":s||n||void 0,onClick:j,...J,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&&f&&e.jsx("span",{"aria-hidden":"true",children:f}),!n&&e.jsx("span",{children:l}),n&&e.jsx("span",{style:{visibility:"hidden"},"aria-hidden":"true",children:l}),!n&&u&&e.jsx("span",{"aria-hidden":"true",children:u})]});if(!_)return U;const w=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--${i}`,style:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:"8px",width:"fit-content"},children:[U,w]}):e.jsxs("span",{className:`nice-btn-field nice-btn-field--bottom nice-field--${i}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",width:"fit-content"},children:[U,w]})});Le.displayName="NiceButton";const Ve=({tabs:l,activeTab:m,onChange:i,variant:p="default",vertical:s,size:n="md",className:d,style:j,displayStyle:f})=>{const u=o.useComponentDisplayStyle("tab",f),_=o.useComponentDisplayClass("tab",f),[S,z]=c.useState(m||l[0]?.id),x=m??S,k=c.useCallback(h=>{z(h),i?.(h)},[i]),L=l.find(h=>h.id===x)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${n} nice-tabs--ds-${_} ${d||""}`,style:{...u,...j,...s?{display:"flex",gap:16}:{}},children:[e.jsx("div",{className:`nice-tabs__list ${p!=="default"?`nice-tabs__list--${p}`:""} ${s?"nice-tabs__list--vertical":""}`,role:"tablist",children:l.map(h=>e.jsxs("button",{type:"button",role:"tab","aria-selected":x===h.id,className:`nice-tabs__tab ${x===h.id?"nice-tabs__tab--active":""} ${h.disabled?"nice-tabs__tab--disabled":""}`,disabled:h.disabled,onClick:()=>k(h.id),children:[h.icon,e.jsx("span",{children:h.label}),h.badge!==void 0&&e.jsx("span",{className:"nice-tabs__badge",children:h.badge})]},h.id))}),L&&e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:L})]})};exports.NiceButton=Le;exports.NiceCheckbox=De;exports.NiceColorPicker=Ee;exports.NiceNumberInput=Me;exports.NiceSelect=Se;exports.NiceTabs=Ve;exports.NiceTextInput=Ce;exports.NiceToggle=Re;
|