@thekestongroup/ui 0.2.1 → 0.4.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 +98 -31
- package/dist/components/Age/Age.vue.d.ts +19 -0
- package/dist/components/AppShell/AppShell.vue.d.ts +108 -0
- package/dist/components/Avatar/Avatar.vue.d.ts +34 -0
- package/dist/components/AvatarGroup/AvatarGroup.vue.d.ts +25 -0
- package/dist/components/Badge/Badge.vue.d.ts +41 -0
- package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +39 -0
- package/dist/components/Button/Button.vue.d.ts +69 -0
- package/dist/components/Calendar/Calendar.vue.d.ts +34 -0
- package/dist/components/Card/Card.vue.d.ts +56 -0
- package/dist/components/Checkbox/Checkbox.vue.d.ts +40 -0
- package/dist/components/Checklist/Checklist.vue.d.ts +18 -0
- package/dist/components/Chip/Chip.vue.d.ts +44 -0
- package/dist/components/Divider/Divider.vue.d.ts +36 -0
- package/dist/components/EmptyState/EmptyState.vue.d.ts +55 -0
- package/dist/components/{ToastItem.vue.d.ts → FormField/FieldMessage.vue.d.ts} +10 -2
- package/dist/components/FormField/FormField.vue.d.ts +61 -0
- package/dist/components/Header/Header.vue.d.ts +104 -0
- package/dist/components/InfoTip/InfoTip.vue.d.ts +20 -0
- package/dist/components/Input/Input.vue.d.ts +56 -0
- package/dist/components/InputCode/InputCode.vue.d.ts +53 -0
- package/dist/components/InputDate/InputDate.vue.d.ts +49 -0
- package/dist/components/InputNumber/InputNumber.vue.d.ts +44 -0
- package/dist/components/InputPassword/InputPassword.vue.d.ts +51 -0
- package/dist/components/InputRichText/InputRichText.vue.d.ts +44 -0
- package/dist/components/Link/Link.vue.d.ts +39 -0
- package/dist/components/Notification/Notification.vue.d.ts +62 -0
- package/dist/components/Notification/NotificationPane.vue.d.ts +38 -0
- package/dist/components/Notification/Toaster.vue.d.ts +51 -0
- package/dist/components/Notification/notification.samples.d.ts +3 -0
- package/dist/components/Notification/notifications.d.ts +115 -0
- package/dist/components/PageHeader/PageHeader.vue.d.ts +43 -0
- package/dist/components/Popover/Popover.vue.d.ts +83 -0
- package/dist/components/Popover/popover.d.ts +16 -0
- package/dist/components/Progress/Progress.vue.d.ts +26 -0
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +45 -0
- package/dist/components/RelativeTime/RelativeTime.vue.d.ts +22 -0
- package/dist/components/Select/Select.vue.d.ts +110 -0
- package/dist/components/Sidebar/Sidebar.vue.d.ts +106 -0
- package/dist/components/Sidebar/sidebar.d.ts +10 -0
- package/dist/components/Slideover/Slideover.vue.d.ts +125 -0
- package/dist/components/Spinner/Spinner.vue.d.ts +30 -0
- package/dist/components/StatTile/StatTile.vue.d.ts +46 -0
- package/dist/components/SummaryList/SummaryList.vue.d.ts +62 -0
- package/dist/components/Switch/Switch.vue.d.ts +39 -0
- package/dist/components/Table/Table.vue.d.ts +82 -0
- package/dist/components/Table/table.d.ts +36 -0
- package/dist/components/Tooltip/Tooltip.vue.d.ts +46 -0
- package/dist/index.d.ts +91 -25
- package/dist/keston-ui.js +5030 -14786
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/dates.d.ts +27 -0
- package/dist/lib/initials.d.ts +2 -0
- package/dist/lib/parseDate.d.ts +44 -0
- package/dist/lib/useNow.d.ts +3 -0
- package/package.json +57 -24
- package/src/components/.gitkeep +0 -0
- package/src/components/Age/Age.stories.ts +24 -0
- package/src/components/Age/Age.vue +56 -0
- package/src/components/AppShell/AppShell.stories.ts +124 -0
- package/src/components/AppShell/AppShell.vue +221 -0
- package/src/components/Avatar/Avatar.stories.ts +56 -0
- package/src/components/Avatar/Avatar.vue +118 -0
- package/src/components/AvatarGroup/AvatarGroup.stories.ts +47 -0
- package/src/components/AvatarGroup/AvatarGroup.vue +97 -0
- package/src/components/Badge/Badge.stories.ts +92 -0
- package/src/components/Badge/Badge.vue +67 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.ts +58 -0
- package/src/components/Breadcrumb/Breadcrumb.vue +109 -0
- package/src/components/Button/Button.mdx +79 -0
- package/src/components/Button/Button.stories.ts +207 -0
- package/src/components/Button/Button.vue +266 -0
- package/src/components/Calendar/Calendar.stories.ts +51 -0
- package/src/components/Calendar/Calendar.vue +364 -0
- package/src/components/Card/Card.stories.ts +109 -0
- package/src/components/Card/Card.vue +115 -0
- package/src/components/Checkbox/Checkbox.stories.ts +102 -0
- package/src/components/Checkbox/Checkbox.vue +102 -0
- package/src/components/Checklist/Checklist.stories.ts +67 -0
- package/src/components/Checklist/Checklist.vue +38 -0
- package/src/components/Chip/Chip.stories.ts +71 -0
- package/src/components/Chip/Chip.vue +86 -0
- package/src/components/Divider/Divider.stories.ts +57 -0
- package/src/components/Divider/Divider.vue +58 -0
- package/src/components/EmptyState/EmptyState.stories.ts +99 -0
- package/src/components/EmptyState/EmptyState.vue +87 -0
- package/src/components/FormField/FieldMessage.vue +81 -0
- package/src/components/FormField/FormField.stories.ts +55 -0
- package/src/components/FormField/FormField.vue +160 -0
- package/src/components/Header/Header.stories.ts +168 -0
- package/src/components/Header/Header.vue +232 -0
- package/src/components/InfoTip/InfoTip.stories.ts +63 -0
- package/src/components/InfoTip/InfoTip.vue +50 -0
- package/src/components/Input/Input.stories.ts +206 -0
- package/src/components/Input/Input.vue +90 -0
- package/src/components/InputCode/InputCode.stories.ts +85 -0
- package/src/components/InputCode/InputCode.vue +145 -0
- package/src/components/InputDate/InputDate.stories.ts +58 -0
- package/src/components/InputDate/InputDate.vue +258 -0
- package/src/components/InputNumber/InputNumber.stories.ts +63 -0
- package/src/components/InputNumber/InputNumber.vue +109 -0
- package/src/components/InputPassword/InputPassword.stories.ts +105 -0
- package/src/components/InputPassword/InputPassword.vue +132 -0
- package/src/components/InputRichText/InputRichText.stories.ts +100 -0
- package/src/components/InputRichText/InputRichText.vue +194 -0
- package/src/components/Link/Link.stories.ts +73 -0
- package/src/components/Link/Link.vue +56 -0
- package/src/components/Notification/Notification.stories.ts +196 -0
- package/src/components/Notification/Notification.vue +136 -0
- package/src/components/Notification/NotificationPane.vue +186 -0
- package/src/components/Notification/Toaster.vue +446 -0
- package/src/components/Notification/notification.samples.ts +45 -0
- package/src/components/Notification/notifications.test.ts +99 -0
- package/src/components/Notification/notifications.ts +172 -0
- package/src/components/PageHeader/PageHeader.stories.ts +79 -0
- package/src/components/PageHeader/PageHeader.vue +66 -0
- package/src/components/Popover/Popover.stories.ts +135 -0
- package/src/components/Popover/Popover.vue +192 -0
- package/src/components/Popover/popover.ts +20 -0
- package/src/components/Progress/Progress.stories.ts +74 -0
- package/src/components/Progress/Progress.vue +75 -0
- package/src/components/RadioGroup/RadioGroup.stories.ts +90 -0
- package/src/components/RadioGroup/RadioGroup.vue +132 -0
- package/src/components/RelativeTime/RelativeTime.stories.ts +74 -0
- package/src/components/RelativeTime/RelativeTime.vue +51 -0
- package/src/components/Select/Select.mdx +202 -0
- package/src/components/Select/Select.stories.ts +223 -0
- package/src/components/Select/Select.vue +630 -0
- package/src/components/Sidebar/Sidebar.stories.ts +192 -0
- package/src/components/Sidebar/Sidebar.vue +382 -0
- package/src/components/Sidebar/sidebar.ts +20 -0
- package/src/components/Slideover/Slideover.stories.ts +225 -0
- package/src/components/Slideover/Slideover.vue +365 -0
- package/src/components/Spinner/Spinner.stories.ts +79 -0
- package/src/components/Spinner/Spinner.vue +97 -0
- package/src/components/StatTile/StatTile.stories.ts +75 -0
- package/src/components/StatTile/StatTile.vue +89 -0
- package/src/components/SummaryList/SummaryList.stories.ts +103 -0
- package/src/components/SummaryList/SummaryList.vue +127 -0
- package/src/components/Switch/Switch.stories.ts +100 -0
- package/src/components/Switch/Switch.vue +96 -0
- package/src/components/Table/Table.stories.ts +212 -0
- package/src/components/Table/Table.vue +223 -0
- package/src/components/Table/table.test.ts +65 -0
- package/src/components/Table/table.ts +70 -0
- package/src/components/Tooltip/Tooltip.stories.ts +57 -0
- package/src/components/Tooltip/Tooltip.vue +86 -0
- package/src/examples/AppPages.stories.ts +500 -0
- package/src/examples/FormLayout.stories.ts +185 -0
- package/src/examples/KestonIdPages.stories.ts +415 -0
- package/src/examples/SchoolPages.stories.ts +665 -0
- package/src/index.ts +116 -36
- package/src/lib/cn.ts +4 -0
- package/src/lib/dates.test.ts +68 -0
- package/src/lib/dates.ts +86 -0
- package/src/lib/initials.ts +8 -0
- package/src/lib/parseDate.test.ts +331 -0
- package/src/lib/parseDate.ts +561 -0
- package/src/lib/useNow.ts +20 -0
- package/src/styles/theme.css +101 -0
- package/dist/components/AppLauncher.vue.d.ts +0 -10
- package/dist/components/Avatar.vue.d.ts +0 -16
- package/dist/components/Button.vue.d.ts +0 -27
- package/dist/components/Checkbox.vue.d.ts +0 -18
- package/dist/components/CloseButton.vue.d.ts +0 -6
- package/dist/components/Dialog.vue.d.ts +0 -23
- package/dist/components/Drawer.vue.d.ts +0 -34
- package/dist/components/DropdownMenu.vue.d.ts +0 -21
- package/dist/components/DropdownMenuItem.vue.d.ts +0 -19
- package/dist/components/DropdownMenuSeparator.vue.d.ts +0 -6
- package/dist/components/Input.vue.d.ts +0 -14
- package/dist/components/Label.vue.d.ts +0 -16
- package/dist/components/NotificationsMenu.vue.d.ts +0 -3
- package/dist/components/Popover.vue.d.ts +0 -23
- package/dist/components/ProfileSwitcher.vue.d.ts +0 -24
- package/dist/components/Select.vue.d.ts +0 -28
- package/dist/components/Separator.vue.d.ts +0 -11
- package/dist/components/ToastRenderer.vue.d.ts +0 -3
- package/dist/components/Toaster.vue.d.ts +0 -3
- package/dist/components/Tooltip.vue.d.ts +0 -23
- package/dist/components/TopBar.vue.d.ts +0 -34
- package/dist/favicon-old.svg +0 -1
- package/dist/favicon.svg +0 -1
- package/dist/keston-ui.cjs +0 -15
- package/dist/lib/toast.d.ts +0 -29
- package/dist/lib/types.d.ts +0 -5
- package/src/components/AppLauncher.vue +0 -63
- package/src/components/Avatar.vue +0 -51
- package/src/components/Button.vue +0 -54
- package/src/components/Checkbox.vue +0 -47
- package/src/components/CloseButton.vue +0 -24
- package/src/components/Dialog.vue +0 -65
- package/src/components/Drawer.vue +0 -202
- package/src/components/DropdownMenu.vue +0 -41
- package/src/components/DropdownMenuItem.vue +0 -28
- package/src/components/DropdownMenuSeparator.vue +0 -12
- package/src/components/Input.vue +0 -21
- package/src/components/Label.vue +0 -15
- package/src/components/NotificationsMenu.vue +0 -115
- package/src/components/Popover.vue +0 -46
- package/src/components/ProfileSwitcher.vue +0 -113
- package/src/components/Select.vue +0 -97
- package/src/components/Separator.vue +0 -30
- package/src/components/ToastItem.vue +0 -158
- package/src/components/ToastRenderer.vue +0 -113
- package/src/components/Toaster.vue +0 -11
- package/src/components/Tooltip.vue +0 -48
- package/src/components/TopBar.vue +0 -52
- package/src/lib/toast.ts +0 -95
- package/src/lib/types.ts +0 -5
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/vue3-vite";
|
|
2
|
+
import { Download, Pencil, Trash2 } from "@lucide/vue";
|
|
3
|
+
import Button from "../Button/Button.vue";
|
|
4
|
+
import Tooltip from "./Tooltip.vue";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Overlay/Tooltip",
|
|
8
|
+
component: Tooltip,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
side: { options: ["top", "right", "bottom", "left"], control: { type: "inline-radio" } },
|
|
12
|
+
align: { options: ["start", "center", "end"], control: { type: "inline-radio" } },
|
|
13
|
+
},
|
|
14
|
+
args: { text: "Download as CSV", side: "top", align: "center", delay: 400 },
|
|
15
|
+
decorators: [() => ({ template: '<div class="p-16"><story /></div>' })],
|
|
16
|
+
render: (args) => ({
|
|
17
|
+
components: { Tooltip, Button, Download },
|
|
18
|
+
setup: () => ({ args }),
|
|
19
|
+
template: `<Tooltip v-bind="args"><Button variant="ghost" square aria-label="Download"><Download /></Button></Tooltip>`,
|
|
20
|
+
}),
|
|
21
|
+
} satisfies Meta<typeof Tooltip>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
/** Hover or tab to the button. Its name is "Download"; the tooltip adds detail as its description. */
|
|
27
|
+
export const Default: Story = {};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A row of icon buttons: once one tooltip is showing, moving to the next shows
|
|
31
|
+
* it straight away (inside AppShell, which shares one provider for the app).
|
|
32
|
+
*/
|
|
33
|
+
export const Toolbar: Story = {
|
|
34
|
+
render: () => ({
|
|
35
|
+
components: { Tooltip, Button, Download, Pencil, Trash2 },
|
|
36
|
+
template: `
|
|
37
|
+
<div class="flex gap-1">
|
|
38
|
+
<Tooltip text="Edit"><Button variant="ghost" square aria-label="Edit"><Pencil /></Button></Tooltip>
|
|
39
|
+
<Tooltip text="Download as CSV"><Button variant="ghost" square aria-label="Download"><Download /></Button></Tooltip>
|
|
40
|
+
<Tooltip text="Delete"><Button variant="ghost" square aria-label="Delete"><Trash2 /></Button></Tooltip>
|
|
41
|
+
</div>`,
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** On text: make it focusable (tabindex="0") so keyboard users can open it too. */
|
|
46
|
+
export const OnText: Story = {
|
|
47
|
+
render: () => ({
|
|
48
|
+
components: { Tooltip },
|
|
49
|
+
template: `
|
|
50
|
+
<p class="text-sm">
|
|
51
|
+
Fees are due by the
|
|
52
|
+
<Tooltip text="Usually the first school day of each term">
|
|
53
|
+
<span tabindex="0" class="underline decoration-black/40 decoration-dotted underline-offset-2 outline-focus focus-visible:outline-2">start of term</span>
|
|
54
|
+
</Tooltip>.
|
|
55
|
+
</p>`,
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { h, type FunctionalComponent, type HTMLAttributes } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
injectTooltipProviderContext,
|
|
5
|
+
TooltipContent,
|
|
6
|
+
TooltipPortal,
|
|
7
|
+
TooltipProvider,
|
|
8
|
+
TooltipRoot,
|
|
9
|
+
TooltipTrigger,
|
|
10
|
+
type TooltipContentProps
|
|
11
|
+
} from 'reka-ui'
|
|
12
|
+
import { cn } from '../../lib/cn'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A short label that appears on hover or keyboard focus: the exact date
|
|
16
|
+
* behind "3 hours ago", a birthday behind an age, the name of an icon
|
|
17
|
+
* button.
|
|
18
|
+
*
|
|
19
|
+
* Only for extra, non-essential detail: it doesn't open on touch screens,
|
|
20
|
+
* so anything people need must be on the page too. Nothing interactive
|
|
21
|
+
* inside it (use a Popover).
|
|
22
|
+
*
|
|
23
|
+
* The trigger (default slot) must be focusable, so keyboard users can open
|
|
24
|
+
* it: a Button, a link, or an element with `tabindex="0"`. The tooltip is
|
|
25
|
+
* linked to it with `aria-describedby`, so screen readers read it after the
|
|
26
|
+
* trigger's name.
|
|
27
|
+
*
|
|
28
|
+
* Slots: default (the trigger), content (instead of `text`).
|
|
29
|
+
*/
|
|
30
|
+
export interface TooltipProps {
|
|
31
|
+
/** The tooltip's text. */
|
|
32
|
+
text?: string
|
|
33
|
+
/** Which side of the trigger. */
|
|
34
|
+
side?: TooltipContentProps['side']
|
|
35
|
+
align?: TooltipContentProps['align']
|
|
36
|
+
/** Wait this long before showing, in ms. Moving to another tooltip soon after shows it at once. */
|
|
37
|
+
delay?: number
|
|
38
|
+
disabled?: boolean
|
|
39
|
+
class?: HTMLAttributes['class']
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const props = withDefaults(defineProps<TooltipProps>(), {
|
|
43
|
+
side: 'top',
|
|
44
|
+
align: 'center',
|
|
45
|
+
delay: 400
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
defineSlots<{
|
|
49
|
+
default?(): unknown
|
|
50
|
+
content?(): unknown
|
|
51
|
+
}>()
|
|
52
|
+
|
|
53
|
+
// Reka needs a TooltipProvider above every tooltip. AppShell has one for the
|
|
54
|
+
// whole app (so moving from one tooltip to the next shows it straight away);
|
|
55
|
+
// elsewhere each tooltip brings its own.
|
|
56
|
+
const hasProvider = injectTooltipProviderContext(null) !== null
|
|
57
|
+
const MaybeProvider: FunctionalComponent = (_, { slots }) =>
|
|
58
|
+
hasProvider ? slots.default?.() : h(TooltipProvider, { delayDuration: props.delay, skipDelayDuration: 300 }, slots)
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<MaybeProvider>
|
|
63
|
+
<TooltipRoot :disabled="disabled" :delay-duration="delay">
|
|
64
|
+
<TooltipTrigger as-child>
|
|
65
|
+
<slot />
|
|
66
|
+
</TooltipTrigger>
|
|
67
|
+
<TooltipPortal>
|
|
68
|
+
<TooltipContent
|
|
69
|
+
:side="side"
|
|
70
|
+
:align="align"
|
|
71
|
+
:side-offset="8"
|
|
72
|
+
:collision-padding="8"
|
|
73
|
+
:class="
|
|
74
|
+
cn(
|
|
75
|
+
'z-100 max-w-72 rounded-md bg-gray-900 px-2.5 py-1.5 text-xs/4 font-medium text-white shadow-lg ring-1 ring-white/10',
|
|
76
|
+
'data-[state=closed]:animate-fade-out data-[state=delayed-open]:animate-fade-in data-[state=instant-open]:animate-fade-in',
|
|
77
|
+
props.class
|
|
78
|
+
)
|
|
79
|
+
"
|
|
80
|
+
>
|
|
81
|
+
<slot name="content">{{ text }}</slot>
|
|
82
|
+
</TooltipContent>
|
|
83
|
+
</TooltipPortal>
|
|
84
|
+
</TooltipRoot>
|
|
85
|
+
</MaybeProvider>
|
|
86
|
+
</template>
|
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/vue3-vite";
|
|
2
|
+
import {
|
|
3
|
+
BookOpen,
|
|
4
|
+
Building2,
|
|
5
|
+
CalendarCog,
|
|
6
|
+
CalendarDays,
|
|
7
|
+
Copy,
|
|
8
|
+
GraduationCap,
|
|
9
|
+
House,
|
|
10
|
+
Layers,
|
|
11
|
+
Shield,
|
|
12
|
+
ClipboardCheck,
|
|
13
|
+
FileText,
|
|
14
|
+
Inbox,
|
|
15
|
+
LayoutDashboard,
|
|
16
|
+
PoundSterling,
|
|
17
|
+
Receipt,
|
|
18
|
+
Settings,
|
|
19
|
+
UserPlus,
|
|
20
|
+
Users,
|
|
21
|
+
Wallet,
|
|
22
|
+
} from "@lucide/vue";
|
|
23
|
+
import { computed, reactive, ref, type Component } from "vue";
|
|
24
|
+
import AppShell from "../components/AppShell/AppShell.vue";
|
|
25
|
+
import Badge, { type BadgeProps } from "../components/Badge/Badge.vue";
|
|
26
|
+
import AvatarGroup from "../components/AvatarGroup/AvatarGroup.vue";
|
|
27
|
+
import Breadcrumb from "../components/Breadcrumb/Breadcrumb.vue";
|
|
28
|
+
import Button, { type ButtonStatus } from "../components/Button/Button.vue";
|
|
29
|
+
import Card from "../components/Card/Card.vue";
|
|
30
|
+
import Checklist from "../components/Checklist/Checklist.vue";
|
|
31
|
+
import Divider from "../components/Divider/Divider.vue";
|
|
32
|
+
import Input from "../components/Input/Input.vue";
|
|
33
|
+
import PageHeader from "../components/PageHeader/PageHeader.vue";
|
|
34
|
+
import RadioGroup from "../components/RadioGroup/RadioGroup.vue";
|
|
35
|
+
import NotificationPane from "../components/Notification/NotificationPane.vue";
|
|
36
|
+
import Toaster from "../components/Notification/Toaster.vue";
|
|
37
|
+
import { createNotifications } from "../components/Notification/notifications";
|
|
38
|
+
import { sampleNotifications } from "../components/Notification/notification.samples";
|
|
39
|
+
import InputDate from "../components/InputDate/InputDate.vue";
|
|
40
|
+
import InputNumber from "../components/InputNumber/InputNumber.vue";
|
|
41
|
+
import Select from "../components/Select/Select.vue";
|
|
42
|
+
import StatTile, { type StatTileProps } from "../components/StatTile/StatTile.vue";
|
|
43
|
+
import SummaryList from "../components/SummaryList/SummaryList.vue";
|
|
44
|
+
import Table from "../components/Table/Table.vue";
|
|
45
|
+
import type { TableColumn } from "../components/Table/table";
|
|
46
|
+
import type { SidebarItem, SidebarSection } from "../components/Sidebar/Sidebar.vue";
|
|
47
|
+
import { sidebarTrail } from "../components/Sidebar/sidebar";
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Whole pages from two different apps, to show the intended layout: every
|
|
51
|
+
* app uses AppShell, so the header is the same everywhere (only the title
|
|
52
|
+
* changes) and each app brings its own sidebar items and pages.
|
|
53
|
+
* Not part of the library itself.
|
|
54
|
+
*
|
|
55
|
+
* Narrow the preview, or use the viewport menu, to see the mobile menu.
|
|
56
|
+
*/
|
|
57
|
+
const meta = {
|
|
58
|
+
title: "Examples/App pages",
|
|
59
|
+
parameters: { layout: "fullscreen" },
|
|
60
|
+
} satisfies Meta;
|
|
61
|
+
|
|
62
|
+
export default meta;
|
|
63
|
+
type Story = StoryObj<typeof meta>;
|
|
64
|
+
|
|
65
|
+
// Every app passes the same user and handles the account actions the same
|
|
66
|
+
// way; only the title, sidebar and pages differ.
|
|
67
|
+
const user = { name: "Ben Smith", email: "ben.smith@keston.school", organisation: "The Keston School" };
|
|
68
|
+
|
|
69
|
+
// The bell opens past notifications; new ones pop up as toasts. Each page
|
|
70
|
+
// story makes its own list (so stories don't share notifications).
|
|
71
|
+
const sharedHeader = `
|
|
72
|
+
<template #header-trailing>
|
|
73
|
+
<NotificationPane :notifications="notifications" />
|
|
74
|
+
</template>`;
|
|
75
|
+
const sharedToaster = `<Toaster :notifications="notifications" />`;
|
|
76
|
+
|
|
77
|
+
/** Marks one item as the current page, and makes choosing an item go to it. */
|
|
78
|
+
function useNav(sections: SidebarSection[], first: string) {
|
|
79
|
+
const current = ref(first);
|
|
80
|
+
const nav = computed(() =>
|
|
81
|
+
sections.map((section) => ({
|
|
82
|
+
...section,
|
|
83
|
+
items: section.items.map((item) => ({
|
|
84
|
+
...item,
|
|
85
|
+
active: item.label === current.value,
|
|
86
|
+
onSelect: () => (current.value = item.label),
|
|
87
|
+
})),
|
|
88
|
+
})),
|
|
89
|
+
);
|
|
90
|
+
return { current, nav };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type Row = { name: string; detail: string; date: string; status: string; color: BadgeProps["color"] };
|
|
94
|
+
|
|
95
|
+
const pageTemplate = `
|
|
96
|
+
<div class="flex flex-col gap-6 p-4 sm:p-6">
|
|
97
|
+
<PageHeader :title="current">
|
|
98
|
+
<template #actions>
|
|
99
|
+
<Button variant="primary"><template #leading><component :is="actionIcon" /></template>{{ action }}</Button>
|
|
100
|
+
</template>
|
|
101
|
+
</PageHeader>
|
|
102
|
+
|
|
103
|
+
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
|
104
|
+
<StatTile v-for="stat in stats" :key="stat.label" v-bind="stat" />
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<Card padding="none">
|
|
108
|
+
<Table :columns="columns" :rows="rows" row-key="name" :caption="current">
|
|
109
|
+
<template #cell-date="{ value }"><span class="text-black/65">{{ value }}</span></template>
|
|
110
|
+
<template #cell-status="{ row }"><Badge :color="row.color" size="sm">{{ row.status }}</Badge></template>
|
|
111
|
+
</Table>
|
|
112
|
+
</Card>
|
|
113
|
+
</div>`;
|
|
114
|
+
|
|
115
|
+
function pageStory(options: {
|
|
116
|
+
title: string;
|
|
117
|
+
sections: SidebarSection[];
|
|
118
|
+
first: string;
|
|
119
|
+
action: string;
|
|
120
|
+
actionIcon: Component;
|
|
121
|
+
stats: StatTileProps[];
|
|
122
|
+
headings: string[];
|
|
123
|
+
rows: Row[];
|
|
124
|
+
}): Story {
|
|
125
|
+
return {
|
|
126
|
+
render: () => ({
|
|
127
|
+
components: { AppShell, Badge, Button, Card, NotificationPane, PageHeader, StatTile, Table, Toaster },
|
|
128
|
+
setup() {
|
|
129
|
+
const { current, nav } = useNav(options.sections, options.first);
|
|
130
|
+
const keys = ["name", "detail", "date", "status"] as const;
|
|
131
|
+
const columns: TableColumn<Row>[] = options.headings.map((label, i) => ({
|
|
132
|
+
key: keys[i],
|
|
133
|
+
label,
|
|
134
|
+
rowHeader: i === 0,
|
|
135
|
+
sortable: keys[i] !== "date",
|
|
136
|
+
align: label === "Amount" ? "end" : undefined,
|
|
137
|
+
}));
|
|
138
|
+
const notifications = createNotifications(sampleNotifications());
|
|
139
|
+
return { ...options, columns, current, nav, user, notifications };
|
|
140
|
+
},
|
|
141
|
+
template: `
|
|
142
|
+
<AppShell :title="title" :sections="nav" :user="user">
|
|
143
|
+
${sharedHeader}
|
|
144
|
+
${pageTemplate}
|
|
145
|
+
</AppShell>
|
|
146
|
+
${sharedToaster}`,
|
|
147
|
+
}),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const statuses: Record<string, BadgeProps["color"]> = {
|
|
152
|
+
Offered: "green",
|
|
153
|
+
Interview: "blue",
|
|
154
|
+
"Awaiting documents": "yellow",
|
|
155
|
+
Withdrawn: "basic",
|
|
156
|
+
Paid: "green",
|
|
157
|
+
"Due soon": "yellow",
|
|
158
|
+
Overdue: "red",
|
|
159
|
+
Draft: "basic",
|
|
160
|
+
};
|
|
161
|
+
const row = (name: string, detail: string, date: string, status: string): Row => ({
|
|
162
|
+
name,
|
|
163
|
+
detail,
|
|
164
|
+
date,
|
|
165
|
+
status,
|
|
166
|
+
color: statuses[status],
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
/** The admissions app: applications, interviews and offers. */
|
|
170
|
+
export const Admissions = pageStory({
|
|
171
|
+
title: "Keston Admissions",
|
|
172
|
+
first: "Applications",
|
|
173
|
+
action: "New application",
|
|
174
|
+
actionIcon: UserPlus,
|
|
175
|
+
sections: [
|
|
176
|
+
{
|
|
177
|
+
items: [
|
|
178
|
+
{ label: "Dashboard", icon: LayoutDashboard },
|
|
179
|
+
{ label: "Applications", icon: Inbox, badge: 12 },
|
|
180
|
+
{ label: "Interviews", icon: CalendarDays },
|
|
181
|
+
{ label: "Offers", icon: ClipboardCheck },
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
label: "Records",
|
|
186
|
+
items: [
|
|
187
|
+
{ label: "Students", icon: Users },
|
|
188
|
+
{ label: "Documents", icon: FileText, badge: 4, badgeColor: "yellow" },
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
{ label: "Admin", items: [{ label: "Settings", icon: Settings }] },
|
|
192
|
+
],
|
|
193
|
+
stats: [
|
|
194
|
+
{ label: "Open applications", value: "48", change: "+12%", changeLabel: "on last year", trend: "up" },
|
|
195
|
+
{ label: "Interviews this week", value: "9" },
|
|
196
|
+
{ label: "Offers accepted", value: "31", change: "+4", changeLabel: "this week", trend: "up" },
|
|
197
|
+
],
|
|
198
|
+
headings: ["Applicant", "Year group", "Applied", "Status"],
|
|
199
|
+
rows: [
|
|
200
|
+
row("Amelia Clarke", "Year 7", "3 Nov 2026", "Offered"),
|
|
201
|
+
row("Noah Patel", "Year 9", "1 Nov 2026", "Interview"),
|
|
202
|
+
row("Isla Thompson", "Year 7", "28 Oct 2026", "Awaiting documents"),
|
|
203
|
+
row("Leo Okafor", "Year 12", "24 Oct 2026", "Interview"),
|
|
204
|
+
row("Grace Wilson", "Year 8", "20 Oct 2026", "Withdrawn"),
|
|
205
|
+
row("Oliver Hughes", "Year 7", "18 Oct 2026", "Offered"),
|
|
206
|
+
],
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
/** The finance app: same shell and header, its own sidebar and pages. */
|
|
210
|
+
export const Finance = pageStory({
|
|
211
|
+
title: "Keston Finance",
|
|
212
|
+
first: "Invoices",
|
|
213
|
+
action: "New invoice",
|
|
214
|
+
actionIcon: Receipt,
|
|
215
|
+
sections: [
|
|
216
|
+
{
|
|
217
|
+
items: [
|
|
218
|
+
{ label: "Overview", icon: LayoutDashboard },
|
|
219
|
+
{ label: "Invoices", icon: Receipt, badge: 5, badgeColor: "red" },
|
|
220
|
+
{ label: "Payments", icon: Wallet },
|
|
221
|
+
{ label: "Fees", icon: PoundSterling },
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
{ label: "Admin", items: [{ label: "Settings", icon: Settings }] },
|
|
225
|
+
],
|
|
226
|
+
stats: [
|
|
227
|
+
{ label: "Outstanding", value: "£18,420" },
|
|
228
|
+
{ label: "Paid this term", value: "£246,900" },
|
|
229
|
+
{ label: "Overdue invoices", value: "5" },
|
|
230
|
+
],
|
|
231
|
+
headings: ["Family", "Amount", "Due", "Status"],
|
|
232
|
+
rows: [
|
|
233
|
+
row("Clarke family", "£4,950.00", "1 Dec 2026", "Due soon"),
|
|
234
|
+
row("Patel family", "£4,950.00", "1 Nov 2026", "Overdue"),
|
|
235
|
+
row("Thompson family", "£2,475.00", "1 Oct 2026", "Paid"),
|
|
236
|
+
row("Okafor family", "£5,300.00", "1 Nov 2026", "Overdue"),
|
|
237
|
+
row("Wilson family", "£4,950.00", "1 Jan 2027", "Draft"),
|
|
238
|
+
row("Hughes family", "£4,950.00", "1 Oct 2026", "Paid"),
|
|
239
|
+
],
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// ── New School Year Setup ───────────────────────────────────────────────────
|
|
243
|
+
|
|
244
|
+
const yearGroups = [7, 8, 9, 10, 11, 12].map((n) => ({ label: `Year ${n}`, value: n, description: `Becomes Year ${n + 1}` }));
|
|
245
|
+
const studentsPerYear: Record<number, number> = { 7: 182, 8: 179, 9: 184, 10: 176, 11: 181, 12: 158 };
|
|
246
|
+
|
|
247
|
+
const copyOptions = [
|
|
248
|
+
{ label: "Classes and sets", value: "classes", icon: BookOpen, description: "Each class moves up a year; teachers stay with them" },
|
|
249
|
+
{ label: "Tutor groups", value: "tutors", icon: Users, description: "Same tutors, renamed for the new year group" },
|
|
250
|
+
{ label: "Houses", value: "houses", icon: Shield, description: "Students stay in their house" },
|
|
251
|
+
{ label: "Timetable", value: "timetable", icon: CalendarDays, description: "Last year's periods and rooms, as a starting point" },
|
|
252
|
+
{ label: "Fee structures", value: "fees", icon: PoundSterling, description: "Fees and discounts, before any rise is applied" },
|
|
253
|
+
];
|
|
254
|
+
|
|
255
|
+
const terms = [
|
|
256
|
+
{ key: "autumn", label: "Autumn term" },
|
|
257
|
+
{ key: "spring", label: "Spring term" },
|
|
258
|
+
{ key: "summer", label: "Summer term" },
|
|
259
|
+
] as const;
|
|
260
|
+
type TermKey = (typeof terms)[number]["key"];
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* A settings page three levels deep: School › School Structure › New School
|
|
264
|
+
* Year Setup. The sidebar opens at that level, the breadcrumb follows it, and
|
|
265
|
+
* the page uses the form components together: dates that must be in order,
|
|
266
|
+
* a multi-select with descriptions, and a summary that updates as you go.
|
|
267
|
+
*
|
|
268
|
+
* "Start new year" checks everything (try clearing a date, or setting a term
|
|
269
|
+
* outside the year), then loads and succeeds.
|
|
270
|
+
*/
|
|
271
|
+
export const NewSchoolYearSetup: Story = {
|
|
272
|
+
render: () => ({
|
|
273
|
+
components: { AppShell, AvatarGroup, Badge, Breadcrumb, Button, Card, NotificationPane, Toaster, Divider, Input, PageHeader, InputDate, InputNumber, Select, SummaryList, Checklist, RadioGroup, Copy },
|
|
274
|
+
setup() {
|
|
275
|
+
const current = ref("New School Year Setup");
|
|
276
|
+
const page = (label: string, icon?: Component): SidebarItem => ({
|
|
277
|
+
label,
|
|
278
|
+
icon,
|
|
279
|
+
active: label === current.value,
|
|
280
|
+
onSelect: () => (current.value = label),
|
|
281
|
+
});
|
|
282
|
+
const items = computed<SidebarItem[]>(() => [
|
|
283
|
+
page("Home", House),
|
|
284
|
+
page("Students", Users),
|
|
285
|
+
page("Staff", GraduationCap),
|
|
286
|
+
{
|
|
287
|
+
label: "School",
|
|
288
|
+
icon: Building2,
|
|
289
|
+
children: [
|
|
290
|
+
page("Overview", LayoutDashboard),
|
|
291
|
+
{
|
|
292
|
+
label: "School Structure",
|
|
293
|
+
icon: Layers,
|
|
294
|
+
children: [
|
|
295
|
+
page("New School Year Setup", CalendarCog),
|
|
296
|
+
page("Year Groups", GraduationCap),
|
|
297
|
+
page("Houses", Shield),
|
|
298
|
+
page("Classes", BookOpen),
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
page("Term Dates", CalendarDays),
|
|
302
|
+
page("Settings", Settings),
|
|
303
|
+
],
|
|
304
|
+
},
|
|
305
|
+
page("Reports", FileText),
|
|
306
|
+
]);
|
|
307
|
+
const trail = computed(() => sidebarTrail(items.value));
|
|
308
|
+
|
|
309
|
+
const form = reactive({
|
|
310
|
+
name: "2027–28",
|
|
311
|
+
start: "2027-09-01" as string | undefined,
|
|
312
|
+
end: "2028-07-21" as string | undefined,
|
|
313
|
+
terms: {
|
|
314
|
+
autumn: { start: "2027-09-01", end: "2027-12-17" },
|
|
315
|
+
spring: { start: "2028-01-04", end: "2028-03-31" },
|
|
316
|
+
summer: { start: "2028-04-18", end: "2028-07-21" },
|
|
317
|
+
} as Record<TermKey, { start?: string; end?: string }>,
|
|
318
|
+
moveUp: [7, 8, 9, 10, 11, 12] as number[],
|
|
319
|
+
year13: "leavers",
|
|
320
|
+
intake: 180 as number | undefined,
|
|
321
|
+
copy: ["classes", "tutors", "houses"] as string[],
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// Errors appear after "Start new year", then update as fields change.
|
|
325
|
+
const checked = ref(false);
|
|
326
|
+
const errors = computed(() => {
|
|
327
|
+
const e: Record<string, string | undefined> = {};
|
|
328
|
+
if (!checked.value) return e;
|
|
329
|
+
if (!form.name.trim()) e.name = "Enter a name, e.g. 2027–28";
|
|
330
|
+
if (!form.start) e.start = "Enter the first day of the year";
|
|
331
|
+
if (!form.end) e.end = "Enter the last day of the year";
|
|
332
|
+
else if (form.start && form.end <= form.start) e.end = "Must be after the start date";
|
|
333
|
+
let previousEnd: string | undefined;
|
|
334
|
+
for (const term of terms) {
|
|
335
|
+
const t = form.terms[term.key];
|
|
336
|
+
if (!t.start) e[`${term.key}.start`] = "Enter a start date";
|
|
337
|
+
else if (form.start && t.start < form.start) e[`${term.key}.start`] = "Must be in the academic year";
|
|
338
|
+
else if (previousEnd && t.start <= previousEnd) e[`${term.key}.start`] = "Must be after the previous term ends";
|
|
339
|
+
if (!t.end) e[`${term.key}.end`] = "Enter an end date";
|
|
340
|
+
else if (t.start && t.end <= t.start) e[`${term.key}.end`] = "Must be after the term starts";
|
|
341
|
+
else if (form.end && t.end > form.end) e[`${term.key}.end`] = "Must be in the academic year";
|
|
342
|
+
previousEnd = t.end;
|
|
343
|
+
}
|
|
344
|
+
if (form.intake === undefined) e.intake = "Enter the expected intake (0 if none)";
|
|
345
|
+
return e;
|
|
346
|
+
});
|
|
347
|
+
const errorCount = computed(() => Object.values(errors.value).filter(Boolean).length);
|
|
348
|
+
|
|
349
|
+
// The summary down the side.
|
|
350
|
+
const movingUp = computed(() => form.moveUp.reduce((sum, year) => sum + (studentsPerYear[year] ?? 0), 0));
|
|
351
|
+
const figures = computed(() => [
|
|
352
|
+
{ label: "Moving up a year", value: movingUp.value.toLocaleString("en-GB") },
|
|
353
|
+
{ label: form.year13 === "leavers" ? "Leaving (Year 13)" : "Staying on (Year 13)", value: "162" },
|
|
354
|
+
{ label: "Joining Year 7", value: form.intake ?? null },
|
|
355
|
+
]);
|
|
356
|
+
const checklist = computed(() => [
|
|
357
|
+
{ label: "Academic year", done: !!(form.name.trim() && form.start && form.end && form.end > form.start) },
|
|
358
|
+
{ label: "Term dates", done: terms.every((t) => form.terms[t.key].start && form.terms[t.key].end) },
|
|
359
|
+
{ label: "Year groups", done: form.moveUp.length > 0 && form.intake !== undefined },
|
|
360
|
+
{ label: "Copied from 2026–27", done: form.copy.length > 0 },
|
|
361
|
+
]);
|
|
362
|
+
|
|
363
|
+
const status = ref<ButtonStatus>("idle");
|
|
364
|
+
const saved = ref(false);
|
|
365
|
+
const notifications = createNotifications(sampleNotifications());
|
|
366
|
+
function start() {
|
|
367
|
+
checked.value = true;
|
|
368
|
+
if (errorCount.value) {
|
|
369
|
+
// Take keyboard and screen reader users to the first problem.
|
|
370
|
+
requestAnimationFrame(() => document.querySelector<HTMLElement>('[aria-invalid="true"]')?.focus());
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
status.value = "loading";
|
|
374
|
+
setTimeout(() => {
|
|
375
|
+
status.value = "success";
|
|
376
|
+
notifications.notify({
|
|
377
|
+
type: "success",
|
|
378
|
+
title: `${form.name.trim() || "The new year"} is set up`,
|
|
379
|
+
description: "Students have moved up a year. Timetables can now be built.",
|
|
380
|
+
});
|
|
381
|
+
}, 1200);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const signOff = [
|
|
385
|
+
{ name: "Margaret Osei", role: "Headteacher", email: "m.osei@keston.school", organisation: "The Keston School" },
|
|
386
|
+
{ name: "Zara Khan", role: "Deputy Head", email: "z.khan@keston.school", organisation: "The Keston School" },
|
|
387
|
+
{ name: "Oscar Hughes", role: "Data Manager", email: "o.hughes@keston.school", organisation: "The Keston School" },
|
|
388
|
+
{ name: "Isla Ahmed", role: "Business Manager", email: "i.ahmed@keston.school", organisation: "The Keston School" },
|
|
389
|
+
{ name: "Leo Wright", role: "Assistant Head", email: "l.wright@keston.school", organisation: "The Keston School" },
|
|
390
|
+
{ name: "Freya Lewis", role: "Assistant Head", email: "f.lewis@keston.school", organisation: "The Keston School" },
|
|
391
|
+
];
|
|
392
|
+
|
|
393
|
+
return { signOff, current, items, trail, form, terms, errors, errorCount, checked, movingUp, figures, checklist, status, saved, start, user, yearGroups, copyOptions, studentsPerYear, notifications };
|
|
394
|
+
},
|
|
395
|
+
template: `
|
|
396
|
+
<AppShell title="Keston School Admin" :items="items" :user="user">
|
|
397
|
+
${sharedHeader}
|
|
398
|
+
|
|
399
|
+
<div v-if="current !== 'New School Year Setup'" class="flex flex-col gap-2 p-4 sm:p-6">
|
|
400
|
+
<PageHeader :title="current" :breadcrumb="trail" description="Choose New School Year Setup (School › School Structure) to see the example page." />
|
|
401
|
+
</div>
|
|
402
|
+
|
|
403
|
+
<div v-else class="flex flex-col gap-6 p-4 sm:p-6">
|
|
404
|
+
<!-- Title, status and actions -->
|
|
405
|
+
<PageHeader
|
|
406
|
+
title="New School Year Setup"
|
|
407
|
+
description="Set up 2027–28 before the summer. Nothing changes for staff or students until you start the new year."
|
|
408
|
+
:breadcrumb="trail"
|
|
409
|
+
>
|
|
410
|
+
<template #badge>
|
|
411
|
+
<Badge :color="status === 'success' ? 'green' : 'basic'">{{ status === 'success' ? 'Started' : saved ? 'Draft saved' : 'Draft' }}</Badge>
|
|
412
|
+
</template>
|
|
413
|
+
<template #actions>
|
|
414
|
+
<Button @click="saved = true">Save draft</Button>
|
|
415
|
+
<Button variant="primary" v-model:status="status" loading-text="Starting…" success-text="Started" @click="start">
|
|
416
|
+
Start new year
|
|
417
|
+
</Button>
|
|
418
|
+
</template>
|
|
419
|
+
<p v-if="checked && errorCount" role="alert" class="text-sm text-red">
|
|
420
|
+
{{ errorCount === 1 ? 'There is 1 thing' : 'There are ' + errorCount + ' things' }} to fix before the new year can start.
|
|
421
|
+
</p>
|
|
422
|
+
</PageHeader>
|
|
423
|
+
|
|
424
|
+
<!-- Laid out by the space it has (container queries), not the
|
|
425
|
+
window: the sidebar takes 256px, and the form needs room. -->
|
|
426
|
+
<div class="@container">
|
|
427
|
+
<div class="grid grid-cols-1 items-start gap-6 @4xl:grid-cols-[minmax(0,1fr)_18rem]">
|
|
428
|
+
<div class="flex flex-col gap-6">
|
|
429
|
+
<!-- Academic year -->
|
|
430
|
+
<Card title="Academic year" description="The first and last day students are on roll.">
|
|
431
|
+
<div class="grid grid-cols-1 gap-4 @lg:grid-cols-3">
|
|
432
|
+
<Input v-model="form.name" label="Name" :error-text="errors.name" />
|
|
433
|
+
<InputDate v-model="form.start" label="Starts" :error-text="errors.start" />
|
|
434
|
+
<InputDate v-model="form.end" label="Ends" :min="form.start" :error-text="errors.end" />
|
|
435
|
+
</div>
|
|
436
|
+
</Card>
|
|
437
|
+
|
|
438
|
+
<!-- Term dates -->
|
|
439
|
+
<Card title="Term dates" description="Half terms and INSET days can be added later in Term Dates.">
|
|
440
|
+
<div v-for="term in terms" :key="term.key" class="grid grid-cols-1 gap-x-4 gap-y-2 @xl:grid-cols-[7rem_1fr_1fr] @xl:items-start">
|
|
441
|
+
<h3 class="text-sm font-bold @xl:pt-8">{{ term.label }}</h3>
|
|
442
|
+
<InputDate v-model="form.terms[term.key].start" :label="term.label + ' starts'" :min="form.start" :max="form.end" :error-text="errors[term.key + '.start']" />
|
|
443
|
+
<InputDate v-model="form.terms[term.key].end" :label="term.label + ' ends'" :min="form.terms[term.key].start || form.start" :max="form.end" :error-text="errors[term.key + '.end']" />
|
|
444
|
+
</div>
|
|
445
|
+
</Card>
|
|
446
|
+
|
|
447
|
+
<!-- Year groups -->
|
|
448
|
+
<Card title="Year groups" description="Who moves up, who leaves, and who joins.">
|
|
449
|
+
<Select
|
|
450
|
+
v-model="form.moveUp"
|
|
451
|
+
label="Year groups moving up"
|
|
452
|
+
helper="Untick a year group to keep it where it is, e.g. if it's being restructured."
|
|
453
|
+
:options="yearGroups"
|
|
454
|
+
multiple
|
|
455
|
+
/>
|
|
456
|
+
<div class="grid grid-cols-1 gap-4 @lg:grid-cols-2">
|
|
457
|
+
<RadioGroup
|
|
458
|
+
v-model="form.year13"
|
|
459
|
+
label="Year 13 students"
|
|
460
|
+
:options="[
|
|
461
|
+
{ label: 'Mark as leavers', value: 'leavers', description: 'Off roll on 31 August' },
|
|
462
|
+
{ label: 'Keep on roll', value: 'keep', description: 'Until results day, then mark as leavers' },
|
|
463
|
+
]"
|
|
464
|
+
/>
|
|
465
|
+
<InputNumber
|
|
466
|
+
v-model="form.intake"
|
|
467
|
+
label="Expected Year 7 intake"
|
|
468
|
+
helper="From admissions. Places can be added later."
|
|
469
|
+
:min="0"
|
|
470
|
+
:max="400"
|
|
471
|
+
:error-text="errors.intake"
|
|
472
|
+
/>
|
|
473
|
+
</div>
|
|
474
|
+
</Card>
|
|
475
|
+
|
|
476
|
+
<!-- Copy from last year -->
|
|
477
|
+
<Card title="Copy from 2026–27" description="Anything not copied starts empty.">
|
|
478
|
+
<Select v-model="form.copy" label="What to copy" :options="copyOptions" multiple searchable placeholder="Search what to copy…" />
|
|
479
|
+
</Card>
|
|
480
|
+
</div>
|
|
481
|
+
|
|
482
|
+
<!-- Summary -->
|
|
483
|
+
<Card as="aside" title="Summary" padding="sm" class="@4xl:sticky @4xl:top-18">
|
|
484
|
+
<Checklist :items="checklist" />
|
|
485
|
+
<Divider />
|
|
486
|
+
<SummaryList layout="compact" :items="figures" />
|
|
487
|
+
<Divider />
|
|
488
|
+
<div class="flex flex-col gap-2">
|
|
489
|
+
<h3 class="text-sm font-bold">Sign-off</h3>
|
|
490
|
+
<p class="text-sm text-black/65">Starting the year needs one of these people.</p>
|
|
491
|
+
<AvatarGroup :users="signOff" size="sm" label="People who can sign off" />
|
|
492
|
+
</div>
|
|
493
|
+
</Card>
|
|
494
|
+
</div>
|
|
495
|
+
</div>
|
|
496
|
+
</div>
|
|
497
|
+
</AppShell>
|
|
498
|
+
${sharedToaster}`,
|
|
499
|
+
}),
|
|
500
|
+
};
|