highsoft-ui 1.0.22 → 1.0.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.
@@ -8,7 +8,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";
10
10
  import { PrefPanel as L } from "../PrefPanel/index.js";
11
- import { useMediaQuery as b, useLocation as G } from "../../utils.js";
11
+ import { useMediaQuery as M, useLocation as G } from "../../utils.js";
12
12
  var F = function(t) {
13
13
  return /* @__PURE__ */ e("svg", d({
14
14
  xmlns: "http://www.w3.org/2000/svg",
@@ -247,35 +247,39 @@ function w1({
247
247
  link: t = "a",
248
248
  host: g = "https://www.highcharts.com"
249
249
  }) {
250
- const o = 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: w, icon: x, tag: _, tagVariant: m = "success" }, k) => {
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: w, icon: k, tag: x, tagVariant: m = "success" }, C) => {
252
252
  w = l(w, g);
253
- const p = window == null ? void 0 : window.location.origin, v = new URL(w, p);
253
+ let p = !1;
254
+ if (typeof window < "u" && i) {
255
+ const v = window.location.origin, _ = new URL(w, v);
256
+ p = _.origin === v && _.pathname === i.pathname;
257
+ }
254
258
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
255
259
  t,
256
260
  {
257
261
  href: w,
258
262
  className: f({
259
- [r.selected]: v.origin === p && v.pathname === (o == null ? void 0 : o.pathname)
263
+ [r.selected]: p
260
264
  }),
261
265
  children: [
262
- x,
266
+ k,
263
267
  /* @__PURE__ */ s("span", { children: [
264
268
  a,
265
- _ && /* @__PURE__ */ e(
269
+ x && /* @__PURE__ */ e(
266
270
  "span",
267
271
  {
268
272
  className: f(
269
273
  r.subTag,
270
274
  r[`subTag-${m}`]
271
275
  ),
272
- children: _
276
+ children: x
273
277
  }
274
278
  )
275
279
  ] })
276
280
  ]
277
281
  }
278
- ) }, k);
282
+ ) }, C);
279
283
  }) }) });
280
284
  }
281
285
  function z1({
@@ -283,10 +287,10 @@ function z1({
283
287
  children: t,
284
288
  notifications: g = [],
285
289
  // TODO: Fetch these from the internets
286
- link: o = "a",
290
+ link: i = "a",
287
291
  host: a = "https://www.highcharts.com"
288
292
  }) {
289
- const w = b("(max-width: 374px)"), x = b("(max-width: 849px)"), _ = b("(min-width: 850px) and (max-width: 999px)"), [m, k] = N(!1), [p, v] = N([]);
293
+ const w = M("(max-width: 374px)"), k = M("(max-width: 849px)"), x = M("(min-width: 850px) and (max-width: 999px)"), [m, C] = N(!1), [p, v] = N([]);
290
294
  V(() => {
291
295
  if (g.length) {
292
296
  const c = localStorage.getItem("notifications");
@@ -294,21 +298,21 @@ function z1({
294
298
  const u = JSON.parse(c);
295
299
  v(
296
300
  g.filter(
297
- (i) => !i.id || !u.closed.includes(i.id)
301
+ (o) => !o.id || !u.closed.includes(o.id)
298
302
  )
299
303
  );
300
304
  } else
301
305
  v(g);
302
306
  }
303
307
  }, [g]);
304
- const M = () => {
305
- k(!m);
306
- }, O = (c) => {
307
- v(p.filter((i) => !i.id || i.id !== c));
308
+ const _ = () => {
309
+ C(!m);
310
+ }, y = (c) => {
311
+ v(p.filter((o) => !o.id || o.id !== c));
308
312
  const u = localStorage.getItem("notifications");
309
313
  if (u) {
310
- const i = JSON.parse(u);
311
- i.closed.includes(c) || (i.closed.push(c), localStorage.setItem("notifications", JSON.stringify(i)));
314
+ const o = JSON.parse(u);
315
+ o.closed.includes(c) || (o.closed.push(c), localStorage.setItem("notifications", JSON.stringify(o)));
312
316
  } else
313
317
  localStorage.setItem(
314
318
  "notifications",
@@ -319,13 +323,13 @@ function z1({
319
323
  };
320
324
  return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ s("header", { className: r.header, children: [
321
325
  p == null ? void 0 : p.map(
322
- ({ id: c, title: u, description: i, variant: C, closable: y }, P) => /* @__PURE__ */ e(
326
+ ({ id: c, title: u, description: o, variant: b, closable: O }, P) => /* @__PURE__ */ e(
323
327
  J,
324
328
  {
325
- description: i,
326
- variant: C,
327
- closable: y,
328
- onClose: () => O(c),
329
+ description: o,
330
+ variant: b,
331
+ closable: O,
332
+ onClose: () => y(c),
329
333
  children: u
330
334
  },
331
335
  P
@@ -333,29 +337,29 @@ function z1({
333
337
  ),
334
338
  /* @__PURE__ */ e("div", { className: f(r.main, r.outer), children: /* @__PURE__ */ s(j, { as: "nav", className: r.container, children: [
335
339
  /* @__PURE__ */ e(
336
- o,
340
+ i,
337
341
  {
338
342
  className: r.logo,
339
343
  href: l("https://www.highcharts.com/", a),
340
- children: /* @__PURE__ */ e(z, { showText: !_ && !w })
344
+ children: /* @__PURE__ */ e(z, { showText: !x && !w })
341
345
  }
342
346
  ),
343
- /* @__PURE__ */ e("ul", { className: r.links, children: W.map(({ title: c, url: u }, i) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
347
+ /* @__PURE__ */ e("ul", { className: r.links, children: W.map(({ title: c, url: u }, o) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
344
348
  h,
345
349
  {
346
350
  variant: "plain",
347
351
  size: 300,
348
- as: o,
352
+ as: i,
349
353
  href: l(u, a),
350
354
  children: c
351
355
  }
352
- ) }, i)) }),
356
+ ) }, o)) }),
353
357
  /* @__PURE__ */ s("div", { className: r.buttons, children: [
354
358
  /* @__PURE__ */ s(
355
359
  h,
356
360
  {
357
361
  variant: "transparent",
358
- as: o,
362
+ as: i,
359
363
  href: l(
360
364
  "https://www.highcharts.com/chat/gpt/",
361
365
  a
@@ -372,7 +376,7 @@ function z1({
372
376
  h,
373
377
  {
374
378
  variant: "brand",
375
- as: o,
379
+ as: i,
376
380
  href: l("https://shop.highcharts.com/account", a),
377
381
  "aria-label": "Login",
378
382
  children: /* @__PURE__ */ e(H, {})
@@ -382,7 +386,7 @@ function z1({
382
386
  h,
383
387
  {
384
388
  variant: "success",
385
- as: o,
389
+ as: i,
386
390
  href: l(
387
391
  "https://www.highcharts.com/download/",
388
392
  a
@@ -398,7 +402,7 @@ function z1({
398
402
  {
399
403
  variant: m ? "white" : "transparent",
400
404
  className: r.menu,
401
- onClick: M,
405
+ onClick: _,
402
406
  children: [
403
407
  m ? "Close" : "Menu",
404
408
  m ? /* @__PURE__ */ e(A, {}) : /* @__PURE__ */ e($, {})
@@ -407,14 +411,14 @@ function z1({
407
411
  )
408
412
  ] })
409
413
  ] }) }),
410
- !!(n != null && n.length) && /* @__PURE__ */ e(w1, { items: n, link: o, host: a }),
414
+ !!(n != null && n.length) && /* @__PURE__ */ e(w1, { items: n, link: i, host: a }),
411
415
  t,
412
- x && /* @__PURE__ */ s(U, { children: [
416
+ k && /* @__PURE__ */ s(U, { children: [
413
417
  /* @__PURE__ */ e(
414
418
  "div",
415
419
  {
416
420
  className: f(r.mobileOverlay, { [r.open]: m }),
417
- onClick: M
421
+ onClick: _
418
422
  }
419
423
  ),
420
424
  /* @__PURE__ */ s(
@@ -426,7 +430,7 @@ function z1({
426
430
  children: [
427
431
  /* @__PURE__ */ s("div", { className: r.container, children: [
428
432
  /* @__PURE__ */ e(
429
- o,
433
+ i,
430
434
  {
431
435
  className: r.logo,
432
436
  href: l("https://www.highcharts.com/", a),
@@ -438,7 +442,7 @@ function z1({
438
442
  h,
439
443
  {
440
444
  variant: "transparent",
441
- as: o,
445
+ as: i,
442
446
  href: l(
443
447
  "https://www.highcharts.com/chat/gpt/",
444
448
  a
@@ -459,7 +463,7 @@ function z1({
459
463
  {
460
464
  variant: "brand",
461
465
  fullWidth: !0,
462
- as: o,
466
+ as: i,
463
467
  href: l(
464
468
  "https://shop.highcharts.com/account",
465
469
  a
@@ -475,7 +479,7 @@ function z1({
475
479
  {
476
480
  variant: "success",
477
481
  fullWidth: !0,
478
- as: o,
482
+ as: i,
479
483
  href: l(
480
484
  "https://www.highcharts.com/download/",
481
485
  a
@@ -487,20 +491,20 @@ function z1({
487
491
  }
488
492
  )
489
493
  ] }),
490
- /* @__PURE__ */ e("ul", { className: r.links, children: W.map(({ title: c, url: u, icon: i }, C) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
494
+ /* @__PURE__ */ e("ul", { className: r.links, children: W.map(({ title: c, url: u, icon: o }, b) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
491
495
  h,
492
496
  {
493
497
  variant: "plain",
494
498
  size: 500,
495
499
  fullWidth: !0,
496
- as: o,
500
+ as: i,
497
501
  href: l(u, a),
498
502
  children: [
499
- i,
503
+ o,
500
504
  c
501
505
  ]
502
506
  }
503
- ) }, C)) })
507
+ ) }, b)) })
504
508
  ]
505
509
  }
506
510
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "highsoft-ui",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Highsoft UI",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",