@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.
Files changed (89) hide show
  1. package/dist/components/AppLauncher/AppLauncher.vue.d.ts +3 -2
  2. package/dist/components/AppShell/AppShell.vue.d.ts +1 -1
  3. package/dist/components/Header/Header.vue.d.ts +2 -1
  4. package/dist/components/Popover/popover.d.ts +3 -2
  5. package/dist/components/Spinner/Spinner.vue.d.ts +1 -1
  6. package/dist/keston-ui.js +703 -699
  7. package/package.json +1 -1
  8. package/src/components/AppLauncher/AppLauncher.stories.ts +1 -1
  9. package/src/components/AppLauncher/AppLauncher.vue +9 -12
  10. package/src/components/AppLauncher/apps.ts +5 -5
  11. package/src/components/AppShell/AppShell.stories.ts +2 -2
  12. package/src/components/AppShell/AppShell.vue +10 -9
  13. package/src/components/Avatar/Avatar.vue +3 -3
  14. package/src/components/AvatarGroup/AvatarGroup.vue +4 -4
  15. package/src/components/Badge/Badge.vue +2 -2
  16. package/src/components/Breadcrumb/Breadcrumb.vue +5 -5
  17. package/src/components/Button/Button.stories.ts +1 -1
  18. package/src/components/Button/Button.vue +12 -9
  19. package/src/components/Calendar/Calendar.stories.ts +2 -2
  20. package/src/components/Calendar/Calendar.vue +8 -8
  21. package/src/components/Card/Card.stories.ts +5 -5
  22. package/src/components/Card/Card.vue +3 -3
  23. package/src/components/CardSelect/CardSelect.vue +10 -7
  24. package/src/components/ChangeIndicator/ChangeIndicator.vue +2 -2
  25. package/src/components/Checkbox/Checkbox.vue +5 -5
  26. package/src/components/CheckboxGroup/CheckboxGroup.stories.ts +1 -1
  27. package/src/components/CheckboxGroup/CheckboxGroup.vue +2 -2
  28. package/src/components/Checklist/Checklist.vue +3 -3
  29. package/src/components/Chip/Chip.stories.ts +1 -1
  30. package/src/components/Chip/Chip.vue +2 -2
  31. package/src/components/Divider/Divider.vue +4 -4
  32. package/src/components/EmptyState/EmptyState.vue +3 -3
  33. package/src/components/Footer/Footer.vue +4 -4
  34. package/src/components/FormField/FieldMessage.vue +3 -3
  35. package/src/components/FormField/FormField.stories.ts +1 -1
  36. package/src/components/FormField/FormField.vue +8 -3
  37. package/src/components/Header/Header.stories.ts +8 -8
  38. package/src/components/Header/Header.vue +10 -7
  39. package/src/components/InfoTip/InfoTip.stories.ts +1 -1
  40. package/src/components/InfoTip/InfoTip.vue +1 -1
  41. package/src/components/Input/Input.vue +1 -1
  42. package/src/components/InputCode/InputCode.stories.ts +1 -1
  43. package/src/components/InputCode/InputCode.vue +4 -4
  44. package/src/components/InputDate/InputDate.stories.ts +1 -1
  45. package/src/components/InputDate/InputDate.vue +5 -5
  46. package/src/components/InputNumber/InputNumber.stories.ts +1 -1
  47. package/src/components/InputNumber/InputNumber.vue +6 -6
  48. package/src/components/InputPassword/InputPassword.vue +4 -4
  49. package/src/components/InputRichText/InputRichText.stories.ts +1 -1
  50. package/src/components/InputRichText/InputRichText.vue +3 -3
  51. package/src/components/InputTextArea/InputTextArea.vue +1 -1
  52. package/src/components/Link/Link.stories.ts +4 -4
  53. package/src/components/Link/Link.vue +1 -1
  54. package/src/components/Menu/Menu.vue +6 -5
  55. package/src/components/Notification/Notification.stories.ts +3 -3
  56. package/src/components/Notification/Notification.vue +9 -9
  57. package/src/components/Notification/NotificationPane.vue +3 -3
  58. package/src/components/Notification/Toaster.vue +1 -1
  59. package/src/components/PageHeader/PageHeader.vue +2 -2
  60. package/src/components/Popover/Popover.stories.ts +2 -2
  61. package/src/components/Popover/popover.ts +4 -3
  62. package/src/components/Progress/Progress.vue +1 -1
  63. package/src/components/RadioGroup/RadioGroup.vue +6 -6
  64. package/src/components/RelativeTime/RelativeTime.stories.ts +1 -1
  65. package/src/components/Select/Select.stories.ts +1 -1
  66. package/src/components/Select/Select.vue +22 -18
  67. package/src/components/SettingsRow/SettingsRow.vue +1 -1
  68. package/src/components/Sidebar/Sidebar.stories.ts +2 -2
  69. package/src/components/Sidebar/Sidebar.vue +9 -9
  70. package/src/components/Slideover/Slideover.stories.ts +5 -5
  71. package/src/components/Slideover/Slideover.vue +6 -6
  72. package/src/components/Spinner/Spinner.stories.ts +7 -7
  73. package/src/components/Spinner/Spinner.vue +1 -1
  74. package/src/components/StatTile/StatTile.stories.ts +2 -2
  75. package/src/components/StatTile/StatTile.vue +6 -6
  76. package/src/components/Steps/Steps.vue +2 -2
  77. package/src/components/SummaryList/SummaryList.vue +8 -8
  78. package/src/components/Switch/Switch.vue +3 -3
  79. package/src/components/Table/Table.vue +12 -12
  80. package/src/components/Tabs/Tabs.vue +4 -4
  81. package/src/components/Tooltip/Tooltip.stories.ts +1 -1
  82. package/src/components/Tooltip/Tooltip.vue +1 -1
  83. package/src/components/UnsavedChangesBar/UnsavedChangesBar.stories.ts +1 -1
  84. package/src/components/UnsavedChangesBar/UnsavedChangesBar.vue +1 -1
  85. package/src/examples/AppPages.stories.ts +3 -3
  86. package/src/examples/FormLayout.stories.ts +3 -3
  87. package/src/examples/KestonIdPages.stories.ts +18 -18
  88. package/src/examples/SchoolPages.stories.ts +5 -5
  89. package/src/styles/theme.css +94 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thekestongroup/ui",
3
- "version": "0.13.1",
3
+ "version": "0.15.0",
4
4
  "description": "Keston UI — Vue 3 + Reka UI + Tailwind CSS component library",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -25,7 +25,7 @@ export const Open: Story = {
25
25
  export const CustomApps: Story = {
26
26
  args: {
27
27
  apps: [
28
- { id: "a", label: "Rota", description: "Who is in when", href: "#a" },
28
+ { id: "a", label: "Rota", href: "#a" },
29
29
  { id: "b", label: "Reports", href: "#b" },
30
30
  ],
31
31
  },
@@ -23,8 +23,6 @@ export interface AppLauncherApp {
23
23
  /** Matches `current` to mark the app you are in. */
24
24
  id: string
25
25
  label: string
26
- /** A few words on what the app is for. */
27
- description?: string
28
26
  href: string
29
27
  /** An icon component, or the name of one of the Keston app icons (id, admin, work, utilities, design). */
30
28
  icon?: Component | string
@@ -43,13 +41,15 @@ export interface AppLauncherProps {
43
41
  apps?: AppLauncherApp[]
44
42
  /** The `id` of the app you are in, shown as the current page. */
45
43
  current?: string
44
+ /** Which edge of the button the panel lines up with: `start` when the button is at the left of the header (AppShell), `end` when at the right. Default `end`. */
45
+ align?: 'start' | 'end'
46
46
  /** Name of the button for screen readers. Default "Keston apps". */
47
47
  label?: string
48
48
  class?: HTMLAttributes['class']
49
49
  }
50
50
 
51
51
  const { t } = useI18n()
52
- const props = withDefaults(defineProps<AppLauncherProps>(), { apps: () => kestonApps })
52
+ const props = withDefaults(defineProps<AppLauncherProps>(), { apps: () => kestonApps, align: 'end' })
53
53
 
54
54
  function iconOf(app: AppLauncherApp): Component {
55
55
  if (typeof app.icon === 'string') return builtInIcons[app.icon] ?? AppWindow
@@ -58,30 +58,27 @@ function iconOf(app: AppLauncherApp): Component {
58
58
  </script>
59
59
 
60
60
  <template>
61
- <Popover :content="{ align: 'end' }" :ui="{ content: 'w-80 p-2' }">
61
+ <Popover :content="{ align }" :ui="{ content: 'w-64 p-2' }">
62
62
  <Button variant="ghost" square :aria-label="label ?? t('ui.appLauncher.label')" :class="props.class">
63
63
  <LayoutGrid />
64
64
  </Button>
65
65
  <template #content="{ close }">
66
66
  <nav :aria-label="label ?? t('ui.appLauncher.label')">
67
- <ul class="grid grid-cols-2 gap-1">
67
+ <ul>
68
68
  <li v-for="app in apps" :key="app.id">
69
69
  <a
70
70
  :href="app.href"
71
71
  :aria-current="app.id === current ? 'page' : undefined"
72
72
  :class="cn(
73
- 'flex h-full flex-col items-start gap-2 rounded-lg p-3 text-sm outline-none hover:bg-black/5 focus-visible:outline-2 focus-visible:outline-focus',
74
- app.id === current && 'bg-black/5'
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-9 items-center justify-center rounded-lg bg-black/5 text-black">
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
- <span class="min-w-0">
82
- <span class="block font-bold text-black">{{ app.label }}</span>
83
- <span v-if="app.description" class="block text-xs text-black/65">{{ app.description }}</span>
84
- </span>
81
+ <span class="min-w-0 truncate">{{ app.label }}</span>
85
82
  </a>
86
83
  </li>
87
84
  </ul>
@@ -2,9 +2,9 @@ import type { AppLauncherApp } from './AppLauncher.vue'
2
2
 
3
3
  /** The Keston Group's apps, as the launcher lists them by default. Apps can pass their own `apps`. */
4
4
  export const kestonApps: AppLauncherApp[] = [
5
- { id: 'id', label: 'Keston ID', description: 'Your account and sign-in', href: 'https://id.keston.co', icon: 'id' },
6
- { id: 'admin', label: 'Admin', description: 'Manage people and access', href: 'https://admin.keston.co', icon: 'admin' },
7
- { id: 'work', label: 'Work', description: 'Day-to-day work', href: 'https://work.keston.co', icon: 'work' },
8
- { id: 'utilities', label: 'Utilities', description: 'Small tools that run on your device', href: 'https://utilities.keston.co', icon: 'utilities' },
9
- { id: 'design', label: 'Design system', description: 'Keston UI', href: 'https://ui.keston.co', icon: 'design' }
5
+ { id: 'id', label: 'Keston ID', href: 'https://id.keston.co', icon: 'id' },
6
+ { id: 'admin', label: 'Admin', href: 'https://admin.keston.co', icon: 'admin' },
7
+ { id: 'work', label: 'Work', href: 'https://work.keston.co', icon: 'work' },
8
+ { id: 'utilities', label: 'Utilities', href: 'https://utilities.keston.co', icon: 'utilities' },
9
+ { id: 'design', label: 'Design system', href: 'https://ui.keston.co', icon: 'design' }
10
10
  ]
@@ -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-black/65">
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-black/65">Choose pages in the sidebar: the breadcrumb follows.</p>
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
  };
@@ -58,7 +58,7 @@ export interface AppShellProps {
58
58
  collapsible?: boolean
59
59
  /** Show the Keston Group footer under the page. The Footer's props: `{ appName, version, … }`. Without it there is no footer. */
60
60
  footer?: FooterProps
61
- /** Show the app launcher (a grid button for moving between Keston apps) in the header. `true` for the defaults, or the AppLauncher's props: `{ current: 'admin' }`. */
61
+ /** Show the app launcher (a grid button for moving between Keston apps) at the left of the header, before the menu button. `true` for the defaults, or the AppLauncher's props: `{ current: 'admin' }`. */
62
62
  launcher?: boolean | AppLauncherProps
63
63
  /** Component used for sidebar items with `to`, and the title link, e.g. RouterLink. */
64
64
  linkComponent?: SidebarProps['linkComponent']
@@ -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-black', props.class)">
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-white px-4 py-2 text-sm focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:outline-2 focus:outline-focus"
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>
@@ -149,13 +149,17 @@ const sidebarId = `${uid}-sidebar`
149
149
  :user="user"
150
150
  :user-actions="userActions"
151
151
  :sign-in="signIn"
152
- :ui="{ ...header?.ui, menu: cn('lg:hidden', header?.ui?.menu) }"
152
+ :ui="{ ...header?.ui, menu: cn('lg:hidden', launcher && 'ml-0', header?.ui?.menu) }"
153
153
  @menu="menuOpen = true"
154
154
  @account-settings="emit('account-settings')"
155
155
  @switch-account="emit('switch-account')"
156
156
  @log-out="emit('log-out')"
157
157
  @sign-in="emit('sign-in')"
158
158
  >
159
+ <!-- First in the header, to the left of the menu / collapse button. -->
160
+ <template v-if="launcher" #start>
161
+ <AppLauncher align="start" v-bind="launcher === true ? {} : launcher" class="-ml-2.5" />
162
+ </template>
159
163
  <template #leading>
160
164
  <!-- Wide screens: in place of the menu button (same look and spot),
161
165
  collapses the sidebar beside the page to icons and back. -->
@@ -166,7 +170,7 @@ const sidebarId = `${uid}-sidebar`
166
170
  :aria-label="collapsed ? t('ui.appShell.expandSidebar') : t('ui.appShell.collapseSidebar')"
167
171
  :aria-expanded="!collapsed"
168
172
  :aria-controls="sidebarId"
169
- class="-ml-2.5 max-lg:hidden"
173
+ :class="cn('max-lg:hidden', launcher ? 'ml-0' : '-ml-2.5')"
170
174
  @click="collapsed = !collapsed"
171
175
  >
172
176
  <Menu />
@@ -174,10 +178,7 @@ const sidebarId = `${uid}-sidebar`
174
178
  <slot name="header-leading" />
175
179
  </template>
176
180
  <slot name="header-middle" />
177
- <template v-if="$slots['header-trailing'] || launcher" #trailing>
178
- <slot name="header-trailing" />
179
- <AppLauncher v-if="launcher" v-bind="launcher === true ? {} : launcher" />
180
- </template>
181
+ <template v-if="$slots['header-trailing']" #trailing><slot name="header-trailing" /></template>
181
182
  <template v-if="$slots.account" #account><slot name="account" /></template>
182
183
  <template v-if="$slots['account-menu']" #account-menu="slotProps"><slot name="account-menu" v-bind="slotProps" /></template>
183
184
  <template v-if="$slots.organisation" #organisation="slotProps"><slot name="organisation" v-bind="slotProps" /></template>
@@ -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-black/65 uppercase">
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-black/65">{{ user.role }}</span>
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-black/65 underline-offset-2 hover:text-black hover:underline outline-2 outline-offset-1 outline-transparent focus-visible:outline-focus"
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-white hover:z-10 focus-within:z-10', rings[size], i > 0 && overlaps[size])"
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-white hover:z-10 focus-within:z-10', rings[size], overlaps[size])">
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-black select-none',
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-black/65">{{ user.role }}</span>
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-black/15 font-bold'
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-white text-black',
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-black/65 underline-offset-2 transition',
72
- 'hover:text-black hover:underline',
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-black')">
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-black/65')">
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-black/40" />
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-black/60">
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-black/15 cursor-pointer transition',
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
- // Ghost has no fill to darken, so hover / press tint it with black instead
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-white text-black ${interactive}`,
176
+ basic: `bg-surface text-ink shadow-xs ${surfaceInteractive}`,
174
177
  primary: `bg-primary text-white ${interactive}`,
175
- ghost: `bg-transparent text-black border-transparent ${ghostInteractive}`,
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-black/65">Chosen: {{ value ?? 'nothing yet' }}</p>`,
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-black/65">3 interviews booked, 2 slots free.</p>
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-black/10 active:bg-black/15 [&_svg]:size-3.5',
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-black/10',
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-black/25 disabled:hover:bg-transparent',
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-black/10',
220
- 'data-[outside-view]:text-black/35',
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-black/25 data-[disabled]:hover:bg-transparent',
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-black', disabled && 'opacity-40', props.class)"
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-black/55"
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-black/65">Email</dt><dd>office@keston.school</dd>
66
- <dt class="text-black/65">Phone</dt><dd>020 7946 0000</dd>
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-black/65">{{ stat[0] }}</span>
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-black/15 text-black/65">
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-black/15"><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>
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-black/15 bg-white text-black',
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-black/65">{{ description }}</p>
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-black/15', footerPaddings[padding], ui?.footer)"
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-black/15 bg-white p-3 text-left text-black transition-colors',
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-elevated',
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-black', disabled && 'opacity-40', props.class)">
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-black/65">
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-black/65 group-data-[state=checked]:text-primary" />
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-black/65">
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-black/55 bg-white group-data-[state=checked]:border-primary"
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-white text-white transition',
65
- 'not-disabled:hover:border-black disabled:cursor-not-allowed',
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-black', disabled && 'opacity-40', props.class)">
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-black/55')"
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-black/65">
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-black/65">{{ value }}</pre>`,
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-black', props.class)">
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-black/65">
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>