@naturalcycles/internal-web-lib 1.5.0 → 1.6.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,4 +1,4 @@
1
- import _palette_default from "../../node_modules/.pnpm/@naturalcycles_ncuikit@1.15.0_react@19.3.0_undici@8.11.2/node_modules/@naturalcycles/ncuikit/dist/styles/_palette.js";
1
+ import _palette_default from "../../node_modules/.pnpm/@naturalcycles_ncuikit@1.17.0_react@19.3.1_undici@8.12.1/node_modules/@naturalcycles/ncuikit/dist/styles/_palette.js";
2
2
  import fonts_default from "./fonts.js";
3
3
  import general_default from "./general.js";
4
4
  //#region src/cookie-monster/css/shared-sheets.ts
@@ -2,6 +2,6 @@ import type { StringMap } from '@naturalcycles/js-lib/types';
2
2
  import { LANG } from '@naturalcycles/shared';
3
3
  export interface Translations extends StringMap {
4
4
  }
5
- export declare const SUPPORTED_LANGUAGES: LANG[];
6
- export declare function setLanguage(rawLang?: LANG): void;
5
+ export declare const SUPPORTED_LANGUAGES: (LANG.en_US | LANG.en_GB | LANG.es_US | LANG.pt_BR | LANG.sv_SE | LANG.de_DE | LANG.fr_FR | LANG.it_IT | LANG.da_DK | LANG.no_NO | LANG.fi_FI)[];
6
+ export declare function setLanguage(rawLang?: string): void;
7
7
  export declare function tr(key: string, params?: Record<string, string>): string;
@@ -26,16 +26,16 @@ var translationsByLang = {
26
26
  [LANG.no_NO]: no_NO_default
27
27
  };
28
28
  _objectKeys(translationsByLang);
29
- var EN_US_FALLBACK_LANGS = /* @__PURE__ */ new Set([LANG.en_GB, LANG.en_CA]);
30
29
  var TranslationsService = class {
31
30
  copy = translationsByLang[langService.LANG_DEFAULT];
32
31
  setLanguage(rawLang) {
33
- const lang = langService.toWebsignupLang(rawLang);
34
- const translations = translationsByLang[lang] || translationsByLang[langService.LANG_DEFAULT];
35
- this.copy = EN_US_FALLBACK_LANGS.has(lang) ? {
32
+ const lang = langService.toCookieMonsterLangOrUndefined(rawLang) ?? langService.LANG_DEFAULT;
33
+ const translations = translationsByLang[lang];
34
+ if (lang !== langService.LANG_DEFAULT && langService.isEnglish(lang)) this.copy = {
36
35
  ...translationsByLang[langService.LANG_DEFAULT],
37
36
  ...translations
38
- } : translations;
37
+ };
38
+ else this.copy = translations;
39
39
  }
40
40
  tr(key, params) {
41
41
  const translation = this.copy[key];
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@naturalcycles+ncuikit@1.15.0_react@19.3.0_undici@8.11.2/node_modules/@naturalcycles/ncuikit/dist/styles/_palette.css?inline
1
+ //#region ../../node_modules/.pnpm/@naturalcycles+ncuikit@1.17.0_react@19.3.1_undici@8.12.1/node_modules/@naturalcycles/ncuikit/dist/styles/_palette.css?inline
2
2
  var _palette_default = "/**\n * Do not edit directly, this file was auto-generated.\n */\n\n:root {\n --color-purple-200: #f8f2f7;\n --color-purple-300: #edc4e6;\n --color-purple-400: #c377b4;\n --color-purple-500: #72035d;\n --color-purple-600: #560246;\n --color-purple-700: #3c0231;\n --color-purple-1000: #310629;\n --color-lavender-300: #ffcbff;\n --color-lavender-400: #fdabf5;\n --color-lavender-500: #f796ee;\n --color-lavender-600: #f471e8;\n --color-neue-blue-200: #e9f3ff;\n --color-neue-blue-250: #c9e0fd;\n --color-neue-blue-300: #9cbbff;\n --color-neue-blue-400: #709dff;\n --color-neue-blue-500: #3c6df0;\n --color-neue-blue-600: #204cc5;\n --color-neue-blue-700: #2547a7;\n --color-raspberry-300: #febfcf;\n --color-raspberry-400: #ed7f9d;\n --color-raspberry-500: #d71c5a;\n --color-raspberry-600: #c90d4b;\n --color-ink-100: rgba(26, 26, 26, 0.050980392156862744);\n --color-ink-200: rgba(26, 26, 26, 0.10196078431372549);\n --color-ink-300: #dedede;\n --color-ink-400: #a3a3a3;\n --color-ink-500: #757575;\n --color-ink-600: #5f5f5f;\n --color-ink-1000: #1a1a1a;\n --color-sand-50: rgba(252, 248, 248, 0.1607843137254902);\n --color-sand-100: #fcf8f8;\n --color-sand-300: #f8f2f2;\n --color-sand-500: #f3eeee;\n --color-sand-600: #e2d4d4;\n --color-sand-700: #d1c0c0;\n --color-white-100: rgba(255, 255, 255, 0.0784313725490196);\n --color-white-200: rgba(255, 255, 255, 0.1607843137254902);\n --color-white-1000: #ffffff;\n --color-green-50: rgba(243, 248, 236, 0.10196078431372549);\n --color-green-100: #f3f8ec;\n --color-green-300: #a0c95e;\n --color-green-500: #87b738;\n --color-green-600: #658d25;\n --color-red-50: rgba(252, 235, 235, 0.10196078431372549);\n --color-red-100: #fcebeb;\n --color-red-500: #ff7c7c;\n --color-red-600: #d83030;\n --color-orange-50: rgba(255, 244, 230, 0.10196078431372549);\n --color-orange-100: #f6d7b2;\n --color-orange-300: #ffa64d;\n --color-orange-500: #ff9000;\n --color-orange-700: #d16900;\n --color-orange-900: #65291f;\n --color-trackers-mood-100: rgba(255, 223, 92, 0.4);\n --color-trackers-mood-300: #fee996;\n --color-trackers-mood-500: #ffdf5c;\n --color-trackers-mood-600: #e0cb79;\n --color-trackers-pain-100: rgba(255, 154, 117, 0.4);\n --color-trackers-pain-300: #f39ab5;\n --color-trackers-pain-500: #ff9a75;\n --color-trackers-pain-600: #d57e98;\n --color-trackers-pain-700: #ac2e00;\n --color-trackers-lifestyle-100: rgba(166, 209, 166, 0.4);\n --color-trackers-lifestyle-300: #afd6af;\n --color-trackers-lifestyle-500: #a6d1a6;\n --color-trackers-lifestyle-600: #92b892;\n --color-trackers-lifestyle-700: #1a5c41;\n --color-trackers-external-factor-100: rgba(255, 184, 0, 0.4);\n --color-trackers-external-factor-300: #ffbf1a;\n --color-trackers-external-factor-500: #ffb800;\n --color-trackers-external-factor-600: #e0a200;\n --color-trackers-external-factor-700: #915f04;\n --color-trackers-skin-100: rgba(255, 146, 142, 0.4);\n --color-trackers-skin-300: #ff9d99;\n --color-trackers-skin-500: #ff928e;\n --color-trackers-skin-600: #e0807d;\n --color-trackers-skin-700: #b12a25;\n --color-trackers-sex-100: rgba(253, 144, 180, 0.4);\n --color-trackers-sex-300: #fd9bbc;\n --color-trackers-sex-500: #fd90b4;\n --color-trackers-sex-600: #df7f9e;\n --color-trackers-sex-700: #a93059;\n --color-trackers-tracker-500: #620d4e;\n --color-trackers-cervical-mucus-100: rgba(241, 150, 231, 0.4);\n --color-trackers-cervical-mucus-300: #dcb2ea;\n --color-trackers-cervical-mucus-500: #f196e7;\n --color-trackers-cervical-mucus-600: #be95cc;\n --color-trackers-cervical-mucus-700: #8f1f83;\n --color-trackers-bleeding-100: rgba(210, 148, 239, 0.4);\n --color-trackers-bleeding-300: #c48fd8;\n --color-trackers-bleeding-500: #d294ef;\n --color-trackers-bleeding-600: #a673bb;\n --color-trackers-excluded-500: #ff736f;\n --color-trackers-lh-test-100: rgba(141, 190, 255, 0.4);\n --color-trackers-lh-test-300: #98c5ff;\n --color-trackers-lh-test-500: #8dbeff;\n --color-trackers-lh-test-600: #7ca7e0;\n --color-trackers-lh-test-700: #16427b;\n --color-trackers-pregnancy-test-100: rgba(99, 164, 248, 0.4);\n --color-trackers-pregnancy-test-300: #73adf9;\n --color-trackers-pregnancy-test-500: #63a4f8;\n --color-trackers-pregnancy-test-600: #5790da;\n --color-trackers-pregnancy-test-700: #16427b;\n --color-trackers-sensitive-500: #e2d4d4;\n --color-trackers-sleep-100: rgba(171, 177, 210, 0.4);\n --color-trackers-sleep-300: #d1d5e6;\n --color-trackers-sleep-500: #abb1d2;\n --color-trackers-sleep-600: #8c91ad;\n --color-trackers-sleep-700: #4d5478;\n --color-trackers-breastfeeding-100: rgba(255, 205, 211, 0.4);\n --color-trackers-breastfeeding-300: #ffd2d7;\n --color-trackers-breastfeeding-500: #ffcdd3;\n --color-trackers-breastfeeding-600: #e0b4ba;\n --color-trackers-breastfeeding-700: #8f343f;\n --color-trackers-bottle-feeding-100: rgba(114, 214, 196, 0.4);\n --color-trackers-bottle-feeding-300: #80daca;\n --color-trackers-bottle-feeding-500: #72d6c4;\n --color-trackers-bottle-feeding-600: #64bcac;\n --color-trackers-bottle-feeding-700: #005a46;\n --color-trackers-pumping-100: rgba(255, 184, 0, 0.4);\n --color-trackers-pumping-300: #ffbf1a;\n --color-trackers-pumping-500: #ffb800;\n --color-trackers-pumping-600: #e0a200;\n --color-trackers-pumping-700: #915f04;\n --color-pale-purple-300: #512d4a;\n --color-pale-purple-500: #4a2d47;\n --color-pale-purple-700: #411a3a;\n --color-fertility-red-50: rgba(243, 59, 110, 0.5019607843137255); /** Peak Fertility */\n --color-fertility-red-100: #f3b6c7; /** Fertility unlikely */\n --color-fertility-red-200: #f590ad; /** Low Fertility */\n --color-fertility-red-500: #fb7598; /** Use Protection and Medium fertility */\n --color-fertility-red-800: #f15880; /** High Fertility */\n --color-fertility-red-900: #f74577; /** Very High Fertility */\n --color-fertility-red-1000: #f33b6e; /** Peak Fertility */\n --color-fertility-grey-500: #e8d2c6;\n --color-fertility-lavender-100: #f3e6f9;\n --color-fertility-lavender-500: #d294ef;\n --color-fertility-blue-500: #63a4f8;\n --color-fertility-green-600: #3ed08e;\n}\n";
3
3
  //#endregion
4
4
  export { _palette_default as default };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "@naturalcycles/ncuikit": "^1",
12
12
  "@playwright/test": "^1",
13
13
  "@types/node": "^26",
14
- "happy-dom": "^20",
14
+ "happy-dom": "^21",
15
15
  "typescript": "^7",
16
16
  "vite": "^8",
17
17
  "vitest": "^5"
@@ -42,7 +42,7 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "version": "1.5.0",
45
+ "version": "1.6.0",
46
46
  "description": "Internal web libraries for Natural Cycles, served via CDN and published from the NCBackend3 monorepo",
47
47
  "author": "Natural Cycles Team",
48
48
  "license": "UNLICENSED",