@thekestongroup/ui 0.16.0 → 0.19.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 (51) hide show
  1. package/dist/components/ActionList/ActionList.vue.d.ts +13 -2
  2. package/dist/components/AppLauncher/AppLauncher.vue.d.ts +8 -0
  3. package/dist/components/AsyncState/AsyncState.vue.d.ts +53 -0
  4. package/dist/components/ConfirmDialog/ConfirmDialog.vue.d.ts +62 -0
  5. package/dist/components/Footer/Footer.vue.d.ts +2 -2
  6. package/dist/components/Header/Header.vue.d.ts +19 -1
  7. package/dist/components/InputRichText/InputRichText.vue.d.ts +12 -6
  8. package/dist/components/Prose/Prose.vue.d.ts +36 -0
  9. package/dist/components/ResultState/ResultState.vue.d.ts +48 -0
  10. package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts +50 -0
  11. package/dist/components/Steps/Steps.vue.d.ts +16 -5
  12. package/dist/components/ThemeSwitcher/ThemeSwitcher.vue.d.ts +8 -1
  13. package/dist/i18n/en.d.ts +17 -0
  14. package/dist/index.d.ts +11 -1
  15. package/dist/keston-ui.js +2305 -1773
  16. package/dist/lib/initials.d.ts +6 -1
  17. package/package.json +3 -1
  18. package/src/components/ActionList/ActionList.stories.ts +34 -1
  19. package/src/components/ActionList/ActionList.vue +27 -5
  20. package/src/components/AppLauncher/AppLauncher.vue +22 -1
  21. package/src/components/AppLauncher/apps.ts +2 -2
  22. package/src/components/AppShell/AppShell.vue +2 -1
  23. package/src/components/AsyncState/AsyncState.stories.ts +46 -0
  24. package/src/components/AsyncState/AsyncState.vue +78 -0
  25. package/src/components/Button/Button.vue +4 -4
  26. package/src/components/ConfirmDialog/ConfirmDialog.stories.ts +54 -0
  27. package/src/components/ConfirmDialog/ConfirmDialog.vue +119 -0
  28. package/src/components/Footer/Footer.stories.ts +3 -3
  29. package/src/components/Footer/Footer.vue +5 -4
  30. package/src/components/Footer/footer.test.ts +2 -2
  31. package/src/components/Footer/links.ts +3 -3
  32. package/src/components/FormField/FormField.vue +5 -1
  33. package/src/components/Header/Header.stories.ts +25 -12
  34. package/src/components/Header/Header.vue +38 -4
  35. package/src/components/InputRichText/InputRichText.stories.ts +19 -0
  36. package/src/components/InputRichText/InputRichText.vue +129 -13
  37. package/src/components/Notification/Toaster.vue +3 -1
  38. package/src/components/Prose/Prose.stories.ts +46 -0
  39. package/src/components/Prose/Prose.vue +54 -0
  40. package/src/components/ResultState/ResultState.stories.ts +44 -0
  41. package/src/components/ResultState/ResultState.vue +76 -0
  42. package/src/components/SegmentedControl/SegmentedControl.stories.ts +57 -0
  43. package/src/components/SegmentedControl/SegmentedControl.vue +93 -0
  44. package/src/components/Steps/Steps.stories.ts +18 -0
  45. package/src/components/Steps/Steps.vue +28 -8
  46. package/src/components/ThemeSwitcher/ThemeSwitcher.vue +24 -2
  47. package/src/i18n/en.ts +13 -3
  48. package/src/index.ts +11 -1
  49. package/src/lib/initials.test.ts +19 -0
  50. package/src/lib/initials.ts +12 -3
  51. package/src/styles/theme.css +25 -2
@@ -16,12 +16,16 @@ export interface ActionListItem {
16
16
  current?: boolean;
17
17
  /** Show a spinner in place of the arrow, e.g. while switching to it. */
18
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;
19
21
  }
20
22
  /**
21
23
  * A list of things to pick one of and go to: accounts to switch to,
22
24
  * organisations, connected apps. Each row is a single button or link with an
23
25
  * optional icon or avatar, a name and a line under it, and an arrow, in a
24
- * bordered box with lines between rows.
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.
25
29
  *
26
30
  * Rows without `to` / `href` are buttons that emit `select`.
27
31
  *
@@ -35,6 +39,10 @@ export interface ActionListProps {
35
39
  label: string;
36
40
  /** Component used for rows with `to`, e.g. RouterLink. */
37
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;
38
46
  class?: HTMLAttributes['class'];
39
47
  }
40
48
  type __VLS_Slots = {
@@ -52,7 +60,10 @@ declare const __VLS_base: import('vue').DefineComponent<ActionListProps, {}, {},
52
60
  select: (item: ActionListItem) => any;
53
61
  }, string, import('vue').PublicProps, Readonly<ActionListProps> & Readonly<{
54
62
  onSelect?: ((item: ActionListItem) => any) | undefined;
55
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
63
+ }>, {
64
+ appearance: "boxed" | "plain";
65
+ chevron: boolean;
66
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
56
67
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
57
68
  declare const _default: typeof __VLS_export;
58
69
  export default _default;
@@ -6,6 +6,8 @@ export interface AppLauncherApp {
6
6
  href: string;
7
7
  /** An icon component, or the name of one of the Keston app icons (id, admin, work, utilities, design). */
8
8
  icon?: Component | string;
9
+ /** Signs in with Keston ID, so it's given the `loginHint`. Default true. */
10
+ signsIn?: boolean;
9
11
  }
10
12
  /**
11
13
  * The grid button in the header that opens a panel of the Keston Group's apps, so people can move between
@@ -24,6 +26,12 @@ export interface AppLauncherProps {
24
26
  align?: 'start' | 'end';
25
27
  /** Name of the button for screen readers. Default "Keston apps". */
26
28
  label?: string;
29
+ /**
30
+ * The signed-in person's email. Added to the other apps' links as
31
+ * `?login_hint=`, so they sign in as the same account without asking
32
+ * which. AppShell passes its `user`'s email.
33
+ */
34
+ loginHint?: string;
27
35
  class?: HTMLAttributes['class'];
28
36
  }
29
37
  declare const _default: typeof __VLS_export;
@@ -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
+ };
@@ -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
+ };
@@ -9,7 +9,7 @@ export interface FooterLink {
9
9
  newTab?: boolean;
10
10
  }
11
11
  /**
12
- * The bottom of an app's page: on the left Help & support and the legal links (Privacy Policy, Terms & Conditions), and
12
+ * The bottom of an app's page: on the left Help and the legal links (Privacy, Terms), and
13
13
  * on the right the app's name, version and build (so a bug report can say exactly which build) with
14
14
  * the copyright. The same in every Keston app; pass the app's `version` and `build`.
15
15
  *
@@ -25,7 +25,7 @@ export interface FooterLink {
25
25
  * Slots: nav (instead of the whole link list), end (after the copyright).
26
26
  */
27
27
  export interface FooterProps {
28
- /** The links on the left. Default: `kestonFooterLinks` (Help & support, Privacy Policy, Terms & Conditions). */
28
+ /** The links on the left. Default: `kestonFooterLinks` (Help, Privacy, Terms). */
29
29
  links?: FooterLink[];
30
30
  /** More links after a divider, e.g. Contact us, or `kestonGroupLinks` to point at the other Keston apps. */
31
31
  moreLinks?: FooterLink[];
@@ -8,6 +8,11 @@ export interface HeaderUser {
8
8
  avatar?: string;
9
9
  }
10
10
  export type HeaderUserAction = 'account-settings' | 'switch-account' | 'log-out';
11
+ /** An image, with an optional version for dark mode (e.g. white). */
12
+ export type HeaderImage = string | {
13
+ light: string;
14
+ dark?: string;
15
+ };
11
16
  /**
12
17
  * The bar across the top of every Keston app. It is the same in every app:
13
18
  * a menu button (to open the Sidebar on small screens), the app's name, an
@@ -15,7 +20,9 @@ export type HeaderUserAction = 'account-settings' | 'switch-account' | 'log-out'
15
20
  * the right (Account settings, Switch account, Log out). Each part can be
16
21
  * overridden with a slot.
17
22
  *
18
- * Slots: start (the very first thing, before the menu button, e.g. the app launcher; give it a `-ml-2.5` button to line up with the padding), leading (before the title, e.g. a logo), title, default (the middle,
23
+ * The app's brand: `title` with a `logo` (icon) beside it, or a `lockup` (one image).
24
+ *
25
+ * Slots: start (the very first thing, before the menu button, e.g. the app launcher; give it a `-ml-2.5` button to line up with the padding), leading (before the title), title, default (the middle,
19
26
  * fills the space between title and trailing), trailing (actions before the
20
27
  * account menu), account (replaces the account menu, or the Sign in button),
21
28
  * account-menu (extra content in the account menu, above Switch account /
@@ -26,6 +33,17 @@ export type HeaderUserAction = 'account-settings' | 'switch-account' | 'log-out'
26
33
  export interface HeaderProps {
27
34
  /** Name of the app or area, shown next to the menu button. */
28
35
  title?: string;
36
+ /**
37
+ * The app's icon, before its name: sized to the text (20px) and part of
38
+ * the title link. Decorative: the name is what's read out. Use this or
39
+ * `lockup`.
40
+ */
41
+ logo?: HeaderImage;
42
+ /**
43
+ * The app's lockup (icon and name in one image), in place of the title
44
+ * text, 24px tall and part of the title link. Its alt text is `title`.
45
+ */
46
+ lockup?: HeaderImage;
29
47
  /**
30
48
  * Make the title a link, e.g. to the app's dashboard: passed as `to` to
31
49
  * `linkComponent` (e.g. a route), or as `href` without one.
@@ -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,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
+ };
@@ -0,0 +1,48 @@
1
+ import { Component, HTMLAttributes } from 'vue';
2
+ /**
3
+ * The end of a task: what happened, and what next. "3 users added", "Nobody
4
+ * was added", "Password changed". A large icon, a heading, a line or two,
5
+ * and actions (e.g. Add more, Done), centred.
6
+ *
7
+ * It usually replaces the form that was just sent, so focus moves to its
8
+ * heading when it appears and screen readers read the outcome. Turn that off
9
+ * with `:focus="false"` when it's on the page from the start.
10
+ *
11
+ * For a list or table with nothing in it, use EmptyState.
12
+ *
13
+ * Slots: description (instead of `description`), default (under the
14
+ * description, e.g. a list of what failed), actions.
15
+ */
16
+ export interface ResultStateProps {
17
+ /** success (default), error (nothing happened), warning (partly), info. Sets the icon and its colour. */
18
+ type?: 'success' | 'error' | 'warning' | 'info';
19
+ /** What happened, e.g. "3 users added". */
20
+ title: string;
21
+ /** What it means or what to do next. */
22
+ description?: string;
23
+ /** A different icon from the type's own. */
24
+ icon?: Component;
25
+ /** The heading's level, to fit the page outline. */
26
+ headingLevel?: 1 | 2 | 3;
27
+ /** Move focus to the heading when it appears. */
28
+ focus?: boolean;
29
+ class?: HTMLAttributes['class'];
30
+ }
31
+ type __VLS_Slots = {
32
+ default?(): unknown;
33
+ description?(): unknown;
34
+ actions?(): unknown;
35
+ };
36
+ declare const __VLS_base: import('vue').DefineComponent<ResultStateProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ResultStateProps> & Readonly<{}>, {
37
+ focus: boolean;
38
+ type: "error" | "success" | "info" | "warning";
39
+ headingLevel: 1 | 2 | 3;
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,50 @@
1
+ import { Component, HTMLAttributes } from 'vue';
2
+ /**
3
+ * One choice from two to four short options, shown as a row of tab-like
4
+ * buttons, e.g. Light / Dark / System. It's a radio group: arrow keys move
5
+ * the choice, and it applies at once. Smaller than a Select and shows every
6
+ * option, so it suits settings that sit in a toolbar or footer.
7
+ *
8
+ * For a choice that changes what's on the page below (sections), use Tabs.
9
+ * For longer options or ones with descriptions, use RadioGroup.
10
+ */
11
+ export type SegmentedValue = string | number;
12
+ export interface SegmentedOption {
13
+ label: string;
14
+ value: SegmentedValue;
15
+ /** An icon before the label (decorative). */
16
+ icon?: Component;
17
+ disabled?: boolean;
18
+ }
19
+ export interface SegmentedControlProps {
20
+ /** What's being chosen, e.g. "Appearance". The group's accessible name. */
21
+ label: string;
22
+ /** Keep the label for screen readers only. */
23
+ hideLabel?: boolean;
24
+ options: SegmentedOption[];
25
+ /**
26
+ * Icons only: each option's label becomes its accessible name and shows
27
+ * as a tooltip-style title. Every option needs an icon.
28
+ */
29
+ iconOnly?: boolean;
30
+ size?: 'sm' | 'md';
31
+ disabled?: boolean;
32
+ /** Name for native form submission. */
33
+ name?: string;
34
+ class?: HTMLAttributes['class'];
35
+ }
36
+ type __VLS_Props = SegmentedControlProps;
37
+ type __VLS_ModelProps = {
38
+ /** The chosen option's value. */
39
+ modelValue?: SegmentedValue | undefined;
40
+ };
41
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
42
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
43
+ "update:modelValue": (value: SegmentedValue | undefined) => any;
44
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
45
+ "onUpdate:modelValue"?: ((value: SegmentedValue | undefined) => any) | undefined;
46
+ }>, {
47
+ size: "sm" | "md";
48
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
49
+ declare const _default: typeof __VLS_export;
50
+ export default _default;
@@ -1,10 +1,15 @@
1
1
  import { HTMLAttributes } from 'vue';
2
2
  /**
3
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" above 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.
4
+ * the current one, and "Step 2 of 3 – Licences" under it, as in Slideover's
5
+ * multi-step form. Put it at the top of a multi-step form on a page, or in a
6
+ * Slideover you drive yourself. The words are announced when the step
7
+ * changes.
8
+ *
9
+ * With `v-model:step`, finished segments are buttons ("Back to step 1: User
10
+ * info") that go back to that step; steps ahead can't be picked, so each
11
+ * step's checks still run in order. With just `:step`, it only shows where
12
+ * you are.
8
13
  */
9
14
  export interface StepsProps {
10
15
  /** The name of each step, in order, e.g. `['User info', 'Licences']`. */
@@ -13,8 +18,14 @@ export interface StepsProps {
13
18
  step: number;
14
19
  /** What the steps are for, e.g. "Add a user". The progress bar's accessible name; not shown. */
15
20
  label: string;
21
+ /** Stops going back, e.g. while a step saves. */
22
+ disabled?: boolean;
16
23
  class?: HTMLAttributes['class'];
17
24
  }
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>;
25
+ declare const __VLS_export: import('vue').DefineComponent<StepsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
26
+ "update:step": (step: number) => any;
27
+ }, string, import('vue').PublicProps, Readonly<StepsProps> & Readonly<{
28
+ "onUpdate:step"?: ((step: number) => any) | undefined;
29
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
30
  declare const _default: typeof __VLS_export;
20
31
  export default _default;
@@ -11,8 +11,15 @@ export interface ThemeSwitcherProps {
11
11
  /** Keep the label for screen readers only. */
12
12
  hideLabel?: boolean;
13
13
  disabled?: boolean;
14
+ /**
15
+ * select: a dropdown (Settings, the account menu). segmented: Light / Dark
16
+ * / System side by side with icons, small: for the footer.
17
+ */
18
+ appearance?: 'select' | 'segmented';
14
19
  class?: HTMLAttributes['class'];
15
20
  }
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>;
21
+ declare const __VLS_export: import('vue').DefineComponent<ThemeSwitcherProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ThemeSwitcherProps> & Readonly<{}>, {
22
+ appearance: "select" | "segmented";
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
24
  declare const _default: typeof __VLS_export;
18
25
  export default _default;
package/dist/i18n/en.d.ts CHANGED
@@ -91,6 +91,12 @@ export declare const en: {
91
91
  bold: string;
92
92
  italic: string;
93
93
  underline: string;
94
+ link: string;
95
+ linkAddress: string;
96
+ addLink: string;
97
+ updateLink: string;
98
+ removeLink: string;
99
+ linkInvalid: string;
94
100
  };
95
101
  alert: {
96
102
  info: string;
@@ -105,6 +111,14 @@ export declare const en: {
105
111
  dropFile: string;
106
112
  dropFiles: string;
107
113
  };
114
+ confirmDialog: {
115
+ confirm: string;
116
+ cancel: string;
117
+ };
118
+ asyncState: {
119
+ error: string;
120
+ retry: string;
121
+ };
108
122
  languageSwitcher: {
109
123
  label: string;
110
124
  };
@@ -113,6 +127,7 @@ export declare const en: {
113
127
  light: string;
114
128
  dark: string;
115
129
  system: string;
130
+ systemShort: string;
116
131
  };
117
132
  notifications: {
118
133
  title: string;
@@ -169,6 +184,8 @@ export declare const en: {
169
184
  steps: {
170
185
  stepOf: string;
171
186
  stepOfNamed: string;
187
+ /** Under the segments, e.g. "Step 2 of 3 – Licences", as in Slideover. */
188
+ stepOfDash: string;
172
189
  };
173
190
  summaryList: {
174
191
  notSet: string;
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export type { Theme } from './lib/theme';
5
5
  export { default as AppShell } from './components/AppShell/AppShell.vue';
6
6
  export type { AppShellProps } from './components/AppShell/AppShell.vue';
7
7
  export { default as Header } from './components/Header/Header.vue';
8
- export type { HeaderProps, HeaderUser, HeaderUserAction } from './components/Header/Header.vue';
8
+ export type { HeaderImage, HeaderProps, HeaderUser, HeaderUserAction } from './components/Header/Header.vue';
9
9
  export { default as PageHeader } from './components/PageHeader/PageHeader.vue';
10
10
  export type { PageHeaderAction, PageHeaderProps } from './components/PageHeader/PageHeader.vue';
11
11
  export { default as SettingsRow } from './components/SettingsRow/SettingsRow.vue';
@@ -40,6 +40,8 @@ export { default as Alert } from './components/Alert/Alert.vue';
40
40
  export type { AlertProps } from './components/Alert/Alert.vue';
41
41
  export { default as Collapsible } from './components/Collapsible/Collapsible.vue';
42
42
  export type { CollapsibleProps } from './components/Collapsible/Collapsible.vue';
43
+ export { default as Prose } from './components/Prose/Prose.vue';
44
+ export type { ProseProps } from './components/Prose/Prose.vue';
43
45
  export { default as FormField } from './components/FormField/FormField.vue';
44
46
  export type { FormFieldProps, FormFieldStatus } from './components/FormField/FormField.vue';
45
47
  export { default as Input } from './components/Input/Input.vue';
@@ -96,6 +98,10 @@ export { default as BarChart } from './components/BarChart/BarChart.vue';
96
98
  export type { BarChartProps } from './components/BarChart/BarChart.vue';
97
99
  export { default as LineChart } from './components/LineChart/LineChart.vue';
98
100
  export type { LineChartProps } from './components/LineChart/LineChart.vue';
101
+ export { default as AsyncState } from './components/AsyncState/AsyncState.vue';
102
+ export type { AsyncStateProps } from './components/AsyncState/AsyncState.vue';
103
+ export { default as ResultState } from './components/ResultState/ResultState.vue';
104
+ export type { ResultStateProps } from './components/ResultState/ResultState.vue';
99
105
  export { default as Breadcrumb } from './components/Breadcrumb/Breadcrumb.vue';
100
106
  export type { BreadcrumbProps, BreadcrumbItem } from './components/Breadcrumb/Breadcrumb.vue';
101
107
  export { default as Sidebar } from './components/Sidebar/Sidebar.vue';
@@ -111,6 +117,8 @@ export { default as Popover } from './components/Popover/Popover.vue';
111
117
  export type { PopoverProps } from './components/Popover/Popover.vue';
112
118
  export { default as Menu } from './components/Menu/Menu.vue';
113
119
  export type { MenuItem, MenuProps } from './components/Menu/Menu.vue';
120
+ export { default as SegmentedControl } from './components/SegmentedControl/SegmentedControl.vue';
121
+ export type { SegmentedControlProps, SegmentedOption, SegmentedValue } from './components/SegmentedControl/SegmentedControl.vue';
114
122
  export { default as Tabs } from './components/Tabs/Tabs.vue';
115
123
  export type { Tab, TabsProps } from './components/Tabs/Tabs.vue';
116
124
  export { default as Slideover } from './components/Slideover/Slideover.vue';
@@ -129,6 +137,8 @@ export { createNotifications, useNotifications, relativeTime } from './component
129
137
  export type { Notifications, NotificationItem, NotificationInput, NotificationAction, NotificationType, ToastOptions } from './components/Notification/notifications';
130
138
  export { default as UnsavedChangesBar } from './components/UnsavedChangesBar/UnsavedChangesBar.vue';
131
139
  export type { UnsavedChangesBarProps } from './components/UnsavedChangesBar/UnsavedChangesBar.vue';
140
+ export { default as ConfirmDialog } from './components/ConfirmDialog/ConfirmDialog.vue';
141
+ export type { ConfirmDialogProps } from './components/ConfirmDialog/ConfirmDialog.vue';
132
142
  export { createKestonI18n, uiMessages, en } from './i18n';
133
143
  export type { KestonI18nOptions, Messages, UiMessages } from './i18n';
134
144
  export { age, daysToBirthday, formatDate, formatDateTime, toDate } from './lib/dates';