@aiquants/console-ui 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkHFWVEGN3cjs = require('./chunk-HFWVEGN3.cjs');var _chunkBEDKWWJCcjs = require('./chunk-BEDKWWJC.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var oe=_react.createContext.call(void 0, null),We=" ",Ze='[inert], [aria-hidden="true" i]',Pe="dialog:modal",ze=e=>{if(e.closest(Ze)!==null)return'an ancestor is inert or aria-hidden="true"';let t=e.ownerDocument,o=[...t.querySelectorAll(Pe)],r=t.activeElement,n=o.filter(l=>l.contains(r)),a=n.length>0?n:o,s=a.filter(l=>l.contains(e)).length;return s===a.length?null:s===0?"the topmost open modal dialog does not contain the console":"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"},Ye=e=>{try{e.querySelectorAll(Pe)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},re= exports.ANNOUNCE_SETTLE_MS =150,Xe=1e3,Je= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(_react.useContext.call(void 0, oe)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=_chunkHFWVEGN3cjs.o.call(void 0, e),[l]=Intl.getCanonicalLocales(t),d=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(l,{timeZone:o}).resolvedOptions().timeZone,[l,o]),u=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Ye(u.current.ownerDocument)},[]);let i=_react.useCallback.call(void 0, y=>{if(y.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let R=()=>{let{texts:N,settle:g,deadline:b}=p.current;p.current=null,clearTimeout(g),clearTimeout(b);let f=u.current;if(f===null)return;let T=N.join(We),h=ze(f);if(h!==null)throw new Error(`announce: the live region is hidden from assistive technology (${h}), so this announcement would be lost: ${T}`);let L=f.ownerDocument.createElement("span");L.textContent=T,f.replaceChildren(L)},P=p.current;if(P===null){p.current={texts:[y],settle:setTimeout(R,re),deadline:setTimeout(R,Xe)};return}P.texts.push(y),clearTimeout(P.settle),P.settle=setTimeout(R,re)},[]),c=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:l,timeZone:d,labels:s,announce:i}),[e,l,d,s,i]);return _jsxruntime.jsx.call(void 0, oe.Provider,{value:c,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:u})]})})},w= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, oe);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},m=()=>{w()},Qe= exports.useAnnounce =()=>w().announce;var E=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var x=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:l,children:d})=>(m(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:l,children:d}));var ot={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"prose"}},Ee=({children:e})=>_jsxruntime.jsx.call(void 0, "span",{children:e}),O= exports.Button =({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:l,ref:d,dataAttributes:u,busy:p,busyLabel:i})=>{m();let c=_react.useId.call(void 0, ),y=p===!0||a!==void 0,R=ot[e],P=N=>{if(y){N.preventDefault();return}_optionalChain([n, 'optionalCall', _2 => _2(N)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":R.fg,"data-cui-surface":R.surface,"data-cui-type":R.type,"data-testid":o,"aria-disabled":y?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:c,"aria-expanded":s,"aria-controls":l,onClick:P,ref:d,...E(u),children:_jsxruntime.jsx.call(void 0, Ee,{children:p===!0?i:t})}),a===void 0?null:_jsxruntime.jsx.call(void 0, x,{fg:"fg-muted",type:"body",id:c,testId:`${o}-reason`,children:a.reason})]})},rt= exports.Link =({onNavigate:e,children:t,testId:o,ref:r})=>(m(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"prose","data-testid":o,onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, Ee,{children:t})}));var nt=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:l,children:d})=>{m();let u=_react.useId.call(void 0, );return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":u,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...E(l),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:u,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),d]})},st= exports.CardSection =({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:l,children:d})=>{m();let u=_react.useId.call(void 0, ),p=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"cui-card-section-title",id:u,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),d]});return r?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":n,ref:s,...E(l),children:p}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...E(l),children:p})};var D=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var ct=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{m();let s=_react.useId.call(void 0, );for(let i of[r,n])if(!(Number.isFinite(i)&&i>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${i}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let i of o)for(let c of t)if(!Object.hasOwn(i.cells,c.key))throw new RangeError(`Column "${i.key}" has no value for attribute "${c.key}"`);let l=r+o.length*n,d=`cui-comparison-a${r}-c${n}-n${o.length}`,u=i=>`[data-cui-comparison="${d}"][data-cui-comparison-layout="${i}"]`,p=`${u("table")}{display:none}@container (min-width:${_chunkHFWVEGN3cjs.p.call(void 0, l)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, D,{ruleKey:d,css:p}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":d,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"prose",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkHFWVEGN3cjs.p.call(void 0, r)}}),o.map(i=>_jsxruntime.jsx.call(void 0, "col",{},i.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),o.map(i=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:i.heading},i.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(i=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:i.label}),o.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[i.key]("table")},c.key))]},i.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":d,"data-cui-comparison-layout":"stack",children:o.map((i,c)=>{let y=`${s}-column-${c}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":y,"data-cui-type":"prose",children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-comparison-heading",id:y,children:i.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(R=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:R.label}),_jsxruntime.jsx.call(void 0, "dd",{children:i.cells[R.key]("stack")})]},R.key))})]},i.key)})})]})};var pt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:l,empty:d,testId:u,ref:p})=>{m();let i=_react.useId.call(void 0, ),c=_chunkHFWVEGN3cjs.s.call(void 0, o);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":u,ref:p,children:r.length===0?_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"prose",testId:`${u}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":i,"data-testid":`${u}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"prose","data-cui-row-size":l,style:{"--cui-table-min":_chunkHFWVEGN3cjs.p.call(void 0, c)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:i,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:o.map(y=>_jsxruntime.jsx.call(void 0, "col",{style:y.width.fixedPx===void 0?void 0:{width:_chunkHFWVEGN3cjs.p.call(void 0, y.width.fixedPx)}},y.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:o.map(y=>_jsxruntime.jsx.call(void 0, "th",{scope:"col","data-cui-align":y.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:y.header},y.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{children:r.map(y=>_jsxruntime.jsx.call(void 0, "tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...E(_optionalChain([s, 'optionalCall', _3 => _3(y)])),children:o.map(R=>_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":R.align,children:R.cell(y)},R.key))},n(y)))})]})})})};var B=({description:e,error:t})=>{m();let o=_react.useId.call(void 0, ),r=_react.useId.call(void 0, ),n=_react.useId.call(void 0, ),a=[e===void 0?null:r,t===void 0?null:n].filter(l=>l!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},q=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),mt= exports.Field =({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:l}=B({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),_jsxruntime.jsx.call(void 0, q,{description:t,error:o,descriptionId:s,errorId:l,testId:r})]})},ft= exports.TextInput =({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:l,testId:d,ref:u})=>{let{control:p,descriptionId:i,errorId:c}=B({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:a,value:r,list:s,required:l,onChange:y=>n(y.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":d,ref:u,...p}),_jsxruntime.jsx.call(void 0, q,{description:t,error:o,descriptionId:i,errorId:c,testId:d})]})},gt= exports.TextArea =({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:l})=>{let{control:d,descriptionId:u,errorId:p}=B({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:d.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:i=>n(i.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:l,...d}),_jsxruntime.jsx.call(void 0, q,{description:t,error:o,descriptionId:u,errorId:p,testId:s})]})},Rt= exports.Select =({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:l})=>{let{control:d,descriptionId:u,errorId:p}=B({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:d.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",value:r,onChange:i=>a(i.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:l,...d,children:n.map(i=>_jsxruntime.jsx.call(void 0, "option",{value:i.value,children:i.label},i.value))}),_jsxruntime.jsx.call(void 0, q,{description:t,error:o,descriptionId:u,errorId:p,testId:s})]})},bt= exports.RadioGroup =({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:l})=>{let d=_react.useId.call(void 0, ),{control:u,descriptionId:p,errorId:i}=B({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":u["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((c,y)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:d,value:c.value,checked:c.value===r,onChange:()=>a(c.value),"aria-invalid":u["aria-invalid"],"data-testid":`${s}-option-${c.value}`,ref:y===0?l:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:c.label})]},c.value)),_jsxruntime.jsx.call(void 0, q,{description:t,error:o,descriptionId:p,errorId:i,testId:s})]})};var ht=({tone:e,testId:t,children:o})=>(m(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-testid":t,children:o})),_= exports.AlertMessage =({occurrence:e,testId:t,children:o})=>(m(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));var xt=e=>e+1,ae= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),o=_react.useRef.call(void 0, null),[,r]=_react.useReducer.call(void 0, xt,0),n=_react.useCallback.call(void 0, (a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return _react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),n};var ne="[data-cui-row-focus]",Et=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(ne)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${ne} elements for ${e.count} rows`);return o},Nt=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},Mt= exports.LoadMore =({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:l,labels:d}=w(),u=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),i=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),y=()=>{let g=a.ref.current;u.current={shown:new Set(g===null?[]:g.querySelectorAll(ne)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let g=c.current;c.current=!1;let b=u.current;if(b===null)return;let f=Et(a);if(t){b.busySeen=!0,b.shown=new Set(f);return}let T=Nt(f,b.shown),h=r!==null&&r.occurrence!==b.failureOccurrence;if(!(b.busySeen||T!==void 0||h||o)||(u.current=null,h||T===void 0))return;let L=[null,document.body].includes(document.activeElement);(i.current!==null&&document.activeElement===i.current||g&&L)&&T.focus()});let R=ae(()=>o?p.current:i.current),P=_react.useCallback.call(void 0, (g=>{i.current=g;let b=R(g);return()=>{i.current=null,c.current=g===document.activeElement,b()}}),[R]),N=_react.useCallback.call(void 0, (g=>{p.current=g;let b=R(g);return()=>{p.current=null,b()}}),[R]);return o?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:N,testId:`${s}-end`,children:d.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:[_jsxruntime.jsx.call(void 0, O,{variant:"secondary",busy:t,busyLabel:d.loading,onClick:y,ref:P,testId:`${s}-button`,children:d.loadMore(_chunkHFWVEGN3cjs.a.call(void 0, n,l))}),r===null?null:_jsxruntime.jsx.call(void 0, _,{occurrence:r.occurrence,testId:`${s}-failure`,children:d.loadFailed(r.reason)})]})};var Lt=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{m();let a=_chunkHFWVEGN3cjs.r.call(void 0, {masterMinPx:o,detailMinPx:r,gapPx:_chunkHFWVEGN3cjs.C.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, D,{ruleKey:a.key,css:a.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};var ie=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=w();if(e===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=_chunkHFWVEGN3cjs.a.call(void 0, e,r);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};var kt={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},St={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},It= exports.Pill =({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{m();let a=t==="tint"?kt[e]:{fg:"on-solid",surface:St[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...E(r),children:n})};var Dt=({label:e,valueText:t,value:o,max:r,testId:n})=>{m();let a=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":n,children:[_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg",type:"body",id:a,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _8 => _8.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _9 => _9.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};var Ht=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=w();return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":a,children:[_jsxruntime.jsx.call(void 0, _,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:_jsxruntime.jsx.call(void 0, O,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};var Fe=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(m(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"prose","data-testid":r,onClick:o,ref:a,...E(n),children:s})),Ot= exports.SelectableList =({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:l,rowData:d,empty:u,testId:p,ref:i})=>(m(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:i,children:t.length===0?_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let y=o(c);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, Fe,{selected:y===r,controls:a,onSelect:()=>n(c),testId:l,dataAttributes:_optionalChain([d, 'optionalCall', _10 => _10(c)]),children:s(c)})},y)})})}));var $t=({gap:e,testId:t,children:o})=>(m(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Bt= exports.Cluster =({gap:e,testId:t,children:o})=>(m(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));var Vt={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Wt= exports.MetricTile =({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(m(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...E(a),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":Vt[r],"data-cui-type":"heading",children:_jsxruntime.jsx.call(void 0, ie,{value:o,testId:`${n}-value`})})]})},Ue=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?Ue(t.props.children):[t]}),Zt= exports.TileGrid =({count:e,minInlinePx:t,testId:o,children:r})=>{m();let n=_chunkHFWVEGN3cjs.w.call(void 0, e,t,_chunkHFWVEGN3cjs.C.space["space-2"]),a=Ue(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":o,children:[_jsxruntime.jsx.call(void 0, D,{ruleKey:n.key,css:n.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};var Yt=229,Xt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),Jt=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Xt.has(e.type)&&(e.value!==""||e.validity.badInput),Qt= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Yt||Jt(t.target)||(t.stopPropagation(),e())},[e]);var Ke=e=>e===null?_chunkHFWVEGN3cjs.i:_chunkHFWVEGN3cjs.j,J=(e,t,o,r,n)=>{let[a,s]=_react.useState.call(void 0, ()=>({key:e,state:Ke(e)})),[l,d]=_react.useState.call(void 0, 0),[u,p]=_react.useState.call(void 0, 0),i=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, l);_react.useLayoutEffect.call(void 0, ()=>{i.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkHFWVEGN3cjs.i});return}let f=new AbortController;c.current=e;let T=l===y.current?"revision":"reload";return y.current=l,s(h=>Object.is(h.key,e)?{key:e,state:r(h.state,T)}:{key:e,state:_chunkHFWVEGN3cjs.j}),i.current(f.signal).then(h=>{f.signal.aborted||(c.current=null,s(L=>({key:e,state:n(L.state,h)})))},h=>{f.signal.aborted||s(()=>{throw h})}),()=>{f.abort(),c.current=null}},[e,o,l,u]);let R=_react.useCallback.call(void 0, ()=>d(f=>f+1),[]),P=_react.useCallback.call(void 0, ()=>p(f=>f+1),[]),N=_react.useCallback.call(void 0, (f,T)=>{s(h=>Object.is(h.key,f)?{key:f,state:T(h.state)}:h)},[]),g=_react.useCallback.call(void 0, (f,T)=>{N(f,T),Object.is(c.current,f)&&P()},[N,P]);return{state:Object.is(a.key,e)?a.state:Ke(e),reload:R,refresh:P,update:N,write:g}};var oo=(e,t,o)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let n=_react.useCallback.call(void 0, g=>r.current.first(g),[]),{state:a,reload:s,refresh:l,update:d,write:u}=J(e,n,o,_chunkHFWVEGN3cjs.x,_chunkHFWVEGN3cjs.y),p=_react.useRef.call(void 0, {key:e,state:a});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:a}});let i=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([i, 'access', _11 => _11.current, 'optionalAccess', _12 => _12.controller, 'access', _13 => _13.abort, 'call', _14 => _14()]),i.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,o,c]);let y=_react.useCallback.call(void 0, ()=>{c(),s()},[c,s]),R=_react.useCallback.call(void 0, ()=>{c(),l()},[c,l]),P=_react.useCallback.call(void 0, ()=>{let{key:g,state:b}=p.current;if(g===null||b.kind!=="ready"||b.refreshing||b.value.next===null||b.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let f=b.value.next,T={key:g,controller:new AbortController,maps:[]};i.current=T,d(g,_chunkHFWVEGN3cjs.z),r.current.next(f,T.controller.signal).then(h=>{i.current===T&&(i.current=null,d(g,L=>T.maps.reduce(($e,Be)=>_chunkHFWVEGN3cjs.B.call(void 0, $e,Be),_chunkHFWVEGN3cjs.A.call(void 0, L,f,h))))},h=>{i.current===T&&d(g,()=>{throw h})})},[d]),N=_react.useCallback.call(void 0, (g,b)=>{let f=i.current;f!==null&&Object.is(f.key,g)&&f.maps.push(b),u(g,T=>_chunkHFWVEGN3cjs.B.call(void 0, T,b))},[u]);return{state:a,reload:y,refresh:R,loadMore:P,updateList:N}};var ao=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=J(e,t,o,_chunkHFWVEGN3cjs.k,_chunkHFWVEGN3cjs.l),l=_react.useCallback.call(void 0, (d,u)=>s(d,p=>_chunkHFWVEGN3cjs.l.call(void 0, p,{ok:!0,value:u})),[s]);return{state:r,reload:n,refresh:a,put:l}};var no=({testId:e,children:t})=>(m(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = re; exports.AlertMessage = _; exports.Button = O; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkHFWVEGN3cjs.n; exports.CONTRAST_MINIMUM = _chunkBEDKWWJCcjs.c; exports.CONTRAST_PAIRS = _chunkBEDKWWJCcjs.d; exports.Card = nt; exports.CardSection = st; exports.Cluster = Bt; exports.ComparisonGrid = ct; exports.ConsoleUiRoot = Je; exports.DataTable = pt; exports.Field = mt; exports.HTTP_FORBIDDEN = _chunkHFWVEGN3cjs.f; exports.Link = rt; exports.LoadMore = Mt; exports.MasterDetail = Lt; exports.Measured = ie; exports.MetricTile = Wt; exports.Notice = ht; exports.Pill = It; exports.ProgressBar = Dt; exports.RadioGroup = bt; exports.ResourceFailed = Ht; exports.RowButton = Fe; exports.Select = Rt; exports.SelectableList = Ot; exports.Stack = $t; exports.TOKENS = _chunkHFWVEGN3cjs.C; exports.Text = x; exports.TextArea = gt; exports.TextInput = ft; exports.TileGrid = Zt; exports.VisuallyHidden = no; exports.ZonedTimeError = _chunkHFWVEGN3cjs.b; exports.beginPage = _chunkHFWVEGN3cjs.z; exports.beginPagedReload = _chunkHFWVEGN3cjs.x; exports.beginReload = _chunkHFWVEGN3cjs.k; exports.ceil8 = _chunkHFWVEGN3cjs.v; exports.contrastRatio = _chunkBEDKWWJCcjs.b; exports.cssVar = _chunkHFWVEGN3cjs.D; exports.flatMapOutcome = _chunkHFWVEGN3cjs.h; exports.formatCount = _chunkHFWVEGN3cjs.a; exports.formatInstant = _chunkHFWVEGN3cjs.e; exports.hexToSrgb = _chunkBEDKWWJCcjs.a; exports.keepLastGood = _chunkHFWVEGN3cjs.l; exports.mapOutcome = _chunkHFWVEGN3cjs.g; exports.mapPagedList = _chunkHFWVEGN3cjs.B; exports.masterDetailPlan = _chunkHFWVEGN3cjs.q; exports.monoTextWidthEm = _chunkHFWVEGN3cjs.u; exports.reasonAside = _chunkHFWVEGN3cjs.m; exports.resolveConsoleUiLabels = _chunkHFWVEGN3cjs.o; exports.settleFirstPage = _chunkHFWVEGN3cjs.y; exports.settlePage = _chunkHFWVEGN3cjs.A; exports.tableMinInlinePx = _chunkHFWVEGN3cjs.s; exports.textWidthEm = _chunkHFWVEGN3cjs.t; exports.tileGridPlan = _chunkHFWVEGN3cjs.w; exports.toOffsetIso = _chunkHFWVEGN3cjs.c; exports.toWallTime = _chunkHFWVEGN3cjs.d; exports.useAnnounce = Qe; exports.useConsoleUi = w; exports.useEscapeToClose = Qt; exports.useFocusRescue = ae; exports.usePagedResource = oo; exports.useResource = ao;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkA4D4K2WFcjs = require('./chunk-A4D4K2WF.cjs');var _chunkIR2WTSOWcjs = require('./chunk-IR2WTSOW.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var ce=_react.createContext.call(void 0, null),xt=" ",Be='[inert], [aria-hidden="true" i]',_e="dialog:modal",pe="data-cui-dialog-announcer",Et=`:scope > [${pe}]`,Nt=e=>{if(e.closest(Be)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(_e)],r=t.activeElement,n=o.filter(c=>c.contains(r)),a=n.length>0?n:o,s=a.filter(c=>c.contains(e)).length;if(s===a.length)return{region:e};let d=a.find(c=>a.every(p=>p.contains(c))),i=_nullishCoalesce(_optionalChain([d, 'optionalAccess', _2 => _2.querySelector, 'call', _3 => _3(Et)]), () => (null));return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Be)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},Pt=e=>{try{e.querySelectorAll(_e)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ue= exports.ANNOUNCE_SETTLE_MS =150,wt=1e3,Mt= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(_react.useContext.call(void 0, ce)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=_chunkA4D4K2WFcjs.o.call(void 0, e),[d]=Intl.getCanonicalLocales(t),i=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Pt(c.current.ownerDocument)},[]);let l=_react.useCallback.call(void 0, m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let g=()=>{let{texts:w,settle:b,deadline:R}=p.current;p.current=null,clearTimeout(b),clearTimeout(R);let f=c.current;if(f===null)return;let h=w.join(xt),T=Nt(f);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let L=f.ownerDocument.createElement("span");L.textContent=h,T.region.replaceChildren(L)},x=p.current;if(x===null){p.current={texts:[m],settle:setTimeout(g,ue),deadline:setTimeout(g,wt)};return}x.texts.push(m),clearTimeout(x.settle),x.settle=setTimeout(g,ue)},[]),y=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return _jsxruntime.jsx.call(void 0, ce.Provider,{value:y,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:c})]})})},N= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, ce);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},u=()=>{N()},St= exports.useAnnounce =()=>N().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};var kt=({items:e,current:t,onNavigate:o,testId:r})=>{let{labels:n}=N();if(new Set(e.map(a=>a.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(a=>a.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(a=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:a.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${a.id}`,onClick:s=>J(s,a.href,o),children:a.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},a.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};var P=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var v=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:d,children:i})=>(u(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:d,children:i}));var Dt={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ve=({children:e})=>_jsxruntime.jsx.call(void 0, "span",{children:e}),S= exports.Button =({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:d,ref:i,dataAttributes:c,busy:p,busyLabel:l})=>{u();let y=_react.useId.call(void 0, ),m=p===!0||a!==void 0,g=Dt[e],x=w=>{if(m){w.preventDefault();return}_optionalChain([n, 'optionalCall', _4 => _4(w)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":g.fg,"data-cui-surface":g.surface,"data-cui-type":g.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:x,ref:i,...P(c),children:_jsxruntime.jsx.call(void 0, Ve,{children:p===!0?l:t})}),a===void 0?null:_jsxruntime.jsx.call(void 0, v,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:a.reason})]})},$t= exports.Link =({onNavigate:e,children:t,testId:o,ref:r})=>(u(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, Ve,{children:t})}));var ye=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=_react.useId.call(void 0, );return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":c,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...P(d),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:c,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),i]})},Ft= exports.CardSection =({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=_react.useId.call(void 0, ),p=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return r?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:p}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:p})};var Ot=({label:e,code:t,testId:o})=>(u(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":o,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${o}-code`,children:t})}));var H=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var qt=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{u();let s=_react.useId.call(void 0, );for(let l of[r,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=r+o.length*n,i=`cui-comparison-a${r}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,p=`${c("table")}{display:none}@container (min-width:${_chunkA4D4K2WFcjs.p.call(void 0, d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:i,css:p}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkA4D4K2WFcjs.p.call(void 0, r)}}),o.map(l=>_jsxruntime.jsx.call(void 0, "col",{},l.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),o.map(l=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:l.heading},l.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(l=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:l.label}),o.map(y=>_jsxruntime.jsx.call(void 0, "td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:o.map((l,y)=>{let m=`${s}-column-${y}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-comparison-heading",id:m,children:l.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(g=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:g.label}),_jsxruntime.jsx.call(void 0, "dd",{children:l.cells[g.key]("stack")})]},g.key))})]},l.key)})})]})};var Gt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:d,empty:i,testId:c,ref:p})=>{u();let l=_react.useId.call(void 0, ),y=_chunkA4D4K2WFcjs.s.call(void 0, o);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":c,ref:p,children:r.length===0?_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):_jsxruntime.jsx.call(void 0, "section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":_chunkA4D4K2WFcjs.p.call(void 0, y)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:o.map(m=>_jsxruntime.jsx.call(void 0, "col",{style:m.width.fixedPx===void 0?void 0:{width:_chunkA4D4K2WFcjs.p.call(void 0, m.width.fixedPx)}},m.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:o.map(m=>_jsxruntime.jsx.call(void 0, "th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{children:r.map(m=>_jsxruntime.jsx.call(void 0, "tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...P(_optionalChain([s, 'optionalCall', _5 => _5(m)])),children:o.map(g=>_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":g.align,children:g.cell(m)},g.key))},n(m)))})]})})})};var zt=({items:e,testId:t})=>{if(u(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:o.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};var Zt=229,Yt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),fe=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Yt.has(e.type)&&(e.value!==""||e.validity.badInput),Xt= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Zt||fe(t.target)||(t.stopPropagation(),e())},[e]);var Ye=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},jt= exports.Dialog =({title:e,open:t,onClose:o,testId:r,children:n})=>{let{labels:a}=N(),s=_react.useId.call(void 0, ),d=_react.useRef.call(void 0, null),i=_react.useRef.call(void 0, null);return _react.useLayoutEffect.call(void 0, ()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),_react.useLayoutEffect.call(void 0, ()=>{let l=d.current;return()=>{l.open&&(l.close(),Ye(i.current),i.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onClose:()=>{Ye(i.current),i.current=null,t&&o()},onCancel:l=>{fe(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",testId:`${r}-close`,onClick:()=>_optionalChain([d, 'access', _6 => _6.current, 'optionalAccess', _7 => _7.close, 'call', _8 => _8()]),children:a.close})})]}),n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[pe]:"","data-testid":`${r}-announcer`})]})};var to=({summary:e,open:t,onOpenChange:o,testId:r,children:n})=>{u();let a=_react.useId.call(void 0, );return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":r,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":a,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>o(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:a,hidden:!t,"data-testid":`${r}-panel`,children:n})]})};var q=({description:e,error:t})=>{u();let o=_react.useId.call(void 0, ),r=_react.useId.call(void 0, ),n=_react.useId.call(void 0, ),a=[e===void 0?null:r,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),oo= exports.Field =({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:s,errorId:d,testId:r})]})},ro= exports.TextInput =({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:d,testId:i,ref:c})=>{let{control:p,descriptionId:l,errorId:y}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${i}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:a,value:r,list:s,required:d,onChange:m=>n(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":i,ref:c,...p}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},ao= exports.TextArea =({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},no= exports.Select =({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",value:r,onChange:l=>a(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>_jsxruntime.jsx.call(void 0, "option",{value:l.value,children:l.label},l.value))}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},so= exports.RadioGroup =({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let i=_react.useId.call(void 0, ),{control:c,descriptionId:p,errorId:l}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:i,value:y.value,checked:y.value===r,onChange:()=>a(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:y.label})]},y.value)),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:p,errorId:l,testId:s})]})};var lo={1:"h1",2:"h2",3:"h3"},co= exports.Heading =({level:e,type:t,testId:o,headingRef:r,children:n})=>{u();let a=lo[e];return _jsxruntime.jsx.call(void 0, a,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:r,tabIndex:r===void 0?void 0:-1,children:n})};var po={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},yo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},be= exports.Pill =({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{u();let a=t==="tint"?po[e]:{fg:"on-solid",surface:yo[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...P(r),children:n})};var Re=({label:e,valueText:t,value:o,max:r,testId:n})=>{u();let a=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":n,children:[_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg",type:"body",id:a,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _9 => _9.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _10 => _10.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};var bo=({title:e,status:t,progress:o,cancel:r,testId:n,children:a})=>_jsxruntime.jsxs.call(void 0, ye,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${n}-cancel`,children:r.label}),testId:n,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, be,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:_jsxruntime.jsx.call(void 0, Re,{...o,testId:`${n}-progress`}),a]});var Ro=({tone:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-testid":t,children:o})),V= exports.AlertMessage =({occurrence:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));var vo=e=>e+1,Te= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),o=_react.useRef.call(void 0, null),[,r]=_react.useReducer.call(void 0, vo,0),n=_react.useCallback.call(void 0, (a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return _react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||_optionalChain([t, 'access', _11 => _11.current, 'call', _12 => _12(), 'optionalAccess', _13 => _13.focus, 'call', _14 => _14()])}),n};var he="[data-cui-row-focus]",xo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(he)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${he} elements for ${e.count} rows`);return o},Eo=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},No= exports.LoadMore =({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, !1),m=()=>{let b=a.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(he)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let f=xo(a);if(t){R.busySeen=!0,R.shown=new Set(f);return}let h=Eo(f,R.shown),T=r!==null&&r.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let L=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&L)&&h.focus()});let g=Te(()=>o?p.current:l.current),x=_react.useCallback.call(void 0, (b=>{l.current=b;let R=g(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[g]),w=_react.useCallback.call(void 0, (b=>{p.current=b;let R=g(b);return()=>{p.current=null,R()}}),[g]);return o?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,testId:`${s}-end`,children:i.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:[_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:x,testId:`${s}-button`,children:i.loadMore(_chunkA4D4K2WFcjs.a.call(void 0, n,d))}),r===null?null:_jsxruntime.jsx.call(void 0, V,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};var wo=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{u();let a=_chunkA4D4K2WFcjs.r.call(void 0, {masterMinPx:o,detailMinPx:r,gapPx:_chunkA4D4K2WFcjs.G.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:a.key,css:a.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};var Ce=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=N();if(e===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=_chunkA4D4K2WFcjs.a.call(void 0, e,r);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};var Mo=({label:e,value:t,min:o,max:r,valueText:n,testId:a})=>{if(u(),!(Number.isFinite(o)&&Number.isFinite(r)&&o<r))throw new RangeError(`Meter needs a finite range with min below max: min ${o}, max ${r}`);if(!(Number.isFinite(t)&&t>=o&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${o}, max ${r}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":n,"data-cui-surface":"sunken","data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-o)/(r-o)*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{fg:"fg",type:"body",testId:`${a}-value`,children:n})})]})};var Lo=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=N();return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":a,children:[_jsxruntime.jsx.call(void 0, V,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};var Io=({label:e,options:t,value:o,onValueChange:r,testId:n})=>{u();let a=new Set(t.map(s=>s.value));if(t.length<2||a.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!a.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...a].join(", ")}`);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":n,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(s=>{let d=s.value===o;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${n}-${s.value}`,onClick:()=>{d||r(s.value)},children:s.label},s.value)})})]})};var it=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(u(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:o,ref:a,...P(n),children:s})),Do= exports.SelectableList =({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:p,ref:l})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, it,{selected:m===r,controls:a,onSelect:()=>n(y),testId:d,dataAttributes:_optionalChain([i, 'optionalCall', _15 => _15(y)]),children:s(y)})},m)})})}));var Ho=({label:e,value:t,min:o,max:r,step:n,valueText:a,onValueChange:s,testId:d})=>{u();let i=_react.useId.call(void 0, );if(!([t,o,r,n].every(Number.isFinite)&&o<r&&n>0&&o<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${r}, step ${n}`);let c=a(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:i,type:"range",min:o,max:r,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};var Fo=({gap:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Uo= exports.Cluster =({gap:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));var ct={done:0,current:1,pending:2},Oo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Bo= exports.Stepper =({label:e,steps:t,testId:o})=>{let{labels:r}=N();if(t.length===0||new Set(t.map(a=>a.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(a=>a.id).join(", ")}`);if(t.filter(a=>a.state==="current").length>1||t.some((a,s)=>s>0&&ct[a.state]<ct[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(a=>a.state).join(", ")}`);let n={done:r.stepDone,current:null,pending:r.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((a,s)=>{let d=Oo[a.state],i=n[a.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":a.state==="current"?"step":void 0,"data-cui-step":a.state,"data-testid":`${o}-${a.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:a.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[a.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},a.id)})})};var Ko=({label:e,checked:t,onCheckedChange:o,testId:r})=>(u(),_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:()=>o(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${r}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{children:e})]}));var _o=({label:e,items:t,currentId:o,onNavigate:r,testId:n})=>{if(u(),t.length===0)throw new RangeError("Tabs needs at least one tab");let a=new Set(t.map(s=>s.id));if(a.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!a.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...a].join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,r),children:s.label})},s.id)})})})};var Wo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Jo= exports.MetricTile =({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(u(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...P(a),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":Wo[r],"data-cui-type":"heading",children:_jsxruntime.jsx.call(void 0, Ce,{value:o,testId:`${n}-value`})})]})},pt=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?pt(t.props.children):[t]}),Zo= exports.TileGrid =({count:e,minInlinePx:t,testId:o,children:r})=>{u();let n=_chunkA4D4K2WFcjs.w.call(void 0, e,t,_chunkA4D4K2WFcjs.G.space["space-2"]),a=pt(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":o,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:n.key,css:n.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};var re=e=>[...e.querySelectorAll("button")],Xo= exports.Toolbar =({label:e,testId:t,children:o})=>{u();let r=_react.useRef.call(void 0, null),n=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=re(r.current),c=n.current!==null&&i.includes(n.current)?n.current:_nullishCoalesce(i[0], () => (null));n.current=c;for(let p of i)p.tabIndex=p===c?0:-1});let a=i=>{for(let c of re(r.current))c.tabIndex=c===i?0:-1;n.current=i};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let c=re(i.currentTarget).find(p=>p.contains(i.target));c!==void 0&&a(c)},onKeyDown:i=>{let c=re(i.currentTarget),p=c.indexOf(i.target);if(p===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",g={[l]:(p+1)%c.length,[y]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(g===void 0)return;i.preventDefault();let x=c[g];a(x),x.focus()},children:o})};var ft=e=>e===null?_chunkA4D4K2WFcjs.i:_chunkA4D4K2WFcjs.j,ne=(e,t,o,r,n)=>{let[a,s]=_react.useState.call(void 0, ()=>({key:e,state:ft(e)})),[d,i]=_react.useState.call(void 0, 0),[c,p]=_react.useState.call(void 0, 0),l=_react.useRef.call(void 0, t),y=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, d);_react.useLayoutEffect.call(void 0, ()=>{l.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkA4D4K2WFcjs.i});return}let f=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:r(T.state,h)}:{key:e,state:_chunkA4D4K2WFcjs.j}),l.current(f.signal).then(T=>{f.signal.aborted||(y.current=null,s(L=>({key:e,state:n(L.state,T)})))},T=>{f.signal.aborted||s(()=>{throw T})}),()=>{f.abort(),y.current=null}},[e,o,d,c]);let g=_react.useCallback.call(void 0, ()=>i(f=>f+1),[]),x=_react.useCallback.call(void 0, ()=>p(f=>f+1),[]),w=_react.useCallback.call(void 0, (f,h)=>{s(T=>Object.is(T.key,f)?{key:f,state:h(T.state)}:T)},[]),b=_react.useCallback.call(void 0, (f,h)=>{w(f,h),Object.is(y.current,f)&&x()},[w,x]);return{state:Object.is(a.key,e)?a.state:ft(e),reload:g,refresh:x,update:w,write:b}};var or=(e,t,o)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let n=_react.useCallback.call(void 0, b=>r.current.first(b),[]),{state:a,reload:s,refresh:d,update:i,write:c}=ne(e,n,o,_chunkA4D4K2WFcjs.x,_chunkA4D4K2WFcjs.y),p=_react.useRef.call(void 0, {key:e,state:a});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:a}});let l=_react.useRef.call(void 0, null),y=_react.useCallback.call(void 0, ()=>{_optionalChain([l, 'access', _16 => _16.current, 'optionalAccess', _17 => _17.controller, 'access', _18 => _18.abort, 'call', _19 => _19()]),l.current=null},[]);_react.useEffect.call(void 0, ()=>y,[e,o,y]);let m=_react.useCallback.call(void 0, ()=>{y(),s()},[y,s]),g=_react.useCallback.call(void 0, ()=>{y(),d()},[y,d]),x=_react.useCallback.call(void 0, ()=>{let{key:b,state:R}=p.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let f=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,_chunkA4D4K2WFcjs.z),r.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,L=>h.maps.reduce((bt,Rt)=>_chunkA4D4K2WFcjs.B.call(void 0, bt,Rt),_chunkA4D4K2WFcjs.A.call(void 0, L,f,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=_react.useCallback.call(void 0, (b,R)=>{let f=l.current;f!==null&&Object.is(f.key,b)&&f.maps.push(R),c(b,h=>_chunkA4D4K2WFcjs.B.call(void 0, h,R))},[c]);return{state:a,reload:m,refresh:g,loadMore:x,updateList:w}};var ar=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=ne(e,t,o,_chunkA4D4K2WFcjs.k,_chunkA4D4K2WFcjs.l),d=_react.useCallback.call(void 0, (i,c)=>s(i,p=>_chunkA4D4K2WFcjs.l.call(void 0, p,{ok:!0,value:c})),[s]);return{state:r,reload:n,refresh:a,put:d}};var nr=({testId:e,children:t})=>(u(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ue; exports.AlertMessage = V; exports.Breadcrumb = kt; exports.Button = S; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkA4D4K2WFcjs.n; exports.CONTRAST_MINIMUM = _chunkIR2WTSOWcjs.c; exports.CONTRAST_PAIRS = _chunkIR2WTSOWcjs.d; exports.Card = ye; exports.CardSection = Ft; exports.Cluster = Uo; exports.CodeBlock = Ot; exports.ComparisonGrid = qt; exports.ConsoleUiRoot = Mt; exports.DataTable = Gt; exports.DescriptionList = zt; exports.Dialog = jt; exports.Disclosure = to; exports.Field = oo; exports.HTTP_FORBIDDEN = _chunkA4D4K2WFcjs.f; exports.Heading = co; exports.JobCard = bo; exports.LATTICE_PX = _chunkA4D4K2WFcjs.C; exports.Link = $t; exports.LoadMore = No; exports.MasterDetail = wo; exports.Measured = Ce; exports.Meter = Mo; exports.MetricTile = Jo; exports.Notice = Ro; exports.Pill = be; exports.ProgressBar = Re; exports.ROW_WITH_CONTROL_PX = _chunkA4D4K2WFcjs.F; exports.RadioGroup = so; exports.ResourceFailed = Lo; exports.RowButton = it; exports.SegmentedControl = Io; exports.Select = no; exports.SelectableList = Do; exports.Slider = Ho; exports.Stack = Fo; exports.Stepper = Bo; exports.Switch = Ko; exports.TARGET_PX = _chunkA4D4K2WFcjs.E; exports.TOKENS = _chunkA4D4K2WFcjs.G; exports.Tabs = _o; exports.Text = v; exports.TextArea = ao; exports.TextInput = ro; exports.TileGrid = Zo; exports.Toolbar = Xo; exports.VisuallyHidden = nr; exports.ZonedTimeError = _chunkA4D4K2WFcjs.b; exports.beginPage = _chunkA4D4K2WFcjs.z; exports.beginPagedReload = _chunkA4D4K2WFcjs.x; exports.beginReload = _chunkA4D4K2WFcjs.k; exports.ceil8 = _chunkA4D4K2WFcjs.v; exports.ceilToLattice = _chunkA4D4K2WFcjs.D; exports.contrastRatio = _chunkIR2WTSOWcjs.b; exports.cssVar = _chunkA4D4K2WFcjs.H; exports.flatMapOutcome = _chunkA4D4K2WFcjs.h; exports.formatCount = _chunkA4D4K2WFcjs.a; exports.formatInstant = _chunkA4D4K2WFcjs.e; exports.hexToSrgb = _chunkIR2WTSOWcjs.a; exports.keepLastGood = _chunkA4D4K2WFcjs.l; exports.mapOutcome = _chunkA4D4K2WFcjs.g; exports.mapPagedList = _chunkA4D4K2WFcjs.B; exports.masterDetailPlan = _chunkA4D4K2WFcjs.q; exports.monoTextWidthEm = _chunkA4D4K2WFcjs.u; exports.reasonAside = _chunkA4D4K2WFcjs.m; exports.resolveConsoleUiLabels = _chunkA4D4K2WFcjs.o; exports.settleFirstPage = _chunkA4D4K2WFcjs.y; exports.settlePage = _chunkA4D4K2WFcjs.A; exports.tableMinInlinePx = _chunkA4D4K2WFcjs.s; exports.textWidthEm = _chunkA4D4K2WFcjs.t; exports.tileGridPlan = _chunkA4D4K2WFcjs.w; exports.toOffsetIso = _chunkA4D4K2WFcjs.c; exports.toWallTime = _chunkA4D4K2WFcjs.d; exports.useAnnounce = St; exports.useConsoleUi = N; exports.useEscapeToClose = Xt; exports.useFocusRescue = Te; exports.usePagedResource = or; exports.useResource = ar;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,19 @@
1
- import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, ResourceFailure, SpaceToken, FgRole, TypeToken, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.cjs";
2
- export { AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, ColorToken, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, HTTP_FORBIDDEN, MasterDetailOptions, MasterDetailPlan, PageFailure, PagedValue, RadiusToken, ReloadCause, SizeToken, Srgb, StrokeToken, SurfaceRole, TOKENS, TileGridPlan, TileGridStep, TokenName, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime } from "./core.cjs";
1
+ import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, TypeToken, ResourceFailure, SpaceToken, FgRole, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.cjs";
2
+ export { AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, ColorScheme, ColorToken, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, HTTP_FORBIDDEN, LATTICE_PX, MasterDetailOptions, MasterDetailPlan, MotionToken, PageFailure, PagedValue, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TileGridPlan, TileGridStep, TokenName, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime } from "./core.cjs";
3
3
  import * as react from "react";
4
4
  import { ReactNode, MouseEvent, Ref, RefObject, RefCallback, KeyboardEvent } from "react";
5
+ type BreadcrumbItem = {
6
+ readonly id: string;
7
+ readonly label: string;
8
+ readonly href: string;
9
+ };
10
+ type BreadcrumbProps = {
11
+ readonly items: readonly BreadcrumbItem[];
12
+ readonly current: string;
13
+ readonly onNavigate: (href: string) => void;
14
+ readonly testId: string;
15
+ };
16
+ declare const Breadcrumb: ({ items, current, onNavigate, testId }: BreadcrumbProps) => react.JSX.Element;
5
17
  type DataAttributes = Readonly<Record<`data-${string}`, string | number | boolean>>;
6
18
  type ButtonVariant = "primary" | "secondary" | "danger" | "link";
7
19
  type ButtonProps = {
@@ -56,6 +68,12 @@ type CardSectionProps = {
56
68
  readonly children: ReactNode;
57
69
  };
58
70
  declare const CardSection: ({ id, title, subtitle, region, testId, headingRef, ref, dataAttributes, children }: CardSectionProps) => react.JSX.Element;
71
+ type CodeBlockProps = {
72
+ readonly label: string;
73
+ readonly code: string;
74
+ readonly testId: string;
75
+ };
76
+ declare const CodeBlock: ({ label, code, testId }: CodeBlockProps) => react.JSX.Element;
59
77
  type ComparisonLayout = "table" | "stack";
60
78
  type ComparisonAttribute = {
61
79
  readonly key: string;
@@ -114,6 +132,32 @@ type DataTableProps<T> = {
114
132
  readonly ref?: Ref<HTMLDivElement>;
115
133
  };
116
134
  declare const DataTable: <T>({ caption, captionHidden, columns, rows, rowKey, rowTestId, rowData, rowSize, empty, testId, ref }: DataTableProps<T>) => react.JSX.Element;
135
+ type DescriptionItem = {
136
+ readonly key: string;
137
+ readonly term: string;
138
+ readonly description: ReactNode;
139
+ };
140
+ type DescriptionListProps = {
141
+ readonly items: readonly DescriptionItem[];
142
+ readonly testId: string;
143
+ };
144
+ declare const DescriptionList: ({ items, testId }: DescriptionListProps) => react.JSX.Element;
145
+ type DialogProps = {
146
+ readonly title: string;
147
+ readonly open: boolean;
148
+ readonly onClose: () => void;
149
+ readonly testId: string;
150
+ readonly children: ReactNode;
151
+ };
152
+ declare const Dialog: ({ title, open, onClose, testId, children }: DialogProps) => react.JSX.Element;
153
+ type DisclosureProps = {
154
+ readonly summary: string;
155
+ readonly open: boolean;
156
+ readonly onOpenChange: (open: boolean) => void;
157
+ readonly testId: string;
158
+ readonly children: ReactNode;
159
+ };
160
+ declare const Disclosure: ({ summary, open, onOpenChange, testId, children }: DisclosureProps) => react.JSX.Element;
117
161
  type FieldControl = {
118
162
  readonly id: string;
119
163
  readonly "aria-describedby": string | undefined;
@@ -170,6 +214,50 @@ type RadioGroupProps = {
170
214
  readonly ref?: Ref<HTMLInputElement>;
171
215
  };
172
216
  declare const RadioGroup: ({ legend, description, error, value, options, onValueChange, testId, ref }: RadioGroupProps) => react.JSX.Element;
217
+ type HeadingType = Extract<TypeToken, "title" | "heading" | "display" | "display-lg">;
218
+ type HeadingProps = {
219
+ readonly level: 1 | 2 | 3;
220
+ readonly type: HeadingType;
221
+ readonly testId: string;
222
+ readonly headingRef?: Ref<HTMLHeadingElement>;
223
+ readonly children: ReactNode;
224
+ };
225
+ declare const Heading: ({ level, type, testId, headingRef, children }: HeadingProps) => react.JSX.Element;
226
+ type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
227
+ type PillProps = {
228
+ readonly tone: PillTone;
229
+ readonly variant: "tint" | "solid";
230
+ readonly testId: string;
231
+ readonly dataAttributes?: DataAttributes;
232
+ readonly children: ReactNode;
233
+ };
234
+ declare const Pill: ({ tone, variant, testId, dataAttributes, children }: PillProps) => react.JSX.Element;
235
+ type ProgressBarProps = {
236
+ readonly label: string;
237
+ readonly valueText: string;
238
+ readonly value: number | null;
239
+ readonly max: number | null;
240
+ readonly testId: string;
241
+ };
242
+ declare const ProgressBar: ({ label, valueText, value, max, testId }: ProgressBarProps) => react.JSX.Element;
243
+ type JobCancel = {
244
+ readonly label: string;
245
+ readonly busyLabel: string;
246
+ readonly busy: boolean;
247
+ readonly onCancel: () => void;
248
+ };
249
+ type JobCardProps = {
250
+ readonly title: string;
251
+ readonly status: {
252
+ readonly tone: PillTone;
253
+ readonly label: string;
254
+ };
255
+ readonly progress?: Omit<ProgressBarProps, "testId">;
256
+ readonly cancel?: JobCancel;
257
+ readonly testId: string;
258
+ readonly children?: ReactNode;
259
+ };
260
+ declare const JobCard: ({ title, status, progress, cancel, testId, children }: JobCardProps) => react.JSX.Element;
173
261
  type LoadMoreProps = {
174
262
  readonly onLoad: () => void;
175
263
  readonly busy: boolean;
@@ -200,6 +288,15 @@ type MeasuredProps = {
200
288
  readonly testId: string;
201
289
  };
202
290
  declare const Measured: ({ value, unit, testId }: MeasuredProps) => react.JSX.Element;
291
+ type MeterProps = {
292
+ readonly label: string;
293
+ readonly value: number;
294
+ readonly min: number;
295
+ readonly max: number;
296
+ readonly valueText: string;
297
+ readonly testId: string;
298
+ };
299
+ declare const Meter: ({ label, value, min, max, valueText, testId }: MeterProps) => react.JSX.Element;
203
300
  type NoticeProps = {
204
301
  readonly tone: "info" | "warning";
205
302
  readonly testId: string;
@@ -212,23 +309,6 @@ type AlertMessageProps = {
212
309
  readonly children: ReactNode;
213
310
  };
214
311
  declare const AlertMessage: ({ occurrence, testId, children }: AlertMessageProps) => react.JSX.Element;
215
- type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
216
- type PillProps = {
217
- readonly tone: PillTone;
218
- readonly variant: "tint" | "solid";
219
- readonly testId: string;
220
- readonly dataAttributes?: DataAttributes;
221
- readonly children: ReactNode;
222
- };
223
- declare const Pill: ({ tone, variant, testId, dataAttributes, children }: PillProps) => react.JSX.Element;
224
- type ProgressBarProps = {
225
- readonly label: string;
226
- readonly valueText: string;
227
- readonly value: number | null;
228
- readonly max: number | null;
229
- readonly testId: string;
230
- };
231
- declare const ProgressBar: ({ label, valueText, value, max, testId }: ProgressBarProps) => react.JSX.Element;
232
312
  type ResourceFailedProps = {
233
313
  readonly failure: ResourceFailure;
234
314
  readonly onReload: () => void;
@@ -238,6 +318,18 @@ type ResourceFailedProps = {
238
318
  readonly testId: string;
239
319
  };
240
320
  declare const ResourceFailed: ({ failure, onReload, forbiddenMessage, failureMessage, rescueRef, testId }: ResourceFailedProps) => react.JSX.Element;
321
+ type SegmentedOption = {
322
+ readonly value: string;
323
+ readonly label: string;
324
+ };
325
+ type SegmentedControlProps = {
326
+ readonly label: string;
327
+ readonly options: readonly SegmentedOption[];
328
+ readonly value: string;
329
+ readonly onValueChange: (value: string) => void;
330
+ readonly testId: string;
331
+ };
332
+ declare const SegmentedControl: ({ label, options, value, onValueChange, testId }: SegmentedControlProps) => react.JSX.Element;
241
333
  type RowButtonProps = {
242
334
  readonly selected: boolean;
243
335
  readonly controls: string;
@@ -263,6 +355,17 @@ type SelectableListProps<T> = {
263
355
  readonly ref?: Ref<HTMLDivElement>;
264
356
  };
265
357
  declare const SelectableList: <T>({ label, items, itemKey, selectedKey, onSelect, detailId, renderRow, rowTestId, rowData, empty, testId, ref }: SelectableListProps<T>) => react.JSX.Element;
358
+ type SliderProps = {
359
+ readonly label: string;
360
+ readonly value: number;
361
+ readonly min: number;
362
+ readonly max: number;
363
+ readonly step: number;
364
+ readonly valueText: (value: number) => string;
365
+ readonly onValueChange: (value: number) => void;
366
+ readonly testId: string;
367
+ };
368
+ declare const Slider: ({ label, value, min, max, step, valueText, onValueChange, testId }: SliderProps) => react.JSX.Element;
266
369
  type StackProps = {
267
370
  readonly gap: SpaceToken;
268
371
  readonly testId: string;
@@ -270,6 +373,38 @@ type StackProps = {
270
373
  };
271
374
  declare const Stack: ({ gap, testId, children }: StackProps) => react.JSX.Element;
272
375
  declare const Cluster: ({ gap, testId, children }: StackProps) => react.JSX.Element;
376
+ type StepState = "done" | "current" | "pending";
377
+ type StepperItem = {
378
+ readonly id: string;
379
+ readonly label: string;
380
+ readonly state: StepState;
381
+ };
382
+ type StepperProps = {
383
+ readonly label: string;
384
+ readonly steps: readonly StepperItem[];
385
+ readonly testId: string;
386
+ };
387
+ declare const Stepper: ({ label, steps, testId }: StepperProps) => react.JSX.Element;
388
+ type SwitchProps = {
389
+ readonly label: string;
390
+ readonly checked: boolean;
391
+ readonly onCheckedChange: (checked: boolean) => void;
392
+ readonly testId: string;
393
+ };
394
+ declare const Switch: ({ label, checked, onCheckedChange, testId }: SwitchProps) => react.JSX.Element;
395
+ type TabItem = {
396
+ readonly id: string;
397
+ readonly label: string;
398
+ readonly href: string;
399
+ };
400
+ type TabsProps = {
401
+ readonly label: string;
402
+ readonly items: readonly TabItem[];
403
+ readonly currentId: string;
404
+ readonly onNavigate: (href: string) => void;
405
+ readonly testId: string;
406
+ };
407
+ declare const Tabs: ({ label, items, currentId, onNavigate, testId }: TabsProps) => react.JSX.Element;
273
408
  type TextFace = "sans" | "mono";
274
409
  type TextProps = {
275
410
  readonly fg: FgRole;
@@ -300,6 +435,12 @@ type TileGridProps = {
300
435
  readonly children: ReactNode;
301
436
  };
302
437
  declare const TileGrid: ({ count, minInlinePx, testId, children }: TileGridProps) => react.JSX.Element;
438
+ type ToolbarProps = {
439
+ readonly label: string;
440
+ readonly testId: string;
441
+ readonly children: ReactNode;
442
+ };
443
+ declare const Toolbar: ({ label, testId, children }: ToolbarProps) => react.JSX.Element;
303
444
  declare const useEscapeToClose: (onClose: () => void) => ((event: KeyboardEvent<HTMLElement>) => void);
304
445
  declare const useFocusRescue: (getTarget: () => HTMLElement | null) => RefCallback<HTMLElement>;
305
446
  type PagedLoaders<T, C, M> = {
@@ -326,4 +467,4 @@ type VisuallyHiddenProps = {
326
467
  readonly children: ReactNode;
327
468
  };
328
469
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
329
- export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, Select, type SelectProps, SelectableList, type SelectableListProps, SpaceToken, Stack, type StackProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
470
+ export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };