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