@synopackageland/ui 0.14.10 → 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.
@@ -1,17 +1,24 @@
1
1
  export interface AccentScale {
2
2
  /** Steps 1–12, opaque. */
3
3
  steps: string[];
4
- /** Steps 1–8 as the accent at a lower opacity, which read the same on white. */
4
+ /** Steps 1–8 as the accent at a lower opacity, which read the same on the scale's card. */
5
5
  alpha: string[];
6
6
  /** Text on a step 9 or 10 fill. */
7
7
  contrast: string;
8
8
  }
9
+ export interface AccentOptions {
10
+ /** Derive the steps for the dark theme (src/theme/dark.css): tints on its card, text lightened instead of darkened. */
11
+ dark?: boolean;
12
+ }
13
+ export declare const DARK_SURFACE = "#1b1f1c";
9
14
  /**
10
15
  * Twelve steps from one opaque colour: step 9 is the colour, darkened in its
11
16
  * own hue only as far as a white label needs to read on it; steps 1–8 tint it
12
- * at the opacities DSM tints its blue with; steps 10–12 add black for the
13
- * hovered fill and for text that reads on the tints.
17
+ * at the opacities DSM tints its blue with; step 10 adds black for the hovered
18
+ * fill and steps 11–12 are text that reads on the tints. On white the text
19
+ * steps add black; with `dark` the tints lie on the dark card and the text
20
+ * steps add white, so links and selected labels stay readable there.
14
21
  */
15
- export declare function accentScale(color: string): AccentScale;
22
+ export declare function accentScale(color: string, { dark }?: AccentOptions): AccentScale;
16
23
  /** The accent as the custom properties an app root sets (AppRoot `accent`). */
17
- export declare function accentStyle(color: string): Record<string, string>;
24
+ export declare function accentStyle(color: string, options?: AccentOptions): Record<string, string>;
@@ -7,6 +7,8 @@ export declare function formatColor([r, g, b, a]: Rgba): string;
7
7
  export declare function over(top: Rgba, under: Rgba): Rgba;
8
8
  /** `color` with `amount` (0–1) of black mixed in, as DSM darkens a hovered or pressed fill. */
9
9
  export declare function mixBlack([r, g, b, a]: Rgba, amount: number): Rgba;
10
+ /** `color` with `amount` (0–1) of white mixed in, as a dark theme lifts a colour off its page. */
11
+ export declare function mixWhite([r, g, b, a]: Rgba, amount: number): Rgba;
10
12
  /** WCAG 2 relative luminance of an opaque colour. */
11
13
  export declare function relativeLuminance([r, g, b]: Rgba): number;
12
14
  /**
@@ -3,7 +3,7 @@
3
3
  "version": "2.10.5",
4
4
  "delivery": "bundled-patched-esm",
5
5
  "patchManifestSha256": "14f10159b60d48ac7a0686f58faf7a30e99898dc267b3c032cf2bdd6052dc52b",
6
- "bundleSha256": "1bcaf322c85f4ae9454740d0d88b123b81366d65e75505432a630c641117cf5e",
6
+ "bundleSha256": "6bb6164f936a111eff6392231f3aa1eae75ecadf714f65b968d23f74313b6ef6",
7
7
  "sourceHashes": {
8
8
  "shared/useBodyScrollLock.js": "657592f283cb6fd25454abd284a0024af21936cb56e05b762ff0d22b6a979d32",
9
9
  "DismissableLayer/DismissableLayer.js": "da05ca544d9822a8e2b71057e78c0e1ef59423aa3893534338fb58e1ecbd1a8d",