@oussemasahbeni/keycloakify-login-shadcn 250004.0.13 → 250004.0.15

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.
@@ -228,10 +228,11 @@ export function Template(props: {
228
228
  <a
229
229
  href="#"
230
230
  id="try-another-way"
231
- onClick={() => {
231
+ onClick={(event) => {
232
232
  document.forms[
233
233
  "kc-select-try-another-way-form" as never
234
234
  ].submit();
235
+ event.preventDefault();
235
236
  return false;
236
237
  }}
237
238
  >
@@ -0,0 +1,49 @@
1
+ {
2
+ const isDark = (() => {
3
+ query_param: {
4
+ const value = new URLSearchParams(location.search).get("dark");
5
+
6
+ switch (value) {
7
+ case "true":
8
+ return true;
9
+ case "false":
10
+ return false;
11
+ default:
12
+ break query_param;
13
+ }
14
+ }
15
+
16
+ local_storage: {
17
+ const value = localStorage.getItem("isDarkMode");
18
+
19
+ if (value === null) {
20
+ break local_storage;
21
+ }
22
+
23
+ switch (value) {
24
+ case "dark":
25
+ return true;
26
+ case "light":
27
+ return false;
28
+ default:
29
+ break local_storage;
30
+ }
31
+ }
32
+
33
+ return matchMedia("(prefers-color-scheme: dark)").matches;
34
+ })();
35
+
36
+ {
37
+ const element = document.createElement("style");
38
+
39
+ element.innerHTML = `:root { color-scheme: ${isDark ? "dark" : "light"}; }`;
40
+
41
+ document.head.appendChild(element);
42
+ }
43
+
44
+ if (isDark) {
45
+ document.documentElement.classList.add("dark");
46
+ }
47
+
48
+ document.documentElement.style.backgroundColor = isDark ? "#0A0A0A" : "#FFFFFF";
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oussemasahbeni/keycloakify-login-shadcn",
3
- "version": "250004.0.13",
3
+ "version": "250004.0.15",
4
4
  "description": "Keycloakify Shadcn Theme extensions",
5
5
  "license": "MIT",
6
6
  "repository": {