highsoft-ui 1.0.140 → 1.0.143

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.
Files changed (78) hide show
  1. package/CLAUDE.md +75 -0
  2. package/README.md +56 -3
  3. package/dist/{Button-Dc8NFRWQ.js → Button-awCDIEXQ.js} +1 -1
  4. package/dist/{ButtonGroup-CYmrw7gQ.js → ButtonGroup-Cwn0djAz.js} +1 -1
  5. package/dist/{Checkbox-CErz7eBz.js → Checkbox-CrF45NBl.js} +1 -1
  6. package/dist/{CodeBlock-BreFXfK5.js → CodeBlock-BIdeK3gz.js} +5 -5
  7. package/dist/{CookiePolicyModal-DdXZ2d36.js → CookiePolicyModal-CTA02JGV.js} +2 -2
  8. package/dist/{CopyCode-DH9Jh7PD.js → CopyCode-QiPNPCQN.js} +3 -3
  9. package/dist/{Dropdown-DbXr3sb-.js → Dropdown-0Vn7yro7.js} +1 -1
  10. package/dist/{Footer-DtFs2Sgb.js → Footer-BlCmsIDd.js} +9 -9
  11. package/dist/{FooterBottom-Dtttgp4F.js → FooterBottom-CF5ctutk.js} +1 -1
  12. package/dist/{FooterHelp-COjjt6h7.js → FooterHelp-BthIJ2ye.js} +1 -1
  13. package/dist/{FooterLinks-DZ0uH7HO.js → FooterLinks-BBOOTdRf.js} +2 -2
  14. package/dist/{Header-C7MCiwiz.js → Header-DY4mJxHm.js} +26 -26
  15. package/dist/{InputGrouped-CIokpRn5.js → InputGrouped-DyxraUpb.js} +12 -12
  16. package/dist/InputSolo-DUdKtZjX.js +126 -0
  17. package/dist/{Label-BM4vL0vA.js → Label-DdXaM1Bo.js} +1 -1
  18. package/dist/{Logo-DTfFHBgU.js → Logo-Bz0G2G-k.js} +69 -92
  19. package/dist/{NewsletterSignup-Dw9YbhEh.js → NewsletterSignup-BMRnrbw8.js} +5 -5
  20. package/dist/{Notification-BgmhEw6w.js → Notification-DM31Uzfz.js} +3 -3
  21. package/dist/{PrefPanel-BG4jW8wc.js → PrefPanel-DDD8R_-o.js} +5 -5
  22. package/dist/{RoadmapDetails-DXxJNZh9.js → RoadmapDetails-DsLtsnqg.js} +6 -6
  23. package/dist/{Search-CpJ2XTLG.js → Search-CDOpNByw.js} +12 -12
  24. package/dist/SearchDropdown-D65lySm_.js +176 -0
  25. package/dist/{YoutubeModal-DGj2INF0.js → YoutubeModal-CZgbaRB6.js} +1 -1
  26. package/dist/components/Button/index.js +1 -1
  27. package/dist/components/ButtonGroup/index.js +1 -1
  28. package/dist/components/Checkbox/index.js +1 -1
  29. package/dist/components/CodeBlock/index.js +1 -1
  30. package/dist/components/CopyCode/index.js +1 -1
  31. package/dist/components/Dropdown/index.js +1 -1
  32. package/dist/components/Footer/CookiePolicyModal.js +1 -1
  33. package/dist/components/Footer/FooterBottom.js +1 -1
  34. package/dist/components/Footer/FooterHelp.js +1 -1
  35. package/dist/components/Footer/FooterLinks.js +1 -1
  36. package/dist/components/Footer/YoutubeModal.js +1 -1
  37. package/dist/components/Footer/index.js +1 -1
  38. package/dist/components/Header/index.js +1 -1
  39. package/dist/components/InputGrouped/index.js +1 -1
  40. package/dist/components/InputSolo/index.js +1 -1
  41. package/dist/components/Label/index.js +1 -1
  42. package/dist/components/Logo/index.js +1 -1
  43. package/dist/components/Modal/ModalContactFooter.js +2 -2
  44. package/dist/components/Modal/index.js +2 -2
  45. package/dist/components/NewsletterSignup/index.js +1 -1
  46. package/dist/components/Notification/index.js +1 -1
  47. package/dist/components/PrefPanel/index.js +1 -1
  48. package/dist/components/RoadmapDetails/index.js +1 -1
  49. package/dist/components/Search/index.js +1 -1
  50. package/dist/components/SearchDropdown/index.js +2 -0
  51. package/dist/components/Sidebar/NavDisclosure.js +39 -0
  52. package/dist/components/Sidebar/NavGroup.js +74 -0
  53. package/dist/components/Sidebar/NavItem.js +28 -0
  54. package/dist/components/Sidebar/Sidebar.js +107 -0
  55. package/dist/components/Sidebar/SidebarLayout.js +95 -0
  56. package/dist/components/Sidebar/SidebarResizer.js +59 -0
  57. package/dist/components/Sidebar/context.js +18 -0
  58. package/dist/components/Sidebar/index.js +8 -0
  59. package/dist/{create-element-B4K6TXvP.js → create-element-CWTzyETe.js} +1 -1
  60. package/dist/{esm-CDDjSK4f.js → esm-VMwHsplm.js} +26 -12
  61. package/dist/highsoft-ui.css +1 -1
  62. package/dist/lib/components/InputSolo/index.d.ts +11 -0
  63. package/dist/lib/components/Logo/index.d.ts +6 -1
  64. package/dist/lib/components/SearchDropdown/index.d.ts +69 -0
  65. package/dist/lib/components/Sidebar/NavDisclosure.d.ts +14 -0
  66. package/dist/lib/components/Sidebar/NavGroup.d.ts +25 -0
  67. package/dist/lib/components/Sidebar/NavItem.d.ts +15 -0
  68. package/dist/lib/components/Sidebar/Sidebar.d.ts +46 -0
  69. package/dist/lib/components/Sidebar/SidebarLayout.d.ts +41 -0
  70. package/dist/lib/components/Sidebar/SidebarResizer.d.ts +6 -0
  71. package/dist/lib/components/Sidebar/context.d.ts +29 -0
  72. package/dist/lib/components/Sidebar/index.d.ts +13 -0
  73. package/dist/lib/main.d.ts +5 -1
  74. package/dist/main.js +36 -27
  75. package/dist/{prism-light-hml_uDoc.js → prism-light-B3yrtgki.js} +1 -1
  76. package/dist/styles.module-Bd4HbnpA.js +42 -0
  77. package/package.json +13 -2
  78. package/dist/InputSolo-2RPRX0wM.js +0 -123
@@ -0,0 +1,176 @@
1
+ import { t as e } from "./clsx-BWCAbrjV.js";
2
+ import { p as t } from "./esm-VMwHsplm.js";
3
+ import { t as n } from "./Icon-VeXJMj8Q.js";
4
+ import { t as r } from "./InputSolo-DUdKtZjX.js";
5
+ import { useCallback as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
6
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ var p = {
8
+ active: "KduBBq_active",
9
+ disabled: "KduBBq_disabled",
10
+ empty: "KduBBq_empty",
11
+ "hsui-search-dropdown-in": "KduBBq_hsui-search-dropdown-in",
12
+ kind: "KduBBq_kind",
13
+ list: "KduBBq_list",
14
+ mark: "KduBBq_mark",
15
+ mono: "KduBBq_mono",
16
+ option: "KduBBq_option",
17
+ optionIcon: "KduBBq_optionIcon",
18
+ optionLabel: "KduBBq_optionLabel",
19
+ popover: "KduBBq_popover",
20
+ root: "KduBBq_root"
21
+ };
22
+ //#endregion
23
+ //#region lib/components/SearchDropdown/index.tsx
24
+ function m(e, t, n) {
25
+ let r = t.trim();
26
+ if (!r) return e;
27
+ let i = e.toLowerCase().indexOf(r.toLowerCase(), n);
28
+ return i < 0 ? e : /* @__PURE__ */ f(u, { children: [
29
+ e.slice(0, i),
30
+ /* @__PURE__ */ d("mark", {
31
+ className: p.mark,
32
+ children: e.slice(i, i + r.length)
33
+ }),
34
+ e.slice(i + r.length)
35
+ ] });
36
+ }
37
+ function h({ items: u, value: h, defaultValue: g, onQueryChange: _, onSelect: v, filter: y = !0, placeholder: b, label: x, "aria-label": S, size: C = 200, variant: w, iconLeft: T, mono: E = !1, minChars: D = 1, emptyState: O = "No results", maxHeight: k = 320, className: A }) {
38
+ let j = o(), M = `${j}-listbox`, N = h !== void 0, [P, F] = l(g ?? ""), I = N ? h : P, [L, R] = l(!1), [z, B] = l(0), V = c(null), H = c(null), U = c([]), W = I.trim(), G = W.length >= D, K = s(() => {
39
+ if (!G) return [];
40
+ if (y === !1) return u;
41
+ if (typeof y == "function") return u.filter((e) => y(e, W));
42
+ let e = W.toLowerCase();
43
+ return u.filter((t) => t.label.toLowerCase().includes(e));
44
+ }, [
45
+ u,
46
+ y,
47
+ W,
48
+ G
49
+ ]), q = K.length ? Math.min(z, K.length - 1) : 0, J = L && G && (K.length > 0 || O != null);
50
+ a(() => {
51
+ function e(e) {
52
+ V.current && !V.current.contains(e.target) && R(!1);
53
+ }
54
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
55
+ }, []), a(() => {
56
+ J && U.current[q]?.scrollIntoView({ block: "nearest" });
57
+ }, [q, J]);
58
+ let Y = i((e) => {
59
+ e.disabled || (R(!1), v?.(e));
60
+ }, [v]), X = i((e) => {
61
+ let t = e.target.value;
62
+ N || F(t), B(0), R(t.trim().length >= D), _?.(t);
63
+ }, [
64
+ N,
65
+ D,
66
+ _
67
+ ]), Z = i(() => {
68
+ G && R(!0);
69
+ }, [G]), Q = i((e) => {
70
+ if (!J) {
71
+ e.key === "ArrowDown" && K.length && (e.preventDefault(), R(!0));
72
+ return;
73
+ }
74
+ switch (e.key) {
75
+ case "ArrowDown":
76
+ e.preventDefault(), B((e) => Math.min(e + 1, K.length - 1));
77
+ break;
78
+ case "ArrowUp":
79
+ e.preventDefault(), B((e) => Math.max(e - 1, 0));
80
+ break;
81
+ case "Home":
82
+ e.preventDefault(), B(0);
83
+ break;
84
+ case "End":
85
+ e.preventDefault(), B(K.length - 1);
86
+ break;
87
+ case "Enter": {
88
+ let t = K[q];
89
+ t && (e.preventDefault(), Y(t));
90
+ break;
91
+ }
92
+ case "Escape":
93
+ e.preventDefault(), R(!1);
94
+ break;
95
+ default: break;
96
+ }
97
+ }, [
98
+ J,
99
+ K,
100
+ q,
101
+ Y
102
+ ]), $ = S ?? x ?? b, ee = typeof k == "number" ? `${k}px` : k;
103
+ return /* @__PURE__ */ f("div", {
104
+ className: e("hsui-search-dropdown", p.root, A),
105
+ ref: V,
106
+ children: [/* @__PURE__ */ d(r, {
107
+ size: C,
108
+ variant: w,
109
+ label: x,
110
+ placeholder: b,
111
+ iconLeft: T ?? /* @__PURE__ */ d(n, {
112
+ name: t,
113
+ size: 16
114
+ }),
115
+ value: I,
116
+ onChange: X,
117
+ onFocus: Z,
118
+ onKeyDown: Q,
119
+ role: "combobox",
120
+ "aria-expanded": J,
121
+ "aria-controls": J ? M : void 0,
122
+ "aria-activedescendant": J && K.length ? `${j}-opt-${q}` : void 0,
123
+ "aria-autocomplete": "list",
124
+ "aria-label": $,
125
+ autoComplete: "off",
126
+ spellCheck: !1
127
+ }), J && /* @__PURE__ */ d("div", {
128
+ className: p.popover,
129
+ children: K.length > 0 ? /* @__PURE__ */ d("ul", {
130
+ ref: H,
131
+ id: M,
132
+ role: "listbox",
133
+ "aria-label": $,
134
+ className: p.list,
135
+ style: { maxHeight: ee },
136
+ children: K.map((t, n) => /* @__PURE__ */ f("li", {
137
+ id: `${j}-opt-${n}`,
138
+ ref: (e) => {
139
+ U.current[n] = e;
140
+ },
141
+ role: "option",
142
+ "aria-selected": n === q,
143
+ "aria-disabled": t.disabled || void 0,
144
+ className: e(p.option, {
145
+ [p.active]: n === q,
146
+ [p.disabled]: t.disabled
147
+ }),
148
+ onMouseEnter: () => B(n),
149
+ onMouseDown: (e) => {
150
+ e.preventDefault(), Y(t);
151
+ },
152
+ children: [
153
+ t.iconLeft && /* @__PURE__ */ d("span", {
154
+ className: p.optionIcon,
155
+ children: t.iconLeft
156
+ }),
157
+ /* @__PURE__ */ d("span", {
158
+ className: e(p.optionLabel, { [p.mono]: E }),
159
+ children: m(t.label, W, t.highlightFrom ?? 0)
160
+ }),
161
+ t.kind != null && /* @__PURE__ */ d("span", {
162
+ className: p.kind,
163
+ children: t.kind
164
+ })
165
+ ]
166
+ }, t.id))
167
+ }) : /* @__PURE__ */ d("div", {
168
+ className: p.empty,
169
+ children: O
170
+ })
171
+ })]
172
+ });
173
+ }
174
+ h.displayName = "SearchDropdown";
175
+ //#endregion
176
+ export { h as t };
@@ -1,4 +1,4 @@
1
- import { n as e } from "./esm-CDDjSK4f.js";
1
+ import { n as e } from "./esm-VMwHsplm.js";
2
2
  import { s as t } from "./fa-B95RwBpz.js";
3
3
  import { t as n } from "./dist-J9cXmrDi.js";
4
4
  import { a as r, i, n as a, o, r as s, s as c, t as l } from "./dist-f0z6DapB.js";
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../Button-Dc8NFRWQ.js";
1
+ import { t as e } from "../../Button-awCDIEXQ.js";
2
2
  export { e as Button };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../ButtonGroup-CYmrw7gQ.js";
1
+ import { t as e } from "../../ButtonGroup-Cwn0djAz.js";
2
2
  export { e as ButtonGroup };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../Checkbox-CErz7eBz.js";
1
+ import { n as e, t } from "../../Checkbox-CrF45NBl.js";
2
2
  export { t as Checkbox, e as CheckboxGroup };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../CodeBlock-BreFXfK5.js";
1
+ import { t as e } from "../../CodeBlock-BIdeK3gz.js";
2
2
  export { e as CodeBlock };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../CopyCode-DH9Jh7PD.js";
1
+ import { t as e } from "../../CopyCode-QiPNPCQN.js";
2
2
  export { e as CopyCode };
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "../../Dropdown-DbXr3sb-.js";
1
+ import { n as e, r as t, t as n } from "../../Dropdown-0Vn7yro7.js";
2
2
  export { n as Dropdown, e as DropdownItem, t as DropdownSeparator };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../CookiePolicyModal-DdXZ2d36.js";
1
+ import { t as e } from "../../CookiePolicyModal-CTA02JGV.js";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../FooterBottom-Dtttgp4F.js";
1
+ import { t as e } from "../../FooterBottom-CF5ctutk.js";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../FooterHelp-COjjt6h7.js";
1
+ import { t as e } from "../../FooterHelp-BthIJ2ye.js";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../FooterLinks-DZ0uH7HO.js";
1
+ import { t as e } from "../../FooterLinks-BBOOTdRf.js";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../YoutubeModal-DGj2INF0.js";
1
+ import { t as e } from "../../YoutubeModal-CZgbaRB6.js";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../Footer-DtFs2Sgb.js";
1
+ import { t as e } from "../../Footer-BlCmsIDd.js";
2
2
  export { e as Footer };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../Header-C7MCiwiz.js";
1
+ import { n as e, t } from "../../Header-DY4mJxHm.js";
2
2
  export { t as Header, e as SubHeader };
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "../../InputGrouped-CIokpRn5.js";
1
+ import { i as e, n as t, r as n, t as r } from "../../InputGrouped-DyxraUpb.js";
2
2
  export { r as FormGroup, t as FormRow, n as InputGrouped, e as SelectGrouped };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../InputSolo-2RPRX0wM.js";
1
+ import { t as e } from "../../InputSolo-DUdKtZjX.js";
2
2
  export { e as InputSolo };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../Label-BM4vL0vA.js";
1
+ import { n as e, t } from "../../Label-DdXaM1Bo.js";
2
2
  export { t as Label, e as NewTag };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../Logo-DTfFHBgU.js";
1
+ import { t as e } from "../../Logo-Bz0G2G-k.js";
2
2
  export { e as Logo };
@@ -1,5 +1,5 @@
1
- import { x as e } from "../../esm-CDDjSK4f.js";
2
- import { t } from "../../Button-Dc8NFRWQ.js";
1
+ import { S as e } from "../../esm-VMwHsplm.js";
2
+ import { t } from "../../Button-awCDIEXQ.js";
3
3
  import { t as n } from "../../Typography-AvvBRu-u.js";
4
4
  import { t as r } from "../../styles.module-BDcr8Smc.js";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../../clsx-BWCAbrjV.js";
2
- import { t } from "../../esm-CDDjSK4f.js";
3
- import { t as n } from "../../Button-Dc8NFRWQ.js";
2
+ import { t } from "../../esm-VMwHsplm.js";
3
+ import { t as n } from "../../Button-awCDIEXQ.js";
4
4
  import { t as r } from "../../Typography-AvvBRu-u.js";
5
5
  import { t as i } from "../../styles.module-BDcr8Smc.js";
6
6
  import { useEffect as a, useRef as o } from "react";
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../NewsletterSignup-Dw9YbhEh.js";
1
+ import { t as e } from "../../NewsletterSignup-BMRnrbw8.js";
2
2
  export { e as NewsletterSignup };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../Notification-BgmhEw6w.js";
1
+ import { t as e } from "../../Notification-DM31Uzfz.js";
2
2
  export { e as Notification };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../PrefPanel-BG4jW8wc.js";
1
+ import { n as e, t } from "../../PrefPanel-DDD8R_-o.js";
2
2
  export { t as PrefPanel, e as PrefRadio };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../RoadmapDetails-DXxJNZh9.js";
1
+ import { t as e } from "../../RoadmapDetails-DsLtsnqg.js";
2
2
  export { e as RoadmapDetails };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../Search-CpJ2XTLG.js";
1
+ import { t as e } from "../../Search-CDOpNByw.js";
2
2
  export { e as Search };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../SearchDropdown-D65lySm_.js";
2
+ export { e as SearchDropdown };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { t as e } from "../../clsx-BWCAbrjV.js";
3
+ import { t } from "../../styles.module-Bd4HbnpA.js";
4
+ import { useId as n, useState as r } from "react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ //#region lib/components/Sidebar/NavDisclosure.tsx
7
+ function o({ label: o, children: s, className: c }) {
8
+ let [l, u] = r(!1), d = n();
9
+ return /* @__PURE__ */ a("div", {
10
+ className: e(t.disclosure, c),
11
+ "data-open": l,
12
+ children: [/* @__PURE__ */ a("button", {
13
+ type: "button",
14
+ className: t.disclosureToggle,
15
+ "aria-expanded": l,
16
+ "aria-controls": d,
17
+ onClick: () => u((e) => !e),
18
+ children: [/* @__PURE__ */ i("svg", {
19
+ className: t.disclosureChevron,
20
+ width: "14",
21
+ height: "14",
22
+ viewBox: "0 0 24 24",
23
+ fill: "none",
24
+ stroke: "currentColor",
25
+ strokeWidth: "2.5",
26
+ strokeLinecap: "round",
27
+ strokeLinejoin: "round",
28
+ "aria-hidden": "true",
29
+ children: /* @__PURE__ */ i("path", { d: "m9 18 6-6-6-6" })
30
+ }), /* @__PURE__ */ i("span", { children: o })]
31
+ }), /* @__PURE__ */ i("div", {
32
+ id: d,
33
+ className: t.disclosureBody,
34
+ children: s
35
+ })]
36
+ });
37
+ }
38
+ //#endregion
39
+ export { o as NavDisclosure };
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { t as e } from "../../clsx-BWCAbrjV.js";
3
+ import { useOptionalSidebarSection as t } from "./context.js";
4
+ import { t as n } from "../../styles.module-Bd4HbnpA.js";
5
+ import { createContext as r, useCallback as i, useContext as a, useEffect as o, useId as s, useRef as c, useState as l } from "react";
6
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
+ //#region lib/components/Sidebar/NavGroup.tsx
8
+ var f = r(0);
9
+ function p({ label: r, children: p, icon: m, defaultOpen: h = !1, open: g, onOpenChange: _, active: v, className: y }) {
10
+ let [b, x] = l(h), S = g !== void 0, C = S ? g : b, w = s(), T = s(), E = t(), D = a(f), O = i((e) => {
11
+ S || x(e), _?.(e);
12
+ }, [S, _]), k = i(() => O(!C), [C, O]);
13
+ o(() => (E?.reportOpen(T, C), () => E?.reportOpen(T, !1)), [
14
+ C,
15
+ T,
16
+ E
17
+ ]);
18
+ let A = c(E?.collapseNonce ?? 0);
19
+ return o(() => {
20
+ let e = E?.collapseNonce ?? 0;
21
+ e !== A.current && (A.current = e, C && O(!1));
22
+ }, [
23
+ E?.collapseNonce,
24
+ C,
25
+ E,
26
+ O
27
+ ]), /* @__PURE__ */ d("div", {
28
+ className: e(n.group, C && n.groupOpen, v && n.groupActive, y),
29
+ style: { "--hs-nav-depth": D },
30
+ children: [/* @__PURE__ */ d("button", {
31
+ type: "button",
32
+ className: n.groupToggle,
33
+ "aria-expanded": C,
34
+ "aria-controls": w,
35
+ onClick: k,
36
+ children: [
37
+ /* @__PURE__ */ u("svg", {
38
+ className: n.groupChevron,
39
+ width: "14",
40
+ height: "14",
41
+ viewBox: "0 0 24 24",
42
+ fill: "none",
43
+ stroke: "currentColor",
44
+ strokeWidth: "2.5",
45
+ strokeLinecap: "round",
46
+ strokeLinejoin: "round",
47
+ "aria-hidden": "true",
48
+ children: /* @__PURE__ */ u("path", { d: "m9 18 6-6-6-6" })
49
+ }),
50
+ m == null ? null : /* @__PURE__ */ u("span", {
51
+ className: n.itemIcon,
52
+ children: m
53
+ }),
54
+ /* @__PURE__ */ u("span", {
55
+ className: n.groupLabel,
56
+ children: r
57
+ })
58
+ ]
59
+ }), /* @__PURE__ */ u("div", {
60
+ id: w,
61
+ className: n.groupChildren,
62
+ role: "group",
63
+ children: /* @__PURE__ */ u("div", {
64
+ className: n.groupChildrenInner,
65
+ children: /* @__PURE__ */ u(f.Provider, {
66
+ value: D + 1,
67
+ children: p
68
+ })
69
+ })
70
+ })]
71
+ });
72
+ }
73
+ //#endregion
74
+ export { p as NavGroup };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { t as e } from "../../clsx-BWCAbrjV.js";
3
+ import { useOptionalSidebarLayout as t } from "./context.js";
4
+ import { t as n } from "../../styles.module-Bd4HbnpA.js";
5
+ import { forwardRef as r } from "react";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ //#region lib/components/Sidebar/NavItem.tsx
8
+ var o = r(function({ as: r, active: o, icon: s, children: c, className: l, onClick: u, ...d }, f) {
9
+ let p = r || "a", m = t();
10
+ return /* @__PURE__ */ a(p, {
11
+ ref: f,
12
+ className: e(n.item, o && n.itemActive, l),
13
+ "aria-current": o ? "page" : void 0,
14
+ onClick: (e) => {
15
+ u?.(e), m?.closeMobile();
16
+ },
17
+ ...d,
18
+ children: [s == null ? null : /* @__PURE__ */ i("span", {
19
+ className: n.itemIcon,
20
+ children: s
21
+ }), /* @__PURE__ */ i("span", {
22
+ className: n.itemLabel,
23
+ children: c
24
+ })]
25
+ });
26
+ });
27
+ //#endregion
28
+ export { o as NavItem };
@@ -0,0 +1,107 @@
1
+ "use client";
2
+ import { t as e } from "../../clsx-BWCAbrjV.js";
3
+ import { t } from "../../Button-awCDIEXQ.js";
4
+ import { SidebarSectionContext as n, useSidebarLayout as r } from "./context.js";
5
+ import { t as i } from "../../styles.module-Bd4HbnpA.js";
6
+ import { SidebarResizer as a } from "./SidebarResizer.js";
7
+ import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
8
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
+ //#region lib/components/Sidebar/Sidebar.tsx
10
+ function f({ children: t, "aria-label": n = "Sidebar navigation", closeLabel: o = "Close navigation", className: l }) {
11
+ let { resizable: f, mobileOpen: p, closeMobile: m } = r(), h = c(null);
12
+ return s(() => {
13
+ p && h.current?.focus();
14
+ }, [p]), /* @__PURE__ */ d("aside", {
15
+ id: "hs-sidebar-drawer",
16
+ className: e(i.sidebar, p && i.sidebarOpen, l),
17
+ "aria-label": n,
18
+ children: [
19
+ /* @__PURE__ */ u("button", {
20
+ ref: h,
21
+ type: "button",
22
+ className: i.close,
23
+ "aria-label": o,
24
+ onClick: m,
25
+ children: /* @__PURE__ */ u(_, {})
26
+ }),
27
+ t,
28
+ f ? /* @__PURE__ */ u(a, {}) : null
29
+ ]
30
+ });
31
+ }
32
+ function p({ children: t, className: n }) {
33
+ return /* @__PURE__ */ u("div", {
34
+ className: e(i.header, n),
35
+ children: t
36
+ });
37
+ }
38
+ function m({ children: t, className: n }) {
39
+ return /* @__PURE__ */ u("div", {
40
+ className: e(i.body, n),
41
+ children: t
42
+ });
43
+ }
44
+ function h({ children: r, label: a, collapsible: s = !1, minimizeLabel: f = "Minimize", action: p, className: m }) {
45
+ let [h, _] = l(0), v = c(/* @__PURE__ */ new Set()), [y, b] = l(0), x = o((e, t) => {
46
+ let n = v.current;
47
+ t ? n.add(e) : n.delete(e), b(n.size);
48
+ }, []), S = s && p == null && y > 0, C = a != null || p != null || S;
49
+ return /* @__PURE__ */ u(n.Provider, {
50
+ value: {
51
+ collapseNonce: h,
52
+ reportOpen: x
53
+ },
54
+ children: /* @__PURE__ */ d("section", {
55
+ className: e(i.section, C && i.hasStickyHead, m),
56
+ children: [C ? /* @__PURE__ */ d("div", {
57
+ className: i.sectionHead,
58
+ children: [a == null ? null : /* @__PURE__ */ u("h3", {
59
+ className: i.sectionLabel,
60
+ children: a
61
+ }), p ?? (S ? /* @__PURE__ */ u(t, {
62
+ variant: "plain",
63
+ size: 100,
64
+ className: i.minimizeBtn,
65
+ iconLeft: /* @__PURE__ */ u(g, {}),
66
+ onClick: () => _((e) => e + 1),
67
+ children: f
68
+ }) : null)]
69
+ }) : null, r]
70
+ })
71
+ });
72
+ }
73
+ function g() {
74
+ return /* @__PURE__ */ d("svg", {
75
+ width: "14",
76
+ height: "14",
77
+ viewBox: "0 0 16 16",
78
+ fill: "none",
79
+ stroke: "currentColor",
80
+ strokeWidth: "1.25",
81
+ strokeLinecap: "round",
82
+ strokeLinejoin: "round",
83
+ "aria-hidden": "true",
84
+ children: [/* @__PURE__ */ u("rect", {
85
+ x: "2.5",
86
+ y: "2.5",
87
+ width: "11",
88
+ height: "11",
89
+ rx: "2"
90
+ }), /* @__PURE__ */ u("path", { d: "M5.5 8h5" })]
91
+ });
92
+ }
93
+ function _() {
94
+ return /* @__PURE__ */ u("svg", {
95
+ width: "18",
96
+ height: "18",
97
+ viewBox: "0 0 24 24",
98
+ fill: "none",
99
+ stroke: "currentColor",
100
+ strokeWidth: "2",
101
+ strokeLinecap: "round",
102
+ "aria-hidden": "true",
103
+ children: /* @__PURE__ */ u("path", { d: "M18 6 6 18M6 6l12 12" })
104
+ });
105
+ }
106
+ //#endregion
107
+ export { f as Sidebar, m as SidebarBody, p as SidebarHeader, h as SidebarSection };
@@ -0,0 +1,95 @@
1
+ "use client";
2
+ import { t as e } from "../../clsx-BWCAbrjV.js";
3
+ import { SidebarLayoutContext as t } from "./context.js";
4
+ import { t as n } from "../../styles.module-Bd4HbnpA.js";
5
+ import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ //#region lib/components/Sidebar/SidebarLayout.tsx
8
+ function l({ children: l, defaultWidth: u = 320, minWidth: f = 230, maxWidth: p = 460, resizable: m = !0, storageKey: h, mobileTriggerLabel: g = "Menu", fill: _ = !0, className: v, style: y }) {
9
+ let [b, x] = o(u), [S, C] = o(!1), w = a(null), T = r((e) => {
10
+ let t = Math.min(Math.max(Math.round(e), f), p);
11
+ if (x(t), h) try {
12
+ localStorage.setItem(h, String(t));
13
+ } catch {}
14
+ }, [
15
+ f,
16
+ p,
17
+ h
18
+ ]);
19
+ i(() => {
20
+ if (h) try {
21
+ let e = localStorage.getItem(h);
22
+ e && T(Number(e) || u);
23
+ } catch {}
24
+ }, []);
25
+ let E = r(() => {
26
+ C(!1), w.current?.focus();
27
+ }, []), D = r(() => C(!0), []);
28
+ return i(() => {
29
+ if (!S) return;
30
+ let e = (e) => {
31
+ e.key === "Escape" && E();
32
+ };
33
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
34
+ }, [S, E]), /* @__PURE__ */ s(t.Provider, {
35
+ value: {
36
+ resizable: m,
37
+ width: b,
38
+ setWidth: T,
39
+ minWidth: f,
40
+ maxWidth: p,
41
+ mobileOpen: S,
42
+ openMobile: D,
43
+ closeMobile: E
44
+ },
45
+ children: /* @__PURE__ */ c("div", {
46
+ className: e(n.layout, _ && n.fill, v),
47
+ style: {
48
+ "--hs-sidebar-w": `${b}px`,
49
+ ...y
50
+ },
51
+ children: [
52
+ /* @__PURE__ */ s("div", {
53
+ className: n.mobileBar,
54
+ children: /* @__PURE__ */ c("button", {
55
+ ref: w,
56
+ type: "button",
57
+ className: n.trigger,
58
+ "aria-expanded": S,
59
+ "aria-controls": "hs-sidebar-drawer",
60
+ onClick: D,
61
+ children: [/* @__PURE__ */ s(d, {}), g]
62
+ })
63
+ }),
64
+ l,
65
+ /* @__PURE__ */ s("div", {
66
+ className: e(n.backdrop, S && n.backdropOpen),
67
+ onClick: E,
68
+ "aria-hidden": "true"
69
+ })
70
+ ]
71
+ })
72
+ });
73
+ }
74
+ function u({ children: t, className: r, ...i }) {
75
+ return /* @__PURE__ */ s("main", {
76
+ className: e(n.main, r),
77
+ ...i,
78
+ children: t
79
+ });
80
+ }
81
+ function d() {
82
+ return /* @__PURE__ */ s("svg", {
83
+ width: "18",
84
+ height: "18",
85
+ viewBox: "0 0 24 24",
86
+ fill: "none",
87
+ stroke: "currentColor",
88
+ strokeWidth: "2",
89
+ strokeLinecap: "round",
90
+ "aria-hidden": "true",
91
+ children: /* @__PURE__ */ s("path", { d: "M3 6h18M3 12h18M3 18h18" })
92
+ });
93
+ }
94
+ //#endregion
95
+ export { l as SidebarLayout, u as SidebarMain };