highsoft-ui 1.0.39 → 1.0.41

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.
@@ -4,6 +4,7 @@ export interface SubHeaderItem {
4
4
  title: string;
5
5
  url: string;
6
6
  icon?: ReactNode;
7
+ selectedIcon?: ReactNode;
7
8
  tag?: ReactNode;
8
9
  tagVariant?: 'success' | 'brand';
9
10
  }
@@ -3,11 +3,11 @@ import { useState as N, useEffect as z } from "react";
3
3
  import { J } from "../../index-CMegByeX.js";
4
4
  import { _ as d, B as h } from "../../index-BIyJbk_U.js";
5
5
  import { N as A, X as G } from "../../index-C5TH1DPz.js";
6
- import { c as g } from "../../clsx-OuTLNxxd.js";
6
+ import { c as v } from "../../clsx-OuTLNxxd.js";
7
7
  import { Container as y } from "../Container/index.js";
8
8
  import { ThemedLogo as q } from "../Logo/index.js";
9
9
  import { PrefPanel as S } from "../PrefPanel/index.js";
10
- import { useMediaQuery as j } from "../../utils.js";
10
+ import { useMediaQuery as M } from "../../utils.js";
11
11
  var F = function(t) {
12
12
  return /* @__PURE__ */ e("svg", d({
13
13
  xmlns: "http://www.w3.org/2000/svg",
@@ -209,7 +209,7 @@ const I = "_header_1jacq_270", K = "_outer_1jacq_281", Y = "_main_1jacq_290", Z
209
209
  }, W = [
210
210
  {
211
211
  title: "Products",
212
- url: "https://highcharts.com/products/",
212
+ url: "https://www.highcharts.com/products/",
213
213
  icon: /* @__PURE__ */ e(R, {})
214
214
  },
215
215
  {
@@ -247,34 +247,36 @@ function w1({
247
247
  host: p = "https://www.highcharts.com",
248
248
  pathname: a = typeof window < "u" ? window.location.pathname : ""
249
249
  }) {
250
- return /* @__PURE__ */ e("div", { className: g(n.sub, n.outer), children: /* @__PURE__ */ e(y, { className: n.subContainer, as: "ul", children: r.map(({ title: i, url: f, icon: _, tag: k, tagVariant: b = "success" }, m) => {
251
- const C = typeof window < "u" && window.location.origin || "http://example.com", w = new URL(f, C), v = w.origin === C && w.pathname === a;
252
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
253
- t,
254
- {
255
- href: l(f, p),
256
- className: g({
257
- [n.selected]: v
258
- }),
259
- children: [
260
- _,
261
- /* @__PURE__ */ o("span", { children: [
262
- i,
263
- k && /* @__PURE__ */ e(
264
- "span",
265
- {
266
- className: g(
267
- n.subTag,
268
- n[`subTag-${b}`]
269
- ),
270
- children: k
271
- }
272
- )
273
- ] })
274
- ]
275
- }
276
- ) }, m);
277
- }) }) });
250
+ return /* @__PURE__ */ e("div", { className: v(n.sub, n.outer), children: /* @__PURE__ */ e(y, { className: n.subContainer, as: "ul", children: r.map(
251
+ ({ title: i, url: _, icon: k, selectedIcon: b, tag: C, tagVariant: m = "success" }, x) => {
252
+ const w = typeof window < "u" && window.location.origin || "http://example.com", g = new URL(_, w), f = g.origin === w && g.pathname === a;
253
+ return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
254
+ t,
255
+ {
256
+ href: l(_, p),
257
+ className: v({
258
+ [n.selected]: f
259
+ }),
260
+ children: [
261
+ f && b || k,
262
+ /* @__PURE__ */ o("span", { children: [
263
+ i,
264
+ C && /* @__PURE__ */ e(
265
+ "span",
266
+ {
267
+ className: v(
268
+ n.subTag,
269
+ n[`subTag-${m}`]
270
+ ),
271
+ children: C
272
+ }
273
+ )
274
+ ] })
275
+ ]
276
+ }
277
+ ) }, x);
278
+ }
279
+ ) }) });
278
280
  }
279
281
  function M1({
280
282
  subItems: r,
@@ -283,27 +285,27 @@ function M1({
283
285
  // TODO: Fetch these from the internets
284
286
  link: a = "a",
285
287
  host: i = "https://www.highcharts.com",
286
- pathname: f = typeof window < "u" ? window.location.pathname : ""
288
+ pathname: _ = typeof window < "u" ? window.location.pathname : ""
287
289
  }) {
288
- const _ = j("(max-width: 374px)"), k = j("(max-width: 849px)"), b = j("(min-width: 850px) and (max-width: 999px)"), [m, C] = N(!1), [w, v] = N([]);
290
+ const k = M("(max-width: 374px)"), b = M("(max-width: 849px)"), C = M("(min-width: 850px) and (max-width: 999px)"), [m, x] = N(!1), [w, g] = N([]);
289
291
  z(() => {
290
292
  if (p.length) {
291
293
  const c = localStorage.getItem("notifications");
292
294
  if (c) {
293
295
  const u = JSON.parse(c);
294
- v(
296
+ g(
295
297
  p.filter(
296
298
  (s) => !s.id || !u.closed.includes(s.id)
297
299
  )
298
300
  );
299
301
  } else
300
- v(p);
302
+ g(p);
301
303
  }
302
304
  }, [p]);
303
- const M = () => {
304
- C(!m);
305
+ const f = () => {
306
+ x(!m);
305
307
  }, O = (c) => {
306
- v(w.filter((s) => !s.id || s.id !== c));
308
+ g(w.filter((s) => !s.id || s.id !== c));
307
309
  const u = localStorage.getItem("notifications");
308
310
  if (u) {
309
311
  const s = JSON.parse(u);
@@ -318,11 +320,11 @@ function M1({
318
320
  };
319
321
  return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ o("header", { className: n.header, children: [
320
322
  w == null ? void 0 : w.map(
321
- ({ id: c, title: u, description: s, variant: x, closable: P }, U) => /* @__PURE__ */ e(
323
+ ({ id: c, title: u, description: s, variant: j, closable: P }, U) => /* @__PURE__ */ e(
322
324
  A,
323
325
  {
324
326
  description: s,
325
- variant: x,
327
+ variant: j,
326
328
  closable: P,
327
329
  onClose: () => O(c),
328
330
  children: u
@@ -330,13 +332,13 @@ function M1({
330
332
  U
331
333
  )
332
334
  ),
333
- /* @__PURE__ */ e("div", { className: g(n.main, n.outer), children: /* @__PURE__ */ o(y, { as: "nav", className: n.container, children: [
335
+ /* @__PURE__ */ e("div", { className: v(n.main, n.outer), children: /* @__PURE__ */ o(y, { as: "nav", className: n.container, children: [
334
336
  /* @__PURE__ */ e(
335
337
  a,
336
338
  {
337
339
  className: n.logo,
338
340
  href: l("https://www.highcharts.com/", i),
339
- children: /* @__PURE__ */ e(q, { showText: !b && !_ })
341
+ children: /* @__PURE__ */ e(q, { showText: !C && !k })
340
342
  }
341
343
  ),
342
344
  /* @__PURE__ */ e("ul", { className: n.links, children: W.map(({ title: c, url: u }, s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
@@ -397,7 +399,7 @@ function M1({
397
399
  {
398
400
  variant: m ? "white" : "transparent",
399
401
  className: n.menu,
400
- onClick: M,
402
+ onClick: f,
401
403
  children: [
402
404
  m ? "Close" : "Menu",
403
405
  m ? /* @__PURE__ */ e(G, {}) : /* @__PURE__ */ e($, {})
@@ -412,22 +414,22 @@ function M1({
412
414
  items: r,
413
415
  link: a,
414
416
  host: i,
415
- pathname: f
417
+ pathname: _
416
418
  }
417
419
  ),
418
420
  t,
419
- k && /* @__PURE__ */ o(V, { children: [
421
+ b && /* @__PURE__ */ o(V, { children: [
420
422
  /* @__PURE__ */ e(
421
423
  "div",
422
424
  {
423
- className: g(n.mobileOverlay, { [n.open]: m }),
424
- onClick: M
425
+ className: v(n.mobileOverlay, { [n.open]: m }),
426
+ onClick: f
425
427
  }
426
428
  ),
427
429
  /* @__PURE__ */ o(
428
430
  "nav",
429
431
  {
430
- className: g(n.mobile, {
432
+ className: v(n.mobile, {
431
433
  [n.open]: m
432
434
  }),
433
435
  children: [
@@ -437,7 +439,7 @@ function M1({
437
439
  {
438
440
  className: n.logo,
439
441
  href: l("https://www.highcharts.com/", i),
440
- children: /* @__PURE__ */ e(q, { showText: !_ })
442
+ children: /* @__PURE__ */ e(q, { showText: !k })
441
443
  }
442
444
  ),
443
445
  /* @__PURE__ */ o("div", { className: n.buttons, children: [
@@ -494,7 +496,7 @@ function M1({
494
496
  }
495
497
  )
496
498
  ] }),
497
- /* @__PURE__ */ e("ul", { className: n.links, children: W.map(({ title: c, url: u, icon: s }, x) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
499
+ /* @__PURE__ */ e("ul", { className: n.links, children: W.map(({ title: c, url: u, icon: s }, j) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
498
500
  h,
499
501
  {
500
502
  variant: "plain",
@@ -507,7 +509,7 @@ function M1({
507
509
  c
508
510
  ]
509
511
  }
510
- ) }, x)) })
512
+ ) }, j)) })
511
513
  ]
512
514
  }
513
515
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "highsoft-ui",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Highsoft UI",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",