@htmlbricks/hb-sidebar-desktop 0.71.23 → 0.71.25

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
  },
@@ -94,27 +108,17 @@
94
108
  ]
95
109
  },
96
110
  "enablethemeswitch": {
97
- "anyOf": [
98
- {
99
- "type": "boolean"
100
- },
101
- {
102
- "const": "yes",
103
- "type": "string"
104
- },
105
- {
106
- "const": "no",
107
- "type": "string"
108
- },
109
- {
110
- "type": "null"
111
- },
112
- {
113
- "const": "",
114
- "type": "string"
115
- }
111
+ "description": "When false or `\"no\"`, the theme control is hidden.",
112
+ "enum": [
113
+ "yes",
114
+ "no",
115
+ null,
116
+ ""
116
117
  ],
117
- "description": "When false or `\"no\"`, the theme control is hidden."
118
+ "type": [
119
+ "string",
120
+ "null"
121
+ ]
118
122
  },
119
123
  "groups": {
120
124
  "items": {
@@ -135,6 +139,34 @@
135
139
  },
136
140
  "type": "array"
137
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
+ },
138
170
  "id": {
139
171
  "type": "string"
140
172
  },
@@ -180,6 +212,23 @@
180
212
  },
181
213
  "type": "object"
182
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
+ },
183
232
  "INavLink": {
184
233
  "additionalProperties": false,
185
234
  "properties": {
@@ -243,7 +292,7 @@
243
292
  }
244
293
  }
245
294
  },
246
- "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).",
247
296
  "storybookArgs": {
248
297
  "companylogouri": {
249
298
  "control": {
@@ -293,6 +342,19 @@
293
342
  "themeChange": {
294
343
  "action": "themeChangeEvent"
295
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
+ },
296
358
  "navpage": {
297
359
  "control": {
298
360
  "type": "text"
@@ -690,9 +752,59 @@
690
752
  "navpage": "settings",
691
753
  "enablefooter": "yes"
692
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
+ }
693
805
  }
694
806
  ],
695
- "iifeIntegrity": "sha384-uuMXNfc046XIxVABTnSNzm+plwjHRBRdDqjL5dnc8AKgKfDoD4HbifbIuAvS5jgn",
807
+ "iifeIntegrity": "sha384-FPsxGs/sBQ22Baj6RhluJ0O4KRW8TRaX6QVsImpcgioytyC0m/yhNj6OQQNqourj",
696
808
  "dependencies": [
697
809
  {
698
810
  "name": "hb-sidenav-link",
@@ -718,5 +830,5 @@
718
830
  "size": {},
719
831
  "iifePath": "main.iife.js",
720
832
  "repoName": "@htmlbricks/hb-sidebar-desktop",
721
- "version": "0.71.23"
833
+ "version": "0.71.25"
722
834
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-sidebar-desktop",
3
- "version": "0.71.23",
3
+ "version": "0.71.25",
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",
@@ -43,27 +43,17 @@
43
43
  ]
44
44
  },
45
45
  "enablethemeswitch": {
46
- "anyOf": [
47
- {
48
- "type": "boolean"
49
- },
50
- {
51
- "const": "yes",
52
- "type": "string"
53
- },
54
- {
55
- "const": "no",
56
- "type": "string"
57
- },
58
- {
59
- "type": "null"
60
- },
61
- {
62
- "const": "",
63
- "type": "string"
64
- }
46
+ "description": "When false or `\"no\"`, the theme control is hidden.",
47
+ "enum": [
48
+ "yes",
49
+ "no",
50
+ null,
51
+ ""
65
52
  ],
66
- "description": "When false or `\"no\"`, the theme control is hidden."
53
+ "type": [
54
+ "string",
55
+ "null"
56
+ ]
67
57
  },
68
58
  "groups": {
69
59
  "items": {
@@ -84,6 +74,34 @@
84
74
  },
85
75
  "type": "array"
86
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
+ },
87
105
  "id": {
88
106
  "type": "string"
89
107
  },
@@ -129,6 +147,23 @@
129
147
  },
130
148
  "type": "object"
131
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
+ },
132
167
  "INavLink": {
133
168
  "additionalProperties": false,
134
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;
@@ -12,9 +15,13 @@ export type Component = {
12
15
  companytitle?: string;
13
16
  enablefooter?: "yes" | "no" | "false" | null | "" | undefined;
14
17
  /** When false or `"no"`, the theme control is hidden. */
15
- enablethemeswitch?: boolean | "yes" | "no" | null | "" | undefined;
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
  },