@stenajs-webui/tooltip 23.16.2 → 23.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ ._floating_1glwr_1{display:flex;flex-direction:row;align-items:center;background:#fff;color:#fff;border-radius:var(--swui-border-radius);padding:var(--swui-metrics-spacing) calc(var(--swui-metrics-indent) * 2);box-shadow:var(--swui-shadow-popover)}._floating_1glwr_1._disablePadding_1glwr_11{padding:0}._iconWrapper_1glwr_16{--current-bg-color: transparent;--current-border-color: var(--lhds-color-ui-50);--current-icon-color: var(--lhds-color-ui-50);display:inline-flex;flex-direction:row;white-space:nowrap;background-color:var(--current-bg-color);border:1px solid var(--current-border-color);border-radius:var(--swui-border-radius);padding:calc(var(--swui-metrics-spacing) * .5);align-items:flex-start}._iconWrapper_1glwr_16 svg{color:var(--current-icon-color)}._iconWrapper_1glwr_16._info_1glwr_36{--current-border-color: var(--lhds-color-blue-300);--current-bg-color: var(--lhds-color-blue-100);--current-icon-color: var(--lhds-color-blue-700)}._iconWrapper_1glwr_16._warning_1glwr_42{--current-border-color: var(--lhds-color-orange-300);--current-bg-color: var(--lhds-color-orange-100);--current-icon-color: var(--lhds-color-orange-700)}._iconWrapper_1glwr_16._error_1glwr_48{--current-border-color: var(--lhds-color-red-300);--current-bg-color: var(--lhds-color-red-100);--current-icon-color: var(--lhds-color-red-700)}._floating_15fk9_1{display:flex;align-items:center;background:#333;color:#fff;border-radius:var(--swui-border-radius);padding:var(--swui-metrics-spacing) calc(var(--swui-metrics-indent) * 2);width:-webkit-fit-content;width:fit-content}._floating_15fk9_1._withIcon_15fk9_10{padding:calc(var(--swui-metrics-spacing) * .5);padding-right:calc(var(--swui-metrics-indent) * 2)}._iconWrapper_15fk9_16{--current-bg-color: transparent;--current-border-color: var(--lhds-color-ui-50);--current-icon-color: var(--lhds-color-ui-50);display:inline-flex;flex-direction:row;white-space:nowrap;background-color:var(--current-bg-color);border:1px solid var(--current-border-color);border-radius:var(--swui-border-radius);padding:calc(var(--swui-metrics-spacing) * .5);align-items:flex-start}._iconWrapper_15fk9_16 svg{color:var(--current-icon-color)}._iconWrapper_15fk9_16._info_15fk9_36{--current-border-color: var(--lhds-color-blue-300);--current-bg-color: var(--lhds-color-blue-100);--current-icon-color: var(--lhds-color-blue-700)}._iconWrapper_15fk9_16._warning_15fk9_42{--current-border-color: var(--lhds-color-orange-300);--current-bg-color: var(--lhds-color-orange-100);--current-icon-color: var(--lhds-color-orange-700)}._iconWrapper_15fk9_16._error_15fk9_48{--current-border-color: var(--lhds-color-red-300);--current-bg-color: var(--lhds-color-red-100);--current-icon-color: var(--lhds-color-red-700)}
package/dist/index.es.js CHANGED
@@ -1,4 +1,3 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._floating_1glwr_1{display:flex;flex-direction:row;align-items:center;background:#fff;color:#fff;border-radius:var(--swui-border-radius);padding:var(--swui-metrics-spacing) calc(var(--swui-metrics-indent) * 2);box-shadow:var(--swui-shadow-popover)}._floating_1glwr_1._disablePadding_1glwr_11{padding:0}._iconWrapper_1glwr_16{--current-bg-color: transparent;--current-border-color: var(--lhds-color-ui-50);--current-icon-color: var(--lhds-color-ui-50);display:inline-flex;flex-direction:row;white-space:nowrap;background-color:var(--current-bg-color);border:1px solid var(--current-border-color);border-radius:var(--swui-border-radius);padding:calc(var(--swui-metrics-spacing) * .5);align-items:flex-start}._iconWrapper_1glwr_16 svg{color:var(--current-icon-color)}._iconWrapper_1glwr_16._info_1glwr_36{--current-border-color: var(--lhds-color-blue-300);--current-bg-color: var(--lhds-color-blue-100);--current-icon-color: var(--lhds-color-blue-700)}._iconWrapper_1glwr_16._warning_1glwr_42{--current-border-color: var(--lhds-color-orange-300);--current-bg-color: var(--lhds-color-orange-100);--current-icon-color: var(--lhds-color-orange-700)}._iconWrapper_1glwr_16._error_1glwr_48{--current-border-color: var(--lhds-color-red-300);--current-bg-color: var(--lhds-color-red-100);--current-icon-color: var(--lhds-color-red-700)}._floating_15fk9_1{display:flex;align-items:center;background:#333;color:#fff;border-radius:var(--swui-border-radius);padding:var(--swui-metrics-spacing) calc(var(--swui-metrics-indent) * 2);width:-webkit-fit-content;width:fit-content}._floating_15fk9_1._withIcon_15fk9_10{padding:calc(var(--swui-metrics-spacing) * .5);padding-right:calc(var(--swui-metrics-indent) * 2)}._iconWrapper_15fk9_16{--current-bg-color: transparent;--current-border-color: var(--lhds-color-ui-50);--current-icon-color: var(--lhds-color-ui-50);display:inline-flex;flex-direction:row;white-space:nowrap;background-color:var(--current-bg-color);border:1px solid var(--current-border-color);border-radius:var(--swui-border-radius);padding:calc(var(--swui-metrics-spacing) * .5);align-items:flex-start}._iconWrapper_15fk9_16 svg{color:var(--current-icon-color)}._iconWrapper_15fk9_16._info_15fk9_36{--current-border-color: var(--lhds-color-blue-300);--current-bg-color: var(--lhds-color-blue-100);--current-icon-color: var(--lhds-color-blue-700)}._iconWrapper_15fk9_16._warning_15fk9_42{--current-border-color: var(--lhds-color-orange-300);--current-bg-color: var(--lhds-color-orange-100);--current-icon-color: var(--lhds-color-orange-700)}._iconWrapper_15fk9_16._error_15fk9_48{--current-border-color: var(--lhds-color-red-300);--current-bg-color: var(--lhds-color-red-100);--current-icon-color: var(--lhds-color-red-700)}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
1
  import { jsxs as r, jsx as e, Fragment as C } from "react/jsx-runtime";
3
2
  import { Column as _e, Text as Z, Space as N, Row as q } from "@stenajs-webui/core";
4
3
  import { FlatButton as we, PrimaryButton as ye, Spinner as Ie, Icon as Re, stenaExclamationTriangle as Pe, stenaExclamationCircle as ve, stenaInfoCircle as Fe } from "@stenajs-webui/elements";
@@ -6,7 +5,7 @@ import { useRef as S, useCallback as O, useState as ee } from "react";
6
5
  import { useFloatingParentNodeId as ne, FloatingTree as te, useFloatingNodeId as oe, useFloating as H, autoUpdate as E, offset as M, flip as $, shift as G, arrow as D, useTransitionStyles as j, useDismiss as se, useRole as ie, useInteractions as z, FloatingNode as le, FloatingPortal as B, FloatingFocusManager as re, FloatingArrow as U, useFocus as Ce, useClick as be, useHover as ce, safePolygon as xe } from "@floating-ui/react";
7
6
  import b from "classnames";
8
7
  import { cssColor as Ae } from "@stenajs-webui/theme";
9
- const Ve = ({
8
+ import './index.css';const Ve = ({
10
9
  text: n = "Are you sure?",
11
10
  yesLabel: t = "Yes",
12
11
  noLabel: o = "No",
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._floating_1glwr_1{display:flex;flex-direction:row;align-items:center;background:#fff;color:#fff;border-radius:var(--swui-border-radius);padding:var(--swui-metrics-spacing) calc(var(--swui-metrics-indent) * 2);box-shadow:var(--swui-shadow-popover)}._floating_1glwr_1._disablePadding_1glwr_11{padding:0}._iconWrapper_1glwr_16{--current-bg-color: transparent;--current-border-color: var(--lhds-color-ui-50);--current-icon-color: var(--lhds-color-ui-50);display:inline-flex;flex-direction:row;white-space:nowrap;background-color:var(--current-bg-color);border:1px solid var(--current-border-color);border-radius:var(--swui-border-radius);padding:calc(var(--swui-metrics-spacing) * .5);align-items:flex-start}._iconWrapper_1glwr_16 svg{color:var(--current-icon-color)}._iconWrapper_1glwr_16._info_1glwr_36{--current-border-color: var(--lhds-color-blue-300);--current-bg-color: var(--lhds-color-blue-100);--current-icon-color: var(--lhds-color-blue-700)}._iconWrapper_1glwr_16._warning_1glwr_42{--current-border-color: var(--lhds-color-orange-300);--current-bg-color: var(--lhds-color-orange-100);--current-icon-color: var(--lhds-color-orange-700)}._iconWrapper_1glwr_16._error_1glwr_48{--current-border-color: var(--lhds-color-red-300);--current-bg-color: var(--lhds-color-red-100);--current-icon-color: var(--lhds-color-red-700)}._floating_15fk9_1{display:flex;align-items:center;background:#333;color:#fff;border-radius:var(--swui-border-radius);padding:var(--swui-metrics-spacing) calc(var(--swui-metrics-indent) * 2);width:-webkit-fit-content;width:fit-content}._floating_15fk9_1._withIcon_15fk9_10{padding:calc(var(--swui-metrics-spacing) * .5);padding-right:calc(var(--swui-metrics-indent) * 2)}._iconWrapper_15fk9_16{--current-bg-color: transparent;--current-border-color: var(--lhds-color-ui-50);--current-icon-color: var(--lhds-color-ui-50);display:inline-flex;flex-direction:row;white-space:nowrap;background-color:var(--current-bg-color);border:1px solid var(--current-border-color);border-radius:var(--swui-border-radius);padding:calc(var(--swui-metrics-spacing) * .5);align-items:flex-start}._iconWrapper_15fk9_16 svg{color:var(--current-icon-color)}._iconWrapper_15fk9_16._info_15fk9_36{--current-border-color: var(--lhds-color-blue-300);--current-bg-color: var(--lhds-color-blue-100);--current-icon-color: var(--lhds-color-blue-700)}._iconWrapper_15fk9_16._warning_15fk9_42{--current-border-color: var(--lhds-color-orange-300);--current-bg-color: var(--lhds-color-orange-100);--current-icon-color: var(--lhds-color-orange-700)}._iconWrapper_15fk9_16._error_15fk9_48{--current-border-color: var(--lhds-color-red-300);--current-bg-color: var(--lhds-color-red-100);--current-icon-color: var(--lhds-color-red-700)}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("@stenajs-webui/core"),g=require("@stenajs-webui/elements"),u=require("react"),e=require("@floating-ui/react"),b=require("classnames"),L=require("@stenajs-webui/theme"),Q=({text:t="Are you sure?",yesLabel:s="Yes",noLabel:o="No",onNo:c,onYes:i,loading:d})=>n.jsxs(f.Column,{position:"relative",children:[n.jsxs("div",{style:{opacity:d?0:1},children:[n.jsx(f.Text,{children:t}),n.jsx(f.Space,{}),n.jsxs(f.Row,{justifyContent:"flex-end",alignItems:"center",children:[n.jsx(g.FlatButton,{label:o,onClick:c}),n.jsx(f.Space,{}),n.jsx(g.PrimaryButton,{label:s,onClick:i})]})]}),d&&n.jsx(f.Row,{justifyContent:"center",alignItems:"center",left:0,top:0,width:"100%",height:"100%",position:"absolute",children:n.jsx(g.Spinner,{size:"small"})})]}),V="_floating_1glwr_1",X="_disablePadding_1glwr_11",R={floating:V,disablePadding:X},Z=12,W=8,ee=2,ne=({children:t,...s})=>e.useFloatingParentNodeId()==null?n.jsx(e.FloatingTree,{children:n.jsx(H,{...s,children:t})}):n.jsx(H,{...s,children:t}),H=({children:t,placement:s="bottom",hideArrow:o,renderTrigger:c,disablePadding:i,open:d,onRequestClose:p,restoreFocus:F,returnFocus:I,initialFocus:_,appendTo:h,zIndex:x})=>{const j=e.useFloatingNodeId(),a=u.useRef(null),m=u.useCallback(N=>{N||p()},[p]),{refs:w,floatingStyles:y,context:l}=e.useFloating({nodeId:j,open:d,onOpenChange:m,placement:s,middleware:[e.offset(W+ee),e.flip({padding:5}),e.shift({padding:5}),e.arrow({element:a})],whileElementsMounted:e.autoUpdate}),{isMounted:P,styles:S}=e.useTransitionStyles(l,{initial:{opacity:0}}),v=e.useDismiss(l),T=e.useRole(l),{getReferenceProps:r,getFloatingProps:A}=e.useInteractions([v,T]);return n.jsxs(n.Fragment,{children:[c({ref:w.setReference,...r()}),n.jsx(e.FloatingNode,{id:j,children:P&&n.jsx(e.FloatingPortal,{root:h,children:n.jsx(e.FloatingFocusManager,{context:l,modal:!1,restoreFocus:F,returnFocus:I,initialFocus:_,children:n.jsx("div",{ref:w.setFloating,style:{zIndex:x,...y},...A(),children:n.jsxs("div",{style:S,className:b(R.floating,i&&R.disablePadding),children:[t,!o&&n.jsx(e.FloatingArrow,{ref:a,context:l,width:Z,height:W,fill:"white"})]})})})})})]})},te=12,M=8,se=2,oe=({children:t,...s})=>e.useFloatingParentNodeId()==null?n.jsx(e.FloatingTree,{children:n.jsx($,{...s,children:t})}):n.jsx($,{...s,children:t}),$=({children:t,variant:s,trigger:o="hover",placement:c="bottom",hideArrow:i,renderTrigger:d,disablePadding:p,restoreFocus:F,returnFocus:I,initialFocus:_,appendTo:h,anchor:x,zIndex:j,onOpened:a,onClosed:m})=>{const[w,y]=u.useState(!1),l=e.useFloatingNodeId(),P=u.useRef(null),S=u.useCallback(O=>{y(O),O?a?.():m?.()},[m,a]),{refs:v,floatingStyles:T,context:r}=e.useFloating({nodeId:l,open:w,onOpenChange:S,placement:c,elements:{reference:x},middleware:[e.offset(M+se),e.flip({padding:5,fallbackAxisSideDirection:"start"}),e.shift({padding:5}),e.arrow({element:P})],whileElementsMounted:e.autoUpdate}),{isMounted:A,styles:N}=e.useTransitionStyles(r,{initial:{opacity:0}}),D=u.useCallback(()=>{y(!1)},[]),G=e.useDismiss(r),z=e.useRole(r),U=e.useFocus(r,{enabled:k(o,"focus")}),B=e.useClick(r,{enabled:k(o,"click")}),Y=e.useHover(r,{enabled:k(o,"hover"),handleClose:e.safePolygon(),restMs:100}),{getReferenceProps:J,getFloatingProps:K}=e.useInteractions([U,B,Y,G,z]);return n.jsxs(n.Fragment,{children:[d({ref:v.setReference,...J()}),n.jsx(e.FloatingNode,{id:l,children:A&&n.jsx(e.FloatingPortal,{root:h,children:n.jsx(e.FloatingFocusManager,{context:r,modal:!1,restoreFocus:F,returnFocus:I,initialFocus:_,children:n.jsx("div",{ref:v.setFloating,style:{zIndex:j,...T},...K(),children:n.jsxs("div",{style:N,className:b(R.floating,p&&R.disablePadding,s&&R.withIcon),children:[typeof t=="function"?t({onRequestClose:D}):t,!i&&n.jsx(e.FloatingArrow,{ref:P,context:r,width:te,height:M,fill:"white"})]})})})})})]})},k=(t,s)=>typeof t=="string"?t===s:t.includes(s),ie="_floating_15fk9_1",le="_withIcon_15fk9_10",re="_iconWrapper_15fk9_16",ae="_info_15fk9_36",ce="_warning_15fk9_42",de="_error_15fk9_48",C={floating:ie,withIcon:le,iconWrapper:re,info:ae,warning:ce,error:de},fe={info:g.stenaInfoCircle,warning:g.stenaExclamationCircle,error:g.stenaExclamationTriangle},ue=12,E=8,ge=2,pe=({children:t,visible:s,placement:o,label:c,variant:i,maxWidth:d="500px",appendTo:p,zIndex:F})=>{const[I,_]=u.useState(!1),h=u.useRef(null),{refs:x,floatingStyles:j,context:a}=e.useFloating({placement:o,open:s??I,onOpenChange:_,middleware:[e.offset(E+ge),e.flip({padding:5}),e.shift({padding:5}),e.arrow({element:h})],whileElementsMounted:e.autoUpdate}),{isMounted:m,styles:w}=e.useTransitionStyles(a,{initial:{opacity:0}}),y=e.useHover(a),{getReferenceProps:l}=e.useInteractions([y]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:x.setReference,...l(),children:t}),m&&n.jsx(e.FloatingPortal,{root:p,children:n.jsx("div",{ref:x.setFloating,style:{zIndex:F,...j},children:n.jsxs("div",{style:{maxWidth:d,...w},className:b(C.floating,i&&C.withIcon),children:[i?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:b(C.iconWrapper,C[i]),children:n.jsx(g.Icon,{icon:fe[i],size:16})}),n.jsx(f.Space,{}),n.jsx(q,{label:c})]}):n.jsx(q,{label:c}),n.jsx(e.FloatingArrow,{ref:h,context:a,width:ue,height:E,fill:"#333"})]})})})]})},q=({label:t})=>n.jsx(f.Text,{color:L.cssColor("--lhds-color-ui-50"),size:"small",variant:"bold",children:t});exports.ActionPrompt=Q;exports.ControlledPopover=ne;exports.Popover=oe;exports.Tooltip=pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const n=require("react/jsx-runtime"),f=require("@stenajs-webui/core"),g=require("@stenajs-webui/elements"),u=require("react"),e=require("@floating-ui/react"),b=require("classnames"),L=require("@stenajs-webui/theme"),Q=({text:t="Are you sure?",yesLabel:s="Yes",noLabel:o="No",onNo:c,onYes:i,loading:d})=>n.jsxs(f.Column,{position:"relative",children:[n.jsxs("div",{style:{opacity:d?0:1},children:[n.jsx(f.Text,{children:t}),n.jsx(f.Space,{}),n.jsxs(f.Row,{justifyContent:"flex-end",alignItems:"center",children:[n.jsx(g.FlatButton,{label:o,onClick:c}),n.jsx(f.Space,{}),n.jsx(g.PrimaryButton,{label:s,onClick:i})]})]}),d&&n.jsx(f.Row,{justifyContent:"center",alignItems:"center",left:0,top:0,width:"100%",height:"100%",position:"absolute",children:n.jsx(g.Spinner,{size:"small"})})]}),V="_floating_1glwr_1",X="_disablePadding_1glwr_11",R={floating:V,disablePadding:X},Z=12,W=8,ee=2,ne=({children:t,...s})=>e.useFloatingParentNodeId()==null?n.jsx(e.FloatingTree,{children:n.jsx(H,{...s,children:t})}):n.jsx(H,{...s,children:t}),H=({children:t,placement:s="bottom",hideArrow:o,renderTrigger:c,disablePadding:i,open:d,onRequestClose:p,restoreFocus:F,returnFocus:I,initialFocus:_,appendTo:h,zIndex:x})=>{const j=e.useFloatingNodeId(),a=u.useRef(null),m=u.useCallback(N=>{N||p()},[p]),{refs:w,floatingStyles:y,context:l}=e.useFloating({nodeId:j,open:d,onOpenChange:m,placement:s,middleware:[e.offset(W+ee),e.flip({padding:5}),e.shift({padding:5}),e.arrow({element:a})],whileElementsMounted:e.autoUpdate}),{isMounted:P,styles:S}=e.useTransitionStyles(l,{initial:{opacity:0}}),v=e.useDismiss(l),T=e.useRole(l),{getReferenceProps:r,getFloatingProps:A}=e.useInteractions([v,T]);return n.jsxs(n.Fragment,{children:[c({ref:w.setReference,...r()}),n.jsx(e.FloatingNode,{id:j,children:P&&n.jsx(e.FloatingPortal,{root:h,children:n.jsx(e.FloatingFocusManager,{context:l,modal:!1,restoreFocus:F,returnFocus:I,initialFocus:_,children:n.jsx("div",{ref:w.setFloating,style:{zIndex:x,...y},...A(),children:n.jsxs("div",{style:S,className:b(R.floating,i&&R.disablePadding),children:[t,!o&&n.jsx(e.FloatingArrow,{ref:a,context:l,width:Z,height:W,fill:"white"})]})})})})})]})},te=12,M=8,se=2,oe=({children:t,...s})=>e.useFloatingParentNodeId()==null?n.jsx(e.FloatingTree,{children:n.jsx($,{...s,children:t})}):n.jsx($,{...s,children:t}),$=({children:t,variant:s,trigger:o="hover",placement:c="bottom",hideArrow:i,renderTrigger:d,disablePadding:p,restoreFocus:F,returnFocus:I,initialFocus:_,appendTo:h,anchor:x,zIndex:j,onOpened:a,onClosed:m})=>{const[w,y]=u.useState(!1),l=e.useFloatingNodeId(),P=u.useRef(null),S=u.useCallback(O=>{y(O),O?a?.():m?.()},[m,a]),{refs:v,floatingStyles:T,context:r}=e.useFloating({nodeId:l,open:w,onOpenChange:S,placement:c,elements:{reference:x},middleware:[e.offset(M+se),e.flip({padding:5,fallbackAxisSideDirection:"start"}),e.shift({padding:5}),e.arrow({element:P})],whileElementsMounted:e.autoUpdate}),{isMounted:A,styles:N}=e.useTransitionStyles(r,{initial:{opacity:0}}),D=u.useCallback(()=>{y(!1)},[]),G=e.useDismiss(r),z=e.useRole(r),U=e.useFocus(r,{enabled:k(o,"focus")}),B=e.useClick(r,{enabled:k(o,"click")}),Y=e.useHover(r,{enabled:k(o,"hover"),handleClose:e.safePolygon(),restMs:100}),{getReferenceProps:J,getFloatingProps:K}=e.useInteractions([U,B,Y,G,z]);return n.jsxs(n.Fragment,{children:[d({ref:v.setReference,...J()}),n.jsx(e.FloatingNode,{id:l,children:A&&n.jsx(e.FloatingPortal,{root:h,children:n.jsx(e.FloatingFocusManager,{context:r,modal:!1,restoreFocus:F,returnFocus:I,initialFocus:_,children:n.jsx("div",{ref:v.setFloating,style:{zIndex:j,...T},...K(),children:n.jsxs("div",{style:N,className:b(R.floating,p&&R.disablePadding,s&&R.withIcon),children:[typeof t=="function"?t({onRequestClose:D}):t,!i&&n.jsx(e.FloatingArrow,{ref:P,context:r,width:te,height:M,fill:"white"})]})})})})})]})},k=(t,s)=>typeof t=="string"?t===s:t.includes(s),ie="_floating_15fk9_1",le="_withIcon_15fk9_10",re="_iconWrapper_15fk9_16",ae="_info_15fk9_36",ce="_warning_15fk9_42",de="_error_15fk9_48",C={floating:ie,withIcon:le,iconWrapper:re,info:ae,warning:ce,error:de},fe={info:g.stenaInfoCircle,warning:g.stenaExclamationCircle,error:g.stenaExclamationTriangle},ue=12,E=8,ge=2,pe=({children:t,visible:s,placement:o,label:c,variant:i,maxWidth:d="500px",appendTo:p,zIndex:F})=>{const[I,_]=u.useState(!1),h=u.useRef(null),{refs:x,floatingStyles:j,context:a}=e.useFloating({placement:o,open:s??I,onOpenChange:_,middleware:[e.offset(E+ge),e.flip({padding:5}),e.shift({padding:5}),e.arrow({element:h})],whileElementsMounted:e.autoUpdate}),{isMounted:m,styles:w}=e.useTransitionStyles(a,{initial:{opacity:0}}),y=e.useHover(a),{getReferenceProps:l}=e.useInteractions([y]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:x.setReference,...l(),children:t}),m&&n.jsx(e.FloatingPortal,{root:p,children:n.jsx("div",{ref:x.setFloating,style:{zIndex:F,...j},children:n.jsxs("div",{style:{maxWidth:d,...w},className:b(C.floating,i&&C.withIcon),children:[i?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:b(C.iconWrapper,C[i]),children:n.jsx(g.Icon,{icon:fe[i],size:16})}),n.jsx(f.Space,{}),n.jsx(q,{label:c})]}):n.jsx(q,{label:c}),n.jsx(e.FloatingArrow,{ref:h,context:a,width:ue,height:E,fill:"#333"})]})})})]})},q=({label:t})=>n.jsx(f.Text,{color:L.cssColor("--lhds-color-ui-50"),size:"small",variant:"bold",children:t});exports.ActionPrompt=Q;exports.ControlledPopover=ne;exports.Popover=oe;exports.Tooltip=pe;
3
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stenajs-webui/tooltip",
3
- "version": "23.16.2",
3
+ "version": "23.16.3",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "author": "mattias800",
@@ -20,7 +20,9 @@
20
20
  },
21
21
  "./package.json": "./package.json"
22
22
  },
23
- "sideEffects": false,
23
+ "sideEffects": [
24
+ "**/*.css"
25
+ ],
24
26
  "engines": {
25
27
  "node": ">=8",
26
28
  "npm": ">=5"
@@ -36,9 +38,9 @@
36
38
  },
37
39
  "dependencies": {
38
40
  "@floating-ui/react": "^0.27.3",
39
- "@stenajs-webui/core": "23.16.2",
40
- "@stenajs-webui/elements": "23.16.2",
41
- "@stenajs-webui/theme": "23.16.2",
41
+ "@stenajs-webui/core": "23.16.3",
42
+ "@stenajs-webui/elements": "23.16.3",
43
+ "@stenajs-webui/theme": "23.16.3",
42
44
  "classnames": "^2.5.1"
43
45
  },
44
46
  "peerDependencies": {
@@ -60,7 +62,7 @@
60
62
  "files": [
61
63
  "dist"
62
64
  ],
63
- "gitHead": "32e48cc18cf9361378c3805f8638c917cafda3ce",
65
+ "gitHead": "ed00286bddd313d67ef7e81bdec73f9e47cf7707",
64
66
  "publishConfig": {
65
67
  "access": "public"
66
68
  }