@ansible/ansible-ui-framework 2.4.2599 → 2.4.2600

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -5604,6 +5604,7 @@ function Kp(e) {
5604
5604
  onClick: () => window.open(r, "_blank"),
5605
5605
  isInline: !0,
5606
5606
  type: "button",
5607
+ iconPosition: "end",
5607
5608
  children: i.documentation
5608
5609
  }
5609
5610
  ) })
@@ -5696,6 +5697,7 @@ function WM(e) {
5696
5697
  variant: "link",
5697
5698
  onClick: () => window.open(e.titleDocLink, "_blank"),
5698
5699
  isInline: !0,
5700
+ iconPosition: "end",
5699
5701
  children: c.documentation
5700
5702
  }
5701
5703
  ) })
package/index.umd.cjs CHANGED
@@ -95,7 +95,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Au]+=1);const Du=Pe.button`
95
95
  &:hover {
96
96
  opacity: 1;
97
97
  }
98
- `;function Pu(e){const{help:t,title:n,docLink:r}=e,[i]=Mt();return t?m.jsx(O.Popover,{headerContent:n,bodyContent:m.jsxs(O.Stack,{hasGutter:!0,children:[Array.isArray(t)?t.map((o,a)=>m.jsx(O.StackItem,{children:o},a)):m.jsx(O.StackItem,{children:t}),r&&m.jsx(O.StackItem,{children:m.jsx(O.Button,{icon:m.jsx(ve.ExternalLinkAltIcon,{}),variant:"link",onClick:()=>window.open(r,"_blank"),isInline:!0,type:"button",children:i.documentation})})]}),children:m.jsx(ID,{type:"button",children:m.jsx(O.Icon,{size:"sm",children:m.jsx(ve.OutlinedQuestionCircleIcon,{})})})}):m.jsx(m.Fragment,{})}const ID=Pe(Du)`
98
+ `;function Pu(e){const{help:t,title:n,docLink:r}=e,[i]=Mt();return t?m.jsx(O.Popover,{headerContent:n,bodyContent:m.jsxs(O.Stack,{hasGutter:!0,children:[Array.isArray(t)?t.map((o,a)=>m.jsx(O.StackItem,{children:o},a)):m.jsx(O.StackItem,{children:t}),r&&m.jsx(O.StackItem,{children:m.jsx(O.Button,{icon:m.jsx(ve.ExternalLinkAltIcon,{}),variant:"link",onClick:()=>window.open(r,"_blank"),isInline:!0,type:"button",iconPosition:"end",children:i.documentation})})]}),children:m.jsx(ID,{type:"button",children:m.jsx(O.Icon,{size:"sm",children:m.jsx(ve.OutlinedQuestionCircleIcon,{})})})}):m.jsx(m.Fragment,{})}const ID=Pe(Du)`
99
99
  margin-left: 4px;
100
100
  `,$D=MD`
101
101
  from {
@@ -106,7 +106,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Au]+=1);const Du=Pe.button`
106
106
  }
107
107
  `,a5=Pe(ve.SyncAltIcon)`
108
108
  animation: ${$D} 1.75s linear infinite;
109
- `;a5.displayName="RunningIcon";const s5=v.createContext({tabBreadcrumb:{},setTabBreadcrumb:()=>{}});function LD(e){const[t,n]=v.useState();return m.jsx(s5.Provider,{value:{tabBreadcrumb:t,setTabBreadcrumb:n},children:e.children})}const FD=()=>v.useContext(s5);function ND(e){const t=Lt.useNavigate();return e.breadcrumbs?m.jsx(O.Breadcrumb,{style:e.style,children:e.breadcrumbs.map((n,r)=>n.label?m.jsx(O.BreadcrumbItem,{"data-cy":n.label,id:n.id,component:n.component,isActive:n.to===void 0,children:n.to?m.jsx("a",{href:n.to,"data-cy":n.label,onClick:i=>{i.preventDefault(),n.to&&t(n.to)},children:n.label}):n.label},r):m.jsx(v.Fragment,{},r))}):m.jsx(v.Fragment,{})}function l5(e){const{title:t,description:n,controls:r,headerActions:i,footer:o}=e,a=fn("lg"),s=fn("xl"),l=fn("md"),[c]=Mt(),{tabBreadcrumb:u}=FD(),d=v.useMemo(()=>{const f=[];return e.breadcrumbs&&(f.push(...e.breadcrumbs),u&&f.push(u)),f},[e.breadcrumbs,u]);return m.jsx(O.PageSection,{variant:O.PageSectionVariants.light,className:"bg-lighten border-bottom",style:{paddingTop:(d!=null&&d.length,s?16:12),paddingBottom:s?16:12},children:m.jsxs(O.Stack,{hasGutter:!0,children:[m.jsxs(O.Flex,{flexWrap:{default:"nowrap"},alignItems:{default:"alignItemsStretch"},children:[m.jsxs(O.FlexItem,{grow:{default:"grow"},children:[d.length>0&&m.jsx(ND,{breadcrumbs:d!=null&&d.length?d:void 0,style:{paddingBottom:a?6:4}}),t?e.titleHelp?m.jsx(O.Popover,{headerContent:e.titleHelpTitle??e.title,bodyContent:m.jsxs(O.Stack,{hasGutter:!0,children:[typeof e.titleHelp=="string"?m.jsx(O.StackItem,{children:e.titleHelp}):e.titleHelp.map((f,h)=>m.jsx(O.StackItem,{children:f},h)),e.titleDocLink&&m.jsx(O.StackItem,{children:m.jsx(O.Button,{icon:m.jsx(ve.ExternalLinkAltIcon,{}),variant:"link",onClick:()=>window.open(e.titleDocLink,"_blank"),isInline:!0,children:c.documentation})})]}),position:"bottom-start",children:m.jsxs(O.Title,{"data-cy":"page-title",headingLevel:"h1",children:[t,m.jsx(O.Button,{variant:"link",style:{padding:0,marginTop:1,marginLeft:8,verticalAlign:"top"},children:m.jsx(ve.OutlinedQuestionCircleIcon,{})})]})}):m.jsx(O.Title,{"data-cy":"page-title",headingLevel:"h1",children:t}):m.jsx(O.Title,{headingLevel:"h1",children:m.jsx(O.Skeleton,{width:"160px"})}),l&&n&&m.jsx("div",{"data-cy":"app-description",style:{paddingTop:s?4:2,opacity:.8},children:n})]}),t&&(i||r)&&m.jsxs(O.Flex,{"data-cy":"manage-view",direction:{default:"column"},spaceItems:{default:"spaceItemsSm",xl:"spaceItemsMd"},justifyContent:{default:"justifyContentCenter"},children:[r&&m.jsx(O.FlexItem,{grow:{default:"grow"},children:r}),i&&m.jsx(O.FlexItem,{children:i})]})]}),o]})})}function BD(){return m.jsx(O.PageSection,{isFilled:!0,variant:"light",children:m.jsx(O.Bullseye,{children:m.jsx(O.Spinner,{})})})}function WD(e){return m.jsxs(v.Fragment,{children:[m.jsx(l5,{breadcrumbs:e.breadcrumbs?[{label:m.jsx(O.Skeleton,{width:"150px"}),isLoading:!0}]:void 0,title:m.jsx(O.Skeleton,{width:"200px"})}),e.tabs&&m.jsx(O.PageSection,{variant:"light",style:{paddingTop:8,paddingBottom:8},children:m.jsx(O.Skeleton,{width:"150px"})}),m.jsx(O.Divider,{}),m.jsx(BD,{})]})}var xl=(e=>(e.Default="default",e.Green="green",e.Success="success",e.Blue="blue",e.Info="info",e.Red="red",e.Danger="danger",e.Yellow="yellow",e.Orange="orange",e.Warning="warning",e.Grey="grey",e.Disabled="disabled",e))(xl||{});function Wo(e){switch(e){case"default":return;case"green":case"success":return wm;case"red":case"danger":return Em;case"yellow":case"orange":case"warning":return c5;case"blue":case"info":return Om;case"grey":case"disabled":return km}}const wm="var(--pf-v5-global--success-color--100)",Em="var(--pf-v5-global--danger-color--100)",c5="var(--pf-v5-global--warning-color--100)",Om="var(--pf-v5-global--info-color--100)",km="var(--pf-v5-global--disabled-color--100)",RD="var(--pf-v5-global--link--Color)",zD="var(--pf-v5-global--danger-color--100)";var u5=(e=>(e.blue="blue",e.cyan="cyan",e.green="green",e.orange="orange",e.purple="purple",e.red="red",e.grey="grey",e))(u5||{});const VD=v[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],UD=e=>{const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),t};function HD(){}function Fa(e,t,n={}){const r=qD(n.polyfill),i=UD(t);return VD(()=>{let o=!1;const a=e&&"current"in e?e.current:e;if(!a)return HD;function s(l,c){o||i.current(l,c)}return r.subscribe(a,s),()=>{o=!0,r.unsubscribe(a,s)}},[e,r,i]),r.observer}function GD(e){let t=!1,n=[];const r=new Map,i=new(e||window.ResizeObserver)((o,a)=>{n=n.concat(o);function s(){const l=new Set;for(let c=0;c<n.length;c++){if(l.has(n[c].target))continue;l.add(n[c].target);const u=r.get(n[c].target);u==null||u.forEach(d=>d(n[c],a))}n=[],t=!1}t||window.requestAnimationFrame(s),t=!0});return{observer:i,subscribe(o,a){var s;i.observe(o);const l=(s=r.get(o))!==null&&s!==void 0?s:[];l.push(a),r.set(o,l)},unsubscribe(o,a){var s;const l=(s=r.get(o))!==null&&s!==void 0?s:[];if(l.length===1){i.unobserve(o),r.delete(o);return}const c=l.indexOf(a);c!==-1&&l.splice(c,1),r.set(o,l)}}}let Tm;const qD=e=>Tm||(Tm=GD(e));function tr(e){const t=v.useRef(null),[n,r]=v.useState(!1),[i,o]=v.useState(!1),a=v.useCallback(()=>{if(!t.current)return;r(t.current.scrollTop>0);const c=t.current.scrollHeight-t.current.scrollTop-t.current.clientHeight-1;o(c>.1)},[]);v.useEffect(()=>a(),[a,e.children]),Fa(t,()=>a());const s=["scrollable-inner"];e.borderTop&&s.push("border-top"),e.borderBottom&&s.push("border-bottom");const l=s.join(" ");return m.jsxs("div",{className:`scrollable-outer ${e.className}`,style:e.style,children:[m.jsx("div",{className:l,ref:t,onScroll:a,children:e.children}),n&&m.jsx("div",{className:"scrollable-shadow-top"}),i&&m.jsx("div",{className:"scrollable-shadow-bottom"})]})}var ot=(e=>(e[e.Button=0]="Button",e[e.Link=1]="Link",e[e.Switch=2]="Switch",e[e.Dropdown=3]="Dropdown",e[e.Seperator=4]="Seperator",e))(ot||{}),Ye=(e=>(e[e.None=0]="None",e[e.Single=1]="Single",e[e.Multiple=2]="Multiple",e))(Ye||{});const YD=(...e)=>{console!=null&&console.warn&&(Ro(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},d5={},Am=(...e)=>{Ro(e[0])&&d5[e[0]]||(Ro(e[0])&&(d5[e[0]]=new Date),YD(...e))},f5=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},h5=(e,t,n)=>{e.loadNamespaces(t,f5(e,n))},m5=(e,t,n,r)=>{Ro(n)&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,f5(e,r))},KD=(e,t,n={})=>!t.languages||!t.languages.length?(Am("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Ro=e=>typeof e=="string",ZD=e=>typeof e=="object"&&e!==null,XD=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,JD={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},QD=e=>JD[e];let eP={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(XD,QD)};const tP=()=>eP;let nP;const rP=()=>nP,iP=v.createContext();class oP{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{var r;(r=this.usedNamespaces)[n]??(r[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const aP=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},g5=(e,t,n,r)=>e.getFixedT(t,n,r),sP=(e,t,n,r)=>v.useCallback(g5(e,t,n,r),[e,t,n,r]),$e=(e,t={})=>{var C,_,w,k;const{i18n:n}=t,{i18n:r,defaultNS:i}=v.useContext(iP)||{},o=n||r||rP();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new oP),!o){Am("You will need to pass in an i18next instance by using initReactI18next");const T=(P,A)=>Ro(A)?A:ZD(A)&&Ro(A.defaultValue)?A.defaultValue:Array.isArray(P)?P[P.length-1]:P,D=[T,{},!1];return D.t=T,D.i18n={},D.ready=!1,D}(C=o.options.react)!=null&&C.wait&&Am("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...tP(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=i||((_=o.options)==null?void 0:_.defaultNS);c=Ro(c)?[c]:c||["translation"],(k=(w=o.reportNamespaces).addUsedNamespaces)==null||k.call(w,c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(T=>KD(T,o,a)),d=sP(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),f=()=>d,h=()=>g5(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[g,p]=v.useState(f);let y=c.join();t.lng&&(y=`${t.lng}${y}`);const b=aP(y),x=v.useRef(!0);v.useEffect(()=>{const{bindI18n:T,bindI18nStore:D}=a;x.current=!0,!u&&!s&&(t.lng?m5(o,t.lng,c,()=>{x.current&&p(h)}):h5(o,c,()=>{x.current&&p(h)})),u&&b&&b!==y&&x.current&&p(h);const P=()=>{x.current&&p(h)};return T&&(o==null||o.on(T,P)),D&&(o==null||o.store.on(D,P)),()=>{x.current=!1,o&&(T==null||T.split(" ").forEach(A=>o.off(A,P))),D&&o&&D.split(" ").forEach(A=>o.store.off(A,P))}},[o,y]),v.useEffect(()=>{x.current&&u&&p(f)},[o,l,u]);const S=[g,o,u];if(S.t=g,S.i18n=o,S.ready=u,u||!u&&!s)return S;throw new Promise(T=>{t.lng?m5(o,t.lng,c,()=>T()):h5(o,c,()=>T())})};function yi(e){const t=v.useId();return qr(e)||t}function qr(e){if(typeof e=="string")return e.toLowerCase().replace(/ /g,"-").replace(/_/g,"-").replace(/\./g,"-");if(e.id)return e.id;if(e.name)return e.name.toLowerCase().replace(/ /g,"-").replace(/_/g,"-").replace(/\./g,"-");if(e.title)return e.title.toLowerCase().replace(/ /g,"-").replace(/_/g,"-").replace(/\./g,"-");if(e.label)return e.label.toLowerCase().replace(/ /g,"-").replace(/_/g,"-").replace(/\./g,"-")}function p5(e,t){if(!("selection"in e))return!1;switch(e.selection){case Ye.None:if(e.isHidden)return e.isHidden();break;case Ye.Single:if(e.isHidden)return t?e.isHidden(t):!0;break}return!1}function ju(){const[e]=Mt();return v.useCallback((t,n,r)=>{if("selection"in t){if(typeof t.isDisabled=="string")return t.isDisabled;if(t.isDisabled)switch(t.selection){case Ye.None:return t.isDisabled();case Ye.Single:return n?t.isDisabled(n):e.noSelection;case Ye.Multiple:return r?t.isDisabled(r):e.noSelections}}},[e.noSelection,e.noSelections])}function lP(e,t,n,r){if(t)return t;if(e.tooltip)return e.tooltip;if(n)return r?e.label:e.labelOff??e.label}function y5(e){const{action:t,wrapper:n,selectedItem:r,iconOnly:i}=e,a=ju()(t,r),s=n??v.Fragment,l=r&&t.isSwitchOn?t.isSwitchOn(r):!1,c=lP(t,a,i??!1,l),u=v.useId();let d=t.label;i&&t.showPinnedLabel!==!0&&(d=void 0);let f=t.labelOff;return i&&t.showPinnedLabel!==!0&&(f=void 0),m.jsx(s,{children:m.jsx("div",{"data-cy":"toggle-switch",style:{marginLeft:i?16:void 0,marginRight:i?16:void 0},children:m.jsx(O.Tooltip,{content:c,trigger:c?void 0:"manual",children:m.jsx(O.Switch,{id:u,"aria-label":t.ariaLabel(l),label:d,labelOff:f,isChecked:l,hasCheckIcon:!0,isDisabled:!!a,onChange:()=>{switch(t.selection){case Ye.None:t.onToggle(!l);break;case Ye.Single:r&&t.onToggle(r,!l);break}},isReversed:(t==null?void 0:t.isReversed)!==void 0?t.isReversed:i})})})})}const cP=Pe.div`
109
+ `;a5.displayName="RunningIcon";const s5=v.createContext({tabBreadcrumb:{},setTabBreadcrumb:()=>{}});function LD(e){const[t,n]=v.useState();return m.jsx(s5.Provider,{value:{tabBreadcrumb:t,setTabBreadcrumb:n},children:e.children})}const FD=()=>v.useContext(s5);function ND(e){const t=Lt.useNavigate();return e.breadcrumbs?m.jsx(O.Breadcrumb,{style:e.style,children:e.breadcrumbs.map((n,r)=>n.label?m.jsx(O.BreadcrumbItem,{"data-cy":n.label,id:n.id,component:n.component,isActive:n.to===void 0,children:n.to?m.jsx("a",{href:n.to,"data-cy":n.label,onClick:i=>{i.preventDefault(),n.to&&t(n.to)},children:n.label}):n.label},r):m.jsx(v.Fragment,{},r))}):m.jsx(v.Fragment,{})}function l5(e){const{title:t,description:n,controls:r,headerActions:i,footer:o}=e,a=fn("lg"),s=fn("xl"),l=fn("md"),[c]=Mt(),{tabBreadcrumb:u}=FD(),d=v.useMemo(()=>{const f=[];return e.breadcrumbs&&(f.push(...e.breadcrumbs),u&&f.push(u)),f},[e.breadcrumbs,u]);return m.jsx(O.PageSection,{variant:O.PageSectionVariants.light,className:"bg-lighten border-bottom",style:{paddingTop:(d!=null&&d.length,s?16:12),paddingBottom:s?16:12},children:m.jsxs(O.Stack,{hasGutter:!0,children:[m.jsxs(O.Flex,{flexWrap:{default:"nowrap"},alignItems:{default:"alignItemsStretch"},children:[m.jsxs(O.FlexItem,{grow:{default:"grow"},children:[d.length>0&&m.jsx(ND,{breadcrumbs:d!=null&&d.length?d:void 0,style:{paddingBottom:a?6:4}}),t?e.titleHelp?m.jsx(O.Popover,{headerContent:e.titleHelpTitle??e.title,bodyContent:m.jsxs(O.Stack,{hasGutter:!0,children:[typeof e.titleHelp=="string"?m.jsx(O.StackItem,{children:e.titleHelp}):e.titleHelp.map((f,h)=>m.jsx(O.StackItem,{children:f},h)),e.titleDocLink&&m.jsx(O.StackItem,{children:m.jsx(O.Button,{icon:m.jsx(ve.ExternalLinkAltIcon,{}),variant:"link",onClick:()=>window.open(e.titleDocLink,"_blank"),isInline:!0,iconPosition:"end",children:c.documentation})})]}),position:"bottom-start",children:m.jsxs(O.Title,{"data-cy":"page-title",headingLevel:"h1",children:[t,m.jsx(O.Button,{variant:"link",style:{padding:0,marginTop:1,marginLeft:8,verticalAlign:"top"},children:m.jsx(ve.OutlinedQuestionCircleIcon,{})})]})}):m.jsx(O.Title,{"data-cy":"page-title",headingLevel:"h1",children:t}):m.jsx(O.Title,{headingLevel:"h1",children:m.jsx(O.Skeleton,{width:"160px"})}),l&&n&&m.jsx("div",{"data-cy":"app-description",style:{paddingTop:s?4:2,opacity:.8},children:n})]}),t&&(i||r)&&m.jsxs(O.Flex,{"data-cy":"manage-view",direction:{default:"column"},spaceItems:{default:"spaceItemsSm",xl:"spaceItemsMd"},justifyContent:{default:"justifyContentCenter"},children:[r&&m.jsx(O.FlexItem,{grow:{default:"grow"},children:r}),i&&m.jsx(O.FlexItem,{children:i})]})]}),o]})})}function BD(){return m.jsx(O.PageSection,{isFilled:!0,variant:"light",children:m.jsx(O.Bullseye,{children:m.jsx(O.Spinner,{})})})}function WD(e){return m.jsxs(v.Fragment,{children:[m.jsx(l5,{breadcrumbs:e.breadcrumbs?[{label:m.jsx(O.Skeleton,{width:"150px"}),isLoading:!0}]:void 0,title:m.jsx(O.Skeleton,{width:"200px"})}),e.tabs&&m.jsx(O.PageSection,{variant:"light",style:{paddingTop:8,paddingBottom:8},children:m.jsx(O.Skeleton,{width:"150px"})}),m.jsx(O.Divider,{}),m.jsx(BD,{})]})}var xl=(e=>(e.Default="default",e.Green="green",e.Success="success",e.Blue="blue",e.Info="info",e.Red="red",e.Danger="danger",e.Yellow="yellow",e.Orange="orange",e.Warning="warning",e.Grey="grey",e.Disabled="disabled",e))(xl||{});function Wo(e){switch(e){case"default":return;case"green":case"success":return wm;case"red":case"danger":return Em;case"yellow":case"orange":case"warning":return c5;case"blue":case"info":return Om;case"grey":case"disabled":return km}}const wm="var(--pf-v5-global--success-color--100)",Em="var(--pf-v5-global--danger-color--100)",c5="var(--pf-v5-global--warning-color--100)",Om="var(--pf-v5-global--info-color--100)",km="var(--pf-v5-global--disabled-color--100)",RD="var(--pf-v5-global--link--Color)",zD="var(--pf-v5-global--danger-color--100)";var u5=(e=>(e.blue="blue",e.cyan="cyan",e.green="green",e.orange="orange",e.purple="purple",e.red="red",e.grey="grey",e))(u5||{});const VD=v[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],UD=e=>{const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),t};function HD(){}function Fa(e,t,n={}){const r=qD(n.polyfill),i=UD(t);return VD(()=>{let o=!1;const a=e&&"current"in e?e.current:e;if(!a)return HD;function s(l,c){o||i.current(l,c)}return r.subscribe(a,s),()=>{o=!0,r.unsubscribe(a,s)}},[e,r,i]),r.observer}function GD(e){let t=!1,n=[];const r=new Map,i=new(e||window.ResizeObserver)((o,a)=>{n=n.concat(o);function s(){const l=new Set;for(let c=0;c<n.length;c++){if(l.has(n[c].target))continue;l.add(n[c].target);const u=r.get(n[c].target);u==null||u.forEach(d=>d(n[c],a))}n=[],t=!1}t||window.requestAnimationFrame(s),t=!0});return{observer:i,subscribe(o,a){var s;i.observe(o);const l=(s=r.get(o))!==null&&s!==void 0?s:[];l.push(a),r.set(o,l)},unsubscribe(o,a){var s;const l=(s=r.get(o))!==null&&s!==void 0?s:[];if(l.length===1){i.unobserve(o),r.delete(o);return}const c=l.indexOf(a);c!==-1&&l.splice(c,1),r.set(o,l)}}}let Tm;const qD=e=>Tm||(Tm=GD(e));function tr(e){const t=v.useRef(null),[n,r]=v.useState(!1),[i,o]=v.useState(!1),a=v.useCallback(()=>{if(!t.current)return;r(t.current.scrollTop>0);const c=t.current.scrollHeight-t.current.scrollTop-t.current.clientHeight-1;o(c>.1)},[]);v.useEffect(()=>a(),[a,e.children]),Fa(t,()=>a());const s=["scrollable-inner"];e.borderTop&&s.push("border-top"),e.borderBottom&&s.push("border-bottom");const l=s.join(" ");return m.jsxs("div",{className:`scrollable-outer ${e.className}`,style:e.style,children:[m.jsx("div",{className:l,ref:t,onScroll:a,children:e.children}),n&&m.jsx("div",{className:"scrollable-shadow-top"}),i&&m.jsx("div",{className:"scrollable-shadow-bottom"})]})}var ot=(e=>(e[e.Button=0]="Button",e[e.Link=1]="Link",e[e.Switch=2]="Switch",e[e.Dropdown=3]="Dropdown",e[e.Seperator=4]="Seperator",e))(ot||{}),Ye=(e=>(e[e.None=0]="None",e[e.Single=1]="Single",e[e.Multiple=2]="Multiple",e))(Ye||{});const YD=(...e)=>{console!=null&&console.warn&&(Ro(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},d5={},Am=(...e)=>{Ro(e[0])&&d5[e[0]]||(Ro(e[0])&&(d5[e[0]]=new Date),YD(...e))},f5=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},h5=(e,t,n)=>{e.loadNamespaces(t,f5(e,n))},m5=(e,t,n,r)=>{Ro(n)&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,f5(e,r))},KD=(e,t,n={})=>!t.languages||!t.languages.length?(Am("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Ro=e=>typeof e=="string",ZD=e=>typeof e=="object"&&e!==null,XD=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,JD={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},QD=e=>JD[e];let eP={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(XD,QD)};const tP=()=>eP;let nP;const rP=()=>nP,iP=v.createContext();class oP{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{var r;(r=this.usedNamespaces)[n]??(r[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const aP=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},g5=(e,t,n,r)=>e.getFixedT(t,n,r),sP=(e,t,n,r)=>v.useCallback(g5(e,t,n,r),[e,t,n,r]),$e=(e,t={})=>{var C,_,w,k;const{i18n:n}=t,{i18n:r,defaultNS:i}=v.useContext(iP)||{},o=n||r||rP();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new oP),!o){Am("You will need to pass in an i18next instance by using initReactI18next");const T=(P,A)=>Ro(A)?A:ZD(A)&&Ro(A.defaultValue)?A.defaultValue:Array.isArray(P)?P[P.length-1]:P,D=[T,{},!1];return D.t=T,D.i18n={},D.ready=!1,D}(C=o.options.react)!=null&&C.wait&&Am("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...tP(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=i||((_=o.options)==null?void 0:_.defaultNS);c=Ro(c)?[c]:c||["translation"],(k=(w=o.reportNamespaces).addUsedNamespaces)==null||k.call(w,c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(T=>KD(T,o,a)),d=sP(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),f=()=>d,h=()=>g5(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[g,p]=v.useState(f);let y=c.join();t.lng&&(y=`${t.lng}${y}`);const b=aP(y),x=v.useRef(!0);v.useEffect(()=>{const{bindI18n:T,bindI18nStore:D}=a;x.current=!0,!u&&!s&&(t.lng?m5(o,t.lng,c,()=>{x.current&&p(h)}):h5(o,c,()=>{x.current&&p(h)})),u&&b&&b!==y&&x.current&&p(h);const P=()=>{x.current&&p(h)};return T&&(o==null||o.on(T,P)),D&&(o==null||o.store.on(D,P)),()=>{x.current=!1,o&&(T==null||T.split(" ").forEach(A=>o.off(A,P))),D&&o&&D.split(" ").forEach(A=>o.store.off(A,P))}},[o,y]),v.useEffect(()=>{x.current&&u&&p(f)},[o,l,u]);const S=[g,o,u];if(S.t=g,S.i18n=o,S.ready=u,u||!u&&!s)return S;throw new Promise(T=>{t.lng?m5(o,t.lng,c,()=>T()):h5(o,c,()=>T())})};function yi(e){const t=v.useId();return qr(e)||t}function qr(e){if(typeof e=="string")return e.toLowerCase().replace(/ /g,"-").replace(/_/g,"-").replace(/\./g,"-");if(e.id)return e.id;if(e.name)return e.name.toLowerCase().replace(/ /g,"-").replace(/_/g,"-").replace(/\./g,"-");if(e.title)return e.title.toLowerCase().replace(/ /g,"-").replace(/_/g,"-").replace(/\./g,"-");if(e.label)return e.label.toLowerCase().replace(/ /g,"-").replace(/_/g,"-").replace(/\./g,"-")}function p5(e,t){if(!("selection"in e))return!1;switch(e.selection){case Ye.None:if(e.isHidden)return e.isHidden();break;case Ye.Single:if(e.isHidden)return t?e.isHidden(t):!0;break}return!1}function ju(){const[e]=Mt();return v.useCallback((t,n,r)=>{if("selection"in t){if(typeof t.isDisabled=="string")return t.isDisabled;if(t.isDisabled)switch(t.selection){case Ye.None:return t.isDisabled();case Ye.Single:return n?t.isDisabled(n):e.noSelection;case Ye.Multiple:return r?t.isDisabled(r):e.noSelections}}},[e.noSelection,e.noSelections])}function lP(e,t,n,r){if(t)return t;if(e.tooltip)return e.tooltip;if(n)return r?e.label:e.labelOff??e.label}function y5(e){const{action:t,wrapper:n,selectedItem:r,iconOnly:i}=e,a=ju()(t,r),s=n??v.Fragment,l=r&&t.isSwitchOn?t.isSwitchOn(r):!1,c=lP(t,a,i??!1,l),u=v.useId();let d=t.label;i&&t.showPinnedLabel!==!0&&(d=void 0);let f=t.labelOff;return i&&t.showPinnedLabel!==!0&&(f=void 0),m.jsx(s,{children:m.jsx("div",{"data-cy":"toggle-switch",style:{marginLeft:i?16:void 0,marginRight:i?16:void 0},children:m.jsx(O.Tooltip,{content:c,trigger:c?void 0:"manual",children:m.jsx(O.Switch,{id:u,"aria-label":t.ariaLabel(l),label:d,labelOff:f,isChecked:l,hasCheckIcon:!0,isDisabled:!!a,onChange:()=>{switch(t.selection){case Ye.None:t.onToggle(!l);break;case Ye.Single:r&&t.onToggle(r,!l);break}},isReversed:(t==null?void 0:t.isReversed)!==void 0?t.isReversed:i})})})})}const cP=Pe.div`
110
110
  --pf-v5-c-dropdown__menu-item-icon--Width: ${({$hasSwitches:e})=>e?"40px":void 0};
111
111
  --pf-v5-c-dropdown__menu-item-icon--MarginRight: ${({$hasSwitches:e})=>e?"16px":void 0};
112
112
  --pf-v5-c-dropdown__menu-item--Color: ${({$isDanger:e})=>e?"var(--pf-v5-global--danger-color--100)":void 0};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ansible/ansible-ui-framework",
3
3
  "description": "A framework for building applications using PatternFly.",
4
- "version": "2.4.2599",
4
+ "version": "2.4.2600",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",