@thekestongroup/ui 0.7.0 → 0.9.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/components/Breadcrumb/Breadcrumb.vue.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +45 -0
- package/dist/components/Chip/Chip.vue.d.ts +0 -1
- package/dist/components/Header/Header.vue.d.ts +0 -1
- package/dist/components/InputDate/InputDate.vue.d.ts +1 -1
- package/dist/components/InputTextArea/InputTextArea.vue.d.ts +49 -0
- package/dist/components/LanguageSwitcher/LanguageSwitcher.vue.d.ts +24 -0
- package/dist/components/Notification/NotificationPane.vue.d.ts +1 -4
- package/dist/components/Select/Select.vue.d.ts +0 -1
- package/dist/components/SettingsRow/SettingsRow.vue.d.ts +28 -0
- package/dist/components/Sidebar/Sidebar.vue.d.ts +0 -1
- package/dist/components/Slideover/Slideover.vue.d.ts +0 -1
- package/dist/components/Spinner/Spinner.vue.d.ts +0 -1
- package/dist/components/Steps/Steps.vue.d.ts +20 -0
- package/dist/components/Switch/Switch.vue.d.ts +2 -0
- package/dist/components/Table/Table.vue.d.ts +21 -1
- package/dist/i18n/en.d.ts +146 -0
- package/dist/i18n/index.d.ts +32 -0
- package/dist/index.d.ts +12 -0
- package/dist/keston-ui.js +2189 -1691
- package/package.json +4 -2
- package/src/components/Age/Age.vue +4 -2
- package/src/components/AppShell/AppShell.vue +4 -2
- package/src/components/AvatarGroup/AvatarGroup.vue +4 -2
- package/src/components/Breadcrumb/Breadcrumb.vue +3 -2
- package/src/components/Calendar/Calendar.vue +8 -6
- package/src/components/Card/Card.vue +3 -1
- package/src/components/Checkbox/Checkbox.stories.ts +3 -0
- package/src/components/Checkbox/Checkbox.vue +3 -1
- package/src/components/CheckboxGroup/CheckboxGroup.stories.ts +48 -0
- package/src/components/CheckboxGroup/CheckboxGroup.vue +96 -0
- package/src/components/Chip/Chip.vue +3 -2
- package/src/components/FormField/FormField.vue +3 -1
- package/src/components/Header/Header.vue +6 -5
- package/src/components/Input/Input.vue +4 -2
- package/src/components/InputCode/InputCode.vue +4 -2
- package/src/components/InputDate/InputDate.vue +4 -2
- package/src/components/InputPassword/InputPassword.vue +4 -2
- package/src/components/InputRichText/InputRichText.vue +6 -4
- package/src/components/InputTextArea/InputTextArea.stories.ts +53 -0
- package/src/components/InputTextArea/InputTextArea.vue +89 -0
- package/src/components/LanguageSwitcher/LanguageSwitcher.stories.ts +21 -0
- package/src/components/LanguageSwitcher/LanguageSwitcher.vue +57 -0
- package/src/components/Link/Link.vue +1 -0
- package/src/components/Notification/Notification.vue +3 -1
- package/src/components/Notification/NotificationPane.vue +10 -8
- package/src/components/Notification/Toaster.vue +9 -7
- package/src/components/PageHeader/PageHeader.vue +13 -2
- package/src/components/Progress/Progress.vue +3 -1
- package/src/components/RadioGroup/RadioGroup.vue +3 -1
- package/src/components/Select/Select.vue +6 -5
- package/src/components/SettingsRow/SettingsRow.stories.ts +59 -0
- package/src/components/SettingsRow/SettingsRow.vue +39 -0
- package/src/components/Sidebar/Sidebar.vue +5 -4
- package/src/components/Slideover/Slideover.vue +8 -7
- package/src/components/Spinner/Spinner.vue +4 -3
- package/src/components/StatTile/StatTile.vue +3 -1
- package/src/components/Steps/Steps.stories.ts +38 -0
- package/src/components/Steps/Steps.vue +38 -0
- package/src/components/SummaryList/SummaryList.vue +5 -4
- package/src/components/Switch/Switch.vue +3 -1
- package/src/components/Table/Table.stories.ts +34 -0
- package/src/components/Table/Table.vue +98 -8
- package/src/i18n/en.ts +127 -0
- package/src/i18n/i18n.test.ts +56 -0
- package/src/i18n/index.ts +89 -0
- package/src/index.ts +14 -0
|
@@ -32,7 +32,6 @@ declare const __VLS_export: import('vue').DefineComponent<BreadcrumbProps, {}, {
|
|
|
32
32
|
}, string, import('vue').PublicProps, Readonly<BreadcrumbProps> & Readonly<{
|
|
33
33
|
onSelect?: ((item: BreadcrumbItem, event: MouseEvent) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
|
-
label: string;
|
|
36
35
|
linkComponent: string | Component;
|
|
37
36
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
38
37
|
declare const _default: typeof __VLS_export;
|
|
@@ -20,6 +20,8 @@ export interface CheckboxProps {
|
|
|
20
20
|
value?: string;
|
|
21
21
|
required?: boolean;
|
|
22
22
|
disabled?: boolean;
|
|
23
|
+
/** Keep the label (and description) for screen readers only, e.g. a row's box in a table. */
|
|
24
|
+
hideLabel?: boolean;
|
|
23
25
|
class?: HTMLAttributes['class'];
|
|
24
26
|
}
|
|
25
27
|
type __VLS_Props = CheckboxProps;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Several yes / no answers under one question, where any number can be
|
|
4
|
+
* ticked, e.g. "Which licences should they have?" or "Send it to". For one
|
|
5
|
+
* choice from a few, use RadioGroup; for a list of more than about eight,
|
|
6
|
+
* use Select with `multiple`.
|
|
7
|
+
*/
|
|
8
|
+
export type CheckboxGroupValue = string | number;
|
|
9
|
+
export interface CheckboxOption {
|
|
10
|
+
label: string;
|
|
11
|
+
value: CheckboxGroupValue;
|
|
12
|
+
/** More detail, in smaller text under the label. */
|
|
13
|
+
description?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface CheckboxGroupProps {
|
|
17
|
+
/** The question, above the options. Also the group's accessible name. */
|
|
18
|
+
label: string;
|
|
19
|
+
options: CheckboxOption[];
|
|
20
|
+
/** Extra guidance about the choice. */
|
|
21
|
+
helper?: string;
|
|
22
|
+
/** Show helper text under the label, or behind a `?` icon next to it. */
|
|
23
|
+
helperPlacement?: 'below' | 'icon';
|
|
24
|
+
/** Keep the label (and helper) for screen readers only. */
|
|
25
|
+
hideLabel?: boolean;
|
|
26
|
+
/** Error message, e.g. "Choose at least one". */
|
|
27
|
+
errorText?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
class?: HTMLAttributes['class'];
|
|
30
|
+
}
|
|
31
|
+
type __VLS_Props = CheckboxGroupProps;
|
|
32
|
+
type __VLS_ModelProps = {
|
|
33
|
+
/** The values of the ticked options. */
|
|
34
|
+
modelValue?: CheckboxGroupValue[];
|
|
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: CheckboxGroupValue[]) => any;
|
|
39
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
40
|
+
"onUpdate:modelValue"?: ((value: CheckboxGroupValue[]) => 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;
|
|
@@ -31,7 +31,6 @@ declare const __VLS_base: import('vue').DefineComponent<ChipProps, {}, {}, {}, {
|
|
|
31
31
|
onRemove?: (() => any) | undefined;
|
|
32
32
|
}>, {
|
|
33
33
|
size: "sm" | "md";
|
|
34
|
-
removeLabel: string;
|
|
35
34
|
removeFocusable: boolean;
|
|
36
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
36
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -98,7 +98,6 @@ declare const __VLS_base: import('vue').DefineComponent<HeaderProps, {}, {}, {},
|
|
|
98
98
|
sticky: boolean;
|
|
99
99
|
linkComponent: string | Component;
|
|
100
100
|
menuOpen: boolean;
|
|
101
|
-
menuLabel: string;
|
|
102
101
|
userActions: HeaderUserAction[];
|
|
103
102
|
signIn: boolean;
|
|
104
103
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -43,8 +43,8 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {},
|
|
|
43
43
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
44
44
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
45
45
|
}>, {
|
|
46
|
-
helperPlacement: "below" | "icon";
|
|
47
46
|
locale: string;
|
|
47
|
+
helperPlacement: "below" | "icon";
|
|
48
48
|
prefer: DatePreference;
|
|
49
49
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
50
50
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { FormFieldStatus } from '../FormField/FormField.vue';
|
|
3
|
+
/**
|
|
4
|
+
* Several lines of plain text, e.g. a reason, an address or a list with one
|
|
5
|
+
* item per line. It starts four lines tall and grows with the text up to 15
|
|
6
|
+
* lines, then scrolls. For notes that need bold, italic or underline, use
|
|
7
|
+
* InputRichText; for one line, Input.
|
|
8
|
+
*/
|
|
9
|
+
export interface InputTextAreaProps {
|
|
10
|
+
/** Visible label. Always set it: it is also the field's accessible name. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Extra guidance about what to enter. */
|
|
13
|
+
helper?: string;
|
|
14
|
+
/** Show helper text under the label, or behind a `?` icon next to it. */
|
|
15
|
+
helperPlacement?: 'below' | 'icon';
|
|
16
|
+
/** Keep the label for screen readers only, e.g. in a table of fields with column headings. */
|
|
17
|
+
hideLabel?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Error message, e.g. from a Zod schema. Overrides `status`, `statusText`
|
|
20
|
+
* and the length check.
|
|
21
|
+
*/
|
|
22
|
+
errorText?: string;
|
|
23
|
+
/** Colours the field and the status text. Overrides the length check. */
|
|
24
|
+
status?: FormFieldStatus;
|
|
25
|
+
/** Message under the field. */
|
|
26
|
+
statusText?: string;
|
|
27
|
+
/** Shown in the empty field, e.g. "One address per line". */
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/** Shows an error as soon as the text is too long. Typing is not blocked. */
|
|
30
|
+
maxLength?: number;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
class?: HTMLAttributes['class'];
|
|
33
|
+
}
|
|
34
|
+
type __VLS_Props = InputTextAreaProps;
|
|
35
|
+
type __VLS_ModelProps = {
|
|
36
|
+
modelValue?: string;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
39
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
40
|
+
focus: () => void | undefined;
|
|
41
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
42
|
+
"update:modelValue": (value: string) => any;
|
|
43
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
44
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
45
|
+
}>, {
|
|
46
|
+
helperPlacement: "below" | "icon";
|
|
47
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
48
|
+
declare const _default: typeof __VLS_export;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Chooses the language the app is shown in, e.g. in the account menu, the
|
|
4
|
+
* footer or Settings. It lists the languages the app's vue-i18n has, each
|
|
5
|
+
* in its own name ("Cymraeg", "Español"), and changes the app's language as
|
|
6
|
+
* soon as one is chosen. With `createKestonI18n` the choice is remembered
|
|
7
|
+
* for next time.
|
|
8
|
+
*/
|
|
9
|
+
export interface LanguageSwitcherProps {
|
|
10
|
+
/** Visible label. Default "Language". */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Keep the label for screen readers only, e.g. in a header or footer. */
|
|
13
|
+
hideLabel?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Names to show instead of the browser's own for a code, e.g.
|
|
16
|
+
* `{ 'en-GB': 'English (UK)' }`.
|
|
17
|
+
*/
|
|
18
|
+
names?: Record<string, string>;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
class?: HTMLAttributes['class'];
|
|
21
|
+
}
|
|
22
|
+
declare const __VLS_export: import('vue').DefineComponent<LanguageSwitcherProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<LanguageSwitcherProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -30,9 +30,6 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {},
|
|
|
30
30
|
"update:open": (value: boolean) => any;
|
|
31
31
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
32
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
33
|
-
}>, {
|
|
34
|
-
label: string;
|
|
35
|
-
emptyText: string;
|
|
36
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
34
|
declare const _default: typeof __VLS_export;
|
|
38
35
|
export default _default;
|
|
@@ -100,7 +100,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
100
100
|
helperPlacement: "below" | "icon";
|
|
101
101
|
options: (string | SelectOption)[];
|
|
102
102
|
groups: SelectGroupOptions[];
|
|
103
|
-
emptyText: string;
|
|
104
103
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
105
104
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
106
105
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* One setting on a settings page: what it is and what it does on the left,
|
|
4
|
+
* the control that changes it on the right (it stacks, label first, on narrow
|
|
5
|
+
* screens). Put a Select, InputNumber, Switch, Input… in the default slot and
|
|
6
|
+
* give it the same label with `hide-label`, so the label is only said once.
|
|
7
|
+
* Stack rows inside a Card, with a Divider between them if there are several.
|
|
8
|
+
*/
|
|
9
|
+
export interface SettingsRowProps {
|
|
10
|
+
/** What the setting is called, e.g. "Multi-factor authentication". */
|
|
11
|
+
label: string;
|
|
12
|
+
/** What it does, in smaller text under the label. */
|
|
13
|
+
description?: string;
|
|
14
|
+
class?: HTMLAttributes['class'];
|
|
15
|
+
}
|
|
16
|
+
type __VLS_Slots = {
|
|
17
|
+
/** The control. */
|
|
18
|
+
default(): unknown;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import('vue').DefineComponent<SettingsRowProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SettingsRowProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -90,7 +90,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
90
90
|
onSelect?: ((item: SidebarItem, event: MouseEvent) => any) | undefined;
|
|
91
91
|
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
92
92
|
}>, {
|
|
93
|
-
label: string;
|
|
94
93
|
linkComponent: string | Component;
|
|
95
94
|
items: SidebarItem[];
|
|
96
95
|
sections: SidebarSection[];
|
|
@@ -113,7 +113,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
113
113
|
close: boolean;
|
|
114
114
|
overlay: boolean;
|
|
115
115
|
initialFocus: "none" | "close" | "auto";
|
|
116
|
-
finishLabel: string;
|
|
117
116
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
118
117
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
119
118
|
declare const _default: typeof __VLS_export;
|
|
@@ -24,7 +24,6 @@ export interface SpinnerProps {
|
|
|
24
24
|
declare const __VLS_export: import('vue').DefineComponent<SpinnerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SpinnerProps> & Readonly<{}>, {
|
|
25
25
|
max: number;
|
|
26
26
|
size: "sm" | "md" | "lg";
|
|
27
|
-
label: string;
|
|
28
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
28
|
declare const _default: typeof __VLS_export;
|
|
30
29
|
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Where someone is in a set of steps: a segment for each step, filled up to
|
|
4
|
+
* the current one, and "Step 2 of 3: Licences" under it. Put it at the top of
|
|
5
|
+
* a multi-step form. (Slideover's `steps` shows one for you; use this when
|
|
6
|
+
* the steps are on a page, or in a Slideover you drive yourself.) The words
|
|
7
|
+
* are announced when the step changes.
|
|
8
|
+
*/
|
|
9
|
+
export interface StepsProps {
|
|
10
|
+
/** The name of each step, in order, e.g. `['User info', 'Licences']`. */
|
|
11
|
+
steps: string[];
|
|
12
|
+
/** The current step, counting from 0. */
|
|
13
|
+
step: number;
|
|
14
|
+
/** What the steps are for, e.g. "Add a user". The progress bar's accessible name; not shown. */
|
|
15
|
+
label: string;
|
|
16
|
+
class?: HTMLAttributes['class'];
|
|
17
|
+
}
|
|
18
|
+
declare const __VLS_export: import('vue').DefineComponent<StepsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<StepsProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -22,6 +22,8 @@ export interface SwitchProps {
|
|
|
22
22
|
/** Name for native form submission. */
|
|
23
23
|
name?: string;
|
|
24
24
|
disabled?: boolean;
|
|
25
|
+
/** Keep the label (and description) for screen readers only, e.g. a switch in a SettingsRow. */
|
|
26
|
+
hideLabel?: boolean;
|
|
25
27
|
class?: HTMLAttributes['class'];
|
|
26
28
|
}
|
|
27
29
|
type __VLS_Props = SwitchProps;
|
|
@@ -38,6 +38,14 @@ export interface TableProps<Row = Record<string, any>> {
|
|
|
38
38
|
loading?: boolean;
|
|
39
39
|
/** md (default) 12px above and below each cell, sm 8px for dense tables. */
|
|
40
40
|
size?: 'sm' | 'md';
|
|
41
|
+
/**
|
|
42
|
+
* For a table that fills a `Card` with `padding="none"` and has a title
|
|
43
|
+
* above it (so the content lines up with the card's padding): the first and
|
|
44
|
+
* last columns have 24px at the table's outer edges (from sm), and there is
|
|
45
|
+
* the same space beneath the last row. The row lines still run edge to
|
|
46
|
+
* edge. Leave it off for a table that is the whole card.
|
|
47
|
+
*/
|
|
48
|
+
inset?: boolean;
|
|
41
49
|
/** Keep the header row in view while the table scrolls. Give the table a max height (`class="max-h-96"`). */
|
|
42
50
|
stickyHeader?: boolean;
|
|
43
51
|
/** Don't sort the rows: just update `sort`, e.g. to sort on the server. */
|
|
@@ -50,6 +58,15 @@ export interface TableProps<Row = Record<string, any>> {
|
|
|
50
58
|
rowLink?: (row: Row, index: number) => unknown;
|
|
51
59
|
/** Component for row links, e.g. RouterLink. It receives `to`. Default a plain `<a href>`. */
|
|
52
60
|
linkComponent?: string | Component;
|
|
61
|
+
/**
|
|
62
|
+
* A checkbox at the start of each row (and "select all" in the header), for
|
|
63
|
+
* acting on several rows. `true` for every row, or a function saying which
|
|
64
|
+
* rows can be ticked. The whole cell is the click target. Ticked rows'
|
|
65
|
+
* keys (`rowKey`) are in `v-model:selected`.
|
|
66
|
+
*/
|
|
67
|
+
selectable?: boolean | ((row: Row) => boolean);
|
|
68
|
+
/** Describes a row for its checkbox, e.g. its name: "Select Jo Bloggs". Default "Select row 2". */
|
|
69
|
+
rowLabel?: (row: Row, index: number) => string;
|
|
53
70
|
class?: HTMLAttributes['class'];
|
|
54
71
|
ui?: {
|
|
55
72
|
table?: HTMLAttributes['class'];
|
|
@@ -60,8 +77,11 @@ export interface TableProps<Row = Record<string, any>> {
|
|
|
60
77
|
declare const __VLS_export: <Row extends Record<string, any>>(__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<{
|
|
61
78
|
props: import('vue').PublicProps & __VLS_PrettifyLocal<(TableProps<Row> & {
|
|
62
79
|
sort?: TableSort | null;
|
|
80
|
+
/** Ticked rows' keys (see `selectable`). */
|
|
81
|
+
selected?: (string | number)[];
|
|
63
82
|
}) & {
|
|
64
83
|
"onUpdate:sort"?: ((value: TableSort | null) => any) | undefined;
|
|
84
|
+
"onUpdate:selected"?: ((value: (string | number)[]) => any) | undefined;
|
|
65
85
|
}> & (typeof globalThis extends {
|
|
66
86
|
__VLS_PROPS_FALLBACK: infer P;
|
|
67
87
|
} ? P : {});
|
|
@@ -82,7 +102,7 @@ declare const __VLS_export: <Row extends Record<string, any>>(__VLS_props: NonNu
|
|
|
82
102
|
column: TableColumn<Row>;
|
|
83
103
|
}) => unknown) | undefined;
|
|
84
104
|
};
|
|
85
|
-
emit: (event: "update:sort", value: TableSort | null) => void;
|
|
105
|
+
emit: ((event: "update:sort", value: TableSort | null) => void) & ((event: "update:selected", value: (string | number)[]) => void);
|
|
86
106
|
}>) => import('vue').VNode & {
|
|
87
107
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
88
108
|
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keston UI's own words in English: what its components say and announce
|
|
3
|
+
* (button names, screen reader text, empty and error messages). Apps add
|
|
4
|
+
* these to their vue-i18n messages (see `createKestonI18n`) and keep their
|
|
5
|
+
* own under other keys.
|
|
6
|
+
*
|
|
7
|
+
* To add a language, copy this object, translate the values and give it to
|
|
8
|
+
* `createKestonI18n` under its code, e.g. `{ en, cy }`. Keep the keys and
|
|
9
|
+
* the `{placeholders}` as they are.
|
|
10
|
+
*/
|
|
11
|
+
export declare const en: {
|
|
12
|
+
ui: {
|
|
13
|
+
age: {
|
|
14
|
+
born: string;
|
|
15
|
+
birthdayToday: string;
|
|
16
|
+
birthdayTomorrow: string;
|
|
17
|
+
birthdayInDays: string;
|
|
18
|
+
};
|
|
19
|
+
appShell: {
|
|
20
|
+
menu: string;
|
|
21
|
+
expandSidebar: string;
|
|
22
|
+
collapseSidebar: string;
|
|
23
|
+
};
|
|
24
|
+
avatar: {
|
|
25
|
+
account: string;
|
|
26
|
+
accountWithInitials: string;
|
|
27
|
+
};
|
|
28
|
+
avatarGroup: {
|
|
29
|
+
people: string;
|
|
30
|
+
more: string;
|
|
31
|
+
};
|
|
32
|
+
breadcrumb: {
|
|
33
|
+
label: string;
|
|
34
|
+
};
|
|
35
|
+
calendar: {
|
|
36
|
+
previousMonth: string;
|
|
37
|
+
nextMonth: string;
|
|
38
|
+
previousYear: string;
|
|
39
|
+
nextYear: string;
|
|
40
|
+
previousYears: string;
|
|
41
|
+
nextYears: string;
|
|
42
|
+
chooseMonth: string;
|
|
43
|
+
chooseYear: string;
|
|
44
|
+
};
|
|
45
|
+
chip: {
|
|
46
|
+
remove: string;
|
|
47
|
+
};
|
|
48
|
+
formField: {
|
|
49
|
+
about: string;
|
|
50
|
+
};
|
|
51
|
+
header: {
|
|
52
|
+
menu: string;
|
|
53
|
+
signIn: string;
|
|
54
|
+
account: string;
|
|
55
|
+
accountWithInitials: string;
|
|
56
|
+
};
|
|
57
|
+
input: {
|
|
58
|
+
maxLength: string;
|
|
59
|
+
minLength: string;
|
|
60
|
+
};
|
|
61
|
+
inputCode: {
|
|
62
|
+
character: string;
|
|
63
|
+
};
|
|
64
|
+
inputDate: {
|
|
65
|
+
openCalendar: string;
|
|
66
|
+
enterDate: string;
|
|
67
|
+
};
|
|
68
|
+
inputPassword: {
|
|
69
|
+
capsLock: string;
|
|
70
|
+
show: string;
|
|
71
|
+
};
|
|
72
|
+
inputRichText: {
|
|
73
|
+
formattingFor: string;
|
|
74
|
+
bold: string;
|
|
75
|
+
italic: string;
|
|
76
|
+
underline: string;
|
|
77
|
+
};
|
|
78
|
+
languageSwitcher: {
|
|
79
|
+
label: string;
|
|
80
|
+
};
|
|
81
|
+
notifications: {
|
|
82
|
+
title: string;
|
|
83
|
+
region: string;
|
|
84
|
+
hotkeyRegion: string;
|
|
85
|
+
notifications: string;
|
|
86
|
+
empty: string;
|
|
87
|
+
withUnread: string;
|
|
88
|
+
dismiss: string;
|
|
89
|
+
close: string;
|
|
90
|
+
clearAll: string;
|
|
91
|
+
more: string;
|
|
92
|
+
};
|
|
93
|
+
pageHeader: {
|
|
94
|
+
actions: string;
|
|
95
|
+
moreActions: string;
|
|
96
|
+
};
|
|
97
|
+
progress: {
|
|
98
|
+
stepOf: string;
|
|
99
|
+
};
|
|
100
|
+
select: {
|
|
101
|
+
choose: string;
|
|
102
|
+
search: string;
|
|
103
|
+
noMatches: string;
|
|
104
|
+
showOptions: string;
|
|
105
|
+
remove: string;
|
|
106
|
+
};
|
|
107
|
+
sidebar: {
|
|
108
|
+
main: string;
|
|
109
|
+
backFrom: string;
|
|
110
|
+
expand: string;
|
|
111
|
+
collapse: string;
|
|
112
|
+
};
|
|
113
|
+
slideover: {
|
|
114
|
+
close: string;
|
|
115
|
+
cancel: string;
|
|
116
|
+
previous: string;
|
|
117
|
+
next: string;
|
|
118
|
+
finish: string;
|
|
119
|
+
steps: string;
|
|
120
|
+
stepOf: string;
|
|
121
|
+
};
|
|
122
|
+
spinner: {
|
|
123
|
+
loading: string;
|
|
124
|
+
};
|
|
125
|
+
statTile: {
|
|
126
|
+
up: string;
|
|
127
|
+
down: string;
|
|
128
|
+
flat: string;
|
|
129
|
+
};
|
|
130
|
+
steps: {
|
|
131
|
+
stepOf: string;
|
|
132
|
+
stepOfNamed: string;
|
|
133
|
+
};
|
|
134
|
+
summaryList: {
|
|
135
|
+
notSet: string;
|
|
136
|
+
};
|
|
137
|
+
table: {
|
|
138
|
+
table: string;
|
|
139
|
+
empty: string;
|
|
140
|
+
selectAll: string;
|
|
141
|
+
selectRow: string;
|
|
142
|
+
select: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export type UiMessages = typeof en;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { en } from './en';
|
|
2
|
+
export type { UiMessages } from './en';
|
|
3
|
+
/** Words by language code, then by key (nested objects are fine). */
|
|
4
|
+
export type Messages = Record<string, Record<string, any>>;
|
|
5
|
+
/** Keston UI's own words, by language. Today: English. */
|
|
6
|
+
export declare const uiMessages: Messages;
|
|
7
|
+
export interface KestonI18nOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The app's own words, by language code: `{ en: { users: { title: 'Users' } } }`.
|
|
10
|
+
* Keston UI's words are added to each language (the app's win if a key
|
|
11
|
+
* is repeated), so only languages that Keston UI also has — or that the
|
|
12
|
+
* app lists here — are available.
|
|
13
|
+
*/
|
|
14
|
+
messages?: Messages;
|
|
15
|
+
/** The language to start in. Default: the one saved last time, else the browser's, else `fallbackLocale`. */
|
|
16
|
+
locale?: string;
|
|
17
|
+
/** Used for any word a language is missing. Default `en`. */
|
|
18
|
+
fallbackLocale?: string;
|
|
19
|
+
/** Where the chosen language is remembered (localStorage). Default `keston-locale`. */
|
|
20
|
+
storageKey?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sets up vue-i18n the way every Keston app should: Keston UI's words plus
|
|
24
|
+
* the app's own, English as the fallback, the language remembered between
|
|
25
|
+
* visits, and `<html lang>` kept in step. Install it with `app.use(i18n)`.
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* const i18n = createKestonI18n({ messages: { en } })
|
|
29
|
+
* createApp(App).use(i18n).mount('#app')
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function createKestonI18n(options?: KestonI18nOptions): import('vue-i18n').I18n<Messages, {}, {}, string, false>;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { default as Header } from './components/Header/Header.vue';
|
|
|
5
5
|
export type { HeaderProps, HeaderUser, HeaderUserAction } from './components/Header/Header.vue';
|
|
6
6
|
export { default as PageHeader } from './components/PageHeader/PageHeader.vue';
|
|
7
7
|
export type { PageHeaderAction, PageHeaderProps } from './components/PageHeader/PageHeader.vue';
|
|
8
|
+
export { default as SettingsRow } from './components/SettingsRow/SettingsRow.vue';
|
|
9
|
+
export type { SettingsRowProps } from './components/SettingsRow/SettingsRow.vue';
|
|
8
10
|
export { default as Avatar } from './components/Avatar/Avatar.vue';
|
|
9
11
|
export type { AvatarProps, AvatarUser } from './components/Avatar/Avatar.vue';
|
|
10
12
|
export { default as AvatarGroup } from './components/AvatarGroup/AvatarGroup.vue';
|
|
@@ -47,6 +49,12 @@ export { default as Switch } from './components/Switch/Switch.vue';
|
|
|
47
49
|
export type { SwitchProps } from './components/Switch/Switch.vue';
|
|
48
50
|
export { default as Calendar } from './components/Calendar/Calendar.vue';
|
|
49
51
|
export type { CalendarProps } from './components/Calendar/Calendar.vue';
|
|
52
|
+
export { default as InputTextArea } from './components/InputTextArea/InputTextArea.vue';
|
|
53
|
+
export type { InputTextAreaProps } from './components/InputTextArea/InputTextArea.vue';
|
|
54
|
+
export { default as CheckboxGroup } from './components/CheckboxGroup/CheckboxGroup.vue';
|
|
55
|
+
export type { CheckboxGroupProps, CheckboxOption, CheckboxGroupValue } from './components/CheckboxGroup/CheckboxGroup.vue';
|
|
56
|
+
export { default as LanguageSwitcher } from './components/LanguageSwitcher/LanguageSwitcher.vue';
|
|
57
|
+
export type { LanguageSwitcherProps } from './components/LanguageSwitcher/LanguageSwitcher.vue';
|
|
50
58
|
export { default as Table } from './components/Table/Table.vue';
|
|
51
59
|
export type { TableProps } from './components/Table/Table.vue';
|
|
52
60
|
export type { TableColumn, TableSort, SortDirection } from './components/Table/table';
|
|
@@ -70,6 +78,8 @@ export type { SidebarProps, SidebarItem, SidebarSection } from './components/Sid
|
|
|
70
78
|
export { sidebarTrail } from './components/Sidebar/sidebar';
|
|
71
79
|
export { default as Link } from './components/Link/Link.vue';
|
|
72
80
|
export type { LinkProps } from './components/Link/Link.vue';
|
|
81
|
+
export { default as Steps } from './components/Steps/Steps.vue';
|
|
82
|
+
export type { StepsProps } from './components/Steps/Steps.vue';
|
|
73
83
|
export { default as Popover } from './components/Popover/Popover.vue';
|
|
74
84
|
export type { PopoverProps } from './components/Popover/Popover.vue';
|
|
75
85
|
export { default as Menu } from './components/Menu/Menu.vue';
|
|
@@ -90,6 +100,8 @@ export { default as Toaster } from './components/Notification/Toaster.vue';
|
|
|
90
100
|
export type { ToasterProps } from './components/Notification/Toaster.vue';
|
|
91
101
|
export { createNotifications, useNotifications, relativeTime } from './components/Notification/notifications';
|
|
92
102
|
export type { Notifications, NotificationItem, NotificationInput, NotificationAction, NotificationType, ToastOptions } from './components/Notification/notifications';
|
|
103
|
+
export { createKestonI18n, uiMessages, en } from './i18n';
|
|
104
|
+
export type { KestonI18nOptions, Messages, UiMessages } from './i18n';
|
|
93
105
|
export { age, daysToBirthday, formatDate, formatDateTime, toDate } from './lib/dates';
|
|
94
106
|
export type { DateInput } from './lib/dates';
|
|
95
107
|
export { useNow } from './lib/useNow';
|