@thekestongroup/ui 0.3.0 → 0.5.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/README.md +18 -9
- package/dist/components/AppShell/AppShell.vue.d.ts +4 -2
- package/dist/components/EmptyState/EmptyState.vue.d.ts +55 -0
- package/dist/components/Header/Header.vue.d.ts +9 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts +1 -1
- package/dist/components/Table/Table.vue.d.ts +14 -1
- package/dist/index.d.ts +2 -0
- package/dist/keston-ui.js +260 -156
- package/package.json +5 -1
- package/src/components/AppShell/AppShell.stories.ts +5 -0
- package/src/components/AppShell/AppShell.vue +16 -3
- package/src/components/EmptyState/EmptyState.stories.ts +99 -0
- package/src/components/EmptyState/EmptyState.vue +87 -0
- package/src/components/Header/Header.stories.ts +9 -0
- package/src/components/Header/Header.vue +27 -4
- package/src/components/Notification/NotificationPane.vue +8 -9
- package/src/components/Table/Table.stories.ts +73 -9
- package/src/components/Table/Table.vue +61 -5
- package/src/index.ts +2 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The component library for every Keston product. Built with Vue 3, [Reka UI](https://reka-ui.com)
|
|
4
4
|
(behaviour and accessibility) and [Tailwind CSS v4](https://tailwindcss.com) (styling).
|
|
5
|
-
Published as `@thekestongroup/ui`.
|
|
5
|
+
Published as `@thekestongroup/ui`. Docs and Storybook: https://ui.keston.co.
|
|
6
6
|
|
|
7
7
|
## Getting started
|
|
8
8
|
|
|
@@ -111,11 +111,20 @@ Versions follow [semver](https://semver.org): **patch** = bug fix,
|
|
|
111
111
|
prop, component or token).
|
|
112
112
|
|
|
113
113
|
1. With each change, run `pnpm changeset` and commit the file it creates.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
Merging only collects changes: nothing is released yet.
|
|
115
|
+
2. When you want a release, run the **Release** workflow: Actions → Release →
|
|
116
|
+
Run workflow, or:
|
|
117
|
+
|
|
118
|
+
```sh
|
|
119
|
+
gh workflow run release.yml -R thekestongroup/ui
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
It tests and builds, works out the version from the changesets waiting,
|
|
123
|
+
updates `package.json` and `CHANGELOG.md`, commits and tags that on
|
|
124
|
+
`main`, and creates a GitHub Release. Then it starts the **Publish**
|
|
125
|
+
workflow, which stages the release on npm (trusted publishing, no token
|
|
126
|
+
needed). With no changesets waiting, it stops without releasing.
|
|
127
|
+
3. Approve the staged release on npmjs.com to make it live.
|
|
128
|
+
|
|
129
|
+
If staging on npm fails, run **Publish** again by hand on the release's tag
|
|
130
|
+
(e.g. `v0.4.0`); it skips a version that's already on npm.
|
|
@@ -28,6 +28,8 @@ import { SidebarItem, SidebarProps } from '../Sidebar/Sidebar.vue';
|
|
|
28
28
|
export interface AppShellProps {
|
|
29
29
|
/** Name of the app, shown in the header and as the mobile menu's title. */
|
|
30
30
|
title?: string;
|
|
31
|
+
/** Make the header's title a link, e.g. to the app's dashboard (`to` for `linkComponent`, or an href). */
|
|
32
|
+
titleTo?: unknown;
|
|
31
33
|
/** The signed-in user, for the account menu. Without it, Sign in is shown. */
|
|
32
34
|
user?: HeaderUser;
|
|
33
35
|
/** Which actions the account menu offers. Default all three. */
|
|
@@ -40,10 +42,10 @@ export interface AppShellProps {
|
|
|
40
42
|
sections?: SidebarProps['sections'];
|
|
41
43
|
/** Wide screens: show the header's menu button, which collapses the sidebar to icons. */
|
|
42
44
|
collapsible?: boolean;
|
|
43
|
-
/** Component used for sidebar items with `to`, e.g. RouterLink. */
|
|
45
|
+
/** Component used for sidebar items with `to`, and the title link, e.g. RouterLink. */
|
|
44
46
|
linkComponent?: SidebarProps['linkComponent'];
|
|
45
47
|
/** Other Header props, e.g. `{ ui: { title: '…' } }`. */
|
|
46
|
-
header?: Omit<HeaderProps, 'title' | 'menu' | 'menuOpen' | 'sticky' | 'user' | 'userActions' | 'signIn'>;
|
|
48
|
+
header?: Omit<HeaderProps, 'title' | 'titleTo' | 'linkComponent' | 'menu' | 'menuOpen' | 'sticky' | 'user' | 'userActions' | 'signIn'>;
|
|
47
49
|
/** Other Sidebar props, e.g. `{ label: 'Admissions' }`. */
|
|
48
50
|
sidebar?: Omit<SidebarProps, 'items' | 'sections' | 'collapsible' | 'linkComponent'>;
|
|
49
51
|
class?: HTMLAttributes['class'];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component, HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* What to show where a list, table or panel has nothing in it yet: an icon,
|
|
4
|
+
* a short title, a line of explanation, and optionally what to do about it
|
|
5
|
+
* (e.g. a Button). "No connected apps", "You're all caught up", "No
|
|
6
|
+
* applications yet".
|
|
7
|
+
*
|
|
8
|
+
* Slots: title, description, actions (under the text, e.g. a Button),
|
|
9
|
+
* default (anything else, under the description). To animate the icon, pass
|
|
10
|
+
* classes in `ui.icon`.
|
|
11
|
+
*/
|
|
12
|
+
export interface EmptyStateProps {
|
|
13
|
+
/** Short and specific, e.g. "No connected apps". */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** What this space is for, or what to do next. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** A Lucide (or any) icon component, shown above the title. */
|
|
18
|
+
icon?: Component;
|
|
19
|
+
/**
|
|
20
|
+
* Make the title a heading, at this level, to fit the page outline (e.g. 2
|
|
21
|
+
* when it fills a page's main area). Without it the title is plain text,
|
|
22
|
+
* as in a panel or table that already has a heading.
|
|
23
|
+
*/
|
|
24
|
+
headingLevel?: 2 | 3 | 4;
|
|
25
|
+
/**
|
|
26
|
+
* - sm: compact, for panels, popovers and tables.
|
|
27
|
+
* - md (default): for a Card or a page's main area.
|
|
28
|
+
*/
|
|
29
|
+
size?: 'sm' | 'md';
|
|
30
|
+
class?: HTMLAttributes['class'];
|
|
31
|
+
/** Extra classes for the parts. */
|
|
32
|
+
ui?: {
|
|
33
|
+
icon?: HTMLAttributes['class'];
|
|
34
|
+
title?: HTMLAttributes['class'];
|
|
35
|
+
description?: HTMLAttributes['class'];
|
|
36
|
+
actions?: HTMLAttributes['class'];
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
type __VLS_Slots = {
|
|
40
|
+
default?(): unknown;
|
|
41
|
+
title?(): unknown;
|
|
42
|
+
description?(): unknown;
|
|
43
|
+
actions?(): unknown;
|
|
44
|
+
};
|
|
45
|
+
declare const __VLS_base: import('vue').DefineComponent<EmptyStateProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmptyStateProps> & Readonly<{}>, {
|
|
46
|
+
size: "sm" | "md";
|
|
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
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'vue';
|
|
1
|
+
import { Component, HTMLAttributes } from 'vue';
|
|
2
2
|
export interface HeaderUser {
|
|
3
3
|
name: string;
|
|
4
4
|
email?: string;
|
|
@@ -24,6 +24,13 @@ export type HeaderUserAction = 'account-settings' | 'switch-account' | 'log-out'
|
|
|
24
24
|
export interface HeaderProps {
|
|
25
25
|
/** Name of the app or area, shown next to the menu button. */
|
|
26
26
|
title?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Make the title a link, e.g. to the app's dashboard: passed as `to` to
|
|
29
|
+
* `linkComponent` (e.g. a route), or as `href` without one.
|
|
30
|
+
*/
|
|
31
|
+
titleTo?: unknown;
|
|
32
|
+
/** Component for the title link, e.g. RouterLink. It receives `to`. Default a plain `<a href>`. */
|
|
33
|
+
linkComponent?: string | Component;
|
|
27
34
|
/**
|
|
28
35
|
* Show the menu button, which emits `menu` when pressed. Hide it on wide
|
|
29
36
|
* screens with `ui.menu`, e.g. `{ menu: 'lg:hidden' }`.
|
|
@@ -89,6 +96,7 @@ declare const __VLS_base: import('vue').DefineComponent<HeaderProps, {}, {}, {},
|
|
|
89
96
|
}>, {
|
|
90
97
|
menu: boolean;
|
|
91
98
|
sticky: boolean;
|
|
99
|
+
linkComponent: string | Component;
|
|
92
100
|
menuOpen: boolean;
|
|
93
101
|
menuLabel: string;
|
|
94
102
|
userActions: HeaderUserAction[];
|
|
@@ -91,10 +91,10 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
91
91
|
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
92
92
|
}>, {
|
|
93
93
|
label: string;
|
|
94
|
+
linkComponent: string | Component;
|
|
94
95
|
items: SidebarItem[];
|
|
95
96
|
sections: SidebarSection[];
|
|
96
97
|
collapsible: boolean;
|
|
97
|
-
linkComponent: string | Component;
|
|
98
98
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
99
99
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
100
100
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'vue';
|
|
1
|
+
import { Component, HTMLAttributes } from 'vue';
|
|
2
2
|
import { TableColumn, TableSort } from './table';
|
|
3
3
|
/**
|
|
4
4
|
* Rows of data with column headings: applicants, classes, invoices.
|
|
@@ -13,6 +13,11 @@ import { TableColumn, TableSort } from './table';
|
|
|
13
13
|
* `manualSort` it only reports the sort (`v-model:sort`) so you can sort on
|
|
14
14
|
* the server.
|
|
15
15
|
*
|
|
16
|
+
* Clickable rows: `rowLink` gives each row a page to go to. The row-header
|
|
17
|
+
* cell (or the first column) becomes a real link, stretched over the whole
|
|
18
|
+
* row, so the row highlights on hover and a click anywhere on it follows the
|
|
19
|
+
* link. Buttons and links in other cells still work on their own.
|
|
20
|
+
*
|
|
16
21
|
* Slots: cell-{key}, header-{key}, empty, footer (rows for a `<tfoot>`,
|
|
17
22
|
* e.g. totals), caption.
|
|
18
23
|
*/
|
|
@@ -37,6 +42,14 @@ export interface TableProps<Row = Record<string, any>> {
|
|
|
37
42
|
stickyHeader?: boolean;
|
|
38
43
|
/** Don't sort the rows: just update `sort`, e.g. to sort on the server. */
|
|
39
44
|
manualSort?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Where each row goes when clicked: passed as `to` to `linkComponent`
|
|
47
|
+
* (e.g. a route), or as `href` without one. Return undefined for rows that
|
|
48
|
+
* don't go anywhere.
|
|
49
|
+
*/
|
|
50
|
+
rowLink?: (row: Row, index: number) => unknown;
|
|
51
|
+
/** Component for row links, e.g. RouterLink. It receives `to`. Default a plain `<a href>`. */
|
|
52
|
+
linkComponent?: string | Component;
|
|
40
53
|
class?: HTMLAttributes['class'];
|
|
41
54
|
ui?: {
|
|
42
55
|
table?: HTMLAttributes['class'];
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export { default as RelativeTime } from './components/RelativeTime/RelativeTime.
|
|
|
61
61
|
export type { RelativeTimeProps } from './components/RelativeTime/RelativeTime.vue';
|
|
62
62
|
export { default as Age } from './components/Age/Age.vue';
|
|
63
63
|
export type { AgeProps } from './components/Age/Age.vue';
|
|
64
|
+
export { default as EmptyState } from './components/EmptyState/EmptyState.vue';
|
|
65
|
+
export type { EmptyStateProps } from './components/EmptyState/EmptyState.vue';
|
|
64
66
|
export { default as Breadcrumb } from './components/Breadcrumb/Breadcrumb.vue';
|
|
65
67
|
export type { BreadcrumbProps, BreadcrumbItem } from './components/Breadcrumb/Breadcrumb.vue';
|
|
66
68
|
export { default as Sidebar } from './components/Sidebar/Sidebar.vue';
|