@thekestongroup/ui 0.15.0 → 0.18.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.
Files changed (78) hide show
  1. package/dist/components/ActionList/ActionList.vue.d.ts +74 -0
  2. package/dist/components/Alert/Alert.vue.d.ts +55 -0
  3. package/dist/components/AsyncState/AsyncState.vue.d.ts +53 -0
  4. package/dist/components/AvatarGroup/AvatarGroup.vue.d.ts +1 -1
  5. package/dist/components/BarChart/BarChart.vue.d.ts +37 -0
  6. package/dist/components/BarChart/ChartData.vue.d.ts +20 -0
  7. package/dist/components/Button/Button.vue.d.ts +1 -1
  8. package/dist/components/Collapsible/Collapsible.vue.d.ts +48 -0
  9. package/dist/components/ConfirmDialog/ConfirmDialog.vue.d.ts +62 -0
  10. package/dist/components/FileUpload/FileUpload.vue.d.ts +55 -0
  11. package/dist/components/Footer/Footer.vue.d.ts +11 -1
  12. package/dist/components/Header/Header.vue.d.ts +1 -1
  13. package/dist/components/InputRichText/InputRichText.vue.d.ts +12 -6
  14. package/dist/components/LineChart/LineChart.vue.d.ts +37 -0
  15. package/dist/components/Notification/Notification.vue.d.ts +2 -2
  16. package/dist/components/Progress/Progress.vue.d.ts +14 -1
  17. package/dist/components/Prose/Prose.vue.d.ts +36 -0
  18. package/dist/components/ResultState/ResultState.vue.d.ts +48 -0
  19. package/dist/components/Slideover/Slideover.vue.d.ts +7 -5
  20. package/dist/components/Spinner/Spinner.vue.d.ts +1 -1
  21. package/dist/components/Steps/Steps.vue.d.ts +16 -5
  22. package/dist/components/ThemeSwitcher/ThemeSwitcher.vue.d.ts +18 -0
  23. package/dist/i18n/en.d.ts +43 -0
  24. package/dist/index.d.ts +25 -0
  25. package/dist/keston-ui.js +5287 -4028
  26. package/dist/lib/chart.d.ts +32 -0
  27. package/dist/lib/initials.d.ts +6 -1
  28. package/dist/lib/theme.d.ts +23 -0
  29. package/package.json +10 -3
  30. package/src/components/ActionList/ActionList.stories.ts +92 -0
  31. package/src/components/ActionList/ActionList.vue +138 -0
  32. package/src/components/Alert/Alert.stories.ts +65 -0
  33. package/src/components/Alert/Alert.vue +110 -0
  34. package/src/components/AsyncState/AsyncState.stories.ts +46 -0
  35. package/src/components/AsyncState/AsyncState.vue +78 -0
  36. package/src/components/BarChart/BarChart.stories.ts +62 -0
  37. package/src/components/BarChart/BarChart.vue +153 -0
  38. package/src/components/BarChart/ChartData.vue +64 -0
  39. package/src/components/Button/Button.vue +4 -4
  40. package/src/components/Calendar/Calendar.vue +3 -2
  41. package/src/components/CardSelect/CardSelect.vue +1 -1
  42. package/src/components/Checkbox/Checkbox.vue +1 -1
  43. package/src/components/CheckboxGroup/CheckboxGroup.vue +1 -1
  44. package/src/components/Collapsible/Collapsible.stories.ts +32 -0
  45. package/src/components/Collapsible/Collapsible.vue +68 -0
  46. package/src/components/ConfirmDialog/ConfirmDialog.stories.ts +54 -0
  47. package/src/components/ConfirmDialog/ConfirmDialog.vue +119 -0
  48. package/src/components/FileUpload/FileUpload.stories.ts +38 -0
  49. package/src/components/FileUpload/FileUpload.vue +150 -0
  50. package/src/components/Footer/Footer.stories.ts +10 -2
  51. package/src/components/Footer/Footer.vue +22 -4
  52. package/src/components/Header/Header.stories.ts +20 -0
  53. package/src/components/InputRichText/InputRichText.stories.ts +19 -0
  54. package/src/components/InputRichText/InputRichText.vue +129 -13
  55. package/src/components/LineChart/LineChart.stories.ts +47 -0
  56. package/src/components/LineChart/LineChart.vue +173 -0
  57. package/src/components/Notification/Toaster.vue +3 -1
  58. package/src/components/Progress/Progress.stories.ts +18 -0
  59. package/src/components/Progress/Progress.vue +57 -0
  60. package/src/components/Prose/Prose.stories.ts +46 -0
  61. package/src/components/Prose/Prose.vue +54 -0
  62. package/src/components/RadioGroup/RadioGroup.vue +2 -2
  63. package/src/components/ResultState/ResultState.stories.ts +44 -0
  64. package/src/components/ResultState/ResultState.vue +76 -0
  65. package/src/components/Select/Select.vue +6 -4
  66. package/src/components/Slideover/Slideover.vue +107 -31
  67. package/src/components/Steps/Steps.stories.ts +18 -0
  68. package/src/components/Steps/Steps.vue +28 -8
  69. package/src/components/ThemeSwitcher/ThemeSwitcher.stories.ts +22 -0
  70. package/src/components/ThemeSwitcher/ThemeSwitcher.vue +48 -0
  71. package/src/components/Tooltip/Tooltip.vue +1 -1
  72. package/src/i18n/en.ts +29 -7
  73. package/src/index.ts +25 -0
  74. package/src/lib/chart.ts +47 -0
  75. package/src/lib/initials.test.ts +19 -0
  76. package/src/lib/initials.ts +12 -3
  77. package/src/lib/theme.ts +75 -0
  78. package/src/styles/theme.css +34 -2
@@ -0,0 +1,74 @@
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
+ /** A short note at the top right of the row, e.g. "Signed out" or "Needs a code". */
20
+ note?: string;
21
+ }
22
+ /**
23
+ * A list of things to pick one of and go to: accounts to switch to,
24
+ * organisations, connected apps. Each row is a single button or link with an
25
+ * optional icon or avatar, a name and a line under it, and an arrow, in a
26
+ * bordered box with lines between rows. `appearance="plain"` drops the box
27
+ * (rows sit straight on the card, with a line under each), for a list that
28
+ * is the main thing on its card, like an account chooser.
29
+ *
30
+ * Rows without `to` / `href` are buttons that emit `select`.
31
+ *
32
+ * Slots, each given `{ item }`: leading (before the text, e.g. an Avatar),
33
+ * badges (after the name, e.g. "Current"), after (beside the row, outside
34
+ * the button, e.g. a Leave button).
35
+ */
36
+ export interface ActionListProps {
37
+ items: ActionListItem[];
38
+ /** What the list is, for screen readers, e.g. "Signed-in accounts". */
39
+ label: string;
40
+ /** Component used for rows with `to`, e.g. RouterLink. */
41
+ linkComponent?: string | Component;
42
+ /** boxed (default): a bordered box. plain: no box, a line under each row, rows lined up with the text around them. */
43
+ appearance?: 'boxed' | 'plain';
44
+ /** Show the arrow at the end of each row. */
45
+ chevron?: boolean;
46
+ class?: HTMLAttributes['class'];
47
+ }
48
+ type __VLS_Slots = {
49
+ leading?(props: {
50
+ item: ActionListItem;
51
+ }): unknown;
52
+ badges?(props: {
53
+ item: ActionListItem;
54
+ }): unknown;
55
+ after?(props: {
56
+ item: ActionListItem;
57
+ }): unknown;
58
+ };
59
+ declare const __VLS_base: import('vue').DefineComponent<ActionListProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
60
+ select: (item: ActionListItem) => any;
61
+ }, string, import('vue').PublicProps, Readonly<ActionListProps> & Readonly<{
62
+ onSelect?: ((item: ActionListItem) => any) | undefined;
63
+ }>, {
64
+ appearance: "boxed" | "plain";
65
+ chevron: boolean;
66
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
67
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
68
+ declare const _default: typeof __VLS_export;
69
+ export default _default;
70
+ type __VLS_WithSlots<T, S> = T & {
71
+ new (): {
72
+ $slots: S;
73
+ };
74
+ };
@@ -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
+ };
@@ -0,0 +1,53 @@
1
+ import { Component, HTMLAttributes } from 'vue';
2
+ /**
3
+ * The three states every page or panel that loads data has, the same way
4
+ * everywhere:
5
+ * - error: "Couldn't load …" with the reason and Try again (emits `retry`);
6
+ * - loading: a spinner, centred;
7
+ * - empty: an EmptyState with what goes here and what to do;
8
+ * - otherwise the content (default slot).
9
+ *
10
+ * In that order, so an error wins over stale content. With `card`, the
11
+ * error and empty states sit in a Card, as on a page of Cards.
12
+ *
13
+ * Slots: default (the content), empty (instead of the EmptyState), empty-actions
14
+ * (under the empty state, e.g. "Add a student").
15
+ */
16
+ export interface AsyncStateProps {
17
+ loading?: boolean;
18
+ /** Why it couldn't load. Shows the error state. */
19
+ error?: string | null;
20
+ /** Loaded, with nothing in it. Shows the empty state. */
21
+ empty?: boolean;
22
+ /** The error's title. Default "Couldn't load this". */
23
+ errorTitle?: string;
24
+ /** Show Try again under the error (emits `retry`). */
25
+ retryable?: boolean;
26
+ /** The empty state's title, e.g. "No applications yet". */
27
+ emptyTitle?: string;
28
+ emptyDescription?: string;
29
+ emptyIcon?: Component;
30
+ /** What the spinner says to screen readers. Default "Loading". */
31
+ loadingLabel?: string;
32
+ /** Put the error and empty states in a Card. */
33
+ card?: boolean;
34
+ class?: HTMLAttributes['class'];
35
+ }
36
+ type __VLS_Slots = {
37
+ default?(): unknown;
38
+ empty?(): unknown;
39
+ 'empty-actions'?(): unknown;
40
+ };
41
+ declare const __VLS_base: import('vue').DefineComponent<AsyncStateProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
42
+ retry: () => any;
43
+ }, string, import('vue').PublicProps, Readonly<AsyncStateProps> & Readonly<{
44
+ onRetry?: (() => any) | undefined;
45
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
46
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
47
+ declare const _default: typeof __VLS_export;
48
+ export default _default;
49
+ type __VLS_WithSlots<T, S> = T & {
50
+ new (): {
51
+ $slots: S;
52
+ };
53
+ };
@@ -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: "button" | "submit" | "reset";
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,62 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { ButtonStatus } from '../Button/Button.vue';
3
+ /**
4
+ * "Are you sure?" before something that can't easily be undone: deleting,
5
+ * leaving, removing access. A small panel in the middle of the screen with a
6
+ * title that asks the question, what will happen, and Cancel / the action.
7
+ *
8
+ * Focus starts on Cancel, so pressing Enter by accident doesn't do it.
9
+ * Escape and Cancel close it; clicking outside doesn't (it's a decision).
10
+ * Built on Reka UI's AlertDialog, so it's announced as an alert dialog.
11
+ *
12
+ * Open it with `v-model:open`, or put the button that opens it in the
13
+ * default slot. While `status` is loading, the action shows a spinner and
14
+ * the dialog can't be closed; set it back to idle (and `open` to false) when
15
+ * the work is done.
16
+ *
17
+ * Slots: default (the trigger), description (instead of `description`, for
18
+ * bold text or a list of what will be lost).
19
+ */
20
+ export interface ConfirmDialogProps {
21
+ /** The question, e.g. "Delete 3 applications?" */
22
+ title: string;
23
+ /** What will happen, and whether it can be undone. */
24
+ description?: string;
25
+ /** The action's text: a verb, e.g. "Delete applications". Default "Confirm". */
26
+ confirmLabel?: string;
27
+ /** Default "Cancel". */
28
+ cancelLabel?: string;
29
+ /** Destroys something: the action is a danger Button. */
30
+ danger?: boolean;
31
+ /** Progress of the action, e.g. loading while it runs. */
32
+ status?: ButtonStatus;
33
+ /** Text beside the spinner while loading, e.g. "Deleting…". */
34
+ loadingText?: string;
35
+ class?: HTMLAttributes['class'];
36
+ }
37
+ type __VLS_Props = ConfirmDialogProps;
38
+ type __VLS_Slots = {
39
+ default?(): unknown;
40
+ description?(): unknown;
41
+ };
42
+ type __VLS_ModelProps = {
43
+ 'open'?: boolean;
44
+ };
45
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
46
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
47
+ "update:open": (value: boolean) => any;
48
+ confirm: () => any;
49
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
50
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
51
+ onConfirm?: (() => any) | undefined;
52
+ }>, {
53
+ status: ButtonStatus;
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,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
- * Slots: nav (instead of the whole link list), end (after the copyright, e.g. a language switcher).
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[];
@@ -1,13 +1,19 @@
1
1
  import { HTMLAttributes } from 'vue';
2
2
  import { FormFieldStatus } from '../FormField/FormField.vue';
3
3
  /**
4
- * Several lines of text with bold, italic and underline, e.g. notes on a
5
- * student or an application. Only those three: no headings, lists, links or
6
- * colours, so notes look the same everywhere. Pasted text keeps its bold,
7
- * italic and underline and loses everything else.
4
+ * Several lines of text with bold, italic, underline and links, e.g. notes
5
+ * on a student, or a company's sign-in page text with a link to its help
6
+ * pages. No headings, lists or colours, so text looks the same everywhere.
7
+ * Pasted text keeps those and loses everything else.
8
8
  *
9
- * The value is HTML using only <p>, <br>, <strong>, <em> and <u>. Sanitise
10
- * it on the server like any HTML from a browser before showing it elsewhere.
9
+ * Links: the Link button or Ctrl/⌘+K opens a small panel for the address.
10
+ * Only https://, mailto: and tel: addresses are allowed (never javascript:
11
+ * or plain http). Typed and pasted https:// addresses become links too.
12
+ * Links open in the same tab, so nobody is sent to a new tab unannounced.
13
+ *
14
+ * The value is HTML using only <p>, <br>, <strong>, <em>, <u> and
15
+ * <a href rel>. Sanitise it on the server like any HTML from a browser
16
+ * before showing it elsewhere.
11
17
  */
12
18
  export interface InputRichTextProps {
13
19
  /** Visible label. Always set it: it is also the editor's accessible name. */
@@ -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, {}, string, import('vue').PublicProps, Readonly<ProgressProps> & Readonly<{}>, {
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>;
@@ -0,0 +1,36 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ /**
3
+ * Long-form text written as plain HTML: privacy policies, terms, help
4
+ * articles, release notes. Gives headings, paragraphs, lists, links, quotes,
5
+ * code and tables Keston's look without a class on each, at a readable line
6
+ * length (about 65 characters).
7
+ *
8
+ * Headings follow the guide's scale: h1 text-2xl (when the page has no
9
+ * PageHeader), h2 text-lg, h3 text-base, h4 text-sm. Links look and behave
10
+ * like Link (Keston blue, underlined, focus ring); use Link itself for
11
+ * links that open in a new tab, so they get its icon and screen-reader text.
12
+ *
13
+ * Not for app screens: those are built from components.
14
+ */
15
+ export interface ProseProps {
16
+ /** The text size. base (default) for reading pages, sm in a panel or card. */
17
+ size?: 'sm' | 'base';
18
+ class?: HTMLAttributes['class'];
19
+ }
20
+ declare const __VLS_template: () => {
21
+ __VLS_Slots: {
22
+ default?: (props: {}) => any;
23
+ };
24
+ };
25
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
26
+ declare const __VLS_base: import('vue').DefineComponent<ProseProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ProseProps> & Readonly<{}>, {
27
+ size: "sm" | "base";
28
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };