New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@stenajs-webui/core

Package Overview
Dependencies
Maintainers
0
Versions
480
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stenajs-webui/core - npm Package Compare versions

Comparing version 21.16.6 to 21.16.7

dist/hooks/UseToday.d.ts

1

dist/index.d.ts

@@ -42,2 +42,3 @@ import "@stenajs-webui/theme";

export * from "./hooks/UseTimeoutState";
export * from "./hooks/UseToday";
export * from "./utils/SwitchCaseExhauster";

@@ -44,0 +45,0 @@ export * from "./utils/TruthyKeysAsList";

53

dist/index.es.js
(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 A } from "@stenajs-webui/theme";
import { cssColor as P } from "@stenajs-webui/theme";
import { jsx as a, Fragment as S } from "react/jsx-runtime";
import P, { forwardRef as h, useState as f, useCallback as m, useLayoutEffect as D, useRef as v, useEffect as d, useMemo as H } from "react";
import D, { forwardRef as h, useState as f, useCallback as m, useLayoutEffect as H, useRef as v, useEffect as d, useMemo as R } from "react";
import _ from "@emotion/styled";
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";
import { memoize as oe, pickBy as se, debounce as ie } from "lodash-es";
import R from "classnames";
import L from "classnames";
import * as ae from "react-dom";

@@ -14,3 +14,3 @@ const ce = "_separatorLine_nzfcz_1", le = {

({
color: e = A("--lhds-color-ui-300"),
color: e = P("--lhds-color-ui-300"),
size: t = "100%",

@@ -70,5 +70,5 @@ width: r = "1px",

focusBackground: g,
type: L = "button",
...M
}, O) => /* @__PURE__ */ a(
type: M = "button",
...O
}, A) => /* @__PURE__ */ a(
de,

@@ -84,8 +84,8 @@ {

pointer: !!(t || r) && !o,
ref: O,
ref: A,
background: l,
hoverBackground: p,
focusBackground: g,
type: L,
...M,
type: M,
...O,
children: i

@@ -708,3 +708,3 @@ }

}, [e, r, u, t]);
return D(() => {
return H(() => {
n();

@@ -782,3 +782,3 @@ }, [n]), {

{
className: R(k.text, k[t], k[r], u),
className: L(k.text, k[t], k[r], u),
ref: g,

@@ -819,3 +819,3 @@ style: {

{
className: R(T.heading, T[e], t),
className: L(T.heading, T[e], t),
style: { color: r, whiteSpace: u, wordBreak: n, ...o },

@@ -928,3 +928,3 @@ ref: l,

}, $t = (e) => {
const t = P.useRef(e);
const t = D.useRef(e);
return t.current = e, t;

@@ -977,3 +977,3 @@ }, St = (e) => {

}, Rt = (e, t) => {
const [r, u] = f(!1), { rootMargin: n, root: o, threshold: s } = t || {}, c = H(() => new IntersectionObserver(
const [r, u] = f(!1), { rootMargin: n, root: o, threshold: s } = t || {}, c = R(() => new IntersectionObserver(
([i]) => u(i.isIntersecting),

@@ -1004,5 +1004,5 @@ {

}, []), [u, s];
}, Ot = (e) => {
}, Ot = () => R(() => /* @__PURE__ */ new Date(), []), At = (e) => {
throw new Error(`Switch unhandled case: ${e}`);
}, At = (e, t) => t, Pt = (e) => Object.keys(e).filter((t) => e[t]), Dt = (e) => {
}, Pt = (e, t) => t, Dt = (e) => Object.keys(e).filter((t) => e[t]), Ht = (e) => {
try {

@@ -1013,3 +1013,3 @@ const t = parseFloat(e);

}
}, Ht = (e) => {
}, zt = (e) => {
try {

@@ -1021,3 +1021,3 @@ const t = parseInt(e, 10);

};
function zt(e, t) {
function Ft(e, t) {
if (e == null)

@@ -1047,10 +1047,10 @@ throw new Error("Invariant error: " + t);

x as booleanOrNumberToNumber,
At as exhaustSwitchCase,
Ot as exhaustSwitchCaseElseThrow,
Pt as exhaustSwitchCase,
At as exhaustSwitchCaseElseThrow,
Te as getDataProps,
xe as getDimensionObject,
zt as invariant,
Dt as parseFloatElseUndefined,
Ht as parseIntElseUndefined,
Pt as truthyKeysAsList,
Ft as invariant,
Ht as parseFloatElseUndefined,
zt as parseIntElseUndefined,
Dt as truthyKeysAsList,
bt as useArraySet,

@@ -1072,4 +1072,5 @@ $ as useBoolean,

Rt as useOnScreen,
Mt as useTimeoutState
Mt as useTimeoutState,
Ot as useToday
};
//# sourceMappingURL=index.es.js.map
(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"),R=require("classnames"),A=require("react-dom");function z(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const u=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,u.get?u:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const H=z(A),F="_separatorLine_nzfcz_1",N={separatorLine:F},q=n.forwardRef(({color:e=P.cssColor("--lhds-color-ui-300"),size:t="100%",width:r="1px",vertical:u=!1},s)=>l.jsx("hr",{className:N.separatorLine,"aria-hidden":!0,color:e,style:{backgroundColor:e,height:u?t||"100%":r||"1px",width:u?r||"1px":t||"100%"},ref:s})),U=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"),C=require("classnames"),A=require("react-dom");function z(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const u=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,u.get?u:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const H=z(A),F="_separatorLine_nzfcz_1",N={separatorLine:F},q=n.forwardRef(({color:e=P.cssColor("--lhds-color-ui-300"),size:t="100%",width:r="1px",vertical:u=!1},s)=>l.jsx("hr",{className:N.separatorLine,"aria-hidden":!0,color:e,style:{backgroundColor:e,height:u?t||"100%":r||"1px",width:u?r||"1px":t||"100%"},ref:s})),U=w.button`
display: inline-block;

@@ -73,3 +73,3 @@ user-select: none;

}
`,ee=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}},te=(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,T=(e,t)=>{const[r,u]=n.useState(),s=n.useCallback(()=>{window.requestAnimationFrame(()=>{if(e.current){const o=$(e.current);(!r||!te(r,o))&&t&&t(o),u(o)}})},[e,r,u,t]);return n.useLayoutEffect(()=>{s()},[s]),{dimensions:r}},re=n.forwardRef(function({onResize:t,...r},u){const s=n.useRef(null);return T(u??s,t),l.jsx(g,{...r,ref:u})}),ue=n.forwardRef(function(t,r){return l.jsx(g,{row:!0,ref:r,...t})}),ne=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{indent:t,ref:u,...r})}),se=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{spacing:t,ref:u,...r})}),oe=w.div`
`,ee=n.forwardRef(function(t,r){return l.jsx(g,{ref:r,...t})}),R=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}},te=(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,$=(e,t)=>{const[r,u]=n.useState(),s=n.useCallback(()=>{window.requestAnimationFrame(()=>{if(e.current){const o=R(e.current);(!r||!te(r,o))&&t&&t(o),u(o)}})},[e,r,u,t]);return n.useLayoutEffect(()=>{s()},[s]),{dimensions:r}},re=n.forwardRef(function({onResize:t,...r},u){const s=n.useRef(null);return $(u??s,t),l.jsx(g,{...r,ref:u})}),ue=n.forwardRef(function(t,r){return l.jsx(g,{row:!0,ref:r,...t})}),ne=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{indent:t,ref:u,...r})}),se=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{spacing:t,ref:u,...r})}),oe=w.div`
--current-size: 1;

@@ -79,3 +79,3 @@ flex: none;

height: calc(var(--current-size) * var(--swui-metrics-space));
`,ie=({half:e=!1,horizontal:t=!1,num:r=1,vertical:u=!1})=>{const s=r*(e?.5:1);return l.jsx(oe,{style:{"--current-size":s,height:t?1:void 0,width:u?1:void 0}})},ae=({children:e,nest:t,render:r})=>t?l.jsx(l.Fragment,{children:r(e)}):l.jsx(l.Fragment,{children:e}),ce="_visuallyHidden_1gevf_1",le={visuallyHidden:ce},O=e=>k.pickBy(e,de),de=(e,t)=>fe(t),fe=e=>e.startsWith("data-")||e.startsWith("aria-"),pe=({children:e,...t})=>l.jsx("span",{className:le.visuallyHidden,...O(t),children:e}),me="_text_1iisw_1",he="_standard_1iisw_24",ge="_bold_1iisw_27",be="_caption_1iisw_31",ye="_overline_1iisw_39",ve="_large_1iisw_48",xe="_medium_1iisw_53",we="_small_1iisw_58",ke="_smaller_1iisw_63",x={text:me,standard:he,bold:ge,caption:be,overline:ye,large:ve,medium:xe,small:we,smaller:ke},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:R(x.text,x[t],x[r],u),ref:m,style:{color:s,userSelect:o,whiteSpace:i,wordBreak:d,textAlign:a,...f},...p,children:e})),Se=b,Ee=e=>l.jsx(b,{size:"small",...e}),_e=e=>l.jsx(b,{size:"smaller",...e}),Ce=e=>l.jsx(b,{size:"medium",...e}),Re=e=>l.jsx(b,{size:"large",...e}),$e="_heading_1cnsg_1",Te="_h1_1cnsg_10",Oe="_h2_1cnsg_14",Ie="_h3_1cnsg_18",Me="_h4_1cnsg_22",Le="_h5_1cnsg_26",De="_h6_1cnsg_30",E={heading:$e,h1:Te,h2:Oe,h3:Ie,h4:Me,h5:Le,h6:De},I=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:R(E.heading,E[e],t),style:{color:r,whiteSpace:u,wordBreak:s,...o},ref:f,...a,children:i})}),je=e=>l.jsx(I,{variant:"h2",...e}),Pe=(e,t)=>e===t,Ae=(e,t,r=Pe)=>{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}},v=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]},ze=(e,t)=>{const[r,u]=n.useState(e);return n.useEffect(()=>{const s=setTimeout(()=>{u(e)},t);return()=>{clearTimeout(s)}},[e,t]),r},He=(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 _=e=>`webui-${e?e+"-":""}${++Fe}`,Ne=e=>{const[t,r]=n.useState(()=>_(e));return n.useEffect(()=>r(_(e)),[e]),t},h=(e,t,r)=>{const u=n.useRef();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])},qe=e=>{const[t,r,u]=v(!1);n.useEffect(()=>{document.activeElement===H.findDOMNode(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}},Ue=e=>{const t=n.useRef(e);return t.current=e,t},Ve=e=>{const[t,r,u]=v(!1);return h(e,"mouseover",r),h(e,"mouseout",u),t},Be=e=>{const[t,r,u]=v(!1);return h(e,"mouseenter",r),h(e,"mouseleave",u),t},We=(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])},Xe=(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])},C=["mousemove","mousedown","keydown","touchstart","scroll"],Ge=(e,t)=>{const r=n.useRef(()=>{});n.useEffect(()=>{r.current=e},[e]),n.useEffect(()=>{const u=k.debounce(r.current,t);return C.forEach(s=>window.addEventListener(s,u)),()=>{C.forEach(s=>window.removeEventListener(s,u))}},[t])},Ye=(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},Ke=e=>{const t=n.useRef(null);return n.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t},Ze=(e,t,r=!0)=>{const[u,s]=n.useState(e),o=n.useRef(),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]},Je=e=>{throw new Error(`Switch unhandled case: ${e}`)},Qe=(e,t)=>t,et=e=>Object.keys(e).filter(t=>e[t]),tt=e=>{try{const t=parseFloat(e);return isNaN(t)||t==null?void 0:t}catch{}},rt=e=>{try{const t=parseInt(e,10);return isNaN(t)||t==null?void 0:t}catch{}};function ut(e,t){if(e==null)throw new Error("Invariant error: "+t)}exports.Box=g;exports.Clickable=V;exports.Column=ee;exports.HeaderText=je;exports.Heading=I;exports.Indent=ne;exports.LargeText=Re;exports.Nest=ae;exports.ResizeAwareBox=re;exports.Row=ue;exports.ScreenReaderOnlyText=pe;exports.SeparatorLine=q;exports.SmallText=Ee;exports.SmallerText=_e;exports.Space=ie;exports.Spacing=se;exports.StandardText=Ce;exports.Text=b;exports.Txt=Se;exports.booleanOrNumberToNumber=y;exports.exhaustSwitchCase=Qe;exports.exhaustSwitchCaseElseThrow=Je;exports.getDataProps=O;exports.getDimensionObject=$;exports.invariant=ut;exports.parseFloatElseUndefined=tt;exports.parseIntElseUndefined=rt;exports.truthyKeysAsList=et;exports.useArraySet=Ae;exports.useBoolean=v;exports.useDebounce=ze;exports.useDelayedFalse=He;exports.useDomId=Ne;exports.useElementDimensions=T;exports.useElementFocus=qe;exports.useEventListener=h;exports.useForwardedRef=Ke;exports.useLatest=Ue;exports.useMouseIsEntered=Be;exports.useMouseIsOver=Ve;exports.useMultiOnClickOutside=We;exports.useOnClickOutside=Xe;exports.useOnNoMouseMovement=Ge;exports.useOnScreen=Ye;exports.useTimeoutState=Ze;
`,ie=({half:e=!1,horizontal:t=!1,num:r=1,vertical:u=!1})=>{const s=r*(e?.5:1);return l.jsx(oe,{style:{"--current-size":s,height:t?1:void 0,width:u?1:void 0}})},ae=({children:e,nest:t,render:r})=>t?l.jsx(l.Fragment,{children:r(e)}):l.jsx(l.Fragment,{children:e}),ce="_visuallyHidden_1gevf_1",le={visuallyHidden:ce},O=e=>k.pickBy(e,de),de=(e,t)=>fe(t),fe=e=>e.startsWith("data-")||e.startsWith("aria-"),pe=({children:e,...t})=>l.jsx("span",{className:le.visuallyHidden,...O(t),children:e}),me="_text_1iisw_1",he="_standard_1iisw_24",ge="_bold_1iisw_27",be="_caption_1iisw_31",ye="_overline_1iisw_39",ve="_large_1iisw_48",xe="_medium_1iisw_53",we="_small_1iisw_58",ke="_smaller_1iisw_63",x={text:me,standard:he,bold:ge,caption:be,overline:ye,large:ve,medium:xe,small:we,smaller:ke},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:C(x.text,x[t],x[r],u),ref:m,style:{color:s,userSelect:o,whiteSpace:i,wordBreak:d,textAlign:a,...f},...p,children:e})),Se=b,Ee=e=>l.jsx(b,{size:"small",...e}),_e=e=>l.jsx(b,{size:"smaller",...e}),Te=e=>l.jsx(b,{size:"medium",...e}),Ce=e=>l.jsx(b,{size:"large",...e}),Re="_heading_1cnsg_1",$e="_h1_1cnsg_10",Oe="_h2_1cnsg_14",Ie="_h3_1cnsg_18",Me="_h4_1cnsg_22",Le="_h5_1cnsg_26",De="_h6_1cnsg_30",E={heading:Re,h1:$e,h2:Oe,h3:Ie,h4:Me,h5:Le,h6:De},I=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:C(E.heading,E[e],t),style:{color:r,whiteSpace:u,wordBreak:s,...o},ref:f,...a,children:i})}),je=e=>l.jsx(I,{variant:"h2",...e}),Pe=(e,t)=>e===t,Ae=(e,t,r=Pe)=>{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}},v=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]},ze=(e,t)=>{const[r,u]=n.useState(e);return n.useEffect(()=>{const s=setTimeout(()=>{u(e)},t);return()=>{clearTimeout(s)}},[e,t]),r},He=(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 _=e=>`webui-${e?e+"-":""}${++Fe}`,Ne=e=>{const[t,r]=n.useState(()=>_(e));return n.useEffect(()=>r(_(e)),[e]),t},h=(e,t,r)=>{const u=n.useRef();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])},qe=e=>{const[t,r,u]=v(!1);n.useEffect(()=>{document.activeElement===H.findDOMNode(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}},Ue=e=>{const t=n.useRef(e);return t.current=e,t},Ve=e=>{const[t,r,u]=v(!1);return h(e,"mouseover",r),h(e,"mouseout",u),t},Be=e=>{const[t,r,u]=v(!1);return h(e,"mouseenter",r),h(e,"mouseleave",u),t},We=(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])},Xe=(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"],Ge=(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])},Ye=(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},Ke=e=>{const t=n.useRef(null);return n.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t},Ze=(e,t,r=!0)=>{const[u,s]=n.useState(e),o=n.useRef(),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]},Je=()=>n.useMemo(()=>new Date,[]),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=V;exports.Column=ee;exports.HeaderText=je;exports.Heading=I;exports.Indent=ne;exports.LargeText=Ce;exports.Nest=ae;exports.ResizeAwareBox=re;exports.Row=ue;exports.ScreenReaderOnlyText=pe;exports.SeparatorLine=q;exports.SmallText=Ee;exports.SmallerText=_e;exports.Space=ie;exports.Spacing=se;exports.StandardText=Te;exports.Text=b;exports.Txt=Se;exports.booleanOrNumberToNumber=y;exports.exhaustSwitchCase=et;exports.exhaustSwitchCaseElseThrow=Qe;exports.getDataProps=O;exports.getDimensionObject=R;exports.invariant=nt;exports.parseFloatElseUndefined=rt;exports.parseIntElseUndefined=ut;exports.truthyKeysAsList=tt;exports.useArraySet=Ae;exports.useBoolean=v;exports.useDebounce=ze;exports.useDelayedFalse=He;exports.useDomId=Ne;exports.useElementDimensions=$;exports.useElementFocus=qe;exports.useEventListener=h;exports.useForwardedRef=Ke;exports.useLatest=Ue;exports.useMouseIsEntered=Be;exports.useMouseIsOver=Ve;exports.useMultiOnClickOutside=We;exports.useOnClickOutside=Xe;exports.useOnNoMouseMovement=Ge;exports.useOnScreen=Ye;exports.useTimeoutState=Ze;exports.useToday=Je;
//# sourceMappingURL=index.js.map
{
"name": "@stenajs-webui/core",
"version": "21.16.6",
"version": "21.16.7",
"type": "module",

@@ -64,5 +64,5 @@ "description": "",

],
"gitHead": "5df89e6b6df3ad387f2716d65e84d761c776769d",
"gitHead": "6bddf68732676427c023240ec6bb3bef5a2569aa",
"dependencies": {
"@stenajs-webui/theme": "21.16.6",
"@stenajs-webui/theme": "21.16.7",
"classnames": "^2.5.1",

@@ -69,0 +69,0 @@ "lodash-es": "^4.17.21"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc