@aiquants/console-ui 0.3.0 → 0.4.1

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 CHANGED
@@ -117,7 +117,7 @@ Draw a modal as a `Dialog`: a modal `<dialog>` (`showModal()`) makes everything
117
117
  Every pair meets AAA (`CONTRAST_MINIMUM`: 7 for text, 4.5 for large text, 3 for non-text; the lowest text and non-text ratios are 7.12 and 3.47 in the light scheme, 9.29 and 5.54 in the dark one), and a pair not in the table is never drawn. `Text` is the only component that paints caller text, and it paints only through a text role.
118
118
  - The remaining colours are fixed non-text graphics, each drawn against listed surfaces of `CONTRAST_PAIRS`: the control border (`border-control`) of inputs, secondary buttons, segments and the switch's track, the slider's rail and a pending step's ring, the invalid border (`danger-accent`), the selected-row band, the radio mark, the current tab's marker and the slider's thumb (`info-accent`), and the focus ring (`focus`).
119
119
  The solid buttons', the pressed segment's and the checked switch track's border is their own fill, and the rules of cards, tables, comparison headings, description lists and dialogs (`border-subtle`) are decorative, never a component's only boundary. A switch's thumb stands out from its track by at least 3 : 1 in both schemes.
120
- - In forced-colors mode (Windows high contrast), which removes surfaces, shadows and backgrounds and paints transparent borders, the package redraws its non-colour cues in system colours: the selected row's start band (`Highlight`), the progress track and fill (`CanvasText` / `Highlight`), the current tab's marker (`Highlight`, the other tabs' markers sunk into `Canvas`), the switch's thumb (`CanvasText`, `HighlightText` on a `Highlight` track when on), the slider's rail and thumb (`CanvasText` / `Highlight`),
120
+ - In forced-colors mode (Windows high contrast), which removes surfaces, shadows and backgrounds and paints transparent borders, the package redraws its non-colour cues in system colours: the selected row's start band (`Highlight`), the progress and meter tracks and fills (`CanvasText` / `Highlight`), the current tab's marker (`Highlight`, the other tabs' markers sunk into `Canvas`), the switch's thumb (`CanvasText`, `HighlightText` on a `Highlight` track when on), the slider's rail and thumb (`CanvasText` / `Highlight`),
121
121
  and the pressed segment and the current step's marker (`Highlight` with `HighlightText`).
122
122
  The band is the row's own inline-start border, taken out of its inline-start padding (the row's box and text stay where an unselected row has them, and the band stays at the start in a right-to-left root). The focus ring sets only `outline`, so a selected row that has focus keeps its band.
123
123
  Every rule is a border (the cell's own bottom border, taken out of the cell's bottom padding; no rule is drawn as a shadow, which forced colours remove), so it stays in the forced `CanvasText` with no rule of its own, and nothing is positioned for forced colours, so the focus rings of rows and of controls in cells stay whole.
@@ -254,10 +254,12 @@ Draw a modal as a `Dialog`: a modal `<dialog>` (`showModal()`) makes everything
254
254
  | `Measured` | A count, or the `unmeasured` label for `null` (never `0`). |
255
255
  | `MetricTile`, `TileGrid` | Metric tiles (100 px high) and the divisor grid. `count` is checked against the element children: a Fragment's children count one by one, a condition that renders no tile (`false`, `null`) does not count, a text child throws, and a component child counts as one tile whatever it renders (a wrapper returning `null` or two tiles is still one), so render `MetricTile` elements directly. |
256
256
  | `DataTable`, `LoadMore` | Fixed-layout table in a focusable named scroll frame; load-more that moves focus to the first row the page appended or the end-of-records text. |
257
+ | `CodeBlock` | Preformatted text (a JSON document, an excerpt of a log) drawn exactly as given in the mono face and the `body` type, without wrapping, in a scroll frame on `sunken` with 8 px padding: a region named by `label` that takes keyboard focus, so a long line can be scrolled into view from the keyboard. |
257
258
  | `SelectableList`, `RowButton` | Master list of selectable rows (`data-selected`, `aria-expanded`, `aria-controls`); the list carries an explicit `role="list"`, which WebKit needs to expose an unstyled list as a list. |
258
259
  | `ComparisonGrid` | Side-by-side comparison: a table named by its (visually hidden) `caption`, or one group per column named by its heading. Both layouts are in the DOM; each cell is a function called once per layout with `"table"` or `"stack"`, so every cell is rendered and mounted twice (the hidden copy included) and the caller gives each copy its own ids, test ids and refs. Cells must be presentational: no data read (`useResource`), announcement (`useAnnounce`) or focus management (`useFocusRescue`); keep state and effects above the grid and pass values into the cells. |
259
260
  | `Field`, `TextInput`, `TextArea`, `Select`, `RadioGroup` | Fields tied to their label, description and error with `useId`. |
260
261
  | `ProgressBar` | Determinate with a maximum (clamped at 100 %); indeterminate without, drawn as a quarter-length segment that sweeps the track when motion is allowed and rests in its middle otherwise. The visible label names the bar; the visible value text is hidden from assistive technology, which reads it once as the bar's `aria-valuetext`. |
262
+ | `Meter` | A value at its place in a fixed range (a score in [0, 1], a share of a quota), not progress: `role="meter"` named by `label` (no visible label; the row or field around it says what it measures), its fill in `info-accent` on a `sunken` track as long as the value's place in the range, beside the value text in `fg` (hidden from assistive technology, which reads it once as the meter's `aria-valuetext`). It is phrasing content that fits one `body` line, so it can be a line of a `RowButton`: it takes its parent's whole width even where the parent aligns its lines to the start (a `RowButton`), and the 8 px track is centred on the value text's 20 px line and takes the width left after the text, never less than 48 px. Refuses a range that is not finite or whose `min` is not below `max`, and a value outside the range. |
261
263
  | `MasterDetail` | Master–detail layout by container width; side by side, neither pane goes below its minimum. |
262
264
  | `Heading` | A page or region heading outside a `Card`: `h1` to `h3` in a heading step (`title`, `heading`, `display`, `display-lg`), bold, without margins; with `headingRef` a programmatic focus target (`tabIndex={-1}`) for the focus a host moves after a navigation. |
263
265
  | `Tabs` | The tab row of a console whose tabs are routes: a named `nav` of real links (not an ARIA `tablist`), the current one `aria-current="page"` with an `info-accent` marker and the medium weight. A plain click hands the tab's `href` to `onNavigate` (the host's router); a click with a modifier key or another button keeps the link's own behaviour. |
@@ -298,6 +300,8 @@ The test ids a component derives from its `testId` are public test hooks:
298
300
  | `TextInput`, `TextArea`, `Select` | `<testId>-field` (the field root; `testId` itself is on the control), `<testId>-description`, `<testId>-error` |
299
301
  | `Field`, `RadioGroup` | `<testId>-description`, `<testId>-error`; `RadioGroup` also `<testId>-option-<value>` |
300
302
  | `ProgressBar` | `<testId>-bar` (the `progressbar`), `<testId>-fill`, `<testId>-value` (the visible value text) |
303
+ | `Meter` | `<testId>-bar` (the `meter`), `<testId>-fill`, `<testId>-value` (the visible value text) |
304
+ | `CodeBlock` | `<testId>-code` (the `pre`; `testId` itself is on the frame) |
301
305
  | `MetricTile` | `<testId>-value` (the `Measured` value) |
302
306
  | `MasterDetail` | `<testId>-master`, `<testId>-detail` |
303
307
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
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&&lt[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;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkA4D4K2WFcjs = require('./chunk-A4D4K2WF.cjs');var _chunkIR2WTSOWcjs = require('./chunk-IR2WTSOW.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var ce=_react.createContext.call(void 0, null),xt=" ",Be='[inert], [aria-hidden="true" i]',_e="dialog:modal",pe="data-cui-dialog-announcer",Et=`:scope > [${pe}]`,Nt=e=>{if(e.closest(Be)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(_e)],r=t.activeElement,n=o.filter(c=>c.contains(r)),a=n.length>0?n:o,s=a.filter(c=>c.contains(e)).length;if(s===a.length)return{region:e};let d=a.find(c=>a.every(p=>p.contains(c))),i=_nullishCoalesce(_optionalChain([d, 'optionalAccess', _2 => _2.querySelector, 'call', _3 => _3(Et)]), () => (null));return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Be)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},Pt=e=>{try{e.querySelectorAll(_e)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ue= exports.ANNOUNCE_SETTLE_MS =150,wt=1e3,Mt= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(_react.useContext.call(void 0, ce)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=_chunkA4D4K2WFcjs.o.call(void 0, e),[d]=Intl.getCanonicalLocales(t),i=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Pt(c.current.ownerDocument)},[]);let l=_react.useCallback.call(void 0, m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let g=()=>{let{texts:w,settle:b,deadline:R}=p.current;p.current=null,clearTimeout(b),clearTimeout(R);let f=c.current;if(f===null)return;let h=w.join(xt),T=Nt(f);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let L=f.ownerDocument.createElement("span");L.textContent=h,T.region.replaceChildren(L)},x=p.current;if(x===null){p.current={texts:[m],settle:setTimeout(g,ue),deadline:setTimeout(g,wt)};return}x.texts.push(m),clearTimeout(x.settle),x.settle=setTimeout(g,ue)},[]),y=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return _jsxruntime.jsx.call(void 0, ce.Provider,{value:y,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:c})]})})},N= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, ce);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},u=()=>{N()},St= exports.useAnnounce =()=>N().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};var kt=({items:e,current:t,onNavigate:o,testId:r})=>{let{labels:n}=N();if(new Set(e.map(a=>a.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(a=>a.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(a=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:a.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${a.id}`,onClick:s=>J(s,a.href,o),children:a.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},a.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};var P=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var v=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:d,children:i})=>(u(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:d,children:i}));var Dt={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ve=({children:e})=>_jsxruntime.jsx.call(void 0, "span",{children:e}),S= exports.Button =({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:d,ref:i,dataAttributes:c,busy:p,busyLabel:l})=>{u();let y=_react.useId.call(void 0, ),m=p===!0||a!==void 0,g=Dt[e],x=w=>{if(m){w.preventDefault();return}_optionalChain([n, 'optionalCall', _4 => _4(w)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":g.fg,"data-cui-surface":g.surface,"data-cui-type":g.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:x,ref:i,...P(c),children:_jsxruntime.jsx.call(void 0, Ve,{children:p===!0?l:t})}),a===void 0?null:_jsxruntime.jsx.call(void 0, v,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:a.reason})]})},$t= exports.Link =({onNavigate:e,children:t,testId:o,ref:r})=>(u(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, Ve,{children:t})}));var ye=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=_react.useId.call(void 0, );return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":c,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...P(d),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:c,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),i]})},Ft= exports.CardSection =({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=_react.useId.call(void 0, ),p=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return r?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:p}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:p})};var Ot=({label:e,code:t,testId:o})=>(u(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":o,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${o}-code`,children:t})}));var H=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var qt=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{u();let s=_react.useId.call(void 0, );for(let l of[r,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=r+o.length*n,i=`cui-comparison-a${r}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,p=`${c("table")}{display:none}@container (min-width:${_chunkA4D4K2WFcjs.p.call(void 0, d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:i,css:p}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkA4D4K2WFcjs.p.call(void 0, r)}}),o.map(l=>_jsxruntime.jsx.call(void 0, "col",{},l.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),o.map(l=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:l.heading},l.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(l=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:l.label}),o.map(y=>_jsxruntime.jsx.call(void 0, "td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:o.map((l,y)=>{let m=`${s}-column-${y}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-comparison-heading",id:m,children:l.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(g=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:g.label}),_jsxruntime.jsx.call(void 0, "dd",{children:l.cells[g.key]("stack")})]},g.key))})]},l.key)})})]})};var Gt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:d,empty:i,testId:c,ref:p})=>{u();let l=_react.useId.call(void 0, ),y=_chunkA4D4K2WFcjs.s.call(void 0, o);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":c,ref:p,children:r.length===0?_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):_jsxruntime.jsx.call(void 0, "section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":_chunkA4D4K2WFcjs.p.call(void 0, y)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:o.map(m=>_jsxruntime.jsx.call(void 0, "col",{style:m.width.fixedPx===void 0?void 0:{width:_chunkA4D4K2WFcjs.p.call(void 0, m.width.fixedPx)}},m.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:o.map(m=>_jsxruntime.jsx.call(void 0, "th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{children:r.map(m=>_jsxruntime.jsx.call(void 0, "tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...P(_optionalChain([s, 'optionalCall', _5 => _5(m)])),children:o.map(g=>_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":g.align,children:g.cell(m)},g.key))},n(m)))})]})})})};var zt=({items:e,testId:t})=>{if(u(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:o.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};var Zt=229,Yt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),fe=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Yt.has(e.type)&&(e.value!==""||e.validity.badInput),Xt= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Zt||fe(t.target)||(t.stopPropagation(),e())},[e]);var Ye=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},jt= exports.Dialog =({title:e,open:t,onClose:o,testId:r,children:n})=>{let{labels:a}=N(),s=_react.useId.call(void 0, ),d=_react.useRef.call(void 0, null),i=_react.useRef.call(void 0, null);return _react.useLayoutEffect.call(void 0, ()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),_react.useLayoutEffect.call(void 0, ()=>{let l=d.current;return()=>{l.open&&(l.close(),Ye(i.current),i.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onClose:()=>{Ye(i.current),i.current=null,t&&o()},onCancel:l=>{fe(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",testId:`${r}-close`,onClick:()=>_optionalChain([d, 'access', _6 => _6.current, 'optionalAccess', _7 => _7.close, 'call', _8 => _8()]),children:a.close})})]}),n,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[pe]:"","data-testid":`${r}-announcer`})]})};var to=({summary:e,open:t,onOpenChange:o,testId:r,children:n})=>{u();let a=_react.useId.call(void 0, );return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":r,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":a,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>o(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:a,hidden:!t,"data-testid":`${r}-panel`,children:n})]})};var q=({description:e,error:t})=>{u();let o=_react.useId.call(void 0, ),r=_react.useId.call(void 0, ),n=_react.useId.call(void 0, ),a=[e===void 0?null:r,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),oo= exports.Field =({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:s,errorId:d,testId:r})]})},ro= exports.TextInput =({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:d,testId:i,ref:c})=>{let{control:p,descriptionId:l,errorId:y}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${i}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:a,value:r,list:s,required:d,onChange:m=>n(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":i,ref:c,...p}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},ao= exports.TextArea =({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},no= exports.Select =({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",value:r,onChange:l=>a(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>_jsxruntime.jsx.call(void 0, "option",{value:l.value,children:l.label},l.value))}),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},so= exports.RadioGroup =({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let i=_react.useId.call(void 0, ),{control:c,descriptionId:p,errorId:l}=q({label:e,description:t,error:o});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:i,value:y.value,checked:y.value===r,onChange:()=>a(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:y.label})]},y.value)),_jsxruntime.jsx.call(void 0, _,{description:t,error:o,descriptionId:p,errorId:l,testId:s})]})};var lo={1:"h1",2:"h2",3:"h3"},co= exports.Heading =({level:e,type:t,testId:o,headingRef:r,children:n})=>{u();let a=lo[e];return _jsxruntime.jsx.call(void 0, a,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:r,tabIndex:r===void 0?void 0:-1,children:n})};var po={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},yo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},be= exports.Pill =({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{u();let a=t==="tint"?po[e]:{fg:"on-solid",surface:yo[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...P(r),children:n})};var Re=({label:e,valueText:t,value:o,max:r,testId:n})=>{u();let a=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":n,children:[_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg",type:"body",id:a,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _9 => _9.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _10 => _10.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};var bo=({title:e,status:t,progress:o,cancel:r,testId:n,children:a})=>_jsxruntime.jsxs.call(void 0, ye,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${n}-cancel`,children:r.label}),testId:n,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, be,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:_jsxruntime.jsx.call(void 0, Re,{...o,testId:`${n}-progress`}),a]});var Ro=({tone:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-testid":t,children:o})),V= exports.AlertMessage =({occurrence:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));var vo=e=>e+1,Te= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),o=_react.useRef.call(void 0, null),[,r]=_react.useReducer.call(void 0, vo,0),n=_react.useCallback.call(void 0, (a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return _react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||_optionalChain([t, 'access', _11 => _11.current, 'call', _12 => _12(), 'optionalAccess', _13 => _13.focus, 'call', _14 => _14()])}),n};var he="[data-cui-row-focus]",xo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(he)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${he} elements for ${e.count} rows`);return o},Eo=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},No= exports.LoadMore =({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, !1),m=()=>{let b=a.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(he)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let f=xo(a);if(t){R.busySeen=!0,R.shown=new Set(f);return}let h=Eo(f,R.shown),T=r!==null&&r.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let L=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&L)&&h.focus()});let g=Te(()=>o?p.current:l.current),x=_react.useCallback.call(void 0, (b=>{l.current=b;let R=g(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[g]),w=_react.useCallback.call(void 0, (b=>{p.current=b;let R=g(b);return()=>{p.current=null,R()}}),[g]);return o?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,testId:`${s}-end`,children:i.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:[_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:x,testId:`${s}-button`,children:i.loadMore(_chunkA4D4K2WFcjs.a.call(void 0, n,d))}),r===null?null:_jsxruntime.jsx.call(void 0, V,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};var wo=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{u();let a=_chunkA4D4K2WFcjs.r.call(void 0, {masterMinPx:o,detailMinPx:r,gapPx:_chunkA4D4K2WFcjs.G.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:a.key,css:a.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};var Ce=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=N();if(e===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=_chunkA4D4K2WFcjs.a.call(void 0, e,r);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};var Mo=({label:e,value:t,min:o,max:r,valueText:n,testId:a})=>{if(u(),!(Number.isFinite(o)&&Number.isFinite(r)&&o<r))throw new RangeError(`Meter needs a finite range with min below max: min ${o}, max ${r}`);if(!(Number.isFinite(t)&&t>=o&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${o}, max ${r}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":n,"data-cui-surface":"sunken","data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-o)/(r-o)*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{fg:"fg",type:"body",testId:`${a}-value`,children:n})})]})};var Lo=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=N();return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":a,children:[_jsxruntime.jsx.call(void 0, V,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:_jsxruntime.jsx.call(void 0, S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};var Io=({label:e,options:t,value:o,onValueChange:r,testId:n})=>{u();let a=new Set(t.map(s=>s.value));if(t.length<2||a.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!a.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...a].join(", ")}`);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":n,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(s=>{let d=s.value===o;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${n}-${s.value}`,onClick:()=>{d||r(s.value)},children:s.label},s.value)})})]})};var it=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(u(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:o,ref:a,...P(n),children:s})),Do= exports.SelectableList =({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:p,ref:l})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?_jsxruntime.jsx.call(void 0, v,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, it,{selected:m===r,controls:a,onSelect:()=>n(y),testId:d,dataAttributes:_optionalChain([i, 'optionalCall', _15 => _15(y)]),children:s(y)})},m)})})}));var Ho=({label:e,value:t,min:o,max:r,step:n,valueText:a,onValueChange:s,testId:d})=>{u();let i=_react.useId.call(void 0, );if(!([t,o,r,n].every(Number.isFinite)&&o<r&&n>0&&o<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${r}, step ${n}`);let c=a(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:i,type:"range",min:o,max:r,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, v,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};var Fo=({gap:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Uo= exports.Cluster =({gap:e,testId:t,children:o})=>(u(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));var ct={done:0,current:1,pending:2},Oo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Bo= exports.Stepper =({label:e,steps:t,testId:o})=>{let{labels:r}=N();if(t.length===0||new Set(t.map(a=>a.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(a=>a.id).join(", ")}`);if(t.filter(a=>a.state==="current").length>1||t.some((a,s)=>s>0&&ct[a.state]<ct[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(a=>a.state).join(", ")}`);let n={done:r.stepDone,current:null,pending:r.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((a,s)=>{let d=Oo[a.state],i=n[a.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":a.state==="current"?"step":void 0,"data-cui-step":a.state,"data-testid":`${o}-${a.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:a.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[a.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},a.id)})})};var Ko=({label:e,checked:t,onCheckedChange:o,testId:r})=>(u(),_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:()=>o(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${r}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{children:e})]}));var _o=({label:e,items:t,currentId:o,onNavigate:r,testId:n})=>{if(u(),t.length===0)throw new RangeError("Tabs needs at least one tab");let a=new Set(t.map(s=>s.id));if(a.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!a.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...a].join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,r),children:s.label})},s.id)})})})};var Wo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Jo= exports.MetricTile =({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(u(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...P(a),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":Wo[r],"data-cui-type":"heading",children:_jsxruntime.jsx.call(void 0, Ce,{value:o,testId:`${n}-value`})})]})},pt=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?pt(t.props.children):[t]}),Zo= exports.TileGrid =({count:e,minInlinePx:t,testId:o,children:r})=>{u();let n=_chunkA4D4K2WFcjs.w.call(void 0, e,t,_chunkA4D4K2WFcjs.G.space["space-2"]),a=pt(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":o,children:[_jsxruntime.jsx.call(void 0, H,{ruleKey:n.key,css:n.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};var re=e=>[...e.querySelectorAll("button")],Xo= exports.Toolbar =({label:e,testId:t,children:o})=>{u();let r=_react.useRef.call(void 0, null),n=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=re(r.current),c=n.current!==null&&i.includes(n.current)?n.current:_nullishCoalesce(i[0], () => (null));n.current=c;for(let p of i)p.tabIndex=p===c?0:-1});let a=i=>{for(let c of re(r.current))c.tabIndex=c===i?0:-1;n.current=i};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let c=re(i.currentTarget).find(p=>p.contains(i.target));c!==void 0&&a(c)},onKeyDown:i=>{let c=re(i.currentTarget),p=c.indexOf(i.target);if(p===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",g={[l]:(p+1)%c.length,[y]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(g===void 0)return;i.preventDefault();let x=c[g];a(x),x.focus()},children:o})};var ft=e=>e===null?_chunkA4D4K2WFcjs.i:_chunkA4D4K2WFcjs.j,ne=(e,t,o,r,n)=>{let[a,s]=_react.useState.call(void 0, ()=>({key:e,state:ft(e)})),[d,i]=_react.useState.call(void 0, 0),[c,p]=_react.useState.call(void 0, 0),l=_react.useRef.call(void 0, t),y=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, d);_react.useLayoutEffect.call(void 0, ()=>{l.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkA4D4K2WFcjs.i});return}let f=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:r(T.state,h)}:{key:e,state:_chunkA4D4K2WFcjs.j}),l.current(f.signal).then(T=>{f.signal.aborted||(y.current=null,s(L=>({key:e,state:n(L.state,T)})))},T=>{f.signal.aborted||s(()=>{throw T})}),()=>{f.abort(),y.current=null}},[e,o,d,c]);let g=_react.useCallback.call(void 0, ()=>i(f=>f+1),[]),x=_react.useCallback.call(void 0, ()=>p(f=>f+1),[]),w=_react.useCallback.call(void 0, (f,h)=>{s(T=>Object.is(T.key,f)?{key:f,state:h(T.state)}:T)},[]),b=_react.useCallback.call(void 0, (f,h)=>{w(f,h),Object.is(y.current,f)&&x()},[w,x]);return{state:Object.is(a.key,e)?a.state:ft(e),reload:g,refresh:x,update:w,write:b}};var or=(e,t,o)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let n=_react.useCallback.call(void 0, b=>r.current.first(b),[]),{state:a,reload:s,refresh:d,update:i,write:c}=ne(e,n,o,_chunkA4D4K2WFcjs.x,_chunkA4D4K2WFcjs.y),p=_react.useRef.call(void 0, {key:e,state:a});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:a}});let l=_react.useRef.call(void 0, null),y=_react.useCallback.call(void 0, ()=>{_optionalChain([l, 'access', _16 => _16.current, 'optionalAccess', _17 => _17.controller, 'access', _18 => _18.abort, 'call', _19 => _19()]),l.current=null},[]);_react.useEffect.call(void 0, ()=>y,[e,o,y]);let m=_react.useCallback.call(void 0, ()=>{y(),s()},[y,s]),g=_react.useCallback.call(void 0, ()=>{y(),d()},[y,d]),x=_react.useCallback.call(void 0, ()=>{let{key:b,state:R}=p.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let f=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,_chunkA4D4K2WFcjs.z),r.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,L=>h.maps.reduce((bt,Rt)=>_chunkA4D4K2WFcjs.B.call(void 0, bt,Rt),_chunkA4D4K2WFcjs.A.call(void 0, L,f,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=_react.useCallback.call(void 0, (b,R)=>{let f=l.current;f!==null&&Object.is(f.key,b)&&f.maps.push(R),c(b,h=>_chunkA4D4K2WFcjs.B.call(void 0, h,R))},[c]);return{state:a,reload:m,refresh:g,loadMore:x,updateList:w}};var ar=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=ne(e,t,o,_chunkA4D4K2WFcjs.k,_chunkA4D4K2WFcjs.l),d=_react.useCallback.call(void 0, (i,c)=>s(i,p=>_chunkA4D4K2WFcjs.l.call(void 0, p,{ok:!0,value:c})),[s]);return{state:r,reload:n,refresh:a,put:d}};var nr=({testId:e,children:t})=>(u(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ue; exports.AlertMessage = V; exports.Breadcrumb = kt; exports.Button = S; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkA4D4K2WFcjs.n; exports.CONTRAST_MINIMUM = _chunkIR2WTSOWcjs.c; exports.CONTRAST_PAIRS = _chunkIR2WTSOWcjs.d; exports.Card = ye; exports.CardSection = Ft; exports.Cluster = Uo; exports.CodeBlock = Ot; exports.ComparisonGrid = qt; exports.ConsoleUiRoot = Mt; exports.DataTable = Gt; exports.DescriptionList = zt; exports.Dialog = jt; exports.Disclosure = to; exports.Field = oo; exports.HTTP_FORBIDDEN = _chunkA4D4K2WFcjs.f; exports.Heading = co; exports.JobCard = bo; exports.LATTICE_PX = _chunkA4D4K2WFcjs.C; exports.Link = $t; exports.LoadMore = No; exports.MasterDetail = wo; exports.Measured = Ce; exports.Meter = Mo; exports.MetricTile = Jo; exports.Notice = Ro; exports.Pill = be; exports.ProgressBar = Re; exports.ROW_WITH_CONTROL_PX = _chunkA4D4K2WFcjs.F; exports.RadioGroup = so; exports.ResourceFailed = Lo; exports.RowButton = it; exports.SegmentedControl = Io; exports.Select = no; exports.SelectableList = Do; exports.Slider = Ho; exports.Stack = Fo; exports.Stepper = Bo; exports.Switch = Ko; exports.TARGET_PX = _chunkA4D4K2WFcjs.E; exports.TOKENS = _chunkA4D4K2WFcjs.G; exports.Tabs = _o; exports.Text = v; exports.TextArea = ao; exports.TextInput = ro; exports.TileGrid = Zo; exports.Toolbar = Xo; exports.VisuallyHidden = nr; exports.ZonedTimeError = _chunkA4D4K2WFcjs.b; exports.beginPage = _chunkA4D4K2WFcjs.z; exports.beginPagedReload = _chunkA4D4K2WFcjs.x; exports.beginReload = _chunkA4D4K2WFcjs.k; exports.ceil8 = _chunkA4D4K2WFcjs.v; exports.ceilToLattice = _chunkA4D4K2WFcjs.D; exports.contrastRatio = _chunkIR2WTSOWcjs.b; exports.cssVar = _chunkA4D4K2WFcjs.H; exports.flatMapOutcome = _chunkA4D4K2WFcjs.h; exports.formatCount = _chunkA4D4K2WFcjs.a; exports.formatInstant = _chunkA4D4K2WFcjs.e; exports.hexToSrgb = _chunkIR2WTSOWcjs.a; exports.keepLastGood = _chunkA4D4K2WFcjs.l; exports.mapOutcome = _chunkA4D4K2WFcjs.g; exports.mapPagedList = _chunkA4D4K2WFcjs.B; exports.masterDetailPlan = _chunkA4D4K2WFcjs.q; exports.monoTextWidthEm = _chunkA4D4K2WFcjs.u; exports.reasonAside = _chunkA4D4K2WFcjs.m; exports.resolveConsoleUiLabels = _chunkA4D4K2WFcjs.o; exports.settleFirstPage = _chunkA4D4K2WFcjs.y; exports.settlePage = _chunkA4D4K2WFcjs.A; exports.tableMinInlinePx = _chunkA4D4K2WFcjs.s; exports.textWidthEm = _chunkA4D4K2WFcjs.t; exports.tileGridPlan = _chunkA4D4K2WFcjs.w; exports.toOffsetIso = _chunkA4D4K2WFcjs.c; exports.toWallTime = _chunkA4D4K2WFcjs.d; exports.useAnnounce = St; exports.useConsoleUi = N; exports.useEscapeToClose = Xt; exports.useFocusRescue = Te; exports.usePagedResource = or; exports.useResource = ar;
package/dist/index.d.cts CHANGED
@@ -68,6 +68,12 @@ type CardSectionProps = {
68
68
  readonly children: ReactNode;
69
69
  };
70
70
  declare const CardSection: ({ id, title, subtitle, region, testId, headingRef, ref, dataAttributes, children }: CardSectionProps) => react.JSX.Element;
71
+ type CodeBlockProps = {
72
+ readonly label: string;
73
+ readonly code: string;
74
+ readonly testId: string;
75
+ };
76
+ declare const CodeBlock: ({ label, code, testId }: CodeBlockProps) => react.JSX.Element;
71
77
  type ComparisonLayout = "table" | "stack";
72
78
  type ComparisonAttribute = {
73
79
  readonly key: string;
@@ -282,6 +288,15 @@ type MeasuredProps = {
282
288
  readonly testId: string;
283
289
  };
284
290
  declare const Measured: ({ value, unit, testId }: MeasuredProps) => react.JSX.Element;
291
+ type MeterProps = {
292
+ readonly label: string;
293
+ readonly value: number;
294
+ readonly min: number;
295
+ readonly max: number;
296
+ readonly valueText: string;
297
+ readonly testId: string;
298
+ };
299
+ declare const Meter: ({ label, value, min, max, valueText, testId }: MeterProps) => react.JSX.Element;
285
300
  type NoticeProps = {
286
301
  readonly tone: "info" | "warning";
287
302
  readonly testId: string;
@@ -452,4 +467,4 @@ type VisuallyHiddenProps = {
452
467
  readonly children: ReactNode;
453
468
  };
454
469
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
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 };
470
+ export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
package/dist/index.d.ts CHANGED
@@ -68,6 +68,12 @@ type CardSectionProps = {
68
68
  readonly children: ReactNode;
69
69
  };
70
70
  declare const CardSection: ({ id, title, subtitle, region, testId, headingRef, ref, dataAttributes, children }: CardSectionProps) => react.JSX.Element;
71
+ type CodeBlockProps = {
72
+ readonly label: string;
73
+ readonly code: string;
74
+ readonly testId: string;
75
+ };
76
+ declare const CodeBlock: ({ label, code, testId }: CodeBlockProps) => react.JSX.Element;
71
77
  type ComparisonLayout = "table" | "stack";
72
78
  type ComparisonAttribute = {
73
79
  readonly key: string;
@@ -282,6 +288,15 @@ type MeasuredProps = {
282
288
  readonly testId: string;
283
289
  };
284
290
  declare const Measured: ({ value, unit, testId }: MeasuredProps) => react.JSX.Element;
291
+ type MeterProps = {
292
+ readonly label: string;
293
+ readonly value: number;
294
+ readonly min: number;
295
+ readonly max: number;
296
+ readonly valueText: string;
297
+ readonly testId: string;
298
+ };
299
+ declare const Meter: ({ label, value, min, max, valueText, testId }: MeterProps) => react.JSX.Element;
285
300
  type NoticeProps = {
286
301
  readonly tone: "info" | "warning";
287
302
  readonly testId: string;
@@ -452,4 +467,4 @@ type VisuallyHiddenProps = {
452
467
  readonly children: ReactNode;
453
468
  };
454
469
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
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 };
470
+ export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{A as He,B as le,C as Rr,D as Tr,E as hr,F as vr,G as z,H as Cr,a as W,b as or,c as rr,d as ar,e as nr,f as bt,g as sr,h as ir,i as ne,j as se,k as Le,l as ie,m as lr,n as dr,o as Se,p as D,q as cr,r as Me,s as ke,t as ur,u as pr,v as yr,w as Ie,x as Ae,y as De,z as $e}from"./chunk-BUX2DNVR.js";import{a as mr,b as fr,c as gr,d as br}from"./chunk-BMGBEN26.js";import{createContext as Rt,useCallback as Tt,useContext as Be,useLayoutEffect as ht,useMemo as Fe,useRef as Ue}from"react";import{jsx as Ke,jsxs as Lt}from"react/jsx-runtime";var de=Rt(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=d?.querySelector(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=150,Nt=1e3,Pt=({locale:e,formatLocale:t,timeZone:o,testId:a,children:n})=>{if(Be(de)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=Se(e),[d]=Intl.getCanonicalLocales(t),i=Fe(()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=Ue(null),u=Ue(null);ht(()=>{Et(c.current.ownerDocument)},[]);let l=Tt(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=Fe(()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return Ke(de.Provider,{value:y,children:Lt("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[n,Ke("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:c})]})})},N=()=>{let e=Be(de);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},p=()=>{N()},wt=()=>N().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};import{jsx as K,jsxs as _e}from"react/jsx-runtime";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 K("nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":a,children:_e("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>_e("li",{className:"cui-breadcrumb-item",children:[K("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}),K("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.id)),K("li",{className:"cui-breadcrumb-item",children:K("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${a}-current`,children:t})})]})})};import{useId as kt}from"react";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};import{jsx as Mt}from"react/jsx-runtime";var x=({fg:e,type:t,face:o,as:a="span",testId:n,id:r,tabIndex:s,ref:d,children:i})=>(p(),Mt(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}));import{jsx as $,jsxs as Dt}from"react/jsx-runtime";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})=>$("span",{children:e}),S=({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=kt(),m=u===!0||r!==void 0,g=It[e],C=w=>{if(m){w.preventDefault();return}n?.(w)};return Dt("span",{className:"cui-button-group",children:[$("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:$(Ge,{children:u===!0?l:t})}),r===void 0?null:$(x,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:r.reason})]})},At=({onNavigate:e,children:t,testId:o,ref:a})=>(p(),$("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:a,children:$(Ge,{children:t})}));import{useId as Ve}from"react";import{Fragment as Ht,jsx as k,jsxs as B}from"react/jsx-runtime";var pe=({id:e,title:t,description:o,actions:a,testId:n,headingRef:r,ref:s,dataAttributes:d,children:i})=>{p();let c=Ve();return B("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:[B("div",{className:"cui-card-header",children:[B("div",{className:"cui-card-heading",children:[k("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:k("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),a===void 0?null:k("div",{className:"cui-card-actions",children:a})]}),i]})},$t=({id:e,title:t,subtitle:o,region:a=!1,testId:n,headingRef:r,ref:s,dataAttributes:d,children:i})=>{p();let c=Ve(),u=B(Ht,{children:[B("div",{className:"cui-card-section-heading",children:[k("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:k("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return a?k("section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:u}):k("div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:u})};import{useId as Ut}from"react";import{jsx as Ft}from"react/jsx-runtime";var H=({ruleKey:e,css:t})=>Ft("style",{href:e,precedence:"cui",children:t});import{jsx as E,jsxs as I}from"react/jsx-runtime";var Ot=({caption:e,attributes:t,columns:o,attributePx:a,columnMinPx:n,testId:r})=>{p();let s=Ut();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:${D(d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return I("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":r,children:[E(H,{ruleKey:i,css:u}),E("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:I("table",{className:"cui-comparison-table","data-cui-type":"body",children:[E("caption",{className:"cui-visually-hidden",children:e}),I("colgroup",{children:[E("col",{style:{width:D(a)}}),o.map(l=>E("col",{},l.key))]}),E("thead",{children:I("tr",{children:[E("td",{}),o.map(l=>E("th",{scope:"col",children:l.heading},l.key))]})}),E("tbody",{children:t.map(l=>I("tr",{children:[E("th",{scope:"row",children:l.label}),o.map(y=>E("td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),E("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 I("div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[E("p",{className:"cui-comparison-heading",id:m,children:l.heading}),E("dl",{className:"cui-comparison-list",children:t.map(g=>I("div",{children:[E("dt",{children:g.label}),E("dd",{children:l.cells[g.key]("stack")})]},g.key))})]},l.key)})})]})};import{useId as Kt}from"react";import{jsx as L,jsxs as qt}from"react/jsx-runtime";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=Kt(),y=ke(o);return L("div",{className:"cui-container","data-testid":c,ref:u,children:a.length===0?L(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):L("section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:qt("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":D(y)},children:[L("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),L("colgroup",{children:o.map(m=>L("col",{style:m.width.fixedPx===void 0?void 0:{width:D(m.width.fixedPx)}},m.key))}),L("thead",{children:L("tr",{children:o.map(m=>L("th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),L("tbody",{children:a.map(m=>L("tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":r,...P(s?.(m)),children:o.map(g=>L("td",{"data-cui-align":g.align,children:g.cell(m)},g.key))},n(m)))})]})})})};import{jsx as ye,jsxs as Gt}from"react/jsx-runtime";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 ye("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>Gt("div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[ye("dt",{"data-cui-fg":"fg-secondary",children:o.term}),ye("dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};import{useId as Zt,useLayoutEffect as We,useRef as ze}from"react";import{useCallback as Vt}from"react";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=e=>Vt(t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Wt||me(t.target)||(t.stopPropagation(),e())},[e]);import{jsx as Z,jsxs as Ze}from"react/jsx-runtime";var Je=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Yt=({title:e,open:t,onClose:o,testId:a,children:n})=>{let{labels:r}=N(),s=Zt(),d=ze(null),i=ze(null);return We(()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),We(()=>{let l=d.current;return()=>{l.open&&(l.close(),Je(i.current),i.current=null)}},[]),Ze("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:[Ze("div",{className:"cui-dialog-header",children:[Z("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),Z("div",{className:"cui-dialog-actions",children:Z(S,{variant:"secondary",testId:`${a}-close`,onClick:()=>d.current?.close(),children:r.close})})]}),n,Z("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[ue]:"","data-testid":`${a}-announcer`})]})};import{useId as Xt}from"react";import{jsx as fe,jsxs as Ye}from"react/jsx-runtime";var Qt=({summary:e,open:t,onOpenChange:o,testId:a,children:n})=>{p();let r=Xt();return Ye("div",{className:"cui-disclosure","data-testid":a,children:[Ye("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:[fe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),fe("span",{children:e})]}),fe("div",{className:"cui-disclosure-panel",id:r,hidden:!t,"data-testid":`${a}-panel`,children:n})]})};import{useId as Y}from"react";import{Fragment as ao,jsx as v,jsxs as A}from"react/jsx-runtime";var q=({description:e,error:t})=>{p();let o=Y(),a=Y(),n=Y(),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})=>A(ao,{children:[e===void 0?null:v(x,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:v(x,{as:"p",fg:"danger-fg",type:"body",id:a,testId:`${n}-error`,children:t})]}),jt=({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 A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":a,children:[v("label",{className:"cui-field-label",htmlFor:r.id,"data-cui-type":"body",children:e}),n(r),v(_,{description:t,error:o,descriptionId:s,errorId:d,testId:a})]})},eo=({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 A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${i}-field`,children:[v("label",{className:"cui-field-label",htmlFor:u.id,"data-cui-type":"body",children:e}),v("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}),v(_,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},to=({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 A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),v("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}),v(_,{description:t,error:o,descriptionId:c,errorId:u,testId:s})]})},oo=({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 A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),v("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=>v("option",{value:l.value,children:l.label},l.value))}),v(_,{description:t,error:o,descriptionId:c,errorId:u,testId:s})]})},ro=({legend:e,description:t,error:o,value:a,options:n,onValueChange:r,testId:s,ref:d})=>{let i=Y(),{control:c,descriptionId:u,errorId:l}=q({label:e,description:t,error:o});return A("fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[v("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}),v("span",{children:y.label})]},y.value)),v(_,{description:t,error:o,descriptionId:u,errorId:l,testId:s})]})};import{jsx as io}from"react/jsx-runtime";var no={1:"h1",2:"h2",3:"h3"},so=({level:e,type:t,testId:o,headingRef:a,children:n})=>{p();let r=no[e];return io(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})};import{jsx as uo}from"react/jsx-runtime";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=({tone:e,variant:t,testId:o,dataAttributes:a,children:n})=>{p();let r=t==="tint"?lo[e]:{fg:"on-solid",surface:co[e]};return uo("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})};import{useId as po}from"react";import{jsx as G,jsxs as yo}from"react/jsx-runtime";var be=({label:e,valueText:t,value:o,max:a,testId:n})=>{p();let r=po();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 yo("div",{className:"cui-progress","data-testid":n,children:[G(x,{as:"p",fg:"fg",type:"body",id:r,children:e}),G("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:G("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`})}),G("div",{"aria-hidden":"true",children:G(x,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};import{jsx as X,jsxs as Xe}from"react/jsx-runtime";var mo=({title:e,status:t,progress:o,cancel:a,testId:n,children:r})=>Xe(pe,{title:e,actions:a===void 0?void 0:X(S,{variant:"secondary",busy:a.busy,busyLabel:a.busyLabel,onClick:a.onCancel,testId:`${n}-cancel`,children:a.label}),testId:n,children:[Xe("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[X("span",{className:"cui-visually-hidden",children:`${e} `}),X(ge,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:X(be,{...o,testId:`${n}-progress`}),r]});import{useCallback as tt,useLayoutEffect as To,useRef as Q}from"react";import{jsx as Qe}from"react/jsx-runtime";var fo=({tone:e,testId:t,children:o})=>(p(),Qe("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=({occurrence:e,testId:t,children:o})=>(p(),Qe("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));import{useCallback as go,useLayoutEffect as je,useReducer as bo,useRef as et}from"react";var Ro=e=>e+1,Re=e=>{let t=et(e),o=et(null),[,a]=bo(Ro,0),n=go((r=>()=>{r.contains(document.activeElement)&&(o.current=r,a())}),[]);return je(()=>{t.current=e}),je(()=>{let r=o.current;if(r===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);r.isConnected||!s||t.current()?.focus()}),n};import{jsx as j,jsxs as xo}from"react/jsx-runtime";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=({onLoad:e,busy:t,done:o,failure:a,limit:n,rows:r,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=Q(null),u=Q(null),l=Q(null),y=Q(!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()};To(()=>{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=tt((b=>{l.current=b;let R=g(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[g]),w=tt((b=>{u.current=b;let R=g(b);return()=>{u.current=null,R()}}),[g]);return o?j("div",{className:"cui-load-more","data-testid":s,children:j(x,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,testId:`${s}-end`,children:i.endOfRecords})}):xo("div",{className:"cui-load-more","data-testid":s,children:[j(S,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:C,testId:`${s}-button`,children:i.loadMore(W(n,d))}),a===null?null:j(V,{occurrence:a.occurrence,testId:`${s}-failure`,children:i.loadFailed(a.reason)})]})};import{jsx as he,jsxs as ot}from"react/jsx-runtime";var Eo=({master:e,detail:t,masterMinPx:o,detailMinPx:a,testId:n})=>{p();let r=Me({masterMinPx:o,detailMinPx:a,gapPx:z.space["space-6"]});return ot("div",{className:"cui-container","data-testid":n,children:[he(H,{ruleKey:r.key,css:r.css}),ot("div",{className:"cui-master-detail","data-cui-master-detail":r.key,children:[he("div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),he("div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};import{jsx as rt}from"react/jsx-runtime";var ve=({value:e,unit:t,testId:o})=>{let{formatLocale:a,labels:n}=N();if(e===null)return rt("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let r=W(e,a);return rt("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?r:`${r} ${t}`})};import{jsx as at,jsxs as Po}from"react/jsx-runtime";var No=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:a,rescueRef:n,testId:r})=>{let{labels:s}=N();return Po("div",{className:"cui-resource-failed","data-testid":r,children:[at(V,{occurrence:e.occurrence,testId:`${r}-alert`,children:s.failureSentence(e,o,a===void 0?s.loadFailed:a)}),e.status===403?null:at(S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${r}-reload`,children:s.reload})]})};import{jsx as Ce,jsxs as Lo}from"react/jsx-runtime";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 Lo("fieldset",{className:"cui-segmented-group","data-testid":n,children:[Ce("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),Ce("div",{className:"cui-segmented",children:t.map(s=>{let d=s.value===o;return Ce("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)})})]})};import{jsx as F}from"react/jsx-runtime";var nt=({selected:e,controls:t,onSelect:o,testId:a,dataAttributes:n,ref:r,children:s})=>(p(),F("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=({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(),F("div",{className:"cui-selectable","data-testid":u,ref:l,children:t.length===0?F(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${u}-empty`,children:c}):F("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return F("li",{children:F(nt,{selected:m===a,controls:r,onSelect:()=>n(y),testId:d,dataAttributes:i?.(y),children:s(y)})},m)})})}));import{useId as Mo}from"react";import{jsx as ee,jsxs as st}from"react/jsx-runtime";var ko=({label:e,value:t,min:o,max:a,step:n,valueText:r,onValueChange:s,testId:d})=>{p();let i=Mo();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 st("div",{className:"cui-field","data-testid":`${d}-field`,children:[ee("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),st("div",{className:"cui-slider",children:[ee("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)}),ee("span",{className:"cui-slider-value","aria-hidden":"true",children:ee(x,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};import{jsx as it}from"react/jsx-runtime";var Io=({gap:e,testId:t,children:o})=>(p(),it("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Ao=({gap:e,testId:t,children:o})=>(p(),it("div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));import{jsx as xe,jsxs as dt}from"react/jsx-runtime";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=({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&&lt[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 xe("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 dt("li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${o}-${r.id}`,children:[xe("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}),dt("span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,i===null?null:xe("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},r.id)})})};import{jsx as Ee,jsxs as Fo}from"react/jsx-runtime";var Ho=({label:e,checked:t,onCheckedChange:o,testId:a})=>(p(),Fo("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:[Ee("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${a}-track`,children:Ee("span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${a}-thumb`})}),Ee("span",{children:e})]}));import{jsx as te}from"react/jsx-runtime";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 te("nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:te("ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return te("li",{className:"cui-tabs-item",children:te("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)})})})};import{Children as Oo,Fragment as Ko,isValidElement as Bo}from"react";import{jsx as U,jsxs as ut}from"react/jsx-runtime";var qo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},_o=({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 ut("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":a,"data-testid":n,...P(r),children:[U("p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),U("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),U("p",{className:"cui-tile-value","data-cui-fg":qo[a],"data-cui-type":"heading",children:U(ve,{value:o,testId:`${n}-value`})})]})},ct=e=>Oo.toArray(e).flatMap(t=>{if(!Bo(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===Ko?ct(t.props.children):[t]}),Go=({count:e,minInlinePx:t,testId:o,children:a})=>{p();let n=Ie(e,t,z.space["space-2"]),r=ct(a).length;if(r!==e)throw new RangeError(`TileGrid has ${r} tiles but count is ${e}`);return ut("div",{className:"cui-container","data-testid":o,children:[U(H,{ruleKey:n.key,css:n.css}),U("div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:a})]})};import{useLayoutEffect as Vo,useRef as pt}from"react";import{jsx as zo}from"react/jsx-runtime";var oe=e=>[...e.querySelectorAll("button")],Wo=({label:e,testId:t,children:o})=>{p();let a=pt(null),n=pt(null);Vo(()=>{let i=oe(a.current),c=n.current!==null&&i.includes(n.current)?n.current: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 zo("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})};import{useCallback as O,useEffect as Yo,useLayoutEffect as mt,useRef as we}from"react";import{useCallback as re,useEffect as Jo,useLayoutEffect as Zo,useRef as Ne,useState as Pe}from"react";var yt=e=>e===null?ne:se,ae=(e,t,o,a,n)=>{let[r,s]=Pe(()=>({key:e,state:yt(e)})),[d,i]=Pe(0),[c,u]=Pe(0),l=Ne(t),y=Ne(null),m=Ne(d);Zo(()=>{l.current=t}),Jo(()=>{if(e===null){s({key:null,state:ne});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:se}),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=re(()=>i(f=>f+1),[]),C=re(()=>u(f=>f+1),[]),w=re((f,h)=>{s(T=>Object.is(T.key,f)?{key:f,state:h(T.state)}:T)},[]),b=re((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=we(t);mt(()=>{a.current=t});let n=O(b=>a.current.first(b),[]),{state:r,reload:s,refresh:d,update:i,write:c}=ae(e,n,o,Ae,De),u=we({key:e,state:r});mt(()=>{u.current={key:e,state:r}});let l=we(null),y=O(()=>{l.current?.controller.abort(),l.current=null},[]);Yo(()=>y,[e,o,y]);let m=O(()=>{y(),s()},[y,s]),g=O(()=>{y(),d()},[y,d]),C=O(()=>{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,$e),a.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,M=>h.maps.reduce((ft,gt)=>le(ft,gt),He(M,f,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=O((b,R)=>{let f=l.current;f!==null&&Object.is(f.key,b)&&f.maps.push(R),c(b,h=>le(h,R))},[c]);return{state:r,reload:m,refresh:g,loadMore:C,updateList:w}};import{useCallback as Qo}from"react";var jo=(e,t,o)=>{let{state:a,reload:n,refresh:r,write:s}=ae(e,t,o,Le,ie),d=Qo((i,c)=>s(i,u=>ie(u,{ok:!0,value:c})),[s]);return{state:a,reload:n,refresh:r,put:d}};import{jsx as tr}from"react/jsx-runtime";var er=({testId:e,children:t})=>(p(),tr("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ce as ANNOUNCE_SETTLE_MS,V as AlertMessage,St as Breadcrumb,S as Button,dr as CONSOLE_UI_LABEL_CATALOGS,gr as CONTRAST_MINIMUM,br as CONTRAST_PAIRS,pe as Card,$t as CardSection,Ao as Cluster,Ot as ComparisonGrid,Pt as ConsoleUiRoot,Bt as DataTable,_t as DescriptionList,Yt as Dialog,Qt as Disclosure,jt as Field,bt as HTTP_FORBIDDEN,so as Heading,mo as JobCard,Rr as LATTICE_PX,At as Link,Co as LoadMore,Eo as MasterDetail,ve as Measured,_o as MetricTile,fo as Notice,ge as Pill,be as ProgressBar,vr as ROW_WITH_CONTROL_PX,ro as RadioGroup,No as ResourceFailed,nt as RowButton,wo as SegmentedControl,oo as Select,So as SelectableList,ko as Slider,Io as Stack,$o as Stepper,Ho as Switch,hr as TARGET_PX,z as TOKENS,Uo as Tabs,x as Text,to as TextArea,eo as TextInput,Go as TileGrid,Wo as Toolbar,er as VisuallyHidden,or as ZonedTimeError,$e as beginPage,Ae as beginPagedReload,Le as beginReload,yr as ceil8,Tr as ceilToLattice,fr as contrastRatio,Cr as cssVar,ir as flatMapOutcome,W as formatCount,nr as formatInstant,mr as hexToSrgb,ie as keepLastGood,sr as mapOutcome,le as mapPagedList,cr as masterDetailPlan,pr as monoTextWidthEm,lr as reasonAside,Se as resolveConsoleUiLabels,De as settleFirstPage,He as settlePage,ke as tableMinInlinePx,ur as textWidthEm,Ie as tileGridPlan,rr as toOffsetIso,ar as toWallTime,wt as useAnnounce,N as useConsoleUi,Jt as useEscapeToClose,Re as useFocusRescue,Xo as usePagedResource,jo as useResource};
1
+ import{A as Fe,B as de,C as xr,D as Er,E as Nr,F as Pr,G as W,H as wr,a as z,b as ir,c as lr,d as dr,e as cr,f as Tt,g as ur,h as pr,i as se,j as ie,k as Se,l as le,m as yr,n as mr,o as Le,p as D,q as fr,r as ke,s as Ie,t as gr,u as br,v as Rr,w as Ae,x as De,y as $e,z as He}from"./chunk-BUX2DNVR.js";import{a as Tr,b as hr,c as vr,d as Cr}from"./chunk-BMGBEN26.js";import{createContext as ht,useCallback as vt,useContext as qe,useLayoutEffect as Ct,useMemo as Ue,useRef as Oe}from"react";import{jsx as Ke,jsxs as Lt}from"react/jsx-runtime";var ce=ht(null),xt=" ",Be='[inert], [aria-hidden="true" i]',_e="dialog:modal",pe="data-cui-dialog-announcer",Et=`:scope > [${pe}]`,Nt=e=>{if(e.closest(Be)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(_e)],r=t.activeElement,n=o.filter(c=>c.contains(r)),a=n.length>0?n:o,s=a.filter(c=>c.contains(e)).length;if(s===a.length)return{region:e};let d=a.find(c=>a.every(p=>p.contains(c))),i=d?.querySelector(Et)??null;return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Be)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},Pt=e=>{try{e.querySelectorAll(_e)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ue=150,wt=1e3,Mt=({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(qe(ce)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=Le(e),[d]=Intl.getCanonicalLocales(t),i=Ue(()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=Oe(null),p=Oe(null);Ct(()=>{Pt(c.current.ownerDocument)},[]);let l=vt(m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let g=()=>{let{texts:w,settle:b,deadline:R}=p.current;p.current=null,clearTimeout(b),clearTimeout(R);let f=c.current;if(f===null)return;let h=w.join(xt),T=Nt(f);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let L=f.ownerDocument.createElement("span");L.textContent=h,T.region.replaceChildren(L)},x=p.current;if(x===null){p.current={texts:[m],settle:setTimeout(g,ue),deadline:setTimeout(g,wt)};return}x.texts.push(m),clearTimeout(x.settle),x.settle=setTimeout(g,ue)},[]),y=Ue(()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return Ke(ce.Provider,{value:y,children:Lt("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,Ke("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:c})]})})},N=()=>{let e=qe(ce);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},u=()=>{N()},St=()=>N().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};import{jsx as B,jsxs as Ge}from"react/jsx-runtime";var kt=({items:e,current:t,onNavigate:o,testId:r})=>{let{labels:n}=N();if(new Set(e.map(a=>a.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(a=>a.id).join(", ")}`);return B("nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":r,children:Ge("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(a=>Ge("li",{className:"cui-breadcrumb-item",children:[B("a",{className:"cui-link",href:a.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${a.id}`,onClick:s=>J(s,a.href,o),children:a.label}),B("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},a.id)),B("li",{className:"cui-breadcrumb-item",children:B("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as At}from"react";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};import{jsx as It}from"react/jsx-runtime";var v=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:d,children:i})=>(u(),It(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:d,children:i}));import{jsx as $,jsxs as Ht}from"react/jsx-runtime";var Dt={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ve=({children:e})=>$("span",{children:e}),S=({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:d,ref:i,dataAttributes:c,busy:p,busyLabel:l})=>{u();let y=At(),m=p===!0||a!==void 0,g=Dt[e],x=w=>{if(m){w.preventDefault();return}n?.(w)};return Ht("span",{className:"cui-button-group",children:[$("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":g.fg,"data-cui-surface":g.surface,"data-cui-type":g.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:x,ref:i,...P(c),children:$(Ve,{children:p===!0?l:t})}),a===void 0?null:$(v,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:a.reason})]})},$t=({onNavigate:e,children:t,testId:o,ref:r})=>(u(),$("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:r,children:$(Ve,{children:t})}));import{useId as ze}from"react";import{Fragment as Ut,jsx as k,jsxs as K}from"react/jsx-runtime";var ye=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=ze();return K("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:[K("div",{className:"cui-card-header",children:[K("div",{className:"cui-card-heading",children:[k("h2",{className:"cui-card-title",id:c,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:k("div",{className:"cui-card-actions",children:r})]}),i]})},Ft=({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:d,children:i})=>{u();let c=ze(),p=K(Ut,{children:[K("div",{className:"cui-card-section-heading",children:[k("h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return r?k("section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:p}):k("div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:p})};import{jsx as We}from"react/jsx-runtime";var Ot=({label:e,code:t,testId:o})=>(u(),We("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":o,children:We("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${o}-code`,children:t})}));import{useId as Kt}from"react";import{jsx as Bt}from"react/jsx-runtime";var H=({ruleKey:e,css:t})=>Bt("style",{href:e,precedence:"cui",children:t});import{jsx as E,jsxs as I}from"react/jsx-runtime";var qt=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{u();let s=Kt();for(let l of[r,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=r+o.length*n,i=`cui-comparison-a${r}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,p=`${c("table")}{display:none}@container (min-width:${D(d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return I("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":a,children:[E(H,{ruleKey:i,css:p}),E("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:I("table",{className:"cui-comparison-table","data-cui-type":"body",children:[E("caption",{className:"cui-visually-hidden",children:e}),I("colgroup",{children:[E("col",{style:{width:D(r)}}),o.map(l=>E("col",{},l.key))]}),E("thead",{children:I("tr",{children:[E("td",{}),o.map(l=>E("th",{scope:"col",children:l.heading},l.key))]})}),E("tbody",{children:t.map(l=>I("tr",{children:[E("th",{scope:"row",children:l.label}),o.map(y=>E("td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),E("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 I("div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[E("p",{className:"cui-comparison-heading",id:m,children:l.heading}),E("dl",{className:"cui-comparison-list",children:t.map(g=>I("div",{children:[E("dt",{children:g.label}),E("dd",{children:l.cells[g.key]("stack")})]},g.key))})]},l.key)})})]})};import{useId as _t}from"react";import{jsx as M,jsxs as Vt}from"react/jsx-runtime";var Gt=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:d,empty:i,testId:c,ref:p})=>{u();let l=_t(),y=Ie(o);return M("div",{className:"cui-container","data-testid":c,ref:p,children:r.length===0?M(v,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):M("section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:Vt("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":D(y)},children:[M("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),M("colgroup",{children:o.map(m=>M("col",{style:m.width.fixedPx===void 0?void 0:{width:D(m.width.fixedPx)}},m.key))}),M("thead",{children:M("tr",{children:o.map(m=>M("th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),M("tbody",{children:r.map(m=>M("tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...P(s?.(m)),children:o.map(g=>M("td",{"data-cui-align":g.align,children:g.cell(m)},g.key))},n(m)))})]})})})};import{jsx as me,jsxs as Wt}from"react/jsx-runtime";var zt=({items:e,testId:t})=>{if(u(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return me("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>Wt("div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[me("dt",{"data-cui-fg":"fg-secondary",children:o.term}),me("dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};import{useId as Qt,useLayoutEffect as Je,useRef as Ze}from"react";import{useCallback as Jt}from"react";var Zt=229,Yt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),fe=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Yt.has(e.type)&&(e.value!==""||e.validity.badInput),Xt=e=>Jt(t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Zt||fe(t.target)||(t.stopPropagation(),e())},[e]);import{jsx as Z,jsxs as Xe}from"react/jsx-runtime";var Ye=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},jt=({title:e,open:t,onClose:o,testId:r,children:n})=>{let{labels:a}=N(),s=Qt(),d=Ze(null),i=Ze(null);return Je(()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),Je(()=>{let l=d.current;return()=>{l.open&&(l.close(),Ye(i.current),i.current=null)}},[]),Xe("dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onClose:()=>{Ye(i.current),i.current=null,t&&o()},onCancel:l=>{fe(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[Xe("div",{className:"cui-dialog-header",children:[Z("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),Z("div",{className:"cui-dialog-actions",children:Z(S,{variant:"secondary",testId:`${r}-close`,onClick:()=>d.current?.close(),children:a.close})})]}),n,Z("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[pe]:"","data-testid":`${r}-announcer`})]})};import{useId as eo}from"react";import{jsx as ge,jsxs as Qe}from"react/jsx-runtime";var to=({summary:e,open:t,onOpenChange:o,testId:r,children:n})=>{u();let a=eo();return Qe("div",{className:"cui-disclosure","data-testid":r,children:[Qe("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":a,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>o(!t),children:[ge("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),ge("span",{children:e})]}),ge("div",{className:"cui-disclosure-panel",id:a,hidden:!t,"data-testid":`${r}-panel`,children:n})]})};import{useId as Y}from"react";import{Fragment as io,jsx as C,jsxs as A}from"react/jsx-runtime";var q=({description:e,error:t})=>{u();let o=Y(),r=Y(),n=Y(),a=[e===void 0?null:r,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>A(io,{children:[e===void 0?null:C(v,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:C(v,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),oo=({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[C("label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),C(_,{description:t,error:o,descriptionId:s,errorId:d,testId:r})]})},ro=({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:d,testId:i,ref:c})=>{let{control:p,descriptionId:l,errorId:y}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${i}-field`,children:[C("label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),C("input",{className:"cui-input",type:a,value:r,list:s,required:d,onChange:m=>n(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":i,ref:c,...p}),C(_,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},ao=({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[C("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),C("textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),C(_,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},no=({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:p}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[C("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),C("select",{className:"cui-input",value:r,onChange:l=>a(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>C("option",{value:l.value,children:l.label},l.value))}),C(_,{description:t,error:o,descriptionId:c,errorId:p,testId:s})]})},so=({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:d})=>{let i=Y(),{control:c,descriptionId:p,errorId:l}=q({label:e,description:t,error:o});return A("fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[C("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[C("input",{type:"radio",name:i,value:y.value,checked:y.value===r,onChange:()=>a(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),C("span",{children:y.label})]},y.value)),C(_,{description:t,error:o,descriptionId:p,errorId:l,testId:s})]})};import{jsx as uo}from"react/jsx-runtime";var lo={1:"h1",2:"h2",3:"h3"},co=({level:e,type:t,testId:o,headingRef:r,children:n})=>{u();let a=lo[e];return uo(a,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:r,tabIndex:r===void 0?void 0:-1,children:n})};import{jsx as mo}from"react/jsx-runtime";var po={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},yo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},be=({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{u();let a=t==="tint"?po[e]:{fg:"on-solid",surface:yo[e]};return mo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...P(r),children:n})};import{useId as fo}from"react";import{jsx as G,jsxs as go}from"react/jsx-runtime";var Re=({label:e,valueText:t,value:o,max:r,testId:n})=>{u();let a=fo();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 go("div",{className:"cui-progress","data-testid":n,children:[G(v,{as:"p",fg:"fg",type:"body",id:a,children:e}),G("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${n}-bar`,children:G("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`})}),G("div",{"aria-hidden":"true",children:G(v,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};import{jsx as X,jsxs as je}from"react/jsx-runtime";var bo=({title:e,status:t,progress:o,cancel:r,testId:n,children:a})=>je(ye,{title:e,actions:r===void 0?void 0:X(S,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${n}-cancel`,children:r.label}),testId:n,children:[je("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[X("span",{className:"cui-visually-hidden",children:`${e} `}),X(be,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:X(Re,{...o,testId:`${n}-progress`}),a]});import{useCallback as rt,useLayoutEffect as Co,useRef as Q}from"react";import{jsx as et}from"react/jsx-runtime";var Ro=({tone:e,testId:t,children:o})=>(u(),et("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=({occurrence:e,testId:t,children:o})=>(u(),et("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));import{useCallback as To,useLayoutEffect as tt,useReducer as ho,useRef as ot}from"react";var vo=e=>e+1,Te=e=>{let t=ot(e),o=ot(null),[,r]=ho(vo,0),n=To((a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return tt(()=>{t.current=e}),tt(()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||t.current()?.focus()}),n};import{jsx as j,jsxs as Po}from"react/jsx-runtime";var he="[data-cui-row-focus]",xo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let o=[...t.querySelectorAll(he)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${he} elements for ${e.count} rows`);return o},Eo=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},No=({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=Q(null),p=Q(null),l=Q(null),y=Q(!1),m=()=>{let b=a.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(he)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};Co(()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let f=xo(a);if(t){R.busySeen=!0,R.shown=new Set(f);return}let h=Eo(f,R.shown),T=r!==null&&r.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let L=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&L)&&h.focus()});let g=Te(()=>o?p.current:l.current),x=rt((b=>{l.current=b;let R=g(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[g]),w=rt((b=>{p.current=b;let R=g(b);return()=>{p.current=null,R()}}),[g]);return o?j("div",{className:"cui-load-more","data-testid":s,children:j(v,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,testId:`${s}-end`,children:i.endOfRecords})}):Po("div",{className:"cui-load-more","data-testid":s,children:[j(S,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:x,testId:`${s}-button`,children:i.loadMore(z(n,d))}),r===null?null:j(V,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as ve,jsxs as at}from"react/jsx-runtime";var wo=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{u();let a=ke({masterMinPx:o,detailMinPx:r,gapPx:W.space["space-6"]});return at("div",{className:"cui-container","data-testid":n,children:[ve(H,{ruleKey:a.key,css:a.css}),at("div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[ve("div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),ve("div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};import{jsx as nt}from"react/jsx-runtime";var Ce=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=N();if(e===null)return nt("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=z(e,r);return nt("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};import{jsx as ee,jsxs as So}from"react/jsx-runtime";var Mo=({label:e,value:t,min:o,max:r,valueText:n,testId:a})=>{if(u(),!(Number.isFinite(o)&&Number.isFinite(r)&&o<r))throw new RangeError(`Meter needs a finite range with min below max: min ${o}, max ${r}`);if(!(Number.isFinite(t)&&t>=o&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${o}, max ${r}`);return So("span",{className:"cui-meter","data-testid":a,children:[ee("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":n,"data-cui-surface":"sunken","data-testid":`${a}-bar`,children:ee("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-o)/(r-o)*100}%`},"data-testid":`${a}-fill`})}),ee("span",{"aria-hidden":"true",children:ee(v,{fg:"fg",type:"body",testId:`${a}-value`,children:n})})]})};import{jsx as st,jsxs as ko}from"react/jsx-runtime";var Lo=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=N();return ko("div",{className:"cui-resource-failed","data-testid":a,children:[st(V,{occurrence:e.occurrence,testId:`${a}-alert`,children:s.failureSentence(e,o,r===void 0?s.loadFailed:r)}),e.status===403?null:st(S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};import{jsx as xe,jsxs as Ao}from"react/jsx-runtime";var Io=({label:e,options:t,value:o,onValueChange:r,testId:n})=>{u();let a=new Set(t.map(s=>s.value));if(t.length<2||a.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!a.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...a].join(", ")}`);return Ao("fieldset",{className:"cui-segmented-group","data-testid":n,children:[xe("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),xe("div",{className:"cui-segmented",children:t.map(s=>{let d=s.value===o;return xe("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${n}-${s.value}`,onClick:()=>{d||r(s.value)},children:s.label},s.value)})})]})};import{jsx as F}from"react/jsx-runtime";var it=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(u(),F("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:o,ref:a,...P(n),children:s})),Do=({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:p,ref:l})=>(u(),F("div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?F(v,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):F("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return F("li",{children:F(it,{selected:m===r,controls:a,onSelect:()=>n(y),testId:d,dataAttributes:i?.(y),children:s(y)})},m)})})}));import{useId as $o}from"react";import{jsx as te,jsxs as lt}from"react/jsx-runtime";var Ho=({label:e,value:t,min:o,max:r,step:n,valueText:a,onValueChange:s,testId:d})=>{u();let i=$o();if(!([t,o,r,n].every(Number.isFinite)&&o<r&&n>0&&o<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${r}, step ${n}`);let c=a(t);return lt("div",{className:"cui-field","data-testid":`${d}-field`,children:[te("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),lt("div",{className:"cui-slider",children:[te("input",{className:"cui-slider-input",id:i,type:"range",min:o,max:r,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),te("span",{className:"cui-slider-value","aria-hidden":"true",children:te(v,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};import{jsx as dt}from"react/jsx-runtime";var Fo=({gap:e,testId:t,children:o})=>(u(),dt("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Uo=({gap:e,testId:t,children:o})=>(u(),dt("div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));import{jsx as Ee,jsxs as ut}from"react/jsx-runtime";var ct={done:0,current:1,pending:2},Oo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Bo=({label:e,steps:t,testId:o})=>{let{labels:r}=N();if(t.length===0||new Set(t.map(a=>a.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(a=>a.id).join(", ")}`);if(t.filter(a=>a.state==="current").length>1||t.some((a,s)=>s>0&&ct[a.state]<ct[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(a=>a.state).join(", ")}`);let n={done:r.stepDone,current:null,pending:r.stepPending};return Ee("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((a,s)=>{let d=Oo[a.state],i=n[a.state];return ut("li",{className:"cui-step","aria-current":a.state==="current"?"step":void 0,"data-cui-step":a.state,"data-testid":`${o}-${a.id}`,children:[Ee("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:a.state==="done"?"\u2713":s+1}),ut("span",{className:"cui-step-label","data-cui-fg":"fg",children:[a.label,i===null?null:Ee("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},a.id)})})};import{jsx as Ne,jsxs as qo}from"react/jsx-runtime";var Ko=({label:e,checked:t,onCheckedChange:o,testId:r})=>(u(),qo("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:()=>o(!t),children:[Ne("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${r}-track`,children:Ne("span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),Ne("span",{children:e})]}));import{jsx as oe}from"react/jsx-runtime";var _o=({label:e,items:t,currentId:o,onNavigate:r,testId:n})=>{if(u(),t.length===0)throw new RangeError("Tabs needs at least one tab");let a=new Set(t.map(s=>s.id));if(a.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!a.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...a].join(", ")}`);return oe("nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:oe("ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return oe("li",{className:"cui-tabs-item",children:oe("a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,r),children:s.label})},s.id)})})})};import{Children as Go,Fragment as Vo,isValidElement as zo}from"react";import{jsx as U,jsxs as yt}from"react/jsx-runtime";var Wo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Jo=({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(u(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return yt("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...P(a),children:[U("p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),U("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),U("p",{className:"cui-tile-value","data-cui-fg":Wo[r],"data-cui-type":"heading",children:U(Ce,{value:o,testId:`${n}-value`})})]})},pt=e=>Go.toArray(e).flatMap(t=>{if(!zo(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===Vo?pt(t.props.children):[t]}),Zo=({count:e,minInlinePx:t,testId:o,children:r})=>{u();let n=Ae(e,t,W.space["space-2"]),a=pt(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return yt("div",{className:"cui-container","data-testid":o,children:[U(H,{ruleKey:n.key,css:n.css}),U("div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as Yo,useRef as mt}from"react";import{jsx as Qo}from"react/jsx-runtime";var re=e=>[...e.querySelectorAll("button")],Xo=({label:e,testId:t,children:o})=>{u();let r=mt(null),n=mt(null);Yo(()=>{let i=re(r.current),c=n.current!==null&&i.includes(n.current)?n.current:i[0]??null;n.current=c;for(let p of i)p.tabIndex=p===c?0:-1});let a=i=>{for(let c of re(r.current))c.tabIndex=c===i?0:-1;n.current=i};return Qo("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let c=re(i.currentTarget).find(p=>p.contains(i.target));c!==void 0&&a(c)},onKeyDown:i=>{let c=re(i.currentTarget),p=c.indexOf(i.target);if(p===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",g={[l]:(p+1)%c.length,[y]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(g===void 0)return;i.preventDefault();let x=c[g];a(x),x.focus()},children:o})};import{useCallback as O,useEffect as tr,useLayoutEffect as gt,useRef as Me}from"react";import{useCallback as ae,useEffect as jo,useLayoutEffect as er,useRef as Pe,useState as we}from"react";var ft=e=>e===null?se:ie,ne=(e,t,o,r,n)=>{let[a,s]=we(()=>({key:e,state:ft(e)})),[d,i]=we(0),[c,p]=we(0),l=Pe(t),y=Pe(null),m=Pe(d);er(()=>{l.current=t}),jo(()=>{if(e===null){s({key:null,state:se});return}let f=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:r(T.state,h)}:{key:e,state:ie}),l.current(f.signal).then(T=>{f.signal.aborted||(y.current=null,s(L=>({key:e,state:n(L.state,T)})))},T=>{f.signal.aborted||s(()=>{throw T})}),()=>{f.abort(),y.current=null}},[e,o,d,c]);let g=ae(()=>i(f=>f+1),[]),x=ae(()=>p(f=>f+1),[]),w=ae((f,h)=>{s(T=>Object.is(T.key,f)?{key:f,state:h(T.state)}:T)},[]),b=ae((f,h)=>{w(f,h),Object.is(y.current,f)&&x()},[w,x]);return{state:Object.is(a.key,e)?a.state:ft(e),reload:g,refresh:x,update:w,write:b}};var or=(e,t,o)=>{let r=Me(t);gt(()=>{r.current=t});let n=O(b=>r.current.first(b),[]),{state:a,reload:s,refresh:d,update:i,write:c}=ne(e,n,o,De,$e),p=Me({key:e,state:a});gt(()=>{p.current={key:e,state:a}});let l=Me(null),y=O(()=>{l.current?.controller.abort(),l.current=null},[]);tr(()=>y,[e,o,y]);let m=O(()=>{y(),s()},[y,s]),g=O(()=>{y(),d()},[y,d]),x=O(()=>{let{key:b,state:R}=p.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let f=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,He),r.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,L=>h.maps.reduce((bt,Rt)=>de(bt,Rt),Fe(L,f,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=O((b,R)=>{let f=l.current;f!==null&&Object.is(f.key,b)&&f.maps.push(R),c(b,h=>de(h,R))},[c]);return{state:a,reload:m,refresh:g,loadMore:x,updateList:w}};import{useCallback as rr}from"react";var ar=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=ne(e,t,o,Se,le),d=rr((i,c)=>s(i,p=>le(p,{ok:!0,value:c})),[s]);return{state:r,reload:n,refresh:a,put:d}};import{jsx as sr}from"react/jsx-runtime";var nr=({testId:e,children:t})=>(u(),sr("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ue as ANNOUNCE_SETTLE_MS,V as AlertMessage,kt as Breadcrumb,S as Button,mr as CONSOLE_UI_LABEL_CATALOGS,vr as CONTRAST_MINIMUM,Cr as CONTRAST_PAIRS,ye as Card,Ft as CardSection,Uo as Cluster,Ot as CodeBlock,qt as ComparisonGrid,Mt as ConsoleUiRoot,Gt as DataTable,zt as DescriptionList,jt as Dialog,to as Disclosure,oo as Field,Tt as HTTP_FORBIDDEN,co as Heading,bo as JobCard,xr as LATTICE_PX,$t as Link,No as LoadMore,wo as MasterDetail,Ce as Measured,Mo as Meter,Jo as MetricTile,Ro as Notice,be as Pill,Re as ProgressBar,Pr as ROW_WITH_CONTROL_PX,so as RadioGroup,Lo as ResourceFailed,it as RowButton,Io as SegmentedControl,no as Select,Do as SelectableList,Ho as Slider,Fo as Stack,Bo as Stepper,Ko as Switch,Nr as TARGET_PX,W as TOKENS,_o as Tabs,v as Text,ao as TextArea,ro as TextInput,Zo as TileGrid,Xo as Toolbar,nr as VisuallyHidden,ir as ZonedTimeError,He as beginPage,De as beginPagedReload,Se as beginReload,Rr as ceil8,Er as ceilToLattice,hr as contrastRatio,wr as cssVar,pr as flatMapOutcome,z as formatCount,cr as formatInstant,Tr as hexToSrgb,le as keepLastGood,ur as mapOutcome,de as mapPagedList,fr as masterDetailPlan,br as monoTextWidthEm,yr as reasonAside,Le as resolveConsoleUiLabels,$e as settleFirstPage,Fe as settlePage,Ie as tableMinInlinePx,gr as textWidthEm,Ae as tileGridPlan,lr as toOffsetIso,dr as toWallTime,St as useAnnounce,N as useConsoleUi,Xt as useEscapeToClose,Te as useFocusRescue,or as usePagedResource,ar as useResource};
@@ -131,6 +131,7 @@
131
131
  .cui-input,
132
132
  .cui-radio input,
133
133
  .cui-table-frame,
134
+ .cui-code-frame,
134
135
  [data-cui-row-focus],
135
136
  .cui-card-title,
136
137
  .cui-card-section-title,
@@ -813,6 +814,43 @@
813
814
  }
814
815
  }
815
816
 
817
+ /* 計器は記述の内容で、本文の 1 行に収まる: space-2 の溝を値の文の 20 px の行の中央に置き、溝は値の文の残りの幅を取る
818
+ (狭い行でも塗りの比が読めるよう space-12 より縮めない)。縦に積んで始端に揃える親 (RowButton) の中でも親の幅いっぱいに伸びる
819
+ (始端揃えのままでは中身の幅、つまり溝の最小の space-12 に縮み、残りの幅を取らない) */
820
+ .cui-meter {
821
+ display: flex;
822
+ align-self: stretch;
823
+ align-items: center;
824
+ gap: var(--cui-space-2);
825
+ min-inline-size: 0;
826
+ }
827
+
828
+ .cui-meter-track {
829
+ display: block;
830
+ flex-grow: 1;
831
+ min-inline-size: var(--cui-space-12);
832
+ overflow: hidden;
833
+ block-size: var(--cui-space-2);
834
+ border-radius: var(--cui-radius-pill);
835
+ }
836
+
837
+ .cui-meter-fill {
838
+ display: block;
839
+ block-size: 100%;
840
+ border-radius: var(--cui-radius-pill);
841
+ }
842
+
843
+ /* 整形済みの文は pre のまま折り返さず、枠が横に送る (高さは上下の space-2 と本文の行の倍数なので格子に乗る) */
844
+ .cui-code-frame {
845
+ overflow-x: auto;
846
+ padding: var(--cui-space-2);
847
+ border-radius: var(--cui-radius-item);
848
+ }
849
+
850
+ .cui-code {
851
+ margin: 0;
852
+ }
853
+
816
854
  .cui-master-detail {
817
855
  display: grid;
818
856
  }
@@ -1227,11 +1265,13 @@
1227
1265
  border-inline-start-color: Highlight;
1228
1266
  }
1229
1267
 
1230
- .cui-progress-track {
1268
+ .cui-progress-track,
1269
+ .cui-meter-track {
1231
1270
  outline: var(--cui-border-width) solid CanvasText;
1232
1271
  }
1233
1272
 
1234
- .cui-progress-fill {
1273
+ .cui-progress-fill,
1274
+ .cui-meter-fill {
1235
1275
  background-color: Highlight;
1236
1276
  forced-color-adjust: none;
1237
1277
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/console-ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
5
5
  "sideEffects": [
6
6
  "**/*.css"