@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
@@ -79,8 +79,8 @@ export const Rows: Story = {
79
79
  components: { Notification },
80
80
  setup: () => ({ items: createNotifications(sampleNotifications()).items }),
81
81
  template: `
82
- <ul class="rounded border border-black/15 bg-white">
83
- <li v-for="item in items" :key="item.id" class="border-b border-black/15 last:border-b-0">
82
+ <ul class="rounded border border-ink/10 bg-surface">
83
+ <li v-for="item in items" :key="item.id" class="border-b border-ink/10 last:border-b-0">
84
84
  <Notification appearance="row" v-bind="item" :created-at="item.createdAt" :unread="!item.read" />
85
85
  </li>
86
86
  </ul>`,
@@ -171,7 +171,7 @@ export const Playground: Story = {
171
171
  <template #trailing><NotificationPane :notifications="notifications" /></template>
172
172
  </Header>
173
173
  <div class="flex flex-col gap-4 p-6">
174
- <p class="max-w-prose text-sm text-black/65">Each button sends a notification. It pops up as a toast and is added to the bell.</p>
174
+ <p class="max-w-prose text-sm text-ink/65">Each button sends a notification. It pops up as a toast and is added to the bell.</p>
175
175
  <div class="flex flex-wrap gap-2">
176
176
  <Button @click="notifications.notify(samples.info)">Info</Button>
177
177
  <Button @click="notifications.notify(samples.success)">Success</Button>
@@ -62,10 +62,10 @@ defineSlots<{
62
62
  const titleId = `${useId()}-title`
63
63
 
64
64
  const types = {
65
- info: { icon: Info, colour: 'text-blue', word: 'Information' },
66
- success: { icon: CircleCheck, colour: 'text-green', word: 'Success' },
67
- warning: { icon: TriangleAlert, colour: 'text-yellow', word: 'Warning' },
68
- error: { icon: CircleX, colour: 'text-red', word: 'Error' }
65
+ info: { icon: Info, colour: 'text-blue-fg', word: 'Information' },
66
+ success: { icon: CircleCheck, colour: 'text-green-fg', word: 'Success' },
67
+ warning: { icon: TriangleAlert, colour: 'text-yellow-fg', word: 'Warning' },
68
+ error: { icon: CircleX, colour: 'text-red-fg', word: 'Error' }
69
69
  } as const
70
70
 
71
71
  // A string, or a render function (for bold text, links).
@@ -86,11 +86,11 @@ function runAction() {
86
86
  role="group"
87
87
  :class="
88
88
  cn(
89
- 'relative flex text-sm text-black',
89
+ 'relative flex text-sm text-ink',
90
90
  oneLine ? 'items-center gap-3' : 'gap-3',
91
- appearance === 'row' ? 'px-4 py-3' : 'rounded border border-black/15 bg-white',
91
+ appearance === 'row' ? 'px-4 py-3' : 'rounded border border-ink/10 bg-surface shadow-xs',
92
92
  appearance === 'card' && (oneLine ? cn('py-1.5 pl-5', dismissible ? 'pr-1.5' : 'pr-4') : 'py-4 pr-4 pl-5'),
93
- appearance === 'row' && unread && 'bg-blue/5',
93
+ appearance === 'row' && unread && 'bg-blue-fg/5',
94
94
  props.class
95
95
  )
96
96
  "
@@ -102,11 +102,11 @@ function runAction() {
102
102
  <span class="sr-only">{{ types[type].word }}: </span>{{ title }}
103
103
  </p>
104
104
 
105
- <div v-if="!oneLine && (description || $slots.default)" class="text-black/65 [&_a]:font-bold [&_a]:text-primary [&_a]:underline [&_b]:font-bold [&_b]:text-black [&_strong]:font-bold [&_strong]:text-black">
105
+ <div v-if="!oneLine && (description || $slots.default)" class="text-ink/65 [&_a]:font-bold [&_a]:text-primary-fg [&_a]:underline [&_b]:font-bold [&_b]:text-ink [&_strong]:font-bold [&_strong]:text-ink">
106
106
  <slot><Description /></slot>
107
107
  </div>
108
108
 
109
- <p v-if="appearance === 'row' && (createdAt || unread)" class="flex items-center gap-1.5 text-xs text-black/65">
109
+ <p v-if="appearance === 'row' && (createdAt || unread)" class="flex items-center gap-1.5 text-xs text-ink/65">
110
110
  <span v-if="unread" class="size-2 shrink-0 rounded-full bg-primary" aria-hidden="true" />
111
111
  <span v-if="unread" class="sr-only">Unread, </span>
112
112
  <RelativeTime v-if="createdAt" :date="createdAt" :now="now" />
@@ -135,7 +135,7 @@ async function finishClear() {
135
135
  <Bell />
136
136
  <span
137
137
  v-if="unread"
138
- class="absolute top-1 left-1/2 ml-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red px-1 text-xs leading-none font-bold text-white ring-2 ring-white"
138
+ class="absolute top-1 left-1/2 ml-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red px-1 text-xs leading-none font-bold text-white ring-2 ring-surface"
139
139
  aria-hidden="true"
140
140
  >
141
141
  {{ countText }}
@@ -144,7 +144,7 @@ async function finishClear() {
144
144
 
145
145
  <template #content="{ close }">
146
146
  <section ref="pane" :aria-labelledby="headingId" class="flex min-h-0 flex-col">
147
- <div class="flex h-11 shrink-0 items-center justify-between gap-2 border-b border-black/15 pr-2 pl-4">
147
+ <div class="flex h-11 shrink-0 items-center justify-between gap-2 border-b border-ink/10 pr-2 pl-4">
148
148
  <h2 :id="headingId" ref="heading" tabindex="-1" class="font-bold outline-none">{{ title }}</h2>
149
149
  <Button v-if="items.length" variant="ghost" size="sm" :disabled="clearing" @click="clearAll">
150
150
  {{ t('ui.notifications.clearAll') }}
@@ -159,7 +159,7 @@ async function finishClear() {
159
159
  :class="cn('min-h-0 overflow-y-auto overscroll-contain [scrollbar-width:thin]', clearing && 'animate-fade-out')"
160
160
  @animationend.self="clearing && finishClear()"
161
161
  >
162
- <li v-for="(item, index) in items" :key="item.id" class="border-b border-black/15 last:border-b-0">
162
+ <li v-for="(item, index) in items" :key="item.id" class="border-b border-ink/10 last:border-b-0">
163
163
  <Notification
164
164
  appearance="row"
165
165
  :type="item.type"
@@ -426,7 +426,7 @@ const positions = {
426
426
  type="button"
427
427
  :class="
428
428
  cn(
429
- 'flex cursor-pointer items-center justify-center overflow-hidden border border-black/15 bg-white font-bold whitespace-nowrap text-black shadow-md hover:bg-surface-elevated',
429
+ 'flex cursor-pointer items-center justify-center overflow-hidden border border-ink/10 bg-surface font-bold whitespace-nowrap text-ink shadow-md hover:bg-surface-hover',
430
430
  'h-7 w-24 rounded-2xl text-xs',
431
431
  hidden && 'in-data-expanded:h-9 in-data-expanded:w-full in-data-expanded:rounded in-data-expanded:text-sm',
432
432
  'transition-[width,height,border-radius,font-size,background-color] duration-300 ease-out motion-reduce:transition-none',
@@ -142,7 +142,7 @@ const overflow = computed<MenuItem[]>(() => (props.toolbar ?? []).slice(shown.va
142
142
  <h1 :class="cn('min-w-0 text-2xl font-bold break-words', ui?.title)">{{ title }}</h1>
143
143
  <slot name="badge" />
144
144
  </div>
145
- <p v-if="description || $slots.description" :class="cn('max-w-prose text-sm text-black/65', ui?.description)">
145
+ <p v-if="description || $slots.description" :class="cn('max-w-prose text-sm text-ink/65', ui?.description)">
146
146
  <slot name="description">{{ description }}</slot>
147
147
  </p>
148
148
  </div>
@@ -158,7 +158,7 @@ const overflow = computed<MenuItem[]>(() => (props.toolbar ?? []).slice(shown.va
158
158
  v-if="hasToolbar"
159
159
  role="group"
160
160
  :aria-label="t('ui.pageHeader.actions', { title })"
161
- :class="cn('flex items-center gap-1 rounded-lg border border-black/15 bg-white p-1', ui?.toolbar)"
161
+ :class="cn('flex items-center gap-1 rounded-lg border border-ink/10 bg-surface p-1 shadow-xs', ui?.toolbar)"
162
162
  >
163
163
  <!-- Text here reads as the toolbar's own: bold, spaced like a button. -->
164
164
  <div v-if="$slots['toolbar-start']" class="flex shrink-0 items-center gap-2 px-3 text-sm font-bold" aria-live="polite">
@@ -67,7 +67,7 @@ export const Hover: Story = {
67
67
  setup: () => ({ args }),
68
68
  template: `
69
69
  <Popover v-bind="args">
70
- <button type="button" aria-label="About attendance codes" class="inline-flex rounded-full p-1 transition hover:bg-black/10 [&_svg]:size-4">
70
+ <button type="button" aria-label="About attendance codes" class="inline-flex rounded-full p-1 transition hover:bg-hover [&_svg]:size-4">
71
71
  <CircleHelp />
72
72
  </button>
73
73
  <template #content>
@@ -107,7 +107,7 @@ export const NotDismissible: Story = {
107
107
  <template #content="{ close }">
108
108
  <div class="flex w-64 flex-col gap-3 p-3 text-sm">
109
109
  <p>Only the button below closes this.</p>
110
- <p class="text-black/60">Blocked close attempts: {{ attempts }}</p>
110
+ <p class="text-ink/60">Blocked close attempts: {{ attempts }}</p>
111
111
  <Button size="sm" @click="close">Close</Button>
112
112
  </div>
113
113
  </template>
@@ -2,12 +2,13 @@
2
2
  * The shared look of floating panels: Popover, and anything else built on
3
3
  * Reka's popper (e.g. InputDate's calendar), so they all match.
4
4
  *
5
- * White panel with the same border and radius as a basic Button, a shadow,
5
+ * An elevated panel (white; a step lighter than the page in dark mode) with
6
+ * the same border and radius as a basic Button, a shadow,
6
7
  * and the theme's fade in / out (Reka waits for the fade-out to finish
7
8
  * before removing the panel).
8
9
  */
9
10
  export const popoverContent = [
10
- 'z-50 rounded border border-black/15 bg-white text-black shadow-md outline-none',
11
+ 'z-50 rounded border border-ink/10 bg-surface-elevated text-ink shadow-md outline-none',
11
12
  'data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out'
12
13
  ]
13
14
 
@@ -17,4 +18,4 @@ export const popoverContent = [
17
18
  * covers the panel's border where they meet. Reka rotates the arrow's wrapper
18
19
  * for each side, so this only needs drawing pointing down.
19
20
  */
20
- export const popoverArrow = 'block size-2.5 -translate-y-1/2 rotate-45 border-r border-b border-black/15 bg-white'
21
+ export const popoverArrow = 'block size-2.5 -translate-y-1/2 rotate-45 border-r border-b border-ink/10 bg-surface-elevated'
@@ -43,7 +43,7 @@ const valueText = () =>
43
43
  ? t('ui.progress.stepOf', { current: clamped.value, total: props.max })
44
44
  : `${Math.round(percent.value)}%`
45
45
 
46
- const track = 'h-1.5 overflow-hidden rounded-full bg-black/10'
46
+ const track = 'h-1.5 overflow-hidden rounded-full bg-ink/10'
47
47
  // Filling and segments colouring in ease over 300ms.
48
48
  const fill = 'h-full rounded-full bg-primary transition-[translate,background-color] duration-300 ease-out motion-reduce:transition-none'
49
49
  </script>
@@ -68,22 +68,22 @@ function pressControl(event: MouseEvent, id: string) {
68
68
  // 16px circle, level with the first line of the label; the chosen one gets a
69
69
  // dot. The border is darker than a text box's so each circle is easy to see.
70
70
  const circle = [
71
- 'mt-0.5 flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full border bg-white transition',
72
- 'not-disabled:hover:border-black disabled:cursor-not-allowed',
71
+ 'mt-0.5 flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full border bg-surface transition',
72
+ 'not-disabled:hover:border-ink disabled:cursor-not-allowed',
73
73
  'data-[state=checked]:border-primary data-[state=checked]:hover:border-primary',
74
74
  'outline-2 outline-offset-2 outline-transparent focus-visible:outline-focus'
75
75
  ]
76
76
  </script>
77
77
 
78
78
  <template>
79
- <div :class="cn('flex flex-col gap-1.5 text-black', disabled && 'opacity-40', props.class)">
79
+ <div :class="cn('flex flex-col gap-1.5 text-ink', disabled && 'opacity-40', props.class)">
80
80
  <div class="flex flex-col gap-0.5">
81
81
  <div class="flex items-center gap-1">
82
82
  <span :id="labelId" class="text-sm">{{ label }}</span>
83
83
  <InfoTip v-if="helper && helperPlacement === 'icon'" :text="helper" :label="t('ui.formField.about', { label })" />
84
84
  </div>
85
85
  <!-- Behind the ?: hidden, but still the group's description. -->
86
- <p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-black/65">
86
+ <p v-if="helper" :id="helperId" :hidden="helperPlacement === 'icon'" class="text-xs text-ink/65">
87
87
  {{ helper }}
88
88
  </p>
89
89
  </div>
@@ -104,7 +104,7 @@ const circle = [
104
104
  :value="option.value"
105
105
  :disabled="option.disabled"
106
106
  :aria-describedby="option.description ? `${id}-${i}-description` : undefined"
107
- :class="cn(circle, errorText ? 'border-red' : 'border-black/55', option.disabled && !disabled && 'opacity-40')"
107
+ :class="cn(circle, errorText ? 'border-red' : 'border-ink/45', option.disabled && !disabled && 'opacity-40')"
108
108
  >
109
109
  <RadioGroupIndicator class="size-2 rounded-full bg-primary" />
110
110
  </RadioGroupItem>
@@ -122,7 +122,7 @@ const circle = [
122
122
  >
123
123
  {{ option.label }}
124
124
  </label>
125
- <p v-if="option.description" :id="`${id}-${i}-description`" class="text-xs text-black/65">
125
+ <p v-if="option.description" :id="`${id}-${i}-description`" class="text-xs text-ink/65">
126
126
  {{ option.description }}
127
127
  </p>
128
128
  </div>
@@ -61,7 +61,7 @@ export const Ages: Story = {
61
61
  },
62
62
  template: `
63
63
  <table class="text-left">
64
- <thead class="text-black/65"><tr><th class="pr-8 pb-2 font-bold">Student</th><th class="pb-2 text-right font-bold">Age</th></tr></thead>
64
+ <thead class="text-ink/65"><tr><th class="pr-8 pb-2 font-bold">Student</th><th class="pb-2 text-right font-bold">Age</th></tr></thead>
65
65
  <tbody>
66
66
  <tr v-for="s in students" :key="s.name">
67
67
  <td class="py-1 pr-8">{{ s.name }}</td>
@@ -31,7 +31,7 @@ const meta = {
31
31
  },
32
32
  template: `
33
33
  <Select v-bind="args" v-model="value" />
34
- <p class="mt-4 text-xs text-black/65">Value: {{ value === undefined ? "undefined" : JSON.stringify(value) }}</p>`,
34
+ <p class="mt-4 text-xs text-ink/65">Value: {{ value === undefined ? "undefined" : JSON.stringify(value) }}</p>`,
35
35
  }),
36
36
  } satisfies Meta<typeof Select>;
37
37
 
@@ -399,7 +399,10 @@ const parts = computed(() =>
399
399
  // The trigger (or the search box's anchor) fills FormField's box: negative
400
400
  // margins cancel its padding, so the whole box opens the list. The box draws
401
401
  // the border and focus ring.
402
- const fill = '-mx-3 -my-2 flex min-w-0 flex-1 items-center gap-2 self-stretch px-3 py-2'
402
+ //
403
+ // Anything that isn't text sits as far from the side as from the top and
404
+ // bottom: icons and the chevron 10px (like FormField), chips 8px.
405
+ const fill = '-mx-3 -my-2 flex min-w-0 flex-1 items-center gap-2 self-stretch px-3 py-2 [&>svg:first-child]:-ml-0.5 [&>svg:last-child]:-mr-0.5'
403
406
 
404
407
  // The list is at least as wide as the field and no taller than the space
405
408
  // below / above it; it scrolls inside.
@@ -411,12 +414,13 @@ const content = computed(() => cn(
411
414
  : 'max-h-(--reka-select-content-available-height) min-w-(--reka-select-trigger-width) max-w-[max(var(--reka-select-trigger-width),--spacing(80))]'
412
415
  ))
413
416
 
414
- // Compact rows: 32px tall with a label only (6px + 20px line + 6px), 8px
415
- // either side, tinted like a ghost Button. A description adds lines below;
417
+ // Compact rows: 32px tall with a label only (6px + 20px line + 6px), running
418
+ // the full width of the panel and square (the panel keeps its rounded
419
+ // corners), text 12px from the edge, tinted when highlighted. A description adds lines below;
416
420
  // the icon and tick stay level with the label (h-5 slots, top-aligned).
417
421
  const item = [
418
- 'relative flex min-h-8 cursor-pointer items-start gap-2 rounded px-2 py-1.5 text-sm outline-none select-none',
419
- 'data-highlighted:bg-black/10',
422
+ 'relative flex min-h-8 cursor-pointer items-start gap-2 px-3 py-1.5 text-sm outline-none select-none',
423
+ 'data-highlighted:bg-selected',
420
424
  'data-disabled:cursor-not-allowed data-disabled:opacity-40'
421
425
  ]
422
426
 
@@ -471,7 +475,7 @@ const chevron = 'transition-transform duration-150 in-data-[state=open]:rotate-1
471
475
  <!-- Multiple: a chip per chosen option, then the search box, wrapping
472
476
  onto more lines as needed. × removes one (mouse); keyboard users
473
477
  press Backspace in the empty box, or untick it in the list. -->
474
- <span :class="multiple ? 'flex min-w-0 flex-1 flex-wrap items-center gap-1' : 'contents'">
478
+ <span :class="multiple ? cn('flex min-w-0 flex-1 flex-wrap items-center gap-1', chosen.length && '-ml-1') : 'contents'">
475
479
  <!-- pointerdown.stop keeps a press on × from opening the list. -->
476
480
  <Chip
477
481
  v-for="option in chosen"
@@ -496,7 +500,7 @@ const chevron = 'transition-transform duration-150 in-data-[state=open]:rotate-1
496
500
  :aria-invalid="invalid"
497
501
  :aria-describedby="describedBy"
498
502
  autocomplete="off"
499
- :class="cn('h-5 min-w-0 flex-1 bg-transparent outline-none placeholder:text-black/55 disabled:cursor-not-allowed', multiple && 'min-w-16')"
503
+ :class="cn('h-5 min-w-0 flex-1 bg-transparent outline-none placeholder:text-ink/55 disabled:cursor-not-allowed', multiple && 'min-w-16')"
500
504
  :data-pointer-focus="pointerFocus || undefined"
501
505
  @focus="onSearchFocus"
502
506
  @blur="pointerFocus = false"
@@ -504,7 +508,7 @@ const chevron = 'transition-transform duration-150 in-data-[state=open]:rotate-1
504
508
  @keydown.backspace="onSearchBackspace"
505
509
  />
506
510
  </span>
507
- <ComboboxTrigger tabindex="-1" :aria-label="t('ui.select.showOptions')" class="flex cursor-pointer disabled:cursor-not-allowed">
511
+ <ComboboxTrigger tabindex="-1" :aria-label="t('ui.select.showOptions')" class="-mr-0.5 flex cursor-pointer disabled:cursor-not-allowed">
508
512
  <ChevronDown aria-hidden="true" :class="chevron" />
509
513
  </ComboboxTrigger>
510
514
  </ComboboxAnchor>
@@ -517,7 +521,7 @@ const chevron = 'transition-transform duration-150 in-data-[state=open]:rotate-1
517
521
  :aria-describedby="describedBy"
518
522
  :data-pointer-focus="pointerFocus || undefined"
519
523
  @blur="pointerFocus = false"
520
- :class="cn(fill, 'cursor-pointer text-left outline-none disabled:cursor-not-allowed data-placeholder:text-black/55')"
524
+ :class="cn(fill, 'cursor-pointer text-left outline-none disabled:cursor-not-allowed data-placeholder:text-ink/55')"
521
525
  >
522
526
  <slot name="leading">
523
527
  <component :is="selected.icon" v-if="selected?.icon" aria-hidden="true" />
@@ -526,7 +530,7 @@ const chevron = 'transition-transform duration-150 in-data-[state=open]:rotate-1
526
530
  SelectValue, which only knows the options currently showing (a
527
531
  nested choice isn't, once the list is back at the top). -->
528
532
  <!-- Multiple: a chip per chosen option, wrapping onto more lines. -->
529
- <span v-if="multiple && chosen.length" class="flex min-w-0 flex-1 flex-wrap gap-1">
533
+ <span v-if="multiple && chosen.length" class="-ml-1 flex min-w-0 flex-1 flex-wrap gap-1">
530
534
  <Chip v-for="option in chosen" :key="String(option.value)" size="sm">
531
535
  <template v-if="option.icon" #leading><component :is="option.icon" aria-hidden="true" /></template>
532
536
  {{ option.label }}
@@ -553,9 +557,9 @@ const chevron = 'transition-transform duration-150 in-data-[state=open]:rotate-1
553
557
  one so long lists look scrollable. -->
554
558
  <component
555
559
  :is="parts.Viewport"
556
- class="flex flex-col gap-0.5 p-1 [scrollbar-width:thin]! [&::-webkit-scrollbar]:block!"
560
+ class="flex flex-col py-1 [scrollbar-width:thin]! [&::-webkit-scrollbar]:block!"
557
561
  >
558
- <ComboboxEmpty v-if="searchable" class="px-2 py-1.5 text-sm text-black/65">
562
+ <ComboboxEmpty v-if="searchable" class="px-3 py-1.5 text-sm text-ink/65">
559
563
  {{ emptyText ?? t('ui.select.noMatches') }}
560
564
  </ComboboxEmpty>
561
565
 
@@ -575,20 +579,20 @@ const chevron = 'transition-transform duration-150 in-data-[state=open]:rotate-1
575
579
  <!-- Names the level being shown; pressing it goes up one. -->
576
580
  <span class="min-w-0 flex-1 truncate"><span class="sr-only">Back from </span>{{ current!.label }}</span>
577
581
  </component>
578
- <component :is="parts.Separator" class="-mx-1 my-0.5 border-t border-black/15" />
582
+ <component :is="parts.Separator" class="my-1 border-t border-ink/10" />
579
583
  </template>
580
584
 
581
585
  <template v-for="(group, g) in shownGroups" :key="g">
582
586
  <component
583
587
  :is="parts.Separator"
584
588
  v-if="g > 0 && !search"
585
- class="-mx-1 my-0.5 border-t border-black/15"
589
+ class="my-1 border-t border-ink/10"
586
590
  />
587
- <component :is="parts.Group" class="flex flex-col gap-0.5">
591
+ <component :is="parts.Group" class="flex flex-col">
588
592
  <component
589
593
  :is="parts.Label"
590
594
  v-if="group.label"
591
- class="flex h-6 items-center gap-1.5 px-2 text-xs font-bold text-black/65 uppercase"
595
+ class="flex h-6 items-center gap-1.5 px-3 text-xs font-bold text-ink/65 uppercase"
592
596
  >
593
597
  <component :is="group.icon" v-if="group.icon" aria-hidden="true" class="size-3.5 shrink-0" />
594
598
  <span class="truncate">{{ group.label }}</span>
@@ -613,8 +617,8 @@ const chevron = 'transition-transform duration-150 in-data-[state=open]:rotate-1
613
617
  <component :is="parts.ItemText" class="truncate in-data-[state=checked]:font-bold">
614
618
  {{ row.option.label }}<span v-if="row.parent" class="sr-only">, more options</span>
615
619
  </component>
616
- <span v-if="row.path" class="text-xs text-black/65">{{ row.path }}</span>
617
- <span v-if="row.option.description" class="text-xs text-black/65">{{ row.option.description }}</span>
620
+ <span v-if="row.path" class="text-xs text-ink/65">{{ row.path }}</span>
621
+ <span v-if="row.option.description" class="text-xs text-ink/65">{{ row.option.description }}</span>
618
622
  </span>
619
623
  <!-- Parents: an arrow into their options. Others: the tick's
620
624
  space, reserved on every row so labels don't shift. -->
@@ -30,7 +30,7 @@ defineSlots<{
30
30
  <div class="flex min-w-0 flex-col gap-0.5">
31
31
  <!-- The control has this name too (hide-label), so it isn't read twice. -->
32
32
  <p class="text-sm" aria-hidden="true">{{ label }}</p>
33
- <p v-if="description" class="text-xs text-black/65">{{ description }}</p>
33
+ <p v-if="description" class="text-xs text-ink/65">{{ description }}</p>
34
34
  </div>
35
35
  <div class="w-full shrink-0 sm:w-80">
36
36
  <slot />
@@ -116,10 +116,10 @@ export const WithFooter: Story = {
116
116
  <template #header="{ collapsed }">${Logo}</template>
117
117
  <template #footer>
118
118
  <div class="flex items-center gap-3 px-3 py-2 text-sm">
119
- <span class="flex size-7 shrink-0 items-center justify-center rounded-full bg-black/10 text-xs font-bold" aria-hidden="true">BS</span>
119
+ <span class="flex size-7 shrink-0 items-center justify-center rounded-full bg-ink/10 text-xs font-bold" aria-hidden="true">BS</span>
120
120
  <span class="flex min-w-0 flex-col">
121
121
  <span class="truncate font-bold">Ben Smith</span>
122
- <span class="truncate text-xs text-black/65">Head of Year 9</span>
122
+ <span class="truncate text-xs text-ink/65">Head of Year 9</span>
123
123
  </span>
124
124
  </div>
125
125
  </template>
@@ -247,22 +247,22 @@ const itemBase = [
247
247
  // Inset, so the ring isn't clipped by the scrolling body.
248
248
  'outline-2 -outline-offset-2 outline-transparent forced-colors:not-focus-visible:outline-0',
249
249
  'focus-visible:outline-focus',
250
- 'not-aria-disabled:not-disabled:hover:bg-black/10 not-aria-disabled:not-disabled:active:bg-black/15',
250
+ 'not-aria-disabled:not-disabled:hover:bg-hover not-aria-disabled:not-disabled:active:bg-pressed',
251
251
  'disabled:cursor-not-allowed disabled:opacity-40 aria-disabled:cursor-not-allowed aria-disabled:opacity-40'
252
252
  ]
253
253
 
254
- const itemActive = 'bg-primary/10 font-bold text-primary not-aria-disabled:not-disabled:hover:bg-primary/15'
254
+ const itemActive = 'bg-primary/10 font-bold text-primary-fg not-aria-disabled:not-disabled:hover:bg-primary/15'
255
255
 
256
256
  // A parent of the current page: bold primary text, no fill, so it reads as
257
257
  // "you are in here" without looking like the page itself.
258
- const itemActiveParent = 'font-bold text-primary'
258
+ const itemActiveParent = 'font-bold text-primary-fg'
259
259
  </script>
260
260
 
261
261
  <template>
262
262
  <aside
263
263
  :data-collapsed="collapsed || undefined"
264
264
  :class="cn(
265
- 'flex h-full shrink-0 flex-col border-r border-black/15 bg-white text-black',
265
+ 'flex h-full shrink-0 flex-col border-r border-ink/10 bg-surface text-ink',
266
266
  'w-64 transition-[width] duration-300 ease-out motion-reduce:transition-none',
267
267
  collapsed && 'w-14',
268
268
  props.class
@@ -270,7 +270,7 @@ const itemActiveParent = 'font-bold text-primary'
270
270
  >
271
271
  <div
272
272
  v-if="$slots.header"
273
- :class="cn('flex h-12 shrink-0 items-center gap-2 overflow-hidden border-b border-black/15 px-4', ui?.header)"
273
+ :class="cn('flex h-12 shrink-0 items-center gap-2 overflow-hidden border-b border-ink/10 px-4', ui?.header)"
274
274
  >
275
275
  <slot name="header" :collapsed="collapsed" />
276
276
  </div>
@@ -290,7 +290,7 @@ const itemActiveParent = 'font-bold text-primary'
290
290
  <div :key="levelKey" :data-level="levelKey" class="flex flex-col gap-4">
291
291
  <!-- Inside a nested item: ‹ and its label, back to the level above.
292
292
  The divider under it keeps the list's gap-4 rhythm with sections. -->
293
- <div v-if="current" class="-mb-2 flex flex-col gap-1 border-b border-black/15 pb-2">
293
+ <div v-if="current" class="-mb-2 flex flex-col gap-1 border-b border-ink/10 pb-2">
294
294
  <button
295
295
  type="button"
296
296
  data-back
@@ -311,13 +311,13 @@ const itemActiveParent = 'font-bold text-primary'
311
311
  <div v-if="section.label" class="relative flex h-6 items-center px-3">
312
312
  <div
313
313
  :id="`${uid}-section-${s}`"
314
- :class="cn('truncate text-xs font-bold text-black/65 uppercase', fade, collapsed && 'opacity-0')"
314
+ :class="cn('truncate text-xs font-bold text-ink/65 uppercase', fade, collapsed && 'opacity-0')"
315
315
  >
316
316
  {{ section.label }}
317
317
  </div>
318
318
  <div
319
319
  aria-hidden="true"
320
- :class="cn('absolute inset-x-2 top-1/2 border-t border-black/15', fade, !collapsed && 'opacity-0')"
320
+ :class="cn('absolute inset-x-2 top-1/2 border-t border-ink/10', fade, !collapsed && 'opacity-0')"
321
321
  />
322
322
  </div>
323
323
 
@@ -363,7 +363,7 @@ const itemActiveParent = 'font-bold text-primary'
363
363
 
364
364
  <div
365
365
  v-if="$slots.footer || collapsible"
366
- :class="cn('flex shrink-0 flex-col gap-1 overflow-hidden border-t border-black/15 p-2', ui?.footer)"
366
+ :class="cn('flex shrink-0 flex-col gap-1 overflow-hidden border-t border-ink/10 p-2', ui?.footer)"
367
367
  >
368
368
  <slot name="footer" :collapsed="collapsed" />
369
369
  <Button
@@ -32,7 +32,7 @@ const meta = {
32
32
  <Slideover v-bind="args">
33
33
  <Button>Open slideover</Button>
34
34
  <template #body>
35
- <p class="text-sm text-black/65">Nothing new.</p>
35
+ <p class="text-sm text-ink/65">Nothing new.</p>
36
36
  </template>
37
37
  </Slideover>`,
38
38
  }),
@@ -160,7 +160,7 @@ export const Sides: Story = {
160
160
  <div class="flex gap-2">
161
161
  <Slideover v-for="side in ['right', 'left', 'top', 'bottom']" :key="side" v-bind="args" :side="side" :title="'From the ' + side">
162
162
  <Button>{{ side }}</Button>
163
- <template #body><p class="text-sm text-black/65">Slides in from the {{ side }}.</p></template>
163
+ <template #body><p class="text-sm text-ink/65">Slides in from the {{ side }}.</p></template>
164
164
  </Slideover>
165
165
  </div>`,
166
166
  }),
@@ -177,7 +177,7 @@ export const LongContent: Story = {
177
177
  <Button>Open log</Button>
178
178
  <template #body>
179
179
  <ul class="flex flex-col gap-3 text-sm">
180
- <li v-for="n in 40" :key="n" class="rounded border border-black/15 p-3">Entry {{ n }}</li>
180
+ <li v-for="n in 40" :key="n" class="rounded border border-ink/10 p-3">Entry {{ n }}</li>
181
181
  </ul>
182
182
  </template>
183
183
  <template #footer="{ close }"><Button @click="close">Done</Button></template>
@@ -197,7 +197,7 @@ export const NotDismissible: Story = {
197
197
  template: `
198
198
  <Slideover v-bind="args" @close:prevent="attempts++">
199
199
  <Button>Open</Button>
200
- <template #body><p class="text-sm text-black/65">Blocked close attempts: {{ attempts }}</p></template>
200
+ <template #body><p class="text-sm text-ink/65">Blocked close attempts: {{ attempts }}</p></template>
201
201
  <template #footer="{ close }">
202
202
  <Button @click="close">Discard</Button>
203
203
  <Button variant="primary" @click="close">Save</Button>
@@ -218,7 +218,7 @@ export const Controlled: Story = {
218
218
  <div>
219
219
  <Button variant="primary" @click="open = true">Open from code</Button>
220
220
  <Slideover v-bind="args" v-model:open="open">
221
- <template #body><p class="text-sm text-black/65">Opened with v-model:open.</p></template>
221
+ <template #body><p class="text-sm text-ink/65">Opened with v-model:open.</p></template>
222
222
  </Slideover>
223
223
  </div>`,
224
224
  }),
@@ -262,7 +262,7 @@ const sides: Record<NonNullable<SlideoverProps['side']>, string> = {
262
262
  }
263
263
 
264
264
  const panel = [
265
- 'fixed z-50 flex flex-col bg-white text-black border-black/15 shadow-xl outline-none',
265
+ 'fixed z-50 flex flex-col bg-surface text-ink border-ink/10 shadow-xl outline-none',
266
266
  // Reduced motion: fade instead of sliding.
267
267
  'motion-reduce:data-[state=open]:animate-fade-in motion-reduce:data-[state=closed]:animate-fade-out'
268
268
  ]
@@ -293,11 +293,11 @@ const panel = [
293
293
  <slot name="content" :close="closePanel">
294
294
  <header
295
295
  v-if="title || description || close || steps || $slots.header || $slots.title"
296
- :class="cn('flex flex-col gap-4 border-b border-black/15 px-6 py-4', ui?.header)"
296
+ :class="cn('flex flex-col gap-4 border-b border-ink/10 px-6 py-4', ui?.header)"
297
297
  >
298
298
  <!-- The step sits above its progress bar. -->
299
- <p v-if="steps" :id="stepLabelId" class="text-sm text-black/65">
300
- Step {{ step + 1 }} of {{ stepCount }}: <span class="text-black">{{ steps[step] }}</span>
299
+ <p v-if="steps" :id="stepLabelId" class="text-sm text-ink/65">
300
+ Step {{ step + 1 }} of {{ stepCount }}: <span class="text-ink">{{ steps[step] }}</span>
301
301
  </p>
302
302
  <Progress v-if="steps" :label="title ?? t('ui.slideover.steps')" segments :value="step + 1" :max="stepCount" />
303
303
  <div class="flex items-start gap-4">
@@ -311,7 +311,7 @@ const panel = [
311
311
  <DialogDescription
312
312
  v-if="description || $slots.description || steps"
313
313
  as="div"
314
- class="flex flex-col gap-1 text-sm text-black/65"
314
+ class="flex flex-col gap-1 text-sm text-ink/65"
315
315
  >
316
316
  <p v-if="description || $slots.description"><slot name="description">{{ description }}</slot></p>
317
317
  <p v-if="steps" class="sr-only">{{ stepText }}</p>
@@ -341,7 +341,7 @@ const panel = [
341
341
 
342
342
  <footer
343
343
  v-if="$slots.footer || steps"
344
- :class="cn('flex justify-end gap-2 border-t border-black/15 px-6 py-4', ui?.footer)"
344
+ :class="cn('flex justify-end gap-2 border-t border-ink/10 px-6 py-4', ui?.footer)"
345
345
  >
346
346
  <slot name="footer" :close="closePanel">
347
347
  <!-- Steps: Cancel or Previous on the left, Next or Finish on the right. -->
@@ -14,7 +14,7 @@ const meta = {
14
14
  render: (args) => ({
15
15
  components: { Spinner },
16
16
  setup: () => ({ args }),
17
- template: '<Spinner v-bind="args" class="text-primary" />',
17
+ template: '<Spinner v-bind="args" class="text-primary-fg" />',
18
18
  }),
19
19
  } satisfies Meta<typeof Spinner>;
20
20
 
@@ -42,7 +42,7 @@ export const Filling: Story = {
42
42
  onBeforeUnmount(() => clearInterval(timer));
43
43
  return { args, value };
44
44
  },
45
- template: '<Spinner v-bind="args" :value="value" class="text-primary" />',
45
+ template: '<Spinner v-bind="args" :value="value" class="text-primary-fg" />',
46
46
  }),
47
47
  };
48
48
 
@@ -50,7 +50,7 @@ export const Sizes: Story = {
50
50
  render: () => ({
51
51
  components: { Spinner },
52
52
  template: `
53
- <div class="flex items-center gap-6 text-primary">
53
+ <div class="flex items-center gap-6 text-primary-fg">
54
54
  <Spinner size="sm" />
55
55
  <Spinner size="md" />
56
56
  <Spinner size="lg" />
@@ -67,10 +67,10 @@ export const Colours: Story = {
67
67
  components: { Spinner },
68
68
  template: `
69
69
  <div class="flex items-center gap-6">
70
- <Spinner class="text-primary" :value="70" />
71
- <Spinner class="text-green" :value="70" />
72
- <Spinner class="text-red" :value="70" />
73
- <Spinner class="text-black" />
70
+ <Spinner class="text-primary-fg" :value="70" />
71
+ <Spinner class="text-green-fg" :value="70" />
72
+ <Spinner class="text-red-fg" :value="70" />
73
+ <Spinner class="text-ink" />
74
74
  <span class="inline-flex rounded bg-primary p-2 text-white">
75
75
  <Spinner />
76
76
  </span>
@@ -11,7 +11,7 @@ import { cn } from '../../lib/cn'
11
11
  * - `value` from 0 to `max`: a ring that fills as the value goes up.
12
12
  *
13
13
  * It takes the surrounding text colour, like an icon, so put a text colour
14
- * class on it or its parent (e.g. `class="text-primary"`).
14
+ * class on it or its parent (e.g. `class="text-primary-fg"`).
15
15
  */
16
16
  export interface SpinnerProps {
17
17
  /** Progress from 0 to `max`. Leave out (or null) for a continuous spinner. */
@@ -68,7 +68,7 @@ export const WithDescriptionAndFooter: Story = {
68
68
  setup: () => ({ args }),
69
69
  template: `
70
70
  <StatTile v-bind="args">
71
- <template #footer><a href="#" class="font-bold text-primary underline-offset-2 hover:underline">View applications</a></template>
71
+ <template #footer><a href="#" class="font-bold text-primary-fg underline-offset-2 hover:underline">View applications</a></template>
72
72
  </StatTile>`,
73
73
  }),
74
74
  };
@@ -79,6 +79,6 @@ export const WithUnit: Story = {
79
79
  render: (args) => ({
80
80
  components: { StatTile },
81
81
  setup: () => ({ args }),
82
- template: `<StatTile v-bind="args"><template #value>27.4 <span class="text-sm font-normal text-black/65">students</span></template></StatTile>`,
82
+ template: `<StatTile v-bind="args"><template #value>27.4 <span class="text-sm font-normal text-ink/65">students</span></template></StatTile>`,
83
83
  }),
84
84
  };