@thekestongroup/ui 0.14.0 → 0.15.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/dist/components/Popover/popover.d.ts +3 -2
- package/dist/components/Spinner/Spinner.vue.d.ts +1 -1
- package/dist/keston-ui.js +681 -680
- package/package.json +1 -1
- package/src/components/AppLauncher/AppLauncher.vue +3 -3
- package/src/components/AppShell/AppShell.stories.ts +2 -2
- package/src/components/AppShell/AppShell.vue +2 -2
- package/src/components/Avatar/Avatar.vue +3 -3
- package/src/components/AvatarGroup/AvatarGroup.vue +4 -4
- package/src/components/Badge/Badge.vue +2 -2
- package/src/components/Breadcrumb/Breadcrumb.vue +5 -5
- package/src/components/Button/Button.stories.ts +1 -1
- package/src/components/Button/Button.vue +12 -9
- package/src/components/Calendar/Calendar.stories.ts +2 -2
- package/src/components/Calendar/Calendar.vue +8 -8
- package/src/components/Card/Card.stories.ts +5 -5
- package/src/components/Card/Card.vue +3 -3
- package/src/components/CardSelect/CardSelect.vue +10 -7
- package/src/components/ChangeIndicator/ChangeIndicator.vue +2 -2
- package/src/components/Checkbox/Checkbox.vue +5 -5
- package/src/components/CheckboxGroup/CheckboxGroup.stories.ts +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.vue +2 -2
- package/src/components/Checklist/Checklist.vue +3 -3
- package/src/components/Chip/Chip.stories.ts +1 -1
- package/src/components/Chip/Chip.vue +2 -2
- package/src/components/Divider/Divider.vue +4 -4
- package/src/components/EmptyState/EmptyState.vue +3 -3
- package/src/components/Footer/Footer.vue +4 -4
- package/src/components/FormField/FieldMessage.vue +3 -3
- package/src/components/FormField/FormField.stories.ts +1 -1
- package/src/components/FormField/FormField.vue +8 -3
- package/src/components/Header/Header.stories.ts +8 -8
- package/src/components/Header/Header.vue +6 -6
- package/src/components/InfoTip/InfoTip.stories.ts +1 -1
- package/src/components/InfoTip/InfoTip.vue +1 -1
- package/src/components/Input/Input.vue +1 -1
- package/src/components/InputCode/InputCode.stories.ts +1 -1
- package/src/components/InputCode/InputCode.vue +4 -4
- package/src/components/InputDate/InputDate.stories.ts +1 -1
- package/src/components/InputDate/InputDate.vue +5 -5
- package/src/components/InputNumber/InputNumber.stories.ts +1 -1
- package/src/components/InputNumber/InputNumber.vue +6 -6
- package/src/components/InputPassword/InputPassword.vue +4 -4
- package/src/components/InputRichText/InputRichText.stories.ts +1 -1
- package/src/components/InputRichText/InputRichText.vue +3 -3
- package/src/components/InputTextArea/InputTextArea.vue +1 -1
- package/src/components/Link/Link.stories.ts +4 -4
- package/src/components/Link/Link.vue +1 -1
- package/src/components/Menu/Menu.vue +6 -5
- package/src/components/Notification/Notification.stories.ts +3 -3
- package/src/components/Notification/Notification.vue +9 -9
- package/src/components/Notification/NotificationPane.vue +3 -3
- package/src/components/Notification/Toaster.vue +1 -1
- package/src/components/PageHeader/PageHeader.vue +2 -2
- package/src/components/Popover/Popover.stories.ts +2 -2
- package/src/components/Popover/popover.ts +4 -3
- package/src/components/Progress/Progress.vue +1 -1
- package/src/components/RadioGroup/RadioGroup.vue +6 -6
- package/src/components/RelativeTime/RelativeTime.stories.ts +1 -1
- package/src/components/Select/Select.stories.ts +1 -1
- package/src/components/Select/Select.vue +22 -18
- package/src/components/SettingsRow/SettingsRow.vue +1 -1
- package/src/components/Sidebar/Sidebar.stories.ts +2 -2
- package/src/components/Sidebar/Sidebar.vue +9 -9
- package/src/components/Slideover/Slideover.stories.ts +5 -5
- package/src/components/Slideover/Slideover.vue +6 -6
- package/src/components/Spinner/Spinner.stories.ts +7 -7
- package/src/components/Spinner/Spinner.vue +1 -1
- package/src/components/StatTile/StatTile.stories.ts +2 -2
- package/src/components/StatTile/StatTile.vue +6 -6
- package/src/components/Steps/Steps.vue +2 -2
- package/src/components/SummaryList/SummaryList.vue +8 -8
- package/src/components/Switch/Switch.vue +3 -3
- package/src/components/Table/Table.vue +12 -12
- package/src/components/Tabs/Tabs.vue +4 -4
- package/src/components/Tooltip/Tooltip.stories.ts +1 -1
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/components/UnsavedChangesBar/UnsavedChangesBar.stories.ts +1 -1
- package/src/components/UnsavedChangesBar/UnsavedChangesBar.vue +1 -1
- package/src/examples/AppPages.stories.ts +3 -3
- package/src/examples/FormLayout.stories.ts +3 -3
- package/src/examples/KestonIdPages.stories.ts +18 -18
- package/src/examples/SchoolPages.stories.ts +5 -5
- package/src/styles/theme.css +94 -5
|
@@ -61,7 +61,7 @@ const labelWidths = {
|
|
|
61
61
|
</script>
|
|
62
62
|
|
|
63
63
|
<template>
|
|
64
|
-
<div :class="cn('@container text-sm text-
|
|
64
|
+
<div :class="cn('@container text-sm text-ink', props.class)">
|
|
65
65
|
<dl
|
|
66
66
|
:class="
|
|
67
67
|
cn(
|
|
@@ -78,18 +78,18 @@ const labelWidths = {
|
|
|
78
78
|
:key="item.label"
|
|
79
79
|
:class="
|
|
80
80
|
cn(
|
|
81
|
-
'grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 border-b border-
|
|
81
|
+
'grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 border-b border-ink/10 py-3 first:pt-0 last:border-b-0 last:pb-0',
|
|
82
82
|
labelWidths[labelWidth]
|
|
83
83
|
)
|
|
84
84
|
"
|
|
85
85
|
>
|
|
86
|
-
<dt class="col-span-2 text-
|
|
86
|
+
<dt class="col-span-2 text-ink/65 @sm:col-span-1">{{ item.label }}</dt>
|
|
87
87
|
<dd :class="cn('min-w-0 break-words', item.emphasis && 'font-bold', !$slots.action && 'col-span-2')">
|
|
88
88
|
<slot name="value" :item="item" :index="index">
|
|
89
89
|
<template v-if="!isEmpty(item.value)">{{ item.value }}</template>
|
|
90
|
-
<template v-else><span class="text-
|
|
90
|
+
<template v-else><span class="text-ink/40" aria-hidden="true">—</span><span class="sr-only">{{ emptyLabel ?? t('ui.summaryList.notSet') }}</span></template>
|
|
91
91
|
</slot>
|
|
92
|
-
<span v-if="item.description" class="mt-0.5 block text-
|
|
92
|
+
<span v-if="item.description" class="mt-0.5 block text-ink/65">{{ item.description }}</span>
|
|
93
93
|
</dd>
|
|
94
94
|
<dd v-if="$slots.action" class="justify-self-end">
|
|
95
95
|
<slot name="action" :item="item" :index="index" />
|
|
@@ -104,7 +104,7 @@ const labelWidths = {
|
|
|
104
104
|
:key="item.label"
|
|
105
105
|
:class="layout === 'compact' ? 'col-span-2 grid grid-cols-subgrid items-baseline' : 'flex min-w-0 flex-col gap-1'"
|
|
106
106
|
>
|
|
107
|
-
<dt class="text-
|
|
107
|
+
<dt class="text-ink/65">{{ item.label }}</dt>
|
|
108
108
|
<dd
|
|
109
109
|
:class="
|
|
110
110
|
cn(
|
|
@@ -116,9 +116,9 @@ const labelWidths = {
|
|
|
116
116
|
>
|
|
117
117
|
<slot name="value" :item="item" :index="index">
|
|
118
118
|
<template v-if="!isEmpty(item.value)">{{ item.value }}</template>
|
|
119
|
-
<template v-else><span class="text-
|
|
119
|
+
<template v-else><span class="text-ink/40" aria-hidden="true">—</span><span class="sr-only">{{ emptyLabel ?? t('ui.summaryList.notSet') }}</span></template>
|
|
120
120
|
</slot>
|
|
121
|
-
<span v-if="item.description" class="mt-0.5 block font-normal text-
|
|
121
|
+
<span v-if="item.description" class="mt-0.5 block font-normal text-ink/65">{{ item.description }}</span>
|
|
122
122
|
<span v-if="$slots.action" class="mt-1 block font-normal"><slot name="action" :item="item" :index="index" /></span>
|
|
123
123
|
</dd>
|
|
124
124
|
</div>
|
|
@@ -62,7 +62,7 @@ function pressControl(event: MouseEvent, id: string) {
|
|
|
62
62
|
// 16px. Off is a mid grey, dark enough to see against the page.
|
|
63
63
|
const track = [
|
|
64
64
|
'inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full p-0.5 transition-colors',
|
|
65
|
-
'bg-
|
|
65
|
+
'bg-ink/45 not-disabled:hover:bg-ink/55 data-[state=checked]:bg-primary data-[state=checked]:hover:bg-primary',
|
|
66
66
|
'disabled:cursor-not-allowed',
|
|
67
67
|
'outline-2 outline-offset-2 outline-transparent focus-visible:outline-focus'
|
|
68
68
|
]
|
|
@@ -70,7 +70,7 @@ const thumb = 'size-4 rounded-full bg-white shadow-sm transition-transform data-
|
|
|
70
70
|
</script>
|
|
71
71
|
|
|
72
72
|
<template>
|
|
73
|
-
<div :class="cn('flex flex-col gap-1.5 text-
|
|
73
|
+
<div :class="cn('flex flex-col gap-1.5 text-ink', disabled && 'opacity-40', props.class)">
|
|
74
74
|
<div class="flex items-start gap-2">
|
|
75
75
|
<SwitchRoot
|
|
76
76
|
:id="controlId"
|
|
@@ -88,7 +88,7 @@ const thumb = 'size-4 rounded-full bg-white shadow-sm transition-transform data-
|
|
|
88
88
|
@click="pressControl($event, controlId)"
|
|
89
89
|
>
|
|
90
90
|
<label :for="controlId" :class="cn('text-sm', disabled ? 'cursor-not-allowed' : 'cursor-pointer')">{{ label }}</label>
|
|
91
|
-
<p v-if="description" :id="descriptionId" class="text-xs text-
|
|
91
|
+
<p v-if="description" :id="descriptionId" class="text-xs text-ink/65">
|
|
92
92
|
{{ description }}
|
|
93
93
|
</p>
|
|
94
94
|
</div>
|
|
@@ -175,7 +175,7 @@ const rowLinkClass = [
|
|
|
175
175
|
'focus-visible:after:outline-focus forced-colors:not-focus-visible:after:outline-0'
|
|
176
176
|
]
|
|
177
177
|
const linkedRowClass = [
|
|
178
|
-
'cursor-pointer hover:bg-
|
|
178
|
+
'cursor-pointer hover:bg-hover has-[[data-row-link]:focus-visible]:bg-hover',
|
|
179
179
|
'[&_:is(a,button,input,select,textarea,label,[tabindex]):not([data-row-link],[data-row-overlay])]:relative',
|
|
180
180
|
'[&_:is(a,button,input,select,textarea,label,[tabindex]):not([data-row-link],[data-row-overlay])]:z-1'
|
|
181
181
|
]
|
|
@@ -228,19 +228,19 @@ onBeforeUnmount(() => observer?.disconnect())
|
|
|
228
228
|
:aria-label="scrolls && !caption && !$slots.caption ? t('ui.table.table') : undefined"
|
|
229
229
|
>
|
|
230
230
|
<table
|
|
231
|
-
:class="cn('w-full border-separate border-spacing-0 text-left text-sm text-
|
|
231
|
+
:class="cn('w-full border-separate border-spacing-0 text-left text-sm text-ink', ui?.table)"
|
|
232
232
|
:aria-busy="loading || undefined"
|
|
233
233
|
>
|
|
234
234
|
<caption v-if="caption || $slots.caption" :id="captionId" :class="showCaption ? cn('px-4 pt-4 pb-2 text-left text-base font-bold', inset && 'sm:px-6') : 'sr-only'">
|
|
235
235
|
<slot name="caption">{{ caption }}</slot>
|
|
236
236
|
</caption>
|
|
237
237
|
|
|
238
|
-
<thead :class="cn(stickyHeader && 'sticky top-0 z-10 bg-
|
|
238
|
+
<thead :class="cn(stickyHeader && 'sticky top-0 z-10 bg-surface', ui?.header)">
|
|
239
239
|
<tr>
|
|
240
240
|
<th
|
|
241
241
|
v-if="selectable"
|
|
242
242
|
scope="col"
|
|
243
|
-
:class="cn('border-b border-
|
|
243
|
+
:class="cn('border-b border-ink/10', cellPadding, selectableKeys.length && selectCell)"
|
|
244
244
|
@click="onCellPress($event, () => selectableKeys.length && setAll(allState !== true))"
|
|
245
245
|
>
|
|
246
246
|
<Checkbox
|
|
@@ -257,7 +257,7 @@ onBeforeUnmount(() => observer?.disconnect())
|
|
|
257
257
|
:key="column.key"
|
|
258
258
|
scope="col"
|
|
259
259
|
:aria-sort="ariaSort(column)"
|
|
260
|
-
:class="cn('border-b border-
|
|
260
|
+
:class="cn('border-b border-ink/10 font-bold text-ink/65', cellPadding, columnClasses(column))"
|
|
261
261
|
>
|
|
262
262
|
<slot :name="`header-${column.key}`" :column="column">
|
|
263
263
|
<span v-if="column.hideLabel" class="sr-only">{{ column.label }}</span>
|
|
@@ -266,9 +266,9 @@ onBeforeUnmount(() => observer?.disconnect())
|
|
|
266
266
|
type="button"
|
|
267
267
|
:class="
|
|
268
268
|
cn(
|
|
269
|
-
'-mx-1 inline-flex cursor-pointer items-center gap-1 rounded px-1 font-bold hover:text-
|
|
269
|
+
'-mx-1 inline-flex cursor-pointer items-center gap-1 rounded px-1 font-bold hover:text-ink',
|
|
270
270
|
column.align === 'end' && 'flex-row-reverse',
|
|
271
|
-
sort?.key === column.key && 'text-
|
|
271
|
+
sort?.key === column.key && 'text-ink',
|
|
272
272
|
focusRing
|
|
273
273
|
)
|
|
274
274
|
"
|
|
@@ -277,7 +277,7 @@ onBeforeUnmount(() => observer?.disconnect())
|
|
|
277
277
|
{{ column.label }}
|
|
278
278
|
<ArrowUp v-if="sort?.key === column.key && sort.direction === 'asc'" class="size-4 shrink-0" aria-hidden="true" />
|
|
279
279
|
<ArrowDown v-else-if="sort?.key === column.key" class="size-4 shrink-0" aria-hidden="true" />
|
|
280
|
-
<ChevronsUpDown v-else class="size-4 shrink-0 text-
|
|
280
|
+
<ChevronsUpDown v-else class="size-4 shrink-0 text-ink/40" aria-hidden="true" />
|
|
281
281
|
</button>
|
|
282
282
|
<template v-else>{{ column.label }}</template>
|
|
283
283
|
</slot>
|
|
@@ -287,7 +287,7 @@ onBeforeUnmount(() => observer?.disconnect())
|
|
|
287
287
|
|
|
288
288
|
<tbody :class="cn(loading && shownRows.length && 'opacity-50 transition-opacity')">
|
|
289
289
|
<tr v-if="!shownRows.length">
|
|
290
|
-
<td :colspan="colspan" class="px-4 py-8 text-center text-
|
|
290
|
+
<td :colspan="colspan" class="px-4 py-8 text-center text-ink/65">
|
|
291
291
|
<span v-if="loading" class="inline-flex items-center gap-2">
|
|
292
292
|
<Spinner size="sm" />
|
|
293
293
|
Loading…
|
|
@@ -304,7 +304,7 @@ onBeforeUnmount(() => observer?.disconnect())
|
|
|
304
304
|
>
|
|
305
305
|
<td
|
|
306
306
|
v-if="selectable"
|
|
307
|
-
:class="cn('border-b border-
|
|
307
|
+
:class="cn('border-b border-ink/10 align-middle', !inset && 'group-last/row:border-b-0', cellPadding, canSelect(row) && selectCell)"
|
|
308
308
|
@click="canSelect(row) && onCellPress($event, () => setRow(row, index, !isSelected(row, index)))"
|
|
309
309
|
>
|
|
310
310
|
<Checkbox
|
|
@@ -322,7 +322,7 @@ onBeforeUnmount(() => observer?.disconnect())
|
|
|
322
322
|
:scope="column.rowHeader ? 'row' : undefined"
|
|
323
323
|
:class="
|
|
324
324
|
cn(
|
|
325
|
-
'border-b border-
|
|
325
|
+
'border-b border-ink/10 align-middle', !inset && 'group-last/row:border-b-0',
|
|
326
326
|
column.rowHeader ? 'font-bold' : 'font-normal',
|
|
327
327
|
column.align === 'end' && 'tabular-nums',
|
|
328
328
|
cellPadding,
|
|
@@ -368,7 +368,7 @@ onBeforeUnmount(() => observer?.disconnect())
|
|
|
368
368
|
v-if="$slots.footer"
|
|
369
369
|
:class="
|
|
370
370
|
cn(
|
|
371
|
-
'font-bold *:*:border-t *:*:border-
|
|
371
|
+
'font-bold *:*:border-t *:*:border-ink/10',
|
|
372
372
|
size === 'sm' ? '*:*:px-4 *:*:py-2' : '*:*:px-4 *:*:py-3',
|
|
373
373
|
inset && '*:*:sm:first:pl-6 *:*:sm:last:pr-6'
|
|
374
374
|
)
|
|
@@ -35,10 +35,10 @@ defineSlots<Record<string, () => unknown>>()
|
|
|
35
35
|
// Like Sidebar's items: muted until hovered or chosen; the chosen one is
|
|
36
36
|
// primary, with a bar under it that slides between tabs.
|
|
37
37
|
const trigger = [
|
|
38
|
-
'relative inline-flex h-10 items-center gap-2 px-3 text-sm whitespace-nowrap text-
|
|
38
|
+
'relative inline-flex h-10 items-center gap-2 px-3 text-sm whitespace-nowrap text-ink/65 outline-none',
|
|
39
39
|
'[&_svg]:size-4 [&_svg]:shrink-0',
|
|
40
|
-
'not-data-disabled:hover:text-
|
|
41
|
-
'data-[state=active]:font-bold data-[state=active]:text-primary',
|
|
40
|
+
'not-data-disabled:hover:text-ink',
|
|
41
|
+
'data-[state=active]:font-bold data-[state=active]:text-primary-fg',
|
|
42
42
|
'focus-visible:rounded focus-visible:ring-2 focus-visible:ring-primary',
|
|
43
43
|
'data-disabled:cursor-not-allowed data-disabled:opacity-40'
|
|
44
44
|
]
|
|
@@ -51,7 +51,7 @@ const trigger = [
|
|
|
51
51
|
@update:model-value="model = String($event)"
|
|
52
52
|
>
|
|
53
53
|
<!-- Scrolls sideways on narrow screens rather than wrapping. -->
|
|
54
|
-
<TabsList :aria-label="label" class="relative flex overflow-x-auto overflow-y-hidden border-b border-
|
|
54
|
+
<TabsList :aria-label="label" class="relative flex overflow-x-auto overflow-y-hidden border-b border-ink/10">
|
|
55
55
|
<TabsTrigger v-for="t in tabs" :key="t.value" :value="t.value" :disabled="t.disabled" :class="trigger">
|
|
56
56
|
<component :is="t.icon" v-if="t.icon" aria-hidden="true" />
|
|
57
57
|
{{ t.label }}
|
|
@@ -50,7 +50,7 @@ export const OnText: Story = {
|
|
|
50
50
|
<p class="text-sm">
|
|
51
51
|
Fees are due by the
|
|
52
52
|
<Tooltip text="Usually the first school day of each term">
|
|
53
|
-
<span tabindex="0" class="underline decoration-
|
|
53
|
+
<span tabindex="0" class="underline decoration-ink/40 decoration-dotted underline-offset-2 outline-focus focus-visible:outline-2">start of term</span>
|
|
54
54
|
</Tooltip>.
|
|
55
55
|
</p>`,
|
|
56
56
|
}),
|
|
@@ -72,7 +72,7 @@ const MaybeProvider: FunctionalComponent = (_, { slots }) =>
|
|
|
72
72
|
:collision-padding="8"
|
|
73
73
|
:class="
|
|
74
74
|
cn(
|
|
75
|
-
'z-100 max-w-72 rounded-md bg-
|
|
75
|
+
'z-100 max-w-72 rounded-md bg-neutral-900 dark:bg-neutral-700 px-2.5 py-1.5 text-xs/4 font-medium text-white shadow-lg ring-1 ring-white/10',
|
|
76
76
|
'data-[state=closed]:animate-fade-out data-[state=delayed-open]:animate-fade-in data-[state=instant-open]:animate-fade-in',
|
|
77
77
|
props.class
|
|
78
78
|
)
|
|
@@ -46,7 +46,7 @@ export const SlidesInAndOut: Story = {
|
|
|
46
46
|
<div class="flex flex-col items-start gap-4 p-6">
|
|
47
47
|
<p class="text-sm">The bar leaves a gap at the end of the page, so nothing is covered.</p>
|
|
48
48
|
<Button variant="primary" @click="open = true">Make a change</Button>
|
|
49
|
-
<div class="h-[60vh] w-full rounded-lg bg-surface" />
|
|
49
|
+
<div class="h-[60vh] w-full rounded-lg bg-surface-muted" />
|
|
50
50
|
<p class="text-sm">Last line of the page.</p>
|
|
51
51
|
<UnsavedChangesBar :open="open" :status="status" @discard="open = false" @save="save" />
|
|
52
52
|
</div>`,
|
|
@@ -69,7 +69,7 @@ const saving = computed(() => props.status === 'loading')
|
|
|
69
69
|
:class="cn('fixed inset-x-0 bottom-0 z-40 flex justify-center px-4 pb-4 pointer-events-none', props.class)"
|
|
70
70
|
>
|
|
71
71
|
<div
|
|
72
|
-
class="pointer-events-auto flex w-full max-w-2xl items-center justify-between gap-3 rounded-lg border border-
|
|
72
|
+
class="pointer-events-auto flex w-full max-w-2xl items-center justify-between gap-3 rounded-lg border border-ink/10 bg-surface-elevated p-3 pl-4 shadow-lg"
|
|
73
73
|
>
|
|
74
74
|
<p role="status" class="flex items-center gap-2 text-sm font-bold">
|
|
75
75
|
<span aria-hidden="true" class="size-2 shrink-0 rounded-full bg-yellow" />
|
|
@@ -106,7 +106,7 @@ const pageTemplate = `
|
|
|
106
106
|
|
|
107
107
|
<Card padding="none">
|
|
108
108
|
<Table :columns="columns" :rows="rows" row-key="name" :caption="current">
|
|
109
|
-
<template #cell-date="{ value }"><span class="text-
|
|
109
|
+
<template #cell-date="{ value }"><span class="text-ink/65">{{ value }}</span></template>
|
|
110
110
|
<template #cell-status="{ row }"><Badge :color="row.color" size="sm">{{ row.status }}</Badge></template>
|
|
111
111
|
</Table>
|
|
112
112
|
</Card>
|
|
@@ -416,7 +416,7 @@ export const NewSchoolYearSetup: Story = {
|
|
|
416
416
|
Start new year
|
|
417
417
|
</Button>
|
|
418
418
|
</template>
|
|
419
|
-
<p v-if="checked && errorCount" role="alert" class="text-sm text-red">
|
|
419
|
+
<p v-if="checked && errorCount" role="alert" class="text-sm text-red-fg">
|
|
420
420
|
{{ errorCount === 1 ? 'There is 1 thing' : 'There are ' + errorCount + ' things' }} to fix before the new year can start.
|
|
421
421
|
</p>
|
|
422
422
|
</PageHeader>
|
|
@@ -487,7 +487,7 @@ export const NewSchoolYearSetup: Story = {
|
|
|
487
487
|
<Divider />
|
|
488
488
|
<div class="flex flex-col gap-2">
|
|
489
489
|
<h3 class="text-sm font-bold">Sign-off</h3>
|
|
490
|
-
<p class="text-sm text-
|
|
490
|
+
<p class="text-sm text-ink/65">Starting the year needs one of these people.</p>
|
|
491
491
|
<AvatarGroup :users="signOff" size="sm" label="People who can sign off" />
|
|
492
492
|
</div>
|
|
493
493
|
</Card>
|
|
@@ -97,10 +97,10 @@ export const AddStudent: Story = {
|
|
|
97
97
|
return { form, errors, errorCount, status, formEl, todayIso, check, recheck, submit, reset };
|
|
98
98
|
},
|
|
99
99
|
template: `
|
|
100
|
-
<form ref="formEl" novalidate class="flex max-w-md flex-col gap-5 text-
|
|
100
|
+
<form ref="formEl" novalidate class="flex max-w-md flex-col gap-5 text-ink" @submit.prevent="submit">
|
|
101
101
|
<div>
|
|
102
102
|
<h2 class="text-lg">Add student</h2>
|
|
103
|
-
<p class="text-sm text-
|
|
103
|
+
<p class="text-sm text-ink/65">Fields check themselves when you leave them. Try "Create student" with the form empty.</p>
|
|
104
104
|
</div>
|
|
105
105
|
|
|
106
106
|
<div class="grid grid-cols-2 items-start gap-3">
|
|
@@ -167,7 +167,7 @@ export const AddStudent: Story = {
|
|
|
167
167
|
<template #leading><IdCard /></template>
|
|
168
168
|
</Input>
|
|
169
169
|
|
|
170
|
-
<div class="flex justify-end gap-2 border-t border-
|
|
170
|
+
<div class="flex justify-end gap-2 border-t border-ink/10 pt-4">
|
|
171
171
|
<Button @click="reset">Reset</Button>
|
|
172
172
|
<Button
|
|
173
173
|
v-model:status="status"
|
|
@@ -102,12 +102,12 @@ const appState = () => ({
|
|
|
102
102
|
// logo: swap it for the SVG when there is one.
|
|
103
103
|
const brands = {
|
|
104
104
|
tkg: `
|
|
105
|
-
<div class="flex items-center justify-center gap-2 text-primary">
|
|
105
|
+
<div class="flex items-center justify-center gap-2 text-primary-fg">
|
|
106
106
|
<span class="flex size-8 items-center justify-center rounded bg-primary text-xs font-bold text-white" aria-hidden="true">TKG</span>
|
|
107
107
|
<span class="text-lg font-bold">The Keston Group</span>
|
|
108
108
|
</div>`,
|
|
109
109
|
kestonId: `
|
|
110
|
-
<div class="flex items-center justify-center gap-2 text-primary">
|
|
110
|
+
<div class="flex items-center justify-center gap-2 text-primary-fg">
|
|
111
111
|
<ShieldCheck class="size-6" aria-hidden="true" />
|
|
112
112
|
<span class="text-lg font-bold">Keston ID</span>
|
|
113
113
|
</div>`,
|
|
@@ -116,11 +116,11 @@ const brands = {
|
|
|
116
116
|
// Every Keston ID page: a narrow column centred on the grey background, with
|
|
117
117
|
// the branding above the card.
|
|
118
118
|
const page = (body: string, brand: keyof typeof brands = "kestonId") => `
|
|
119
|
-
<div class="flex min-h-screen flex-col items-center bg-background px-4 py-12 text-
|
|
119
|
+
<div class="flex min-h-screen flex-col items-center bg-background px-4 py-12 text-ink">
|
|
120
120
|
<div class="flex w-full max-w-100 flex-col gap-6">
|
|
121
121
|
${brands[brand]}
|
|
122
122
|
${body}
|
|
123
|
-
<nav aria-label="Legal and help" class="flex items-center justify-center gap-2 text-xs text-
|
|
123
|
+
<nav aria-label="Legal and help" class="flex items-center justify-center gap-2 text-xs text-ink/65">
|
|
124
124
|
<Link href="#" new-tab class="py-1">Privacy</Link>
|
|
125
125
|
<span aria-hidden="true">·</span>
|
|
126
126
|
<Link href="#" new-tab class="py-1">Terms</Link>
|
|
@@ -150,7 +150,7 @@ const appName = (headingId: string) => `
|
|
|
150
150
|
<button
|
|
151
151
|
type="button"
|
|
152
152
|
:aria-label="mark.label"
|
|
153
|
-
:class="client.verification === 'owned' ? 'text-kblue' : 'text-blue'"
|
|
153
|
+
:class="client.verification === 'owned' ? 'text-kblue' : 'text-blue-fg'"
|
|
154
154
|
class="flex cursor-pointer rounded-full outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus"
|
|
155
155
|
>
|
|
156
156
|
<BadgeCheck class="size-5" aria-hidden="true" />
|
|
@@ -202,14 +202,14 @@ const consentCard = `
|
|
|
202
202
|
<div class="flex flex-col gap-6">
|
|
203
203
|
<div class="flex items-center justify-center gap-3" aria-hidden="true">
|
|
204
204
|
<Avatar :user="app" size="lg" decorative />
|
|
205
|
-
<ArrowLeftRight class="size-5 text-
|
|
205
|
+
<ArrowLeftRight class="size-5 text-ink/55" />
|
|
206
206
|
<Avatar :user="user" size="lg" decorative />
|
|
207
207
|
</div>
|
|
208
208
|
|
|
209
209
|
<div class="flex flex-col gap-1 text-center">
|
|
210
210
|
${appName("consent-heading")}
|
|
211
211
|
<p class="text-base">wants to access your Keston account</p>
|
|
212
|
-
<p class="text-sm text-
|
|
212
|
+
<p class="text-sm text-ink/65">An app by {{ client.publisher }}</p>
|
|
213
213
|
</div>
|
|
214
214
|
|
|
215
215
|
<!-- Who's signed in, as a small Card in a row. -->
|
|
@@ -218,7 +218,7 @@ const consentCard = `
|
|
|
218
218
|
<Avatar :user="user" size="sm" decorative />
|
|
219
219
|
<div class="flex min-w-0 flex-col">
|
|
220
220
|
<span class="truncate text-sm font-bold">{{ user.name }}</span>
|
|
221
|
-
<span class="truncate text-xs text-
|
|
221
|
+
<span class="truncate text-xs text-ink/65">{{ user.email }}</span>
|
|
222
222
|
</div>
|
|
223
223
|
</div>
|
|
224
224
|
<Button size="sm" class="shrink-0">Switch account</Button>
|
|
@@ -228,10 +228,10 @@ const consentCard = `
|
|
|
228
228
|
<h2 class="text-sm font-bold">This will let {{ client.name }}:</h2>
|
|
229
229
|
<ul class="flex flex-col gap-3">
|
|
230
230
|
<li v-for="scope in required" :key="scope.id" class="flex items-start gap-3">
|
|
231
|
-
<component :is="scope.icon" class="mt-0.5 size-4 shrink-0 text-
|
|
231
|
+
<component :is="scope.icon" class="mt-0.5 size-4 shrink-0 text-ink/65" aria-hidden="true" />
|
|
232
232
|
<div class="flex flex-col gap-0.5">
|
|
233
233
|
<span class="text-sm">{{ scope.label }}</span>
|
|
234
|
-
<span class="text-xs text-
|
|
234
|
+
<span class="text-xs text-ink/65">{{ scope.description }}</span>
|
|
235
235
|
</div>
|
|
236
236
|
</li>
|
|
237
237
|
</ul>
|
|
@@ -250,8 +250,8 @@ const consentCard = `
|
|
|
250
250
|
|
|
251
251
|
<Divider />
|
|
252
252
|
|
|
253
|
-
<p class="text-xs text-
|
|
254
|
-
You'll be sent to <span class="font-bold text-
|
|
253
|
+
<p class="text-xs text-ink/65">
|
|
254
|
+
You'll be sent to <span class="font-bold text-ink">{{ client.redirectHost }}</span>.
|
|
255
255
|
Make sure you trust {{ client.name }}: read its
|
|
256
256
|
<Link href="#" new-tab>privacy policy</Link>
|
|
257
257
|
and
|
|
@@ -266,7 +266,7 @@ const consentCard = `
|
|
|
266
266
|
</Button>
|
|
267
267
|
</div>
|
|
268
268
|
|
|
269
|
-
<p v-if="result" class="break-all rounded bg-surface px-3 py-2 font-mono text-xs" role="status">{{ result }}</p>
|
|
269
|
+
<p v-if="result" class="break-all rounded bg-surface-muted px-3 py-2 font-mono text-xs" role="status">{{ result }}</p>
|
|
270
270
|
</div>
|
|
271
271
|
</Card>`;
|
|
272
272
|
|
|
@@ -315,7 +315,7 @@ export const SignIn: Story = {
|
|
|
315
315
|
<div class="flex flex-col gap-1 text-center">
|
|
316
316
|
${appName("sign-in-heading")}
|
|
317
317
|
<p class="text-base">Sign in with your Keston account</p>
|
|
318
|
-
<p class="text-sm text-
|
|
318
|
+
<p class="text-sm text-ink/65">An app by {{ client.publisher }}</p>
|
|
319
319
|
</div>
|
|
320
320
|
|
|
321
321
|
<form class="flex flex-col gap-4" @submit.prevent="signIn">
|
|
@@ -327,7 +327,7 @@ export const SignIn: Story = {
|
|
|
327
327
|
<InputPassword v-model="form.password" label="Password" :error-text="error">
|
|
328
328
|
<template #leading><Lock /></template>
|
|
329
329
|
<template #label-trailing>
|
|
330
|
-
<Link href="#" class="text-
|
|
330
|
+
<Link href="#" class="text-ink/65">Forgot password?</Link>
|
|
331
331
|
</template>
|
|
332
332
|
</InputPassword>
|
|
333
333
|
<Button type="submit" variant="primary" :status="status" loading-text="Signing in" success-text="Signed in">
|
|
@@ -338,7 +338,7 @@ export const SignIn: Story = {
|
|
|
338
338
|
<Button>Sign in with a passkey</Button>
|
|
339
339
|
</div>
|
|
340
340
|
<template #footer>
|
|
341
|
-
<p class="text-center text-xs text-
|
|
341
|
+
<p class="text-center text-xs text-ink/65">
|
|
342
342
|
By signing in, you agree to our <Link href="#" new-tab>terms</Link>
|
|
343
343
|
and <Link href="#" new-tab>privacy policy</Link>.
|
|
344
344
|
</p>
|
|
@@ -392,8 +392,8 @@ export const TwoStepCode: Story = {
|
|
|
392
392
|
<Button type="submit" variant="primary" :disabled="status === 'loading'">Continue</Button>
|
|
393
393
|
</form>
|
|
394
394
|
<template #footer>
|
|
395
|
-
<Link href="#" class="py-1 text-xs text-
|
|
396
|
-
<Link href="#" class="py-1 text-xs text-
|
|
395
|
+
<Link href="#" class="py-1 text-xs text-ink/65">Use a backup code</Link>
|
|
396
|
+
<Link href="#" class="py-1 text-xs text-ink/65">Email me a code</Link>
|
|
397
397
|
</template>
|
|
398
398
|
</Card>`, "tkg"),
|
|
399
399
|
}),
|
|
@@ -199,7 +199,7 @@ export const StudentRecord: Story = {
|
|
|
199
199
|
<div class="grid grid-cols-1 gap-6 @lg:grid-cols-3">
|
|
200
200
|
<StatTile label="Attendance" value="96.4%" change="+1.2%" change-label="on last term" trend="up">
|
|
201
201
|
<template #footer>
|
|
202
|
-
<span class="flex items-center gap-1 text-xs text-
|
|
202
|
+
<span class="flex items-center gap-1 text-xs text-ink/65">
|
|
203
203
|
This term
|
|
204
204
|
<InfoTip label="About attendance" text="Sessions attended as a share of possible sessions. Authorised absences count against it." />
|
|
205
205
|
</span>
|
|
@@ -236,7 +236,7 @@ export const StudentRecord: Story = {
|
|
|
236
236
|
{{ contact.name }}
|
|
237
237
|
<Badge v-if="contact.primary" size="sm">Primary</Badge>
|
|
238
238
|
</span>
|
|
239
|
-
<span class="text-xs text-
|
|
239
|
+
<span class="text-xs text-ink/65">{{ contact.relation }}</span>
|
|
240
240
|
</div>
|
|
241
241
|
</div>
|
|
242
242
|
<div class="flex flex-wrap gap-2">
|
|
@@ -251,7 +251,7 @@ export const StudentRecord: Story = {
|
|
|
251
251
|
<ul class="flex flex-col gap-3 text-sm">
|
|
252
252
|
<li v-for="item in activity" :key="item.text" class="flex flex-col gap-0.5">
|
|
253
253
|
<span>{{ item.text }}</span>
|
|
254
|
-
<span class="text-xs text-
|
|
254
|
+
<span class="text-xs text-ink/65">{{ item.by }} · <RelativeTime :date="item.at" :now="now" /></span>
|
|
255
255
|
</li>
|
|
256
256
|
</ul>
|
|
257
257
|
</Card>
|
|
@@ -420,7 +420,7 @@ export const ApplicationReview: Story = {
|
|
|
420
420
|
|
|
421
421
|
<Card padding="none">
|
|
422
422
|
<Table v-model:sort="sort" :columns="columns" :rows="applications" row-key="id" caption="Applications">
|
|
423
|
-
<template #cell-submitted="{ row }"><span class="text-
|
|
423
|
+
<template #cell-submitted="{ row }"><span class="text-ink/65"><RelativeTime :date="row.submitted" :now="now" /></span></template>
|
|
424
424
|
<template #cell-status="{ row }"><Badge :color="statusColour[row.status]" size="sm">{{ row.status }}</Badge></template>
|
|
425
425
|
<template #cell-review="{ row }">
|
|
426
426
|
<Button size="sm" :aria-label="'Review ' + row.name" @click="review(row)">Review</Button>
|
|
@@ -547,7 +547,7 @@ export const InterviewBooking: Story = {
|
|
|
547
547
|
</Card>
|
|
548
548
|
|
|
549
549
|
<Card :title="dayLabel ? 'Times on ' + dayLabel : 'Times'">
|
|
550
|
-
<p v-if="weekend" class="text-sm text-
|
|
550
|
+
<p v-if="weekend" class="text-sm text-ink/65">No interviews at weekends. Choose a weekday.</p>
|
|
551
551
|
<template v-else>
|
|
552
552
|
<RadioGroup v-model="slot" label="Time" :options="slots" :error-text="slotError" />
|
|
553
553
|
<Select v-model="interviewer" label="Interviewer" :options="interviewers" placeholder="Choose…" :error-text="interviewerError" />
|
package/src/styles/theme.css
CHANGED
|
@@ -26,19 +26,72 @@
|
|
|
26
26
|
|
|
27
27
|
@theme {
|
|
28
28
|
--font-sans: "Lato", sans-serif;
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* Colours
|
|
32
|
+
* -------
|
|
33
|
+
* Each colour holds its light and dark value: light-dark(light, dark). The
|
|
34
|
+
* browser picks one from the element's color-scheme, set by data-theme (see
|
|
35
|
+
* "Dark mode" at the end of this file). Tailwind's shades are named in
|
|
36
|
+
* comments; hex values for native apps are in tokens/README.md.
|
|
37
|
+
*
|
|
38
|
+
* black / white never change. Use them only where the colour must stay the
|
|
39
|
+
* same in both modes: white text on a coloured fill, black text on yellow,
|
|
40
|
+
* the dimmed backdrop behind a Slideover.
|
|
41
|
+
*
|
|
42
|
+
* Everything else uses the colours below:
|
|
43
|
+
* - ink: text, icons, borders and tints, usually with an opacity:
|
|
44
|
+
* text-ink (body text), text-ink/65 (secondary text), border-ink/10
|
|
45
|
+
* (cards, dividers, buttons), border-ink/45 (outlines of form fields,
|
|
46
|
+
* checkboxes and radios: 3:1 contrast, WCAG 1.4.11).
|
|
47
|
+
* - background: the page. surface: cards, fields, header, sidebar.
|
|
48
|
+
* surface-elevated: things that float (popovers, menus, toasts). In dark
|
|
49
|
+
* mode it's a step lighter, as shadows barely show on dark.
|
|
50
|
+
* surface-muted: a solid grey fill, e.g. the "+3" in an AvatarGroup.
|
|
51
|
+
*/
|
|
29
52
|
--color-white: #fafafa;
|
|
30
53
|
--color-black: #050505;
|
|
31
|
-
--color-
|
|
54
|
+
--color-ink: light-dark(#050505, oklch(98.5% 0 0)); /* dark: neutral-50 */
|
|
55
|
+
--color-background: light-dark(oklch(97% 0 0), oklch(14.5% 0 0)); /* neutral-100 / 950 */
|
|
56
|
+
--color-surface: light-dark(#ffffff, oklch(20.5% 0 0)); /* white / neutral-900 */
|
|
57
|
+
--color-surface-elevated: light-dark(#ffffff, oklch(26.9% 0 0)); /* white / neutral-800 */
|
|
58
|
+
--color-surface-muted: light-dark(oklch(92.2% 0 0), oklch(26.9% 0 0)); /* neutral-200 / 800 */
|
|
59
|
+
|
|
60
|
+
/* Brand and status colours as fills: white text on them (black on yellow).
|
|
61
|
+
Dark mode lightens Keston blue (sky-700) so primary buttons, switches and
|
|
62
|
+
checkboxes stand out from the dark page; white text on it still passes. */
|
|
32
63
|
--color-kblue: #023750;
|
|
33
|
-
--color-
|
|
34
|
-
--color-surface: #ebebeb;
|
|
35
|
-
--color-surface-elevated: #f2f2f2;
|
|
64
|
+
--color-primary: light-dark(var(--color-kblue), oklch(50% 0.134 242.749)); /* dark: sky-700 */
|
|
36
65
|
--color-green: #007a16;
|
|
37
66
|
--color-yellow: #f1c70b;
|
|
38
67
|
--color-red: #d2042d;
|
|
39
68
|
--color-blue: #035483;
|
|
40
69
|
--color-focus: #007fc9;
|
|
41
|
-
|
|
70
|
+
|
|
71
|
+
/* The same colours as text or icons, e.g. text-red-fg for an error message.
|
|
72
|
+
Light: the fill colour, or a darker amber for yellow (yellow text on
|
|
73
|
+
white fails contrast). Dark: lighter shades that pass 4.5:1. */
|
|
74
|
+
--color-primary-fg: light-dark(var(--color-kblue), oklch(82.8% 0.111 230.318)); /* dark: sky-300 */
|
|
75
|
+
--color-green-fg: light-dark(var(--color-green), oklch(79.2% 0.209 151.711)); /* dark: green-400 */
|
|
76
|
+
--color-red-fg: light-dark(var(--color-red), oklch(70.4% 0.191 22.216)); /* dark: red-400 */
|
|
77
|
+
--color-blue-fg: light-dark(var(--color-blue), oklch(80.9% 0.105 251.813)); /* dark: blue-300 */
|
|
78
|
+
--color-yellow-fg: light-dark(oklch(55.4% 0.135 66.442), var(--color-yellow)); /* light: yellow-700 */
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
* States: one look for hover, press and selection everywhere.
|
|
82
|
+
* - hover / pressed / selected: see-through tints for things with no fill
|
|
83
|
+
* of their own (ghost buttons, menu items, table rows, sidebar items).
|
|
84
|
+
* - surface-hover / surface-pressed: solid, for things filled with surface
|
|
85
|
+
* (basic buttons, the buttons inside fields), so they lighten in dark
|
|
86
|
+
* mode rather than darken.
|
|
87
|
+
* Coloured fills (primary, danger) darken instead: brightness-90 / 80.
|
|
88
|
+
* Disabled is opacity-40. Focus is a 2px outline-focus ring, keyboard only.
|
|
89
|
+
*/
|
|
90
|
+
--color-hover: color-mix(in oklab, var(--color-ink) 5%, transparent);
|
|
91
|
+
--color-pressed: color-mix(in oklab, var(--color-ink) 10%, transparent);
|
|
92
|
+
--color-selected: var(--color-pressed);
|
|
93
|
+
--color-surface-hover: color-mix(in oklab, var(--color-surface) 95%, var(--color-ink));
|
|
94
|
+
--color-surface-pressed: color-mix(in oklab, var(--color-surface) 90%, var(--color-ink));
|
|
42
95
|
|
|
43
96
|
/* Radius e.g. --radius-control: …; */
|
|
44
97
|
|
|
@@ -99,3 +152,39 @@
|
|
|
99
152
|
80% { rotate: 4deg; }
|
|
100
153
|
}
|
|
101
154
|
}
|
|
155
|
+
|
|
156
|
+
/*
|
|
157
|
+
* Dark mode
|
|
158
|
+
* ---------
|
|
159
|
+
* Opt-in per app, on the <html> element (or any element, for one section):
|
|
160
|
+
*
|
|
161
|
+
* data-theme="light" always light (also the default with no attribute)
|
|
162
|
+
* data-theme="dark" always dark
|
|
163
|
+
* data-theme="system" follows the device setting
|
|
164
|
+
*
|
|
165
|
+
* color-scheme drives every light-dark() colour above, and also the browser's
|
|
166
|
+
* own parts: scrollbars, date pickers, autofill.
|
|
167
|
+
*/
|
|
168
|
+
:root,
|
|
169
|
+
[data-theme="light"] {
|
|
170
|
+
color-scheme: light;
|
|
171
|
+
}
|
|
172
|
+
[data-theme="dark"] {
|
|
173
|
+
color-scheme: dark;
|
|
174
|
+
}
|
|
175
|
+
[data-theme="system"] {
|
|
176
|
+
color-scheme: light dark;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Tailwind's dark: variant follows the same switch, for the rare case a
|
|
180
|
+
colour token can't express (e.g. Tooltip). */
|
|
181
|
+
@custom-variant dark {
|
|
182
|
+
&:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
183
|
+
@slot;
|
|
184
|
+
}
|
|
185
|
+
@media (prefers-color-scheme: dark) {
|
|
186
|
+
&:where([data-theme="system"], [data-theme="system"] *) {
|
|
187
|
+
@slot;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|