@thekestongroup/ui 0.18.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.
@@ -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;
@@ -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.
@@ -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;
@@ -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
@@ -127,6 +127,7 @@ export declare const en: {
127
127
  light: string;
128
128
  dark: string;
129
129
  system: string;
130
+ systemShort: string;
130
131
  };
131
132
  notifications: {
132
133
  title: 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';
@@ -117,6 +117,8 @@ export { default as Popover } from './components/Popover/Popover.vue';
117
117
  export type { PopoverProps } from './components/Popover/Popover.vue';
118
118
  export { default as Menu } from './components/Menu/Menu.vue';
119
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';
120
122
  export { default as Tabs } from './components/Tabs/Tabs.vue';
121
123
  export type { Tab, TabsProps } from './components/Tabs/Tabs.vue';
122
124
  export { default as Slideover } from './components/Slideover/Slideover.vue';