@r2digisolutions/ui 0.6.0 → 0.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/README.md CHANGED
@@ -56,3 +56,13 @@ To publish your library to [npm](https://www.npmjs.com):
56
56
  ```bash
57
57
  npm publish
58
58
  ```
59
+
60
+ ## Publishing
61
+
62
+ Go into the `package.json` and give your package the desired name through the `"name"` option.
63
+
64
+ To publish your library to [npm](https://www.npmjs.com):
65
+
66
+ ```bash
67
+ npm publish
68
+ ```
@@ -1,5 +1,6 @@
1
1
  export class StoreI18n {
2
2
  #language = $state("en");
3
+ #defaultLanguage = "en";
3
4
  #translations = $state({});
4
5
  constructor(currentLanguage, translations = {}) {
5
6
  this.#language = currentLanguage;
@@ -9,7 +10,7 @@ export class StoreI18n {
9
10
  this.#language;
10
11
  this.#translations;
11
12
  return (key, params = {}) => {
12
- const translations = this.#translations[this.#language];
13
+ const translations = this.#translations?.[this.#language || this.#defaultLanguage];
13
14
  const translation = this.#getTranslationValue(translations, key);
14
15
  if (!translation || typeof translation !== "string") {
15
16
  return `--${key}--`;
@@ -25,7 +26,7 @@ export class StoreI18n {
25
26
  }
26
27
  #getTranslationValue(translations, key) {
27
28
  // Intentar primero como clave plana
28
- if (translations[key])
29
+ if (translations?.[key])
29
30
  return translations[key];
30
31
  // Si no existe como clave plana, intentar lookup recursivo
31
32
  return key.split('.').reduce((acc, part) => acc?.[part], translations);
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@r2digisolutions/ui",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "private": false,
5
- "packageManager": "bun@1.2.8",
5
+ "packageManager": "bun@1.2.18",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -47,42 +47,42 @@
47
47
  "svelte": "^5.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@changesets/cli": "^2.29.4",
51
- "@chromatic-com/storybook": "^3.2.6",
52
- "@eslint/compat": "^1.2.9",
53
- "@playwright/test": "^1.52.0",
50
+ "@changesets/cli": "^2.29.5",
51
+ "@chromatic-com/storybook": "^4.0.1",
52
+ "@eslint/compat": "^1.3.1",
53
+ "@playwright/test": "^1.54.1",
54
54
  "@storybook/addon-essentials": "^8.6.14",
55
55
  "@storybook/addon-interactions": "^8.6.14",
56
- "@storybook/addon-svelte-csf": "5.0.0",
56
+ "@storybook/addon-svelte-csf": "5.0.6",
57
57
  "@storybook/blocks": "^8.6.14",
58
- "@storybook/svelte": "^8.6.14",
59
- "@storybook/sveltekit": "^8.6.14",
58
+ "@storybook/svelte": "^9.0.16",
59
+ "@storybook/sveltekit": "^9.0.16",
60
60
  "@storybook/test": "^8.6.14",
61
61
  "@sveltejs/adapter-static": "^3.0.8",
62
- "@sveltejs/kit": "^2.21.0",
63
- "@sveltejs/package": "^2.3.11",
64
- "@sveltejs/vite-plugin-svelte": "^5.0.3",
65
- "@tailwindcss/postcss": "^4.1.7",
66
- "@vitest/browser": "^3.1.3",
62
+ "@sveltejs/kit": "^2.22.5",
63
+ "@sveltejs/package": "^2.3.12",
64
+ "@sveltejs/vite-plugin-svelte": "^6.0.0",
65
+ "@tailwindcss/postcss": "^4.1.11",
66
+ "@vitest/browser": "^3.2.4",
67
67
  "changeset": "^0.2.6",
68
- "eslint": "^9.27.0",
68
+ "eslint": "^9.31.0",
69
69
  "eslint-config-prettier": "^10.1.5",
70
- "eslint-plugin-svelte": "^3.8.0",
71
- "globals": "^16.1.0",
70
+ "eslint-plugin-svelte": "^3.10.1",
71
+ "globals": "^16.3.0",
72
72
  "jsdom": "^26.1.0",
73
- "lucide-svelte": "^0.511.0",
74
- "prettier": "^3.5.3",
73
+ "lucide-svelte": "^0.525.0",
74
+ "prettier": "^3.6.2",
75
75
  "prettier-plugin-svelte": "^3.4.0",
76
- "prettier-plugin-tailwindcss": "^0.6.11",
76
+ "prettier-plugin-tailwindcss": "^0.6.14",
77
77
  "publint": "^0.3.12",
78
- "storybook": "^8.6.14",
79
- "svelte": "^5.30.1",
80
- "svelte-check": "^4.2.1",
81
- "tailwindcss": "^4.1.7",
78
+ "storybook": "^9.0.16",
79
+ "svelte": "^5.35.6",
80
+ "svelte-check": "^4.2.2",
81
+ "tailwindcss": "^4.1.11",
82
82
  "typescript": "^5.8.3",
83
- "typescript-eslint": "^8.32.1",
84
- "vite": "^6.3.5",
85
- "vitest": "^3.1.3"
83
+ "typescript-eslint": "^8.36.0",
84
+ "vite": "^7.0.4",
85
+ "vitest": "^3.2.4"
86
86
  },
87
87
  "dependencies": {
88
88
  "@tailwindcss/container-queries": "^0.1.1",