highsoft-ui 1.0.25 → 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.
@@ -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 _ } 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/",
@@ -245,31 +245,30 @@ 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: 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;
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
+ let w = !1;
253
+ if (typeof window < "u") {
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;
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(v, g),
261
+ className: _({
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: _(
273
272
  r.subTag,
274
273
  r[`subTag-${m}`]
275
274
  ),
@@ -279,40 +278,40 @@ function w1({
279
278
  ] })
280
279
  ]
281
280
  }
282
- ) }, b);
281
+ ) }, C);
283
282
  }) }) });
284
283
  }
285
284
  function z1({
286
285
  subItems: n,
287
286
  children: t,
288
- notifications: p = [],
287
+ notifications: g = [],
289
288
  // TODO: Fetch these from the internets
290
- link: i = "a",
289
+ link: o = "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 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([]);
294
293
  V(() => {
295
- if (p.length) {
294
+ if (g.length) {
296
295
  const c = localStorage.getItem("notifications");
297
296
  if (c) {
298
297
  const u = JSON.parse(c);
299
- g(
300
- p.filter(
301
- (o) => !o.id || !u.closed.includes(o.id)
298
+ p(
299
+ g.filter(
300
+ (i) => !i.id || !u.closed.includes(i.id)
302
301
  )
303
302
  );
304
303
  } else
305
- g(p);
304
+ p(g);
306
305
  }
307
- }, [p]);
308
- const _ = () => {
309
- b(!m);
310
- }, k = (c) => {
311
- g(w.filter((o) => !o.id || o.id !== c));
306
+ }, [g]);
307
+ const f = () => {
308
+ C(!m);
309
+ }, y = (c) => {
310
+ p(w.filter((i) => !i.id || i.id !== c));
312
311
  const u = localStorage.getItem("notifications");
313
312
  if (u) {
314
- const o = JSON.parse(u);
315
- 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)));
316
315
  } else
317
316
  localStorage.setItem(
318
317
  "notifications",
@@ -323,76 +322,76 @@ 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: i, variant: b, closable: O }, P) => /* @__PURE__ */ e(
327
326
  J,
328
327
  {
329
- description: o,
330
- variant: M,
328
+ description: i,
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: _(r.main, r.outer), children: /* @__PURE__ */ s(j, { as: "nav", className: r.container, children: [
339
338
  /* @__PURE__ */ e(
340
- i,
339
+ o,
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 && !v })
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 }, i) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
348
347
  h,
349
348
  {
350
349
  variant: "plain",
351
350
  size: 300,
352
- as: i,
351
+ as: o,
353
352
  href: l(u, a),
354
353
  children: c
355
354
  }
356
- ) }, o)) }),
355
+ ) }, i)) }),
357
356
  /* @__PURE__ */ s("div", { className: r.buttons, children: [
358
357
  /* @__PURE__ */ s(
359
358
  h,
360
359
  {
361
360
  variant: "transparent",
362
- as: i,
361
+ as: o,
363
362
  href: l(
364
363
  "https://www.highcharts.com/chat/gpt/",
365
364
  a
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,
377
376
  {
378
377
  variant: "brand",
379
- as: i,
378
+ as: o,
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(
386
385
  h,
387
386
  {
388
387
  variant: "success",
389
- as: i,
388
+ as: o,
390
389
  href: l(
391
390
  "https://www.highcharts.com/download/",
392
391
  a
393
392
  ),
394
393
  children: [
395
- /* @__PURE__ */ e(W, {}),
394
+ /* @__PURE__ */ e(B, {}),
396
395
  "Get started"
397
396
  ]
398
397
  }
@@ -402,7 +401,7 @@ function z1({
402
401
  {
403
402
  variant: m ? "white" : "transparent",
404
403
  className: r.menu,
405
- onClick: _,
404
+ onClick: f,
406
405
  children: [
407
406
  m ? "Close" : "Menu",
408
407
  m ? /* @__PURE__ */ e(A, {}) : /* @__PURE__ */ e($, {})
@@ -411,30 +410,30 @@ function z1({
411
410
  )
412
411
  ] })
413
412
  ] }) }),
414
- !!(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 }),
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 }),
421
- onClick: _
419
+ className: _(r.mobileOverlay, { [r.open]: m }),
420
+ onClick: f
422
421
  }
423
422
  ),
424
423
  /* @__PURE__ */ s(
425
424
  "nav",
426
425
  {
427
- className: v(r.mobile, {
426
+ className: _(r.mobile, {
428
427
  [r.open]: m
429
428
  }),
430
429
  children: [
431
430
  /* @__PURE__ */ s("div", { className: r.container, children: [
432
431
  /* @__PURE__ */ e(
433
- i,
432
+ o,
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: !v })
438
437
  }
439
438
  ),
440
439
  /* @__PURE__ */ s("div", { className: r.buttons, children: [
@@ -442,18 +441,18 @@ function z1({
442
441
  h,
443
442
  {
444
443
  variant: "transparent",
445
- as: i,
444
+ as: o,
446
445
  href: l(
447
446
  "https://www.highcharts.com/chat/gpt/",
448
447
  a
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
  ] }),
@@ -463,13 +462,13 @@ function z1({
463
462
  {
464
463
  variant: "brand",
465
464
  fullWidth: !0,
466
- as: i,
465
+ as: o,
467
466
  href: l(
468
467
  "https://shop.highcharts.com/account",
469
468
  a
470
469
  ),
471
470
  children: [
472
- /* @__PURE__ */ e(H, {}),
471
+ /* @__PURE__ */ e(W, {}),
473
472
  "Login"
474
473
  ]
475
474
  }
@@ -479,32 +478,32 @@ function z1({
479
478
  {
480
479
  variant: "success",
481
480
  fullWidth: !0,
482
- as: i,
481
+ as: o,
483
482
  href: l(
484
483
  "https://www.highcharts.com/download/",
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: i }, b) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
495
494
  h,
496
495
  {
497
496
  variant: "plain",
498
497
  size: 500,
499
498
  fullWidth: !0,
500
- as: i,
499
+ as: o,
501
500
  href: l(u, a),
502
501
  children: [
503
- o,
502
+ i,
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,15 +1,15 @@
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
- (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 t = r.location, e = t.pathname, c = t.search, l = t.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: e,
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 t = p.Pop, e = f(), c = e[0], l = e[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: t,
45
+ action: n,
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(n);
61
61
  }
62
62
  }
63
- r.addEventListener(j, D);
64
- var m = p.Pop, L = f(), h = L[0], g = L[1], x = B(), d = B();
63
+ t.addEventListener(j, D);
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(n) {
69
+ return typeof n == "string" ? n : K(n);
70
70
  }
71
- function S(t, e) {
72
- return e === void 0 && (e = null), A($({
73
- pathname: g.pathname,
71
+ function S(n, r) {
72
+ return r === void 0 && (r = null), A($({
73
+ pathname: m.pathname,
74
74
  hash: "",
75
75
  search: ""
76
- }, typeof t == "string" ? Q(t) : t, {
77
- state: e,
76
+ }, typeof n == "string" ? Q(n) : n, {
77
+ state: r,
78
78
  key: C()
79
79
  }));
80
80
  }
81
- function _(t, e) {
81
+ function _(n, r) {
82
82
  return [{
83
- usr: t.state,
84
- key: t.key,
85
- idx: e
86
- }, O(t)];
83
+ usr: n.state,
84
+ key: n.key,
85
+ idx: r
86
+ }, O(n)];
87
87
  }
88
- function M(t, e, c) {
88
+ function M(n, r, c) {
89
89
  return !d.length || (d.call({
90
- action: t,
91
- location: e,
90
+ action: n,
91
+ location: r,
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(n) {
96
+ w = n;
97
+ var r = f();
98
+ h = r[0], m = r[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(n, r) {
104
+ var c = p.Push, l = S(n, r);
105
105
  function u() {
106
- T(t, e);
106
+ T(n, r);
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
+ t.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(n, r) {
119
+ var c = p.Replace, l = S(n, r);
120
120
  function u() {
121
- N(t, e);
121
+ N(n, r);
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(n) {
129
+ i.go(n);
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,37 +145,37 @@ 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(r) {
149
+ return L.push(r);
150
150
  },
151
- block: function(e) {
152
- var c = d.push(e);
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,48 @@ 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) {
201
- const [o, a] = P(!1);
200
+ function J(e) {
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] = P(!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] = P();
219
- return k(() => z().listen(({ location: r }) => {
220
- o(r);
221
- }), []), n;
218
+ const [e, o] = E("");
219
+ return k(() => {
220
+ const a = z();
221
+ return o(a.location.pathname), a.listen(({ location: t }) => {
222
+ console.log("listener", t.pathname), o(t.pathname);
223
+ });
224
+ }, []), e;
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.28",
4
4
  "description": "Highsoft UI",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",