@aiquants/console-ui 0.6.1 → 0.6.3

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
@@ -28,20 +28,28 @@ The `/core` exports:
28
28
  - Tones and the CSS text of a colour (see Tokens and colours): `TONES`, `TONE_HUES`, `TONE_ROLES` and the types `Tone`, `ToneHue` and `ToneRole`; `lightDark(color)` and `placeholderRule(rootAttribute)`.
29
29
  - The geometry the tokens are computed on: `LATTICE_PX` (4), `TARGET_PX` (44), `ROW_WITH_CONTROL_PX` (52), `COMPACT_ROW_PX` (28) and `ceilToLattice(px)` (the smallest lattice multiple at or above a length).
30
30
  - Layout arithmetic: `textWidthEm`, `monoTextWidthEm` (the type `TextFace` names the face each model sizes), `ceil8`, `tileGridPlan`, `tableMinInlinePx`, `tableFrameMinInlinePx` (the narrowest a `DataTable` is while its table shows without scrolling: the table's minimum and the scroll frame's 4 px inline padding on both sides), `masterDetailPlan`.
31
+ - The golden section and rem: `goldenSectionPx(lengthPx, step)` (the length / φ^step for a step at or above 0: step 1 is the larger part of one golden cut and step 2 its smaller part, which add back up to the length; φ itself is not exported) and `pxToRem(px)` (a px length written as the rem length the stylesheet uses, at the 16 px root the formulas assume).
31
32
  - Widths sized from what a box holds (see Layout): `fixedColumnPx({ header, note }, contents)` (a `DataTable` fixed column; the first argument, type `ColumnHeaderText`, mirrors `ColumnDef`'s `header` and, for a column with a note, lists every line its `note` may show; `contents` are `CellContent` values, measured one by one with `cellContentInlinePx(content)`), `FLEXIBLE_COLUMN_MIN_PX` (160: the one minimum every flexible column shares), `comparisonAttributePx(labels)` (a `ComparisonGrid`'s `attributePx`), `tileMinInlinePx(captions, values)` (a `TileGrid`'s `minInlinePx`),
32
33
  `instantSampleText(formatLocale, timeZone)` (the text an instant column is measured with) and `countSampleText(formatLocale, unit?)` (the text a count column or a tile's count is measured with).
33
34
  - Figure formulas (see Figures): `spacedTextWidthEm(text, face)` (a line's width under the widest letter and word spacing WCAG 1.4.12 allows), `figureBoxPlan({ name, notes })` (the narrowest width and the height of a figure node's box, types `FigureBoxLines` and `FigureBoxPlan`), `figureDiscLabelPlan(label, radiusPx)` (the width of the name under a disc and its reach below the centre; for `null`, a disc drawn without a name, width 0 and the reach of its focus ring; type `FigureDiscLabelPlan`) and `FIGURE_RING_REACH_PX` (4: how far a node's focus ring reaches beyond the node).
34
- - Formatting: `formatCount`, `toOffsetIso`, `toWallTime`, `formatInstant`, `ZonedTimeError`.
35
+ - Formatting: `formatCount`, `formatByteSize`, `toOffsetIso`, `toWallTime`, `formatInstant`, `ZonedTimeError`.
36
+ `formatCount(value, formatLocale)` writes a count with the grouping of the format locale (`9,999,999`).
37
+ `formatByteSize(size, formatLocale)` writes a byte size in a binary unit (B, KiB, MiB, GiB or TiB: powers of 1024 under their IEC names) chosen after rounding: the smallest unit whose rounded mantissa stays below 1024, or TiB, which has no upper bound.
38
+ B has no digits after the point, KiB and MiB one, GiB and TiB two, and the mantissa is grouped in the format locale (`1,023 B`, `1.0 MiB` for 1,048,575 bytes, `8,192.00 TiB` for the largest safe integer).
39
+ Both refuse a value that is not a non-negative safe integer and an invalid locale with a `RangeError`, and write `-0` as `0`.
35
40
  - The text of a number field: `readDecimalText(text)` reads a decimal text (an optional sign, digits with an optional fraction or a fraction alone, an optional exponent, blanks around it; the full-width forms of ASCII read as half-width, as typed with a Japanese input method on) and returns `null` for anything else, an infinity or a value that underflows to zero, so an unreadable entry is reported instead of saved as another number; `-0` reads as `0`. `readIntegerText(text)` also returns `null` unless the value is a safe integer.
36
41
  - Text with nothing to read: `isReadableText(text)` is `true` when the text holds at least one character outside Unicode's white space (`White_Space`), control (`Cc`) and format (`Cf`) characters and default-ignorable code points (`Default_Ignorable_Code_Point`): the empty string, and a text of only spaces, line breaks, U+3000, U+FEFF, U+200B, the separators U+001C–U+001F, U+0085, U+00AD, the Hangul fillers or variation selectors, is not readable.
37
42
  It covers the white space of both JavaScript (`\s`) and Python (`\s`), so a record written in either language that reads as blank in it is not readable here either.
38
43
  It is the one rule of a blank text: `Measured` refuses a `text` or `unit` it rejects, and a host decides with it whether a text is worth drawing at all.
39
44
  - Labels: `CONSOLE_UI_LABEL_CATALOGS`, `resolveConsoleUiLabels` (a UI language's catalog, whose `loadFailed`, `refreshFailed` and `forbiddenBecause` build the failure sentences and whose `failureSentence` is the one rule that chooses between them), `reasonAside` (a failure's reason as a parenthetical).
45
+ - Label templates: `fillLabel(template, values)` is the one filler of a label that carries a value (a count, a name) as a `{key}` placeholder (a key is ASCII letters, digits and `_`), so the label's language, not the code that draws it, decides where the value stands; a label that crosses a loader as a plain string carries its values this way.
46
+ It scans the template once and writes every value as plain text: a `{key}` inside a value is not filled again, and `$&`, `$1` or `` $` `` in a value are not replacement patterns, so a name a user controls cannot pull another value in or forge another sentence.
47
+ A placeholder whose key `values` does not own (an inherited key such as `{constructor}` included) stays as written, so a forgotten value shows instead of leaving a sentence with a word missing. A number is written with `String`: format a count with `formatCount` first when it should follow a locale.
40
48
  - The read contract: the types `ResourceOutcome<T>` / `ResourceState<T>` / `ReloadCause`, `HTTP_FORBIDDEN` (the status of a refusal), `keepLastGood`, `beginReload`, `mapOutcome` and `flatMapOutcome`.
41
49
  - The command contract: the type `CommandOutcome<T, R>` (a command the host can refuse with a structured body, which the failure carries as `rejection`).
42
50
  - The keyset paging machine: the types `KeysetPage<T, C, M>` / `NextPage<T, C>` / `PagedValue<T, C, M>` / `PagedState<T, C, M>` / `PageFailure` / `PagedContent<T, M>`, `beginPagedReload`, `settleFirstPage`, `beginPage`, `settlePage` and `mapPagedList`.
43
51
 
44
- `@aiquants/console-ui` and `@aiquants/console-ui/core` share one module instance of the core code: the build emits the code several entries reach as a shared chunk per format (ESM / CommonJS), so a host that imports both paths in the same module format gets one copy of every core export and of any module state behind it (for example the `Intl.NumberFormat` cache of `formatCount`).
52
+ `@aiquants/console-ui` and `@aiquants/console-ui/core` share one module instance of the core code: the build emits the code several entries reach as a shared chunk per format (ESM / CommonJS), so a host that imports both paths in the same module format gets one copy of every core export and of any module state behind it (for example the `Intl.NumberFormat` cache `formatCount` and `formatByteSize` share).
45
53
 
46
54
  ## Usage
47
55
 
@@ -116,7 +124,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
116
124
 
117
125
  - Every length, type step and duration is computed from a few formulas (no value is written by hand):
118
126
  - a 4 px lattice (`LATTICE_PX`) and the spaces 4, 8, 12, 16, 24, 32, 48, 64 and 96 (`space-1` … `space-24`, multipliers whose prime factors are 2 and 3);
119
- - type steps of round(16 × 1.25^k) px, never below 11 px, each line the smallest lattice multiple at or above 1.5 times its size (WCAG 1.4.8; `title`, beside controls, and `prose`, the reading line, at 1.75): `caption` 11/20, `body` 13/20, `prose` 13/24, `title` 16/28, `heading` 20/32, `display` 25/40, `display-lg` 31/48;
127
+ - type steps of round(16 × 1.25^k) px, never below 11 px, each line the smallest lattice multiple at or above 1.5 times its size (WCAG 1.4.8; `title`, beside controls, and `prose`, the reading line, at 1.75): `caption` 11/20, `body` 13/20, `prose` 13/24, `body-lg` 16/24 (the body of a surface read at length, such as a conversation or an article: the 16 px base step with the 1.5 line), `title` 16/28, `heading` 20/32, `display` 25/40, `display-lg` 31/48;
120
128
  - the 44 px target (`TARGET_PX`: a `body` line with 12 px above and below), which is also the height of a control and of a table row (`size-target`, `size-control`, `size-row`), the 52 px row that holds a control (`ROW_WITH_CONTROL_PX`: the target with one lattice unit above and below, `size-row-control`) and the 28 px compact row of a read-only line table (`COMPACT_ROW_PX`: a `body` line with one lattice unit above and below, `size-row-compact`);
121
129
  - motion of 120, 180 and 270 ms (`motion-1` … `motion-3`, 120 × 1.5^(k − 1)).
122
130
  Only `body` (20) and `title` (28) lines, whose difference from 44 is a multiple of 8, can be centred in a 44 px box on the lattice, so every control draws its text in `body` or `title`.
@@ -0,0 +1 @@
1
+ var Pe=[{name:"B",power:0,fractionDigits:0},{name:"KiB",power:1,fractionDigits:1},{name:"MiB",power:2,fractionDigits:1},{name:"GiB",power:3,fractionDigits:2},{name:"TiB",power:4,fractionDigits:2}],j=new Map,K=e=>Number.isSafeInteger(e)&&e>=0,V=(e,n,t)=>{let r=`${t} ${n}`,o=j.get(r);return o===void 0&&(o=new Intl.NumberFormat(n,{minimumFractionDigits:t,maximumFractionDigits:t,useGrouping:!0}),j.set(r,o)),o.format(e===0?0:e)},w=(e,n)=>{if(!K(e))throw new RangeError(`A count must be a non-negative safe integer: ${e}`);return V(e,n,0)},Y=(e,n)=>Number((e/1024**n.power).toFixed(n.fractionDigits)),_e=(e,n)=>{if(!K(e))throw new RangeError(`A byte size must be a non-negative safe integer: ${e}`);let[t,...r]=Pe,o=t,i=Y(e,o);for(let d of r){if(i<1024)break;o=d,i=Y(e,o)}return`${V(i,n,o.fractionDigits)} ${o.name}`},J=(e,n)=>n===void 0?e:`${e} ${n}`;var we=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Oe=/[!-~]/g;var Ie=/^[^eE]*[1-9]/,q=e=>{let n=e.replace(Oe,r=>String.fromCharCode(r.charCodeAt(0)-65248)).trim();if(!we.test(n))return null;let t=Number(n);return Number.isFinite(t)?t===0?Ie.test(n)?null:0:t:null},Ne=e=>{let n=q(e);return n!==null&&Number.isSafeInteger(n)?n:null};var Me=/[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u,f=e=>Me.test(e);var l=class extends RangeError{reason;constructor(n,t){super(t),this.name="ZonedTimeError",this.reason=n}},Le=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/,Fe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/,$e=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/,Z=864e5,I=6e4,E={min:1,max:9999},Q=new Map,ee=new Map,Ae=e=>{let n=Q.get(e);return n===void 0&&(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Q.set(e,n)),n},ne=e=>{let n=new Date(0);return n.setUTCFullYear(e.year,e.month-1,e.day),n.setUTCHours(e.hour,e.minute,e.second,0),n.getUTCFullYear()===e.year&&n.getUTCMonth()===e.month-1&&n.getUTCDate()===e.day&&n.getUTCHours()===e.hour&&n.getUTCMinutes()===e.minute&&n.getUTCSeconds()===e.second?n.getTime():null},N=(e,n)=>{let[t,r,o,i,d,s,R]=n;if(R!==void 0&&/[1-9]/.test(R))throw new l("subsecond",`Fractions of a second cannot be kept: ${e}`);let p={year:Number(t),month:Number(r),day:Number(o),hour:Number(i),minute:Number(d),second:s===void 0?0:Number(s)},X=p.year>=E.min?ne(p):null;if(X===null)throw new l("malformed",`Not a calendar date and time: ${e}`);return{fields:p,millis:X}},M=(e,n)=>{let t=new Map(Ae(n).formatToParts(new Date(e)).map(o=>[o.type,o.value])),r={year:Number(t.get("year")),month:Number(t.get("month")),day:Number(t.get("day")),hour:Number(t.get("hour")),minute:Number(t.get("minute")),second:Number(t.get("second"))};if(t.get("era")!=="AD"||r.year>E.max)throw new l("malformed",`The wall clock falls outside years ${E.min}-${E.max}: ${new Date(e).toISOString()}`);return r},O=(e,n)=>ne(M(e,n))-e,g=e=>String(e).padStart(2,"0"),te=(e,n)=>{let t=`${String(e.year).padStart(4,"0")}-${g(e.month)}-${g(e.day)}T${g(e.hour)}:${g(e.minute)}`;return n||e.second!==0?`${t}:${g(e.second)}`:t},De=e=>{if(e%I!==0)throw new l("malformed",`The zone's offset is not a whole number of minutes: ${e} ms`);let n=Math.abs(e)/I;return`${e<0?"-":"+"}${g(Math.floor(n/60))}:${g(n%60)}`},Ue=(e,n)=>{let t=Le.exec(e);if(t===null)throw new l("malformed",`Not a wall time (YYYY-MM-DDTHH:mm[:ss]): ${e}`);let{fields:r,millis:o}=N(e,t.slice(1)),d=[...new Set([O(o-Z,n),O(o+Z,n)])].filter(s=>O(o-s,n)===s);if(d.length===0)throw new l("nonexistent",`${e} does not exist in ${n}`);if(d.length>1)throw new l("ambiguous",`${e} occurs twice in ${n}`);return`${te(r,!0)}${De(d[0])}`},re=(e,n)=>{let[t,r,o,i]=n;if(t!==void 0)return 0;if(Number(o)>23||Number(i)>59)throw new l("malformed",`Not a valid offset: ${e}`);return(r==="-"?-1:1)*(Number(o)*60+Number(i))*I},ve=(e,n)=>{let t=Fe.exec(e);if(t===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:r}=N(e,t.slice(1,8));return te(M(r-re(e,t.slice(8)),n),!1)},Be=(e,n)=>{let t=JSON.stringify([e,n]),r=ee.get(t);return r===void 0&&(r=new Intl.DateTimeFormat(e,{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),ee.set(t,r)),r},L=(e,n,t)=>{let r=$e.exec(e);if(r===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:o}=N(e,[...r.slice(1,7),void 0]),i=o-re(e,r.slice(7));return M(i,t),Be(n,t).format(i)};function He(e,n){return e.replace(/\{(\w+)\}/g,(t,r)=>Object.hasOwn(n,r)?String(n[r]):t)}var oe=403,We=(e,n)=>e.ok?{ok:!0,value:n(e.value)}:e,ze=(e,n)=>e.ok?n(e.value):e,Kn={kind:"idle"},Ge={kind:"loading"},F=(e,n)=>e.kind==="ready"?{...e,refreshing:!0}:e.kind==="failed"?n==="reload"?{...e,retrying:!0}:e:Ge,$=(e,n)=>n.ok?{kind:"ready",value:n.value,refreshing:!1,refreshFailure:null}:e.kind==="failed"&&e.status===403?e.retrying?{...e,retrying:!1}:e:e.kind==="ready"&&n.status!==403?{kind:"ready",value:e.value,refreshing:!1,refreshFailure:{status:n.status,reason:n.reason}}:{kind:"failed",status:n.status,reason:n.reason,occurrence:e.kind==="failed"?e.occurrence+1:1,retrying:!1};var T=e=>e===""?"":` (${e})`,ae=e=>(n,t,r)=>n.status===403?e(t,n.reason):r(n.reason),ie=(e,n)=>n===""?e:`${e} Reason: ${n}.`,se=(e,n)=>n===""?e:`${e}${n}\u3002`,C={en:{unmeasured:"Not measured",loading:"Loading",loadFailed:e=>`Could not load${T(e)}.`,refreshFailed:e=>`Could not refresh${T(e)}.`,forbiddenBecause:ie,failureSentence:ae(ie),loadMore:e=>`Show ${e} more`,endOfRecords:"No more records",close:"Close",cancel:"Cancel",reload:"Reload",breadcrumb:"Breadcrumb",stepDone:"Done",stepPending:"Not started"},ja:{unmeasured:"\u672A\u6E2C\u5B9A",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D",loadFailed:e=>`\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F${T(e)}\u3002`,refreshFailed:e=>`\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F${T(e)}\u3002`,forbiddenBecause:se,failureSentence:ae(se),loadMore:e=>`\u3055\u3089\u306B ${e} \u4EF6\u3092\u8868\u793A`,endOfRecords:"\u3053\u308C\u4EE5\u4E0A\u306E\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093",close:"\u9589\u3058\u308B",cancel:"\u3084\u3081\u308B",reload:"\u518D\u8AAD\u307F\u8FBC\u307F",breadcrumb:"\u30D1\u30F3\u304F\u305A",stepDone:"\u5B8C\u4E86",stepPending:"\u672A\u7740\u624B"}},Xe=e=>{if(!Object.hasOwn(C,e))throw new RangeError(`No console UI labels for locale "${e}"; supported: ${Object.keys(C).join(", ")}`);return C[e]};var je=4,Ye=[1,2,3,4,6,8,12,16,24],Ke=16,Ve=5/4,D={caption:-2,body:-1,"body-lg":0,title:0,heading:1,display:2,"display-lg":3},Je=11,le=3/2,qe=7/4,Ze=7/4,Qe=120,en=3/2,nn=[1,2,3],de=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);return Math.ceil(e/4)*4},U=e=>{if(!Number.isInteger(e))throw new RangeError(`A type step must be an integer: ${e}`);return Math.max(Je,Math.round(Ke*Ve**e))},v=(e,n)=>de(e*n),ce=v(U(D.body),le),b=ce+24,ue=b+8,me=ce+8,A={weight:{regular:400,medium:500,bold:700},radius:{"radius-control":4,"radius-item":8,"radius-container":12,"radius-pill":9999},stroke:{"border-width":1,"focus-width":2,"focus-offset":2,"marker-width":2}},tn=()=>Object.fromEntries(Ye.map(e=>[`space-${e}`,e*4])),rn=()=>{let e=Object.fromEntries(Object.entries(D).map(([t,r])=>{let o=U(r);return[t,{size:o,lineHeight:v(o,t==="title"?Ze:le)}]})),n=U(D.body);return{...e,prose:{size:n,lineHeight:v(n,qe)}}},on=()=>Object.fromEntries(nn.map(e=>[`motion-${e}`,Qe*en**(e-1)])),fe=e=>Object.freeze({space:Object.freeze(tn()),type:Object.freeze(rn()),weight:A.weight,radius:A.radius,size:Object.freeze({"size-target":b,"size-control":b,"size-row":b,"size-row-control":ue,"size-row-compact":me}),stroke:A.stroke,motion:Object.freeze(on()),color:Object.freeze({...e})});var an={fg:{light:"#0f172b",dark:"#f8fafc"},"fg-secondary":{light:"#314158",dark:"#e2e8f0"},"fg-muted":{light:"#44536a",dark:"#cad5e2"},"danger-fg":{light:"#9f0712",dark:"#ffc9c9"},"warning-fg":{light:"#7b3306",dark:"#fee685"},"success-fg":{light:"#006045",dark:"#a4f4cf"},"info-fg":{light:"#193cb8",dark:"#bedbff"},"on-solid":{light:"#ffffff",dark:"#0f172b"},surface:{light:"#ffffff",dark:"#0f172b"},subtle:{light:"#f8fafc",dark:"#1d293d"},sunken:{light:"#f1f5f9",dark:"#020618"},"danger-tint":{light:"#fef2f2",dark:"#460809"},"warning-tint":{light:"#fffbeb",dark:"#461901"},"success-tint":{light:"#ecfdf5",dark:"#002c22"},"info-tint":{light:"#eff6ff",dark:"#162456"},"neutral-solid":{light:"#314158",dark:"#cad5e2"},"danger-solid":{light:"#9f0712",dark:"#ffa2a2"},"success-solid":{light:"#006045",dark:"#5ee9b5"},"info-solid":{light:"#193cb8",dark:"#8ec5ff"},"warning-solid":{light:"#7b3306",dark:"#ffd230"},"danger-accent":{light:"#e7000b",dark:"#ff6467"},"warning-accent":{light:"#bb4d00",dark:"#fcbb00"},"success-accent":{light:"#009966",dark:"#00d492"},"info-accent":{light:"#155dfc",dark:"#51a2ff"},focus:{light:"#155dfc",dark:"#51a2ff"},"border-control":{light:"#62748e",dark:"#90a1b9"},"border-subtle":{light:"#e2e8f0",dark:"#314158"}},a=fe(an),sn="--cui-",ln=e=>`var(${sn}${e})`;var dn=e=>e>=32&&e<=126||e>=65377&&e<=65500||e>=65512&&e<=65518,ge=(e,n)=>{let t=0,r=0;for(let o of e)dn(o.codePointAt(0))?r+=1:t+=1;return t*1+r*n},h=e=>ge(e,.55),x=e=>ge(e,.6),u=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return Math.max(0,Math.ceil((e-1e-9)/8))*8};var pe="caption",W="body",z=2*a.space["space-3"],ye={type:"caption",paddingInlinePx:2*a.space["space-2"]},B={type:"body",paddingInlinePx:2*a.space["space-3"]+2*a.stroke["border-width"],minInlinePx:a.size["size-control"]},Te={type:"body",minInlinePx:a.size["size-target"]},S={trackInlinePx:2*a.type.body.lineHeight+3*a.space["space-1"],labelGapPx:a.space["space-2"],type:"body"},H={captionType:"caption",valueType:"heading",paddingInlinePx:2*a.space["space-3"]},cn=10,un="2000-01-01T00:00:00Z",mn=9999999,be=(e,n,t)=>(n==="mono"?x(e):h(e))*a.type[t].size,fn=(e,n)=>{if(e.length===0)throw new RangeError(`A ${n} needs at least one text to be measured with`);for(let t of e)if(!f(t))throw new RangeError(`A ${n} sample must hold a readable character: ${JSON.stringify(t)}`);return e},c=(e,n,t,r)=>Math.max(...fn(e,n).map(o=>be(o,t,r))),G=e=>{switch(e.kind){case"text":return c(e.texts,"text",e.face,e.type);case"measured":return c(e.texts,"measured value","sans",W);case"pill":return c(e.labels,"pill","sans",ye.type)+ye.paddingInlinePx;case"button":return Math.max(B.minInlinePx,c(e.labels,"button","sans",B.type)+B.paddingInlinePx);case"link":return Math.max(Te.minInlinePx,c(e.labels,"link","sans",Te.type));case"switch":return e.labelHidden?S.trackInlinePx:S.trackInlinePx+S.labelGapPx+c(e.labels,"switch","sans",S.type);case"cluster":{if(e.items.length===0)throw new RangeError("A cluster needs at least one item to be measured with");return e.items.reduce((n,t)=>n+G(t),0)+(e.items.length-1)*a.space[e.gap]}}},gn=(e,n)=>{let t=c([e.header],"column header","sans",pe),r=e.note===void 0?0:c(e.note,"column header note","sans",pe);return u(Math.max(t,r,...n.map(G))+z)},pn=u(be("\u3042".repeat(cn),"sans",W)+z),yn=e=>u(c(e,"comparison attribute","sans",W)+z),Tn=(e,n)=>L(un,e,n),bn=(e,n)=>{if(n!==void 0&&!f(n))throw new RangeError(`A count sample's unit must hold a readable character: ${JSON.stringify(n)}`);return J(w(mn,e),n)},hn=(e,n)=>u(Math.max(c(e,"tile caption","sans",H.captionType),c(n,"tile value","sans",H.valueType))+H.paddingInlinePx);var xn=.12,kn=.16,Rn=/[\u0020\u00a0\u1361\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,k=a.space["space-3"],P=(e,n)=>{let t=0,r=0;for(let i of e)t+=1,Rn.test(i)&&(r+=1);return(n==="mono"?x(e):h(e))+xn*t+kn*r},En=e=>{for(let t of[e.name,...e.notes])if(!f(t))throw new RangeError(`A figure node's name and notes must hold a readable character: ${JSON.stringify(t)}`);let n=Math.max(P(e.name,"sans")*a.type.body.size,...e.notes.map(t=>P(t,"sans")*a.type.caption.size));return{minWidthPx:u(n)+2*k,heightPx:2*k+a.type.body.lineHeight+e.notes.length*a.type.caption.lineHeight}},ct=e=>{let n=k+a.type.body.lineHeight;return{insetPx:k,namePx:k+a.type.body.lineHeight/2,notesPx:Array.from({length:e},(t,r)=>n+r*a.type.caption.lineHeight+a.type.caption.lineHeight/2)}},Cn=(e,n)=>{if(e!==null&&!f(e))throw new RangeError(`A disc's name must hold a readable character: ${JSON.stringify(e)}`);if(!(Number.isFinite(n)&&n>0))throw new RangeError(`A disc's radius must be a positive finite px value: ${n}`);return e===null?{widthPx:0,extentBelowPx:n+he}:{widthPx:u(P(e,"sans")*a.type.caption.size),extentBelowPx:n+a.space["space-1"]+a.type.caption.lineHeight}},he=a.stroke["focus-offset"]+a.stroke["focus-width"],ut=a.stroke["focus-offset"]+a.stroke["focus-width"]/2;var _=(1+Math.sqrt(5))/2,Sn=(e,n)=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);if(!(Number.isInteger(n)&&n>=0))throw new RangeError(`A golden section step must be an integer at or above 0: ${n}`);return e/_**n};var Pn=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return e},m=e=>`${Pn(e)/16}rem`;var xe=({masterMinPx:e,detailMinPx:n,gapPx:t})=>{for(let r of[e,n])if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Pane minimum must be a positive px value: ${r}`);if(!(Number.isFinite(t)&&t>=0))throw new RangeError(`Gap must be a px value >= 0: ${t}`);return e+t+n},_n=(e,n)=>{let t=xe(n);if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Container width must be a px value >= 0: ${e}`);if(e<t)return{sideBySide:!1,sideBySideFromPx:t,masterInlinePx:e,detailInlinePx:e};let r=(e-n.gapPx)/(1+_),o=Math.min(Math.max(n.masterMinPx,r),e-n.gapPx-n.detailMinPx);return{sideBySide:!0,sideBySideFromPx:t,masterInlinePx:o,detailInlinePx:e-n.gapPx-o}},Tt=e=>{let n=xe(e),t=`cui-master-detail-m${e.masterMinPx}-d${e.detailMinPx}-g${e.gapPx}`,r=`[data-cui-master-detail="${t}"]`,o=m(e.gapPx),i=`${r}{grid-template-columns:minmax(0,1fr);gap:${o}}`,d=`clamp(${m(e.masterMinPx)},calc((100% - ${o}) / ${1+_}),calc(100% - ${o} - ${m(e.detailMinPx)}))`,s=`@container (min-width:${m(n)}){${r}{grid-template-columns:${d} minmax(0,1fr)}}`;return{key:t,css:i+s}};var wn=2*a.space["space-1"],ke=e=>{if(!(Number.isFinite(e)&&e>0))throw new RangeError(`Column width must be a positive px value: ${e}`);return e},Re=e=>{if(e.length===0)throw new RangeError("A table needs at least one column");let n=0,t=null;for(let{width:r}of e){if(r.fixedPx!==void 0){n+=ke(r.fixedPx);continue}let o=ke(r.minPx);if(t!==null&&t!==o)throw new RangeError(`Flexible columns share the remaining width equally, so their minimums must be equal: ${t} and ${o}`);t=o,n+=o}return n},On=e=>Re(e)+wn;var In=(e,n,t)=>{if(!(Number.isSafeInteger(e)&&e>0))throw new RangeError(`Tile count must be a positive integer: ${e}`);if(!(Number.isFinite(n)&&n>0))throw new RangeError(`Tile minimum width must be a positive px value: ${n}`);if(!(Number.isFinite(t)&&t>=0))throw new RangeError(`Tile gap must be a px value >= 0: ${t}`);let r=[];for(let s=1;s<=e;s+=1)e%s===0&&r.push({columns:s,minContainerPx:s*n+(s-1)*t});let o=`cui-tiles-n${e}-m${n}-g${t}`,i=`[data-cui-tile-grid="${o}"]`,d=r.map(({columns:s,minContainerPx:R})=>{let p=`${i}{grid-template-columns:repeat(${s},minmax(0,1fr))}`;return s===1?p:`@container (min-width:${m(R)}){${p}}`});return{key:o,steps:r,css:d.join("")}};var Nn=(e,n)=>{let t=F(e,n);return t.kind==="ready"?{...t,value:{...t.value,loadingMore:!1}}:t},Mn=(e,n)=>$(e,n.ok?{ok:!0,value:{rows:n.value.rows,next:n.value.next,meta:n.value.meta,loadingMore:!1,moreFailure:null}}:n),Ln=e=>e.kind==="ready"&&!e.refreshing&&e.value.next!==null&&!e.value.loadingMore?{...e,value:{...e.value,loadingMore:!0}}:e,Fn=(e,n,t)=>{if(!(e.kind==="ready"&&e.value.loadingMore&&Object.is(e.value.next,n)))return e;if(t.ok)return{...e,value:{...e.value,rows:[...e.value.rows,...t.value.rows],next:t.value.next,loadingMore:!1,moreFailure:null}};let r=e.value.moreFailure===null?1:e.value.moreFailure.occurrence+1;return{...e,value:{...e.value,loadingMore:!1,moreFailure:{reason:t.reason,occurrence:r}}}},$n=(e,n)=>{if(e.kind!=="ready")return e;let{rows:t,meta:r}=n({rows:e.value.rows,meta:e.value.meta});return{...e,value:{...e.value,rows:t,meta:r}}};var An=/^#[0-9a-f]{6}$/i,Dn=/^[a-z][a-z0-9-]*$/,Ee=e=>{if(!An.test(e))throw new RangeError(`A palette colour must be #rrggbb: ${e}`);return e},Ce=({light:e,dark:n})=>`light-dark(${Ee(e)}, ${Ee(n)})`,Un=e=>{if(!Dn.test(e))throw new RangeError(`A root attribute must be lowercase letters, digits and hyphens, starting with a letter: ${e}`);return`[${e}] ::placeholder { color: ${Ce(a.color["fg-muted"])}; opacity: 1; }`};var Se=["indigo","violet","purple","fuchsia","pink","rose","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue"],vn=["fg","tint","accent","line","solid","solid-hover"],Bn={indigo:{fg:{light:"#372aac",dark:"#c6d2ff"},tint:{light:"#eff3ff",dark:"#1e1a4d"},accent:{light:"#4f39f6",dark:"#7c86ff"}},violet:{fg:{light:"#5d0ec0",dark:"#ddd6ff"},tint:{light:"#f5f3ff",dark:"#2f0d68"},accent:{light:"#7f22fe",dark:"#a684ff"}},purple:{fg:{light:"#6e11b0",dark:"#e9d4ff"},tint:{light:"#faf5ff",dark:"#3c0366"},accent:{light:"#9810fa",dark:"#c27aff"}},fuchsia:{fg:{light:"#8a0194",dark:"#f6cfff"},tint:{light:"#fdf4ff",dark:"#4b004f"},accent:{light:"#c800de",dark:"#ed6aff"}},pink:{fg:{light:"#a3004c",dark:"#fccee8"},tint:{light:"#fdf2f8",dark:"#510424"},accent:{light:"#e60076",dark:"#fb64b6"}},rose:{fg:{light:"#a50036",dark:"#ffccd3"},tint:{light:"#fff1f2",dark:"#4d0218"},accent:{light:"#ec003f",dark:"#ff637e"}},red:{fg:{light:"#9f0712",dark:"#ffc9c9"},tint:{light:"#fef2f2",dark:"#460809"},accent:{light:"#e7000b",dark:"#ff6467"}},orange:{fg:{light:"#7e2a0c",dark:"#ffd6a7"},tint:{light:"#fff7ed",dark:"#441306"},accent:{light:"#f54900",dark:"#ff8904"}},amber:{fg:{light:"#7b3306",dark:"#fee685"},tint:{light:"#fffbeb",dark:"#461901"},accent:{light:"#bb4d00",dark:"#fcbb00"}},yellow:{fg:{light:"#733e0a",dark:"#fff085"},tint:{light:"#fefce8",dark:"#432004"},accent:{light:"#a65f00",dark:"#fdc700"}},lime:{fg:{light:"#35530e",dark:"#d8f999"},tint:{light:"#f7fee7",dark:"#192e03"},accent:{light:"#497d00",dark:"#9ae600"}},green:{fg:{light:"#0d542b",dark:"#b9f8cf"},tint:{light:"#f0fdf4",dark:"#032e15"},accent:{light:"#008236",dark:"#05df72"}},emerald:{fg:{light:"#004f3b",dark:"#a4f4cf"},tint:{light:"#ecfdf5",dark:"#002c22"},accent:{light:"#009966",dark:"#00d492"}},teal:{fg:{light:"#0b4f4a",dark:"#96f7e4"},tint:{light:"#f0fdfa",dark:"#022f2e"},accent:{light:"#009689",dark:"#00d5be"}},cyan:{fg:{light:"#104e64",dark:"#a2f4fd"},tint:{light:"#ecfeff",dark:"#053345"},accent:{light:"#0092b8",dark:"#00d3f2"}},sky:{fg:{light:"#024a70",dark:"#b8e6fe"},tint:{light:"#f0f9ff",dark:"#052f4a"},accent:{light:"#0084d1",dark:"#00bcff"}},blue:{fg:{light:"#193cb8",dark:"#bedbff"},tint:{light:"#eff6ff",dark:"#162456"},accent:{light:"#155dfc",dark:"#51a2ff"}}},y=({light:e,dark:n})=>Object.freeze({light:e,dark:n}),Hn=({fg:e,tint:n,accent:t})=>Object.freeze({fg:y(e),tint:y(n),accent:y(t),line:y({light:e.dark,dark:e.light}),solid:y(e),"solid-hover":y({light:n.dark,dark:n.light})}),Wn=Object.freeze(Object.fromEntries(Se.map(e=>[e,Hn(Bn[e])])));export{w as a,_e as b,J as c,q as d,Ne as e,f,l as g,Ue as h,ve as i,L as j,He as k,oe as l,We as m,ze as n,Kn as o,Ge as p,F as q,$ as r,T as s,C as t,Xe as u,je as v,de as w,b as x,ue as y,me as z,a as A,ln as B,h as C,x as D,u as E,G as F,gn as G,pn as H,yn as I,Tn as J,bn as K,hn as L,P as M,En as N,ct as O,Cn as P,he as Q,ut as R,Sn as S,m as T,_n as U,Tt as V,Re as W,On as X,In as Y,Nn as Z,Mn as _,Ln as $,Fn as aa,$n as ba,Ce as ca,Un as da,Se as ea,vn as fa,Wn as ga};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var Pe=[{name:"B",power:0,fractionDigits:0},{name:"KiB",power:1,fractionDigits:1},{name:"MiB",power:2,fractionDigits:1},{name:"GiB",power:3,fractionDigits:2},{name:"TiB",power:4,fractionDigits:2}],j=new Map,K=e=>Number.isSafeInteger(e)&&e>=0,V=(e,n,t)=>{let r=`${t} ${n}`,o=j.get(r);return o===void 0&&(o=new Intl.NumberFormat(n,{minimumFractionDigits:t,maximumFractionDigits:t,useGrouping:!0}),j.set(r,o)),o.format(e===0?0:e)},w= exports.a =(e,n)=>{if(!K(e))throw new RangeError(`A count must be a non-negative safe integer: ${e}`);return V(e,n,0)},Y=(e,n)=>Number((e/1024**n.power).toFixed(n.fractionDigits)),_e= exports.b =(e,n)=>{if(!K(e))throw new RangeError(`A byte size must be a non-negative safe integer: ${e}`);let[t,...r]=Pe,o=t,i=Y(e,o);for(let d of r){if(i<1024)break;o=d,i=Y(e,o)}return`${V(i,n,o.fractionDigits)} ${o.name}`},J= exports.c =(e,n)=>n===void 0?e:`${e} ${n}`;var we=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Oe=/[!-~]/g;var Ie=/^[^eE]*[1-9]/,q= exports.d =e=>{let n=e.replace(Oe,r=>String.fromCharCode(r.charCodeAt(0)-65248)).trim();if(!we.test(n))return null;let t=Number(n);return Number.isFinite(t)?t===0?Ie.test(n)?null:0:t:null},Ne= exports.e =e=>{let n=q(e);return n!==null&&Number.isSafeInteger(n)?n:null};var Me=/[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u,f= exports.f =e=>Me.test(e);var l=class extends RangeError{constructor(n,t){super(t),this.name="ZonedTimeError",this.reason=n}},Le=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/,Fe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/,$e=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/,Z=864e5,I=6e4,E={min:1,max:9999},Q=new Map,ee=new Map,Ae=e=>{let n=Q.get(e);return n===void 0&&(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Q.set(e,n)),n},ne=e=>{let n=new Date(0);return n.setUTCFullYear(e.year,e.month-1,e.day),n.setUTCHours(e.hour,e.minute,e.second,0),n.getUTCFullYear()===e.year&&n.getUTCMonth()===e.month-1&&n.getUTCDate()===e.day&&n.getUTCHours()===e.hour&&n.getUTCMinutes()===e.minute&&n.getUTCSeconds()===e.second?n.getTime():null},N=(e,n)=>{let[t,r,o,i,d,s,R]=n;if(R!==void 0&&/[1-9]/.test(R))throw new l("subsecond",`Fractions of a second cannot be kept: ${e}`);let p={year:Number(t),month:Number(r),day:Number(o),hour:Number(i),minute:Number(d),second:s===void 0?0:Number(s)},X=p.year>=E.min?ne(p):null;if(X===null)throw new l("malformed",`Not a calendar date and time: ${e}`);return{fields:p,millis:X}},M=(e,n)=>{let t=new Map(Ae(n).formatToParts(new Date(e)).map(o=>[o.type,o.value])),r={year:Number(t.get("year")),month:Number(t.get("month")),day:Number(t.get("day")),hour:Number(t.get("hour")),minute:Number(t.get("minute")),second:Number(t.get("second"))};if(t.get("era")!=="AD"||r.year>E.max)throw new l("malformed",`The wall clock falls outside years ${E.min}-${E.max}: ${new Date(e).toISOString()}`);return r},O=(e,n)=>ne(M(e,n))-e,g=e=>String(e).padStart(2,"0"),te=(e,n)=>{let t=`${String(e.year).padStart(4,"0")}-${g(e.month)}-${g(e.day)}T${g(e.hour)}:${g(e.minute)}`;return n||e.second!==0?`${t}:${g(e.second)}`:t},De=e=>{if(e%I!==0)throw new l("malformed",`The zone's offset is not a whole number of minutes: ${e} ms`);let n=Math.abs(e)/I;return`${e<0?"-":"+"}${g(Math.floor(n/60))}:${g(n%60)}`},Ue= exports.h =(e,n)=>{let t=Le.exec(e);if(t===null)throw new l("malformed",`Not a wall time (YYYY-MM-DDTHH:mm[:ss]): ${e}`);let{fields:r,millis:o}=N(e,t.slice(1)),d=[...new Set([O(o-Z,n),O(o+Z,n)])].filter(s=>O(o-s,n)===s);if(d.length===0)throw new l("nonexistent",`${e} does not exist in ${n}`);if(d.length>1)throw new l("ambiguous",`${e} occurs twice in ${n}`);return`${te(r,!0)}${De(d[0])}`},re=(e,n)=>{let[t,r,o,i]=n;if(t!==void 0)return 0;if(Number(o)>23||Number(i)>59)throw new l("malformed",`Not a valid offset: ${e}`);return(r==="-"?-1:1)*(Number(o)*60+Number(i))*I},ve= exports.i =(e,n)=>{let t=Fe.exec(e);if(t===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:r}=N(e,t.slice(1,8));return te(M(r-re(e,t.slice(8)),n),!1)},Be=(e,n)=>{let t=JSON.stringify([e,n]),r=ee.get(t);return r===void 0&&(r=new Intl.DateTimeFormat(e,{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),ee.set(t,r)),r},L= exports.j =(e,n,t)=>{let r=$e.exec(e);if(r===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:o}=N(e,[...r.slice(1,7),void 0]),i=o-re(e,r.slice(7));return M(i,t),Be(n,t).format(i)};function He(e,n){return e.replace(/\{(\w+)\}/g,(t,r)=>Object.hasOwn(n,r)?String(n[r]):t)}var oe=403,We= exports.m =(e,n)=>e.ok?{ok:!0,value:n(e.value)}:e,ze= exports.n =(e,n)=>e.ok?n(e.value):e,Kn= exports.o ={kind:"idle"},Ge= exports.p ={kind:"loading"},F= exports.q =(e,n)=>e.kind==="ready"?{...e,refreshing:!0}:e.kind==="failed"?n==="reload"?{...e,retrying:!0}:e:Ge,$= exports.r =(e,n)=>n.ok?{kind:"ready",value:n.value,refreshing:!1,refreshFailure:null}:e.kind==="failed"&&e.status===403?e.retrying?{...e,retrying:!1}:e:e.kind==="ready"&&n.status!==403?{kind:"ready",value:e.value,refreshing:!1,refreshFailure:{status:n.status,reason:n.reason}}:{kind:"failed",status:n.status,reason:n.reason,occurrence:e.kind==="failed"?e.occurrence+1:1,retrying:!1};var T=e=>e===""?"":` (${e})`,ae=e=>(n,t,r)=>n.status===403?e(t,n.reason):r(n.reason),ie=(e,n)=>n===""?e:`${e} Reason: ${n}.`,se=(e,n)=>n===""?e:`${e}${n}\u3002`,C= exports.t ={en:{unmeasured:"Not measured",loading:"Loading",loadFailed:e=>`Could not load${T(e)}.`,refreshFailed:e=>`Could not refresh${T(e)}.`,forbiddenBecause:ie,failureSentence:ae(ie),loadMore:e=>`Show ${e} more`,endOfRecords:"No more records",close:"Close",cancel:"Cancel",reload:"Reload",breadcrumb:"Breadcrumb",stepDone:"Done",stepPending:"Not started"},ja:{unmeasured:"\u672A\u6E2C\u5B9A",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D",loadFailed:e=>`\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F${T(e)}\u3002`,refreshFailed:e=>`\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F${T(e)}\u3002`,forbiddenBecause:se,failureSentence:ae(se),loadMore:e=>`\u3055\u3089\u306B ${e} \u4EF6\u3092\u8868\u793A`,endOfRecords:"\u3053\u308C\u4EE5\u4E0A\u306E\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093",close:"\u9589\u3058\u308B",cancel:"\u3084\u3081\u308B",reload:"\u518D\u8AAD\u307F\u8FBC\u307F",breadcrumb:"\u30D1\u30F3\u304F\u305A",stepDone:"\u5B8C\u4E86",stepPending:"\u672A\u7740\u624B"}},Xe= exports.u =e=>{if(!Object.hasOwn(C,e))throw new RangeError(`No console UI labels for locale "${e}"; supported: ${Object.keys(C).join(", ")}`);return C[e]};var je=4,Ye=[1,2,3,4,6,8,12,16,24],Ke=16,Ve=5/4,D={caption:-2,body:-1,"body-lg":0,title:0,heading:1,display:2,"display-lg":3},Je=11,le=3/2,qe=7/4,Ze=7/4,Qe=120,en=3/2,nn=[1,2,3],de= exports.w =e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);return Math.ceil(e/4)*4},U=e=>{if(!Number.isInteger(e))throw new RangeError(`A type step must be an integer: ${e}`);return Math.max(Je,Math.round(Ke*Ve**e))},v=(e,n)=>de(e*n),ce=v(U(D.body),le),b= exports.x =ce+24,ue= exports.y =b+8,me= exports.z =ce+8,A={weight:{regular:400,medium:500,bold:700},radius:{"radius-control":4,"radius-item":8,"radius-container":12,"radius-pill":9999},stroke:{"border-width":1,"focus-width":2,"focus-offset":2,"marker-width":2}},tn=()=>Object.fromEntries(Ye.map(e=>[`space-${e}`,e*4])),rn=()=>{let e=Object.fromEntries(Object.entries(D).map(([t,r])=>{let o=U(r);return[t,{size:o,lineHeight:v(o,t==="title"?Ze:le)}]})),n=U(D.body);return{...e,prose:{size:n,lineHeight:v(n,qe)}}},on=()=>Object.fromEntries(nn.map(e=>[`motion-${e}`,Qe*en**(e-1)])),fe=e=>Object.freeze({space:Object.freeze(tn()),type:Object.freeze(rn()),weight:A.weight,radius:A.radius,size:Object.freeze({"size-target":b,"size-control":b,"size-row":b,"size-row-control":ue,"size-row-compact":me}),stroke:A.stroke,motion:Object.freeze(on()),color:Object.freeze({...e})});var an={fg:{light:"#0f172b",dark:"#f8fafc"},"fg-secondary":{light:"#314158",dark:"#e2e8f0"},"fg-muted":{light:"#44536a",dark:"#cad5e2"},"danger-fg":{light:"#9f0712",dark:"#ffc9c9"},"warning-fg":{light:"#7b3306",dark:"#fee685"},"success-fg":{light:"#006045",dark:"#a4f4cf"},"info-fg":{light:"#193cb8",dark:"#bedbff"},"on-solid":{light:"#ffffff",dark:"#0f172b"},surface:{light:"#ffffff",dark:"#0f172b"},subtle:{light:"#f8fafc",dark:"#1d293d"},sunken:{light:"#f1f5f9",dark:"#020618"},"danger-tint":{light:"#fef2f2",dark:"#460809"},"warning-tint":{light:"#fffbeb",dark:"#461901"},"success-tint":{light:"#ecfdf5",dark:"#002c22"},"info-tint":{light:"#eff6ff",dark:"#162456"},"neutral-solid":{light:"#314158",dark:"#cad5e2"},"danger-solid":{light:"#9f0712",dark:"#ffa2a2"},"success-solid":{light:"#006045",dark:"#5ee9b5"},"info-solid":{light:"#193cb8",dark:"#8ec5ff"},"warning-solid":{light:"#7b3306",dark:"#ffd230"},"danger-accent":{light:"#e7000b",dark:"#ff6467"},"warning-accent":{light:"#bb4d00",dark:"#fcbb00"},"success-accent":{light:"#009966",dark:"#00d492"},"info-accent":{light:"#155dfc",dark:"#51a2ff"},focus:{light:"#155dfc",dark:"#51a2ff"},"border-control":{light:"#62748e",dark:"#90a1b9"},"border-subtle":{light:"#e2e8f0",dark:"#314158"}},a= exports.A =fe(an),sn="--cui-",ln= exports.B =e=>`var(${sn}${e})`;var dn=e=>e>=32&&e<=126||e>=65377&&e<=65500||e>=65512&&e<=65518,ge=(e,n)=>{let t=0,r=0;for(let o of e)dn(o.codePointAt(0))?r+=1:t+=1;return t*1+r*n},h= exports.C =e=>ge(e,.55),x= exports.D =e=>ge(e,.6),u= exports.E =e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return Math.max(0,Math.ceil((e-1e-9)/8))*8};var pe="caption",W="body",z=2*a.space["space-3"],ye={type:"caption",paddingInlinePx:2*a.space["space-2"]},B={type:"body",paddingInlinePx:2*a.space["space-3"]+2*a.stroke["border-width"],minInlinePx:a.size["size-control"]},Te={type:"body",minInlinePx:a.size["size-target"]},S={trackInlinePx:2*a.type.body.lineHeight+3*a.space["space-1"],labelGapPx:a.space["space-2"],type:"body"},H={captionType:"caption",valueType:"heading",paddingInlinePx:2*a.space["space-3"]},cn=10,un="2000-01-01T00:00:00Z",mn=9999999,be=(e,n,t)=>(n==="mono"?x(e):h(e))*a.type[t].size,fn=(e,n)=>{if(e.length===0)throw new RangeError(`A ${n} needs at least one text to be measured with`);for(let t of e)if(!f(t))throw new RangeError(`A ${n} sample must hold a readable character: ${JSON.stringify(t)}`);return e},c=(e,n,t,r)=>Math.max(...fn(e,n).map(o=>be(o,t,r))),G= exports.F =e=>{switch(e.kind){case"text":return c(e.texts,"text",e.face,e.type);case"measured":return c(e.texts,"measured value","sans",W);case"pill":return c(e.labels,"pill","sans",ye.type)+ye.paddingInlinePx;case"button":return Math.max(B.minInlinePx,c(e.labels,"button","sans",B.type)+B.paddingInlinePx);case"link":return Math.max(Te.minInlinePx,c(e.labels,"link","sans",Te.type));case"switch":return e.labelHidden?S.trackInlinePx:S.trackInlinePx+S.labelGapPx+c(e.labels,"switch","sans",S.type);case"cluster":{if(e.items.length===0)throw new RangeError("A cluster needs at least one item to be measured with");return e.items.reduce((n,t)=>n+G(t),0)+(e.items.length-1)*a.space[e.gap]}}},gn= exports.G =(e,n)=>{let t=c([e.header],"column header","sans",pe),r=e.note===void 0?0:c(e.note,"column header note","sans",pe);return u(Math.max(t,r,...n.map(G))+z)},pn= exports.H =u(be("\u3042".repeat(cn),"sans",W)+z),yn= exports.I =e=>u(c(e,"comparison attribute","sans",W)+z),Tn= exports.J =(e,n)=>L(un,e,n),bn= exports.K =(e,n)=>{if(n!==void 0&&!f(n))throw new RangeError(`A count sample's unit must hold a readable character: ${JSON.stringify(n)}`);return J(w(mn,e),n)},hn= exports.L =(e,n)=>u(Math.max(c(e,"tile caption","sans",H.captionType),c(n,"tile value","sans",H.valueType))+H.paddingInlinePx);var xn=.12,kn=.16,Rn=/[\u0020\u00a0\u1361\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,k=a.space["space-3"],P= exports.M =(e,n)=>{let t=0,r=0;for(let i of e)t+=1,Rn.test(i)&&(r+=1);return(n==="mono"?x(e):h(e))+xn*t+kn*r},En= exports.N =e=>{for(let t of[e.name,...e.notes])if(!f(t))throw new RangeError(`A figure node's name and notes must hold a readable character: ${JSON.stringify(t)}`);let n=Math.max(P(e.name,"sans")*a.type.body.size,...e.notes.map(t=>P(t,"sans")*a.type.caption.size));return{minWidthPx:u(n)+2*k,heightPx:2*k+a.type.body.lineHeight+e.notes.length*a.type.caption.lineHeight}},ct= exports.O =e=>{let n=k+a.type.body.lineHeight;return{insetPx:k,namePx:k+a.type.body.lineHeight/2,notesPx:Array.from({length:e},(t,r)=>n+r*a.type.caption.lineHeight+a.type.caption.lineHeight/2)}},Cn= exports.P =(e,n)=>{if(e!==null&&!f(e))throw new RangeError(`A disc's name must hold a readable character: ${JSON.stringify(e)}`);if(!(Number.isFinite(n)&&n>0))throw new RangeError(`A disc's radius must be a positive finite px value: ${n}`);return e===null?{widthPx:0,extentBelowPx:n+he}:{widthPx:u(P(e,"sans")*a.type.caption.size),extentBelowPx:n+a.space["space-1"]+a.type.caption.lineHeight}},he= exports.Q =a.stroke["focus-offset"]+a.stroke["focus-width"],ut= exports.R =a.stroke["focus-offset"]+a.stroke["focus-width"]/2;var _=(1+Math.sqrt(5))/2,Sn= exports.S =(e,n)=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);if(!(Number.isInteger(n)&&n>=0))throw new RangeError(`A golden section step must be an integer at or above 0: ${n}`);return e/_**n};var Pn=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return e},m= exports.T =e=>`${Pn(e)/16}rem`;var xe=({masterMinPx:e,detailMinPx:n,gapPx:t})=>{for(let r of[e,n])if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Pane minimum must be a positive px value: ${r}`);if(!(Number.isFinite(t)&&t>=0))throw new RangeError(`Gap must be a px value >= 0: ${t}`);return e+t+n},_n= exports.U =(e,n)=>{let t=xe(n);if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Container width must be a px value >= 0: ${e}`);if(e<t)return{sideBySide:!1,sideBySideFromPx:t,masterInlinePx:e,detailInlinePx:e};let r=(e-n.gapPx)/(1+_),o=Math.min(Math.max(n.masterMinPx,r),e-n.gapPx-n.detailMinPx);return{sideBySide:!0,sideBySideFromPx:t,masterInlinePx:o,detailInlinePx:e-n.gapPx-o}},Tt= exports.V =e=>{let n=xe(e),t=`cui-master-detail-m${e.masterMinPx}-d${e.detailMinPx}-g${e.gapPx}`,r=`[data-cui-master-detail="${t}"]`,o=m(e.gapPx),i=`${r}{grid-template-columns:minmax(0,1fr);gap:${o}}`,d=`clamp(${m(e.masterMinPx)},calc((100% - ${o}) / ${1+_}),calc(100% - ${o} - ${m(e.detailMinPx)}))`,s=`@container (min-width:${m(n)}){${r}{grid-template-columns:${d} minmax(0,1fr)}}`;return{key:t,css:i+s}};var wn=2*a.space["space-1"],ke=e=>{if(!(Number.isFinite(e)&&e>0))throw new RangeError(`Column width must be a positive px value: ${e}`);return e},Re= exports.W =e=>{if(e.length===0)throw new RangeError("A table needs at least one column");let n=0,t=null;for(let{width:r}of e){if(r.fixedPx!==void 0){n+=ke(r.fixedPx);continue}let o=ke(r.minPx);if(t!==null&&t!==o)throw new RangeError(`Flexible columns share the remaining width equally, so their minimums must be equal: ${t} and ${o}`);t=o,n+=o}return n},On= exports.X =e=>Re(e)+wn;var In=(e,n,t)=>{if(!(Number.isSafeInteger(e)&&e>0))throw new RangeError(`Tile count must be a positive integer: ${e}`);if(!(Number.isFinite(n)&&n>0))throw new RangeError(`Tile minimum width must be a positive px value: ${n}`);if(!(Number.isFinite(t)&&t>=0))throw new RangeError(`Tile gap must be a px value >= 0: ${t}`);let r=[];for(let s=1;s<=e;s+=1)e%s===0&&r.push({columns:s,minContainerPx:s*n+(s-1)*t});let o=`cui-tiles-n${e}-m${n}-g${t}`,i=`[data-cui-tile-grid="${o}"]`,d=r.map(({columns:s,minContainerPx:R})=>{let p=`${i}{grid-template-columns:repeat(${s},minmax(0,1fr))}`;return s===1?p:`@container (min-width:${m(R)}){${p}}`});return{key:o,steps:r,css:d.join("")}};var Nn=(e,n)=>{let t=F(e,n);return t.kind==="ready"?{...t,value:{...t.value,loadingMore:!1}}:t},Mn= exports._ =(e,n)=>$(e,n.ok?{ok:!0,value:{rows:n.value.rows,next:n.value.next,meta:n.value.meta,loadingMore:!1,moreFailure:null}}:n),Ln= exports.$ =e=>e.kind==="ready"&&!e.refreshing&&e.value.next!==null&&!e.value.loadingMore?{...e,value:{...e.value,loadingMore:!0}}:e,Fn= exports.aa =(e,n,t)=>{if(!(e.kind==="ready"&&e.value.loadingMore&&Object.is(e.value.next,n)))return e;if(t.ok)return{...e,value:{...e.value,rows:[...e.value.rows,...t.value.rows],next:t.value.next,loadingMore:!1,moreFailure:null}};let r=e.value.moreFailure===null?1:e.value.moreFailure.occurrence+1;return{...e,value:{...e.value,loadingMore:!1,moreFailure:{reason:t.reason,occurrence:r}}}},$n= exports.ba =(e,n)=>{if(e.kind!=="ready")return e;let{rows:t,meta:r}=n({rows:e.value.rows,meta:e.value.meta});return{...e,value:{...e.value,rows:t,meta:r}}};var An=/^#[0-9a-f]{6}$/i,Dn=/^[a-z][a-z0-9-]*$/,Ee=e=>{if(!An.test(e))throw new RangeError(`A palette colour must be #rrggbb: ${e}`);return e},Ce= exports.ca =({light:e,dark:n})=>`light-dark(${Ee(e)}, ${Ee(n)})`,Un= exports.da =e=>{if(!Dn.test(e))throw new RangeError(`A root attribute must be lowercase letters, digits and hyphens, starting with a letter: ${e}`);return`[${e}] ::placeholder { color: ${Ce(a.color["fg-muted"])}; opacity: 1; }`};var Se=["indigo","violet","purple","fuchsia","pink","rose","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue"],vn= exports.fa =["fg","tint","accent","line","solid","solid-hover"],Bn={indigo:{fg:{light:"#372aac",dark:"#c6d2ff"},tint:{light:"#eff3ff",dark:"#1e1a4d"},accent:{light:"#4f39f6",dark:"#7c86ff"}},violet:{fg:{light:"#5d0ec0",dark:"#ddd6ff"},tint:{light:"#f5f3ff",dark:"#2f0d68"},accent:{light:"#7f22fe",dark:"#a684ff"}},purple:{fg:{light:"#6e11b0",dark:"#e9d4ff"},tint:{light:"#faf5ff",dark:"#3c0366"},accent:{light:"#9810fa",dark:"#c27aff"}},fuchsia:{fg:{light:"#8a0194",dark:"#f6cfff"},tint:{light:"#fdf4ff",dark:"#4b004f"},accent:{light:"#c800de",dark:"#ed6aff"}},pink:{fg:{light:"#a3004c",dark:"#fccee8"},tint:{light:"#fdf2f8",dark:"#510424"},accent:{light:"#e60076",dark:"#fb64b6"}},rose:{fg:{light:"#a50036",dark:"#ffccd3"},tint:{light:"#fff1f2",dark:"#4d0218"},accent:{light:"#ec003f",dark:"#ff637e"}},red:{fg:{light:"#9f0712",dark:"#ffc9c9"},tint:{light:"#fef2f2",dark:"#460809"},accent:{light:"#e7000b",dark:"#ff6467"}},orange:{fg:{light:"#7e2a0c",dark:"#ffd6a7"},tint:{light:"#fff7ed",dark:"#441306"},accent:{light:"#f54900",dark:"#ff8904"}},amber:{fg:{light:"#7b3306",dark:"#fee685"},tint:{light:"#fffbeb",dark:"#461901"},accent:{light:"#bb4d00",dark:"#fcbb00"}},yellow:{fg:{light:"#733e0a",dark:"#fff085"},tint:{light:"#fefce8",dark:"#432004"},accent:{light:"#a65f00",dark:"#fdc700"}},lime:{fg:{light:"#35530e",dark:"#d8f999"},tint:{light:"#f7fee7",dark:"#192e03"},accent:{light:"#497d00",dark:"#9ae600"}},green:{fg:{light:"#0d542b",dark:"#b9f8cf"},tint:{light:"#f0fdf4",dark:"#032e15"},accent:{light:"#008236",dark:"#05df72"}},emerald:{fg:{light:"#004f3b",dark:"#a4f4cf"},tint:{light:"#ecfdf5",dark:"#002c22"},accent:{light:"#009966",dark:"#00d492"}},teal:{fg:{light:"#0b4f4a",dark:"#96f7e4"},tint:{light:"#f0fdfa",dark:"#022f2e"},accent:{light:"#009689",dark:"#00d5be"}},cyan:{fg:{light:"#104e64",dark:"#a2f4fd"},tint:{light:"#ecfeff",dark:"#053345"},accent:{light:"#0092b8",dark:"#00d3f2"}},sky:{fg:{light:"#024a70",dark:"#b8e6fe"},tint:{light:"#f0f9ff",dark:"#052f4a"},accent:{light:"#0084d1",dark:"#00bcff"}},blue:{fg:{light:"#193cb8",dark:"#bedbff"},tint:{light:"#eff6ff",dark:"#162456"},accent:{light:"#155dfc",dark:"#51a2ff"}}},y=({light:e,dark:n})=>Object.freeze({light:e,dark:n}),Hn=({fg:e,tint:n,accent:t})=>Object.freeze({fg:y(e),tint:y(n),accent:y(t),line:y({light:e.dark,dark:e.light}),solid:y(e),"solid-hover":y({light:n.dark,dark:n.light})}),Wn= exports.ga =Object.freeze(Object.fromEntries(Se.map(e=>[e,Hn(Bn[e])])));exports.a = w; exports.b = _e; exports.c = J; exports.d = q; exports.e = Ne; exports.f = f; exports.g = l; exports.h = Ue; exports.i = ve; exports.j = L; exports.k = He; exports.l = oe; exports.m = We; exports.n = ze; exports.o = Kn; exports.p = Ge; exports.q = F; exports.r = $; exports.s = T; exports.t = C; exports.u = Xe; exports.v = je; exports.w = de; exports.x = b; exports.y = ue; exports.z = me; exports.A = a; exports.B = ln; exports.C = h; exports.D = x; exports.E = u; exports.F = G; exports.G = gn; exports.H = pn; exports.I = yn; exports.J = Tn; exports.K = bn; exports.L = hn; exports.M = P; exports.N = En; exports.O = ct; exports.P = Cn; exports.Q = he; exports.R = ut; exports.S = Sn; exports.T = m; exports.U = _n; exports.V = Tt; exports.W = Re; exports.X = On; exports.Y = In; exports.Z = Nn; exports._ = Mn; exports.$ = Ln; exports.aa = Fn; exports.ba = $n; exports.ca = Ce; exports.da = Un; exports.ea = Se; exports.fa = vn; exports.ga = Wn;
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkS6DFKVUVcjs = require('./chunk-S6DFKVUV.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');exports.COMPACT_ROW_PX = _chunkS6DFKVUVcjs.x; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkS6DFKVUVcjs.r; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.FIGURE_RING_REACH_PX = _chunkS6DFKVUVcjs.O; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkS6DFKVUVcjs.F; exports.HTTP_FORBIDDEN = _chunkS6DFKVUVcjs.j; exports.LATTICE_PX = _chunkS6DFKVUVcjs.t; exports.ROW_WITH_CONTROL_PX = _chunkS6DFKVUVcjs.w; exports.TARGET_PX = _chunkS6DFKVUVcjs.v; exports.TOKENS = _chunkS6DFKVUVcjs.y; exports.TONES = _chunkS6DFKVUVcjs.da; exports.TONE_HUES = _chunkS6DFKVUVcjs.ba; exports.TONE_ROLES = _chunkS6DFKVUVcjs.ca; exports.ZonedTimeError = _chunkS6DFKVUVcjs.f; exports.beginPage = _chunkS6DFKVUVcjs.Y; exports.beginPagedReload = _chunkS6DFKVUVcjs.W; exports.beginReload = _chunkS6DFKVUVcjs.o; exports.ceil8 = _chunkS6DFKVUVcjs.C; exports.ceilToLattice = _chunkS6DFKVUVcjs.u; exports.cellContentInlinePx = _chunkS6DFKVUVcjs.D; exports.comparisonAttributePx = _chunkS6DFKVUVcjs.G; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkS6DFKVUVcjs.I; exports.cssVar = _chunkS6DFKVUVcjs.z; exports.figureBoxPlan = _chunkS6DFKVUVcjs.L; exports.figureDiscLabelPlan = _chunkS6DFKVUVcjs.N; exports.fixedColumnPx = _chunkS6DFKVUVcjs.E; exports.flatMapOutcome = _chunkS6DFKVUVcjs.l; exports.formatCount = _chunkS6DFKVUVcjs.a; exports.formatInstant = _chunkS6DFKVUVcjs.i; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkS6DFKVUVcjs.H; exports.isReadableText = _chunkS6DFKVUVcjs.e; exports.keepLastGood = _chunkS6DFKVUVcjs.p; exports.lightDark = _chunkS6DFKVUVcjs.$; exports.mapOutcome = _chunkS6DFKVUVcjs.k; exports.mapPagedList = _chunkS6DFKVUVcjs._; exports.masterDetailPlan = _chunkS6DFKVUVcjs.R; exports.monoTextWidthEm = _chunkS6DFKVUVcjs.B; exports.placeholderRule = _chunkS6DFKVUVcjs.aa; exports.readDecimalText = _chunkS6DFKVUVcjs.c; exports.readIntegerText = _chunkS6DFKVUVcjs.d; exports.reasonAside = _chunkS6DFKVUVcjs.q; exports.resolveConsoleUiLabels = _chunkS6DFKVUVcjs.s; exports.settleFirstPage = _chunkS6DFKVUVcjs.X; exports.settlePage = _chunkS6DFKVUVcjs.Z; exports.spacedTextWidthEm = _chunkS6DFKVUVcjs.K; exports.tableFrameMinInlinePx = _chunkS6DFKVUVcjs.U; exports.tableMinInlinePx = _chunkS6DFKVUVcjs.T; exports.textWidthEm = _chunkS6DFKVUVcjs.A; exports.tileGridPlan = _chunkS6DFKVUVcjs.V; exports.tileMinInlinePx = _chunkS6DFKVUVcjs.J; exports.toOffsetIso = _chunkS6DFKVUVcjs.g; exports.toWallTime = _chunkS6DFKVUVcjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkK7BETTSLcjs = require('./chunk-K7BETTSL.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');exports.COMPACT_ROW_PX = _chunkK7BETTSLcjs.z; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkK7BETTSLcjs.t; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.FIGURE_RING_REACH_PX = _chunkK7BETTSLcjs.Q; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkK7BETTSLcjs.H; exports.HTTP_FORBIDDEN = _chunkK7BETTSLcjs.l; exports.LATTICE_PX = _chunkK7BETTSLcjs.v; exports.ROW_WITH_CONTROL_PX = _chunkK7BETTSLcjs.y; exports.TARGET_PX = _chunkK7BETTSLcjs.x; exports.TOKENS = _chunkK7BETTSLcjs.A; exports.TONES = _chunkK7BETTSLcjs.ga; exports.TONE_HUES = _chunkK7BETTSLcjs.ea; exports.TONE_ROLES = _chunkK7BETTSLcjs.fa; exports.ZonedTimeError = _chunkK7BETTSLcjs.g; exports.beginPage = _chunkK7BETTSLcjs.$; exports.beginPagedReload = _chunkK7BETTSLcjs.Z; exports.beginReload = _chunkK7BETTSLcjs.q; exports.ceil8 = _chunkK7BETTSLcjs.E; exports.ceilToLattice = _chunkK7BETTSLcjs.w; exports.cellContentInlinePx = _chunkK7BETTSLcjs.F; exports.comparisonAttributePx = _chunkK7BETTSLcjs.I; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkK7BETTSLcjs.K; exports.cssVar = _chunkK7BETTSLcjs.B; exports.figureBoxPlan = _chunkK7BETTSLcjs.N; exports.figureDiscLabelPlan = _chunkK7BETTSLcjs.P; exports.fillLabel = _chunkK7BETTSLcjs.k; exports.fixedColumnPx = _chunkK7BETTSLcjs.G; exports.flatMapOutcome = _chunkK7BETTSLcjs.n; exports.formatByteSize = _chunkK7BETTSLcjs.b; exports.formatCount = _chunkK7BETTSLcjs.a; exports.formatInstant = _chunkK7BETTSLcjs.j; exports.goldenSectionPx = _chunkK7BETTSLcjs.S; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkK7BETTSLcjs.J; exports.isReadableText = _chunkK7BETTSLcjs.f; exports.keepLastGood = _chunkK7BETTSLcjs.r; exports.lightDark = _chunkK7BETTSLcjs.ca; exports.mapOutcome = _chunkK7BETTSLcjs.m; exports.mapPagedList = _chunkK7BETTSLcjs.ba; exports.masterDetailPlan = _chunkK7BETTSLcjs.U; exports.monoTextWidthEm = _chunkK7BETTSLcjs.D; exports.placeholderRule = _chunkK7BETTSLcjs.da; exports.pxToRem = _chunkK7BETTSLcjs.T; exports.readDecimalText = _chunkK7BETTSLcjs.d; exports.readIntegerText = _chunkK7BETTSLcjs.e; exports.reasonAside = _chunkK7BETTSLcjs.s; exports.resolveConsoleUiLabels = _chunkK7BETTSLcjs.u; exports.settleFirstPage = _chunkK7BETTSLcjs._; exports.settlePage = _chunkK7BETTSLcjs.aa; exports.spacedTextWidthEm = _chunkK7BETTSLcjs.M; exports.tableFrameMinInlinePx = _chunkK7BETTSLcjs.X; exports.tableMinInlinePx = _chunkK7BETTSLcjs.W; exports.textWidthEm = _chunkK7BETTSLcjs.C; exports.tileGridPlan = _chunkK7BETTSLcjs.Y; exports.tileMinInlinePx = _chunkK7BETTSLcjs.L; exports.toOffsetIso = _chunkK7BETTSLcjs.h; exports.toWallTime = _chunkK7BETTSLcjs.i;
package/dist/core.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare const formatCount: (value: number, formatLocale: string) => string;
2
+ declare const formatByteSize: (size: number, formatLocale: string) => string;
2
3
  declare const readDecimalText: (text: string) => number | null;
3
4
  declare const readIntegerText: (text: string) => number | null;
4
5
  declare const isReadableText: (text: string) => boolean;
@@ -10,6 +11,7 @@ declare class ZonedTimeError extends RangeError {
10
11
  declare const toOffsetIso: (wallTime: string, timeZone: string) => string;
11
12
  declare const toWallTime: (offsetIso: string, timeZone: string) => string;
12
13
  declare const formatInstant: (instant: string, formatLocale: string, timeZone: string) => string;
14
+ declare function fillLabel(template: string, values: Readonly<Record<string, string | number>>): string;
13
15
  type ConsoleUiLocale = "en" | "ja";
14
16
  type ConsoleUiLabels = {
15
17
  readonly unmeasured: string;
@@ -48,6 +50,7 @@ declare const SPACE_MULTIPLIERS: readonly [
48
50
  declare const TYPE_STEPS: {
49
51
  readonly caption: -2;
50
52
  readonly body: -1;
53
+ readonly "body-lg": 0;
51
54
  readonly title: 0;
52
55
  readonly heading: 1;
53
56
  readonly display: 2;
@@ -265,6 +268,7 @@ type FigureDiscLabelPlan = {
265
268
  };
266
269
  declare const figureDiscLabelPlan: (label: string | null, radiusPx: number) => FigureDiscLabelPlan;
267
270
  declare const FIGURE_RING_REACH_PX: number;
271
+ declare const goldenSectionPx: (lengthPx: number, step: number) => number;
268
272
  type MasterDetailOptions = {
269
273
  readonly masterMinPx: number;
270
274
  readonly detailMinPx: number;
@@ -277,6 +281,7 @@ type MasterDetailPlan = {
277
281
  readonly detailInlinePx: number;
278
282
  };
279
283
  declare const masterDetailPlan: (containerPx: number, options: MasterDetailOptions) => MasterDetailPlan;
284
+ declare const pxToRem: (px: number) => string;
280
285
  type ColumnWidth = {
281
286
  readonly fixedPx: number;
282
287
  readonly minPx?: never;
@@ -583,4 +588,4 @@ declare const TONE_ROLES: readonly [
583
588
  type ToneRole = (typeof TONE_ROLES)[number];
584
589
  type Tone = Readonly<Record<ToneRole, SchemeColor>>;
585
590
  declare const TONES: Readonly<Record<ToneHue, Tone>>;
586
- export { type AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type CellContent, type ColorScheme, type ColorToken, type ColumnHeaderText, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, type FgRole, type FigureBoxLines, type FigureBoxPlan, type FigureDiscLabelPlan, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, type TextFace, type TileGridPlan, type TileGridStep, type TokenName, type Tone, type ToneHue, type ToneRole, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fixedColumnPx, flatMapOutcome, formatCount, formatInstant, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime };
591
+ export { type AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type CellContent, type ColorScheme, type ColorToken, type ColumnHeaderText, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, type FgRole, type FigureBoxLines, type FigureBoxPlan, type FigureDiscLabelPlan, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, type TextFace, type TileGridPlan, type TileGridStep, type TokenName, type Tone, type ToneHue, type ToneRole, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime };
package/dist/core.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare const formatCount: (value: number, formatLocale: string) => string;
2
+ declare const formatByteSize: (size: number, formatLocale: string) => string;
2
3
  declare const readDecimalText: (text: string) => number | null;
3
4
  declare const readIntegerText: (text: string) => number | null;
4
5
  declare const isReadableText: (text: string) => boolean;
@@ -10,6 +11,7 @@ declare class ZonedTimeError extends RangeError {
10
11
  declare const toOffsetIso: (wallTime: string, timeZone: string) => string;
11
12
  declare const toWallTime: (offsetIso: string, timeZone: string) => string;
12
13
  declare const formatInstant: (instant: string, formatLocale: string, timeZone: string) => string;
14
+ declare function fillLabel(template: string, values: Readonly<Record<string, string | number>>): string;
13
15
  type ConsoleUiLocale = "en" | "ja";
14
16
  type ConsoleUiLabels = {
15
17
  readonly unmeasured: string;
@@ -48,6 +50,7 @@ declare const SPACE_MULTIPLIERS: readonly [
48
50
  declare const TYPE_STEPS: {
49
51
  readonly caption: -2;
50
52
  readonly body: -1;
53
+ readonly "body-lg": 0;
51
54
  readonly title: 0;
52
55
  readonly heading: 1;
53
56
  readonly display: 2;
@@ -265,6 +268,7 @@ type FigureDiscLabelPlan = {
265
268
  };
266
269
  declare const figureDiscLabelPlan: (label: string | null, radiusPx: number) => FigureDiscLabelPlan;
267
270
  declare const FIGURE_RING_REACH_PX: number;
271
+ declare const goldenSectionPx: (lengthPx: number, step: number) => number;
268
272
  type MasterDetailOptions = {
269
273
  readonly masterMinPx: number;
270
274
  readonly detailMinPx: number;
@@ -277,6 +281,7 @@ type MasterDetailPlan = {
277
281
  readonly detailInlinePx: number;
278
282
  };
279
283
  declare const masterDetailPlan: (containerPx: number, options: MasterDetailOptions) => MasterDetailPlan;
284
+ declare const pxToRem: (px: number) => string;
280
285
  type ColumnWidth = {
281
286
  readonly fixedPx: number;
282
287
  readonly minPx?: never;
@@ -583,4 +588,4 @@ declare const TONE_ROLES: readonly [
583
588
  type ToneRole = (typeof TONE_ROLES)[number];
584
589
  type Tone = Readonly<Record<ToneRole, SchemeColor>>;
585
590
  declare const TONES: Readonly<Record<ToneHue, Tone>>;
586
- export { type AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type CellContent, type ColorScheme, type ColorToken, type ColumnHeaderText, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, type FgRole, type FigureBoxLines, type FigureBoxPlan, type FigureDiscLabelPlan, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, type TextFace, type TileGridPlan, type TileGridStep, type TokenName, type Tone, type ToneHue, type ToneRole, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fixedColumnPx, flatMapOutcome, formatCount, formatInstant, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime };
591
+ export { type AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type CellContent, type ColorScheme, type ColorToken, type ColumnHeaderText, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, type FgRole, type FigureBoxLines, type FigureBoxPlan, type FigureDiscLabelPlan, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, type TextFace, type TileGridPlan, type TileGridStep, type TokenName, type Tone, type ToneHue, type ToneRole, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime };
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- import{$ as Y,A as x,B as y,C as z,D as A,E as B,F as C,G as D,H as E,I as F,J as G,K as H,L as I,N as J,O as K,R as L,T as M,U as N,V as O,W as P,X as Q,Y as R,Z as S,_ as T,a,aa as Z,ba as _,c as b,ca as $,d as c,da as aa,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u,y as v,z as w}from"./chunk-4IQKQ7WF.js";import{a as U,b as V,c as W,d as X}from"./chunk-FXEGLGL7.js";export{u as COMPACT_ROW_PX,o as CONSOLE_UI_LABEL_CATALOGS,W as CONTRAST_MINIMUM,X as CONTRAST_PAIRS,K as FIGURE_RING_REACH_PX,C as FLEXIBLE_COLUMN_MIN_PX,i as HTTP_FORBIDDEN,q as LATTICE_PX,t as ROW_WITH_CONTROL_PX,s as TARGET_PX,v as TOKENS,aa as TONES,_ as TONE_HUES,$ as TONE_ROLES,e as ZonedTimeError,R as beginPage,P as beginPagedReload,l as beginReload,z as ceil8,r as ceilToLattice,A as cellContentInlinePx,D as comparisonAttributePx,V as contrastRatio,F as countSampleText,w as cssVar,I as figureBoxPlan,J as figureDiscLabelPlan,B as fixedColumnPx,k as flatMapOutcome,a as formatCount,h as formatInstant,U as hexToSrgb,E as instantSampleText,d as isReadableText,m as keepLastGood,Y as lightDark,j as mapOutcome,T as mapPagedList,L as masterDetailPlan,y as monoTextWidthEm,Z as placeholderRule,b as readDecimalText,c as readIntegerText,n as reasonAside,p as resolveConsoleUiLabels,Q as settleFirstPage,S as settlePage,H as spacedTextWidthEm,N as tableFrameMinInlinePx,M as tableMinInlinePx,x as textWidthEm,O as tileGridPlan,G as tileMinInlinePx,f as toOffsetIso,g as toWallTime};
1
+ import{$ as V,A as x,B as y,C as z,D as A,E as B,F as C,G as D,H as E,I as F,J as G,K as H,L as I,M as J,N as K,P as L,Q as M,S as N,T as O,U as P,W as Q,X as R,Y as S,Z as T,_ as U,a,aa as W,b,ba as X,ca as aa,d as c,da as ba,e as d,ea as ca,f as e,fa as da,g as f,ga as ea,h as g,i as h,j as i,k as j,l as k,m as l,n as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u,y as v,z as w}from"./chunk-5TR7VUZM.js";import{a as Y,b as Z,c as _,d as $}from"./chunk-FXEGLGL7.js";export{w as COMPACT_ROW_PX,q as CONSOLE_UI_LABEL_CATALOGS,_ as CONTRAST_MINIMUM,$ as CONTRAST_PAIRS,M as FIGURE_RING_REACH_PX,E as FLEXIBLE_COLUMN_MIN_PX,k as HTTP_FORBIDDEN,s as LATTICE_PX,v as ROW_WITH_CONTROL_PX,u as TARGET_PX,x as TOKENS,ea as TONES,ca as TONE_HUES,da as TONE_ROLES,f as ZonedTimeError,V as beginPage,T as beginPagedReload,n as beginReload,B as ceil8,t as ceilToLattice,C as cellContentInlinePx,F as comparisonAttributePx,Z as contrastRatio,H as countSampleText,y as cssVar,K as figureBoxPlan,L as figureDiscLabelPlan,j as fillLabel,D as fixedColumnPx,m as flatMapOutcome,b as formatByteSize,a as formatCount,i as formatInstant,N as goldenSectionPx,Y as hexToSrgb,G as instantSampleText,e as isReadableText,o as keepLastGood,aa as lightDark,l as mapOutcome,X as mapPagedList,P as masterDetailPlan,A as monoTextWidthEm,ba as placeholderRule,O as pxToRem,c as readDecimalText,d as readIntegerText,p as reasonAside,r as resolveConsoleUiLabels,U as settleFirstPage,W as settlePage,J as spacedTextWidthEm,R as tableFrameMinInlinePx,Q as tableMinInlinePx,z as textWidthEm,S as tileGridPlan,I as tileMinInlinePx,g as toOffsetIso,h as toWallTime};