@aiquants/console-ui 0.2.0 → 0.3.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/README.md +73 -34
- package/dist/chunk-A4D4K2WF.cjs +1 -0
- package/dist/chunk-BMGBEN26.js +1 -0
- package/dist/chunk-BUX2DNVR.js +1 -0
- package/dist/chunk-IR2WTSOW.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +310 -165
- package/dist/core.d.ts +310 -165
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +146 -20
- package/dist/index.d.ts +146 -20
- package/dist/index.js +1 -1
- package/dist/styles/console-ui.css +555 -136
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-BEDKWWJC.cjs +0 -1
- package/dist/chunk-HFWVEGN3.cjs +0 -1
- package/dist/chunk-MYMCHY7C.js +0 -1
- package/dist/chunk-YUUKR7HN.js +0 -1
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 de=_react.createContext.call(void 0, null),vt=" ",Oe='[inert], [aria-hidden="true" i]',qe="dialog:modal",ue="data-cui-dialog-announcer",Ct=`:scope > [${ue}]`,xt=e=>{if(e.closest(Oe)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(qe)],a=t.activeElement,n=o.filter(c=>c.contains(a)),r=n.length>0?n:o,s=r.filter(c=>c.contains(e)).length;if(s===r.length)return{region:e};let d=r.find(c=>r.every(u=>u.contains(c))),i=_nullishCoalesce(_optionalChain([d, 'optionalAccess', _2 => _2.querySelector, 'call', _3 => _3(Ct)]), () => (null));return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Oe)===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"}},Et=e=>{try{e.querySelectorAll(qe)}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}},ce= exports.ANNOUNCE_SETTLE_MS =150,Nt=1e3,Pt= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:o,testId:a,children:n})=>{if(_react.useContext.call(void 0, de)!==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),u=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Et(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}=u.current;u.current=null,clearTimeout(b),clearTimeout(R);let f=c.current;if(f===null)return;let h=w.join(vt),T=xt(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 M=f.ownerDocument.createElement("span");M.textContent=h,T.region.replaceChildren(M)},C=u.current;if(C===null){u.current={texts:[m],settle:setTimeout(g,ce),deadline:setTimeout(g,Nt)};return}C.texts.push(m),clearTimeout(C.settle),C.settle=setTimeout(g,ce)},[]),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, de.Provider,{value:y,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:c})]})})},N= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, de);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},p=()=>{N()},wt= 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 St=({items:e,current:t,onNavigate:o,testId:a})=>{let{labels:n}=N();if(new Set(e.map(r=>r.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(r=>r.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":a,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:r.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${a}-${r.id}`,onClick:s=>J(s,r.href,o),children:r.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.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":`${a}-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 x=({fg:e,type:t,face:o,as:a="span",testId:n,id:r,tabIndex:s,ref:d,children:i})=>(p(),_jsxruntime.jsx.call(void 0, a,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:r,tabIndex:s,ref:d,children:i}));var It={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"}},Ge=({children:e})=>_jsxruntime.jsx.call(void 0, "span",{children:e}),S= exports.Button =({variant:e,children:t,testId:o,type:a="button",onClick:n,unavailable:r,expanded:s,controls:d,ref:i,dataAttributes:c,busy:u,busyLabel:l})=>{p();let y=_react.useId.call(void 0, ),m=u===!0||r!==void 0,g=It[e],C=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:a==="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":u===!0?!0:void 0,"aria-describedby":r===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:C,ref:i,...P(c),children:_jsxruntime.jsx.call(void 0, Ge,{children:u===!0?l:t})}),r===void 0?null:_jsxruntime.jsx.call(void 0, x,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:r.reason})]})},At= exports.Link =({onNavigate:e,children:t,testId:o,ref:a})=>(p(),_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:a,children:_jsxruntime.jsx.call(void 0, Ge,{children:t})}));var pe=({id:e,title:t,description:o,actions:a,testId:n,headingRef:r,ref:s,dataAttributes:d,children:i})=>{p();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:r,tabIndex:r===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})]}),a===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:a})]}),i]})},$t= exports.CardSection =({id:e,title:t,subtitle:o,region:a=!1,testId:n,headingRef:r,ref:s,dataAttributes:d,children:i})=>{p();let c=_react.useId.call(void 0, ),u=_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:r,tabIndex:r===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 a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:u}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:u})};var H=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var Ot=({caption:e,attributes:t,columns:o,attributePx:a,columnMinPx:n,testId:r})=>{p();let s=_react.useId.call(void 0, );for(let l of[a,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=a+o.length*n,i=`cui-comparison-a${a}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,u=`${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":r,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:i,css:u}),_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, a)}}),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 Bt=({caption:e,captionHidden:t,columns:o,rows:a,rowKey:n,rowTestId:r,rowData:s,rowSize:d,empty:i,testId:c,ref:u})=>{p();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:u,children:a.length===0?_jsxruntime.jsx.call(void 0, x,{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:a.map(m=>_jsxruntime.jsx.call(void 0, "tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":r,...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 _t=({items:e,testId:t})=>{if(p(),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 Wt=229,zt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),me=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&zt.has(e.type)&&(e.value!==""||e.validity.badInput),Jt= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Wt||me(t.target)||(t.stopPropagation(),e())},[e]);var Je=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Yt= exports.Dialog =({title:e,open:t,onClose:o,testId:a,children:n})=>{let{labels:r}=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(),Je(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":a,ref:d,onClose:()=>{Je(i.current),i.current=null,t&&o()},onCancel:l=>{me(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:`${a}-close`,onClick:()=>_optionalChain([d, 'access', _6 => _6.current, 'optionalAccess', _7 => _7.close, 'call', _8 => _8()]),children:r.close})})]}),n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[ue]:"","data-testid":`${a}-announcer`})]})};var Qt=({summary:e,open:t,onOpenChange:o,testId:a,children:n})=>{p();let r=_react.useId.call(void 0, );return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":a,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":r,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-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:r,hidden:!t,"data-testid":`${a}-panel`,children:n})]})};var q=({description:e,error:t})=>{p();let o=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),n=_react.useId.call(void 0, ),r=[e===void 0?null:a,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":r===""?void 0:r,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:a,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:a,testId:`${n}-error`,children:t})]}),jt= exports.Field =({label:e,description:t,error:o,testId:a,children:n})=>{let{control:r,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":a,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:r.id,"data-cui-type":"body",children:e}),n(r),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:s,errorId:d,testId:a})]})},eo= exports.TextInput =({label:e,description:t,error:o,value:a,onValueChange:n,type:r,list:s,required:d,testId:i,ref:c})=>{let{control:u,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:u.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:r,value:a,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,...u}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},to= exports.TextArea =({label:e,description:t,error:o,value:a,onValueChange:n,required:r,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:u}=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:a,required:r,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:u,testId:s})]})},oo= exports.Select =({label:e,description:t,error:o,value:a,options:n,onValueChange:r,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:u}=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:a,onChange:l=>r(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:u,testId:s})]})},ro= exports.RadioGroup =({legend:e,description:t,error:o,value:a,options:n,onValueChange:r,testId:s,ref:d})=>{let i=_react.useId.call(void 0, ),{control:c,descriptionId:u,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===a,onChange:()=>r(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:u,errorId:l,testId:s})]})};var no={1:"h1",2:"h2",3:"h3"},so= exports.Heading =({level:e,type:t,testId:o,headingRef:a,children:n})=>{p();let r=no[e];return _jsxruntime.jsx.call(void 0, r,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:a,tabIndex:a===void 0?void 0:-1,children:n})};var lo={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"}},co={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},ge= exports.Pill =({tone:e,variant:t,testId:o,dataAttributes:a,children:n})=>{p();let r=t==="tint"?lo[e]:{fg:"on-solid",surface:co[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":r.fg,"data-cui-surface":r.surface,"data-cui-type":"caption","data-testid":o,...P(a),children:n})};var be=({label:e,valueText:t,value:o,max:a,testId:n})=>{p();let r=_react.useId.call(void 0, );if(a!==null){if(!(Number.isFinite(a)&&a>0))throw new RangeError(`Progress maximum must be positive: ${a}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=a===null?null:{max:a,now:Math.min(o,a)};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:r,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"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, x,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};var mo=({title:e,status:t,progress:o,cancel:a,testId:n,children:r})=>_jsxruntime.jsxs.call(void 0, pe,{title:e,actions:a===void 0?void 0:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:a.busy,busyLabel:a.busyLabel,onClick:a.onCancel,testId:`${n}-cancel`,children:a.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, ge,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:_jsxruntime.jsx.call(void 0, be,{...o,testId:`${n}-progress`}),r]});var fo=({tone:e,testId:t,children:o})=>(p(),_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})=>(p(),_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 Ro=e=>e+1,Re= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),o=_react.useRef.call(void 0, null),[,a]=_react.useReducer.call(void 0, Ro,0),n=_react.useCallback.call(void 0, (r=>()=>{r.contains(document.activeElement)&&(o.current=r,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let r=o.current;if(r===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);r.isConnected||!s||_optionalChain([t, 'access', _11 => _11.current, 'call', _12 => _12(), 'optionalAccess', _13 => _13.focus, 'call', _14 => _14()])}),n};var Te="[data-cui-row-focus]",ho=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(Te)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${Te} elements for ${e.count} rows`);return o},vo=(e,t)=>{let o=-1;return e.forEach((a,n)=>{t.has(a)&&(o=n)}),e[o+1]},Co= exports.LoadMore =({onLoad:e,busy:t,done:o,failure:a,limit:n,rows:r,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, !1),m=()=>{let b=r.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(Te)),failureOccurrence:a===null?null:a.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=ho(r);if(t){R.busySeen=!0,R.shown=new Set(f);return}let h=vo(f,R.shown),T=a!==null&&a.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let M=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&M)&&h.focus()});let g=Re(()=>o?u.current:l.current),C=_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=>{u.current=b;let R=g(b);return()=>{u.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, x,{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:C,testId:`${s}-button`,children:i.loadMore(_chunkA4D4K2WFcjs.a.call(void 0, n,d))}),a===null?null:_jsxruntime.jsx.call(void 0, V,{occurrence:a.occurrence,testId:`${s}-failure`,children:i.loadFailed(a.reason)})]})};var Eo=({master:e,detail:t,masterMinPx:o,detailMinPx:a,testId:n})=>{p();let r=_chunkA4D4K2WFcjs.r.call(void 0, {masterMinPx:o,detailMinPx:a,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:r.key,css:r.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":r.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 ve=({value:e,unit:t,testId:o})=>{let{formatLocale:a,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 r=_chunkA4D4K2WFcjs.a.call(void 0, e,a);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?r:`${r} ${t}`})};var No=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:a,rescueRef:n,testId:r})=>{let{labels:s}=N();return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":r,children:[_jsxruntime.jsx.call(void 0, V,{occurrence:e.occurrence,testId:`${r}-alert`,children:s.failureSentence(e,o,a===void 0?s.loadFailed:a)}),e.status===403?null:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${r}-reload`,children:s.reload})]})};var wo=({label:e,options:t,value:o,onValueChange:a,testId:n})=>{p();let r=new Set(t.map(s=>s.value));if(t.length<2||r.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!r.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...r].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||a(s.value)},children:s.label},s.value)})})]})};var nt=({selected:e,controls:t,onSelect:o,testId:a,dataAttributes:n,ref:r,children:s})=>(p(),_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":a,onClick:o,ref:r,...P(n),children:s})),So= exports.SelectableList =({label:e,items:t,itemKey:o,selectedKey:a,onSelect:n,detailId:r,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:u,ref:l})=>(p(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":u,ref:l,children:t.length===0?_jsxruntime.jsx.call(void 0, x,{as:"p",fg:"fg-muted",type:"prose",testId:`${u}-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, nt,{selected:m===a,controls:r,onSelect:()=>n(y),testId:d,dataAttributes:_optionalChain([i, 'optionalCall', _15 => _15(y)]),children:s(y)})},m)})})}));var ko=({label:e,value:t,min:o,max:a,step:n,valueText:r,onValueChange:s,testId:d})=>{p();let i=_react.useId.call(void 0, );if(!([t,o,a,n].every(Number.isFinite)&&o<a&&n>0&&o<=t&&t<=a))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${a}, step ${n}`);let c=r(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:a,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:u=>s(u.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, x,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};var Io=({gap:e,testId:t,children:o})=>(p(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Ao= exports.Cluster =({gap:e,testId:t,children:o})=>(p(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));var lt={done:0,current:1,pending:2},Do={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},$o= exports.Stepper =({label:e,steps:t,testId:o})=>{let{labels:a}=N();if(t.length===0||new Set(t.map(r=>r.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(r=>r.id).join(", ")}`);if(t.filter(r=>r.state==="current").length>1||t.some((r,s)=>s>0&<[r.state]<lt[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(r=>r.state).join(", ")}`);let n={done:a.stepDone,current:null,pending:a.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((r,s)=>{let d=Do[r.state],i=n[r.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${o}-${r.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:r.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},r.id)})})};var Ho=({label:e,checked:t,onCheckedChange:o,testId:a})=>(p(),_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":a,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":`${a}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${a}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{children:e})]}));var Uo=({label:e,items:t,currentId:o,onNavigate:a,testId:n})=>{if(p(),t.length===0)throw new RangeError("Tabs needs at least one tab");let r=new Set(t.map(s=>s.id));if(r.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!r.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...r].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,a),children:s.label})},s.id)})})})};var qo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},_o= exports.MetricTile =({label:e,sublabel:t,value:o,tone:a,testId:n,dataAttributes:r})=>{if(p(),o===null&&a!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${a}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":a,"data-testid":n,...P(r),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":qo[a],"data-cui-type":"heading",children:_jsxruntime.jsx.call(void 0, ve,{value:o,testId:`${n}-value`})})]})},ct=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?ct(t.props.children):[t]}),Go= exports.TileGrid =({count:e,minInlinePx:t,testId:o,children:a})=>{p();let n=_chunkA4D4K2WFcjs.w.call(void 0, e,t,_chunkA4D4K2WFcjs.G.space["space-2"]),r=ct(a).length;if(r!==e)throw new RangeError(`TileGrid has ${r} 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:a})]})};var oe=e=>[...e.querySelectorAll("button")],Wo= exports.Toolbar =({label:e,testId:t,children:o})=>{p();let a=_react.useRef.call(void 0, null),n=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=oe(a.current),c=n.current!==null&&i.includes(n.current)?n.current:_nullishCoalesce(i[0], () => (null));n.current=c;for(let u of i)u.tabIndex=u===c?0:-1});let r=i=>{for(let c of oe(a.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:a,onFocus:i=>{let c=oe(i.currentTarget).find(u=>u.contains(i.target));c!==void 0&&r(c)},onKeyDown:i=>{let c=oe(i.currentTarget),u=c.indexOf(i.target);if(u===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",g={[l]:(u+1)%c.length,[y]:(u-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(g===void 0)return;i.preventDefault();let C=c[g];r(C),C.focus()},children:o})};var yt=e=>e===null?_chunkA4D4K2WFcjs.i:_chunkA4D4K2WFcjs.j,ae=(e,t,o,a,n)=>{let[r,s]=_react.useState.call(void 0, ()=>({key:e,state:yt(e)})),[d,i]=_react.useState.call(void 0, 0),[c,u]=_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:a(T.state,h)}:{key:e,state:_chunkA4D4K2WFcjs.j}),l.current(f.signal).then(T=>{f.signal.aborted||(y.current=null,s(M=>({key:e,state:n(M.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),[]),C=_react.useCallback.call(void 0, ()=>u(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)&&C()},[w,C]);return{state:Object.is(r.key,e)?r.state:yt(e),reload:g,refresh:C,update:w,write:b}};var Xo=(e,t,o)=>{let a=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{a.current=t});let n=_react.useCallback.call(void 0, b=>a.current.first(b),[]),{state:r,reload:s,refresh:d,update:i,write:c}=ae(e,n,o,_chunkA4D4K2WFcjs.x,_chunkA4D4K2WFcjs.y),u=_react.useRef.call(void 0, {key:e,state:r});_react.useLayoutEffect.call(void 0, ()=>{u.current={key:e,state:r}});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]),C=_react.useCallback.call(void 0, ()=>{let{key:b,state:R}=u.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),a.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,M=>h.maps.reduce((ft,gt)=>_chunkA4D4K2WFcjs.B.call(void 0, ft,gt),_chunkA4D4K2WFcjs.A.call(void 0, M,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:r,reload:m,refresh:g,loadMore:C,updateList:w}};var jo=(e,t,o)=>{let{state:a,reload:n,refresh:r,write:s}=ae(e,t,o,_chunkA4D4K2WFcjs.k,_chunkA4D4K2WFcjs.l),d=_react.useCallback.call(void 0, (i,c)=>s(i,u=>_chunkA4D4K2WFcjs.l.call(void 0, u,{ok:!0,value:c})),[s]);return{state:a,reload:n,refresh:r,put:d}};var er=({testId:e,children:t})=>(p(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ce; exports.AlertMessage = V; exports.Breadcrumb = St; exports.Button = S; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkA4D4K2WFcjs.n; exports.CONTRAST_MINIMUM = _chunkIR2WTSOWcjs.c; exports.CONTRAST_PAIRS = _chunkIR2WTSOWcjs.d; exports.Card = pe; exports.CardSection = $t; exports.Cluster = Ao; exports.ComparisonGrid = Ot; exports.ConsoleUiRoot = Pt; exports.DataTable = Bt; exports.DescriptionList = _t; exports.Dialog = Yt; exports.Disclosure = Qt; exports.Field = jt; exports.HTTP_FORBIDDEN = _chunkA4D4K2WFcjs.f; exports.Heading = so; exports.JobCard = mo; exports.LATTICE_PX = _chunkA4D4K2WFcjs.C; exports.Link = At; exports.LoadMore = Co; exports.MasterDetail = Eo; exports.Measured = ve; exports.MetricTile = _o; exports.Notice = fo; exports.Pill = ge; exports.ProgressBar = be; exports.ROW_WITH_CONTROL_PX = _chunkA4D4K2WFcjs.F; exports.RadioGroup = ro; exports.ResourceFailed = No; exports.RowButton = nt; exports.SegmentedControl = wo; exports.Select = oo; exports.SelectableList = So; exports.Slider = ko; exports.Stack = Io; exports.Stepper = $o; exports.Switch = Ho; exports.TARGET_PX = _chunkA4D4K2WFcjs.E; exports.TOKENS = _chunkA4D4K2WFcjs.G; exports.Tabs = Uo; exports.Text = x; exports.TextArea = to; exports.TextInput = eo; exports.TileGrid = Go; exports.Toolbar = Wo; exports.VisuallyHidden = er; 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 = wt; exports.useConsoleUi = N; exports.useEscapeToClose = Jt; exports.useFocusRescue = Re; exports.usePagedResource = Xo; exports.useResource = jo;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, ResourceFailure, SpaceToken, FgRole,
|
|
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 = {
|
|
@@ -114,6 +126,32 @@ type DataTableProps<T> = {
|
|
|
114
126
|
readonly ref?: Ref<HTMLDivElement>;
|
|
115
127
|
};
|
|
116
128
|
declare const DataTable: <T>({ caption, captionHidden, columns, rows, rowKey, rowTestId, rowData, rowSize, empty, testId, ref }: DataTableProps<T>) => react.JSX.Element;
|
|
129
|
+
type DescriptionItem = {
|
|
130
|
+
readonly key: string;
|
|
131
|
+
readonly term: string;
|
|
132
|
+
readonly description: ReactNode;
|
|
133
|
+
};
|
|
134
|
+
type DescriptionListProps = {
|
|
135
|
+
readonly items: readonly DescriptionItem[];
|
|
136
|
+
readonly testId: string;
|
|
137
|
+
};
|
|
138
|
+
declare const DescriptionList: ({ items, testId }: DescriptionListProps) => react.JSX.Element;
|
|
139
|
+
type DialogProps = {
|
|
140
|
+
readonly title: string;
|
|
141
|
+
readonly open: boolean;
|
|
142
|
+
readonly onClose: () => void;
|
|
143
|
+
readonly testId: string;
|
|
144
|
+
readonly children: ReactNode;
|
|
145
|
+
};
|
|
146
|
+
declare const Dialog: ({ title, open, onClose, testId, children }: DialogProps) => react.JSX.Element;
|
|
147
|
+
type DisclosureProps = {
|
|
148
|
+
readonly summary: string;
|
|
149
|
+
readonly open: boolean;
|
|
150
|
+
readonly onOpenChange: (open: boolean) => void;
|
|
151
|
+
readonly testId: string;
|
|
152
|
+
readonly children: ReactNode;
|
|
153
|
+
};
|
|
154
|
+
declare const Disclosure: ({ summary, open, onOpenChange, testId, children }: DisclosureProps) => react.JSX.Element;
|
|
117
155
|
type FieldControl = {
|
|
118
156
|
readonly id: string;
|
|
119
157
|
readonly "aria-describedby": string | undefined;
|
|
@@ -170,6 +208,50 @@ type RadioGroupProps = {
|
|
|
170
208
|
readonly ref?: Ref<HTMLInputElement>;
|
|
171
209
|
};
|
|
172
210
|
declare const RadioGroup: ({ legend, description, error, value, options, onValueChange, testId, ref }: RadioGroupProps) => react.JSX.Element;
|
|
211
|
+
type HeadingType = Extract<TypeToken, "title" | "heading" | "display" | "display-lg">;
|
|
212
|
+
type HeadingProps = {
|
|
213
|
+
readonly level: 1 | 2 | 3;
|
|
214
|
+
readonly type: HeadingType;
|
|
215
|
+
readonly testId: string;
|
|
216
|
+
readonly headingRef?: Ref<HTMLHeadingElement>;
|
|
217
|
+
readonly children: ReactNode;
|
|
218
|
+
};
|
|
219
|
+
declare const Heading: ({ level, type, testId, headingRef, children }: HeadingProps) => react.JSX.Element;
|
|
220
|
+
type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
|
|
221
|
+
type PillProps = {
|
|
222
|
+
readonly tone: PillTone;
|
|
223
|
+
readonly variant: "tint" | "solid";
|
|
224
|
+
readonly testId: string;
|
|
225
|
+
readonly dataAttributes?: DataAttributes;
|
|
226
|
+
readonly children: ReactNode;
|
|
227
|
+
};
|
|
228
|
+
declare const Pill: ({ tone, variant, testId, dataAttributes, children }: PillProps) => react.JSX.Element;
|
|
229
|
+
type ProgressBarProps = {
|
|
230
|
+
readonly label: string;
|
|
231
|
+
readonly valueText: string;
|
|
232
|
+
readonly value: number | null;
|
|
233
|
+
readonly max: number | null;
|
|
234
|
+
readonly testId: string;
|
|
235
|
+
};
|
|
236
|
+
declare const ProgressBar: ({ label, valueText, value, max, testId }: ProgressBarProps) => react.JSX.Element;
|
|
237
|
+
type JobCancel = {
|
|
238
|
+
readonly label: string;
|
|
239
|
+
readonly busyLabel: string;
|
|
240
|
+
readonly busy: boolean;
|
|
241
|
+
readonly onCancel: () => void;
|
|
242
|
+
};
|
|
243
|
+
type JobCardProps = {
|
|
244
|
+
readonly title: string;
|
|
245
|
+
readonly status: {
|
|
246
|
+
readonly tone: PillTone;
|
|
247
|
+
readonly label: string;
|
|
248
|
+
};
|
|
249
|
+
readonly progress?: Omit<ProgressBarProps, "testId">;
|
|
250
|
+
readonly cancel?: JobCancel;
|
|
251
|
+
readonly testId: string;
|
|
252
|
+
readonly children?: ReactNode;
|
|
253
|
+
};
|
|
254
|
+
declare const JobCard: ({ title, status, progress, cancel, testId, children }: JobCardProps) => react.JSX.Element;
|
|
173
255
|
type LoadMoreProps = {
|
|
174
256
|
readonly onLoad: () => void;
|
|
175
257
|
readonly busy: boolean;
|
|
@@ -212,23 +294,6 @@ type AlertMessageProps = {
|
|
|
212
294
|
readonly children: ReactNode;
|
|
213
295
|
};
|
|
214
296
|
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
297
|
type ResourceFailedProps = {
|
|
233
298
|
readonly failure: ResourceFailure;
|
|
234
299
|
readonly onReload: () => void;
|
|
@@ -238,6 +303,18 @@ type ResourceFailedProps = {
|
|
|
238
303
|
readonly testId: string;
|
|
239
304
|
};
|
|
240
305
|
declare const ResourceFailed: ({ failure, onReload, forbiddenMessage, failureMessage, rescueRef, testId }: ResourceFailedProps) => react.JSX.Element;
|
|
306
|
+
type SegmentedOption = {
|
|
307
|
+
readonly value: string;
|
|
308
|
+
readonly label: string;
|
|
309
|
+
};
|
|
310
|
+
type SegmentedControlProps = {
|
|
311
|
+
readonly label: string;
|
|
312
|
+
readonly options: readonly SegmentedOption[];
|
|
313
|
+
readonly value: string;
|
|
314
|
+
readonly onValueChange: (value: string) => void;
|
|
315
|
+
readonly testId: string;
|
|
316
|
+
};
|
|
317
|
+
declare const SegmentedControl: ({ label, options, value, onValueChange, testId }: SegmentedControlProps) => react.JSX.Element;
|
|
241
318
|
type RowButtonProps = {
|
|
242
319
|
readonly selected: boolean;
|
|
243
320
|
readonly controls: string;
|
|
@@ -263,6 +340,17 @@ type SelectableListProps<T> = {
|
|
|
263
340
|
readonly ref?: Ref<HTMLDivElement>;
|
|
264
341
|
};
|
|
265
342
|
declare const SelectableList: <T>({ label, items, itemKey, selectedKey, onSelect, detailId, renderRow, rowTestId, rowData, empty, testId, ref }: SelectableListProps<T>) => react.JSX.Element;
|
|
343
|
+
type SliderProps = {
|
|
344
|
+
readonly label: string;
|
|
345
|
+
readonly value: number;
|
|
346
|
+
readonly min: number;
|
|
347
|
+
readonly max: number;
|
|
348
|
+
readonly step: number;
|
|
349
|
+
readonly valueText: (value: number) => string;
|
|
350
|
+
readonly onValueChange: (value: number) => void;
|
|
351
|
+
readonly testId: string;
|
|
352
|
+
};
|
|
353
|
+
declare const Slider: ({ label, value, min, max, step, valueText, onValueChange, testId }: SliderProps) => react.JSX.Element;
|
|
266
354
|
type StackProps = {
|
|
267
355
|
readonly gap: SpaceToken;
|
|
268
356
|
readonly testId: string;
|
|
@@ -270,6 +358,38 @@ type StackProps = {
|
|
|
270
358
|
};
|
|
271
359
|
declare const Stack: ({ gap, testId, children }: StackProps) => react.JSX.Element;
|
|
272
360
|
declare const Cluster: ({ gap, testId, children }: StackProps) => react.JSX.Element;
|
|
361
|
+
type StepState = "done" | "current" | "pending";
|
|
362
|
+
type StepperItem = {
|
|
363
|
+
readonly id: string;
|
|
364
|
+
readonly label: string;
|
|
365
|
+
readonly state: StepState;
|
|
366
|
+
};
|
|
367
|
+
type StepperProps = {
|
|
368
|
+
readonly label: string;
|
|
369
|
+
readonly steps: readonly StepperItem[];
|
|
370
|
+
readonly testId: string;
|
|
371
|
+
};
|
|
372
|
+
declare const Stepper: ({ label, steps, testId }: StepperProps) => react.JSX.Element;
|
|
373
|
+
type SwitchProps = {
|
|
374
|
+
readonly label: string;
|
|
375
|
+
readonly checked: boolean;
|
|
376
|
+
readonly onCheckedChange: (checked: boolean) => void;
|
|
377
|
+
readonly testId: string;
|
|
378
|
+
};
|
|
379
|
+
declare const Switch: ({ label, checked, onCheckedChange, testId }: SwitchProps) => react.JSX.Element;
|
|
380
|
+
type TabItem = {
|
|
381
|
+
readonly id: string;
|
|
382
|
+
readonly label: string;
|
|
383
|
+
readonly href: string;
|
|
384
|
+
};
|
|
385
|
+
type TabsProps = {
|
|
386
|
+
readonly label: string;
|
|
387
|
+
readonly items: readonly TabItem[];
|
|
388
|
+
readonly currentId: string;
|
|
389
|
+
readonly onNavigate: (href: string) => void;
|
|
390
|
+
readonly testId: string;
|
|
391
|
+
};
|
|
392
|
+
declare const Tabs: ({ label, items, currentId, onNavigate, testId }: TabsProps) => react.JSX.Element;
|
|
273
393
|
type TextFace = "sans" | "mono";
|
|
274
394
|
type TextProps = {
|
|
275
395
|
readonly fg: FgRole;
|
|
@@ -300,6 +420,12 @@ type TileGridProps = {
|
|
|
300
420
|
readonly children: ReactNode;
|
|
301
421
|
};
|
|
302
422
|
declare const TileGrid: ({ count, minInlinePx, testId, children }: TileGridProps) => react.JSX.Element;
|
|
423
|
+
type ToolbarProps = {
|
|
424
|
+
readonly label: string;
|
|
425
|
+
readonly testId: string;
|
|
426
|
+
readonly children: ReactNode;
|
|
427
|
+
};
|
|
428
|
+
declare const Toolbar: ({ label, testId, children }: ToolbarProps) => react.JSX.Element;
|
|
303
429
|
declare const useEscapeToClose: (onClose: () => void) => ((event: KeyboardEvent<HTMLElement>) => void);
|
|
304
430
|
declare const useFocusRescue: (getTarget: () => HTMLElement | null) => RefCallback<HTMLElement>;
|
|
305
431
|
type PagedLoaders<T, C, M> = {
|
|
@@ -326,4 +452,4 @@ type VisuallyHiddenProps = {
|
|
|
326
452
|
readonly children: ReactNode;
|
|
327
453
|
};
|
|
328
454
|
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 };
|
|
455
|
+
export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, 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, 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, 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 };
|