@stenajs-webui/core
Advanced tools
@@ -44,2 +44,3 @@ import "@stenajs-webui/theme"; | ||
export * from "./hooks/UseToday"; | ||
export * from "./sorting/Comparators"; | ||
export * from "./utils/SwitchCaseExhauster"; | ||
@@ -46,0 +47,0 @@ export * from "./utils/TruthyKeysAsList"; |
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._separatorLine_nzfcz_1{display:flex;border:0;margin:0;flex:none}._visuallyHidden_1gevf_1{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}._text_1iisw_1{--swui-text-color: var(--swui-text-primary-color);--swui-text-color-caption: var(--lhds-color-ui-600);--swui-text-color-overline: var(--lhds-color-ui-600);--swui-text-font-family: var(--swui-font-primary);--swui-text-font-weight: var(--swui-font-weight-text);--current-color: var(--swui-text-color);--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium);--current-font-weight: var(--swui-text-font-weight);--current-letter-spacing: var(--swui-text-letter-spacing);font-size:var(--current-font-size);line-height:var(--current-line-height);color:var(--current-color);letter-spacing:var(--current-letter-spacing);font-family:var(--swui-text-font-family);font-weight:var(--current-font-weight)}._text_1iisw_1._bold_1iisw_27{--current-font-weight: var(--swui-font-weight-text-bold)}._text_1iisw_1._caption_1iisw_31{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small);--current-color: var(--swui-text-color-caption);--current-letter-spacing: 0;font-style:italic}._text_1iisw_1._overline_1iisw_39{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller);--current-color: var(--swui-text-color-overline);--current-font-weight: var(--swui-font-weight-text-bold);--current-letter-spacing: .1rem;text-transform:uppercase}._text_1iisw_1._large_1iisw_48{--current-font-size: var(--swui-font-size-large);--current-line-height: var(--swui-line-height-large)}._text_1iisw_1._medium_1iisw_53{--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium)}._text_1iisw_1._small_1iisw_58{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small)}._text_1iisw_1._smaller_1iisw_63{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller)}._heading_1cnsg_1{font-size:2rem;color:var(--swui-text-primary-color);letter-spacing:0;margin:0;line-height:var(--swui-line-height);font-family:var(--swui-font-primary);font-weight:var(--swui-font-weight-text-bold)}._heading_1cnsg_1._h1_1cnsg_10{font-size:2.8rem}._heading_1cnsg_1._h2_1cnsg_14{font-size:2.4rem}._heading_1cnsg_1._h3_1cnsg_18{font-size:2rem}._heading_1cnsg_1._h4_1cnsg_22{font-size:1.8rem}._heading_1cnsg_1._h5_1cnsg_26{font-size:1.6rem}._heading_1cnsg_1._h6_1cnsg_30{font-size:1.4rem}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})(); | ||
import { cssColor as D } from "@stenajs-webui/theme"; | ||
import { jsx as a, Fragment as S } from "react/jsx-runtime"; | ||
import H, { forwardRef as h, useState as y, useCallback as m, useLayoutEffect as R, useRef as f, useEffect as d, useMemo as L } from "react"; | ||
import H, { forwardRef as h, useState as y, useCallback as m, useLayoutEffect as R, useRef as g, useEffect as d, useMemo as L } from "react"; | ||
import _ from "@emotion/styled"; | ||
@@ -67,3 +67,3 @@ import { system as z, background as F, border as N, borderRight as U, borderLeft as V, borderTop as q, borderBottom as j, borderColor as B, borderRadius as W, borderStyle as X, borderWidth as G, boxShadow as Y, flexbox as K, overflow as Z, position as J, layout as Q, zIndex as ee, left as te, right as re, top as ue, bottom as ne } from "styled-system"; | ||
hoverBackground: p, | ||
focusBackground: g, | ||
focusBackground: f, | ||
type: O = "button", | ||
@@ -85,3 +85,3 @@ ...A | ||
hoverBackground: p, | ||
focusBackground: g, | ||
focusBackground: f, | ||
type: O, | ||
@@ -584,5 +584,5 @@ ...A, | ||
"|" | ||
)})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$`, he = new RegExp(me), fe = oe( | ||
)})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$`, he = new RegExp(me), ge = oe( | ||
(e) => he.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91 | ||
), ge = { | ||
), fe = { | ||
box: "var(--swui-shadow-box)", | ||
@@ -630,6 +630,6 @@ popover: "var(--swui-shadow-popover)", | ||
property: "boxShadow", | ||
transform: (e) => ge[e] ?? e | ||
transform: (e) => fe[e] ?? e | ||
} | ||
}), b = _("div", { | ||
shouldForwardProp: (e) => typeof e == "string" ? ve(e) ? !1 : fe(e) : !1 | ||
shouldForwardProp: (e) => typeof e == "string" ? ve(e) ? !1 : ge(e) : !1 | ||
})` | ||
@@ -715,3 +715,3 @@ --current-spacing: 0; | ||
function({ onResize: t, ...r }, u) { | ||
const n = f(null); | ||
const n = g(null); | ||
return ke(u ?? n, t), /* @__PURE__ */ a(b, { ...r, ref: u }); | ||
@@ -779,7 +779,7 @@ } | ||
...p | ||
}, g) => /* @__PURE__ */ a( | ||
}, f) => /* @__PURE__ */ a( | ||
"span", | ||
{ | ||
className: M(k.text, k[t], k[r], u), | ||
ref: g, | ||
ref: f, | ||
style: { | ||
@@ -797,3 +797,3 @@ color: n, | ||
) | ||
), pt = w, mt = (e) => /* @__PURE__ */ a(w, { size: "small", ...e }), ht = (e) => /* @__PURE__ */ a(w, { size: "smaller", ...e }), ft = (e) => /* @__PURE__ */ a(w, { size: "medium", ...e }), gt = (e) => /* @__PURE__ */ a(w, { size: "large", ...e }), ze = "_heading_1cnsg_1", Fe = "_h1_1cnsg_10", Ne = "_h2_1cnsg_14", Ue = "_h3_1cnsg_18", Ve = "_h4_1cnsg_22", qe = "_h5_1cnsg_26", je = "_h6_1cnsg_30", T = { | ||
), pt = w, mt = (e) => /* @__PURE__ */ a(w, { size: "small", ...e }), ht = (e) => /* @__PURE__ */ a(w, { size: "smaller", ...e }), gt = (e) => /* @__PURE__ */ a(w, { size: "medium", ...e }), ft = (e) => /* @__PURE__ */ a(w, { size: "large", ...e }), ze = "_heading_1cnsg_1", Fe = "_h1_1cnsg_10", Ne = "_h2_1cnsg_14", Ue = "_h3_1cnsg_18", Ve = "_h4_1cnsg_22", qe = "_h5_1cnsg_26", je = "_h6_1cnsg_30", T = { | ||
heading: ze, | ||
@@ -836,3 +836,3 @@ h1: Fe, | ||
t( | ||
i.reduce((l, p) => l.some((g) => r(g, p)) ? l : [...l, p], e) | ||
i.reduce((l, p) => l.some((f) => r(f, p)) ? l : [...l, p], e) | ||
); | ||
@@ -844,3 +844,3 @@ }, | ||
const l = e.findIndex((p) => r(p, i)); | ||
l >= 0 && t(e.filter((p, g) => g !== l)); | ||
l >= 0 && t(e.filter((p, f) => f !== l)); | ||
}, | ||
@@ -902,3 +902,3 @@ [e, t, r] | ||
}, v = (e, t, r) => { | ||
const u = f(null); | ||
const u = g(null); | ||
d(() => { | ||
@@ -931,3 +931,3 @@ u.current = r; | ||
}, _t = (e) => { | ||
const t = f(e); | ||
const t = g(e); | ||
return R(() => { | ||
@@ -949,3 +949,3 @@ t.current = e; | ||
}, Tt = (e, t) => { | ||
const r = f(() => { | ||
const r = g(() => { | ||
}); | ||
@@ -963,3 +963,3 @@ d(() => { | ||
}, Ct = (e, t, r) => { | ||
const u = f(() => { | ||
const u = g(() => { | ||
}); | ||
@@ -977,3 +977,3 @@ d(() => { | ||
}, I = ["mousemove", "mousedown", "keydown", "touchstart", "scroll"], It = (e, t) => { | ||
const r = f(() => { | ||
const r = g(() => { | ||
}); | ||
@@ -1003,3 +1003,3 @@ d(() => { | ||
}, Lt = (e) => { | ||
const t = f(null); | ||
const t = g(null); | ||
return d(() => { | ||
@@ -1009,3 +1009,3 @@ e && (typeof e == "function" ? e(t.current) : e.current = t.current); | ||
}, Mt = (e, t, r = !0) => { | ||
const [u, n] = y(e), o = f(null), s = m( | ||
const [u, n] = y(e), o = g(null), s = m( | ||
(c, i = t) => { | ||
@@ -1019,5 +1019,5 @@ n(c), r && clearTimeout(o.current), o.current = setTimeout(() => n(e), i); | ||
}, []), [u, s]; | ||
}, Ot = () => L(() => /* @__PURE__ */ new Date(), []), At = (e) => { | ||
}, Ot = () => L(() => /* @__PURE__ */ new Date(), []), At = (e) => (t, r) => e(t).localeCompare(e(r)), Pt = (e) => (t, r) => e(t) - e(r), Dt = (e) => { | ||
throw new Error(`Switch unhandled case: ${e}`); | ||
}, Pt = (e, t) => t, Dt = (e) => Object.keys(e).filter((t) => e[t]), Ht = (e) => { | ||
}, Ht = (e, t) => t, zt = (e) => Object.keys(e).filter((t) => e[t]), Ft = (e) => { | ||
try { | ||
@@ -1028,3 +1028,3 @@ const t = parseFloat(e); | ||
} | ||
}, zt = (e) => { | ||
}, Nt = (e) => { | ||
try { | ||
@@ -1036,3 +1036,3 @@ const t = parseInt(e, 10); | ||
}; | ||
function Ft(e, t) { | ||
function Ut(e, t) { | ||
if (e == null) | ||
@@ -1048,3 +1048,3 @@ throw new Error("Invariant error: " + t); | ||
it as Indent, | ||
gt as LargeText, | ||
ft as LargeText, | ||
lt as Nest, | ||
@@ -1059,14 +1059,16 @@ ot as ResizeAwareBox, | ||
at as Spacing, | ||
ft as StandardText, | ||
gt as StandardText, | ||
w as Text, | ||
pt as Txt, | ||
x as booleanOrNumberToNumber, | ||
Pt as exhaustSwitchCase, | ||
At as exhaustSwitchCaseElseThrow, | ||
Pt as byNumberField, | ||
At as byStringField, | ||
Ht as exhaustSwitchCase, | ||
Dt as exhaustSwitchCaseElseThrow, | ||
Ee as getDataProps, | ||
we as getDimensionObject, | ||
Ft as invariant, | ||
Ht as parseFloatElseUndefined, | ||
zt as parseIntElseUndefined, | ||
Dt as truthyKeysAsList, | ||
Ut as invariant, | ||
Ft as parseFloatElseUndefined, | ||
Nt as parseIntElseUndefined, | ||
zt as truthyKeysAsList, | ||
vt as useArraySet, | ||
@@ -1073,0 +1075,0 @@ $ as useBoolean, |
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._separatorLine_nzfcz_1{display:flex;border:0;margin:0;flex:none}._visuallyHidden_1gevf_1{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}._text_1iisw_1{--swui-text-color: var(--swui-text-primary-color);--swui-text-color-caption: var(--lhds-color-ui-600);--swui-text-color-overline: var(--lhds-color-ui-600);--swui-text-font-family: var(--swui-font-primary);--swui-text-font-weight: var(--swui-font-weight-text);--current-color: var(--swui-text-color);--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium);--current-font-weight: var(--swui-text-font-weight);--current-letter-spacing: var(--swui-text-letter-spacing);font-size:var(--current-font-size);line-height:var(--current-line-height);color:var(--current-color);letter-spacing:var(--current-letter-spacing);font-family:var(--swui-text-font-family);font-weight:var(--current-font-weight)}._text_1iisw_1._bold_1iisw_27{--current-font-weight: var(--swui-font-weight-text-bold)}._text_1iisw_1._caption_1iisw_31{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small);--current-color: var(--swui-text-color-caption);--current-letter-spacing: 0;font-style:italic}._text_1iisw_1._overline_1iisw_39{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller);--current-color: var(--swui-text-color-overline);--current-font-weight: var(--swui-font-weight-text-bold);--current-letter-spacing: .1rem;text-transform:uppercase}._text_1iisw_1._large_1iisw_48{--current-font-size: var(--swui-font-size-large);--current-line-height: var(--swui-line-height-large)}._text_1iisw_1._medium_1iisw_53{--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium)}._text_1iisw_1._small_1iisw_58{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small)}._text_1iisw_1._smaller_1iisw_63{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller)}._heading_1cnsg_1{font-size:2rem;color:var(--swui-text-primary-color);letter-spacing:0;margin:0;line-height:var(--swui-line-height);font-family:var(--swui-font-primary);font-weight:var(--swui-font-weight-text-bold)}._heading_1cnsg_1._h1_1cnsg_10{font-size:2.8rem}._heading_1cnsg_1._h2_1cnsg_14{font-size:2.4rem}._heading_1cnsg_1._h3_1cnsg_18{font-size:2rem}._heading_1cnsg_1._h4_1cnsg_22{font-size:1.8rem}._heading_1cnsg_1._h5_1cnsg_26{font-size:1.6rem}._heading_1cnsg_1._h6_1cnsg_30{font-size:1.4rem}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})(); | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("@stenajs-webui/theme"),l=require("react/jsx-runtime"),n=require("react"),w=require("@emotion/styled"),c=require("styled-system"),k=require("lodash-es"),_=require("classnames"),j="_separatorLine_nzfcz_1",H={separatorLine:j},z=n.forwardRef(({color:e=P.cssColor("--lhds-color-ui-300"),size:t="100%",width:r="1px",vertical:u=!1},s)=>l.jsx("hr",{className:H.separatorLine,"aria-hidden":!0,color:e,style:{backgroundColor:e,height:u?t||"100%":r||"1px",width:u?r||"1px":t||"100%"},ref:s})),F=w.button` | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("@stenajs-webui/theme"),l=require("react/jsx-runtime"),n=require("react"),w=require("@emotion/styled"),c=require("styled-system"),k=require("lodash-es"),_=require("classnames"),F="_separatorLine_nzfcz_1",j={separatorLine:F},H=n.forwardRef(({color:e=P.cssColor("--lhds-color-ui-300"),size:t="100%",width:r="1px",vertical:u=!1},s)=>l.jsx("hr",{className:j.separatorLine,"aria-hidden":!0,color:e,style:{backgroundColor:e,height:u?t||"100%":r||"1px",width:u?r||"1px":t||"100%"},ref:s})),z=w.button` | ||
display: inline-block; | ||
@@ -25,3 +25,3 @@ user-select: none; | ||
${({borderRadius:e})=>e?`border-radius: ${e};`:""} | ||
`,N=n.forwardRef(({disableFocusHighlight:e,onClick:t,onDblClick:r,tooltip:u,disableOpacityOnClick:s,disablePointer:o,opacityOnHover:a,disabled:d,children:i,background:f="transparent",hoverBackground:p,focusBackground:m,type:L="button",...M},A)=>{const D=!!(t||r);return l.jsx(F,{opacityOnHover:a,title:u,disabled:d,disableOpacityOnClick:s,onClick:t,onDoubleClick:r,disableFocusHighlight:e,pointer:D&&!o,ref:A,background:f,hoverBackground:p,focusBackground:m,type:L,...M,children:i})}),y=e=>e==null?0:typeof e=="boolean"?e?1:0:e,q=e=>{if(e!==0)return`calc(${e} * var(--swui-metrics-space))`},E=e=>q(y(e)),U={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,valueLink:!0,abbr:!0,accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allow:!0,allowUserMedia:!0,allowPaymentRequest:!0,allowFullScreen:!0,allowTransparency:!0,alt:!0,async:!0,autoComplete:!0,autoPlay:!0,capture:!0,cellPadding:!0,cellSpacing:!0,challenge:!0,charSet:!0,checked:!0,cite:!0,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:!0,controlsList:!0,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,decoding:!0,default:!0,defer:!0,dir:!0,disabled:!0,disablePictureInPicture:!0,disableRemotePlayback:!0,download:!0,draggable:!0,encType:!0,enterKeyHint:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:!0,high:!0,href:!0,hrefLang:!0,htmlFor:!0,httpEquiv:!0,id:!0,inputMode:!0,integrity:!0,is:!0,keyParams:!0,keyType:!0,kind:!0,label:!0,lang:!0,list:!0,loading:!0,loop:!0,low:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,minLength:!0,multiple:!0,muted:!0,name:!0,nonce:!0,noValidate:!0,open:!0,optimum:!0,pattern:!0,placeholder:!0,playsInline:!0,poster:!0,preload:!0,profile:!0,radioGroup:!0,readOnly:!0,referrerPolicy:!0,rel:!0,required:!0,reversed:!0,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scoped:!0,scrolling:!0,seamless:!0,selected:!0,shape:!0,size:!0,sizes:!0,slot:!0,span:!0,spellCheck:!0,src:!0,srcDoc:!0,srcLang:!0,srcSet:!0,start:!0,step:!0,style:!0,summary:!0,tabIndex:!0,target:!0,title:!0,translate:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,wrap:!0,about:!0,datatype:!0,inlist:!0,prefix:!0,property:!0,resource:!0,typeof:!0,vocab:!0,autoCapitalize:!0,autoCorrect:!0,autoSave:!0,color:!0,incremental:!0,fallback:!0,inert:!0,itemProp:!0,itemScope:!0,itemType:!0,itemID:!0,itemRef:!0,on:!0,option:!0,results:!0,security:!0,unselectable:!0,accentHeight:!0,accumulate:!0,additive:!0,alignmentBaseline:!0,allowReorder:!0,alphabetic:!0,amplitude:!0,arabicForm:!0,ascent:!0,attributeName:!0,attributeType:!0,autoReverse:!0,azimuth:!0,baseFrequency:!0,baselineShift:!0,baseProfile:!0,bbox:!0,begin:!0,bias:!0,by:!0,calcMode:!0,capHeight:!0,clip:!0,clipPathUnits:!0,clipPath:!0,clipRule:!0,colorInterpolation:!0,colorInterpolationFilters:!0,colorProfile:!0,colorRendering:!0,contentScriptType:!0,contentStyleType:!0,cursor:!0,cx:!0,cy:!0,d:!0,decelerate:!0,descent:!0,diffuseConstant:!0,direction:!0,display:!0,divisor:!0,dominantBaseline:!0,dur:!0,dx:!0,dy:!0,edgeMode:!0,elevation:!0,enableBackground:!0,end:!0,exponent:!0,externalResourcesRequired:!0,fill:!0,fillOpacity:!0,fillRule:!0,filter:!0,filterRes:!0,filterUnits:!0,floodColor:!0,floodOpacity:!0,focusable:!0,fontFamily:!0,fontSize:!0,fontSizeAdjust:!0,fontStretch:!0,fontStyle:!0,fontVariant:!0,fontWeight:!0,format:!0,from:!0,fr:!0,fx:!0,fy:!0,g1:!0,g2:!0,glyphName:!0,glyphOrientationHorizontal:!0,glyphOrientationVertical:!0,glyphRef:!0,gradientTransform:!0,gradientUnits:!0,hanging:!0,horizAdvX:!0,horizOriginX:!0,ideographic:!0,imageRendering:!0,in:!0,in2:!0,intercept:!0,k:!0,k1:!0,k2:!0,k3:!0,k4:!0,kernelMatrix:!0,kernelUnitLength:!0,kerning:!0,keyPoints:!0,keySplines:!0,keyTimes:!0,lengthAdjust:!0,letterSpacing:!0,lightingColor:!0,limitingConeAngle:!0,local:!0,markerEnd:!0,markerMid:!0,markerStart:!0,markerHeight:!0,markerUnits:!0,markerWidth:!0,mask:!0,maskContentUnits:!0,maskUnits:!0,mathematical:!0,mode:!0,numOctaves:!0,offset:!0,opacity:!0,operator:!0,order:!0,orient:!0,orientation:!0,origin:!0,overflow:!0,overlinePosition:!0,overlineThickness:!0,panose1:!0,paintOrder:!0,pathLength:!0,patternContentUnits:!0,patternTransform:!0,patternUnits:!0,pointerEvents:!0,points:!0,pointsAtX:!0,pointsAtY:!0,pointsAtZ:!0,preserveAlpha:!0,preserveAspectRatio:!0,primitiveUnits:!0,r:!0,radius:!0,refX:!0,refY:!0,renderingIntent:!0,repeatCount:!0,repeatDur:!0,requiredExtensions:!0,requiredFeatures:!0,restart:!0,result:!0,rotate:!0,rx:!0,ry:!0,scale:!0,seed:!0,shapeRendering:!0,slope:!0,spacing:!0,specularConstant:!0,specularExponent:!0,speed:!0,spreadMethod:!0,startOffset:!0,stdDeviation:!0,stemh:!0,stemv:!0,stitchTiles:!0,stopColor:!0,stopOpacity:!0,strikethroughPosition:!0,strikethroughThickness:!0,string:!0,stroke:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeLinecap:!0,strokeLinejoin:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,surfaceScale:!0,systemLanguage:!0,tableValues:!0,targetX:!0,targetY:!0,textAnchor:!0,textDecoration:!0,textRendering:!0,textLength:!0,to:!0,transform:!0,u1:!0,u2:!0,underlinePosition:!0,underlineThickness:!0,unicode:!0,unicodeBidi:!0,unicodeRange:!0,unitsPerEm:!0,vAlphabetic:!0,vHanging:!0,vIdeographic:!0,vMathematical:!0,values:!0,vectorEffect:!0,version:!0,vertAdvY:!0,vertOriginX:!0,vertOriginY:!0,viewBox:!0,viewTarget:!0,visibility:!0,widths:!0,wordSpacing:!0,writingMode:!0,x:!0,xHeight:!0,x1:!0,x2:!0,xChannelSelector:!0,xlinkActuate:!0,xlinkArcrole:!0,xlinkHref:!0,xlinkRole:!0,xlinkShow:!0,xlinkTitle:!0,xlinkType:!0,xmlBase:!0,xmlns:!0,xmlnsXlink:!0,xmlLang:!0,xmlSpace:!0,y:!0,y1:!0,y2:!0,yChannelSelector:!0,z:!0,zoomAndPan:!0,for:!0,class:!0,autofocus:!0},V=`^((${Object.keys(U).join("|")})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$`,B=new RegExp(V),W=k.memoize(e=>B.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91),X={box:"var(--swui-shadow-box)",popover:"var(--swui-shadow-popover)",modal:"var(--swui-shadow-modal)",bottom:"var(--swui-shadow-bottom)"},G=["spacing","indent","gap","width","height","overflow","display"],Y=e=>G.includes(e),K=c.system({row:{property:"flexDirection",transform:e=>e?"row":"column"},indent:{property:"--current-indent",transform:y},spacing:{property:"--current-spacing",transform:y},gap:{property:"--current-gap",transform:y},columnGap:{property:"columnGap",transform:E},rowGap:{property:"rowGap",transform:E},shadow:{property:"boxShadow",transform:e=>X[e]??e}}),g=w("div",{shouldForwardProp:e=>typeof e=="string"?Y(e)?!1:W(e):!1})` | ||
`,N=n.forwardRef(({disableFocusHighlight:e,onClick:t,onDblClick:r,tooltip:u,disableOpacityOnClick:s,disablePointer:o,opacityOnHover:i,disabled:d,children:a,background:f="transparent",hoverBackground:p,focusBackground:m,type:L="button",...M},A)=>{const D=!!(t||r);return l.jsx(z,{opacityOnHover:i,title:u,disabled:d,disableOpacityOnClick:s,onClick:t,onDoubleClick:r,disableFocusHighlight:e,pointer:D&&!o,ref:A,background:f,hoverBackground:p,focusBackground:m,type:L,...M,children:a})}),y=e=>e==null?0:typeof e=="boolean"?e?1:0:e,q=e=>{if(e!==0)return`calc(${e} * var(--swui-metrics-space))`},S=e=>q(y(e)),U={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,valueLink:!0,abbr:!0,accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allow:!0,allowUserMedia:!0,allowPaymentRequest:!0,allowFullScreen:!0,allowTransparency:!0,alt:!0,async:!0,autoComplete:!0,autoPlay:!0,capture:!0,cellPadding:!0,cellSpacing:!0,challenge:!0,charSet:!0,checked:!0,cite:!0,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:!0,controlsList:!0,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,decoding:!0,default:!0,defer:!0,dir:!0,disabled:!0,disablePictureInPicture:!0,disableRemotePlayback:!0,download:!0,draggable:!0,encType:!0,enterKeyHint:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:!0,high:!0,href:!0,hrefLang:!0,htmlFor:!0,httpEquiv:!0,id:!0,inputMode:!0,integrity:!0,is:!0,keyParams:!0,keyType:!0,kind:!0,label:!0,lang:!0,list:!0,loading:!0,loop:!0,low:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,minLength:!0,multiple:!0,muted:!0,name:!0,nonce:!0,noValidate:!0,open:!0,optimum:!0,pattern:!0,placeholder:!0,playsInline:!0,poster:!0,preload:!0,profile:!0,radioGroup:!0,readOnly:!0,referrerPolicy:!0,rel:!0,required:!0,reversed:!0,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scoped:!0,scrolling:!0,seamless:!0,selected:!0,shape:!0,size:!0,sizes:!0,slot:!0,span:!0,spellCheck:!0,src:!0,srcDoc:!0,srcLang:!0,srcSet:!0,start:!0,step:!0,style:!0,summary:!0,tabIndex:!0,target:!0,title:!0,translate:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,wrap:!0,about:!0,datatype:!0,inlist:!0,prefix:!0,property:!0,resource:!0,typeof:!0,vocab:!0,autoCapitalize:!0,autoCorrect:!0,autoSave:!0,color:!0,incremental:!0,fallback:!0,inert:!0,itemProp:!0,itemScope:!0,itemType:!0,itemID:!0,itemRef:!0,on:!0,option:!0,results:!0,security:!0,unselectable:!0,accentHeight:!0,accumulate:!0,additive:!0,alignmentBaseline:!0,allowReorder:!0,alphabetic:!0,amplitude:!0,arabicForm:!0,ascent:!0,attributeName:!0,attributeType:!0,autoReverse:!0,azimuth:!0,baseFrequency:!0,baselineShift:!0,baseProfile:!0,bbox:!0,begin:!0,bias:!0,by:!0,calcMode:!0,capHeight:!0,clip:!0,clipPathUnits:!0,clipPath:!0,clipRule:!0,colorInterpolation:!0,colorInterpolationFilters:!0,colorProfile:!0,colorRendering:!0,contentScriptType:!0,contentStyleType:!0,cursor:!0,cx:!0,cy:!0,d:!0,decelerate:!0,descent:!0,diffuseConstant:!0,direction:!0,display:!0,divisor:!0,dominantBaseline:!0,dur:!0,dx:!0,dy:!0,edgeMode:!0,elevation:!0,enableBackground:!0,end:!0,exponent:!0,externalResourcesRequired:!0,fill:!0,fillOpacity:!0,fillRule:!0,filter:!0,filterRes:!0,filterUnits:!0,floodColor:!0,floodOpacity:!0,focusable:!0,fontFamily:!0,fontSize:!0,fontSizeAdjust:!0,fontStretch:!0,fontStyle:!0,fontVariant:!0,fontWeight:!0,format:!0,from:!0,fr:!0,fx:!0,fy:!0,g1:!0,g2:!0,glyphName:!0,glyphOrientationHorizontal:!0,glyphOrientationVertical:!0,glyphRef:!0,gradientTransform:!0,gradientUnits:!0,hanging:!0,horizAdvX:!0,horizOriginX:!0,ideographic:!0,imageRendering:!0,in:!0,in2:!0,intercept:!0,k:!0,k1:!0,k2:!0,k3:!0,k4:!0,kernelMatrix:!0,kernelUnitLength:!0,kerning:!0,keyPoints:!0,keySplines:!0,keyTimes:!0,lengthAdjust:!0,letterSpacing:!0,lightingColor:!0,limitingConeAngle:!0,local:!0,markerEnd:!0,markerMid:!0,markerStart:!0,markerHeight:!0,markerUnits:!0,markerWidth:!0,mask:!0,maskContentUnits:!0,maskUnits:!0,mathematical:!0,mode:!0,numOctaves:!0,offset:!0,opacity:!0,operator:!0,order:!0,orient:!0,orientation:!0,origin:!0,overflow:!0,overlinePosition:!0,overlineThickness:!0,panose1:!0,paintOrder:!0,pathLength:!0,patternContentUnits:!0,patternTransform:!0,patternUnits:!0,pointerEvents:!0,points:!0,pointsAtX:!0,pointsAtY:!0,pointsAtZ:!0,preserveAlpha:!0,preserveAspectRatio:!0,primitiveUnits:!0,r:!0,radius:!0,refX:!0,refY:!0,renderingIntent:!0,repeatCount:!0,repeatDur:!0,requiredExtensions:!0,requiredFeatures:!0,restart:!0,result:!0,rotate:!0,rx:!0,ry:!0,scale:!0,seed:!0,shapeRendering:!0,slope:!0,spacing:!0,specularConstant:!0,specularExponent:!0,speed:!0,spreadMethod:!0,startOffset:!0,stdDeviation:!0,stemh:!0,stemv:!0,stitchTiles:!0,stopColor:!0,stopOpacity:!0,strikethroughPosition:!0,strikethroughThickness:!0,string:!0,stroke:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeLinecap:!0,strokeLinejoin:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,surfaceScale:!0,systemLanguage:!0,tableValues:!0,targetX:!0,targetY:!0,textAnchor:!0,textDecoration:!0,textRendering:!0,textLength:!0,to:!0,transform:!0,u1:!0,u2:!0,underlinePosition:!0,underlineThickness:!0,unicode:!0,unicodeBidi:!0,unicodeRange:!0,unitsPerEm:!0,vAlphabetic:!0,vHanging:!0,vIdeographic:!0,vMathematical:!0,values:!0,vectorEffect:!0,version:!0,vertAdvY:!0,vertOriginX:!0,vertOriginY:!0,viewBox:!0,viewTarget:!0,visibility:!0,widths:!0,wordSpacing:!0,writingMode:!0,x:!0,xHeight:!0,x1:!0,x2:!0,xChannelSelector:!0,xlinkActuate:!0,xlinkArcrole:!0,xlinkHref:!0,xlinkRole:!0,xlinkShow:!0,xlinkTitle:!0,xlinkType:!0,xmlBase:!0,xmlns:!0,xmlnsXlink:!0,xmlLang:!0,xmlSpace:!0,y:!0,y1:!0,y2:!0,yChannelSelector:!0,z:!0,zoomAndPan:!0,for:!0,class:!0,autofocus:!0},V=`^((${Object.keys(U).join("|")})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$`,B=new RegExp(V),W=k.memoize(e=>B.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91),X={box:"var(--swui-shadow-box)",popover:"var(--swui-shadow-popover)",modal:"var(--swui-shadow-modal)",bottom:"var(--swui-shadow-bottom)"},G=["spacing","indent","gap","width","height","overflow","display"],Y=e=>G.includes(e),K=c.system({row:{property:"flexDirection",transform:e=>e?"row":"column"},indent:{property:"--current-indent",transform:y},spacing:{property:"--current-spacing",transform:y},gap:{property:"--current-gap",transform:y},columnGap:{property:"columnGap",transform:S},rowGap:{property:"rowGap",transform:S},shadow:{property:"boxShadow",transform:e=>X[e]??e}}),g=w("div",{shouldForwardProp:e=>typeof e=="string"?Y(e)?!1:W(e):!1})` | ||
--current-spacing: 0; | ||
@@ -74,3 +74,3 @@ --current-indent: 0; | ||
} | ||
`,Z=n.forwardRef(function(t,r){return l.jsx(g,{ref:r,...t})}),$=e=>{const{x:t,y:r,width:u,height:s,bottom:o,top:a,left:d,right:i}=e.getBoundingClientRect();return{width:u,height:s,top:a,left:d,x:t,y:r,right:i,bottom:o}},J=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height&&e.bottom===t.bottom&&e.top===t.top&&e.left===t.left&&e.right===t.right,R=(e,t)=>{const[r,u]=n.useState(),s=n.useCallback(()=>{window.requestAnimationFrame(()=>{if(e.current){const o=$(e.current);(!r||!J(r,o))&&t&&t(o),u(o)}})},[e,r,u,t]);return n.useLayoutEffect(()=>{s()},[s]),{dimensions:r}},Q=n.forwardRef(function({onResize:t,...r},u){const s=n.useRef(null);return R(u??s,t),l.jsx(g,{...r,ref:u})}),ee=n.forwardRef(function(t,r){return l.jsx(g,{row:!0,ref:r,...t})}),te=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{indent:t,ref:u,...r})}),re=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{spacing:t,ref:u,...r})}),ue=w.div` | ||
`,Z=n.forwardRef(function(t,r){return l.jsx(g,{ref:r,...t})}),$=e=>{const{x:t,y:r,width:u,height:s,bottom:o,top:i,left:d,right:a}=e.getBoundingClientRect();return{width:u,height:s,top:i,left:d,x:t,y:r,right:a,bottom:o}},J=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height&&e.bottom===t.bottom&&e.top===t.top&&e.left===t.left&&e.right===t.right,R=(e,t)=>{const[r,u]=n.useState(),s=n.useCallback(()=>{window.requestAnimationFrame(()=>{if(e.current){const o=$(e.current);(!r||!J(r,o))&&t&&t(o),u(o)}})},[e,r,u,t]);return n.useLayoutEffect(()=>{s()},[s]),{dimensions:r}},Q=n.forwardRef(function({onResize:t,...r},u){const s=n.useRef(null);return R(u??s,t),l.jsx(g,{...r,ref:u})}),ee=n.forwardRef(function(t,r){return l.jsx(g,{row:!0,ref:r,...t})}),te=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{indent:t,ref:u,...r})}),re=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{spacing:t,ref:u,...r})}),ue=w.div` | ||
--current-size: 1; | ||
@@ -80,3 +80,3 @@ flex: none; | ||
height: calc(var(--current-size) * var(--swui-metrics-space)); | ||
`,ne=({half:e=!1,horizontal:t=!1,num:r=1,vertical:u=!1})=>{const s=r*(e?.5:1);return l.jsx(ue,{style:{"--current-size":s,height:t?1:void 0,width:u?1:void 0}})},se=({children:e,nest:t,render:r})=>t?l.jsx(l.Fragment,{children:r(e)}):l.jsx(l.Fragment,{children:e}),oe="_visuallyHidden_1gevf_1",ae={visuallyHidden:oe},I=e=>k.pickBy(e,ie),ie=(e,t)=>ce(t),ce=e=>e.startsWith("data-")||e.startsWith("aria-"),le=({children:e,...t})=>l.jsx("span",{className:ae.visuallyHidden,...I(t),children:e}),de="_text_1iisw_1",fe="_standard_1iisw_24",pe="_bold_1iisw_27",me="_caption_1iisw_31",he="_overline_1iisw_39",ge="_large_1iisw_48",be="_medium_1iisw_53",ye="_small_1iisw_58",xe="_smaller_1iisw_63",v={text:de,standard:fe,bold:pe,caption:me,overline:he,large:ge,medium:be,small:ye,smaller:xe},b=n.forwardRef(({children:e,variant:t="standard",size:r="medium",className:u,color:s,userSelect:o,whiteSpace:a,wordBreak:d,textAlign:i,style:f,...p},m)=>l.jsx("span",{className:_(v.text,v[t],v[r],u),ref:m,style:{color:s,userSelect:o,whiteSpace:a,wordBreak:d,textAlign:i,...f},...p,children:e})),ve=b,we=e=>l.jsx(b,{size:"small",...e}),ke=e=>l.jsx(b,{size:"smaller",...e}),Ee=e=>l.jsx(b,{size:"medium",...e}),Se=e=>l.jsx(b,{size:"large",...e}),Ce="_heading_1cnsg_1",Te="_h1_1cnsg_10",_e="_h2_1cnsg_14",$e="_h3_1cnsg_18",Re="_h4_1cnsg_22",Ie="_h5_1cnsg_26",Oe="_h6_1cnsg_30",S={heading:Ce,h1:Te,h2:_e,h3:$e,h4:Re,h5:Ie,h6:Oe},O=n.forwardRef(({variant:e="h3",className:t,color:r,whiteSpace:u,wordBreak:s,style:o,children:a,as:d,...i},f)=>{const p=d??e;return l.jsx(p,{className:_(S.heading,S[e],t),style:{color:r,whiteSpace:u,wordBreak:s,...o},ref:f,...i,children:a})}),Le=e=>l.jsx(O,{variant:"h2",...e}),Me=(e,t)=>e===t,Ae=(e,t,r=Me)=>{const u=n.useCallback(i=>{e.some(f=>r(f,i))||t([...e,i])},[e,t,r]),s=n.useCallback(i=>{t(i.reduce((f,p)=>f.some(m=>r(m,p))?f:[...f,p],e))},[e,t,r]),o=n.useCallback(i=>{const f=e.findIndex(p=>r(p,i));f>=0&&t(e.filter((p,m)=>m!==f))},[e,t,r]),a=n.useCallback(i=>{t(e.filter(f=>!i.some(p=>r(p,f))))},[e,t,r]),d=n.useCallback(i=>{e.some(p=>r(p,i))?o(i):u(i)},[e,u,o,r]);return{add:u,addMultiple:s,remove:o,removeMultiple:a,toggle:d}},x=e=>{const[t,r]=n.useState(e),u=n.useCallback(()=>{r(!0)},[r]),s=n.useCallback(()=>{r(!1)},[r]),o=n.useCallback(()=>{r(a=>!a)},[r]);return[t,u,s,o]},De=(e,t)=>{const[r,u]=n.useState(e);return n.useEffect(()=>{const s=setTimeout(()=>{u(e)},t);return()=>{clearTimeout(s)}},[e,t]),r},Pe=(e,t)=>{const[r,u]=n.useState(e);return n.useEffect(()=>{e&&u(!0);const s=setTimeout(()=>{e||u(e)},t);return()=>{clearTimeout(s)}},[e,t]),r};let je=0;const C=e=>`webui-${e?e+"-":""}${++je}`,He=e=>{const[t,r]=n.useState(()=>C(e));return n.useEffect(()=>r(C(e)),[e]),t},h=(e,t,r)=>{const u=n.useRef(null);n.useEffect(()=>{u.current=r},[r]),n.useEffect(()=>{if(!(e.current&&e.current.addEventListener))return;const o=d=>{if(u.current)return u.current(d)};if(!e.current)return;const a=e.current;return a.addEventListener(t,o),()=>{a&&a.removeEventListener(t,o)}},[t,e])},ze=e=>{const[t,r,u]=x(!1);n.useEffect(()=>{document.activeElement===e.current?r():u()},[e,u,r]),h(e,"focus",r),h(e,"blur",u);const s=n.useCallback(()=>{e.current&&e.current.focus()},[e]),o=n.useCallback(()=>{e.current&&e.current.blur()},[e]);return{isInFocus:t,focus:s,blur:o}},Fe=e=>{const t=n.useRef(e);return n.useLayoutEffect(()=>{t.current=e}),n.useCallback((...r)=>{const{current:u}=t;return u(...r)},[])},Ne=e=>{const t=n.useRef(e);return t.current=e,t},qe=e=>{const[t,r,u]=x(!1);return h(e,"mouseover",r),h(e,"mouseout",u),t},Ue=e=>{const[t,r,u]=x(!1);return h(e,"mouseenter",r),h(e,"mouseleave",u),t},Ve=(e,t)=>{const r=n.useRef(()=>{});n.useEffect(()=>{r.current=t},[t]),n.useEffect(()=>{const u=s=>{e.filter(a=>a.current).every(a=>a.current&&!a.current.contains(s.target))&&r.current(s)};return document.addEventListener("mousedown",u),document.addEventListener("touchstart",u),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("touchstart",u)}},[...e])},Be=(e,t,r)=>{const u=n.useRef(()=>{});n.useEffect(()=>{u.current=t},[t]),n.useEffect(()=>{const s=o=>{!e.current||e.current.contains(o.target)||u.current(o)};return document.addEventListener("mousedown",s,r),document.addEventListener("touchstart",s,r),()=>{document.removeEventListener("mousedown",s,r),document.removeEventListener("touchstart",s,r)}},[e,r])},T=["mousemove","mousedown","keydown","touchstart","scroll"],We=(e,t)=>{const r=n.useRef(()=>{});n.useEffect(()=>{r.current=e},[e]),n.useEffect(()=>{const u=k.debounce(r.current,t);return T.forEach(s=>window.addEventListener(s,u)),()=>{T.forEach(s=>window.removeEventListener(s,u))}},[t])},Xe=(e,t)=>{const[r,u]=n.useState(!1),{rootMargin:s,root:o,threshold:a}=t||{},d=n.useMemo(()=>new IntersectionObserver(([i])=>u(i.isIntersecting),{rootMargin:s,root:o,threshold:a}),[u,s,o,a]);return n.useEffect(()=>(e.current&&d.observe(e.current),()=>{d.disconnect()}),[d,e]),r},Ge=e=>{const t=n.useRef(null);return n.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t},Ye=(e,t,r=!0)=>{const[u,s]=n.useState(e),o=n.useRef(null),a=n.useCallback((d,i=t)=>{s(d),r&&clearTimeout(o.current),o.current=setTimeout(()=>s(e),i)},[t,r,e]);return n.useEffect(()=>()=>{clearTimeout(o.current)},[]),[u,a]},Ke=()=>n.useMemo(()=>new Date,[]),Ze=e=>{throw new Error(`Switch unhandled case: ${e}`)},Je=(e,t)=>t,Qe=e=>Object.keys(e).filter(t=>e[t]),et=e=>{try{const t=parseFloat(e);return isNaN(t)||t==null?void 0:t}catch{}},tt=e=>{try{const t=parseInt(e,10);return isNaN(t)||t==null?void 0:t}catch{}};function rt(e,t){if(e==null)throw new Error("Invariant error: "+t)}exports.Box=g;exports.Clickable=N;exports.Column=Z;exports.HeaderText=Le;exports.Heading=O;exports.Indent=te;exports.LargeText=Se;exports.Nest=se;exports.ResizeAwareBox=Q;exports.Row=ee;exports.ScreenReaderOnlyText=le;exports.SeparatorLine=z;exports.SmallText=we;exports.SmallerText=ke;exports.Space=ne;exports.Spacing=re;exports.StandardText=Ee;exports.Text=b;exports.Txt=ve;exports.booleanOrNumberToNumber=y;exports.exhaustSwitchCase=Je;exports.exhaustSwitchCaseElseThrow=Ze;exports.getDataProps=I;exports.getDimensionObject=$;exports.invariant=rt;exports.parseFloatElseUndefined=et;exports.parseIntElseUndefined=tt;exports.truthyKeysAsList=Qe;exports.useArraySet=Ae;exports.useBoolean=x;exports.useDebounce=De;exports.useDelayedFalse=Pe;exports.useDomId=He;exports.useElementDimensions=R;exports.useElementFocus=ze;exports.useEventCallback=Fe;exports.useEventListener=h;exports.useForwardedRef=Ge;exports.useLatest=Ne;exports.useMouseIsEntered=Ue;exports.useMouseIsOver=qe;exports.useMultiOnClickOutside=Ve;exports.useOnClickOutside=Be;exports.useOnNoMouseMovement=We;exports.useOnScreen=Xe;exports.useTimeoutState=Ye;exports.useToday=Ke; | ||
`,ne=({half:e=!1,horizontal:t=!1,num:r=1,vertical:u=!1})=>{const s=r*(e?.5:1);return l.jsx(ue,{style:{"--current-size":s,height:t?1:void 0,width:u?1:void 0}})},se=({children:e,nest:t,render:r})=>t?l.jsx(l.Fragment,{children:r(e)}):l.jsx(l.Fragment,{children:e}),oe="_visuallyHidden_1gevf_1",ie={visuallyHidden:oe},I=e=>k.pickBy(e,ae),ae=(e,t)=>ce(t),ce=e=>e.startsWith("data-")||e.startsWith("aria-"),le=({children:e,...t})=>l.jsx("span",{className:ie.visuallyHidden,...I(t),children:e}),de="_text_1iisw_1",fe="_standard_1iisw_24",pe="_bold_1iisw_27",me="_caption_1iisw_31",he="_overline_1iisw_39",ge="_large_1iisw_48",be="_medium_1iisw_53",ye="_small_1iisw_58",xe="_smaller_1iisw_63",v={text:de,standard:fe,bold:pe,caption:me,overline:he,large:ge,medium:be,small:ye,smaller:xe},b=n.forwardRef(({children:e,variant:t="standard",size:r="medium",className:u,color:s,userSelect:o,whiteSpace:i,wordBreak:d,textAlign:a,style:f,...p},m)=>l.jsx("span",{className:_(v.text,v[t],v[r],u),ref:m,style:{color:s,userSelect:o,whiteSpace:i,wordBreak:d,textAlign:a,...f},...p,children:e})),ve=b,we=e=>l.jsx(b,{size:"small",...e}),ke=e=>l.jsx(b,{size:"smaller",...e}),Se=e=>l.jsx(b,{size:"medium",...e}),Ee=e=>l.jsx(b,{size:"large",...e}),Ce="_heading_1cnsg_1",Te="_h1_1cnsg_10",_e="_h2_1cnsg_14",$e="_h3_1cnsg_18",Re="_h4_1cnsg_22",Ie="_h5_1cnsg_26",Oe="_h6_1cnsg_30",E={heading:Ce,h1:Te,h2:_e,h3:$e,h4:Re,h5:Ie,h6:Oe},O=n.forwardRef(({variant:e="h3",className:t,color:r,whiteSpace:u,wordBreak:s,style:o,children:i,as:d,...a},f)=>{const p=d??e;return l.jsx(p,{className:_(E.heading,E[e],t),style:{color:r,whiteSpace:u,wordBreak:s,...o},ref:f,...a,children:i})}),Le=e=>l.jsx(O,{variant:"h2",...e}),Me=(e,t)=>e===t,Ae=(e,t,r=Me)=>{const u=n.useCallback(a=>{e.some(f=>r(f,a))||t([...e,a])},[e,t,r]),s=n.useCallback(a=>{t(a.reduce((f,p)=>f.some(m=>r(m,p))?f:[...f,p],e))},[e,t,r]),o=n.useCallback(a=>{const f=e.findIndex(p=>r(p,a));f>=0&&t(e.filter((p,m)=>m!==f))},[e,t,r]),i=n.useCallback(a=>{t(e.filter(f=>!a.some(p=>r(p,f))))},[e,t,r]),d=n.useCallback(a=>{e.some(p=>r(p,a))?o(a):u(a)},[e,u,o,r]);return{add:u,addMultiple:s,remove:o,removeMultiple:i,toggle:d}},x=e=>{const[t,r]=n.useState(e),u=n.useCallback(()=>{r(!0)},[r]),s=n.useCallback(()=>{r(!1)},[r]),o=n.useCallback(()=>{r(i=>!i)},[r]);return[t,u,s,o]},De=(e,t)=>{const[r,u]=n.useState(e);return n.useEffect(()=>{const s=setTimeout(()=>{u(e)},t);return()=>{clearTimeout(s)}},[e,t]),r},Pe=(e,t)=>{const[r,u]=n.useState(e);return n.useEffect(()=>{e&&u(!0);const s=setTimeout(()=>{e||u(e)},t);return()=>{clearTimeout(s)}},[e,t]),r};let Fe=0;const C=e=>`webui-${e?e+"-":""}${++Fe}`,je=e=>{const[t,r]=n.useState(()=>C(e));return n.useEffect(()=>r(C(e)),[e]),t},h=(e,t,r)=>{const u=n.useRef(null);n.useEffect(()=>{u.current=r},[r]),n.useEffect(()=>{if(!(e.current&&e.current.addEventListener))return;const o=d=>{if(u.current)return u.current(d)};if(!e.current)return;const i=e.current;return i.addEventListener(t,o),()=>{i&&i.removeEventListener(t,o)}},[t,e])},He=e=>{const[t,r,u]=x(!1);n.useEffect(()=>{document.activeElement===e.current?r():u()},[e,u,r]),h(e,"focus",r),h(e,"blur",u);const s=n.useCallback(()=>{e.current&&e.current.focus()},[e]),o=n.useCallback(()=>{e.current&&e.current.blur()},[e]);return{isInFocus:t,focus:s,blur:o}},ze=e=>{const t=n.useRef(e);return n.useLayoutEffect(()=>{t.current=e}),n.useCallback((...r)=>{const{current:u}=t;return u(...r)},[])},Ne=e=>{const t=n.useRef(e);return t.current=e,t},qe=e=>{const[t,r,u]=x(!1);return h(e,"mouseover",r),h(e,"mouseout",u),t},Ue=e=>{const[t,r,u]=x(!1);return h(e,"mouseenter",r),h(e,"mouseleave",u),t},Ve=(e,t)=>{const r=n.useRef(()=>{});n.useEffect(()=>{r.current=t},[t]),n.useEffect(()=>{const u=s=>{e.filter(i=>i.current).every(i=>i.current&&!i.current.contains(s.target))&&r.current(s)};return document.addEventListener("mousedown",u),document.addEventListener("touchstart",u),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("touchstart",u)}},[...e])},Be=(e,t,r)=>{const u=n.useRef(()=>{});n.useEffect(()=>{u.current=t},[t]),n.useEffect(()=>{const s=o=>{!e.current||e.current.contains(o.target)||u.current(o)};return document.addEventListener("mousedown",s,r),document.addEventListener("touchstart",s,r),()=>{document.removeEventListener("mousedown",s,r),document.removeEventListener("touchstart",s,r)}},[e,r])},T=["mousemove","mousedown","keydown","touchstart","scroll"],We=(e,t)=>{const r=n.useRef(()=>{});n.useEffect(()=>{r.current=e},[e]),n.useEffect(()=>{const u=k.debounce(r.current,t);return T.forEach(s=>window.addEventListener(s,u)),()=>{T.forEach(s=>window.removeEventListener(s,u))}},[t])},Xe=(e,t)=>{const[r,u]=n.useState(!1),{rootMargin:s,root:o,threshold:i}=t||{},d=n.useMemo(()=>new IntersectionObserver(([a])=>u(a.isIntersecting),{rootMargin:s,root:o,threshold:i}),[u,s,o,i]);return n.useEffect(()=>(e.current&&d.observe(e.current),()=>{d.disconnect()}),[d,e]),r},Ge=e=>{const t=n.useRef(null);return n.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t},Ye=(e,t,r=!0)=>{const[u,s]=n.useState(e),o=n.useRef(null),i=n.useCallback((d,a=t)=>{s(d),r&&clearTimeout(o.current),o.current=setTimeout(()=>s(e),a)},[t,r,e]);return n.useEffect(()=>()=>{clearTimeout(o.current)},[]),[u,i]},Ke=()=>n.useMemo(()=>new Date,[]),Ze=e=>(t,r)=>e(t).localeCompare(e(r)),Je=e=>(t,r)=>e(t)-e(r),Qe=e=>{throw new Error(`Switch unhandled case: ${e}`)},et=(e,t)=>t,tt=e=>Object.keys(e).filter(t=>e[t]),rt=e=>{try{const t=parseFloat(e);return isNaN(t)||t==null?void 0:t}catch{}},ut=e=>{try{const t=parseInt(e,10);return isNaN(t)||t==null?void 0:t}catch{}};function nt(e,t){if(e==null)throw new Error("Invariant error: "+t)}exports.Box=g;exports.Clickable=N;exports.Column=Z;exports.HeaderText=Le;exports.Heading=O;exports.Indent=te;exports.LargeText=Ee;exports.Nest=se;exports.ResizeAwareBox=Q;exports.Row=ee;exports.ScreenReaderOnlyText=le;exports.SeparatorLine=H;exports.SmallText=we;exports.SmallerText=ke;exports.Space=ne;exports.Spacing=re;exports.StandardText=Se;exports.Text=b;exports.Txt=ve;exports.booleanOrNumberToNumber=y;exports.byNumberField=Je;exports.byStringField=Ze;exports.exhaustSwitchCase=et;exports.exhaustSwitchCaseElseThrow=Qe;exports.getDataProps=I;exports.getDimensionObject=$;exports.invariant=nt;exports.parseFloatElseUndefined=rt;exports.parseIntElseUndefined=ut;exports.truthyKeysAsList=tt;exports.useArraySet=Ae;exports.useBoolean=x;exports.useDebounce=De;exports.useDelayedFalse=Pe;exports.useDomId=je;exports.useElementDimensions=R;exports.useElementFocus=He;exports.useEventCallback=ze;exports.useEventListener=h;exports.useForwardedRef=Ge;exports.useLatest=Ne;exports.useMouseIsEntered=Ue;exports.useMouseIsOver=qe;exports.useMultiOnClickOutside=Ve;exports.useOnClickOutside=Be;exports.useOnNoMouseMovement=We;exports.useOnScreen=Xe;exports.useTimeoutState=Ye;exports.useToday=Ke; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@stenajs-webui/core", | ||
"version": "21.29.17", | ||
"version": "21.30.0", | ||
"type": "module", | ||
@@ -64,5 +64,5 @@ "description": "", | ||
], | ||
"gitHead": "f175fca01d4ee153d22727ab70a55ffd4111ff0c", | ||
"gitHead": "145ccd79af4bf53142122a94afa91d450f8c999e", | ||
"dependencies": { | ||
"@stenajs-webui/theme": "21.29.17", | ||
"@stenajs-webui/theme": "21.30.0", | ||
"classnames": "^2.5.1", | ||
@@ -69,0 +69,0 @@ "lodash-es": "^4.17.21" |
@@ -17,7 +17,7 @@ # stenajs-webui/core | ||
* Column (same as Box, content is placed in a column) | ||
* Row (same as Box, content is placed in a row) | ||
* [Indent](src/components/layout/indent/Indent.md) | ||
* [Space](src/components/layout/space/Space.md) | ||
* [Spacing](src/components/layout/spacing/Spacing.md) | ||
- Column (same as Box, content is placed in a column) | ||
- Row (same as Box, content is placed in a row) | ||
- [Indent](src/components/layout/indent/Indent.md) | ||
- [Space](src/components/layout/space/Space.md) | ||
- [Spacing](src/components/layout/spacing/Spacing.md) | ||
@@ -36,1 +36,17 @@ ### Interaction | ||
See [`src/hooks/README.md`](src/hooks/README.md) for details. | ||
## Comparators | ||
There are a few comparators that can be used to sort arrays of objects. | ||
- byStringField | ||
- byNumberField | ||
``` | ||
const r = users | ||
.filter((user) => user.age > 17) | ||
.toSorted(byStringField((i) => i.name)) | ||
.toReversed() | ||
.map((p) => `${p.firstName} ${p.lastName}`) | ||
.join(", "); | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
216532
0.87%58
1.75%1677
0.3%51
45.71%