@nice2dev/ui 1.3.0 → 1.3.1

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./NiceModuleLifecyclePanel-D8EoXqBy.cjs"),e=require("react/jsx-runtime"),c=require("@nice2dev/ui-core"),a=require("react"),z=require("./pickerCommons-DvQptSPX.cjs"),K=require("./NicePagination-D_3GfWp5.cjs"),E=[],W=Object.assign(a.forwardRef(({items:p=E,activeKey:f,collapsed:l=!1,width:x=240,collapsedWidth:u=52,onItemClick:y,onCollapseChange:A,header:g,footer:b,size:_="md",className:R,style:$,id:S,accessMode:C,...D},m)=>{const j=c.useControlId(S),M=c.useNiceAccessMode(C,S),[k,h]=a.useState(new Set),i=a.useCallback(n=>{h(t=>{const o=new Set(t);return o.has(n)?o.delete(n):o.add(n),o})},[]);if(M==="hidden")return null;const d=(n,t=0)=>{const o=n.children&&n.children.length>0,r=k.has(n.key),N=n.key===f;return e.jsxs("li",{className:"nice-sidebar-menu__item",children:[e.jsxs("button",{className:`nice-sidebar-menu__btn ${N?"nice-sidebar-menu__btn--active":""} ${n.disabled?"nice-sidebar-menu__btn--disabled":""}`,style:{paddingLeft:l?void 0:12+t*16},onClick:()=>o?i(n.key):y?.(n),disabled:n.disabled,title:l?n.text:void 0,type:"button",children:[n.icon&&e.jsx("span",{className:"nice-sidebar-menu__icon",children:n.icon}),!l&&e.jsx("span",{className:"nice-sidebar-menu__label",children:n.text}),!l&&n.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-menu__badge",children:n.badge}),!l&&o&&e.jsx("span",{className:"nice-sidebar-menu__chevron",children:e.jsx(c.NiceIcon,{name:r?"chevron-down":"chevron-right",size:14})})]}),o&&r&&!l&&e.jsx("ul",{className:"nice-sidebar-menu__children",children:n.children.map(I=>d(I,t+1))})]},n.key)};return e.jsxs("nav",{ref:m,id:j,className:`nice-sidebar-menu nice-sidebar-menu--${_} ${l?"nice-sidebar-menu--collapsed":""} ${R??""}`,style:{...$,width:l?u:x},...D,children:[g&&e.jsx("div",{className:"nice-sidebar-menu__header",children:g}),e.jsx("ul",{className:"nice-sidebar-menu__list",role:"list",children:p.map(n=>d(n))}),b&&e.jsx("div",{className:"nice-sidebar-menu__footer",children:b})]})}),{displayName:"NiceSidebarMenu"}),q=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,brand:x,actions:u,size:y="md",className:A,style:g,id:b,accessMode:_,...R},$)=>{const S=c.useControlId(b),C=c.useNiceAccessMode(_,b),[D,m]=a.useState(null),[j,M]=a.useState(!1),k=a.useRef(null),h=a.useRef(null);c.useRovingFocus(k,{orientation:"horizontal",wrap:!0,typeahead:!0}),c.useRovingFocus(h,{orientation:"vertical",wrap:!0,typeahead:!0}),c.useOverlayFocus(h,{open:D!=null&&!j,modal:!1,onClose:()=>m(null)});const i=n=>{M(!1),m(n)},d=n=>{if(n.key!=="ArrowLeft"&&n.key!=="ArrowRight")return;n.preventDefault();const t=[...k.current?.querySelectorAll(".nice-top-menu__btn")??[]],o=t.findIndex(N=>N.getAttribute("aria-expanded")==="true"),r=t[(o+(n.key==="ArrowRight"?1:-1)+t.length)%t.length];m(null),r?.focus()};return C==="hidden"?null:e.jsxs("nav",{ref:$,id:S,className:`nice-top-menu nice-top-menu--${y} ${A??""}`,style:g,...R,children:[x&&e.jsx("div",{className:"nice-top-menu__brand",children:x}),e.jsx("ul",{className:"nice-top-menu__items",role:"menubar",ref:k,children:p.map(n=>{const t=n.children&&n.children.length>0,o=D===n.key;return e.jsxs("li",{className:"nice-top-menu__item",onMouseEnter:()=>{t&&(M(!0),m(n.key))},onMouseLeave:()=>t&&m(null),children:[e.jsxs("button",{className:`nice-top-menu__btn ${n.key===f?"nice-top-menu__btn--active":""}`,onClick:()=>t?o?m(null):i(n.key):l?.(n),onKeyDown:r=>{const N=r.nativeEvent.niceSource;t&&r.key==="ArrowDown"&&N!=="gamepad"&&(r.preventDefault(),i(n.key))},role:"menuitem","aria-haspopup":t,"aria-expanded":o,disabled:n.disabled,type:"button",children:[n.icon&&e.jsx("span",{children:n.icon}),e.jsx("span",{children:n.text}),t&&e.jsx("span",{className:"nice-top-menu__chevron",children:e.jsx(c.NiceIcon,{name:"chevron-down",size:14})})]}),t&&o&&e.jsx("ul",{className:"nice-top-menu__dropdown",role:"menu",ref:h,onKeyDown:d,children:n.children.map(r=>e.jsx("li",{children:e.jsxs("button",{className:`nice-top-menu__dropdown-btn ${r.key===f?"nice-top-menu__dropdown-btn--active":""}`,onClick:()=>{l?.(r),m(null)},disabled:r.disabled,role:"menuitem",type:"button",children:[r.icon&&e.jsx("span",{children:r.icon}),e.jsx("span",{children:r.text}),r.badge!==void 0&&e.jsx("span",{className:"nice-top-menu__badge",children:r.badge})]})},r.key))})]},n.key)})}),u&&e.jsx("div",{className:"nice-top-menu__actions",children:u})]})}),{displayName:"NiceTopMenu"}),H=[],U=Object.assign(a.forwardRef(({tabs:p=H,activeTab:f,onTabChange:l,onItemClick:x,minimized:u=!1,onMinimizeToggle:y,size:A="md",className:g,style:b,id:_,accessMode:R,...$},S)=>{const C=a.useRef(null);c.useRovingFocus(C,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const D=c.useControlId(_),m=c.useNiceAccessMode(R,_),{t:j}=c.useNiceTranslation(),[M,k]=a.useState(void 0),h=f??M??p[0]?.key,i=p.find(n=>n.key===h),d=a.useCallback(n=>{k(n),l?.(n)},[l]);return m==="hidden"?null:e.jsxs("div",{ref:S,id:D,className:`nice-ribbon-menu nice-ribbon-menu--${A} ${u?"nice-ribbon-menu--minimized":""} ${g??""}`,style:b,...$,children:[e.jsxs("div",{className:"nice-ribbon-menu__tabs",ref:C,role:"tablist",children:[p.map(n=>e.jsx("button",{className:`nice-ribbon-menu__tab ${n.key===h?"nice-ribbon-menu__tab--active":""}`,onClick:()=>d(n.key),role:"tab","aria-selected":n.key===h,type:"button",children:n.label},n.key)),e.jsx("button",{className:"nice-ribbon-menu__minimize",onClick:()=>y?.(!u),type:"button","aria-label":u?j("nav.expand","Expand"):j("nav.collapse","Collapse"),children:e.jsx(c.NiceIcon,{name:u?"chevron-down":"chevron-up",size:14})})]}),!u&&i&&e.jsx("div",{className:"nice-ribbon-menu__panel",role:"tabpanel",children:i.groups.map((n,t)=>e.jsxs("div",{className:"nice-ribbon-menu__group",children:[e.jsx("div",{className:"nice-ribbon-menu__group-items",children:n.items.map(o=>e.jsxs("button",{className:"nice-ribbon-menu__item",onClick:()=>x?.(o),disabled:o.disabled,type:"button",children:[o.icon&&e.jsx("span",{className:"nice-ribbon-menu__item-icon",children:o.icon}),e.jsx("span",{className:"nice-ribbon-menu__item-label",children:o.text})]},o.key))}),e.jsx("div",{className:"nice-ribbon-menu__group-label",children:n.label})]},t))})]})}),{displayName:"NiceRibbonMenu"}),V=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,position:x="bottom",autoHide:u=!1,iconSize:y=40,size:A="md",className:g,style:b,id:_,accessMode:R,...$},S)=>{const C=c.useControlId(_),D=c.useNiceAccessMode(R,_),[m,j]=a.useState(!1),[M,k]=a.useState(!1),h=!u||m||M;return D==="hidden"?null:e.jsx("div",{ref:S,id:C,className:`nice-dock-menu nice-dock-menu--${x} nice-dock-menu--${A} ${u&&!h?"nice-dock-menu--hidden":""} ${g??""}`,style:b,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),onFocus:()=>k(!0),onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||k(!1)},...$,children:e.jsx("div",{className:"nice-dock-menu__items",children:p.map(i=>e.jsxs("button",{className:`nice-dock-menu__item ${i.key===f?"nice-dock-menu__item--active":""}`,onClick:()=>l?.(i),disabled:i.disabled,title:i.text,"aria-label":i.text,type:"button",style:{width:y,height:y},children:[i.icon?e.jsx("span",{className:"nice-dock-menu__icon",children:i.icon}):e.jsx("span",{children:i.text[0]}),i.badge!==void 0&&e.jsx("span",{className:"nice-dock-menu__badge",children:i.badge})]},i.key))})})}),{displayName:"NiceDockMenu"}),Y=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,open:x,onOpenChange:u,position:y="left",panelWidth:A=280,header:g,footer:b,size:_="md",className:R,style:$,id:S,accessMode:C,...D},m)=>{const j=c.useControlId(S),M=c.useNiceAccessMode(C,S),{t:k}=c.useNiceTranslation(),[h,i]=a.useState(!1),d=x??h,n=a.useCallback(v=>{i(v),u?.(v)},[u]),t=a.useCallback(()=>n(!d),[d,n]),o=a.useCallback(v=>{l?.(v),n(!1)},[l,n]),r=a.useRef(null),N=a.useRef(null),I=a.useRef(null);return a.useLayoutEffect(()=>{I.current?.toggleAttribute("inert",!d)},[d]),c.useMenuButton(r,N,{open:d,onOpenChange:n,closeOnFocusOut:!1,closeOnOutsidePress:!1}),M==="hidden"?null:e.jsxs("div",{ref:m,id:j,className:`nice-hamburger-menu nice-hamburger-menu--${_} ${R??""}`,style:$,...D,children:[e.jsx("button",{ref:r,className:"nice-hamburger-menu__trigger",onClick:t,"aria-label":k("nav.menu","Menu"),"aria-haspopup":"menu","aria-expanded":d,type:"button",children:e.jsxs("span",{className:`nice-hamburger-menu__icon ${d?"nice-hamburger-menu__icon--open":""}`,children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}),d&&e.jsx("div",{className:"nice-hamburger-menu__backdrop",onClick:t,"aria-hidden":!0}),e.jsxs("div",{ref:I,className:`nice-hamburger-menu__panel nice-hamburger-menu__panel--${y} ${d?"nice-hamburger-menu__panel--open":""}`,style:{width:A},children:[g&&e.jsx("div",{className:"nice-hamburger-menu__header",children:g}),e.jsx("ul",{className:"nice-hamburger-menu__list",role:"menu",ref:N,children:p.map(v=>e.jsx("li",{children:e.jsxs("button",{className:`nice-hamburger-menu__item ${v.key===f?"nice-hamburger-menu__item--active":""}`,onClick:()=>o(v),disabled:v.disabled,role:"menuitem",type:"button",children:[v.icon&&e.jsx("span",{className:"nice-hamburger-menu__item-icon",children:v.icon}),e.jsx("span",{children:v.text}),v.badge!==void 0&&e.jsx("span",{className:"nice-hamburger-menu__item-badge",children:v.badge})]})},v.key))}),b&&e.jsx("div",{className:"nice-hamburger-menu__footer",children:b})]})]})}),{displayName:"NiceHamburgerMenu"}),J=Object.assign(a.forwardRef(({canGoBack:p=!1,canGoForward:f=!1,onBack:l,onForward:x,onRefresh:u,enableShortcuts:y=!0,showRefresh:A=!0,showStop:g=!0,isLoading:b=!1,onStop:_,size:R="md",variant:$="default",tooltipPosition:S="bottom",backIcon:C,forwardIcon:D,refreshIcon:m,stopIcon:j,className:M,style:k,id:h,accessMode:i,disabled:d,...n},t)=>{const o=c.useControlId(h),r=c.useNiceAccessMode(i,h),{t:N}=c.useNiceTranslation();if(a.useEffect(()=>{if(!y||d)return;const T=w=>{const O=w.altKey,B=w.ctrlKey||w.metaKey;O&&w.key==="ArrowLeft"?(w.preventDefault(),p&&l?.()):O&&w.key==="ArrowRight"?(w.preventDefault(),f&&x?.()):w.key==="F5"||B&&w.key==="r"?(w.preventDefault(),b?_?.():u?.()):w.key==="Escape"&&b&&(w.preventDefault(),_?.())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[y,d,p,f,b,l,x,u,_]),r==="hidden")return null;const I=r==="disabled"||d,v=C??e.jsx(c.NiceIcon,{name:"chevron-left",size:16}),P=D??e.jsx(c.NiceIcon,{name:"chevron-right",size:16}),F=m??e.jsx(c.NiceIcon,{name:"refresh",size:16}),L=j??e.jsx(c.NiceIcon,{name:"close",size:16});return e.jsxs("div",{ref:t,id:o,className:`nice-nav-controls nice-nav-controls--${R} nice-nav-controls--${$}${I?" nice-nav-controls--disabled":""}${M?` ${M}`:""}`,style:k,role:"navigation","aria-label":N("nav.controls","Navigation controls"),...n,children:[e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--back${p?"":" nice-nav-controls__btn--disabled"}`,onClick:l,disabled:I||!p,"aria-label":N("nav.back","Back"),title:`${N("nav.back","Back")} (Alt+←)`,children:v}),e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--forward${f?"":" nice-nav-controls__btn--disabled"}`,onClick:x,disabled:I||!f,"aria-label":N("nav.forward","Forward"),title:`${N("nav.forward","Forward")} (Alt+→)`,children:P}),(A||g&&b)&&(b?e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--stop nice-nav-controls__btn--loading",onClick:_,disabled:I,"aria-label":N("nav.stop","Stop"),title:`${N("nav.stop","Stop")} (Esc)`,children:L}):e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--refresh",onClick:u,disabled:I,"aria-label":N("nav.refresh","Refresh"),title:`${N("nav.refresh","Refresh")} (F5)`,children:F}))]})}),{displayName:"NiceNavigationControls"});exports.DEFAULT_SIDEBAR_PREFS=s.DEFAULT_SIDEBAR_PREFS;exports.DesktopContextMenu=s.DesktopContextMenu;exports.DesktopGrid=s.DesktopGrid;exports.DesktopStartMenu=s.DesktopStartMenu;exports.DesktopSystemTray=s.DesktopSystemTray;exports.DesktopTaskbar=s.DesktopTaskbar;exports.NiceAccordion=s.NiceAccordion;exports.NiceAppLayout=s.NiceAppLayout;exports.NiceAuthButtons=s.NiceAuthButtons;exports.NiceBreadcrumb=s.NiceBreadcrumb;exports.NiceCard=s.NiceCard;exports.NiceConsole=s.NiceConsole;exports.NiceContextMenu=s.NiceContextMenu;exports.NiceDashboardLayout=s.NiceDashboardLayout;exports.NiceDashboardShell=s.NiceDashboardShell;exports.NiceDesktop=s.NiceDesktop;exports.NiceDock=s.NiceDock;exports.NiceDynamicSidebar=s.NiceDynamicSidebar;exports.NiceHybridShell=s.NiceHybridShell;exports.NiceKioskShell=s.NiceKioskShell;exports.NiceMdiWorkspace=s.NiceMdiWorkspace;exports.NiceMenu=s.NiceMenu;exports.NiceMinimalShell=s.NiceMinimalShell;exports.NiceModeSelector=s.NiceModeSelector;exports.NiceModernShell=s.NiceModernShell;exports.NiceModuleLifecyclePanel=s.NiceModuleLifecyclePanel;exports.NiceNavMenu=s.NiceNavMenu;exports.NiceNavbar=s.NiceNavbar;exports.NiceOrganizationProfileForm=s.NiceOrganizationProfileForm;exports.NicePwaShell=s.NicePwaShell;exports.NiceSetupWizard=s.NiceSetupWizard;exports.NiceSidebarNav=s.NiceSidebarNav;exports.NiceSplitter=s.NiceSplitter;exports.NiceUserMenu=s.NiceUserMenu;exports.NiceWizard=s.NiceWizard;exports.SIDEBAR_MODE_META=s.SIDEBAR_MODE_META;exports.sidebarModeLabel=s.sidebarModeLabel;exports.NiceTabs=z.NiceTabs;exports.NicePagination=K.NicePagination;exports.NiceDockMenu=V;exports.NiceHamburgerMenu=Y;exports.NiceNavigationControls=J;exports.NiceRibbonMenu=U;exports.NiceSidebarMenu=W;exports.NiceTopMenu=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./NiceModuleLifecyclePanel-BWUYyWfY.cjs"),e=require("react/jsx-runtime"),c=require("@nice2dev/ui-core"),a=require("react"),z=require("./pickerCommons-CUGHOWyc.cjs"),K=require("./NicePagination-D_3GfWp5.cjs"),E=[],W=Object.assign(a.forwardRef(({items:p=E,activeKey:f,collapsed:l=!1,width:x=240,collapsedWidth:u=52,onItemClick:y,onCollapseChange:A,header:g,footer:b,size:_="md",className:R,style:$,id:S,accessMode:C,...D},m)=>{const j=c.useControlId(S),M=c.useNiceAccessMode(C,S),[k,h]=a.useState(new Set),i=a.useCallback(n=>{h(t=>{const o=new Set(t);return o.has(n)?o.delete(n):o.add(n),o})},[]);if(M==="hidden")return null;const d=(n,t=0)=>{const o=n.children&&n.children.length>0,r=k.has(n.key),N=n.key===f;return e.jsxs("li",{className:"nice-sidebar-menu__item",children:[e.jsxs("button",{className:`nice-sidebar-menu__btn ${N?"nice-sidebar-menu__btn--active":""} ${n.disabled?"nice-sidebar-menu__btn--disabled":""}`,style:{paddingLeft:l?void 0:12+t*16},onClick:()=>o?i(n.key):y?.(n),disabled:n.disabled,title:l?n.text:void 0,type:"button",children:[n.icon&&e.jsx("span",{className:"nice-sidebar-menu__icon",children:n.icon}),!l&&e.jsx("span",{className:"nice-sidebar-menu__label",children:n.text}),!l&&n.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-menu__badge",children:n.badge}),!l&&o&&e.jsx("span",{className:"nice-sidebar-menu__chevron",children:e.jsx(c.NiceIcon,{name:r?"chevron-down":"chevron-right",size:14})})]}),o&&r&&!l&&e.jsx("ul",{className:"nice-sidebar-menu__children",children:n.children.map(I=>d(I,t+1))})]},n.key)};return e.jsxs("nav",{ref:m,id:j,className:`nice-sidebar-menu nice-sidebar-menu--${_} ${l?"nice-sidebar-menu--collapsed":""} ${R??""}`,style:{...$,width:l?u:x},...D,children:[g&&e.jsx("div",{className:"nice-sidebar-menu__header",children:g}),e.jsx("ul",{className:"nice-sidebar-menu__list",role:"list",children:p.map(n=>d(n))}),b&&e.jsx("div",{className:"nice-sidebar-menu__footer",children:b})]})}),{displayName:"NiceSidebarMenu"}),q=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,brand:x,actions:u,size:y="md",className:A,style:g,id:b,accessMode:_,...R},$)=>{const S=c.useControlId(b),C=c.useNiceAccessMode(_,b),[D,m]=a.useState(null),[j,M]=a.useState(!1),k=a.useRef(null),h=a.useRef(null);c.useRovingFocus(k,{orientation:"horizontal",wrap:!0,typeahead:!0}),c.useRovingFocus(h,{orientation:"vertical",wrap:!0,typeahead:!0}),c.useOverlayFocus(h,{open:D!=null&&!j,modal:!1,onClose:()=>m(null)});const i=n=>{M(!1),m(n)},d=n=>{if(n.key!=="ArrowLeft"&&n.key!=="ArrowRight")return;n.preventDefault();const t=[...k.current?.querySelectorAll(".nice-top-menu__btn")??[]],o=t.findIndex(N=>N.getAttribute("aria-expanded")==="true"),r=t[(o+(n.key==="ArrowRight"?1:-1)+t.length)%t.length];m(null),r?.focus()};return C==="hidden"?null:e.jsxs("nav",{ref:$,id:S,className:`nice-top-menu nice-top-menu--${y} ${A??""}`,style:g,...R,children:[x&&e.jsx("div",{className:"nice-top-menu__brand",children:x}),e.jsx("ul",{className:"nice-top-menu__items",role:"menubar",ref:k,children:p.map(n=>{const t=n.children&&n.children.length>0,o=D===n.key;return e.jsxs("li",{className:"nice-top-menu__item",onMouseEnter:()=>{t&&(M(!0),m(n.key))},onMouseLeave:()=>t&&m(null),children:[e.jsxs("button",{className:`nice-top-menu__btn ${n.key===f?"nice-top-menu__btn--active":""}`,onClick:()=>t?o?m(null):i(n.key):l?.(n),onKeyDown:r=>{const N=r.nativeEvent.niceSource;t&&r.key==="ArrowDown"&&N!=="gamepad"&&(r.preventDefault(),i(n.key))},role:"menuitem","aria-haspopup":t,"aria-expanded":o,disabled:n.disabled,type:"button",children:[n.icon&&e.jsx("span",{children:n.icon}),e.jsx("span",{children:n.text}),t&&e.jsx("span",{className:"nice-top-menu__chevron",children:e.jsx(c.NiceIcon,{name:"chevron-down",size:14})})]}),t&&o&&e.jsx("ul",{className:"nice-top-menu__dropdown",role:"menu",ref:h,onKeyDown:d,children:n.children.map(r=>e.jsx("li",{children:e.jsxs("button",{className:`nice-top-menu__dropdown-btn ${r.key===f?"nice-top-menu__dropdown-btn--active":""}`,onClick:()=>{l?.(r),m(null)},disabled:r.disabled,role:"menuitem",type:"button",children:[r.icon&&e.jsx("span",{children:r.icon}),e.jsx("span",{children:r.text}),r.badge!==void 0&&e.jsx("span",{className:"nice-top-menu__badge",children:r.badge})]})},r.key))})]},n.key)})}),u&&e.jsx("div",{className:"nice-top-menu__actions",children:u})]})}),{displayName:"NiceTopMenu"}),H=[],U=Object.assign(a.forwardRef(({tabs:p=H,activeTab:f,onTabChange:l,onItemClick:x,minimized:u=!1,onMinimizeToggle:y,size:A="md",className:g,style:b,id:_,accessMode:R,...$},S)=>{const C=a.useRef(null);c.useRovingFocus(C,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const D=c.useControlId(_),m=c.useNiceAccessMode(R,_),{t:j}=c.useNiceTranslation(),[M,k]=a.useState(void 0),h=f??M??p[0]?.key,i=p.find(n=>n.key===h),d=a.useCallback(n=>{k(n),l?.(n)},[l]);return m==="hidden"?null:e.jsxs("div",{ref:S,id:D,className:`nice-ribbon-menu nice-ribbon-menu--${A} ${u?"nice-ribbon-menu--minimized":""} ${g??""}`,style:b,...$,children:[e.jsxs("div",{className:"nice-ribbon-menu__tabs",ref:C,role:"tablist",children:[p.map(n=>e.jsx("button",{className:`nice-ribbon-menu__tab ${n.key===h?"nice-ribbon-menu__tab--active":""}`,onClick:()=>d(n.key),role:"tab","aria-selected":n.key===h,type:"button",children:n.label},n.key)),e.jsx("button",{className:"nice-ribbon-menu__minimize",onClick:()=>y?.(!u),type:"button","aria-label":u?j("nav.expand","Expand"):j("nav.collapse","Collapse"),children:e.jsx(c.NiceIcon,{name:u?"chevron-down":"chevron-up",size:14})})]}),!u&&i&&e.jsx("div",{className:"nice-ribbon-menu__panel",role:"tabpanel",children:i.groups.map((n,t)=>e.jsxs("div",{className:"nice-ribbon-menu__group",children:[e.jsx("div",{className:"nice-ribbon-menu__group-items",children:n.items.map(o=>e.jsxs("button",{className:"nice-ribbon-menu__item",onClick:()=>x?.(o),disabled:o.disabled,type:"button",children:[o.icon&&e.jsx("span",{className:"nice-ribbon-menu__item-icon",children:o.icon}),e.jsx("span",{className:"nice-ribbon-menu__item-label",children:o.text})]},o.key))}),e.jsx("div",{className:"nice-ribbon-menu__group-label",children:n.label})]},t))})]})}),{displayName:"NiceRibbonMenu"}),V=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,position:x="bottom",autoHide:u=!1,iconSize:y=40,size:A="md",className:g,style:b,id:_,accessMode:R,...$},S)=>{const C=c.useControlId(_),D=c.useNiceAccessMode(R,_),[m,j]=a.useState(!1),[M,k]=a.useState(!1),h=!u||m||M;return D==="hidden"?null:e.jsx("div",{ref:S,id:C,className:`nice-dock-menu nice-dock-menu--${x} nice-dock-menu--${A} ${u&&!h?"nice-dock-menu--hidden":""} ${g??""}`,style:b,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),onFocus:()=>k(!0),onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||k(!1)},...$,children:e.jsx("div",{className:"nice-dock-menu__items",children:p.map(i=>e.jsxs("button",{className:`nice-dock-menu__item ${i.key===f?"nice-dock-menu__item--active":""}`,onClick:()=>l?.(i),disabled:i.disabled,title:i.text,"aria-label":i.text,type:"button",style:{width:y,height:y},children:[i.icon?e.jsx("span",{className:"nice-dock-menu__icon",children:i.icon}):e.jsx("span",{children:i.text[0]}),i.badge!==void 0&&e.jsx("span",{className:"nice-dock-menu__badge",children:i.badge})]},i.key))})})}),{displayName:"NiceDockMenu"}),Y=Object.assign(a.forwardRef(({items:p=E,activeKey:f,onItemClick:l,open:x,onOpenChange:u,position:y="left",panelWidth:A=280,header:g,footer:b,size:_="md",className:R,style:$,id:S,accessMode:C,...D},m)=>{const j=c.useControlId(S),M=c.useNiceAccessMode(C,S),{t:k}=c.useNiceTranslation(),[h,i]=a.useState(!1),d=x??h,n=a.useCallback(v=>{i(v),u?.(v)},[u]),t=a.useCallback(()=>n(!d),[d,n]),o=a.useCallback(v=>{l?.(v),n(!1)},[l,n]),r=a.useRef(null),N=a.useRef(null),I=a.useRef(null);return a.useLayoutEffect(()=>{I.current?.toggleAttribute("inert",!d)},[d]),c.useMenuButton(r,N,{open:d,onOpenChange:n,closeOnFocusOut:!1,closeOnOutsidePress:!1}),M==="hidden"?null:e.jsxs("div",{ref:m,id:j,className:`nice-hamburger-menu nice-hamburger-menu--${_} ${R??""}`,style:$,...D,children:[e.jsx("button",{ref:r,className:"nice-hamburger-menu__trigger",onClick:t,"aria-label":k("nav.menu","Menu"),"aria-haspopup":"menu","aria-expanded":d,type:"button",children:e.jsxs("span",{className:`nice-hamburger-menu__icon ${d?"nice-hamburger-menu__icon--open":""}`,children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}),d&&e.jsx("div",{className:"nice-hamburger-menu__backdrop",onClick:t,"aria-hidden":!0}),e.jsxs("div",{ref:I,className:`nice-hamburger-menu__panel nice-hamburger-menu__panel--${y} ${d?"nice-hamburger-menu__panel--open":""}`,style:{width:A},children:[g&&e.jsx("div",{className:"nice-hamburger-menu__header",children:g}),e.jsx("ul",{className:"nice-hamburger-menu__list",role:"menu",ref:N,children:p.map(v=>e.jsx("li",{children:e.jsxs("button",{className:`nice-hamburger-menu__item ${v.key===f?"nice-hamburger-menu__item--active":""}`,onClick:()=>o(v),disabled:v.disabled,role:"menuitem",type:"button",children:[v.icon&&e.jsx("span",{className:"nice-hamburger-menu__item-icon",children:v.icon}),e.jsx("span",{children:v.text}),v.badge!==void 0&&e.jsx("span",{className:"nice-hamburger-menu__item-badge",children:v.badge})]})},v.key))}),b&&e.jsx("div",{className:"nice-hamburger-menu__footer",children:b})]})]})}),{displayName:"NiceHamburgerMenu"}),J=Object.assign(a.forwardRef(({canGoBack:p=!1,canGoForward:f=!1,onBack:l,onForward:x,onRefresh:u,enableShortcuts:y=!0,showRefresh:A=!0,showStop:g=!0,isLoading:b=!1,onStop:_,size:R="md",variant:$="default",tooltipPosition:S="bottom",backIcon:C,forwardIcon:D,refreshIcon:m,stopIcon:j,className:M,style:k,id:h,accessMode:i,disabled:d,...n},t)=>{const o=c.useControlId(h),r=c.useNiceAccessMode(i,h),{t:N}=c.useNiceTranslation();if(a.useEffect(()=>{if(!y||d)return;const T=w=>{const O=w.altKey,B=w.ctrlKey||w.metaKey;O&&w.key==="ArrowLeft"?(w.preventDefault(),p&&l?.()):O&&w.key==="ArrowRight"?(w.preventDefault(),f&&x?.()):w.key==="F5"||B&&w.key==="r"?(w.preventDefault(),b?_?.():u?.()):w.key==="Escape"&&b&&(w.preventDefault(),_?.())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[y,d,p,f,b,l,x,u,_]),r==="hidden")return null;const I=r==="disabled"||d,v=C??e.jsx(c.NiceIcon,{name:"chevron-left",size:16}),P=D??e.jsx(c.NiceIcon,{name:"chevron-right",size:16}),F=m??e.jsx(c.NiceIcon,{name:"refresh",size:16}),L=j??e.jsx(c.NiceIcon,{name:"close",size:16});return e.jsxs("div",{ref:t,id:o,className:`nice-nav-controls nice-nav-controls--${R} nice-nav-controls--${$}${I?" nice-nav-controls--disabled":""}${M?` ${M}`:""}`,style:k,role:"navigation","aria-label":N("nav.controls","Navigation controls"),...n,children:[e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--back${p?"":" nice-nav-controls__btn--disabled"}`,onClick:l,disabled:I||!p,"aria-label":N("nav.back","Back"),title:`${N("nav.back","Back")} (Alt+←)`,children:v}),e.jsx("button",{type:"button",className:`nice-nav-controls__btn nice-nav-controls__btn--forward${f?"":" nice-nav-controls__btn--disabled"}`,onClick:x,disabled:I||!f,"aria-label":N("nav.forward","Forward"),title:`${N("nav.forward","Forward")} (Alt+→)`,children:P}),(A||g&&b)&&(b?e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--stop nice-nav-controls__btn--loading",onClick:_,disabled:I,"aria-label":N("nav.stop","Stop"),title:`${N("nav.stop","Stop")} (Esc)`,children:L}):e.jsx("button",{type:"button",className:"nice-nav-controls__btn nice-nav-controls__btn--refresh",onClick:u,disabled:I,"aria-label":N("nav.refresh","Refresh"),title:`${N("nav.refresh","Refresh")} (F5)`,children:F}))]})}),{displayName:"NiceNavigationControls"});exports.DEFAULT_SIDEBAR_PREFS=s.DEFAULT_SIDEBAR_PREFS;exports.DesktopContextMenu=s.DesktopContextMenu;exports.DesktopGrid=s.DesktopGrid;exports.DesktopStartMenu=s.DesktopStartMenu;exports.DesktopSystemTray=s.DesktopSystemTray;exports.DesktopTaskbar=s.DesktopTaskbar;exports.NiceAccordion=s.NiceAccordion;exports.NiceAppLayout=s.NiceAppLayout;exports.NiceAuthButtons=s.NiceAuthButtons;exports.NiceBreadcrumb=s.NiceBreadcrumb;exports.NiceCard=s.NiceCard;exports.NiceConsole=s.NiceConsole;exports.NiceContextMenu=s.NiceContextMenu;exports.NiceDashboardLayout=s.NiceDashboardLayout;exports.NiceDashboardShell=s.NiceDashboardShell;exports.NiceDesktop=s.NiceDesktop;exports.NiceDock=s.NiceDock;exports.NiceDynamicSidebar=s.NiceDynamicSidebar;exports.NiceHybridShell=s.NiceHybridShell;exports.NiceKioskShell=s.NiceKioskShell;exports.NiceMdiWorkspace=s.NiceMdiWorkspace;exports.NiceMenu=s.NiceMenu;exports.NiceMinimalShell=s.NiceMinimalShell;exports.NiceModeSelector=s.NiceModeSelector;exports.NiceModernShell=s.NiceModernShell;exports.NiceModuleLifecyclePanel=s.NiceModuleLifecyclePanel;exports.NiceNavMenu=s.NiceNavMenu;exports.NiceNavbar=s.NiceNavbar;exports.NiceOrganizationProfileForm=s.NiceOrganizationProfileForm;exports.NicePwaShell=s.NicePwaShell;exports.NiceSetupWizard=s.NiceSetupWizard;exports.NiceSidebarNav=s.NiceSidebarNav;exports.NiceSplitter=s.NiceSplitter;exports.NiceUserMenu=s.NiceUserMenu;exports.NiceWizard=s.NiceWizard;exports.SIDEBAR_MODE_META=s.SIDEBAR_MODE_META;exports.sidebarModeLabel=s.sidebarModeLabel;exports.NiceTabs=z.NiceTabs;exports.NicePagination=K.NicePagination;exports.NiceDockMenu=V;exports.NiceHamburgerMenu=Y;exports.NiceNavigationControls=J;exports.NiceRibbonMenu=U;exports.NiceSidebarMenu=W;exports.NiceTopMenu=q;
@@ -1469,6 +1469,14 @@ export declare interface NiceSetupWizardProps {
1469
1469
  };
1470
1470
  /** Accessibility */
1471
1471
  accessMode?: NiceAccessMode;
1472
+ /**
1473
+ * Height of the wizard (1.3.1) — px or any CSS length. Default: as tall as the step, up to the
1474
+ * screen (`max-height: 100vh`), so on a short step the button bar sits right under it. With a
1475
+ * height the wizard fills exactly that (no 400px minimum, no 100vh cap): the step body scrolls
1476
+ * and the button bar stays at the bottom edge on every step. `'100%'` fills a parent with a
1477
+ * definite height, `'100dvh'` the screen.
1478
+ */
1479
+ height?: number | string;
1472
1480
  id?: string;
1473
1481
  className?: string;
1474
1482
  style?: default_2.CSSProperties;
@@ -1930,7 +1938,8 @@ declare interface NiceThemePickerProps extends NiceFormFieldProps, DualVisibilit
1930
1938
  previewSize?: number;
1931
1939
  /**
1932
1940
  * Preview rendering style:
1933
- * - `'page'` (default): a small "page" thumbnail with header/text/sidebar.
1941
+ * - `'page'` (default): a page in miniature — accent bar on top, a card with two lines of text
1942
+ * between thin margins of the page background.
1934
1943
  * - `'swatch'`: a flag-like vertical colour stripe (cheaper, less informative).
1935
1944
  */
1936
1945
  previewShape?: 'page' | 'swatch';
@@ -2335,17 +2344,20 @@ declare interface TaskbarProps {
2335
2344
  onItemClick?: (key: string) => void;
2336
2345
  }
2337
2346
 
2338
- /** Colours used to render a theme preview thumbnail. All optional except `background`. */
2347
+ /** Colours used to render a theme preview thumbnail. */
2339
2348
  declare interface ThemePreviewColors {
2340
- /** Main page background. */
2349
+ /** Main surface (a theme's `backgrounds.primary`) — the card in the middle of the 'page' shape. */
2341
2350
  background: string;
2342
- /** Sidebar / secondary surface (left bar in 'page' shape). */
2351
+ /**
2352
+ * Secondary surface (`backgrounds.secondary`) — the page background left and right of the card
2353
+ * in the 'page' shape. Defaults to `background`.
2354
+ */
2343
2355
  backgroundSecondary?: string;
2344
- /** Accent / header bar colour. */
2356
+ /** Accent — the bar across the top of the 'page' shape. */
2345
2357
  primary: string;
2346
- /** Body text colour (rendered as a thin line). */
2358
+ /** Body text — the two lines on the card. */
2347
2359
  textColor: string;
2348
- /** Optional border (defaults to a translucent overlay). */
2360
+ /** Border of the thumbnail and of the card (defaults to a translucent overlay). */
2349
2361
  border?: string;
2350
2362
  }
2351
2363
 
@@ -1,8 +1,8 @@
1
- import { D as de, a as ue, b as be, c as me, d as pe, e as _e, N as he, f as Ne, g as ve, h as fe, i as ye, j as ge, k as ke, l as we, m as $e, n as Me, o as Ce, p as De, q as xe, r as Se, s as Oe, t as Ae, u as Ee, v as Ie, w as Re, x as Te, y as Pe, z as ze, A as Be, B as Fe, C as je, E as Le, F as Ke, G as We, H as He, S as qe, I as Ue } from "./NiceModuleLifecyclePanel-SN6G7t64.js";
1
+ import { D as de, a as ue, b as be, c as me, d as pe, e as _e, N as he, f as Ne, g as ve, h as fe, i as ye, j as ge, k as ke, l as we, m as $e, n as Me, o as Ce, p as De, q as xe, r as Se, s as Oe, t as Ae, u as Ee, v as Ie, w as Re, x as Te, y as Pe, z as ze, A as Be, B as Fe, C as je, E as Le, F as Ke, G as We, H as He, S as qe, I as Ue } from "./NiceModuleLifecyclePanel-BdcJATGF.js";
2
2
  import { jsx as n, jsxs as b } from "react/jsx-runtime";
3
3
  import { useControlId as T, useNiceAccessMode as P, useNiceTranslation as L, useMenuButton as Y, useRovingFocus as j, NiceIcon as E, useOverlayFocus as J } from "@nice2dev/ui-core";
4
4
  import { forwardRef as z, useState as I, useCallback as B, useRef as R, useLayoutEffect as Q, useEffect as X } from "react";
5
- import { a as Ye } from "./pickerCommons-BQi6IEAt.js";
5
+ import { a as Ye } from "./pickerCommons-D-dwdCBZ.js";
6
6
  import { N as Qe } from "./NicePagination-BJS65foT.js";
7
7
  const F = [], ae = /* @__PURE__ */ Object.assign(
8
8
  /* @__PURE__ */ z(
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),d=require("@nice2dev/ui-core"),m=require("react"),B=require("./vendor-Bo2Q64AF.cjs"),H=[],K=({tabs:f=H,activeTab:i,onChange:r,variant:u="default",vertical:s,size:c="md",iconOnly:n=!1,centered:o="auto",countLocation:l="right",showHints:x,id:p,className:v,style:e,displayStyle:g})=>{const{t:h}=d.useNiceTranslation(),b=d.useControlId(p),N=o==="auto"?n:o,k=d.useComponentDisplayStyle("tab",g),T=d.useComponentDisplayClass("tab",g),[A,C]=m.useState(i||f[0]?.id),M=i??A,y=m.useRef(null),S=m.useRef(null),[E]=d.useInputPreferences(),_=d.useHintsVisible(),$=m.useCallback(a=>{C(a),r?.(a)},[r]);d.useRovingFocus(S,{orientation:s?"vertical":"horizontal",wrap:!0,onMove:a=>{const w=a.getAttribute("data-tab-id");w&&$(w)}}),d.useIntent(["sectionPrev","sectionNext"],a=>{const w=f.filter(j=>!j.disabled);if(w.length<2)return!1;const G=w.findIndex(j=>j.id===M),P=a.intent==="sectionNext"?1:-1,D=w[(G+P+w.length)%w.length];return $(D.id),[...S.current?.querySelectorAll("[data-tab-id]")??[]].find(j=>j.getAttribute("data-tab-id")===D.id)?.focus(),!0},{ref:y}),d.useInputHints(y,f.length>1?[{intent:"sectionPrev",label:h("input.intent.sectionPrev","Previous section")},{intent:"sectionNext",label:h("input.intent.sectionNext","Next section")}]:[]);const R=f.length>1&&_&&(x??E.hintDensity==="bar-and-controls"),L=f.find(a=>a.id===M)?.content;return t.jsxs("div",{ref:y,className:`nice-tabs nice-tabs--${c} ${s?"nice-tabs--vertical":""} ${n?"nice-tabs--icon-only":""} nice-tabs--ds-${T} ${v||""}`,style:{...k,...e},children:[t.jsxs("div",{ref:S,className:`nice-tabs__list ${u!=="default"?`nice-tabs__list--${u}`:""} ${s?"nice-tabs__list--vertical":""} ${N?"nice-tabs__list--centered":""}`,role:"tablist","aria-orientation":s?"vertical":"horizontal",children:[R&&t.jsx("span",{className:"nice-tabs__hint","aria-hidden":"true",children:t.jsx(d.NiceButtonPrompt,{intent:"sectionPrev",size:"sm"})}),f.map(a=>t.jsxs("button",{type:"button",role:"tab",id:`${b}-tab-${a.id}`,"data-tab-id":a.id,"aria-selected":M===a.id,"aria-controls":`${b}-panel`,"aria-label":n?a.label:void 0,title:n?a.label:void 0,className:`nice-tabs__tab ${M===a.id?"nice-tabs__tab--active":""} ${a.disabled?"nice-tabs__tab--disabled":""} ${l==="bottom"?"nice-tabs__tab--count-bottom":""}`,disabled:a.disabled,onClick:()=>$(a.id),children:[a.icon,!n&&t.jsx("span",{children:a.label}),a.badge!==void 0&&t.jsx("span",{className:`nice-tabs__badge${l==="bottom"?" nice-tabs__badge--pill":""}`,children:a.badge})]},a.id)),R&&t.jsx("span",{className:"nice-tabs__hint","aria-hidden":"true",children:t.jsx(d.NiceButtonPrompt,{intent:"sectionNext",size:"sm"})})]}),t.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",id:`${b}-panel`,"aria-labelledby":M?`${b}-tab-${M}`:void 0,children:L})]})};function U(f,{open:i,onSelect:r,onClose:u,onOpen:s,loop:c=!1,pageSize:n=10,intentRef:o}){const[l,x]=m.useState(0);m.useEffect(()=>{x(e=>f.length===0?0:Math.min(Math.max(e,0),f.length-1))},[f.length]);const p=m.useCallback((e,g)=>x(h=>{const b=f.length;if(b===0)return 0;const N=e(h);return g?(N%b+b)%b:Math.min(Math.max(N,0),b-1)}),[f.length]),v=m.useCallback(e=>{if(!i){(e.key==="ArrowDown"||e.key==="ArrowUp")&&(e.preventDefault(),s?.());return}const g=e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLInputElement&&e.target.type!=="checkbox";if(e.key==="ArrowDown")e.preventDefault(),p(h=>h+1,c);else if(e.key==="ArrowUp")e.preventDefault(),p(h=>h-1,c);else if(e.key==="PageDown")e.preventDefault(),p(h=>h+n,!1);else if(e.key==="PageUp")e.preventDefault(),p(h=>h-n,!1);else if(!g&&(e.key==="Home"||e.key==="End"))e.preventDefault(),p(()=>e.key==="Home"?0:f.length-1,!1);else if(e.key==="Enter"){const h=f[l];h!==void 0&&(e.preventDefault(),r(h,l))}else e.key==="Escape"&&u?.()},[i,f,l,c,n,p,r,u,s]);return d.useIntent(["navigate","activate"],e=>{if(e.source==="keyboard")return!1;if(e.intent==="activate"){const g=f[l];if(g===void 0)return!1;r(g,l);return}if(e.direction!=="up"&&e.direction!=="down")return!1;p(g=>g+(e.direction==="down"?1:-1),c)},{ref:o,enabled:i&&!!o}),{activeIndex:l,setActiveIndex:x,handleKeyDown:v}}const F=Object.assign(m.forwardRef(({label:f,checked:i=!1,onChange:r,disabled:u,readOnly:s,loading:c,required:n,size:o="md",name:l,id:x,className:p,style:v,accessMode:e,displayStyle:g,showKeyboardHints:h,error:b,helperText:N,labelPlacement:k,errorPlacement:T,labelWidth:A,controlWidth:C},M)=>{const y=d.useNiceAccessMode(e,x),S=y==="hidden";(y==="disabled"||y==="readOnly")&&(u=!0);const{t:E}=d.useNiceTranslation(),_=d.useControlId(x);d.useComponentDisplayStyle("toggle",g);const $=d.useComponentDisplayClass("toggle",g),R=m.useMemo(()=>[{key:"Space",description:E("shortcuts.toggle","Toggle on/off")}],[E]);return S?null:t.jsxs("div",{className:`nice-field nice-field--inline nice-field--${o} ${k==="left"?"nice-field--label-left":""} ${c?"nice-field--loading":""} ${p||""}`,style:{...v,...A!=null&&{"--nice-field-label-width":typeof A=="number"?`${A}px`:A},...C!=null&&{"--nice-field-control-width":typeof C=="number"?`${C}px`:C}},"aria-busy":c||void 0,children:[k==="left"&&f&&t.jsx("span",{className:`nice-field__label ${n?"nice-field__label--required":""}`,children:f}),t.jsxs("div",{className:"nice-field__control",children:[t.jsxs("label",{className:`nice-toggle nice-toggle--ds-${$} ${o!=="md"?`nice-toggle--${o}`:""} ${u||c?"nice-toggle--disabled":""}`,htmlFor:_,children:[t.jsx("input",{ref:M,id:_,type:"checkbox",className:"nice-toggle__input",name:l,checked:i,disabled:u||c,readOnly:s,role:"switch","aria-checked":i,"aria-invalid":!!b,onChange:L=>{s||c||r?.(L.target.checked)}}),t.jsx("span",{className:"nice-toggle__track",children:t.jsx("span",{className:"nice-toggle__thumb"})}),k!=="left"&&f&&t.jsx("span",{children:f}),h&&t.jsx(d.NiceKeyboardHint,{shortcuts:R,size:"sm"})]}),c&&t.jsx("span",{className:"nice-field__spinner",children:t.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),T==="right"&&b&&t.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:b}),T==="right"&&!b&&N&&t.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:N})]}),T!=="right"&&b&&t.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:b}),T!=="right"&&!b&&N&&t.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:N})]})}),{displayName:"NiceToggle"}),Z=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"]}),I=["#cbd5e1","#94a3b8","#cbd5e1"];function V(f){return f?Z[f.toUpperCase()]??I:I}const Y=B.Flags3x2,O=({code:f,size:i=22,className:r})=>{const{t:u}=d.useNiceTranslation(),s=f?.toUpperCase(),c=s?Y[s]:void 0,n=i,o=Math.round(i*2/3);return c?t.jsx("span",{className:r,role:"img","aria-label":u("pickerCommons.flag","{upper} flag").replace("{upper}",String(s)),style:{display:"inline-block",width:n,height:o,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:c.replace("<svg ",`<svg width="${n}" height="${o}" preserveAspectRatio="xMidYMid slice" `)}}):t.jsx(J,{code:f,size:i,className:r})},J=({code:f,size:i=18,className:r})=>{const{t:u}=d.useNiceTranslation(),s=V(f);return t.jsx("span",{className:r,role:"img","aria-label":u("pickerCommons.flag2","{code} flag").replace("{code}",String(f)),style:{display:"inline-flex",width:i,height:Math.round(i*.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:s.map((c,n)=>t.jsx("span",{style:{flex:1,background:c}},n))})};function q(f,i,r,u=280){const[s,c]=m.useState(r==="left"?"left":"right"),n=m.useCallback(()=>{if(r!=="auto"){c(r);return}const o=i.current;if(!o||typeof window>"u")return;const l=o.getBoundingClientRect(),p=window.innerWidth-l.left,v=l.right;p>=u&&p>v?c("left"):c("right")},[r,i,u]);return m.useEffect(()=>{if(f)return n(),window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),()=>{window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}},[f,n]),s}const W=({colors:f,size:i=28,shape:r="page",className:u})=>{const{t:s}=d.useNiceTranslation(),c=i,n=Math.round(i*.75),o=f.border??"color-mix(in srgb, currentColor 30%, transparent)";if(r==="swatch"){const h=[f.primary,f.background,f.backgroundSecondary??f.background,f.textColor];return t.jsx("span",{className:u,role:"img","aria-label":s("pickerCommons.themePreview","Theme preview"),style:{display:"inline-flex",width:c,height:n,border:`1px solid ${o}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:h.map((b,N)=>t.jsx("span",{style:{flex:1,background:b}},N))})}const l=Math.max(2,Math.round(n*.17)),x=Math.max(2,Math.round(c*.14)),p=c-x*2,v=Math.max(2,Math.round(p*.16)),e=Math.max(1,Math.round(n*.07)),g=n-l;return t.jsxs("span",{className:u,role:"img","aria-label":s("pickerCommons.themePreview","Theme preview"),style:{position:"relative",display:"inline-block",width:c,height:n,boxSizing:"content-box",background:f.backgroundSecondary??f.background,border:`1px solid ${o}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[t.jsx("span",{style:{position:"absolute",top:0,left:0,right:0,height:l,background:f.primary}}),t.jsx("span",{style:{position:"absolute",top:l,bottom:0,left:x,right:x,background:f.background,borderLeft:`1px solid ${o}`,borderRight:`1px solid ${o}`}}),t.jsx("span",{style:{position:"absolute",top:l+Math.round(g*.28),left:x+v,right:x+v,height:e,background:f.textColor}}),t.jsx("span",{style:{position:"absolute",top:l+Math.round(g*.55),left:x+v,width:Math.max(3,Math.round((p-v*2)*.6)),height:e,background:f.textColor}})]})};exports.FlagIcon=O;exports.NiceTabs=K;exports.NiceToggle=F;exports.ThemePreviewSwatch=W;exports.useDropdownAlignment=q;exports.useListKeyboardNav=U;