@thekestongroup/ui 0.2.0 → 0.3.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 (207) hide show
  1. package/README.md +90 -32
  2. package/dist/components/Age/Age.vue.d.ts +19 -0
  3. package/dist/components/AppShell/AppShell.vue.d.ts +108 -0
  4. package/dist/components/Avatar/Avatar.vue.d.ts +34 -0
  5. package/dist/components/AvatarGroup/AvatarGroup.vue.d.ts +25 -0
  6. package/dist/components/Badge/Badge.vue.d.ts +41 -0
  7. package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +39 -0
  8. package/dist/components/Button/Button.vue.d.ts +69 -0
  9. package/dist/components/Calendar/Calendar.vue.d.ts +34 -0
  10. package/dist/components/Card/Card.vue.d.ts +56 -0
  11. package/dist/components/Checkbox/Checkbox.vue.d.ts +40 -0
  12. package/dist/components/Checklist/Checklist.vue.d.ts +18 -0
  13. package/dist/components/Chip/Chip.vue.d.ts +44 -0
  14. package/dist/components/Divider/Divider.vue.d.ts +36 -0
  15. package/dist/components/{ToastItem.vue.d.ts → FormField/FieldMessage.vue.d.ts} +10 -2
  16. package/dist/components/FormField/FormField.vue.d.ts +61 -0
  17. package/dist/components/Header/Header.vue.d.ts +104 -0
  18. package/dist/components/InfoTip/InfoTip.vue.d.ts +20 -0
  19. package/dist/components/Input/Input.vue.d.ts +56 -0
  20. package/dist/components/InputCode/InputCode.vue.d.ts +53 -0
  21. package/dist/components/InputDate/InputDate.vue.d.ts +49 -0
  22. package/dist/components/InputNumber/InputNumber.vue.d.ts +44 -0
  23. package/dist/components/InputPassword/InputPassword.vue.d.ts +51 -0
  24. package/dist/components/InputRichText/InputRichText.vue.d.ts +44 -0
  25. package/dist/components/Link/Link.vue.d.ts +39 -0
  26. package/dist/components/Notification/Notification.vue.d.ts +62 -0
  27. package/dist/components/Notification/NotificationPane.vue.d.ts +38 -0
  28. package/dist/components/Notification/Toaster.vue.d.ts +51 -0
  29. package/dist/components/Notification/notification.samples.d.ts +3 -0
  30. package/dist/components/Notification/notifications.d.ts +115 -0
  31. package/dist/components/PageHeader/PageHeader.vue.d.ts +43 -0
  32. package/dist/components/Popover/Popover.vue.d.ts +83 -0
  33. package/dist/components/Popover/popover.d.ts +16 -0
  34. package/dist/components/Progress/Progress.vue.d.ts +26 -0
  35. package/dist/components/RadioGroup/RadioGroup.vue.d.ts +45 -0
  36. package/dist/components/RelativeTime/RelativeTime.vue.d.ts +22 -0
  37. package/dist/components/Select/Select.vue.d.ts +110 -0
  38. package/dist/components/Sidebar/Sidebar.vue.d.ts +106 -0
  39. package/dist/components/Sidebar/sidebar.d.ts +10 -0
  40. package/dist/components/Slideover/Slideover.vue.d.ts +125 -0
  41. package/dist/components/Spinner/Spinner.vue.d.ts +30 -0
  42. package/dist/components/StatTile/StatTile.vue.d.ts +46 -0
  43. package/dist/components/SummaryList/SummaryList.vue.d.ts +62 -0
  44. package/dist/components/Switch/Switch.vue.d.ts +39 -0
  45. package/dist/components/Table/Table.vue.d.ts +82 -0
  46. package/dist/components/Table/table.d.ts +36 -0
  47. package/dist/components/Tooltip/Tooltip.vue.d.ts +46 -0
  48. package/dist/index.d.ts +89 -25
  49. package/dist/keston-ui.js +4963 -14785
  50. package/dist/lib/cn.d.ts +4 -0
  51. package/dist/lib/dates.d.ts +27 -0
  52. package/dist/lib/initials.d.ts +2 -0
  53. package/dist/lib/parseDate.d.ts +44 -0
  54. package/dist/lib/useNow.d.ts +3 -0
  55. package/package.json +53 -24
  56. package/src/components/.gitkeep +0 -0
  57. package/src/components/Age/Age.stories.ts +24 -0
  58. package/src/components/Age/Age.vue +56 -0
  59. package/src/components/AppShell/AppShell.stories.ts +124 -0
  60. package/src/components/AppShell/AppShell.vue +212 -0
  61. package/src/components/Avatar/Avatar.stories.ts +56 -0
  62. package/src/components/Avatar/Avatar.vue +118 -0
  63. package/src/components/AvatarGroup/AvatarGroup.stories.ts +47 -0
  64. package/src/components/AvatarGroup/AvatarGroup.vue +97 -0
  65. package/src/components/Badge/Badge.stories.ts +92 -0
  66. package/src/components/Badge/Badge.vue +67 -0
  67. package/src/components/Breadcrumb/Breadcrumb.stories.ts +58 -0
  68. package/src/components/Breadcrumb/Breadcrumb.vue +109 -0
  69. package/src/components/Button/Button.mdx +79 -0
  70. package/src/components/Button/Button.stories.ts +207 -0
  71. package/src/components/Button/Button.vue +266 -0
  72. package/src/components/Calendar/Calendar.stories.ts +51 -0
  73. package/src/components/Calendar/Calendar.vue +364 -0
  74. package/src/components/Card/Card.stories.ts +109 -0
  75. package/src/components/Card/Card.vue +115 -0
  76. package/src/components/Checkbox/Checkbox.stories.ts +102 -0
  77. package/src/components/Checkbox/Checkbox.vue +102 -0
  78. package/src/components/Checklist/Checklist.stories.ts +67 -0
  79. package/src/components/Checklist/Checklist.vue +38 -0
  80. package/src/components/Chip/Chip.stories.ts +71 -0
  81. package/src/components/Chip/Chip.vue +86 -0
  82. package/src/components/Divider/Divider.stories.ts +57 -0
  83. package/src/components/Divider/Divider.vue +58 -0
  84. package/src/components/FormField/FieldMessage.vue +81 -0
  85. package/src/components/FormField/FormField.stories.ts +55 -0
  86. package/src/components/FormField/FormField.vue +160 -0
  87. package/src/components/Header/Header.stories.ts +168 -0
  88. package/src/components/Header/Header.vue +232 -0
  89. package/src/components/InfoTip/InfoTip.stories.ts +63 -0
  90. package/src/components/InfoTip/InfoTip.vue +50 -0
  91. package/src/components/Input/Input.stories.ts +206 -0
  92. package/src/components/Input/Input.vue +90 -0
  93. package/src/components/InputCode/InputCode.stories.ts +85 -0
  94. package/src/components/InputCode/InputCode.vue +145 -0
  95. package/src/components/InputDate/InputDate.stories.ts +58 -0
  96. package/src/components/InputDate/InputDate.vue +258 -0
  97. package/src/components/InputNumber/InputNumber.stories.ts +63 -0
  98. package/src/components/InputNumber/InputNumber.vue +109 -0
  99. package/src/components/InputPassword/InputPassword.stories.ts +105 -0
  100. package/src/components/InputPassword/InputPassword.vue +132 -0
  101. package/src/components/InputRichText/InputRichText.stories.ts +100 -0
  102. package/src/components/InputRichText/InputRichText.vue +194 -0
  103. package/src/components/Link/Link.stories.ts +73 -0
  104. package/src/components/Link/Link.vue +56 -0
  105. package/src/components/Notification/Notification.stories.ts +196 -0
  106. package/src/components/Notification/Notification.vue +136 -0
  107. package/src/components/Notification/NotificationPane.vue +187 -0
  108. package/src/components/Notification/Toaster.vue +446 -0
  109. package/src/components/Notification/notification.samples.ts +45 -0
  110. package/src/components/Notification/notifications.test.ts +99 -0
  111. package/src/components/Notification/notifications.ts +172 -0
  112. package/src/components/PageHeader/PageHeader.stories.ts +79 -0
  113. package/src/components/PageHeader/PageHeader.vue +66 -0
  114. package/src/components/Popover/Popover.stories.ts +135 -0
  115. package/src/components/Popover/Popover.vue +192 -0
  116. package/src/components/Popover/popover.ts +20 -0
  117. package/src/components/Progress/Progress.stories.ts +74 -0
  118. package/src/components/Progress/Progress.vue +75 -0
  119. package/src/components/RadioGroup/RadioGroup.stories.ts +90 -0
  120. package/src/components/RadioGroup/RadioGroup.vue +132 -0
  121. package/src/components/RelativeTime/RelativeTime.stories.ts +74 -0
  122. package/src/components/RelativeTime/RelativeTime.vue +51 -0
  123. package/src/components/Select/Select.mdx +202 -0
  124. package/src/components/Select/Select.stories.ts +223 -0
  125. package/src/components/Select/Select.vue +630 -0
  126. package/src/components/Sidebar/Sidebar.stories.ts +192 -0
  127. package/src/components/Sidebar/Sidebar.vue +382 -0
  128. package/src/components/Sidebar/sidebar.ts +20 -0
  129. package/src/components/Slideover/Slideover.stories.ts +225 -0
  130. package/src/components/Slideover/Slideover.vue +365 -0
  131. package/src/components/Spinner/Spinner.stories.ts +79 -0
  132. package/src/components/Spinner/Spinner.vue +97 -0
  133. package/src/components/StatTile/StatTile.stories.ts +75 -0
  134. package/src/components/StatTile/StatTile.vue +89 -0
  135. package/src/components/SummaryList/SummaryList.stories.ts +103 -0
  136. package/src/components/SummaryList/SummaryList.vue +127 -0
  137. package/src/components/Switch/Switch.stories.ts +100 -0
  138. package/src/components/Switch/Switch.vue +96 -0
  139. package/src/components/Table/Table.stories.ts +206 -0
  140. package/src/components/Table/Table.vue +220 -0
  141. package/src/components/Table/table.test.ts +65 -0
  142. package/src/components/Table/table.ts +70 -0
  143. package/src/components/Tooltip/Tooltip.stories.ts +57 -0
  144. package/src/components/Tooltip/Tooltip.vue +86 -0
  145. package/src/examples/AppPages.stories.ts +500 -0
  146. package/src/examples/FormLayout.stories.ts +185 -0
  147. package/src/examples/KestonIdPages.stories.ts +415 -0
  148. package/src/examples/SchoolPages.stories.ts +665 -0
  149. package/src/index.ts +114 -36
  150. package/src/lib/cn.ts +4 -0
  151. package/src/lib/dates.test.ts +68 -0
  152. package/src/lib/dates.ts +86 -0
  153. package/src/lib/initials.ts +8 -0
  154. package/src/lib/parseDate.test.ts +331 -0
  155. package/src/lib/parseDate.ts +561 -0
  156. package/src/lib/useNow.ts +20 -0
  157. package/src/styles/theme.css +101 -0
  158. package/dist/components/AppLauncher.vue.d.ts +0 -10
  159. package/dist/components/Avatar.vue.d.ts +0 -16
  160. package/dist/components/Button.vue.d.ts +0 -27
  161. package/dist/components/Checkbox.vue.d.ts +0 -18
  162. package/dist/components/CloseButton.vue.d.ts +0 -6
  163. package/dist/components/Dialog.vue.d.ts +0 -23
  164. package/dist/components/Drawer.vue.d.ts +0 -34
  165. package/dist/components/DropdownMenu.vue.d.ts +0 -21
  166. package/dist/components/DropdownMenuItem.vue.d.ts +0 -19
  167. package/dist/components/DropdownMenuSeparator.vue.d.ts +0 -6
  168. package/dist/components/Input.vue.d.ts +0 -14
  169. package/dist/components/Label.vue.d.ts +0 -16
  170. package/dist/components/NotificationsMenu.vue.d.ts +0 -3
  171. package/dist/components/Popover.vue.d.ts +0 -23
  172. package/dist/components/ProfileSwitcher.vue.d.ts +0 -24
  173. package/dist/components/Select.vue.d.ts +0 -28
  174. package/dist/components/Separator.vue.d.ts +0 -11
  175. package/dist/components/ToastRenderer.vue.d.ts +0 -3
  176. package/dist/components/Toaster.vue.d.ts +0 -3
  177. package/dist/components/Tooltip.vue.d.ts +0 -23
  178. package/dist/components/TopBar.vue.d.ts +0 -34
  179. package/dist/favicon-old.svg +0 -1
  180. package/dist/favicon.svg +0 -1
  181. package/dist/keston-ui.cjs +0 -15
  182. package/dist/lib/toast.d.ts +0 -29
  183. package/dist/lib/types.d.ts +0 -5
  184. package/src/components/AppLauncher.vue +0 -63
  185. package/src/components/Avatar.vue +0 -51
  186. package/src/components/Button.vue +0 -54
  187. package/src/components/Checkbox.vue +0 -47
  188. package/src/components/CloseButton.vue +0 -24
  189. package/src/components/Dialog.vue +0 -65
  190. package/src/components/Drawer.vue +0 -202
  191. package/src/components/DropdownMenu.vue +0 -41
  192. package/src/components/DropdownMenuItem.vue +0 -28
  193. package/src/components/DropdownMenuSeparator.vue +0 -12
  194. package/src/components/Input.vue +0 -21
  195. package/src/components/Label.vue +0 -15
  196. package/src/components/NotificationsMenu.vue +0 -115
  197. package/src/components/Popover.vue +0 -46
  198. package/src/components/ProfileSwitcher.vue +0 -113
  199. package/src/components/Select.vue +0 -97
  200. package/src/components/Separator.vue +0 -30
  201. package/src/components/ToastItem.vue +0 -158
  202. package/src/components/ToastRenderer.vue +0 -113
  203. package/src/components/Toaster.vue +0 -11
  204. package/src/components/Tooltip.vue +0 -48
  205. package/src/components/TopBar.vue +0 -52
  206. package/src/lib/toast.ts +0 -95
  207. package/src/lib/types.ts +0 -5
package/README.md CHANGED
@@ -1,63 +1,121 @@
1
1
  # Keston UI
2
2
 
3
- Vue 3 + [Reka UI](https://reka-ui.com) + [Tailwind CSS](https://tailwindcss.com) component library for the Keston product suite. Published as `@thekestongroup/ui`.
3
+ The component library for every Keston product. Built with Vue 3, [Reka UI](https://reka-ui.com)
4
+ (behaviour and accessibility) and [Tailwind CSS v4](https://tailwindcss.com) (styling).
5
+ Published as `@thekestongroup/ui`.
4
6
 
5
- ## Development
7
+ ## Getting started
6
8
 
7
9
  ```sh
8
10
  pnpm install
9
11
  pnpm dev
10
12
  ```
11
13
 
12
- `pnpm dev` serves `demo/App.vue` at `http://localhost:5173` with Vite HMR — edit any component in `src/components/` and the page hot-reloads instantly.
14
+ `pnpm dev` opens Storybook at http://localhost:6006. Every component has a live
15
+ playground with controls for its props, plus a docs page.
13
16
 
14
- ## Scripts
17
+ ## Creating a component
18
+
19
+ ```sh
20
+ pnpm new Button Element
21
+ ```
22
+
23
+ The second argument is the component's group. Components are grouped as in
24
+ [Nuxt UI](https://ui.nuxt.com/components), in Storybook's sidebar and in
25
+ `src/index.ts`:
26
+
27
+ | Group | For |
28
+ |---|---|
29
+ | Layout | The frame of an app: AppShell, Header, PageHeader |
30
+ | Element | Small building blocks: Button, Badge, Avatar, Card, Chip, Divider, Spinner |
31
+ | Form | Anything people fill in or choose with: Input, Select, Checkbox, RadioGroup, Switch, Calendar, FormField |
32
+ | Data | Showing information: Table, StatTile, SummaryList, Checklist, RelativeTime, Age |
33
+ | Navigation | Moving around: Breadcrumb, Sidebar |
34
+ | Overlay | Things that float over the page: Popover, Slideover, Tooltip, InfoTip, Notification |
35
+
36
+ Component folders stay flat (`src/components/<Name>/`); the group only sets
37
+ where the component appears.
38
+
39
+ This creates:
40
+
41
+ | File | Purpose |
42
+ |---|---|
43
+ | `src/components/Button/Button.vue` | The component (starts unstyled) |
44
+ | `src/components/Button/Button.stories.ts` | Storybook playground |
45
+ | `specs/button.md` | Platform-neutral spec: anatomy, sizes, states, rules |
46
+
47
+ and exports it from `src/index.ts`, at the end of its group. Props you add to the component appear in
48
+ Storybook's Controls panel automatically.
15
49
 
16
- | Command | Description |
17
- | ----------------- | --------------------------------------------- |
18
- | `pnpm dev` | Live demo with hot module reload |
19
- | `pnpm build` | Type-check and build the library to `dist/` |
20
- | `pnpm typecheck` | Type-check only |
21
- | `pnpm preview` | Preview the built demo |
50
+ Each component is done when:
51
+
52
+ 1. The spec in `specs/` is filled in.
53
+ 2. It uses tokens from `src/styles/theme.css`, not hard-coded values, where a token exists.
54
+ 3. Its story covers every variant, size and state.
55
+ 4. It works in dark mode, with a keyboard, and at phone width, with no issues in Storybook's Accessibility panel.
56
+ 5. A changeset is added (`pnpm changeset`).
22
57
 
23
58
  ## Structure
24
59
 
25
- - `src/` — the published component library (Reka UI primitives styled with Tailwind)
26
- - `demo/` — the development playground (not published)
60
+ ```
61
+ src/
62
+ components/ one folder per component (.vue + .stories.ts)
63
+ lib/ shared helpers (cn)
64
+ styles/ theme.css — the Tailwind @theme tokens
65
+ index.ts public exports
66
+ specs/ platform-neutral component specs (+ _template.md)
67
+ tokens/ token notes; later the cross-platform token source
68
+ docs/ Storybook docs pages (.mdx)
69
+ scripts/ pnpm new
70
+ .storybook/ Storybook config
71
+ .changeset/ pending release notes
72
+ ```
73
+
74
+ ## Scripts
27
75
 
28
- ## Consuming the library
76
+ | Command | Description |
77
+ |---|---|
78
+ | `pnpm dev` | Storybook with hot reload |
79
+ | `pnpm new <Name> <Group>` | Scaffold a component, story and spec |
80
+ | `pnpm build` | Type-check and build the library to `dist/` |
81
+ | `pnpm typecheck` | Type-check only |
82
+ | `pnpm build-storybook` | Build Storybook as a static site |
83
+ | `pnpm changeset` | Record a change for the next release |
84
+
85
+ ## Using the library in an app
29
86
 
30
87
  ```sh
31
88
  pnpm add @thekestongroup/ui
32
89
  ```
33
90
 
34
- Components are styled with Tailwind utility classes, so each consuming app must tell Tailwind to scan the library source:
91
+ In the app's main CSS file:
35
92
 
36
93
  ```css
37
94
  @import "tailwindcss";
38
- @source "../node_modules/@thekestongroup/ui/src";
95
+ @import "@thekestongroup/ui/theme.css";
39
96
  ```
40
97
 
41
- Some components (e.g. the `Drawer`) also ship a small amount of CSS for animation keyframes. Import it once in your app entry:
98
+ `theme.css` adds the Keston tokens and tells Tailwind to scan the library's
99
+ components for classes. Then:
42
100
 
43
- ```ts
44
- import '@thekestongroup/ui/style.css'
101
+ ```vue
102
+ <script setup lang="ts">
103
+ import { Button } from '@thekestongroup/ui'
104
+ </script>
45
105
  ```
46
106
 
47
- ## Publishing
48
-
49
- Publishing is done **manually** (no CI auto-publish), to the public npm registry.
107
+ ## Releasing
50
108
 
51
- ```sh
52
- # 1. Bump the version
53
- npm version patch # or minor / major
109
+ Versions follow [semver](https://semver.org): **patch** = bug fix,
110
+ **minor** = something new, **major** = breaking change (renamed or removed
111
+ prop, component or token).
54
112
 
55
- # 2. Build and publish (public)
56
- pnpm build
57
- pnpm publish --no-git-checks --access public
58
- ```
113
+ 1. With each change, run `pnpm changeset` and commit the file it creates.
114
+ 2. On `main`, the **Release** workflow opens a "Version Packages" pull request
115
+ that bumps the version and updates `CHANGELOG.md`.
116
+ 3. Merging that pull request triggers the **Publish** workflow, which stages
117
+ the release on npm (trusted publishing, no token needed).
118
+ 4. Approve the staged release on npmjs.com to make it live.
59
119
 
60
- `--access public` is required because scoped packages (`@scope/name`) default to
61
- private on npm. `pnpm publish` reads the registry + access defaults from
62
- `publishConfig` in `package.json`, but you'll still need to be logged in
63
- (`npm login`) or pass `--//registry.npmjs.org/:_authToken=YOUR_TOKEN`.
120
+ The Release workflow needs **Settings → Actions → General → Allow GitHub
121
+ Actions to create and approve pull requests** turned on.
@@ -0,0 +1,19 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { DateInput } from '../../lib/dates';
3
+ /**
4
+ * Someone's age, "13", with their date of birth in a tooltip on hover or
5
+ * focus: "Born 14 March 2013", plus "Birthday today" or "Birthday in 3 days"
6
+ * when it's within a week (handy for teachers).
7
+ */
8
+ export interface AgeProps {
9
+ /** Date of birth: a Date, an ISO string ("2013-03-14"), or a timestamp. */
10
+ birthDate: DateInput;
11
+ /** Text after the number: "years" gives "13 years". Leave out for just "13" (e.g. in an "Age" column). */
12
+ suffix?: string;
13
+ /** What "today" is, e.g. for tests. Default the live date. */
14
+ now?: Date;
15
+ class?: HTMLAttributes['class'];
16
+ }
17
+ declare const __VLS_export: import('vue').DefineComponent<AgeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AgeProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -0,0 +1,108 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { HeaderProps, HeaderUser, HeaderUserAction } from '../Header/Header.vue';
3
+ import { SidebarItem, SidebarProps } from '../Sidebar/Sidebar.vue';
4
+ /**
5
+ * The layout of a whole app page: the Header across the top, the app's
6
+ * Sidebar down the left, and the page in the middle. Every app uses this, so
7
+ * the header looks and behaves the same everywhere; only the sidebar's items
8
+ * and the page change.
9
+ *
10
+ * - Wide screens (lg and up): the sidebar sits beside the page, and the
11
+ * header's menu button collapses it to icons and back (unless
12
+ * `collapsible` is false).
13
+ * - Narrow screens: the sidebar is hidden and the menu button opens it in a
14
+ * Slideover from the left, whose title bar is the header's height. Choosing
15
+ * an item, or the screen becoming wide, closes it.
16
+ * - The page itself scrolls (not an inner box), so the header stays at the
17
+ * top (sticky), the sidebar stays put below it, and mobile browsers can
18
+ * hide their address bar while scrolling.
19
+ *
20
+ * The account menu (top right) is the Header's: pass `user` and listen for
21
+ * account-settings, switch-account, log-out (and sign-in when signed out).
22
+ *
23
+ * Slots: default (the page), header-leading, header-middle, header-trailing,
24
+ * account, account-menu (passed to Header), sidebar-header and sidebar-footer (passed to Sidebar;
25
+ * sidebar-header is only shown on wide screens, as the Slideover has its own
26
+ * title).
27
+ */
28
+ export interface AppShellProps {
29
+ /** Name of the app, shown in the header and as the mobile menu's title. */
30
+ title?: string;
31
+ /** The signed-in user, for the account menu. Without it, Sign in is shown. */
32
+ user?: HeaderUser;
33
+ /** Which actions the account menu offers. Default all three. */
34
+ userActions?: HeaderUserAction[];
35
+ /** Show Sign in when there is no user. */
36
+ signIn?: boolean;
37
+ /** Sidebar items in a single section. */
38
+ items?: SidebarItem[];
39
+ /** Sidebar items in labelled sections. */
40
+ sections?: SidebarProps['sections'];
41
+ /** Wide screens: show the header's menu button, which collapses the sidebar to icons. */
42
+ collapsible?: boolean;
43
+ /** Component used for sidebar items with `to`, e.g. RouterLink. */
44
+ linkComponent?: SidebarProps['linkComponent'];
45
+ /** Other Header props, e.g. `{ ui: { title: '…' } }`. */
46
+ header?: Omit<HeaderProps, 'title' | 'menu' | 'menuOpen' | 'sticky' | 'user' | 'userActions' | 'signIn'>;
47
+ /** Other Sidebar props, e.g. `{ label: 'Admissions' }`. */
48
+ sidebar?: Omit<SidebarProps, 'items' | 'sections' | 'collapsible' | 'linkComponent'>;
49
+ class?: HTMLAttributes['class'];
50
+ /** Extra classes for the parts. */
51
+ ui?: {
52
+ main?: HTMLAttributes['class'];
53
+ };
54
+ }
55
+ type __VLS_Props = AppShellProps;
56
+ type __VLS_Slots = {
57
+ default?(): unknown;
58
+ 'header-leading'?(): unknown;
59
+ 'header-middle'?(): unknown;
60
+ 'header-trailing'?(): unknown;
61
+ account?(): unknown;
62
+ 'account-menu'?(props: {
63
+ close: () => void;
64
+ }): unknown;
65
+ 'sidebar-header'?(props: {
66
+ collapsed: boolean;
67
+ }): unknown;
68
+ 'sidebar-footer'?(props: {
69
+ collapsed: boolean;
70
+ mobile: boolean;
71
+ }): unknown;
72
+ };
73
+ type __VLS_ModelProps = {
74
+ /** Sidebar collapsed to icons (wide screens). Use v-model:collapsed to keep it, e.g. in localStorage. */
75
+ 'collapsed'?: boolean;
76
+ /** Mobile menu open. Optional: use v-model:menu-open to control it. */
77
+ 'menuOpen'?: boolean;
78
+ };
79
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
80
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
81
+ "account-settings": () => any;
82
+ "switch-account": () => any;
83
+ "log-out": () => any;
84
+ "sign-in": () => any;
85
+ "update:collapsed": (value: boolean) => any;
86
+ "update:menuOpen": (value: boolean) => any;
87
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
88
+ "onAccount-settings"?: (() => any) | undefined;
89
+ "onSwitch-account"?: (() => any) | undefined;
90
+ "onLog-out"?: (() => any) | undefined;
91
+ "onSign-in"?: (() => any) | undefined;
92
+ "onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
93
+ "onUpdate:menuOpen"?: ((value: boolean) => any) | undefined;
94
+ }>, {
95
+ userActions: HeaderUserAction[];
96
+ signIn: boolean;
97
+ items: SidebarItem[];
98
+ sections: import('../..').SidebarSection[];
99
+ collapsible: boolean;
100
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
101
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
102
+ declare const _default: typeof __VLS_export;
103
+ export default _default;
104
+ type __VLS_WithSlots<T, S> = T & {
105
+ new (): {
106
+ $slots: S;
107
+ };
108
+ };
@@ -0,0 +1,34 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ export interface AvatarUser {
3
+ name: string;
4
+ /** Picture URL. Initials are shown without one, or if it fails to load. */
5
+ avatar?: string;
6
+ /** Job or role, e.g. "Head of Year 9". Shown in the profile. */
7
+ role?: string;
8
+ email?: string;
9
+ /** Organisation or school, shown in the profile. */
10
+ organisation?: string;
11
+ }
12
+ /**
13
+ * A person's picture, or their initials on a primary circle. With `profile`,
14
+ * it becomes a button that shows a small profile card (name, role, email,
15
+ * organisation) on hover, and on click, tap or Enter, so it works on touch
16
+ * screens and from the keyboard.
17
+ *
18
+ * Several people overlapping: use AvatarGroup.
19
+ */
20
+ export interface AvatarProps {
21
+ user: AvatarUser;
22
+ /** 20 / 28 / 36 / 48 / 64px. */
23
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
24
+ /** Show a profile card on hover / press. Makes the avatar a button. */
25
+ profile?: boolean;
26
+ /** Hidden from screen readers, when the name is already said nearby (e.g. in a labelled button). */
27
+ decorative?: boolean;
28
+ class?: HTMLAttributes['class'];
29
+ }
30
+ declare const __VLS_export: import('vue').DefineComponent<AvatarProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AvatarProps> & Readonly<{}>, {
31
+ size: "sm" | "md" | "lg" | "xs" | "xl";
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
33
+ declare const _default: typeof __VLS_export;
34
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { AvatarProps, AvatarUser } from '../Avatar/Avatar.vue';
3
+ /**
4
+ * Several people as overlapping avatars, e.g. a class's teachers or who's
5
+ * been sent a message. Each shows its profile on hover (or press). Past
6
+ * `max`, the rest are a "+N" circle that lists them.
7
+ */
8
+ export interface AvatarGroupProps {
9
+ users: AvatarUser[];
10
+ size?: AvatarProps['size'];
11
+ /** Avatars shown before "+N". */
12
+ max?: number;
13
+ /** Profile card on each avatar. */
14
+ profile?: boolean;
15
+ /** Name of the group for screen readers. Default "{n} people". */
16
+ label?: string;
17
+ class?: HTMLAttributes['class'];
18
+ }
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
+ size: "sm" | "md" | "lg" | "xs" | "xl";
22
+ profile: boolean;
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: typeof __VLS_export;
25
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ /**
3
+ * A small label for a status, count or category, e.g. "Active", "3", "Year 9".
4
+ * Not interactive: for something people can press, use a Button.
5
+ *
6
+ * Slots: default (the text), leading and trailing (e.g. an icon).
7
+ */
8
+ export interface BadgeProps {
9
+ /**
10
+ * Colour, by meaning:
11
+ * - basic: neutral information, e.g. a category or count
12
+ * - primary: emphasis, e.g. "New"
13
+ * - green: positive / done, e.g. "Paid"
14
+ * - blue: informational, e.g. "In progress"
15
+ * - yellow: needs attention, e.g. "Due soon"
16
+ * - red: a problem, e.g. "Overdue"
17
+ *
18
+ * Colour alone doesn't carry meaning for everyone, so the text should say
19
+ * it too.
20
+ */
21
+ color?: 'basic' | 'primary' | 'red' | 'green' | 'blue' | 'yellow';
22
+ size?: 'sm' | 'md' | 'lg';
23
+ class?: HTMLAttributes['class'];
24
+ }
25
+ type __VLS_Slots = {
26
+ default?(): unknown;
27
+ leading?(): unknown;
28
+ trailing?(): unknown;
29
+ };
30
+ declare const __VLS_base: import('vue').DefineComponent<BadgeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BadgeProps> & Readonly<{}>, {
31
+ size: "sm" | "md" | "lg";
32
+ color: "basic" | "primary" | "red" | "green" | "blue" | "yellow";
33
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
34
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
37
+ type __VLS_WithSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -0,0 +1,39 @@
1
+ import { Component, HTMLAttributes } from 'vue';
2
+ export interface BreadcrumbItem {
3
+ label: string;
4
+ /** A Lucide (or any) icon component, shown before the label. */
5
+ icon?: Component;
6
+ /** Link with a plain <a href>. */
7
+ href?: string;
8
+ /** Link through `linkComponent` (e.g. RouterLink), which receives `to`. */
9
+ to?: unknown;
10
+ /** Called when the step is chosen (for steps that aren't links). */
11
+ onSelect?: (event: MouseEvent) => void;
12
+ }
13
+ /**
14
+ * Where the current page is: its parents, then the page itself, e.g.
15
+ * School › School Structure › New School Year Setup. Earlier steps with a
16
+ * `href`, `to` or `onSelect` are links back; steps without are plain text
17
+ * (e.g. a group that isn't a page itself). The last step is the current page.
18
+ *
19
+ * SidebarItems fit, so it can follow a nested Sidebar:
20
+ * `<Breadcrumb :items="sidebarTrail(items, sections)" />`.
21
+ */
22
+ export interface BreadcrumbProps {
23
+ items: BreadcrumbItem[];
24
+ /** Accessible name of the navigation landmark. */
25
+ label?: string;
26
+ /** Component used for steps with `to`, e.g. RouterLink or NuxtLink. */
27
+ linkComponent?: string | Component;
28
+ class?: HTMLAttributes['class'];
29
+ }
30
+ declare const __VLS_export: import('vue').DefineComponent<BreadcrumbProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
31
+ select: (item: BreadcrumbItem, event: MouseEvent) => any;
32
+ }, string, import('vue').PublicProps, Readonly<BreadcrumbProps> & Readonly<{
33
+ onSelect?: ((item: BreadcrumbItem, event: MouseEvent) => any) | undefined;
34
+ }>, {
35
+ label: string;
36
+ linkComponent: string | Component;
37
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
38
+ declare const _default: typeof __VLS_export;
39
+ export default _default;
@@ -0,0 +1,69 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { PrimitiveProps } from 'reka-ui';
3
+ export type ButtonStatus = 'idle' | 'loading' | 'success' | 'error';
4
+ export interface ButtonProps extends PrimitiveProps {
5
+ /**
6
+ * What the button is for:
7
+ * - primary: the main action (one per area), e.g. Save
8
+ * - basic: other actions, e.g. Cancel, Export
9
+ * - ghost: low-emphasis actions, e.g. toolbar and icon buttons, × on panels
10
+ * - danger: destructive actions, e.g. Delete
11
+ */
12
+ variant?: 'basic' | 'primary' | 'ghost' | 'danger';
13
+ size?: 'sm' | 'md' | 'lg';
14
+ /**
15
+ * Icon-only button: as tall as a normal button of the same size and just as
16
+ * wide, so the icon has equal space on every side. Give it an `aria-label`
17
+ * (e.g. "Close"), as there is no text to name it.
18
+ */
19
+ square?: boolean;
20
+ disabled?: boolean;
21
+ type?: 'button' | 'submit' | 'reset';
22
+ /**
23
+ * Progress of the action this button starts. The parent sets it; use
24
+ * `v-model:status` so the button can return itself to `idle` after showing
25
+ * success or error. Not supported with `asChild`.
26
+ */
27
+ status?: ButtonStatus;
28
+ /** Text shown next to the spinner while loading. Icon only if not set. */
29
+ loadingText?: string;
30
+ /** Text shown next to the check on success. Icon only if not set. */
31
+ successText?: string;
32
+ /** Text shown next to the cross on error. Icon only if not set. */
33
+ errorText?: string;
34
+ /** How long success / error is shown before returning to idle, in ms. */
35
+ statusDuration?: number;
36
+ class?: HTMLAttributes['class'];
37
+ }
38
+ declare const __VLS_template: () => {
39
+ __VLS_Slots: {
40
+ default?: (props: {}) => any;
41
+ } & {
42
+ leading?: (props: {}) => any;
43
+ } & {
44
+ default?: (props: {}) => any;
45
+ } & {
46
+ trailing?: (props: {}) => any;
47
+ };
48
+ };
49
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
50
+ declare const __VLS_base: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
51
+ "update:status": (status: ButtonStatus) => any;
52
+ }, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{
53
+ "onUpdate:status"?: ((status: ButtonStatus) => any) | undefined;
54
+ }>, {
55
+ size: "sm" | "md" | "lg";
56
+ type: "button" | "submit" | "reset";
57
+ as: import('reka-ui').AsTag | import('vue').Component;
58
+ variant: "basic" | "primary" | "ghost" | "danger";
59
+ status: ButtonStatus;
60
+ statusDuration: number;
61
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
62
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
63
+ declare const _default: typeof __VLS_export;
64
+ export default _default;
65
+ type __VLS_WithSlots<T, S> = T & {
66
+ new (): {
67
+ $slots: S;
68
+ };
69
+ };
@@ -0,0 +1,34 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ /**
3
+ * A month of days to pick one from, with the month and year in the heading
4
+ * opening grids of months and years. InputDate shows it in a popover; on its
5
+ * own it suits a page where the date is the main thing, e.g. choosing an
6
+ * interview day. It has no frame: put it in a Card.
7
+ */
8
+ export interface CalendarProps {
9
+ /** Earliest allowed date, as `YYYY-MM-DD`. */
10
+ min?: string;
11
+ /** Latest allowed date, as `YYYY-MM-DD`. */
12
+ max?: string;
13
+ /** Sets the weekday names, month names and the calendar's language. */
14
+ locale?: string;
15
+ /** Move focus to the chosen day (or today) when the calendar appears. */
16
+ initialFocus?: boolean;
17
+ disabled?: boolean;
18
+ class?: HTMLAttributes['class'];
19
+ }
20
+ type __VLS_Props = CalendarProps;
21
+ type __VLS_ModelProps = {
22
+ /** The date as `YYYY-MM-DD`, or undefined when none is chosen. */
23
+ modelValue?: string | undefined;
24
+ };
25
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
26
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
27
+ "update:modelValue": (value: string | undefined) => any;
28
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
29
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
30
+ }>, {
31
+ locale: string;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
33
+ declare const _default: typeof __VLS_export;
34
+ export default _default;
@@ -0,0 +1,56 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ /**
3
+ * A white panel that groups related content on a page: a form section, a
4
+ * summary, a stat, a table. Same border, radius and white as Button, Input
5
+ * and Popover, so everything on the grey page background matches.
6
+ *
7
+ * With a `title` it's a labelled region (a `<section>` named by its heading),
8
+ * so screen reader users can jump between cards. It's also a size container:
9
+ * children can lay out by the card's width with `@sm:` / `@lg:` etc.
10
+ *
11
+ * Slots: default (the content), header (replaces title and description),
12
+ * actions (top right, beside the title, e.g. an Edit button), footer (under a
13
+ * divider, right-aligned, e.g. Cancel / Save).
14
+ */
15
+ export interface CardProps {
16
+ /** Heading. Also the card's accessible name. */
17
+ title?: string;
18
+ /** Smaller grey text under the title. */
19
+ description?: string;
20
+ /** Heading level, to fit the page outline (h1 is the page title). */
21
+ headingLevel?: 2 | 3 | 4;
22
+ /**
23
+ * Space inside:
24
+ * - md (default): 16px, 24px from the sm breakpoint. Sections and forms.
25
+ * - sm: 16px. Small cards, e.g. stats in a grid.
26
+ * - none: content touches the edges, e.g. a table.
27
+ */
28
+ padding?: 'none' | 'sm' | 'md';
29
+ /** Element to render. Defaults to section (with a title) or div. */
30
+ as?: 'section' | 'aside' | 'article' | 'div';
31
+ class?: HTMLAttributes['class'];
32
+ /** Extra classes for the parts. */
33
+ ui?: {
34
+ header?: HTMLAttributes['class'];
35
+ body?: HTMLAttributes['class'];
36
+ footer?: HTMLAttributes['class'];
37
+ };
38
+ }
39
+ type __VLS_Slots = {
40
+ default?(): unknown;
41
+ header?(): unknown;
42
+ actions?(): unknown;
43
+ footer?(): unknown;
44
+ };
45
+ declare const __VLS_base: import('vue').DefineComponent<CardProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CardProps> & Readonly<{}>, {
46
+ headingLevel: 2 | 3 | 4;
47
+ padding: "sm" | "md" | "none";
48
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
49
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
50
+ declare const _default: typeof __VLS_export;
51
+ export default _default;
52
+ type __VLS_WithSlots<T, S> = T & {
53
+ new (): {
54
+ $slots: S;
55
+ };
56
+ };
@@ -0,0 +1,40 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ /**
3
+ * A yes / no answer that's sent with the form, e.g. "Has a sibling at the
4
+ * school" or agreeing to terms. For a setting that takes effect straight
5
+ * away, use Switch; for one choice from a few, use RadioGroup.
6
+ */
7
+ export interface CheckboxProps {
8
+ /** Visible label, beside the box. Pressing it ticks the box too. */
9
+ label: string;
10
+ /** More detail, in smaller text under the label. */
11
+ description?: string;
12
+ /**
13
+ * Error message, e.g. "Agree to the terms to continue". When set (and not
14
+ * empty) the box shows as an error with this text.
15
+ */
16
+ errorText?: string;
17
+ /** Name for native form submission. */
18
+ name?: string;
19
+ /** Value sent with the form when ticked. Default "on". */
20
+ value?: string;
21
+ required?: boolean;
22
+ disabled?: boolean;
23
+ class?: HTMLAttributes['class'];
24
+ }
25
+ type __VLS_Props = CheckboxProps;
26
+ type __VLS_ModelProps = {
27
+ /**
28
+ * Ticked or not. 'indeterminate' shows a dash: for a "select all" box when
29
+ * only some of its items are ticked. Pressing it then ticks it.
30
+ */
31
+ modelValue?: boolean | 'indeterminate';
32
+ };
33
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
34
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
35
+ "update:modelValue": (value: boolean | "indeterminate") => any;
36
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
37
+ "onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
38
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
39
+ declare const _default: typeof __VLS_export;
40
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ /**
3
+ * Steps towards something, ticked off as they're done: what's left before a
4
+ * form can be submitted, or setting up a new school year. It shows progress;
5
+ * people don't tick it themselves (use Checkbox for that).
6
+ */
7
+ export interface ChecklistItem {
8
+ /** What needs doing, e.g. "Term dates". */
9
+ label: string;
10
+ done: boolean;
11
+ }
12
+ export interface ChecklistProps {
13
+ items: ChecklistItem[];
14
+ class?: HTMLAttributes['class'];
15
+ }
16
+ declare const __VLS_export: import('vue').DefineComponent<ChecklistProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ChecklistProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;