@shlinkio/shlink-frontend-kit 1.3.1 → 1.5.0
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 +25 -1
- package/dist/content/Details.d.ts +9 -0
- package/dist/content/Details.stories.d.ts +11 -0
- package/dist/content/Listbox.d.ts +25 -0
- package/dist/content/Table.d.ts +33 -0
- package/dist/content/Table.stories.d.ts +20 -0
- package/dist/content/index.d.ts +3 -0
- package/dist/feedback/CardModal.d.ts +40 -0
- package/dist/feedback/CardModal.stories.d.ts +25 -0
- package/dist/feedback/Message.d.ts +11 -0
- package/dist/feedback/Message.stories.d.ts +11 -0
- package/dist/feedback/ModalDialog.d.ts +8 -0
- package/dist/feedback/Result.d.ts +11 -0
- package/dist/feedback/Result.stories.d.ts +12 -0
- package/dist/feedback/Tooltip.d.ts +897 -0
- package/dist/feedback/Tooltip.stories.d.ts +10 -0
- package/dist/feedback/index.d.ts +5 -0
- package/dist/form/BooleanControl.d.ts +6 -0
- package/dist/form/Button.d.ts +17 -0
- package/dist/form/Button.stories.d.ts +26 -0
- package/dist/form/Checkbox.d.ts +4 -0
- package/dist/form/Checkbox.stories.d.ts +9 -0
- package/dist/form/CloseButton.d.ts +11 -0
- package/dist/form/CloseButton.stories.d.ts +12 -0
- package/dist/form/FormControlWithFeedback.d.ts +12 -0
- package/dist/form/Input.d.ts +16 -0
- package/dist/form/Input.stories.d.ts +20 -0
- package/dist/form/Label.d.ts +5 -0
- package/dist/form/Label.stories.d.ts +9 -0
- package/dist/form/LabelledInput.d.ts +14 -0
- package/dist/form/LabelledInput.stories.d.ts +12 -0
- package/dist/form/LabelledRevealablePasswordInput.d.ts +14 -0
- package/dist/form/LabelledRevealablePasswordInput.stories.d.ts +8 -0
- package/dist/form/LabelledSelect.d.ts +11 -0
- package/dist/form/LabelledSelect.stories.d.ts +15 -0
- package/dist/form/RevealablePasswordInput.d.ts +9 -0
- package/dist/form/RevealablePasswordInput.stories.d.ts +8 -0
- package/dist/form/SearchCombobox.d.ts +35 -0
- package/dist/form/SearchCombobox.stories.d.ts +15 -0
- package/dist/form/SearchInput.d.ts +15 -0
- package/dist/form/SearchInput.stories.d.ts +19 -0
- package/dist/form/Select.d.ts +8 -0
- package/dist/form/Select.stories.d.ts +17 -0
- package/dist/form/TagsAutocomplete.d.ts +33 -0
- package/dist/form/TagsAutocomplete.stories.d.ts +14 -0
- package/dist/form/ToggleSwitch.d.ts +4 -0
- package/dist/form/ToggleSwitch.stories.d.ts +9 -0
- package/dist/form/index.d.ts +14 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/normalize-tag.d.ts +4 -0
- package/dist/helpers/numbers.d.ts +2 -0
- package/dist/helpers/pagination.d.ts +8 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/use-arrow-key-navigation.d.ts +18 -0
- package/dist/hooks/use-go-back.d.ts +1 -0
- package/dist/hooks/use-parsed-query.d.ts +1 -0
- package/dist/hooks/use-tags-search.d.ts +34 -0
- package/dist/hooks/use-timeout-toggle.d.ts +14 -0
- package/dist/hooks/use-timeout.d.ts +15 -0
- package/dist/hooks/use-toggle.d.ts +7 -0
- package/dist/index.d.ts +11 -1651
- package/dist/index.js +1311 -1647
- package/dist/navigation/Dropdown.d.ts +32 -0
- package/dist/navigation/Dropdown.stories.d.ts +36 -0
- package/dist/navigation/LinkButton.d.ts +8 -0
- package/dist/navigation/LinkButton.stories.d.ts +10 -0
- package/dist/navigation/Menu.d.ts +35 -0
- package/dist/navigation/Menu.stories.d.ts +16 -0
- package/dist/navigation/NavBar.d.ts +16 -0
- package/dist/navigation/NavBar.stories.d.ts +18 -0
- package/dist/navigation/NavPills.d.ts +10 -0
- package/dist/navigation/NavPills.stories.d.ts +13 -0
- package/dist/navigation/Paginator.d.ts +10 -0
- package/dist/navigation/Paginator.stories.d.ts +18 -0
- package/dist/navigation/RowDropdown.d.ts +11 -0
- package/dist/navigation/RowDropdown.stories.d.ts +24 -0
- package/dist/navigation/index.d.ts +7 -0
- package/dist/ordering/OrderingDropdown.d.ts +12 -0
- package/dist/ordering/OrderingDropdown.stories.d.ts +17 -0
- package/dist/ordering/index.d.ts +2 -0
- package/dist/ordering/ordering.d.ts +25 -0
- package/dist/surfaces/Card.d.ts +7 -0
- package/dist/surfaces/Card.stories.d.ts +12 -0
- package/dist/surfaces/SimpleCard.d.ts +16 -0
- package/dist/surfaces/SimpleCard.stories.d.ts +11 -0
- package/dist/surfaces/index.d.ts +2 -0
- package/dist/theme/index.d.ts +15 -0
- package/dist/types.d.ts +3 -0
- package/dist/utils/CopyToClipboardButton.d.ts +13 -0
- package/dist/utils/CopyToClipboardButton.stories.d.ts +8 -0
- package/dist/utils/colors.d.ts +9 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/query.d.ts +12 -0
- package/package.json +26 -20
package/dist/index.js
CHANGED
|
@@ -1,1664 +1,1328 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Link as
|
|
5
|
-
import {
|
|
6
|
-
import { FontAwesomeIcon as
|
|
7
|
-
import {
|
|
8
|
-
import { faClone as
|
|
9
|
-
import { createPortal as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)), Ke = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
className: d(
|
|
34
|
-
"p-4 bg-lm-primary dark:bg-dm-primary first:rounded-t-md",
|
|
35
|
-
"first:rounded-t-md last:rounded-b-md",
|
|
36
|
-
e
|
|
37
|
-
),
|
|
38
|
-
...r,
|
|
39
|
-
ref: t
|
|
40
|
-
}
|
|
41
|
-
)), We = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
42
|
-
"div",
|
|
43
|
-
{
|
|
44
|
-
className: d(
|
|
45
|
-
"px-4 py-3 rounded-b-md",
|
|
46
|
-
"bg-lm-primary dark:bg-dm-primary border-t border-lm-border dark:border-dm-border",
|
|
47
|
-
e
|
|
48
|
-
),
|
|
49
|
-
...r,
|
|
50
|
-
ref: t
|
|
51
|
-
}
|
|
52
|
-
)), qe = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
className: d(
|
|
56
|
-
"group/card rounded-md shadow-md",
|
|
57
|
-
"border border-lm-border dark:border-dm-border bg-lm-primary dark:bg-dm-primary",
|
|
58
|
-
e
|
|
59
|
-
),
|
|
60
|
-
...r,
|
|
61
|
-
ref: t
|
|
62
|
-
}
|
|
63
|
-
)), I = Object.assign(qe, { Body: Ke, Header: Ge, Footer: We }), Qe = k(({ bodyClassName: e, children: r, ...t }, n) => {
|
|
64
|
-
const { title: o, titleSize: s = "md", ...l } = "title" in t ? t : {
|
|
65
|
-
...t,
|
|
66
|
-
title: void 0,
|
|
67
|
-
titleSize: void 0
|
|
68
|
-
};
|
|
69
|
-
return /* @__PURE__ */ g(I, { ...l, ref: n, children: [
|
|
70
|
-
o && /* @__PURE__ */ g(I.Header, { children: [
|
|
71
|
-
s === "lg" && /* @__PURE__ */ a("h4", { children: o }),
|
|
72
|
-
s === "md" && /* @__PURE__ */ a("h5", { children: o }),
|
|
73
|
-
s === "sm" && /* @__PURE__ */ a("h6", { children: o })
|
|
74
|
-
] }),
|
|
75
|
-
/* @__PURE__ */ a(I.Body, { className: e, children: r })
|
|
76
|
-
] });
|
|
1
|
+
import { clsx as e } from "clsx";
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useId as a, useImperativeHandle as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
3
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
|
+
import { Link as p, NavLink as m, useLocation as h, useNavigate as g } from "react-router";
|
|
5
|
+
import { faCaretDown as _, faCheck as v, faChevronDown as y, faChevronLeft as b, faChevronRight as x, faChevronUp as S, faCircleNotch as C, faClose as w, faEllipsisV as T, faEye as E, faEyeSlash as ee, faSearch as D, faSortAmountDown as O, faSortAmountUp as k } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import { FontAwesomeIcon as A } from "@fortawesome/react-fontawesome";
|
|
7
|
+
import { arrow as j, autoPlacement as te, flip as ne, offset as re, useClick as ie, useFloating as ae, useHover as oe, useInteractions as se, useTransitionStyles as ce } from "@floating-ui/react";
|
|
8
|
+
import { faClone as le } from "@fortawesome/free-regular-svg-icons";
|
|
9
|
+
import { createPortal as ue } from "react-dom";
|
|
10
|
+
//#region src/content/Details.tsx
|
|
11
|
+
var de = ({ children: t, summary: n, summaryClasses: r, ...a }) => {
|
|
12
|
+
let o = c(null), [s, u] = l(!1);
|
|
13
|
+
return i(() => {
|
|
14
|
+
let e = o.current, t = () => u(!!e?.open);
|
|
15
|
+
return e?.addEventListener("toggle", t), () => e?.removeEventListener("toggle", t);
|
|
16
|
+
}, []), /* @__PURE__ */ f("details", {
|
|
17
|
+
ref: o,
|
|
18
|
+
...a,
|
|
19
|
+
children: [/* @__PURE__ */ d("summary", {
|
|
20
|
+
className: e("focus-ring px-1 -mx-1 rounded-sm", r),
|
|
21
|
+
children: n
|
|
22
|
+
}), s && /* @__PURE__ */ d("div", {
|
|
23
|
+
className: "mt-3 flex flex-col gap-y-3",
|
|
24
|
+
children: t
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
}, fe = ({ className: t, ...n }) => /* @__PURE__ */ d("div", {
|
|
28
|
+
className: e("px-4 py-3 rounded-t-md", "bg-lm-primary dark:bg-dm-primary border-b border-lm-border dark:border-dm-border", t),
|
|
29
|
+
...n
|
|
77
30
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
31
|
+
fe.displayName = "Card.Header";
|
|
32
|
+
var pe = ({ className: t, ...n }) => /* @__PURE__ */ d("div", {
|
|
33
|
+
className: e("p-4 bg-lm-primary dark:bg-dm-primary first:rounded-t-md", "first:rounded-t-md last:rounded-b-md", t),
|
|
34
|
+
...n
|
|
35
|
+
});
|
|
36
|
+
pe.displayName = "Card.Body";
|
|
37
|
+
var me = ({ className: t, ...n }) => /* @__PURE__ */ d("div", {
|
|
38
|
+
className: e("px-4 py-3 rounded-b-md", "bg-lm-primary dark:bg-dm-primary border-t border-lm-border dark:border-dm-border", t),
|
|
39
|
+
...n
|
|
40
|
+
});
|
|
41
|
+
me.displayName = "Card.Footer";
|
|
42
|
+
var he = ({ className: t, ...n }) => /* @__PURE__ */ d("div", {
|
|
43
|
+
className: e("group/card rounded-md shadow-md", "border border-lm-border dark:border-dm-border bg-lm-primary dark:bg-dm-primary", t),
|
|
44
|
+
...n
|
|
45
|
+
});
|
|
46
|
+
he.displayName = "Card";
|
|
47
|
+
var M = Object.assign(he, {
|
|
48
|
+
Body: pe,
|
|
49
|
+
Header: fe,
|
|
50
|
+
Footer: me
|
|
51
|
+
}), ge = ({ bodyClassName: e, children: t, ...n }) => {
|
|
52
|
+
let { title: r, titleSize: i = "md", ...a } = "title" in n ? n : {
|
|
53
|
+
...n,
|
|
54
|
+
title: void 0,
|
|
55
|
+
titleSize: void 0
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ f(M, {
|
|
58
|
+
...a,
|
|
59
|
+
children: [r && /* @__PURE__ */ f(M.Header, { children: [
|
|
60
|
+
i === "lg" && /* @__PURE__ */ d("h4", { children: r }),
|
|
61
|
+
i === "md" && /* @__PURE__ */ d("h5", { children: r }),
|
|
62
|
+
i === "sm" && /* @__PURE__ */ d("h6", { children: r })
|
|
63
|
+
] }), /* @__PURE__ */ d(M.Body, {
|
|
64
|
+
className: e,
|
|
65
|
+
children: t
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/content/Listbox.tsx
|
|
71
|
+
function _e({ id: t, items: r, onSelectItem: a, onActiveItemChange: o, renderItem: s, className: c, noItemsMessage: u = "No items", anchor: p, "aria-label": m = "Items", ...h }) {
|
|
72
|
+
let [g, _] = l(0), v = n((e) => {
|
|
73
|
+
if (_(e), o) {
|
|
74
|
+
let [t, n] = [...r.entries()][e];
|
|
75
|
+
o(t, n);
|
|
76
|
+
}
|
|
77
|
+
}, [r, o]);
|
|
78
|
+
return i(() => {
|
|
79
|
+
let e = p?.current;
|
|
80
|
+
if (!e) return;
|
|
81
|
+
let t = (e) => {
|
|
82
|
+
[
|
|
83
|
+
"Enter",
|
|
84
|
+
"ArrowUp",
|
|
85
|
+
"ArrowDown"
|
|
86
|
+
].includes(e.key) && e.preventDefault(), e.key === "ArrowDown" ? v(Math.min(g + 1, r.size - 1)) : e.key === "ArrowUp" ? v(Math.max(g - 1, 0)) : e.key === "Enter" && a([...r.values()][g]);
|
|
87
|
+
};
|
|
88
|
+
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
89
|
+
}, [
|
|
90
|
+
g,
|
|
91
|
+
p,
|
|
92
|
+
v,
|
|
93
|
+
r,
|
|
94
|
+
a
|
|
95
|
+
]), /* @__PURE__ */ f(M, {
|
|
96
|
+
id: t,
|
|
97
|
+
className: e("py-1 flex flex-col", c),
|
|
98
|
+
role: "listbox",
|
|
99
|
+
"aria-orientation": "vertical",
|
|
100
|
+
"aria-label": m,
|
|
101
|
+
...h,
|
|
102
|
+
children: [r.size === 0 && /* @__PURE__ */ d("i", {
|
|
103
|
+
role: "option",
|
|
104
|
+
"aria-disabled": !0,
|
|
105
|
+
"aria-selected": !1,
|
|
106
|
+
"data-testid": "no-items",
|
|
107
|
+
className: "px-2 py-1",
|
|
108
|
+
children: u
|
|
109
|
+
}), [...r.entries()].map(([n, r], i) => /* @__PURE__ */ d("button", {
|
|
110
|
+
id: `${t}_${n}`,
|
|
111
|
+
type: "button",
|
|
112
|
+
role: "option",
|
|
113
|
+
"aria-selected": i === g,
|
|
114
|
+
className: e("px-2 py-1 text-left truncate", { "bg-lm-secondary dark:bg-dm-secondary": i === g }),
|
|
115
|
+
tabIndex: -1,
|
|
116
|
+
onClick: () => a(r),
|
|
117
|
+
onMouseOver: () => v(i),
|
|
118
|
+
children: s(r)
|
|
119
|
+
}, n))]
|
|
120
|
+
});
|
|
136
121
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
);
|
|
217
|
-
}, et = ({ header: e, footer: r, children: t, responsive: n = !0, size: o = "md", ...s }) => /* @__PURE__ */ a(M.Provider, { value: { responsive: n, size: o }, children: /* @__PURE__ */ g("table", { className: "w-full", ...s, children: [
|
|
218
|
-
/* @__PURE__ */ a(Xe, { children: e }),
|
|
219
|
-
/* @__PURE__ */ a(Je, { children: t }),
|
|
220
|
-
r && /* @__PURE__ */ a(Ze, { children: r })
|
|
221
|
-
] }) }), rr = Object.assign(et, { Row: Ve, Cell: ze }), ie = k(({
|
|
222
|
-
className: e,
|
|
223
|
-
disabled: r,
|
|
224
|
-
variant: t = "primary",
|
|
225
|
-
size: n = "md",
|
|
226
|
-
inline: o = !1,
|
|
227
|
-
solid: s = !1,
|
|
228
|
-
type: l = "button",
|
|
229
|
-
...i
|
|
230
|
-
}, c) => {
|
|
231
|
-
const u = "to" in i && typeof i.to == "string", b = u ? W : "button", x = u ? void 0 : l;
|
|
232
|
-
return /* @__PURE__ */ a(
|
|
233
|
-
b,
|
|
234
|
-
{
|
|
235
|
-
ref: c,
|
|
236
|
-
className: d(
|
|
237
|
-
{
|
|
238
|
-
"inline-flex": o,
|
|
239
|
-
flex: !o
|
|
240
|
-
},
|
|
241
|
-
"gap-2 items-center justify-center",
|
|
242
|
-
"border rounded-md no-underline",
|
|
243
|
-
"transition-colors",
|
|
244
|
-
{
|
|
245
|
-
"focus-ring": t === "primary",
|
|
246
|
-
"focus-ring-secondary": t === "secondary",
|
|
247
|
-
"focus-ring-danger": t === "danger"
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"px-1.5 py-1 text-sm": n === "sm",
|
|
251
|
-
"px-3 py-1.5": n === "md",
|
|
252
|
-
"px-4 py-2 text-lg": n === "lg"
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
"border-lm-brand dark:border-dm-brand": t === "primary",
|
|
256
|
-
"text-lm-brand dark:text-dm-brand": t === "primary" && !s,
|
|
257
|
-
"border-zinc-500": t === "secondary",
|
|
258
|
-
"text-zinc-500": t === "secondary" && !s,
|
|
259
|
-
"border-danger": t === "danger",
|
|
260
|
-
"text-danger": t === "danger" && !s
|
|
261
|
-
},
|
|
262
|
-
s && {
|
|
263
|
-
"text-white": !0,
|
|
264
|
-
"bg-lm-brand dark:bg-dm-brand": t === "primary",
|
|
265
|
-
"highlight:bg-lm-brand-dark dark:highlight:bg-dm-brand-dark": t === "primary",
|
|
266
|
-
"highlight:border-lm-brand-dark dark:highlight:border-dm-brand-dark": t === "primary",
|
|
267
|
-
"bg-zinc-500": t === "secondary",
|
|
268
|
-
"highlight:bg-zinc-600 highlight:border-zinc-600": t === "secondary",
|
|
269
|
-
"bg-danger": t === "danger",
|
|
270
|
-
"highlight:bg-danger-dark highlight:border-danger-dark": t === "danger"
|
|
271
|
-
},
|
|
272
|
-
!r && {
|
|
273
|
-
"highlight:text-white": !s,
|
|
274
|
-
"highlight:bg-lm-brand dark:highlight:bg-dm-brand": t === "primary",
|
|
275
|
-
"highlight:bg-zinc-500": t === "secondary",
|
|
276
|
-
"highlight:bg-danger": t === "danger"
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
"cursor-pointer": !r,
|
|
280
|
-
"pointer-events-none opacity-65": r
|
|
281
|
-
},
|
|
282
|
-
e
|
|
283
|
-
),
|
|
284
|
-
disabled: u ? void 0 : r,
|
|
285
|
-
"aria-disabled": u ? r : void 0,
|
|
286
|
-
type: x,
|
|
287
|
-
...i
|
|
288
|
-
}
|
|
289
|
-
);
|
|
290
|
-
}), de = k(({ className: e, onChange: r, ...t }, n) => {
|
|
291
|
-
const o = w((s) => r?.(s.target.checked, s), [r]);
|
|
292
|
-
return /* @__PURE__ */ a(
|
|
293
|
-
"input",
|
|
294
|
-
{
|
|
295
|
-
ref: n,
|
|
296
|
-
type: "checkbox",
|
|
297
|
-
className: d(
|
|
298
|
-
"appearance-none focus-ring cursor-[inherit]",
|
|
299
|
-
"border-1 border-lm-input-border dark:border-dm-input-border",
|
|
300
|
-
"bg-lm-primary dark:bg-dm-primary checked:bg-lm-brand dark:checked:bg-dm-brand bg-no-repeat",
|
|
301
|
-
// Use different background color when rendered inside a card
|
|
302
|
-
"group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input",
|
|
303
|
-
e
|
|
304
|
-
),
|
|
305
|
-
onChange: o,
|
|
306
|
-
...t
|
|
307
|
-
}
|
|
308
|
-
);
|
|
309
|
-
}), nr = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
310
|
-
de,
|
|
311
|
-
{
|
|
312
|
-
ref: t,
|
|
313
|
-
className: d("rounded-sm min-w-4 w-4 h-4 checked:bg-(image:--tick) bg-center", e),
|
|
314
|
-
...r
|
|
315
|
-
}
|
|
316
|
-
)), Y = k(({ onClick: e, className: r, label: t = "Close", size: n = "lg", solid: o }, s) => /* @__PURE__ */ a(
|
|
317
|
-
"button",
|
|
318
|
-
{
|
|
319
|
-
ref: s,
|
|
320
|
-
type: "button",
|
|
321
|
-
onClick: e,
|
|
322
|
-
className: d(
|
|
323
|
-
"rounded-md focus-ring cursor-pointer",
|
|
324
|
-
{
|
|
325
|
-
"opacity-50 highlight:opacity-80 transition-opacity": !o
|
|
326
|
-
},
|
|
327
|
-
r
|
|
328
|
-
),
|
|
329
|
-
"aria-label": t,
|
|
330
|
-
children: /* @__PURE__ */ a(N, { icon: Ne, size: n === "lg" ? "xl" : n === "md" ? "lg" : void 0 })
|
|
331
|
-
}
|
|
332
|
-
)), J = k(({
|
|
333
|
-
borderless: e = !1,
|
|
334
|
-
size: r = "md",
|
|
335
|
-
feedback: t,
|
|
336
|
-
variant: n = "default",
|
|
337
|
-
className: o,
|
|
338
|
-
disabled: s,
|
|
339
|
-
...l
|
|
340
|
-
}, i) => /* @__PURE__ */ a(
|
|
341
|
-
"input",
|
|
342
|
-
{
|
|
343
|
-
ref: i,
|
|
344
|
-
className: d(
|
|
345
|
-
"outline-none",
|
|
346
|
-
n === "default" && [
|
|
347
|
-
"w-full",
|
|
348
|
-
{
|
|
349
|
-
"focus-ring": !t,
|
|
350
|
-
"focus-ring-danger": t === "error",
|
|
351
|
-
"px-2 py-1 text-sm": r === "sm",
|
|
352
|
-
"px-3 py-1.5": r === "md",
|
|
353
|
-
"px-4 py-2 text-xl": r === "lg",
|
|
354
|
-
"rounded-md border": !e,
|
|
355
|
-
"border-lm-input-border dark:border-dm-input-border": !e && !t,
|
|
356
|
-
"border-danger": !e && t === "error",
|
|
357
|
-
"bg-lm-disabled-input dark:bg-dm-disabled-input": s,
|
|
358
|
-
"bg-lm-primary dark:bg-dm-primary": !s,
|
|
359
|
-
// Use different background color when rendered inside a card
|
|
360
|
-
"group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !s
|
|
361
|
-
}
|
|
362
|
-
],
|
|
363
|
-
o
|
|
364
|
-
),
|
|
365
|
-
disabled: s,
|
|
366
|
-
...l
|
|
367
|
-
}
|
|
368
|
-
)), Z = ({ required: e, children: r, className: t, ...n }) => /* @__PURE__ */ g("label", { className: d("cursor-pointer", t), ...n, children: [
|
|
369
|
-
r,
|
|
370
|
-
e && /* @__PURE__ */ a("span", { className: "text-danger ml-1", "data-testid": "required-indicator", children: "*" })
|
|
371
|
-
] }), V = ({ children: e, helpText: r, error: t, "data-testid": n }) => /* @__PURE__ */ g("div", { className: "flex flex-col gap-1", "data-testid": n, children: [
|
|
372
|
-
e,
|
|
373
|
-
r && /* @__PURE__ */ a(
|
|
374
|
-
"small",
|
|
375
|
-
{
|
|
376
|
-
"data-testid": n ? `${n}-help-text` : "help-text",
|
|
377
|
-
className: "text-gray-500 dark:text-gray-400",
|
|
378
|
-
children: r
|
|
379
|
-
}
|
|
380
|
-
),
|
|
381
|
-
t && /* @__PURE__ */ a("span", { "data-testid": n ? `${n}-error` : "error", className: "text-danger", children: t })
|
|
382
|
-
] }), or = k(({ label: e, inputClassName: r, required: t, hiddenRequired: n, error: o, helpText: s, "data-testid": l, ...i }, c) => {
|
|
383
|
-
const u = S();
|
|
384
|
-
return /* @__PURE__ */ g(V, { error: o, helpText: s, "data-testid": l, children: [
|
|
385
|
-
/* @__PURE__ */ a(Z, { htmlFor: u, required: t, children: e }),
|
|
386
|
-
/* @__PURE__ */ a(
|
|
387
|
-
J,
|
|
388
|
-
{
|
|
389
|
-
ref: c,
|
|
390
|
-
id: u,
|
|
391
|
-
className: r,
|
|
392
|
-
required: t || n,
|
|
393
|
-
feedback: o ? "error" : void 0,
|
|
394
|
-
...i
|
|
395
|
-
}
|
|
396
|
-
)
|
|
397
|
-
] });
|
|
398
|
-
}), tt = k(({ containerClassName: e, className: r, size: t, ...n }, o) => {
|
|
399
|
-
const { flag: s, toggle: l, setToFalse: i } = ue(), c = C(null), u = w(({ relatedTarget: b }) => {
|
|
400
|
-
c.current?.contains(b) || i();
|
|
401
|
-
}, [c, i]);
|
|
402
|
-
return /* @__PURE__ */ g(
|
|
403
|
-
"div",
|
|
404
|
-
{
|
|
405
|
-
className: d("group relative", e),
|
|
406
|
-
ref: c,
|
|
407
|
-
onBlurCapture: u,
|
|
408
|
-
children: [
|
|
409
|
-
/* @__PURE__ */ a(
|
|
410
|
-
J,
|
|
411
|
-
{
|
|
412
|
-
ref: o,
|
|
413
|
-
type: s ? "text" : "password",
|
|
414
|
-
className: d(
|
|
415
|
-
{
|
|
416
|
-
"pr-10": t !== "sm",
|
|
417
|
-
"pr-8": t === "sm"
|
|
418
|
-
},
|
|
419
|
-
r
|
|
420
|
-
),
|
|
421
|
-
size: t,
|
|
422
|
-
"data-testid": "input",
|
|
423
|
-
...n
|
|
424
|
-
}
|
|
425
|
-
),
|
|
426
|
-
/* @__PURE__ */ a(
|
|
427
|
-
"button",
|
|
428
|
-
{
|
|
429
|
-
type: "button",
|
|
430
|
-
onClick: l,
|
|
431
|
-
title: s ? "Hide password" : "Show password",
|
|
432
|
-
"aria-label": s ? "Hide password" : "Show password",
|
|
433
|
-
className: d(
|
|
434
|
-
"absolute top-[50%] translate-y-[-50%] px-1 cursor-pointer",
|
|
435
|
-
"text-placeholder hover:text-lm-text hover:dark:text-dm-text transition-colors",
|
|
436
|
-
{
|
|
437
|
-
"right-1.5": t !== "sm",
|
|
438
|
-
"scale-85 right-1": t === "sm"
|
|
439
|
-
}
|
|
440
|
-
),
|
|
441
|
-
tabIndex: -1,
|
|
442
|
-
children: /* @__PURE__ */ a(N, { icon: s ? Ce : Te })
|
|
443
|
-
}
|
|
444
|
-
)
|
|
445
|
-
]
|
|
446
|
-
}
|
|
447
|
-
);
|
|
448
|
-
}), ar = k(({ label: e, inputClassName: r, required: t, hiddenRequired: n, error: o, helpText: s, "data-testid": l, ...i }, c) => {
|
|
449
|
-
const u = S();
|
|
450
|
-
return /* @__PURE__ */ g(V, { error: o, helpText: s, "data-testid": l, children: [
|
|
451
|
-
/* @__PURE__ */ a(Z, { htmlFor: u, required: t, children: e }),
|
|
452
|
-
/* @__PURE__ */ a(
|
|
453
|
-
tt,
|
|
454
|
-
{
|
|
455
|
-
ref: c,
|
|
456
|
-
id: u,
|
|
457
|
-
className: r,
|
|
458
|
-
required: t || n,
|
|
459
|
-
feedback: o ? "error" : void 0,
|
|
460
|
-
...i
|
|
461
|
-
}
|
|
462
|
-
)
|
|
463
|
-
] });
|
|
464
|
-
}), rt = k(({
|
|
465
|
-
className: e,
|
|
466
|
-
size: r = "md",
|
|
467
|
-
feedback: t,
|
|
468
|
-
disabled: n,
|
|
469
|
-
...o
|
|
470
|
-
}, s) => /* @__PURE__ */ a(
|
|
471
|
-
"select",
|
|
472
|
-
{
|
|
473
|
-
ref: s,
|
|
474
|
-
className: d(
|
|
475
|
-
"w-full rounded-md border appearance-none pr-9",
|
|
476
|
-
"bg-(image:--chevron-down) bg-no-repeat bg-position-[right_0.75rem_center] bg-size-[16px_12px]",
|
|
477
|
-
{
|
|
478
|
-
"focus-ring": !t,
|
|
479
|
-
"focus-ring-danger": t === "error",
|
|
480
|
-
"border-lm-input-border dark:border-dm-input-border": !t,
|
|
481
|
-
"border-danger": t === "error",
|
|
482
|
-
"pl-2 py-1 text-sm": r === "sm",
|
|
483
|
-
"pl-3 py-1.5": r === "md",
|
|
484
|
-
"pl-4 py-2 text-xl": r === "lg",
|
|
485
|
-
"bg-lm-disabled-input dark:bg-dm-disabled-input": n,
|
|
486
|
-
// Apply different background color when rendered inside a card
|
|
487
|
-
"bg-lm-primary dark:bg-dm-primary group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !n
|
|
488
|
-
},
|
|
489
|
-
e
|
|
490
|
-
),
|
|
491
|
-
disabled: n,
|
|
492
|
-
...o
|
|
493
|
-
}
|
|
494
|
-
)), sr = k(({ selectClassName: e, label: r, error: t, helpText: n, required: o, hiddenRequired: s, "data-testid": l, ...i }, c) => {
|
|
495
|
-
const u = S();
|
|
496
|
-
return /* @__PURE__ */ g(V, { error: t, helpText: n, "data-testid": l, children: [
|
|
497
|
-
/* @__PURE__ */ a(Z, { htmlFor: u, required: o, children: r }),
|
|
498
|
-
/* @__PURE__ */ a(
|
|
499
|
-
rt,
|
|
500
|
-
{
|
|
501
|
-
ref: c,
|
|
502
|
-
id: u,
|
|
503
|
-
className: e,
|
|
504
|
-
required: o || s,
|
|
505
|
-
feedback: t ? "error" : void 0,
|
|
506
|
-
...i
|
|
507
|
-
}
|
|
508
|
-
)
|
|
509
|
-
] });
|
|
510
|
-
}), nt = k(({
|
|
511
|
-
onChange: e,
|
|
512
|
-
containerClassName: r,
|
|
513
|
-
inputClassName: t,
|
|
514
|
-
// Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
|
|
515
|
-
size: n = "lg",
|
|
516
|
-
loading: o = !1,
|
|
517
|
-
variant: s = "default",
|
|
518
|
-
immediate: l = !1,
|
|
519
|
-
...i
|
|
520
|
-
}, c) => {
|
|
521
|
-
const { setTimeout: u, clearCurrentTimeout: b } = me(500), x = w((f) => {
|
|
522
|
-
!f || l ? (b(), e(f)) : u(() => e(f));
|
|
523
|
-
}, [b, l, e, u]);
|
|
524
|
-
return /* @__PURE__ */ g("div", { className: d("group relative focus-within:z-10", r), children: [
|
|
525
|
-
s === "default" && /* @__PURE__ */ a(
|
|
526
|
-
N,
|
|
527
|
-
{
|
|
528
|
-
icon: o ? ae : Ae,
|
|
529
|
-
spin: o,
|
|
530
|
-
className: d(
|
|
531
|
-
"absolute top-[50%] translate-y-[-50%] transition-colors",
|
|
532
|
-
"text-placeholder group-focus-within:text-lm-text dark:group-focus-within:text-dm-text",
|
|
533
|
-
{
|
|
534
|
-
"left-3": n !== "sm",
|
|
535
|
-
"scale-85 left-2": n === "sm"
|
|
536
|
-
}
|
|
537
|
-
)
|
|
538
|
-
}
|
|
539
|
-
),
|
|
540
|
-
/* @__PURE__ */ a(
|
|
541
|
-
J,
|
|
542
|
-
{
|
|
543
|
-
ref: c,
|
|
544
|
-
variant: s,
|
|
545
|
-
type: "search",
|
|
546
|
-
className: d(
|
|
547
|
-
s === "default" && {
|
|
548
|
-
"pl-9": n !== "sm",
|
|
549
|
-
"pl-7": n === "sm"
|
|
550
|
-
},
|
|
551
|
-
t
|
|
552
|
-
),
|
|
553
|
-
placeholder: "Search...",
|
|
554
|
-
onChange: (f) => x(f.target.value),
|
|
555
|
-
size: n,
|
|
556
|
-
...i
|
|
557
|
-
}
|
|
558
|
-
)
|
|
559
|
-
] });
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/content/Table.tsx
|
|
124
|
+
var N = t(void 0), P = t({
|
|
125
|
+
responsive: !0,
|
|
126
|
+
size: "md"
|
|
127
|
+
}), ve = ({ children: t, className: n }) => {
|
|
128
|
+
let { responsive: i } = r(P);
|
|
129
|
+
return /* @__PURE__ */ d(N.Provider, {
|
|
130
|
+
value: { section: "head" },
|
|
131
|
+
children: /* @__PURE__ */ d("thead", {
|
|
132
|
+
className: e({ "hidden lg:table-header-group": i }, n),
|
|
133
|
+
children: t
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
}, ye = ({ children: t, className: n }) => {
|
|
137
|
+
let { responsive: i } = r(P);
|
|
138
|
+
return /* @__PURE__ */ d(N.Provider, {
|
|
139
|
+
value: { section: "body" },
|
|
140
|
+
children: /* @__PURE__ */ d("tbody", {
|
|
141
|
+
className: e({ "lg:table-row-group flex flex-col gap-y-3": i }, n),
|
|
142
|
+
children: t
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}, be = ({ children: t, className: n }) => {
|
|
146
|
+
let { responsive: i } = r(P);
|
|
147
|
+
return /* @__PURE__ */ d(N.Provider, {
|
|
148
|
+
value: { section: "footer" },
|
|
149
|
+
children: /* @__PURE__ */ d("tfoot", {
|
|
150
|
+
className: e({ "lg:table-row-group flex flex-col gap-y-3 mt-4": i }, n),
|
|
151
|
+
children: t
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}, F = ({ children: t, className: n, ...i }) => {
|
|
155
|
+
let a = r(N)?.section === "body", { responsive: o } = r(P);
|
|
156
|
+
return /* @__PURE__ */ d("tr", {
|
|
157
|
+
className: e("group", {
|
|
158
|
+
"lg:table-row flex flex-col": o,
|
|
159
|
+
"lg:border-0 border-y-2 border-lm-border dark:border-dm-border": o,
|
|
160
|
+
"hover:bg-lm-primary dark:hover:bg-dm-primary": a,
|
|
161
|
+
"group-[&]/card:hover:bg-lm-secondary dark:group-[&]/card:hover:bg-dm-secondary": a
|
|
162
|
+
}, n),
|
|
163
|
+
...i,
|
|
164
|
+
children: t
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
F.displayName = "Table.Row";
|
|
168
|
+
var I = ({ children: t, className: n, columnName: i, type: a, ...o }) => {
|
|
169
|
+
let s = r(N), c = a ?? (s?.section === "body" ? "td" : "th"), { responsive: l, size: u } = r(P);
|
|
170
|
+
return /* @__PURE__ */ d(c, {
|
|
171
|
+
"data-column": l ? i : void 0,
|
|
172
|
+
className: e("border-lm-border dark:border-dm-border", {
|
|
173
|
+
"p-1": u === "sm",
|
|
174
|
+
"p-2": u === "md",
|
|
175
|
+
"p-3": u === "lg",
|
|
176
|
+
"border-b-1": !l,
|
|
177
|
+
"block lg:table-cell not-last:border-b-1 lg:border-b-1": l,
|
|
178
|
+
"text-left": c === "th",
|
|
179
|
+
"before:lg:hidden before:content-[attr(data-column)] before:font-bold before:mr-1": l && c === "td"
|
|
180
|
+
}, n),
|
|
181
|
+
...o,
|
|
182
|
+
children: t
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
I.displayName = "Table.Cell";
|
|
186
|
+
var xe = ({ header: e, footer: t, children: n, responsive: r = !0, size: i = "md", ...a }) => /* @__PURE__ */ d(P.Provider, {
|
|
187
|
+
value: {
|
|
188
|
+
responsive: r,
|
|
189
|
+
size: i
|
|
190
|
+
},
|
|
191
|
+
children: /* @__PURE__ */ f("table", {
|
|
192
|
+
className: "w-full",
|
|
193
|
+
...a,
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ d(ve, { children: e }),
|
|
196
|
+
/* @__PURE__ */ d(ye, { children: n }),
|
|
197
|
+
t && /* @__PURE__ */ d(be, { children: t })
|
|
198
|
+
]
|
|
199
|
+
})
|
|
560
200
|
});
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
201
|
+
xe.displayName = "Table";
|
|
202
|
+
var Se = Object.assign(xe, {
|
|
203
|
+
Row: F,
|
|
204
|
+
Cell: I
|
|
205
|
+
}), L = ({ className: t, disabled: n, variant: r = "primary", size: i = "md", inline: a = !1, solid: o = !1, type: s = "button", ref: c, ...l }) => {
|
|
206
|
+
let u = "to" in l && typeof l.to == "string", f = u ? p : "button", m = u ? void 0 : s;
|
|
207
|
+
return /* @__PURE__ */ d(f, {
|
|
208
|
+
ref: c,
|
|
209
|
+
className: e({
|
|
210
|
+
"inline-flex": a,
|
|
211
|
+
flex: !a
|
|
212
|
+
}, "gap-2 items-center justify-center", "border rounded-md no-underline", "transition-colors", {
|
|
213
|
+
"focus-ring": r === "primary",
|
|
214
|
+
"focus-ring-secondary": r === "secondary",
|
|
215
|
+
"focus-ring-danger": r === "danger"
|
|
216
|
+
}, {
|
|
217
|
+
"px-1.5 py-1 text-sm": i === "sm",
|
|
218
|
+
"px-3 py-1.5": i === "md",
|
|
219
|
+
"px-4 py-2 text-lg": i === "lg"
|
|
220
|
+
}, {
|
|
221
|
+
"border-lm-brand dark:border-dm-brand": r === "primary",
|
|
222
|
+
"text-lm-brand dark:text-dm-brand": r === "primary" && !o,
|
|
223
|
+
"border-zinc-500": r === "secondary",
|
|
224
|
+
"text-zinc-500": r === "secondary" && !o,
|
|
225
|
+
"border-danger": r === "danger",
|
|
226
|
+
"text-danger": r === "danger" && !o
|
|
227
|
+
}, o && {
|
|
228
|
+
"text-white": !0,
|
|
229
|
+
"bg-lm-brand dark:bg-dm-brand": r === "primary",
|
|
230
|
+
"highlight:bg-lm-brand-dark dark:highlight:bg-dm-brand-dark": r === "primary",
|
|
231
|
+
"highlight:border-lm-brand-dark dark:highlight:border-dm-brand-dark": r === "primary",
|
|
232
|
+
"bg-zinc-500": r === "secondary",
|
|
233
|
+
"highlight:bg-zinc-600 highlight:border-zinc-600": r === "secondary",
|
|
234
|
+
"bg-danger": r === "danger",
|
|
235
|
+
"highlight:bg-danger-dark highlight:border-danger-dark": r === "danger"
|
|
236
|
+
}, !n && {
|
|
237
|
+
"highlight:text-white": !o,
|
|
238
|
+
"highlight:bg-lm-brand dark:highlight:bg-dm-brand": r === "primary",
|
|
239
|
+
"highlight:bg-zinc-500": r === "secondary",
|
|
240
|
+
"highlight:bg-danger": r === "danger"
|
|
241
|
+
}, {
|
|
242
|
+
"cursor-pointer": !n,
|
|
243
|
+
"pointer-events-none opacity-65": n
|
|
244
|
+
}, t),
|
|
245
|
+
disabled: u ? void 0 : n,
|
|
246
|
+
"aria-disabled": u ? n : void 0,
|
|
247
|
+
type: m,
|
|
248
|
+
...l
|
|
249
|
+
});
|
|
250
|
+
}, Ce = ({ className: t, onChange: r, ref: i, ...a }) => {
|
|
251
|
+
let o = n((e) => r?.(e.target.checked, e), [r]);
|
|
252
|
+
return /* @__PURE__ */ d("input", {
|
|
253
|
+
ref: i,
|
|
254
|
+
type: "checkbox",
|
|
255
|
+
className: e("appearance-none focus-ring cursor-[inherit]", "border-1 border-lm-input-border dark:border-dm-input-border", "bg-lm-primary dark:bg-dm-primary checked:bg-lm-brand dark:checked:bg-dm-brand bg-no-repeat", "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input", t),
|
|
256
|
+
onChange: o,
|
|
257
|
+
...a
|
|
258
|
+
});
|
|
259
|
+
}, we = ({ className: t, ...n }) => /* @__PURE__ */ d(Ce, {
|
|
260
|
+
className: e("rounded-sm min-w-4 w-4 h-4 checked:bg-(image:--tick) bg-center", t),
|
|
261
|
+
...n
|
|
262
|
+
}), R = ({ onClick: t, className: n, label: r = "Close", size: i = "lg", solid: a, ref: o }) => /* @__PURE__ */ d("button", {
|
|
263
|
+
ref: o,
|
|
264
|
+
type: "button",
|
|
265
|
+
onClick: t,
|
|
266
|
+
className: e("rounded-md focus-ring cursor-pointer", { "opacity-50 highlight:opacity-80 transition-opacity": !a }, n),
|
|
267
|
+
"aria-label": r,
|
|
268
|
+
children: /* @__PURE__ */ d(A, {
|
|
269
|
+
icon: w,
|
|
270
|
+
size: i === "lg" ? "xl" : i === "md" ? "lg" : void 0
|
|
271
|
+
})
|
|
272
|
+
}), z = ({ borderless: t = !1, size: n = "md", feedback: r, variant: i = "default", className: a, disabled: o, ref: s, ...c }) => /* @__PURE__ */ d("input", {
|
|
273
|
+
ref: s,
|
|
274
|
+
className: e("outline-none", i === "default" && ["w-full", {
|
|
275
|
+
"focus-ring": !r,
|
|
276
|
+
"focus-ring-danger": r === "error",
|
|
277
|
+
"px-2 py-1 text-sm": n === "sm",
|
|
278
|
+
"px-3 py-1.5": n === "md",
|
|
279
|
+
"px-4 py-2 text-xl": n === "lg",
|
|
280
|
+
"rounded-md border": !t,
|
|
281
|
+
"border-lm-input-border dark:border-dm-input-border": !t && !r,
|
|
282
|
+
"border-danger": !t && r === "error",
|
|
283
|
+
"bg-lm-disabled-input dark:bg-dm-disabled-input": o,
|
|
284
|
+
"bg-lm-primary dark:bg-dm-primary": !o,
|
|
285
|
+
"group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !o
|
|
286
|
+
}], a),
|
|
287
|
+
disabled: o,
|
|
288
|
+
...c
|
|
289
|
+
}), B = ({ required: t, children: n, className: r, ...i }) => /* @__PURE__ */ f("label", {
|
|
290
|
+
className: e("cursor-pointer", r),
|
|
291
|
+
...i,
|
|
292
|
+
children: [n, t && /* @__PURE__ */ d("span", {
|
|
293
|
+
className: "text-danger ml-1",
|
|
294
|
+
"data-testid": "required-indicator",
|
|
295
|
+
children: "*"
|
|
296
|
+
})]
|
|
297
|
+
}), V = ({ children: e, helpText: t, error: n, "data-testid": r }) => /* @__PURE__ */ f("div", {
|
|
298
|
+
className: "flex flex-col gap-1",
|
|
299
|
+
"data-testid": r,
|
|
300
|
+
children: [
|
|
301
|
+
e,
|
|
302
|
+
t && /* @__PURE__ */ d("small", {
|
|
303
|
+
"data-testid": r ? `${r}-help-text` : "help-text",
|
|
304
|
+
className: "text-gray-500 dark:text-gray-400",
|
|
305
|
+
children: t
|
|
306
|
+
}),
|
|
307
|
+
n && /* @__PURE__ */ d("span", {
|
|
308
|
+
"data-testid": r ? `${r}-error` : "error",
|
|
309
|
+
className: "text-danger",
|
|
310
|
+
children: n
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
}), Te = ({ label: e, inputClassName: t, required: n, hiddenRequired: r, error: i, helpText: o, "data-testid": s, ...c }) => {
|
|
314
|
+
let l = a();
|
|
315
|
+
return /* @__PURE__ */ f(V, {
|
|
316
|
+
error: i,
|
|
317
|
+
helpText: o,
|
|
318
|
+
"data-testid": s,
|
|
319
|
+
children: [/* @__PURE__ */ d(B, {
|
|
320
|
+
htmlFor: l,
|
|
321
|
+
required: n,
|
|
322
|
+
children: e
|
|
323
|
+
}), /* @__PURE__ */ d(z, {
|
|
324
|
+
id: l,
|
|
325
|
+
className: t,
|
|
326
|
+
required: n || r,
|
|
327
|
+
feedback: i ? "error" : void 0,
|
|
328
|
+
...c
|
|
329
|
+
})]
|
|
330
|
+
});
|
|
331
|
+
}, Ee = ({ containerClassName: t, className: r, size: i, ...a }) => {
|
|
332
|
+
let { flag: o, toggle: s, setToFalse: l } = J(), u = c(null), p = n(({ relatedTarget: e }) => {
|
|
333
|
+
u.current?.contains(e) || l();
|
|
334
|
+
}, [u, l]);
|
|
335
|
+
return /* @__PURE__ */ f("div", {
|
|
336
|
+
className: e("group relative", t),
|
|
337
|
+
ref: u,
|
|
338
|
+
onBlurCapture: p,
|
|
339
|
+
children: [/* @__PURE__ */ d(z, {
|
|
340
|
+
type: o ? "text" : "password",
|
|
341
|
+
className: e({
|
|
342
|
+
"pr-10": i !== "sm",
|
|
343
|
+
"pr-8": i === "sm"
|
|
344
|
+
}, r),
|
|
345
|
+
size: i,
|
|
346
|
+
"data-testid": "input",
|
|
347
|
+
...a
|
|
348
|
+
}), /* @__PURE__ */ d("button", {
|
|
349
|
+
type: "button",
|
|
350
|
+
onClick: s,
|
|
351
|
+
title: o ? "Hide password" : "Show password",
|
|
352
|
+
"aria-label": o ? "Hide password" : "Show password",
|
|
353
|
+
className: e("absolute top-[50%] translate-y-[-50%] px-1 cursor-pointer", "text-placeholder hover:text-lm-text hover:dark:text-dm-text transition-colors", {
|
|
354
|
+
"right-1.5": i !== "sm",
|
|
355
|
+
"scale-85 right-1": i === "sm"
|
|
356
|
+
}),
|
|
357
|
+
tabIndex: -1,
|
|
358
|
+
children: /* @__PURE__ */ d(A, { icon: o ? ee : E })
|
|
359
|
+
})]
|
|
360
|
+
});
|
|
361
|
+
}, De = ({ label: e, inputClassName: t, required: n, hiddenRequired: r, error: i, helpText: o, "data-testid": s, ...c }) => {
|
|
362
|
+
let l = a();
|
|
363
|
+
return /* @__PURE__ */ f(V, {
|
|
364
|
+
error: i,
|
|
365
|
+
helpText: o,
|
|
366
|
+
"data-testid": s,
|
|
367
|
+
children: [/* @__PURE__ */ d(B, {
|
|
368
|
+
htmlFor: l,
|
|
369
|
+
required: n,
|
|
370
|
+
children: e
|
|
371
|
+
}), /* @__PURE__ */ d(Ee, {
|
|
372
|
+
id: l,
|
|
373
|
+
className: t,
|
|
374
|
+
required: n || r,
|
|
375
|
+
feedback: i ? "error" : void 0,
|
|
376
|
+
...c
|
|
377
|
+
})]
|
|
378
|
+
});
|
|
379
|
+
}, Oe = ({ className: t, size: n = "md", feedback: r, disabled: i, ...a }) => /* @__PURE__ */ d("select", {
|
|
380
|
+
className: e("w-full rounded-md border appearance-none pr-9", "bg-(image:--chevron-down) bg-no-repeat bg-position-[right_0.75rem_center] bg-size-[16px_12px]", {
|
|
381
|
+
"focus-ring": !r,
|
|
382
|
+
"focus-ring-danger": r === "error",
|
|
383
|
+
"border-lm-input-border dark:border-dm-input-border": !r,
|
|
384
|
+
"border-danger": r === "error",
|
|
385
|
+
"pl-2 py-1 text-sm": n === "sm",
|
|
386
|
+
"pl-3 py-1.5": n === "md",
|
|
387
|
+
"pl-4 py-2 text-xl": n === "lg",
|
|
388
|
+
"bg-lm-disabled-input dark:bg-dm-disabled-input": i,
|
|
389
|
+
"bg-lm-primary dark:bg-dm-primary group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !i
|
|
390
|
+
}, t),
|
|
391
|
+
disabled: i,
|
|
392
|
+
...a
|
|
393
|
+
}), ke = ({ selectClassName: e, label: t, error: n, helpText: r, required: i, hiddenRequired: o, "data-testid": s, ...c }) => {
|
|
394
|
+
let l = a();
|
|
395
|
+
return /* @__PURE__ */ f(V, {
|
|
396
|
+
error: n,
|
|
397
|
+
helpText: r,
|
|
398
|
+
"data-testid": s,
|
|
399
|
+
children: [/* @__PURE__ */ d(B, {
|
|
400
|
+
htmlFor: l,
|
|
401
|
+
required: i,
|
|
402
|
+
children: t
|
|
403
|
+
}), /* @__PURE__ */ d(Oe, {
|
|
404
|
+
id: l,
|
|
405
|
+
className: e,
|
|
406
|
+
required: i || o,
|
|
407
|
+
feedback: n ? "error" : void 0,
|
|
408
|
+
...c
|
|
409
|
+
})]
|
|
410
|
+
});
|
|
411
|
+
}, Ae = ({ onChange: t, containerClassName: r, inputClassName: i, size: a = "lg", loading: o = !1, variant: s = "default", immediate: c = !1, ...l }) => {
|
|
412
|
+
let { setTimeout: u, clearCurrentTimeout: p } = q(500), m = n((e) => {
|
|
413
|
+
!e || c ? (p(), t(e)) : u(() => t(e));
|
|
414
|
+
}, [
|
|
415
|
+
p,
|
|
416
|
+
c,
|
|
417
|
+
t,
|
|
418
|
+
u
|
|
419
|
+
]);
|
|
420
|
+
return /* @__PURE__ */ f("div", {
|
|
421
|
+
className: e("group relative focus-within:z-10", r),
|
|
422
|
+
children: [s === "default" && /* @__PURE__ */ d(A, {
|
|
423
|
+
icon: o ? C : D,
|
|
424
|
+
spin: o,
|
|
425
|
+
className: e("absolute top-[50%] translate-y-[-50%] transition-colors", "text-placeholder group-focus-within:text-lm-text dark:group-focus-within:text-dm-text", {
|
|
426
|
+
"left-3": a !== "sm",
|
|
427
|
+
"scale-85 left-2": a === "sm"
|
|
428
|
+
})
|
|
429
|
+
}), /* @__PURE__ */ d(z, {
|
|
430
|
+
variant: s,
|
|
431
|
+
type: "search",
|
|
432
|
+
className: e(s === "default" && {
|
|
433
|
+
"pl-9": a !== "sm",
|
|
434
|
+
"pl-7": a === "sm"
|
|
435
|
+
}, i),
|
|
436
|
+
placeholder: "Search...",
|
|
437
|
+
onChange: (e) => m(e.target.value),
|
|
438
|
+
size: a,
|
|
439
|
+
...l
|
|
440
|
+
})]
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/form/SearchCombobox.tsx
|
|
445
|
+
function je({ searchResults: t, onSearch: r, onSelectSearchResult: i, renderSearchResult: u, size: p = "md", listboxSpan: m = "full", onFocus: h, containerClassName: g, listboxClassName: _, ref: v, ...y }) {
|
|
446
|
+
let b = a(), [x, S] = l(), C = c(null);
|
|
447
|
+
o(v, () => C.current);
|
|
448
|
+
let w = s(() => t ? x ?? [...t.keys()][0] : void 0, [x, t]), T = n((e) => {
|
|
449
|
+
i(e), r(""), C.current.value = "";
|
|
450
|
+
}, [
|
|
451
|
+
r,
|
|
452
|
+
i,
|
|
453
|
+
C
|
|
454
|
+
]);
|
|
455
|
+
return /* @__PURE__ */ f("div", {
|
|
456
|
+
className: e("relative", g),
|
|
457
|
+
onBlur: (e) => {
|
|
458
|
+
e.currentTarget.contains(e.relatedTarget) || r("");
|
|
459
|
+
},
|
|
460
|
+
children: [/* @__PURE__ */ d(Ae, {
|
|
461
|
+
onChange: r,
|
|
462
|
+
size: p,
|
|
463
|
+
ref: C,
|
|
464
|
+
role: "combobox",
|
|
465
|
+
"aria-autocomplete": "list",
|
|
466
|
+
"aria-expanded": !!t,
|
|
467
|
+
"aria-controls": b,
|
|
468
|
+
"aria-activedescendant": w ? `${b}_${w}` : void 0,
|
|
469
|
+
autoComplete: "off",
|
|
470
|
+
autoCorrect: "off",
|
|
471
|
+
onFocus: (e) => {
|
|
472
|
+
h?.(e), r(e.target.value);
|
|
473
|
+
},
|
|
474
|
+
...y
|
|
475
|
+
}), t && /* @__PURE__ */ d(_e, {
|
|
476
|
+
id: b,
|
|
477
|
+
items: t,
|
|
478
|
+
anchor: C,
|
|
479
|
+
onSelectItem: T,
|
|
480
|
+
onActiveItemChange: S,
|
|
481
|
+
renderItem: u,
|
|
482
|
+
className: e("absolute top-full mt-1 z-10", {
|
|
483
|
+
"min-w-60": m === "auto",
|
|
484
|
+
"w-full": m === "full"
|
|
485
|
+
}, _),
|
|
486
|
+
"aria-label": "Matching items",
|
|
487
|
+
noItemsMessage: "No results found matching search"
|
|
488
|
+
})]
|
|
489
|
+
});
|
|
633
490
|
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
...r
|
|
753
|
-
}
|
|
754
|
-
));
|
|
755
|
-
function it(e, { elementsSelector: r, focusFirstItem: t = !1, vertical: n = !0, horizontal: o = !0 }) {
|
|
756
|
-
const s = P(() => {
|
|
757
|
-
const c = [];
|
|
758
|
-
return n && c.push("ArrowDown"), o && c.push("ArrowRight"), c;
|
|
759
|
-
}, [o, n]), l = P(() => {
|
|
760
|
-
const c = [];
|
|
761
|
-
return n && c.push("ArrowUp"), o && c.push("ArrowLeft"), c;
|
|
762
|
-
}, [o, n]), i = P(() => [...s, ...l], [s, l]);
|
|
763
|
-
R(() => {
|
|
764
|
-
const c = e.current;
|
|
765
|
-
if (!c)
|
|
766
|
-
return () => {
|
|
767
|
-
};
|
|
768
|
-
const u = new AbortController(), b = () => [...c.querySelectorAll(r)], x = b(), f = Math.max(x.findIndex((h) => h.dataset.selected === "true"), 0);
|
|
769
|
-
return x.forEach((h, p) => {
|
|
770
|
-
h.tabIndex = p === f ? 0 : -1, t && p === f && h.focus();
|
|
771
|
-
}), c.addEventListener("keydown", (h) => {
|
|
772
|
-
if (!i.includes(h.key))
|
|
773
|
-
return;
|
|
774
|
-
h.preventDefault();
|
|
775
|
-
const p = b(), m = p.findIndex((y) => y.tabIndex === 0), v = s.includes(h.key) ? p[m + 1] ?? p[0] : p[m - 1] ?? p[p.length - 1];
|
|
776
|
-
p.forEach((y) => {
|
|
777
|
-
y.tabIndex = -1;
|
|
778
|
-
}), v.tabIndex = 0, v.focus();
|
|
779
|
-
}, { signal: u.signal }), () => u.abort();
|
|
780
|
-
}, [i, e, r, t, s]);
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/form/TagsAutocomplete.tsx
|
|
493
|
+
var Me = ({ name: e, color: t }) => /* @__PURE__ */ f("div", {
|
|
494
|
+
className: "inline-flex items-center gap-2",
|
|
495
|
+
children: [/* @__PURE__ */ d("div", {
|
|
496
|
+
"aria-hidden": !0,
|
|
497
|
+
className: "w-4 h-4 rounded-full",
|
|
498
|
+
style: { backgroundColor: t }
|
|
499
|
+
}), e]
|
|
500
|
+
}), Ne = ({ tag: t, color: n, size: r, onRemove: i }) => /* @__PURE__ */ f("li", {
|
|
501
|
+
className: e("inline-flex items-center gap-1 font-bold [&]:rounded-md", {
|
|
502
|
+
"px-1 text-sm": r === "sm",
|
|
503
|
+
"py-0.25 px-1.5": r === "md",
|
|
504
|
+
"py-0.5 px-1.5": r === "lg"
|
|
505
|
+
}),
|
|
506
|
+
style: {
|
|
507
|
+
backgroundColor: n,
|
|
508
|
+
color: ze(n) ? "#000" : "#fff"
|
|
509
|
+
},
|
|
510
|
+
onClick: (e) => e.stopPropagation(),
|
|
511
|
+
children: [t, /* @__PURE__ */ d(R, {
|
|
512
|
+
label: `Remove ${t}`,
|
|
513
|
+
solid: !0,
|
|
514
|
+
size: "sm",
|
|
515
|
+
onClick: () => i(t)
|
|
516
|
+
})]
|
|
517
|
+
}), Pe = "#99a1af", Fe = ({ tags: t, selectedTags: r = [], onTagsChange: i, getColorForTag: a, searchMode: o = "startsWith", immutable: s = !1, size: l = "md", disabled: u, containerClassName: p, ...m }) => {
|
|
518
|
+
let { searchResults: h, onSearch: g } = $e({
|
|
519
|
+
tags: t,
|
|
520
|
+
selectedTags: r,
|
|
521
|
+
searchMode: o,
|
|
522
|
+
allowAdding: !s
|
|
523
|
+
}), _ = n((e) => {
|
|
524
|
+
let t = (e.match(/Add\s+"([^"]+)"\s+tag/)?.[1] ?? e).split(",").map(W);
|
|
525
|
+
i?.([...new Set([...r, ...t])]);
|
|
526
|
+
}, [i, r]), v = n((e) => i?.(r.filter((t) => t !== e)), [i, r]), y = c(null);
|
|
527
|
+
return /* @__PURE__ */ f("div", {
|
|
528
|
+
className: e("rounded-md flex flex-wrap gap-1", "border border-lm-input-border dark:border-dm-input-border", "cursor-text focus-within:focus-within-ring", {
|
|
529
|
+
"p-0.5": l === "sm",
|
|
530
|
+
"p-1.25": l === "md",
|
|
531
|
+
"p-2": l === "lg",
|
|
532
|
+
"bg-lm-disabled-input dark:bg-dm-disabled-input": u,
|
|
533
|
+
"bg-lm-primary dark:bg-dm-primary": !u,
|
|
534
|
+
"group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !u
|
|
535
|
+
}, p),
|
|
536
|
+
onClick: (e) => {
|
|
537
|
+
e.target !== y.current && y.current?.focus();
|
|
538
|
+
},
|
|
539
|
+
children: [/* @__PURE__ */ d("ul", {
|
|
540
|
+
className: "m-0 p-0 flex flex-wrap gap-1",
|
|
541
|
+
children: r.map((e, t) => /* @__PURE__ */ d(Ne, {
|
|
542
|
+
tag: e,
|
|
543
|
+
color: a?.(e) ?? Pe,
|
|
544
|
+
onRemove: v,
|
|
545
|
+
size: l
|
|
546
|
+
}, `${e}${t}`))
|
|
547
|
+
}), /* @__PURE__ */ d(je, {
|
|
548
|
+
variant: "unstyled",
|
|
549
|
+
listboxSpan: "auto",
|
|
550
|
+
containerClassName: "flex items-center",
|
|
551
|
+
listboxClassName: "whitespace-nowrap",
|
|
552
|
+
inputClassName: e("no-clear-button", {
|
|
553
|
+
"px-1 text-sm": l === "sm",
|
|
554
|
+
"px-2 h-[26px]": l === "md",
|
|
555
|
+
"px-3 text-xl": l === "lg"
|
|
556
|
+
}),
|
|
557
|
+
searchResults: h,
|
|
558
|
+
onSearch: g,
|
|
559
|
+
onSelectSearchResult: _,
|
|
560
|
+
renderSearchResult: (e) => e.match(/Add\s+"([^"]+)"\s+tag/) ? e : /* @__PURE__ */ d(Me, {
|
|
561
|
+
name: e,
|
|
562
|
+
color: a?.(e) ?? Pe
|
|
563
|
+
}),
|
|
564
|
+
onKeyDown: (e) => {
|
|
565
|
+
e.key === "Backspace" && !h && v(r[r.length - 1]);
|
|
566
|
+
},
|
|
567
|
+
size: l,
|
|
568
|
+
disabled: u,
|
|
569
|
+
ref: y,
|
|
570
|
+
immediate: !0,
|
|
571
|
+
...m
|
|
572
|
+
})]
|
|
573
|
+
});
|
|
574
|
+
}, Ie = ({ className: t, ...n }) => /* @__PURE__ */ d(Ce, {
|
|
575
|
+
className: e("rounded-full min-w-8 w-8 h-4", "bg-(image:--circle-grey-dark) dark:bg-(image:--circle-grey-light) checked:bg-(image:--circle-white)", "focus-visible:not-checked:bg-(image:--circle-blue-light)", "checked:bg-right transition-[background-position]", t),
|
|
576
|
+
...n
|
|
577
|
+
});
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region src/hooks/use-arrow-key-navigation.ts
|
|
580
|
+
function H(e, { elementsSelector: t, focusFirstItem: n = !1, vertical: r = !0, horizontal: a = !0 }) {
|
|
581
|
+
let o = s(() => {
|
|
582
|
+
let e = [];
|
|
583
|
+
return r && e.push("ArrowDown"), a && e.push("ArrowRight"), e;
|
|
584
|
+
}, [a, r]), c = s(() => {
|
|
585
|
+
let e = [];
|
|
586
|
+
return r && e.push("ArrowUp"), a && e.push("ArrowLeft"), e;
|
|
587
|
+
}, [a, r]), l = s(() => [...o, ...c], [o, c]);
|
|
588
|
+
i(() => {
|
|
589
|
+
let r = e.current;
|
|
590
|
+
if (!r) return () => {};
|
|
591
|
+
let i = new AbortController(), a = () => [...r.querySelectorAll(t)], s = a(), c = Math.max(s.findIndex((e) => e.dataset.selected === "true"), 0);
|
|
592
|
+
return s.forEach((e, t) => {
|
|
593
|
+
e.tabIndex = t === c ? 0 : -1, n && t === c && e.focus();
|
|
594
|
+
}), r.addEventListener("keydown", (e) => {
|
|
595
|
+
if (!l.includes(e.key)) return;
|
|
596
|
+
e.preventDefault();
|
|
597
|
+
let t = a(), n = t.findIndex((e) => e.tabIndex === 0), r = o.includes(e.key) ? t[n + 1] ?? t[0] : t[n - 1] ?? t[t.length - 1];
|
|
598
|
+
t.forEach((e) => {
|
|
599
|
+
e.tabIndex = -1;
|
|
600
|
+
}), r.tabIndex = 0, r.focus();
|
|
601
|
+
}, { signal: i.signal }), () => i.abort();
|
|
602
|
+
}, [
|
|
603
|
+
l,
|
|
604
|
+
e,
|
|
605
|
+
t,
|
|
606
|
+
n,
|
|
607
|
+
o
|
|
608
|
+
]);
|
|
781
609
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region src/hooks/use-go-back.ts
|
|
612
|
+
var Le = () => {
|
|
613
|
+
let e = g();
|
|
614
|
+
return n(() => e(-1), [e]);
|
|
615
|
+
}, Re = 128;
|
|
616
|
+
function ze(e) {
|
|
617
|
+
let [t, n, r] = (e.match(/../g) ?? []).map((e) => parseInt(e, 16) || 0);
|
|
618
|
+
return Math.round(Math.sqrt(.299 * t ** 2 + .587 * n ** 2 + .114 * r ** 2)) >= Re;
|
|
789
619
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
},
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region src/utils/CopyToClipboardButton.tsx
|
|
622
|
+
var Be = ({ text: t, className: r, size: i = "lg", initialCopied: a = !1, navigator_: o = globalThis.navigator, ...s }) => {
|
|
623
|
+
let [c, l] = tt({ initialValue: a }), u = n(() => o.clipboard.writeText(t).then(l), [
|
|
624
|
+
o.clipboard,
|
|
625
|
+
t,
|
|
626
|
+
l
|
|
627
|
+
]);
|
|
628
|
+
return /* @__PURE__ */ d("button", {
|
|
629
|
+
type: "button",
|
|
630
|
+
className: e("focus-ring rounded-sm cursor-pointer", {
|
|
631
|
+
"text-md": i === "sm",
|
|
632
|
+
"text-lg": i === "md",
|
|
633
|
+
"text-xl": i === "lg"
|
|
634
|
+
}, r),
|
|
635
|
+
"aria-label": `Copy ${t} to clipboard`,
|
|
636
|
+
title: "Copy to clipboard",
|
|
637
|
+
onClick: u,
|
|
638
|
+
...s,
|
|
639
|
+
children: /* @__PURE__ */ d(A, { icon: c ? v : le })
|
|
640
|
+
});
|
|
641
|
+
}, U = (e) => {
|
|
642
|
+
let t = new URLSearchParams(e), n = {};
|
|
643
|
+
return t.forEach((e, t) => {
|
|
644
|
+
if (t.endsWith("[]")) {
|
|
645
|
+
let r = t.slice(0, -2);
|
|
646
|
+
n[r] ??= [], n[r].push(e);
|
|
647
|
+
} else n[t] = e;
|
|
648
|
+
}), n;
|
|
649
|
+
}, Ve = (e) => {
|
|
650
|
+
let t = new URLSearchParams();
|
|
651
|
+
for (let [n, r] of Object.entries(e)) r !== void 0 && (Array.isArray(r) ? r.forEach((e) => t.append(`${n}[]`, `${e}`)) : t.append(n, `${r}`));
|
|
652
|
+
return t.toString();
|
|
653
|
+
}, He = () => {
|
|
654
|
+
let { search: e } = h();
|
|
655
|
+
return s(() => U(e), [e]);
|
|
656
|
+
}, Ue = /\s+/g, W = (e) => e.trim().toLowerCase().replace(Ue, "-"), We = new Intl.NumberFormat("en-US"), Ge = (e) => We.format(Number(e)), Ke = 10, qe = (e) => Math.ceil(e / Ke) * Ke, G = 2, Je = "...", Ye = (e, t) => Array.from({ length: t - e }, (t, n) => e + n), Xe = (e, t) => {
|
|
657
|
+
let n = Ye(Math.max(G, e - G), Math.min(t - 1, e + G) + 1);
|
|
658
|
+
return e - G > G && n.unshift("..."), e + G < t - 1 && n.push("..."), n.unshift(1), n.push(t), n;
|
|
659
|
+
}, K = (e) => e === "...", Ze = (e) => K(e) ? e : Ge(e), Qe = (e, t) => K(e) ? `${e}_${t}` : `${e}`;
|
|
660
|
+
//#endregion
|
|
661
|
+
//#region src/hooks/use-tags-search.ts
|
|
662
|
+
function $e({ tags: e, selectedTags: t, searchMode: r, searchLimit: i = 5, allowAdding: a = !1 }) {
|
|
663
|
+
let [o, s] = l();
|
|
664
|
+
return {
|
|
665
|
+
searchResults: o,
|
|
666
|
+
onSearch: n((n) => {
|
|
667
|
+
let o = n.toLowerCase().trim();
|
|
668
|
+
if (!o) {
|
|
669
|
+
s(void 0);
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
let c = e.filter((e) => t.includes(e) ? !1 : e.toLowerCase()[r](o)).slice(0, i);
|
|
673
|
+
a && c.push(`Add "${o.split(",").map(W).join(",")}" tag`), s(new Map(c.map((e) => [e, e])));
|
|
674
|
+
}, [
|
|
675
|
+
a,
|
|
676
|
+
i,
|
|
677
|
+
r,
|
|
678
|
+
t,
|
|
679
|
+
e
|
|
680
|
+
])
|
|
681
|
+
};
|
|
850
682
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region src/hooks/use-timeout.ts
|
|
685
|
+
function q(e, t = globalThis.setTimeout, r = globalThis.clearTimeout) {
|
|
686
|
+
let a = c(null), o = n(() => {
|
|
687
|
+
a.current && r(a.current);
|
|
688
|
+
}, [r]), l = n((n, r) => {
|
|
689
|
+
o(), a.current = t(() => {
|
|
690
|
+
n(), a.current = null;
|
|
691
|
+
}, r ?? e);
|
|
692
|
+
}, [
|
|
693
|
+
o,
|
|
694
|
+
e,
|
|
695
|
+
t
|
|
696
|
+
]);
|
|
697
|
+
return i(() => o, [o]), s(() => ({
|
|
698
|
+
setTimeout: l,
|
|
699
|
+
clearCurrentTimeout: o
|
|
700
|
+
}), [o, l]);
|
|
863
701
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region src/hooks/use-timeout-toggle.ts
|
|
704
|
+
var et = 2e3, tt = ({ initialValue: e = !1, delay: t = et } = {}, r = globalThis.setTimeout, i = globalThis.clearTimeout) => {
|
|
705
|
+
let { setTimeout: a } = q(t, r, i), [o, s] = l(e), u = c(e);
|
|
706
|
+
return [o, n(() => {
|
|
707
|
+
s(!u.current), a(() => s(u.current));
|
|
708
|
+
}, [a])];
|
|
869
709
|
};
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region src/hooks/use-toggle.ts
|
|
712
|
+
function J(e = !1) {
|
|
713
|
+
let [t, r] = l(e);
|
|
714
|
+
return {
|
|
715
|
+
flag: t,
|
|
716
|
+
toggle: n(() => r((e) => !e), []),
|
|
717
|
+
setToTrue: n(() => r(!0), []),
|
|
718
|
+
setToFalse: n(() => r(!1), [])
|
|
719
|
+
};
|
|
873
720
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
),
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
"md:hidden mx-2 [&]:px-2",
|
|
1137
|
-
"opacity-60 highlight:opacity-100 transition-opacity",
|
|
1138
|
-
"[&]:text-white [&]:border-white [&]:highlight:bg-transparent"
|
|
1139
|
-
),
|
|
1140
|
-
onClick: o,
|
|
1141
|
-
"aria-label": `${n ? "Hide" : "Show"} menu`,
|
|
1142
|
-
"aria-controls": l,
|
|
1143
|
-
children: /* @__PURE__ */ a(N, { icon: n ? Re : Le })
|
|
1144
|
-
}
|
|
1145
|
-
)
|
|
1146
|
-
] }),
|
|
1147
|
-
/* @__PURE__ */ a(
|
|
1148
|
-
"ul",
|
|
1149
|
-
{
|
|
1150
|
-
id: l,
|
|
1151
|
-
"aria-labelledby": i,
|
|
1152
|
-
role: "menu",
|
|
1153
|
-
className: d(
|
|
1154
|
-
"m-0 p-0",
|
|
1155
|
-
"max-md:w-full md:mr-2 max-md:absolute max-md:top-full z-2000",
|
|
1156
|
-
"flex max-md:flex-col items-center",
|
|
1157
|
-
"bg-lm-main dark:bg-dm-main",
|
|
1158
|
-
{ "max-md:hidden": !n }
|
|
1159
|
-
),
|
|
1160
|
-
children: t
|
|
1161
|
-
}
|
|
1162
|
-
)
|
|
1163
|
-
]
|
|
1164
|
-
}
|
|
1165
|
-
);
|
|
1166
|
-
}, gr = Object.assign(Pt, { MenuItem: Rt, Dropdown: Lt }), ge = K(null), Et = ({ className: e, to: r, ...t }) => {
|
|
1167
|
-
const n = E(ge);
|
|
1168
|
-
return /* @__PURE__ */ a(
|
|
1169
|
-
ve,
|
|
1170
|
-
{
|
|
1171
|
-
role: "menuitem",
|
|
1172
|
-
to: r,
|
|
1173
|
-
className: ({ isActive: o }) => d(
|
|
1174
|
-
"px-4 pt-2 pb-[calc(0.5rem-3px)] border-b-3",
|
|
1175
|
-
"highlight:text-lm-brand dark:highlight:text-dm-brand",
|
|
1176
|
-
"font-bold text-center no-underline transition-colors",
|
|
1177
|
-
"rounded-none outline-none focus-visible:inset-ring-2",
|
|
1178
|
-
"focus-visible:inset-ring-lm-brand/50 dark:focus-visible:inset-ring-dm-brand/50",
|
|
1179
|
-
{
|
|
1180
|
-
"text-lm-brand dark:text-dm-brand": o,
|
|
1181
|
-
"border-b-lm-brand dark:border-b-dm-brand active": o,
|
|
1182
|
-
"border-b-transparent text-gray-500": !o,
|
|
1183
|
-
"flex-grow": n?.fill
|
|
1184
|
-
},
|
|
1185
|
-
e
|
|
1186
|
-
),
|
|
1187
|
-
...t
|
|
1188
|
-
}
|
|
1189
|
-
);
|
|
1190
|
-
}, St = ({ children: e, className: r, fill: t }) => /* @__PURE__ */ a(ge.Provider, { value: { fill: t }, children: /* @__PURE__ */ a(I, { role: "menubar", className: d("flex overflow-hidden", r), children: e }) }), br = Object.assign(St, { Pill: Et }), be = [
|
|
1191
|
-
"border border-r-0 last:border-r border-lm-border dark:border-dm-border",
|
|
1192
|
-
"rounded-none first:rounded-l last:rounded-r"
|
|
1193
|
-
], he = (e = !1) => d(
|
|
1194
|
-
be,
|
|
1195
|
-
"px-3 py-2 cursor-pointer no-underline",
|
|
1196
|
-
"focus-ring focus-visible:z-1",
|
|
1197
|
-
!e && [
|
|
1198
|
-
"text-lm-brand dark:text-dm-brand",
|
|
1199
|
-
"bg-lm-primary dark:bg-dm-primary",
|
|
1200
|
-
"highlight:bg-lm-secondary dark:highlight:bg-dm-secondary"
|
|
1201
|
-
],
|
|
1202
|
-
e && "bg-lm-main dark:bg-dm-main text-white"
|
|
1203
|
-
), X = ({ children: e }) => /* @__PURE__ */ a("span", { "aria-hidden": !0, className: d(be, "px-3 py-2 text-gray-400"), children: e }), fe = () => /* @__PURE__ */ a(X, { children: G });
|
|
1204
|
-
function Dt({ children: e, active: r, isEllipsis: t, href: n, ...o }) {
|
|
1205
|
-
const s = P(() => he(r), [r]);
|
|
1206
|
-
return t ? /* @__PURE__ */ a(fe, {}) : /* @__PURE__ */ a(W, { className: s, to: n, ...o, "data-active": r, children: e });
|
|
721
|
+
//#endregion
|
|
722
|
+
//#region src/navigation/Menu.tsx
|
|
723
|
+
var nt = t({}), rt = ({ className: t, selected: n, disabled: i, onClick: a, ...o }) => {
|
|
724
|
+
let s = "to" in o && typeof o.to == "string", c = s ? p : "button", { onItemClick: l } = r(nt);
|
|
725
|
+
return /* @__PURE__ */ d(c, {
|
|
726
|
+
role: "menuitem",
|
|
727
|
+
"data-selected": n,
|
|
728
|
+
className: e("flex items-center gap-2", "w-full px-3 py-1.5 focus-ring", "no-underline text-inherit", {
|
|
729
|
+
"cursor-pointer": !i,
|
|
730
|
+
"pointer-events-none opacity-50": i,
|
|
731
|
+
"bg-lm-secondary dark:bg-dm-secondary": n && !i,
|
|
732
|
+
"highlight:bg-lm-secondary dark:highlight:bg-dm-secondary highlight:z-1 relative": !n && !i
|
|
733
|
+
}, t),
|
|
734
|
+
tabIndex: -1,
|
|
735
|
+
disabled: s ? void 0 : i,
|
|
736
|
+
"aria-disabled": s ? i : void 0,
|
|
737
|
+
type: s ? void 0 : "button",
|
|
738
|
+
onClick: (e) => {
|
|
739
|
+
a?.(e), l?.();
|
|
740
|
+
},
|
|
741
|
+
...o
|
|
742
|
+
});
|
|
743
|
+
};
|
|
744
|
+
rt.displayName = "Menu.Item";
|
|
745
|
+
var it = () => /* @__PURE__ */ d("div", {
|
|
746
|
+
role: "separator",
|
|
747
|
+
"aria-hidden": !0,
|
|
748
|
+
className: "border-b border-lm-border dark:border-dm-border my-2"
|
|
749
|
+
});
|
|
750
|
+
it.displayName = "Menu.Separator";
|
|
751
|
+
var at = ({ children: t }) => /* @__PURE__ */ d("div", {
|
|
752
|
+
role: "heading",
|
|
753
|
+
"aria-level": 6,
|
|
754
|
+
"aria-hidden": !0,
|
|
755
|
+
className: e("flex items-center w-full px-3 py-1.5", "text-gray-500 text-sm font-semibold"),
|
|
756
|
+
onClick: (e) => e.stopPropagation(),
|
|
757
|
+
children: t
|
|
758
|
+
});
|
|
759
|
+
at.displayName = "Menu.Title";
|
|
760
|
+
var ot = ({ className: t, ...n }) => /* @__PURE__ */ d("div", {
|
|
761
|
+
className: e("px-3 py-1.5", t),
|
|
762
|
+
...n
|
|
763
|
+
});
|
|
764
|
+
ot.displayName = "Menu.Misc";
|
|
765
|
+
var st = ({ children: t, className: n, focusableElementsSelector: r = "[role=\"menuitem\"]:not([disabled]):not([aria-disabled])", focusFirstItem: i = !1, onItemClick: a, ...o }) => {
|
|
766
|
+
let s = c(null);
|
|
767
|
+
return H(s, {
|
|
768
|
+
elementsSelector: r,
|
|
769
|
+
focusFirstItem: i
|
|
770
|
+
}), /* @__PURE__ */ d(M, {
|
|
771
|
+
ref: s,
|
|
772
|
+
role: "menu",
|
|
773
|
+
className: e("py-2 whitespace-nowrap", n),
|
|
774
|
+
...o,
|
|
775
|
+
children: /* @__PURE__ */ d(nt.Provider, {
|
|
776
|
+
value: { onItemClick: a },
|
|
777
|
+
children: t
|
|
778
|
+
})
|
|
779
|
+
});
|
|
780
|
+
};
|
|
781
|
+
st.displayName = "Menu";
|
|
782
|
+
var Y = Object.assign(st, {
|
|
783
|
+
Item: rt,
|
|
784
|
+
Separator: it,
|
|
785
|
+
Title: at,
|
|
786
|
+
Misc: ot
|
|
787
|
+
}), ct = ({ children: t, menuAlignment: r = "left", buttonVariant: o = "button", buttonContent: s, buttonClassName: u, buttonSize: p = "md", buttonDisabled: m = !1, containerClassName: h, menuClassName: g, caretless: v, buttonLabel: y, menuOffset: b = 3 }) => {
|
|
788
|
+
let [x, S] = l(!1), C = c(null), w = n(({ focusButton: e = !0 } = {}) => {
|
|
789
|
+
S(!1), e && C.current?.focus();
|
|
790
|
+
}, []), { refs: T, floatingStyles: E, context: ee } = ae({
|
|
791
|
+
open: x,
|
|
792
|
+
onOpenChange: S,
|
|
793
|
+
placement: r === "right" ? "bottom-end" : "bottom-start",
|
|
794
|
+
middleware: [ne(), re(b)],
|
|
795
|
+
elements: { reference: C.current }
|
|
796
|
+
}), { getReferenceProps: D, getFloatingProps: O } = se([ie(ee)]), k = a(), j = c(null);
|
|
797
|
+
return i(() => {
|
|
798
|
+
let e = j.current;
|
|
799
|
+
if (!e || !x) return () => {};
|
|
800
|
+
let t = new AbortController();
|
|
801
|
+
return document.body.addEventListener("click", (t) => {
|
|
802
|
+
t.composedPath().includes(e) || w();
|
|
803
|
+
}, { signal: t.signal }), () => t.abort();
|
|
804
|
+
}, [w, x]), /* @__PURE__ */ f("div", {
|
|
805
|
+
ref: j,
|
|
806
|
+
className: e("relative inline-block", h),
|
|
807
|
+
onKeyDown: (e) => {
|
|
808
|
+
e.key === "Escape" && w();
|
|
809
|
+
},
|
|
810
|
+
onBlur: (e) => {
|
|
811
|
+
e.relatedTarget && !j.current.contains(e.relatedTarget) && w({ focusButton: !1 });
|
|
812
|
+
},
|
|
813
|
+
children: [/* @__PURE__ */ f("button", {
|
|
814
|
+
ref: C,
|
|
815
|
+
...D(),
|
|
816
|
+
type: "button",
|
|
817
|
+
"aria-haspopup": !0,
|
|
818
|
+
"aria-expanded": x,
|
|
819
|
+
"aria-controls": k,
|
|
820
|
+
"aria-label": y,
|
|
821
|
+
disabled: m,
|
|
822
|
+
className: e("flex items-center rounded-md focus-ring", {
|
|
823
|
+
"justify-between": !v,
|
|
824
|
+
"cursor-pointer": !m,
|
|
825
|
+
"pointer-events-none opacity-50": m,
|
|
826
|
+
"border border-lm-border dark:border-dm-border": o === "button",
|
|
827
|
+
"bg-lm-primary dark:bg-dm-primary": o === "button",
|
|
828
|
+
"group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": o === "button",
|
|
829
|
+
"text-lm-brand dark:text-dm-brand": o === "link",
|
|
830
|
+
"highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline": o === "link",
|
|
831
|
+
"px-1.5 py-1 text-sm": o !== "text" && p === "sm",
|
|
832
|
+
"px-3 py-1.5": o !== "text" && p === "md",
|
|
833
|
+
"px-4 py-2 text-lg": o !== "text" && p === "lg",
|
|
834
|
+
"gap-x-1.5": p === "sm",
|
|
835
|
+
"gap-x-2": p !== "sm"
|
|
836
|
+
}, u),
|
|
837
|
+
onKeyDown: (e) => {
|
|
838
|
+
e.key === "ArrowDown" && (e.preventDefault(), S(!0));
|
|
839
|
+
},
|
|
840
|
+
children: [s, !v && /* @__PURE__ */ d(A, {
|
|
841
|
+
icon: _,
|
|
842
|
+
size: "xs",
|
|
843
|
+
widthAuto: !0
|
|
844
|
+
})]
|
|
845
|
+
}), x && /* @__PURE__ */ d("div", {
|
|
846
|
+
ref: T.setFloating,
|
|
847
|
+
style: E,
|
|
848
|
+
className: "min-w-full z-500",
|
|
849
|
+
...O(),
|
|
850
|
+
children: /* @__PURE__ */ d(Y, {
|
|
851
|
+
className: g,
|
|
852
|
+
id: k,
|
|
853
|
+
focusableElementsSelector: "[role=\"menuitem\"]:not([disabled]):not([aria-disabled]),input:not([disabled]),select:not([disabled])",
|
|
854
|
+
focusFirstItem: !0,
|
|
855
|
+
onItemClick: w,
|
|
856
|
+
children: t
|
|
857
|
+
})
|
|
858
|
+
})]
|
|
859
|
+
});
|
|
860
|
+
};
|
|
861
|
+
ct.displayName = "Dropdown";
|
|
862
|
+
var X = Object.assign(ct, {
|
|
863
|
+
Item: Y.Item,
|
|
864
|
+
Separator: Y.Separator,
|
|
865
|
+
Title: Y.Title,
|
|
866
|
+
Misc: Y.Misc
|
|
867
|
+
}), lt = ({ className: t, disabled: n, size: r = "md", type: i = "button", ...a }) => /* @__PURE__ */ d("button", {
|
|
868
|
+
className: e("inline-flex rounded-md focus-ring", "text-lm-brand dark:text-dm-brand", "highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline", {
|
|
869
|
+
"px-1.5 py-1 text-sm": r === "sm",
|
|
870
|
+
"px-3 py-1.5": r === "md",
|
|
871
|
+
"px-4 py-2 text-lg": r === "lg",
|
|
872
|
+
"cursor-pointer": !n,
|
|
873
|
+
"pointer-events-none opacity-65": n
|
|
874
|
+
}, t),
|
|
875
|
+
disabled: n,
|
|
876
|
+
type: i,
|
|
877
|
+
...a
|
|
878
|
+
}), ut = ({ className: t, active: n, ...r }) => /* @__PURE__ */ d("li", {
|
|
879
|
+
role: "menuitem",
|
|
880
|
+
className: "w-full flex",
|
|
881
|
+
"data-active": n,
|
|
882
|
+
children: /* @__PURE__ */ d(p, {
|
|
883
|
+
className: e("px-2 py-3", "max-md:w-full max-md:px-3 max-md:py-2", "text-white no-underline highlight:opacity-100 transition-opacity", {
|
|
884
|
+
"opacity-60": !n,
|
|
885
|
+
"opacity-100": n
|
|
886
|
+
}, t),
|
|
887
|
+
...r
|
|
888
|
+
})
|
|
889
|
+
});
|
|
890
|
+
ut.displayName = "NavBar.MenuItem";
|
|
891
|
+
var dt = ({ containerClassName: t, buttonClassName: n, menuClassName: r, active: i, ...a }) => /* @__PURE__ */ d("li", {
|
|
892
|
+
role: "menuitem",
|
|
893
|
+
"aria-haspopup": !0,
|
|
894
|
+
className: "w-full flex",
|
|
895
|
+
"data-active": i,
|
|
896
|
+
children: /* @__PURE__ */ d(X, {
|
|
897
|
+
containerClassName: e("max-md:w-full", t),
|
|
898
|
+
buttonVariant: "text",
|
|
899
|
+
buttonClassName: e("px-2 py-3", "max-md:w-full max-md:px-3 max-md:py-2", "text-white highlight:opacity-100 transition-opacity", {
|
|
900
|
+
"opacity-60": !i,
|
|
901
|
+
"opacity-100": i
|
|
902
|
+
}, n),
|
|
903
|
+
menuAlignment: "right",
|
|
904
|
+
menuOffset: -3,
|
|
905
|
+
menuClassName: e("mx-2", r),
|
|
906
|
+
...a
|
|
907
|
+
})
|
|
908
|
+
});
|
|
909
|
+
dt.displayName = "NavBar.Dropdown";
|
|
910
|
+
var Z = ({ className: t, brand: n, children: r }) => {
|
|
911
|
+
let { flag: o, toggle: s, setToFalse: c } = J(), l = a(), u = a(), { pathname: p } = h();
|
|
912
|
+
return i(() => c(), [p, c]), /* @__PURE__ */ f("nav", {
|
|
913
|
+
className: e("w-full relative", "bg-lm-main dark:bg-dm-main", "flex max-md:flex-col items-center justify-between", t),
|
|
914
|
+
children: [/* @__PURE__ */ f("div", {
|
|
915
|
+
className: "w-full relative",
|
|
916
|
+
children: [/* @__PURE__ */ d("h4", {
|
|
917
|
+
className: e("text-white px-4 py-3", "max-md:w-full max-md:flex max-md:flex-col items-center"),
|
|
918
|
+
children: n
|
|
919
|
+
}), /* @__PURE__ */ d(L, {
|
|
920
|
+
id: u,
|
|
921
|
+
variant: "secondary",
|
|
922
|
+
className: e("absolute right-0 top-[50%] translate-y-[-50%]", "md:hidden mx-2 [&]:px-2", "opacity-60 highlight:opacity-100 transition-opacity", "[&]:text-white [&]:border-white [&]:highlight:bg-transparent"),
|
|
923
|
+
onClick: s,
|
|
924
|
+
"aria-label": `${o ? "Hide" : "Show"} menu`,
|
|
925
|
+
"aria-controls": l,
|
|
926
|
+
children: /* @__PURE__ */ d(A, { icon: o ? S : y })
|
|
927
|
+
})]
|
|
928
|
+
}), /* @__PURE__ */ d("ul", {
|
|
929
|
+
id: l,
|
|
930
|
+
"aria-labelledby": u,
|
|
931
|
+
role: "menu",
|
|
932
|
+
className: e("m-0 p-0", "max-md:w-full md:mr-2 max-md:absolute max-md:top-full z-2000", "flex max-md:flex-col items-center", "bg-lm-main dark:bg-dm-main", { "max-md:hidden": !o }),
|
|
933
|
+
children: r
|
|
934
|
+
})]
|
|
935
|
+
});
|
|
936
|
+
};
|
|
937
|
+
Z.displayName = "NavBar";
|
|
938
|
+
var ft = Object.assign(Z, {
|
|
939
|
+
MenuItem: ut,
|
|
940
|
+
Dropdown: dt
|
|
941
|
+
}), pt = t(null), mt = ({ className: t, to: n, ...i }) => {
|
|
942
|
+
let a = r(pt);
|
|
943
|
+
return /* @__PURE__ */ d(m, {
|
|
944
|
+
role: "menuitem",
|
|
945
|
+
to: n,
|
|
946
|
+
className: ({ isActive: n }) => e("px-4 pt-2 pb-[calc(0.5rem-3px)] border-b-3", "highlight:text-lm-brand dark:highlight:text-dm-brand", "font-bold text-center no-underline transition-colors", "rounded-none outline-none focus-visible:inset-ring-2", "focus-visible:inset-ring-lm-brand/50 dark:focus-visible:inset-ring-dm-brand/50", {
|
|
947
|
+
"text-lm-brand dark:text-dm-brand": n,
|
|
948
|
+
"border-b-lm-brand dark:border-b-dm-brand active": n,
|
|
949
|
+
"border-b-transparent text-gray-500": !n,
|
|
950
|
+
"flex-grow": a?.fill
|
|
951
|
+
}, t),
|
|
952
|
+
...i
|
|
953
|
+
});
|
|
954
|
+
};
|
|
955
|
+
mt.displayName = "NavPills.Pill";
|
|
956
|
+
var ht = ({ children: t, className: n, fill: r }) => /* @__PURE__ */ d(pt.Provider, {
|
|
957
|
+
value: { fill: r },
|
|
958
|
+
children: /* @__PURE__ */ d(M, {
|
|
959
|
+
role: "menubar",
|
|
960
|
+
className: e("flex overflow-hidden", n),
|
|
961
|
+
children: t
|
|
962
|
+
})
|
|
963
|
+
});
|
|
964
|
+
ht.displayName = "NavPills";
|
|
965
|
+
var gt = Object.assign(ht, { Pill: mt }), _t = ["border border-r-0 last:border-r border-lm-border dark:border-dm-border", "rounded-none first:rounded-l last:rounded-r"], vt = (t = !1) => e(_t, "px-3 py-2 cursor-pointer no-underline", "focus-ring focus-visible:z-1", !t && [
|
|
966
|
+
"text-lm-brand dark:text-dm-brand",
|
|
967
|
+
"bg-lm-primary dark:bg-dm-primary",
|
|
968
|
+
"highlight:bg-lm-secondary dark:highlight:bg-dm-secondary"
|
|
969
|
+
], t && "bg-lm-main dark:bg-dm-main text-white"), Q = ({ children: t }) => /* @__PURE__ */ d("span", {
|
|
970
|
+
"aria-hidden": !0,
|
|
971
|
+
className: e(_t, "px-3 py-2 text-gray-400"),
|
|
972
|
+
children: t
|
|
973
|
+
}), yt = () => /* @__PURE__ */ d(Q, { children: "..." });
|
|
974
|
+
function bt({ children: e, active: t, isEllipsis: n, href: r, ...i }) {
|
|
975
|
+
let a = s(() => vt(t), [t]);
|
|
976
|
+
return n ? /* @__PURE__ */ d(yt, {}) : /* @__PURE__ */ d(p, {
|
|
977
|
+
className: a,
|
|
978
|
+
to: r,
|
|
979
|
+
...i,
|
|
980
|
+
"data-active": t,
|
|
981
|
+
children: e
|
|
982
|
+
});
|
|
1207
983
|
}
|
|
1208
|
-
function
|
|
1209
|
-
|
|
1210
|
-
|
|
984
|
+
function xt({ children: e, active: t, isEllipsis: n, ...r }) {
|
|
985
|
+
let i = s(() => vt(t), [t]);
|
|
986
|
+
return n ? /* @__PURE__ */ d(yt, {}) : /* @__PURE__ */ d("button", {
|
|
987
|
+
type: "button",
|
|
988
|
+
className: i,
|
|
989
|
+
...r,
|
|
990
|
+
"data-active": t,
|
|
991
|
+
children: e
|
|
992
|
+
});
|
|
1211
993
|
}
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
},
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
{
|
|
1477
|
-
role: "tooltip",
|
|
1478
|
-
"aria-live": "polite",
|
|
1479
|
-
className: d(
|
|
1480
|
-
"z-500 max-w-64",
|
|
1481
|
-
// Add space between anchor and tooltip via padding, so that if the tooltip is inside the anchor, you can hover it
|
|
1482
|
-
// and it's never closed
|
|
1483
|
-
{
|
|
1484
|
-
"pt-2.5": l === "top",
|
|
1485
|
-
"pb-2.5": l === "bottom",
|
|
1486
|
-
"pr-2.5": l === "right",
|
|
1487
|
-
"pl-2.5": l === "left"
|
|
1488
|
-
}
|
|
1489
|
-
),
|
|
1490
|
-
ref: n,
|
|
1491
|
-
style: t,
|
|
1492
|
-
...i,
|
|
1493
|
-
children: /* @__PURE__ */ g("div", { className: "relative px-1.5 py-1 rounded bg-black/90 text-white text-center", children: [
|
|
1494
|
-
/* @__PURE__ */ a("span", { className: "sr-only", children: "Tooltip: " }),
|
|
1495
|
-
e,
|
|
1496
|
-
/* @__PURE__ */ a(
|
|
1497
|
-
"div",
|
|
1498
|
-
{
|
|
1499
|
-
ref: o,
|
|
1500
|
-
className: d(
|
|
1501
|
-
"absolute",
|
|
1502
|
-
// Render as a triangle
|
|
1503
|
-
"border-l-6 border-r-6 border-b-6 border-l-transparent border-r-transparent border-b-black/90",
|
|
1504
|
-
// Rotate triangle so that it points to the correct direction
|
|
1505
|
-
{
|
|
1506
|
-
"rotate-180": l === "bottom",
|
|
1507
|
-
"rotate-90 mr-[-3px]": l === "right",
|
|
1508
|
-
"rotate-270 ml-[-3px]": l === "left"
|
|
1509
|
-
}
|
|
1510
|
-
),
|
|
1511
|
-
style: {
|
|
1512
|
-
left: s?.x,
|
|
1513
|
-
top: s?.y,
|
|
1514
|
-
[l]: `${-(o.current?.offsetWidth ?? 0) / 2}px`
|
|
1515
|
-
},
|
|
1516
|
-
"data-testid": "arrow"
|
|
1517
|
-
}
|
|
1518
|
-
)
|
|
1519
|
-
] })
|
|
1520
|
-
}
|
|
1521
|
-
);
|
|
1522
|
-
function Bt(e) {
|
|
1523
|
-
if (e.currentField !== e.newField)
|
|
1524
|
-
return "ASC";
|
|
1525
|
-
const r = {
|
|
1526
|
-
ASC: "DESC",
|
|
1527
|
-
DESC: void 0
|
|
1528
|
-
};
|
|
1529
|
-
return e.currentOrderDir ? r[e.currentOrderDir] : "ASC";
|
|
994
|
+
var St = ({ currentPage: e, pagesCount: t, ...r }) => {
|
|
995
|
+
let i = "urlForPage" in r, a = i ? bt : xt, o = n((e) => i ? { href: K(e) ? void 0 : r.urlForPage(e) } : { onClick: () => !K(e) && r.onPageChange(e) }, [i, r]), s = c(null);
|
|
996
|
+
return H(s, {
|
|
997
|
+
elementsSelector: "button,a",
|
|
998
|
+
vertical: !1
|
|
999
|
+
}), t < 2 ? null : /* @__PURE__ */ f("div", {
|
|
1000
|
+
className: "select-none flex",
|
|
1001
|
+
"data-testid": "paginator",
|
|
1002
|
+
ref: s,
|
|
1003
|
+
children: [
|
|
1004
|
+
e === 1 ? /* @__PURE__ */ d(Q, { children: /* @__PURE__ */ d(A, {
|
|
1005
|
+
size: "xs",
|
|
1006
|
+
icon: b
|
|
1007
|
+
}) }) : /* @__PURE__ */ d(a, {
|
|
1008
|
+
...o(Math.max(1, e - 1)),
|
|
1009
|
+
"aria-label": "Previous",
|
|
1010
|
+
children: /* @__PURE__ */ d(A, {
|
|
1011
|
+
size: "xs",
|
|
1012
|
+
icon: b
|
|
1013
|
+
})
|
|
1014
|
+
}),
|
|
1015
|
+
Xe(e, t).map((t, n) => /* @__PURE__ */ d(a, {
|
|
1016
|
+
active: t === e,
|
|
1017
|
+
isEllipsis: K(t),
|
|
1018
|
+
...o(t),
|
|
1019
|
+
children: Ze(t)
|
|
1020
|
+
}, Qe(t, n))),
|
|
1021
|
+
e === t ? /* @__PURE__ */ d(Q, { children: /* @__PURE__ */ d(A, {
|
|
1022
|
+
size: "xs",
|
|
1023
|
+
icon: x
|
|
1024
|
+
}) }) : /* @__PURE__ */ d(a, {
|
|
1025
|
+
...o(Math.min(t, e + 1)),
|
|
1026
|
+
"aria-label": "Next",
|
|
1027
|
+
children: /* @__PURE__ */ d(A, {
|
|
1028
|
+
size: "xs",
|
|
1029
|
+
icon: x
|
|
1030
|
+
})
|
|
1031
|
+
})
|
|
1032
|
+
]
|
|
1033
|
+
});
|
|
1034
|
+
}, Ct = ({ buttonLabel: t = "Options", buttonSize: n = "md", ...r }) => /* @__PURE__ */ d(X, {
|
|
1035
|
+
buttonContent: /* @__PURE__ */ d(A, {
|
|
1036
|
+
icon: T,
|
|
1037
|
+
widthAuto: !0,
|
|
1038
|
+
className: e({ "px-1": n === "sm" })
|
|
1039
|
+
}),
|
|
1040
|
+
caretless: !0,
|
|
1041
|
+
buttonLabel: t,
|
|
1042
|
+
buttonSize: n,
|
|
1043
|
+
...r
|
|
1044
|
+
});
|
|
1045
|
+
Ct.displayName = "RowDropdown";
|
|
1046
|
+
var wt = Object.assign(Ct, {
|
|
1047
|
+
Item: X.Item,
|
|
1048
|
+
Separator: X.Separator,
|
|
1049
|
+
Title: X.Title,
|
|
1050
|
+
Misc: X.Misc
|
|
1051
|
+
}), Tt = ({ open: t, children: n, className: r, onClose: a, ...o }) => {
|
|
1052
|
+
let s = c(null);
|
|
1053
|
+
return i(() => {
|
|
1054
|
+
let e = document.body, n = e.style.overflow, r = e.style.paddingRight;
|
|
1055
|
+
if (t) {
|
|
1056
|
+
let t = window.outerWidth - e.clientWidth, n = e.scrollHeight > e.clientHeight;
|
|
1057
|
+
e.style.overflow = "hidden", n && (e.style.paddingRight = `${t}px`), s.current?.showModal();
|
|
1058
|
+
} else s.current?.close();
|
|
1059
|
+
return () => {
|
|
1060
|
+
e.style.overflow = n, e.style.paddingRight = r;
|
|
1061
|
+
};
|
|
1062
|
+
}, [t]), ue(/* @__PURE__ */ d("dialog", {
|
|
1063
|
+
ref: s,
|
|
1064
|
+
className: e("bg-transparent backdrop:bg-black/50", r),
|
|
1065
|
+
onCancel: (e) => {
|
|
1066
|
+
e.preventDefault(), a();
|
|
1067
|
+
},
|
|
1068
|
+
...o,
|
|
1069
|
+
children: t && n
|
|
1070
|
+
}), document.body);
|
|
1071
|
+
}, Et = ({ open: t, onClose: r, variant: a = "default", title: o, children: s, className: p, ...m }) => {
|
|
1072
|
+
let { size: h = "md", confirmText: g = "Confirm", cancelText: _ = "Cancel", confirmDisabled: v, onConfirm: y, onClosed: b, ...x } = "onConfirm" in m ? m : { ...m }, [S, C] = l(t), w = c(null), T = c("cancel"), E = n((e) => {
|
|
1073
|
+
e.preventDefault(), e.stopPropagation(), T.current = "confirm", y?.();
|
|
1074
|
+
}, [y]);
|
|
1075
|
+
return i(() => {
|
|
1076
|
+
if (t) {
|
|
1077
|
+
T.current = "cancel", C(!0);
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
let e = w.current;
|
|
1081
|
+
if (e) {
|
|
1082
|
+
delete w.current.dataset.open;
|
|
1083
|
+
let t = !1, n = (n) => {
|
|
1084
|
+
t || n.target !== e || (t = !0, C(!1), b?.(T.current));
|
|
1085
|
+
};
|
|
1086
|
+
return e.addEventListener("transitionend", n), () => {
|
|
1087
|
+
e.removeEventListener("transitionend", n);
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
}, [b, t]), i(() => {
|
|
1091
|
+
let e = w.current;
|
|
1092
|
+
S && e && (e.dataset.open = "");
|
|
1093
|
+
}, [S]), /* @__PURE__ */ d(Tt, {
|
|
1094
|
+
open: S,
|
|
1095
|
+
onClose: r,
|
|
1096
|
+
className: e({
|
|
1097
|
+
"flex w-screen h-screen max-w-screen max-h-screen": S,
|
|
1098
|
+
"overflow-hidden": a === "cover"
|
|
1099
|
+
}, p),
|
|
1100
|
+
...x,
|
|
1101
|
+
children: /* @__PURE__ */ d("form", {
|
|
1102
|
+
"data-testid": "transition-container",
|
|
1103
|
+
ref: w,
|
|
1104
|
+
className: e("w-full m-auto p-4 sm:p-6", "-translate-y-4 data-open:translate-y-0 opacity-0 data-open:opacity-100", "transition-[opacity_,_translate] duration-300", a !== "cover" && {
|
|
1105
|
+
"sm:w-sm": h === "sm",
|
|
1106
|
+
"md:w-lg": h === "md",
|
|
1107
|
+
"md:w-4xl": h === "lg",
|
|
1108
|
+
"md:w-6xl": h === "xl"
|
|
1109
|
+
}, { "h-full": a === "cover" }),
|
|
1110
|
+
onSubmit: E,
|
|
1111
|
+
children: /* @__PURE__ */ d(M, {
|
|
1112
|
+
className: e("w-full", { "h-full relative overflow-auto": a === "cover" }),
|
|
1113
|
+
children: a === "cover" ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("div", {
|
|
1114
|
+
className: e("px-4 py-3 absolute top-0 left-0 right-0 z-3000", "flex items-center justify-between", "text-white bg-linear-to-b from-black/70 to-black/10", "[text-shadow:_0_2px_4px_rgb(0_0_0/_0.8)]"),
|
|
1115
|
+
children: [/* @__PURE__ */ d("h5", { children: o }), /* @__PURE__ */ d(R, {
|
|
1116
|
+
onClick: r,
|
|
1117
|
+
label: "Close dialog"
|
|
1118
|
+
})]
|
|
1119
|
+
}), s] }) : /* @__PURE__ */ f(u, { children: [
|
|
1120
|
+
/* @__PURE__ */ f(M.Header, {
|
|
1121
|
+
className: e("sticky top-0", "flex items-center justify-between gap-x-2"),
|
|
1122
|
+
children: [/* @__PURE__ */ d("h5", {
|
|
1123
|
+
className: e({ "text-danger": a === "danger" }),
|
|
1124
|
+
children: o
|
|
1125
|
+
}), /* @__PURE__ */ d(R, {
|
|
1126
|
+
onClick: r,
|
|
1127
|
+
label: "Close dialog"
|
|
1128
|
+
})]
|
|
1129
|
+
}),
|
|
1130
|
+
/* @__PURE__ */ d(M.Body, { children: s }),
|
|
1131
|
+
y && /* @__PURE__ */ f(M.Footer, {
|
|
1132
|
+
"data-testid": "footer",
|
|
1133
|
+
className: e("flex justify-end items-center gap-x-2", "[&]:px-3 sticky bottom-0"),
|
|
1134
|
+
children: [/* @__PURE__ */ d(lt, {
|
|
1135
|
+
onClick: r,
|
|
1136
|
+
children: _
|
|
1137
|
+
}), /* @__PURE__ */ d(L, {
|
|
1138
|
+
solid: !0,
|
|
1139
|
+
variant: a === "danger" ? "danger" : "primary",
|
|
1140
|
+
disabled: v,
|
|
1141
|
+
type: "submit",
|
|
1142
|
+
children: g
|
|
1143
|
+
})]
|
|
1144
|
+
})
|
|
1145
|
+
] })
|
|
1146
|
+
})
|
|
1147
|
+
})
|
|
1148
|
+
});
|
|
1149
|
+
}, Dt = ({ className: t, children: n, variant: r = "default", loading: i = !1 }) => {
|
|
1150
|
+
let a = r === "loading" || i;
|
|
1151
|
+
return /* @__PURE__ */ d(ge, {
|
|
1152
|
+
className: e({ "[&]:border-danger": r === "error" }, t),
|
|
1153
|
+
children: /* @__PURE__ */ f("h3", {
|
|
1154
|
+
className: e("text-center", {
|
|
1155
|
+
"text-gray-500 dark:text-gray-400": r !== "error",
|
|
1156
|
+
"text-danger": r === "error"
|
|
1157
|
+
}),
|
|
1158
|
+
children: [a && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(A, {
|
|
1159
|
+
icon: C,
|
|
1160
|
+
spin: !0
|
|
1161
|
+
}), /* @__PURE__ */ d("span", {
|
|
1162
|
+
className: "ml-2",
|
|
1163
|
+
children: n ?? "Loading..."
|
|
1164
|
+
})] }), !a && n]
|
|
1165
|
+
})
|
|
1166
|
+
});
|
|
1167
|
+
}, Ot = ({ variant: t, className: n, size: r = "md", children: i }) => /* @__PURE__ */ d("div", {
|
|
1168
|
+
className: e("rounded-md text-center", {
|
|
1169
|
+
"p-2": r === "sm",
|
|
1170
|
+
"p-4": r === "md",
|
|
1171
|
+
"p-6": r === "lg",
|
|
1172
|
+
"[&]:text-white": t !== "warning",
|
|
1173
|
+
"bg-lm-brand dark:bg-dm-brand": t === "success",
|
|
1174
|
+
"bg-danger": t === "error",
|
|
1175
|
+
"bg-warning text-black": t === "warning"
|
|
1176
|
+
}, n),
|
|
1177
|
+
children: i
|
|
1178
|
+
}), kt = ({ placement: e = "auto" } = {}) => {
|
|
1179
|
+
let t = c(null), n = s(() => {
|
|
1180
|
+
let n = j({ element: t });
|
|
1181
|
+
return e === "auto" ? [te(), n] : [n];
|
|
1182
|
+
}, [e]), [r, i] = l(!1), { refs: a, floatingStyles: o, context: u, middlewareData: d } = ae({
|
|
1183
|
+
placement: e === "auto" ? void 0 : e,
|
|
1184
|
+
open: r,
|
|
1185
|
+
onOpenChange: i,
|
|
1186
|
+
middleware: n
|
|
1187
|
+
}), { getFloatingProps: f, getReferenceProps: p } = se([oe(u, {
|
|
1188
|
+
delay: { open: 300 },
|
|
1189
|
+
move: !0
|
|
1190
|
+
})]), { isMounted: m, styles: h } = ce(u, { duration: 200 }), g = s(() => ({
|
|
1191
|
+
top: "bottom",
|
|
1192
|
+
right: "left",
|
|
1193
|
+
bottom: "top",
|
|
1194
|
+
left: "right"
|
|
1195
|
+
})[u.placement.split("-")[0]] ?? "", [u.placement]);
|
|
1196
|
+
return {
|
|
1197
|
+
anchor: {
|
|
1198
|
+
...p(),
|
|
1199
|
+
ref: a.setReference
|
|
1200
|
+
},
|
|
1201
|
+
tooltip: {
|
|
1202
|
+
...f(),
|
|
1203
|
+
refSetter: a.setFloating,
|
|
1204
|
+
isMounted: m,
|
|
1205
|
+
styles: {
|
|
1206
|
+
...o,
|
|
1207
|
+
...h
|
|
1208
|
+
},
|
|
1209
|
+
arrowPos: d.arrow,
|
|
1210
|
+
arrowRef: t,
|
|
1211
|
+
arrowSide: g
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
}, At = ({ children: t, isMounted: n, styles: r, refSetter: i, arrowRef: a, arrowPos: o, arrowSide: s, ...c }) => n && /* @__PURE__ */ d("div", {
|
|
1215
|
+
role: "tooltip",
|
|
1216
|
+
"aria-live": "polite",
|
|
1217
|
+
className: e("z-500 max-w-64", {
|
|
1218
|
+
"pt-2.5": s === "top",
|
|
1219
|
+
"pb-2.5": s === "bottom",
|
|
1220
|
+
"pr-2.5": s === "right",
|
|
1221
|
+
"pl-2.5": s === "left"
|
|
1222
|
+
}),
|
|
1223
|
+
ref: i,
|
|
1224
|
+
style: r,
|
|
1225
|
+
...c,
|
|
1226
|
+
children: /* @__PURE__ */ f("div", {
|
|
1227
|
+
className: "relative px-1.5 py-1 rounded bg-black/90 text-white text-center",
|
|
1228
|
+
children: [
|
|
1229
|
+
/* @__PURE__ */ d("span", {
|
|
1230
|
+
className: "sr-only",
|
|
1231
|
+
children: "Tooltip: "
|
|
1232
|
+
}),
|
|
1233
|
+
t,
|
|
1234
|
+
/* @__PURE__ */ d("div", {
|
|
1235
|
+
ref: a,
|
|
1236
|
+
className: e("absolute", "border-l-6 border-r-6 border-b-6 border-l-transparent border-r-transparent border-b-black/90", {
|
|
1237
|
+
"rotate-180": s === "bottom",
|
|
1238
|
+
"rotate-90 mr-[-3px]": s === "right",
|
|
1239
|
+
"rotate-270 ml-[-3px]": s === "left"
|
|
1240
|
+
}),
|
|
1241
|
+
style: {
|
|
1242
|
+
left: o?.x,
|
|
1243
|
+
top: o?.y,
|
|
1244
|
+
[s]: `${-(a.current?.offsetWidth ?? 0) / 2}px`
|
|
1245
|
+
},
|
|
1246
|
+
"data-testid": "arrow"
|
|
1247
|
+
})
|
|
1248
|
+
]
|
|
1249
|
+
})
|
|
1250
|
+
});
|
|
1251
|
+
//#endregion
|
|
1252
|
+
//#region src/ordering/ordering.ts
|
|
1253
|
+
function jt(e) {
|
|
1254
|
+
return e.currentField === e.newField && e.currentOrderDir ? {
|
|
1255
|
+
ASC: "DESC",
|
|
1256
|
+
DESC: void 0
|
|
1257
|
+
}[e.currentOrderDir] : "ASC";
|
|
1530
1258
|
}
|
|
1531
|
-
function
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1259
|
+
function Mt(e) {
|
|
1260
|
+
let t = jt(e);
|
|
1261
|
+
return {
|
|
1262
|
+
field: t ? e.newField : void 0,
|
|
1263
|
+
dir: t
|
|
1264
|
+
};
|
|
1537
1265
|
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
}),
|
|
1542
|
-
|
|
1543
|
-
|
|
1266
|
+
var Nt = (e, { field: t, dir: n }) => !t || !n ? e : e.sort((e, r) => {
|
|
1267
|
+
let i = n === "ASC" ? 1 : -1, a = n === "ASC" ? -1 : 1;
|
|
1268
|
+
return e[t] > r[t] ? i : a;
|
|
1269
|
+
}), Pt = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Ft = (e) => {
|
|
1270
|
+
let [t, n] = e.split("-");
|
|
1271
|
+
return {
|
|
1272
|
+
field: t,
|
|
1273
|
+
dir: n
|
|
1274
|
+
};
|
|
1544
1275
|
};
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1276
|
+
//#endregion
|
|
1277
|
+
//#region src/ordering/OrderingDropdown.tsx
|
|
1278
|
+
function It({ items: e, order: t, onChange: r, prefixed: i = !0, buttonVariant: a = "button", ...o }) {
|
|
1279
|
+
let s = n((e) => {
|
|
1280
|
+
r(Mt({
|
|
1281
|
+
currentOrderDir: t.dir,
|
|
1282
|
+
currentField: t.field,
|
|
1283
|
+
newField: e
|
|
1284
|
+
}));
|
|
1285
|
+
}, [
|
|
1286
|
+
r,
|
|
1287
|
+
t.dir,
|
|
1288
|
+
t.field
|
|
1289
|
+
]), c = a === "button";
|
|
1290
|
+
return /* @__PURE__ */ f(X, {
|
|
1291
|
+
buttonContent: /* @__PURE__ */ f(u, { children: [
|
|
1292
|
+
!c && "Order by",
|
|
1293
|
+
c && !t.field && /* @__PURE__ */ d("i", { children: "Order by..." }),
|
|
1294
|
+
c && t.field && /* @__PURE__ */ f(u, { children: [
|
|
1295
|
+
i && "Order by: ",
|
|
1296
|
+
e[t.field],
|
|
1297
|
+
" - ",
|
|
1298
|
+
t.dir ?? "DESC"
|
|
1299
|
+
] })
|
|
1300
|
+
] }),
|
|
1301
|
+
buttonVariant: a,
|
|
1302
|
+
...o,
|
|
1303
|
+
children: [
|
|
1304
|
+
Object.entries(e).map(([e, n]) => /* @__PURE__ */ f(X.Item, {
|
|
1305
|
+
selected: t.field === e,
|
|
1306
|
+
onClick: () => s(e),
|
|
1307
|
+
className: "flex items-center justify-between gap-2",
|
|
1308
|
+
children: [n, t.field === e && /* @__PURE__ */ d(A, { icon: t.dir === "ASC" ? k : O })]
|
|
1309
|
+
}, e)),
|
|
1310
|
+
/* @__PURE__ */ d(X.Separator, {}),
|
|
1311
|
+
/* @__PURE__ */ d(X.Item, {
|
|
1312
|
+
disabled: !t.field,
|
|
1313
|
+
onClick: () => r({}),
|
|
1314
|
+
children: /* @__PURE__ */ d("i", { children: "Clear selection" })
|
|
1315
|
+
})
|
|
1316
|
+
]
|
|
1317
|
+
});
|
|
1584
1318
|
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
jt as BRAND_COLOR_ALPHA_DM,
|
|
1593
|
-
Gt as BRAND_COLOR_ALPHA_LM,
|
|
1594
|
-
$t as BRAND_COLOR_DM,
|
|
1595
|
-
Ut as BRAND_COLOR_LM,
|
|
1596
|
-
Pt as BaseNavBar,
|
|
1597
|
-
ie as Button,
|
|
1598
|
-
I as Card,
|
|
1599
|
-
xr as CardModal,
|
|
1600
|
-
nr as Checkbox,
|
|
1601
|
-
Y as CloseButton,
|
|
1602
|
-
cr as CopyToClipboardButton,
|
|
1603
|
-
tr as Details,
|
|
1604
|
-
O as Dropdown,
|
|
1605
|
-
G as ELLIPSIS,
|
|
1606
|
-
Rr as HIGHLIGHTED_COLOR,
|
|
1607
|
-
Lr as HIGHLIGHTED_COLOR_ALPHA,
|
|
1608
|
-
J as Input,
|
|
1609
|
-
Z as Label,
|
|
1610
|
-
or as LabelledInput,
|
|
1611
|
-
ar as LabelledRevealablePasswordInput,
|
|
1612
|
-
sr as LabelledSelect,
|
|
1613
|
-
Ot as LinkButton,
|
|
1614
|
-
Ye as Listbox,
|
|
1615
|
-
_ as Menu,
|
|
1616
|
-
yr as Message,
|
|
1617
|
-
Ft as ModalDialog,
|
|
1618
|
-
gr as NavBar,
|
|
1619
|
-
br as NavPills,
|
|
1620
|
-
Ar as OrderingDropdown,
|
|
1621
|
-
Er as PRIMARY_DARK_COLOR,
|
|
1622
|
-
Pr as PRIMARY_LIGHT_COLOR,
|
|
1623
|
-
hr as Paginator,
|
|
1624
|
-
wr as Result,
|
|
1625
|
-
tt as RevealablePasswordInput,
|
|
1626
|
-
fr as RowDropdown,
|
|
1627
|
-
at as SearchCombobox,
|
|
1628
|
-
nt as SearchInput,
|
|
1629
|
-
rt as Select,
|
|
1630
|
-
Qe as SimpleCard,
|
|
1631
|
-
rr as Table,
|
|
1632
|
-
lr as TagsAutocomplete,
|
|
1633
|
-
ir as ToggleSwitch,
|
|
1634
|
-
vr as Tooltip,
|
|
1635
|
-
Ir as brandColor,
|
|
1636
|
-
Or as brandColorAlpha,
|
|
1637
|
-
Kt as changeThemeInMarkup,
|
|
1638
|
-
Ht as determineOrder,
|
|
1639
|
-
Bt as determineOrderDir,
|
|
1640
|
-
gt as formatNumber,
|
|
1641
|
-
Wt as getSystemPreferredTheme,
|
|
1642
|
-
xe as isDarkThemeEnabled,
|
|
1643
|
-
ct as isLightColor,
|
|
1644
|
-
xt as keyForPage,
|
|
1645
|
-
ce as normalizeTag,
|
|
1646
|
-
Cr as orderToString,
|
|
1647
|
-
F as pageIsEllipsis,
|
|
1648
|
-
mt as parseQueryString,
|
|
1649
|
-
ft as prettifyPageNumber,
|
|
1650
|
-
ht as progressivePagination,
|
|
1651
|
-
pr as roundTen,
|
|
1652
|
-
Nr as sortList,
|
|
1653
|
-
Tr as stringToOrder,
|
|
1654
|
-
mr as stringifyQueryParams,
|
|
1655
|
-
it as useArrowKeyNavigation,
|
|
1656
|
-
dr as useGoBack,
|
|
1657
|
-
ur as useParsedQuery,
|
|
1658
|
-
yt as useTagsSearch,
|
|
1659
|
-
Sr as useTheme,
|
|
1660
|
-
me as useTimeout,
|
|
1661
|
-
kt as useTimeoutToggle,
|
|
1662
|
-
ue as useToggle,
|
|
1663
|
-
kr as useTooltip
|
|
1319
|
+
//#endregion
|
|
1320
|
+
//#region src/theme/index.ts
|
|
1321
|
+
var Lt = "#4696e5", Rt = "rgba(70, 150, 229, 0.4)", zt = "#2078CF", Bt = "rgba(32, 120, 207, 0.4)", Vt = () => $() ? Lt : zt, Ht = () => $() ? Rt : Bt, Ut = "#f77f28", Wt = "rgba(247, 127, 40, 0.4)", Gt = "white", Kt = "#161b22", qt = (e) => document.querySelector("html")?.setAttribute("data-theme", e), $ = () => document.querySelector("html")?.getAttribute("data-theme") === "dark", Jt = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", Yt = (e) => {
|
|
1322
|
+
let [t, n] = l(() => e ?? Jt());
|
|
1323
|
+
return i(() => {
|
|
1324
|
+
qt(t);
|
|
1325
|
+
}, [t]), [t, n];
|
|
1664
1326
|
};
|
|
1327
|
+
//#endregion
|
|
1328
|
+
export { Rt as BRAND_COLOR_ALPHA_DM, Bt as BRAND_COLOR_ALPHA_LM, Lt as BRAND_COLOR_DM, zt as BRAND_COLOR_LM, Z as BaseNavBar, L as Button, M as Card, Et as CardModal, we as Checkbox, R as CloseButton, Be as CopyToClipboardButton, de as Details, X as Dropdown, Je as ELLIPSIS, Ut as HIGHLIGHTED_COLOR, Wt as HIGHLIGHTED_COLOR_ALPHA, z as Input, B as Label, Te as LabelledInput, De as LabelledRevealablePasswordInput, ke as LabelledSelect, lt as LinkButton, _e as Listbox, Y as Menu, Dt as Message, Tt as ModalDialog, ft as NavBar, gt as NavPills, It as OrderingDropdown, Kt as PRIMARY_DARK_COLOR, Gt as PRIMARY_LIGHT_COLOR, St as Paginator, Ot as Result, Ee as RevealablePasswordInput, wt as RowDropdown, je as SearchCombobox, Ae as SearchInput, Oe as Select, ge as SimpleCard, Se as Table, Fe as TagsAutocomplete, Ie as ToggleSwitch, At as Tooltip, Vt as brandColor, Ht as brandColorAlpha, qt as changeThemeInMarkup, Mt as determineOrder, jt as determineOrderDir, Ge as formatNumber, Jt as getSystemPreferredTheme, $ as isDarkThemeEnabled, ze as isLightColor, Qe as keyForPage, W as normalizeTag, Pt as orderToString, K as pageIsEllipsis, U as parseQueryString, Ze as prettifyPageNumber, Xe as progressivePagination, qe as roundTen, Nt as sortList, Ft as stringToOrder, Ve as stringifyQueryParams, H as useArrowKeyNavigation, Le as useGoBack, He as useParsedQuery, $e as useTagsSearch, Yt as useTheme, q as useTimeout, tt as useTimeoutToggle, J as useToggle, kt as useTooltip };
|