@htmlbricks/hb-sidebar-desktop 0.71.24 → 0.71.26

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/manifest.json CHANGED
@@ -7,6 +7,19 @@
7
7
  "Events": {
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
+ "languageChange": {
11
+ "additionalProperties": false,
12
+ "description": "Host updates `i18nlang` on `hb-layout` (or equivalent) and reloads copy.",
13
+ "properties": {
14
+ "code": {
15
+ "type": "string"
16
+ }
17
+ },
18
+ "required": [
19
+ "code"
20
+ ],
21
+ "type": "object"
22
+ },
10
23
  "pageChange": {
11
24
  "additionalProperties": false,
12
25
  "properties": {
@@ -35,7 +48,8 @@
35
48
  },
36
49
  "required": [
37
50
  "pageChange",
38
- "themeChange"
51
+ "themeChange",
52
+ "languageChange"
39
53
  ],
40
54
  "type": "object"
41
55
  },
@@ -125,6 +139,34 @@
125
139
  },
126
140
  "type": "array"
127
141
  },
142
+ "i18nlang": {
143
+ "description": "BCP-47 / app language code; should match one of `i18nlanguages[].code` when set.",
144
+ "type": [
145
+ "string",
146
+ "null"
147
+ ]
148
+ },
149
+ "i18nlanguages": {
150
+ "anyOf": [
151
+ {
152
+ "items": {
153
+ "$ref": "#/definitions/I18nLanguageOption"
154
+ },
155
+ "type": "array"
156
+ },
157
+ {
158
+ "type": "string"
159
+ },
160
+ {
161
+ "type": "null"
162
+ },
163
+ {
164
+ "const": "",
165
+ "type": "string"
166
+ }
167
+ ],
168
+ "description": "Available UI languages (JSON string or array)."
169
+ },
128
170
  "id": {
129
171
  "type": "string"
130
172
  },
@@ -170,6 +212,23 @@
170
212
  },
171
213
  "type": "object"
172
214
  },
215
+ "I18nLanguageOption": {
216
+ "additionalProperties": false,
217
+ "description": "Entry for the sidebar language menu (from `hb-layout` → layouts → sidebar).",
218
+ "properties": {
219
+ "code": {
220
+ "type": "string"
221
+ },
222
+ "label": {
223
+ "type": "string"
224
+ }
225
+ },
226
+ "required": [
227
+ "code",
228
+ "label"
229
+ ],
230
+ "type": "object"
231
+ },
173
232
  "INavLink": {
174
233
  "additionalProperties": false,
175
234
  "properties": {
@@ -233,7 +292,7 @@
233
292
  }
234
293
  }
235
294
  },
236
- "description": "Fixed-width desktop sidebar: optional company logo and title, header/footer slots, Bulma theme switch (light / dark / system), and a nav list built from hb-sidenav-link entries with optional JSON groups (Bulma layout, menu labels, light background). Parses navlinks and groups from strings; emits pageChange when a link selects a page and themeChange when the user picks a theme (host applies document hooks such as data-theme on html/body).",
295
+ "description": "Fixed-width desktop sidebar: optional company logo and title, header/footer slots, optional language menu (i18nlanguages + i18nlang) beside the Bulma theme switch (light / dark / system), and a nav list built from hb-sidenav-link entries with optional JSON groups (Bulma layout, menu labels, light background). Parses navlinks and groups from strings; emits pageChange when a link selects a page, themeChange when the user picks a theme (host applies document hooks such as data-theme on html/body), and languageChange { code } when a language is chosen (host updates i18nlang on hb-layout or equivalent).",
237
296
  "storybookArgs": {
238
297
  "companylogouri": {
239
298
  "control": {
@@ -283,6 +342,19 @@
283
342
  "themeChange": {
284
343
  "action": "themeChangeEvent"
285
344
  },
345
+ "languageChange": {
346
+ "action": "languageChangeEvent"
347
+ },
348
+ "i18nlang": {
349
+ "control": {
350
+ "type": "text"
351
+ }
352
+ },
353
+ "i18nlanguages": {
354
+ "control": {
355
+ "type": "text"
356
+ }
357
+ },
286
358
  "navpage": {
287
359
  "control": {
288
360
  "type": "text"
@@ -680,9 +752,59 @@
680
752
  "navpage": "settings",
681
753
  "enablefooter": "yes"
682
754
  }
755
+ },
756
+ {
757
+ "name": "sidebarWithLanguages",
758
+ "description": "Language dropdown (from i18nlanguages) next to the theme switch; emits languageChange with { code }. Host should set i18nlang when a language is picked.",
759
+ "data": {
760
+ "navlinks": [
761
+ {
762
+ "label": "Home",
763
+ "key": "home",
764
+ "icon": "house-door"
765
+ },
766
+ {
767
+ "label": "Dashboard",
768
+ "key": "dashboard",
769
+ "icon": "speedometer"
770
+ },
771
+ {
772
+ "label": "Settings",
773
+ "key": "settings",
774
+ "icon": "gear"
775
+ },
776
+ {
777
+ "label": "Users",
778
+ "key": "users",
779
+ "icon": "people-fill"
780
+ },
781
+ {
782
+ "label": "Stats",
783
+ "key": "stats",
784
+ "icon": "graph-up"
785
+ }
786
+ ],
787
+ "navpage": "home",
788
+ "enablethemeswitch": "yes",
789
+ "i18nlang": "it",
790
+ "i18nlanguages": [
791
+ {
792
+ "code": "it",
793
+ "label": "Italiano"
794
+ },
795
+ {
796
+ "code": "en",
797
+ "label": "English"
798
+ },
799
+ {
800
+ "code": "de",
801
+ "label": "Deutsch"
802
+ }
803
+ ]
804
+ }
683
805
  }
684
806
  ],
685
- "iifeIntegrity": "sha384-wBLuiZuNMVVfCs4Nl3ia+01WI27TTH1hRju0R/3Q6CUuxJqv7XkXglApISSuYwvJ",
807
+ "iifeIntegrity": "sha384-3aEATj4LxlQ9ld2QfW78fppO018ZTJ2dkha224Ovq7+l1VldaabbuMlx8kficMUL",
686
808
  "dependencies": [
687
809
  {
688
810
  "name": "hb-sidenav-link",
@@ -708,5 +830,5 @@
708
830
  "size": {},
709
831
  "iifePath": "main.iife.js",
710
832
  "repoName": "@htmlbricks/hb-sidebar-desktop",
711
- "version": "0.71.24"
833
+ "version": "0.71.26"
712
834
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-sidebar-desktop",
3
- "version": "0.71.24",
3
+ "version": "0.71.26",
4
4
  "contributors": [],
5
- "description": "Fixed-width desktop sidebar: optional company logo and title, header/footer slots, Bulma theme switch (light / dark / system), and a nav list built from hb-sidenav-link entries with optional JSON groups (Bulma layout, menu labels, light background). Parses navlinks and groups from strings; emits pageChange when a link selects a page and themeChange when the user picks a theme (host applies document hooks such as data-theme on html/body).",
5
+ "description": "Fixed-width desktop sidebar: optional company logo and title, header/footer slots, optional language menu (i18nlanguages + i18nlang) beside the Bulma theme switch (light / dark / system), and a nav list built from hb-sidenav-link entries with optional JSON groups (Bulma layout, menu labels, light background). Parses navlinks and groups from strings; emits pageChange when a link selects a page, themeChange when the user picks a theme (host applies document hooks such as data-theme on html/body), and languageChange { code } when a language is chosen (host updates i18nlang on hb-layout or equivalent).",
6
6
  "licenses": [
7
7
  {
8
8
  "type": "Apache-2.0",
@@ -74,6 +74,34 @@
74
74
  },
75
75
  "type": "array"
76
76
  },
77
+ "i18nlang": {
78
+ "description": "BCP-47 / app language code; should match one of `i18nlanguages[].code` when set.",
79
+ "type": [
80
+ "string",
81
+ "null"
82
+ ]
83
+ },
84
+ "i18nlanguages": {
85
+ "anyOf": [
86
+ {
87
+ "items": {
88
+ "$ref": "#/definitions/I18nLanguageOption"
89
+ },
90
+ "type": "array"
91
+ },
92
+ {
93
+ "type": "string"
94
+ },
95
+ {
96
+ "type": "null"
97
+ },
98
+ {
99
+ "const": "",
100
+ "type": "string"
101
+ }
102
+ ],
103
+ "description": "Available UI languages (JSON string or array)."
104
+ },
77
105
  "id": {
78
106
  "type": "string"
79
107
  },
@@ -119,6 +147,23 @@
119
147
  },
120
148
  "type": "object"
121
149
  },
150
+ "I18nLanguageOption": {
151
+ "additionalProperties": false,
152
+ "description": "Entry for the sidebar language menu (from `hb-layout` → layouts → sidebar).",
153
+ "properties": {
154
+ "code": {
155
+ "type": "string"
156
+ },
157
+ "label": {
158
+ "type": "string"
159
+ }
160
+ },
161
+ "required": [
162
+ "code",
163
+ "label"
164
+ ],
165
+ "type": "object"
166
+ },
122
167
  "INavLink": {
123
168
  "additionalProperties": false,
124
169
  "properties": {
@@ -2,6 +2,9 @@ import type { INavLink } from "../../sidenav-link/types/webcomponent.type";
2
2
 
3
3
  export type ThemePreference = "light" | "dark" | "auto";
4
4
 
5
+ /** Entry for the sidebar language menu (from `hb-layout` → layouts → sidebar). */
6
+ export type I18nLanguageOption = { code: string; label: string };
7
+
5
8
  export type Component = {
6
9
  id?: string;
7
10
  style?: string;
@@ -15,6 +18,10 @@ export type Component = {
15
18
  enablethemeswitch?: "yes" | "no" | null | "" | undefined;
16
19
  /** Optional controlled value from the host (e.g. after persisting `themeChange`). */
17
20
  themepreference?: ThemePreference | null | "" | undefined;
21
+ /** BCP-47 / app language code; should match one of `i18nlanguages[].code` when set. */
22
+ i18nlang?: string | null | "" | undefined;
23
+ /** Available UI languages (JSON string or array). */
24
+ i18nlanguages?: I18nLanguageOption[] | string | null | "" | undefined;
18
25
  cookielawallowdecline?: "yes" | "no" | null | "" | undefined;
19
26
  cookielawlanguage?: string;
20
27
  cookielawuri4more?: string;
@@ -25,4 +32,6 @@ export type Events = {
25
32
  pageChange: { page: string };
26
33
  /** Host applies Bulma/document hooks (`data-theme` / `theme-*` on `html`/`body`) or ignores. */
27
34
  themeChange: { mode: ThemePreference };
35
+ /** Host updates `i18nlang` on `hb-layout` (or equivalent) and reloads copy. */
36
+ languageChange: { code: string };
28
37
  };
@@ -5,6 +5,19 @@
5
5
  "Events": {
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
+ "languageChange": {
9
+ "additionalProperties": false,
10
+ "description": "Host updates `i18nlang` on `hb-layout` (or equivalent) and reloads copy.",
11
+ "properties": {
12
+ "code": {
13
+ "type": "string"
14
+ }
15
+ },
16
+ "required": [
17
+ "code"
18
+ ],
19
+ "type": "object"
20
+ },
8
21
  "pageChange": {
9
22
  "additionalProperties": false,
10
23
  "properties": {
@@ -33,7 +46,8 @@
33
46
  },
34
47
  "required": [
35
48
  "pageChange",
36
- "themeChange"
49
+ "themeChange",
50
+ "languageChange"
37
51
  ],
38
52
  "type": "object"
39
53
  },