@stenajs-webui/tooltip 20.10.0 → 20.11.1
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 +6 -6
- package/dist/index.js +2 -2
- package/package.json +5 -5
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(".
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._noPadding_14drg_1 .tippy-content{padding:0}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:8px;font-size:14px;line-height:1.5;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-theme~=light]{box-shadow:var(--swui-shadow-popover);color:#26323d;background-color:#fff}.tippy-box[data-theme~=outlined]{border:1px solid var(--lhds-color-blue-500)}.tippy-box[data-theme~=info]{background-color:var(--lhds-color-blue-50);color:var(--swui-text-primary-color)}.tippy-box[data-theme~=info] .tippy-arrow{color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=warning]{background-color:var(--lhds-color-orange-50);color:var(--swui-text-primary-color)}.tippy-box[data-theme~=warning] .tippy-arrow{color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=error]{background-color:var(--lhds-color-red-50);color:var(--swui-text-primary-color)}.tippy-box[data-theme~=error] .tippy-arrow{color:var(--lhds-color-red-50)}.tippy-box[data-theme~=info][data-placement^=top]>.tippy-arrow:before{border-top-color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=info][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=info][data-placement^=left]>.tippy-arrow:before{border-left-color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=info][data-placement^=right]>.tippy-arrow:before{border-right-color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=warning][data-placement^=top]>.tippy-arrow:before{border-top-color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=warning][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=warning][data-placement^=left]>.tippy-arrow:before{border-left-color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=warning][data-placement^=right]>.tippy-arrow:before{border-right-color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=error][data-placement^=top]>.tippy-arrow:before{border-top-color:var(--lhds-color-red-50)}.tippy-box[data-theme~=error][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:var(--lhds-color-red-50)}.tippy-box[data-theme~=error][data-placement^=left]>.tippy-arrow:before{border-left-color:var(--lhds-color-red-50)}.tippy-box[data-theme~=error][data-placement^=right]>.tippy-arrow:before{border-right-color:var(--lhds-color-red-50)}._tooltip_1i1mn_1{display:flex;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;align-items:center;border-radius:var(--swui-border-radius);padding:var(--swui-metrics-spacing) calc(var(--swui-metrics-indent) * 2)}._tooltip_1i1mn_1._withIcon_1i1mn_8{padding:calc(var(--swui-metrics-spacing) * .5);padding-right:calc(var(--swui-metrics-indent) * 2)}._iconWrapper_1i1mn_14{--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_1i1mn_14 svg{color:var(--current-icon-color)}._iconWrapper_1i1mn_14._info_1i1mn_34{--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_1i1mn_14._warning_1i1mn_40{--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_1i1mn_14._error_1i1mn_46{--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 n, Fragment as S } from "react/jsx-runtime";
|
|
3
3
|
import { Column as W, Text as h, Space as a, Row as p, Box as j } from "@stenajs-webui/core";
|
|
4
4
|
import { FlatButton as f, PrimaryButton as k, Spinner as B, Icon as N, stenaInfoCircle as R, stenaExclamationCircle as $, stenaExclamationTriangle as b } from "@stenajs-webui/elements";
|
|
@@ -36,7 +36,7 @@ const sn = ({
|
|
|
36
36
|
children: /* @__PURE__ */ n(B, { size: "small" })
|
|
37
37
|
}
|
|
38
38
|
)
|
|
39
|
-
] }), L = "
|
|
39
|
+
] }), L = "_noPadding_14drg_1", Y = {
|
|
40
40
|
noPadding: L
|
|
41
41
|
}, q = (o = []) => {
|
|
42
42
|
const [t, i] = E(!1);
|
|
@@ -70,13 +70,13 @@ const sn = ({
|
|
|
70
70
|
disablePadding: d,
|
|
71
71
|
content: y,
|
|
72
72
|
maxWidth: w = "500px",
|
|
73
|
-
plugins:
|
|
74
|
-
lazy:
|
|
73
|
+
plugins: P,
|
|
74
|
+
lazy: x,
|
|
75
75
|
arrow: v = !0,
|
|
76
76
|
theme: I = "light",
|
|
77
77
|
...C
|
|
78
78
|
}) => {
|
|
79
|
-
const { plugins: T, mounted: z } = q(
|
|
79
|
+
const { plugins: T, mounted: z } = q(P);
|
|
80
80
|
return /* @__PURE__ */ n(
|
|
81
81
|
A,
|
|
82
82
|
{
|
|
@@ -88,7 +88,7 @@ const sn = ({
|
|
|
88
88
|
delay: l,
|
|
89
89
|
maxWidth: w,
|
|
90
90
|
arrow: v,
|
|
91
|
-
content: (!
|
|
91
|
+
content: (!x || z) && /* @__PURE__ */ n(j, { spacing: !d && 1, indent: !d && 1, children: y }),
|
|
92
92
|
plugins: T,
|
|
93
93
|
...C,
|
|
94
94
|
children: i && /* @__PURE__ */ n("div", { ref: r, children: i })
|
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(".
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("@stenajs-webui/core"),
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._noPadding_14drg_1 .tippy-content{padding:0}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:8px;font-size:14px;line-height:1.5;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-theme~=light]{box-shadow:var(--swui-shadow-popover);color:#26323d;background-color:#fff}.tippy-box[data-theme~=outlined]{border:1px solid var(--lhds-color-blue-500)}.tippy-box[data-theme~=info]{background-color:var(--lhds-color-blue-50);color:var(--swui-text-primary-color)}.tippy-box[data-theme~=info] .tippy-arrow{color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=warning]{background-color:var(--lhds-color-orange-50);color:var(--swui-text-primary-color)}.tippy-box[data-theme~=warning] .tippy-arrow{color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=error]{background-color:var(--lhds-color-red-50);color:var(--swui-text-primary-color)}.tippy-box[data-theme~=error] .tippy-arrow{color:var(--lhds-color-red-50)}.tippy-box[data-theme~=info][data-placement^=top]>.tippy-arrow:before{border-top-color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=info][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=info][data-placement^=left]>.tippy-arrow:before{border-left-color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=info][data-placement^=right]>.tippy-arrow:before{border-right-color:var(--lhds-color-blue-50)}.tippy-box[data-theme~=warning][data-placement^=top]>.tippy-arrow:before{border-top-color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=warning][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=warning][data-placement^=left]>.tippy-arrow:before{border-left-color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=warning][data-placement^=right]>.tippy-arrow:before{border-right-color:var(--lhds-color-orange-50)}.tippy-box[data-theme~=error][data-placement^=top]>.tippy-arrow:before{border-top-color:var(--lhds-color-red-50)}.tippy-box[data-theme~=error][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:var(--lhds-color-red-50)}.tippy-box[data-theme~=error][data-placement^=left]>.tippy-arrow:before{border-left-color:var(--lhds-color-red-50)}.tippy-box[data-theme~=error][data-placement^=right]>.tippy-arrow:before{border-right-color:var(--lhds-color-red-50)}._tooltip_1i1mn_1{display:flex;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;align-items:center;border-radius:var(--swui-border-radius);padding:var(--swui-metrics-spacing) calc(var(--swui-metrics-indent) * 2)}._tooltip_1i1mn_1._withIcon_1i1mn_8{padding:calc(var(--swui-metrics-spacing) * .5);padding-right:calc(var(--swui-metrics-indent) * 2)}._iconWrapper_1i1mn_14{--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_1i1mn_14 svg{color:var(--current-icon-color)}._iconWrapper_1i1mn_14._info_1i1mn_34{--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_1i1mn_14._warning_1i1mn_40{--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_1i1mn_14._error_1i1mn_46{--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"),i=require("@stenajs-webui/core"),s=require("@stenajs-webui/elements"),S=require("@tippyjs/react"),d=require("react"),x=require("classnames"),C=require("@stenajs-webui/theme"),q=({text:t="Are you sure?",yesLabel:o="Yes",noLabel:e="No",onNo:r,onYes:a,loading:c})=>n.jsxs(i.Column,{position:"relative",children:[n.jsxs("div",{style:{opacity:c?0:1},children:[n.jsx(i.Text,{children:t}),n.jsx(i.Space,{}),n.jsxs(i.Row,{justifyContent:"flex-end",alignItems:"center",children:[n.jsx(s.FlatButton,{label:e,onClick:r}),n.jsx(i.Space,{}),n.jsx(s.PrimaryButton,{label:o,onClick:a})]})]}),c&&n.jsx(i.Row,{justifyContent:"center",alignItems:"center",left:0,top:0,width:"100%",height:"100%",position:"absolute",children:n.jsx(s.Spinner,{size:"small"})})]}),z="_noPadding_14drg_1",B={noPadding:z},W=(t=[])=>{const[o,e]=d.useState(!1);return{plugins:[d.useMemo(()=>({fn:()=>({onShow:()=>e(!0),onHidden:()=>e(!1)})}),[e]),...t],mounted:o}},j={noPadding:B.noPadding},g={standard:"light",info:"info",warning:"warning",error:"error",outlined:"outlined"},p=({visible:t,trigger:o="mouseenter",children:e,tippyRef:r,delay:a=0,variant:c="standard",disablePadding:u,content:m,maxWidth:y="500px",plugins:_,lazy:f,arrow:P=!0,theme:v="light",...w})=>{const{plugins:T,mounted:I}=W(_);return n.jsx(S,{interactive:!0,className:j.noPadding,trigger:t!==void 0?void 0:o,visible:t,theme:`${v} ${g[c]??g.standard}`,delay:a,maxWidth:y,arrow:P,content:(!f||I)&&n.jsx(i.Box,{spacing:!u&&1,indent:!u&&1,children:m}),plugins:T,...w,children:e&&n.jsx("div",{ref:r,children:e})})},R=({children:t,onShow:o,onHide:e,...r})=>n.jsx(p,{content:t,trigger:"click",zIndex:1e3,onShow:o,onHide:e,children:n.jsx(s.FlatButton,{...r})}),b="_tooltip_1i1mn_1",k="_withIcon_1i1mn_8",N="_iconWrapper_1i1mn_14",A="_info_1i1mn_34",F="_warning_1i1mn_40",M="_error_1i1mn_46",l={tooltip:b,withIcon:k,iconWrapper:N,info:A,warning:F,error:M},$={info:s.stenaInfoCircle,warning:s.stenaExclamationCircle,error:s.stenaExclamationTriangle},h=({label:t})=>n.jsx(i.Text,{color:C.cssColor("--lhds-color-ui-50"),size:"small",variant:"bold",children:t}),E=({label:t,variant:o,children:e,...r})=>n.jsx(p,{theme:"dark",...r,disablePadding:!0,content:n.jsx("div",{className:x(l.tooltip,o?l.withIcon:null),children:o?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:x(l.iconWrapper,l[o]),children:n.jsx(s.Icon,{icon:$[o],size:16})}),n.jsx(i.Space,{}),n.jsx(h,{label:t})]}):n.jsx(h,{label:t})}),children:e}),H=()=>{const t=d.useRef();return[o=>{t.current=(o==null?void 0:o._tippy)??void 0},t]};exports.ActionPrompt=q;exports.ButtonWithPopover=R;exports.Popover=p;exports.Tooltip=E;exports.tippyStyles=j;exports.useTippyInstance=H;
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stenajs-webui/tooltip",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.11.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "mattias800",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"deploy": "gh-pages -d example/build"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@stenajs-webui/core": "20.
|
|
37
|
-
"@stenajs-webui/elements": "20.
|
|
38
|
-
"@stenajs-webui/theme": "20.
|
|
36
|
+
"@stenajs-webui/core": "20.11.1",
|
|
37
|
+
"@stenajs-webui/elements": "20.11.1",
|
|
38
|
+
"@stenajs-webui/theme": "20.11.1",
|
|
39
39
|
"@tippyjs/react": "^4.1.0",
|
|
40
40
|
"classnames": "^2.3.1",
|
|
41
41
|
"tippy.js": "^6.2.6"
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"files": [
|
|
63
63
|
"dist"
|
|
64
64
|
],
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "cdf5ab04f4a3950486a7d994ab05a643a8750e32"
|
|
66
66
|
}
|