@thekestongroup/ui 0.13.1 → 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/AppLauncher/AppLauncher.vue.d.ts +3 -2
- package/dist/components/AppShell/AppShell.vue.d.ts +1 -1
- package/dist/components/Header/Header.vue.d.ts +2 -1
- package/dist/components/Popover/popover.d.ts +3 -2
- package/dist/components/Spinner/Spinner.vue.d.ts +1 -1
- package/dist/keston-ui.js +703 -699
- package/package.json +1 -1
- package/src/components/AppLauncher/AppLauncher.stories.ts +1 -1
- package/src/components/AppLauncher/AppLauncher.vue +9 -12
- package/src/components/AppLauncher/apps.ts +5 -5
- package/src/components/AppShell/AppShell.stories.ts +2 -2
- package/src/components/AppShell/AppShell.vue +10 -9
- 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 +10 -7
- 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
|
@@ -29,10 +29,10 @@ const props = defineProps<ChecklistProps>()
|
|
|
29
29
|
<li v-for="item in items" :key="item.label" class="flex items-start gap-2">
|
|
30
30
|
<!-- h-5 keeps the icon level with the first line of a label that wraps. -->
|
|
31
31
|
<span class="flex h-5 shrink-0 items-center">
|
|
32
|
-
<CircleCheck v-if="item.done" class="size-4 text-green" aria-hidden="true" />
|
|
33
|
-
<Circle v-else :class="cn('size-4', invalid ? 'text-red' : 'text-
|
|
32
|
+
<CircleCheck v-if="item.done" class="size-4 text-green-fg" aria-hidden="true" />
|
|
33
|
+
<Circle v-else :class="cn('size-4', invalid ? 'text-red-fg' : 'text-ink/40')" aria-hidden="true" />
|
|
34
34
|
</span>
|
|
35
|
-
<span :class="item.done ? 'text-
|
|
35
|
+
<span :class="item.done ? 'text-ink' : 'text-ink/65'">
|
|
36
36
|
{{ item.label }}<span class="sr-only">{{ item.done ? ' (done)' : ' (to do)' }}</span>
|
|
37
37
|
</span>
|
|
38
38
|
</li>
|
|
@@ -65,7 +65,7 @@ export const Removable: Story = {
|
|
|
65
65
|
<template #leading><component :is="subject.icon" /></template>
|
|
66
66
|
{{ subject.label }}
|
|
67
67
|
</Chip>
|
|
68
|
-
<span v-if="!subjects.length" class="text-sm text-
|
|
68
|
+
<span v-if="!subjects.length" class="text-sm text-ink/65">All removed</span>
|
|
69
69
|
</div>`,
|
|
70
70
|
}),
|
|
71
71
|
};
|
|
@@ -43,7 +43,7 @@ defineSlots<{
|
|
|
43
43
|
// Light grey fill and the shared border, so it reads as a chosen item on a
|
|
44
44
|
// white field without competing with buttons.
|
|
45
45
|
const base = [
|
|
46
|
-
'inline-flex max-w-full shrink-0 items-center whitespace-nowrap rounded border border-
|
|
46
|
+
'inline-flex max-w-full shrink-0 items-center whitespace-nowrap rounded border border-ink/10 bg-ink/5 text-ink',
|
|
47
47
|
'[&_svg]:shrink-0'
|
|
48
48
|
]
|
|
49
49
|
|
|
@@ -75,7 +75,7 @@ const removeSizes: Record<NonNullable<ChipProps['size']>, string> = {
|
|
|
75
75
|
:disabled="disabled"
|
|
76
76
|
:class="cn(
|
|
77
77
|
'flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition',
|
|
78
|
-
'not-disabled:hover:bg-
|
|
78
|
+
'not-disabled:hover:bg-hover not-disabled:active:bg-pressed disabled:cursor-not-allowed',
|
|
79
79
|
'outline-2 outline-offset-0 outline-transparent focus-visible:outline-focus',
|
|
80
80
|
removeSizes[size]
|
|
81
81
|
)"
|
|
@@ -38,11 +38,11 @@ defineSlots<{ default?(): unknown }>()
|
|
|
38
38
|
v-if="orientation === 'horizontal' && (label || $slots.default)"
|
|
39
39
|
:role="decorative ? 'presentation' : 'separator'"
|
|
40
40
|
:aria-label="decorative ? undefined : label"
|
|
41
|
-
:class="cn('flex w-full items-center gap-3 text-xs text-
|
|
41
|
+
:class="cn('flex w-full items-center gap-3 text-xs text-ink/65', props.class)"
|
|
42
42
|
>
|
|
43
|
-
<span aria-hidden="true" class="h-px flex-1 bg-
|
|
43
|
+
<span aria-hidden="true" class="h-px flex-1 bg-ink/10" />
|
|
44
44
|
<span class="shrink-0"><slot>{{ label }}</slot></span>
|
|
45
|
-
<span aria-hidden="true" class="h-px flex-1 bg-
|
|
45
|
+
<span aria-hidden="true" class="h-px flex-1 bg-ink/10" />
|
|
46
46
|
</div>
|
|
47
47
|
|
|
48
48
|
<Separator
|
|
@@ -50,7 +50,7 @@ defineSlots<{ default?(): unknown }>()
|
|
|
50
50
|
:orientation="orientation"
|
|
51
51
|
:decorative="decorative"
|
|
52
52
|
:class="cn(
|
|
53
|
-
'shrink-0 bg-
|
|
53
|
+
'shrink-0 bg-ink/10',
|
|
54
54
|
orientation === 'horizontal' ? 'h-px w-full' : 'w-px self-stretch',
|
|
55
55
|
props.class
|
|
56
56
|
)"
|
|
@@ -59,21 +59,21 @@ const sizes = {
|
|
|
59
59
|
|
|
60
60
|
<template>
|
|
61
61
|
<div :class="cn('flex flex-col items-center text-center', sizes[size].root, props.class)">
|
|
62
|
-
<div v-if="icon" :class="cn('flex text-
|
|
62
|
+
<div v-if="icon" :class="cn('flex text-ink/45', size === 'md' && 'mb-1', ui?.icon)" aria-hidden="true">
|
|
63
63
|
<component :is="icon" :class="sizes[size].icon" />
|
|
64
64
|
</div>
|
|
65
65
|
|
|
66
66
|
<component
|
|
67
67
|
:is="headingLevel ? `h${headingLevel}` : 'p'"
|
|
68
68
|
v-if="$slots.title || title"
|
|
69
|
-
:class="cn('font-bold text-
|
|
69
|
+
:class="cn('font-bold text-ink', sizes[size].title, ui?.title)"
|
|
70
70
|
>
|
|
71
71
|
<slot name="title">{{ title }}</slot>
|
|
72
72
|
</component>
|
|
73
73
|
|
|
74
74
|
<p
|
|
75
75
|
v-if="$slots.description || description"
|
|
76
|
-
:class="cn('max-w-sm text-
|
|
76
|
+
:class="cn('max-w-sm text-ink/65', sizes[size].description, ui?.description)"
|
|
77
77
|
>
|
|
78
78
|
<slot name="description">{{ description }}</slot>
|
|
79
79
|
</p>
|
|
@@ -84,7 +84,7 @@ function linkAttrs(link: FooterLink) {
|
|
|
84
84
|
<template>
|
|
85
85
|
<footer
|
|
86
86
|
:class="cn(
|
|
87
|
-
'flex shrink-0 flex-col gap-3 border-t border-
|
|
87
|
+
'flex shrink-0 flex-col gap-3 border-t border-ink/10 bg-surface px-4 py-4 text-sm text-ink/65 sm:flex-row sm:items-center sm:justify-between sm:px-6',
|
|
88
88
|
props.class
|
|
89
89
|
)"
|
|
90
90
|
>
|
|
@@ -94,7 +94,7 @@ function linkAttrs(link: FooterLink) {
|
|
|
94
94
|
<li v-for="link in links" :key="link.label">
|
|
95
95
|
<Link v-bind="linkAttrs(link)" :icon="false">{{ link.label }}</Link>
|
|
96
96
|
</li>
|
|
97
|
-
<li v-if="moreLinks.length" class="hidden h-4 w-px bg-
|
|
97
|
+
<li v-if="moreLinks.length" class="hidden h-4 w-px bg-ink/10 sm:block" aria-hidden="true"></li>
|
|
98
98
|
<li v-for="link in moreLinks" :key="link.label">
|
|
99
99
|
<Link v-bind="linkAttrs(link)" :icon="false">{{ link.label }}</Link>
|
|
100
100
|
</li>
|
|
@@ -104,7 +104,7 @@ function linkAttrs(link: FooterLink) {
|
|
|
104
104
|
|
|
105
105
|
<div :class="cn('flex flex-wrap items-center gap-x-3 gap-y-1 sm:justify-end', ui?.meta)">
|
|
106
106
|
<p v-if="appName || version || build" class="flex flex-wrap items-baseline gap-x-1.5">
|
|
107
|
-
<span v-if="appName" class="font-bold text-
|
|
107
|
+
<span v-if="appName" class="font-bold text-ink/80">{{ appName }}</span>
|
|
108
108
|
<!-- Shows as "v1.4.2" but reads as "Version 1.4.2". -->
|
|
109
109
|
<span v-if="version">
|
|
110
110
|
<span class="sr-only">{{ versionLabel }}</span>
|
|
@@ -113,7 +113,7 @@ function linkAttrs(link: FooterLink) {
|
|
|
113
113
|
<!-- Shows as "a1b2c3d" in monospace but reads as "Build a1b2c3d". -->
|
|
114
114
|
<span v-if="build" :title="buildLabel">
|
|
115
115
|
<span class="sr-only">{{ buildLabel }}</span>
|
|
116
|
-
<span class="font-mono text-xs text-
|
|
116
|
+
<span class="font-mono text-xs text-ink/55" aria-hidden="true">{{ build }}</span>
|
|
117
117
|
</span>
|
|
118
118
|
</p>
|
|
119
119
|
<p>{{ t('ui.footer.copyright', { years, holder }) }}</p>
|
|
@@ -34,9 +34,9 @@ watch(
|
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
const colour: Record<FieldStatus, string> = {
|
|
37
|
-
error: 'text-red',
|
|
38
|
-
success: 'text-green',
|
|
39
|
-
loading: 'text-
|
|
37
|
+
error: 'text-red-fg',
|
|
38
|
+
success: 'text-green-fg',
|
|
39
|
+
loading: 'text-ink/65'
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const icon = { error: CircleAlert, success: CircleCheck } as const
|
|
@@ -32,7 +32,7 @@ const meta = {
|
|
|
32
32
|
:disabled="args.disabled"
|
|
33
33
|
:aria-invalid="invalid"
|
|
34
34
|
:aria-describedby="describedBy"
|
|
35
|
-
class="min-h-5 min-w-0 flex-1 resize-y bg-transparent outline-none placeholder:text-
|
|
35
|
+
class="min-h-5 min-w-0 flex-1 resize-y bg-transparent outline-none placeholder:text-ink/55 disabled:cursor-not-allowed"
|
|
36
36
|
/>
|
|
37
37
|
</template>
|
|
38
38
|
</FormField>`,
|
|
@@ -105,9 +105,14 @@ function focusUnlabelable() {
|
|
|
105
105
|
//
|
|
106
106
|
// Text is 16px on touch screens: iPhone zooms the page into any field with
|
|
107
107
|
// smaller text when it's tapped. 16px stops that without blocking pinch-zoom.
|
|
108
|
+
//
|
|
109
|
+
// Text sits 12px from the sides. An icon at either end sits 10px from the
|
|
110
|
+
// edge instead, the same as above and below it (16px icon in a 20px line,
|
|
111
|
+
// plus 8px padding), so it looks evenly placed.
|
|
108
112
|
const box = [
|
|
109
113
|
'flex items-center gap-2 px-3 py-2 text-sm pointer-coarse:text-base [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:opacity-70',
|
|
110
|
-
'
|
|
114
|
+
'[&>svg:first-child]:-ml-0.5 [&>svg:last-child]:-mr-0.5',
|
|
115
|
+
'bg-surface text-ink border border-ink/45 rounded shadow-xs cursor-text transition',
|
|
111
116
|
'outline-2 outline-offset-1 outline-transparent forced-colors:not-has-focus-visible:outline-0',
|
|
112
117
|
'has-focus-visible:outline-focus',
|
|
113
118
|
// A control can mark itself data-pointer-focus to hide the ring while it
|
|
@@ -124,7 +129,7 @@ const statusBorder: Record<FormFieldStatus, string> = {
|
|
|
124
129
|
</script>
|
|
125
130
|
|
|
126
131
|
<template>
|
|
127
|
-
<div :class="cn('flex flex-col gap-1.5 text-
|
|
132
|
+
<div :class="cn('flex flex-col gap-1.5 text-ink', props.class)">
|
|
128
133
|
<!-- Label row and box in a grid, so label-trailing can come after the
|
|
129
134
|
box in the page (and the Tab order) but show at the end of the label row. -->
|
|
130
135
|
<div :class="cn('grid grid-cols-[minmax(0,1fr)_auto]', !hideLabel && 'gap-y-1.5', $slots['label-trailing'] && 'gap-x-3')">
|
|
@@ -138,7 +143,7 @@ const statusBorder: Record<FormFieldStatus, string> = {
|
|
|
138
143
|
</div>
|
|
139
144
|
|
|
140
145
|
<!-- Behind the ?: hidden, but still the control's description. -->
|
|
141
|
-
<p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-
|
|
146
|
+
<p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-ink/65">
|
|
142
147
|
{{ helper }}
|
|
143
148
|
</p>
|
|
144
149
|
</div>
|
|
@@ -41,7 +41,7 @@ const meta = {
|
|
|
41
41
|
<Button variant="ghost" square aria-label="Notifications"><Bell /></Button>
|
|
42
42
|
</template>
|
|
43
43
|
</Header>
|
|
44
|
-
<p class="p-4 text-sm text-
|
|
44
|
+
<p class="p-4 text-sm text-ink/65">Last event: {{ last || "none" }}</p>
|
|
45
45
|
</div>`,
|
|
46
46
|
}),
|
|
47
47
|
} satisfies Meta<typeof Header>;
|
|
@@ -80,8 +80,8 @@ export const CustomUserMenu: Story = {
|
|
|
80
80
|
template: `
|
|
81
81
|
<Header v-bind="args">
|
|
82
82
|
<template #account-menu="{ close }">
|
|
83
|
-
<div class="flex flex-col gap-1 border-t border-
|
|
84
|
-
<p class="px-3 pt-1 text-xs font-bold text-
|
|
83
|
+
<div class="flex flex-col gap-1 border-t border-ink/10 p-2">
|
|
84
|
+
<p class="px-3 pt-1 text-xs font-bold text-ink/65 uppercase">Switch school</p>
|
|
85
85
|
<Button variant="ghost" class="w-full justify-start px-3" @click="close">
|
|
86
86
|
<template #leading><Building2 /></template>Keston Prep
|
|
87
87
|
</Button>
|
|
@@ -108,13 +108,13 @@ export const OrganisationSwitcher: Story = {
|
|
|
108
108
|
<template #organisation="{ close }">
|
|
109
109
|
<button
|
|
110
110
|
type="button"
|
|
111
|
-
class="flex w-full items-center gap-2 px-4 py-3 text-left text-sm hover:bg-
|
|
111
|
+
class="flex w-full items-center gap-2 px-4 py-3 text-left text-sm hover:bg-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus"
|
|
112
112
|
@click="close"
|
|
113
113
|
>
|
|
114
114
|
<Building2 class="size-4 shrink-0" aria-hidden="true" />
|
|
115
115
|
<span class="flex min-w-0 flex-1 flex-col">
|
|
116
116
|
<span class="truncate font-bold">The Keston School</span>
|
|
117
|
-
<span class="text-xs text-
|
|
117
|
+
<span class="text-xs text-ink/65">Switch organisation</span>
|
|
118
118
|
</span>
|
|
119
119
|
<ChevronRight class="size-4 shrink-0" aria-hidden="true" />
|
|
120
120
|
</button>
|
|
@@ -161,11 +161,11 @@ export const WithMiddle: Story = {
|
|
|
161
161
|
setup: () => ({ args }),
|
|
162
162
|
template: `
|
|
163
163
|
<Header v-bind="args">
|
|
164
|
-
<nav aria-label="Breadcrumb" class="ml-2 hidden items-center gap-1 text-sm text-
|
|
164
|
+
<nav aria-label="Breadcrumb" class="ml-2 hidden items-center gap-1 text-sm text-ink/65 sm:flex [&_svg]:size-4">
|
|
165
165
|
<ChevronRight aria-hidden="true" />
|
|
166
166
|
<a href="#" class="hover:underline">Students</a>
|
|
167
167
|
<ChevronRight aria-hidden="true" />
|
|
168
|
-
<span aria-current="page" class="text-
|
|
168
|
+
<span aria-current="page" class="text-ink">Ben Smith</span>
|
|
169
169
|
</nav>
|
|
170
170
|
<template #trailing>
|
|
171
171
|
<Button variant="ghost" square aria-label="Notifications"><Bell /></Button>
|
|
@@ -199,7 +199,7 @@ export const Sticky: Story = {
|
|
|
199
199
|
<div class="h-96 overflow-y-auto bg-background">
|
|
200
200
|
<Header v-bind="args" />
|
|
201
201
|
<div class="flex flex-col gap-3 p-4">
|
|
202
|
-
<p v-for="n in 30" :key="n" class="text-sm text-
|
|
202
|
+
<p v-for="n in 30" :key="n" class="text-sm text-ink/65">Row {{ n }}</p>
|
|
203
203
|
</div>
|
|
204
204
|
</div>`,
|
|
205
205
|
}),
|
|
@@ -26,7 +26,7 @@ export type HeaderUserAction = 'account-settings' | 'switch-account' | 'log-out'
|
|
|
26
26
|
* the right (Account settings, Switch account, Log out). Each part can be
|
|
27
27
|
* overridden with a slot.
|
|
28
28
|
*
|
|
29
|
-
* Slots: leading (before the title, e.g. a logo), title, default (the middle,
|
|
29
|
+
* Slots: start (the very first thing, before the menu button, e.g. the app launcher; give it a `-ml-2.5` button to line up with the padding), leading (before the title, e.g. a logo), title, default (the middle,
|
|
30
30
|
* fills the space between title and trailing), trailing (actions before the
|
|
31
31
|
* account menu), account (replaces the account menu, or the Sign in button),
|
|
32
32
|
* account-menu (extra content in the account menu, above Switch account /
|
|
@@ -104,6 +104,7 @@ const emit = defineEmits<{
|
|
|
104
104
|
}>()
|
|
105
105
|
|
|
106
106
|
defineSlots<{
|
|
107
|
+
start?(): unknown
|
|
107
108
|
leading?(): unknown
|
|
108
109
|
title?(): unknown
|
|
109
110
|
default?(): unknown
|
|
@@ -134,7 +135,7 @@ const titleLink = computed(() => {
|
|
|
134
135
|
// As a link the title looks the same, with a ghost button's hover and press
|
|
135
136
|
// backgrounds round it; the negative margin keeps the text where it was.
|
|
136
137
|
const titleLinkClass = [
|
|
137
|
-
'-mx-2 rounded px-2 py-1 transition-colors hover:bg-
|
|
138
|
+
'-mx-2 rounded px-2 py-1 transition-colors hover:bg-hover active:bg-pressed',
|
|
138
139
|
'outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus forced-colors:not-focus-visible:outline-0'
|
|
139
140
|
]
|
|
140
141
|
|
|
@@ -151,11 +152,13 @@ function runAction(action: HeaderUserAction, close: () => void) {
|
|
|
151
152
|
<template>
|
|
152
153
|
<header
|
|
153
154
|
:class="cn(
|
|
154
|
-
'flex h-12 shrink-0 items-center gap-2 border-b border-
|
|
155
|
+
'flex h-12 shrink-0 items-center gap-2 border-b border-ink/10 bg-surface px-4 text-ink',
|
|
155
156
|
sticky && 'sticky top-0 z-40',
|
|
156
157
|
props.class
|
|
157
158
|
)"
|
|
158
159
|
>
|
|
160
|
+
<slot name="start" />
|
|
161
|
+
|
|
159
162
|
<!-- A ghost icon Button; the negative margin lines its icon up with the
|
|
160
163
|
header's padding, as the × does in Slideover. -->
|
|
161
164
|
<Button
|
|
@@ -204,9 +207,9 @@ function runAction(action: HeaderUserAction, close: () => void) {
|
|
|
204
207
|
<div class="flex flex-col">
|
|
205
208
|
<!-- The organisation at the top, with a divider under it. The
|
|
206
209
|
organisation slot replaces the plain heading. -->
|
|
207
|
-
<div v-if="user.organisation || $slots.organisation" class="border-b border-
|
|
210
|
+
<div v-if="user.organisation || $slots.organisation" class="border-b border-ink/10">
|
|
208
211
|
<slot name="organisation" :close="close">
|
|
209
|
-
<p class="truncate px-4 py-3 text-xs font-bold text-
|
|
212
|
+
<p class="truncate px-4 py-3 text-xs font-bold text-ink/65 uppercase" :title="user.organisation">
|
|
210
213
|
{{ user.organisation }}
|
|
211
214
|
</p>
|
|
212
215
|
</slot>
|
|
@@ -218,7 +221,7 @@ function runAction(action: HeaderUserAction, close: () => void) {
|
|
|
218
221
|
<Avatar :user="user" size="lg" decorative />
|
|
219
222
|
<div class="flex min-w-0 flex-col">
|
|
220
223
|
<span class="truncate font-bold" :title="user.name">{{ user.name }}</span>
|
|
221
|
-
<span v-if="user.email" class="truncate text-sm text-
|
|
224
|
+
<span v-if="user.email" class="truncate text-sm text-ink/65" :title="user.email">{{ user.email }}</span>
|
|
222
225
|
</div>
|
|
223
226
|
<Button
|
|
224
227
|
v-if="userActions.includes('account-settings')"
|
|
@@ -236,7 +239,7 @@ function runAction(action: HeaderUserAction, close: () => void) {
|
|
|
236
239
|
<!-- Switch account on the left, Log out on the right. -->
|
|
237
240
|
<div
|
|
238
241
|
v-if="userActions.includes('switch-account') || userActions.includes('log-out')"
|
|
239
|
-
class="flex items-center gap-2 border-t border-
|
|
242
|
+
class="flex items-center gap-2 border-t border-ink/10 px-4 py-3"
|
|
240
243
|
>
|
|
241
244
|
<Button v-if="userActions.includes('switch-account')" @click="runAction('switch-account', close)">
|
|
242
245
|
<template #leading><ArrowLeftRight /></template>
|
|
@@ -36,7 +36,7 @@ export const InTableHeading: Story = {
|
|
|
36
36
|
setup: () => ({ args }),
|
|
37
37
|
template: `
|
|
38
38
|
<table class="text-sm">
|
|
39
|
-
<thead><tr class="border-b border-
|
|
39
|
+
<thead><tr class="border-b border-ink/10">
|
|
40
40
|
<th class="px-3 py-2 text-left font-bold">Student</th>
|
|
41
41
|
<th class="px-3 py-2 text-left font-bold"><span class="inline-flex items-center gap-1">FSM <InfoTip v-bind="args" /></span></th>
|
|
42
42
|
</tr></thead>
|
|
@@ -33,7 +33,7 @@ const descriptionId = `${useId()}-description`
|
|
|
33
33
|
:aria-label="label"
|
|
34
34
|
:aria-describedby="descriptionId"
|
|
35
35
|
:class="cn(
|
|
36
|
-
'inline-flex shrink-0 rounded-full p-0.5 align-middle text-
|
|
36
|
+
'inline-flex shrink-0 rounded-full p-0.5 align-middle text-ink transition hover:bg-hover data-[state=open]:bg-selected',
|
|
37
37
|
'outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus [&_svg]:size-4',
|
|
38
38
|
props.class
|
|
39
39
|
)"
|
|
@@ -87,7 +87,7 @@ const statusText = computed(() => props.statusText ?? lengthError.value)
|
|
|
87
87
|
:disabled="disabled"
|
|
88
88
|
:aria-invalid="invalid"
|
|
89
89
|
:aria-describedby="describedBy"
|
|
90
|
-
class="h-5 min-w-0 flex-1 bg-transparent outline-none placeholder:text-
|
|
90
|
+
class="h-5 min-w-0 flex-1 bg-transparent outline-none placeholder:text-ink/55 disabled:cursor-not-allowed"
|
|
91
91
|
@blur="touched = true"
|
|
92
92
|
/>
|
|
93
93
|
</template>
|
|
@@ -35,7 +35,7 @@ export const Default: Story = {};
|
|
|
35
35
|
export const EmailCode: Story = {
|
|
36
36
|
args: {
|
|
37
37
|
label: "Code from your email",
|
|
38
|
-
helper: "We sent a 6-digit code to b
|
|
38
|
+
helper: "We sent a 6-digit code to b***@keston.school. It expires in 10 minutes.",
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -92,9 +92,9 @@ const onComplete = (value: Box[]) => emit('complete', toCode(value))
|
|
|
92
92
|
// Each box looks like FormField's box (a medium basic Button), with the
|
|
93
93
|
// focus ring on the box being typed in.
|
|
94
94
|
const box = [
|
|
95
|
-
'size-10 shrink-0 rounded border border-
|
|
95
|
+
'size-10 shrink-0 rounded border border-ink/45 bg-surface shadow-xs text-center text-lg tabular-nums text-ink transition',
|
|
96
96
|
'outline-2 outline-offset-1 outline-transparent focus:outline-focus forced-colors:not-focus:outline-0',
|
|
97
|
-
'placeholder:text-
|
|
97
|
+
'placeholder:text-ink/25 disabled:cursor-not-allowed'
|
|
98
98
|
]
|
|
99
99
|
const statusBorder: Record<InputCodeStatus, string> = {
|
|
100
100
|
error: 'border-red',
|
|
@@ -104,14 +104,14 @@ const statusBorder: Record<InputCodeStatus, string> = {
|
|
|
104
104
|
</script>
|
|
105
105
|
|
|
106
106
|
<template>
|
|
107
|
-
<div :class="cn('flex flex-col gap-1.5 text-
|
|
107
|
+
<div :class="cn('flex flex-col gap-1.5 text-ink', props.class)">
|
|
108
108
|
<div class="flex flex-col gap-0.5">
|
|
109
109
|
<div class="flex items-center gap-1">
|
|
110
110
|
<label :id="labelId" :for="`${id}-0`" class="text-sm">{{ label }}</label>
|
|
111
111
|
<InfoTip v-if="helper && helperPlacement === 'icon'" :text="helper" :label="t('ui.formField.about', { label })" />
|
|
112
112
|
</div>
|
|
113
113
|
<!-- Behind the ?: hidden, but still the boxes' description. -->
|
|
114
|
-
<p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-
|
|
114
|
+
<p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-ink/65">
|
|
115
115
|
{{ helper }}
|
|
116
116
|
</p>
|
|
117
117
|
</div>
|
|
@@ -203,9 +203,9 @@ function onCalendarPick(value: string | undefined) {
|
|
|
203
203
|
// InputNumber's + button. Negative margins cancel the box's padding.
|
|
204
204
|
const trigger = [
|
|
205
205
|
'flex w-9 shrink-0 -my-2 -mr-3 self-stretch items-center justify-center',
|
|
206
|
-
'rounded-r border-l border-
|
|
207
|
-
'not-disabled:hover:
|
|
208
|
-
'data-[state=open]:
|
|
206
|
+
'rounded-r border-l border-ink/10 bg-surface cursor-pointer transition',
|
|
207
|
+
'not-disabled:hover:bg-surface-hover not-disabled:active:bg-surface-pressed [&_svg]:opacity-100!',
|
|
208
|
+
'data-[state=open]:bg-surface-pressed disabled:cursor-not-allowed',
|
|
209
209
|
'outline-2 -outline-offset-2 outline-transparent focus-visible:outline-focus'
|
|
210
210
|
]
|
|
211
211
|
</script>
|
|
@@ -235,14 +235,14 @@ const trigger = [
|
|
|
235
235
|
:disabled="disabled"
|
|
236
236
|
:aria-invalid="invalid"
|
|
237
237
|
:aria-describedby="describedBy"
|
|
238
|
-
class="h-5 min-w-0 flex-1 bg-transparent tabular-nums outline-none placeholder:text-
|
|
238
|
+
class="h-5 min-w-0 flex-1 bg-transparent tabular-nums outline-none placeholder:text-ink/55 disabled:cursor-not-allowed"
|
|
239
239
|
@input="onTextInput"
|
|
240
240
|
@blur="onTextBlur"
|
|
241
241
|
@keydown.enter="onTextEnter"
|
|
242
242
|
/>
|
|
243
243
|
|
|
244
244
|
<!-- The date a typed phrase means, e.g. "tmrw" → 11/11/2026. -->
|
|
245
|
-
<span v-if="phrasePreview" aria-hidden="true" class="shrink-0 tabular-nums text-
|
|
245
|
+
<span v-if="phrasePreview" aria-hidden="true" class="shrink-0 tabular-nums text-ink/55">
|
|
246
246
|
{{ phrasePreview }}
|
|
247
247
|
</span>
|
|
248
248
|
|
|
@@ -25,7 +25,7 @@ const meta = {
|
|
|
25
25
|
},
|
|
26
26
|
template: `
|
|
27
27
|
<InputNumber v-bind="args" v-model="value" />
|
|
28
|
-
<small class="mt-3 block text-xs text-
|
|
28
|
+
<small class="mt-3 block text-xs text-ink/60">
|
|
29
29
|
Value: {{ value === undefined ? "undefined" : value }}
|
|
30
30
|
</small>`,
|
|
31
31
|
}),
|
|
@@ -57,15 +57,15 @@ const valueText = computed(() =>
|
|
|
57
57
|
// split from the value by a divider, so the field looks like
|
|
58
58
|
// [ − | value | + ]. Negative margins cancel the box's padding (px-3 py-2), so
|
|
59
59
|
// each button is 36×36 inside the 38px box. They behave like a basic Button:
|
|
60
|
-
//
|
|
60
|
+
// surface fill with the surface hover / pressed colours, icon at full colour (the box mutes
|
|
61
61
|
// decorative icons). When disabled (min / max reached) only the icon fades.
|
|
62
62
|
const stepButton = [
|
|
63
|
-
'flex w-9 shrink-0 -my-2 self-stretch items-center justify-center bg-
|
|
64
|
-
'not-disabled:hover:
|
|
63
|
+
'flex w-9 shrink-0 -my-2 self-stretch items-center justify-center bg-surface cursor-pointer transition',
|
|
64
|
+
'not-disabled:hover:bg-surface-hover not-disabled:active:bg-surface-pressed [&_svg]:opacity-100!',
|
|
65
65
|
'disabled:cursor-not-allowed disabled:[&_svg]:opacity-40!'
|
|
66
66
|
]
|
|
67
|
-
const decrement = '-ml-3 rounded-l border-r border-
|
|
68
|
-
const increment = '-mr-3 rounded-r border-l border-
|
|
67
|
+
const decrement = '-ml-3 rounded-l border-r border-ink/10'
|
|
68
|
+
const increment = '-mr-3 rounded-r border-l border-ink/10'
|
|
69
69
|
</script>
|
|
70
70
|
|
|
71
71
|
<template>
|
|
@@ -101,7 +101,7 @@ const increment = '-mr-3 rounded-r border-l border-black/15'
|
|
|
101
101
|
:aria-invalid="invalid"
|
|
102
102
|
:aria-describedby="describedBy"
|
|
103
103
|
:aria-valuetext="valueText"
|
|
104
|
-
class="h-5 min-w-0 flex-1 bg-transparent text-center tabular-nums outline-none placeholder:text-
|
|
104
|
+
class="h-5 min-w-0 flex-1 bg-transparent text-center tabular-nums outline-none placeholder:text-ink/55 disabled:cursor-not-allowed"
|
|
105
105
|
/>
|
|
106
106
|
<NumberFieldIncrement :class="[stepButton, increment]">
|
|
107
107
|
<Plus />
|
|
@@ -79,9 +79,9 @@ const statusText = computed(() => props.statusText ?? (capsLock.value ? t('ui.in
|
|
|
79
79
|
// [ password | 👁 ]. Pressing it keeps focus (and the caret) in the input.
|
|
80
80
|
const toggle = [
|
|
81
81
|
'flex w-9 shrink-0 -my-2 -mr-3 self-stretch items-center justify-center',
|
|
82
|
-
'bg-
|
|
83
|
-
'not-disabled:hover:
|
|
84
|
-
'outline-none focus-visible:bg-
|
|
82
|
+
'bg-surface rounded-r border-l border-ink/10 cursor-pointer transition',
|
|
83
|
+
'not-disabled:hover:bg-surface-hover not-disabled:active:bg-surface-pressed [&_svg]:opacity-100!',
|
|
84
|
+
'outline-none focus-visible:bg-surface-hover disabled:cursor-not-allowed'
|
|
85
85
|
]
|
|
86
86
|
</script>
|
|
87
87
|
|
|
@@ -114,7 +114,7 @@ const toggle = [
|
|
|
114
114
|
:disabled="disabled"
|
|
115
115
|
:aria-invalid="invalid"
|
|
116
116
|
:aria-describedby="describedBy"
|
|
117
|
-
class="h-5 min-w-0 flex-1 bg-transparent outline-none placeholder:text-
|
|
117
|
+
class="h-5 min-w-0 flex-1 bg-transparent outline-none placeholder:text-ink/55 disabled:cursor-not-allowed"
|
|
118
118
|
@keydown="checkCapsLock"
|
|
119
119
|
@keyup="checkCapsLock"
|
|
120
120
|
@blur="capsLock = false"
|
|
@@ -23,7 +23,7 @@ const meta = {
|
|
|
23
23
|
setup: () => ({ args, value: ref("") }),
|
|
24
24
|
template: `
|
|
25
25
|
<InputRichText v-bind="args" v-model="value" />
|
|
26
|
-
<pre class="mt-4 text-xs whitespace-pre-wrap text-
|
|
26
|
+
<pre class="mt-4 text-xs whitespace-pre-wrap text-ink/65">{{ value || '(empty)' }}</pre>`,
|
|
27
27
|
}),
|
|
28
28
|
} satisfies Meta<typeof InputRichText>;
|
|
29
29
|
|
|
@@ -146,7 +146,7 @@ const editable = [
|
|
|
146
146
|
'min-h-24 max-h-80 overflow-y-auto px-3 py-2 text-sm pointer-coarse:text-base outline-none cursor-text',
|
|
147
147
|
'[&_p+p]:mt-2',
|
|
148
148
|
'[&_p.is-editor-empty:first-child]:before:pointer-events-none [&_p.is-editor-empty:first-child]:before:float-left',
|
|
149
|
-
'[&_p.is-editor-empty:first-child]:before:h-0 [&_p.is-editor-empty:first-child]:before:text-
|
|
149
|
+
'[&_p.is-editor-empty:first-child]:before:h-0 [&_p.is-editor-empty:first-child]:before:text-ink/55',
|
|
150
150
|
'[&_p.is-editor-empty:first-child]:before:content-[attr(data-placeholder)]'
|
|
151
151
|
].join(' ')
|
|
152
152
|
</script>
|
|
@@ -172,7 +172,7 @@ const editable = [
|
|
|
172
172
|
role="toolbar"
|
|
173
173
|
:aria-label="t('ui.inputRichText.formattingFor', { label })"
|
|
174
174
|
:aria-controls="slot.id"
|
|
175
|
-
class="flex items-center gap-0.5 border-b border-
|
|
175
|
+
class="flex items-center gap-0.5 border-b border-ink/10 px-1.5 py-1 [&_svg]:opacity-100!"
|
|
176
176
|
@mousedown.prevent
|
|
177
177
|
>
|
|
178
178
|
<Tooltip v-for="mark in marks" :key="mark.name" :text="`${mark.label} (${mod}${mark.key})`" :disabled="disabled">
|
|
@@ -184,7 +184,7 @@ const editable = [
|
|
|
184
184
|
:aria-pressed="active[mark.name]"
|
|
185
185
|
:aria-keyshortcuts="`${isMac ? 'Meta' : 'Control'}+${mark.key}`"
|
|
186
186
|
:disabled="disabled"
|
|
187
|
-
class="aria-pressed:bg-
|
|
187
|
+
class="aria-pressed:bg-selected"
|
|
188
188
|
@click="mark.toggle()"
|
|
189
189
|
>
|
|
190
190
|
<component :is="mark.icon" />
|
|
@@ -82,7 +82,7 @@ defineExpose({ focus: () => area.value?.focus() })
|
|
|
82
82
|
:disabled="disabled"
|
|
83
83
|
:aria-invalid="invalid"
|
|
84
84
|
:aria-describedby="describedBy"
|
|
85
|
-
class="field-sizing-content -my-0.5 max-h-80 min-h-24 min-w-0 flex-1 resize-none bg-transparent text-sm leading-5 outline-none placeholder:text-
|
|
85
|
+
class="field-sizing-content -my-0.5 max-h-80 min-h-24 min-w-0 flex-1 resize-none bg-transparent text-sm leading-5 outline-none placeholder:text-ink/55 disabled:cursor-not-allowed pointer-coarse:text-base"
|
|
86
86
|
/>
|
|
87
87
|
</template>
|
|
88
88
|
</FormField>
|
|
@@ -14,7 +14,7 @@ const meta = {
|
|
|
14
14
|
render: (args) => ({
|
|
15
15
|
components: { Link },
|
|
16
16
|
setup: () => ({ args }),
|
|
17
|
-
template: `<p class="text-sm text-
|
|
17
|
+
template: `<p class="text-sm text-ink"><Link :href="args.href" :new-tab="args.newTab" :icon="args.icon">{{ args.text }}</Link></p>`,
|
|
18
18
|
}),
|
|
19
19
|
} satisfies Meta<LinkStoryArgs>;
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ export const InASentence: Story = {
|
|
|
35
35
|
render: () => ({
|
|
36
36
|
components: { Link },
|
|
37
37
|
template: `
|
|
38
|
-
<p class="max-w-100 text-xs text-
|
|
38
|
+
<p class="max-w-100 text-xs text-ink/65">
|
|
39
39
|
Make sure you trust Keston Admissions: read its
|
|
40
40
|
<Link href="#" new-tab>privacy policy</Link> and <Link href="#" new-tab>terms</Link>.
|
|
41
41
|
You can remove its access at any time in your <Link href="#">Keston account</Link>.
|
|
@@ -48,7 +48,7 @@ export const Footer: Story = {
|
|
|
48
48
|
render: () => ({
|
|
49
49
|
components: { Link },
|
|
50
50
|
template: `
|
|
51
|
-
<nav aria-label="Legal and help" class="flex items-center gap-2 text-xs text-
|
|
51
|
+
<nav aria-label="Legal and help" class="flex items-center gap-2 text-xs text-ink/65">
|
|
52
52
|
<Link href="#" new-tab>Privacy</Link>
|
|
53
53
|
<span aria-hidden="true">·</span>
|
|
54
54
|
<Link href="#" new-tab>Terms</Link>
|
|
@@ -63,7 +63,7 @@ export const Sizes: Story = {
|
|
|
63
63
|
render: () => ({
|
|
64
64
|
components: { Link },
|
|
65
65
|
template: `
|
|
66
|
-
<div class="flex flex-col gap-2 text-
|
|
66
|
+
<div class="flex flex-col gap-2 text-ink">
|
|
67
67
|
<p class="text-xs"><Link href="#" new-tab>Extra small</Link></p>
|
|
68
68
|
<p class="text-sm"><Link href="#" new-tab>Small</Link></p>
|
|
69
69
|
<p class="text-base"><Link href="#" new-tab>Base</Link></p>
|
|
@@ -33,7 +33,7 @@ const props = withDefaults(defineProps<LinkProps>(), {
|
|
|
33
33
|
// thickens the line. Keyboard focus gets the usual focus ring.
|
|
34
34
|
const base = [
|
|
35
35
|
'cursor-pointer rounded-xs underline underline-offset-2 transition-colors',
|
|
36
|
-
'hover:text-
|
|
36
|
+
'hover:text-ink hover:decoration-2',
|
|
37
37
|
'outline-2 outline-offset-2 outline-transparent focus-visible:outline-focus'
|
|
38
38
|
]
|
|
39
39
|
</script>
|
|
@@ -62,12 +62,13 @@ function attrsFor(item: MenuItem) {
|
|
|
62
62
|
return {}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
// Like Select's options: 32px rows
|
|
66
|
-
//
|
|
65
|
+
// Like Select's options: 32px rows running the full width of the panel,
|
|
66
|
+
// square (the panel keeps its rounded corners), text 12px from the edge,
|
|
67
|
+
// tinted when highlighted.
|
|
67
68
|
const item = [
|
|
68
|
-
'flex min-h-8 cursor-pointer items-center gap-2
|
|
69
|
+
'flex min-h-8 cursor-pointer items-center gap-2 px-3 py-1.5 text-sm text-ink no-underline outline-none select-none',
|
|
69
70
|
'[&_svg]:size-4 [&_svg]:shrink-0',
|
|
70
|
-
'data-highlighted:bg-
|
|
71
|
+
'data-highlighted:bg-selected',
|
|
71
72
|
'data-disabled:cursor-not-allowed data-disabled:opacity-40'
|
|
72
73
|
]
|
|
73
74
|
</script>
|
|
@@ -84,7 +85,7 @@ const item = [
|
|
|
84
85
|
align="end"
|
|
85
86
|
:side-offset="4"
|
|
86
87
|
:collision-padding="8"
|
|
87
|
-
:class="cn(popoverContent, 'min-w-48
|
|
88
|
+
:class="cn(popoverContent, 'min-w-48 overflow-hidden py-1')"
|
|
88
89
|
>
|
|
89
90
|
<DropdownMenuItem
|
|
90
91
|
v-for="i in items"
|