@stenajs-webui/tooltip 21.26.0 → 21.28.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 +1 -1
- package/dist/index.js +1 -1
- package/package.json +15 -15
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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:-
|
|
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
2
|
import { jsxs as c, jsx as e, Fragment as F } from "react/jsx-runtime";
|
|
3
3
|
import { Column as me, Text as Z, Space as $, Row as q } from "@stenajs-webui/core";
|
|
4
4
|
import { FlatButton as _e, PrimaryButton as we, Spinner as ye, Icon as Ie, stenaInfoCircle as Re, stenaExclamationCircle as Pe, stenaExclamationTriangle as ve } from "@stenajs-webui/elements";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +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:-
|
|
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
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("@stenajs-webui/core"),h=require("@stenajs-webui/elements"),g=require("react"),e=require("@floating-ui/react"),T=require("classnames"),K=require("@stenajs-webui/theme"),L=({text:t="Are you sure?",yesLabel:o="Yes",noLabel:s="No",onNo:d,onYes:r,loading:f})=>n.jsxs(u.Column,{position:"relative",children:[n.jsxs("div",{style:{opacity:f?0:1},children:[n.jsx(u.Text,{children:t}),n.jsx(u.Space,{}),n.jsxs(u.Row,{justifyContent:"flex-end",alignItems:"center",children:[n.jsx(h.FlatButton,{label:s,onClick:d}),n.jsx(u.Space,{}),n.jsx(h.PrimaryButton,{label:o,onClick:r})]})]}),f&&n.jsx(u.Row,{justifyContent:"center",alignItems:"center",left:0,top:0,width:"100%",height:"100%",position:"absolute",children:n.jsx(h.Spinner,{size:"small"})})]}),Q="_floating_1glwr_1",V="_disablePadding_1glwr_11",X="_iconWrapper_1glwr_16",Z="_info_1glwr_36",ee="_warning_1glwr_42",ne="_error_1glwr_48",R={floating:Q,disablePadding:V,iconWrapper:X,info:Z,warning:ee,error:ne},te=12,$=8,oe=2,se=({children:t,...o})=>e.useFloatingParentNodeId()==null?n.jsx(e.FloatingTree,{children:n.jsx(H,{...o,children:t})}):n.jsx(H,{...o,children:t}),H=({children:t,placement:o="bottom",hideArrow:s,renderTrigger:d,disablePadding:r,open:f,onRequestClose:x,restoreFocus:w,returnFocus:y,initialFocus:F,appendTo:j,zIndex:m})=>{const c=e.useFloatingNodeId(),i=g.useRef(null),I=g.useCallback(A=>{A||x()},[x]),{refs:p,floatingStyles:_,context:l}=e.useFloating({nodeId:c,open:f,onOpenChange:I,placement:o,middleware:[e.offset($+oe),e.flip({padding:5}),e.shift({padding:5}),e.arrow({element:i})],whileElementsMounted:e.autoUpdate}),{isMounted:b,styles:P}=e.useTransitionStyles(l,{initial:{opacity:0}}),S=e.useDismiss(l),a=e.useRole(l),{getReferenceProps:C,getFloatingProps:W}=e.useInteractions([S,a]);return n.jsxs(n.Fragment,{children:[d({ref:p.setReference,...C()}),n.jsx(e.FloatingNode,{id:c,children:b&&n.jsx(e.FloatingPortal,{root:j,children:n.jsx(e.FloatingFocusManager,{context:l,modal:!1,restoreFocus:w,returnFocus:y,initialFocus:F,children:n.jsx("div",{ref:p.setFloating,style:{zIndex:m,..._},...W(),children:n.jsxs("div",{style:P,className:T(R.floating,r&&R.disablePadding),children:[t,!s&&n.jsx(e.FloatingArrow,{ref:i,context:l,width:te,height:$,fill:"white"})]})})})})})]})},ie=12,M=8,re=2,le=({children:t,...o})=>e.useFloatingParentNodeId()==null?n.jsx(e.FloatingTree,{children:n.jsx(O,{...o,children:t})}):n.jsx(O,{...o,children:t}),O=({children:t,variant:o,trigger:s="hover",placement:d="bottom",hideArrow:r,renderTrigger:f,disablePadding:x,restoreFocus:w,returnFocus:y,initialFocus:F,appendTo:j,zIndex:m,onOpened:c,onClosed:i})=>{const[I,p]=g.useState(!1),_=e.useFloatingNodeId(),l=g.useRef(null),b=g.useCallback(k=>{p(k),k?c==null||c():i==null||i()},[i,c]),{refs:P,floatingStyles:S,context:a}=e.useFloating({nodeId:_,open:I,onOpenChange:b,placement:d,middleware:[e.offset(M+re),e.flip({padding:5}),e.shift({padding:5}),e.arrow({element:l})],whileElementsMounted:e.autoUpdate}),{isMounted:C,styles:W}=e.useTransitionStyles(a,{initial:{opacity:0}}),A=g.useCallback(()=>{p(!1)},[]),G=e.useDismiss(a),D=e.useRole(a),z=e.useFocus(a,{enabled:N(s,"focus")}),U=e.useClick(a,{enabled:N(s,"click")}),B=e.useHover(a,{enabled:N(s,"hover"),handleClose:e.safePolygon(),restMs:100}),{getReferenceProps:Y,getFloatingProps:J}=e.useInteractions([z,U,B,G,D]);return n.jsxs(n.Fragment,{children:[f({ref:P.setReference,...Y()}),n.jsx(e.FloatingNode,{id:_,children:C&&n.jsx(e.FloatingPortal,{root:j,children:n.jsx(e.FloatingFocusManager,{context:a,modal:!1,restoreFocus:w,returnFocus:y,initialFocus:F,children:n.jsx("div",{ref:P.setFloating,style:{zIndex:m,...S},...J(),children:n.jsxs("div",{style:W,className:T(R.floating,x&&R.disablePadding,o&&R.withIcon),children:[typeof t=="function"?t({onRequestClose:A}):t,!r&&n.jsx(e.FloatingArrow,{ref:l,context:a,width:ie,height:M,fill:"white"})]})})})})})]})},N=(t,o)=>typeof t=="string"?t===o:t.includes(o),ae="_floating_15fk9_1",ce="_withIcon_15fk9_10",de="_iconWrapper_15fk9_16",fe="_info_15fk9_36",ue="_warning_15fk9_42",ge="_error_15fk9_48",v={floating:ae,withIcon:ce,iconWrapper:de,info:fe,warning:ue,error:ge},pe={info:h.stenaInfoCircle,warning:h.stenaExclamationCircle,error:h.stenaExclamationTriangle},he=12,E=8,xe=2,je=({children:t,visible:o,placement:s,label:d,variant:r,maxWidth:f="500px",appendTo:x,zIndex:w})=>{const[y,F]=g.useState(!1),j=g.useRef(null),{refs:m,floatingStyles:c,context:i}=e.useFloating({placement:s,open:o??y,onOpenChange:F,middleware:[e.offset(E+xe),e.flip({padding:5}),e.shift({padding:5}),e.arrow({element:j})],whileElementsMounted:e.autoUpdate}),{isMounted:I,styles:p}=e.useTransitionStyles(i,{initial:{opacity:0}}),_=e.useHover(i),{getReferenceProps:l}=e.useInteractions([_]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:m.setReference,...l(),children:t}),I&&n.jsx(e.FloatingPortal,{root:x,children:n.jsx("div",{ref:m.setFloating,style:{zIndex:w,...c},children:n.jsxs("div",{style:{maxWidth:f,...p},className:T(v.floating,r&&v.withIcon),children:[r?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:T(v.iconWrapper,v[r]),children:n.jsx(h.Icon,{icon:pe[r],size:16})}),n.jsx(u.Space,{}),n.jsx(q,{label:d})]}):n.jsx(q,{label:d}),n.jsx(e.FloatingArrow,{ref:j,context:i,width:he,height:E,fill:"#333"})]})})})]})},q=({label:t})=>n.jsx(u.Text,{color:K.cssColor("--lhds-color-ui-50"),size:"small",variant:"bold",children:t});exports.ActionPrompt=L;exports.ControlledPopover=se;exports.Popover=le;exports.Tooltip=je;
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stenajs-webui/tooltip",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.28.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "mattias800",
|
|
@@ -34,29 +34,29 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@floating-ui/react": "^0.26.22",
|
|
37
|
-
"@stenajs-webui/core": "21.
|
|
38
|
-
"@stenajs-webui/elements": "21.
|
|
39
|
-
"@stenajs-webui/theme": "21.
|
|
37
|
+
"@stenajs-webui/core": "21.28.0",
|
|
38
|
+
"@stenajs-webui/elements": "21.28.0",
|
|
39
|
+
"@stenajs-webui/theme": "21.28.0",
|
|
40
40
|
"classnames": "^2.5.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@emotion/react": ">=11.
|
|
44
|
-
"@emotion/styled": ">=11.
|
|
43
|
+
"@emotion/react": ">=11.14.0",
|
|
44
|
+
"@emotion/styled": ">=11.14.0",
|
|
45
45
|
"prop-types": ">=15.5.4",
|
|
46
|
-
"react": ">=
|
|
47
|
-
"react-dom": ">=
|
|
46
|
+
"react": ">=19.0.0",
|
|
47
|
+
"react-dom": ">=19.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@emotion/react": "^11.
|
|
51
|
-
"@emotion/styled": "^11.
|
|
52
|
-
"@types/react": "^
|
|
53
|
-
"@types/react-dom": "^
|
|
50
|
+
"@emotion/react": "^11.14.0",
|
|
51
|
+
"@emotion/styled": "^11.14.0",
|
|
52
|
+
"@types/react": "^19.0.7",
|
|
53
|
+
"@types/react-dom": "^19.0.3",
|
|
54
54
|
"prop-types": "^15.5.4",
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-dom": "^
|
|
55
|
+
"react": "^19.0.0",
|
|
56
|
+
"react-dom": "^19.0.0"
|
|
57
57
|
},
|
|
58
58
|
"files": [
|
|
59
59
|
"dist"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "0f8cae612416d20594a94d021d01248379cd3eb1"
|
|
62
62
|
}
|