import{j as e,c as o}from"./Button.BVfR1y85.js";import{r as u}from"./index.eCxJ45ll.js";import{T as S,a as q,b as j,c,d as v,e as l,f as h,g as w,A as y}from"./AutoLinkHeader.BijNRLMB.js";import{S as f}from"./c_table__sticky_cell_InsetInlineStart.DGzYmtkF.js";import{C as P}from"./Content.CYLxURqU.js";import{L as R}from"./Label.CM_es7Cu.js";import{S as m}from"./StackItem.CMxajCCo.js";/* empty css                        */import"./DropdownList.DP2npVYh.js";import"./angle-down-icon.Dqz5ba9D.js";import"./divider.BP4XR7uq.js";import"./index.BQFV5hT1.js";import"./angle-left-icon.CfKwuSCS.js";const p={textColorRequired:"pf-v6-u-text-color-required",textColorSubtle:"pf-v6-u-text-color-subtle"},k=({componentName:s,headingLevel:i="h3",componentDescription:a,componentProps:n})=>{const t=n?.filter(r=>!r.isHidden),b=!!t?.length,T=r=>{const{name:D,isBeta:d,isDeprecated:x}=r;return!d&&!x?null:(d&&x&&console.error(`The ${D} prop for ${s} has both the isBeta and isDeprecated tag.`),e.jsx(R,{color:`${d?"blue":"grey"}`,isCompact:!0,children:d?"Beta":"Deprecated"}))},g=r=>r?e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",className:o(p.textColorRequired),children:"*"}),e.jsx("span",{className:o(w.screenReader),children:"required"})]}):null;return e.jsxs("div",{children:[e.jsx(P,{component:i,children:s}),e.jsxs(f,{hasGutter:!0,children:[a&&e.jsx("div",{"data-testid":"component-description",className:o(p.textColorSubtle),children:a}),b&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:`${s}-required-description`,children:[e.jsx("span",{className:o(p.textColorRequired),children:"*"})," ",e.jsx("span",{className:o(p.textColorSubtle),children:"indicates a required prop"})]}),e.jsxs(S,{variant:"compact","aria-label":`Props for ${s}`,"aria-describedby":`${s}-required-description`,gridBreakPoint:"grid-lg",children:[e.jsx(q,{children:e.jsxs(j,{children:[e.jsx(c,{width:20,children:"Name"}),e.jsx(c,{width:20,children:"Type"}),e.jsx(c,{width:10,children:"Default"}),e.jsx(c,{children:"Description"})]})}),e.jsx(v,{children:t.map(r=>e.jsxs(j,{children:[e.jsx(l,{children:e.jsxs(h,{wrapModifier:"breakWord",children:[r.name,g(r.isRequired)," ",T(r)]})}),e.jsx(l,{children:e.jsx(h,{wrapModifier:"breakWord",children:r.type||"No type info available"})}),e.jsx(l,{children:e.jsx(h,{wrapModifier:"breakWord",children:r.defaultValue||"-"})}),e.jsx(l,{children:e.jsx(h,{wrapModifier:"breakWord",children:r.description||"No description available."})})]},r.name))})]})]})]})]})};async function $(s,i){if(!s||s.length===0)return[];const a=new URL(`/props?components=${s}`,i);try{return await(await fetch(a.toString())).json()}catch(n){return console.error(n),[]}}const V=({propComponents:s,url:i})=>{const[a,n]=u.useState([]);return u.useEffect(()=>{$(s,i).then(n)},[s,i]),e.jsxs(f,{hasGutter:!0,children:[e.jsx(m,{children:e.jsx(y,{headingLevel:"h2",className:"pf-v6-c-content--h2",id:"props-table",children:"Props"})}),a.filter(t=>!!t).map(t=>e.jsx(m,{children:e.jsx(k,{componentName:t.name,componentDescription:t.description,componentProps:t.props})},t.name))]})};export{V as PropsTables};
