@thekestongroup/ui 0.15.0 → 0.16.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/ActionList/ActionList.vue.d.ts +63 -0
- package/dist/components/Alert/Alert.vue.d.ts +55 -0
- package/dist/components/AvatarGroup/AvatarGroup.vue.d.ts +1 -1
- package/dist/components/BarChart/BarChart.vue.d.ts +37 -0
- package/dist/components/BarChart/ChartData.vue.d.ts +20 -0
- package/dist/components/Button/Button.vue.d.ts +1 -1
- package/dist/components/Collapsible/Collapsible.vue.d.ts +48 -0
- package/dist/components/FileUpload/FileUpload.vue.d.ts +55 -0
- package/dist/components/Footer/Footer.vue.d.ts +11 -1
- package/dist/components/Header/Header.vue.d.ts +1 -1
- package/dist/components/LineChart/LineChart.vue.d.ts +37 -0
- package/dist/components/Notification/Notification.vue.d.ts +2 -2
- package/dist/components/Progress/Progress.vue.d.ts +14 -1
- package/dist/components/Slideover/Slideover.vue.d.ts +7 -5
- package/dist/components/Spinner/Spinner.vue.d.ts +1 -1
- package/dist/components/ThemeSwitcher/ThemeSwitcher.vue.d.ts +18 -0
- package/dist/i18n/en.d.ts +27 -0
- package/dist/index.d.ts +17 -0
- package/dist/keston-ui.js +4106 -3247
- package/dist/lib/chart.d.ts +32 -0
- package/dist/lib/theme.d.ts +23 -0
- package/package.json +8 -3
- package/src/components/ActionList/ActionList.stories.ts +59 -0
- package/src/components/ActionList/ActionList.vue +116 -0
- package/src/components/Alert/Alert.stories.ts +65 -0
- package/src/components/Alert/Alert.vue +110 -0
- package/src/components/BarChart/BarChart.stories.ts +62 -0
- package/src/components/BarChart/BarChart.vue +153 -0
- package/src/components/BarChart/ChartData.vue +64 -0
- package/src/components/Calendar/Calendar.vue +3 -2
- package/src/components/CardSelect/CardSelect.vue +1 -1
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.vue +1 -1
- package/src/components/Collapsible/Collapsible.stories.ts +32 -0
- package/src/components/Collapsible/Collapsible.vue +68 -0
- package/src/components/FileUpload/FileUpload.stories.ts +38 -0
- package/src/components/FileUpload/FileUpload.vue +150 -0
- package/src/components/Footer/Footer.stories.ts +10 -2
- package/src/components/Footer/Footer.vue +22 -4
- package/src/components/Header/Header.stories.ts +20 -0
- package/src/components/LineChart/LineChart.stories.ts +47 -0
- package/src/components/LineChart/LineChart.vue +173 -0
- package/src/components/Progress/Progress.stories.ts +18 -0
- package/src/components/Progress/Progress.vue +57 -0
- package/src/components/RadioGroup/RadioGroup.vue +2 -2
- package/src/components/Select/Select.vue +6 -4
- package/src/components/Slideover/Slideover.vue +107 -31
- package/src/components/ThemeSwitcher/ThemeSwitcher.stories.ts +22 -0
- package/src/components/ThemeSwitcher/ThemeSwitcher.vue +48 -0
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/i18n/en.ts +16 -4
- package/src/index.ts +17 -0
- package/src/lib/chart.ts +47 -0
- package/src/lib/theme.ts +75 -0
- package/src/styles/theme.css +23 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Component, HTMLAttributes } from 'vue';
|
|
2
|
+
export interface ActionListItem {
|
|
3
|
+
/** Unique key. Default the label. */
|
|
4
|
+
key?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** A second line, e.g. an email address or a domain. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** An icon before the text (or use the leading slot, e.g. for an Avatar). */
|
|
9
|
+
icon?: Component;
|
|
10
|
+
/** Go somewhere through `linkComponent` (e.g. RouterLink), which receives `to`. */
|
|
11
|
+
to?: unknown;
|
|
12
|
+
/** Go to a URL. */
|
|
13
|
+
href?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** The one you're on now (aria-current). */
|
|
16
|
+
current?: boolean;
|
|
17
|
+
/** Show a spinner in place of the arrow, e.g. while switching to it. */
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A list of things to pick one of and go to: accounts to switch to,
|
|
22
|
+
* organisations, connected apps. Each row is a single button or link with an
|
|
23
|
+
* optional icon or avatar, a name and a line under it, and an arrow, in a
|
|
24
|
+
* bordered box with lines between rows.
|
|
25
|
+
*
|
|
26
|
+
* Rows without `to` / `href` are buttons that emit `select`.
|
|
27
|
+
*
|
|
28
|
+
* Slots, each given `{ item }`: leading (before the text, e.g. an Avatar),
|
|
29
|
+
* badges (after the name, e.g. "Current"), after (beside the row, outside
|
|
30
|
+
* the button, e.g. a Leave button).
|
|
31
|
+
*/
|
|
32
|
+
export interface ActionListProps {
|
|
33
|
+
items: ActionListItem[];
|
|
34
|
+
/** What the list is, for screen readers, e.g. "Signed-in accounts". */
|
|
35
|
+
label: string;
|
|
36
|
+
/** Component used for rows with `to`, e.g. RouterLink. */
|
|
37
|
+
linkComponent?: string | Component;
|
|
38
|
+
class?: HTMLAttributes['class'];
|
|
39
|
+
}
|
|
40
|
+
type __VLS_Slots = {
|
|
41
|
+
leading?(props: {
|
|
42
|
+
item: ActionListItem;
|
|
43
|
+
}): unknown;
|
|
44
|
+
badges?(props: {
|
|
45
|
+
item: ActionListItem;
|
|
46
|
+
}): unknown;
|
|
47
|
+
after?(props: {
|
|
48
|
+
item: ActionListItem;
|
|
49
|
+
}): unknown;
|
|
50
|
+
};
|
|
51
|
+
declare const __VLS_base: import('vue').DefineComponent<ActionListProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
52
|
+
select: (item: ActionListItem) => any;
|
|
53
|
+
}, string, import('vue').PublicProps, Readonly<ActionListProps> & Readonly<{
|
|
54
|
+
onSelect?: ((item: ActionListItem) => any) | undefined;
|
|
55
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
|
+
declare const _default: typeof __VLS_export;
|
|
58
|
+
export default _default;
|
|
59
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
60
|
+
new (): {
|
|
61
|
+
$slots: S;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component, HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* A message that stays on the page until it's dealt with: a problem to fix,
|
|
4
|
+
* a warning, something that went well, or information people need here.
|
|
5
|
+
* For something that has just happened, use a toast Notification instead.
|
|
6
|
+
*
|
|
7
|
+
* Two appearances:
|
|
8
|
+
* - card (default): a rounded box in the page's flow, e.g. above a form.
|
|
9
|
+
* - banner: full width, no corners, a line under it, e.g. under the Header
|
|
10
|
+
* for something that affects the whole app ("You're using a support
|
|
11
|
+
* account").
|
|
12
|
+
*
|
|
13
|
+
* Slots: default (the description, for links or bold text), actions (Buttons
|
|
14
|
+
* on the right; under the text on narrow screens), icon (replaces the icon).
|
|
15
|
+
*/
|
|
16
|
+
export interface AlertProps {
|
|
17
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
18
|
+
/** The message, in a few words. Bold. */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** More detail under the title. Or use the default slot. */
|
|
21
|
+
description?: string;
|
|
22
|
+
appearance?: 'card' | 'banner';
|
|
23
|
+
/** A different icon from the type's own. */
|
|
24
|
+
icon?: Component;
|
|
25
|
+
/** Show × to close it; emits `dismiss`. */
|
|
26
|
+
dismissible?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Announce it to screen readers when it appears (or changes). For alerts
|
|
29
|
+
* shown in response to something, e.g. a save that failed. Not for ones
|
|
30
|
+
* that are on the page from the start.
|
|
31
|
+
*/
|
|
32
|
+
live?: boolean;
|
|
33
|
+
class?: HTMLAttributes['class'];
|
|
34
|
+
}
|
|
35
|
+
type __VLS_Slots = {
|
|
36
|
+
default?(): unknown;
|
|
37
|
+
actions?(): unknown;
|
|
38
|
+
icon?(): unknown;
|
|
39
|
+
};
|
|
40
|
+
declare const __VLS_base: import('vue').DefineComponent<AlertProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
41
|
+
dismiss: () => any;
|
|
42
|
+
}, string, import('vue').PublicProps, Readonly<AlertProps> & Readonly<{
|
|
43
|
+
onDismiss?: (() => any) | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
type: "error" | "success" | "info" | "warning";
|
|
46
|
+
appearance: "card" | "banner";
|
|
47
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
48
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
52
|
+
new (): {
|
|
53
|
+
$slots: S;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -17,8 +17,8 @@ export interface AvatarGroupProps {
|
|
|
17
17
|
class?: HTMLAttributes['class'];
|
|
18
18
|
}
|
|
19
19
|
declare const __VLS_export: import('vue').DefineComponent<AvatarGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {
|
|
20
|
-
max: number;
|
|
21
20
|
size: "sm" | "md" | "lg" | "xs" | "xl";
|
|
21
|
+
max: number;
|
|
22
22
|
profile: boolean;
|
|
23
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { ChartPoint, ChartSeries } from '../../lib/chart';
|
|
3
|
+
/**
|
|
4
|
+
* Amounts compared across a few categories or days, as columns: sign-ins per
|
|
5
|
+
* day, applications per year group. One series, or several stacked (the
|
|
6
|
+
* parts of a whole, e.g. succeeded and failed) or side by side.
|
|
7
|
+
*
|
|
8
|
+
* Every chart carries its numbers as a table: always there for screen
|
|
9
|
+
* readers, and shown to anyone with "Show as table". Hovering a column shows
|
|
10
|
+
* its values. Put it in a Card whose title says what it shows.
|
|
11
|
+
*
|
|
12
|
+
* Colours come from the chart palette (chart-1 to chart-8), in order unless a
|
|
13
|
+
* series sets its own `color`.
|
|
14
|
+
*/
|
|
15
|
+
export interface BarChartProps {
|
|
16
|
+
/** What the chart shows, e.g. "Sign-ins this week". The table's caption; not shown (the Card's title says it). */
|
|
17
|
+
label: string;
|
|
18
|
+
/** One point per column, in order. */
|
|
19
|
+
data: ChartPoint[];
|
|
20
|
+
/** The numbers in each point. One series needs no legend; two or more get one. */
|
|
21
|
+
series: ChartSeries[];
|
|
22
|
+
/** With several series: stack them in one column (default), or put them side by side. */
|
|
23
|
+
stacked?: boolean;
|
|
24
|
+
/** Heading of the table's first column, e.g. "Date". Default "Category". */
|
|
25
|
+
categoryLabel?: string;
|
|
26
|
+
/** Height of the plot in px. */
|
|
27
|
+
height?: number;
|
|
28
|
+
/** How values are written on the axis, in tooltips and the table. Default: whole numbers in the app's language. */
|
|
29
|
+
format?: (value: number) => string;
|
|
30
|
+
class?: HTMLAttributes['class'];
|
|
31
|
+
}
|
|
32
|
+
declare const __VLS_export: import('vue').DefineComponent<BarChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BarChartProps> & Readonly<{}>, {
|
|
33
|
+
height: number;
|
|
34
|
+
stacked: boolean;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChartPoint, ChartSeries } from '../../lib/chart';
|
|
2
|
+
/**
|
|
3
|
+
* The parts every Keston chart shares, under the plot: the legend (for two
|
|
4
|
+
* or more series), a button to see the numbers as a table, and the table.
|
|
5
|
+
* The table is always there for screen readers; the button shows it to
|
|
6
|
+
* everyone (keyboard users can't hover for tooltips). Internal: used by
|
|
7
|
+
* BarChart and LineChart.
|
|
8
|
+
*/
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
/** The chart's name: the table's caption. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Heading of the table's first column, e.g. "Date". */
|
|
13
|
+
categoryLabel: string;
|
|
14
|
+
series: ChartSeries[];
|
|
15
|
+
data: ChartPoint[];
|
|
16
|
+
format: (value: number) => string;
|
|
17
|
+
};
|
|
18
|
+
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>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -53,7 +53,7 @@ declare const __VLS_base: import('vue').DefineComponent<ButtonProps, {}, {}, {},
|
|
|
53
53
|
"onUpdate:status"?: ((status: ButtonStatus) => any) | undefined;
|
|
54
54
|
}>, {
|
|
55
55
|
size: "sm" | "md" | "lg";
|
|
56
|
-
type: "
|
|
56
|
+
type: "reset" | "submit" | "button";
|
|
57
57
|
as: import('reka-ui').AsTag | import('vue').Component;
|
|
58
58
|
variant: "basic" | "primary" | "ghost" | "danger";
|
|
59
59
|
status: ButtonStatus;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* A section that opens and closes: "Advanced options", "Customise rules",
|
|
4
|
+
* "How does this work?". The title row is a button; the content shows under
|
|
5
|
+
* it. Closed by default; use `defaultOpen` or `v-model:open`.
|
|
6
|
+
*
|
|
7
|
+
* Built on Reka UI's Collapsible, so the button says whether it's open
|
|
8
|
+
* (aria-expanded) and points at what it opens (aria-controls).
|
|
9
|
+
*
|
|
10
|
+
* Slots: default (the content), title (replaces the title text).
|
|
11
|
+
*/
|
|
12
|
+
export interface CollapsibleProps {
|
|
13
|
+
/** The title row's text, e.g. "Advanced options". */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Start open (when not using v-model:open). */
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
/** A line between it and what's above, e.g. at the end of a Card's fields. */
|
|
18
|
+
divided?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
class?: HTMLAttributes['class'];
|
|
21
|
+
/** Extra classes for the parts. */
|
|
22
|
+
ui?: {
|
|
23
|
+
trigger?: HTMLAttributes['class'];
|
|
24
|
+
content?: HTMLAttributes['class'];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
type __VLS_Props = CollapsibleProps;
|
|
28
|
+
type __VLS_Slots = {
|
|
29
|
+
default?(): unknown;
|
|
30
|
+
title?(): unknown;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_ModelProps = {
|
|
33
|
+
'open'?: boolean | undefined;
|
|
34
|
+
};
|
|
35
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
36
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
37
|
+
"update:open": (value: boolean | undefined) => any;
|
|
38
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
39
|
+
"onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
|
|
40
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { ButtonProps } from '../Button/Button.vue';
|
|
3
|
+
/**
|
|
4
|
+
* Choosing files to upload: a Button that opens the device's file picker
|
|
5
|
+
* and, with `drop`, a dashed area around it that files can be dragged onto.
|
|
6
|
+
* Emits `select` with the chosen files (only ones `accept` allows; just the
|
|
7
|
+
* first unless `multiple`). It doesn't upload anything itself.
|
|
8
|
+
*
|
|
9
|
+
* The button is always there, so it works by keyboard, on touch screens and
|
|
10
|
+
* with screen readers; dropping is a shortcut for mouse users.
|
|
11
|
+
*
|
|
12
|
+
* Slots: default (in the drop area above the button, e.g. the chosen file's
|
|
13
|
+
* name; replaces the description), leading (the button's icon).
|
|
14
|
+
*/
|
|
15
|
+
export interface FileUploadProps {
|
|
16
|
+
/** The button's text. Default "Choose a file" (or "Choose files" with `multiple`). */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** File types to allow, as for `<input accept>`: ".csv,text/csv", "image/*". */
|
|
19
|
+
accept?: string;
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
/** Show a drop area around the button. */
|
|
22
|
+
drop?: boolean;
|
|
23
|
+
/** Text in the drop area. Default "Drop a file here, or choose one." */
|
|
24
|
+
description?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** The button's look; default basic. */
|
|
27
|
+
variant?: ButtonProps['variant'];
|
|
28
|
+
size?: ButtonProps['size'];
|
|
29
|
+
/** Button status, e.g. `loading` while the chosen file uploads. */
|
|
30
|
+
status?: ButtonProps['status'];
|
|
31
|
+
/** Text beside the spinner while `status` is loading, e.g. "Uploading…". */
|
|
32
|
+
loadingText?: string;
|
|
33
|
+
class?: HTMLAttributes['class'];
|
|
34
|
+
}
|
|
35
|
+
type __VLS_Slots = {
|
|
36
|
+
default?(): unknown;
|
|
37
|
+
leading?(): unknown;
|
|
38
|
+
};
|
|
39
|
+
declare const __VLS_base: import('vue').DefineComponent<FileUploadProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
40
|
+
select: (files: File[]) => any;
|
|
41
|
+
}, string, import('vue').PublicProps, Readonly<FileUploadProps> & Readonly<{
|
|
42
|
+
onSelect?: ((files: File[]) => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
size: "sm" | "md" | "lg";
|
|
45
|
+
variant: "basic" | "primary" | "ghost" | "danger";
|
|
46
|
+
status: import('../..').ButtonStatus;
|
|
47
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
48
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
52
|
+
new (): {
|
|
53
|
+
$slots: S;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -18,7 +18,11 @@ export interface FooterLink {
|
|
|
18
18
|
* apps), which follow, after a divider. The version comes from the app's package.json and the build
|
|
19
19
|
* from its CI: in Vite, put them in with `define` (see the spec).
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* On the right too: a Language dropdown (when the app has more than one
|
|
22
|
+
* language) and an Appearance dropdown (Light / Dark / Match device). Turn
|
|
23
|
+
* either off with `languageSwitcher` / `themeSwitcher`.
|
|
24
|
+
*
|
|
25
|
+
* Slots: nav (instead of the whole link list), end (after the copyright).
|
|
22
26
|
*/
|
|
23
27
|
export interface FooterProps {
|
|
24
28
|
/** The links on the left. Default: `kestonFooterLinks` (Help & support, Privacy Policy, Terms & Conditions). */
|
|
@@ -39,6 +43,10 @@ export interface FooterProps {
|
|
|
39
43
|
year?: number;
|
|
40
44
|
/** The first year, to show a range such as 2024–2026. */
|
|
41
45
|
since?: number;
|
|
46
|
+
/** Show the Language dropdown. Default true; it only shows when the app has more than one language. */
|
|
47
|
+
languageSwitcher?: boolean;
|
|
48
|
+
/** Show the Appearance dropdown (Light / Dark / Match device). Default true. */
|
|
49
|
+
themeSwitcher?: boolean;
|
|
42
50
|
class?: HTMLAttributes['class'];
|
|
43
51
|
/** Extra classes for the parts. */
|
|
44
52
|
ui?: {
|
|
@@ -55,6 +63,8 @@ declare const __VLS_base: import('vue').DefineComponent<FooterProps, {}, {}, {},
|
|
|
55
63
|
moreLinks: FooterLink[];
|
|
56
64
|
linkComponent: string | Component;
|
|
57
65
|
holder: string;
|
|
66
|
+
languageSwitcher: boolean;
|
|
67
|
+
themeSwitcher: boolean;
|
|
58
68
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
59
69
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
60
70
|
declare const _default: typeof __VLS_export;
|
|
@@ -100,8 +100,8 @@ declare const __VLS_base: import('vue').DefineComponent<HeaderProps, {}, {}, {},
|
|
|
100
100
|
"onLog-out"?: (() => any) | undefined;
|
|
101
101
|
"onSign-in"?: (() => any) | undefined;
|
|
102
102
|
}>, {
|
|
103
|
-
menu: boolean;
|
|
104
103
|
sticky: boolean;
|
|
104
|
+
menu: boolean;
|
|
105
105
|
linkComponent: string | Component;
|
|
106
106
|
menuOpen: boolean;
|
|
107
107
|
userActions: HeaderUserAction[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { ChartPoint, ChartSeries } from '../../lib/chart';
|
|
3
|
+
/**
|
|
4
|
+
* Change over time as lines: applications per week across a term,
|
|
5
|
+
* attendance by month. One series, or a few to compare (up to four reads
|
|
6
|
+
* well; past that, use separate charts).
|
|
7
|
+
*
|
|
8
|
+
* Every chart carries its numbers as a table: always there for screen
|
|
9
|
+
* readers, and shown to anyone with "Show as table". Hovering shows a line
|
|
10
|
+
* across the chart and every series' value at that point. Put it in a Card
|
|
11
|
+
* whose title says what it shows.
|
|
12
|
+
*
|
|
13
|
+
* Colours come from the chart palette (chart-1 to chart-8), in order unless a
|
|
14
|
+
* series sets its own `color`.
|
|
15
|
+
*/
|
|
16
|
+
export interface LineChartProps {
|
|
17
|
+
/** What the chart shows, e.g. "Applications per week". The table's caption; not shown (the Card's title says it). */
|
|
18
|
+
label: string;
|
|
19
|
+
/** One point per step along the bottom, in order (oldest first). */
|
|
20
|
+
data: ChartPoint[];
|
|
21
|
+
/** The lines. One series needs no legend; two or more get one. */
|
|
22
|
+
series: ChartSeries[];
|
|
23
|
+
/** A light wash under a single line, to show it as an amount. */
|
|
24
|
+
area?: boolean;
|
|
25
|
+
/** Heading of the table's first column, e.g. "Week". Default "Category". */
|
|
26
|
+
categoryLabel?: string;
|
|
27
|
+
/** Height of the plot in px. */
|
|
28
|
+
height?: number;
|
|
29
|
+
/** How values are written on the axis, in tooltips and the table. Default: whole numbers in the app's language. */
|
|
30
|
+
format?: (value: number) => string;
|
|
31
|
+
class?: HTMLAttributes['class'];
|
|
32
|
+
}
|
|
33
|
+
declare const __VLS_export: import('vue').DefineComponent<LineChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<LineChartProps> & Readonly<{}>, {
|
|
34
|
+
height: number;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -42,11 +42,11 @@ type __VLS_Slots = {
|
|
|
42
42
|
actions?(): unknown;
|
|
43
43
|
};
|
|
44
44
|
declare const __VLS_base: import('vue').DefineComponent<NotificationProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
45
|
-
action: () => any;
|
|
46
45
|
dismiss: () => any;
|
|
46
|
+
action: () => any;
|
|
47
47
|
}, string, import('vue').PublicProps, Readonly<NotificationProps> & Readonly<{
|
|
48
|
-
onAction?: (() => any) | undefined;
|
|
49
48
|
onDismiss?: (() => any) | undefined;
|
|
49
|
+
onAction?: (() => any) | undefined;
|
|
50
50
|
}>, {
|
|
51
51
|
type: NotificationType;
|
|
52
52
|
dismissible: boolean;
|
|
@@ -6,6 +6,11 @@ import { HTMLAttributes } from 'vue';
|
|
|
6
6
|
* steps filled out of `max`);
|
|
7
7
|
* - indeterminate, when there's no telling how long it'll take (no `value`).
|
|
8
8
|
* Built on Reka UI's Progress, so it's announced as a progress bar.
|
|
9
|
+
*
|
|
10
|
+
* Segments can take you back: give `segmentLabels` (one name per segment) and
|
|
11
|
+
* the finished segments before the current one become buttons ("Back to step
|
|
12
|
+
* 1: Name") that emit `select` with the segment's index, from 0. Steps ahead
|
|
13
|
+
* can't be picked, so each step's checks still run in order.
|
|
9
14
|
*/
|
|
10
15
|
export interface ProgressProps {
|
|
11
16
|
/** Done so far, out of `max`. Leave it out (or null) for indeterminate. */
|
|
@@ -16,9 +21,17 @@ export interface ProgressProps {
|
|
|
16
21
|
segments?: boolean;
|
|
17
22
|
/** What's progressing, e.g. "Uploading report.pdf". Its accessible name; not shown. */
|
|
18
23
|
label: string;
|
|
24
|
+
/** With `segments`: a name per segment. Finished segments become buttons that emit `select`. */
|
|
25
|
+
segmentLabels?: string[];
|
|
26
|
+
/** Stops the segment buttons working, e.g. while a step is saving. */
|
|
27
|
+
disabled?: boolean;
|
|
19
28
|
class?: HTMLAttributes['class'];
|
|
20
29
|
}
|
|
21
|
-
declare const __VLS_export: import('vue').DefineComponent<ProgressProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
30
|
+
declare const __VLS_export: import('vue').DefineComponent<ProgressProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
31
|
+
select: (index: number) => any;
|
|
32
|
+
}, string, import('vue').PublicProps, Readonly<ProgressProps> & Readonly<{
|
|
33
|
+
onSelect?: ((index: number) => any) | undefined;
|
|
34
|
+
}>, {
|
|
22
35
|
value: number | null;
|
|
23
36
|
max: number;
|
|
24
37
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -13,9 +13,11 @@ import { DialogContentProps } from 'reka-ui';
|
|
|
13
13
|
*
|
|
14
14
|
* Multi-step forms: pass `steps` (one name per step) and show the current
|
|
15
15
|
* step's fields in the body slot, which gets `{ step }`. The header shows a
|
|
16
|
-
* segment per step
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* segment per step (press a finished one to go back to it), then the title
|
|
17
|
+
* with the step under it (e.g. "Turn on MFA" / "Step 2 of 3 – Enter the
|
|
18
|
+
* code"). Changing step slides the step line, the body and the buttons. The
|
|
19
|
+
* footer gets Cancel / Previous and Next / Finish, unless you fill the footer
|
|
20
|
+
* slot. Enter in a text field presses Next / Finish.
|
|
19
21
|
*/
|
|
20
22
|
export interface SlideoverProps {
|
|
21
23
|
/** Heading of the panel. Also its accessible name, so always set it (or the title slot). */
|
|
@@ -106,13 +108,13 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
106
108
|
onFinish?: (() => any) | undefined;
|
|
107
109
|
"onUpdate:step"?: ((value: number) => any) | undefined;
|
|
108
110
|
}>, {
|
|
111
|
+
close: boolean;
|
|
109
112
|
side: "bottom" | "top" | "right" | "left";
|
|
110
113
|
portal: string | boolean | HTMLElement;
|
|
111
114
|
dismissible: boolean;
|
|
112
115
|
modal: boolean;
|
|
113
|
-
close: boolean;
|
|
114
116
|
overlay: boolean;
|
|
115
|
-
initialFocus: "
|
|
117
|
+
initialFocus: "close" | "none" | "auto";
|
|
116
118
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
117
119
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
118
120
|
declare const _default: typeof __VLS_export;
|
|
@@ -22,8 +22,8 @@ export interface SpinnerProps {
|
|
|
22
22
|
class?: HTMLAttributes['class'];
|
|
23
23
|
}
|
|
24
24
|
declare const __VLS_export: import('vue').DefineComponent<SpinnerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SpinnerProps> & Readonly<{}>, {
|
|
25
|
-
max: number;
|
|
26
25
|
size: "sm" | "md" | "lg";
|
|
26
|
+
max: number;
|
|
27
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
declare const _default: typeof __VLS_export;
|
|
29
29
|
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Chooses light, dark or matching the device, e.g. in the account menu
|
|
4
|
+
* (Header's `account-menu` slot) or Settings. Applies at once and is
|
|
5
|
+
* remembered in this browser. Call `initTheme()` in main.ts so the saved
|
|
6
|
+
* choice is applied before the app shows.
|
|
7
|
+
*/
|
|
8
|
+
export interface ThemeSwitcherProps {
|
|
9
|
+
/** Visible label. Default "Appearance". */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Keep the label for screen readers only. */
|
|
12
|
+
hideLabel?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
class?: HTMLAttributes['class'];
|
|
15
|
+
}
|
|
16
|
+
declare const __VLS_export: import('vue').DefineComponent<ThemeSwitcherProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ThemeSwitcherProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -45,6 +45,11 @@ export declare const en: {
|
|
|
45
45
|
changeIndicator: {
|
|
46
46
|
changed: string;
|
|
47
47
|
};
|
|
48
|
+
chart: {
|
|
49
|
+
category: string;
|
|
50
|
+
showTable: string;
|
|
51
|
+
hideTable: string;
|
|
52
|
+
};
|
|
48
53
|
chip: {
|
|
49
54
|
remove: string;
|
|
50
55
|
};
|
|
@@ -87,9 +92,28 @@ export declare const en: {
|
|
|
87
92
|
italic: string;
|
|
88
93
|
underline: string;
|
|
89
94
|
};
|
|
95
|
+
alert: {
|
|
96
|
+
info: string;
|
|
97
|
+
success: string;
|
|
98
|
+
warning: string;
|
|
99
|
+
error: string;
|
|
100
|
+
dismiss: string;
|
|
101
|
+
};
|
|
102
|
+
fileUpload: {
|
|
103
|
+
chooseFile: string;
|
|
104
|
+
chooseFiles: string;
|
|
105
|
+
dropFile: string;
|
|
106
|
+
dropFiles: string;
|
|
107
|
+
};
|
|
90
108
|
languageSwitcher: {
|
|
91
109
|
label: string;
|
|
92
110
|
};
|
|
111
|
+
themeSwitcher: {
|
|
112
|
+
label: string;
|
|
113
|
+
light: string;
|
|
114
|
+
dark: string;
|
|
115
|
+
system: string;
|
|
116
|
+
};
|
|
93
117
|
notifications: {
|
|
94
118
|
title: string;
|
|
95
119
|
region: string;
|
|
@@ -108,6 +132,7 @@ export declare const en: {
|
|
|
108
132
|
};
|
|
109
133
|
progress: {
|
|
110
134
|
stepOf: string;
|
|
135
|
+
backTo: string;
|
|
111
136
|
};
|
|
112
137
|
select: {
|
|
113
138
|
choose: string;
|
|
@@ -130,6 +155,8 @@ export declare const en: {
|
|
|
130
155
|
finish: string;
|
|
131
156
|
steps: string;
|
|
132
157
|
stepOf: string;
|
|
158
|
+
/** Shown under the title, e.g. "Step 1 of 3 – Name". */
|
|
159
|
+
stepHeading: string;
|
|
133
160
|
};
|
|
134
161
|
spinner: {
|
|
135
162
|
loading: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { cn } from './lib/cn';
|
|
2
|
+
export { initTheme, useTheme } from './lib/theme';
|
|
3
|
+
export type { ChartPoint, ChartSeries } from './lib/chart';
|
|
4
|
+
export type { Theme } from './lib/theme';
|
|
2
5
|
export { default as AppShell } from './components/AppShell/AppShell.vue';
|
|
3
6
|
export type { AppShellProps } from './components/AppShell/AppShell.vue';
|
|
4
7
|
export { default as Header } from './components/Header/Header.vue';
|
|
@@ -33,6 +36,10 @@ export { default as Progress } from './components/Progress/Progress.vue';
|
|
|
33
36
|
export type { ProgressProps } from './components/Progress/Progress.vue';
|
|
34
37
|
export { default as ChangeIndicator } from './components/ChangeIndicator/ChangeIndicator.vue';
|
|
35
38
|
export type { ChangeIndicatorProps } from './components/ChangeIndicator/ChangeIndicator.vue';
|
|
39
|
+
export { default as Alert } from './components/Alert/Alert.vue';
|
|
40
|
+
export type { AlertProps } from './components/Alert/Alert.vue';
|
|
41
|
+
export { default as Collapsible } from './components/Collapsible/Collapsible.vue';
|
|
42
|
+
export type { CollapsibleProps } from './components/Collapsible/Collapsible.vue';
|
|
36
43
|
export { default as FormField } from './components/FormField/FormField.vue';
|
|
37
44
|
export type { FormFieldProps, FormFieldStatus } from './components/FormField/FormField.vue';
|
|
38
45
|
export { default as Input } from './components/Input/Input.vue';
|
|
@@ -63,8 +70,12 @@ export { default as CheckboxGroup } from './components/CheckboxGroup/CheckboxGro
|
|
|
63
70
|
export type { CheckboxGroupProps, CheckboxOption, CheckboxGroupValue } from './components/CheckboxGroup/CheckboxGroup.vue';
|
|
64
71
|
export { default as LanguageSwitcher } from './components/LanguageSwitcher/LanguageSwitcher.vue';
|
|
65
72
|
export type { LanguageSwitcherProps } from './components/LanguageSwitcher/LanguageSwitcher.vue';
|
|
73
|
+
export { default as ThemeSwitcher } from './components/ThemeSwitcher/ThemeSwitcher.vue';
|
|
74
|
+
export type { ThemeSwitcherProps } from './components/ThemeSwitcher/ThemeSwitcher.vue';
|
|
66
75
|
export { default as CardSelect } from './components/CardSelect/CardSelect.vue';
|
|
67
76
|
export type { CardSelectProps } from './components/CardSelect/CardSelect.vue';
|
|
77
|
+
export { default as FileUpload } from './components/FileUpload/FileUpload.vue';
|
|
78
|
+
export type { FileUploadProps } from './components/FileUpload/FileUpload.vue';
|
|
68
79
|
export { default as Table } from './components/Table/Table.vue';
|
|
69
80
|
export type { TableProps } from './components/Table/Table.vue';
|
|
70
81
|
export type { TableColumn, TableSort, SortDirection } from './components/Table/table';
|
|
@@ -81,6 +92,10 @@ export { default as Age } from './components/Age/Age.vue';
|
|
|
81
92
|
export type { AgeProps } from './components/Age/Age.vue';
|
|
82
93
|
export { default as EmptyState } from './components/EmptyState/EmptyState.vue';
|
|
83
94
|
export type { EmptyStateProps } from './components/EmptyState/EmptyState.vue';
|
|
95
|
+
export { default as BarChart } from './components/BarChart/BarChart.vue';
|
|
96
|
+
export type { BarChartProps } from './components/BarChart/BarChart.vue';
|
|
97
|
+
export { default as LineChart } from './components/LineChart/LineChart.vue';
|
|
98
|
+
export type { LineChartProps } from './components/LineChart/LineChart.vue';
|
|
84
99
|
export { default as Breadcrumb } from './components/Breadcrumb/Breadcrumb.vue';
|
|
85
100
|
export type { BreadcrumbProps, BreadcrumbItem } from './components/Breadcrumb/Breadcrumb.vue';
|
|
86
101
|
export { default as Sidebar } from './components/Sidebar/Sidebar.vue';
|
|
@@ -90,6 +105,8 @@ export { default as Link } from './components/Link/Link.vue';
|
|
|
90
105
|
export type { LinkProps } from './components/Link/Link.vue';
|
|
91
106
|
export { default as Steps } from './components/Steps/Steps.vue';
|
|
92
107
|
export type { StepsProps } from './components/Steps/Steps.vue';
|
|
108
|
+
export { default as ActionList } from './components/ActionList/ActionList.vue';
|
|
109
|
+
export type { ActionListItem, ActionListProps } from './components/ActionList/ActionList.vue';
|
|
93
110
|
export { default as Popover } from './components/Popover/Popover.vue';
|
|
94
111
|
export type { PopoverProps } from './components/Popover/Popover.vue';
|
|
95
112
|
export { default as Menu } from './components/Menu/Menu.vue';
|