@redacto.io/consent-sdk-react 10.3.0 → 10.3.1

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.
@@ -11,11 +11,16 @@ import {
11
11
  USER_SERVICE_PATH,
12
12
  getAppearanceLayout,
13
13
  glassPalette,
14
+ loadNoticeWebfont,
14
15
  resolveAppearance,
15
16
  useIsomorphicLayoutEffect,
16
17
  useMediaQuery,
17
18
  withIdempotencyKey
18
- } from "./chunk-SZWLAJB7.mjs";
19
+ } from "./chunk-RG4PVVKF.mjs";
20
+ import {
21
+ INHERIT_FONT_FAMILY,
22
+ resolveNoticeFontFamily
23
+ } from "./chunk-4SCWX74J.mjs";
19
24
 
20
25
  // src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx
21
26
  import { I18nextProvider } from "react-i18next";
@@ -13794,7 +13799,8 @@ var OVERRIDDEN_VARS = [
13794
13799
  "--pc-border-color",
13795
13800
  "--pc-success",
13796
13801
  "--pc-warning",
13797
- "--pc-error"
13802
+ "--pc-error",
13803
+ "--pc-font-family"
13798
13804
  ];
13799
13805
  function darken(hex, amount) {
13800
13806
  const h = hex.replace("#", "").trim();
@@ -13826,6 +13832,17 @@ function applyBrandingTheme(theme) {
13826
13832
  set("--pc-success", theme.success);
13827
13833
  set("--pc-warning", theme.warning);
13828
13834
  set("--pc-error", theme.danger);
13835
+ applyBrandingFont(theme.font_family);
13836
+ }
13837
+ function applyBrandingFont(fontFamily) {
13838
+ const root = document.documentElement;
13839
+ const stack = resolveNoticeFontFamily({ noticeFont: fontFamily });
13840
+ if (!(fontFamily == null ? void 0 : fontFamily.trim()) || stack === INHERIT_FONT_FAMILY) {
13841
+ root.style.removeProperty("--pc-font-family");
13842
+ return;
13843
+ }
13844
+ root.style.setProperty("--pc-font-family", stack);
13845
+ void loadNoticeWebfont(stack);
13829
13846
  }
13830
13847
  function clearBrandingTheme() {
13831
13848
  if (typeof document === "undefined") return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redacto.io/consent-sdk-react",
3
- "version": "10.3.0",
3
+ "version": "10.3.1",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",