highsoft-ui 1.0.11 → 1.0.13

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,47 +1,47 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as l } from "react";
3
- import { c as u } from "../../clsx-OuTLNxxd.js";
4
- const j = "_button_57js8_293", z = "_neutral_57js8_335", f = "_white_57js8_359", p = "_transparent_57js8_383", b = "_plain_57js8_407", d = "_brand_57js8_431", m = "_success_57js8_455", w = "_attention_57js8_479", g = "_danger_57js8_503", h = "_full_57js8_629", s = {
5
- button: j,
2
+ import { forwardRef as w } from "react";
3
+ import { c as l } from "../../clsx-OuTLNxxd.js";
4
+ const u = "_button_1we8s_285", z = "_neutral_1we8s_327", f = "_white_1we8s_351", p = "_transparent_1we8s_375", b = "_plain_1we8s_399", d = "_brand_1we8s_423", m = "_success_1we8s_447", g = "_attention_1we8s_471", h = "_danger_1we8s_495", x = "_full_1we8s_621", s = {
5
+ button: u,
6
6
  neutral: z,
7
7
  white: f,
8
8
  transparent: p,
9
9
  plain: b,
10
10
  brand: d,
11
11
  success: m,
12
- attention: w,
13
- danger: g,
14
- "size-50": "_size-50_57js8_527",
15
- "size-100": "_size-100_57js8_544",
16
- "size-200": "_size-200_57js8_561",
17
- "size-300": "_size-300_57js8_578",
18
- "size-400": "_size-400_57js8_595",
19
- "size-500": "_size-500_57js8_612",
20
- full: h
21
- }, N = l(
12
+ attention: g,
13
+ danger: h,
14
+ "size-50": "_size-50_1we8s_519",
15
+ "size-100": "_size-100_1we8s_536",
16
+ "size-200": "_size-200_1we8s_553",
17
+ "size-300": "_size-300_1we8s_570",
18
+ "size-400": "_size-400_1we8s_587",
19
+ "size-500": "_size-500_1we8s_604",
20
+ full: x
21
+ }, N = w(
22
22
  ({
23
- children: t,
24
- variant: _ = "neutral",
25
- size: n = 200,
26
- fullWidth: e = !1,
23
+ children: e,
24
+ variant: t = "neutral",
25
+ size: _ = 200,
26
+ fullWidth: n = !1,
27
27
  as: o = "button",
28
28
  className: a,
29
29
  ...r
30
30
  }, i) => /* @__PURE__ */ c(
31
31
  o,
32
32
  {
33
- className: u(
33
+ className: l(
34
34
  a,
35
35
  s.button,
36
- s[_],
37
- s[`size-${n}`],
36
+ s[t],
37
+ s[`size-${_}`],
38
38
  {
39
- [s.full]: e
39
+ [s.full]: n
40
40
  }
41
41
  ),
42
42
  ref: i,
43
43
  ...r,
44
- children: t
44
+ children: e
45
45
  }
46
46
  )
47
47
  );
@@ -1,9 +1,9 @@
1
1
  import { jsx as n, jsxs as l } from "react/jsx-runtime";
2
- import { useRef as y, useState as g, useLayoutEffect as b } from "react";
3
- import { c as f } from "../../clsx-OuTLNxxd.js";
4
- import x from "../icons/Bubble.js";
2
+ import { useRef as y, useState as b, useLayoutEffect as x } from "react";
3
+ import { c as h } from "../../clsx-OuTLNxxd.js";
4
+ import g from "../icons/Bubble.js";
5
5
  import C from "../icons/Plane.js";
6
- const v = "_inputContainer_1hfog_293", S = "_bottomFade_1hfog_296", K = "_inputWrap_1hfog_299", P = "_textarea_1hfog_302", N = "_button_1hfog_368", W = "_primary_1hfog_403", k = "_secondary_1hfog_412", D = "_disclaimer_1hfog_418", o = {
6
+ const v = "_inputContainer_h08to_285", S = "_bottomFade_h08to_288", K = "_inputWrap_h08to_291", P = "_textarea_h08to_294", N = "_button_h08to_360", W = "_primary_h08to_395", k = "_secondary_h08to_404", D = "_disclaimer_h08to_410", o = {
7
7
  inputContainer: v,
8
8
  bottomFade: S,
9
9
  inputWrap: K,
@@ -22,7 +22,7 @@ function F({
22
22
  return /* @__PURE__ */ n(
23
23
  "button",
24
24
  {
25
- className: f(o.button, o[r], s),
25
+ className: h(o.button, o[r], s),
26
26
  ...a,
27
27
  children: /* @__PURE__ */ n("span", { children: e })
28
28
  }
@@ -32,46 +32,46 @@ function I({
32
32
  autoFocus: r,
33
33
  onSubmit: s
34
34
  }) {
35
- const e = y(null), [a, i] = g(""), c = a.trim(), u = !!c;
36
- b(() => {
35
+ const e = y(null), [a, i] = b(""), c = a.trim(), u = !!c;
36
+ x(() => {
37
37
  var t;
38
38
  r && ((t = e.current) == null || t.focus());
39
39
  }, [r]);
40
40
  const p = () => {
41
41
  const t = e.current;
42
42
  t && (t.style.height = "64px", t.style.height = `${t.scrollHeight + 4}px`);
43
- }, h = (t) => {
43
+ }, _ = (t) => {
44
44
  i(t.target.value), p();
45
45
  }, m = (t) => {
46
46
  t.preventDefault(), s(c), i(""), requestAnimationFrame(p);
47
- }, _ = (t) => {
47
+ }, d = (t) => {
48
48
  t.key === "Enter" && !t.shiftKey && !t.ctrlKey && !t.metaKey && m(t);
49
- }, d = () => {
49
+ }, f = () => {
50
50
  var t;
51
51
  (t = e.current) == null || t.focus();
52
52
  };
53
53
  return /* @__PURE__ */ l(
54
54
  "form",
55
55
  {
56
- className: f(o.inputWrap, { [o.active]: u }),
57
- onKeyDown: _,
56
+ className: h(o.inputWrap, { [o.active]: u }),
57
+ onKeyDown: d,
58
58
  onSubmit: m,
59
59
  children: [
60
- /* @__PURE__ */ n(x, {}),
60
+ /* @__PURE__ */ n(g, {}),
61
61
  /* @__PURE__ */ n(
62
62
  "textarea",
63
63
  {
64
64
  className: o.textarea,
65
65
  ref: e,
66
66
  value: a,
67
- onChange: h
67
+ onChange: _
68
68
  }
69
69
  ),
70
70
  /* @__PURE__ */ l(
71
71
  F,
72
72
  {
73
73
  variant: u ? "primary" : "secondary",
74
- onClick: d,
74
+ onClick: f,
75
75
  children: [
76
76
  /* @__PURE__ */ n(C, {}),
77
77
  /* @__PURE__ */ n("span", { className: "sr-only", children: "Send message" })
@@ -11,16 +11,17 @@ export interface SubHeaderItem {
11
11
  export declare function SubHeader({ items }: {
12
12
  items: Array<SubHeaderItem>;
13
13
  }): import("react/jsx-runtime").JSX.Element;
14
+ export interface Notification {
15
+ id?: string;
16
+ title?: string;
17
+ description?: string;
18
+ variant?: NotificationVariant;
19
+ closable?: boolean;
20
+ }
14
21
  export declare function Header({ subItems, children, notifications: initialNotifications, // TODO: Fetch these from the internets
15
22
  link: Link }: {
16
23
  subItems?: Array<SubHeaderItem>;
17
24
  children?: ReactNode;
18
- notifications?: Array<{
19
- id?: string;
20
- title?: string;
21
- description?: string;
22
- variant?: NotificationVariant;
23
- closable?: boolean;
24
- }>;
25
+ notifications?: Array<Notification>;
25
26
  link?: ElementType;
26
27
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import { jsx as e, jsxs as o, Fragment as P } from "react/jsx-runtime";
2
- import { useState as x, useEffect as V } from "react";
2
+ import { useState as b, useEffect as V } from "react";
3
3
  import { J as q } from "../../index-CMegByeX.js";
4
4
  import { _ as h } from "../../extends-hS2Bh-Yp.js";
5
- import { N as z, X as J } from "../../index-CYCXI8lK.js";
6
- import { c as p } from "../../clsx-OuTLNxxd.js";
5
+ import { N as z, X as J } from "../../index-CcO3hfIY.js";
6
+ import { c as m } from "../../clsx-OuTLNxxd.js";
7
7
  import { Button as c } from "../Button/index.js";
8
8
  import { Container as H } from "../Container/index.js";
9
- import { ThemedLogo as b } from "../Logo/index.js";
9
+ import { ThemedLogo as x } from "../Logo/index.js";
10
10
  import { PrefPanel as M } from "../PrefPanel/index.js";
11
11
  import { useMediaQuery as k } from "../../utils.js";
12
12
  var U = function(t) {
@@ -137,7 +137,7 @@ var U = 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
- }, L = function(t) {
140
+ }, S = function(t) {
141
141
  return /* @__PURE__ */ e("svg", h({
142
142
  xmlns: "http://www.w3.org/2000/svg",
143
143
  width: 24,
@@ -153,7 +153,7 @@ var U = 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
- }, S = function(t) {
156
+ }, L = function(t) {
157
157
  return /* @__PURE__ */ e("svg", h({
158
158
  xmlns: "http://www.w3.org/2000/svg",
159
159
  width: 24,
@@ -186,7 +186,7 @@ var U = function(t) {
186
186
  })
187
187
  }));
188
188
  };
189
- const D = "_header_1ar49_293", E = "_outer_1ar49_304", R = "_main_1ar49_313", I = "_container_1ar49_317", K = "_links_1ar49_323", Y = "_buttons_1ar49_324", Z = "_menu_1ar49_332", e1 = "_logo_1ar49_337", t1 = "_subContainer_1ar49_349", r1 = "_selected_1ar49_377", n1 = "_subTag_1ar49_389", o1 = "_mobileOverlay_1ar49_407", s1 = "_show_1ar49_1", a1 = "_open_1ar49_419", i1 = "_mobile_1ar49_407", c1 = "_slideUp_1ar49_1", h1 = "_sub_1ar49_349", l1 = "_gpt_1ar49_485", r = {
189
+ const D = "_header_ap7gr_285", E = "_outer_ap7gr_296", R = "_main_ap7gr_305", I = "_container_ap7gr_309", K = "_links_ap7gr_315", Y = "_buttons_ap7gr_316", Z = "_menu_ap7gr_324", e1 = "_logo_ap7gr_329", t1 = "_subContainer_ap7gr_341", r1 = "_selected_ap7gr_369", n1 = "_subTag_ap7gr_381", o1 = "_mobileOverlay_ap7gr_399", s1 = "_show_ap7gr_1", a1 = "_open_ap7gr_411", i1 = "_mobile_ap7gr_399", c1 = "_slideUp_ap7gr_1", h1 = "_sub_ap7gr_341", l1 = "_gpt_ap7gr_477", r = {
190
190
  header: D,
191
191
  outer: E,
192
192
  main: R,
@@ -198,8 +198,8 @@ const D = "_header_1ar49_293", E = "_outer_1ar49_304", R = "_main_1ar49_313", I
198
198
  subContainer: t1,
199
199
  selected: r1,
200
200
  subTag: n1,
201
- "subTag-success": "_subTag-success_1ar49_394",
202
- "subTag-brand": "_subTag-brand_1ar49_398",
201
+ "subTag-success": "_subTag-success_ap7gr_386",
202
+ "subTag-brand": "_subTag-brand_ap7gr_390",
203
203
  mobileOverlay: o1,
204
204
  show: s1,
205
205
  open: a1,
@@ -240,33 +240,33 @@ const D = "_header_1ar49_293", E = "_outer_1ar49_304", R = "_main_1ar49_313", I
240
240
  }
241
241
  ];
242
242
  function d1({ items: n }) {
243
- return /* @__PURE__ */ e("div", { className: p(r.sub, r.outer), children: /* @__PURE__ */ e(H, { className: r.subContainer, as: "ul", children: n.map(
244
- ({ title: t, url: u, icon: i, tag: m, tagVariant: g = "success", link: v = "a" }, d) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(v, { href: u, children: [
243
+ return /* @__PURE__ */ e("div", { className: m(r.sub, r.outer), children: /* @__PURE__ */ e(H, { className: r.subContainer, as: "ul", children: n.map(
244
+ ({ title: t, url: u, icon: i, tag: p, tagVariant: w = "success", link: v = "a" }, d) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(v, { href: u, children: [
245
245
  i,
246
246
  /* @__PURE__ */ o("span", { children: [
247
247
  t,
248
- m && /* @__PURE__ */ e(
248
+ p && /* @__PURE__ */ e(
249
249
  "span",
250
250
  {
251
- className: p(
251
+ className: m(
252
252
  r.subTag,
253
- r[`subTag-${g}`]
253
+ r[`subTag-${w}`]
254
254
  ),
255
- children: m
255
+ children: p
256
256
  }
257
257
  )
258
258
  ] })
259
259
  ] }) }, d)
260
260
  ) }) });
261
261
  }
262
- function b1({
262
+ function x1({
263
263
  subItems: n,
264
264
  children: t,
265
265
  notifications: u = [],
266
266
  // TODO: Fetch these from the internets
267
267
  link: i = "a"
268
268
  }) {
269
- const m = k("(max-width: 374px)"), g = k("(max-width: 849px)"), v = k("(min-width: 850px) and (max-width: 999px)"), [d, W] = x(!1), [w, f] = x([]);
269
+ const p = k("(max-width: 374px)"), w = k("(max-width: 849px)"), v = k("(min-width: 850px) and (max-width: 999px)"), [d, W] = b(!1), [g, f] = b([]);
270
270
  V(() => {
271
271
  if (u.length) {
272
272
  const a = localStorage.getItem("notifications");
@@ -284,7 +284,7 @@ function b1({
284
284
  const C = () => {
285
285
  W(!d);
286
286
  }, j = (a) => {
287
- f(w.filter((s) => !s.id || s.id !== a));
287
+ f(g.filter((s) => !s.id || s.id !== a));
288
288
  const l = localStorage.getItem("notifications");
289
289
  if (l) {
290
290
  const s = JSON.parse(l);
@@ -298,7 +298,7 @@ function b1({
298
298
  );
299
299
  };
300
300
  return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ o("header", { className: r.header, children: [
301
- w == null ? void 0 : w.map(
301
+ g == null ? void 0 : g.map(
302
302
  ({ id: a, title: l, description: s, variant: _, closable: O }, y) => /* @__PURE__ */ e(
303
303
  z,
304
304
  {
@@ -311,19 +311,9 @@ function b1({
311
311
  y
312
312
  )
313
313
  ),
314
- /* @__PURE__ */ e("div", { className: p(r.main, r.outer), children: /* @__PURE__ */ o(H, { as: "nav", className: r.container, children: [
315
- /* @__PURE__ */ e(i, { className: r.logo, href: "https://www.highcharts.com/", children: /* @__PURE__ */ e(b, { showText: !v && !m }) }),
316
- /* @__PURE__ */ e("ul", { className: r.links, children: B.map(({ title: a, url: l }, s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
317
- c,
318
- {
319
- variant: "plain",
320
- size: 300,
321
- as: i,
322
- href: l,
323
- children: a
324
- },
325
- s
326
- ) })) }),
314
+ /* @__PURE__ */ e("div", { className: m(r.main, r.outer), children: /* @__PURE__ */ o(H, { as: "nav", className: r.container, children: [
315
+ /* @__PURE__ */ e(i, { className: r.logo, href: "https://www.highcharts.com/", children: /* @__PURE__ */ e(x, { showText: !v && !p }) }),
316
+ /* @__PURE__ */ e("ul", { className: r.links, children: B.map(({ title: a, url: l }, s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(c, { variant: "plain", size: 300, as: i, href: l, children: a }) }, s)) }),
327
317
  /* @__PURE__ */ o("div", { className: r.buttons, children: [
328
318
  /* @__PURE__ */ o(
329
319
  c,
@@ -333,11 +323,11 @@ function b1({
333
323
  href: "https://www.highcharts.com/chat/gpt/",
334
324
  children: [
335
325
  /* @__PURE__ */ e("span", { className: r.gpt, children: "Highcharts GPT" }),
336
- /* @__PURE__ */ e(L, {})
326
+ /* @__PURE__ */ e(S, {})
337
327
  ]
338
328
  }
339
329
  ),
340
- /* @__PURE__ */ e(c, { variant: "transparent", children: /* @__PURE__ */ e(N, {}) }),
330
+ /* @__PURE__ */ e(c, { variant: "transparent", "aria-label": "Search", children: /* @__PURE__ */ e(N, {}) }),
341
331
  /* @__PURE__ */ e(M, {}),
342
332
  /* @__PURE__ */ e(
343
333
  c,
@@ -345,6 +335,7 @@ function b1({
345
335
  variant: "brand",
346
336
  as: i,
347
337
  href: "https://shop.highcharts.com/account",
338
+ "aria-label": "Login",
348
339
  children: /* @__PURE__ */ e(T, {})
349
340
  }
350
341
  ),
@@ -355,7 +346,7 @@ function b1({
355
346
  as: i,
356
347
  href: "https://www.highcharts.com/download/",
357
348
  children: [
358
- /* @__PURE__ */ e(S, {}),
349
+ /* @__PURE__ */ e(L, {}),
359
350
  "Get started"
360
351
  ]
361
352
  }
@@ -376,18 +367,18 @@ function b1({
376
367
  ] }) }),
377
368
  !!(n != null && n.length) && /* @__PURE__ */ e(d1, { items: n }),
378
369
  t,
379
- g && /* @__PURE__ */ o(P, { children: [
370
+ w && /* @__PURE__ */ o(P, { children: [
380
371
  /* @__PURE__ */ e(
381
372
  "div",
382
373
  {
383
- className: p(r.mobileOverlay, { [r.open]: d }),
374
+ className: m(r.mobileOverlay, { [r.open]: d }),
384
375
  onClick: C
385
376
  }
386
377
  ),
387
378
  /* @__PURE__ */ o(
388
379
  "nav",
389
380
  {
390
- className: p(r.mobile, {
381
+ className: m(r.mobile, {
391
382
  [r.open]: d
392
383
  }),
393
384
  children: [
@@ -397,7 +388,7 @@ function b1({
397
388
  {
398
389
  className: r.logo,
399
390
  href: "https://www.highcharts.com/",
400
- children: /* @__PURE__ */ e(b, { showText: !m })
391
+ children: /* @__PURE__ */ e(x, { showText: !p })
401
392
  }
402
393
  ),
403
394
  /* @__PURE__ */ o("div", { className: r.buttons, children: [
@@ -409,11 +400,11 @@ function b1({
409
400
  href: "https://www.highcharts.com/chat/gpt/",
410
401
  children: [
411
402
  /* @__PURE__ */ e("span", { className: r.gpt, children: "Highcharts GPT" }),
412
- /* @__PURE__ */ e(L, {})
403
+ /* @__PURE__ */ e(S, {})
413
404
  ]
414
405
  }
415
406
  ),
416
- /* @__PURE__ */ e(c, { variant: "transparent", children: /* @__PURE__ */ e(N, {}) }),
407
+ /* @__PURE__ */ e(c, { variant: "transparent", "aria-label": "Search", children: /* @__PURE__ */ e(N, {}) }),
417
408
  /* @__PURE__ */ e(M, {})
418
409
  ] })
419
410
  ] }),
@@ -439,7 +430,7 @@ function b1({
439
430
  as: i,
440
431
  href: "https://www.highcharts.com/download/",
441
432
  children: [
442
- /* @__PURE__ */ e(S, {}),
433
+ /* @__PURE__ */ e(L, {}),
443
434
  "Get started"
444
435
  ]
445
436
  }
@@ -457,9 +448,8 @@ function b1({
457
448
  s,
458
449
  a
459
450
  ]
460
- },
461
- _
462
- ) })) })
451
+ }
452
+ ) }, _)) })
463
453
  ]
464
454
  }
465
455
  )
@@ -467,6 +457,6 @@ function b1({
467
457
  ] }) });
468
458
  }
469
459
  export {
470
- b1 as Header,
460
+ x1 as Header,
471
461
  d1 as SubHeader
472
462
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import { z as h } from "../../index-CMegByeX.js";
3
- import { useState as d, useEffect as n } from "react";
4
- function p({
3
+ import { useMounted as d } from "../../utils.js";
4
+ function n({
5
5
  title: s = "Highcharts",
6
6
  light: l,
7
7
  showText: o = !0,
@@ -246,13 +246,11 @@ function p({
246
246
  );
247
247
  return e ? /* @__PURE__ */ t("a", { href: "https://www.highcharts.com", children: r }) : r;
248
248
  }
249
- function v(s) {
250
- const { resolvedTheme: l } = h(), [o, e] = d(!1);
251
- return n(() => {
252
- e(!0);
253
- }, []), /* @__PURE__ */ t(p, { light: !o || l === "light", ...s });
249
+ function a(s) {
250
+ const { resolvedTheme: l } = h(), o = d();
251
+ return /* @__PURE__ */ t(n, { light: !o || l === "light", ...s });
254
252
  }
255
253
  export {
256
- p as Logo,
257
- v as ThemedLogo
254
+ n as Logo,
255
+ a as ThemedLogo
258
256
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { N as f } from "../../index-CYCXI8lK.js";
3
+ import { N as f } from "../../index-CcO3hfIY.js";
4
4
  import "../../clsx-OuTLNxxd.js";
5
5
  import "../Button/index.js";
6
6
  import "../Container/index.js";