@nice2dev/ui 1.4.16 → 1.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/NiceAlert-RVTgQxCE.cjs +1 -0
  3. package/dist/NiceDataGrid-Cszjz8NV.cjs +10 -0
  4. package/dist/NiceForm-DM2tARZT.cjs +1 -0
  5. package/dist/{NiceHtmlEditor-By7R1wRo.cjs → NiceHtmlEditor-BEWNA_UI.cjs} +1 -1
  6. package/dist/NiceLoginForm-Bkm5j80r.cjs +1 -0
  7. package/dist/{NiceMention-i7n2BoMw.cjs → NiceMention-DhaTUqvR.cjs} +1 -1
  8. package/dist/NiceModuleLifecyclePanel-DAIbzfZd.cjs +1 -0
  9. package/dist/{NicePagination-D9JguOl0.cjs → NicePagination-CnKYyKI5.cjs} +1 -1
  10. package/dist/{NicePivotGrid-B_7iQJys.cjs → NicePivotGrid-BshofJh1.cjs} +1 -1
  11. package/dist/NiceSavedQueryPanel-DJKEOqy5.cjs +587 -0
  12. package/dist/{NiceScheduler-B2DamQ_L.cjs → NiceScheduler-Dff8fuq_.cjs} +1 -1
  13. package/dist/{core-lazy-ChKRuEPb.cjs → core-lazy-BhQxFuLf.cjs} +1 -1
  14. package/dist/data/NiceRowEditDialog.mjs +42 -35
  15. package/dist/data/NiceTreeGrid.mjs +512 -474
  16. package/dist/data.cjs +1 -1
  17. package/dist/data.d.ts +30 -3
  18. package/dist/editors/forms/NiceForm.mjs +55 -52
  19. package/dist/editors/inputs/NiceRadioGroup.mjs +12 -12
  20. package/dist/editors/inputs/NiceSelect.mjs +51 -51
  21. package/dist/editors/pickers/NiceLanguagePicker.mjs +129 -125
  22. package/dist/editors/pickers/NiceThemePicker.mjs +1 -1
  23. package/dist/editors/pickers/pickerCommons.mjs +155 -203
  24. package/dist/editors.cjs +1 -1
  25. package/dist/feedback.cjs +1 -1
  26. package/dist/index.cjs +96 -96
  27. package/dist/index.d.ts +41 -7
  28. package/dist/lazy.cjs +1 -1
  29. package/dist/navigation.cjs +1 -1
  30. package/dist/navigation.d.ts +6 -0
  31. package/dist/{no-code-CN_q6TcB.cjs → no-code-DPc82kyy.cjs} +11 -11
  32. package/dist/no-code.cjs +1 -1
  33. package/dist/pickerCommons-CQnae2FM.cjs +1 -0
  34. package/dist/style.css +2 -2
  35. package/dist/tools/NiceThemeGalleryPicker.mjs +168 -265
  36. package/package.json +4 -4
  37. package/dist/NiceDataGrid-B1AOjgjm.cjs +0 -10
  38. package/dist/NiceForm-fmePSeA9.cjs +0 -1
  39. package/dist/NiceLoginForm-C2-WgRn0.cjs +0 -1
  40. package/dist/NiceModuleLifecyclePanel-DVHQuhc-.cjs +0 -1
  41. package/dist/NiceSavedQueryPanel-ChY4HwpM.cjs +0 -587
  42. package/dist/pickerCommons-CwcCc8Qi.cjs +0 -1
package/dist/no-code.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-CN_q6TcB.cjs");exports.NICE_NO_CODE_STEP_TYPES=e.NICE_NO_CODE_STEP_TYPES;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.NiceNoCodeScriptEditor=e.NiceNoCodeScriptEditor;exports.NicePageBuilder=e.NicePageBuilder;exports.NiceStateDesigner=e.NiceStateDesigner;exports.NiceTestBuilder=e.NiceTestBuilder;exports.evaluateNoCodeExpression=e.evaluateNoCodeExpression;exports.newNoCodeStep=e.newNoCodeStep;exports.noCodeConditionsHold=e.noCodeConditionsHold;exports.noCodePath=e.noCodePath;exports.runNoCodeScript=e.runNoCodeScript;exports.validateNoCodeScript=e.validateNoCodeScript;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-DPc82kyy.cjs");exports.NICE_NO_CODE_STEP_TYPES=e.NICE_NO_CODE_STEP_TYPES;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.NiceNoCodeScriptEditor=e.NiceNoCodeScriptEditor;exports.NicePageBuilder=e.NicePageBuilder;exports.NiceStateDesigner=e.NiceStateDesigner;exports.NiceTestBuilder=e.NiceTestBuilder;exports.evaluateNoCodeExpression=e.evaluateNoCodeExpression;exports.newNoCodeStep=e.newNoCodeStep;exports.noCodeConditionsHold=e.noCodeConditionsHold;exports.noCodePath=e.noCodePath;exports.runNoCodeScript=e.runNoCodeScript;exports.validateNoCodeScript=e.validateNoCodeScript;
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),p=require("@nice2dev/ui-core"),y=require("react"),K=require("country-flag-icons/string/3x2");function U(f){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const a in f)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(f,a);Object.defineProperty(i,a,r.get?r:{enumerable:!0,get:()=>f[a]})}}return i.default=f,Object.freeze(i)}const F=U(K),O=[],Z=({tabs:f=O,activeTab:i,onChange:a,variant:r="default",vertical:o,size:c="md",iconOnly:n=!1,centered:s="auto",countLocation:d="right",showHints:b,id:l,className:x,"data-testid":e,style:m,displayStyle:g})=>{const{t:h}=p.useNiceTranslation(),v=p.useControlId(l),_=s==="auto"?n:s,S=p.useComponentDisplayStyle("tab",g),T=p.useComponentDisplayClass("tab",g),[C,L]=y.useState(i||f[0]?.id),M=i??C,j=y.useRef(null),A=y.useRef(null),[E]=p.useInputPreferences(),N=p.useHintsVisible(),$=y.useCallback(u=>{L(u),a?.(u)},[a]);p.useRovingFocus(A,{orientation:o?"vertical":"horizontal",wrap:!0,onMove:u=>{const w=u.getAttribute("data-tab-id");w&&$(w)}}),p.useIntent(["sectionPrev","sectionNext"],u=>{const w=f.filter(R=>!R.disabled);if(w.length<2)return!1;const G=w.findIndex(R=>R.id===M),H=u.intent==="sectionNext"?1:-1,P=w[(G+H+w.length)%w.length];return $(P.id),[...A.current?.querySelectorAll("[data-tab-id]")??[]].find(R=>R.getAttribute("data-tab-id")===P.id)?.focus(),!0},{ref:j}),p.useInputHints(j,f.length>1?[{intent:"sectionPrev",label:h("input.intent.sectionPrev","Previous section")},{intent:"sectionNext",label:h("input.intent.sectionNext","Next section")}]:[]);const I=f.length>1&&N&&(b??E.hintDensity==="bar-and-controls"),D=f.find(u=>u.id===M)?.content;return t.jsxs("div",{ref:j,className:`nice-tabs nice-tabs--${c} ${o?"nice-tabs--vertical":""} ${n?"nice-tabs--icon-only":""} nice-tabs--ds-${T} ${x||""}`,style:{...S,...m},"data-testid":e,children:[t.jsxs("div",{ref:A,className:`nice-tabs__list ${r!=="default"?`nice-tabs__list--${r}`:""} ${o?"nice-tabs__list--vertical":""} ${_?"nice-tabs__list--centered":""}`,role:"tablist","aria-orientation":o?"vertical":"horizontal",children:[I&&t.jsx("span",{className:"nice-tabs__hint","aria-hidden":"true",children:t.jsx(p.NiceButtonPrompt,{intent:"sectionPrev",size:"sm"})}),f.map(u=>t.jsxs("button",{type:"button",role:"tab",id:`${v}-tab-${u.id}`,"data-tab-id":u.id,"aria-selected":M===u.id,"aria-controls":`${v}-panel`,"aria-label":n?u.label:void 0,title:n?u.label:void 0,className:`nice-tabs__tab ${M===u.id?"nice-tabs__tab--active":""} ${u.disabled?"nice-tabs__tab--disabled":""} ${d==="bottom"?"nice-tabs__tab--count-bottom":""}`,disabled:u.disabled,onClick:()=>$(u.id),children:[u.icon,!n&&t.jsx("span",{children:u.label}),u.badge!==void 0&&t.jsx("span",{className:`nice-tabs__badge${d==="bottom"?" nice-tabs__badge--pill":""}`,children:u.badge})]},u.id)),I&&t.jsx("span",{className:"nice-tabs__hint","aria-hidden":"true",children:t.jsx(p.NiceButtonPrompt,{intent:"sectionNext",size:"sm"})})]}),t.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",id:`${v}-panel`,"aria-labelledby":M?`${v}-tab-${M}`:void 0,children:D})]})};function V(f,{open:i,onSelect:a,onClose:r,onOpen:o,loop:c=!1,pageSize:n=10,intentRef:s}){const[d,b]=y.useState(0);y.useEffect(()=>{b(e=>f.length===0?0:Math.min(Math.max(e,0),f.length-1))},[f.length]);const l=y.useCallback((e,m)=>b(g=>{const h=f.length;if(h===0)return 0;const v=e(g);return m?(v%h+h)%h:Math.min(Math.max(v,0),h-1)}),[f.length]),x=y.useCallback(e=>{if(!i){(e.key==="ArrowDown"||e.key==="ArrowUp")&&(e.preventDefault(),o?.());return}const m=e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLInputElement&&e.target.type!=="checkbox";if(e.key==="ArrowDown")e.preventDefault(),l(g=>g+1,c);else if(e.key==="ArrowUp")e.preventDefault(),l(g=>g-1,c);else if(e.key==="PageDown")e.preventDefault(),l(g=>g+n,!1);else if(e.key==="PageUp")e.preventDefault(),l(g=>g-n,!1);else if(!m&&(e.key==="Home"||e.key==="End"))e.preventDefault(),l(()=>e.key==="Home"?0:f.length-1,!1);else if(e.key==="Enter"){const g=f[d];g!==void 0&&(e.preventDefault(),a(g,d))}else e.key==="Escape"&&r?.()},[i,f,d,c,n,l,a,r,o]);return p.useIntent(["navigate","activate"],e=>{if(e.source==="keyboard")return!1;if(e.intent==="activate"){const m=f[d];if(m===void 0)return!1;a(m,d);return}if(e.direction!=="up"&&e.direction!=="down")return!1;l(m=>m+(e.direction==="down"?1:-1),c)},{ref:s,enabled:i&&!!s}),{activeIndex:d,setActiveIndex:b,handleKeyDown:x}}const Y=Object.assign(y.forwardRef(({label:f,checked:i=!1,onChange:a,disabled:r,readOnly:o,loading:c,required:n,size:s="md",name:d,id:b,className:l,style:x,accessMode:e,displayStyle:m,showKeyboardHints:g,error:h,helperText:v,labelPlacement:_,errorPlacement:S,labelWidth:T,controlWidth:C,"data-testid":L},M)=>{const j=p.useNiceAccessMode(e,b),A=j==="hidden";(j==="disabled"||j==="readOnly")&&(r=!0);const{t:E}=p.useNiceTranslation(),N=p.useControlId(b);p.useComponentDisplayStyle("toggle",m);const $=p.useComponentDisplayClass("toggle",m),I=y.useMemo(()=>[{key:"Space",description:E("shortcuts.toggle","Toggle on/off")}],[E]);return A?null:t.jsxs("div",{className:`nice-field nice-field--inline nice-field--${s} ${_==="left"?"nice-field--label-left":""} ${c?"nice-field--loading":""} ${l||""}`,style:{...x,...T!=null&&{"--nice-field-label-width":typeof T=="number"?`${T}px`:T},...C!=null&&{"--nice-field-control-width":typeof C=="number"?`${C}px`:C}},"data-testid":L,"aria-busy":c||void 0,children:[_==="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-${$} ${s!=="md"?`nice-toggle--${s}`:""} ${r||c?"nice-toggle--disabled":""}`,htmlFor:N,children:[t.jsx("input",{ref:M,id:N,type:"checkbox",className:"nice-toggle__input",name:d,checked:i,disabled:r||c,readOnly:o,role:"switch","aria-checked":i,"aria-invalid":!!h,onChange:D=>{o||c||a?.(D.target.checked)}}),t.jsx("span",{className:"nice-toggle__track",children:t.jsx("span",{className:"nice-toggle__thumb"})}),_!=="left"&&f&&t.jsx("span",{children:f}),g&&t.jsx(p.NiceKeyboardHint,{shortcuts:I,size:"sm"})]}),c&&t.jsx("span",{className:"nice-field__spinner",children:t.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),S==="right"&&h&&t.jsx("div",{id:`${N}-error`,className:"nice-field__error",role:"alert",children:h}),S==="right"&&!h&&v&&t.jsx("div",{id:`${N}-helper`,className:"nice-field__helper",children:v})]}),S!=="right"&&h&&t.jsx("div",{id:`${N}-error`,className:"nice-field__error",role:"alert",children:h}),S!=="right"&&!h&&v&&t.jsx("div",{id:`${N}-helper`,className:"nice-field__helper",children:v})]})}),{displayName:"NiceToggle"}),J=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"]}),B=["#cbd5e1","#94a3b8","#cbd5e1"];function q(f){return f?J[f.toUpperCase()]??B:B}const z=F,W=({code:f,size:i=22,className:a})=>{const{t:r}=p.useNiceTranslation(),o=f?.toUpperCase(),c=o?z[o]:void 0,n=i,s=Math.round(i*2/3);return c?t.jsx("span",{className:a,role:"img","aria-label":r("pickerCommons.flag","{upper} flag").replace("{upper}",String(o)),style:{display:"inline-block",width:n,height:s,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="${s}" preserveAspectRatio="xMidYMid slice" `)}}):t.jsx(Q,{code:f,size:i,className:a})},Q=({code:f,size:i=18,className:a})=>{const{t:r}=p.useNiceTranslation(),o=q(f);return t.jsx("span",{className:a,role:"img","aria-label":r("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:o.map((c,n)=>t.jsx("span",{style:{flex:1,background:c}},n))})};function X(f,i,a,r=280){const[o,c]=y.useState(a==="left"?"left":"right"),n=y.useCallback(()=>{if(a!=="auto"){c(a);return}const s=i.current;if(!s||typeof window>"u")return;const d=s.getBoundingClientRect(),l=window.innerWidth-d.left,x=d.right;l>=r&&l>x?c("left"):c("right")},[a,i,r]);return y.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]),o}const k=(f,i)=>({backgroundColor:f,backgroundImage:i});function ff({roles:f,w:i,h:a,border:r,className:o,label:c}){const n=[{key:"side",style:k(f.sideNav,f.sideNavImage)},{key:"top",style:k(f.topNav,f.topNavImage)},{key:"body",style:k(f.body,f.bodyImage)},{key:"primary",style:k(f.primary)}];return t.jsx("span",{className:o,role:"img","aria-label":c,"data-preview":"columns",style:{display:"inline-flex",width:i,height:a,border:`1px solid ${r}`,borderRadius:Math.max(2,Math.round(a*.14)),overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:n.map(s=>t.jsx("span",{"data-role":s.key,style:{flex:1,...s.style}},s.key))})}function ef({roles:f,w:i,h:a,border:r,className:o,label:c}){const n=Math.max(4,Math.round(a*.24)),s=Math.max(4,Math.round(i*.24)),d=Math.max(2,Math.round(a*.1)),b=Math.max(2,Math.round(a*.1)),l=n+d,x=s+d,e=m=>({position:"absolute",...m});return t.jsxs("span",{className:o,role:"img","aria-label":c,"data-preview":"layout",style:{position:"relative",display:"inline-block",width:i,height:a,boxSizing:"content-box",...k(f.body,f.bodyImage),border:`1px solid ${r}`,borderRadius:Math.max(2,Math.round(a*.1)),overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[t.jsx("span",{"data-role":"top",style:e({top:0,left:0,right:0,height:n,...k(f.topNav,f.topNavImage)})}),t.jsx("span",{"data-role":"side",style:e({top:n,bottom:0,left:0,width:s,...k(f.sideNav,f.sideNavImage)})}),t.jsx("span",{"data-role":"panel",style:e({top:l,left:x,right:d,bottom:d,...k(f.panel,f.panelImage),border:`1px solid ${f.panelBorder}`,borderRadius:Math.max(1,Math.round(d*.6))})}),t.jsx("span",{style:e({top:l+d,left:x+d,right:d*2,height:b,borderRadius:b/2,background:f.text,opacity:.85})}),t.jsx("span",{style:e({top:l+d+b+d,left:x+d,width:Math.round((i-x-d*3)*.55),height:b,borderRadius:b/2,background:f.text,opacity:.55})}),t.jsx("span",{"data-role":"primary",style:e({bottom:d*2,right:d*2,width:Math.round((i-x)*.32),height:b+2,borderRadius:Math.max(1,Math.round(b/2)),background:f.primary})})]})}const tf=({colors:f,size:i=28,shape:a="page",className:r})=>{const{t:o}=p.useNiceTranslation(),c=i,n=Math.round(i*.75),s=f.border??"color-mix(in srgb, currentColor 30%, transparent)",d=o("pickerCommons.themePreview","Theme preview");if(f.roles){const h={roles:f.roles,w:c,h:n,border:s,className:r,label:d};return a==="swatch"||a==="columns"?t.jsx(ff,{...h}):t.jsx(ef,{...h})}if(a==="swatch"||a==="columns"){const h=[f.primary,f.background,f.backgroundSecondary??f.background,f.textColor];return t.jsx("span",{className:r,role:"img","aria-label":o("pickerCommons.themePreview","Theme preview"),style:{display:"inline-flex",width:c,height:n,border:`1px solid ${s}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:h.map((v,_)=>t.jsx("span",{style:{flex:1,background:v}},_))})}const b=Math.max(2,Math.round(n*.17)),l=Math.max(2,Math.round(c*.14)),x=c-l*2,e=Math.max(2,Math.round(x*.16)),m=Math.max(1,Math.round(n*.07)),g=n-b;return t.jsxs("span",{className:r,role:"img","aria-label":o("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 ${s}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[t.jsx("span",{style:{position:"absolute",top:0,left:0,right:0,height:b,background:f.primary}}),t.jsx("span",{style:{position:"absolute",top:b,bottom:0,left:l,right:l,background:f.background,borderLeft:`1px solid ${s}`,borderRight:`1px solid ${s}`}}),t.jsx("span",{style:{position:"absolute",top:b+Math.round(g*.28),left:l+e,right:l+e,height:m,background:f.textColor}}),t.jsx("span",{style:{position:"absolute",top:b+Math.round(g*.55),left:l+e,width:Math.max(3,Math.round((x-e*2)*.6)),height:m,background:f.textColor}})]})};exports.FlagIcon=W;exports.NiceTabs=Z;exports.NiceToggle=Y;exports.ThemePreviewSwatch=tf;exports.useDropdownAlignment=X;exports.useListKeyboardNav=V;