@htmlbricks/hb-sidebar-desktop 0.71.22 → 0.71.23

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
@@ -18,12 +18,34 @@
18
18
  "page"
19
19
  ],
20
20
  "type": "object"
21
+ },
22
+ "themeChange": {
23
+ "additionalProperties": false,
24
+ "description": "Host applies Bulma/document hooks (`data-theme` / `theme-*` on `html`/`body`) or ignores.",
25
+ "properties": {
26
+ "mode": {
27
+ "$ref": "#/definitions/ThemePreference"
28
+ }
29
+ },
30
+ "required": [
31
+ "mode"
32
+ ],
33
+ "type": "object"
21
34
  }
22
35
  },
23
36
  "required": [
24
- "pageChange"
37
+ "pageChange",
38
+ "themeChange"
25
39
  ],
26
40
  "type": "object"
41
+ },
42
+ "ThemePreference": {
43
+ "enum": [
44
+ "light",
45
+ "dark",
46
+ "auto"
47
+ ],
48
+ "type": "string"
27
49
  }
28
50
  }
29
51
  },
@@ -59,7 +81,40 @@
59
81
  "type": "string"
60
82
  },
61
83
  "enablefooter": {
62
- "type": "boolean"
84
+ "enum": [
85
+ "yes",
86
+ "no",
87
+ "false",
88
+ null,
89
+ ""
90
+ ],
91
+ "type": [
92
+ "string",
93
+ "null"
94
+ ]
95
+ },
96
+ "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
+ }
116
+ ],
117
+ "description": "When false or `\"no\"`, the theme control is hidden."
63
118
  },
64
119
  "groups": {
65
120
  "items": {
@@ -106,6 +161,21 @@
106
161
  },
107
162
  "style": {
108
163
  "type": "string"
164
+ },
165
+ "themepreference": {
166
+ "anyOf": [
167
+ {
168
+ "$ref": "#/definitions/ThemePreference"
169
+ },
170
+ {
171
+ "type": "null"
172
+ },
173
+ {
174
+ "const": "",
175
+ "type": "string"
176
+ }
177
+ ],
178
+ "description": "Optional controlled value from the host (e.g. after persisting `themeChange`)."
109
179
  }
110
180
  },
111
181
  "type": "object"
@@ -161,11 +231,19 @@
161
231
  "label"
162
232
  ],
163
233
  "type": "object"
234
+ },
235
+ "ThemePreference": {
236
+ "enum": [
237
+ "light",
238
+ "dark",
239
+ "auto"
240
+ ],
241
+ "type": "string"
164
242
  }
165
243
  }
166
244
  }
167
245
  },
168
- "description": "Fixed-width desktop sidebar: optional company logo and title, header/footer slots, 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.",
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).",
169
247
  "storybookArgs": {
170
248
  "companylogouri": {
171
249
  "control": {
@@ -187,12 +265,34 @@
187
265
  "type": "boolean"
188
266
  }
189
267
  },
268
+ "enablethemeswitch": {
269
+ "control": {
270
+ "type": "select"
271
+ },
272
+ "options": [
273
+ "yes",
274
+ "no"
275
+ ]
276
+ },
277
+ "themepreference": {
278
+ "control": {
279
+ "type": "select"
280
+ },
281
+ "options": [
282
+ "light",
283
+ "dark",
284
+ "auto"
285
+ ]
286
+ },
190
287
  "offcanvasswitch": {
191
288
  "action": "offcanvasswitchEvent"
192
289
  },
193
290
  "pageChange": {
194
291
  "action": "pageChangeEvent"
195
292
  },
293
+ "themeChange": {
294
+ "action": "themeChangeEvent"
295
+ },
196
296
  "navpage": {
197
297
  "control": {
198
298
  "type": "text"
@@ -200,7 +300,7 @@
200
300
  },
201
301
  "navlinks": {
202
302
  "control": {
203
- "type": "array"
303
+ "type": "text"
204
304
  }
205
305
  }
206
306
  },
@@ -512,7 +612,7 @@
512
612
  }
513
613
  ],
514
614
  "navpage": "settings",
515
- "enablefooter": true
615
+ "enablefooter": "yes"
516
616
  }
517
617
  },
518
618
  {
@@ -588,11 +688,11 @@
588
688
  }
589
689
  ],
590
690
  "navpage": "settings",
591
- "enablefooter": true
691
+ "enablefooter": "yes"
592
692
  }
593
693
  }
594
694
  ],
595
- "iifeIntegrity": "sha384-KzQZlMOOSeVQduriHnVDSd80RO5qUCMuAAsmsGF/Xt1FuE8gNOzxTQPp/xbqURu4",
695
+ "iifeIntegrity": "sha384-uuMXNfc046XIxVABTnSNzm+plwjHRBRdDqjL5dnc8AKgKfDoD4HbifbIuAvS5jgn",
596
696
  "dependencies": [
597
697
  {
598
698
  "name": "hb-sidenav-link",
@@ -618,5 +718,5 @@
618
718
  "size": {},
619
719
  "iifePath": "main.iife.js",
620
720
  "repoName": "@htmlbricks/hb-sidebar-desktop",
621
- "version": "0.71.22"
721
+ "version": "0.71.23"
622
722
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-sidebar-desktop",
3
- "version": "0.71.22",
3
+ "version": "0.71.23",
4
4
  "contributors": [],
5
- "description": "Fixed-width desktop sidebar: optional company logo and title, header/footer slots, 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.",
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).",
6
6
  "licenses": [
7
7
  {
8
8
  "type": "Apache-2.0",
@@ -30,7 +30,40 @@
30
30
  "type": "string"
31
31
  },
32
32
  "enablefooter": {
33
- "type": "boolean"
33
+ "enum": [
34
+ "yes",
35
+ "no",
36
+ "false",
37
+ null,
38
+ ""
39
+ ],
40
+ "type": [
41
+ "string",
42
+ "null"
43
+ ]
44
+ },
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
+ }
65
+ ],
66
+ "description": "When false or `\"no\"`, the theme control is hidden."
34
67
  },
35
68
  "groups": {
36
69
  "items": {
@@ -77,6 +110,21 @@
77
110
  },
78
111
  "style": {
79
112
  "type": "string"
113
+ },
114
+ "themepreference": {
115
+ "anyOf": [
116
+ {
117
+ "$ref": "#/definitions/ThemePreference"
118
+ },
119
+ {
120
+ "type": "null"
121
+ },
122
+ {
123
+ "const": "",
124
+ "type": "string"
125
+ }
126
+ ],
127
+ "description": "Optional controlled value from the host (e.g. after persisting `themeChange`)."
80
128
  }
81
129
  },
82
130
  "type": "object"
@@ -132,6 +180,14 @@
132
180
  "label"
133
181
  ],
134
182
  "type": "object"
183
+ },
184
+ "ThemePreference": {
185
+ "enum": [
186
+ "light",
187
+ "dark",
188
+ "auto"
189
+ ],
190
+ "type": "string"
135
191
  }
136
192
  }
137
193
  }
@@ -1,5 +1,7 @@
1
1
  import type { INavLink } from "../../sidenav-link/types/webcomponent.type";
2
2
 
3
+ export type ThemePreference = "light" | "dark" | "auto";
4
+
3
5
  export type Component = {
4
6
  id?: string;
5
7
  style?: string;
@@ -8,7 +10,11 @@ export type Component = {
8
10
  groups?: { key: string; label: string }[];
9
11
  companylogouri?: string;
10
12
  companytitle?: string;
11
- enablefooter?: boolean;
13
+ enablefooter?: "yes" | "no" | "false" | null | "" | undefined;
14
+ /** When false or `"no"`, the theme control is hidden. */
15
+ enablethemeswitch?: boolean | "yes" | "no" | null | "" | undefined;
16
+ /** Optional controlled value from the host (e.g. after persisting `themeChange`). */
17
+ themepreference?: ThemePreference | null | "" | undefined;
12
18
  cookielawallowdecline?: "yes" | "no" | null | "" | undefined;
13
19
  cookielawlanguage?: string;
14
20
  cookielawuri4more?: string;
@@ -17,4 +23,6 @@ export type Component = {
17
23
 
18
24
  export type Events = {
19
25
  pageChange: { page: string };
26
+ /** Host applies Bulma/document hooks (`data-theme` / `theme-*` on `html`/`body`) or ignores. */
27
+ themeChange: { mode: ThemePreference };
20
28
  };
@@ -16,12 +16,34 @@
16
16
  "page"
17
17
  ],
18
18
  "type": "object"
19
+ },
20
+ "themeChange": {
21
+ "additionalProperties": false,
22
+ "description": "Host applies Bulma/document hooks (`data-theme` / `theme-*` on `html`/`body`) or ignores.",
23
+ "properties": {
24
+ "mode": {
25
+ "$ref": "#/definitions/ThemePreference"
26
+ }
27
+ },
28
+ "required": [
29
+ "mode"
30
+ ],
31
+ "type": "object"
19
32
  }
20
33
  },
21
34
  "required": [
22
- "pageChange"
35
+ "pageChange",
36
+ "themeChange"
23
37
  ],
24
38
  "type": "object"
39
+ },
40
+ "ThemePreference": {
41
+ "enum": [
42
+ "light",
43
+ "dark",
44
+ "auto"
45
+ ],
46
+ "type": "string"
25
47
  }
26
48
  }
27
49
  }