rei-kit 2.4.1 → 2.6.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.
@@ -0,0 +1,44 @@
1
+ /**
2
+ * A short code typed one character per box — a sign-in code, a PIN.
3
+ *
4
+ * No `maxlength` on the boxes: iOS fills a one-time code into the first box
5
+ * in one go, and a limit of one would cut it to its first digit.
6
+ *
7
+ * The boxes are a way of showing the length, not of splitting the work:
8
+ * typing moves to the next box on its own, Backspace on an empty box goes
9
+ * back and clears, the arrows move, and pasting "482913" anywhere fills all
10
+ * six. The first box carries `autocomplete="one-time-code"`, so a phone
11
+ * offers the code from the message it just received.
12
+ *
13
+ * `complete` fires once when the last box is filled — the moment to submit,
14
+ * so nobody has to find a button after typing six digits.
15
+ */
16
+ type __VLS_Props = {
17
+ /** How many characters. */
18
+ length?: number | undefined;
19
+ /** The group's accessible name, e.g. "Verification code". */
20
+ label: string;
21
+ /** Each box's accessible name, from its 1-based position: `(n, total) => \`Digit ${n} of ${total}\``. */
22
+ cellLabel: (position: number, total: number) => string;
23
+ /** `numeric` takes digits and opens the number pad; `alphanumeric` takes letters too. */
24
+ type?: 'numeric' | 'alphanumeric' | undefined;
25
+ /** Show dots instead of the characters, for a PIN. */
26
+ mask?: boolean | undefined;
27
+ /** A message under the boxes; also marks them invalid. */
28
+ error?: string | undefined;
29
+ disabled?: boolean | undefined;
30
+ };
31
+ type __VLS_ModelProps = {
32
+ /** The code so far, with `v-model`. Always shorter than or as long as `length`. */
33
+ modelValue?: string;
34
+ };
35
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
36
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
37
+ "update:modelValue": (value: string) => any;
38
+ complete: (code: string) => any;
39
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
40
+ "onUpdate:modelValue"?: (value: string) => any;
41
+ onComplete?: (code: string) => any;
42
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { Component } from 'vue';
2
+ declare const __VLS_export: <V extends string, M extends "single" | "multiple" = "single">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<({
4
+ options: readonly {
5
+ value: V;
6
+ /** Visible text — or, with an icon and `iconOnly`, the accessible name. */
7
+ label: string;
8
+ icon?: Component | undefined;
9
+ /** Show the icon alone. The label becomes the button's accessible name. */
10
+ iconOnly?: boolean | undefined;
11
+ disabled?: boolean | undefined;
12
+ }[];
13
+ /** The group's accessible name. */
14
+ label: string;
15
+ /** `single`: at most one pressed. `multiple`: any number. */
16
+ mode?: M | undefined;
17
+ /** In `single` mode, never let the last pressed button go. */
18
+ required?: boolean | undefined;
19
+ size?: "sm" | "md" | undefined;
20
+ } & {
21
+ /** The pressed value — or, in `multiple` mode, the pressed values. */
22
+ modelValue?: M extends "multiple" ? V[] : V | undefined;
23
+ }) & {
24
+ "onUpdate:modelValue"?: (value: M extends "multiple" ? V[] : V | undefined) => any;
25
+ }> & (typeof globalThis extends {
26
+ __VLS_PROPS_FALLBACK: infer P;
27
+ } ? P : {});
28
+ expose: (exposed: {}) => void;
29
+ attrs: any;
30
+ slots: {};
31
+ emit: (event: "update:modelValue", value: M extends "multiple" ? V[] : V | undefined) => void;
32
+ }>) => import('vue').VNode & {
33
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
34
+ };
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
37
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
38
+ [K in keyof T]: T[K];
39
+ } : {
40
+ [K in keyof T as K]: T[K];
41
+ }) & {};
@@ -22,16 +22,34 @@
22
22
  * same corner. The store lives at module scope and `ToastHost` renders it.
23
23
  */
24
24
  export type ToastTone = 'info' | 'success' | 'warning' | 'danger';
25
+ /**
26
+ * One button on a toast — nearly always "Undo".
27
+ *
28
+ * The toast is dismissed when it is pressed, so the handler only has to do
29
+ * the undoing.
30
+ */
31
+ export interface ToastAction {
32
+ /** The button's text. Already translated. */
33
+ readonly label: string;
34
+ readonly onClick: () => void;
35
+ }
25
36
  export interface Toast {
26
37
  readonly id: number;
27
38
  readonly message: string;
28
39
  readonly tone: ToastTone;
29
40
  /** Milliseconds on screen. `0` stays until dismissed. */
30
41
  readonly duration: number;
42
+ readonly action?: ToastAction | undefined;
31
43
  }
32
44
  export interface ToastOptions {
33
45
  /** Milliseconds on screen; `0` stays until dismissed. */
34
46
  duration?: number | undefined;
47
+ /**
48
+ * A button on the toast. An undo is the kindest confirmation there is: act
49
+ * first, and let the reader take it back, instead of asking "are you sure"
50
+ * before every delete.
51
+ */
52
+ action?: ToastAction | undefined;
35
53
  }
36
54
  /** Removes a toast, whether it timed out or was dismissed. */
37
55
  declare function dismiss(id: number): void;
@@ -58,6 +76,10 @@ declare function resume(id: number): void;
58
76
  *
59
77
  * const id = toast.info(t('export.preparing'), { duration: 0 })
60
78
  * toast.dismiss(id)
79
+ *
80
+ * toast.success(t('entry.deleted'), {
81
+ * action: { label: t('common.undo'), onClick: () => restore(entry) },
82
+ * })
61
83
  * ```
62
84
  */
63
85
  export declare function useToast(): {
@@ -67,11 +89,19 @@ export declare function useToast(): {
67
89
  readonly message: string;
68
90
  readonly tone: ToastTone;
69
91
  readonly duration: number;
92
+ readonly action?: {
93
+ readonly label: string;
94
+ readonly onClick: () => void;
95
+ } | undefined;
70
96
  }[], readonly {
71
97
  readonly id: number;
72
98
  readonly message: string;
73
99
  readonly tone: ToastTone;
74
100
  readonly duration: number;
101
+ readonly action?: {
102
+ readonly label: string;
103
+ readonly onClick: () => void;
104
+ } | undefined;
75
105
  }[]>>;
76
106
  info: (message: string, options?: ToastOptions) => number;
77
107
  success: (message: string, options?: ToastOptions) => number;
package/dist/index.d.ts CHANGED
@@ -44,7 +44,7 @@ export { useDragScroll } from './composables/use-drag-scroll';
44
44
  export { useMediaQuery } from './composables/use-media-query';
45
45
  export { useVisualViewport } from './composables/use-visual-viewport';
46
46
  export { useToast } from './composables/use-toast';
47
- export type { Toast, ToastOptions, ToastTone } from './composables/use-toast';
47
+ export type { Toast, ToastAction, ToastOptions, ToastTone } from './composables/use-toast';
48
48
  export type { VisualViewportRect } from './composables/use-visual-viewport';
49
49
  export { default as BaseAvatar } from './components/BaseAvatar.vue';
50
50
  export { default as BaseAlert } from './components/BaseAlert.vue';
@@ -85,5 +85,17 @@ export { default as LocaleLinks } from './components/LocaleLinks.vue';
85
85
  export { default as GoogleButton } from './components/GoogleButton.vue';
86
86
  export { default as TabBar } from './components/TabBar.vue';
87
87
  export type { TabItem } from './components/TabBar.vue';
88
+ export { default as BaseCalendar } from './components/BaseCalendar.vue';
89
+ export type { DateRange } from './components/BaseCalendar.vue';
90
+ export { default as BaseDatePicker } from './components/BaseDatePicker.vue';
91
+ export type { DatePreset } from './components/BaseDatePicker.vue';
92
+ export { default as BasePopover } from './components/BasePopover.vue';
93
+ export type { PopoverTriggerProps } from './components/BasePopover.vue';
94
+ export { default as ToggleGroup } from './components/ToggleGroup.vue';
95
+ export { default as NumberInput } from './components/NumberInput.vue';
96
+ export { default as PinInput } from './components/PinInput.vue';
97
+ export { default as CircularProgress } from './components/CircularProgress.vue';
98
+ export { default as BaseStepper } from './components/BaseStepper.vue';
99
+ export type { StepperStep } from './components/BaseStepper.vue';
88
100
  export { createI18nRuntime } from './i18n/runtime';
89
101
  export type { I18nRuntimeOptions, LocalePreference } from './i18n/runtime';