@htmlbricks/hb-sidebar-desktop 0.71.22 → 0.71.24

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,30 @@
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
+ "description": "When false or `\"no\"`, the theme control is hidden.",
98
+ "enum": [
99
+ "yes",
100
+ "no",
101
+ null,
102
+ ""
103
+ ],
104
+ "type": [
105
+ "string",
106
+ "null"
107
+ ]
63
108
  },
64
109
  "groups": {
65
110
  "items": {
@@ -106,6 +151,21 @@
106
151
  },
107
152
  "style": {
108
153
  "type": "string"
154
+ },
155
+ "themepreference": {
156
+ "anyOf": [
157
+ {
158
+ "$ref": "#/definitions/ThemePreference"
159
+ },
160
+ {
161
+ "type": "null"
162
+ },
163
+ {
164
+ "const": "",
165
+ "type": "string"
166
+ }
167
+ ],
168
+ "description": "Optional controlled value from the host (e.g. after persisting `themeChange`)."
109
169
  }
110
170
  },
111
171
  "type": "object"
@@ -161,11 +221,19 @@
161
221
  "label"
162
222
  ],
163
223
  "type": "object"
224
+ },
225
+ "ThemePreference": {
226
+ "enum": [
227
+ "light",
228
+ "dark",
229
+ "auto"
230
+ ],
231
+ "type": "string"
164
232
  }
165
233
  }
166
234
  }
167
235
  },
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.",
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).",
169
237
  "storybookArgs": {
170
238
  "companylogouri": {
171
239
  "control": {
@@ -187,12 +255,34 @@
187
255
  "type": "boolean"
188
256
  }
189
257
  },
258
+ "enablethemeswitch": {
259
+ "control": {
260
+ "type": "select"
261
+ },
262
+ "options": [
263
+ "yes",
264
+ "no"
265
+ ]
266
+ },
267
+ "themepreference": {
268
+ "control": {
269
+ "type": "select"
270
+ },
271
+ "options": [
272
+ "light",
273
+ "dark",
274
+ "auto"
275
+ ]
276
+ },
190
277
  "offcanvasswitch": {
191
278
  "action": "offcanvasswitchEvent"
192
279
  },
193
280
  "pageChange": {
194
281
  "action": "pageChangeEvent"
195
282
  },
283
+ "themeChange": {
284
+ "action": "themeChangeEvent"
285
+ },
196
286
  "navpage": {
197
287
  "control": {
198
288
  "type": "text"
@@ -200,7 +290,7 @@
200
290
  },
201
291
  "navlinks": {
202
292
  "control": {
203
- "type": "array"
293
+ "type": "text"
204
294
  }
205
295
  }
206
296
  },
@@ -512,7 +602,7 @@
512
602
  }
513
603
  ],
514
604
  "navpage": "settings",
515
- "enablefooter": true
605
+ "enablefooter": "yes"
516
606
  }
517
607
  },
518
608
  {
@@ -588,11 +678,11 @@
588
678
  }
589
679
  ],
590
680
  "navpage": "settings",
591
- "enablefooter": true
681
+ "enablefooter": "yes"
592
682
  }
593
683
  }
594
684
  ],
595
- "iifeIntegrity": "sha384-KzQZlMOOSeVQduriHnVDSd80RO5qUCMuAAsmsGF/Xt1FuE8gNOzxTQPp/xbqURu4",
685
+ "iifeIntegrity": "sha384-wBLuiZuNMVVfCs4Nl3ia+01WI27TTH1hRju0R/3Q6CUuxJqv7XkXglApISSuYwvJ",
596
686
  "dependencies": [
597
687
  {
598
688
  "name": "hb-sidenav-link",
@@ -618,5 +708,5 @@
618
708
  "size": {},
619
709
  "iifePath": "main.iife.js",
620
710
  "repoName": "@htmlbricks/hb-sidebar-desktop",
621
- "version": "0.71.22"
711
+ "version": "0.71.24"
622
712
  }
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.24",
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,30 @@
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
+ "description": "When false or `\"no\"`, the theme control is hidden.",
47
+ "enum": [
48
+ "yes",
49
+ "no",
50
+ null,
51
+ ""
52
+ ],
53
+ "type": [
54
+ "string",
55
+ "null"
56
+ ]
34
57
  },
35
58
  "groups": {
36
59
  "items": {
@@ -77,6 +100,21 @@
77
100
  },
78
101
  "style": {
79
102
  "type": "string"
103
+ },
104
+ "themepreference": {
105
+ "anyOf": [
106
+ {
107
+ "$ref": "#/definitions/ThemePreference"
108
+ },
109
+ {
110
+ "type": "null"
111
+ },
112
+ {
113
+ "const": "",
114
+ "type": "string"
115
+ }
116
+ ],
117
+ "description": "Optional controlled value from the host (e.g. after persisting `themeChange`)."
80
118
  }
81
119
  },
82
120
  "type": "object"
@@ -132,6 +170,14 @@
132
170
  "label"
133
171
  ],
134
172
  "type": "object"
173
+ },
174
+ "ThemePreference": {
175
+ "enum": [
176
+ "light",
177
+ "dark",
178
+ "auto"
179
+ ],
180
+ "type": "string"
135
181
  }
136
182
  }
137
183
  }
@@ -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?: "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
  }