@ssa-ui-kit/core 3.24.0 → 3.25.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.
@@ -43,3 +43,18 @@ export declare function darkenColor(color: string, amount?: number): string;
43
43
  * Defaults to `rgba(255, 255, 255, 1)` (white).
44
44
  */
45
45
  export declare function getContrastColor(bgColor: string, darkText?: string, lightText?: string): string;
46
+ /**
47
+ * Returns whichever of `darkText` / `lightText` has the higher WCAG contrast
48
+ * ratio against `bgColor`.
49
+ *
50
+ * Unlike {@link getContrastColor}, which uses a fixed luminance threshold
51
+ * tuned for pure black, this measures both candidates — so mid-tone
52
+ * backgrounds such as the theme `blue` get white text, matching the design.
53
+ *
54
+ * Falls back to `darkText` when any of the colors cannot be parsed.
55
+ *
56
+ * @param bgColor - The background color to contrast against.
57
+ * @param darkText - Candidate for light backgrounds. Defaults to `greyDarker`.
58
+ * @param lightText - Candidate for dark backgrounds. Defaults to white.
59
+ */
60
+ export declare const getReadableColor: (bgColor: string, darkText?: string, lightText?: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssa-ui-kit/core",
3
- "version": "3.24.0",
3
+ "version": "3.25.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -40,8 +40,8 @@
40
40
  "luxon": "3.5.0",
41
41
  "plotly.js": "3.0.0",
42
42
  "react-plotly.js": "2.6.0",
43
- "@ssa-ui-kit/hooks": "^3.24.0",
44
- "@ssa-ui-kit/utils": "^3.24.0"
43
+ "@ssa-ui-kit/hooks": "^3.25.0",
44
+ "@ssa-ui-kit/utils": "^3.25.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@emotion/css": "11.13.5",