@thekestongroup/ui 0.2.0 → 0.3.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 +90 -32
- package/dist/components/Age/Age.vue.d.ts +19 -0
- package/dist/components/AppShell/AppShell.vue.d.ts +108 -0
- package/dist/components/Avatar/Avatar.vue.d.ts +34 -0
- package/dist/components/AvatarGroup/AvatarGroup.vue.d.ts +25 -0
- package/dist/components/Badge/Badge.vue.d.ts +41 -0
- package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +39 -0
- package/dist/components/Button/Button.vue.d.ts +69 -0
- package/dist/components/Calendar/Calendar.vue.d.ts +34 -0
- package/dist/components/Card/Card.vue.d.ts +56 -0
- package/dist/components/Checkbox/Checkbox.vue.d.ts +40 -0
- package/dist/components/Checklist/Checklist.vue.d.ts +18 -0
- package/dist/components/Chip/Chip.vue.d.ts +44 -0
- package/dist/components/Divider/Divider.vue.d.ts +36 -0
- package/dist/components/{ToastItem.vue.d.ts → FormField/FieldMessage.vue.d.ts} +10 -2
- package/dist/components/FormField/FormField.vue.d.ts +61 -0
- package/dist/components/Header/Header.vue.d.ts +104 -0
- package/dist/components/InfoTip/InfoTip.vue.d.ts +20 -0
- package/dist/components/Input/Input.vue.d.ts +56 -0
- package/dist/components/InputCode/InputCode.vue.d.ts +53 -0
- package/dist/components/InputDate/InputDate.vue.d.ts +49 -0
- package/dist/components/InputNumber/InputNumber.vue.d.ts +44 -0
- package/dist/components/InputPassword/InputPassword.vue.d.ts +51 -0
- package/dist/components/InputRichText/InputRichText.vue.d.ts +44 -0
- package/dist/components/Link/Link.vue.d.ts +39 -0
- package/dist/components/Notification/Notification.vue.d.ts +62 -0
- package/dist/components/Notification/NotificationPane.vue.d.ts +38 -0
- package/dist/components/Notification/Toaster.vue.d.ts +51 -0
- package/dist/components/Notification/notification.samples.d.ts +3 -0
- package/dist/components/Notification/notifications.d.ts +115 -0
- package/dist/components/PageHeader/PageHeader.vue.d.ts +43 -0
- package/dist/components/Popover/Popover.vue.d.ts +83 -0
- package/dist/components/Popover/popover.d.ts +16 -0
- package/dist/components/Progress/Progress.vue.d.ts +26 -0
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +45 -0
- package/dist/components/RelativeTime/RelativeTime.vue.d.ts +22 -0
- package/dist/components/Select/Select.vue.d.ts +110 -0
- package/dist/components/Sidebar/Sidebar.vue.d.ts +106 -0
- package/dist/components/Sidebar/sidebar.d.ts +10 -0
- package/dist/components/Slideover/Slideover.vue.d.ts +125 -0
- package/dist/components/Spinner/Spinner.vue.d.ts +30 -0
- package/dist/components/StatTile/StatTile.vue.d.ts +46 -0
- package/dist/components/SummaryList/SummaryList.vue.d.ts +62 -0
- package/dist/components/Switch/Switch.vue.d.ts +39 -0
- package/dist/components/Table/Table.vue.d.ts +82 -0
- package/dist/components/Table/table.d.ts +36 -0
- package/dist/components/Tooltip/Tooltip.vue.d.ts +46 -0
- package/dist/index.d.ts +89 -25
- package/dist/keston-ui.js +4963 -14785
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/dates.d.ts +27 -0
- package/dist/lib/initials.d.ts +2 -0
- package/dist/lib/parseDate.d.ts +44 -0
- package/dist/lib/useNow.d.ts +3 -0
- package/package.json +53 -24
- package/src/components/.gitkeep +0 -0
- package/src/components/Age/Age.stories.ts +24 -0
- package/src/components/Age/Age.vue +56 -0
- package/src/components/AppShell/AppShell.stories.ts +124 -0
- package/src/components/AppShell/AppShell.vue +212 -0
- package/src/components/Avatar/Avatar.stories.ts +56 -0
- package/src/components/Avatar/Avatar.vue +118 -0
- package/src/components/AvatarGroup/AvatarGroup.stories.ts +47 -0
- package/src/components/AvatarGroup/AvatarGroup.vue +97 -0
- package/src/components/Badge/Badge.stories.ts +92 -0
- package/src/components/Badge/Badge.vue +67 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.ts +58 -0
- package/src/components/Breadcrumb/Breadcrumb.vue +109 -0
- package/src/components/Button/Button.mdx +79 -0
- package/src/components/Button/Button.stories.ts +207 -0
- package/src/components/Button/Button.vue +266 -0
- package/src/components/Calendar/Calendar.stories.ts +51 -0
- package/src/components/Calendar/Calendar.vue +364 -0
- package/src/components/Card/Card.stories.ts +109 -0
- package/src/components/Card/Card.vue +115 -0
- package/src/components/Checkbox/Checkbox.stories.ts +102 -0
- package/src/components/Checkbox/Checkbox.vue +102 -0
- package/src/components/Checklist/Checklist.stories.ts +67 -0
- package/src/components/Checklist/Checklist.vue +38 -0
- package/src/components/Chip/Chip.stories.ts +71 -0
- package/src/components/Chip/Chip.vue +86 -0
- package/src/components/Divider/Divider.stories.ts +57 -0
- package/src/components/Divider/Divider.vue +58 -0
- package/src/components/FormField/FieldMessage.vue +81 -0
- package/src/components/FormField/FormField.stories.ts +55 -0
- package/src/components/FormField/FormField.vue +160 -0
- package/src/components/Header/Header.stories.ts +168 -0
- package/src/components/Header/Header.vue +232 -0
- package/src/components/InfoTip/InfoTip.stories.ts +63 -0
- package/src/components/InfoTip/InfoTip.vue +50 -0
- package/src/components/Input/Input.stories.ts +206 -0
- package/src/components/Input/Input.vue +90 -0
- package/src/components/InputCode/InputCode.stories.ts +85 -0
- package/src/components/InputCode/InputCode.vue +145 -0
- package/src/components/InputDate/InputDate.stories.ts +58 -0
- package/src/components/InputDate/InputDate.vue +258 -0
- package/src/components/InputNumber/InputNumber.stories.ts +63 -0
- package/src/components/InputNumber/InputNumber.vue +109 -0
- package/src/components/InputPassword/InputPassword.stories.ts +105 -0
- package/src/components/InputPassword/InputPassword.vue +132 -0
- package/src/components/InputRichText/InputRichText.stories.ts +100 -0
- package/src/components/InputRichText/InputRichText.vue +194 -0
- package/src/components/Link/Link.stories.ts +73 -0
- package/src/components/Link/Link.vue +56 -0
- package/src/components/Notification/Notification.stories.ts +196 -0
- package/src/components/Notification/Notification.vue +136 -0
- package/src/components/Notification/NotificationPane.vue +187 -0
- package/src/components/Notification/Toaster.vue +446 -0
- package/src/components/Notification/notification.samples.ts +45 -0
- package/src/components/Notification/notifications.test.ts +99 -0
- package/src/components/Notification/notifications.ts +172 -0
- package/src/components/PageHeader/PageHeader.stories.ts +79 -0
- package/src/components/PageHeader/PageHeader.vue +66 -0
- package/src/components/Popover/Popover.stories.ts +135 -0
- package/src/components/Popover/Popover.vue +192 -0
- package/src/components/Popover/popover.ts +20 -0
- package/src/components/Progress/Progress.stories.ts +74 -0
- package/src/components/Progress/Progress.vue +75 -0
- package/src/components/RadioGroup/RadioGroup.stories.ts +90 -0
- package/src/components/RadioGroup/RadioGroup.vue +132 -0
- package/src/components/RelativeTime/RelativeTime.stories.ts +74 -0
- package/src/components/RelativeTime/RelativeTime.vue +51 -0
- package/src/components/Select/Select.mdx +202 -0
- package/src/components/Select/Select.stories.ts +223 -0
- package/src/components/Select/Select.vue +630 -0
- package/src/components/Sidebar/Sidebar.stories.ts +192 -0
- package/src/components/Sidebar/Sidebar.vue +382 -0
- package/src/components/Sidebar/sidebar.ts +20 -0
- package/src/components/Slideover/Slideover.stories.ts +225 -0
- package/src/components/Slideover/Slideover.vue +365 -0
- package/src/components/Spinner/Spinner.stories.ts +79 -0
- package/src/components/Spinner/Spinner.vue +97 -0
- package/src/components/StatTile/StatTile.stories.ts +75 -0
- package/src/components/StatTile/StatTile.vue +89 -0
- package/src/components/SummaryList/SummaryList.stories.ts +103 -0
- package/src/components/SummaryList/SummaryList.vue +127 -0
- package/src/components/Switch/Switch.stories.ts +100 -0
- package/src/components/Switch/Switch.vue +96 -0
- package/src/components/Table/Table.stories.ts +206 -0
- package/src/components/Table/Table.vue +220 -0
- package/src/components/Table/table.test.ts +65 -0
- package/src/components/Table/table.ts +70 -0
- package/src/components/Tooltip/Tooltip.stories.ts +57 -0
- package/src/components/Tooltip/Tooltip.vue +86 -0
- package/src/examples/AppPages.stories.ts +500 -0
- package/src/examples/FormLayout.stories.ts +185 -0
- package/src/examples/KestonIdPages.stories.ts +415 -0
- package/src/examples/SchoolPages.stories.ts +665 -0
- package/src/index.ts +114 -36
- package/src/lib/cn.ts +4 -0
- package/src/lib/dates.test.ts +68 -0
- package/src/lib/dates.ts +86 -0
- package/src/lib/initials.ts +8 -0
- package/src/lib/parseDate.test.ts +331 -0
- package/src/lib/parseDate.ts +561 -0
- package/src/lib/useNow.ts +20 -0
- package/src/styles/theme.css +101 -0
- package/dist/components/AppLauncher.vue.d.ts +0 -10
- package/dist/components/Avatar.vue.d.ts +0 -16
- package/dist/components/Button.vue.d.ts +0 -27
- package/dist/components/Checkbox.vue.d.ts +0 -18
- package/dist/components/CloseButton.vue.d.ts +0 -6
- package/dist/components/Dialog.vue.d.ts +0 -23
- package/dist/components/Drawer.vue.d.ts +0 -34
- package/dist/components/DropdownMenu.vue.d.ts +0 -21
- package/dist/components/DropdownMenuItem.vue.d.ts +0 -19
- package/dist/components/DropdownMenuSeparator.vue.d.ts +0 -6
- package/dist/components/Input.vue.d.ts +0 -14
- package/dist/components/Label.vue.d.ts +0 -16
- package/dist/components/NotificationsMenu.vue.d.ts +0 -3
- package/dist/components/Popover.vue.d.ts +0 -23
- package/dist/components/ProfileSwitcher.vue.d.ts +0 -24
- package/dist/components/Select.vue.d.ts +0 -28
- package/dist/components/Separator.vue.d.ts +0 -11
- package/dist/components/ToastRenderer.vue.d.ts +0 -3
- package/dist/components/Toaster.vue.d.ts +0 -3
- package/dist/components/Tooltip.vue.d.ts +0 -23
- package/dist/components/TopBar.vue.d.ts +0 -34
- package/dist/favicon-old.svg +0 -1
- package/dist/favicon.svg +0 -1
- package/dist/keston-ui.cjs +0 -15
- package/dist/lib/toast.d.ts +0 -29
- package/dist/lib/types.d.ts +0 -5
- package/src/components/AppLauncher.vue +0 -63
- package/src/components/Avatar.vue +0 -51
- package/src/components/Button.vue +0 -54
- package/src/components/Checkbox.vue +0 -47
- package/src/components/CloseButton.vue +0 -24
- package/src/components/Dialog.vue +0 -65
- package/src/components/Drawer.vue +0 -202
- package/src/components/DropdownMenu.vue +0 -41
- package/src/components/DropdownMenuItem.vue +0 -28
- package/src/components/DropdownMenuSeparator.vue +0 -12
- package/src/components/Input.vue +0 -21
- package/src/components/Label.vue +0 -15
- package/src/components/NotificationsMenu.vue +0 -115
- package/src/components/Popover.vue +0 -46
- package/src/components/ProfileSwitcher.vue +0 -113
- package/src/components/Select.vue +0 -97
- package/src/components/Separator.vue +0 -30
- package/src/components/ToastItem.vue +0 -158
- package/src/components/ToastRenderer.vue +0 -113
- package/src/components/Toaster.vue +0 -11
- package/src/components/Tooltip.vue +0 -48
- package/src/components/TopBar.vue +0 -52
- package/src/lib/toast.ts +0 -95
- package/src/lib/types.ts +0 -5
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { NotificationAction, NotificationInput, NotificationType } from './notifications';
|
|
3
|
+
/**
|
|
4
|
+
* One notification: an icon for its type, a title, a description, an
|
|
5
|
+
* optional action button, and a close ×.
|
|
6
|
+
*
|
|
7
|
+
* - appearance "card" (default): a white panel with a border. On a page, or
|
|
8
|
+
* as a toast (Toaster adds the shadow).
|
|
9
|
+
* - appearance "row": no border, for lists, e.g. NotificationPane. Shows the
|
|
10
|
+
* time, and a dot when unread.
|
|
11
|
+
*
|
|
12
|
+
* The description can be formatted with a render function, e.g.
|
|
13
|
+
* `() => ['Your password expires in ', h('b', '7 days'), '.']`, or the
|
|
14
|
+
* default slot.
|
|
15
|
+
*/
|
|
16
|
+
export interface NotificationProps {
|
|
17
|
+
type?: NotificationType;
|
|
18
|
+
title: string;
|
|
19
|
+
description?: NotificationInput['description'];
|
|
20
|
+
action?: NotificationAction;
|
|
21
|
+
/** When it happened. Shown in the row appearance, e.g. "2 hours ago", with the exact time on hover. */
|
|
22
|
+
createdAt?: Date;
|
|
23
|
+
/** Row appearance: show the unread dot. */
|
|
24
|
+
unread?: boolean;
|
|
25
|
+
appearance?: 'card' | 'row';
|
|
26
|
+
/**
|
|
27
|
+
* Card appearance: one line, for quick confirmations, e.g. "✓ Student
|
|
28
|
+
* disabled [Undo] ×". The title only (no description); the action sits on
|
|
29
|
+
* the right, before the ×.
|
|
30
|
+
*/
|
|
31
|
+
compact?: boolean;
|
|
32
|
+
/** Show the close ×. */
|
|
33
|
+
dismissible?: boolean;
|
|
34
|
+
/** The ×'s accessible name. Default "Dismiss: {title}". */
|
|
35
|
+
dismissLabel?: string;
|
|
36
|
+
/** What "now" is for the relative time. Default the live time. */
|
|
37
|
+
now?: Date;
|
|
38
|
+
class?: HTMLAttributes['class'];
|
|
39
|
+
}
|
|
40
|
+
type __VLS_Slots = {
|
|
41
|
+
default?(): unknown;
|
|
42
|
+
actions?(): unknown;
|
|
43
|
+
};
|
|
44
|
+
declare const __VLS_base: import('vue').DefineComponent<NotificationProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
45
|
+
action: () => any;
|
|
46
|
+
dismiss: () => any;
|
|
47
|
+
}, string, import('vue').PublicProps, Readonly<NotificationProps> & Readonly<{
|
|
48
|
+
onAction?: (() => any) | undefined;
|
|
49
|
+
onDismiss?: (() => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
type: NotificationType;
|
|
52
|
+
dismissible: boolean;
|
|
53
|
+
appearance: "row" | "card";
|
|
54
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
55
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
56
|
+
declare const _default: typeof __VLS_export;
|
|
57
|
+
export default _default;
|
|
58
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
59
|
+
new (): {
|
|
60
|
+
$slots: S;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { Notifications } from './notifications';
|
|
3
|
+
/**
|
|
4
|
+
* The bell in the Header, with a count of unread notifications, that opens
|
|
5
|
+
* a panel of past notifications: newest first, each with a × to remove it,
|
|
6
|
+
* and Clear all. Put it in the Header's `trailing` slot (AppShell's
|
|
7
|
+
* `header-trailing`).
|
|
8
|
+
*
|
|
9
|
+
* Opening it shows what's unread (a dot on each); closing it marks them all
|
|
10
|
+
* read.
|
|
11
|
+
*/
|
|
12
|
+
export interface NotificationPaneProps {
|
|
13
|
+
/** The list to show. Default the shared one from `useNotifications()`. */
|
|
14
|
+
notifications?: Notifications;
|
|
15
|
+
/** Panel heading, and the bell's name. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Shown when there are none. */
|
|
18
|
+
emptyText?: string;
|
|
19
|
+
ui?: {
|
|
20
|
+
content?: HTMLAttributes['class'];
|
|
21
|
+
trigger?: HTMLAttributes['class'];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
type __VLS_Props = NotificationPaneProps;
|
|
25
|
+
type __VLS_ModelProps = {
|
|
26
|
+
'open'?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
29
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
30
|
+
"update:open": (value: boolean) => any;
|
|
31
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
label: string;
|
|
35
|
+
emptyText: string;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { Notifications } from './notifications';
|
|
3
|
+
/**
|
|
4
|
+
* Shows new notifications as toasts: cards that slide in at the edge of the
|
|
5
|
+
* screen and close by themselves. Put one in the app (e.g. beside AppShell),
|
|
6
|
+
* then call `notify()` from anywhere:
|
|
7
|
+
*
|
|
8
|
+
* const { notify } = useNotifications()
|
|
9
|
+
* notify({ type: 'success', title: 'Saved' })
|
|
10
|
+
*
|
|
11
|
+
* New toasts slide in from the bottom (top for top-right) and push the
|
|
12
|
+
* others along smoothly. Toasts that don't fit in `maxHeight` collapse into
|
|
13
|
+
* a "+5 more" pill on top of the stack saying how many aren't in view (they
|
|
14
|
+
* shrink into it, and grow out of it again); hovering the toasts, tapping the pill, or
|
|
15
|
+
* keyboard focus in them (F8), spreads them all out.
|
|
16
|
+
*
|
|
17
|
+
* If there are more than fit on the screen spread out, the oldest wait, and
|
|
18
|
+
* a "+3 more"
|
|
19
|
+
* row at the end opens NotificationPane, which has them all.
|
|
20
|
+
*
|
|
21
|
+
* Built on Reka UI's Toast: screen readers hear each one (errors and
|
|
22
|
+
* warnings straight away, others when they're idle), timers pause while the
|
|
23
|
+
* pointer is over them or the window isn't focused, and they swipe away.
|
|
24
|
+
*
|
|
25
|
+
* Closing a toast leaves the notification in the list (NotificationPane).
|
|
26
|
+
*/
|
|
27
|
+
export interface ToasterProps {
|
|
28
|
+
/** The list to show. Default the shared one from `useNotifications()`. */
|
|
29
|
+
notifications?: Notifications;
|
|
30
|
+
/** Where they appear. top-right sits under the 48px Header. */
|
|
31
|
+
position?: 'bottom-right' | 'top-right' | 'bottom-center';
|
|
32
|
+
/**
|
|
33
|
+
* How tall the toasts can be, spread out, before older ones collapse into
|
|
34
|
+
* a stack (in px). The newest always shows in full.
|
|
35
|
+
*/
|
|
36
|
+
maxHeight?: number;
|
|
37
|
+
/** The most toasts kept at once; older ones beyond this wait until one closes. */
|
|
38
|
+
limit?: number;
|
|
39
|
+
class?: HTMLAttributes['class'];
|
|
40
|
+
}
|
|
41
|
+
declare const __VLS_export: import('vue').DefineComponent<ToasterProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
42
|
+
more: () => any;
|
|
43
|
+
}, string, import('vue').PublicProps, Readonly<ToasterProps> & Readonly<{
|
|
44
|
+
onMore?: (() => any) | undefined;
|
|
45
|
+
}>, {
|
|
46
|
+
position: "bottom-right" | "top-right" | "bottom-center";
|
|
47
|
+
maxHeight: number;
|
|
48
|
+
limit: number;
|
|
49
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { VNodeChild } from 'vue';
|
|
2
|
+
export type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export interface NotificationAction {
|
|
4
|
+
label: string;
|
|
5
|
+
/** Run when pressed. The toast closes afterwards (the notification stays in the pane). */
|
|
6
|
+
onSelect?: () => void;
|
|
7
|
+
/** Make the action a link instead. */
|
|
8
|
+
href?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface NotificationInput {
|
|
11
|
+
/** Generated if left out. Notifying with an id that's already there replaces it. */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** Colour and icon. Default info. */
|
|
14
|
+
type?: NotificationType;
|
|
15
|
+
title: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text under the title. A string, or a render function for formatting,
|
|
18
|
+
* e.g. `() => ['Your password expires in ', h('b', '7 days'), '.']`.
|
|
19
|
+
* (No HTML strings: they'd let anything that reaches a notification run
|
|
20
|
+
* as code.)
|
|
21
|
+
*/
|
|
22
|
+
description?: string | (() => VNodeChild);
|
|
23
|
+
action?: NotificationAction;
|
|
24
|
+
/**
|
|
25
|
+
* A one-line toast: icon, title, action, × (e.g. "✓ Student disabled
|
|
26
|
+
* [Undo]"). For quick confirmations; the description isn't shown in the
|
|
27
|
+
* toast. In the pane it's a normal row.
|
|
28
|
+
*/
|
|
29
|
+
compact?: boolean;
|
|
30
|
+
/** When it happened. Default now. */
|
|
31
|
+
createdAt?: Date;
|
|
32
|
+
read?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface NotificationItem extends NotificationInput {
|
|
35
|
+
id: string;
|
|
36
|
+
type: NotificationType;
|
|
37
|
+
createdAt: Date;
|
|
38
|
+
read: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface ToastOptions {
|
|
41
|
+
/** Pop up a toast as well as adding it to the history. Default true. */
|
|
42
|
+
toast?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* How long the toast stays, in ms. Default 6000; until closed for errors,
|
|
45
|
+
* and for toasts with an action (people need time to use it); compact ones
|
|
46
|
+
* with an action (Undo) stay 10 seconds.
|
|
47
|
+
*/
|
|
48
|
+
duration?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ShownToast {
|
|
51
|
+
id: string;
|
|
52
|
+
duration: number;
|
|
53
|
+
item: NotificationItem;
|
|
54
|
+
}
|
|
55
|
+
/** Default toast length: long enough to read; forever when there's something to do. */
|
|
56
|
+
export declare function toastDuration(item: Pick<NotificationItem, 'type' | 'action' | 'compact'>, duration?: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* A list of notifications (newest first), and the ones currently showing as
|
|
59
|
+
* toasts. Pass `items` to NotificationPane and `toasts` to Toaster, or call
|
|
60
|
+
* `useNotifications()` for one shared list for the whole app.
|
|
61
|
+
*/
|
|
62
|
+
export declare function createNotifications(initial?: NotificationInput[]): {
|
|
63
|
+
readonly items: {
|
|
64
|
+
id: string;
|
|
65
|
+
type: NotificationType;
|
|
66
|
+
createdAt: Date;
|
|
67
|
+
read: boolean;
|
|
68
|
+
title: string;
|
|
69
|
+
description?: string | (() => VNodeChild) | undefined;
|
|
70
|
+
action?: {
|
|
71
|
+
label: string;
|
|
72
|
+
onSelect?: (() => void) | undefined;
|
|
73
|
+
href?: string | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
compact?: boolean
|
|
76
|
+
/** When it happened. Default now. */
|
|
77
|
+
| undefined;
|
|
78
|
+
}[];
|
|
79
|
+
/** Toasts showing, oldest first (the order they stack in). */
|
|
80
|
+
readonly toasts: {
|
|
81
|
+
id: string;
|
|
82
|
+
duration: number;
|
|
83
|
+
item: {
|
|
84
|
+
id: string;
|
|
85
|
+
type: NotificationType;
|
|
86
|
+
createdAt: Date;
|
|
87
|
+
read: boolean;
|
|
88
|
+
title: string;
|
|
89
|
+
description?: string | (() => VNodeChild) | undefined;
|
|
90
|
+
action?: {
|
|
91
|
+
label: string;
|
|
92
|
+
onSelect?: (() => void) | undefined;
|
|
93
|
+
href?: string | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
compact?: boolean
|
|
96
|
+
/** When it happened. Default now. */
|
|
97
|
+
| undefined;
|
|
98
|
+
};
|
|
99
|
+
}[];
|
|
100
|
+
/** Goes up each time `openPane()` is called; NotificationPane opens when it changes. */
|
|
101
|
+
readonly paneRequests: number;
|
|
102
|
+
readonly paneOpen: boolean;
|
|
103
|
+
unreadCount: import('vue').ComputedRef<number>;
|
|
104
|
+
openPane: () => void;
|
|
105
|
+
setPaneOpen: (open: boolean) => void;
|
|
106
|
+
notify: (input: NotificationInput, options?: ToastOptions) => string;
|
|
107
|
+
dismiss: (id: string) => void;
|
|
108
|
+
hideToast: (id: string) => void;
|
|
109
|
+
clear: () => void;
|
|
110
|
+
markAllRead: () => void;
|
|
111
|
+
};
|
|
112
|
+
export type Notifications = ReturnType<typeof createNotifications>;
|
|
113
|
+
/** One shared notification list for the whole app. */
|
|
114
|
+
export declare function useNotifications(): Notifications;
|
|
115
|
+
export { relativeTime } from '../../lib/dates';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component, HTMLAttributes } from 'vue';
|
|
2
|
+
import { BreadcrumbItem } from '../Breadcrumb/Breadcrumb.vue';
|
|
3
|
+
/**
|
|
4
|
+
* The top of a page: where it is (breadcrumb), what it is (the h1 title, with
|
|
5
|
+
* an optional status badge and description), and its main actions on the
|
|
6
|
+
* right. Actions wrap under the title on narrow screens.
|
|
7
|
+
*
|
|
8
|
+
* Slots: badge (after the title, e.g. a Badge), description (instead of the
|
|
9
|
+
* prop, for links or formatting), actions (e.g. Buttons), default (anything
|
|
10
|
+
* under, e.g. an alert or tabs).
|
|
11
|
+
*/
|
|
12
|
+
export interface PageHeaderProps {
|
|
13
|
+
/** The page's name: its h1. */
|
|
14
|
+
title: string;
|
|
15
|
+
/** A sentence under the title. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Where the page is. Pass `sidebarTrail(items)` to follow a nested Sidebar. */
|
|
18
|
+
breadcrumb?: BreadcrumbItem[];
|
|
19
|
+
/** Component used for breadcrumb steps with `to`, e.g. RouterLink. */
|
|
20
|
+
linkComponent?: string | Component;
|
|
21
|
+
class?: HTMLAttributes['class'];
|
|
22
|
+
/** Extra classes for the parts. */
|
|
23
|
+
ui?: {
|
|
24
|
+
title?: HTMLAttributes['class'];
|
|
25
|
+
description?: HTMLAttributes['class'];
|
|
26
|
+
actions?: HTMLAttributes['class'];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
type __VLS_Slots = {
|
|
30
|
+
badge?(): unknown;
|
|
31
|
+
description?(): unknown;
|
|
32
|
+
actions?(): unknown;
|
|
33
|
+
default?(): unknown;
|
|
34
|
+
};
|
|
35
|
+
declare const __VLS_base: import('vue').DefineComponent<PageHeaderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PageHeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { PopoverArrowProps, PopoverContentProps } from 'reka-ui';
|
|
3
|
+
/**
|
|
4
|
+
* A floating panel attached to a trigger. Built on Reka UI's Popover, which
|
|
5
|
+
* handles positioning, focus, Escape and clicking outside.
|
|
6
|
+
*
|
|
7
|
+
* - mode "click" (default): opens and closes on click / tap / Enter. Focus
|
|
8
|
+
* moves into the panel, so it suits interactive content (menus, forms).
|
|
9
|
+
* - mode "hover": opens on mouse hover, and also on click / tap, which keeps
|
|
10
|
+
* it open (so it works on touch screens). Focus stays where it is, so it
|
|
11
|
+
* suits information, e.g. a field's help text.
|
|
12
|
+
*
|
|
13
|
+
* Slots: default (the trigger, e.g. a Button), content ({ close }), anchor
|
|
14
|
+
* (position against something other than the trigger).
|
|
15
|
+
*/
|
|
16
|
+
export interface PopoverProps {
|
|
17
|
+
/** How it opens. */
|
|
18
|
+
mode?: 'click' | 'hover';
|
|
19
|
+
/**
|
|
20
|
+
* Where the panel goes and how it behaves, passed to Reka's PopoverContent,
|
|
21
|
+
* e.g. `{ side: 'top', align: 'start' }`. Default
|
|
22
|
+
* `{ side: 'bottom', sideOffset: 8, collisionPadding: 8 }`.
|
|
23
|
+
*/
|
|
24
|
+
content?: Omit<PopoverContentProps, 'as' | 'asChild' | 'forceMount'>;
|
|
25
|
+
/** Show an arrow pointing at the trigger (or Reka arrow options). */
|
|
26
|
+
arrow?: boolean | Omit<PopoverArrowProps, 'as' | 'asChild'>;
|
|
27
|
+
/**
|
|
28
|
+
* Render the panel at the end of the page (true), inside a given element
|
|
29
|
+
* (a selector or element), or in place (false).
|
|
30
|
+
*/
|
|
31
|
+
portal?: boolean | string | HTMLElement;
|
|
32
|
+
/** Close on Escape and on clicking outside. If false, emits close:prevent instead. */
|
|
33
|
+
dismissible?: boolean;
|
|
34
|
+
/** Block interaction with the rest of the page while open. */
|
|
35
|
+
modal?: boolean;
|
|
36
|
+
/** Open when first shown. */
|
|
37
|
+
defaultOpen?: boolean;
|
|
38
|
+
/** Hover mode: wait this long before opening, in ms. */
|
|
39
|
+
openDelay?: number;
|
|
40
|
+
/** Hover mode: wait this long before closing, in ms (at least 100, so the pointer can reach the panel). */
|
|
41
|
+
closeDelay?: number;
|
|
42
|
+
/** Extra classes for the panel and the arrow. */
|
|
43
|
+
ui?: {
|
|
44
|
+
content?: HTMLAttributes['class'];
|
|
45
|
+
arrow?: HTMLAttributes['class'];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
type __VLS_Props = PopoverProps;
|
|
49
|
+
type __VLS_Slots = {
|
|
50
|
+
default?(): unknown;
|
|
51
|
+
content?(props: {
|
|
52
|
+
close: () => void;
|
|
53
|
+
}): unknown;
|
|
54
|
+
anchor?(): unknown;
|
|
55
|
+
};
|
|
56
|
+
type __VLS_ModelProps = {
|
|
57
|
+
/** Whether the panel is open. Optional: use v-model:open to control it. */
|
|
58
|
+
'open'?: boolean | undefined;
|
|
59
|
+
};
|
|
60
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
61
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
62
|
+
"close:prevent": () => any;
|
|
63
|
+
"update:open": (value: boolean | undefined) => any;
|
|
64
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
65
|
+
"onClose:prevent"?: (() => any) | undefined;
|
|
66
|
+
"onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
|
|
67
|
+
}>, {
|
|
68
|
+
mode: "click" | "hover";
|
|
69
|
+
arrow: boolean | Omit<PopoverArrowProps, "asChild" | "as">;
|
|
70
|
+
portal: string | boolean | HTMLElement;
|
|
71
|
+
dismissible: boolean;
|
|
72
|
+
modal: boolean;
|
|
73
|
+
openDelay: number;
|
|
74
|
+
closeDelay: number;
|
|
75
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
76
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
77
|
+
declare const _default: typeof __VLS_export;
|
|
78
|
+
export default _default;
|
|
79
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
80
|
+
new (): {
|
|
81
|
+
$slots: S;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared look of floating panels: Popover, and anything else built on
|
|
3
|
+
* Reka's popper (e.g. InputDate's calendar), so they all match.
|
|
4
|
+
*
|
|
5
|
+
* White panel with the same border and radius as a basic Button, a shadow,
|
|
6
|
+
* and the theme's fade in / out (Reka waits for the fade-out to finish
|
|
7
|
+
* before removing the panel).
|
|
8
|
+
*/
|
|
9
|
+
export declare const popoverContent: string[];
|
|
10
|
+
/**
|
|
11
|
+
* The arrow pointing at the trigger: a white square turned 45° with the
|
|
12
|
+
* panel's border on its two outer edges, half overlapping the panel so it
|
|
13
|
+
* covers the panel's border where they meet. Reka rotates the arrow's wrapper
|
|
14
|
+
* for each side, so this only needs drawing pointing down.
|
|
15
|
+
*/
|
|
16
|
+
export declare const popoverArrow = "block size-2.5 -translate-y-1/2 rotate-45 border-r border-b border-black/15 bg-white";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* How far along something is, as a thin bar. Three forms:
|
|
4
|
+
* - a line that fills up, e.g. an upload (`value` out of `max`);
|
|
5
|
+
* - segments, one per step, e.g. a multi-step form (`segments`, with `value`
|
|
6
|
+
* steps filled out of `max`);
|
|
7
|
+
* - indeterminate, when there's no telling how long it'll take (no `value`).
|
|
8
|
+
* Built on Reka UI's Progress, so it's announced as a progress bar.
|
|
9
|
+
*/
|
|
10
|
+
export interface ProgressProps {
|
|
11
|
+
/** Done so far, out of `max`. Leave it out (or null) for indeterminate. */
|
|
12
|
+
value?: number | null;
|
|
13
|
+
/** The total. With `segments`, the number of segments. */
|
|
14
|
+
max?: number;
|
|
15
|
+
/** Split the bar into `max` segments and fill `value` of them. */
|
|
16
|
+
segments?: boolean;
|
|
17
|
+
/** What's progressing, e.g. "Uploading report.pdf". Its accessible name; not shown. */
|
|
18
|
+
label: string;
|
|
19
|
+
class?: HTMLAttributes['class'];
|
|
20
|
+
}
|
|
21
|
+
declare const __VLS_export: import('vue').DefineComponent<ProgressProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ProgressProps> & Readonly<{}>, {
|
|
22
|
+
value: number | null;
|
|
23
|
+
max: number;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* One choice from a few (two to five) that people should see side by side,
|
|
4
|
+
* e.g. "Mark as leavers" or "Keep on roll". For more options, or when the
|
|
5
|
+
* choice is less important than the space it takes, use Select.
|
|
6
|
+
*/
|
|
7
|
+
export type RadioValue = string | number;
|
|
8
|
+
export interface RadioOption {
|
|
9
|
+
label: string;
|
|
10
|
+
value: RadioValue;
|
|
11
|
+
/** More detail, in smaller text under the label. */
|
|
12
|
+
description?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface RadioGroupProps {
|
|
16
|
+
/** The question, above the options. Also the group's accessible name. */
|
|
17
|
+
label: string;
|
|
18
|
+
options: RadioOption[];
|
|
19
|
+
/** Extra guidance about the choice. */
|
|
20
|
+
helper?: string;
|
|
21
|
+
/** Show helper text under the label, or behind a `?` icon next to it. */
|
|
22
|
+
helperPlacement?: 'below' | 'icon';
|
|
23
|
+
/** Error message, e.g. "Choose what happens to Year 13". */
|
|
24
|
+
errorText?: string;
|
|
25
|
+
/** Name for native form submission. */
|
|
26
|
+
name?: string;
|
|
27
|
+
required?: boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
class?: HTMLAttributes['class'];
|
|
30
|
+
}
|
|
31
|
+
type __VLS_Props = RadioGroupProps;
|
|
32
|
+
type __VLS_ModelProps = {
|
|
33
|
+
/** The chosen option's value; undefined until one is chosen. */
|
|
34
|
+
modelValue?: RadioValue | undefined;
|
|
35
|
+
};
|
|
36
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
37
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
38
|
+
"update:modelValue": (value: RadioValue | undefined) => any;
|
|
39
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
40
|
+
"onUpdate:modelValue"?: ((value: RadioValue | undefined) => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
helperPlacement: "below" | "icon";
|
|
43
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const _default: typeof __VLS_export;
|
|
45
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { DateInput } from '../../lib/dates';
|
|
3
|
+
/**
|
|
4
|
+
* A time as people say it, "3 hours ago", with the exact date and time
|
|
5
|
+
* ("Wednesday 11 November 2026 at 09:52") in a tooltip on hover or focus.
|
|
6
|
+
* Keeps itself up to date (every 30 seconds).
|
|
7
|
+
*
|
|
8
|
+
* Use it wherever an app shows a relative date: notifications, "last
|
|
9
|
+
* edited", activity, comments.
|
|
10
|
+
*/
|
|
11
|
+
export interface RelativeTimeProps {
|
|
12
|
+
/** A Date, an ISO string, or a timestamp. */
|
|
13
|
+
date: DateInput;
|
|
14
|
+
/** What "now" is, e.g. for tests or a fixed screenshot. Default the live time. */
|
|
15
|
+
now?: Date;
|
|
16
|
+
/** Tooltip text. Default the full date and time; e.g. "Edited on {date}". */
|
|
17
|
+
tooltip?: (date: Date) => string;
|
|
18
|
+
class?: HTMLAttributes['class'];
|
|
19
|
+
}
|
|
20
|
+
declare const __VLS_export: import('vue').DefineComponent<RelativeTimeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<RelativeTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Component, HTMLAttributes } from 'vue';
|
|
2
|
+
import { FormFieldStatus } from '../FormField/FormField.vue';
|
|
3
|
+
export type SelectValueType = string | number;
|
|
4
|
+
export interface SelectOption {
|
|
5
|
+
/** Required. Shown in the list and, once chosen, in the field. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** What v-model is set to when chosen. Defaults to the label. Not used on options with children. */
|
|
8
|
+
value?: SelectValueType;
|
|
9
|
+
/** Smaller grey text under the label, in the list only. Searchable lists match it too. */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** A Lucide (or any) icon component, shown before the label (and in the field once chosen). */
|
|
12
|
+
icon?: Component;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Nested options. Choosing this option opens them (with a back row to
|
|
16
|
+
* return) instead of choosing it, e.g. Classes › Year 8 › 11Y/En2 › Ben.
|
|
17
|
+
*/
|
|
18
|
+
children?: (SelectOption | string)[];
|
|
19
|
+
}
|
|
20
|
+
export interface SelectGroupOptions {
|
|
21
|
+
/** Heading above the group's options. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** A Lucide (or any) icon component, shown before the heading. */
|
|
24
|
+
icon?: Component;
|
|
25
|
+
options: (SelectOption | string)[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Choose one option from a list that opens below the field, e.g. a year
|
|
29
|
+
* group or a school. Looks like Input (same label, helper, status message and
|
|
30
|
+
* box).
|
|
31
|
+
*
|
|
32
|
+
* - Default: built on Reka UI's Select. The field is a button; arrow keys,
|
|
33
|
+
* Home / End and typing the start of an option move through the list, Enter
|
|
34
|
+
* / Space choose, Escape closes.
|
|
35
|
+
* - `searchable`: built on Reka UI's Combobox. The field is a text box;
|
|
36
|
+
* typing filters the options (anywhere in the label, ignoring case and
|
|
37
|
+
* accents), arrow keys move, Enter chooses. When it loses focus it shows
|
|
38
|
+
* the chosen option again.
|
|
39
|
+
*
|
|
40
|
+
* Options can be plain strings (label and value the same) or objects with a
|
|
41
|
+
* label and, optionally, a description and an icon; they can be grouped under
|
|
42
|
+
* headings, and nested (`children`): choosing an option with children opens
|
|
43
|
+
* them, with a back row at the top. → / ← also go in and back. Searchable
|
|
44
|
+
* lists search every level and show where each match is.
|
|
45
|
+
*
|
|
46
|
+
* Slots: leading (before the value, replacing the chosen option's icon).
|
|
47
|
+
*/
|
|
48
|
+
export interface SelectProps {
|
|
49
|
+
/** Visible label. Always set it: it is also the field's accessible name. */
|
|
50
|
+
label: string;
|
|
51
|
+
/** Options in a single list. Use `groups` for headings. */
|
|
52
|
+
options?: (SelectOption | string)[];
|
|
53
|
+
/** Groups of options, each with an optional heading. Shown after `options`. */
|
|
54
|
+
groups?: SelectGroupOptions[];
|
|
55
|
+
/** Type in the field to filter the options. Use for lists of more than about 10. */
|
|
56
|
+
searchable?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Choose any number of options. v-model is then an array, the list stays
|
|
59
|
+
* open while ticking, and the chosen options show as chips in the field
|
|
60
|
+
* (with × to remove them when searchable).
|
|
61
|
+
*/
|
|
62
|
+
multiple?: boolean;
|
|
63
|
+
/** Shown in the field when nothing is chosen. Default "Choose…", or "Search…" when searchable. */
|
|
64
|
+
placeholder?: string;
|
|
65
|
+
/** Shown in the list when a search matches nothing. */
|
|
66
|
+
emptyText?: string;
|
|
67
|
+
/** Extra guidance about what to choose. */
|
|
68
|
+
helper?: string;
|
|
69
|
+
/** Show helper text under the label, or behind a `?` icon next to it. */
|
|
70
|
+
helperPlacement?: 'below' | 'icon';
|
|
71
|
+
/** Error message, e.g. from a Zod schema. Overrides `status` / `statusText`. */
|
|
72
|
+
errorText?: string;
|
|
73
|
+
/** Colours the field and the status text. */
|
|
74
|
+
status?: FormFieldStatus;
|
|
75
|
+
/** Message under the field. */
|
|
76
|
+
statusText?: string;
|
|
77
|
+
/** Form field name: adds a hidden native field so the value is submitted with a form. */
|
|
78
|
+
name?: string;
|
|
79
|
+
/** Must be chosen before a form can be submitted. */
|
|
80
|
+
required?: boolean;
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
class?: HTMLAttributes['class'];
|
|
83
|
+
}
|
|
84
|
+
type __VLS_Props = SelectProps;
|
|
85
|
+
type __VLS_Slots = {
|
|
86
|
+
leading?(): unknown;
|
|
87
|
+
};
|
|
88
|
+
type __VLS_ModelProps = {
|
|
89
|
+
/** The chosen option's value, or undefined when nothing is chosen. */
|
|
90
|
+
modelValue?: SelectValueType | SelectValueType[] | undefined;
|
|
91
|
+
};
|
|
92
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
93
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
94
|
+
"update:modelValue": (value: SelectValueType | SelectValueType[] | undefined) => any;
|
|
95
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
96
|
+
"onUpdate:modelValue"?: ((value: SelectValueType | SelectValueType[] | undefined) => any) | undefined;
|
|
97
|
+
}>, {
|
|
98
|
+
helperPlacement: "below" | "icon";
|
|
99
|
+
options: (string | SelectOption)[];
|
|
100
|
+
groups: SelectGroupOptions[];
|
|
101
|
+
emptyText: string;
|
|
102
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
103
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
104
|
+
declare const _default: typeof __VLS_export;
|
|
105
|
+
export default _default;
|
|
106
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
107
|
+
new (): {
|
|
108
|
+
$slots: S;
|
|
109
|
+
};
|
|
110
|
+
};
|