@glimstone/vue 4.1.1 → 4.2.2

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 CHANGED
@@ -45,6 +45,9 @@ const { confirm, ConfirmHost } = useConfirm({ title: "Confirm", cancel: "Cancel"
45
45
  - The engines are composables: `useLabelMode`, `useRainbow`, `useShape`,
46
46
  `useMotion`, `useAccent` and `useHue`, each a writable ref that follows the
47
47
  document.
48
+ - A component that waits for the app's answer, such as `SignInCard`, takes
49
+ async callbacks as props (`:on-sign-in`, or `@sign-in`, which Vue binds to the
50
+ same prop), since an emitted event cannot answer.
48
51
  - `Select`, `Combobox` and `Slider` come from their own entries and need
49
52
  `@zag-js/vue` with their machine packages (`@zag-js/select` and
50
53
  `@zag-js/menu`, `@zag-js/combobox`, `@zag-js/slider`).
@@ -0,0 +1,61 @@
1
+ import { type ResetAnswer, type SignInAnswer, type SignInText } from "@glimstone/core";
2
+ type __VLS_Props = {
3
+ /** The address of the app's logo. It stands large above the name. */
4
+ logo?: string;
5
+ /** The page's heading. */
6
+ appName: string;
7
+ text: SignInText;
8
+ /** Offers Sign in with a passkey. Pass it only where a passkey can answer on this address. */
9
+ passkey?: boolean;
10
+ /** Offers Forgot password? and the reset form. */
11
+ reset?: boolean;
12
+ /** The shortest new password the reset form takes, as the server says. */
13
+ minPassword?: number;
14
+ /** One line at the top of the sign-in form, such as "You are signed out". */
15
+ note?: string;
16
+ /** The label keys behind the buttons, which pick their glyphs. */
17
+ labelKeys?: Partial<Record<"signIn" | "passkey" | "forgot" | "back" | "setPassword", string>>;
18
+ /** The start of the fields' ids: `-password`, `-code`, `-reset-code`, `-new` and `-confirm` follow it. */
19
+ idPrefix?: string;
20
+ /** Puts the focus in the first empty field when the card opens. */
21
+ autoFocus?: boolean;
22
+ /** `code` is set once the app asked for one, and `passkey` when a passkey started the sign-in. */
23
+ onSignIn: (input: {
24
+ password: string;
25
+ code?: string;
26
+ passkey: boolean;
27
+ }) => Promise<SignInAnswer>;
28
+ onPasskey?: () => Promise<SignInAnswer>;
29
+ /** Writes a code to the log. The reset form shows only once this answers ok. */
30
+ onAskCode?: () => Promise<ResetAnswer>;
31
+ onSetPassword?: (input: {
32
+ code: string;
33
+ password: string;
34
+ }) => Promise<ResetAnswer>;
35
+ };
36
+ declare const __VLS_template: () => {
37
+ __VLS_Slots: {
38
+ logo?: (props: {}) => any;
39
+ } & {
40
+ step?: (props: {}) => any;
41
+ } & {
42
+ fields?: (props: {}) => any;
43
+ } & {
44
+ actions?: (props: {}) => any;
45
+ };
46
+ };
47
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
48
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
49
+ reset: boolean;
50
+ autoFocus: boolean;
51
+ passkey: boolean;
52
+ minPassword: number;
53
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
55
+ declare const _default: typeof __VLS_export;
56
+ export default _default;
57
+ type __VLS_WithSlots<T, S> = T & {
58
+ new (): {
59
+ $slots: S;
60
+ };
61
+ };
@@ -0,0 +1,22 @@
1
+ type __VLS_Props = {
2
+ label: string;
3
+ /** The id of the field in the slot. */
4
+ for: string;
5
+ /** What the field asks for, drawn as an "(i)" beside the label. */
6
+ hint?: string;
7
+ };
8
+ declare const __VLS_template: () => {
9
+ __VLS_Slots: {
10
+ default?: (props: {}) => any;
11
+ };
12
+ };
13
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
14
+ 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>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
package/dist/index.d.ts CHANGED
@@ -32,6 +32,8 @@ export { default as ReadmeButton } from "./ReadmeButton.vue";
32
32
  export { default as RowMark } from "./RowMark.vue";
33
33
  export { default as Selector } from "./Selector.vue";
34
34
  export { default as SidebarRow } from "./SidebarRow.vue";
35
+ export { default as SignInCard } from "./SignInCard.vue";
36
+ export { default as SignInField } from "./SignInField.vue";
35
37
  export { default as SubCard } from "./SubCard.vue";
36
38
  export { default as Table } from "./Table.vue";
37
39
  export { default as TextArea } from "./TextArea.vue";
@@ -49,6 +51,7 @@ export type { InfoAboutCardProps, InfoHelpCardProps, InfoVersionCardProps } from
49
51
  export type { SelectEntry, SelectGroup, SelectOption, SelectSubmenu } from "./selectParts";
50
52
  export type { SelectorItem } from "./selectorItem";
51
53
  export type { MenuBarMenu, MenuEntry, MenuHead, MenuItem, TreeNode, WindowAction } from "./windowParts";
54
+ export type { ResetAnswer, SignInAnswer, SignInText } from "@glimstone/core";
52
55
  export type { ButtonSize, ColorName, ColorPickerPanelText, FieldWidth, MeterSize, PillTone, SelectRows, TableColumn, ToastAction, WindowSize } from "@glimstone/core";
53
56
  export { selectorTabId } from "@glimstone/core";
54
57
  export { useTipBubble, type TipBubble } from "./tipBubble";