@heyramzi/ui 2.6.0 → 2.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyramzi/ui",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Svelte 5 UI for apps: primitives, effects and animations, plus tasks, charts, slides, an editor, onboarding and a canvas as subpaths.",
5
5
  "homepage": "https://ui.heyramzi.com",
6
6
  "license": "MIT",
@@ -29,6 +29,14 @@ export type BrandColors = {
29
29
  surfaceLight?: CssColor;
30
30
  /** Borders on a light page. */
31
31
  lineLight?: CssColor;
32
+ /** The key button on a light page. Falls back to the near-black neutral. */
33
+ primary?: CssColor;
34
+ /** Text on the key button on a light page. */
35
+ primaryForeground?: CssColor;
36
+ /** The key button on a dark page. Falls back to paper. */
37
+ primaryOnDark?: CssColor;
38
+ /** Text on the key button on a dark page. */
39
+ primaryForegroundOnDark?: CssColor;
32
40
  };
33
41
 
34
42
  export type BrandFonts = {
@@ -61,6 +69,10 @@ const COLOR_VARS = {
61
69
  paper: "--brand-paper",
62
70
  surfaceLight: "--brand-surface-light",
63
71
  lineLight: "--brand-line-light",
72
+ primary: "--brand-primary",
73
+ primaryForeground: "--brand-primary-foreground",
74
+ primaryOnDark: "--brand-primary-on-dark",
75
+ primaryForegroundOnDark: "--brand-primary-foreground-on-dark",
64
76
  } as const satisfies Record<keyof BrandColors, string>;
65
77
 
66
78
  const FONT_VARS = {
@@ -3,7 +3,7 @@ import { sortParentsFirst, stripCallbacks } from "./canvas-cleanup.js";
3
3
  import { makeNode } from "../test-utils.js";
4
4
  import type { CanvasNode } from "../types.js";
5
5
 
6
- /** Read serialized data as a loose record: these tests exercise old fields
6
+ /** Read serialized data as a loose record: these tests exercise legacy fields
7
7
  * that are no longer part of any per-type shape but must survive the denylist. */
8
8
  function loose(node: { data: unknown }): Record<string, unknown> {
9
9
  return node.data as Record<string, unknown>;
@@ -36,7 +36,7 @@ export const patchNodeOp = z.object({
36
36
  kind: z.literal("patchNode"),
37
37
  nodeId: z.string().min(1),
38
38
  data: z.record(z.string(), z.unknown()).optional(),
39
- // Merged into the node's style object. A CSS-string style from an old save is replaced
39
+ // Merged into the node's style object. A legacy CSS-string style is replaced
40
40
  // wholesale (there is nothing sane to merge into).
41
41
  style: z.record(z.string(), z.unknown()).optional(),
42
42
  width: z.number().optional(),
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  /*
18
- * car-garage, hammer / wave-saw-tool, helmet, trowel, grid-dots, leaf, car, crane. Svelte 5 port is ` @tabler/icons-svelte-runes` (runes, not the Svelte 4 ` @tabler/icons-svelte`).
18
+ * car-garage, hammer / wave-saw-tool, helmet, trowel, grid-dots, leaf, car, crane. Svelte 5 port is ` @tabler/icons-svelte-runes` (runes, not legacy ` @tabler/icons-svelte`).
19
19
  */
20
20
 
21
21
  import {
@@ -2,7 +2,11 @@
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
3
  import { cn, type WithElementRef } from "../../lib/utils.js";
4
4
 
5
- // WHY: card titles default to a div, so pass `as="h2"` on real section titles or a page of cards has no headings for screen readers (WCAG 2.4.6).
5
+ // WHY: card titles render as a div by default for backwards compatibility,
6
+
7
+ // but a page whose sections are all cards ends up with no headings below the h1, so screen readers cannot navigate it by heading (WCAG 2.4.6).
8
+
9
+ // Pass `as="h2"` on real section titles.
6
10
  let {
7
11
  ref = $bindable(null),
8
12
  class: className,
@@ -38,6 +38,12 @@
38
38
  --brand-surface-light: oklch(0.99 0 0); /* Cards on a light page */
39
39
  --brand-line-light: oklch(0.91 0 0); /* Borders on a light page */
40
40
 
41
+ /* The key button. Each theme has its own pair, since a hue lifted for dark needs dark text. */
42
+ --brand-primary: var(--gray-900);
43
+ --brand-primary-foreground: var(--gray-50);
44
+ --brand-primary-on-dark: var(--brand-paper);
45
+ --brand-primary-foreground-on-dark: var(--gray-900);
46
+
41
47
  /* === Tint scales ===
42
48
  Mixed from the three hues so `--brand` alone yields 100 to 800; 400 is the colour lifted
43
49
  for dark, 600 the colour itself. */
@@ -220,8 +226,8 @@
220
226
  --color-popover: var(--brand-surface-light);
221
227
  --color-popover-foreground: var(--gray-900);
222
228
 
223
- --color-primary: var(--gray-900);
224
- --color-primary-foreground: var(--gray-50);
229
+ --color-primary: var(--brand-primary);
230
+ --color-primary-foreground: var(--brand-primary-foreground);
225
231
 
226
232
  --color-secondary: var(--gray-100);
227
233
  --color-secondary-foreground: var(--gray-900);
@@ -320,8 +326,8 @@
320
326
  --color-popover: var(--brand-surface);
321
327
  --color-popover-foreground: var(--brand-paper);
322
328
 
323
- --color-primary: var(--brand-paper);
324
- --color-primary-foreground: var(--gray-900);
329
+ --color-primary: var(--brand-primary-on-dark);
330
+ --color-primary-foreground: var(--brand-primary-foreground-on-dark);
325
331
 
326
332
  --color-secondary: var(--brand-raised);
327
333
  --color-secondary-foreground: var(--brand-paper);