@shlinkio/shlink-frontend-kit 0.8.11 → 0.8.13
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 +1 -0
- package/dist/tailwind.d.ts +30 -7
- package/dist/tailwind.js +313 -284
- package/dist/tailwind.preset.css +7 -0
- package/package.json +9 -10
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export declare type InputFormGroupProps = PropsWithChildren<{
|
|
|
68
68
|
|
|
69
69
|
export declare const isDarkThemeEnabled: () => boolean;
|
|
70
70
|
|
|
71
|
+
/** @deprecated */
|
|
71
72
|
export declare const LabeledFormGroup: FC<LabeledFormGroupProps>;
|
|
72
73
|
|
|
73
74
|
declare type LabeledFormGroupProps = PropsWithChildren<{
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -85,6 +85,13 @@ declare type CoverCardModalProps = CommonCardModalProps & {
|
|
|
85
85
|
variant: 'cover';
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
export declare const Details: FC<DetailsProps>;
|
|
89
|
+
|
|
90
|
+
export declare type DetailsProps = Omit<HTMLProps<HTMLDetailsElement>, 'ref'> & {
|
|
91
|
+
summary: ReactNode;
|
|
92
|
+
summaryClasses?: string;
|
|
93
|
+
};
|
|
94
|
+
|
|
88
95
|
export declare const ELLIPSIS = "...";
|
|
89
96
|
|
|
90
97
|
declare type Ellipsis = typeof ELLIPSIS;
|
|
@@ -93,6 +100,14 @@ export declare type ExitAction = 'confirm' | 'cancel';
|
|
|
93
100
|
|
|
94
101
|
export declare const formatNumber: (number: number | string) => string;
|
|
95
102
|
|
|
103
|
+
declare type FormControlWithFeedbackProps = PropsWithChildren<{
|
|
104
|
+
/** An error message to display under the input. Will cause the input to be set with `error` feedback. */
|
|
105
|
+
error?: ReactNode;
|
|
106
|
+
/** Informative help to be display under the input */
|
|
107
|
+
helpText?: ReactNode;
|
|
108
|
+
'data-testid'?: string;
|
|
109
|
+
}>;
|
|
110
|
+
|
|
96
111
|
export declare const Input: ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "checked" | "size"> & BaseInputProps & {
|
|
97
112
|
borderless?: boolean;
|
|
98
113
|
} & RefAttributes<HTMLInputElement>>;
|
|
@@ -106,40 +121,48 @@ export declare const keyForPage: (pageNumber: NumberOrEllipsis, index: number) =
|
|
|
106
121
|
export declare const Label: FC<LabelProps>;
|
|
107
122
|
|
|
108
123
|
export declare const LabelledInput: ForwardRefExoticComponent<Omit<InputProps, "className" | "id" | "feedback"> & {
|
|
124
|
+
error?: ReactNode;
|
|
125
|
+
helpText?: ReactNode;
|
|
126
|
+
'data-testid'?: string;
|
|
127
|
+
} & {
|
|
128
|
+
children?: ReactNode | undefined;
|
|
129
|
+
} & {
|
|
109
130
|
label: RequiredReactNode;
|
|
110
131
|
inputClassName?: string;
|
|
111
|
-
error?: string;
|
|
112
132
|
/** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
|
|
113
133
|
hiddenRequired?: boolean;
|
|
114
134
|
} & RefAttributes<HTMLInputElement>>;
|
|
115
135
|
|
|
116
|
-
export declare type LabelledInputProps = Omit<InputProps, 'className' | 'id' | 'feedback'> & {
|
|
136
|
+
export declare type LabelledInputProps = Omit<InputProps, 'className' | 'id' | 'feedback'> & FormControlWithFeedbackProps & {
|
|
117
137
|
label: RequiredReactNode;
|
|
118
138
|
inputClassName?: string;
|
|
119
|
-
error?: string;
|
|
120
139
|
/** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
|
|
121
140
|
hiddenRequired?: boolean;
|
|
122
141
|
};
|
|
123
142
|
|
|
124
143
|
export declare const LabelledRevealablePasswordInput: ForwardRefExoticComponent<Omit<RevealablePasswordInputProps, "className" | "id" | "feedback"> & {
|
|
144
|
+
error?: ReactNode;
|
|
145
|
+
helpText?: ReactNode;
|
|
146
|
+
'data-testid'?: string;
|
|
147
|
+
} & {
|
|
148
|
+
children?: ReactNode | undefined;
|
|
149
|
+
} & {
|
|
125
150
|
label: RequiredReactNode;
|
|
126
151
|
inputClassName?: string;
|
|
127
|
-
error?: string;
|
|
128
152
|
/** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
|
|
129
153
|
hiddenRequired?: boolean;
|
|
130
154
|
} & RefAttributes<HTMLInputElement>>;
|
|
131
155
|
|
|
132
|
-
export declare type LabelledRevealablePasswordInputProps = Omit<RevealablePasswordInputProps, 'className' | 'id' | 'feedback'> & {
|
|
156
|
+
export declare type LabelledRevealablePasswordInputProps = Omit<RevealablePasswordInputProps, 'className' | 'id' | 'feedback'> & FormControlWithFeedbackProps & {
|
|
133
157
|
label: RequiredReactNode;
|
|
134
158
|
inputClassName?: string;
|
|
135
|
-
error?: string;
|
|
136
159
|
/** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
|
|
137
160
|
hiddenRequired?: boolean;
|
|
138
161
|
};
|
|
139
162
|
|
|
140
163
|
export declare const LabelledSelect: ForwardRefExoticComponent<Omit<LabelledSelectProps, "ref"> & RefAttributes<HTMLSelectElement>>;
|
|
141
164
|
|
|
142
|
-
export declare type LabelledSelectProps = Omit<SelectProps, 'className' | 'id'> & {
|
|
165
|
+
export declare type LabelledSelectProps = Omit<SelectProps, 'className' | 'id'> & FormControlWithFeedbackProps & {
|
|
143
166
|
label: RequiredReactNode;
|
|
144
167
|
selectClassName?: string;
|
|
145
168
|
/** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
|
package/dist/tailwind.js
CHANGED
|
@@ -1,58 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { Link as S, NavLink as
|
|
5
|
-
import { faClose as
|
|
1
|
+
import { jsxs as g, jsx as n, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import w, { clsx as x } from "clsx";
|
|
3
|
+
import { useRef as L, useState as F, useEffect as M, useCallback as C, createContext as H, useContext as N, forwardRef as y, useId as D, useMemo as O } from "react";
|
|
4
|
+
import { Link as S, NavLink as at } from "react-router";
|
|
5
|
+
import { faClose as dt, faEyeSlash as lt, faEye as st, faCircleNotch as X, faSearch as it, faChevronLeft as G, faChevronRight as J } from "@fortawesome/free-solid-svg-icons";
|
|
6
6
|
import { FontAwesomeIcon as k } from "@fortawesome/react-fontawesome";
|
|
7
|
-
import { a as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
const
|
|
7
|
+
import { a as wt, u as ct } from "./use-toggle-PWLikLl6.js";
|
|
8
|
+
import { createPortal as mt } from "react-dom";
|
|
9
|
+
const Qt = ({ children: t, summary: e, summaryClasses: r, ...o }) => {
|
|
10
|
+
const a = L(null), [l, d] = F(!1);
|
|
11
|
+
return M(() => {
|
|
12
|
+
const s = a.current, i = () => d(!!(s != null && s.open));
|
|
13
|
+
return s == null || s.addEventListener("toggle", i), () => s == null ? void 0 : s.removeEventListener("toggle", i);
|
|
14
|
+
}, []), /* @__PURE__ */ g("details", { ref: a, ...o, children: [
|
|
15
|
+
/* @__PURE__ */ n("summary", { className: x("tw:focus-ring tw:px-1 tw:-mx-1 tw:rounded-sm", r), children: e }),
|
|
16
|
+
l && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children: t })
|
|
17
|
+
] });
|
|
18
|
+
}, gt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
10
19
|
"div",
|
|
11
20
|
{
|
|
12
|
-
className:
|
|
21
|
+
className: w(
|
|
13
22
|
"tw:px-4 tw:py-3 tw:rounded-t-md",
|
|
14
23
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-b tw:border-lm-border tw:dark:border-dm-border",
|
|
15
24
|
t
|
|
16
25
|
),
|
|
17
26
|
...e
|
|
18
27
|
}
|
|
19
|
-
),
|
|
28
|
+
), bt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
20
29
|
"div",
|
|
21
30
|
{
|
|
22
|
-
className:
|
|
31
|
+
className: w(
|
|
23
32
|
"tw:p-4 tw:bg-lm-primary tw:dark:bg-dm-primary tw:first:rounded-t-md",
|
|
24
33
|
"tw:first:rounded-t-md tw:last:rounded-b-md",
|
|
25
34
|
t
|
|
26
35
|
),
|
|
27
36
|
...e
|
|
28
37
|
}
|
|
29
|
-
),
|
|
38
|
+
), ut = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
30
39
|
"div",
|
|
31
40
|
{
|
|
32
|
-
className:
|
|
41
|
+
className: w(
|
|
33
42
|
"tw:px-4 tw:py-3 tw:rounded-b-md",
|
|
34
43
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-t tw:border-lm-border tw:dark:border-dm-border",
|
|
35
44
|
t
|
|
36
45
|
),
|
|
37
46
|
...e
|
|
38
47
|
}
|
|
39
|
-
),
|
|
48
|
+
), pt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
40
49
|
"div",
|
|
41
50
|
{
|
|
42
|
-
className:
|
|
51
|
+
className: w(
|
|
43
52
|
"tw:group/card tw:rounded-md tw:shadow-md",
|
|
44
53
|
"tw:border tw:border-lm-border tw:dark:border-dm-border tw:bg-lm-primary tw:dark:bg-dm-primary",
|
|
45
54
|
t
|
|
46
55
|
),
|
|
47
56
|
...e
|
|
48
57
|
}
|
|
49
|
-
), v = Object.assign(
|
|
50
|
-
const { title: o, titleSize: a = "md", ...
|
|
58
|
+
), v = Object.assign(pt, { Body: bt, Header: gt, Footer: ut }), ht = ({ bodyClassName: t, children: e, ...r }) => {
|
|
59
|
+
const { title: o, titleSize: a = "md", ...l } = "title" in r ? r : {
|
|
51
60
|
...r,
|
|
52
61
|
title: void 0,
|
|
53
62
|
titleSize: void 0
|
|
54
63
|
};
|
|
55
|
-
return /* @__PURE__ */ g(v, { ...
|
|
64
|
+
return /* @__PURE__ */ g(v, { ...l, children: [
|
|
56
65
|
o && /* @__PURE__ */ g(v.Header, { children: [
|
|
57
66
|
a === "lg" && /* @__PURE__ */ n("h4", { children: o }),
|
|
58
67
|
a === "md" && /* @__PURE__ */ n("h5", { children: o }),
|
|
@@ -61,58 +70,58 @@ const mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
|
61
70
|
/* @__PURE__ */ n(v.Body, { className: t, children: e })
|
|
62
71
|
] });
|
|
63
72
|
};
|
|
64
|
-
function
|
|
73
|
+
function ft({
|
|
65
74
|
id: t,
|
|
66
75
|
items: e,
|
|
67
76
|
onSelectItem: r,
|
|
68
77
|
onActiveItemChange: o,
|
|
69
78
|
renderItem: a,
|
|
70
|
-
className:
|
|
71
|
-
noItemsMessage:
|
|
79
|
+
className: l,
|
|
80
|
+
noItemsMessage: d = "No items",
|
|
72
81
|
anchor: s,
|
|
73
|
-
"aria-label":
|
|
74
|
-
...
|
|
82
|
+
"aria-label": i = "Items",
|
|
83
|
+
...c
|
|
75
84
|
}) {
|
|
76
|
-
const [
|
|
85
|
+
const [m, u] = F(0), p = C((f) => {
|
|
77
86
|
if (u(f), o) {
|
|
78
|
-
const [
|
|
79
|
-
o(
|
|
87
|
+
const [b, h] = [...e.entries()][f];
|
|
88
|
+
o(b, h);
|
|
80
89
|
}
|
|
81
90
|
}, [e, o]);
|
|
82
|
-
return
|
|
91
|
+
return M(() => {
|
|
83
92
|
const f = s == null ? void 0 : s.current;
|
|
84
93
|
if (!f)
|
|
85
94
|
return;
|
|
86
|
-
const
|
|
87
|
-
["Enter", "ArrowUp", "ArrowDown"].includes(h.key) && h.preventDefault(), h.key === "ArrowDown" ? p(Math.min(
|
|
95
|
+
const b = (h) => {
|
|
96
|
+
["Enter", "ArrowUp", "ArrowDown"].includes(h.key) && h.preventDefault(), h.key === "ArrowDown" ? p(Math.min(m + 1, e.size - 1)) : h.key === "ArrowUp" ? p(Math.max(m - 1, 0)) : h.key === "Enter" && r([...e.values()][m]);
|
|
88
97
|
};
|
|
89
|
-
return f.addEventListener("keydown",
|
|
90
|
-
}, [
|
|
98
|
+
return f.addEventListener("keydown", b), () => f.removeEventListener("keydown", b);
|
|
99
|
+
}, [m, s, p, e, r]), /* @__PURE__ */ g(
|
|
91
100
|
v,
|
|
92
101
|
{
|
|
93
102
|
id: t,
|
|
94
|
-
className:
|
|
103
|
+
className: w("tw:py-1 tw:flex tw:flex-col", l),
|
|
95
104
|
role: "listbox",
|
|
96
105
|
"aria-orientation": "vertical",
|
|
97
|
-
"aria-label":
|
|
98
|
-
...
|
|
106
|
+
"aria-label": i,
|
|
107
|
+
...c,
|
|
99
108
|
children: [
|
|
100
|
-
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:
|
|
101
|
-
[...e.entries()].map(([f,
|
|
109
|
+
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: d }),
|
|
110
|
+
[...e.entries()].map(([f, b], h) => /* @__PURE__ */ n(
|
|
102
111
|
"button",
|
|
103
112
|
{
|
|
104
113
|
id: `${t}_${f}`,
|
|
105
114
|
type: "button",
|
|
106
115
|
role: "option",
|
|
107
|
-
"aria-selected": h ===
|
|
108
|
-
className:
|
|
116
|
+
"aria-selected": h === m,
|
|
117
|
+
className: w(
|
|
109
118
|
"tw:px-2 tw:py-1 tw:text-left tw:truncate",
|
|
110
|
-
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary": h ===
|
|
119
|
+
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary": h === m }
|
|
111
120
|
),
|
|
112
121
|
tabIndex: -1,
|
|
113
|
-
onClick: () => r(
|
|
122
|
+
onClick: () => r(b),
|
|
114
123
|
onMouseOver: () => p(h),
|
|
115
|
-
children: a(
|
|
124
|
+
children: a(b)
|
|
116
125
|
},
|
|
117
126
|
f
|
|
118
127
|
))
|
|
@@ -120,52 +129,52 @@ function ht({
|
|
|
120
129
|
}
|
|
121
130
|
);
|
|
122
131
|
}
|
|
123
|
-
const
|
|
132
|
+
const E = H(void 0), T = H({ responsive: !0 }), xt = ({ children: t, className: e }) => {
|
|
124
133
|
const { responsive: r } = N(T);
|
|
125
|
-
return /* @__PURE__ */ n(
|
|
134
|
+
return /* @__PURE__ */ n(E.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
|
|
126
135
|
"thead",
|
|
127
136
|
{
|
|
128
|
-
className:
|
|
137
|
+
className: w(
|
|
129
138
|
{ "tw:hidden tw:lg:table-header-group": r },
|
|
130
139
|
e
|
|
131
140
|
),
|
|
132
141
|
children: t
|
|
133
142
|
}
|
|
134
143
|
) });
|
|
135
|
-
},
|
|
144
|
+
}, yt = ({ children: t, className: e }) => {
|
|
136
145
|
const { responsive: r } = N(T);
|
|
137
|
-
return /* @__PURE__ */ n(
|
|
146
|
+
return /* @__PURE__ */ n(E.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
|
|
138
147
|
"tbody",
|
|
139
148
|
{
|
|
140
|
-
className:
|
|
149
|
+
className: w(
|
|
141
150
|
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": r },
|
|
142
151
|
e
|
|
143
152
|
),
|
|
144
153
|
children: t
|
|
145
154
|
}
|
|
146
155
|
) });
|
|
147
|
-
},
|
|
156
|
+
}, vt = ({ children: t, className: e }) => {
|
|
148
157
|
const { responsive: r } = N(T);
|
|
149
|
-
return /* @__PURE__ */ n(
|
|
158
|
+
return /* @__PURE__ */ n(E.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
|
|
150
159
|
"tfoot",
|
|
151
160
|
{
|
|
152
|
-
className:
|
|
161
|
+
className: w(
|
|
153
162
|
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": r },
|
|
154
163
|
e
|
|
155
164
|
),
|
|
156
165
|
children: t
|
|
157
166
|
}
|
|
158
167
|
) });
|
|
159
|
-
},
|
|
160
|
-
const o = N(
|
|
168
|
+
}, kt = ({ children: t, className: e, ...r }) => {
|
|
169
|
+
const o = N(E), a = (o == null ? void 0 : o.section) === "body", { responsive: l } = N(T);
|
|
161
170
|
return /* @__PURE__ */ n(
|
|
162
171
|
"tr",
|
|
163
172
|
{
|
|
164
|
-
className:
|
|
173
|
+
className: w(
|
|
165
174
|
"tw:group",
|
|
166
175
|
{
|
|
167
|
-
"tw:lg:table-row tw:flex tw:flex-col":
|
|
168
|
-
"tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border":
|
|
176
|
+
"tw:lg:table-row tw:flex tw:flex-col": l,
|
|
177
|
+
"tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": l,
|
|
169
178
|
"tw:hover:bg-lm-primary tw:dark:hover:bg-dm-primary": a,
|
|
170
179
|
// Use a different hover bg color depending on the table being inside a card or not
|
|
171
180
|
"tw:group-[&]/card:hover:bg-lm-secondary tw:dark:group-[&]/card:hover:bg-dm-secondary": a
|
|
@@ -176,19 +185,19 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
176
185
|
children: t
|
|
177
186
|
}
|
|
178
187
|
);
|
|
179
|
-
},
|
|
180
|
-
const
|
|
188
|
+
}, Nt = ({ children: t, className: e, columnName: r, type: o, ...a }) => {
|
|
189
|
+
const l = N(E), d = o ?? ((l == null ? void 0 : l.section) !== "body" ? "th" : "td"), { responsive: s } = N(T);
|
|
181
190
|
return /* @__PURE__ */ n(
|
|
182
|
-
|
|
191
|
+
d,
|
|
183
192
|
{
|
|
184
193
|
"data-column": s ? r : void 0,
|
|
185
|
-
className:
|
|
194
|
+
className: w(
|
|
186
195
|
"tw:p-2 tw:border-lm-border tw:dark:border-dm-border",
|
|
187
196
|
{
|
|
188
197
|
"tw:border-b-1": !s,
|
|
189
198
|
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": s,
|
|
190
199
|
// For md and lower, display the content in data-column attribute as before
|
|
191
|
-
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": s &&
|
|
200
|
+
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": s && d === "td"
|
|
192
201
|
},
|
|
193
202
|
e
|
|
194
203
|
),
|
|
@@ -196,31 +205,31 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
196
205
|
children: t
|
|
197
206
|
}
|
|
198
207
|
);
|
|
199
|
-
},
|
|
200
|
-
/* @__PURE__ */ n(
|
|
201
|
-
/* @__PURE__ */ n(
|
|
202
|
-
e && /* @__PURE__ */ n(
|
|
203
|
-
] }) }),
|
|
208
|
+
}, Pt = ({ header: t, footer: e, children: r, responsive: o = !0, ...a }) => /* @__PURE__ */ n(T.Provider, { value: { responsive: o }, children: /* @__PURE__ */ g("table", { className: "tw:w-full", ...a, children: [
|
|
209
|
+
/* @__PURE__ */ n(xt, { children: t }),
|
|
210
|
+
/* @__PURE__ */ n(yt, { children: r }),
|
|
211
|
+
e && /* @__PURE__ */ n(vt, { children: e })
|
|
212
|
+
] }) }), Vt = Object.assign(Pt, { Row: kt, Cell: Nt }), Ct = ({
|
|
204
213
|
children: t,
|
|
205
214
|
className: e,
|
|
206
215
|
disabled: r,
|
|
207
216
|
variant: o = "primary",
|
|
208
217
|
size: a = "md",
|
|
209
|
-
inline:
|
|
210
|
-
solid:
|
|
218
|
+
inline: l = !1,
|
|
219
|
+
solid: d = !1,
|
|
211
220
|
type: s = "button",
|
|
212
|
-
...
|
|
221
|
+
...i
|
|
213
222
|
}) => {
|
|
214
|
-
const
|
|
223
|
+
const c = "to" in i ? S : "button", m = c === S ? void 0 : s;
|
|
215
224
|
return (
|
|
216
225
|
// @ts-expect-error We are explicitly checking for the `to` prop before using Link
|
|
217
226
|
/* @__PURE__ */ n(
|
|
218
|
-
|
|
227
|
+
c,
|
|
219
228
|
{
|
|
220
|
-
className:
|
|
229
|
+
className: w(
|
|
221
230
|
{
|
|
222
|
-
"tw:inline-flex":
|
|
223
|
-
"tw:flex": !
|
|
231
|
+
"tw:inline-flex": l,
|
|
232
|
+
"tw:flex": !l
|
|
224
233
|
},
|
|
225
234
|
"tw:gap-2 tw:items-center tw:justify-center",
|
|
226
235
|
"tw:border tw:rounded-md tw:no-underline",
|
|
@@ -238,11 +247,11 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
238
247
|
{
|
|
239
248
|
"tw:border-brand tw:text-brand": o === "primary",
|
|
240
249
|
"tw:border-zinc-500": o === "secondary",
|
|
241
|
-
"tw:text-zinc-500": o === "secondary" && !
|
|
250
|
+
"tw:text-zinc-500": o === "secondary" && !d,
|
|
242
251
|
"tw:border-danger": o === "danger",
|
|
243
|
-
"tw:text-danger": o === "danger" && !
|
|
252
|
+
"tw:text-danger": o === "danger" && !d
|
|
244
253
|
},
|
|
245
|
-
|
|
254
|
+
d && {
|
|
246
255
|
"tw:text-white": !0,
|
|
247
256
|
"tw:bg-brand": o === "primary",
|
|
248
257
|
"tw:highlight:bg-brand-dark tw:highlight:border-brand-dark": o === "primary",
|
|
@@ -252,7 +261,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
252
261
|
"tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": o === "danger"
|
|
253
262
|
},
|
|
254
263
|
!r && {
|
|
255
|
-
"tw:highlight:text-white": !
|
|
264
|
+
"tw:highlight:text-white": !d,
|
|
256
265
|
"tw:highlight:bg-brand": o === "primary",
|
|
257
266
|
"tw:highlight:bg-zinc-500": o === "secondary",
|
|
258
267
|
"tw:highlight:bg-danger": o === "danger"
|
|
@@ -263,14 +272,14 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
263
272
|
e
|
|
264
273
|
),
|
|
265
274
|
disabled: r,
|
|
266
|
-
type:
|
|
267
|
-
...
|
|
275
|
+
type: m,
|
|
276
|
+
...i,
|
|
268
277
|
children: t
|
|
269
278
|
}
|
|
270
279
|
)
|
|
271
280
|
);
|
|
272
|
-
},
|
|
273
|
-
const a =
|
|
281
|
+
}, Y = y(({ className: t, onChange: e, ...r }, o) => {
|
|
282
|
+
const a = C((l) => e == null ? void 0 : e(l.target.checked, l), [e]);
|
|
274
283
|
return /* @__PURE__ */ n(
|
|
275
284
|
"input",
|
|
276
285
|
{
|
|
@@ -288,24 +297,24 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
288
297
|
...r
|
|
289
298
|
}
|
|
290
299
|
);
|
|
291
|
-
}),
|
|
292
|
-
|
|
300
|
+
}), Xt = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
301
|
+
Y,
|
|
293
302
|
{
|
|
294
303
|
ref: r,
|
|
295
304
|
className: x("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
|
|
296
305
|
...e
|
|
297
306
|
}
|
|
298
|
-
)),
|
|
307
|
+
)), Q = ({ onClick: t, label: e = "Close" }) => /* @__PURE__ */ n(
|
|
299
308
|
"button",
|
|
300
309
|
{
|
|
301
310
|
type: "button",
|
|
302
311
|
onClick: t,
|
|
303
|
-
className:
|
|
312
|
+
className: w(
|
|
304
313
|
"tw:opacity-50 tw:highlight:opacity-80 tw:transition-opacity",
|
|
305
314
|
"tw:rounded-md tw:focus-ring"
|
|
306
315
|
),
|
|
307
316
|
"aria-label": e,
|
|
308
|
-
children: /* @__PURE__ */ n(k, { icon:
|
|
317
|
+
children: /* @__PURE__ */ n(k, { icon: dt, size: "xl" })
|
|
309
318
|
}
|
|
310
319
|
), U = y(({
|
|
311
320
|
borderless: t = !1,
|
|
@@ -313,15 +322,15 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
313
322
|
feedback: r,
|
|
314
323
|
className: o,
|
|
315
324
|
disabled: a,
|
|
316
|
-
readOnly:
|
|
317
|
-
...
|
|
325
|
+
readOnly: l,
|
|
326
|
+
...d
|
|
318
327
|
}, s) => {
|
|
319
|
-
const
|
|
328
|
+
const i = !a && !l;
|
|
320
329
|
return /* @__PURE__ */ n(
|
|
321
330
|
"input",
|
|
322
331
|
{
|
|
323
332
|
ref: s,
|
|
324
|
-
className:
|
|
333
|
+
className: w(
|
|
325
334
|
"tw:w-full",
|
|
326
335
|
{
|
|
327
336
|
"tw:focus-ring": !r,
|
|
@@ -336,55 +345,65 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
336
345
|
"tw:rounded-md tw:border": !t,
|
|
337
346
|
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !r,
|
|
338
347
|
"tw:border-danger": !t && r === "error",
|
|
339
|
-
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !
|
|
340
|
-
"tw:bg-lm-primary tw:dark:bg-dm-primary":
|
|
348
|
+
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !i,
|
|
349
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary": i,
|
|
341
350
|
// Use different background color when rendered inside a card
|
|
342
|
-
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input":
|
|
351
|
+
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": i
|
|
343
352
|
},
|
|
344
353
|
o
|
|
345
354
|
),
|
|
346
355
|
disabled: a,
|
|
347
|
-
readOnly:
|
|
348
|
-
...
|
|
356
|
+
readOnly: l,
|
|
357
|
+
...d
|
|
349
358
|
}
|
|
350
359
|
);
|
|
351
360
|
}), K = ({ required: t, children: e, className: r, ...o }) => /* @__PURE__ */ g("label", { className: x("tw:cursor-pointer", r), ...o, children: [
|
|
352
361
|
e,
|
|
353
362
|
t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
|
|
354
|
-
] }),
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
363
|
+
] }), W = ({ children: t, helpText: e, error: r, "data-testid": o }) => /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", "data-testid": o, children: [
|
|
364
|
+
t,
|
|
365
|
+
e && /* @__PURE__ */ n(
|
|
366
|
+
"small",
|
|
367
|
+
{
|
|
368
|
+
"data-testid": o ? `${o}-help-text` : "help-text",
|
|
369
|
+
className: "tw:text-gray-500 tw:dark:text-gray-400",
|
|
370
|
+
children: e
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
r && /* @__PURE__ */ n("span", { "data-testid": o ? `${o}-error` : "error", className: "tw:text-danger", children: r })
|
|
374
|
+
] }), Yt = y(({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: a, helpText: l, "data-testid": d, ...s }, i) => {
|
|
375
|
+
const c = D();
|
|
376
|
+
return /* @__PURE__ */ g(W, { error: a, helpText: l, "data-testid": d, children: [
|
|
377
|
+
/* @__PURE__ */ n(K, { htmlFor: c, required: r, children: t }),
|
|
358
378
|
/* @__PURE__ */ n(
|
|
359
379
|
U,
|
|
360
380
|
{
|
|
361
|
-
ref:
|
|
362
|
-
id:
|
|
381
|
+
ref: i,
|
|
382
|
+
id: c,
|
|
363
383
|
className: e,
|
|
364
384
|
required: r || o,
|
|
365
385
|
feedback: a ? "error" : void 0,
|
|
366
|
-
...
|
|
386
|
+
...s
|
|
367
387
|
}
|
|
368
|
-
)
|
|
369
|
-
a && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: a })
|
|
388
|
+
)
|
|
370
389
|
] });
|
|
371
390
|
}), It = y(({ containerClassName: t, className: e, size: r, ...o }, a) => {
|
|
372
|
-
const [
|
|
391
|
+
const [l, d, , s] = wt(!1), i = L(null), c = C(({ relatedTarget: m }) => {
|
|
373
392
|
var u;
|
|
374
|
-
(u =
|
|
375
|
-
}, [
|
|
393
|
+
(u = i.current) != null && u.contains(m) || s();
|
|
394
|
+
}, [i, s]);
|
|
376
395
|
return /* @__PURE__ */ g(
|
|
377
396
|
"div",
|
|
378
397
|
{
|
|
379
398
|
className: x("tw:group tw:relative", t),
|
|
380
|
-
ref:
|
|
381
|
-
onBlurCapture:
|
|
399
|
+
ref: i,
|
|
400
|
+
onBlurCapture: c,
|
|
382
401
|
children: [
|
|
383
402
|
/* @__PURE__ */ n(
|
|
384
403
|
U,
|
|
385
404
|
{
|
|
386
405
|
ref: a,
|
|
387
|
-
type:
|
|
406
|
+
type: l ? "text" : "password",
|
|
388
407
|
className: x(
|
|
389
408
|
{
|
|
390
409
|
"tw:pr-10": r !== "sm",
|
|
@@ -401,9 +420,9 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
401
420
|
"button",
|
|
402
421
|
{
|
|
403
422
|
type: "button",
|
|
404
|
-
onClick:
|
|
405
|
-
title:
|
|
406
|
-
"aria-label":
|
|
423
|
+
onClick: d,
|
|
424
|
+
title: l ? "Hide password" : "Show password",
|
|
425
|
+
"aria-label": l ? "Hide password" : "Show password",
|
|
407
426
|
className: x(
|
|
408
427
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:px-1",
|
|
409
428
|
"tw:text-placeholder tw:hover:text-lm-text tw:hover:dark:text-dm-text tw:transition-colors",
|
|
@@ -413,41 +432,40 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
413
432
|
}
|
|
414
433
|
),
|
|
415
434
|
tabIndex: -1,
|
|
416
|
-
children: /* @__PURE__ */ n(k, { fixedWidth: !0, icon:
|
|
435
|
+
children: /* @__PURE__ */ n(k, { fixedWidth: !0, icon: l ? lt : st })
|
|
417
436
|
}
|
|
418
437
|
)
|
|
419
438
|
]
|
|
420
439
|
}
|
|
421
440
|
);
|
|
422
|
-
}),
|
|
423
|
-
const
|
|
424
|
-
return /* @__PURE__ */ g(
|
|
425
|
-
/* @__PURE__ */ n(K, { htmlFor:
|
|
441
|
+
}), Zt = y(({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: a, helpText: l, "data-testid": d, ...s }, i) => {
|
|
442
|
+
const c = D();
|
|
443
|
+
return /* @__PURE__ */ g(W, { error: a, helpText: l, "data-testid": d, children: [
|
|
444
|
+
/* @__PURE__ */ n(K, { htmlFor: c, required: r, children: t }),
|
|
426
445
|
/* @__PURE__ */ n(
|
|
427
446
|
It,
|
|
428
447
|
{
|
|
429
|
-
ref:
|
|
430
|
-
id:
|
|
448
|
+
ref: i,
|
|
449
|
+
id: c,
|
|
431
450
|
className: e,
|
|
432
451
|
required: r || o,
|
|
433
452
|
feedback: a ? "error" : void 0,
|
|
434
|
-
...
|
|
453
|
+
...s
|
|
435
454
|
}
|
|
436
|
-
)
|
|
437
|
-
a && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: a })
|
|
455
|
+
)
|
|
438
456
|
] });
|
|
439
|
-
}),
|
|
457
|
+
}), Lt = y(({
|
|
440
458
|
className: t,
|
|
441
459
|
size: e = "md",
|
|
442
460
|
feedback: r,
|
|
443
461
|
style: o = {},
|
|
444
462
|
disabled: a,
|
|
445
|
-
...
|
|
446
|
-
},
|
|
463
|
+
...l
|
|
464
|
+
}, d) => /* @__PURE__ */ n(
|
|
447
465
|
"select",
|
|
448
466
|
{
|
|
449
|
-
ref:
|
|
450
|
-
className:
|
|
467
|
+
ref: d,
|
|
468
|
+
className: w(
|
|
451
469
|
"tw:w-full tw:appearance-none tw:pr-9",
|
|
452
470
|
"tw:bg-(image:--chevron-down) tw:bg-no-repeat",
|
|
453
471
|
{
|
|
@@ -474,13 +492,23 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
474
492
|
background: "right 0.75rem center / 16px 12px"
|
|
475
493
|
},
|
|
476
494
|
disabled: a,
|
|
477
|
-
...
|
|
495
|
+
...l
|
|
478
496
|
}
|
|
479
|
-
)),
|
|
480
|
-
const
|
|
481
|
-
return /* @__PURE__ */ g(
|
|
482
|
-
/* @__PURE__ */ n(K, { htmlFor:
|
|
483
|
-
/* @__PURE__ */ n(
|
|
497
|
+
)), te = y(({ selectClassName: t, label: e, error: r, helpText: o, required: a, hiddenRequired: l, "data-testid": d, ...s }, i) => {
|
|
498
|
+
const c = D();
|
|
499
|
+
return /* @__PURE__ */ g(W, { error: r, helpText: o, "data-testid": d, children: [
|
|
500
|
+
/* @__PURE__ */ n(K, { htmlFor: c, required: a, children: e }),
|
|
501
|
+
/* @__PURE__ */ n(
|
|
502
|
+
Lt,
|
|
503
|
+
{
|
|
504
|
+
ref: i,
|
|
505
|
+
id: c,
|
|
506
|
+
className: t,
|
|
507
|
+
required: a || l,
|
|
508
|
+
feedback: r ? "error" : void 0,
|
|
509
|
+
...s
|
|
510
|
+
}
|
|
511
|
+
)
|
|
484
512
|
] });
|
|
485
513
|
}), Tt = y(({
|
|
486
514
|
onChange: t,
|
|
@@ -489,18 +517,18 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
489
517
|
// Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
|
|
490
518
|
size: o = "lg",
|
|
491
519
|
loading: a = !1,
|
|
492
|
-
...
|
|
493
|
-
},
|
|
494
|
-
const { setTimeout: s, clearCurrentTimeout:
|
|
495
|
-
|
|
496
|
-
}, [
|
|
497
|
-
return /* @__PURE__ */ g("div", { className:
|
|
520
|
+
...l
|
|
521
|
+
}, d) => {
|
|
522
|
+
const { setTimeout: s, clearCurrentTimeout: i } = ct(500), c = C((m) => {
|
|
523
|
+
m ? s(() => t(m)) : (i(), t(m));
|
|
524
|
+
}, [i, t, s]);
|
|
525
|
+
return /* @__PURE__ */ g("div", { className: w("tw:group tw:relative tw:focus-within:z-10", e), children: [
|
|
498
526
|
/* @__PURE__ */ n(
|
|
499
527
|
k,
|
|
500
528
|
{
|
|
501
|
-
icon: a ?
|
|
529
|
+
icon: a ? X : it,
|
|
502
530
|
spin: a,
|
|
503
|
-
className:
|
|
531
|
+
className: w(
|
|
504
532
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
|
|
505
533
|
"tw:text-placeholder tw:group-focus-within:text-lm-text tw:dark:group-focus-within:text-dm-text",
|
|
506
534
|
{
|
|
@@ -513,9 +541,9 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
513
541
|
/* @__PURE__ */ n(
|
|
514
542
|
U,
|
|
515
543
|
{
|
|
516
|
-
ref:
|
|
544
|
+
ref: d,
|
|
517
545
|
type: "search",
|
|
518
|
-
className:
|
|
546
|
+
className: w(
|
|
519
547
|
{
|
|
520
548
|
"tw:pl-9": o !== "sm",
|
|
521
549
|
"tw:pl-7": o === "sm"
|
|
@@ -523,36 +551,36 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
523
551
|
r
|
|
524
552
|
),
|
|
525
553
|
placeholder: "Search...",
|
|
526
|
-
onChange: (
|
|
554
|
+
onChange: (m) => c(m.target.value),
|
|
527
555
|
size: o,
|
|
528
|
-
...
|
|
556
|
+
...l
|
|
529
557
|
}
|
|
530
558
|
)
|
|
531
559
|
] });
|
|
532
560
|
});
|
|
533
|
-
function
|
|
561
|
+
function ee({
|
|
534
562
|
searchResults: t,
|
|
535
563
|
onSearch: e,
|
|
536
564
|
onSelectSearchResult: r,
|
|
537
565
|
renderSearchResult: o,
|
|
538
566
|
size: a = "md",
|
|
539
567
|
// SearchInput defaults its size to 'lg'. Change it to 'md'
|
|
540
|
-
listboxSpan:
|
|
541
|
-
onFocus:
|
|
568
|
+
listboxSpan: l = "full",
|
|
569
|
+
onFocus: d,
|
|
542
570
|
...s
|
|
543
571
|
}) {
|
|
544
|
-
const
|
|
545
|
-
() => t ?
|
|
546
|
-
[
|
|
547
|
-
), f =
|
|
548
|
-
r(
|
|
572
|
+
const i = L(null), c = D(), [m, u] = F(), p = O(
|
|
573
|
+
() => t ? m ?? [...t.keys()][0] : void 0,
|
|
574
|
+
[m, t]
|
|
575
|
+
), f = C((b) => {
|
|
576
|
+
r(b), e(""), i.current.value = "";
|
|
549
577
|
}, [e, r]);
|
|
550
578
|
return /* @__PURE__ */ g(
|
|
551
579
|
"div",
|
|
552
580
|
{
|
|
553
581
|
className: "tw:relative",
|
|
554
|
-
onBlur: (
|
|
555
|
-
|
|
582
|
+
onBlur: (b) => {
|
|
583
|
+
b.currentTarget.contains(b.relatedTarget) || e("");
|
|
556
584
|
},
|
|
557
585
|
children: [
|
|
558
586
|
/* @__PURE__ */ n(
|
|
@@ -560,34 +588,34 @@ function Zt({
|
|
|
560
588
|
{
|
|
561
589
|
onChange: e,
|
|
562
590
|
size: a,
|
|
563
|
-
ref:
|
|
591
|
+
ref: i,
|
|
564
592
|
role: "combobox",
|
|
565
593
|
"aria-autocomplete": "list",
|
|
566
594
|
"aria-expanded": !!t,
|
|
567
|
-
"aria-controls":
|
|
568
|
-
"aria-activedescendant": p ? `${
|
|
595
|
+
"aria-controls": c,
|
|
596
|
+
"aria-activedescendant": p ? `${c}_${p}` : void 0,
|
|
569
597
|
autoComplete: "off",
|
|
570
598
|
autoCorrect: "off",
|
|
571
|
-
onFocus: (
|
|
572
|
-
|
|
599
|
+
onFocus: (b) => {
|
|
600
|
+
d == null || d(b), e(b.target.value);
|
|
573
601
|
},
|
|
574
602
|
...s
|
|
575
603
|
}
|
|
576
604
|
),
|
|
577
605
|
t && /* @__PURE__ */ n(
|
|
578
|
-
|
|
606
|
+
ft,
|
|
579
607
|
{
|
|
580
|
-
id:
|
|
608
|
+
id: c,
|
|
581
609
|
items: t,
|
|
582
|
-
anchor:
|
|
610
|
+
anchor: i,
|
|
583
611
|
onSelectItem: f,
|
|
584
612
|
onActiveItemChange: u,
|
|
585
613
|
renderItem: o,
|
|
586
|
-
className:
|
|
614
|
+
className: w(
|
|
587
615
|
"tw:absolute tw:top-full tw:mt-1 tw:z-10",
|
|
588
616
|
{
|
|
589
|
-
"tw:min-w-60 tw:max-w-full":
|
|
590
|
-
"tw:w-full":
|
|
617
|
+
"tw:min-w-60 tw:max-w-full": l === "auto",
|
|
618
|
+
"tw:w-full": l === "full"
|
|
591
619
|
}
|
|
592
620
|
),
|
|
593
621
|
"aria-label": "Matching items",
|
|
@@ -598,8 +626,8 @@ function Zt({
|
|
|
598
626
|
}
|
|
599
627
|
);
|
|
600
628
|
}
|
|
601
|
-
const
|
|
602
|
-
|
|
629
|
+
const re = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
630
|
+
Y,
|
|
603
631
|
{
|
|
604
632
|
ref: r,
|
|
605
633
|
className: x(
|
|
@@ -611,10 +639,10 @@ const te = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
|
611
639
|
),
|
|
612
640
|
...e
|
|
613
641
|
}
|
|
614
|
-
)),
|
|
642
|
+
)), Bt = ({ className: t, disabled: e, size: r = "md", type: o = "button", ...a }) => /* @__PURE__ */ n(
|
|
615
643
|
"button",
|
|
616
644
|
{
|
|
617
|
-
className:
|
|
645
|
+
className: w(
|
|
618
646
|
"tw:inline-flex tw:rounded-md tw:focus-ring",
|
|
619
647
|
"tw:text-brand tw:highlight:text-brand-dark tw:highlight:underline",
|
|
620
648
|
{
|
|
@@ -629,14 +657,14 @@ const te = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
|
629
657
|
type: o,
|
|
630
658
|
...a
|
|
631
659
|
}
|
|
632
|
-
),
|
|
633
|
-
const o = N(
|
|
660
|
+
), Z = H(null), Mt = ({ className: t, to: e, ...r }) => {
|
|
661
|
+
const o = N(Z);
|
|
634
662
|
return /* @__PURE__ */ n(
|
|
635
|
-
|
|
663
|
+
at,
|
|
636
664
|
{
|
|
637
665
|
role: "menuitem",
|
|
638
666
|
to: e,
|
|
639
|
-
className: ({ isActive: a }) =>
|
|
667
|
+
className: ({ isActive: a }) => w(
|
|
640
668
|
"tw:px-4 tw:pt-2 tw:pb-[calc(0.5rem-3px)] tw:border-b-3",
|
|
641
669
|
"tw:font-bold tw:no-underline tw:text-center tw:highlight:text-brand tw:transition-colors",
|
|
642
670
|
"tw:rounded-none tw:outline-none tw:focus-visible:inset-ring-2 tw:focus-visible:inset-ring-brand/50",
|
|
@@ -650,78 +678,78 @@ const te = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
|
650
678
|
...r
|
|
651
679
|
}
|
|
652
680
|
);
|
|
653
|
-
},
|
|
654
|
-
const r =
|
|
655
|
-
Math.max(
|
|
656
|
-
Math.min(e - 1, t +
|
|
681
|
+
}, Et = ({ children: t, className: e, fill: r }) => /* @__PURE__ */ n(Z.Provider, { value: { fill: r }, children: /* @__PURE__ */ n(v, { role: "menubar", className: w("tw:flex tw:overflow-hidden", e), children: t }) }), oe = Object.assign(Et, { Pill: Mt }), _t = new Intl.NumberFormat("en-US"), Rt = (t) => _t.format(Number(t)), V = 10, ne = (t) => Math.ceil(t / V) * V, I = 2, R = "...", Ft = (t, e) => Array.from({ length: e - t }, (r, o) => t + o), Dt = (t, e) => {
|
|
682
|
+
const r = Ft(
|
|
683
|
+
Math.max(I, t - I),
|
|
684
|
+
Math.min(e - 1, t + I) + 1
|
|
657
685
|
);
|
|
658
|
-
return t -
|
|
659
|
-
},
|
|
686
|
+
return t - I > I && r.unshift(R), t + I < e - 1 && r.push(R), r.unshift(1), r.push(e), r;
|
|
687
|
+
}, B = (t) => t === R, $t = (t) => B(t) ? t : Rt(t), At = (t, e) => B(t) ? `${t}_${e}` : `${t}`, tt = [
|
|
660
688
|
"tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
|
|
661
689
|
"tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
|
|
662
|
-
],
|
|
663
|
-
|
|
690
|
+
], et = (t = !1) => w(
|
|
691
|
+
tt,
|
|
664
692
|
"tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
|
|
665
693
|
"tw:focus-ring tw:focus-visible:z-1",
|
|
666
694
|
{
|
|
667
695
|
"tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:text-brand": !t,
|
|
668
696
|
"tw:bg-lm-brand tw:dark:bg-dm-brand tw:text-white": t
|
|
669
697
|
}
|
|
670
|
-
), j = ({ children: t }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className:
|
|
698
|
+
), j = ({ children: t }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: w(tt, "tw:px-3 py-2 tw:text-gray-400"), children: t }), rt = () => /* @__PURE__ */ n(j, { children: R });
|
|
671
699
|
function St({ children: t, active: e, isEllipsis: r, href: o, ...a }) {
|
|
672
|
-
const
|
|
673
|
-
return r ? /* @__PURE__ */ n(
|
|
700
|
+
const l = O(() => et(e), [e]);
|
|
701
|
+
return r ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n(S, { className: l, to: o, ...a, children: t });
|
|
674
702
|
}
|
|
675
703
|
function jt({ children: t, active: e, isEllipsis: r, ...o }) {
|
|
676
|
-
const a = O(() =>
|
|
677
|
-
return r ? /* @__PURE__ */ n(
|
|
704
|
+
const a = O(() => et(e), [e]);
|
|
705
|
+
return r ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n("button", { type: "button", className: a, ...o, children: t });
|
|
678
706
|
}
|
|
679
|
-
const
|
|
680
|
-
const o = "urlForPage" in r, a = o ? St : jt,
|
|
681
|
-
(
|
|
707
|
+
const ae = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
708
|
+
const o = "urlForPage" in r, a = o ? St : jt, l = C(
|
|
709
|
+
(d) => o ? { href: B(d) ? void 0 : r.urlForPage(d) } : { onClick: () => !B(d) && r.onPageChange(d) },
|
|
682
710
|
[o, r]
|
|
683
711
|
);
|
|
684
712
|
return e < 2 ? null : /* @__PURE__ */ g("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
685
|
-
t === 1 ? /* @__PURE__ */ n(j, { children: /* @__PURE__ */ n(k, { size: "xs", icon:
|
|
686
|
-
|
|
713
|
+
t === 1 ? /* @__PURE__ */ n(j, { children: /* @__PURE__ */ n(k, { size: "xs", icon: G }) }) : /* @__PURE__ */ n(a, { ...l(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(k, { size: "xs", icon: G }) }),
|
|
714
|
+
Dt(t, e).map((d, s) => /* @__PURE__ */ n(
|
|
687
715
|
a,
|
|
688
716
|
{
|
|
689
|
-
active:
|
|
690
|
-
isEllipsis:
|
|
691
|
-
...d
|
|
692
|
-
children:
|
|
717
|
+
active: d === t,
|
|
718
|
+
isEllipsis: B(d),
|
|
719
|
+
...l(d),
|
|
720
|
+
children: $t(d)
|
|
693
721
|
},
|
|
694
|
-
|
|
722
|
+
At(d, s)
|
|
695
723
|
)),
|
|
696
|
-
t === e ? /* @__PURE__ */ n(j, { children: /* @__PURE__ */ n(k, { size: "xs", icon:
|
|
724
|
+
t === e ? /* @__PURE__ */ n(j, { children: /* @__PURE__ */ n(k, { size: "xs", icon: J }) }) : /* @__PURE__ */ n(a, { ...l(Math.min(e, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(k, { size: "xs", icon: J }) })
|
|
697
725
|
] });
|
|
698
|
-
},
|
|
726
|
+
}, Ht = ({
|
|
699
727
|
open: t,
|
|
700
728
|
children: e,
|
|
701
729
|
className: r,
|
|
702
730
|
onClose: o,
|
|
703
731
|
...a
|
|
704
732
|
}) => {
|
|
705
|
-
const
|
|
706
|
-
return
|
|
707
|
-
var
|
|
708
|
-
const
|
|
733
|
+
const l = L(null);
|
|
734
|
+
return M(() => {
|
|
735
|
+
var c, m;
|
|
736
|
+
const d = document.body, s = d.style.overflow, i = d.style.paddingRight;
|
|
709
737
|
if (t) {
|
|
710
|
-
const u = window.outerWidth -
|
|
711
|
-
|
|
738
|
+
const u = window.outerWidth - d.clientWidth, p = d.scrollHeight > d.clientHeight;
|
|
739
|
+
d.style.overflow = "hidden", p && (d.style.paddingRight = `${u}px`), (c = l.current) == null || c.showModal();
|
|
712
740
|
} else
|
|
713
|
-
(
|
|
741
|
+
(m = l.current) == null || m.close();
|
|
714
742
|
return () => {
|
|
715
|
-
|
|
743
|
+
d.style.overflow = s, d.style.paddingRight = i;
|
|
716
744
|
};
|
|
717
|
-
}, [t]),
|
|
745
|
+
}, [t]), mt(
|
|
718
746
|
/* @__PURE__ */ n(
|
|
719
747
|
"dialog",
|
|
720
748
|
{
|
|
721
|
-
ref:
|
|
722
|
-
className:
|
|
723
|
-
onCancel: (
|
|
724
|
-
|
|
749
|
+
ref: l,
|
|
750
|
+
className: w("tw:bg-transparent tw:backdrop:bg-black/50", r),
|
|
751
|
+
onCancel: (d) => {
|
|
752
|
+
d.preventDefault(), o();
|
|
725
753
|
},
|
|
726
754
|
...a,
|
|
727
755
|
children: t && e
|
|
@@ -729,64 +757,64 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
729
757
|
),
|
|
730
758
|
document.body
|
|
731
759
|
);
|
|
732
|
-
},
|
|
760
|
+
}, de = ({
|
|
733
761
|
open: t,
|
|
734
762
|
onClose: e,
|
|
735
763
|
variant: r = "default",
|
|
736
764
|
title: o,
|
|
737
765
|
children: a,
|
|
738
|
-
className:
|
|
739
|
-
...
|
|
766
|
+
className: l,
|
|
767
|
+
...d
|
|
740
768
|
}) => {
|
|
741
769
|
const {
|
|
742
770
|
size: s = "md",
|
|
743
|
-
confirmText:
|
|
744
|
-
cancelText:
|
|
745
|
-
confirmDisabled:
|
|
771
|
+
confirmText: i = "Confirm",
|
|
772
|
+
cancelText: c = "Cancel",
|
|
773
|
+
confirmDisabled: m,
|
|
746
774
|
onConfirm: u,
|
|
747
775
|
onClosed: p,
|
|
748
776
|
...f
|
|
749
|
-
} = "onConfirm" in
|
|
750
|
-
|
|
777
|
+
} = "onConfirm" in d ? d : { ...d }, [b, h] = F(t), _ = L(null), $ = L("cancel"), ot = C(() => {
|
|
778
|
+
$.current = "confirm", u == null || u();
|
|
751
779
|
}, [u]);
|
|
752
|
-
return
|
|
780
|
+
return M(() => {
|
|
753
781
|
if (t) {
|
|
754
|
-
|
|
782
|
+
$.current = "cancel", h(!0);
|
|
755
783
|
return;
|
|
756
784
|
}
|
|
757
|
-
const P =
|
|
785
|
+
const P = _.current;
|
|
758
786
|
if (P) {
|
|
759
|
-
delete
|
|
760
|
-
let
|
|
761
|
-
const
|
|
762
|
-
|
|
787
|
+
delete _.current.dataset.open;
|
|
788
|
+
let q = !1;
|
|
789
|
+
const z = (nt) => {
|
|
790
|
+
q || nt.target !== P || (q = !0, h(!1), p == null || p($.current));
|
|
763
791
|
};
|
|
764
|
-
return P.addEventListener("transitionend",
|
|
765
|
-
P.removeEventListener("transitionend",
|
|
792
|
+
return P.addEventListener("transitionend", z), () => {
|
|
793
|
+
P.removeEventListener("transitionend", z);
|
|
766
794
|
};
|
|
767
795
|
}
|
|
768
|
-
}, [p, t]),
|
|
769
|
-
const P =
|
|
770
|
-
|
|
771
|
-
}, [
|
|
772
|
-
|
|
796
|
+
}, [p, t]), M(() => {
|
|
797
|
+
const P = _.current;
|
|
798
|
+
b && P && (P.dataset.open = "");
|
|
799
|
+
}, [b]), /* @__PURE__ */ n(
|
|
800
|
+
Ht,
|
|
773
801
|
{
|
|
774
|
-
open:
|
|
802
|
+
open: b,
|
|
775
803
|
onClose: e,
|
|
776
|
-
className:
|
|
804
|
+
className: w(
|
|
777
805
|
{
|
|
778
|
-
"tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen":
|
|
806
|
+
"tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": b,
|
|
779
807
|
"tw:overflow-hidden": r === "cover"
|
|
780
808
|
},
|
|
781
|
-
|
|
809
|
+
l
|
|
782
810
|
),
|
|
783
811
|
...f,
|
|
784
812
|
children: /* @__PURE__ */ n(
|
|
785
813
|
"div",
|
|
786
814
|
{
|
|
787
815
|
"data-testid": "transition-container",
|
|
788
|
-
ref:
|
|
789
|
-
className:
|
|
816
|
+
ref: _,
|
|
817
|
+
className: w(
|
|
790
818
|
"tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
|
|
791
819
|
// CSS transitions are based on the presence of the `data-open` attribute
|
|
792
820
|
"tw:-translate-y-4 tw:data-open:translate-y-0 tw:opacity-0 tw:data-open:opacity-100",
|
|
@@ -800,14 +828,14 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
800
828
|
},
|
|
801
829
|
{ "tw:h-full": r === "cover" }
|
|
802
830
|
),
|
|
803
|
-
children: /* @__PURE__ */ n(v, { className:
|
|
831
|
+
children: /* @__PURE__ */ n(v, { className: w(
|
|
804
832
|
"tw:w-full",
|
|
805
833
|
{ "tw:h-full tw:relative tw:overflow-auto": r === "cover" }
|
|
806
|
-
), children: r === "cover" ? /* @__PURE__ */ g(
|
|
834
|
+
), children: r === "cover" ? /* @__PURE__ */ g(A, { children: [
|
|
807
835
|
/* @__PURE__ */ g(
|
|
808
836
|
"div",
|
|
809
837
|
{
|
|
810
|
-
className:
|
|
838
|
+
className: w(
|
|
811
839
|
"tw:px-4 tw:py-3 tw:absolute tw:top-0 tw:left-0 tw:right-0",
|
|
812
840
|
"tw:flex tw:items-center tw:justify-between",
|
|
813
841
|
"tw:text-white tw:bg-linear-to-b tw:from-black/70 tw:to-black/10",
|
|
@@ -815,38 +843,38 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
815
843
|
),
|
|
816
844
|
children: [
|
|
817
845
|
/* @__PURE__ */ n("h5", { children: o }),
|
|
818
|
-
/* @__PURE__ */ n(
|
|
846
|
+
/* @__PURE__ */ n(Q, { onClick: e, label: "Close dialog" })
|
|
819
847
|
]
|
|
820
848
|
}
|
|
821
849
|
),
|
|
822
850
|
/* @__PURE__ */ n("div", { children: a })
|
|
823
|
-
] }) : /* @__PURE__ */ g(
|
|
824
|
-
/* @__PURE__ */ g(v.Header, { className:
|
|
851
|
+
] }) : /* @__PURE__ */ g(A, { children: [
|
|
852
|
+
/* @__PURE__ */ g(v.Header, { className: w(
|
|
825
853
|
"tw:sticky tw:top-0",
|
|
826
854
|
"tw:flex tw:items-center tw:justify-between tw:gap-x-2"
|
|
827
855
|
), children: [
|
|
828
|
-
/* @__PURE__ */ n("h5", { className:
|
|
829
|
-
/* @__PURE__ */ n(
|
|
856
|
+
/* @__PURE__ */ n("h5", { className: w({ "tw:text-danger": r === "danger" }), children: o }),
|
|
857
|
+
/* @__PURE__ */ n(Q, { onClick: e, label: "Close dialog" })
|
|
830
858
|
] }),
|
|
831
859
|
/* @__PURE__ */ n(v.Body, { children: a }),
|
|
832
860
|
u && /* @__PURE__ */ g(
|
|
833
861
|
v.Footer,
|
|
834
862
|
{
|
|
835
863
|
"data-testid": "footer",
|
|
836
|
-
className:
|
|
864
|
+
className: w(
|
|
837
865
|
"tw:flex tw:justify-end tw:items-center tw:gap-x-2",
|
|
838
866
|
"tw:[&]:px-3 tw:sticky tw:bottom-0"
|
|
839
867
|
),
|
|
840
868
|
children: [
|
|
841
|
-
/* @__PURE__ */ n(
|
|
869
|
+
/* @__PURE__ */ n(Bt, { onClick: e, children: c }),
|
|
842
870
|
/* @__PURE__ */ n(
|
|
843
|
-
|
|
871
|
+
Ct,
|
|
844
872
|
{
|
|
845
873
|
solid: !0,
|
|
846
874
|
variant: r === "danger" ? "danger" : "primary",
|
|
847
|
-
disabled:
|
|
848
|
-
onClick:
|
|
849
|
-
children:
|
|
875
|
+
disabled: m,
|
|
876
|
+
onClick: ot,
|
|
877
|
+
children: i
|
|
850
878
|
}
|
|
851
879
|
)
|
|
852
880
|
]
|
|
@@ -857,16 +885,16 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
857
885
|
)
|
|
858
886
|
}
|
|
859
887
|
);
|
|
860
|
-
},
|
|
888
|
+
}, le = ({ className: t, children: e, loading: r = !1, variant: o = "default" }) => /* @__PURE__ */ n(ht, { className: x({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ g("h3", { className: x("tw:text-center", {
|
|
861
889
|
"tw:text-gray-500 tw:dark:text-gray-400": o === "default",
|
|
862
890
|
"tw:text-danger": o === "error"
|
|
863
891
|
}), children: [
|
|
864
|
-
r && /* @__PURE__ */ g(
|
|
865
|
-
/* @__PURE__ */ n(k, { icon:
|
|
892
|
+
r && /* @__PURE__ */ g(A, { children: [
|
|
893
|
+
/* @__PURE__ */ n(k, { icon: X, spin: !0 }),
|
|
866
894
|
/* @__PURE__ */ n("span", { className: "tw:ml-2", children: e ?? "Loading..." })
|
|
867
895
|
] }),
|
|
868
896
|
!r && e
|
|
869
|
-
] }) }),
|
|
897
|
+
] }) }), se = ({ variant: t, className: e, size: r = "md", children: o }) => /* @__PURE__ */ n(
|
|
870
898
|
"div",
|
|
871
899
|
{
|
|
872
900
|
className: x(
|
|
@@ -886,35 +914,36 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
886
914
|
}
|
|
887
915
|
);
|
|
888
916
|
export {
|
|
889
|
-
|
|
917
|
+
Ct as Button,
|
|
890
918
|
v as Card,
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
919
|
+
de as CardModal,
|
|
920
|
+
Xt as Checkbox,
|
|
921
|
+
Q as CloseButton,
|
|
922
|
+
Qt as Details,
|
|
894
923
|
R as ELLIPSIS,
|
|
895
924
|
U as Input,
|
|
896
925
|
K as Label,
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
926
|
+
Yt as LabelledInput,
|
|
927
|
+
Zt as LabelledRevealablePasswordInput,
|
|
928
|
+
te as LabelledSelect,
|
|
929
|
+
Bt as LinkButton,
|
|
930
|
+
ft as Listbox,
|
|
931
|
+
le as Message,
|
|
932
|
+
Ht as ModalDialog,
|
|
933
|
+
oe as NavPills,
|
|
934
|
+
ae as Paginator,
|
|
935
|
+
se as Result,
|
|
907
936
|
It as RevealablePasswordInput,
|
|
908
|
-
|
|
937
|
+
ee as SearchCombobox,
|
|
909
938
|
Tt as SearchInput,
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
939
|
+
Lt as Select,
|
|
940
|
+
ht as SimpleCard,
|
|
941
|
+
Vt as Table,
|
|
942
|
+
re as ToggleSwitch,
|
|
943
|
+
Rt as formatNumber,
|
|
944
|
+
At as keyForPage,
|
|
945
|
+
B as pageIsEllipsis,
|
|
946
|
+
$t as prettifyPageNumber,
|
|
947
|
+
Dt as progressivePagination,
|
|
948
|
+
ne as roundTen
|
|
920
949
|
};
|
package/dist/tailwind.preset.css
CHANGED
|
@@ -50,6 +50,13 @@
|
|
|
50
50
|
--color-warning: #ffc107;
|
|
51
51
|
--color-warning-dark: #ffca2c;
|
|
52
52
|
--color-placeholder: #6c757d;
|
|
53
|
+
|
|
54
|
+
/* Override breakpoints with the values from bootstrap, to keep sizing until fully migrated */
|
|
55
|
+
--breakpoint-sm: 576px;
|
|
56
|
+
--breakpoint-md: 768px;
|
|
57
|
+
--breakpoint-lg: 992px;
|
|
58
|
+
--breakpoint-xl: 1200px;
|
|
59
|
+
--breakpoint-2xl: 1400px;
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
@layer base {
|
package/package.json
CHANGED
|
@@ -62,25 +62,24 @@
|
|
|
62
62
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
63
63
|
"@types/react": "^19.1.2",
|
|
64
64
|
"@types/react-dom": "^19.1.2",
|
|
65
|
-
"@vitejs/plugin-react": "^4.
|
|
66
|
-
"@vitest/browser": "^3.1.
|
|
67
|
-
"@vitest/coverage-v8": "^3.1.
|
|
65
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
66
|
+
"@vitest/browser": "^3.1.2",
|
|
67
|
+
"@vitest/coverage-v8": "^3.1.2",
|
|
68
68
|
"axe-core": "^4.10.3",
|
|
69
69
|
"bootstrap": "5.2.3",
|
|
70
|
-
"eslint": "^9.25.
|
|
70
|
+
"eslint": "^9.25.1",
|
|
71
71
|
"eslint-plugin-import": "^2.31.0",
|
|
72
72
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
73
73
|
"eslint-plugin-react": "^7.37.5",
|
|
74
|
-
"eslint-plugin-react-compiler": "^19.0.0-beta-
|
|
74
|
+
"eslint-plugin-react-compiler": "^19.0.0-beta-714736e-20250131",
|
|
75
75
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
76
76
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
77
77
|
"history": "^5.3.0",
|
|
78
78
|
"playwright": "^1.52.0",
|
|
79
|
-
"
|
|
80
|
-
"sass": "^1.86.3",
|
|
79
|
+
"sass": "^1.87.0",
|
|
81
80
|
"typescript": "^5.8.3",
|
|
82
|
-
"typescript-eslint": "^8.
|
|
83
|
-
"vite": "^6.
|
|
81
|
+
"typescript-eslint": "^8.31.0",
|
|
82
|
+
"vite": "^6.3.3",
|
|
84
83
|
"vite-plugin-dts": "^4.5.3",
|
|
85
84
|
"vitest": "^3.0.2"
|
|
86
85
|
},
|
|
@@ -90,5 +89,5 @@
|
|
|
90
89
|
"not ie <= 11",
|
|
91
90
|
"not op_mini all"
|
|
92
91
|
],
|
|
93
|
-
"version": "0.8.
|
|
92
|
+
"version": "0.8.13"
|
|
94
93
|
}
|