@nightshadeui/components 3.2.0 → 3.4.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/components/Bubble.css +1 -1
- package/dist/components/Bubble.js +1 -1
- package/dist/components/Bubble.vue.d.ts.map +1 -1
- package/dist/components/ContextPopup.js +1 -1
- package/dist/components/Tooltip.css +1 -1
- package/dist/components/Tooltip.js +25 -16
- package/dist/components/Tooltip.vue.d.ts +2 -0
- package/dist/components/Tooltip.vue.d.ts.map +1 -1
- package/dist/components.css +2 -2
- package/package.json +3 -3
- package/src/components/Bubble.vue +42 -26
- package/src/components/ContextPopup.vue +1 -1
- package/src/components/Tooltip.vue +23 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer nightshade;@layer nightshade-components{.Bubble[data-v-
|
|
1
|
+
@layer nightshade;@layer nightshade-components{.Bubble[data-v-f27c2b6e]{--Bubble-background:var(--surface-raised);--Bubble-arrow-size:var(--sp);--Bubble-arrow-offset:var(--sp2);--Bubble-radius:var(--radius-m);--Bubble-max-width:calc(100vw - var(--sp4));--Bubble-shadow:var(--shadow-light);--Bubble-filter:drop-shadow(0 1px 3px var(--Bubble-shadow));z-index:10;width:0;height:0;filter:var(--Bubble-filter);position:absolute}.Body[data-v-f27c2b6e]{width:max-content;max-width:var(--Bubble-max-width);min-width:var(--sp6);min-height:var(--sp2);border-radius:var(--Bubble-radius);background:var(--Bubble-background);position:absolute}.Arrow[data-v-f27c2b6e]{background:var(--Bubble-background);position:absolute}.Bubble-top>.Body[data-v-f27c2b6e]{bottom:var(--Bubble-arrow-size)}.Bubble-bottom>.Body[data-v-f27c2b6e]{top:var(--Bubble-arrow-size)}.Bubble-left>.Body[data-v-f27c2b6e]{right:var(--Bubble-arrow-size)}.Bubble-right>.Body[data-v-f27c2b6e]{left:var(--Bubble-arrow-size)}.Bubble-start.Bubble-top>.Body[data-v-f27c2b6e],.Bubble-start.Bubble-bottom>.Body[data-v-f27c2b6e]{left:calc(-1 * var(--Bubble-arrow-offset))}.Bubble-center.Bubble-top>.Body[data-v-f27c2b6e],.Bubble-center.Bubble-bottom>.Body[data-v-f27c2b6e]{left:0;transform:translate(-50%)}.Bubble-end.Bubble-top>.Body[data-v-f27c2b6e],.Bubble-end.Bubble-bottom>.Body[data-v-f27c2b6e]{right:calc(-1 * var(--Bubble-arrow-offset))}.Bubble-start.Bubble-left>.Body[data-v-f27c2b6e],.Bubble-start.Bubble-right>.Body[data-v-f27c2b6e]{top:calc(-1 * var(--Bubble-arrow-offset))}.Bubble-center.Bubble-left>.Body[data-v-f27c2b6e],.Bubble-center.Bubble-right>.Body[data-v-f27c2b6e]{top:0;transform:translateY(-50%)}.Bubble-end.Bubble-left>.Body[data-v-f27c2b6e],.Bubble-end.Bubble-right>.Body[data-v-f27c2b6e]{bottom:calc(-1 * var(--Bubble-arrow-offset))}.Bubble-top>.Arrow[data-v-f27c2b6e],.Bubble-bottom>.Arrow[data-v-f27c2b6e]{left:calc(-1 * var(--Bubble-arrow-size));width:calc(2 * var(--Bubble-arrow-size));height:var(--Bubble-arrow-size)}.Bubble-left>.Arrow[data-v-f27c2b6e],.Bubble-right>.Arrow[data-v-f27c2b6e]{top:calc(-1 * var(--Bubble-arrow-size));width:var(--Bubble-arrow-size);height:calc(2 * var(--Bubble-arrow-size))}.Bubble-top>.Arrow[data-v-f27c2b6e]{clip-path:polygon(0 0,100% 0,50% 100%);bottom:0}.Bubble-bottom>.Arrow[data-v-f27c2b6e]{clip-path:polygon(50% 0,100% 100%,0 100%);top:0}.Bubble-left>.Arrow[data-v-f27c2b6e]{clip-path:polygon(0 0,100% 50%,0 100%);right:0}.Bubble-right>.Arrow[data-v-f27c2b6e]{clip-path:polygon(0 50%,100% 0,100% 100%);left:0}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bubble.vue.d.ts","sourceRoot":"","sources":["../../src/components/Bubble.vue"],"names":[],"mappings":"AAmBA;
|
|
1
|
+
{"version":3,"file":"Bubble.vue.d.ts","sourceRoot":"","sources":["../../src/components/Bubble.vue"],"names":[],"mappings":"AAmBA;wBA2K0B,OAAO,YAAY;;oCAE/B,EAAE;qCACF,OAAO,KAAK,EAAE,gBAAgB;oCAG9B,EAAE;0BAgHF,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAUG;AAzHH;;kBAsGc,CAAC,KAAK,IAAgB,KAAK,GAAG;;EAM3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer nightshade;@layer nightshade-components{.Tooltip[data-v-
|
|
1
|
+
@layer nightshade;@layer nightshade-components{.Tooltip[data-v-5e400a76]{--Tooltip-padding:var(--sp1) var(--sp1-5);--Tooltip-gap:var(--sp0-5);--Tooltip-width:var(--sp40);--Tooltip-title:var(--text-base);--Tooltip-text:var(--text-subtle);gap:var(--Tooltip-gap);width:max-content;max-width:var(--Tooltip-width);padding:var(--Tooltip-padding);font-size:var(--font-size-s);flex-flow:column;display:flex}.Title[data-v-5e400a76]{font-weight:var(--font-weight-bold);color:var(--Tooltip-title)}.Text[data-v-5e400a76]{color:var(--Tooltip-text)}.Text[data-v-5e400a76]:first-child{color:var(--Tooltip-title)}}
|
|
@@ -5,7 +5,7 @@ import t from "./ContextPopup.js";
|
|
|
5
5
|
import n from "../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
import { createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, openBlock as s, renderSlot as c, resolveComponent as l, toDisplayString as u, withCtx as d } from "vue";
|
|
7
7
|
// src/components/Tooltip.vue
|
|
8
|
-
var f = 300, p = {
|
|
8
|
+
var f = 300, p = 100, m = {
|
|
9
9
|
components: { ContextPopup: t },
|
|
10
10
|
mixins: [e],
|
|
11
11
|
props: {
|
|
@@ -36,62 +36,71 @@ var f = 300, p = {
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
created() {
|
|
39
|
-
this.showTimer = null, this.anchorTitle = null;
|
|
39
|
+
this.showTimer = null, this.hideTimer = null, this.anchorTitle = null;
|
|
40
40
|
},
|
|
41
41
|
mounted() {
|
|
42
|
-
this.anchor = this.resolvedProps.anchorEl ?? this.$el.parentElement, this.anchor.addEventListener("pointerenter", this.onPointerEnter), this.anchor.addEventListener("pointerleave", this.
|
|
42
|
+
this.anchor = this.resolvedProps.anchorEl ?? this.$el.parentElement, this.anchor.addEventListener("pointerenter", this.onPointerEnter), this.anchor.addEventListener("pointerleave", this.scheduleHide), this.anchor.addEventListener("pointerdown", this.hide), this.anchor.addEventListener("focusin", this.onFocusIn), this.anchor.addEventListener("focusout", this.hide);
|
|
43
43
|
},
|
|
44
44
|
beforeUnmount() {
|
|
45
|
-
this.hide(), this.anchor.removeEventListener("pointerenter", this.onPointerEnter), this.anchor.removeEventListener("pointerleave", this.
|
|
45
|
+
this.hide(), this.anchor.removeEventListener("pointerenter", this.onPointerEnter), this.anchor.removeEventListener("pointerleave", this.scheduleHide), this.anchor.removeEventListener("pointerdown", this.hide), this.anchor.removeEventListener("focusin", this.onFocusIn), this.anchor.removeEventListener("focusout", this.hide);
|
|
46
46
|
},
|
|
47
47
|
methods: {
|
|
48
48
|
show() {
|
|
49
|
-
clearTimeout(this.showTimer), !this.shown && this.hasContent && (this.anchorTitle = this.anchor.getAttribute("title"), this.anchor.removeAttribute("title"), this.anchor.setAttribute("aria-describedby", this.tooltipId), window.addEventListener("scroll", this.hide, {
|
|
49
|
+
clearTimeout(this.showTimer), this.cancelHide(), !this.shown && this.hasContent && (this.anchorTitle = this.anchor.getAttribute("title"), this.anchor.removeAttribute("title"), this.anchor.setAttribute("aria-describedby", this.tooltipId), window.addEventListener("scroll", this.hide, {
|
|
50
50
|
capture: !0,
|
|
51
51
|
passive: !0
|
|
52
52
|
}), this.shown = !0);
|
|
53
53
|
},
|
|
54
54
|
hide() {
|
|
55
|
-
clearTimeout(this.showTimer), this.shown &&= (this.anchorTitle != null && this.anchor.setAttribute("title", this.anchorTitle), this.anchor.removeAttribute("aria-describedby"), window.removeEventListener("scroll", this.hide, { capture: !0 }), !1);
|
|
55
|
+
clearTimeout(this.showTimer), this.cancelHide(), this.shown &&= (this.anchorTitle != null && this.anchor.setAttribute("title", this.anchorTitle), this.anchor.removeAttribute("aria-describedby"), window.removeEventListener("scroll", this.hide, { capture: !0 }), !1);
|
|
56
|
+
},
|
|
57
|
+
scheduleHide() {
|
|
58
|
+
clearTimeout(this.showTimer), clearTimeout(this.hideTimer), this.hideTimer = setTimeout(() => this.hide(), p);
|
|
59
|
+
},
|
|
60
|
+
cancelHide() {
|
|
61
|
+
clearTimeout(this.hideTimer);
|
|
56
62
|
},
|
|
57
63
|
onPointerEnter(e) {
|
|
58
|
-
e.pointerType === "mouse" && (clearTimeout(this.showTimer), this.showTimer = setTimeout(() => this.show(), f));
|
|
64
|
+
e.pointerType === "mouse" && (this.cancelHide(), this.shown || (clearTimeout(this.showTimer), this.showTimer = setTimeout(() => this.show(), f)));
|
|
59
65
|
},
|
|
60
66
|
onFocusIn(e) {
|
|
61
67
|
e.target.matches(":focus-visible") && this.show();
|
|
62
68
|
}
|
|
63
69
|
}
|
|
64
|
-
},
|
|
70
|
+
}, h = ["id"], g = {
|
|
65
71
|
key: 0,
|
|
66
72
|
class: "Title"
|
|
67
|
-
},
|
|
73
|
+
}, _ = {
|
|
68
74
|
key: 1,
|
|
69
75
|
class: "Text"
|
|
70
76
|
};
|
|
71
|
-
function
|
|
77
|
+
function v(e, t, n, f, p, m) {
|
|
72
78
|
let v = l("ContextPopup");
|
|
73
79
|
return p.shown ? (s(), r(v, {
|
|
74
80
|
key: 0,
|
|
75
81
|
dir: e.resolvedProps.dir,
|
|
76
82
|
align: e.resolvedProps.align,
|
|
77
83
|
anchorEl: p.anchor,
|
|
78
|
-
anchorDir: "auto",
|
|
79
84
|
overlayEnabled: !1,
|
|
80
85
|
overlayShown: !1,
|
|
81
|
-
|
|
86
|
+
onMouseenter: m.cancelHide,
|
|
87
|
+
onMouseleave: m.scheduleHide,
|
|
88
|
+
onHide: m.hide
|
|
82
89
|
}, {
|
|
83
90
|
default: d(() => [o("div", {
|
|
84
|
-
id:
|
|
91
|
+
id: m.tooltipId,
|
|
85
92
|
class: "Tooltip",
|
|
86
93
|
role: "tooltip"
|
|
87
|
-
}, [c(e.$slots, "default", {}, () => [e.resolvedProps.title ? (s(), a("div",
|
|
94
|
+
}, [c(e.$slots, "default", {}, () => [e.resolvedProps.title ? (s(), a("div", g, u(e.resolvedProps.title), 1)) : i("", !0), e.resolvedProps.text ? (s(), a("div", _, u(e.resolvedProps.text), 1)) : i("", !0)], !0)], 8, h)]),
|
|
88
95
|
_: 3
|
|
89
96
|
}, 8, [
|
|
90
97
|
"dir",
|
|
91
98
|
"align",
|
|
92
99
|
"anchorEl",
|
|
100
|
+
"onMouseenter",
|
|
101
|
+
"onMouseleave",
|
|
93
102
|
"onHide"
|
|
94
103
|
])) : i("", !0);
|
|
95
104
|
}
|
|
96
|
-
var
|
|
97
|
-
export {
|
|
105
|
+
var y = /*#__PURE__*/ n(m, [["render", v], ["__scopeId", "data-v-5e400a76"]]);
|
|
106
|
+
export { y as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/Tooltip.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/Tooltip.vue"],"names":[],"mappings":"AA8BA;wBA0N0B,OAAO,YAAY;;oCAK/B,OAAO,sBAAsB;qCAC7B,OAAO,KAAK,EAAE,gBAAgB;oCAG9B,EAAE;0BAmFF,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEAuHG;;;;AAzMH;;kBAyEc,CAAC,KAAK,IAAiB,KAAK,GAAG;;EAM5C;yBArGwB,oBAAoB"}
|
package/dist/components.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
@layer nightshade;@layer nightshade-components{.Btn[data-v-363985f6]{--Btn-size:var(--input-major-height);--Btn-padding:var(--input-major-padding);--Btn-gap:var(--input-gap);--Btn-font-size:var(--input-font-size);--Btn-text:var(--tone-fill-text);--Btn-outline:transparent;--Btn-fill:var(--tone-fill);--Btn-fill-top:var(--tone-fill-top);--Btn-fill-bottom:var(--tone-fill-bottom);--Btn-background:linear-gradient(to bottom, var(--Btn-fill-top), var(--Btn-fill-bottom));--Btn-border-size:0px;--Btn-border:transparent;--Btn-radius:var(--radius-m);--Btn-shadow:var(--tone-shadow);--Btn-box-shadow:0 1px 1px var(--Btn-shadow), 0 1px 5px var(--shadow-medium);--Btn-text-shadow:0 1px 1px var(--text-shadow-auto);appearance:none;padding:0 calc(var(--Btn-padding) - var(--Btn-border-size));height:var(--Btn-size);line-height:var(--Btn-size);box-sizing:border-box;justify-content:flex-start;align-items:center;gap:var(--Btn-gap);border:var(--Btn-border-size) solid var(--Btn-border);border-radius:var(--Btn-radius);color:var(--Btn-text);text-shadow:var(--Btn-text-shadow);outline:var(--input-outline-size) solid var(--Btn-outline);outline-offset:var(--input-outline-offset);background:var(--Btn-background);box-shadow:var(--Btn-box-shadow);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:inherit;font-size:var(--Btn-font-size);flex-shrink:0;margin:0;transition:color .3s,outline .3s,filter .3s,border-radius .3s;display:inline-flex;position:relative}.Btn[data-v-363985f6]:after{content:"";z-index:1;border-radius:var(--Btn-radius);background:var(--input-hover-overlay);mix-blend-mode:color-dodge;pointer-events:none;opacity:0;width:100%;height:100%;position:absolute;top:0;left:0}.Label[data-v-363985f6]{line-height:var(--Btn-size);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.Icon[data-v-363985f6]{width:var(--sp2);font-size:var(--Btn-font-size);justify-content:center;align-items:center;display:flex}.Btn-iconPos-right .Icon[data-v-363985f6]{order:100}.Btn[data-v-363985f6]:focus,.Btn[data-v-363985f6]:active,.Btn[data-v-363985f6]:hover{transition:none}.Btn[data-v-363985f6]:not(.Btn-disabled):hover:after,.Btn.Btn-forceHover[data-v-363985f6]:after{opacity:1}.Btn[data-v-363985f6]:not(.Btn-disabled):focus-visible,.Btn.Btn-forceFocus[data-v-363985f6]{z-index:10;--Btn-outline:var(--tone-focus-outline);--Btn-border:var(--tone-focus-border)}.Btn[data-v-363985f6]:not(.Btn-disabled):active,.Btn.Btn-forceActive[data-v-363985f6]{box-shadow:0 6px 12px var(--shadow-light) inset, 0 1px 2px var(--shadow-medium) inset;padding-top:1px}.Btn-disabled[data-v-363985f6]{opacity:var(--input-disabled-opacity);filter:var(--input-disabled-filter);cursor:not-allowed}.Btn-round[data-v-363985f6]{--Btn-radius:calc(.5 * var(--Btn-size))}.Btn-outline[data-v-363985f6]{--Btn-border:var(--tone-border);--Btn-border-size:var(--input-border-size)}.Btn-ghost[data-v-363985f6]{--Btn-fill:transparent;--Btn-fill-top:transparent;--Btn-fill-bottom:transparent;--Btn-border:var(--tone-text);--Btn-text:var(--tone-text);--Btn-text-shadow:none;--Btn-box-shadow:none}.Btn-flat[data-v-363985f6]{--Btn-fill-top:var(--Btn-fill);--Btn-fill-bottom:var(--Btn-fill);--Btn-text-shadow:none;--Btn-box-shadow:none}.Btn-translucent[data-v-363985f6]{--Btn-background:linear-gradient(to bottom, color-mix(in srgb, var(--Btn-fill-top), transparent var(--translucency-mix-light)), color-mix(in srgb, var(--Btn-fill-bottom), transparent var(--translucency-mix-light)));--Btn-box-shadow:0 1px 1px var(--Btn-shadow), 0 1px 5px var(--shadow-medium), 0 0 3px var(--translucency-highlight) inset;-webkit-backdrop-filter:blur(var(--translucency-blur));backdrop-filter:blur(var(--translucency-blur))}.Btn-flat.Btn-translucent[data-v-363985f6]{--Btn-box-shadow:0 0 3px var(--translucency-highlight) inset}.Btn-ghost.Btn-translucent[data-v-363985f6]{--Btn-background:transparent;--Btn-box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}.Btn-square[data-v-363985f6]{width:var(--Btn-size);justify-content:center;padding-left:0;padding-right:0}.Btn-block[data-v-363985f6]{flex:auto;justify-content:center;display:flex}}
|
|
4
4
|
|
|
5
|
-
@layer nightshade;@layer nightshade-components{.Bubble[data-v-
|
|
5
|
+
@layer nightshade;@layer nightshade-components{.Bubble[data-v-f27c2b6e]{--Bubble-background:var(--surface-raised);--Bubble-arrow-size:var(--sp);--Bubble-arrow-offset:var(--sp2);--Bubble-radius:var(--radius-m);--Bubble-max-width:calc(100vw - var(--sp4));--Bubble-shadow:var(--shadow-light);--Bubble-filter:drop-shadow(0 1px 3px var(--Bubble-shadow));z-index:10;width:0;height:0;filter:var(--Bubble-filter);position:absolute}.Body[data-v-f27c2b6e]{width:max-content;max-width:var(--Bubble-max-width);min-width:var(--sp6);min-height:var(--sp2);border-radius:var(--Bubble-radius);background:var(--Bubble-background);position:absolute}.Arrow[data-v-f27c2b6e]{background:var(--Bubble-background);position:absolute}.Bubble-top>.Body[data-v-f27c2b6e]{bottom:var(--Bubble-arrow-size)}.Bubble-bottom>.Body[data-v-f27c2b6e]{top:var(--Bubble-arrow-size)}.Bubble-left>.Body[data-v-f27c2b6e]{right:var(--Bubble-arrow-size)}.Bubble-right>.Body[data-v-f27c2b6e]{left:var(--Bubble-arrow-size)}.Bubble-start.Bubble-top>.Body[data-v-f27c2b6e],.Bubble-start.Bubble-bottom>.Body[data-v-f27c2b6e]{left:calc(-1 * var(--Bubble-arrow-offset))}.Bubble-center.Bubble-top>.Body[data-v-f27c2b6e],.Bubble-center.Bubble-bottom>.Body[data-v-f27c2b6e]{left:0;transform:translate(-50%)}.Bubble-end.Bubble-top>.Body[data-v-f27c2b6e],.Bubble-end.Bubble-bottom>.Body[data-v-f27c2b6e]{right:calc(-1 * var(--Bubble-arrow-offset))}.Bubble-start.Bubble-left>.Body[data-v-f27c2b6e],.Bubble-start.Bubble-right>.Body[data-v-f27c2b6e]{top:calc(-1 * var(--Bubble-arrow-offset))}.Bubble-center.Bubble-left>.Body[data-v-f27c2b6e],.Bubble-center.Bubble-right>.Body[data-v-f27c2b6e]{top:0;transform:translateY(-50%)}.Bubble-end.Bubble-left>.Body[data-v-f27c2b6e],.Bubble-end.Bubble-right>.Body[data-v-f27c2b6e]{bottom:calc(-1 * var(--Bubble-arrow-offset))}.Bubble-top>.Arrow[data-v-f27c2b6e],.Bubble-bottom>.Arrow[data-v-f27c2b6e]{left:calc(-1 * var(--Bubble-arrow-size));width:calc(2 * var(--Bubble-arrow-size));height:var(--Bubble-arrow-size)}.Bubble-left>.Arrow[data-v-f27c2b6e],.Bubble-right>.Arrow[data-v-f27c2b6e]{top:calc(-1 * var(--Bubble-arrow-size));width:var(--Bubble-arrow-size);height:calc(2 * var(--Bubble-arrow-size))}.Bubble-top>.Arrow[data-v-f27c2b6e]{clip-path:polygon(0 0,100% 0,50% 100%);bottom:0}.Bubble-bottom>.Arrow[data-v-f27c2b6e]{clip-path:polygon(50% 0,100% 100%,0 100%);top:0}.Bubble-left>.Arrow[data-v-f27c2b6e]{clip-path:polygon(0 0,100% 50%,0 100%);right:0}.Bubble-right>.Arrow[data-v-f27c2b6e]{clip-path:polygon(0 50%,100% 0,100% 100%);left:0}}
|
|
6
6
|
|
|
7
7
|
@layer nightshade;@layer nightshade-components{.Checkbox[data-v-340042a7]{--Checkbox-size:var(--input-minor-height);--Checkbox-outline:transparent;--Checkbox-background:var(--surface-deep);--Checkbox-border-size:0px;--Checkbox-border:transparent;--Checkbox-radius:var(--radius-m);--Checkbox-box-shadow:0 1px 3px var(--Checkbox-shadow) inset, 0 0 5px -1px var(--Checkbox-shadow) inset;--Checkbox-shadow:var(--shadow-light);--Checkbox-mark-text-shadow:0 1px 1px var(--text-shadow-auto);width:var(--Checkbox-size);height:var(--Checkbox-size);border:var(--Checkbox-border-size) solid var(--Checkbox-border);border-radius:var(--Checkbox-radius);background:var(--Checkbox-background);outline:var(--input-outline-size) solid var(--Checkbox-outline);outline-offset:var(--input-outline-offset);font-size:var(--Checkbox-size);color:var(--tone-fill-text);text-shadow:var(--Checkbox-mark-text-shadow);box-shadow:var(--Checkbox-box-shadow);cursor:pointer;-webkit-user-select:none;user-select:none;background-clip:border-box;justify-content:center;align-items:center;transition:background-color .3s,border-radius .3s;display:inline-flex;position:relative;overflow:hidden}.Checkbox input[data-v-340042a7]{display:none}.Mark[data-v-340042a7]{opacity:0;transition:opacity .1s,border-radius .3s}.MarkGlyph[data-v-340042a7]{width:1em;height:1em}.Checkbox-active .Mark[data-v-340042a7]{opacity:1}.Checkbox-mark-dot .Mark[data-v-340042a7]:after{content:"●"}.Checkbox-mark-knob .Mark[data-v-340042a7]{content:"";width:calc(var(--Checkbox-size) - var(--sp));height:calc(var(--Checkbox-size) - var(--sp));border-radius:calc(var(--Checkbox-radius) - 2px);background:var(--tone-fill-text);box-shadow:0 1px 2px var(--Checkbox-shadow)}.Checkbox-disabled[data-v-340042a7]{cursor:not-allowed;opacity:var(--input-disabled-opacity);filter:var(--input-disabled-filter)}.Checkbox[data-v-340042a7]:not(.Checkbox-disabled):hover,.Checkbox.Checkbox-forceHover[data-v-340042a7]{filter:var(--input-hover-filter)}.Checkbox[data-v-340042a7]:not(.Checkbox-disabled):focus-visible,.Checkbox.Checkbox-forceFocus[data-v-340042a7]{z-index:10;--Checkbox-outline:var(--tone-focus-outline);--Checkbox-border:var(--tone-focus-border)}.Checkbox-active[data-v-340042a7]{--Checkbox-background:var(--tone-fill)}.Checkbox-round[data-v-340042a7]{--Checkbox-radius:calc(.5 * var(--Checkbox-size))}.Checkbox-outline[data-v-340042a7]{--Checkbox-border:var(--tone-border);--Checkbox-border-size:var(--input-border-size)}.Checkbox-flat[data-v-340042a7]{--Checkbox-box-shadow:none;--Checkbox-shadow:transparent;--Checkbox-mark-text-shadow:none}}
|
|
8
8
|
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
|
|
35
35
|
@layer nightshade;@layer nightshade-components{.ToolPanel[data-v-89d92a54]{--ToolPanel-size:var(--input-major-height);--ToolPanel-padding:var(--input-minor-padding);--ToolPanel-gap:var(--input-gap);--ToolPanel-background:var(--surface-deep);--ToolPanel-border-size:0px;--ToolPanel-border:var(--border-deep);--ToolPanel-radius:var(--radius-m);--ToolPanel-shadow:var(--shadow-light);--ToolPanel-box-shadow:0 1px 1px var(--ToolPanel-shadow) inset, 0 0 5px var(--ToolPanel-shadow) inset;align-items:center;gap:var(--ToolPanel-gap);padding:calc(var(--ToolPanel-padding) - var(--ToolPanel-border-size));min-height:var(--ToolPanel-size);border:var(--ToolPanel-border-size) solid var(--ToolPanel-border);border-radius:var(--ToolPanel-radius);box-shadow:var(--ToolPanel-box-shadow);background:var(--ToolPanel-background);transition:color .3s,background-color .3s,border-radius .3s,filter .3s;display:flex}.ToolPanel-round[data-v-89d92a54]{--ToolPanel-radius:calc(.5 * var(--ToolPanel-size))}.ToolPanel-outline[data-v-89d92a54]{--ToolPanel-border-size:var(--input-border-size)}.ToolPanel-flat[data-v-89d92a54]{--ToolPanel-box-shadow:none}}
|
|
36
36
|
|
|
37
|
-
@layer nightshade;@layer nightshade-components{.Tooltip[data-v-
|
|
37
|
+
@layer nightshade;@layer nightshade-components{.Tooltip[data-v-5e400a76]{--Tooltip-padding:var(--sp1) var(--sp1-5);--Tooltip-gap:var(--sp0-5);--Tooltip-width:var(--sp40);--Tooltip-title:var(--text-base);--Tooltip-text:var(--text-subtle);gap:var(--Tooltip-gap);width:max-content;max-width:var(--Tooltip-width);padding:var(--Tooltip-padding);font-size:var(--font-size-s);flex-flow:column;display:flex}.Title[data-v-5e400a76]{font-weight:var(--font-weight-bold);color:var(--Tooltip-title)}.Text[data-v-5e400a76]{color:var(--Tooltip-text)}.Text[data-v-5e400a76]:first-child{color:var(--Tooltip-title)}}
|
|
38
38
|
|
|
39
39
|
@layer nightshade;@layer nightshade-components{.VGroup[data-v-082136ab]{--VGroup-gap:var(--sp2);gap:var(--VGroup-gap);flex-flow:column;display:flex}.VGroup-align-stretch[data-v-082136ab]{align-items:stretch}.VGroup-align-baseline[data-v-082136ab]{align-items:baseline}.VGroup-align-center[data-v-082136ab]{align-items:center}.VGroup-align-start[data-v-082136ab]{align-items:flex-start}.VGroup-align-end[data-v-082136ab]{align-items:flex-end}.VGroup-justify-center[data-v-082136ab]{justify-content:center}.VGroup-justify-start[data-v-082136ab]{justify-content:flex-start}.VGroup-justify-end[data-v-082136ab]{justify-content:flex-end}.VGroup-justify-space-around[data-v-082136ab]{justify-content:space-around}.VGroup-justify-space-between[data-v-082136ab]{justify-content:space-between}.VGroup-justify-space-evenly[data-v-082136ab]{justify-content:space-evenly}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nightshadeui/components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Standard Nightshade components: opt-in Vue primitives that read the styles",
|
|
5
5
|
"author": "Boris Okunskiy",
|
|
6
6
|
"license": "ISC",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@nightshadeui/util": "3.
|
|
41
|
-
"@nightshadeui/stylesheets": "3.
|
|
40
|
+
"@nightshadeui/util": "3.4.0",
|
|
41
|
+
"@nightshadeui/stylesheets": "3.4.0"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -40,110 +40,126 @@ export default {
|
|
|
40
40
|
|
|
41
41
|
@layer nightshade-components {
|
|
42
42
|
|
|
43
|
+
/* A point: the arrow's tip. The arrow and the body sit outside it, on the `dir` side */
|
|
43
44
|
.Bubble {
|
|
44
45
|
--Bubble-background: var(--surface-raised);
|
|
45
46
|
--Bubble-arrow-size: var(--sp);
|
|
46
47
|
--Bubble-arrow-offset: var(--sp2);
|
|
47
48
|
--Bubble-radius: var(--radius-m);
|
|
49
|
+
--Bubble-max-width: calc(100vw - var(--sp4));
|
|
48
50
|
--Bubble-shadow: var(--shadow-light);
|
|
49
51
|
--Bubble-filter: drop-shadow(0 1px 3px var(--Bubble-shadow));
|
|
50
52
|
|
|
51
53
|
position: absolute;
|
|
52
54
|
z-index: 10;
|
|
55
|
+
width: 0;
|
|
56
|
+
height: 0;
|
|
53
57
|
filter: var(--Bubble-filter);
|
|
54
58
|
}
|
|
55
59
|
|
|
60
|
+
/* A point has no width to shrink into, so the body takes its content's */
|
|
56
61
|
.Body {
|
|
57
62
|
position: absolute;
|
|
63
|
+
width: max-content;
|
|
64
|
+
max-width: var(--Bubble-max-width);
|
|
58
65
|
min-width: var(--sp6);
|
|
59
66
|
min-height: var(--sp2);
|
|
60
67
|
border-radius: var(--Bubble-radius);
|
|
61
68
|
background: var(--Bubble-background);
|
|
62
69
|
}
|
|
63
70
|
|
|
71
|
+
/* Clipped to the triangle, so it covers nothing past the tip */
|
|
64
72
|
.Arrow {
|
|
65
73
|
position: absolute;
|
|
66
|
-
|
|
67
|
-
width: 0;
|
|
68
|
-
height: 0;
|
|
69
|
-
border: var(--Bubble-arrow-size) solid transparent;
|
|
70
|
-
transform: translate(-50%, -50%);
|
|
74
|
+
background: var(--Bubble-background);
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
/* Directions */
|
|
74
78
|
|
|
75
79
|
.Bubble-top > .Body {
|
|
76
|
-
|
|
77
|
-
bottom: 0;
|
|
80
|
+
bottom: var(--Bubble-arrow-size);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
.Bubble-bottom > .Body {
|
|
81
|
-
|
|
82
|
-
top: 0;
|
|
84
|
+
top: var(--Bubble-arrow-size);
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
.Bubble-left > .Body {
|
|
86
|
-
|
|
87
|
-
right: 0;
|
|
88
|
+
right: var(--Bubble-arrow-size);
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
.Bubble-right > .Body {
|
|
91
|
-
|
|
92
|
-
left: 0;
|
|
92
|
+
left: var(--Bubble-arrow-size);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/* Alignments */
|
|
95
|
+
/* Alignments: where the arrow lands along the body's edge */
|
|
96
96
|
|
|
97
97
|
.Bubble-start.Bubble-top > .Body,
|
|
98
98
|
.Bubble-start.Bubble-bottom > .Body {
|
|
99
|
-
left:
|
|
100
|
-
transform: translateX(calc(-1 * var(--Bubble-arrow-offset)));
|
|
99
|
+
left: calc(-1 * var(--Bubble-arrow-offset));
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
.Bubble-center.Bubble-top > .Body,
|
|
104
103
|
.Bubble-center.Bubble-bottom > .Body {
|
|
104
|
+
left: 0;
|
|
105
105
|
transform: translateX(-50%);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.Bubble-end.Bubble-top > .Body,
|
|
109
109
|
.Bubble-end.Bubble-bottom > .Body {
|
|
110
|
-
right:
|
|
111
|
-
transform: translateX(var(--Bubble-arrow-offset));
|
|
110
|
+
right: calc(-1 * var(--Bubble-arrow-offset));
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
.Bubble-start.Bubble-left > .Body,
|
|
115
114
|
.Bubble-start.Bubble-right > .Body {
|
|
116
|
-
top:
|
|
117
|
-
transform: translateY(calc(-1 * var(--Bubble-arrow-offset)));
|
|
115
|
+
top: calc(-1 * var(--Bubble-arrow-offset));
|
|
118
116
|
}
|
|
119
117
|
|
|
120
118
|
.Bubble-center.Bubble-left > .Body,
|
|
121
119
|
.Bubble-center.Bubble-right > .Body {
|
|
120
|
+
top: 0;
|
|
122
121
|
transform: translateY(-50%);
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
.Bubble-end.Bubble-left > .Body,
|
|
126
125
|
.Bubble-end.Bubble-right > .Body {
|
|
127
|
-
bottom:
|
|
128
|
-
transform: translateY(var(--Bubble-arrow-offset));
|
|
126
|
+
bottom: calc(-1 * var(--Bubble-arrow-offset));
|
|
129
127
|
}
|
|
130
128
|
|
|
131
129
|
/* Arrows */
|
|
132
130
|
|
|
131
|
+
.Bubble-top > .Arrow,
|
|
132
|
+
.Bubble-bottom > .Arrow {
|
|
133
|
+
left: calc(-1 * var(--Bubble-arrow-size));
|
|
134
|
+
width: calc(2 * var(--Bubble-arrow-size));
|
|
135
|
+
height: var(--Bubble-arrow-size);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.Bubble-left > .Arrow,
|
|
139
|
+
.Bubble-right > .Arrow {
|
|
140
|
+
top: calc(-1 * var(--Bubble-arrow-size));
|
|
141
|
+
width: var(--Bubble-arrow-size);
|
|
142
|
+
height: calc(2 * var(--Bubble-arrow-size));
|
|
143
|
+
}
|
|
144
|
+
|
|
133
145
|
.Bubble-top > .Arrow {
|
|
134
|
-
|
|
146
|
+
bottom: 0;
|
|
147
|
+
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
135
148
|
}
|
|
136
149
|
|
|
137
150
|
.Bubble-bottom > .Arrow {
|
|
138
|
-
|
|
151
|
+
top: 0;
|
|
152
|
+
clip-path: polygon(50% 0, 100% 100%, 0 100%);
|
|
139
153
|
}
|
|
140
154
|
|
|
141
155
|
.Bubble-left > .Arrow {
|
|
142
|
-
|
|
156
|
+
right: 0;
|
|
157
|
+
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
143
158
|
}
|
|
144
159
|
|
|
145
160
|
.Bubble-right > .Arrow {
|
|
146
|
-
|
|
161
|
+
left: 0;
|
|
162
|
+
clip-path: polygon(0 50%, 100% 0, 100% 100%);
|
|
147
163
|
}
|
|
148
164
|
|
|
149
165
|
}
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
align: { type: String, default: 'auto' },
|
|
35
35
|
anchorRef: { type: String },
|
|
36
36
|
anchorEl: { default: null },
|
|
37
|
-
anchorDir: { type: String, default: '
|
|
37
|
+
anchorDir: { type: String, default: 'auto' },
|
|
38
38
|
overlayEnabled: { type: Boolean, default: true },
|
|
39
39
|
overlayShown: { type: Boolean, default: true },
|
|
40
40
|
arrowShown: { type: Boolean, default: true },
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
:dir="resolvedProps.dir"
|
|
5
5
|
:align="resolvedProps.align"
|
|
6
6
|
:anchorEl="anchor"
|
|
7
|
-
anchorDir="auto"
|
|
8
7
|
:overlayEnabled="false"
|
|
9
8
|
:overlayShown="false"
|
|
9
|
+
@mouseenter="cancelHide"
|
|
10
|
+
@mouseleave="scheduleHide"
|
|
10
11
|
@hide="hide">
|
|
11
12
|
<div
|
|
12
13
|
:id="tooltipId"
|
|
@@ -33,10 +34,12 @@ import { nightshadeMixin } from '../helpers/props.js';
|
|
|
33
34
|
import ContextPopup from './ContextPopup.vue';
|
|
34
35
|
|
|
35
36
|
const SHOW_DELAY = 300;
|
|
37
|
+
const HIDE_DELAY = 100;
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* Shows a bubble while its anchor is hovered or focused from the keyboard.
|
|
39
41
|
* The anchor is the parent element, or `anchorEl` (which `v-tooltip` passes).
|
|
42
|
+
* The pointer can cross from the anchor onto the bubble, so a bubble that opens under it stays open.
|
|
40
43
|
*/
|
|
41
44
|
export default {
|
|
42
45
|
|
|
@@ -75,13 +78,14 @@ export default {
|
|
|
75
78
|
|
|
76
79
|
created() {
|
|
77
80
|
this.showTimer = null;
|
|
81
|
+
this.hideTimer = null;
|
|
78
82
|
this.anchorTitle = null;
|
|
79
83
|
},
|
|
80
84
|
|
|
81
85
|
mounted() {
|
|
82
86
|
this.anchor = this.resolvedProps.anchorEl ?? this.$el.parentElement;
|
|
83
87
|
this.anchor.addEventListener('pointerenter', this.onPointerEnter);
|
|
84
|
-
this.anchor.addEventListener('pointerleave', this.
|
|
88
|
+
this.anchor.addEventListener('pointerleave', this.scheduleHide);
|
|
85
89
|
this.anchor.addEventListener('pointerdown', this.hide);
|
|
86
90
|
this.anchor.addEventListener('focusin', this.onFocusIn);
|
|
87
91
|
this.anchor.addEventListener('focusout', this.hide);
|
|
@@ -90,7 +94,7 @@ export default {
|
|
|
90
94
|
beforeUnmount() {
|
|
91
95
|
this.hide();
|
|
92
96
|
this.anchor.removeEventListener('pointerenter', this.onPointerEnter);
|
|
93
|
-
this.anchor.removeEventListener('pointerleave', this.
|
|
97
|
+
this.anchor.removeEventListener('pointerleave', this.scheduleHide);
|
|
94
98
|
this.anchor.removeEventListener('pointerdown', this.hide);
|
|
95
99
|
this.anchor.removeEventListener('focusin', this.onFocusIn);
|
|
96
100
|
this.anchor.removeEventListener('focusout', this.hide);
|
|
@@ -100,6 +104,7 @@ export default {
|
|
|
100
104
|
|
|
101
105
|
show() {
|
|
102
106
|
clearTimeout(this.showTimer);
|
|
107
|
+
this.cancelHide();
|
|
103
108
|
if (this.shown || !this.hasContent) {
|
|
104
109
|
return;
|
|
105
110
|
}
|
|
@@ -113,6 +118,7 @@ export default {
|
|
|
113
118
|
|
|
114
119
|
hide() {
|
|
115
120
|
clearTimeout(this.showTimer);
|
|
121
|
+
this.cancelHide();
|
|
116
122
|
if (!this.shown) {
|
|
117
123
|
return;
|
|
118
124
|
}
|
|
@@ -124,10 +130,24 @@ export default {
|
|
|
124
130
|
this.shown = false;
|
|
125
131
|
},
|
|
126
132
|
|
|
133
|
+
scheduleHide() {
|
|
134
|
+
clearTimeout(this.showTimer);
|
|
135
|
+
clearTimeout(this.hideTimer);
|
|
136
|
+
this.hideTimer = setTimeout(() => this.hide(), HIDE_DELAY);
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
cancelHide() {
|
|
140
|
+
clearTimeout(this.hideTimer);
|
|
141
|
+
},
|
|
142
|
+
|
|
127
143
|
onPointerEnter(ev) {
|
|
128
144
|
if (ev.pointerType !== 'mouse') {
|
|
129
145
|
return;
|
|
130
146
|
}
|
|
147
|
+
this.cancelHide();
|
|
148
|
+
if (this.shown) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
131
151
|
clearTimeout(this.showTimer);
|
|
132
152
|
this.showTimer = setTimeout(() => this.show(), SHOW_DELAY);
|
|
133
153
|
},
|