highsoft-ui 1.0.114 → 1.0.116

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.
package/README.md CHANGED
@@ -106,6 +106,59 @@ hydrate({
106
106
  });
107
107
  ```
108
108
 
109
+ ### Sub-navigation notes
110
+
111
+ `Header` supports a single level of secondary navigation through `subItems`.
112
+
113
+ Text-only items compact automatically:
114
+
115
+ ```tsx
116
+ <Header
117
+ subItems={[
118
+ { title: 'Demos', url: '/demo' },
119
+ { title: 'Docs', url: '/docs', prefixMatch: true },
120
+ { title: 'API', url: '/api' },
121
+ ]}
122
+ pathname={pathname}
123
+ />
124
+ ```
125
+
126
+ Icon-based items keep the taller icon layout:
127
+
128
+ ```tsx
129
+ <Header
130
+ subItems={[
131
+ {
132
+ title: 'Demos',
133
+ url: '/demo',
134
+ icon: <ChartBreakoutSquare />,
135
+ selectedIcon: <PresentationChart02 />,
136
+ },
137
+ {
138
+ title: 'Docs',
139
+ url: '/docs',
140
+ prefixMatch: true,
141
+ icon: <File06 />,
142
+ },
143
+ ]}
144
+ pathname={pathname}
145
+ />
146
+ ```
147
+
148
+ Supported:
149
+
150
+ - One horizontal row of secondary navigation
151
+ - Optional icons and selected icons
152
+ - Optional short tags next to the title
153
+ - Active-state matching with `pathname` and `prefixMatch`
154
+
155
+ Not supported:
156
+
157
+ - Nested submenus or flyout menus
158
+ - Accordion or expand/collapse navigation behavior
159
+ - Multi-line or highly custom item layouts
160
+ - Perfect alignment when mixing icon and non-icon items in the same row
161
+
109
162
  ## Formatting and linting
110
163
 
111
164
  ### Prettier
@@ -0,0 +1,47 @@
1
+ import { t as e } from "./clsx-ROFf4vs9.js";
2
+ import { y as t } from "./esm-C1TDRARf.js";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ var a = {
6
+ attention: "QF-Hta_attention",
7
+ brand: "QF-Hta_brand",
8
+ button: "QF-Hta_button",
9
+ content: "QF-Hta_content",
10
+ danger: "QF-Hta_danger",
11
+ full: "QF-Hta_full",
12
+ loader: "QF-Hta_loader",
13
+ loading: "QF-Hta_loading",
14
+ neutral: "QF-Hta_neutral",
15
+ plain: "QF-Hta_plain",
16
+ "size-100": "QF-Hta_size-100",
17
+ "size-200": "QF-Hta_size-200",
18
+ "size-300": "QF-Hta_size-300",
19
+ "size-400": "QF-Hta_size-400",
20
+ "size-50": "QF-Hta_size-50",
21
+ "size-500": "QF-Hta_size-500",
22
+ soft: "QF-Hta_soft",
23
+ spin: "QF-Hta_spin",
24
+ success: "QF-Hta_success",
25
+ transparent: "QF-Hta_transparent"
26
+ }, o = n(({ children: n, variant: o = "neutral", size: s = 200, fullWidth: c = !1, loading: l, as: u = "button", disabled: d, className: f, ...p }, m) => {
27
+ let h = o === "white" ? "soft" : o;
28
+ return /* @__PURE__ */ i(u, {
29
+ className: e("hsui-button", f, a.button, a[h], a[`size-${s}`], {
30
+ [a.full]: c,
31
+ [a.loading]: l
32
+ }),
33
+ disabled: d || l,
34
+ type: "button",
35
+ ref: m,
36
+ ...p,
37
+ children: [l && /* @__PURE__ */ r("span", {
38
+ className: a.loader,
39
+ children: /* @__PURE__ */ r(t, {})
40
+ }), /* @__PURE__ */ r("span", {
41
+ className: a.content,
42
+ children: n
43
+ })]
44
+ });
45
+ });
46
+ //#endregion
47
+ export { o as t };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./esm-C1TDRARf.js";
2
- import { t } from "./Button-Bbc4vmW_.js";
2
+ import { t } from "./Button-9RIB8ZR0.js";
3
3
  import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./dist-0f0-S8_q.js";
4
4
  import { useEffect as l, useRef as u, useState as d } from "react";
5
5
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -1,14 +1,14 @@
1
1
  import { i as e, n as t, s as n } from "./utils-C4QGLbxr.js";
2
2
  import { t as r } from "./clsx-ROFf4vs9.js";
3
3
  import { E as i, M as a, T as o, a as s, u as c, x as l } from "./esm-C1TDRARf.js";
4
- import { t as u } from "./Button-Bbc4vmW_.js";
4
+ import { t as u } from "./Button-9RIB8ZR0.js";
5
5
  import { t as d } from "./Container-LAkF4ShX.js";
6
6
  import { t as f } from "./dist-CjrKJb_1.js";
7
7
  import { a as p, i as m, n as h, o as g, r as _, s as v } from "./dist-0f0-S8_q.js";
8
8
  import { t as y } from "./Logo-CZ5LYqub.js";
9
9
  import { t as b } from "./NewTag-C-3mRyvV.js";
10
10
  import x from "./components/icons/MadeInNorway.js";
11
- import { n as S, t as C } from "./CookiePolicyModal-BH2uHybE.js";
11
+ import { n as S, t as C } from "./CookiePolicyModal-B2mvebvV.js";
12
12
  import w, { useEffect as T, useRef as E, useState as D } from "react";
13
13
  import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
14
14
  //#region node_modules/react-icons/lib/iconContext.mjs
@@ -414,7 +414,7 @@ var ee = [
414
414
  ],
415
415
  "Data Connectors": [{
416
416
  title: "Morningstar Data",
417
- url: "https://www.highcharts.com/products/morningstar-data/"
417
+ url: "https://www.highcharts.com/products/data-connector-for-morningstar/"
418
418
  }],
419
419
  "Pro Services": [{
420
420
  title: "Custom Projects",
@@ -666,6 +666,7 @@ function ie({ link: t = "a", host: i = "https://www.highcharts.com" }) {
666
666
  ref: o
667
667
  }),
668
668
  /* @__PURE__ */ k(u, {
669
+ type: "submit",
669
670
  variant: N ? "danger" : "brand",
670
671
  loading: c,
671
672
  children: "Sign up"
@@ -1,17 +1,18 @@
1
- import { t as e } from "./Search-D_fsZ-hm.js";
1
+ import { t as e } from "./Search-DAPCZo13.js";
2
2
  import { a as t, c as n, i as r, l as i, r as a } from "./utils-C4QGLbxr.js";
3
3
  import { t as o } from "./clsx-ROFf4vs9.js";
4
4
  import { D as s, M as c, S as l, _ as u, k as d, n as f, o as p, p as m, s as h, t as g, v as _ } from "./esm-C1TDRARf.js";
5
- import { t as v } from "./Button-Bbc4vmW_.js";
5
+ import { t as v } from "./Button-9RIB8ZR0.js";
6
6
  import { t as y } from "./Container-LAkF4ShX.js";
7
- import { t as b } from "./PrefPanel-DmiRZs1n.js";
7
+ import { t as b } from "./PrefPanel-BTX6RAo4.js";
8
8
  import { t as x } from "./Logo-CZ5LYqub.js";
9
9
  import { t as S } from "./NewTag-C-3mRyvV.js";
10
- import { t as C } from "./Notification-_vWBqFiA.js";
10
+ import { t as C } from "./Notification-DHcQtd1k.js";
11
11
  import { useEffect as w, useRef as T, useState as E } from "react";
12
12
  import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
13
13
  var A = {
14
14
  buttons: "m_QBtq_buttons",
15
+ compact: "m_QBtq_compact",
15
16
  container: "m_QBtq_container",
16
17
  content: "m_QBtq_content",
17
18
  cta: "m_QBtq_cta",
@@ -35,7 +36,8 @@ var A = {
35
36
  slideUp: "m_QBtq_slideUp",
36
37
  sub: "m_QBtq_sub",
37
38
  subContainer: "m_QBtq_subContainer",
38
- subTitle: "m_QBtq_subTitle"
39
+ subTitle: "m_QBtq_subTitle",
40
+ withIcon: "m_QBtq_withIcon"
39
41
  }, j = "notifications", M = "theme", N = 365 * 20, P = (e) => /^\d{1,3}(?:\.\d{1,3}){3}$/.test(e), F = () => {
40
42
  if (typeof window > "u") return;
41
43
  let e = window.location.hostname;
@@ -112,22 +114,31 @@ function V(e) {
112
114
  function H(e, t) {
113
115
  return `${e}-${V((Array.isArray(t) ? t : [t]).map(({ url: e = "" }) => e.trim()).join("|"))}`;
114
116
  }
115
- function U({ items: e, link: n = "a", host: r = "https://www.highcharts.com", pathname: i }) {
116
- let a = t();
117
+ var U = 72, W = 48;
118
+ function G(e) {
119
+ return !!e?.some(({ icon: e, selectedIcon: t }) => !!(e || t));
120
+ }
121
+ function K({ items: e, link: n = "a", host: r = "https://www.highcharts.com", pathname: i }) {
122
+ let a = t(), s = G(e);
117
123
  return /* @__PURE__ */ O("div", {
118
124
  className: o(A.sub, A.outer),
119
125
  children: /* @__PURE__ */ O(y, {
120
- className: A.subContainer,
126
+ className: o(A.subContainer, { [A.compact]: !s }),
121
127
  as: "ul",
122
128
  children: e.map(({ title: e, url: t, prefixMatch: s, icon: c, selectedIcon: l, tag: u, tagVariant: d = "success" }, f) => {
123
- let p = i || typeof window < "u" && window.location.pathname, m = typeof window < "u" && window.location.origin || "http://example.com", h = new URL(t, m), g = p && (!!i || a) && h.origin === m && (s ? p.startsWith(h.pathname) : h.pathname === p);
129
+ let p = i || typeof window < "u" && window.location.pathname, m = typeof window < "u" && window.location.origin || "http://example.com", h = new URL(t, m), g = p && (!!i || a) && h.origin === m && (s ? p.startsWith(h.pathname) : h.pathname === p), _ = !!(c || l), v = typeof u == "string" || typeof u == "number" ? /* @__PURE__ */ O(S, {
130
+ variant: d,
131
+ icon: !1,
132
+ children: u
133
+ }) : u;
124
134
  return /* @__PURE__ */ O("li", { children: /* @__PURE__ */ k(n, {
125
135
  href: B(t, r),
126
136
  className: o({
137
+ [A.withIcon]: _,
127
138
  [A.selectableIcon]: l,
128
139
  [A.selected]: g
129
140
  }),
130
- children: [/* @__PURE__ */ k("span", {
141
+ children: [_ && /* @__PURE__ */ k("span", {
131
142
  className: A.icons,
132
143
  children: [/* @__PURE__ */ O("span", {
133
144
  className: A.selectedIcon,
@@ -138,17 +149,14 @@ function U({ items: e, link: n = "a", host: r = "https://www.highcharts.com", pa
138
149
  })]
139
150
  }), /* @__PURE__ */ k("span", {
140
151
  className: A.subTitle,
141
- children: [e, u && /* @__PURE__ */ O(S, {
142
- variant: d,
143
- icon: !1
144
- })]
152
+ children: [e, v]
145
153
  })]
146
154
  }) }, f);
147
155
  })
148
156
  })
149
157
  });
150
158
  }
151
- var W = [
159
+ var q = [
152
160
  {
153
161
  title: "Highcharts at CSUN 2026",
154
162
  description: "See what we're presenting",
@@ -173,11 +181,11 @@ var W = [
173
181
  url: "https://discord.com/invite/xHxxcyyy6K",
174
182
  tag: "new"
175
183
  }
176
- ], G = [{
177
- id: H("whats-new", W),
178
- content: W
184
+ ], J = [{
185
+ id: H("whats-new", q),
186
+ content: q
179
187
  }];
180
- function K() {
188
+ function Y() {
181
189
  let { theme: e, setTheme: t } = i(), n = T(!1);
182
190
  return w(() => {
183
191
  if (n.current) return;
@@ -191,12 +199,12 @@ function K() {
191
199
  e && R(M, e);
192
200
  }, [e]), null;
193
201
  }
194
- function q({ subItems: t, children: i, notifications: s = G, link: c = "a", host: l = "https://www.highcharts.com", pathname: u, cssVariable: d }) {
195
- let m = r("(max-width: 374px)"), S = r("(max-width: 849px)"), w = r("(max-width: 1300px)"), M = T(null), [N, P] = E(!1), [F, L] = E([]);
202
+ function X({ subItems: t, children: i, notifications: s = J, link: c = "a", host: l = "https://www.highcharts.com", pathname: u, cssVariable: d }) {
203
+ let m = r("(max-width: 374px)"), S = r("(max-width: 849px)"), w = r("(max-width: 1300px)"), M = G(t), N = T(null), [P, F] = E(!1), [L, V] = E([]);
196
204
  a(() => {
197
- let e = M.current;
205
+ let e = N.current;
198
206
  if (!e) return;
199
- let n = t?.length ? 72 : 0, r = 82 + F.length * 48 + n, i = -(82 + F.length * 48), a = window.scrollY, o = 0, s = null, c = null, l = () => {
207
+ let n = t?.length ? M ? U : W : 0, r = 82 + L.length * 48 + n, i = -(82 + L.length * 48), a = window.scrollY, o = 0, s = null, c = null, l = () => {
200
208
  c = null, !(!e || s === o) && (e.style.transform = `translate3d(0, ${o}px, 0)`, d && document.documentElement.style.setProperty("--header-bottom", `${r + o}px`), s = o);
201
209
  };
202
210
  l();
@@ -209,37 +217,38 @@ function q({ subItems: t, children: i, notifications: s = G, link: c = "a", host
209
217
  };
210
218
  }, [
211
219
  d,
212
- F.length,
220
+ M,
221
+ L.length,
213
222
  t?.length
214
223
  ]), a(() => {
215
224
  if (!s.length) return;
216
225
  let e = I();
217
- L(e ? s.filter((t) => !t.id || !e.closed.includes(t.id)) : s);
226
+ V(e ? s.filter((t) => !t.id || !e.closed.includes(t.id)) : s);
218
227
  }, [l, s]);
219
- let V = (e) => {
228
+ let H = (e) => {
220
229
  if (e.preventDefault(), !(e.nativeEvent instanceof KeyboardEvent) || e.nativeEvent.code === "Enter" || e.nativeEvent.code === "Space") {
221
230
  let e = document.querySelector("main");
222
231
  e && (e.scrollIntoView(), e.getAttribute("tabindex") !== "-1" && e.setAttribute("tabindex", "-1"), e.focus());
223
232
  }
224
- }, H = () => {
225
- P(!N);
226
- }, W = (e) => {
227
- if (L(F.filter((t) => !t.id || t.id !== e)), !e) return;
233
+ }, q = () => {
234
+ F(!P);
235
+ }, X = (e) => {
236
+ if (V(L.filter((t) => !t.id || t.id !== e)), !e) return;
228
237
  let t = I() ?? { closed: [] };
229
238
  t.closed.includes(e) || R(j, JSON.stringify({ closed: [...t.closed, e] }));
230
239
  };
231
- return /* @__PURE__ */ k(n, { children: [/* @__PURE__ */ O(K, {}), /* @__PURE__ */ k("header", {
240
+ return /* @__PURE__ */ k(n, { children: [/* @__PURE__ */ O(Y, {}), /* @__PURE__ */ k("header", {
232
241
  className: A.header,
233
242
  children: [/* @__PURE__ */ k("div", {
234
243
  className: A.content,
235
- ref: M,
244
+ ref: N,
236
245
  children: [
237
- F?.map(({ id: e, content: t, variant: n, closable: r }, i) => /* @__PURE__ */ O(C, {
246
+ L?.map(({ id: e, content: t, variant: n, closable: r }, i) => /* @__PURE__ */ O(C, {
238
247
  id: e,
239
248
  content: t,
240
249
  variant: n,
241
250
  closable: r,
242
- onClose: () => W(e)
251
+ onClose: () => X(e)
243
252
  }, i)),
244
253
  /* @__PURE__ */ O("div", {
245
254
  className: o(A.main, A.outer),
@@ -252,8 +261,8 @@ function q({ subItems: t, children: i, notifications: s = G, link: c = "a", host
252
261
  className: A.skip,
253
262
  size: 500,
254
263
  tabIndex: "0",
255
- onClick: V,
256
- onKeyPress: V,
264
+ onClick: H,
265
+ onKeyPress: H,
257
266
  children: "Skip to content"
258
267
  }),
259
268
  /* @__PURE__ */ O(c, {
@@ -301,17 +310,17 @@ function q({ subItems: t, children: i, notifications: s = G, link: c = "a", host
301
310
  children: [/* @__PURE__ */ O(f, {}), "Try for Free"]
302
311
  }) }),
303
312
  /* @__PURE__ */ O("li", { children: /* @__PURE__ */ k(v, {
304
- variant: N ? "white" : "transparent",
313
+ variant: P ? "soft" : "transparent",
305
314
  className: A.menu,
306
- onClick: H,
307
- children: [N ? "Close" : "Menu", O(N ? g : _, {})]
315
+ onClick: q,
316
+ children: [P ? "Close" : "Menu", O(P ? g : _, {})]
308
317
  }) })
309
318
  ]
310
319
  })
311
320
  ]
312
321
  })
313
322
  }),
314
- !!t?.length && /* @__PURE__ */ O(U, {
323
+ !!t?.length && /* @__PURE__ */ O(K, {
315
324
  items: t,
316
325
  link: c,
317
326
  host: l,
@@ -320,10 +329,10 @@ function q({ subItems: t, children: i, notifications: s = G, link: c = "a", host
320
329
  i
321
330
  ]
322
331
  }), S && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("div", {
323
- className: o(A.mobileOverlay, { [A.open]: N }),
324
- onClick: H
332
+ className: o(A.mobileOverlay, { [A.open]: P }),
333
+ onClick: q
325
334
  }), /* @__PURE__ */ k("nav", {
326
- className: o(A.mobile, { [A.open]: N }),
335
+ className: o(A.mobile, { [A.open]: P }),
327
336
  children: [
328
337
  /* @__PURE__ */ k("div", {
329
338
  className: A.container,
@@ -380,4 +389,4 @@ function q({ subItems: t, children: i, notifications: s = G, link: c = "a", host
380
389
  })] });
381
390
  }
382
391
  //#endregion
383
- export { U as n, q as t };
392
+ export { K as n, X as t };
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./clsx-ROFf4vs9.js";
2
2
  import { t } from "./esm-C1TDRARf.js";
3
- import { t as n } from "./Button-Bbc4vmW_.js";
3
+ import { t as n } from "./Button-9RIB8ZR0.js";
4
4
  import { t as r } from "./Container-LAkF4ShX.js";
5
5
  import { t as i } from "./NewTag-C-3mRyvV.js";
6
6
  import { useEffect as a, useState as o } from "react";
@@ -1,7 +1,7 @@
1
1
  import { a as e, l as t } from "./utils-C4QGLbxr.js";
2
2
  import { t as n } from "./clsx-ROFf4vs9.js";
3
3
  import { E as r, g as i, h as a, l as o, r as s } from "./esm-C1TDRARf.js";
4
- import { t as c } from "./Button-Bbc4vmW_.js";
4
+ import { t as c } from "./Button-9RIB8ZR0.js";
5
5
  import { _ as l, a as u, c as d, d as f, f as p, g as m, h, i as g, l as _, m as v, n as y, o as b, r as x, s as S, t as C, u as w } from "./es2015-CzBBLWyD.js";
6
6
  import * as T from "react";
7
7
  import { useLayoutEffect as ee } from "react";