highsoft-ui 1.0.27 → 1.0.28

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.
@@ -3,7 +3,7 @@ import { useState as N, useEffect as V } from "react";
3
3
  import { J as q } from "../../index-CMegByeX.js";
4
4
  import { _ as d } from "../../extends-hS2Bh-Yp.js";
5
5
  import { N as J, X as A } from "../../index-ChurKizy.js";
6
- import { c as f } from "../../clsx-OuTLNxxd.js";
6
+ import { c as _ } from "../../clsx-OuTLNxxd.js";
7
7
  import { Button as h } from "../Button/index.js";
8
8
  import { Container as j } from "../Container/index.js";
9
9
  import { ThemedLogo as z } from "../Logo/index.js";
@@ -245,20 +245,20 @@ function l(n, t) {
245
245
  function w1({
246
246
  items: n,
247
247
  link: t = "a",
248
- host: p = "https://www.highcharts.com"
248
+ host: g = "https://www.highcharts.com"
249
249
  }) {
250
- const i = G();
251
- return /* @__PURE__ */ e("div", { className: f(r.sub, r.outer), children: /* @__PURE__ */ e(j, { className: r.subContainer, as: "ul", children: n.map(({ title: a, url: g, icon: k, tag: x, tagVariant: m = "success" }, C) => {
250
+ const o = G();
251
+ return console.log("header", o), /* @__PURE__ */ e("div", { className: _(r.sub, r.outer), children: /* @__PURE__ */ e(j, { className: r.subContainer, as: "ul", children: n.map(({ title: a, url: v, icon: k, tag: x, tagVariant: m = "success" }, C) => {
252
252
  let w = !1;
253
253
  if (typeof window < "u") {
254
- const v = window.location.origin, _ = new URL(g, v);
255
- w = (g.startsWith("/") || _.origin === v) && _.pathname === i;
254
+ const p = window.location.origin, f = new URL(v, p);
255
+ console.log(f, o, p), w = (v.startsWith("/") || f.origin === p) && f.pathname === o;
256
256
  }
257
257
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
258
258
  t,
259
259
  {
260
- href: l(g, p),
261
- className: f({
260
+ href: l(v, g),
261
+ className: _({
262
262
  [r.selected]: w
263
263
  }),
264
264
  children: [
@@ -268,7 +268,7 @@ function w1({
268
268
  x && /* @__PURE__ */ e(
269
269
  "span",
270
270
  {
271
- className: f(
271
+ className: _(
272
272
  r.subTag,
273
273
  r[`subTag-${m}`]
274
274
  ),
@@ -284,34 +284,34 @@ function w1({
284
284
  function z1({
285
285
  subItems: n,
286
286
  children: t,
287
- notifications: p = [],
287
+ notifications: g = [],
288
288
  // TODO: Fetch these from the internets
289
- link: i = "a",
289
+ link: o = "a",
290
290
  host: a = "https://www.highcharts.com"
291
291
  }) {
292
- const g = M("(max-width: 374px)"), k = M("(max-width: 849px)"), x = M("(min-width: 850px) and (max-width: 999px)"), [m, C] = N(!1), [w, v] = N([]);
292
+ const v = M("(max-width: 374px)"), k = M("(max-width: 849px)"), x = M("(min-width: 850px) and (max-width: 999px)"), [m, C] = N(!1), [w, p] = N([]);
293
293
  V(() => {
294
- if (p.length) {
294
+ if (g.length) {
295
295
  const c = localStorage.getItem("notifications");
296
296
  if (c) {
297
297
  const u = JSON.parse(c);
298
- v(
299
- p.filter(
300
- (o) => !o.id || !u.closed.includes(o.id)
298
+ p(
299
+ g.filter(
300
+ (i) => !i.id || !u.closed.includes(i.id)
301
301
  )
302
302
  );
303
303
  } else
304
- v(p);
304
+ p(g);
305
305
  }
306
- }, [p]);
307
- const _ = () => {
306
+ }, [g]);
307
+ const f = () => {
308
308
  C(!m);
309
309
  }, y = (c) => {
310
- v(w.filter((o) => !o.id || o.id !== c));
310
+ p(w.filter((i) => !i.id || i.id !== c));
311
311
  const u = localStorage.getItem("notifications");
312
312
  if (u) {
313
- const o = JSON.parse(u);
314
- o.closed.includes(c) || (o.closed.push(c), localStorage.setItem("notifications", JSON.stringify(o)));
313
+ const i = JSON.parse(u);
314
+ i.closed.includes(c) || (i.closed.push(c), localStorage.setItem("notifications", JSON.stringify(i)));
315
315
  } else
316
316
  localStorage.setItem(
317
317
  "notifications",
@@ -322,10 +322,10 @@ function z1({
322
322
  };
323
323
  return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ s("header", { className: r.header, children: [
324
324
  w == null ? void 0 : w.map(
325
- ({ id: c, title: u, description: o, variant: b, closable: O }, P) => /* @__PURE__ */ e(
325
+ ({ id: c, title: u, description: i, variant: b, closable: O }, P) => /* @__PURE__ */ e(
326
326
  J,
327
327
  {
328
- description: o,
328
+ description: i,
329
329
  variant: b,
330
330
  closable: O,
331
331
  onClose: () => y(c),
@@ -334,31 +334,31 @@ function z1({
334
334
  P
335
335
  )
336
336
  ),
337
- /* @__PURE__ */ e("div", { className: f(r.main, r.outer), children: /* @__PURE__ */ s(j, { as: "nav", className: r.container, children: [
337
+ /* @__PURE__ */ e("div", { className: _(r.main, r.outer), children: /* @__PURE__ */ s(j, { as: "nav", className: r.container, children: [
338
338
  /* @__PURE__ */ e(
339
- i,
339
+ o,
340
340
  {
341
341
  className: r.logo,
342
342
  href: l("https://www.highcharts.com/", a),
343
- children: /* @__PURE__ */ e(z, { showText: !x && !g })
343
+ children: /* @__PURE__ */ e(z, { showText: !x && !v })
344
344
  }
345
345
  ),
346
- /* @__PURE__ */ e("ul", { className: r.links, children: H.map(({ title: c, url: u }, o) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
346
+ /* @__PURE__ */ e("ul", { className: r.links, children: H.map(({ title: c, url: u }, i) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
347
347
  h,
348
348
  {
349
349
  variant: "plain",
350
350
  size: 300,
351
- as: i,
351
+ as: o,
352
352
  href: l(u, a),
353
353
  children: c
354
354
  }
355
- ) }, o)) }),
355
+ ) }, i)) }),
356
356
  /* @__PURE__ */ s("div", { className: r.buttons, children: [
357
357
  /* @__PURE__ */ s(
358
358
  h,
359
359
  {
360
360
  variant: "transparent",
361
- as: i,
361
+ as: o,
362
362
  href: l(
363
363
  "https://www.highcharts.com/chat/gpt/",
364
364
  a
@@ -375,7 +375,7 @@ function z1({
375
375
  h,
376
376
  {
377
377
  variant: "brand",
378
- as: i,
378
+ as: o,
379
379
  href: l("https://shop.highcharts.com/account", a),
380
380
  "aria-label": "Login",
381
381
  children: /* @__PURE__ */ e(W, {})
@@ -385,7 +385,7 @@ function z1({
385
385
  h,
386
386
  {
387
387
  variant: "success",
388
- as: i,
388
+ as: o,
389
389
  href: l(
390
390
  "https://www.highcharts.com/download/",
391
391
  a
@@ -401,7 +401,7 @@ function z1({
401
401
  {
402
402
  variant: m ? "white" : "transparent",
403
403
  className: r.menu,
404
- onClick: _,
404
+ onClick: f,
405
405
  children: [
406
406
  m ? "Close" : "Menu",
407
407
  m ? /* @__PURE__ */ e(A, {}) : /* @__PURE__ */ e($, {})
@@ -410,30 +410,30 @@ function z1({
410
410
  )
411
411
  ] })
412
412
  ] }) }),
413
- !!(n != null && n.length) && /* @__PURE__ */ e(w1, { items: n, link: i, host: a }),
413
+ !!(n != null && n.length) && /* @__PURE__ */ e(w1, { items: n, link: o, host: a }),
414
414
  t,
415
415
  k && /* @__PURE__ */ s(U, { children: [
416
416
  /* @__PURE__ */ e(
417
417
  "div",
418
418
  {
419
- className: f(r.mobileOverlay, { [r.open]: m }),
420
- onClick: _
419
+ className: _(r.mobileOverlay, { [r.open]: m }),
420
+ onClick: f
421
421
  }
422
422
  ),
423
423
  /* @__PURE__ */ s(
424
424
  "nav",
425
425
  {
426
- className: f(r.mobile, {
426
+ className: _(r.mobile, {
427
427
  [r.open]: m
428
428
  }),
429
429
  children: [
430
430
  /* @__PURE__ */ s("div", { className: r.container, children: [
431
431
  /* @__PURE__ */ e(
432
- i,
432
+ o,
433
433
  {
434
434
  className: r.logo,
435
435
  href: l("https://www.highcharts.com/", a),
436
- children: /* @__PURE__ */ e(z, { showText: !g })
436
+ children: /* @__PURE__ */ e(z, { showText: !v })
437
437
  }
438
438
  ),
439
439
  /* @__PURE__ */ s("div", { className: r.buttons, children: [
@@ -441,7 +441,7 @@ function z1({
441
441
  h,
442
442
  {
443
443
  variant: "transparent",
444
- as: i,
444
+ as: o,
445
445
  href: l(
446
446
  "https://www.highcharts.com/chat/gpt/",
447
447
  a
@@ -462,7 +462,7 @@ function z1({
462
462
  {
463
463
  variant: "brand",
464
464
  fullWidth: !0,
465
- as: i,
465
+ as: o,
466
466
  href: l(
467
467
  "https://shop.highcharts.com/account",
468
468
  a
@@ -478,7 +478,7 @@ function z1({
478
478
  {
479
479
  variant: "success",
480
480
  fullWidth: !0,
481
- as: i,
481
+ as: o,
482
482
  href: l(
483
483
  "https://www.highcharts.com/download/",
484
484
  a
@@ -490,16 +490,16 @@ function z1({
490
490
  }
491
491
  )
492
492
  ] }),
493
- /* @__PURE__ */ e("ul", { className: r.links, children: H.map(({ title: c, url: u, icon: o }, b) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
493
+ /* @__PURE__ */ e("ul", { className: r.links, children: H.map(({ title: c, url: u, icon: i }, b) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
494
494
  h,
495
495
  {
496
496
  variant: "plain",
497
497
  size: 500,
498
498
  fullWidth: !0,
499
- as: i,
499
+ as: o,
500
500
  href: l(u, a),
501
501
  children: [
502
- o,
502
+ i,
503
503
  c
504
504
  ]
505
505
  }
package/dist/utils.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { _ as $ } from "./extends-hS2Bh-Yp.js";
2
2
  import { useState as E, useEffect as k } from "react";
3
3
  var p;
4
- (function(n) {
5
- n.Pop = "POP", n.Push = "PUSH", n.Replace = "REPLACE";
4
+ (function(e) {
5
+ e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
6
6
  })(p || (p = {}));
7
- var A = process.env.NODE_ENV !== "production" ? function(n) {
8
- return Object.freeze(n);
9
- } : function(n) {
10
- return n;
7
+ var A = process.env.NODE_ENV !== "production" ? function(e) {
8
+ return Object.freeze(e);
9
+ } : function(e) {
10
+ return e;
11
11
  };
12
- function U(n, o) {
12
+ function U(e, o) {
13
13
  {
14
14
  typeof console < "u" && console.warn(o);
15
15
  try {
@@ -19,13 +19,13 @@ function U(n, o) {
19
19
  }
20
20
  }
21
21
  var H = "beforeunload", j = "popstate";
22
- function z(n) {
23
- n === void 0 && (n = {});
24
- var o = n, a = o.window, r = a === void 0 ? document.defaultView : a, i = r.history;
22
+ function z(e) {
23
+ e === void 0 && (e = {});
24
+ var o = e, a = o.window, t = a === void 0 ? document.defaultView : a, i = t.history;
25
25
  function f() {
26
- var e = r.location, t = e.pathname, c = e.search, l = e.hash, u = i.state || {};
26
+ var n = t.location, r = n.pathname, c = n.search, l = n.hash, u = i.state || {};
27
27
  return [u.idx, A({
28
- pathname: t,
28
+ pathname: r,
29
29
  search: c,
30
30
  hash: l,
31
31
  state: u.usr || null,
@@ -37,12 +37,12 @@ function z(n) {
37
37
  if (s)
38
38
  d.call(s), s = null;
39
39
  else {
40
- var e = p.Pop, t = f(), c = t[0], l = t[1];
40
+ var n = p.Pop, r = f(), c = r[0], l = r[1];
41
41
  if (d.length)
42
42
  if (c != null) {
43
43
  var u = h - c;
44
44
  u && (s = {
45
- action: e,
45
+ action: n,
46
46
  location: l,
47
47
  retry: function() {
48
48
  y(u * -1);
@@ -57,76 +57,76 @@ function z(n) {
57
57
  "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
58
58
  );
59
59
  else
60
- b(e);
60
+ b(n);
61
61
  }
62
62
  }
63
- r.addEventListener(j, D);
63
+ t.addEventListener(j, D);
64
64
  var w = p.Pop, x = f(), h = x[0], m = x[1], L = B(), d = B();
65
65
  h == null && (h = 0, i.replaceState($({}, i.state, {
66
66
  idx: h
67
67
  }), ""));
68
- function O(e) {
69
- return typeof e == "string" ? e : K(e);
68
+ function O(n) {
69
+ return typeof n == "string" ? n : K(n);
70
70
  }
71
- function S(e, t) {
72
- return t === void 0 && (t = null), A($({
71
+ function S(n, r) {
72
+ return r === void 0 && (r = null), A($({
73
73
  pathname: m.pathname,
74
74
  hash: "",
75
75
  search: ""
76
- }, typeof e == "string" ? Q(e) : e, {
77
- state: t,
76
+ }, typeof n == "string" ? Q(n) : n, {
77
+ state: r,
78
78
  key: C()
79
79
  }));
80
80
  }
81
- function _(e, t) {
81
+ function _(n, r) {
82
82
  return [{
83
- usr: e.state,
84
- key: e.key,
85
- idx: t
86
- }, O(e)];
83
+ usr: n.state,
84
+ key: n.key,
85
+ idx: r
86
+ }, O(n)];
87
87
  }
88
- function M(e, t, c) {
88
+ function M(n, r, c) {
89
89
  return !d.length || (d.call({
90
- action: e,
91
- location: t,
90
+ action: n,
91
+ location: r,
92
92
  retry: c
93
93
  }), !1);
94
94
  }
95
- function b(e) {
96
- w = e;
97
- var t = f();
98
- h = t[0], m = t[1], L.call({
95
+ function b(n) {
96
+ w = n;
97
+ var r = f();
98
+ h = r[0], m = r[1], L.call({
99
99
  action: w,
100
100
  location: m
101
101
  });
102
102
  }
103
- function T(e, t) {
104
- var c = p.Push, l = S(e, t);
103
+ function T(n, r) {
104
+ var c = p.Push, l = S(n, r);
105
105
  function u() {
106
- T(e, t);
106
+ T(n, r);
107
107
  }
108
108
  if (M(c, l, u)) {
109
109
  var v = _(l, h + 1), P = v[0], g = v[1];
110
110
  try {
111
111
  i.pushState(P, "", g);
112
112
  } catch {
113
- r.location.assign(g);
113
+ t.location.assign(g);
114
114
  }
115
115
  b(c);
116
116
  }
117
117
  }
118
- function N(e, t) {
119
- var c = p.Replace, l = S(e, t);
118
+ function N(n, r) {
119
+ var c = p.Replace, l = S(n, r);
120
120
  function u() {
121
- N(e, t);
121
+ N(n, r);
122
122
  }
123
123
  if (M(c, l, u)) {
124
124
  var v = _(l, h), P = v[0], g = v[1];
125
125
  i.replaceState(P, "", g), b(c);
126
126
  }
127
127
  }
128
- function y(e) {
129
- i.go(e);
128
+ function y(n) {
129
+ i.go(n);
130
130
  }
131
131
  var R = {
132
132
  get action() {
@@ -145,37 +145,37 @@ function z(n) {
145
145
  forward: function() {
146
146
  y(1);
147
147
  },
148
- listen: function(t) {
149
- return L.push(t);
148
+ listen: function(r) {
149
+ return L.push(r);
150
150
  },
151
- block: function(t) {
152
- var c = d.push(t);
153
- return d.length === 1 && r.addEventListener(H, V), function() {
154
- c(), d.length || r.removeEventListener(H, V);
151
+ block: function(r) {
152
+ var c = d.push(r);
153
+ return d.length === 1 && t.addEventListener(H, V), function() {
154
+ c(), d.length || t.removeEventListener(H, V);
155
155
  };
156
156
  }
157
157
  };
158
158
  return R;
159
159
  }
160
- function V(n) {
161
- n.preventDefault(), n.returnValue = "";
160
+ function V(e) {
161
+ e.preventDefault(), e.returnValue = "";
162
162
  }
163
163
  function B() {
164
- var n = [];
164
+ var e = [];
165
165
  return {
166
166
  get length() {
167
- return n.length;
167
+ return e.length;
168
168
  },
169
169
  push: function(a) {
170
- return n.push(a), function() {
171
- n = n.filter(function(r) {
172
- return r !== a;
170
+ return e.push(a), function() {
171
+ e = e.filter(function(t) {
172
+ return t !== a;
173
173
  });
174
174
  };
175
175
  },
176
176
  call: function(a) {
177
- n.forEach(function(r) {
178
- return r && r(a);
177
+ e.forEach(function(t) {
178
+ return t && t(a);
179
179
  });
180
180
  }
181
181
  };
@@ -183,45 +183,45 @@ function B() {
183
183
  function C() {
184
184
  return Math.random().toString(36).substr(2, 8);
185
185
  }
186
- function K(n) {
187
- var o = n.pathname, a = o === void 0 ? "/" : o, r = n.search, i = r === void 0 ? "" : r, f = n.hash, s = f === void 0 ? "" : f;
186
+ function K(e) {
187
+ var o = e.pathname, a = o === void 0 ? "/" : o, t = e.search, i = t === void 0 ? "" : t, f = e.hash, s = f === void 0 ? "" : f;
188
188
  return i && i !== "?" && (a += i.charAt(0) === "?" ? i : "?" + i), s && s !== "#" && (a += s.charAt(0) === "#" ? s : "#" + s), a;
189
189
  }
190
- function Q(n) {
190
+ function Q(e) {
191
191
  var o = {};
192
- if (n) {
193
- var a = n.indexOf("#");
194
- a >= 0 && (o.hash = n.substr(a), n = n.substr(0, a));
195
- var r = n.indexOf("?");
196
- r >= 0 && (o.search = n.substr(r), n = n.substr(0, r)), n && (o.pathname = n);
192
+ if (e) {
193
+ var a = e.indexOf("#");
194
+ a >= 0 && (o.hash = e.substr(a), e = e.substr(0, a));
195
+ var t = e.indexOf("?");
196
+ t >= 0 && (o.search = e.substr(t), e = e.substr(0, t)), e && (o.pathname = e);
197
197
  }
198
198
  return o;
199
199
  }
200
- function J(n) {
200
+ function J(e) {
201
201
  const [o, a] = E(!1);
202
202
  return k(() => {
203
- const r = window.matchMedia(n);
204
- a(r.matches);
203
+ const t = window.matchMedia(e);
204
+ a(t.matches);
205
205
  const i = (f) => {
206
206
  a(f.matches);
207
207
  };
208
- return r.addEventListener("change", i), () => r.removeEventListener("change", i);
209
- }, [n]), o;
208
+ return t.addEventListener("change", i), () => t.removeEventListener("change", i);
209
+ }, [e]), o;
210
210
  }
211
211
  function W() {
212
- const [n, o] = E(!1);
212
+ const [e, o] = E(!1);
213
213
  return k(() => {
214
214
  o(!0);
215
- }, []), n;
215
+ }, []), e;
216
216
  }
217
217
  function X() {
218
- const [n, o] = E("");
218
+ const [e, o] = E("");
219
219
  return k(() => {
220
220
  const a = z();
221
- return o(a.location.pathname), a.listen(({ location: r }) => {
222
- o(r.pathname);
221
+ return o(a.location.pathname), a.listen(({ location: t }) => {
222
+ console.log("listener", t.pathname), o(t.pathname);
223
223
  });
224
- }, []), n;
224
+ }, []), e;
225
225
  }
226
226
  export {
227
227
  J as useMediaQuery,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "highsoft-ui",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Highsoft UI",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",