@crystaltech/hsms-shared-ui 0.6.7-alpha-0.0.1 → 0.6.8

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/dist/index.es2.js CHANGED
@@ -1,4 +1,5 @@
1
- function b(t, e) {
1
+ import { p as g } from "./logo-CDcm1S1N.js";
2
+ function w(t, e) {
2
3
  try {
3
4
  let a = t.replace("#", "");
4
5
  a.length === 3 && (a = a.split("").map((i) => i + i).join(""));
@@ -11,16 +12,16 @@ function b(t, e) {
11
12
  return t;
12
13
  }
13
14
  }
14
- function w() {
15
+ function E() {
15
16
  try {
16
- const t = localStorage.getItem("theme"), e = t ? JSON.parse(t) : null, a = e && e.mode || "light", r = e && e.themeColor || "#2c5282", n = b(r, 24), o = a === "light" ? "#ffffff" : "#121212", d = a === "light" ? "#0f172a" : "#e5e7eb", s = document.documentElement;
17
+ const t = localStorage.getItem("theme"), e = t ? JSON.parse(t) : null, a = e && e.mode || "light", r = e && e.themeColor || "#2563eb", n = w(r, 36), o = a === "light" ? "#ffffff" : "#121212", d = a === "light" ? "#0f172a" : "#e5e7eb", s = document.documentElement;
17
18
  s.style.setProperty("--app-bg", o), s.style.setProperty("--app-fg", d), s.style.setProperty("--app-primary", r), s.style.setProperty("--app-primary-2", n);
18
19
  } catch {
19
20
  const e = document.documentElement;
20
- e.style.setProperty("--app-bg", "#ffffff"), e.style.setProperty("--app-fg", "#0f172a"), e.style.setProperty("--app-primary", "#2c5282"), e.style.setProperty("--app-primary-2", "#3b82f6");
21
+ e.style.setProperty("--app-bg", "#ffffff"), e.style.setProperty("--app-fg", "#0f172a"), e.style.setProperty("--app-primary", "#2563eb"), e.style.setProperty("--app-primary-2", "#60a5fa");
21
22
  }
22
23
  }
23
- function g() {
24
+ function u() {
24
25
  try {
25
26
  const t = localStorage.getItem("organization_name") || "", e = localStorage.getItem("organization_logo_full_url") || "";
26
27
  return { orgName: t, orgLogo: e };
@@ -28,7 +29,7 @@ function g() {
28
29
  return { orgName: "", orgLogo: "" };
29
30
  }
30
31
  }
31
- function E() {
32
+ function x() {
32
33
  if (document.getElementById("hsms-pre-splash-style")) return;
33
34
  const t = document.createElement("style");
34
35
  t.id = "hsms-pre-splash-style", t.textContent = `
@@ -73,7 +74,7 @@ function E() {
73
74
  @keyframes hsms-spin { to { transform: rotate(360deg); } }
74
75
  `, document.head.appendChild(t);
75
76
  }
76
- function x(t) {
77
+ function L(t) {
77
78
  if (t != null && t.rootId) {
78
79
  const e = document.getElementById(t.rootId);
79
80
  if (e) return e;
@@ -102,18 +103,18 @@ function c(t) {
102
103
  } catch {
103
104
  }
104
105
  }
105
- function u(t) {
106
+ function y(t) {
106
107
  try {
107
108
  if (document.getElementById("hsms-pre-splash")) return;
108
109
  try {
109
110
  document.documentElement.classList.add("app-loading"), document.documentElement.classList.remove("app-ready"), window.__APP_READY__ = !1;
110
111
  } catch {
111
112
  }
112
- w(), E();
113
- const { orgName: e, orgLogo: a } = g(), r = x(t), n = document.createElement("div");
113
+ E(), x();
114
+ const { orgName: e, orgLogo: a } = u(), r = L(t), n = document.createElement("div");
114
115
  n.id = "hsms-pre-splash", n.className = "app-splash", n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite"), n.innerHTML = `
115
116
  <div class="brand">
116
- <img id="hsms-splash-logo" src="/logo.png" alt="Organization Logo"
117
+ <img id="hsms-splash-logo" src="${g}" alt="Organization Logo"
117
118
  style="height:40px;width:auto;border-radius:6px" />
118
119
  <div id="hsms-splash-name" class="splash-title">Loading HSMS UI…</div>
119
120
  </div>
@@ -121,7 +122,7 @@ function u(t) {
121
122
  `, r.firstChild ? r.insertBefore(n, r.firstChild) : r.appendChild(n);
122
123
  const o = n.querySelector("#hsms-splash-logo"), d = n.querySelector("#hsms-splash-name");
123
124
  if (o && a && (o.src = a), d && e && (d.textContent = e), o) {
124
- const l = "/logo.png", p = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(
125
+ const l = g, p = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(
125
126
  `<svg xmlns="http://www.w3.org/2000/svg" width="80" height="40">
126
127
  <rect width="100%" height="100%" rx="6" fill="rgba(255,255,255,0.18)"/>
127
128
  <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="white" font-family="sans-serif" font-size="12">HSMS</text>
@@ -137,7 +138,7 @@ function u(t) {
137
138
  }
138
139
  const s = () => {
139
140
  try {
140
- const { orgName: l, orgLogo: p } = g();
141
+ const { orgName: l, orgLogo: p } = u();
141
142
  o && p && (o.src = p), d && l && (d.textContent = l);
142
143
  } catch {
143
144
  }
@@ -149,38 +150,38 @@ function u(t) {
149
150
  i.observe(r, { childList: !0, subtree: !1 });
150
151
  const m = () => c(r);
151
152
  window.addEventListener("load", m, { once: !0 });
152
- const y = () => c(r);
153
- window.addEventListener("hsms-app-mounted", y);
154
153
  const f = () => c(r);
155
- document.addEventListener("DOMContentLoaded", f, { once: !0 });
154
+ window.addEventListener("hsms-app-mounted", f);
156
155
  const v = () => c(r);
157
- window.addEventListener("app-ready", v);
156
+ document.addEventListener("DOMContentLoaded", v, { once: !0 });
157
+ const b = () => c(r);
158
+ window.addEventListener("app-ready", b);
158
159
  } catch {
159
160
  }
160
161
  }
161
- function L() {
162
+ function I() {
162
163
  c();
163
164
  }
164
- function I() {
165
+ function S() {
165
166
  try {
166
167
  window.__APP_READY__ = !0, window.dispatchEvent(new Event("app-ready"));
167
168
  } catch {
168
169
  }
169
170
  }
170
171
  try {
171
- u();
172
+ y();
172
173
  } catch {
173
174
  }
174
175
  try {
175
176
  window.HSMSPreMountSplash = {
176
- initPreMountSplash: u,
177
- hidePreMountSplash: L,
178
- markAppReady: I
177
+ initPreMountSplash: y,
178
+ hidePreMountSplash: I,
179
+ markAppReady: S
179
180
  };
180
181
  } catch {
181
182
  }
182
183
  export {
183
- L as hidePreMountSplash,
184
- u as initPreMountSplash,
185
- I as markAppReady
184
+ I as hidePreMountSplash,
185
+ y as initPreMountSplash,
186
+ S as markAppReady
186
187
  };