@nice2dev/ui 1.1.6 → 1.1.7
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 +52 -0
- package/README.md +50 -29
- package/css/legacy-bg-text-aliases.css +65 -61
- package/dist/NiceCodeEditor-Bc81wiaN.js +1134 -0
- package/dist/NiceCodeEditor-D6f8KdHN.js +1134 -0
- package/dist/NiceCodeEditor-DE3saxyt.cjs +260 -0
- package/dist/NiceCodeEditor-DZM16My5.cjs +260 -0
- package/dist/NiceCodeEditor-HqmcJjmZ.js +1179 -0
- package/dist/NiceColorPicker-6EqXaDj0.cjs +1 -0
- package/dist/NiceColorPicker-BiEWqWnd.js +596 -0
- package/dist/NiceColorPicker-Cuc6YXqz.cjs +1 -0
- package/dist/NiceColorPicker-DMATcNWG.js +596 -0
- package/dist/NiceColorPicker-R3O1nemp.js +596 -0
- package/dist/NiceConfirmDialog-B0e10fRL.cjs +1 -0
- package/dist/NiceConfirmDialog-BBDgEMHv.js +81 -0
- package/dist/NiceConfirmDialog-C7kdr8jJ.js +81 -0
- package/dist/NiceConfirmDialog-DMHqPfFM.js +81 -0
- package/dist/NiceConfirmDialog-ZJpQLQQS.cjs +1 -0
- package/dist/NiceDataGrid-BzUw4dSu.cjs +10 -0
- package/dist/NiceDataGrid-CPKcVOVz.js +1743 -0
- package/dist/NiceDataGrid-DJr33WMy.cjs +10 -0
- package/dist/NiceDataGrid-D_4gZ1Hu.js +1736 -0
- package/dist/NiceDataGrid-DlUAaXhD.js +1736 -0
- package/dist/NiceDocumentViewer-8ghRVtfO.js +672 -0
- package/dist/NiceDocumentViewer-ChWtA_Ry.cjs +180 -0
- package/dist/NiceDocumentViewer-DwLUV7Tc.js +672 -0
- package/dist/NiceDocumentViewer-goMzF1w3.cjs +180 -0
- package/dist/NiceDocumentViewer-gt1mxzP8.js +672 -0
- package/dist/NiceForm-CHEAHxDw.js +4805 -0
- package/dist/NiceForm-CJUp1CL0.cjs +1 -0
- package/dist/NiceForm-Cp_RH3Yj.js +4805 -0
- package/dist/NiceForm-a6tGr6ss.js +4819 -0
- package/dist/NiceForm-jU89oe2S.cjs +1 -0
- package/dist/NiceGantt-BnQwyTfG.cjs +1 -0
- package/dist/NiceGantt-D8coFAvK.js +328 -0
- package/dist/NiceGantt-DOZfT6r5.js +328 -0
- package/dist/NiceGantt-DQzH1V-R.js +328 -0
- package/dist/NiceGantt-jQ8ZpXko.cjs +1 -0
- package/dist/NiceHtmlEditor-B1nlXJNW.cjs +10 -0
- package/dist/NiceHtmlEditor-Bv3VqJPG.js +862 -0
- package/dist/NiceHtmlEditor-CKsGj-Ei.cjs +10 -0
- package/dist/NiceHtmlEditor-CloMgyzg.js +841 -0
- package/dist/NiceHtmlEditor-DUAHmkWI.js +841 -0
- package/dist/NiceLoginForm-Ce_QLnLf.js +736 -0
- package/dist/NiceLoginForm-DLpNTQlR.cjs +1 -0
- package/dist/NiceLoginForm-Dg0286Cc.js +736 -0
- package/dist/NiceLoginForm-X05Vadeg.js +708 -0
- package/dist/NiceLoginForm-f_dBCnUi.cjs +1 -0
- package/dist/NiceMention-BByI4nFG.js +11120 -0
- package/dist/NiceMention-C2TPiMph.cjs +430 -0
- package/dist/NiceMention-C67vT6m0.js +11145 -0
- package/dist/NiceMention-D1cdy63w.cjs +430 -0
- package/dist/NiceMention-QIuggb9Y.js +11122 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-CHaan9al.js +95 -0
- package/dist/NiceModal-Czq6OEAT.js +95 -0
- package/dist/NiceModal-D-HFwawr.js +95 -0
- package/dist/NiceModal-DOy2XTzc.cjs +1 -0
- package/dist/NiceModal-DkawKzEE.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-1CsP8Zst.js +6997 -0
- package/dist/NiceModuleLifecyclePanel-Bkx4Yg-3.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-C5oYtczk.js +6999 -0
- package/dist/NiceModuleLifecyclePanel-DCcy2yYi.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DqdgW-0s.js +7004 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-7od5KUa3.cjs +1 -0
- package/dist/NicePagination-DMrkR8hH.cjs +1 -0
- package/dist/NicePagination-DQmZpsSQ.js +179 -0
- package/dist/NicePagination-DipQRjPq.js +172 -0
- package/dist/NicePagination-KhlVXYaT.js +172 -0
- package/dist/NicePivotGrid-B-KthuqL.cjs +152 -0
- package/dist/NicePivotGrid-CLCTHkKO.cjs +152 -0
- package/dist/NicePivotGrid-DV54FCsH.js +1174 -0
- package/dist/NicePivotGrid-DoWLUPUs.js +1167 -0
- package/dist/NicePivotGrid-etwpfccz.js +1167 -0
- package/dist/NiceSavedQueryPanel-BABkTNc5.js +5129 -0
- package/dist/NiceSavedQueryPanel-Cfeig83P.cjs +586 -0
- package/dist/NiceSavedQueryPanel-DTWRLseb.cjs +586 -0
- package/dist/NiceSavedQueryPanel-Dy154sxE.js +5129 -0
- package/dist/NiceSavedQueryPanel-v7AffOOe.js +5129 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceScheduler-BEgB7ZgF.cjs +5 -0
- package/dist/NiceScheduler-C9JprsEI.cjs +5 -0
- package/dist/NiceScheduler-DSP-PPh0.js +1645 -0
- package/dist/NiceScheduler-DuPnaA3t.js +1652 -0
- package/dist/NiceScheduler-Oa89YZx9.js +1645 -0
- package/dist/NiceSelect-A336yeLZ.js +433 -0
- package/dist/NiceSelect-B5hTbqi2.js +433 -0
- package/dist/NiceSelect-BYSgDYzq.cjs +1 -0
- package/dist/NiceSelect-Dudf2T5T.js +433 -0
- package/dist/NiceSelect-DwBAIrX7.cjs +1 -0
- package/dist/NiceWindow-B6zjBTl9.cjs +1 -0
- package/dist/NiceWindow-BKQEx7Vf.js +1623 -0
- package/dist/NiceWindow-BnTH7Gy0.js +1623 -0
- package/dist/NiceWindow-CZN9NVZw.cjs +1 -0
- package/dist/NiceWindow-lxtPR7yZ.js +1623 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-B8_V3_nq.cjs +882 -0
- package/dist/charts-BZgyyybE.js +31933 -0
- package/dist/charts-FuDk5-r6.js +31958 -0
- package/dist/charts-INj3yFo5.js +31946 -0
- package/dist/charts-NolNXKUL.cjs +882 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-A_A6c7an.js +795 -0
- package/dist/core-B2iH2J_X.js +795 -0
- package/dist/core-BmspZEfD.js +795 -0
- package/dist/core-DAfLOet6.cjs +1 -0
- package/dist/core-ZG3bgnBR.cjs +1 -0
- package/dist/data-branching-B3TOqXAO.cjs +1 -0
- package/dist/data-branching-BUGiICDZ.js +6275 -0
- package/dist/data-branching-DMXmcocj.js +6275 -0
- package/dist/data-branching-YE8P9M5P.js +6275 -0
- package/dist/data-branching-t6uhAwIm.cjs +1 -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 +7 -2
- package/dist/data.mjs +3 -3
- package/dist/devops-BhV3OmF7.js +8285 -0
- package/dist/devops-BqUxnbRi.cjs +17 -0
- package/dist/devops-Bx-Qwj9w.cjs +17 -0
- package/dist/devops-DYZatW45.js +8251 -0
- package/dist/devops-R98k2zpd.js +8251 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +29 -16
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +35 -20
- package/dist/editors.mjs +7 -7
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index.cjs +445 -445
- package/dist/index.css +1 -1
- package/dist/index.d.ts +190 -111
- package/dist/index.mjs +16635 -16351
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +31 -18
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +17 -14
- package/dist/navigation.mjs +130 -130
- package/dist/no-code-BPaAS4wW.cjs +332 -0
- package/dist/no-code-CBwUVL1i.js +7447 -0
- package/dist/no-code-CjktkQ50.js +7447 -0
- package/dist/no-code-DW2NrRba.js +7447 -0
- package/dist/no-code-DmFxrZ5T.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +2 -2
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +4 -4
- package/dist/overlays.mjs +2 -2
- package/dist/pickerCommons-C4XWRUvH.cjs +1 -0
- package/dist/pickerCommons-C_BpYs_m.cjs +1 -0
- package/dist/pickerCommons-DAOXH_u5.js +1122 -0
- package/dist/pickerCommons-Dn4wnDco.js +1122 -0
- package/dist/pickerCommons-DskswPS5.js +1122 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +7 -7
- package/package.json +3 -3
package/dist/no-code.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-DmFxrZ5T.cjs");exports.NiceAPIFlow=e.NiceAPIFlow;exports.NiceCodePreview=e.NiceCodePreview;exports.NiceCodeTemplate=e.NiceCodeTemplate;exports.NiceComponentDesigner=e.NiceComponentDesigner;exports.NiceDataMapper=e.NiceDataMapper;exports.NiceEventOrchestrator=e.NiceEventOrchestrator;exports.NiceLowCodeStudio=e.NiceLowCodeStudio;exports.NicePageBuilder=e.NicePageBuilder;exports.NiceStateDesigner=e.NiceStateDesigner;exports.NiceTestBuilder=e.NiceTestBuilder;
|
package/dist/no-code.d.ts
CHANGED
|
@@ -407,8 +407,8 @@ export declare interface NiceCodePreviewProps {
|
|
|
407
407
|
export declare const NiceCodeTemplate: default_2.FC<NiceCodeTemplateProps>;
|
|
408
408
|
|
|
409
409
|
export declare interface NiceCodeTemplateProps extends NiceBaseProps {
|
|
410
|
-
/** Available templates */
|
|
411
|
-
templates
|
|
410
|
+
/** Available templates. Defaults to none. */
|
|
411
|
+
templates?: CodeTemplate[];
|
|
412
412
|
/** Framework presets */
|
|
413
413
|
presets?: FrameworkPreset[];
|
|
414
414
|
/** Currently selected template */
|
package/dist/no-code.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as i, a as s, b as c, c as o, d as r, e as t, f as N, g as d, h as n, i as p } from "./no-code-
|
|
1
|
+
import { N as i, a as s, b as c, c as o, d as r, e as t, f as N, g as d, h as n, i as p } from "./no-code-CBwUVL1i.js";
|
|
2
2
|
export {
|
|
3
3
|
i as NiceAPIFlow,
|
|
4
4
|
s as NiceCodePreview,
|
package/dist/overlays.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-CZN9NVZw.cjs"),r=require("react/jsx-runtime"),M=require("./charts-NolNXKUL.cjs"),e=require("react"),B=require("react-dom");function Y(){const t=e.useContext(M.Er);return t?.portalTarget?t.portalTarget:typeof document<"u"?document.body:null}const W=({open:t,onClose:c,children:v,title:o,size:x="md",closeOnBackdropClick:l=!0,closeOnEscape:d=!0,disableFocusTrap:u=!1,disableBodyScroll:j=!0,zIndex:_=1e3,className:p,style:E})=>{const w=e.useRef(null);M.xc(w,t&&!u);const y=Y();e.useEffect(()=>{if(!j&&t){const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}}},[t,j]),e.useEffect(()=>{if(!d||!t)return;const n=g=>{g.key==="Escape"&&(g.preventDefault(),c())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[d,t,c]);const f=e.useCallback(n=>{l&&n.target===n.currentTarget&&c()},[l,c]);if(!t)return null;const s={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[x];return B.createPortal(r.jsx("div",{className:"nice-modal__overlay",style:{zIndex:_},onClick:f,role:"presentation",children:r.jsx("div",{ref:w,className:`nice-modal ${s} ${p||""}`,role:"dialog","aria-modal":"true","aria-label":o,style:E,tabIndex:-1,children:v})}),y)},O=({children:t,showClose:c=!0,onClose:v,className:o})=>r.jsxs("div",{className:`nice-modal__header ${o||""}`,children:[r.jsx("div",{className:"nice-modal__title",children:t}),c&&v&&r.jsx("button",{type:"button",className:"nice-modal__close",onClick:v,"aria-label":"Close",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),X=({children:t,className:c})=>r.jsx("div",{className:`nice-modal__body ${c||""}`,children:t}),q=({children:t,className:c})=>r.jsx("div",{className:`nice-modal__footer ${c||""}`,children:t}),K=({open:t,onClose:c,children:v,position:o="right",size:x=320,title:l,closeOnBackdropClick:d=!0,closeOnEscape:u=!0,swipeToClose:j=!0,zIndex:_=1e3,className:p,style:E})=>{const w=e.useRef(null),[y,f]=e.useState(!1),[s,n]=e.useState(0);M.xc(w,t);const g=Y();e.useEffect(()=>{if(!u||!t)return;const a=k=>{k.key==="Escape"&&(k.preventDefault(),c())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[u,t,c]);const h=e.useCallback(a=>{let k=0;switch(o){case"left":k=Math.min(0,a.deltaX);break;case"right":k=Math.max(0,a.deltaX);break;case"top":k=Math.min(0,a.deltaY);break;case"bottom":k=Math.max(0,a.deltaY);break}n(k)},[o]),D=e.useCallback(a=>{let C=!1;switch(o){case"left":C=a.deltaX<-100;break;case"right":C=a.deltaX>100;break;case"top":C=a.deltaY<-100;break;case"bottom":C=a.deltaY>100;break}C&&(M.ua("light"),c()),n(0),f(!1)},[o,c]),{ref:P}=M.Wc({enabled:j&&t,onPanStart:()=>f(!0),onPan:h,onPanEnd:D}),S=e.useCallback(a=>{d&&a.target===a.currentTarget&&c()},[d,c]);if(!t)return null;const $=o==="left"||o==="right",L=$?{width:typeof x=="number"?`${x}px`:x}:{height:typeof x=="number"?`${x}px`:x},i=()=>{if(y)return $?`translateX(${s}px)`:`translateY(${s}px)`};return B.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-drawer__overlay ${t?"nice-drawer__overlay--visible":""}`,style:{zIndex:_},onClick:S}),r.jsx("div",{ref:a=>{w.current=a,P.current=a},className:`nice-drawer nice-drawer--${o} ${t?"nice-drawer--open":""} ${p||""}`,style:{...L,zIndex:_+1,transform:i(),transition:y?"none":void 0,...E},role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:v})]}),g)},F=({open:t,onClose:c,children:v,title:o,showHandle:x=!0,snapPoints:l=[.5,.9],initialSnap:d=0,expandable:u=!0,closeOnBackdropClick:j=!0,closeOnEscape:_=!0,hapticFeedback:p=!0,zIndex:E=1e3,className:w,style:y})=>{const f=e.useRef(null),s=e.useRef(null),[n,g]=e.useState(d),[h,D]=e.useState(!1),[P,S]=e.useState(0),$=e.useRef(0);e.useEffect(()=>{t&&(g(d),S(0))},[t,d]),M.xc(f,t);const L=Y();e.useEffect(()=>{if(!_||!t)return;const m=b=>{b.key==="Escape"&&(b.preventDefault(),c())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[_,t,c]),e.useEffect(()=>{if(t){const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[t]);const i=e.useCallback(m=>{const b=m.target.closest(".nice-bottom-sheet__handle"),I=s.current,H=!I||I.scrollTop<=0;!b&&!H||(D(!0),$.current=m.touches[0].clientY)},[]),a=e.useCallback(m=>{if(!h)return;const b=m.touches[0].clientY-$.current;(b>0||n<l.length-1)&&S(b)},[h,n,l.length]),k=e.useCallback(()=>{if(!h)return;const m=window.innerHeight;l[n]*m;const b=-P,I=m*.15;b>I&&u&&n<l.length-1?(g(n+1),p&&M.ua("selection")):b<-I&&(n>0?(g(n-1),p&&M.ua("selection")):(p&&M.ua("light"),c())),D(!1),S(0)},[h,P,n,l,u,p,c]),C=e.useCallback(()=>{j&&c()},[j,c]);if(!t)return null;const R=l[n]*100,T=h?P:0;return B.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-bottom-sheet__overlay ${t?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:E},onClick:C}),r.jsxs("div",{ref:f,className:`nice-bottom-sheet ${t?"nice-bottom-sheet--open":""} ${w||""}`,style:{zIndex:E+1,height:`${R}vh`,transform:`translateY(${Math.max(0,T)}px)`,transition:h?"none":"transform 0.3s ease-out, height 0.3s ease-out",...y},role:"dialog","aria-modal":"true","aria-label":o,tabIndex:-1,onTouchStart:i,onTouchMove:a,onTouchEnd:k,children:[x&&r.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),o&&r.jsx("div",{className:"nice-bottom-sheet__title",children:o}),r.jsx("div",{ref:s,className:"nice-bottom-sheet__content",children:v})]})]}),L)},z=({trigger:t,children:c,placement:v="bottom",triggerMode:o="click",open:x,onOpenChange:l,hoverDelay:d=200,offset:u=8,className:j,showArrow:_=!0})=>{const[p,E]=e.useState(!1),w=e.useRef(null),y=e.useRef(null),f=e.useRef(null),s=Y(),n=x!==void 0,g=n?x:p,h=e.useCallback(i=>{n||E(i),l?.(i)},[n,l]);M.Sc(y,()=>{o!=="manual"&&g&&h(!1)});const D=e.useCallback(()=>{o==="click"&&h(!g)},[o,g,h]),P=e.useCallback(()=>{o==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!0),d))},[o,d,h]),S=e.useCallback(()=>{o==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!1),d))},[o,d,h]),[$,L]=e.useState({top:0,left:0});return e.useEffect(()=>{if(!g||!w.current||!y.current)return;const i=w.current.getBoundingClientRect(),a=y.current.getBoundingClientRect(),k=window.innerWidth,C=window.innerHeight;let R=0,T=0;const[m,b="center"]=v.split("-");switch(m){case"top":R=i.top-a.height-u,T=i.left+(i.width-a.width)/2;break;case"bottom":R=i.bottom+u,T=i.left+(i.width-a.width)/2;break;case"left":R=i.top+(i.height-a.height)/2,T=i.left-a.width-u;break;case"right":R=i.top+(i.height-a.height)/2,T=i.right+u;break}m==="top"||m==="bottom"?(b==="start"&&(T=i.left),b==="end"&&(T=i.right-a.width)):(b==="start"&&(R=i.top),b==="end"&&(R=i.bottom-a.height)),T=Math.max(8,Math.min(k-a.width-8,T)),R=Math.max(8,Math.min(C-a.height-8,R)),L({top:R,left:T})},[g,v,u]),r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,className:"nice-popover__trigger",onClick:D,onMouseEnter:P,onMouseLeave:S,style:{display:"inline-block"},children:t}),g&&B.createPortal(r.jsxs("div",{ref:y,className:`nice-popover nice-popover--${v} ${j||""}`,style:{position:"fixed",top:$.top,left:$.left,zIndex:1100},onMouseEnter:P,onMouseLeave:S,role:"tooltip",children:[_&&r.jsx("div",{className:"nice-popover__arrow"}),r.jsx("div",{className:"nice-popover__content",children:c})]}),s)]})},A=({items:t,children:c,onOpen:v,onClose:o,className:x})=>{const[l,d]=e.useState(!1),[u,j]=e.useState({x:0,y:0}),_=e.useRef(null),p=e.useRef(null),E=Y();M.Sc(_,()=>{l&&(d(!1),o?.())});const w=e.useCallback(s=>{s.preventDefault(),j({x:s.clientX,y:s.clientY}),d(!0),v?.()},[v]),y=e.useCallback(s=>{!s.disabled&&s.onClick&&(s.onClick(),d(!1),o?.())},[o]);e.useEffect(()=>{if(!l)return;const s=n=>{n.key==="Escape"&&(d(!1),o?.())};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[l,o]);const f=s=>r.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:s.map(n=>n.divider?r.jsx("li",{className:"nice-context-menu__divider",role:"separator"},n.key):r.jsx("li",{role:"presentation",children:r.jsxs("button",{type:"button",className:`nice-context-menu__item ${n.disabled?"nice-context-menu__item--disabled":""} ${n.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:n.disabled,onClick:()=>y(n),children:[n.icon&&r.jsx("span",{className:"nice-context-menu__icon",children:n.icon}),r.jsx("span",{className:"nice-context-menu__label",children:n.label})]})},n.key))});return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,onContextMenu:w,style:{display:"contents"},children:c}),l&&B.createPortal(r.jsx("div",{ref:_,className:`nice-context-menu ${x||""}`,style:{position:"fixed",left:u.x,top:u.y,zIndex:1200},role:"menu",children:f(t)}),E)]})};exports.NiceActionSheet=N.NiceActionSheet;exports.NiceBlockUI=N.NiceBlockUI;exports.NiceBox=N.NiceBox;exports.NiceCommandPaletteProvider=N.NiceCommandPaletteProvider;exports.NiceLoadPanel=N.NiceLoadPanel;exports.NicePopover=N.NicePopover;exports.NiceResizable=N.NiceResizable;exports.NiceResponsiveBox=N.NiceResponsiveBox;exports.NiceScrollView=N.NiceScrollView;exports.NiceTutorial=N.NiceTutorial;exports.NiceTutorialProvider=N.NiceTutorialProvider;exports.NiceWindow=N.NiceWindow;exports.NiceWindowManager=N.NiceWindowManager;exports.useCommandPalette=N.useCommandPalette;exports.useRegisterCommands=N.useRegisterCommands;exports.NiceBottomSheet=F;exports.NiceContextMenu=A;exports.NiceDrawer=K;exports.NiceModal=W;exports.NiceModalBody=X;exports.NiceModalFooter=q;exports.NiceModalHeader=O;exports.NiceOverlayPopover=z;
|
package/dist/overlays.d.ts
CHANGED
|
@@ -410,8 +410,8 @@ export declare const NiceTutorial: default_2.FC<NiceTutorialProps>;
|
|
|
410
410
|
|
|
411
411
|
/** Props for the {@link NiceTutorial} component — a guided walkthrough overlay with step-by-step highlighting. */
|
|
412
412
|
export declare interface NiceTutorialProps {
|
|
413
|
-
/** Array of ordered tutorial steps */
|
|
414
|
-
steps
|
|
413
|
+
/** Array of ordered tutorial steps. Defaults to none. */
|
|
414
|
+
steps?: NiceTutorialStep[];
|
|
415
415
|
/** Starts the tutorial when true */
|
|
416
416
|
active: boolean;
|
|
417
417
|
/** Called when tutorial finishes (last step completed) */
|
|
@@ -554,8 +554,8 @@ export declare interface NiceWindowPosition {
|
|
|
554
554
|
export declare interface NiceWindowProps extends NiceBaseProps {
|
|
555
555
|
/** Unique window identifier. Auto-generated if not provided. */
|
|
556
556
|
windowKey?: string;
|
|
557
|
-
/** Window title. */
|
|
558
|
-
title
|
|
557
|
+
/** Window title. Optional — without one the title bar is empty and the dialog carries no aria-label. */
|
|
558
|
+
title?: string;
|
|
559
559
|
/** Icon displayed in title bar */
|
|
560
560
|
icon?: React.ReactNode;
|
|
561
561
|
/** Window content */
|
package/dist/overlays.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as xe } from "./NiceWindow-
|
|
1
|
+
import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as xe } from "./NiceWindow-BKQEx7Vf.js";
|
|
2
2
|
import { jsxs as S, Fragment as O, jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { x as j, u as K, S as z, W as U, E as V } from "./charts-
|
|
3
|
+
import { x as j, u as K, S as z, W as U, E as V } from "./charts-FuDk5-r6.js";
|
|
4
4
|
import { useRef as E, useState as D, useEffect as Y, useCallback as b, useContext as q } from "react";
|
|
5
5
|
import { createPortal as W } from "react-dom";
|
|
6
6
|
function X() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("./charts-B8_V3_nq.cjs"),u=require("react"),De=require("./vendor-Bo2Q64AF.cjs"),Ee=({tabs:c,activeTab:r,onChange:n,variant:p="default",vertical:t,size:i="md",iconOnly:d=!1,centered:x="auto",countLocation:g="right",className:S,style:y,displayStyle:j})=>{const F=x==="auto"?d:x,o=a.rc("tab",j),_=a.ac("tab",j),[M,C]=u.useState(r||c[0]?.id),A=r??M,m=u.useCallback(s=>{C(s),n?.(s)},[n]),h=c.find(s=>s.id===A)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${i} ${t?"nice-tabs--vertical":""} ${d?"nice-tabs--icon-only":""} nice-tabs--ds-${_} ${S||""}`,style:{...o,...y},children:[e.jsx("div",{className:`nice-tabs__list ${p!=="default"?`nice-tabs__list--${p}`:""} ${t?"nice-tabs__list--vertical":""} ${F?"nice-tabs__list--centered":""}`,role:"tablist",children:c.map(s=>e.jsxs("button",{type:"button",role:"tab","aria-selected":A===s.id,"aria-label":d?s.label:void 0,title:d?s.label:void 0,className:`nice-tabs__tab ${A===s.id?"nice-tabs__tab--active":""} ${s.disabled?"nice-tabs__tab--disabled":""} ${g==="bottom"?"nice-tabs__tab--count-bottom":""}`,disabled:s.disabled,onClick:()=>m(s.id),children:[s.icon,!d&&e.jsx("span",{children:s.label}),s.badge!==void 0&&e.jsx("span",{className:`nice-tabs__badge${g==="bottom"?" nice-tabs__badge--pill":""}`,children:s.badge})]},s.id))}),e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:h})]})},_e=u.forwardRef(({label:c,checked:r=!1,indeterminate:n=!1,onChange:p,disabled:t,readOnly:i,loading:d,required:x,size:g="md",name:S,id:y,className:j,style:F,error:o,helperText:_,accessMode:M,displayStyle:C,showKeyboardHints:A,labelPlacement:m,errorPlacement:h,labelWidth:s,controlWidth:b},N)=>{const L=a.Dc(M,y),v=L==="hidden";(L==="disabled"||L==="readOnly")&&(t=!0);const{t:T}=a.Gt(),R=a.bc(y);a.ac("toggle",C);const U=u.useMemo(()=>[{key:"Space",description:T("shortcuts.toggle","Toggle")}],[T]),D=u.useCallback(k=>{k&&(k.indeterminate=n),typeof N=="function"?N(k):N&&(N.current=k)},[n,N]);return v?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${g} ${m==="left"?"nice-field--label-left":""} ${h==="right"?"nice-field--error-right":""} ${d?"nice-field--loading":""} ${j||""}`,style:{...F,...s!=null&&{"--nice-field-label-width":typeof s=="number"?`${s}px`:s},...b!=null&&{"--nice-field-control-width":typeof b=="number"?`${b}px`:b}},"aria-busy":d||void 0,children:[m==="left"&&c&&e.jsx("span",{className:`nice-field__label ${x?"nice-field__label--required":""}`,children:c}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${g!=="md"?`nice-checkbox--${g}`:""} ${t||d?"nice-checkbox--disabled":""}`,htmlFor:R,children:[e.jsx("input",{ref:D,id:R,type:"checkbox",className:"nice-checkbox__input",name:S,checked:r,disabled:t||d,readOnly:i,"aria-invalid":!!o,onChange:k=>{i||d||p?.(k.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:r?e.jsx("polyline",{points:"2 6 5 9 10 3"}):e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"})})}),m!=="left"&&c&&e.jsx("span",{children:c}),A&&e.jsx(a.ha,{shortcuts:U,size:"sm"})]}),d&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),h==="right"&&o&&e.jsx("div",{id:`${R}-error`,className:"nice-field__error",role:"alert",children:o}),h==="right"&&!o&&_&&e.jsx("div",{id:`${R}-helper`,className:"nice-field__helper",children:_})]}),h!=="right"&&o&&e.jsx("div",{id:`${R}-error`,className:"nice-field__error",role:"alert",children:o}),h!=="right"&&!o&&_&&e.jsx("div",{id:`${R}-helper`,className:"nice-field__helper",children:_})]})});_e.displayName="NiceCheckbox";const Ie=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:_e},Symbol.toStringTag,{value:"Module"})),me=u.forwardRef(({label:c,helperText:r,error:n,required:p,disabled:t,readOnly:i,size:d="md",name:x,id:g,className:S,style:y,accessMode:j,displayStyle:F,value:o,onChange:_,onBlur:M,onKeyDown:C,placeholder:A,min:m,max:h,step:s=1,precision:b,prefix:N,prefixType:L="label",prefixOptions:v,prefixValue:T,onPrefixChange:R,suffix:U,showStepper:D=!0,submitOnEnter:k,onSubmit:q,showKeyboardHints:J,labelPlacement:z,errorPlacement:E,loading:V,labelWidth:Q,controlWidth:I,formatPreset:K,format:X,suffixType:P="label",suffixOptions:$,suffixValue:ie,onSuffixChange:re,suffixSeparator:oe=!1,displayMode:ne},G)=>{const O=a.Dc(j,g),ue=O==="hidden";O==="disabled"&&(t=!0),O==="readOnly"&&(i=!0);const{t:Z}=a.Gt(),w=a.bc(g),ke=a.rc("input",F),Se=a.ac("input",F),[ee,xe]=u.useState(!1),[be,he]=u.useState(null),te=a.sc({enabled:ne,readOnly:i,disabled:t}),Ce=u.useMemo(()=>{let f=3;return h!=null&&(f=String(Math.abs(Math.floor(h))).length),m!=null&&m<0&&(f+=1),b&&(f+=b+1),Math.max(3,f)+1},[h,m,b]),Ne=u.useCallback(f=>{if(X)return X(f);if(!K)return b!=null?f.toFixed(b):String(f);switch(K){case"integer":return Math.round(f).toLocaleString();case"decimal":return f.toLocaleString(void 0,{minimumFractionDigits:b??2,maximumFractionDigits:b??2});case"money":return f.toLocaleString(void 0,{minimumFractionDigits:b??2,maximumFractionDigits:b??2,useGrouping:!0});case"percent":return(f*100).toLocaleString(void 0,{minimumFractionDigits:b??0,maximumFractionDigits:b??2})+"%";default:return String(f)}},[X,K,b]),se=u.useMemo(()=>ee&&be!==null?be:o==null?"":ee?b!=null?o.toFixed(b):String(o):Ne(o),[o,ee,be,Ne,b]),Ae=o!=null&&o<0,Te=!!(N||L==="select"&&v&&v.length>0),pe=Ae&&Te&&!ee,Re=pe?se.replace(/^[-−]/,""):se,ae=u.useCallback(f=>{let l=f;return m!==void 0&&(l=Math.max(m,l)),h!==void 0&&(l=Math.min(h,l)),b!==void 0&&(l=parseFloat(l.toFixed(b))),l},[m,h,b]),Fe=u.useCallback(f=>{const l=f.target.value;if(he(l),l===""||l==="-"||l==="."||l==="-."){l===""&&_?.(null);return}const B=parseFloat(l);if(!isNaN(B)){let H=B;m!==void 0&&(H=Math.max(m,H)),h!==void 0&&(H=Math.min(h,H)),_?.(H)}},[_,m,h]),le=u.useCallback(()=>{const f=fe.current,l=ae((f??0)+s);fe.current=l,_?.(l)},[s,_,ae]),de=u.useCallback(()=>{const f=fe.current,l=ae((f??0)-s);fe.current=l,_?.(l)},[s,_,ae]),fe=u.useRef(o);fe.current=o;const ce=u.useRef(null),W=u.useCallback(()=>{ce.current&&(clearTimeout(ce.current),ce.current=null)},[]),ve=u.useCallback(f=>{W();let l=300;const B=()=>{f(),l=Math.max(30,l*.82),ce.current=setTimeout(B,l)};ce.current=setTimeout(B,400)},[W]),je=a.Zc({enabled:k,onSubmit:q}),Le=u.useCallback(f=>{je(f),f.key==="ArrowUp"?(f.preventDefault(),le()):f.key==="ArrowDown"&&(f.preventDefault(),de()),C?.(f)},[je,C,le,de]),$e=u.useMemo(()=>{const f=[];return k&&f.push(a.Yc.submit),D&&(f.push({key:"ArrowUp",description:Z("shortcuts.increment","Increase value")}),f.push({key:"ArrowDown",description:Z("shortcuts.decrement","Decrease value")})),f},[k,D,Z]);return ue?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${z==="left"?"nice-field--label-left":""} ${V?"nice-field--loading":""} ${S||""}`,style:{...y,...Q!=null&&{"--nice-field-label-width":typeof Q=="number"?`${Q}px`:Q},...I!=null&&{"--nice-field-control-width":typeof I=="number"?`${I}px`:I}},"aria-busy":V||void 0,children:[c&&e.jsxs("label",{htmlFor:w,className:`nice-field__label ${p?"nice-field__label--required":""}`,children:[c,J&&$e.length>0&&e.jsx(a.ha,{shortcuts:$e,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[te.isDisplay?e.jsx(a.cc,{value:o==null?"":N?e.jsxs(e.Fragment,{children:[N,se]}):se,placeholder:A,disabled:t,readOnly:i,onActivate:te.enterEdit,ariaLabel:c}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${d} nice-input--ds-${Se} ${oe?"nice-input--suffix-sep":""} ${n?"nice-input--error":""} ${t?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:ke,children:[D&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:de,onMouseDown:()=>ve(de),onMouseUp:W,onMouseLeave:W,disabled:t,"aria-label":Z("controls.decrement","Decrement"),children:e.jsx(a.oa,{name:"minus",size:16})}),L==="select"&&v&&v.length>0?e.jsxs(e.Fragment,{children:[pe&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:T??v[0]?.value,disabled:t,onChange:f=>{const l=f.target.value,B=v.find(Y=>Y.value===(T??v[0]?.value)),H=v.find(Y=>Y.value===l);R?.(l,B?.weight,H?.weight)},children:v.map(f=>e.jsx("option",{value:f.value,children:f.label},f.value))})]}):N?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[pe&&e.jsx("span",{className:"nice-input__sign",children:"−"}),N]}):null,e.jsx("input",{ref:f=>{typeof G=="function"?G(f):G&&(G.current=f),te.autoFocusRef(f)},id:w,className:"nice-input__native",type:!ee&&(X||K)?"text":"number",name:x,value:Re,placeholder:A,min:m,max:h,step:s,disabled:t||V,readOnly:i,"aria-invalid":!!n,onChange:Fe,onFocus:f=>{xe(!0),he(null),f.target.select()},onBlur:f=>{if(xe(!1),he(null),o!=null&&b!==void 0){const l=parseFloat(o.toFixed(b));l!==o&&_?.(l)}ne&&te.exitEdit(),M?.(f)},onKeyDown:Le,style:{width:`${Ce}ch`}}),P==="select"&&$&&$.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:ie??$[0]?.value,disabled:t,onChange:f=>{const l=f.target.value,B=$.find(Y=>Y.value===(ie??$[0]?.value)),H=$.find(Y=>Y.value===l);re?.(l,B?.weight,H?.weight)},children:$.map(f=>e.jsx("option",{value:f.value,children:f.label},f.value))}):U?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:U}):null,D&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:le,onMouseDown:()=>ve(le),onMouseUp:W,onMouseLeave:W,disabled:t,"aria-label":Z("controls.increment","Increment"),children:e.jsx(a.oa,{name:"plus",size:16})})]})}),V&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),E==="right"&&n&&e.jsx("div",{className:"nice-field__error",role:"alert",children:n}),E==="right"&&!n&&r&&e.jsx("div",{className:"nice-field__helper",children:r})]}),E!=="right"&&n&&e.jsx("div",{className:"nice-field__error",role:"alert",children:n}),E!=="right"&&!n&&r&&e.jsx("div",{className:"nice-field__helper",children:r})]})});me.displayName="NiceNumberInput";const Ge=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:me},Symbol.toStringTag,{value:"Module"})),ge=u.forwardRef(({label:c,helperText:r,error:n,required:p,disabled:t,readOnly:i,size:d="md",name:x,id:g,className:S,style:y,accessMode:j,displayStyle:F,variant:o,value:_,defaultValue:M,onChange:C,onBlur:A,onKeyDown:m,placeholder:h,type:s="text",maxLength:b,prefix:N,suffix:L,clearable:v,autoFocus:T,submitOnEnter:R,onSubmit:U,showKeyboardHints:D,labelPlacement:k,errorPlacement:q,loading:J,labelWidth:z,controlWidth:E,displayMode:V,...Q},I)=>{const K=a.Dc(j,g),X=K==="hidden";K==="disabled"&&(t=!0),K==="readOnly"&&(i=!0);const{t:P}=a.Gt(),$=a.bc(g),ie=a.rc("input",F),re=a.ac("input",F),oe=o==="filled"?"filled":o==="underlined"?"underlined":"",ne=u.useCallback(()=>C?.(""),[C]),G=a.sc({enabled:V,readOnly:i,disabled:t}),O=a.Zc({enabled:R,onSubmit:U}),ue=u.useCallback(w=>{O(w),m?.(w)},[O,m]),Z=u.useMemo(()=>{const w=[];return R&&w.push({key:"Enter",description:P("shortcuts.submit","Submit")}),v&&w.push({key:"Escape",description:P("shortcuts.clear","Clear")}),w},[R,v,P]);return X?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${k==="left"?"nice-field--label-left":""} ${k==="inside"?"nice-field--label-inside":""} ${J?"nice-field--loading":""} ${S||""}`,style:{...y,...z!=null&&{"--nice-field-label-width":typeof z=="number"?`${z}px`:z},...E!=null&&{"--nice-field-control-width":typeof E=="number"?`${E}px`:E}},"aria-busy":J||void 0,"data-floating":k==="inside"&&_?"true":void 0,children:[c&&k!=="inside"&&e.jsxs("label",{htmlFor:$,className:`nice-field__label ${p?"nice-field__label--required":""}`,children:[c,D&&Z.length>0&&e.jsx(a.ha,{shortcuts:Z,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[G.isDisplay?e.jsx(a.cc,{value:_??M??"",placeholder:h,disabled:t,readOnly:i,onActivate:G.enterEdit,ariaLabel:c}):e.jsxs("div",{className:`nice-input nice-input--${d} nice-input--ds-${oe||re} ${n?"nice-input--error":""} ${t?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:o?void 0:ie,children:[N&&e.jsx("span",{className:"nice-input__icon",children:N}),e.jsx("input",{ref:w=>{typeof I=="function"?I(w):I&&(I.current=w),G.autoFocusRef(w)},id:$,className:"nice-input__native",type:s,name:x,value:_,defaultValue:M,placeholder:h,disabled:t||J,readOnly:i,maxLength:b,autoFocus:T,"aria-invalid":!!n,"aria-describedby":n?`${$}-error`:r?`${$}-helper`:void 0,onChange:w=>C?.(w.target.value),onBlur:w=>{V&&G.exitEdit(),A?.(w)},onKeyDown:ue,...Q}),v&&_&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:ne,"aria-label":P("controls.clear","Clear"),children:e.jsx(a.oa,{name:"close",size:14})}),L&&e.jsx("span",{className:"nice-input__icon",children:L}),c&&k==="inside"&&e.jsx("label",{htmlFor:$,className:`nice-input__floating-label ${p?"nice-input__floating-label--required":""}`,children:c})]}),J&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),q==="right"&&n&&e.jsx("div",{id:`${$}-error`,className:"nice-field__error",role:"alert",children:n}),q==="right"&&!n&&r&&e.jsx("div",{id:`${$}-helper`,className:"nice-field__helper",children:r})]}),q!=="right"&&n&&e.jsx("div",{id:`${$}-error`,className:"nice-field__error",role:"alert",children:n}),q!=="right"&&!n&&r&&e.jsx("div",{id:`${$}-helper`,className:"nice-field__helper",children:r})]})});ge.displayName="NiceTextInput";const Be=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:ge},Symbol.toStringTag,{value:"Module"})),ye=u.forwardRef(({label:c,checked:r=!1,onChange:n,disabled:p,readOnly:t,loading:i,required:d,size:x="md",name:g,id:S,className:y,style:j,accessMode:F,displayStyle:o,showKeyboardHints:_,error:M,helperText:C,labelPlacement:A,errorPlacement:m,labelWidth:h,controlWidth:s},b)=>{const N=a.Dc(F,S),L=N==="hidden";(N==="disabled"||N==="readOnly")&&(p=!0);const{t:v}=a.Gt(),T=a.bc(S);a.rc("toggle",o);const R=a.ac("toggle",o),U=u.useMemo(()=>[{key:"Space",description:v("shortcuts.toggle","Toggle on/off")}],[v]);return L?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${x} ${A==="left"?"nice-field--label-left":""} ${i?"nice-field--loading":""} ${y||""}`,style:{...j,...h!=null&&{"--nice-field-label-width":typeof h=="number"?`${h}px`:h},...s!=null&&{"--nice-field-control-width":typeof s=="number"?`${s}px`:s}},"aria-busy":i||void 0,children:[A==="left"&&c&&e.jsx("span",{className:`nice-field__label ${d?"nice-field__label--required":""}`,children:c}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${R} ${x!=="md"?`nice-toggle--${x}`:""} ${p||i?"nice-toggle--disabled":""}`,htmlFor:T,children:[e.jsx("input",{ref:b,id:T,type:"checkbox",className:"nice-toggle__input",name:g,checked:r,disabled:p||i,readOnly:t,role:"switch","aria-checked":r,"aria-invalid":!!M,onChange:D=>{t||i||n?.(D.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),A!=="left"&&c&&e.jsx("span",{children:c}),_&&e.jsx(a.ha,{shortcuts:U,size:"sm"})]}),i&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),m==="right"&&M&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:M}),m==="right"&&!M&&C&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:C})]}),m!=="right"&&M&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:M}),m!=="right"&&!M&&C&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:C})]})});ye.displayName="NiceToggle";const He=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"]}),we=["#cbd5e1","#94a3b8","#cbd5e1"];function Ue(c){return c?He[c.toUpperCase()]??we:we}const Ke=De.Flags3x2,Ze=({code:c,size:r=22,className:n})=>{const p=c?.toUpperCase(),t=p?Ke[p]:void 0,i=r,d=Math.round(r*2/3);return t?e.jsx("span",{className:n,role:"img","aria-label":`${p} flag`,style:{display:"inline-block",width:i,height:d,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:t.replace("<svg ",`<svg width="${i}" height="${d}" preserveAspectRatio="xMidYMid slice" `)}}):e.jsx(Me,{code:c,size:r,className:n})},Me=({code:c,size:r=18,className:n})=>{const p=Ue(c);return e.jsx("span",{className:n,role:"img","aria-label":`${c} flag`,style:{display:"inline-flex",width:r,height:Math.round(r*.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:p.map((t,i)=>e.jsx("span",{style:{flex:1,background:t}},i))})};function Ve(c,r,n,p=280){const[t,i]=u.useState(n==="left"?"left":"right"),d=u.useCallback(()=>{if(n!=="auto"){i(n);return}const x=r.current;if(!x||typeof window>"u")return;const g=x.getBoundingClientRect(),y=window.innerWidth-g.left,j=g.right;y>=p&&y>j?i("left"):i("right")},[n,r,p]);return u.useEffect(()=>{if(c)return d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}},[c,d]),t}const Ye=({colors:c,size:r=28,shape:n="page",className:p})=>{const t=r,i=Math.round(r*.75),d=c.border??"color-mix(in srgb, currentColor 30%, transparent)";if(n==="swatch"){const F=[c.primary,c.background,c.backgroundSecondary??c.background,c.textColor];return e.jsx("span",{className:p,role:"img","aria-label":"Theme preview",style:{display:"inline-flex",width:t,height:i,border:`1px solid ${d}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:F.map((o,_)=>e.jsx("span",{style:{flex:1,background:o}},_))})}const x=Math.max(2,Math.round(i*.22)),g=c.backgroundSecondary?Math.max(3,Math.round(t*.28)):0,S=Math.max(1,Math.round(i*.08)),y=Math.max(1,Math.round(i*.05)),j=Math.max(2,Math.round(t*.08));return e.jsxs("span",{className:p,role:"img","aria-label":"Theme preview",style:{position:"relative",display:"inline-block",width:t,height:i,boxSizing:"content-box",background:c.background,border:`1px solid ${d}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[e.jsx("span",{style:{position:"absolute",top:0,left:0,right:0,height:x,background:c.primary}}),g>0&&e.jsx("span",{style:{position:"absolute",top:x,left:0,bottom:0,width:g,background:c.backgroundSecondary}}),e.jsx("span",{style:{position:"absolute",top:x+y,left:g+j,right:j,height:S,background:c.textColor,opacity:.8,borderRadius:1}}),e.jsx("span",{style:{position:"absolute",top:x+y*2+S,left:g+j,width:`${Math.max(20,t-g-j*2-4)}px`,height:S,background:c.textColor,opacity:.5,borderRadius:1}})]})};exports.FlagIcon=Ze;exports.FlagSwatch=Me;exports.NiceCheckbox=_e;exports.NiceCheckbox$1=Ie;exports.NiceNumberInput=me;exports.NiceNumberInput$1=Ge;exports.NiceTabs=Ee;exports.NiceTextInput=ge;exports.NiceTextInput$1=Be;exports.NiceToggle=ye;exports.ThemePreviewSwatch=Ye;exports.useDropdownAlignment=Ve;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("./charts-NolNXKUL.cjs"),u=require("react"),De=require("./vendor-Bo2Q64AF.cjs"),Ee=({tabs:c,activeTab:r,onChange:n,variant:p="default",vertical:t,size:i="md",iconOnly:d=!1,centered:x="auto",countLocation:g="right",className:S,style:y,displayStyle:j})=>{const F=x==="auto"?d:x,o=a.rc("tab",j),_=a.ac("tab",j),[M,C]=u.useState(r||c[0]?.id),A=r??M,m=u.useCallback(s=>{C(s),n?.(s)},[n]),h=c.find(s=>s.id===A)?.content;return e.jsxs("div",{className:`nice-tabs nice-tabs--${i} ${t?"nice-tabs--vertical":""} ${d?"nice-tabs--icon-only":""} nice-tabs--ds-${_} ${S||""}`,style:{...o,...y},children:[e.jsx("div",{className:`nice-tabs__list ${p!=="default"?`nice-tabs__list--${p}`:""} ${t?"nice-tabs__list--vertical":""} ${F?"nice-tabs__list--centered":""}`,role:"tablist",children:c.map(s=>e.jsxs("button",{type:"button",role:"tab","aria-selected":A===s.id,"aria-label":d?s.label:void 0,title:d?s.label:void 0,className:`nice-tabs__tab ${A===s.id?"nice-tabs__tab--active":""} ${s.disabled?"nice-tabs__tab--disabled":""} ${g==="bottom"?"nice-tabs__tab--count-bottom":""}`,disabled:s.disabled,onClick:()=>m(s.id),children:[s.icon,!d&&e.jsx("span",{children:s.label}),s.badge!==void 0&&e.jsx("span",{className:`nice-tabs__badge${g==="bottom"?" nice-tabs__badge--pill":""}`,children:s.badge})]},s.id))}),e.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",children:h})]})},_e=u.forwardRef(({label:c,checked:r=!1,indeterminate:n=!1,onChange:p,disabled:t,readOnly:i,loading:d,required:x,size:g="md",name:S,id:y,className:j,style:F,error:o,helperText:_,accessMode:M,displayStyle:C,showKeyboardHints:A,labelPlacement:m,errorPlacement:h,labelWidth:s,controlWidth:b},N)=>{const L=a.Dc(M,y),v=L==="hidden";(L==="disabled"||L==="readOnly")&&(t=!0);const{t:T}=a.Gt(),R=a.bc(y);a.ac("toggle",C);const U=u.useMemo(()=>[{key:"Space",description:T("shortcuts.toggle","Toggle")}],[T]),D=u.useCallback(k=>{k&&(k.indeterminate=n),typeof N=="function"?N(k):N&&(N.current=k)},[n,N]);return v?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${g} ${m==="left"?"nice-field--label-left":""} ${h==="right"?"nice-field--error-right":""} ${d?"nice-field--loading":""} ${j||""}`,style:{...F,...s!=null&&{"--nice-field-label-width":typeof s=="number"?`${s}px`:s},...b!=null&&{"--nice-field-control-width":typeof b=="number"?`${b}px`:b}},"aria-busy":d||void 0,children:[m==="left"&&c&&e.jsx("span",{className:`nice-field__label ${x?"nice-field__label--required":""}`,children:c}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-checkbox ${g!=="md"?`nice-checkbox--${g}`:""} ${t||d?"nice-checkbox--disabled":""}`,htmlFor:R,children:[e.jsx("input",{ref:D,id:R,type:"checkbox",className:"nice-checkbox__input",name:S,checked:r,disabled:t||d,readOnly:i,"aria-invalid":!!o,onChange:k=>{i||d||p?.(k.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:r?e.jsx("polyline",{points:"2 6 5 9 10 3"}):e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"})})}),m!=="left"&&c&&e.jsx("span",{children:c}),A&&e.jsx(a.ha,{shortcuts:U,size:"sm"})]}),d&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),h==="right"&&o&&e.jsx("div",{id:`${R}-error`,className:"nice-field__error",role:"alert",children:o}),h==="right"&&!o&&_&&e.jsx("div",{id:`${R}-helper`,className:"nice-field__helper",children:_})]}),h!=="right"&&o&&e.jsx("div",{id:`${R}-error`,className:"nice-field__error",role:"alert",children:o}),h!=="right"&&!o&&_&&e.jsx("div",{id:`${R}-helper`,className:"nice-field__helper",children:_})]})});_e.displayName="NiceCheckbox";const Ie=Object.freeze(Object.defineProperty({__proto__:null,NiceCheckbox:_e},Symbol.toStringTag,{value:"Module"})),me=u.forwardRef(({label:c,helperText:r,error:n,required:p,disabled:t,readOnly:i,size:d="md",name:x,id:g,className:S,style:y,accessMode:j,displayStyle:F,value:o,onChange:_,onBlur:M,onKeyDown:C,placeholder:A,min:m,max:h,step:s=1,precision:b,prefix:N,prefixType:L="label",prefixOptions:v,prefixValue:T,onPrefixChange:R,suffix:U,showStepper:D=!0,submitOnEnter:k,onSubmit:q,showKeyboardHints:J,labelPlacement:z,errorPlacement:E,loading:V,labelWidth:Q,controlWidth:I,formatPreset:K,format:X,suffixType:P="label",suffixOptions:$,suffixValue:ie,onSuffixChange:re,suffixSeparator:oe=!1,displayMode:ne},G)=>{const O=a.Dc(j,g),ue=O==="hidden";O==="disabled"&&(t=!0),O==="readOnly"&&(i=!0);const{t:Z}=a.Gt(),w=a.bc(g),ke=a.rc("input",F),Se=a.ac("input",F),[ee,xe]=u.useState(!1),[be,he]=u.useState(null),te=a.sc({enabled:ne,readOnly:i,disabled:t}),Ce=u.useMemo(()=>{let f=3;return h!=null&&(f=String(Math.abs(Math.floor(h))).length),m!=null&&m<0&&(f+=1),b&&(f+=b+1),Math.max(3,f)+1},[h,m,b]),Ne=u.useCallback(f=>{if(X)return X(f);if(!K)return b!=null?f.toFixed(b):String(f);switch(K){case"integer":return Math.round(f).toLocaleString();case"decimal":return f.toLocaleString(void 0,{minimumFractionDigits:b??2,maximumFractionDigits:b??2});case"money":return f.toLocaleString(void 0,{minimumFractionDigits:b??2,maximumFractionDigits:b??2,useGrouping:!0});case"percent":return(f*100).toLocaleString(void 0,{minimumFractionDigits:b??0,maximumFractionDigits:b??2})+"%";default:return String(f)}},[X,K,b]),se=u.useMemo(()=>ee&&be!==null?be:o==null?"":ee?b!=null?o.toFixed(b):String(o):Ne(o),[o,ee,be,Ne,b]),Ae=o!=null&&o<0,Te=!!(N||L==="select"&&v&&v.length>0),pe=Ae&&Te&&!ee,Re=pe?se.replace(/^[-−]/,""):se,ae=u.useCallback(f=>{let l=f;return m!==void 0&&(l=Math.max(m,l)),h!==void 0&&(l=Math.min(h,l)),b!==void 0&&(l=parseFloat(l.toFixed(b))),l},[m,h,b]),Fe=u.useCallback(f=>{const l=f.target.value;if(he(l),l===""||l==="-"||l==="."||l==="-."){l===""&&_?.(null);return}const B=parseFloat(l);if(!isNaN(B)){let H=B;m!==void 0&&(H=Math.max(m,H)),h!==void 0&&(H=Math.min(h,H)),_?.(H)}},[_,m,h]),le=u.useCallback(()=>{const f=fe.current,l=ae((f??0)+s);fe.current=l,_?.(l)},[s,_,ae]),de=u.useCallback(()=>{const f=fe.current,l=ae((f??0)-s);fe.current=l,_?.(l)},[s,_,ae]),fe=u.useRef(o);fe.current=o;const ce=u.useRef(null),W=u.useCallback(()=>{ce.current&&(clearTimeout(ce.current),ce.current=null)},[]),ve=u.useCallback(f=>{W();let l=300;const B=()=>{f(),l=Math.max(30,l*.82),ce.current=setTimeout(B,l)};ce.current=setTimeout(B,400)},[W]),je=a.Zc({enabled:k,onSubmit:q}),Le=u.useCallback(f=>{je(f),f.key==="ArrowUp"?(f.preventDefault(),le()):f.key==="ArrowDown"&&(f.preventDefault(),de()),C?.(f)},[je,C,le,de]),$e=u.useMemo(()=>{const f=[];return k&&f.push(a.Yc.submit),D&&(f.push({key:"ArrowUp",description:Z("shortcuts.increment","Increase value")}),f.push({key:"ArrowDown",description:Z("shortcuts.decrement","Decrease value")})),f},[k,D,Z]);return ue?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${z==="left"?"nice-field--label-left":""} ${V?"nice-field--loading":""} ${S||""}`,style:{...y,...Q!=null&&{"--nice-field-label-width":typeof Q=="number"?`${Q}px`:Q},...I!=null&&{"--nice-field-control-width":typeof I=="number"?`${I}px`:I}},"aria-busy":V||void 0,children:[c&&e.jsxs("label",{htmlFor:w,className:`nice-field__label ${p?"nice-field__label--required":""}`,children:[c,J&&$e.length>0&&e.jsx(a.ha,{shortcuts:$e,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[te.isDisplay?e.jsx(a.cc,{value:o==null?"":N?e.jsxs(e.Fragment,{children:[N,se]}):se,placeholder:A,disabled:t,readOnly:i,onActivate:te.enterEdit,ariaLabel:c}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:`nice-input nice-input--number nice-input--${d} nice-input--ds-${Se} ${oe?"nice-input--suffix-sep":""} ${n?"nice-input--error":""} ${t?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:ke,children:[D&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__minus",onClick:de,onMouseDown:()=>ve(de),onMouseUp:W,onMouseLeave:W,disabled:t,"aria-label":Z("controls.decrement","Decrement"),children:e.jsx(a.oa,{name:"minus",size:16})}),L==="select"&&v&&v.length>0?e.jsxs(e.Fragment,{children:[pe&&e.jsx("span",{className:"nice-input__sign",children:"−"}),e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--prefix",value:T??v[0]?.value,disabled:t,onChange:f=>{const l=f.target.value,B=v.find(Y=>Y.value===(T??v[0]?.value)),H=v.find(Y=>Y.value===l);R?.(l,B?.weight,H?.weight)},children:v.map(f=>e.jsx("option",{value:f.value,children:f.label},f.value))})]}):N?e.jsxs("span",{className:"nice-input__icon nice-input__icon--prefix",children:[pe&&e.jsx("span",{className:"nice-input__sign",children:"−"}),N]}):null,e.jsx("input",{ref:f=>{typeof G=="function"?G(f):G&&(G.current=f),te.autoFocusRef(f)},id:w,className:"nice-input__native",type:!ee&&(X||K)?"text":"number",name:x,value:Re,placeholder:A,min:m,max:h,step:s,disabled:t||V,readOnly:i,"aria-invalid":!!n,onChange:Fe,onFocus:f=>{xe(!0),he(null),f.target.select()},onBlur:f=>{if(xe(!1),he(null),o!=null&&b!==void 0){const l=parseFloat(o.toFixed(b));l!==o&&_?.(l)}ne&&te.exitEdit(),M?.(f)},onKeyDown:Le,style:{width:`${Ce}ch`}}),P==="select"&&$&&$.length>0?e.jsx("select",{className:"nice-input__suffix-select nice-input__icon--suffix",value:ie??$[0]?.value,disabled:t,onChange:f=>{const l=f.target.value,B=$.find(Y=>Y.value===(ie??$[0]?.value)),H=$.find(Y=>Y.value===l);re?.(l,B?.weight,H?.weight)},children:$.map(f=>e.jsx("option",{value:f.value,children:f.label},f.value))}):U?e.jsx("span",{className:"nice-input__icon nice-input__icon--suffix",children:U}):null,D&&!i&&e.jsx("button",{type:"button",className:"nice-input__clear nice-input__plus",onClick:le,onMouseDown:()=>ve(le),onMouseUp:W,onMouseLeave:W,disabled:t,"aria-label":Z("controls.increment","Increment"),children:e.jsx(a.oa,{name:"plus",size:16})})]})}),V&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),E==="right"&&n&&e.jsx("div",{className:"nice-field__error",role:"alert",children:n}),E==="right"&&!n&&r&&e.jsx("div",{className:"nice-field__helper",children:r})]}),E!=="right"&&n&&e.jsx("div",{className:"nice-field__error",role:"alert",children:n}),E!=="right"&&!n&&r&&e.jsx("div",{className:"nice-field__helper",children:r})]})});me.displayName="NiceNumberInput";const Ge=Object.freeze(Object.defineProperty({__proto__:null,NiceNumberInput:me},Symbol.toStringTag,{value:"Module"})),ge=u.forwardRef(({label:c,helperText:r,error:n,required:p,disabled:t,readOnly:i,size:d="md",name:x,id:g,className:S,style:y,accessMode:j,displayStyle:F,variant:o,value:_,defaultValue:M,onChange:C,onBlur:A,onKeyDown:m,placeholder:h,type:s="text",maxLength:b,prefix:N,suffix:L,clearable:v,autoFocus:T,submitOnEnter:R,onSubmit:U,showKeyboardHints:D,labelPlacement:k,errorPlacement:q,loading:J,labelWidth:z,controlWidth:E,displayMode:V,...Q},I)=>{const K=a.Dc(j,g),X=K==="hidden";K==="disabled"&&(t=!0),K==="readOnly"&&(i=!0);const{t:P}=a.Gt(),$=a.bc(g),ie=a.rc("input",F),re=a.ac("input",F),oe=o==="filled"?"filled":o==="underlined"?"underlined":"",ne=u.useCallback(()=>C?.(""),[C]),G=a.sc({enabled:V,readOnly:i,disabled:t}),O=a.Zc({enabled:R,onSubmit:U}),ue=u.useCallback(w=>{O(w),m?.(w)},[O,m]),Z=u.useMemo(()=>{const w=[];return R&&w.push({key:"Enter",description:P("shortcuts.submit","Submit")}),v&&w.push({key:"Escape",description:P("shortcuts.clear","Clear")}),w},[R,v,P]);return X?null:e.jsxs("div",{className:`nice-field nice-field--${d} ${k==="left"?"nice-field--label-left":""} ${k==="inside"?"nice-field--label-inside":""} ${J?"nice-field--loading":""} ${S||""}`,style:{...y,...z!=null&&{"--nice-field-label-width":typeof z=="number"?`${z}px`:z},...E!=null&&{"--nice-field-control-width":typeof E=="number"?`${E}px`:E}},"aria-busy":J||void 0,"data-floating":k==="inside"&&_?"true":void 0,children:[c&&k!=="inside"&&e.jsxs("label",{htmlFor:$,className:`nice-field__label ${p?"nice-field__label--required":""}`,children:[c,D&&Z.length>0&&e.jsx(a.ha,{shortcuts:Z,size:"sm"})]}),e.jsxs("div",{className:"nice-field__control",children:[G.isDisplay?e.jsx(a.cc,{value:_??M??"",placeholder:h,disabled:t,readOnly:i,onActivate:G.enterEdit,ariaLabel:c}):e.jsxs("div",{className:`nice-input nice-input--${d} nice-input--ds-${oe||re} ${n?"nice-input--error":""} ${t?"nice-input--disabled":""} ${i?"nice-input--readonly":""}`,style:o?void 0:ie,children:[N&&e.jsx("span",{className:"nice-input__icon",children:N}),e.jsx("input",{ref:w=>{typeof I=="function"?I(w):I&&(I.current=w),G.autoFocusRef(w)},id:$,className:"nice-input__native",type:s,name:x,value:_,defaultValue:M,placeholder:h,disabled:t||J,readOnly:i,maxLength:b,autoFocus:T,"aria-invalid":!!n,"aria-describedby":n?`${$}-error`:r?`${$}-helper`:void 0,onChange:w=>C?.(w.target.value),onBlur:w=>{V&&G.exitEdit(),A?.(w)},onKeyDown:ue,...Q}),v&&_&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:ne,"aria-label":P("controls.clear","Clear"),children:e.jsx(a.oa,{name:"close",size:14})}),L&&e.jsx("span",{className:"nice-input__icon",children:L}),c&&k==="inside"&&e.jsx("label",{htmlFor:$,className:`nice-input__floating-label ${p?"nice-input__floating-label--required":""}`,children:c})]}),J&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),q==="right"&&n&&e.jsx("div",{id:`${$}-error`,className:"nice-field__error",role:"alert",children:n}),q==="right"&&!n&&r&&e.jsx("div",{id:`${$}-helper`,className:"nice-field__helper",children:r})]}),q!=="right"&&n&&e.jsx("div",{id:`${$}-error`,className:"nice-field__error",role:"alert",children:n}),q!=="right"&&!n&&r&&e.jsx("div",{id:`${$}-helper`,className:"nice-field__helper",children:r})]})});ge.displayName="NiceTextInput";const Be=Object.freeze(Object.defineProperty({__proto__:null,NiceTextInput:ge},Symbol.toStringTag,{value:"Module"})),ye=u.forwardRef(({label:c,checked:r=!1,onChange:n,disabled:p,readOnly:t,loading:i,required:d,size:x="md",name:g,id:S,className:y,style:j,accessMode:F,displayStyle:o,showKeyboardHints:_,error:M,helperText:C,labelPlacement:A,errorPlacement:m,labelWidth:h,controlWidth:s},b)=>{const N=a.Dc(F,S),L=N==="hidden";(N==="disabled"||N==="readOnly")&&(p=!0);const{t:v}=a.Gt(),T=a.bc(S);a.rc("toggle",o);const R=a.ac("toggle",o),U=u.useMemo(()=>[{key:"Space",description:v("shortcuts.toggle","Toggle on/off")}],[v]);return L?null:e.jsxs("div",{className:`nice-field nice-field--inline nice-field--${x} ${A==="left"?"nice-field--label-left":""} ${i?"nice-field--loading":""} ${y||""}`,style:{...j,...h!=null&&{"--nice-field-label-width":typeof h=="number"?`${h}px`:h},...s!=null&&{"--nice-field-control-width":typeof s=="number"?`${s}px`:s}},"aria-busy":i||void 0,children:[A==="left"&&c&&e.jsx("span",{className:`nice-field__label ${d?"nice-field__label--required":""}`,children:c}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${R} ${x!=="md"?`nice-toggle--${x}`:""} ${p||i?"nice-toggle--disabled":""}`,htmlFor:T,children:[e.jsx("input",{ref:b,id:T,type:"checkbox",className:"nice-toggle__input",name:g,checked:r,disabled:p||i,readOnly:t,role:"switch","aria-checked":r,"aria-invalid":!!M,onChange:D=>{t||i||n?.(D.target.checked)}}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),A!=="left"&&c&&e.jsx("span",{children:c}),_&&e.jsx(a.ha,{shortcuts:U,size:"sm"})]}),i&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),m==="right"&&M&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:M}),m==="right"&&!M&&C&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:C})]}),m!=="right"&&M&&e.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:M}),m!=="right"&&!M&&C&&e.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:C})]})});ye.displayName="NiceToggle";const He=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"]}),we=["#cbd5e1","#94a3b8","#cbd5e1"];function Ue(c){return c?He[c.toUpperCase()]??we:we}const Ke=De.Flags3x2,Ze=({code:c,size:r=22,className:n})=>{const p=c?.toUpperCase(),t=p?Ke[p]:void 0,i=r,d=Math.round(r*2/3);return t?e.jsx("span",{className:n,role:"img","aria-label":`${p} flag`,style:{display:"inline-block",width:i,height:d,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:t.replace("<svg ",`<svg width="${i}" height="${d}" preserveAspectRatio="xMidYMid slice" `)}}):e.jsx(Me,{code:c,size:r,className:n})},Me=({code:c,size:r=18,className:n})=>{const p=Ue(c);return e.jsx("span",{className:n,role:"img","aria-label":`${c} flag`,style:{display:"inline-flex",width:r,height:Math.round(r*.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:p.map((t,i)=>e.jsx("span",{style:{flex:1,background:t}},i))})};function Ve(c,r,n,p=280){const[t,i]=u.useState(n==="left"?"left":"right"),d=u.useCallback(()=>{if(n!=="auto"){i(n);return}const x=r.current;if(!x||typeof window>"u")return;const g=x.getBoundingClientRect(),y=window.innerWidth-g.left,j=g.right;y>=p&&y>j?i("left"):i("right")},[n,r,p]);return u.useEffect(()=>{if(c)return d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}},[c,d]),t}const Ye=({colors:c,size:r=28,shape:n="page",className:p})=>{const t=r,i=Math.round(r*.75),d=c.border??"color-mix(in srgb, currentColor 30%, transparent)";if(n==="swatch"){const F=[c.primary,c.background,c.backgroundSecondary??c.background,c.textColor];return e.jsx("span",{className:p,role:"img","aria-label":"Theme preview",style:{display:"inline-flex",width:t,height:i,border:`1px solid ${d}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:F.map((o,_)=>e.jsx("span",{style:{flex:1,background:o}},_))})}const x=Math.max(2,Math.round(i*.22)),g=c.backgroundSecondary?Math.max(3,Math.round(t*.28)):0,S=Math.max(1,Math.round(i*.08)),y=Math.max(1,Math.round(i*.05)),j=Math.max(2,Math.round(t*.08));return e.jsxs("span",{className:p,role:"img","aria-label":"Theme preview",style:{position:"relative",display:"inline-block",width:t,height:i,boxSizing:"content-box",background:c.background,border:`1px solid ${d}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[e.jsx("span",{style:{position:"absolute",top:0,left:0,right:0,height:x,background:c.primary}}),g>0&&e.jsx("span",{style:{position:"absolute",top:x,left:0,bottom:0,width:g,background:c.backgroundSecondary}}),e.jsx("span",{style:{position:"absolute",top:x+y,left:g+j,right:j,height:S,background:c.textColor,opacity:.8,borderRadius:1}}),e.jsx("span",{style:{position:"absolute",top:x+y*2+S,left:g+j,width:`${Math.max(20,t-g-j*2-4)}px`,height:S,background:c.textColor,opacity:.5,borderRadius:1}})]})};exports.FlagIcon=Ze;exports.FlagSwatch=Me;exports.NiceCheckbox=_e;exports.NiceCheckbox$1=Ie;exports.NiceNumberInput=me;exports.NiceNumberInput$1=Ge;exports.NiceTabs=Ee;exports.NiceTextInput=ge;exports.NiceTextInput$1=Be;exports.NiceToggle=ye;exports.ThemePreviewSwatch=Ye;exports.useDropdownAlignment=Ve;
|