@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
package/package.json
CHANGED
|
@@ -70,12 +70,12 @@ function iconOf(app: AppLauncherApp): Component {
|
|
|
70
70
|
:href="app.href"
|
|
71
71
|
:aria-current="app.id === current ? 'page' : undefined"
|
|
72
72
|
:class="cn(
|
|
73
|
-
'flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-bold text-
|
|
74
|
-
app.id === current && 'bg-
|
|
73
|
+
'flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-bold text-ink outline-none hover:bg-hover focus-visible:outline-2 focus-visible:outline-focus',
|
|
74
|
+
app.id === current && 'bg-selected'
|
|
75
75
|
)"
|
|
76
76
|
@click="close()"
|
|
77
77
|
>
|
|
78
|
-
<span class="flex size-8 shrink-0 items-center justify-center rounded-lg bg-
|
|
78
|
+
<span class="flex size-8 shrink-0 items-center justify-center rounded-lg bg-ink/5">
|
|
79
79
|
<component :is="iconOf(app)" class="size-5" aria-hidden="true" />
|
|
80
80
|
</span>
|
|
81
81
|
<span class="min-w-0 truncate">{{ app.label }}</span>
|
|
@@ -44,7 +44,7 @@ const meta = {
|
|
|
44
44
|
<Button variant="ghost" square aria-label="Notifications"><Bell /></Button>
|
|
45
45
|
</template>
|
|
46
46
|
<h1 class="text-2xl font-bold">{{ current }}</h1>
|
|
47
|
-
<p v-for="n in 40" :key="n" class="mt-3 text-sm text-
|
|
47
|
+
<p v-for="n in 40" :key="n" class="mt-3 text-sm text-ink/65">
|
|
48
48
|
Line {{ n }}. Scroll: the header stays at the top and the sidebar stays beside the page.
|
|
49
49
|
</p>
|
|
50
50
|
</AppShell>`,
|
|
@@ -136,7 +136,7 @@ export const WithBreadcrumb: Story = {
|
|
|
136
136
|
<AppShell v-bind="args" :items="items" :ui="{ main: 'p-6' }">
|
|
137
137
|
<Breadcrumb :items="trail" />
|
|
138
138
|
<h1 class="mt-2 text-2xl font-bold">{{ current }}</h1>
|
|
139
|
-
<p class="mt-3 text-sm text-
|
|
139
|
+
<p class="mt-3 text-sm text-ink/65">Choose pages in the sidebar: the breadcrumb follows.</p>
|
|
140
140
|
</AppShell>`,
|
|
141
141
|
}),
|
|
142
142
|
};
|
|
@@ -129,11 +129,11 @@ const sidebarId = `${uid}-sidebar`
|
|
|
129
129
|
<!-- One provider for every Tooltip in the app, so moving from one to the
|
|
130
130
|
next shows it without waiting again. -->
|
|
131
131
|
<TooltipProvider :delay-duration="400" :skip-delay-duration="300">
|
|
132
|
-
<div :class="cn('flex min-h-dvh flex-col bg-background text-
|
|
132
|
+
<div :class="cn('flex min-h-dvh flex-col bg-background text-ink', props.class)">
|
|
133
133
|
<!-- First thing keyboard users reach: jumps past the header and sidebar. -->
|
|
134
134
|
<a
|
|
135
135
|
:href="`#${mainId}`"
|
|
136
|
-
class="sr-only z-50 rounded bg-
|
|
136
|
+
class="sr-only z-50 rounded bg-surface px-4 py-2 text-sm focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:outline-2 focus:outline-focus"
|
|
137
137
|
>
|
|
138
138
|
Skip to content
|
|
139
139
|
</a>
|
|
@@ -83,7 +83,7 @@ const circle = 'relative inline-flex shrink-0 items-center justify-center overfl
|
|
|
83
83
|
|
|
84
84
|
<template #content>
|
|
85
85
|
<div class="flex flex-col">
|
|
86
|
-
<p v-if="user.organisation" class="truncate px-4 pt-3 text-xs font-bold text-
|
|
86
|
+
<p v-if="user.organisation" class="truncate px-4 pt-3 text-xs font-bold text-ink/65 uppercase">
|
|
87
87
|
{{ user.organisation }}
|
|
88
88
|
</p>
|
|
89
89
|
<div class="flex items-center gap-3 px-4 py-3">
|
|
@@ -93,11 +93,11 @@ const circle = 'relative inline-flex shrink-0 items-center justify-center overfl
|
|
|
93
93
|
</span>
|
|
94
94
|
<div class="flex min-w-0 flex-col">
|
|
95
95
|
<span class="truncate font-bold">{{ user.name }}</span>
|
|
96
|
-
<span v-if="user.role" class="truncate text-sm text-
|
|
96
|
+
<span v-if="user.role" class="truncate text-sm text-ink/65">{{ user.role }}</span>
|
|
97
97
|
<a
|
|
98
98
|
v-if="user.email"
|
|
99
99
|
:href="`mailto:${user.email}`"
|
|
100
|
-
class="truncate rounded-sm text-sm text-
|
|
100
|
+
class="truncate rounded-sm text-sm text-ink/65 underline-offset-2 hover:text-ink hover:underline outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus"
|
|
101
101
|
>
|
|
102
102
|
{{ user.email }}
|
|
103
103
|
</a>
|
|
@@ -66,18 +66,18 @@ const counterSizes: Record<NonNullable<AvatarProps['size']>, string> = {
|
|
|
66
66
|
<span
|
|
67
67
|
v-for="(user, i) in shown"
|
|
68
68
|
:key="`${user.name}-${i}`"
|
|
69
|
-
:class="cn('relative flex rounded-full ring-
|
|
69
|
+
:class="cn('relative flex rounded-full ring-surface hover:z-10 focus-within:z-10', rings[size], i > 0 && overlaps[size])"
|
|
70
70
|
>
|
|
71
71
|
<Avatar :user="user" :size="size" :profile="profile" />
|
|
72
72
|
</span>
|
|
73
73
|
|
|
74
|
-
<span v-if="hidden.length" :class="cn('relative flex rounded-full ring-
|
|
74
|
+
<span v-if="hidden.length" :class="cn('relative flex rounded-full ring-surface hover:z-10 focus-within:z-10', rings[size], overlaps[size])">
|
|
75
75
|
<Popover mode="hover" :open-delay="300" :close-delay="150" :content="{ side: 'bottom', align: 'start', sideOffset: 6 }" :ui="{ content: 'w-56' }">
|
|
76
76
|
<button
|
|
77
77
|
type="button"
|
|
78
78
|
:aria-label="t('ui.avatarGroup.more', { count: hidden.length, names: hidden.map((u) => u.name).join(', ') })"
|
|
79
79
|
:class="cn(
|
|
80
|
-
'inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full bg-surface font-bold text-
|
|
80
|
+
'inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full bg-surface-muted font-bold text-ink select-none',
|
|
81
81
|
'outline-2 outline-offset-1 outline-transparent transition focus-visible:outline-focus',
|
|
82
82
|
counterSizes[size]
|
|
83
83
|
)"
|
|
@@ -89,7 +89,7 @@ const counterSizes: Record<NonNullable<AvatarProps['size']>, string> = {
|
|
|
89
89
|
<li v-for="(user, i) in hidden" :key="`${user.name}-${i}`" class="flex items-center gap-2">
|
|
90
90
|
<Avatar :user="user" size="xs" decorative />
|
|
91
91
|
<span class="min-w-0 truncate">{{ user.name }}</span>
|
|
92
|
-
<span v-if="user.role" class="ml-auto shrink-0 truncate text-xs text-
|
|
92
|
+
<span v-if="user.role" class="ml-auto shrink-0 truncate text-xs text-ink/65">{{ user.role }}</span>
|
|
93
93
|
</li>
|
|
94
94
|
</ul>
|
|
95
95
|
</template>
|
|
@@ -39,10 +39,10 @@ defineSlots<{
|
|
|
39
39
|
|
|
40
40
|
// The same border and colours as Button's variants (basic white, the rest
|
|
41
41
|
// solid with white text, except yellow, which needs black text to be readable).
|
|
42
|
-
const base = 'inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-
|
|
42
|
+
const base = 'inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-ink/10 font-bold'
|
|
43
43
|
|
|
44
44
|
const colors: Record<NonNullable<BadgeProps['color']>, string> = {
|
|
45
|
-
basic: 'bg-
|
|
45
|
+
basic: 'bg-surface text-ink',
|
|
46
46
|
primary: 'bg-primary text-white',
|
|
47
47
|
red: 'bg-red text-white',
|
|
48
48
|
green: 'bg-green text-white',
|
|
@@ -68,8 +68,8 @@ function select(item: BreadcrumbItem, event: MouseEvent) {
|
|
|
68
68
|
const step = 'inline-flex max-w-60 min-w-0 items-center gap-1.5 [&_svg]:size-3.5 [&_svg]:shrink-0'
|
|
69
69
|
|
|
70
70
|
const link = [
|
|
71
|
-
'cursor-pointer rounded-sm text-
|
|
72
|
-
'hover:text-
|
|
71
|
+
'cursor-pointer rounded-sm text-ink/65 underline-offset-2 transition',
|
|
72
|
+
'hover:text-ink hover:underline',
|
|
73
73
|
'outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus'
|
|
74
74
|
]
|
|
75
75
|
</script>
|
|
@@ -79,7 +79,7 @@ const link = [
|
|
|
79
79
|
<ol class="flex flex-wrap items-center gap-x-1.5 gap-y-1">
|
|
80
80
|
<li v-for="(item, i) in items" :key="`${item.label}-${i}`" class="flex min-w-0 items-center gap-1.5">
|
|
81
81
|
<!-- The current page. -->
|
|
82
|
-
<span v-if="i === items.length - 1" aria-current="page" :title="item.label" :class="cn(step, 'text-
|
|
82
|
+
<span v-if="i === items.length - 1" aria-current="page" :title="item.label" :class="cn(step, 'text-ink')">
|
|
83
83
|
<component :is="item.icon" v-if="item.icon" aria-hidden="true" />
|
|
84
84
|
<span class="truncate">{{ item.label }}</span>
|
|
85
85
|
</span>
|
|
@@ -98,12 +98,12 @@ const link = [
|
|
|
98
98
|
</component>
|
|
99
99
|
|
|
100
100
|
<!-- A step that isn't a page itself, e.g. a group. -->
|
|
101
|
-
<span v-else :title="item.label" :class="cn(step, 'text-
|
|
101
|
+
<span v-else :title="item.label" :class="cn(step, 'text-ink/65')">
|
|
102
102
|
<component :is="item.icon" v-if="item.icon" aria-hidden="true" />
|
|
103
103
|
<span class="truncate">{{ item.label }}</span>
|
|
104
104
|
</span>
|
|
105
105
|
|
|
106
|
-
<ChevronRight v-if="i < items.length - 1" aria-hidden="true" class="size-3.5 shrink-0 text-
|
|
106
|
+
<ChevronRight v-if="i < items.length - 1" aria-hidden="true" class="size-3.5 shrink-0 text-ink/40" />
|
|
107
107
|
</li>
|
|
108
108
|
</ol>
|
|
109
109
|
</nav>
|
|
@@ -199,7 +199,7 @@ export const StatusDemo: Story = {
|
|
|
199
199
|
template: `
|
|
200
200
|
<div class="flex flex-col items-start gap-3">
|
|
201
201
|
<Button v-bind="buttonProps" v-model:status="status" @click="run">${buttonContent}</Button>
|
|
202
|
-
<small class="text-xs text-
|
|
202
|
+
<small class="text-xs text-ink/60">
|
|
203
203
|
Last result: {{ lastResult ?? "—" }}
|
|
204
204
|
</small>
|
|
205
205
|
</div>`,
|
|
@@ -154,25 +154,28 @@ const announcement = computed(() => {
|
|
|
154
154
|
const base = [
|
|
155
155
|
// overflow-hidden: content briefly wider than the button while its width animates is clipped
|
|
156
156
|
'relative inline-flex shrink-0 items-center justify-center whitespace-nowrap select-none overflow-hidden',
|
|
157
|
-
'border border-
|
|
157
|
+
'border border-ink/10 cursor-pointer transition',
|
|
158
158
|
'disabled:cursor-not-allowed disabled:opacity-40',
|
|
159
159
|
'aria-busy:cursor-progress',
|
|
160
160
|
'outline-2 outline-offset-1 outline-transparent forced-colors:not-focus-visible:outline-0',
|
|
161
161
|
'focus-visible:outline-focus'
|
|
162
162
|
]
|
|
163
163
|
|
|
164
|
-
// Hover / pressed only apply when the button is usable.
|
|
164
|
+
// Hover / pressed only apply when the button is usable. The theme's state
|
|
165
|
+
// colours (theme.css, "States") keep this the same as every other component:
|
|
166
|
+
// - coloured fills (primary, danger) darken
|
|
167
|
+
// - basic (surface fill) takes the solid surface-hover / -pressed colours,
|
|
168
|
+
// which lighten in dark mode rather than darken
|
|
169
|
+
// - ghost has no fill, so it takes the see-through hover / pressed tints. Its
|
|
170
|
+
// border stays (transparent) so it lines up with the other variants.
|
|
165
171
|
const interactive = 'not-disabled:not-aria-disabled:hover:brightness-90 not-disabled:not-aria-disabled:active:brightness-80'
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
// (10% / 15%, matching the other variants' 90% / 80% brightness). The border
|
|
169
|
-
// stays (transparent) so it lines up with the other variants.
|
|
170
|
-
const ghostInteractive = 'not-disabled:not-aria-disabled:hover:bg-black/10 not-disabled:not-aria-disabled:active:bg-black/15'
|
|
172
|
+
const surfaceInteractive = 'not-disabled:not-aria-disabled:hover:bg-surface-hover not-disabled:not-aria-disabled:active:bg-surface-pressed'
|
|
173
|
+
const ghostInteractive = 'not-disabled:not-aria-disabled:hover:bg-hover not-disabled:not-aria-disabled:active:bg-pressed'
|
|
171
174
|
|
|
172
175
|
const variants: Record<NonNullable<ButtonProps['variant']>, string> = {
|
|
173
|
-
basic: `bg-
|
|
176
|
+
basic: `bg-surface text-ink shadow-xs ${surfaceInteractive}`,
|
|
174
177
|
primary: `bg-primary text-white ${interactive}`,
|
|
175
|
-
ghost: `bg-transparent text-
|
|
178
|
+
ghost: `bg-transparent text-ink border-transparent ${ghostInteractive}`,
|
|
176
179
|
danger: `bg-red text-white ${interactive}`
|
|
177
180
|
}
|
|
178
181
|
|
|
@@ -15,7 +15,7 @@ const meta = {
|
|
|
15
15
|
<Card class="w-fit">
|
|
16
16
|
<Calendar v-bind="args" v-model="value" />
|
|
17
17
|
</Card>
|
|
18
|
-
<p class="mt-3 text-sm text-
|
|
18
|
+
<p class="mt-3 text-sm text-ink/65">Chosen: {{ value ?? 'nothing yet' }}</p>`,
|
|
19
19
|
}),
|
|
20
20
|
} satisfies Meta<typeof Calendar>;
|
|
21
21
|
|
|
@@ -42,7 +42,7 @@ export const InterviewDay: Story = {
|
|
|
42
42
|
<div class="flex flex-wrap items-start gap-4">
|
|
43
43
|
<Card class="w-fit"><Calendar v-bind="args" v-model="value" /></Card>
|
|
44
44
|
<Card :title="'Interviews on ' + new Date(value).toLocaleDateString('en-GB', { dateStyle: 'long' })" class="min-w-64 flex-1">
|
|
45
|
-
<p class="text-sm text-
|
|
45
|
+
<p class="text-sm text-ink/65">3 interviews booked, 2 slots free.</p>
|
|
46
46
|
</Card>
|
|
47
47
|
</div>`,
|
|
48
48
|
}),
|
|
@@ -186,7 +186,7 @@ const isCurrentYear = (year: number) => year === today(getLocalTimeZone()).year
|
|
|
186
186
|
// "October ▾" / "2026 ▾" in the heading.
|
|
187
187
|
const headingButton = [
|
|
188
188
|
'inline-flex items-center gap-0.5 rounded px-1.5 py-1 text-sm cursor-pointer transition',
|
|
189
|
-
'hover:bg-
|
|
189
|
+
'hover:bg-hover active:bg-pressed [&_svg]:size-3.5',
|
|
190
190
|
'disabled:cursor-not-allowed disabled:hover:bg-transparent',
|
|
191
191
|
'outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus'
|
|
192
192
|
]
|
|
@@ -206,9 +206,9 @@ const pickCell = [
|
|
|
206
206
|
...todayMark,
|
|
207
207
|
'aria-[current=date]:after:bottom-2',
|
|
208
208
|
'flex h-12 items-center justify-center rounded text-sm tabular-nums cursor-pointer transition',
|
|
209
|
-
'hover:bg-
|
|
209
|
+
'hover:bg-hover',
|
|
210
210
|
'aria-pressed:bg-primary aria-pressed:text-white aria-pressed:hover:bg-primary',
|
|
211
|
-
'disabled:cursor-not-allowed disabled:text-
|
|
211
|
+
'disabled:cursor-not-allowed disabled:text-ink/25 disabled:hover:bg-transparent',
|
|
212
212
|
'outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus'
|
|
213
213
|
]
|
|
214
214
|
|
|
@@ -216,10 +216,10 @@ const day = [
|
|
|
216
216
|
...todayMark,
|
|
217
217
|
'aria-[current=date]:after:bottom-0.5',
|
|
218
218
|
'flex size-8 items-center justify-center rounded text-sm tabular-nums cursor-pointer transition',
|
|
219
|
-
'hover:bg-
|
|
220
|
-
'data-[outside-view]:text-
|
|
219
|
+
'hover:bg-hover',
|
|
220
|
+
'data-[outside-view]:text-ink/55',
|
|
221
221
|
'data-[selected]:bg-primary data-[selected]:text-white data-[selected]:hover:bg-primary',
|
|
222
|
-
'data-[disabled]:cursor-not-allowed data-[disabled]:text-
|
|
222
|
+
'data-[disabled]:cursor-not-allowed data-[disabled]:text-ink/25 data-[disabled]:hover:bg-transparent',
|
|
223
223
|
'data-[unavailable]:line-through',
|
|
224
224
|
'outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus'
|
|
225
225
|
]
|
|
@@ -237,7 +237,7 @@ const day = [
|
|
|
237
237
|
:initial-focus="initialFocus"
|
|
238
238
|
:week-starts-on="1"
|
|
239
239
|
fixed-weeks
|
|
240
|
-
:class="cn('w-fit text-
|
|
240
|
+
:class="cn('w-fit text-ink', disabled && 'opacity-40', props.class)"
|
|
241
241
|
@update:model-value="setValue"
|
|
242
242
|
@update:placeholder="onPlaceholderChange"
|
|
243
243
|
>
|
|
@@ -343,7 +343,7 @@ const day = [
|
|
|
343
343
|
<CalendarHeadCell
|
|
344
344
|
v-for="weekDay in weekDays"
|
|
345
345
|
:key="weekDay"
|
|
346
|
-
class="w-8 pb-1 text-xs font-normal text-
|
|
346
|
+
class="w-8 pb-1 text-xs font-normal text-ink/55"
|
|
347
347
|
>
|
|
348
348
|
{{ weekDay }}
|
|
349
349
|
</CalendarHeadCell>
|
|
@@ -62,8 +62,8 @@ export const WithActionsAndFooter: Story = {
|
|
|
62
62
|
<Button variant="ghost" size="sm"><template #leading><Pencil /></template>Edit</Button>
|
|
63
63
|
</template>
|
|
64
64
|
<dl class="grid grid-cols-[8rem_1fr] gap-y-2 text-sm">
|
|
65
|
-
<dt class="text-
|
|
66
|
-
<dt class="text-
|
|
65
|
+
<dt class="text-ink/65">Email</dt><dd>office@keston.school</dd>
|
|
66
|
+
<dt class="text-ink/65">Phone</dt><dd>020 7946 0000</dd>
|
|
67
67
|
</dl>
|
|
68
68
|
<template #footer>
|
|
69
69
|
<Button>Cancel</Button>
|
|
@@ -80,7 +80,7 @@ export const Stats: Story = {
|
|
|
80
80
|
template: `
|
|
81
81
|
<div class="grid grid-cols-1 gap-6 sm:grid-cols-3">
|
|
82
82
|
<Card v-for="stat in [['Open applications', '48'], ['Interviews this week', '9'], ['Offers accepted', '31']]" :key="stat[0]" padding="sm" :ui="{ body: 'gap-1' }">
|
|
83
|
-
<span class="text-sm text-
|
|
83
|
+
<span class="text-sm text-ink/65">{{ stat[0] }}</span>
|
|
84
84
|
<span class="text-2xl font-bold">{{ stat[1] }}</span>
|
|
85
85
|
</Card>
|
|
86
86
|
</div>`,
|
|
@@ -96,11 +96,11 @@ export const Table: Story = {
|
|
|
96
96
|
template: `
|
|
97
97
|
<Card v-bind="args" :ui="{ body: 'overflow-x-auto' }">
|
|
98
98
|
<table class="w-full text-left text-sm">
|
|
99
|
-
<thead class="border-b border-
|
|
99
|
+
<thead class="border-b border-ink/10 text-ink/65">
|
|
100
100
|
<tr><th class="px-4 py-3 font-bold">Applicant</th><th class="px-4 py-3 font-bold">Year</th><th class="px-4 py-3 font-bold">Status</th></tr>
|
|
101
101
|
</thead>
|
|
102
102
|
<tbody>
|
|
103
|
-
<tr class="border-b border-
|
|
103
|
+
<tr class="border-b border-ink/10"><td class="px-4 py-3 font-bold">Amelia Clarke</td><td class="px-4 py-3">Year 7</td><td class="px-4 py-3"><Badge size="sm" color="green">Offered</Badge></td></tr>
|
|
104
104
|
<tr><td class="px-4 py-3 font-bold">Noah Patel</td><td class="px-4 py-3">Year 9</td><td class="px-4 py-3"><Badge size="sm" color="blue">Interview</Badge></td></tr>
|
|
105
105
|
</tbody>
|
|
106
106
|
</table>
|
|
@@ -77,7 +77,7 @@ const footerPaddings: Record<NonNullable<CardProps['padding']>, string> = {
|
|
|
77
77
|
:aria-labelledby="title ? headingId : undefined"
|
|
78
78
|
:class="
|
|
79
79
|
cn(
|
|
80
|
-
'@container flex flex-col rounded-lg border border-
|
|
80
|
+
'@container flex flex-col rounded-lg border border-ink/10 bg-surface text-ink shadow-xs',
|
|
81
81
|
// Content that runs to the edges (a table's header, a list's rows) is
|
|
82
82
|
// clipped to the rounded corners. clip, not hidden: it doesn't make a
|
|
83
83
|
// scroll container, so sticky content inside still sticks to the page.
|
|
@@ -96,7 +96,7 @@ const footerPaddings: Record<NonNullable<CardProps['padding']>, string> = {
|
|
|
96
96
|
<component :is="`h${headingLevel}`" v-if="title" :id="headingId" class="text-base font-bold">
|
|
97
97
|
{{ title }}
|
|
98
98
|
</component>
|
|
99
|
-
<p v-if="description" class="text-sm text-
|
|
99
|
+
<p v-if="description" class="text-sm text-ink/65">{{ description }}</p>
|
|
100
100
|
</div>
|
|
101
101
|
</slot>
|
|
102
102
|
<div v-if="$slots.actions" class="flex shrink-0 items-center gap-2">
|
|
@@ -109,7 +109,7 @@ const footerPaddings: Record<NonNullable<CardProps['padding']>, string> = {
|
|
|
109
109
|
|
|
110
110
|
<div
|
|
111
111
|
v-if="$slots.footer"
|
|
112
|
-
:class="cn('flex flex-wrap justify-end gap-2 border-t border-
|
|
112
|
+
:class="cn('flex flex-wrap justify-end gap-2 border-t border-ink/10', footerPaddings[padding], ui?.footer)"
|
|
113
113
|
>
|
|
114
114
|
<slot name="footer" />
|
|
115
115
|
</div>
|
|
@@ -88,10 +88,13 @@ const grid = computed(() => {
|
|
|
88
88
|
// card only changes colours and gets a second, inset 1px line drawn with a
|
|
89
89
|
// box-shadow, which takes no space. Text keeps the same weight. Nothing is
|
|
90
90
|
// added or removed in the card, so nothing can move.
|
|
91
|
+
//
|
|
92
|
+
// 10px on top, 12px elsewhere: the radio and icon sit 2px down to line up
|
|
93
|
+
// with the title, so this puts them 12px from the top, the same as the sides.
|
|
91
94
|
const card = [
|
|
92
|
-
'group relative flex w-full cursor-pointer items-start gap-3 rounded-lg border border-
|
|
95
|
+
'group relative flex w-full cursor-pointer items-start gap-3 rounded-lg border border-ink/10 bg-surface p-3 pt-2.5 text-left text-ink shadow-xs transition-colors',
|
|
93
96
|
'outline-2 outline-offset-2 outline-transparent focus-visible:outline-focus',
|
|
94
|
-
'not-disabled:not-data-[state=checked]:hover:bg-surface-
|
|
97
|
+
'not-disabled:not-data-[state=checked]:hover:bg-surface-hover',
|
|
95
98
|
'data-[state=checked]:border-primary data-[state=checked]:bg-primary/6 data-[state=checked]:shadow-[inset_0_0_0_1px_var(--color-primary)]',
|
|
96
99
|
'disabled:cursor-not-allowed disabled:opacity-40',
|
|
97
100
|
'motion-reduce:transition-none'
|
|
@@ -99,13 +102,13 @@ const card = [
|
|
|
99
102
|
</script>
|
|
100
103
|
|
|
101
104
|
<template>
|
|
102
|
-
<div :class="cn('flex flex-col gap-2 text-
|
|
105
|
+
<div :class="cn('flex flex-col gap-2 text-ink', disabled && 'opacity-40', props.class)">
|
|
103
106
|
<div :class="cn('flex flex-col gap-0.5', hideLabel && 'sr-only')">
|
|
104
107
|
<div class="flex items-center gap-1">
|
|
105
108
|
<span :id="labelId" class="text-sm">{{ label }}</span>
|
|
106
109
|
<InfoTip v-if="helper && helperPlacement === 'icon'" :text="helper" :label="t('ui.formField.about', { label })" />
|
|
107
110
|
</div>
|
|
108
|
-
<p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-
|
|
111
|
+
<p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-ink/65">
|
|
109
112
|
{{ helper }}
|
|
110
113
|
</p>
|
|
111
114
|
</div>
|
|
@@ -129,17 +132,17 @@ const card = [
|
|
|
129
132
|
:aria-describedby="option.description ? `${id}-${i}-description` : undefined"
|
|
130
133
|
:class="cn(card, errorText && 'not-data-[state=checked]:border-red')"
|
|
131
134
|
>
|
|
132
|
-
<component :is="option.icon" v-if="option.icon" aria-hidden="true" class="mt-0.5 size-4 shrink-0 text-
|
|
135
|
+
<component :is="option.icon" v-if="option.icon" aria-hidden="true" class="mt-0.5 size-4 shrink-0 text-ink/65 group-data-[state=checked]:text-primary-fg" />
|
|
133
136
|
<span class="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
134
137
|
<span class="text-sm font-bold">{{ option.title }}</span>
|
|
135
|
-
<span v-if="option.description" :id="`${id}-${i}-description`" class="text-xs text-
|
|
138
|
+
<span v-if="option.description" :id="`${id}-${i}-description`" class="text-xs text-ink/65">
|
|
136
139
|
{{ option.description }}
|
|
137
140
|
</span>
|
|
138
141
|
</span>
|
|
139
142
|
<!-- Always there, so the card is the same size either way: the dot only fades and scales in. -->
|
|
140
143
|
<span
|
|
141
144
|
aria-hidden="true"
|
|
142
|
-
class="mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border border-
|
|
145
|
+
class="mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border border-ink/45 bg-surface group-data-[state=checked]:border-primary"
|
|
143
146
|
>
|
|
144
147
|
<span class="size-2 scale-0 rounded-full bg-primary transition-transform group-data-[state=checked]:scale-100 motion-reduce:transition-none" />
|
|
145
148
|
</span>
|
|
@@ -32,10 +32,10 @@ const label = computed(() => t('ui.changeIndicator.changed', { from: props.from,
|
|
|
32
32
|
<template>
|
|
33
33
|
<span
|
|
34
34
|
v-if="changed"
|
|
35
|
-
:class="cn('inline-flex items-center gap-1 whitespace-nowrap rounded-full border border-blue/30 bg-blue/10 px-2 text-xs font-bold text-blue', props.class)"
|
|
35
|
+
:class="cn('inline-flex items-center gap-1 whitespace-nowrap rounded-full border border-blue-fg/30 bg-blue-fg/10 px-2 text-xs font-bold text-blue-fg', props.class)"
|
|
36
36
|
>
|
|
37
37
|
<span class="sr-only">{{ label }}</span>
|
|
38
|
-
<span aria-hidden="true" class="font-normal line-through decoration-blue/60">{{ from }}</span>
|
|
38
|
+
<span aria-hidden="true" class="font-normal line-through decoration-blue-fg/60">{{ from }}</span>
|
|
39
39
|
<ArrowRight aria-hidden="true" class="size-3 shrink-0" />
|
|
40
40
|
<span aria-hidden="true">{{ to }}<template v-if="unit"> {{ unit }}</template></span>
|
|
41
41
|
</span>
|
|
@@ -61,8 +61,8 @@ function pressControl(event: MouseEvent, id: string) {
|
|
|
61
61
|
// 16px box, level with the first line of the label (20px line: 2px above).
|
|
62
62
|
// The border is darker than a text box's so the box itself is easy to see.
|
|
63
63
|
const box = [
|
|
64
|
-
'mt-0.5 flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-sm border bg-
|
|
65
|
-
'not-disabled:hover:border-
|
|
64
|
+
'mt-0.5 flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-sm border bg-surface text-white transition',
|
|
65
|
+
'not-disabled:hover:border-ink disabled:cursor-not-allowed',
|
|
66
66
|
'data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:hover:border-primary',
|
|
67
67
|
'data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:hover:border-primary',
|
|
68
68
|
'outline-2 outline-offset-2 outline-transparent focus-visible:outline-focus',
|
|
@@ -71,7 +71,7 @@ const box = [
|
|
|
71
71
|
</script>
|
|
72
72
|
|
|
73
73
|
<template>
|
|
74
|
-
<div :class="cn('flex flex-col gap-1.5 text-
|
|
74
|
+
<div :class="cn('flex flex-col gap-1.5 text-ink', disabled && 'opacity-40', props.class)">
|
|
75
75
|
<div class="flex items-start gap-2">
|
|
76
76
|
<CheckboxRoot
|
|
77
77
|
:id="controlId"
|
|
@@ -82,7 +82,7 @@ const box = [
|
|
|
82
82
|
:disabled="disabled"
|
|
83
83
|
:aria-invalid="errorText ? true : undefined"
|
|
84
84
|
:aria-describedby="describedBy"
|
|
85
|
-
:class="cn(box, errorText ? 'border-red' : 'border-
|
|
85
|
+
:class="cn(box, errorText ? 'border-red' : 'border-ink/45')"
|
|
86
86
|
>
|
|
87
87
|
<CheckboxIndicator class="flex">
|
|
88
88
|
<Minus v-if="model === 'indeterminate'" aria-hidden="true" />
|
|
@@ -94,7 +94,7 @@ const box = [
|
|
|
94
94
|
@click="pressControl($event, controlId)"
|
|
95
95
|
>
|
|
96
96
|
<label :for="controlId" :class="cn('text-sm', disabled ? 'cursor-not-allowed' : 'cursor-pointer')">{{ label }}</label>
|
|
97
|
-
<p v-if="description" :id="descriptionId" class="text-xs text-
|
|
97
|
+
<p v-if="description" :id="descriptionId" class="text-xs text-ink/65">
|
|
98
98
|
{{ description }}
|
|
99
99
|
</p>
|
|
100
100
|
</div>
|
|
@@ -27,7 +27,7 @@ const meta = {
|
|
|
27
27
|
setup: () => ({ args, value: ref<(string | number)[]>(["admissions"]) }),
|
|
28
28
|
template: `
|
|
29
29
|
<CheckboxGroup v-bind="args" v-model="value" />
|
|
30
|
-
<pre class="mt-4 text-xs text-
|
|
30
|
+
<pre class="mt-4 text-xs text-ink/65">{{ value }}</pre>`,
|
|
31
31
|
}),
|
|
32
32
|
} satisfies Meta<typeof CheckboxGroup>;
|
|
33
33
|
|
|
@@ -61,14 +61,14 @@ function toggle(value: CheckboxGroupValue, on: boolean) {
|
|
|
61
61
|
</script>
|
|
62
62
|
|
|
63
63
|
<template>
|
|
64
|
-
<div :class="cn('flex flex-col gap-1.5 text-
|
|
64
|
+
<div :class="cn('flex flex-col gap-1.5 text-ink', props.class)">
|
|
65
65
|
<div :class="cn('flex flex-col gap-0.5', hideLabel && 'sr-only')">
|
|
66
66
|
<div class="flex items-center gap-1">
|
|
67
67
|
<span :id="labelId" class="text-sm">{{ label }}</span>
|
|
68
68
|
<InfoTip v-if="helper && helperPlacement === 'icon'" :text="helper" :label="t('ui.formField.about', { label })" />
|
|
69
69
|
</div>
|
|
70
70
|
<!-- Behind the ?: hidden, but still the group's description. -->
|
|
71
|
-
<p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-
|
|
71
|
+
<p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-ink/65">
|
|
72
72
|
{{ helper }}
|
|
73
73
|
</p>
|
|
74
74
|
</div>
|
|
@@ -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>
|