@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
@@ -26,19 +26,72 @@
26
26
 
27
27
  @theme {
28
28
  --font-sans: "Lato", sans-serif;
29
+
30
+ /*
31
+ * Colours
32
+ * -------
33
+ * Each colour holds its light and dark value: light-dark(light, dark). The
34
+ * browser picks one from the element's color-scheme, set by data-theme (see
35
+ * "Dark mode" at the end of this file). Tailwind's shades are named in
36
+ * comments; hex values for native apps are in tokens/README.md.
37
+ *
38
+ * black / white never change. Use them only where the colour must stay the
39
+ * same in both modes: white text on a coloured fill, black text on yellow,
40
+ * the dimmed backdrop behind a Slideover.
41
+ *
42
+ * Everything else uses the colours below:
43
+ * - ink: text, icons, borders and tints, usually with an opacity:
44
+ * text-ink (body text), text-ink/65 (secondary text), border-ink/10
45
+ * (cards, dividers, buttons), border-ink/45 (outlines of form fields,
46
+ * checkboxes and radios: 3:1 contrast, WCAG 1.4.11).
47
+ * - background: the page. surface: cards, fields, header, sidebar.
48
+ * surface-elevated: things that float (popovers, menus, toasts). In dark
49
+ * mode it's a step lighter, as shadows barely show on dark.
50
+ * surface-muted: a solid grey fill, e.g. the "+3" in an AvatarGroup.
51
+ */
29
52
  --color-white: #fafafa;
30
53
  --color-black: #050505;
31
- --color-primary: var(--color-kblue);
54
+ --color-ink: light-dark(#050505, oklch(98.5% 0 0)); /* dark: neutral-50 */
55
+ --color-background: light-dark(oklch(97% 0 0), oklch(14.5% 0 0)); /* neutral-100 / 950 */
56
+ --color-surface: light-dark(#ffffff, oklch(20.5% 0 0)); /* white / neutral-900 */
57
+ --color-surface-elevated: light-dark(#ffffff, oklch(26.9% 0 0)); /* white / neutral-800 */
58
+ --color-surface-muted: light-dark(oklch(92.2% 0 0), oklch(26.9% 0 0)); /* neutral-200 / 800 */
59
+
60
+ /* Brand and status colours as fills: white text on them (black on yellow).
61
+ Dark mode lightens Keston blue (sky-700) so primary buttons, switches and
62
+ checkboxes stand out from the dark page; white text on it still passes. */
32
63
  --color-kblue: #023750;
33
- --color-background: #e1e1e1;
34
- --color-surface: #ebebeb;
35
- --color-surface-elevated: #f2f2f2;
64
+ --color-primary: light-dark(var(--color-kblue), oklch(50% 0.134 242.749)); /* dark: sky-700 */
36
65
  --color-green: #007a16;
37
66
  --color-yellow: #f1c70b;
38
67
  --color-red: #d2042d;
39
68
  --color-blue: #035483;
40
69
  --color-focus: #007fc9;
41
- /* Colours e.g. --color-primary: …; */
70
+
71
+ /* The same colours as text or icons, e.g. text-red-fg for an error message.
72
+ Light: the fill colour, or a darker amber for yellow (yellow text on
73
+ white fails contrast). Dark: lighter shades that pass 4.5:1. */
74
+ --color-primary-fg: light-dark(var(--color-kblue), oklch(82.8% 0.111 230.318)); /* dark: sky-300 */
75
+ --color-green-fg: light-dark(var(--color-green), oklch(79.2% 0.209 151.711)); /* dark: green-400 */
76
+ --color-red-fg: light-dark(var(--color-red), oklch(70.4% 0.191 22.216)); /* dark: red-400 */
77
+ --color-blue-fg: light-dark(var(--color-blue), oklch(80.9% 0.105 251.813)); /* dark: blue-300 */
78
+ --color-yellow-fg: light-dark(oklch(55.4% 0.135 66.442), var(--color-yellow)); /* light: yellow-700 */
79
+
80
+ /*
81
+ * States: one look for hover, press and selection everywhere.
82
+ * - hover / pressed / selected: see-through tints for things with no fill
83
+ * of their own (ghost buttons, menu items, table rows, sidebar items).
84
+ * - surface-hover / surface-pressed: solid, for things filled with surface
85
+ * (basic buttons, the buttons inside fields), so they lighten in dark
86
+ * mode rather than darken.
87
+ * Coloured fills (primary, danger) darken instead: brightness-90 / 80.
88
+ * Disabled is opacity-40. Focus is a 2px outline-focus ring, keyboard only.
89
+ */
90
+ --color-hover: color-mix(in oklab, var(--color-ink) 5%, transparent);
91
+ --color-pressed: color-mix(in oklab, var(--color-ink) 10%, transparent);
92
+ --color-selected: var(--color-pressed);
93
+ --color-surface-hover: color-mix(in oklab, var(--color-surface) 95%, var(--color-ink));
94
+ --color-surface-pressed: color-mix(in oklab, var(--color-surface) 90%, var(--color-ink));
42
95
 
43
96
  /* Radius e.g. --radius-control: …; */
44
97
 
@@ -99,3 +152,39 @@
99
152
  80% { rotate: 4deg; }
100
153
  }
101
154
  }
155
+
156
+ /*
157
+ * Dark mode
158
+ * ---------
159
+ * Opt-in per app, on the <html> element (or any element, for one section):
160
+ *
161
+ * data-theme="light" always light (also the default with no attribute)
162
+ * data-theme="dark" always dark
163
+ * data-theme="system" follows the device setting
164
+ *
165
+ * color-scheme drives every light-dark() colour above, and also the browser's
166
+ * own parts: scrollbars, date pickers, autofill.
167
+ */
168
+ :root,
169
+ [data-theme="light"] {
170
+ color-scheme: light;
171
+ }
172
+ [data-theme="dark"] {
173
+ color-scheme: dark;
174
+ }
175
+ [data-theme="system"] {
176
+ color-scheme: light dark;
177
+ }
178
+
179
+ /* Tailwind's dark: variant follows the same switch, for the rare case a
180
+ colour token can't express (e.g. Tooltip). */
181
+ @custom-variant dark {
182
+ &:where([data-theme="dark"], [data-theme="dark"] *) {
183
+ @slot;
184
+ }
185
+ @media (prefers-color-scheme: dark) {
186
+ &:where([data-theme="system"], [data-theme="system"] *) {
187
+ @slot;
188
+ }
189
+ }
190
+ }