@glimstone/vue 0.0.0-stage → 4.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/README.md +51 -2
- package/dist/Badge.vue.d.ts +49 -0
- package/dist/BrandMark.vue.d.ts +6 -0
- package/dist/Button.vue.d.ts +43 -0
- package/dist/Card.vue.d.ts +25 -0
- package/dist/Combobox.js +70 -0
- package/dist/Combobox.vue.d.ts +27 -0
- package/dist/ConfirmDialog.vue.d.ts +37 -0
- package/dist/EmptyState.vue.d.ts +28 -0
- package/dist/IconTipButton.vue.d.ts +24 -0
- package/dist/InfoAboutCard.vue.d.ts +4 -0
- package/dist/InfoBubble.vue.d.ts +9 -0
- package/dist/InfoHelpCard.vue.d.ts +6 -0
- package/dist/InfoTile.vue.d.ts +22 -0
- package/dist/InfoVersionCard.vue.d.ts +15 -0
- package/dist/ListSelect.vue.d.ts +37 -0
- package/dist/MenuChoice.vue.d.ts +27 -0
- package/dist/MenuSelect.vue.d.ts +37 -0
- package/dist/MenuSubmenu.vue.d.ts +31 -0
- package/dist/NumberField.vue.d.ts +10 -0
- package/dist/ReadmeButton.vue.d.ts +33 -0
- package/dist/Select.js +444 -0
- package/dist/Select.vue.d.ts +50 -0
- package/dist/SelectFace.vue.d.ts +26 -0
- package/dist/Selector.vue.d.ts +55 -0
- package/dist/SelectorSegment.vue.d.ts +28 -0
- package/dist/SidebarRow.vue.d.ts +22 -0
- package/dist/Slider.js +36 -0
- package/dist/Slider.vue.d.ts +23 -0
- package/dist/SubCard.vue.d.ts +21 -0
- package/dist/TipBubble.vue.d.ts +7 -0
- package/dist/TipWrap-rNAEgvb0.js +51 -0
- package/dist/TipWrap.d.ts +11 -0
- package/dist/ToastViewport.vue.d.ts +25 -0
- package/dist/Toggle.vue.d.ts +21 -0
- package/dist/UnavailableNotice.vue.d.ts +20 -0
- package/dist/confirm.d.ts +20 -0
- package/dist/engines.d.ts +12 -0
- package/dist/entries/combobox.d.ts +1 -0
- package/dist/entries/select.d.ts +1 -0
- package/dist/entries/slider.d.ts +1 -0
- package/dist/glyphs-CvCRgBMU.js +27 -0
- package/dist/glyphs.d.ts +21 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +1301 -0
- package/dist/info.d.ts +71 -0
- package/dist/selectParts.d.ts +25 -0
- package/dist/selectorItem.d.ts +19 -0
- package/dist/tipBubble.d.ts +16 -0
- package/package.json +47 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
step?: number;
|
|
6
|
+
/** How the value reads, on screen and to a screen reader. */
|
|
7
|
+
format: (value: number) => string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_ModelProps = {
|
|
11
|
+
modelValue: number;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (value: number) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
step: number;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The group's name, set small and uppercase above it. */
|
|
3
|
+
title: string;
|
|
4
|
+
/** One line on what the group does, drawn as an "(i)" beside the title. */
|
|
5
|
+
hint?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_template: () => {
|
|
8
|
+
__VLS_Slots: {
|
|
9
|
+
default?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TipBubble } from "./tipBubble";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
state: TipBubble;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Teleport as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, h as o, onScopeDispose as s, openBlock as c, ref as l, shallowRef as u, toDisplayString as d, useId as f, watch as p } from "vue";
|
|
2
|
+
import { dismissBubbleOn as m, placeBubble as h, pointerWasLast as g, trackInputModality as _ } from "@glimstone/core";
|
|
3
|
+
// src/tipBubble.ts
|
|
4
|
+
function v(e, n = () => !1) {
|
|
5
|
+
let r = l(!1), i = u(null), a = u(null), o = f(), c = t(e), d = t(() => !!c.value && r.value);
|
|
6
|
+
p(n, () => r.value = !1), _();
|
|
7
|
+
let v = () => {
|
|
8
|
+
c.value && (r.value = !0);
|
|
9
|
+
}, y = () => {
|
|
10
|
+
r.value = !1;
|
|
11
|
+
}, b;
|
|
12
|
+
return p(d, (e) => {
|
|
13
|
+
b?.(), b = void 0, e && (i.value && a.value && h(i.value, a.value), b = m(y));
|
|
14
|
+
}, { flush: "post" }), s(() => b?.()), {
|
|
15
|
+
trigger: i,
|
|
16
|
+
bubble: a,
|
|
17
|
+
id: o,
|
|
18
|
+
text: c,
|
|
19
|
+
shown: d,
|
|
20
|
+
describedBy: t(() => d.value ? o : void 0),
|
|
21
|
+
show: v,
|
|
22
|
+
hide: y,
|
|
23
|
+
showOnFocus: () => {
|
|
24
|
+
g() || v();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// src/TipBubble.vue?vue&type=script&setup=true&lang.ts
|
|
29
|
+
var y = ["id"], b = /* @__PURE__ */ a({
|
|
30
|
+
__name: "TipBubble",
|
|
31
|
+
props: { state: {} },
|
|
32
|
+
setup(t) {
|
|
33
|
+
return (a, o) => (c(), n(e, { to: "body" }, [t.state.shown.value ? (c(), i("div", {
|
|
34
|
+
key: 0,
|
|
35
|
+
ref: (e) => t.state.bubble.value = e,
|
|
36
|
+
id: t.state.id,
|
|
37
|
+
role: "tooltip",
|
|
38
|
+
class: "glim-bubble glim-fade"
|
|
39
|
+
}, d(t.state.text.value), 9, y)) : r("", !0)]));
|
|
40
|
+
}
|
|
41
|
+
}), x = (e, { slots: t }) => e.on ? o("span", {
|
|
42
|
+
class: "glim-tip-wrap",
|
|
43
|
+
onMouseenter: e.show,
|
|
44
|
+
onMouseleave: e.hide
|
|
45
|
+
}, t.default?.()) : t.default?.();
|
|
46
|
+
x.props = [
|
|
47
|
+
"on",
|
|
48
|
+
"show",
|
|
49
|
+
"hide"
|
|
50
|
+
];
|
|
51
|
+
export { b as n, v as r, x as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FunctionalComponent } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* Boxes a disabled trigger with a tip in a span that still sees the pointer,
|
|
4
|
+
* since a disabled <button> emits no mouse events. Otherwise the trigger
|
|
5
|
+
* renders as it is.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TipWrap: FunctionalComponent<{
|
|
8
|
+
on: boolean;
|
|
9
|
+
show: () => void;
|
|
10
|
+
hide: () => void;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ToastSeverity } from "@glimstone/core";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
toasts: {
|
|
4
|
+
id: string;
|
|
5
|
+
message: string;
|
|
6
|
+
severity: ToastSeverity;
|
|
7
|
+
}[];
|
|
8
|
+
/** Accessible name for each dismiss button. */
|
|
9
|
+
dismissLabel: string;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
focusin: (id: string) => any;
|
|
13
|
+
focusout: (id: string) => any;
|
|
14
|
+
enter: (id: string) => any;
|
|
15
|
+
dismiss: (id: string) => any;
|
|
16
|
+
leave: (id: string) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onFocusin?: ((id: string) => any) | undefined;
|
|
19
|
+
onFocusout?: ((id: string) => any) | undefined;
|
|
20
|
+
onEnter?: ((id: string) => any) | undefined;
|
|
21
|
+
onDismiss?: ((id: string) => any) | undefined;
|
|
22
|
+
onLeave?: ((id: string) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
/** Use it only when the caller draws the same text right next to the
|
|
4
|
+
* switch, never because a card title further up already says it. */
|
|
5
|
+
hideLabel?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_ModelProps = {
|
|
9
|
+
modelValue: boolean;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: boolean) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
hideLabel: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_template: () => {
|
|
5
|
+
__VLS_Slots: {
|
|
6
|
+
default?: (props: {}) => any;
|
|
7
|
+
} & {
|
|
8
|
+
action?: (props: {}) => any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Component } from "vue";
|
|
2
|
+
export interface ConfirmText {
|
|
3
|
+
/** The dialog's title, the same for every question, such as "Confirm". */
|
|
4
|
+
title: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
/** The confirm button's words where a question passes none of its own. */
|
|
7
|
+
confirm: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ConfirmOptions {
|
|
10
|
+
confirmLabel?: string;
|
|
11
|
+
confirmLabelKey?: string;
|
|
12
|
+
confirmGlyph?: Component;
|
|
13
|
+
/** A switch or two the answer needs, shown under the question. */
|
|
14
|
+
extra?: Component;
|
|
15
|
+
}
|
|
16
|
+
export declare function useConfirm(text: ConfirmText): {
|
|
17
|
+
confirm: (message: string, options?: ConfirmOptions) => Promise<boolean>;
|
|
18
|
+
dismiss: () => void;
|
|
19
|
+
ConfirmHost: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Ref, type WritableComputedRef } from "vue";
|
|
2
|
+
import { type LabelAxis, type LabelMode, type Motion, type RainbowState, type Shape } from "@glimstone/core";
|
|
3
|
+
/** One axis of the label engine. Writing it stores the mode and tells every control. */
|
|
4
|
+
export declare function useLabelMode(axis: LabelAxis): WritableComputedRef<LabelMode>;
|
|
5
|
+
/** The rainbow state. Writing it applies the new state to the document. */
|
|
6
|
+
export declare function useRainbow(): WritableComputedRef<RainbowState>;
|
|
7
|
+
/** The custom properties that put an element at a rainbow position. */
|
|
8
|
+
export declare function useHue(index: () => number | undefined): Ref<Record<string, string> | undefined>;
|
|
9
|
+
export declare function useShape(): WritableComputedRef<Shape>;
|
|
10
|
+
export declare function useMotion(): WritableComputedRef<Motion>;
|
|
11
|
+
/** The accent the user chose, or "" for the default. */
|
|
12
|
+
export declare function useAccent(): WritableComputedRef<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Combobox } from "../Combobox.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Select } from "../Select.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Slider } from "../Slider.vue";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { h as e } from "vue";
|
|
2
|
+
import { MARKS as t } from "@glimstone/core";
|
|
3
|
+
// src/glyphs.ts
|
|
4
|
+
var n = null;
|
|
5
|
+
function r(e) {
|
|
6
|
+
n = e;
|
|
7
|
+
}
|
|
8
|
+
function i(e) {
|
|
9
|
+
return n ? n(e) : void 0;
|
|
10
|
+
}
|
|
11
|
+
var a = ({ mark: t }) => e("svg", {
|
|
12
|
+
width: t.size,
|
|
13
|
+
height: t.size,
|
|
14
|
+
viewBox: t.viewBox,
|
|
15
|
+
fill: "currentColor",
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
innerHTML: t.body
|
|
18
|
+
});
|
|
19
|
+
a.props = ["mark"];
|
|
20
|
+
function o(t) {
|
|
21
|
+
return () => e(a, {
|
|
22
|
+
mark: t,
|
|
23
|
+
class: "glim-mark"
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
var s = o(t.close), c = o(t.cancel), l = o(t.check), u = o(t.expand), d = o(t.windowMinimise), f = o(t.windowMaximise), p = o(t.windowRestore);
|
|
27
|
+
export { f as a, a as c, u as i, i as l, l as n, d as o, s as r, p as s, c as t, r as u };
|
package/dist/glyphs.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Component, type FunctionalComponent } from "vue";
|
|
2
|
+
import { type Mark } from "@glimstone/core";
|
|
3
|
+
/**
|
|
4
|
+
* Register the app's label-key-to-glyph mapping, once, at boot. A button that is
|
|
5
|
+
* given no glyph cannot be shown in glyph mode, and one place to ask saves
|
|
6
|
+
* passing an icon at every call site.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setGlyphResolver(fn: (labelKey: string) => Component | undefined): void;
|
|
9
|
+
/** The mark for a label key, or nothing when no app resolver knows it. */
|
|
10
|
+
export declare function glyphFor(labelKey: string): Component | undefined;
|
|
11
|
+
/** A mark from the core, drawn in the current colour. A `class` falls through to the <svg>. */
|
|
12
|
+
export declare const MarkSvg: FunctionalComponent<{
|
|
13
|
+
mark: Mark;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const IconClose: FunctionalComponent<{}, {}, any, {}>;
|
|
16
|
+
export declare const IconCancel: FunctionalComponent<{}, {}, any, {}>;
|
|
17
|
+
export declare const IconCheck: FunctionalComponent<{}, {}, any, {}>;
|
|
18
|
+
export declare const IconExpand: FunctionalComponent<{}, {}, any, {}>;
|
|
19
|
+
export declare const IconWindowMinimise: FunctionalComponent<{}, {}, any, {}>;
|
|
20
|
+
export declare const IconWindowMaximise: FunctionalComponent<{}, {}, any, {}>;
|
|
21
|
+
export declare const IconWindowRestore: FunctionalComponent<{}, {}, any, {}>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { default as Badge } from "./Badge.vue";
|
|
2
|
+
export { default as BrandMark } from "./BrandMark.vue";
|
|
3
|
+
export { default as Button } from "./Button.vue";
|
|
4
|
+
export { default as Card } from "./Card.vue";
|
|
5
|
+
export { default as ConfirmDialog } from "./ConfirmDialog.vue";
|
|
6
|
+
export { default as EmptyState } from "./EmptyState.vue";
|
|
7
|
+
export { default as IconTipButton } from "./IconTipButton.vue";
|
|
8
|
+
export { default as InfoAboutCard } from "./InfoAboutCard.vue";
|
|
9
|
+
export { default as InfoBubble } from "./InfoBubble.vue";
|
|
10
|
+
export { default as InfoHelpCard } from "./InfoHelpCard.vue";
|
|
11
|
+
export { default as InfoTile } from "./InfoTile.vue";
|
|
12
|
+
export { default as InfoVersionCard } from "./InfoVersionCard.vue";
|
|
13
|
+
export { default as NumberField } from "./NumberField.vue";
|
|
14
|
+
export { default as ReadmeButton } from "./ReadmeButton.vue";
|
|
15
|
+
export { default as Selector } from "./Selector.vue";
|
|
16
|
+
export { default as SidebarRow } from "./SidebarRow.vue";
|
|
17
|
+
export { default as SubCard } from "./SubCard.vue";
|
|
18
|
+
export { default as ToastViewport } from "./ToastViewport.vue";
|
|
19
|
+
export { default as Toggle } from "./Toggle.vue";
|
|
20
|
+
export { default as UnavailableNotice } from "./UnavailableNotice.vue";
|
|
21
|
+
export { useConfirm, type ConfirmOptions, type ConfirmText } from "./confirm";
|
|
22
|
+
export { useAccent, useHue, useLabelMode, useMotion, useRainbow, useShape } from "./engines";
|
|
23
|
+
export * from "./glyphs";
|
|
24
|
+
export type { InfoAboutCardProps, InfoHelpCardProps, InfoVersionCardProps } from "./info";
|
|
25
|
+
export type { SelectEntry, SelectGroup, SelectOption, SelectSubmenu } from "./selectParts";
|
|
26
|
+
export type { SelectorItem } from "./selectorItem";
|
|
27
|
+
export { selectorTabId } from "@glimstone/core";
|
|
28
|
+
export { useTipBubble, type TipBubble } from "./tipBubble";
|
|
29
|
+
export { GLIMSTONE_VERSION } from "@glimstone/core";
|