nightshade 1.0.0-2 → 1.0.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/bundle.js ADDED
@@ -0,0 +1,21 @@
1
+ import { B as e, a as t, C as o, b as r, H as p, c as n, I as u, d as m, S as T, T as b, e as c, V as i, i as x } from "./index-B1Hbr9vA.js";
2
+ import { g as B } from "./dom-LZO9EPGL.js";
3
+ import { T as f, t as h } from "./plugins-BNw3Bq_Y.js";
4
+ export {
5
+ e as Btn,
6
+ t as Bubble,
7
+ o as Circle,
8
+ r as ContextPopup,
9
+ p as HGroup,
10
+ n as HStack,
11
+ u as InputBase,
12
+ m as InputText,
13
+ T as Sizer,
14
+ b as Tab,
15
+ c as TabCap,
16
+ f as ThemeManager,
17
+ i as VGroup,
18
+ x as components,
19
+ B as getAnchorPoint,
20
+ h as themePlugin
21
+ };
@@ -0,0 +1 @@
1
+ .Btn[data-v-3e453c3b]{--Btn-padding: var(--sp1-5);--Btn-gap: var(--sp);--Btn-size: var(--input-size);--Btn-font-size: var(--font-size);--Btn-text-color: inherit;--Btn-outline-color: transparent;--Btn-outline-color-effective: transparent;--Btn-outline-color-focus: var(--color-primary);--Btn-surface-top: transparent;--Btn-surface-bottom: transparent;--Btn-shadow-color: transparent;--Btn-border-radius: var(--border-radius);-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;z-index:1;margin:0;padding:0 var(--Btn-padding);height:var(--Btn-size);line-height:var(--Btn-size);box-sizing:border-box;display:inline-flex;align-items:center;justify-content:flex-start;flex-shrink:0;gap:var(--Btn-gap);border:0;border-radius:var(--Btn-border-radius);cursor:pointer;-webkit-user-select:none;user-select:none;overflow:hidden;font-family:inherit;font-size:var(--Btn-font-size);color:var(--Btn-text-color);outline:2px solid var(--Btn-outline-color-effective);background:radial-gradient(120% 150% at 80% 0%,var(--Btn-surface-top),var(--Btn-surface-bottom));background-clip:padding-box;box-shadow:0 .5px .5px var(--Btn-shadow-color);transition:color .3s,outline .3s,filter .3s,border-radius .3s}.Btn[data-v-3e453c3b]:focus,.Btn[data-v-3e453c3b]:active,.Btn[data-v-3e453c3b]:hover{transition:none}.Btn[data-v-3e453c3b]:not(:disabled):hover,.Btn.Btn-pseudo-hover[data-v-3e453c3b]{filter:brightness(.96)}.Btn[data-v-3e453c3b]:not(:disabled):focus,.Btn.Btn-pseudo-focus[data-v-3e453c3b]{z-index:10;--Btn-outline-color-effective: var(--Btn-outline-color-focus)}.Btn[data-v-3e453c3b]:not(:disabled):active,.Btn.Btn-pseudo-active[data-v-3e453c3b]{padding-top:1px;box-shadow:0 6px 12px #00000014 inset,0 1px 2px #0000001f inset}.Label[data-v-3e453c3b]{line-height:var(--Btn-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.Icon[data-v-3e453c3b]{width:var(--sp2);display:flex;align-items:center;justify-content:center;font-size:var(--Btn-font-size)}.Btn-square[data-v-3e453c3b]{padding-left:0;padding-right:0;width:var(--Btn-size);justify-content:center}.Btn-round[data-v-3e453c3b]{--Btn-border-radius: var(--border-radius-round)}.Btn-disabled[data-v-3e453c3b]{opacity:.64;filter:saturate(40%);cursor:not-allowed}.Btn-block[data-v-3e453c3b]{flex:1 1 auto;display:flex;justify-content:center}.Btn-outline[data-v-3e453c3b]{--Btn-outline-color-effective: var(--Btn-outline-color)}.Btn-large[data-v-3e453c3b]{--Btn-size: var(--input-size-large);--Btn-font-size: var(--font-size-large);--Btn-padding: var(--sp2)}.Btn-small[data-v-3e453c3b]{--Btn-size: var(--input-size-small);--Btn-font-size: var(--font-size-small);--Btn-padding: var(--sp);--Btn-gap: var(--sp0-5)}.Btn-iconPos-right .Icon[data-v-3e453c3b]{order:100}.Btn-default[data-v-3e453c3b]{--Btn-text-color: var(--color-default-text);--Btn-surface-top: var(--color-default-surface-top);--Btn-surface-bottom: var(--color-default-surface-bottom);--Btn-surface-top-hover: var(--color-default-surface-top-hover);--Btn-surface-bottom-hover: var(--color-default-surface-bottom-hover);--Btn-outline-color: var(--color-default-outline);--Btn-outline-color-focus: var(--color-default-focus);--Btn-shadow-color: var(--color-default-shadow)}.Btn-primary[data-v-3e453c3b]{--Btn-text-color: var(--color-primary-text);--Btn-surface-top: var(--color-primary-surface-top);--Btn-surface-bottom: var(--color-primary-surface-bottom);--Btn-surface-top-hover: var(--color-primary-surface-top-hover);--Btn-surface-bottom-hover: var(--color-primary-surface-bottom-hover);--Btn-outline-color: var(--color-primary-outline);--Btn-outline-color-focus: var(--color-primary-focus);--Btn-shadow-color: var(--color-primary-shadow)}.Btn-secondary[data-v-3e453c3b]{--Btn-text-color: var(--color-secondary-text);--Btn-surface-top: var(--color-secondary-surface-top);--Btn-surface-bottom: var(--color-secondary-surface-bottom);--Btn-surface-top-hover: var(--color-secondary-surface-top-hover);--Btn-surface-bottom-hover: var(--color-secondary-surface-bottom-hover);--Btn-outline-color: var(--color-secondary-outline);--Btn-outline-color-focus: var(--color-secondary-focus);--Btn-shadow-color: var(--color-secondary-shadow)}.Btn-tertiary[data-v-3e453c3b]{--Btn-text-color: var(--color-tertiary-text);--Btn-surface-top: var(--color-tertiary-surface-top);--Btn-surface-bottom: var(--color-tertiary-surface-bottom);--Btn-surface-top-hover: var(--color-tertiary-surface-top-hover);--Btn-surface-bottom-hover: var(--color-tertiary-surface-bottom-hover);--Btn-outline-color: var(--color-tertiary-outline);--Btn-outline-color-focus: var(--color-tertiary-focus);--Btn-shadow-color: var(--color-tertiary-shadow)}.Btn-success[data-v-3e453c3b]{--Btn-text-color: var(--color-success-text);--Btn-surface-top: var(--color-success-surface-top);--Btn-surface-bottom: var(--color-success-surface-bottom);--Btn-surface-top-hover: var(--color-success-surface-top-hover);--Btn-surface-bottom-hover: var(--color-success-surface-bottom-hover);--Btn-outline-color: var(--color-success-outline);--Btn-outline-color-focus: var(--color-success-focus);--Btn-shadow-color: var(--color-success-shadow)}.Btn-warning[data-v-3e453c3b]{--Btn-text-color: var(--color-warning-text);--Btn-surface-top: var(--color-warning-surface-top);--Btn-surface-bottom: var(--color-warning-surface-bottom);--Btn-outline-color: var(--color-warning-outline);--Btn-outline-color-focus: var(--color-warning-focus);--Btn-shadow-color: var(--color-warning-shadow)}.Btn-danger[data-v-3e453c3b]{--Btn-text-color: var(--color-danger-text);--Btn-surface-top: var(--color-danger-surface-top);--Btn-surface-bottom: var(--color-danger-surface-bottom);--Btn-outline-color: var(--color-danger-outline);--Btn-outline-color-focus: var(--color-danger-focus);--Btn-shadow-color: var(--color-danger-shadow)}.Btn-link-default[data-v-3e453c3b]{--Btn-text-color: var(--color-default);--Btn-outline-color: var(--color-default-outline);--Btn-outline-color-focus: var(--color-default-focus)}.Btn-link-primary[data-v-3e453c3b]{--Btn-text-color: var(--color-primary);--Btn-outline-color: var(--color-primary-outline);--Btn-outline-color-focus: var(--color-primary-focus)}.Btn-link-secondary[data-v-3e453c3b]{--Btn-text-color: var(--color-secondary);--Btn-outline-color: var(--color-secondary-outline);--Btn-outline-color-focus: var(--color-secondary-focus)}.Btn-link-tertiary[data-v-3e453c3b]{--Btn-text-color: var(--color-tertiary);--Btn-outline-color: var(--color-tertiary-outline);--Btn-outline-color-focus: var(--color-tertiary-focus)}.Btn-link-success[data-v-3e453c3b]{--Btn-text-color: var(--color-success);--Btn-outline-color: var(--color-success-outline);--Btn-outline-color-focus: var(--color-success-focus)}.Btn-link-warning[data-v-3e453c3b]{--Btn-text-color: var(--color-warning);--Btn-outline-color: var(--color-warning-outline);--Btn-outline-color-focus: var(--color-warning-focus)}.Btn-link-danger[data-v-3e453c3b]{--Btn-text-color: var(--color-danger);--Btn-outline-color: var(--color-danger-outline);--Btn-outline-color-focus: var(--color-danger-focus)}:root{--Bubble-surface: var(--color-base-0);--Bubble-arrow-size: 10px;--Bubble-arrow-offset: 16px;--Bubble-shadow-color: var(--color-shadow-light);--Bubble-shadow-size: 0 2px 5px}.Bubble[data-v-2bf83119]{position:absolute;z-index:10;filter:drop-shadow(var(--Bubble-shadow-size) var(--Bubble-shadow-color))}.Body[data-v-2bf83119]{position:absolute;min-width:48px;min-height:16px;border-radius:var(--border-radius);background:var(--Bubble-surface)}.Arrow[data-v-2bf83119]{position:absolute;z-index:5;width:0;height:0;border:var(--Bubble-arrow-size) solid transparent;transform:translate(-50%,-50%)}.Bubble-top>.Body[data-v-2bf83119]{margin-bottom:var(--Bubble-arrow-size);bottom:0}.Bubble-bottom>.Body[data-v-2bf83119]{margin-top:var(--Bubble-arrow-size);top:0}.Bubble-left>.Body[data-v-2bf83119]{margin-right:var(--Bubble-arrow-size);right:0}.Bubble-right>.Body[data-v-2bf83119]{margin-left:var(--Bubble-arrow-size);left:0}.Bubble-start.Bubble-top>.Body[data-v-2bf83119],.Bubble-start.Bubble-bottom>.Body[data-v-2bf83119]{left:0;transform:translate(calc(-1 * var(--Bubble-arrow-offset)))}.Bubble-center.Bubble-top>.Body[data-v-2bf83119],.Bubble-center.Bubble-bottom>.Body[data-v-2bf83119]{transform:translate(-50%)}.Bubble-end.Bubble-top>.Body[data-v-2bf83119],.Bubble-end.Bubble-bottom>.Body[data-v-2bf83119]{right:0;transform:translate(var(--Bubble-arrow-offset))}.Bubble-start.Bubble-left>.Body[data-v-2bf83119],.Bubble-start.Bubble-right>.Body[data-v-2bf83119]{top:0;transform:translateY(calc(-1 * var(--Bubble-arrow-offset)))}.Bubble-center.Bubble-left>.Body[data-v-2bf83119],.Bubble-center.Bubble-right>.Body[data-v-2bf83119]{transform:translateY(-50%)}.Bubble-end.Bubble-left>.Body[data-v-2bf83119],.Bubble-end.Bubble-right>.Body[data-v-2bf83119]{bottom:0;transform:translateY(var(--Bubble-arrow-offset))}.Bubble-top>.Arrow[data-v-2bf83119]{border-top-color:var(--Bubble-surface)}.Bubble-bottom>.Arrow[data-v-2bf83119]{border-bottom-color:var(--Bubble-surface)}.Bubble-left>.Arrow[data-v-2bf83119]{border-left-color:var(--Bubble-surface)}.Bubble-right>.Arrow[data-v-2bf83119]{border-right-color:var(--Bubble-surface)}.Circle[data-v-48fdb4ac]{--CircleSize: var(--sp2);width:var(--CircleSize);height:var(--CircleSize);border-radius:var(--CircleSize);box-shadow:0 1px 3px #00000040}.Circle-normal[data-v-48fdb4ac]{--CircleSize: var(--sp2) }.Circle-large[data-v-48fdb4ac]{--CircleSize: var(--sp4) }.Circle-larger[data-v-48fdb4ac]{--CircleSize: var(--sp6) }.Overlay[data-v-573085ca]{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;pointer-events:none}.Overlay-enabled[data-v-573085ca]{pointer-events:auto;overscroll-behavior:none;overflow:auto}.Overlay-shown[data-v-573085ca]{background:var(--color-overlay)}.HGroup[data-v-0abfef17]{display:flex;flex-flow:row nowrap}.HGroup-align-stretch[data-v-0abfef17]{align-items:stretch}.HGroup-align-baseline[data-v-0abfef17]{align-items:baseline}.HGroup-align-center[data-v-0abfef17]{align-items:center}.HGroup-align-start[data-v-0abfef17]{align-items:flex-start}.HGroup-align-end[data-v-0abfef17]{align-items:flex-end}.HGroup-justify-center[data-v-0abfef17]{justify-content:center}.HGroup-justify-start[data-v-0abfef17]{justify-content:flex-start}.HGroup-justify-end[data-v-0abfef17]{justify-content:flex-end}.HGroup-justify-space-around[data-v-0abfef17]{justify-content:space-around}.HGroup-justify-space-between[data-v-0abfef17]{justify-content:space-between}.HGroup-gap-0[data-v-0abfef17]{gap:0}.HGroup-gap-1[data-v-0abfef17]{gap:var(--sp)}.HGroup-gap-2[data-v-0abfef17]{gap:var(--sp2)}.HGroup-gap-3[data-v-0abfef17]{gap:var(--sp3)}.HGroup-wrap[data-v-0abfef17]{flex-wrap:wrap}.HStack[data-v-48a370d0]{display:flex;align-items:stretch}.HStack[data-v-48a370d0]>*:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.HStack[data-v-48a370d0]>*:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.Tab[data-v-1ba502f2]{--Tab-size: var(--sp3);--Tab-cap-size: var(--sp4);--Tab-surface: var(--color-base-1);--Tab-color: var(--color-text-0);--Tab-shadow-size: .5px;--Tab-shadow-color: rgba(0, 0, 0, .25);--Tab-shadow-offset-x: 0;--Tab-shadow-offset-y: 0;display:flex;cursor:pointer;position:relative;filter:drop-shadow(var(--Tab-shadow-offset-x) var(--Tab-shadow-offset-y) var(--Tab-shadow-size) var(--Tab-shadow-color))}.TabCap[data-v-1ba502f2],.Content[data-v-1ba502f2]{position:relative;z-index:2}.Content[data-v-1ba502f2]{min-width:0;display:flex;align-items:center;background:var(--Tab-surface);color:var(--Tab-color)}.TabLabel[data-v-1ba502f2]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.Tab-h[data-v-1ba502f2]{flex-flow:row;height:var(--Tab-size)}.Tab-v[data-v-1ba502f2]{flex-flow:column;width:var(--Tab-size)}.Tab-v .Content[data-v-1ba502f2]{writing-mode:vertical-lr;text-orientation:sideways-right;transform:rotate(180deg);transform-origin:50% 50%}.TabCap[data-v-1ba502f2]{flex:0 0 var(--Tab-cap-size);fill:var(--Tab-surface)}.Tab-h .TabCap[data-v-1ba502f2]{width:var(--Tab-cap-size)}.Tab-v .TabCap[data-v-1ba502f2]{height:var(--Tab-cap-size)}.InputBase[data-v-490d7c53]{--InputBase-size: var(--input-size);--InputBase-padding: var(--sp1-5);--InputBase-font-size: var(--font-size);--InputBase-text-color: var(--color-text-0);--InputBase-surface: var(--color-base-0);--InputBase-outline-color: transparent;--InputBase-outline-color-focus: var(--color-tertiary-focus);--InputBase-outline-color-invalid: var(--color-danger-focus);--InputBase-border-color: var(--color-base-3);--InputBase-border-color-focus: var(--color-tertiary);--InputBase-border-color-invalid: var(--color-danger);--InputBase-label-color: var(--color-text-0);--InputBase-label-color-focus: var(--color-tertiary-4);--InputBase-label-color-invalid: var(--color-danger-4);--InputBase-label-surface: var(--color-base-1);--InputBase-label-surface-focus: var(--InputBase-outline-color-focus);--InputBase-label-surface-invalid: var(--InputBase-outline-color-invalid);--InputBase-border-radius: var(--border-radius);position:relative;display:flex;flex-flow:column nowrap}.Container[data-v-490d7c53]{position:relative;z-index:1;display:inline-flex;align-items:center;border-radius:var(--border-radius-small);box-sizing:border-box;padding:var(--InputBase-padding);gap:var(--sp);width:100%;min-height:var(--InputBase-size);color:var(--InputBase-text-color);background:var(--InputBase-surface);outline:2px solid var(--InputBase-outline-color);border:1px solid var(--InputBase-border-color);border-radius:var(--InputBase-border-radius);font-size:var(--InputBase-font-size);transition:color .3s,outline .3s,border-radius .3s,filter .3s}.InputBase-fixed-height .Container[data-v-490d7c53]{height:var(--InputBase-size)}.Label.Label[data-v-490d7c53]{align-self:flex-start;position:relative;z-index:0;margin:0 var(--sp2);max-width:calc(100% - 2 * var(--sp2));--Tab-surface: var(--InputBase-label-surface);--Tab-color: var(--InputBase-label-color);--Tab-size: calc(.75 * var(--InputBase-size));--Tab-cap-size: calc(.75 * var(--InputBase-size));font-size:var(--InputBase-font-size)}.InputBase[data-v-490d7c53]:not(.InputBase-disabled):focus-within,.InputBase.InputBase-pseudo-focus[data-v-490d7c53]{z-index:10;--InputBase-outline-color: var(--InputBase-outline-color-focus);--InputBase-border-color: var(--InputBase-border-color-focus);--InputBase-label-color: var(--InputBase-label-color-focus);--InputBase-label-surface: var(--InputBase-label-surface-focus)}.InputBase-invalid[data-v-490d7c53]{--InputBase-outline-color: var(--InputBase-outline-color-invalid);--InputBase-border-color: var(--InputBase-border-color-invalid);--InputBase-label-color: var(--InputBase-label-color-invalid);--InputBase-label-surface: var(--InputBase-label-surface-invalid)}.InputBase-round[data-v-490d7c53]{--InputBase-border-radius: var(--border-radius-round)}.InputBase-block[data-v-490d7c53]{flex:1 1 auto;display:flex}.InputBase-disabled .Container[data-v-490d7c53]{--InputBase-surface: var(--color-base-1);opacity:.64;filter:saturate(40%);cursor:not-allowed}.InputBase-small[data-v-490d7c53]{--InputBase-size: var(--input-size-small);--InputBase-font-size: var(--font-size-small);--InputBase-padding: var(--sp)}.InputBase-large[data-v-490d7c53]{--InputBase-size: var(--input-size-large);--InputBase-font-size: var(--font-size-large);--InputBase-padding: var(--sp2)}.InputText[data-v-26fed2ef]{--InputBase-padding: var(--sp1-5)}input[data-v-26fed2ef],textarea[data-v-26fed2ef]{-webkit-appearance:none;box-sizing:border-box;flex:1;padding:0;border:0;width:100%;min-width:0;outline:0;-webkit-user-select:text;user-select:text;background:transparent;color:inherit;font:inherit;cursor:inherit}.Sizer[data-v-2f099547]{flex:1;min-width:0;min-height:0}path[data-v-3c0176d0]{transform-origin:50% 50%;stroke:none}.TabCap-top.TabCap-start path[data-v-3c0176d0]{transform:scale(1)}.TabCap-top.TabCap-end path[data-v-3c0176d0]{transform:scaleX(-1)}.TabCap-bottom.TabCap-start path[data-v-3c0176d0]{transform:scaleY(-1)}.TabCap-bottom.TabCap-end path[data-v-3c0176d0]{transform:scale(-1)}.TabCap-right.TabCap-start path[data-v-3c0176d0]{transform:scale(1) rotate(90deg)}.TabCap-right.TabCap-end path[data-v-3c0176d0]{transform:scaleX(-1) rotate(-90deg)}.TabCap-left.TabCap-start path[data-v-3c0176d0]{transform:scaleY(-1) rotate(-90deg)}.TabCap-left.TabCap-end path[data-v-3c0176d0]{transform:scale(-1) rotate(90deg)}.VGroup[data-v-4e4be270]{display:flex;flex-flow:column nowrap}.VGroup-align-stretch[data-v-4e4be270]{align-items:stretch}.VGroup-align-baseline[data-v-4e4be270]{align-items:baseline}.VGroup-align-center[data-v-4e4be270]{align-items:center}.VGroup-align-start[data-v-4e4be270]{align-items:flex-start}.VGroup-align-end[data-v-4e4be270]{align-items:flex-end}.VGroup-justify-center[data-v-4e4be270]{justify-content:center}.VGroup-justify-start[data-v-4e4be270]{justify-content:flex-start}.VGroup-justify-end[data-v-4e4be270]{justify-content:flex-end}.VGroup-justify-space-around[data-v-4e4be270]{justify-content:space-around}.VGroup-justify-space-between[data-v-4e4be270]{justify-content:space-between}.VGroup-gap-0[data-v-4e4be270]{gap:0}.VGroup-gap-1[data-v-4e4be270]{gap:var(--sp)}.VGroup-gap-2[data-v-4e4be270]{gap:var(--sp2)}.VGroup-gap-3[data-v-4e4be270]{gap:var(--sp3)}.VGroup-gap-4[data-v-4e4be270]{gap:var(--sp4)}
@@ -0,0 +1,15 @@
1
+ import { B as e, a as p, C as t, b as o, H as r, c as u, I as b, d as n, S as B, T as C, e as T, V as c } from "./index-B1Hbr9vA.js";
2
+ export {
3
+ e as Btn,
4
+ p as Bubble,
5
+ t as Circle,
6
+ o as ContextPopup,
7
+ r as HGroup,
8
+ u as HStack,
9
+ b as InputBase,
10
+ n as InputText,
11
+ B as Sizer,
12
+ C as Tab,
13
+ T as TabCap,
14
+ c as VGroup
15
+ };
@@ -0,0 +1,22 @@
1
+ var u = Object.defineProperty;
2
+ var i = (o, c) => u(o, "name", { value: c, configurable: !0 });
3
+ function x(o, c) {
4
+ const s = o.getBoundingClientRect(), { top: t, left: e, width: n, height: r } = s;
5
+ switch (c) {
6
+ case "left":
7
+ return { x: e, y: t + r * 0.5 };
8
+ case "right":
9
+ return { x: e + n, y: t + r * 0.5 };
10
+ case "top":
11
+ return { x: e + n * 0.5, y: t };
12
+ case "bottom":
13
+ return { x: e + n * 0.5, y: t + r };
14
+ case "middle":
15
+ default:
16
+ return { x: e + n * 0.5, y: t + r * 0.5 };
17
+ }
18
+ }
19
+ i(x, "getAnchorPoint");
20
+ export {
21
+ x as g
22
+ };
@@ -0,0 +1,513 @@
1
+ var k = Object.defineProperty;
2
+ var i = (t, n) => k(t, "name", { value: n, configurable: !0 });
3
+ import { openBlock as s, createBlock as f, resolveDynamicComponent as h, normalizeClass as c, withCtx as v, renderSlot as d, createElementBlock as b, createCommentVNode as m, toDisplayString as $, Transition as I, createElementVNode as y, resolveComponent as _, Teleport as T, withModifiers as g, normalizeStyle as C, createVNode as B, mergeProps as E } from "vue";
4
+ import { g as z } from "./dom-LZO9EPGL.js";
5
+ const u = /* @__PURE__ */ i((t, n) => {
6
+ const e = t.__vccOpts || t;
7
+ for (const [l, a] of n)
8
+ e[l] = a;
9
+ return e;
10
+ }, "_export_sfc"), H = {
11
+ props: {
12
+ label: { type: String },
13
+ title: { type: String },
14
+ icon: { type: String },
15
+ iconPos: { type: String, default: "left" },
16
+ kind: { type: String, default: "link-default" },
17
+ hoverKind: { type: String },
18
+ customTag: { type: String },
19
+ href: { type: String },
20
+ debounce: { type: Number, default: 0 },
21
+ disabled: { type: Boolean, default: !1 },
22
+ size: { type: String, default: "normal" },
23
+ square: { type: Boolean, default: !1 },
24
+ block: { type: Boolean, default: !1 },
25
+ round: { type: Boolean, default: !1 },
26
+ outline: { type: Boolean, default: !1 },
27
+ pseudoFocus: { type: Boolean, default: !1 },
28
+ pseudoHover: { type: Boolean, default: !1 },
29
+ pseudoActive: { type: Boolean, default: !1 }
30
+ },
31
+ data() {
32
+ return {
33
+ hover: !1,
34
+ blocked: !1
35
+ };
36
+ },
37
+ computed: {
38
+ tagName() {
39
+ return this.customTag ?? "button";
40
+ },
41
+ actualKind() {
42
+ const { kind: t, hoverKind: n, hover: e } = this;
43
+ return e ? n ?? t : t;
44
+ }
45
+ },
46
+ methods: {
47
+ onUiActivate() {
48
+ this.debounce > 0 && (this.blocked = !0, setTimeout(() => {
49
+ this.blocked = !1;
50
+ }, this.debounce));
51
+ }
52
+ }
53
+ }, A = {
54
+ key: 0,
55
+ class: "Label"
56
+ };
57
+ function D(t, n, e, l, a, o) {
58
+ return s(), f(h(o.tagName), {
59
+ ref: "button",
60
+ class: c(["Btn button", [
61
+ `Btn-${e.size}`,
62
+ `Btn-${o.actualKind}`,
63
+ `Btn-iconPos-${e.iconPos}`,
64
+ {
65
+ "Btn-disabled": e.disabled || a.blocked,
66
+ "Btn-square": e.square,
67
+ "Btn-round": e.round,
68
+ "Btn-outline": e.outline,
69
+ "Btn-block": e.block,
70
+ "Btn-pseudo-focus": e.pseudoFocus,
71
+ "Btn-pseudo-hover": e.pseudoHover,
72
+ "Btn-pseudo-active": e.pseudoActive
73
+ }
74
+ ]]),
75
+ disabled: e.disabled || a.blocked,
76
+ title: e.title ?? e.label,
77
+ href: e.href,
78
+ onUiactivate: n[0] || (n[0] = (r) => o.onUiActivate(r)),
79
+ onMouseenter: n[1] || (n[1] = (r) => a.hover = !0),
80
+ onMouseleave: n[2] || (n[2] = (r) => a.hover = !1)
81
+ }, {
82
+ default: v(() => [
83
+ d(t.$slots, "icon", {
84
+ hover: a.hover,
85
+ blocked: a.blocked
86
+ }, () => [
87
+ e.icon ? (s(), b("i", {
88
+ key: 0,
89
+ class: c([e.icon, "Icon"])
90
+ }, null, 2)) : m("", !0)
91
+ ], !0),
92
+ e.label ? (s(), b("span", A, $(e.label), 1)) : m("", !0),
93
+ d(t.$slots, "default", {
94
+ hover: a.hover,
95
+ blocked: a.blocked
96
+ }, void 0, !0)
97
+ ]),
98
+ _: 3
99
+ }, 40, ["class", "disabled", "title", "href"]);
100
+ }
101
+ i(D, "_sfc_render$b");
102
+ const N = /* @__PURE__ */ u(H, [["render", D], ["__scopeId", "data-v-3e453c3b"]]), x = {
103
+ props: {
104
+ dir: { type: String, default: "bottom" },
105
+ align: { type: String, default: "start" }
106
+ }
107
+ }, O = { class: "Body" };
108
+ function V(t, n, e, l, a, o) {
109
+ return s(), f(I, {
110
+ name: "fade-" + e.dir,
111
+ appear: ""
112
+ }, {
113
+ default: v(() => [
114
+ y("div", {
115
+ class: c(["Bubble", [
116
+ `Bubble-${e.dir}`,
117
+ `Bubble-${e.align}`
118
+ ]])
119
+ }, [
120
+ n[0] || (n[0] = y("div", { class: "Arrow" }, null, -1)),
121
+ y("div", O, [
122
+ d(t.$slots, "default", {}, void 0, !0)
123
+ ])
124
+ ], 2)
125
+ ]),
126
+ _: 3
127
+ }, 8, ["name"]);
128
+ }
129
+ i(V, "_sfc_render$a");
130
+ const G = /* @__PURE__ */ u(x, [["render", V], ["__scopeId", "data-v-2bf83119"]]), L = {
131
+ props: {
132
+ size: { type: String, default: "normal" }
133
+ }
134
+ };
135
+ function P(t, n, e, l, a, o) {
136
+ return s(), b("div", {
137
+ class: c(["Circle", [
138
+ `Circle-${e.size}`
139
+ ]])
140
+ }, [
141
+ d(t.$slots, "default", {}, void 0, !0)
142
+ ], 2);
143
+ }
144
+ i(P, "_sfc_render$9");
145
+ const R = /* @__PURE__ */ u(L, [["render", P], ["__scopeId", "data-v-48fdb4ac"]]), j = {
146
+ props: {
147
+ dir: { type: String, default: "v" },
148
+ align: { type: String, default: "auto" },
149
+ anchorRef: { type: String },
150
+ anchorDir: { type: String, default: "middle" },
151
+ overlayEnabled: { type: Boolean, default: !0 },
152
+ overlayShown: { type: Boolean, default: !0 }
153
+ },
154
+ emits: ["hide", "mouseenter", "mouseleave", "ready"],
155
+ data() {
156
+ return {
157
+ pos: {
158
+ x: 0,
159
+ y: 0
160
+ },
161
+ actualDir: "bottom",
162
+ actualAlign: "start",
163
+ ready: !1
164
+ };
165
+ },
166
+ computed: {
167
+ bubbleStyle() {
168
+ const { x: t, y: n } = this.pos;
169
+ return {
170
+ left: `${t}px`,
171
+ top: `${n}px`,
172
+ "pointer-events": "auto"
173
+ };
174
+ }
175
+ },
176
+ mounted() {
177
+ this.$nextTick(() => this.calcPos()), window.addEventListener("resize", this.onResize), window.addEventListener("keydown", this.onWindowKeyDown), this.enableOverlay();
178
+ },
179
+ unmounted() {
180
+ window.removeEventListener("resize", this.onResize), window.removeEventListener("keydown", this.onWindowKeyDown), this.disableOverlay();
181
+ },
182
+ methods: {
183
+ hide() {
184
+ this.$emit("hide");
185
+ },
186
+ calcPos() {
187
+ const t = this.getAnchorEl();
188
+ this.pos = z(t, this.anchorDir), this.calcDirAlign(), this.ready = !0, this.$nextTick(() => this.$emit("ready"));
189
+ },
190
+ calcDirAlign() {
191
+ const t = this.pos.y < window.innerHeight * 0.5, n = this.pos.x < window.innerWidth * 0.5;
192
+ this.align === "auto" ? ["top", "bottom", "v"].includes(this.dir) ? this.actualAlign = n ? "start" : "end" : this.actualAlign = t ? "start" : "end" : this.actualAlign = this.align, this.dir === "v" ? this.actualDir = t ? "bottom" : "top" : this.dir === "h" ? this.actualDir = n ? "right" : "left" : this.actualDir = this.dir;
193
+ },
194
+ getAnchorEl() {
195
+ if (this.anchorRef) {
196
+ const t = this.findRef(this.$parent, this.anchorRef);
197
+ if (t)
198
+ return t;
199
+ }
200
+ return this.$el.parentElement;
201
+ },
202
+ findRef(t, n) {
203
+ const e = t.$refs[n];
204
+ if (e) {
205
+ const l = e.$el ?? e;
206
+ if (l instanceof HTMLElement)
207
+ return l;
208
+ }
209
+ return t.$parent ? this.findRef(t.$parent, n) : null;
210
+ },
211
+ onResize() {
212
+ this.calcPos();
213
+ },
214
+ onWindowKeyDown(t) {
215
+ t.key === "Escape" && this.hide();
216
+ },
217
+ enableOverlay() {
218
+ if (!this.overlayEnabled)
219
+ return;
220
+ const t = document.documentElement, n = t.style.overflow;
221
+ t.dataset.previousOverflow = n, t.style.overflow = "hidden";
222
+ },
223
+ disableOverlay() {
224
+ const t = document.documentElement;
225
+ t.dataset.previousOverflow != null && (t.style.overflow = t.dataset.previousOverflow, delete t.dataset.previousOverflow);
226
+ }
227
+ }
228
+ };
229
+ function M(t, n, e, l, a, o) {
230
+ const r = _("Bubble");
231
+ return s(), f(T, { to: "#overlays" }, [
232
+ y("div", {
233
+ class: c(["Overlay", {
234
+ "Overlay-enabled": e.overlayEnabled,
235
+ "Overlay-shown": e.overlayShown
236
+ }]),
237
+ onClick: n[3] || (n[3] = g((p) => o.hide(), ["stop"]))
238
+ }, [
239
+ a.ready ? (s(), f(r, {
240
+ key: 0,
241
+ dir: a.actualDir,
242
+ align: a.actualAlign,
243
+ style: C(o.bubbleStyle),
244
+ onMouseenter: n[0] || (n[0] = (p) => t.$emit("mouseenter")),
245
+ onMouseleave: n[1] || (n[1] = (p) => t.$emit("mouseleave")),
246
+ onClick: n[2] || (n[2] = g(() => {
247
+ }, ["stop"]))
248
+ }, {
249
+ default: v(() => [
250
+ d(t.$slots, "default", {}, void 0, !0)
251
+ ]),
252
+ _: 3
253
+ }, 8, ["dir", "align", "style"])) : m("", !0)
254
+ ], 2)
255
+ ]);
256
+ }
257
+ i(M, "_sfc_render$8");
258
+ const F = /* @__PURE__ */ u(j, [["render", M], ["__scopeId", "data-v-573085ca"]]), K = {
259
+ props: {
260
+ tagName: { type: String, default: "div" },
261
+ align: { type: String, default: "center" },
262
+ justify: { type: String },
263
+ gap: { type: String, default: "1" },
264
+ wrap: { type: Boolean, default: !1 }
265
+ }
266
+ };
267
+ function W(t, n, e, l, a, o) {
268
+ return s(), f(h(e.tagName), {
269
+ class: c(["HGroup", [
270
+ `HGroup-align-${e.align}`,
271
+ `HGroup-justify-${e.justify}`,
272
+ `HGroup-gap-${e.gap}`,
273
+ {
274
+ "HGroup-wrap": e.wrap
275
+ }
276
+ ]])
277
+ }, {
278
+ default: v(() => [
279
+ d(t.$slots, "default", {}, void 0, !0)
280
+ ]),
281
+ _: 3
282
+ }, 8, ["class"]);
283
+ }
284
+ i(W, "_sfc_render$7");
285
+ const q = /* @__PURE__ */ u(K, [["render", W], ["__scopeId", "data-v-0abfef17"]]), U = {}, J = { class: "HStack" };
286
+ function Q(t, n, e, l, a, o) {
287
+ return s(), b("div", J, [
288
+ d(t.$slots, "default", {}, void 0, !0)
289
+ ]);
290
+ }
291
+ i(Q, "_sfc_render$6");
292
+ const X = /* @__PURE__ */ u(U, [["render", Q], ["__scopeId", "data-v-48a370d0"]]), Y = {
293
+ props: {
294
+ dir: { type: String, default: "top" },
295
+ label: { type: String }
296
+ },
297
+ computed: {
298
+ orientation() {
299
+ return this.dir === "top" || this.dir === "bottom" ? "h" : "v";
300
+ }
301
+ }
302
+ }, Z = { class: "Content" }, ee = ["title"];
303
+ function te(t, n, e, l, a, o) {
304
+ const r = _("TabCap");
305
+ return s(), b("div", {
306
+ class: c(["Tab", [
307
+ `Tab-${e.dir}`,
308
+ `Tab-${o.orientation}`
309
+ ]])
310
+ }, [
311
+ B(r, {
312
+ class: "TabCap",
313
+ dir: e.dir,
314
+ type: "start"
315
+ }, null, 8, ["dir"]),
316
+ y("div", Z, [
317
+ d(t.$slots, "default", {}, () => [
318
+ e.label ? (s(), b("div", {
319
+ key: 0,
320
+ class: "TabLabel",
321
+ title: e.label
322
+ }, $(e.label), 9, ee)) : m("", !0)
323
+ ], !0)
324
+ ]),
325
+ B(r, {
326
+ class: "TabCap",
327
+ dir: e.dir,
328
+ type: "end"
329
+ }, null, 8, ["dir"])
330
+ ], 2);
331
+ }
332
+ i(te, "_sfc_render$5");
333
+ const S = /* @__PURE__ */ u(Y, [["render", te], ["__scopeId", "data-v-1ba502f2"]]), ne = {
334
+ components: {
335
+ Tab: S
336
+ },
337
+ props: {
338
+ tagName: { default: "label" },
339
+ label: { type: String },
340
+ size: { type: String, default: "normal" },
341
+ fixedHeight: { type: Boolean, default: !0 },
342
+ round: { type: Boolean, default: !1 },
343
+ block: { type: Boolean },
344
+ disabled: { type: Boolean, default: !1 },
345
+ invalid: { type: Boolean, default: !1 },
346
+ pseudoFocus: { type: Boolean, default: !1 },
347
+ pseudoHover: { type: Boolean, default: !1 }
348
+ }
349
+ }, ae = { class: "Container" };
350
+ function oe(t, n, e, l, a, o) {
351
+ const r = _("Tab");
352
+ return s(), f(h(e.tagName), {
353
+ class: c(["InputBase", [
354
+ `InputBase-${e.size}`,
355
+ {
356
+ "InputBase-block": e.block,
357
+ "InputBase-round": e.round,
358
+ "InputBase-disabled": e.disabled,
359
+ "InputBase-invalid": e.invalid,
360
+ "InputBase-fixed-height": e.fixedHeight,
361
+ "InputBase-pseudo-focus": e.pseudoFocus,
362
+ "InputBase-pseudo-hover": e.pseudoHover
363
+ }
364
+ ]])
365
+ }, {
366
+ default: v(() => [
367
+ e.label ? (s(), f(r, {
368
+ key: 0,
369
+ class: "Label",
370
+ label: e.label
371
+ }, null, 8, ["label"])) : m("", !0),
372
+ y("div", ae, [
373
+ d(t.$slots, "default", {}, void 0, !0)
374
+ ])
375
+ ]),
376
+ _: 3
377
+ }, 8, ["class"]);
378
+ }
379
+ i(oe, "_sfc_render$4");
380
+ const w = /* @__PURE__ */ u(ne, [["render", oe], ["__scopeId", "data-v-490d7c53"]]), se = {
381
+ props: {
382
+ ...w.props,
383
+ modelValue: { type: [String, Number] },
384
+ type: { type: String },
385
+ placeholder: { type: String },
386
+ min: { type: Number },
387
+ max: { type: Number },
388
+ step: { type: Number },
389
+ autoFocus: { type: Boolean },
390
+ readonly: { type: Boolean }
391
+ },
392
+ emits: [
393
+ "focus",
394
+ "blur",
395
+ "input",
396
+ "update:modelValue"
397
+ ],
398
+ mounted() {
399
+ var t;
400
+ this.autoFocus && ((t = this.$refs.input) == null || t.focus());
401
+ },
402
+ methods: {
403
+ onInput(t) {
404
+ this.$emit("update:modelValue", t.target.value);
405
+ }
406
+ }
407
+ }, le = ["value", "type", "placeholder", "readonly", "disabled", "min", "max", "step"];
408
+ function ie(t, n, e, l, a, o) {
409
+ const r = _("InputBase");
410
+ return s(), f(r, E({ class: "InputText" }, {
411
+ ...t.$attrs,
412
+ ...t.$props
413
+ }), {
414
+ default: v(() => [
415
+ d(t.$slots, "before", {}, void 0, !0),
416
+ y("input", {
417
+ ref: "input",
418
+ value: e.modelValue,
419
+ type: e.type,
420
+ placeholder: e.placeholder,
421
+ readonly: e.readonly,
422
+ disabled: t.disabled,
423
+ min: e.min,
424
+ max: e.max,
425
+ step: e.step,
426
+ autocomplete: "off",
427
+ onInput: n[0] || (n[0] = (p) => o.onInput(p)),
428
+ onFocus: n[1] || (n[1] = (p) => t.$emit("focus", p)),
429
+ onBlur: n[2] || (n[2] = (p) => t.$emit("blur", p))
430
+ }, null, 40, le),
431
+ d(t.$slots, "after", {}, void 0, !0)
432
+ ]),
433
+ _: 3
434
+ }, 16);
435
+ }
436
+ i(ie, "_sfc_render$3");
437
+ const re = /* @__PURE__ */ u(se, [["render", ie], ["__scopeId", "data-v-26fed2ef"]]), de = {}, ue = { class: "Sizer" };
438
+ function ce(t, n) {
439
+ return s(), b("div", ue);
440
+ }
441
+ i(ce, "_sfc_render$2");
442
+ const fe = /* @__PURE__ */ u(de, [["render", ce], ["__scopeId", "data-v-2f099547"]]), pe = {
443
+ props: {
444
+ dir: { type: String, default: "top" },
445
+ type: { type: String, default: "start" }
446
+ }
447
+ };
448
+ function ye(t, n, e, l, a, o) {
449
+ return s(), b("svg", {
450
+ class: c(["TabCap", [
451
+ `TabCap-${e.dir}`,
452
+ `TabCap-${e.type}`
453
+ ]]),
454
+ viewBox: "0 0 32 32",
455
+ preserveAspectRatio: "none"
456
+ }, n[0] || (n[0] = [
457
+ y("path", { d: "M0 32 C 16 32 16 0 32 0 L 32 32 z" }, null, -1)
458
+ ]), 2);
459
+ }
460
+ i(ye, "_sfc_render$1");
461
+ const be = /* @__PURE__ */ u(pe, [["render", ye], ["__scopeId", "data-v-3c0176d0"]]), ve = {
462
+ props: {
463
+ tagName: { type: String, default: "div" },
464
+ align: { type: String, default: "stretch" },
465
+ justify: { type: String },
466
+ gap: { type: String, default: "1" }
467
+ }
468
+ };
469
+ function me(t, n, e, l, a, o) {
470
+ return s(), f(h(e.tagName), {
471
+ class: c(["VGroup", [
472
+ `VGroup-align-${e.align}`,
473
+ `VGroup-justify-${e.justify}`,
474
+ `VGroup-gap-${e.gap}`
475
+ ]])
476
+ }, {
477
+ default: v(() => [
478
+ d(t.$slots, "default", {}, void 0, !0)
479
+ ]),
480
+ _: 3
481
+ }, 8, ["class"]);
482
+ }
483
+ i(me, "_sfc_render");
484
+ const he = /* @__PURE__ */ u(ve, [["render", me], ["__scopeId", "data-v-4e4be270"]]), $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
485
+ __proto__: null,
486
+ Btn: N,
487
+ Bubble: G,
488
+ Circle: R,
489
+ ContextPopup: F,
490
+ HGroup: q,
491
+ HStack: X,
492
+ InputBase: w,
493
+ InputText: re,
494
+ Sizer: fe,
495
+ Tab: S,
496
+ TabCap: be,
497
+ VGroup: he
498
+ }, Symbol.toStringTag, { value: "Module" }));
499
+ export {
500
+ N as B,
501
+ R as C,
502
+ q as H,
503
+ w as I,
504
+ fe as S,
505
+ S as T,
506
+ he as V,
507
+ G as a,
508
+ F as b,
509
+ X as c,
510
+ re as d,
511
+ be as e,
512
+ $e as i
513
+ };
@@ -0,0 +1,51 @@
1
+ var a = Object.defineProperty;
2
+ var m = (t, e) => a(t, "name", { value: e, configurable: !0 });
3
+ import { reactive as o } from "vue";
4
+ const s = class s {
5
+ constructor() {
6
+ this.currentTheme = "auto";
7
+ }
8
+ init() {
9
+ this.loadTheme(), this.applyTheme(), this.listenForSystemThemeChanges();
10
+ }
11
+ setTheme(e) {
12
+ this.currentTheme = e, this.saveTheme(), this.applyTheme();
13
+ }
14
+ toggleTheme() {
15
+ this.setTheme(this.currentTheme === "light" ? "dark" : "light");
16
+ }
17
+ applyTheme() {
18
+ const e = document.documentElement, r = this.currentTheme === "auto" ? this.getSystemTheme() : this.currentTheme;
19
+ e.classList.remove("theme-light"), e.classList.remove("theme-dark"), e.classList.add(`theme-${r}`), window.dispatchEvent(new CustomEvent("themeChanged"));
20
+ }
21
+ loadTheme() {
22
+ this.currentTheme = this.getLocalStorageTheme();
23
+ }
24
+ saveTheme() {
25
+ this.currentTheme === "auto" ? localStorage.removeItem("theme") : localStorage.setItem("theme", this.currentTheme);
26
+ }
27
+ listenForSystemThemeChanges() {
28
+ window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
29
+ this.currentTheme === "auto" && this.applyTheme();
30
+ });
31
+ }
32
+ getLocalStorageTheme() {
33
+ const e = localStorage.getItem("theme") ?? "";
34
+ return ["dark", "light"].includes(e) ? e : "auto";
35
+ }
36
+ getSystemTheme() {
37
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
38
+ }
39
+ };
40
+ m(s, "ThemeManager");
41
+ let h = s;
42
+ const c = {
43
+ install(t) {
44
+ const e = o(new h());
45
+ t.provide("themeManager", e), e.init();
46
+ }
47
+ };
48
+ export {
49
+ h as T,
50
+ c as t
51
+ };
package/dist/utils.js ADDED
@@ -0,0 +1,7 @@
1
+ import { g as r } from "./dom-LZO9EPGL.js";
2
+ import { T as a, t as g } from "./plugins-BNw3Bq_Y.js";
3
+ export {
4
+ a as ThemeManager,
5
+ r as getAnchorPoint,
6
+ g as themePlugin
7
+ };