@stenajs-webui/core 18.12.0 → 19.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,10 +1,10 @@
1
- (function(){"use strict";try{var t=document.createElement("style");t.appendChild(document.createTextNode("._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_1fcct_1{--swui-heading-text-color: var(--swui-text-primary-color);--swui-heading-font-family: var(--swui-font-primary);--swui-heading-font-weight: var(--swui-font-weight-text);--swui-heading-line-height: var(--swui-line-height);font-size:var(--swui-heading-font-size);color:var(--swui-heading-text-color);letter-spacing:0;margin:0;line-height:var(--swui-heading-line-height);font-family:var(--swui-heading-font-family);font-weight:var(--swui-heading-font-weight)}._heading_1fcct_1._h1_1fcct_15{--swui-heading-font-size: 2.8rem}._heading_1fcct_1._h2_1fcct_19{--swui-heading-font-size: 2.4rem}._heading_1fcct_1._h3_1fcct_23{--swui-heading-font-size: 2rem}._heading_1fcct_1._h4_1fcct_27{--swui-heading-font-size: 1.6rem;font-weight:var(--swui-font-weight-text-bold)}._heading_1fcct_1._h5_1fcct_32{--swui-heading-font-size: 1.4rem;font-weight:var(--swui-font-weight-text-bold)}._heading_1fcct_1._h6_1fcct_37{--swui-heading-font-size: 1.2rem;font-weight:var(--swui-font-weight-text-bold)}")),document.head.appendChild(t)}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
1
+ (function(){"use strict";try{var e=document.createElement("style");e.appendChild(document.createTextNode("._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_1cuj6_1{--swui-heading-text-color: var(--swui-text-primary-color);--swui-heading-font-family: var(--swui-font-primary);--swui-heading-font-weight: var(--swui-font-weight-text);font-size:var(--swui-heading-font-size);color:var(--swui-heading-text-color);letter-spacing:0;margin:0;line-height:var(--swui-heading-line-height);font-family:var(--swui-heading-font-family);font-weight:var(--swui-heading-font-weight)}._heading_1cuj6_1._h1_1cuj6_14{--swui-heading-font-size: 2.8rem;--swui-heading-line-height: 4rem}._heading_1cuj6_1._h2_1cuj6_19{--swui-heading-font-size: 2.4rem;--swui-heading-line-height: 3.2rem}._heading_1cuj6_1._h3_1cuj6_24{--swui-heading-font-size: 2rem;--swui-heading-line-height: 2.4rem}._heading_1cuj6_1._h4_1cuj6_29{--swui-heading-font-size: 1.8rem;--swui-heading-line-height: 2.4rem}._heading_1cuj6_1._h5_1cuj6_34{--swui-heading-font-size: 1.6rem;--swui-heading-line-height: 1.6rem}._heading_1cuj6_1._h6_1cuj6_39{--swui-heading-font-size: 1.4rem;--swui-heading-line-height: 1.6rem}")),document.head.appendChild(e)}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
2
  import "@stenajs-webui/theme";
3
3
  import _ from "@emotion/styled";
4
4
  import { forwardRef as f, useState as p, useCallback as h, useLayoutEffect as L, useRef as w, useEffect as m, useMemo as z } from "react";
5
5
  import { jsx as a, Fragment as I } from "react/jsx-runtime";
6
6
  import F from "@emotion/is-prop-valid";
7
- import { system as R, background as H, border as N, borderRight as P, borderLeft as V, borderTop as A, borderBottom as j, borderColor as U, borderRadius as q, borderStyle as W, borderWidth as B, boxShadow as K, flexbox as G, overflow as J, position as Q, layout as X, zIndex as Y, left as Z, right as ee, top as te, bottom as ne } from "styled-system";
7
+ import { system as R, background as j, border as H, borderRight as N, borderLeft as P, borderTop as V, borderBottom as A, borderColor as U, borderRadius as q, borderStyle as W, borderWidth as B, boxShadow as K, flexbox as G, overflow as J, position as Q, layout as X, zIndex as Y, left as Z, right as ee, top as te, bottom as ne } from "styled-system";
8
8
  import T from "classnames";
9
9
  import * as re from "react-dom";
10
10
  import { debounce as oe, pickBy as se } from "lodash";
@@ -137,12 +137,12 @@ const ce = _.hr`
137
137
  display: flex;
138
138
  flex-direction: column;
139
139
  ${le};
140
+ ${j};
140
141
  ${H};
141
142
  ${N};
142
143
  ${P};
143
144
  ${V};
144
145
  ${A};
145
- ${j};
146
146
  ${U};
147
147
  ${q};
148
148
  ${W};
@@ -322,7 +322,7 @@ const ce = _.hr`
322
322
  }), st = (e) => /* @__PURE__ */ a($, {
323
323
  size: "large",
324
324
  ...e
325
- }), Ie = "_heading_1fcct_1", Se = "_h1_1fcct_15", Ce = "_h2_1fcct_19", De = "_h3_1fcct_23", Te = "_h4_1fcct_27", Me = "_h5_1fcct_32", Oe = "_h6_1fcct_37", S = {
325
+ }), Ie = "_heading_1cuj6_1", Se = "_h1_1cuj6_14", Ce = "_h2_1cuj6_19", De = "_h3_1cuj6_24", Te = "_h4_1cuj6_29", Me = "_h5_1cuj6_34", Oe = "_h6_1cuj6_39", S = {
326
326
  heading: Ie,
327
327
  h1: Se,
328
328
  h2: Ce,
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{var t=document.createElement("style");t.appendChild(document.createTextNode("._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_1fcct_1{--swui-heading-text-color: var(--swui-text-primary-color);--swui-heading-font-family: var(--swui-font-primary);--swui-heading-font-weight: var(--swui-font-weight-text);--swui-heading-line-height: var(--swui-line-height);font-size:var(--swui-heading-font-size);color:var(--swui-heading-text-color);letter-spacing:0;margin:0;line-height:var(--swui-heading-line-height);font-family:var(--swui-heading-font-family);font-weight:var(--swui-heading-font-weight)}._heading_1fcct_1._h1_1fcct_15{--swui-heading-font-size: 2.8rem}._heading_1fcct_1._h2_1fcct_19{--swui-heading-font-size: 2.4rem}._heading_1fcct_1._h3_1fcct_23{--swui-heading-font-size: 2rem}._heading_1fcct_1._h4_1fcct_27{--swui-heading-font-size: 1.6rem;font-weight:var(--swui-font-weight-text-bold)}._heading_1fcct_1._h5_1fcct_32{--swui-heading-font-size: 1.4rem;font-weight:var(--swui-font-weight-text-bold)}._heading_1fcct_1._h6_1fcct_37{--swui-heading-font-size: 1.2rem;font-weight:var(--swui-font-weight-text-bold)}")),document.head.appendChild(t)}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("@stenajs-webui/theme");const L=require("@emotion/styled"),r=require("react"),l=require("react/jsx-runtime"),F=require("@emotion/is-prop-valid"),a=require("styled-system"),z=require("classnames"),N=require("react-dom"),C=require("lodash"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function P(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const x=$(L),q=$(F),I=$(z),H=P(N),A=x.default.hr`
1
+ (function(){"use strict";try{var e=document.createElement("style");e.appendChild(document.createTextNode("._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_1cuj6_1{--swui-heading-text-color: var(--swui-text-primary-color);--swui-heading-font-family: var(--swui-font-primary);--swui-heading-font-weight: var(--swui-font-weight-text);font-size:var(--swui-heading-font-size);color:var(--swui-heading-text-color);letter-spacing:0;margin:0;line-height:var(--swui-heading-line-height);font-family:var(--swui-heading-font-family);font-weight:var(--swui-heading-font-weight)}._heading_1cuj6_1._h1_1cuj6_14{--swui-heading-font-size: 2.8rem;--swui-heading-line-height: 4rem}._heading_1cuj6_1._h2_1cuj6_19{--swui-heading-font-size: 2.4rem;--swui-heading-line-height: 3.2rem}._heading_1cuj6_1._h3_1cuj6_24{--swui-heading-font-size: 2rem;--swui-heading-line-height: 2.4rem}._heading_1cuj6_1._h4_1cuj6_29{--swui-heading-font-size: 1.8rem;--swui-heading-line-height: 2.4rem}._heading_1cuj6_1._h5_1cuj6_34{--swui-heading-font-size: 1.6rem;--swui-heading-line-height: 1.6rem}._heading_1cuj6_1._h6_1cuj6_39{--swui-heading-font-size: 1.4rem;--swui-heading-line-height: 1.6rem}")),document.head.appendChild(e)}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("@stenajs-webui/theme");const L=require("@emotion/styled"),r=require("react"),l=require("react/jsx-runtime"),F=require("@emotion/is-prop-valid"),a=require("styled-system"),z=require("classnames"),N=require("react-dom"),j=require("lodash"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function P(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const x=$(L),q=$(F),C=$(z),H=P(N),A=x.default.hr`
3
3
  display: flex;
4
4
  border: 0;
5
5
  margin: 0;
@@ -30,7 +30,7 @@
30
30
  ${({width:e})=>e?`width: ${e};`:""}
31
31
  ${({height:e})=>e?`height: ${e};`:""}
32
32
  ${({borderRadius:e})=>e?`border-radius: ${e};`:""}
33
- `,B=r.forwardRef(({disableFocusHighlight:e,onClick:t,onDblClick:n,tooltip:s,disableOpacityOnClick:o,disablePointer:c,opacityOnHover:u,disabled:d,children:i,background:f="transparent",hoverBackground:m,focusBackground:p,type:T="button",...k},D)=>{const M=!!(t||n);return l.jsx(U,{opacityOnHover:u,title:s,disabled:d,disableOpacityOnClick:o,onClick:t,onDoubleClick:n,disableFocusHighlight:e,pointer:M&&!c,ref:D,background:f,hoverBackground:m,focusBackground:p,type:T,...k,children:i})}),g=e=>e==null?0:typeof e=="boolean"?e?1:0:e,K={box:"var(--swui-shadow-box)",popover:"var(--swui-shadow-popover)",modal:"var(--swui-shadow-modal)"},W=["spacing","indent","gap","width","height","overflow","display"],G=e=>W.includes(e),J=a.system({row:{property:"flexDirection",transform:e=>e?"row":"column"},indent:{property:"--current-indent",transform:g},spacing:{property:"--current-spacing",transform:g},gap:{property:"--current-gap",transform:g},shadow:{property:"boxShadow",transform:e=>{var t;return(t=K[e])!=null?t:e}}}),b=x.default("div",{shouldForwardProp:e=>typeof e=="string"?G(e)?!1:q.default(e):!1})`
33
+ `,B=r.forwardRef(({disableFocusHighlight:e,onClick:t,onDblClick:n,tooltip:s,disableOpacityOnClick:o,disablePointer:u,opacityOnHover:c,disabled:d,children:i,background:f="transparent",hoverBackground:m,focusBackground:p,type:T="button",...k},D)=>{const M=!!(t||n);return l.jsx(U,{opacityOnHover:c,title:s,disabled:d,disableOpacityOnClick:o,onClick:t,onDoubleClick:n,disableFocusHighlight:e,pointer:M&&!u,ref:D,background:f,hoverBackground:m,focusBackground:p,type:T,...k,children:i})}),g=e=>e==null?0:typeof e=="boolean"?e?1:0:e,K={box:"var(--swui-shadow-box)",popover:"var(--swui-shadow-popover)",modal:"var(--swui-shadow-modal)"},W=["spacing","indent","gap","width","height","overflow","display"],G=e=>W.includes(e),J=a.system({row:{property:"flexDirection",transform:e=>e?"row":"column"},indent:{property:"--current-indent",transform:g},spacing:{property:"--current-spacing",transform:g},gap:{property:"--current-gap",transform:g},shadow:{property:"boxShadow",transform:e=>{var t;return(t=K[e])!=null?t:e}}}),b=x.default("div",{shouldForwardProp:e=>typeof e=="string"?G(e)?!1:q.default(e):!1})`
34
34
  --current-spacing: 0;
35
35
  --current-indent: 0;
36
36
  --current-gap: 0;
@@ -75,10 +75,10 @@
75
75
  ${({focusWithinBackground:e})=>e?`background: ${e};`:""}
76
76
  ${({focusWithinBorder:e})=>e?`border: ${e};`:""}
77
77
  }
78
- `,Q=r.forwardRef(function(t,n){return l.jsx(b,{ref:n,...t})}),O=e=>{const{x:t,y:n,width:s,height:o,bottom:c,top:u,left:d,right:i}=e.getBoundingClientRect();return{width:s,height:o,top:u,left:d,x:t,y:n,right:i,bottom:c}},X=(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[n,s]=r.useState(),o=r.useCallback(()=>{window.requestAnimationFrame(()=>{if(e.current){const c=O(e.current);(!n||!X(n,c))&&t&&t(c),s(c)}})},[e,n,s,t]);return r.useLayoutEffect(()=>{o()},[o]),{dimensions:n}},Y=r.forwardRef(function({onResize:t,...n},s){const o=r.useRef(null),c=s!=null?s:o;return R(c,t),l.jsx(b,{...n,ref:s})}),Z=r.forwardRef(function(t,n){return l.jsx(b,{row:!0,ref:n,...t})}),ee=r.forwardRef(function({num:t=1,...n},s){return l.jsx(b,{indent:t,ref:s,...n})}),te=r.forwardRef(function({num:t=1,...n},s){return l.jsx(b,{spacing:t,ref:s,...n})}),ne=x.default.div`
78
+ `,Q=r.forwardRef(function(t,n){return l.jsx(b,{ref:n,...t})}),I=e=>{const{x:t,y:n,width:s,height:o,bottom:u,top:c,left:d,right:i}=e.getBoundingClientRect();return{width:s,height:o,top:c,left:d,x:t,y:n,right:i,bottom:u}},X=(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,O=(e,t)=>{const[n,s]=r.useState(),o=r.useCallback(()=>{window.requestAnimationFrame(()=>{if(e.current){const u=I(e.current);(!n||!X(n,u))&&t&&t(u),s(u)}})},[e,n,s,t]);return r.useLayoutEffect(()=>{o()},[o]),{dimensions:n}},Y=r.forwardRef(function({onResize:t,...n},s){const o=r.useRef(null),u=s!=null?s:o;return O(u,t),l.jsx(b,{...n,ref:s})}),Z=r.forwardRef(function(t,n){return l.jsx(b,{row:!0,ref:n,...t})}),ee=r.forwardRef(function({num:t=1,...n},s){return l.jsx(b,{indent:t,ref:s,...n})}),te=r.forwardRef(function({num:t=1,...n},s){return l.jsx(b,{spacing:t,ref:s,...n})}),ne=x.default.div`
79
79
  --current-size: 1;
80
80
  flex: none;
81
81
  width: calc(var(--current-size) * var(--swui-metrics-space));
82
82
  height: calc(var(--current-size) * var(--swui-metrics-space));
83
- `,se=({half:e=!1,horizontal:t=!1,num:n=1,vertical:s=!1})=>{const o=n*(e?.5:1);return l.jsx(ne,{style:{["--current-size"]:o,height:t?1:void 0,width:s?1:void 0}})},re=({children:e,nest:t,render:n})=>t?l.jsx(l.Fragment,{children:n(e)}):l.jsx(l.Fragment,{children:e}),oe="_text_1iisw_1",ce="_standard_1iisw_24",ue="_bold_1iisw_27",ie="_caption_1iisw_31",ae="_overline_1iisw_39",de="_large_1iisw_48",le="_medium_1iisw_53",fe="_small_1iisw_58",me="_smaller_1iisw_63",_={text:oe,standard:ce,bold:ue,caption:ie,overline:ae,large:de,medium:le,small:fe,smaller:me},w=r.forwardRef(({children:e,variant:t="standard",size:n="medium",className:s,color:o,userSelect:c,whiteSpace:u,wordBreak:d,style:i,...f},m)=>l.jsx("span",{className:I.default(_.text,_[t],_[n],s),ref:m,style:{color:o,userSelect:c,whiteSpace:u,wordBreak:d,...i},...f,children:e})),he=w,be=e=>l.jsx(w,{size:"small",...e}),we=e=>l.jsx(w,{size:"smaller",...e}),pe=e=>l.jsx(w,{size:"medium",...e}),ge=e=>l.jsx(w,{size:"large",...e}),xe="_heading_1fcct_1",ve="_h1_1fcct_15",_e="_h2_1fcct_19",$e="_h3_1fcct_23",Ee="_h4_1fcct_27",ye="_h5_1fcct_32",Se="_h6_1fcct_37",E={heading:xe,h1:ve,h2:_e,h3:$e,h4:Ee,h5:ye,h6:Se},j=r.forwardRef(({variant:e="h3",className:t,color:n,whiteSpace:s,wordBreak:o,style:c,children:u,as:d,...i},f)=>{const m=d!=null?d:e;return l.jsx(m,{className:I.default(E.heading,E[e],t),style:{color:n,whiteSpace:s,wordBreak:o,...c},ref:f,...i,children:u})}),Ce=e=>l.jsx(j,{variant:"h2",...e}),Ie=(e,t)=>e===t,Oe=(e,t,n=Ie)=>{const s=r.useCallback(i=>{e.some(f=>n(f,i))||t([...e,i])},[e,t,n]),o=r.useCallback(i=>{t(i.reduce((f,m)=>f.some(p=>n(p,m))?f:[...f,m],e))},[e,t,n]),c=r.useCallback(i=>{const f=e.findIndex(m=>n(m,i));f>=0&&t(e.filter((m,p)=>p!==f))},[e,t,n]),u=r.useCallback(i=>{t(e.filter(f=>!i.some(m=>n(m,f))))},[e,t,n]),d=r.useCallback(i=>{e.some(m=>n(m,i))?c(i):s(i)},[e,s,c,n]);return{add:s,addMultiple:o,remove:c,removeMultiple:u,toggle:d}},v=e=>{const[t,n]=r.useState(e),s=r.useCallback(()=>{n(!0)},[n]),o=r.useCallback(()=>{n(!1)},[n]),c=r.useCallback(()=>{n(u=>!u)},[n]);return[t,s,o,c]},Re=(e,t)=>{const[n,s]=r.useState(e);return r.useEffect(()=>{const o=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},je=(e,t)=>{const[n,s]=r.useState(e);return r.useEffect(()=>{e&&s(!0);const o=setTimeout(()=>{e||s(e)},t);return()=>{clearTimeout(o)}},[e,t]),n};let Te=0;const y=e=>`webui-${e?e+"-":""}${++Te}`,ke=e=>{const[t,n]=r.useState(()=>y(e));return r.useEffect(()=>n(y(e)),[e]),t},h=(e,t,n)=>{const s=r.useRef();r.useEffect(()=>{s.current=n},[n]),r.useEffect(()=>{if(!(e.current&&e.current.addEventListener))return;const c=d=>{if(s.current)return s.current(d)};if(!e.current)return;const u=e.current;return u.addEventListener(t,c),()=>{u&&u.removeEventListener(t,c)}},[t,e])},De=e=>{const[t,n,s]=v(!1);r.useEffect(()=>{document.activeElement===H.findDOMNode(e.current)?n():s()},[e,s,n]),h(e,"focus",n),h(e,"blur",s);const o=r.useCallback(()=>{e.current&&e.current.focus()},[e]),c=r.useCallback(()=>{e.current&&e.current.blur()},[e]);return{isInFocus:t,focus:o,blur:c}},Me=e=>{const[t,n,s]=v(!1);return h(e,"mouseover",n),h(e,"mouseout",s),t},Le=e=>{const[t,n,s]=v(!1);return h(e,"mouseenter",n),h(e,"mouseleave",s),t},Fe=(e,t)=>{const n=r.useRef(()=>{});r.useEffect(()=>{n.current=t},[t]),r.useEffect(()=>{const s=o=>{!e.filter(u=>u.current).every(u=>u.current&&!u.current.contains(o.target))||n.current(o)};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[...e])},ze=(e,t,n)=>{const s=r.useRef(()=>{});r.useEffect(()=>{s.current=t},[t]),r.useEffect(()=>{const o=c=>{!e.current||e.current.contains(c.target)||s.current(c)};return document.addEventListener("mousedown",o,n),document.addEventListener("touchstart",o,n),()=>{document.removeEventListener("mousedown",o,n),document.removeEventListener("touchstart",o,n)}},[e,n])},S=["mousemove","mousedown","keydown","touchstart","scroll"],Ne=(e,t)=>{const n=r.useRef(()=>{});r.useEffect(()=>{n.current=e},[e]),r.useEffect(()=>{const s=C.debounce(n.current,t);return S.forEach(o=>window.addEventListener(o,s)),()=>{S.forEach(o=>window.removeEventListener(o,s))}},[t])},Pe=(e,t)=>{const[n,s]=r.useState(!1),{rootMargin:o,root:c,threshold:u}=t||{},d=r.useMemo(()=>new IntersectionObserver(([i])=>s(i.isIntersecting),{rootMargin:o,root:c,threshold:u}),[s,o,c,u]);return r.useEffect(()=>(e.current&&d.observe(e.current),()=>{d.disconnect()}),[d,e]),n},qe=e=>{const t=r.useRef(null);return r.useEffect(()=>{!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t},He=(e,t,n=!0)=>{const[s,o]=r.useState(e),c=r.useRef(),u=r.useCallback((d,i=t)=>{o(d),n&&clearTimeout(c.current),c.current=setTimeout(()=>o(e),i)},[t,n,e]);return r.useEffect(()=>()=>{clearTimeout(c.current)},[]),[s,u]},Ae=e=>{throw new Error(`Switch unhandled case: ${e}`)},Ve=(e,t)=>t,Ue=e=>Object.keys(e).filter(t=>e[t]),Be=e=>C.pickBy(e,Ke),Ke=(e,t)=>We(t),We=e=>e.startsWith("data-")||e.startsWith("aria-"),Ge=e=>{try{const t=parseFloat(e);return isNaN(t)||t==null?void 0:t}catch{}},Je=e=>{try{const t=parseInt(e,10);return isNaN(t)||t==null?void 0:t}catch{}};exports.Box=b;exports.Clickable=B;exports.Column=Q;exports.HeaderText=Ce;exports.Heading=j;exports.Indent=ee;exports.LargeText=ge;exports.Nest=re;exports.ResizeAwareBox=Y;exports.Row=Z;exports.SeparatorLine=V;exports.SmallText=be;exports.SmallerText=we;exports.Space=se;exports.Spacing=te;exports.StandardText=pe;exports.Text=w;exports.Txt=he;exports.booleanOrNumberToNumber=g;exports.exhaustSwitchCase=Ve;exports.exhaustSwitchCaseElseThrow=Ae;exports.getDataProps=Be;exports.getDimensionObject=O;exports.parseFloatElseUndefined=Ge;exports.parseIntElseUndefined=Je;exports.truthyKeysAsList=Ue;exports.useArraySet=Oe;exports.useBoolean=v;exports.useDebounce=Re;exports.useDelayedFalse=je;exports.useDomId=ke;exports.useElementDimensions=R;exports.useElementFocus=De;exports.useEventListener=h;exports.useForwardedRef=qe;exports.useMouseIsEntered=Le;exports.useMouseIsOver=Me;exports.useMultiOnClickOutside=Fe;exports.useOnClickOutside=ze;exports.useOnNoMouseMovement=Ne;exports.useOnScreen=Pe;exports.useTimeoutState=He;
83
+ `,se=({half:e=!1,horizontal:t=!1,num:n=1,vertical:s=!1})=>{const o=n*(e?.5:1);return l.jsx(ne,{style:{["--current-size"]:o,height:t?1:void 0,width:s?1:void 0}})},re=({children:e,nest:t,render:n})=>t?l.jsx(l.Fragment,{children:n(e)}):l.jsx(l.Fragment,{children:e}),oe="_text_1iisw_1",ue="_standard_1iisw_24",ce="_bold_1iisw_27",ie="_caption_1iisw_31",ae="_overline_1iisw_39",de="_large_1iisw_48",le="_medium_1iisw_53",fe="_small_1iisw_58",me="_smaller_1iisw_63",_={text:oe,standard:ue,bold:ce,caption:ie,overline:ae,large:de,medium:le,small:fe,smaller:me},w=r.forwardRef(({children:e,variant:t="standard",size:n="medium",className:s,color:o,userSelect:u,whiteSpace:c,wordBreak:d,style:i,...f},m)=>l.jsx("span",{className:C.default(_.text,_[t],_[n],s),ref:m,style:{color:o,userSelect:u,whiteSpace:c,wordBreak:d,...i},...f,children:e})),he=w,be=e=>l.jsx(w,{size:"small",...e}),we=e=>l.jsx(w,{size:"smaller",...e}),pe=e=>l.jsx(w,{size:"medium",...e}),ge=e=>l.jsx(w,{size:"large",...e}),xe="_heading_1cuj6_1",ve="_h1_1cuj6_14",_e="_h2_1cuj6_19",$e="_h3_1cuj6_24",Ee="_h4_1cuj6_29",ye="_h5_1cuj6_34",Se="_h6_1cuj6_39",E={heading:xe,h1:ve,h2:_e,h3:$e,h4:Ee,h5:ye,h6:Se},R=r.forwardRef(({variant:e="h3",className:t,color:n,whiteSpace:s,wordBreak:o,style:u,children:c,as:d,...i},f)=>{const m=d!=null?d:e;return l.jsx(m,{className:C.default(E.heading,E[e],t),style:{color:n,whiteSpace:s,wordBreak:o,...u},ref:f,...i,children:c})}),je=e=>l.jsx(R,{variant:"h2",...e}),Ce=(e,t)=>e===t,Ie=(e,t,n=Ce)=>{const s=r.useCallback(i=>{e.some(f=>n(f,i))||t([...e,i])},[e,t,n]),o=r.useCallback(i=>{t(i.reduce((f,m)=>f.some(p=>n(p,m))?f:[...f,m],e))},[e,t,n]),u=r.useCallback(i=>{const f=e.findIndex(m=>n(m,i));f>=0&&t(e.filter((m,p)=>p!==f))},[e,t,n]),c=r.useCallback(i=>{t(e.filter(f=>!i.some(m=>n(m,f))))},[e,t,n]),d=r.useCallback(i=>{e.some(m=>n(m,i))?u(i):s(i)},[e,s,u,n]);return{add:s,addMultiple:o,remove:u,removeMultiple:c,toggle:d}},v=e=>{const[t,n]=r.useState(e),s=r.useCallback(()=>{n(!0)},[n]),o=r.useCallback(()=>{n(!1)},[n]),u=r.useCallback(()=>{n(c=>!c)},[n]);return[t,s,o,u]},Oe=(e,t)=>{const[n,s]=r.useState(e);return r.useEffect(()=>{const o=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Re=(e,t)=>{const[n,s]=r.useState(e);return r.useEffect(()=>{e&&s(!0);const o=setTimeout(()=>{e||s(e)},t);return()=>{clearTimeout(o)}},[e,t]),n};let Te=0;const y=e=>`webui-${e?e+"-":""}${++Te}`,ke=e=>{const[t,n]=r.useState(()=>y(e));return r.useEffect(()=>n(y(e)),[e]),t},h=(e,t,n)=>{const s=r.useRef();r.useEffect(()=>{s.current=n},[n]),r.useEffect(()=>{if(!(e.current&&e.current.addEventListener))return;const u=d=>{if(s.current)return s.current(d)};if(!e.current)return;const c=e.current;return c.addEventListener(t,u),()=>{c&&c.removeEventListener(t,u)}},[t,e])},De=e=>{const[t,n,s]=v(!1);r.useEffect(()=>{document.activeElement===H.findDOMNode(e.current)?n():s()},[e,s,n]),h(e,"focus",n),h(e,"blur",s);const o=r.useCallback(()=>{e.current&&e.current.focus()},[e]),u=r.useCallback(()=>{e.current&&e.current.blur()},[e]);return{isInFocus:t,focus:o,blur:u}},Me=e=>{const[t,n,s]=v(!1);return h(e,"mouseover",n),h(e,"mouseout",s),t},Le=e=>{const[t,n,s]=v(!1);return h(e,"mouseenter",n),h(e,"mouseleave",s),t},Fe=(e,t)=>{const n=r.useRef(()=>{});r.useEffect(()=>{n.current=t},[t]),r.useEffect(()=>{const s=o=>{!e.filter(c=>c.current).every(c=>c.current&&!c.current.contains(o.target))||n.current(o)};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[...e])},ze=(e,t,n)=>{const s=r.useRef(()=>{});r.useEffect(()=>{s.current=t},[t]),r.useEffect(()=>{const o=u=>{!e.current||e.current.contains(u.target)||s.current(u)};return document.addEventListener("mousedown",o,n),document.addEventListener("touchstart",o,n),()=>{document.removeEventListener("mousedown",o,n),document.removeEventListener("touchstart",o,n)}},[e,n])},S=["mousemove","mousedown","keydown","touchstart","scroll"],Ne=(e,t)=>{const n=r.useRef(()=>{});r.useEffect(()=>{n.current=e},[e]),r.useEffect(()=>{const s=j.debounce(n.current,t);return S.forEach(o=>window.addEventListener(o,s)),()=>{S.forEach(o=>window.removeEventListener(o,s))}},[t])},Pe=(e,t)=>{const[n,s]=r.useState(!1),{rootMargin:o,root:u,threshold:c}=t||{},d=r.useMemo(()=>new IntersectionObserver(([i])=>s(i.isIntersecting),{rootMargin:o,root:u,threshold:c}),[s,o,u,c]);return r.useEffect(()=>(e.current&&d.observe(e.current),()=>{d.disconnect()}),[d,e]),n},qe=e=>{const t=r.useRef(null);return r.useEffect(()=>{!e||(typeof e=="function"?e(t.current):e.current=t.current)}),t},He=(e,t,n=!0)=>{const[s,o]=r.useState(e),u=r.useRef(),c=r.useCallback((d,i=t)=>{o(d),n&&clearTimeout(u.current),u.current=setTimeout(()=>o(e),i)},[t,n,e]);return r.useEffect(()=>()=>{clearTimeout(u.current)},[]),[s,c]},Ae=e=>{throw new Error(`Switch unhandled case: ${e}`)},Ve=(e,t)=>t,Ue=e=>Object.keys(e).filter(t=>e[t]),Be=e=>j.pickBy(e,Ke),Ke=(e,t)=>We(t),We=e=>e.startsWith("data-")||e.startsWith("aria-"),Ge=e=>{try{const t=parseFloat(e);return isNaN(t)||t==null?void 0:t}catch{}},Je=e=>{try{const t=parseInt(e,10);return isNaN(t)||t==null?void 0:t}catch{}};exports.Box=b;exports.Clickable=B;exports.Column=Q;exports.HeaderText=je;exports.Heading=R;exports.Indent=ee;exports.LargeText=ge;exports.Nest=re;exports.ResizeAwareBox=Y;exports.Row=Z;exports.SeparatorLine=V;exports.SmallText=be;exports.SmallerText=we;exports.Space=se;exports.Spacing=te;exports.StandardText=pe;exports.Text=w;exports.Txt=he;exports.booleanOrNumberToNumber=g;exports.exhaustSwitchCase=Ve;exports.exhaustSwitchCaseElseThrow=Ae;exports.getDataProps=Be;exports.getDimensionObject=I;exports.parseFloatElseUndefined=Ge;exports.parseIntElseUndefined=Je;exports.truthyKeysAsList=Ue;exports.useArraySet=Ie;exports.useBoolean=v;exports.useDebounce=Oe;exports.useDelayedFalse=Re;exports.useDomId=ke;exports.useElementDimensions=O;exports.useElementFocus=De;exports.useEventListener=h;exports.useForwardedRef=qe;exports.useMouseIsEntered=Le;exports.useMouseIsOver=Me;exports.useMultiOnClickOutside=Fe;exports.useOnClickOutside=ze;exports.useOnNoMouseMovement=Ne;exports.useOnScreen=Pe;exports.useTimeoutState=He;
84
84
  //# sourceMappingURL=index.js.map
@@ -12,6 +12,7 @@ export declare type DivProps = ComponentPropsWithoutRef<"div">;
12
12
  export declare type SpanProps = ComponentPropsWithoutRef<"span">;
13
13
  export declare type H1Props = ComponentPropsWithoutRef<"h1">;
14
14
  export declare type ButtonElementProps = ComponentPropsWithoutRef<"button">;
15
+ export declare type InputElementProps = ComponentPropsWithoutRef<"input">;
15
16
  export declare type AnchorElementProps = ComponentPropsWithoutRef<"a">;
16
17
  export interface WithInnerRef<TInputElement> {
17
18
  innerRef?: Ref<TInputElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stenajs-webui/core",
3
- "version": "18.12.0",
3
+ "version": "19.0.0-next.0",
4
4
  "description": "",
5
5
  "author": "mattias800",
6
6
  "license": "MIT",
@@ -57,10 +57,10 @@
57
57
  "files": [
58
58
  "dist"
59
59
  ],
60
- "gitHead": "d0bc10e9bd393ffa69851bed86e6929d632aae2a",
60
+ "gitHead": "835ed29571c4902a9bc9ecb45646fe15d7316c1e",
61
61
  "dependencies": {
62
62
  "@emotion/is-prop-valid": "^1.1.0",
63
- "@stenajs-webui/theme": "18.12.0",
63
+ "@stenajs-webui/theme": "19.0.0-next.0",
64
64
  "classnames": "^2.3.1"
65
65
  }
66
66
  }