highsoft-ui 1.0.25 → 1.0.27

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.
@@ -1,14 +1,14 @@
1
- import { jsx as e, jsxs as s, Fragment as P } from "react/jsx-runtime";
2
- import { useState as z, useEffect as V } from "react";
1
+ import { jsx as e, jsxs as s, Fragment as U } from "react/jsx-runtime";
2
+ 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 v } from "../../clsx-OuTLNxxd.js";
6
+ import { c as f } from "../../clsx-OuTLNxxd.js";
7
7
  import { Button as h } from "../Button/index.js";
8
- import { Container as y } from "../Container/index.js";
9
- import { ThemedLogo as L } from "../Logo/index.js";
8
+ import { Container as j } from "../Container/index.js";
9
+ import { ThemedLogo as z } from "../Logo/index.js";
10
10
  import { PrefPanel as S } from "../PrefPanel/index.js";
11
- import { useMediaQuery as N, useLocation as G } from "../../utils.js";
11
+ import { useMediaQuery as M, usePathname 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",
@@ -121,7 +121,7 @@ var F = function(t) {
121
121
  d: "M12 16v5m6 0-3.9514-3.2928c-.7288-.6074-1.0932-.911-1.4999-1.0271a2 2 0 0 0-1.0974 0c-.4067.1161-.7711.4197-1.4999 1.0271L6 21m2-10v1m4-3v3m4-5v5m6-9H2m1 0h18v8.2c0 1.6802 0 2.5202-.327 3.162a3 3 0 0 1-1.311 1.311C18.7202 16 17.8802 16 16.2 16H7.8c-1.6802 0-2.5202 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 13.7202 3 12.8802 3 11.2z"
122
122
  })
123
123
  }));
124
- }, T = function(t) {
124
+ }, L = function(t) {
125
125
  return /* @__PURE__ */ e("svg", d({
126
126
  xmlns: "http://www.w3.org/2000/svg",
127
127
  width: 24,
@@ -137,7 +137,7 @@ var F = function(t) {
137
137
  d: "m21 21-4.35-4.35M19 11c0 4.4183-3.5817 8-8 8s-8-3.5817-8-8 3.5817-8 8-8 8 3.5817 8 8"
138
138
  })
139
139
  }));
140
- }, B = function(t) {
140
+ }, T = function(t) {
141
141
  return /* @__PURE__ */ e("svg", d({
142
142
  xmlns: "http://www.w3.org/2000/svg",
143
143
  width: 24,
@@ -153,7 +153,7 @@ var F = function(t) {
153
153
  d: "M4.5 22v-5m0-10V2M2 4.5h5m-5 15h5M13 3l-1.7342 4.5089c-.282.7332-.423 1.0998-.6423 1.4082a3 3 0 0 1-.7064.7064c-.3084.2193-.675.3603-1.4082.6423L4 12l4.5089 1.7342c.7332.282 1.0998.423 1.4082.6423.2733.1943.5121.4331.7064.7064.2193.3084.3603.675.6423 1.4082L13 21l1.7342-4.5089c.282-.7332.423-1.0998.6423-1.4082a3 3 0 0 1 .7064-.7064c.3084-.2193.675-.3603 1.4082-.6423L22 12l-4.5089-1.7342c-.7332-.282-1.0998-.423-1.4082-.6423a3 3 0 0 1-.7064-.7064c-.2193-.3084-.3603-.675-.6423-1.4082z"
154
154
  })
155
155
  }));
156
- }, W = function(t) {
156
+ }, B = function(t) {
157
157
  return /* @__PURE__ */ e("svg", d({
158
158
  xmlns: "http://www.w3.org/2000/svg",
159
159
  width: 24,
@@ -169,7 +169,7 @@ var F = function(t) {
169
169
  d: "m7 15 3-3-3-3m6 6h4m-9.2 6h8.4c1.6802 0 2.5202 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.7202 21 17.8802 21 16.2V7.8c0-1.6802 0-2.5202-.327-3.162a3 3 0 0 0-1.311-1.311C18.7202 3 17.8802 3 16.2 3H7.8c-1.6802 0-2.5202 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.2798 3 6.1198 3 7.8v8.4c0 1.6802 0 2.5202.327 3.162a3 3 0 0 0 1.311 1.311C5.2798 21 6.1198 21 7.8 21"
170
170
  })
171
171
  }));
172
- }, H = function(t) {
172
+ }, W = function(t) {
173
173
  return /* @__PURE__ */ e("svg", d({
174
174
  xmlns: "http://www.w3.org/2000/svg",
175
175
  width: 24,
@@ -207,7 +207,7 @@ const I = "_header_1vxsz_270", K = "_outer_1vxsz_281", Y = "_main_1vxsz_290", Z
207
207
  slideUp: d1,
208
208
  sub: u1,
209
209
  gpt: m1
210
- }, j = [
210
+ }, H = [
211
211
  {
212
212
  title: "Products",
213
213
  url: "https://highcharts.com/products/",
@@ -248,28 +248,27 @@ function w1({
248
248
  host: p = "https://www.highcharts.com"
249
249
  }) {
250
250
  const i = G();
251
- return /* @__PURE__ */ e("div", { className: v(r.sub, r.outer), children: /* @__PURE__ */ e(y, { className: r.subContainer, as: "ul", children: n.map(({ title: a, url: f, icon: C, tag: x, tagVariant: m = "success" }, b) => {
252
- const w = l(f, p);
253
- let g = !1;
254
- if (typeof window < "u" && i) {
255
- const _ = window.location.origin, k = new URL(w, _);
256
- g = (f.startsWith("/") || k.origin === _) && k.pathname === i.pathname;
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) => {
252
+ let w = !1;
253
+ if (typeof window < "u") {
254
+ const v = window.location.origin, _ = new URL(g, v);
255
+ w = (g.startsWith("/") || _.origin === v) && _.pathname === i;
257
256
  }
258
257
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
259
258
  t,
260
259
  {
261
- href: w,
262
- className: v({
263
- [r.selected]: g
260
+ href: l(g, p),
261
+ className: f({
262
+ [r.selected]: w
264
263
  }),
265
264
  children: [
266
- C,
265
+ k,
267
266
  /* @__PURE__ */ s("span", { children: [
268
267
  a,
269
268
  x && /* @__PURE__ */ e(
270
269
  "span",
271
270
  {
272
- className: v(
271
+ className: f(
273
272
  r.subTag,
274
273
  r[`subTag-${m}`]
275
274
  ),
@@ -279,7 +278,7 @@ function w1({
279
278
  ] })
280
279
  ]
281
280
  }
282
- ) }, b);
281
+ ) }, C);
283
282
  }) }) });
284
283
  }
285
284
  function z1({
@@ -290,25 +289,25 @@ function z1({
290
289
  link: i = "a",
291
290
  host: a = "https://www.highcharts.com"
292
291
  }) {
293
- const f = N("(max-width: 374px)"), C = N("(max-width: 849px)"), x = N("(min-width: 850px) and (max-width: 999px)"), [m, b] = z(!1), [w, g] = z([]);
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([]);
294
293
  V(() => {
295
294
  if (p.length) {
296
295
  const c = localStorage.getItem("notifications");
297
296
  if (c) {
298
297
  const u = JSON.parse(c);
299
- g(
298
+ v(
300
299
  p.filter(
301
300
  (o) => !o.id || !u.closed.includes(o.id)
302
301
  )
303
302
  );
304
303
  } else
305
- g(p);
304
+ v(p);
306
305
  }
307
306
  }, [p]);
308
307
  const _ = () => {
309
- b(!m);
310
- }, k = (c) => {
311
- g(w.filter((o) => !o.id || o.id !== c));
308
+ C(!m);
309
+ }, y = (c) => {
310
+ v(w.filter((o) => !o.id || o.id !== c));
312
311
  const u = localStorage.getItem("notifications");
313
312
  if (u) {
314
313
  const o = JSON.parse(u);
@@ -323,28 +322,28 @@ function z1({
323
322
  };
324
323
  return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ s("header", { className: r.header, children: [
325
324
  w == null ? void 0 : w.map(
326
- ({ id: c, title: u, description: o, variant: M, closable: O }, U) => /* @__PURE__ */ e(
325
+ ({ id: c, title: u, description: o, variant: b, closable: O }, P) => /* @__PURE__ */ e(
327
326
  J,
328
327
  {
329
328
  description: o,
330
- variant: M,
329
+ variant: b,
331
330
  closable: O,
332
- onClose: () => k(c),
331
+ onClose: () => y(c),
333
332
  children: u
334
333
  },
335
- U
334
+ P
336
335
  )
337
336
  ),
338
- /* @__PURE__ */ e("div", { className: v(r.main, r.outer), children: /* @__PURE__ */ s(y, { as: "nav", className: r.container, children: [
337
+ /* @__PURE__ */ e("div", { className: f(r.main, r.outer), children: /* @__PURE__ */ s(j, { as: "nav", className: r.container, children: [
339
338
  /* @__PURE__ */ e(
340
339
  i,
341
340
  {
342
341
  className: r.logo,
343
342
  href: l("https://www.highcharts.com/", a),
344
- children: /* @__PURE__ */ e(L, { showText: !x && !f })
343
+ children: /* @__PURE__ */ e(z, { showText: !x && !g })
345
344
  }
346
345
  ),
347
- /* @__PURE__ */ e("ul", { className: r.links, children: j.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 }, o) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
348
347
  h,
349
348
  {
350
349
  variant: "plain",
@@ -366,11 +365,11 @@ function z1({
366
365
  ),
367
366
  children: [
368
367
  /* @__PURE__ */ e("span", { className: r.gpt, children: "Highcharts GPT" }),
369
- /* @__PURE__ */ e(B, {})
368
+ /* @__PURE__ */ e(T, {})
370
369
  ]
371
370
  }
372
371
  ),
373
- /* @__PURE__ */ e(h, { variant: "transparent", "aria-label": "Search", children: /* @__PURE__ */ e(T, {}) }),
372
+ /* @__PURE__ */ e(h, { variant: "transparent", "aria-label": "Search", children: /* @__PURE__ */ e(L, {}) }),
374
373
  /* @__PURE__ */ e(S, {}),
375
374
  /* @__PURE__ */ e(
376
375
  h,
@@ -379,7 +378,7 @@ function z1({
379
378
  as: i,
380
379
  href: l("https://shop.highcharts.com/account", a),
381
380
  "aria-label": "Login",
382
- children: /* @__PURE__ */ e(H, {})
381
+ children: /* @__PURE__ */ e(W, {})
383
382
  }
384
383
  ),
385
384
  /* @__PURE__ */ s(
@@ -392,7 +391,7 @@ function z1({
392
391
  a
393
392
  ),
394
393
  children: [
395
- /* @__PURE__ */ e(W, {}),
394
+ /* @__PURE__ */ e(B, {}),
396
395
  "Get started"
397
396
  ]
398
397
  }
@@ -413,18 +412,18 @@ function z1({
413
412
  ] }) }),
414
413
  !!(n != null && n.length) && /* @__PURE__ */ e(w1, { items: n, link: i, host: a }),
415
414
  t,
416
- C && /* @__PURE__ */ s(P, { children: [
415
+ k && /* @__PURE__ */ s(U, { children: [
417
416
  /* @__PURE__ */ e(
418
417
  "div",
419
418
  {
420
- className: v(r.mobileOverlay, { [r.open]: m }),
419
+ className: f(r.mobileOverlay, { [r.open]: m }),
421
420
  onClick: _
422
421
  }
423
422
  ),
424
423
  /* @__PURE__ */ s(
425
424
  "nav",
426
425
  {
427
- className: v(r.mobile, {
426
+ className: f(r.mobile, {
428
427
  [r.open]: m
429
428
  }),
430
429
  children: [
@@ -434,7 +433,7 @@ function z1({
434
433
  {
435
434
  className: r.logo,
436
435
  href: l("https://www.highcharts.com/", a),
437
- children: /* @__PURE__ */ e(L, { showText: !f })
436
+ children: /* @__PURE__ */ e(z, { showText: !g })
438
437
  }
439
438
  ),
440
439
  /* @__PURE__ */ s("div", { className: r.buttons, children: [
@@ -449,11 +448,11 @@ function z1({
449
448
  ),
450
449
  children: [
451
450
  /* @__PURE__ */ e("span", { className: r.gpt, children: "Highcharts GPT" }),
452
- /* @__PURE__ */ e(B, {})
451
+ /* @__PURE__ */ e(T, {})
453
452
  ]
454
453
  }
455
454
  ),
456
- /* @__PURE__ */ e(h, { variant: "transparent", "aria-label": "Search", children: /* @__PURE__ */ e(T, {}) }),
455
+ /* @__PURE__ */ e(h, { variant: "transparent", "aria-label": "Search", children: /* @__PURE__ */ e(L, {}) }),
457
456
  /* @__PURE__ */ e(S, {})
458
457
  ] })
459
458
  ] }),
@@ -469,7 +468,7 @@ function z1({
469
468
  a
470
469
  ),
471
470
  children: [
472
- /* @__PURE__ */ e(H, {}),
471
+ /* @__PURE__ */ e(W, {}),
473
472
  "Login"
474
473
  ]
475
474
  }
@@ -485,13 +484,13 @@ function z1({
485
484
  a
486
485
  ),
487
486
  children: [
488
- /* @__PURE__ */ e(W, {}),
487
+ /* @__PURE__ */ e(B, {}),
489
488
  "Get started"
490
489
  ]
491
490
  }
492
491
  )
493
492
  ] }),
494
- /* @__PURE__ */ e("ul", { className: r.links, children: j.map(({ title: c, url: u, icon: o }, M) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
493
+ /* @__PURE__ */ e("ul", { className: r.links, children: H.map(({ title: c, url: u, icon: o }, b) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
495
494
  h,
496
495
  {
497
496
  variant: "plain",
@@ -504,7 +503,7 @@ function z1({
504
503
  c
505
504
  ]
506
505
  }
507
- ) }, M)) })
506
+ ) }, b)) })
508
507
  ]
509
508
  }
510
509
  )
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { Location } from 'history';
2
1
  export declare function useMediaQuery(query: string): boolean;
3
2
  export declare function useMounted(): boolean;
4
- export declare function useLocation(): Location | undefined;
3
+ export declare function usePathname(): string;
package/dist/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { _ as $ } from "./extends-hS2Bh-Yp.js";
2
- import { useState as P, useEffect as k } from "react";
2
+ import { useState as E, useEffect as k } from "react";
3
3
  var p;
4
4
  (function(n) {
5
5
  n.Pop = "POP", n.Push = "PUSH", n.Replace = "REPLACE";
@@ -23,9 +23,9 @@ function z(n) {
23
23
  n === void 0 && (n = {});
24
24
  var o = n, a = o.window, r = a === void 0 ? document.defaultView : a, i = r.history;
25
25
  function f() {
26
- var t = r.location, e = t.pathname, c = t.search, l = t.hash, u = i.state || {};
26
+ var e = r.location, t = e.pathname, c = e.search, l = e.hash, u = i.state || {};
27
27
  return [u.idx, A({
28
- pathname: e,
28
+ pathname: t,
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 t = p.Pop, e = f(), c = e[0], l = e[1];
40
+ var e = p.Pop, t = f(), c = t[0], l = t[1];
41
41
  if (d.length)
42
42
  if (c != null) {
43
43
  var u = h - c;
44
44
  u && (s = {
45
- action: t,
45
+ action: e,
46
46
  location: l,
47
47
  retry: function() {
48
48
  y(u * -1);
@@ -57,83 +57,83 @@ 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(t);
60
+ b(e);
61
61
  }
62
62
  }
63
63
  r.addEventListener(j, D);
64
- var m = p.Pop, L = f(), h = L[0], g = L[1], x = B(), d = B();
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(t) {
69
- return typeof t == "string" ? t : K(t);
68
+ function O(e) {
69
+ return typeof e == "string" ? e : K(e);
70
70
  }
71
- function S(t, e) {
72
- return e === void 0 && (e = null), A($({
73
- pathname: g.pathname,
71
+ function S(e, t) {
72
+ return t === void 0 && (t = null), A($({
73
+ pathname: m.pathname,
74
74
  hash: "",
75
75
  search: ""
76
- }, typeof t == "string" ? Q(t) : t, {
77
- state: e,
76
+ }, typeof e == "string" ? Q(e) : e, {
77
+ state: t,
78
78
  key: C()
79
79
  }));
80
80
  }
81
- function _(t, e) {
81
+ function _(e, t) {
82
82
  return [{
83
- usr: t.state,
84
- key: t.key,
85
- idx: e
86
- }, O(t)];
83
+ usr: e.state,
84
+ key: e.key,
85
+ idx: t
86
+ }, O(e)];
87
87
  }
88
- function M(t, e, c) {
88
+ function M(e, t, c) {
89
89
  return !d.length || (d.call({
90
- action: t,
91
- location: e,
90
+ action: e,
91
+ location: t,
92
92
  retry: c
93
93
  }), !1);
94
94
  }
95
- function b(t) {
96
- m = t;
97
- var e = f();
98
- h = e[0], g = e[1], x.call({
99
- action: m,
100
- location: g
95
+ function b(e) {
96
+ w = e;
97
+ var t = f();
98
+ h = t[0], m = t[1], L.call({
99
+ action: w,
100
+ location: m
101
101
  });
102
102
  }
103
- function T(t, e) {
104
- var c = p.Push, l = S(t, e);
103
+ function T(e, t) {
104
+ var c = p.Push, l = S(e, t);
105
105
  function u() {
106
- T(t, e);
106
+ T(e, t);
107
107
  }
108
108
  if (M(c, l, u)) {
109
- var v = _(l, h + 1), E = v[0], w = v[1];
109
+ var v = _(l, h + 1), P = v[0], g = v[1];
110
110
  try {
111
- i.pushState(E, "", w);
111
+ i.pushState(P, "", g);
112
112
  } catch {
113
- r.location.assign(w);
113
+ r.location.assign(g);
114
114
  }
115
115
  b(c);
116
116
  }
117
117
  }
118
- function N(t, e) {
119
- var c = p.Replace, l = S(t, e);
118
+ function N(e, t) {
119
+ var c = p.Replace, l = S(e, t);
120
120
  function u() {
121
- N(t, e);
121
+ N(e, t);
122
122
  }
123
123
  if (M(c, l, u)) {
124
- var v = _(l, h), E = v[0], w = v[1];
125
- i.replaceState(E, "", w), b(c);
124
+ var v = _(l, h), P = v[0], g = v[1];
125
+ i.replaceState(P, "", g), b(c);
126
126
  }
127
127
  }
128
- function y(t) {
129
- i.go(t);
128
+ function y(e) {
129
+ i.go(e);
130
130
  }
131
131
  var R = {
132
132
  get action() {
133
- return m;
133
+ return w;
134
134
  },
135
135
  get location() {
136
- return g;
136
+ return m;
137
137
  },
138
138
  createHref: O,
139
139
  push: T,
@@ -145,11 +145,11 @@ function z(n) {
145
145
  forward: function() {
146
146
  y(1);
147
147
  },
148
- listen: function(e) {
149
- return x.push(e);
148
+ listen: function(t) {
149
+ return L.push(t);
150
150
  },
151
- block: function(e) {
152
- var c = d.push(e);
151
+ block: function(t) {
152
+ var c = d.push(t);
153
153
  return d.length === 1 && r.addEventListener(H, V), function() {
154
154
  c(), d.length || r.removeEventListener(H, V);
155
155
  };
@@ -198,7 +198,7 @@ function Q(n) {
198
198
  return o;
199
199
  }
200
200
  function J(n) {
201
- const [o, a] = P(!1);
201
+ const [o, a] = E(!1);
202
202
  return k(() => {
203
203
  const r = window.matchMedia(n);
204
204
  a(r.matches);
@@ -209,19 +209,22 @@ function J(n) {
209
209
  }, [n]), o;
210
210
  }
211
211
  function W() {
212
- const [n, o] = P(!1);
212
+ const [n, o] = E(!1);
213
213
  return k(() => {
214
214
  o(!0);
215
215
  }, []), n;
216
216
  }
217
217
  function X() {
218
- const [n, o] = P();
219
- return k(() => z().listen(({ location: r }) => {
220
- o(r);
221
- }), []), n;
218
+ const [n, o] = E("");
219
+ return k(() => {
220
+ const a = z();
221
+ return o(a.location.pathname), a.listen(({ location: r }) => {
222
+ o(r.pathname);
223
+ });
224
+ }, []), n;
222
225
  }
223
226
  export {
224
- X as useLocation,
225
227
  J as useMediaQuery,
226
- W as useMounted
228
+ W as useMounted,
229
+ X as usePathname
227
230
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "highsoft-ui",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Highsoft UI",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",