@shlinkio/shlink-frontend-kit 0.8.0 → 0.8.1
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 +4 -0
- package/dist/index.js +84 -78
- package/dist/tailwind.d.ts +6 -27
- package/dist/tailwind.js +175 -215
- package/dist/tailwind.preset.css +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { CardProps } from 'reactstrap';
|
|
2
2
|
import { ChangeEvent } from 'react';
|
|
3
|
+
import { Dispatch } from 'react';
|
|
3
4
|
import { DropdownToggleProps } from 'reactstrap/types/lib/DropdownToggle';
|
|
4
5
|
import { FC } from 'react';
|
|
5
6
|
import { JSX } from 'react/jsx-runtime';
|
|
6
7
|
import { PropsWithChildren } from 'react';
|
|
7
8
|
import { ReactNode } from 'react';
|
|
8
9
|
import { RefObject } from 'react';
|
|
10
|
+
import { SetStateAction } from 'react';
|
|
9
11
|
|
|
10
12
|
declare type BooleanControlProps = PropsWithChildren<{
|
|
11
13
|
checked?: boolean;
|
|
@@ -199,6 +201,8 @@ export declare const useOrder: <T>(initialOrder: Order<T>) => [Order<T>, (orderF
|
|
|
199
201
|
|
|
200
202
|
export declare const useParsedQuery: <T>() => T;
|
|
201
203
|
|
|
204
|
+
export declare const useTheme: (initialTheme?: Theme) => readonly [Theme, Dispatch<SetStateAction<Theme>>];
|
|
205
|
+
|
|
202
206
|
export declare const useTimeoutToggle: (initialValue?: boolean, delay?: number, setTimeout?: ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & typeof globalThis.setTimeout, clearTimeout?: ((id: number | undefined) => void) & typeof globalThis.clearTimeout) => [boolean, () => void];
|
|
203
207
|
|
|
204
208
|
export declare const useToggle: (initialValue?: boolean) => ToggleResult;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as o, jsxs as d, Fragment as N } from "react/jsx-runtime";
|
|
2
2
|
import { faCircleNotch as I, faSearch as A, faEllipsisV as E, faSortAmountUp as F, faSortAmountDown as P } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
-
import { FontAwesomeIcon as
|
|
3
|
+
import { FontAwesomeIcon as w } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import { clsx as u } from "clsx";
|
|
5
5
|
import { Card as _, CardHeader as H, CardBody as M, Dropdown as $, DropdownToggle as k, DropdownMenu as S, NavItem as j, NavLink as G, Nav as U, UncontrolledDropdown as q, DropdownItem as g } from "reactstrap";
|
|
6
|
-
import { useId as T, useState as
|
|
7
|
-
import { useLocation as
|
|
8
|
-
const
|
|
6
|
+
import { useId as T, useState as p, useRef as C, useCallback as f, useMemo as Q, Children as V, isValidElement as Y, useEffect as W } from "react";
|
|
7
|
+
import { useLocation as z, NavLink as J } from "react-router";
|
|
8
|
+
const he = ({ className: e, children: r, loading: t = !1, type: n = "default", fullWidth: c = !1 }) => /* @__PURE__ */ o(
|
|
9
9
|
_,
|
|
10
10
|
{
|
|
11
11
|
body: !0,
|
|
@@ -22,18 +22,18 @@ const de = ({ className: e, children: r, loading: t = !1, type: n = "default", f
|
|
|
22
22
|
"text-danger": n === "error"
|
|
23
23
|
}),
|
|
24
24
|
children: [
|
|
25
|
-
t && /* @__PURE__ */ o(
|
|
25
|
+
t && /* @__PURE__ */ o(w, { icon: I, spin: !0 }),
|
|
26
26
|
t && /* @__PURE__ */ o("span", { className: "ms-2", children: r ?? "Loading..." }),
|
|
27
27
|
!t && r
|
|
28
28
|
]
|
|
29
29
|
}
|
|
30
30
|
)
|
|
31
31
|
}
|
|
32
|
-
),
|
|
32
|
+
), X = ({ title: e, children: r, bodyClassName: t, ...n }) => /* @__PURE__ */ d(_, { ...n, children: [
|
|
33
33
|
e && /* @__PURE__ */ o(H, { role: "heading", "aria-level": 4, children: e }),
|
|
34
34
|
/* @__PURE__ */ o(M, { className: t, children: r })
|
|
35
|
-
] }),
|
|
36
|
-
|
|
35
|
+
] }), fe = ({ children: e, type: r, className: t, small: n = !1 }) => /* @__PURE__ */ o(
|
|
36
|
+
X,
|
|
37
37
|
{
|
|
38
38
|
role: "document",
|
|
39
39
|
className: u("text-center", {
|
|
@@ -56,12 +56,12 @@ const de = ({ className: e, children: r, loading: t = !1, type: n = "default", f
|
|
|
56
56
|
/* @__PURE__ */ o("input", { type: "checkbox", className: "form-check-input", id: l, checked: e, onChange: a }),
|
|
57
57
|
/* @__PURE__ */ o("label", { className: "form-check-label", htmlFor: l, children: n })
|
|
58
58
|
] });
|
|
59
|
-
},
|
|
59
|
+
}, pe = (e) => /* @__PURE__ */ o(x, { type: "checkbox", ...e }), be = (e) => /* @__PURE__ */ o(x, { type: "switch", ...e }), Z = ({ children: e, label: r, className: t = "", labelClassName: n = "", noMargin: c = !1, id: s }) => /* @__PURE__ */ d("div", { className: `${t} ${c ? "" : "mb-3"}`, children: [
|
|
60
60
|
/* @__PURE__ */ o("label", { className: `form-label ${n}`, htmlFor: s, children: r }),
|
|
61
61
|
e
|
|
62
|
-
] }),
|
|
62
|
+
] }), we = ({ children: e, value: r, onChange: t, type: n, required: c, placeholder: s, className: l, labelClassName: a }) => {
|
|
63
63
|
const i = T();
|
|
64
|
-
return /* @__PURE__ */ o(
|
|
64
|
+
return /* @__PURE__ */ o(Z, { label: /* @__PURE__ */ d(N, { children: [
|
|
65
65
|
e,
|
|
66
66
|
":"
|
|
67
67
|
] }), className: l, labelClassName: a, id: i, children: /* @__PURE__ */ o(
|
|
@@ -76,13 +76,13 @@ const de = ({ className: e, children: r, loading: t = !1, type: n = "default", f
|
|
|
76
76
|
onChange: (m) => t(m.target.value)
|
|
77
77
|
}
|
|
78
78
|
) });
|
|
79
|
-
},
|
|
80
|
-
let
|
|
79
|
+
}, B = 500;
|
|
80
|
+
let b;
|
|
81
81
|
const v = () => {
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
const [l, a] =
|
|
85
|
-
a(m), v(),
|
|
82
|
+
b !== null && clearTimeout(b), b = null;
|
|
83
|
+
}, ge = ({ onChange: e, className: r, large: t = !0, noBorder: n = !1, initialValue: c = "", setTimeout_: s = setTimeout }) => {
|
|
84
|
+
const [l, a] = p(c), i = (m, h = B) => {
|
|
85
|
+
a(m), v(), b = s(() => {
|
|
86
86
|
e(m), v();
|
|
87
87
|
}, h);
|
|
88
88
|
};
|
|
@@ -100,7 +100,7 @@ const v = () => {
|
|
|
100
100
|
onChange: (m) => i(m.target.value)
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
|
-
/* @__PURE__ */ o(
|
|
103
|
+
/* @__PURE__ */ o(w, { icon: A, className: "search-field__icon" }),
|
|
104
104
|
/* @__PURE__ */ o(
|
|
105
105
|
"button",
|
|
106
106
|
{
|
|
@@ -113,7 +113,7 @@ const v = () => {
|
|
|
113
113
|
}
|
|
114
114
|
)
|
|
115
115
|
] });
|
|
116
|
-
},
|
|
116
|
+
}, K = (e) => {
|
|
117
117
|
const r = new URLSearchParams(e), t = {};
|
|
118
118
|
return r.forEach((n, c) => {
|
|
119
119
|
if (c.endsWith("[]")) {
|
|
@@ -122,23 +122,23 @@ const v = () => {
|
|
|
122
122
|
} else
|
|
123
123
|
t[c] = n;
|
|
124
124
|
}), t;
|
|
125
|
-
},
|
|
125
|
+
}, Ne = (e) => {
|
|
126
126
|
const r = new URLSearchParams();
|
|
127
127
|
for (const [t, n] of Object.entries(e))
|
|
128
128
|
n !== void 0 && (Array.isArray(n) ? n.forEach((c) => r.append(`${t}[]`, `${c}`)) : r.append(t, `${n}`));
|
|
129
129
|
return r.toString();
|
|
130
|
-
},
|
|
131
|
-
const [r, t] =
|
|
130
|
+
}, ee = (e = !1) => {
|
|
131
|
+
const [r, t] = p(e), n = f(() => t((l) => !l), []), c = f(() => t(!0), []), s = f(() => t(!1), []);
|
|
132
132
|
return [r, n, c, s];
|
|
133
|
-
},
|
|
134
|
-
const [c, s] =
|
|
133
|
+
}, Ce = (e = !1, r = 2e3, t = window.setTimeout, n = window.clearTimeout) => {
|
|
134
|
+
const [c, s] = p(e), l = C(e), a = C(void 0), i = f(() => {
|
|
135
135
|
s(!l.current), a.current && n(a.current), a.current = t(() => s(l.current), r);
|
|
136
136
|
}, [n, r, t]);
|
|
137
137
|
return [c, i];
|
|
138
|
-
},
|
|
139
|
-
const { search: e } =
|
|
140
|
-
return Q(() =>
|
|
141
|
-
},
|
|
138
|
+
}, _e = () => C(null), Oe = () => {
|
|
139
|
+
const { search: e } = z();
|
|
140
|
+
return Q(() => K(e), [e]);
|
|
141
|
+
}, re = ({
|
|
142
142
|
text: e,
|
|
143
143
|
disabled: r = !1,
|
|
144
144
|
className: t,
|
|
@@ -151,7 +151,7 @@ const v = () => {
|
|
|
151
151
|
size: m,
|
|
152
152
|
...h
|
|
153
153
|
}) => {
|
|
154
|
-
const [y, L] =
|
|
154
|
+
const [y, L] = ee(), D = u("dropdown-btn__toggle", t, {
|
|
155
155
|
"btn-block": !i,
|
|
156
156
|
"dropdown-btn__toggle--with-caret": !s
|
|
157
157
|
}), R = { minWidth: a && `${a}px` };
|
|
@@ -159,10 +159,10 @@ const v = () => {
|
|
|
159
159
|
/* @__PURE__ */ o(k, { size: m, caret: !s, className: D, color: "primary", ...h, children: e }),
|
|
160
160
|
/* @__PURE__ */ o(S, { className: "w-100", end: l, style: R, children: n })
|
|
161
161
|
] });
|
|
162
|
-
},
|
|
163
|
-
|
|
162
|
+
}, ve = ({ children: e, minWidth: r, label: t = "Options" }) => /* @__PURE__ */ o(
|
|
163
|
+
re,
|
|
164
164
|
{
|
|
165
|
-
text: /* @__PURE__ */ o(
|
|
165
|
+
text: /* @__PURE__ */ o(w, { className: "px-1", icon: E }),
|
|
166
166
|
"aria-label": t,
|
|
167
167
|
size: "sm",
|
|
168
168
|
minWidth: r,
|
|
@@ -171,8 +171,8 @@ const v = () => {
|
|
|
171
171
|
inline: !0,
|
|
172
172
|
children: e
|
|
173
173
|
}
|
|
174
|
-
),
|
|
175
|
-
if (!Y(n) || n.type !==
|
|
174
|
+
), te = ({ children: e, ...r }) => /* @__PURE__ */ o(j, { children: /* @__PURE__ */ o(G, { className: "nav-pills__nav-link", tag: J, ...r, children: e }) }), ke = ({ children: e, fill: r = !1, className: t = "" }) => /* @__PURE__ */ o(_, { className: `nav-pills__nav p-0 overflow-hidden ${t}`, body: !0, children: /* @__PURE__ */ o(U, { pills: !0, fill: r, children: V.map(e, (n) => {
|
|
175
|
+
if (!Y(n) || n.type !== te)
|
|
176
176
|
throw new Error("Only NavPillItem children are allowed inside NavPills.");
|
|
177
177
|
return n;
|
|
178
178
|
}) }) });
|
|
@@ -182,23 +182,23 @@ function O(e, r, t) {
|
|
|
182
182
|
DESC: void 0
|
|
183
183
|
}[t] : "ASC";
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
return typeof e == "object" ?
|
|
185
|
+
function ne(e, r, t) {
|
|
186
|
+
return typeof e == "object" ? ne(e.currentField, e.newField, e.currentOrderDir) : {
|
|
187
187
|
field: r,
|
|
188
188
|
dir: O(e, r, t)
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const Se = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, c) => {
|
|
192
192
|
const s = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
|
|
193
193
|
return n[r] > c[r] ? s : l;
|
|
194
|
-
}),
|
|
194
|
+
}), Te = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, xe = (e) => {
|
|
195
195
|
const [r, t] = e.split("-");
|
|
196
196
|
return { field: r, dir: t };
|
|
197
|
-
},
|
|
198
|
-
const [r, t] =
|
|
197
|
+
}, ye = (e) => {
|
|
198
|
+
const [r, t] = p(e), n = f((c, s) => t({ field: c, dir: s }), []);
|
|
199
199
|
return [r, n];
|
|
200
200
|
};
|
|
201
|
-
function
|
|
201
|
+
function Le({ items: e, order: r, onChange: t, isButton: n = !0, right: c = !1, prefixed: s = !0 }) {
|
|
202
202
|
const l = (a) => () => {
|
|
203
203
|
const i = O(a, r.field, r.dir);
|
|
204
204
|
t(i ? a : void 0, i);
|
|
@@ -234,7 +234,7 @@ function Te({ items: e, order: r, onChange: t, isButton: n = !0, right: c = !1,
|
|
|
234
234
|
className: "d-flex justify-content-between align-items-center",
|
|
235
235
|
children: [
|
|
236
236
|
i,
|
|
237
|
-
r.field === a && /* @__PURE__ */ o(
|
|
237
|
+
r.field === a && /* @__PURE__ */ o(w, { icon: r.dir === "ASC" ? F : P })
|
|
238
238
|
]
|
|
239
239
|
},
|
|
240
240
|
a
|
|
@@ -244,46 +244,52 @@ function Te({ items: e, order: r, onChange: t, isButton: n = !0, right: c = !1,
|
|
|
244
244
|
] })
|
|
245
245
|
] });
|
|
246
246
|
}
|
|
247
|
-
const
|
|
247
|
+
const De = "#4696e5", Re = "rgba(70, 150, 229, 0.4)", Ie = "#f77f28", Ae = "rgba(247, 127, 40, 0.4)", Ee = "white", Fe = "#161b22", oe = (e) => {
|
|
248
248
|
var r;
|
|
249
249
|
return (r = document.querySelector("html")) == null ? void 0 : r.setAttribute("data-theme", e);
|
|
250
|
-
},
|
|
250
|
+
}, Pe = () => {
|
|
251
251
|
var e;
|
|
252
252
|
return ((e = document.querySelector("html")) == null ? void 0 : e.getAttribute("data-theme")) === "dark";
|
|
253
|
-
},
|
|
253
|
+
}, ce = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", He = (e) => {
|
|
254
|
+
const [r, t] = p(() => e ?? ce());
|
|
255
|
+
return W(() => {
|
|
256
|
+
oe(r);
|
|
257
|
+
}, [r]), [r, t];
|
|
258
|
+
};
|
|
254
259
|
export {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
260
|
+
pe as Checkbox,
|
|
261
|
+
re as DropdownBtn,
|
|
262
|
+
Ie as HIGHLIGHTED_COLOR,
|
|
263
|
+
Ae as HIGHLIGHTED_COLOR_ALPHA,
|
|
264
|
+
we as InputFormGroup,
|
|
265
|
+
Z as LabeledFormGroup,
|
|
266
|
+
De as MAIN_COLOR,
|
|
267
|
+
Re as MAIN_COLOR_ALPHA,
|
|
268
|
+
he as Message,
|
|
269
|
+
te as NavPillItem,
|
|
270
|
+
ke as NavPills,
|
|
271
|
+
Le as OrderingDropdown,
|
|
272
|
+
Fe as PRIMARY_DARK_COLOR,
|
|
273
|
+
Ee as PRIMARY_LIGHT_COLOR,
|
|
274
|
+
fe as Result,
|
|
275
|
+
ve as RowDropdownBtn,
|
|
276
|
+
ge as SearchField,
|
|
277
|
+
X as SimpleCard,
|
|
278
|
+
be as ToggleSwitch,
|
|
279
|
+
oe as changeThemeInMarkup,
|
|
280
|
+
ne as determineOrder,
|
|
276
281
|
O as determineOrderDir,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
282
|
+
ce as getSystemPreferredTheme,
|
|
283
|
+
Pe as isDarkThemeEnabled,
|
|
284
|
+
Te as orderToString,
|
|
285
|
+
K as parseQueryString,
|
|
286
|
+
Se as sortList,
|
|
287
|
+
xe as stringToOrder,
|
|
288
|
+
Ne as stringifyQueryParams,
|
|
289
|
+
_e as useElementRef,
|
|
290
|
+
ye as useOrder,
|
|
291
|
+
Oe as useParsedQuery,
|
|
292
|
+
He as useTheme,
|
|
293
|
+
Ce as useTimeoutToggle,
|
|
294
|
+
ee as useToggle
|
|
289
295
|
};
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -51,23 +51,6 @@ export declare type CloseButtonProps = {
|
|
|
51
51
|
onClick?: HTMLProps<HTMLButtonElement>['onClick'];
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
declare type CommonModalDialogProps = {
|
|
55
|
-
open: boolean;
|
|
56
|
-
size?: Size | 'xl' | 'full';
|
|
57
|
-
/** Modal header title */
|
|
58
|
-
title: string;
|
|
59
|
-
/** Invoked when the modal is closed for any reason */
|
|
60
|
-
onClose?: () => void;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
declare type CoverModalDialogProps = CommonModalDialogProps & {
|
|
64
|
-
/**
|
|
65
|
-
* Cover dialogs have a body that span the whole dialog, and no buttons.
|
|
66
|
-
* The header overlaps the body with semi-transparent background.
|
|
67
|
-
*/
|
|
68
|
-
variant: 'cover';
|
|
69
|
-
};
|
|
70
|
-
|
|
71
54
|
export declare const ELLIPSIS = "...";
|
|
72
55
|
|
|
73
56
|
declare type Ellipsis = typeof ELLIPSIS;
|
|
@@ -118,7 +101,12 @@ declare type LinkButtonProps_2 = LinkProps;
|
|
|
118
101
|
|
|
119
102
|
export declare const ModalDialog: FC<ModalDialogProps>;
|
|
120
103
|
|
|
121
|
-
export declare type ModalDialogProps =
|
|
104
|
+
export declare type ModalDialogProps = HTMLProps<HTMLDialogElement> & {
|
|
105
|
+
/** Whether the dialog is open or not */
|
|
106
|
+
open: boolean;
|
|
107
|
+
/** Invoked when the dialog is closed for any reason */
|
|
108
|
+
onClose: () => void;
|
|
109
|
+
};
|
|
122
110
|
|
|
123
111
|
declare type NoTitleProps = {
|
|
124
112
|
title?: never;
|
|
@@ -146,15 +134,6 @@ export declare const progressivePagination: (currentPage: number, pageCount: num
|
|
|
146
134
|
|
|
147
135
|
declare type RegularButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'size'>;
|
|
148
136
|
|
|
149
|
-
declare type RegularModalDialogProps = CommonModalDialogProps & {
|
|
150
|
-
/** Danger dialogs use danger variants in title and confirm button */
|
|
151
|
-
variant?: 'default' | 'danger';
|
|
152
|
-
/** Value to display in confirm button. Defaults to 'Confirm' */
|
|
153
|
-
confirmText?: string;
|
|
154
|
-
/** Invoked when the modal is closed via confirm button */
|
|
155
|
-
onConfirm?: () => void;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
137
|
export declare const roundTen: (number: number) => number;
|
|
159
138
|
|
|
160
139
|
export declare const SearchInput: FC<SearchInputProps>;
|
package/dist/tailwind.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { faClose as
|
|
6
|
-
import { FontAwesomeIcon as
|
|
7
|
-
const
|
|
8
|
-
const { responsive: e } =
|
|
9
|
-
return /* @__PURE__ */ n(
|
|
2
|
+
import a from "clsx";
|
|
3
|
+
import { createContext as C, useContext as m, useRef as S, useEffect as B, useId as L, useCallback as f, useMemo as v } from "react";
|
|
4
|
+
import { Link as R } from "react-router";
|
|
5
|
+
import { faClose as U, faSearch as A, faChevronLeft as T, faChevronRight as I } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import { FontAwesomeIcon as b } from "@fortawesome/react-fontawesome";
|
|
7
|
+
const p = C(void 0), h = C({ responsive: !0 }), D = ({ children: t, className: r }) => {
|
|
8
|
+
const { responsive: e } = m(h);
|
|
9
|
+
return /* @__PURE__ */ n(p.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
|
|
10
10
|
"thead",
|
|
11
11
|
{
|
|
12
|
-
className:
|
|
12
|
+
className: a(
|
|
13
13
|
{ "tw:hidden tw:lg:table-header-group": e },
|
|
14
14
|
r
|
|
15
15
|
),
|
|
16
16
|
children: t
|
|
17
17
|
}
|
|
18
18
|
) });
|
|
19
|
-
},
|
|
20
|
-
const { responsive: e } =
|
|
21
|
-
return /* @__PURE__ */ n(
|
|
19
|
+
}, O = ({ children: t, className: r }) => {
|
|
20
|
+
const { responsive: e } = m(h);
|
|
21
|
+
return /* @__PURE__ */ n(p.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
|
|
22
22
|
"tbody",
|
|
23
23
|
{
|
|
24
|
-
className:
|
|
24
|
+
className: a(
|
|
25
25
|
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": e },
|
|
26
26
|
r
|
|
27
27
|
),
|
|
28
28
|
children: t
|
|
29
29
|
}
|
|
30
30
|
) });
|
|
31
|
-
},
|
|
32
|
-
const { responsive: e } =
|
|
33
|
-
return /* @__PURE__ */ n(
|
|
31
|
+
}, W = ({ children: t, className: r }) => {
|
|
32
|
+
const { responsive: e } = m(h);
|
|
33
|
+
return /* @__PURE__ */ n(p.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
|
|
34
34
|
"tfoot",
|
|
35
35
|
{
|
|
36
|
-
className:
|
|
36
|
+
className: a(
|
|
37
37
|
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": e },
|
|
38
38
|
r
|
|
39
39
|
),
|
|
40
40
|
children: t
|
|
41
41
|
}
|
|
42
42
|
) });
|
|
43
|
-
},
|
|
44
|
-
const o =
|
|
43
|
+
}, _ = ({ children: t, className: r, ...e }) => {
|
|
44
|
+
const o = m(p), d = (o == null ? void 0 : o.section) === "body", { responsive: l } = m(h);
|
|
45
45
|
return /* @__PURE__ */ n(
|
|
46
46
|
"tr",
|
|
47
47
|
{
|
|
48
|
-
className:
|
|
48
|
+
className: a(
|
|
49
49
|
"tw:group",
|
|
50
50
|
{
|
|
51
51
|
"tw:lg:table-row tw:flex tw:flex-col": l,
|
|
@@ -60,19 +60,19 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
60
60
|
children: t
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
-
},
|
|
64
|
-
const l =
|
|
63
|
+
}, q = ({ children: t, className: r, columnName: e, type: o, ...d }) => {
|
|
64
|
+
const l = m(p), s = o ?? ((l == null ? void 0 : l.section) !== "body" ? "th" : "td"), { responsive: i } = m(h);
|
|
65
65
|
return /* @__PURE__ */ n(
|
|
66
|
-
|
|
66
|
+
s,
|
|
67
67
|
{
|
|
68
|
-
"data-column":
|
|
69
|
-
className:
|
|
68
|
+
"data-column": i ? e : void 0,
|
|
69
|
+
className: a(
|
|
70
70
|
"tw:p-2 tw:border-lm-border tw:dark:border-dm-border",
|
|
71
71
|
{
|
|
72
|
-
"tw:border-b-1": !
|
|
73
|
-
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1":
|
|
72
|
+
"tw:border-b-1": !i,
|
|
73
|
+
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": i,
|
|
74
74
|
// For md and lower, display the content in data-column attribute as before
|
|
75
|
-
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1":
|
|
75
|
+
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": i && s === "td"
|
|
76
76
|
},
|
|
77
77
|
r
|
|
78
78
|
),
|
|
@@ -80,27 +80,54 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
80
80
|
children: t
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
|
-
},
|
|
84
|
-
/* @__PURE__ */ n(
|
|
85
|
-
/* @__PURE__ */ n(
|
|
86
|
-
r && /* @__PURE__ */ n(
|
|
87
|
-
] }) }),
|
|
83
|
+
}, G = ({ header: t, footer: r, children: e, responsive: o = !0, ...d }) => /* @__PURE__ */ n(h.Provider, { value: { responsive: o }, children: /* @__PURE__ */ c("table", { className: "tw:w-full", ...d, children: [
|
|
84
|
+
/* @__PURE__ */ n(D, { children: t }),
|
|
85
|
+
/* @__PURE__ */ n(O, { children: e }),
|
|
86
|
+
r && /* @__PURE__ */ n(W, { children: r })
|
|
87
|
+
] }) }), bt = Object.assign(G, { Row: _, Cell: q }), ht = ({
|
|
88
|
+
open: t,
|
|
89
|
+
children: r,
|
|
90
|
+
className: e,
|
|
91
|
+
...o
|
|
92
|
+
}) => {
|
|
93
|
+
const d = S(null);
|
|
94
|
+
return B(() => {
|
|
95
|
+
var w, N;
|
|
96
|
+
const l = document.body, s = l.style.overflow, i = l.style.paddingRight;
|
|
97
|
+
if (t) {
|
|
98
|
+
const $ = window.outerWidth - l.clientWidth, z = l.scrollHeight > l.clientHeight;
|
|
99
|
+
l.style.overflow = "hidden", z && (l.style.paddingRight = `${$}px`), (w = d.current) == null || w.showModal();
|
|
100
|
+
} else
|
|
101
|
+
(N = d.current) == null || N.close();
|
|
102
|
+
return () => {
|
|
103
|
+
l.style.overflow = s, l.style.paddingRight = i;
|
|
104
|
+
};
|
|
105
|
+
}, [t]), /* @__PURE__ */ n(
|
|
106
|
+
"dialog",
|
|
107
|
+
{
|
|
108
|
+
ref: d,
|
|
109
|
+
className: a("tw:bg-transparent tw:backdrop:bg-black/50", e),
|
|
110
|
+
...o,
|
|
111
|
+
children: t && r
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}, ut = ({
|
|
88
115
|
children: t,
|
|
89
116
|
className: r,
|
|
90
117
|
disabled: e,
|
|
91
118
|
variant: o = "primary",
|
|
92
119
|
size: d = "md",
|
|
93
120
|
inline: l = !1,
|
|
94
|
-
solid:
|
|
95
|
-
...
|
|
121
|
+
solid: s = !1,
|
|
122
|
+
...i
|
|
96
123
|
}) => {
|
|
97
|
-
const
|
|
124
|
+
const w = "to" in i ? R : "button";
|
|
98
125
|
return (
|
|
99
126
|
// @ts-expect-error We are explicitly checking for the `to` prop before using Link
|
|
100
127
|
/* @__PURE__ */ n(
|
|
101
|
-
|
|
128
|
+
w,
|
|
102
129
|
{
|
|
103
|
-
className:
|
|
130
|
+
className: a(
|
|
104
131
|
{
|
|
105
132
|
"tw:inline-flex": l,
|
|
106
133
|
"tw:flex": !l
|
|
@@ -120,11 +147,11 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
120
147
|
{
|
|
121
148
|
"tw:border-brand tw:text-brand": o === "primary",
|
|
122
149
|
"tw:border-zinc-500": o === "secondary",
|
|
123
|
-
"tw:text-zinc-500": o === "secondary" && !
|
|
150
|
+
"tw:text-zinc-500": o === "secondary" && !s,
|
|
124
151
|
"tw:border-danger": o === "danger",
|
|
125
|
-
"tw:text-danger": o === "danger" && !
|
|
152
|
+
"tw:text-danger": o === "danger" && !s
|
|
126
153
|
},
|
|
127
|
-
|
|
154
|
+
s && {
|
|
128
155
|
"tw:text-white": !0,
|
|
129
156
|
"tw:bg-brand": o === "primary",
|
|
130
157
|
"tw:highlight:bg-brand-dark tw:highlight:border-brand-dark": o === "primary",
|
|
@@ -134,7 +161,7 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
134
161
|
"tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": o === "danger"
|
|
135
162
|
},
|
|
136
163
|
!e && {
|
|
137
|
-
"tw:highlight:text-white": !
|
|
164
|
+
"tw:highlight:text-white": !s,
|
|
138
165
|
"tw:highlight:bg-brand": o === "primary",
|
|
139
166
|
"tw:highlight:bg-zinc-500": o === "secondary",
|
|
140
167
|
"tw:highlight:bg-danger": o === "danger"
|
|
@@ -145,36 +172,36 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
145
172
|
r
|
|
146
173
|
),
|
|
147
174
|
disabled: e,
|
|
148
|
-
...
|
|
175
|
+
...i,
|
|
149
176
|
children: t
|
|
150
177
|
}
|
|
151
178
|
)
|
|
152
179
|
);
|
|
153
|
-
},
|
|
180
|
+
}, pt = ({ onClick: t, label: r = "Close" }) => /* @__PURE__ */ n(
|
|
154
181
|
"button",
|
|
155
182
|
{
|
|
156
183
|
onClick: t,
|
|
157
|
-
className:
|
|
184
|
+
className: a(
|
|
158
185
|
"tw:opacity-50 tw:highlight:opacity-80 tw:transition-opacity",
|
|
159
186
|
"tw:rounded-md tw:focus-ring"
|
|
160
187
|
),
|
|
161
188
|
"aria-label": r,
|
|
162
|
-
children: /* @__PURE__ */ n(
|
|
189
|
+
children: /* @__PURE__ */ n(b, { icon: U, size: "xl" })
|
|
163
190
|
}
|
|
164
|
-
),
|
|
191
|
+
), F = ({
|
|
165
192
|
borderless: t = !1,
|
|
166
193
|
size: r = "md",
|
|
167
194
|
feedback: e,
|
|
168
195
|
className: o,
|
|
169
196
|
disabled: d,
|
|
170
197
|
readOnly: l,
|
|
171
|
-
...
|
|
198
|
+
...s
|
|
172
199
|
}) => {
|
|
173
|
-
const
|
|
200
|
+
const i = !d && !l;
|
|
174
201
|
return /* @__PURE__ */ n(
|
|
175
202
|
"input",
|
|
176
203
|
{
|
|
177
|
-
className:
|
|
204
|
+
className: a(
|
|
178
205
|
"tw:w-full",
|
|
179
206
|
{
|
|
180
207
|
"tw:focus-ring": !e,
|
|
@@ -189,29 +216,29 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
189
216
|
"tw:rounded-md tw:border": !t,
|
|
190
217
|
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !e,
|
|
191
218
|
"tw:border-danger": !t && e === "error",
|
|
192
|
-
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !
|
|
193
|
-
"tw:bg-lm-primary tw:dark:bg-dm-primary":
|
|
219
|
+
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !i,
|
|
220
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary": i,
|
|
194
221
|
// Use different background color when rendered inside a card
|
|
195
|
-
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input":
|
|
222
|
+
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": i
|
|
196
223
|
},
|
|
197
224
|
o
|
|
198
225
|
),
|
|
199
226
|
disabled: d,
|
|
200
227
|
readOnly: l,
|
|
201
|
-
...
|
|
228
|
+
...s
|
|
202
229
|
}
|
|
203
230
|
);
|
|
204
231
|
}, E = ({ required: t, children: r, ...e }) => /* @__PURE__ */ c("label", { ...e, children: [
|
|
205
232
|
r,
|
|
206
233
|
t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
|
|
207
|
-
] }),
|
|
208
|
-
const
|
|
234
|
+
] }), ft = ({ label: t, inputClassName: r, required: e, hiddenRequired: o, error: d, ...l }) => {
|
|
235
|
+
const s = L();
|
|
209
236
|
return /* @__PURE__ */ c("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
210
|
-
/* @__PURE__ */ n(E, { htmlFor:
|
|
237
|
+
/* @__PURE__ */ n(E, { htmlFor: s, required: e, children: t }),
|
|
211
238
|
/* @__PURE__ */ n(
|
|
212
|
-
|
|
239
|
+
F,
|
|
213
240
|
{
|
|
214
|
-
id:
|
|
241
|
+
id: s,
|
|
215
242
|
className: r,
|
|
216
243
|
required: e || o,
|
|
217
244
|
feedback: d ? "error" : void 0,
|
|
@@ -220,7 +247,7 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
220
247
|
),
|
|
221
248
|
d && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: d })
|
|
222
249
|
] });
|
|
223
|
-
},
|
|
250
|
+
}, J = String.raw`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/></svg>`, K = ({
|
|
224
251
|
className: t,
|
|
225
252
|
size: r = "md",
|
|
226
253
|
feedback: e,
|
|
@@ -230,7 +257,7 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
230
257
|
}) => /* @__PURE__ */ n(
|
|
231
258
|
"select",
|
|
232
259
|
{
|
|
233
|
-
className:
|
|
260
|
+
className: a(
|
|
234
261
|
"tw:w-full tw:appearance-none tw:pr-9 tw:bg-no-repeat",
|
|
235
262
|
{
|
|
236
263
|
"tw:focus-ring": !e,
|
|
@@ -253,34 +280,34 @@ const y = I(void 0), f = I({ responsive: !0 }), G = ({ children: t, className: r
|
|
|
253
280
|
),
|
|
254
281
|
style: {
|
|
255
282
|
...o,
|
|
256
|
-
backgroundImage: `url("${
|
|
283
|
+
backgroundImage: `url("${J}")`,
|
|
257
284
|
backgroundSize: "16px 12px",
|
|
258
285
|
backgroundPosition: "right 0.75rem center"
|
|
259
286
|
},
|
|
260
287
|
disabled: d,
|
|
261
288
|
...l
|
|
262
289
|
}
|
|
263
|
-
),
|
|
264
|
-
const l =
|
|
290
|
+
), yt = ({ selectClassName: t, label: r, required: e, hiddenRequired: o, ...d }) => {
|
|
291
|
+
const l = L();
|
|
265
292
|
return /* @__PURE__ */ c("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
266
293
|
/* @__PURE__ */ n(E, { htmlFor: l, required: e, children: r }),
|
|
267
|
-
/* @__PURE__ */ n(
|
|
294
|
+
/* @__PURE__ */ n(K, { id: l, className: t, required: e || o, ...d })
|
|
268
295
|
] });
|
|
269
296
|
};
|
|
270
|
-
function
|
|
271
|
-
const o = S(null), d =
|
|
297
|
+
function Q(t, r = globalThis.setTimeout.bind(globalThis), e = globalThis.clearTimeout.bind(globalThis)) {
|
|
298
|
+
const o = S(null), d = f(() => {
|
|
272
299
|
o.current && e(o.current);
|
|
273
|
-
}, [e]), l =
|
|
300
|
+
}, [e]), l = f((s, i) => {
|
|
274
301
|
d(), o.current = r(() => {
|
|
275
|
-
|
|
276
|
-
},
|
|
302
|
+
s(), o.current = null;
|
|
303
|
+
}, i ?? t);
|
|
277
304
|
}, [d, t, r]);
|
|
278
|
-
return
|
|
305
|
+
return B(() => d, [d]), v(
|
|
279
306
|
() => ({ setTimeout: l, clearCurrentTimeout: d }),
|
|
280
307
|
[d, l]
|
|
281
308
|
);
|
|
282
309
|
}
|
|
283
|
-
const
|
|
310
|
+
const xt = ({
|
|
284
311
|
onChange: t,
|
|
285
312
|
containerClassName: r,
|
|
286
313
|
inputClassName: e,
|
|
@@ -288,15 +315,15 @@ const Nt = ({
|
|
|
288
315
|
size: o = "lg",
|
|
289
316
|
...d
|
|
290
317
|
}) => {
|
|
291
|
-
const { setTimeout: l, clearCurrentTimeout:
|
|
292
|
-
|
|
293
|
-
}, [
|
|
294
|
-
return /* @__PURE__ */ c("div", { className:
|
|
318
|
+
const { setTimeout: l, clearCurrentTimeout: s } = Q(500), i = f((w) => {
|
|
319
|
+
w ? l(() => t(w)) : (s(), t(w));
|
|
320
|
+
}, [s, t, l]);
|
|
321
|
+
return /* @__PURE__ */ c("div", { className: a("tw:group tw:relative tw:focus-within:z-10", r), children: [
|
|
295
322
|
/* @__PURE__ */ n(
|
|
296
|
-
|
|
323
|
+
b,
|
|
297
324
|
{
|
|
298
|
-
icon:
|
|
299
|
-
className:
|
|
325
|
+
icon: A,
|
|
326
|
+
className: a(
|
|
300
327
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
|
|
301
328
|
"tw:text-placeholder tw:group-focus-within:text-lm-text tw:dark:group-focus-within:text-dm-text",
|
|
302
329
|
{
|
|
@@ -307,10 +334,10 @@ const Nt = ({
|
|
|
307
334
|
}
|
|
308
335
|
),
|
|
309
336
|
/* @__PURE__ */ n(
|
|
310
|
-
|
|
337
|
+
F,
|
|
311
338
|
{
|
|
312
339
|
type: "search",
|
|
313
|
-
className:
|
|
340
|
+
className: a(
|
|
314
341
|
{
|
|
315
342
|
"tw:pl-9": o !== "sm",
|
|
316
343
|
"tw:pl-7": o === "sm"
|
|
@@ -318,16 +345,22 @@ const Nt = ({
|
|
|
318
345
|
e
|
|
319
346
|
),
|
|
320
347
|
placeholder: "Search...",
|
|
321
|
-
onChange: (
|
|
348
|
+
onChange: (w) => i(w.target.value),
|
|
322
349
|
size: o,
|
|
323
350
|
...d
|
|
324
351
|
}
|
|
325
352
|
)
|
|
326
353
|
] });
|
|
327
|
-
},
|
|
354
|
+
}, V = new Intl.NumberFormat("en-US"), X = (t) => V.format(Number(t)), P = 10, kt = (t) => Math.ceil(t / P) * P, g = 2, y = "...", Y = (t, r) => Array.from({ length: r - t }, (e, o) => t + o), Z = (t, r) => {
|
|
355
|
+
const e = Y(
|
|
356
|
+
Math.max(g, t - g),
|
|
357
|
+
Math.min(r - 1, t + g) + 1
|
|
358
|
+
);
|
|
359
|
+
return t - g > g && e.unshift(y), t + g < r - 1 && e.push(y), e.unshift(1), e.push(r), e;
|
|
360
|
+
}, u = (t) => t === y, tt = (t) => u(t) ? t : X(t), rt = (t, r) => u(t) ? `${t}_${r}` : `${t}`, vt = ({ className: t, disabled: r, size: e = "md", ...o }) => /* @__PURE__ */ n(
|
|
328
361
|
"button",
|
|
329
362
|
{
|
|
330
|
-
className:
|
|
363
|
+
className: a(
|
|
331
364
|
"tw:inline-flex tw:rounded-md tw:focus-ring",
|
|
332
365
|
"tw:text-brand tw:highlight:text-brand-dark tw:highlight:underline",
|
|
333
366
|
{
|
|
@@ -341,194 +374,121 @@ const Nt = ({
|
|
|
341
374
|
disabled: r,
|
|
342
375
|
...o
|
|
343
376
|
}
|
|
344
|
-
),
|
|
345
|
-
const e = nt(
|
|
346
|
-
Math.max(h, t - h),
|
|
347
|
-
Math.min(r - 1, t + h) + 1
|
|
348
|
-
);
|
|
349
|
-
return t - h > h && e.unshift(v), t + h < r - 1 && e.push(v), e.unshift(1), e.push(r), e;
|
|
350
|
-
}, x = (t) => t === v, lt = (t) => x(t) ? t : ot(t), at = (t, r) => x(t) ? `${t}_${r}` : `${t}`, M = (t = !1) => w(
|
|
377
|
+
), M = [
|
|
351
378
|
"tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
|
|
352
|
-
"tw:first:rounded-l tw:last:rounded-r"
|
|
379
|
+
"tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
|
|
380
|
+
], j = (t = !1) => a(
|
|
381
|
+
M,
|
|
353
382
|
"tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
|
|
354
|
-
"tw:
|
|
383
|
+
"tw:focus-ring tw:focus-visible:z-1",
|
|
355
384
|
{
|
|
356
|
-
"tw:
|
|
357
|
-
"tw:bg-brand tw:
|
|
385
|
+
"tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:text-brand": !t,
|
|
386
|
+
"tw:bg-lm-brand tw:dark:bg-dm-brand tw:text-white": t
|
|
358
387
|
}
|
|
359
|
-
);
|
|
360
|
-
function
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
{
|
|
364
|
-
"aria-hidden": !0,
|
|
365
|
-
className: "tw:border-r tw:last:border-none tw:px-3 py-2 tw:text-gray-400 tw:border-r-(--border-color)",
|
|
366
|
-
children: v
|
|
367
|
-
}
|
|
368
|
-
);
|
|
388
|
+
), k = ({ children: t }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: a(M, "tw:px-3 py-2 tw:text-gray-400"), children: t }), H = () => /* @__PURE__ */ n(k, { children: y });
|
|
389
|
+
function et({ children: t, active: r, isEllipsis: e, href: o, ...d }) {
|
|
390
|
+
const l = v(() => j(r), [r]);
|
|
391
|
+
return e ? /* @__PURE__ */ n(H, {}) : /* @__PURE__ */ n(R, { className: l, to: o, ...d, children: t });
|
|
369
392
|
}
|
|
370
|
-
function
|
|
371
|
-
const
|
|
372
|
-
return e ? /* @__PURE__ */ n(
|
|
393
|
+
function ot({ children: t, active: r, isEllipsis: e, ...o }) {
|
|
394
|
+
const d = v(() => j(r), [r]);
|
|
395
|
+
return e ? /* @__PURE__ */ n(H, {}) : /* @__PURE__ */ n("button", { type: "button", className: d, ...o, children: t });
|
|
373
396
|
}
|
|
374
|
-
|
|
375
|
-
const d =
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
const Ct = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
379
|
-
const o = "urlForPage" in e, d = o ? st : wt, l = p(
|
|
380
|
-
(a) => o ? { href: x(a) ? void 0 : e.urlForPage(a) } : { onClick: () => !x(a) && e.onPageChange(a) },
|
|
397
|
+
const Nt = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
398
|
+
const o = "urlForPage" in e, d = o ? et : ot, l = f(
|
|
399
|
+
(s) => o ? { href: u(s) ? void 0 : e.urlForPage(s) } : { onClick: () => !u(s) && e.onPageChange(s) },
|
|
381
400
|
[o, e]
|
|
382
401
|
);
|
|
383
402
|
return r < 2 ? null : /* @__PURE__ */ c("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
384
|
-
/* @__PURE__ */ n(d, { ...l(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(
|
|
385
|
-
|
|
403
|
+
t === 1 ? /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(b, { size: "xs", icon: T }) }) : /* @__PURE__ */ n(d, { ...l(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(b, { size: "xs", icon: T }) }),
|
|
404
|
+
Z(t, r).map((s, i) => /* @__PURE__ */ n(
|
|
386
405
|
d,
|
|
387
406
|
{
|
|
388
|
-
active:
|
|
389
|
-
isEllipsis:
|
|
390
|
-
...l(
|
|
391
|
-
children:
|
|
407
|
+
active: s === t,
|
|
408
|
+
isEllipsis: u(s),
|
|
409
|
+
...l(s),
|
|
410
|
+
children: tt(s)
|
|
392
411
|
},
|
|
393
|
-
|
|
412
|
+
rt(s, i)
|
|
394
413
|
)),
|
|
395
|
-
/* @__PURE__ */ n(d, { ...l(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(
|
|
414
|
+
t === r ? /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(b, { size: "xs", icon: I }) }) : /* @__PURE__ */ n(d, { ...l(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(b, { size: "xs", icon: I }) })
|
|
396
415
|
] });
|
|
397
|
-
},
|
|
416
|
+
}, nt = ({ className: t, ...r }) => /* @__PURE__ */ n(
|
|
398
417
|
"div",
|
|
399
418
|
{
|
|
400
|
-
className:
|
|
419
|
+
className: a(
|
|
401
420
|
"tw:px-4 tw:py-3 tw:rounded-t-md",
|
|
402
421
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-b tw:border-lm-border tw:dark:border-dm-border",
|
|
403
422
|
t
|
|
404
423
|
),
|
|
405
424
|
...r
|
|
406
425
|
}
|
|
407
|
-
),
|
|
426
|
+
), dt = ({ className: t, ...r }) => /* @__PURE__ */ n(
|
|
408
427
|
"div",
|
|
409
428
|
{
|
|
410
|
-
className:
|
|
429
|
+
className: a(
|
|
411
430
|
"tw:p-4 tw:bg-lm-primary tw:dark:bg-dm-primary tw:first:rounded-t-md",
|
|
412
431
|
"tw:first:rounded-t-md tw:last:rounded-b-md",
|
|
413
432
|
t
|
|
414
433
|
),
|
|
415
434
|
...r
|
|
416
435
|
}
|
|
417
|
-
),
|
|
436
|
+
), lt = ({ className: t, ...r }) => /* @__PURE__ */ n(
|
|
418
437
|
"div",
|
|
419
438
|
{
|
|
420
|
-
className:
|
|
439
|
+
className: a(
|
|
421
440
|
"tw:px-4 tw:py-3 tw:rounded-b-md",
|
|
422
441
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-t tw:border-lm-border tw:dark:border-dm-border",
|
|
423
442
|
t
|
|
424
443
|
),
|
|
425
444
|
...r
|
|
426
445
|
}
|
|
427
|
-
),
|
|
446
|
+
), st = ({ className: t, ...r }) => /* @__PURE__ */ n(
|
|
428
447
|
"div",
|
|
429
448
|
{
|
|
430
|
-
className:
|
|
449
|
+
className: a(
|
|
431
450
|
"tw:group/card tw:rounded-md tw:shadow-md",
|
|
432
451
|
"tw:border tw:border-lm-border tw:dark:border-dm-border tw:bg-lm-primary tw:dark:bg-dm-primary",
|
|
433
452
|
t
|
|
434
453
|
),
|
|
435
454
|
...r
|
|
436
455
|
}
|
|
437
|
-
),
|
|
456
|
+
), x = Object.assign(st, { Body: dt, Header: nt, Footer: lt }), Tt = ({ bodyClassName: t, children: r, ...e }) => {
|
|
438
457
|
const { title: o, titleSize: d = "md", ...l } = "title" in e ? e : {
|
|
439
458
|
...e,
|
|
440
459
|
title: void 0,
|
|
441
460
|
titleSize: void 0
|
|
442
461
|
};
|
|
443
|
-
return /* @__PURE__ */ c(
|
|
444
|
-
o && /* @__PURE__ */ c(
|
|
462
|
+
return /* @__PURE__ */ c(x, { ...l, children: [
|
|
463
|
+
o && /* @__PURE__ */ c(x.Header, { children: [
|
|
445
464
|
d === "lg" && /* @__PURE__ */ n("h4", { children: o }),
|
|
446
465
|
d === "md" && /* @__PURE__ */ n("h5", { children: o }),
|
|
447
466
|
d === "sm" && /* @__PURE__ */ n("h6", { children: o })
|
|
448
467
|
] }),
|
|
449
|
-
/* @__PURE__ */ n(
|
|
468
|
+
/* @__PURE__ */ n(x.Body, { className: t, children: r })
|
|
450
469
|
] });
|
|
451
|
-
}, It = ({
|
|
452
|
-
open: t,
|
|
453
|
-
variant: r = "default",
|
|
454
|
-
size: e = "md",
|
|
455
|
-
title: o,
|
|
456
|
-
children: d,
|
|
457
|
-
className: l,
|
|
458
|
-
...a
|
|
459
|
-
}) => {
|
|
460
|
-
const { onConfirm: s, confirmText: m = "Confirm", ...H } = "onConfirm" in a ? a : {
|
|
461
|
-
...a,
|
|
462
|
-
onConfirm: void 0,
|
|
463
|
-
confirmText: void 0
|
|
464
|
-
}, N = S(null), u = p(() => {
|
|
465
|
-
var i;
|
|
466
|
-
return (i = N.current) == null ? void 0 : i.close();
|
|
467
|
-
}, []), A = p(() => {
|
|
468
|
-
s == null || s(), u();
|
|
469
|
-
}, [u, s]);
|
|
470
|
-
return F(() => {
|
|
471
|
-
var C;
|
|
472
|
-
const i = document.querySelector("body"), D = i.style.overflow, U = i.style.paddingRight;
|
|
473
|
-
return t ? (i.style.overflow = "hidden", i.scrollHeight > i.clientHeight && (i.style.paddingRight = "15px"), (C = N.current) == null || C.showModal()) : u(), () => {
|
|
474
|
-
i.style.overflow = D, i.style.paddingRight = U;
|
|
475
|
-
};
|
|
476
|
-
}, [u, t]), /* @__PURE__ */ n(
|
|
477
|
-
"dialog",
|
|
478
|
-
{
|
|
479
|
-
ref: N,
|
|
480
|
-
className: w(
|
|
481
|
-
"tw:bg-transparent tw:backdrop:bg-black/50",
|
|
482
|
-
{
|
|
483
|
-
"tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen tw:px-4": t
|
|
484
|
-
},
|
|
485
|
-
l
|
|
486
|
-
),
|
|
487
|
-
...H,
|
|
488
|
-
children: t && /* @__PURE__ */ c(g, { className: w(
|
|
489
|
-
"tw:m-auto tw:w-full",
|
|
490
|
-
{
|
|
491
|
-
"tw:md:w-sm": e === "sm",
|
|
492
|
-
"tw:md:w-lg": e === "md",
|
|
493
|
-
"tw:md:w-4xl": e === "lg",
|
|
494
|
-
"tw:md:w-6xl": e === "xl",
|
|
495
|
-
"tw:w-full": e === "full"
|
|
496
|
-
}
|
|
497
|
-
), children: [
|
|
498
|
-
/* @__PURE__ */ c(g.Header, { className: "tw:flex tw:items-center tw:justify-between tw:sticky tw:top-0", children: [
|
|
499
|
-
/* @__PURE__ */ n("h5", { className: w({ "tw:text-danger": r === "danger" }), children: o }),
|
|
500
|
-
/* @__PURE__ */ n(Y, { onClick: u, label: "Close dialog" })
|
|
501
|
-
] }),
|
|
502
|
-
/* @__PURE__ */ n(g.Body, { children: d }),
|
|
503
|
-
/* @__PURE__ */ c(g.Footer, { className: "tw:flex tw:flex-row-reverse tw:gap-x-2 tw:items-center tw:py-4 tw:sticky tw:bottom-0", children: [
|
|
504
|
-
s && /* @__PURE__ */ n(X, { variant: r === "danger" ? "danger" : "primary", onClick: A, children: m }),
|
|
505
|
-
/* @__PURE__ */ n(rt, { onClick: u, children: "Cancel" })
|
|
506
|
-
] })
|
|
507
|
-
] })
|
|
508
|
-
}
|
|
509
|
-
);
|
|
510
470
|
};
|
|
511
471
|
export {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
472
|
+
ut as Button,
|
|
473
|
+
x as Card,
|
|
474
|
+
pt as CloseButton,
|
|
475
|
+
y as ELLIPSIS,
|
|
476
|
+
F as Input,
|
|
517
477
|
E as Label,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
478
|
+
ft as LabelledInput,
|
|
479
|
+
yt as LabelledSelect,
|
|
480
|
+
vt as LinkButton,
|
|
481
|
+
ht as ModalDialog,
|
|
482
|
+
Nt as Paginator,
|
|
483
|
+
xt as SearchInput,
|
|
484
|
+
K as Select,
|
|
485
|
+
Tt as SimpleCard,
|
|
486
|
+
bt as Table,
|
|
487
|
+
X as formatNumber,
|
|
488
|
+
rt as keyForPage,
|
|
489
|
+
u as pageIsEllipsis,
|
|
490
|
+
tt as prettifyPageNumber,
|
|
491
|
+
Z as progressivePagination,
|
|
492
|
+
kt as roundTen,
|
|
493
|
+
Q as useTimeout
|
|
534
494
|
};
|
package/dist/tailwind.preset.css
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
--color-lm-main: #4696e5; /* TODO Rename to "brand" */
|
|
11
11
|
--color-lm-main-dark: #1f69c0;
|
|
12
12
|
--color-lm-primary: #ffffff;
|
|
13
|
-
--color-lm-primary-alfa:
|
|
13
|
+
--color-lm-primary-alfa: rgb(var(--tw-color-lm-primary) / .5);
|
|
14
14
|
--color-lm-secondary: #f5f6fe;
|
|
15
15
|
--color-lm-text: #232323;
|
|
16
16
|
--color-lm-border: rgb(0 0 0 / .125);
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
--color-dm-main: #4696e5; /* TODO Rename to "brand" */
|
|
28
28
|
--color-dm-main-dark: #1f69c0;
|
|
29
29
|
--color-dm-primary: #161b22;
|
|
30
|
-
--color-dm-primary-alfa:
|
|
30
|
+
--color-dm-primary-alfa: rgb(var(--tw-color-dm-primary) / .8);
|
|
31
31
|
--color-dm-secondary: #0f131a;
|
|
32
32
|
--color-dm-text: rgb(201 209 217);
|
|
33
33
|
--color-dm-border: rgb(255 255 255 / .15);
|
package/package.json
CHANGED