siddha-ui-react 1.0.0 → 1.0.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/README.md +29 -3
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +452 -257
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/styles.css +267 -76
package/lib/index.js
CHANGED
|
@@ -1,149 +1,208 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useId as x, useState as C, useEffect as D, useRef as E, useLayoutEffect as O } from "react";
|
|
3
|
+
const p = (...i) => i.filter(Boolean).join(" ");
|
|
4
|
+
function A({
|
|
5
5
|
children: i,
|
|
6
|
-
variant:
|
|
7
|
-
size:
|
|
6
|
+
variant: n = "primary",
|
|
7
|
+
size: t = "md",
|
|
8
8
|
className: r = "",
|
|
9
|
-
type:
|
|
9
|
+
type: a = "button",
|
|
10
10
|
...s
|
|
11
11
|
}) {
|
|
12
|
-
const
|
|
12
|
+
const c = ["primary", "secondary"].includes(n) ? n : "primary";
|
|
13
13
|
return /* @__PURE__ */ e(
|
|
14
14
|
"button",
|
|
15
15
|
{
|
|
16
|
-
className:
|
|
17
|
-
type:
|
|
16
|
+
className: p("ui-button", `ui-button--${c}`, `ui-button--${t}`, r),
|
|
17
|
+
type: a,
|
|
18
18
|
...s,
|
|
19
19
|
children: i
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function S({ label: i, children: n, size: t = "md", className: r = "", ...a }) {
|
|
24
24
|
return /* @__PURE__ */ e(
|
|
25
25
|
"button",
|
|
26
26
|
{
|
|
27
|
-
className:
|
|
27
|
+
className: p("ui-icon-button", `ui-icon-button--${t}`, r),
|
|
28
28
|
type: "button",
|
|
29
29
|
"aria-label": i,
|
|
30
|
-
...
|
|
31
|
-
children:
|
|
30
|
+
...a,
|
|
31
|
+
children: n
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
return /* @__PURE__ */
|
|
35
|
+
function P({ label: i, helper: n, error: t, className: r = "", id: a, ...s }) {
|
|
36
|
+
const c = x(), l = a || c;
|
|
37
|
+
return /* @__PURE__ */ d("label", { className: p("ui-field", t && "is-error", r), htmlFor: l, children: [
|
|
38
38
|
i && /* @__PURE__ */ e("span", { className: "ui-field__label", children: i }),
|
|
39
39
|
/* @__PURE__ */ e(
|
|
40
40
|
"input",
|
|
41
41
|
{
|
|
42
42
|
id: l,
|
|
43
|
-
"aria-invalid": !!
|
|
44
|
-
"aria-describedby":
|
|
43
|
+
"aria-invalid": !!t,
|
|
44
|
+
"aria-describedby": n || t ? `${l}-message` : void 0,
|
|
45
45
|
...s
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
|
-
(
|
|
48
|
+
(n || t) && /* @__PURE__ */ e("small", { id: `${l}-message`, className: "ui-field__message", children: t || n })
|
|
49
49
|
] });
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
53
|
-
return /* @__PURE__ */
|
|
51
|
+
function G({ label: i, helper: n, error: t, className: r = "", id: a, ...s }) {
|
|
52
|
+
const c = x(), l = a || c;
|
|
53
|
+
return /* @__PURE__ */ d("label", { className: p("ui-field", t && "is-error", r), htmlFor: l, children: [
|
|
54
54
|
i && /* @__PURE__ */ e("span", { className: "ui-field__label", children: i }),
|
|
55
55
|
/* @__PURE__ */ e(
|
|
56
56
|
"textarea",
|
|
57
57
|
{
|
|
58
58
|
id: l,
|
|
59
|
-
"aria-invalid": !!
|
|
60
|
-
"aria-describedby":
|
|
59
|
+
"aria-invalid": !!t,
|
|
60
|
+
"aria-describedby": n || t ? `${l}-message` : void 0,
|
|
61
61
|
...s
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
(
|
|
64
|
+
(n || t) && /* @__PURE__ */ e("small", { id: `${l}-message`, className: "ui-field__message", children: t || n })
|
|
65
65
|
] });
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const l =
|
|
69
|
-
return /* @__PURE__ */
|
|
67
|
+
function U({ label: i, children: n, helper: t, error: r, className: a = "", id: s, ...c }) {
|
|
68
|
+
const l = x(), u = s || l;
|
|
69
|
+
return /* @__PURE__ */ d("label", { className: p("ui-field", r && "is-error", a), htmlFor: u, children: [
|
|
70
70
|
i && /* @__PURE__ */ e("span", { className: "ui-field__label", children: i }),
|
|
71
71
|
/* @__PURE__ */ e(
|
|
72
72
|
"select",
|
|
73
73
|
{
|
|
74
|
-
id:
|
|
74
|
+
id: u,
|
|
75
75
|
"aria-invalid": !!r,
|
|
76
|
-
"aria-describedby":
|
|
77
|
-
...
|
|
78
|
-
children:
|
|
76
|
+
"aria-describedby": t || r ? `${u}-message` : void 0,
|
|
77
|
+
...c,
|
|
78
|
+
children: n
|
|
79
79
|
}
|
|
80
80
|
),
|
|
81
|
-
(
|
|
81
|
+
(t || r) && /* @__PURE__ */ e("small", { id: `${u}-message`, className: "ui-field__message", children: r || t })
|
|
82
82
|
] });
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return /* @__PURE__ */ e(
|
|
84
|
+
function q(i) {
|
|
85
|
+
return /* @__PURE__ */ e(P, { type: "date", ...i });
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
function H({
|
|
88
|
+
label: i = "Upload files",
|
|
89
|
+
helper: n,
|
|
90
|
+
error: t,
|
|
91
|
+
min: r,
|
|
92
|
+
max: a,
|
|
93
|
+
accept: s,
|
|
94
|
+
multiple: c = !1,
|
|
95
|
+
disabled: l = !1,
|
|
96
|
+
className: u = "",
|
|
97
|
+
id: h,
|
|
98
|
+
onChange: b,
|
|
99
|
+
...w
|
|
100
|
+
}) {
|
|
101
|
+
const g = x(), N = h || g, k = `${N}-message`, v = r == null || r === "" ? void 0 : Number(r), _ = a == null || a === "" ? void 0 : Number(a), o = v !== void 0 && (!Number.isFinite(v) || v < 0) ? "Minimum file size must be a non-negative number of bytes." : _ !== void 0 && (!Number.isFinite(_) || _ < 0) ? "Maximum file size must be a non-negative number of bytes." : v !== void 0 && _ !== void 0 && v > _ ? "Minimum file size cannot exceed maximum file size." : "", [m, f] = C(""), y = t || o || m, $ = y || n;
|
|
102
|
+
D(() => {
|
|
103
|
+
f("");
|
|
104
|
+
}, [v, _]);
|
|
105
|
+
const I = (M) => {
|
|
106
|
+
const B = Array.from(M.currentTarget.files ?? []), L = B.find((T) => v != null && T.size < v), z = B.find((T) => _ != null && T.size > _);
|
|
107
|
+
if (L) {
|
|
108
|
+
f(`${L.name} must be at least ${v} bytes.`), M.currentTarget.value = "";
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (z) {
|
|
112
|
+
f(`${z.name} must be no larger than ${_} bytes.`), M.currentTarget.value = "";
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
f(""), b?.(M);
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ d("label", { className: p("ui-file-upload", u), htmlFor: N, children: [
|
|
118
|
+
/* @__PURE__ */ e("span", { className: "ui-file-upload__label", children: i }),
|
|
119
|
+
/* @__PURE__ */ d("span", { className: "ui-file-upload__control", children: [
|
|
120
|
+
/* @__PURE__ */ e(
|
|
121
|
+
"input",
|
|
122
|
+
{
|
|
123
|
+
...w,
|
|
124
|
+
id: N,
|
|
125
|
+
type: "file",
|
|
126
|
+
accept: s,
|
|
127
|
+
multiple: c,
|
|
128
|
+
disabled: l || !!o,
|
|
129
|
+
"aria-invalid": !!y,
|
|
130
|
+
"aria-describedby": $ ? k : void 0,
|
|
131
|
+
onChange: I
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
$ && /* @__PURE__ */ e(
|
|
135
|
+
"small",
|
|
136
|
+
{
|
|
137
|
+
id: k,
|
|
138
|
+
className: p("ui-file-upload__message", y && "is-error"),
|
|
139
|
+
role: y ? "alert" : void 0,
|
|
140
|
+
children: $
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] })
|
|
144
|
+
] });
|
|
145
|
+
}
|
|
146
|
+
function R({ label: i, className: n = "", ...t }) {
|
|
147
|
+
return /* @__PURE__ */ d("label", { className: p("ui-choice", n), children: [
|
|
148
|
+
/* @__PURE__ */ e("input", { type: "checkbox", ...t }),
|
|
90
149
|
/* @__PURE__ */ e("span", { children: i })
|
|
91
150
|
] });
|
|
92
151
|
}
|
|
93
|
-
function
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */ e("input", { type: "radio", ...
|
|
152
|
+
function V({ label: i, className: n = "", ...t }) {
|
|
153
|
+
return /* @__PURE__ */ d("label", { className: p("ui-choice", n), children: [
|
|
154
|
+
/* @__PURE__ */ e("input", { type: "radio", ...t }),
|
|
96
155
|
/* @__PURE__ */ e("span", { children: i })
|
|
97
156
|
] });
|
|
98
157
|
}
|
|
99
|
-
function
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */ e("input", { type: "checkbox", role: "switch", ...
|
|
158
|
+
function W({ label: i, className: n = "", ...t }) {
|
|
159
|
+
return /* @__PURE__ */ d("label", { className: p("ui-switch", n), children: [
|
|
160
|
+
/* @__PURE__ */ e("input", { type: "checkbox", role: "switch", ...t }),
|
|
102
161
|
/* @__PURE__ */ e("span", { className: "ui-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ e("span", {}) }),
|
|
103
162
|
i && /* @__PURE__ */ e("span", { children: i })
|
|
104
163
|
] });
|
|
105
164
|
}
|
|
106
|
-
function
|
|
107
|
-
return /* @__PURE__ */
|
|
165
|
+
function X({ label: i, options: n, listId: t = "autocomplete-options", ...r }) {
|
|
166
|
+
return /* @__PURE__ */ d("label", { className: "ui-field", children: [
|
|
108
167
|
/* @__PURE__ */ e("span", { className: "ui-field__label", children: i }),
|
|
109
|
-
/* @__PURE__ */ e("input", { type: "text", list:
|
|
110
|
-
/* @__PURE__ */ e("datalist", { id:
|
|
168
|
+
/* @__PURE__ */ e("input", { type: "text", list: t, autoComplete: "off", ...r }),
|
|
169
|
+
/* @__PURE__ */ e("datalist", { id: t, children: n.map((a) => /* @__PURE__ */ e("option", { value: a }, a)) })
|
|
111
170
|
] });
|
|
112
171
|
}
|
|
113
|
-
function
|
|
114
|
-
const [
|
|
115
|
-
return /* @__PURE__ */
|
|
172
|
+
function Y({ label: i = "Select items", options: n, value: t, onChange: r }) {
|
|
173
|
+
const [a, s] = C(!1), c = (l) => r(t.includes(l) ? t.filter((u) => u !== l) : [...t, l]);
|
|
174
|
+
return /* @__PURE__ */ d("div", { className: "ui-field ui-multi-select", children: [
|
|
116
175
|
/* @__PURE__ */ e("span", { className: "ui-field__label", children: i }),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */ e("span", { children:
|
|
176
|
+
/* @__PURE__ */ d("button", { type: "button", "aria-expanded": a, onClick: () => s((l) => !l), children: [
|
|
177
|
+
/* @__PURE__ */ e("span", { children: t.length ? t.join(", ") : "Choose team members" }),
|
|
119
178
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: "⌄" })
|
|
120
179
|
] }),
|
|
121
|
-
|
|
122
|
-
|
|
180
|
+
a && /* @__PURE__ */ e("div", { className: "ui-multi-select__menu", children: n.map((l) => /* @__PURE__ */ e(
|
|
181
|
+
R,
|
|
123
182
|
{
|
|
124
183
|
label: l,
|
|
125
|
-
checked:
|
|
126
|
-
onChange: () =>
|
|
184
|
+
checked: t.includes(l),
|
|
185
|
+
onChange: () => c(l)
|
|
127
186
|
},
|
|
128
187
|
l
|
|
129
188
|
)) })
|
|
130
189
|
] });
|
|
131
190
|
}
|
|
132
|
-
function
|
|
191
|
+
function J({ options: i, value: n, onChange: t, label: r, disabled: a = !1 }) {
|
|
133
192
|
return /* @__PURE__ */ e(
|
|
134
193
|
"div",
|
|
135
194
|
{
|
|
136
|
-
className:
|
|
195
|
+
className: p("ui-button-group", a && "is-disabled"),
|
|
137
196
|
role: "group",
|
|
138
197
|
"aria-label": r,
|
|
139
198
|
children: i.map((s) => /* @__PURE__ */ e(
|
|
140
199
|
"button",
|
|
141
200
|
{
|
|
142
|
-
className:
|
|
201
|
+
className: n === s.value ? "is-active" : "",
|
|
143
202
|
type: "button",
|
|
144
|
-
onClick: () =>
|
|
145
|
-
"aria-pressed":
|
|
146
|
-
disabled:
|
|
203
|
+
onClick: () => t(s.value),
|
|
204
|
+
"aria-pressed": n === s.value,
|
|
205
|
+
disabled: a,
|
|
147
206
|
children: s.label
|
|
148
207
|
},
|
|
149
208
|
s.value
|
|
@@ -151,89 +210,89 @@ function O({ options: i, value: a, onChange: n, label: r, disabled: t = !1 }) {
|
|
|
151
210
|
}
|
|
152
211
|
);
|
|
153
212
|
}
|
|
154
|
-
function
|
|
155
|
-
return /* @__PURE__ */ e("span", { className:
|
|
213
|
+
function Q({ children: i, tone: n = "neutral", className: t = "" }) {
|
|
214
|
+
return /* @__PURE__ */ e("span", { className: p("ui-badge", `ui-badge--${n}`, t), children: i });
|
|
156
215
|
}
|
|
157
|
-
function
|
|
158
|
-
const
|
|
159
|
-
return /* @__PURE__ */ e("span", { className:
|
|
216
|
+
function Z({ name: i, src: n, size: t = "md", className: r = "" }) {
|
|
217
|
+
const a = i.split(" ").map((s) => s[0]).slice(0, 2).join("").toUpperCase();
|
|
218
|
+
return /* @__PURE__ */ e("span", { className: p("ui-avatar", `ui-avatar--${t}`, r), "aria-label": i, children: n ? /* @__PURE__ */ e("img", { src: n, alt: "" }) : a });
|
|
160
219
|
}
|
|
161
|
-
function
|
|
162
|
-
return /* @__PURE__ */ e("button", { className: "ui-tooltip", type: "button", "data-tooltip": i, "aria-label": i, children:
|
|
220
|
+
function ee({ content: i, children: n = "?" }) {
|
|
221
|
+
return /* @__PURE__ */ e("button", { className: "ui-tooltip", type: "button", "data-tooltip": i, "aria-label": i, children: n });
|
|
163
222
|
}
|
|
164
|
-
function
|
|
165
|
-
const
|
|
166
|
-
return /* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
223
|
+
function ie({ label: i, value: n, tone: t = "primary", success: r = !1 }) {
|
|
224
|
+
const a = ["primary", "success", "warning", "error"].includes(t) ? t : "primary";
|
|
225
|
+
return /* @__PURE__ */ d("div", { className: "ui-progress", children: [
|
|
226
|
+
/* @__PURE__ */ d("div", { children: [
|
|
168
227
|
/* @__PURE__ */ e("span", { children: i }),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
|
|
228
|
+
/* @__PURE__ */ d("strong", { children: [
|
|
229
|
+
n,
|
|
171
230
|
"%"
|
|
172
231
|
] })
|
|
173
232
|
] }),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
|
|
233
|
+
/* @__PURE__ */ d("progress", { className: `is-${r ? "success" : a}`, value: n, max: "100", children: [
|
|
234
|
+
n,
|
|
176
235
|
"%"
|
|
177
236
|
] })
|
|
178
237
|
] });
|
|
179
238
|
}
|
|
180
|
-
function
|
|
181
|
-
const r =
|
|
182
|
-
return /* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
239
|
+
function ne({ label: i, value: n, ...t }) {
|
|
240
|
+
const r = x();
|
|
241
|
+
return /* @__PURE__ */ d("label", { className: "ui-field ui-slider", htmlFor: r, children: [
|
|
242
|
+
/* @__PURE__ */ d("span", { className: "ui-field__label", children: [
|
|
184
243
|
i,
|
|
185
|
-
/* @__PURE__ */ e("output", { children:
|
|
244
|
+
/* @__PURE__ */ e("output", { children: n })
|
|
186
245
|
] }),
|
|
187
|
-
/* @__PURE__ */ e("input", { id: r, type: "range", value:
|
|
246
|
+
/* @__PURE__ */ e("input", { id: r, type: "range", value: n, ...t })
|
|
188
247
|
] });
|
|
189
248
|
}
|
|
190
|
-
function
|
|
191
|
-
return /* @__PURE__ */ e("div", { className:
|
|
249
|
+
function te({ className: i = "", animate: n = !0 }) {
|
|
250
|
+
return /* @__PURE__ */ e("div", { className: p("ui-skeleton", !n && "is-static", i), "aria-hidden": "true" });
|
|
192
251
|
}
|
|
193
|
-
function
|
|
194
|
-
return /* @__PURE__ */ e("article", { className:
|
|
252
|
+
function ae({ children: i, className: n = "" }) {
|
|
253
|
+
return /* @__PURE__ */ e("article", { className: p("ui-card", n), children: i });
|
|
195
254
|
}
|
|
196
|
-
function
|
|
255
|
+
function re({ label: i }) {
|
|
197
256
|
return /* @__PURE__ */ e("div", { className: "ui-divider", role: "separator", children: i && /* @__PURE__ */ e("span", { children: i }) });
|
|
198
257
|
}
|
|
199
|
-
function
|
|
200
|
-
return /* @__PURE__ */
|
|
258
|
+
function le({ tone: i = "info", title: n, children: t, onClose: r }) {
|
|
259
|
+
return /* @__PURE__ */ d("div", { className: `ui-alert ui-alert--${i}`, role: i === "error" ? "alert" : "status", children: [
|
|
201
260
|
/* @__PURE__ */ e("span", { className: "ui-alert__icon", "aria-hidden": "true", children: i === "success" ? "✓" : i === "error" ? "!" : "i" }),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
|
|
204
|
-
/* @__PURE__ */ e("p", { children:
|
|
261
|
+
/* @__PURE__ */ d("div", { children: [
|
|
262
|
+
n && /* @__PURE__ */ e("strong", { children: n }),
|
|
263
|
+
/* @__PURE__ */ e("p", { children: t })
|
|
205
264
|
] }),
|
|
206
265
|
r && /* @__PURE__ */ e("button", { type: "button", "aria-label": "Dismiss alert", onClick: r, children: "×" })
|
|
207
266
|
] });
|
|
208
267
|
}
|
|
209
|
-
function
|
|
268
|
+
function se({
|
|
210
269
|
message: i,
|
|
211
|
-
tone:
|
|
212
|
-
position:
|
|
270
|
+
tone: n = "success",
|
|
271
|
+
position: t = "bottom-right",
|
|
213
272
|
inline: r = !1,
|
|
214
|
-
duration:
|
|
273
|
+
duration: a = 0,
|
|
215
274
|
onClose: s
|
|
216
275
|
}) {
|
|
217
|
-
const
|
|
218
|
-
return
|
|
219
|
-
if (!
|
|
220
|
-
const l = window.setTimeout(s,
|
|
276
|
+
const c = n === "error" || n === "warning" ? "!" : "✓";
|
|
277
|
+
return D(() => {
|
|
278
|
+
if (!a || !s) return;
|
|
279
|
+
const l = window.setTimeout(s, a);
|
|
221
280
|
return () => window.clearTimeout(l);
|
|
222
|
-
}, [
|
|
281
|
+
}, [a, s, i]), /* @__PURE__ */ d(
|
|
223
282
|
"div",
|
|
224
283
|
{
|
|
225
|
-
className:
|
|
284
|
+
className: p(
|
|
226
285
|
r ? "inline-toast" : "toast",
|
|
227
|
-
`toast--${
|
|
286
|
+
`toast--${n}`,
|
|
228
287
|
r || i ? "is-visible" : "",
|
|
229
|
-
!r && `toast--${
|
|
288
|
+
!r && `toast--${t}`
|
|
230
289
|
),
|
|
231
|
-
role:
|
|
290
|
+
role: n === "error" ? "alert" : "status",
|
|
232
291
|
"aria-live": "polite",
|
|
233
292
|
children: [
|
|
234
|
-
/* @__PURE__ */ e("span", { "aria-hidden": "true", children:
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */ e("strong", { children:
|
|
293
|
+
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: c }),
|
|
294
|
+
/* @__PURE__ */ d("div", { children: [
|
|
295
|
+
/* @__PURE__ */ e("strong", { children: n === "success" ? "Completed" : n === "error" ? "Needs attention" : "Notice" }),
|
|
237
296
|
/* @__PURE__ */ e("p", { children: i })
|
|
238
297
|
] }),
|
|
239
298
|
s && /* @__PURE__ */ e("button", { type: "button", "aria-label": "Dismiss notification", onClick: s, children: "×" })
|
|
@@ -241,94 +300,228 @@ function U({
|
|
|
241
300
|
}
|
|
242
301
|
);
|
|
243
302
|
}
|
|
244
|
-
function
|
|
245
|
-
|
|
303
|
+
function F(i, n, t) {
|
|
304
|
+
D(() => {
|
|
246
305
|
if (!i) return;
|
|
247
|
-
const r = document.activeElement,
|
|
248
|
-
if (
|
|
249
|
-
|
|
306
|
+
const r = document.activeElement, a = (c) => {
|
|
307
|
+
if (c.key === "Escape") {
|
|
308
|
+
n();
|
|
250
309
|
return;
|
|
251
310
|
}
|
|
252
|
-
if (
|
|
311
|
+
if (c.key !== "Tab") return;
|
|
253
312
|
const l = [
|
|
254
|
-
...
|
|
313
|
+
...t.current?.querySelectorAll(
|
|
255
314
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
256
315
|
) ?? []
|
|
257
|
-
].filter((
|
|
316
|
+
].filter((b) => !b.disabled);
|
|
258
317
|
if (!l.length) {
|
|
259
|
-
|
|
318
|
+
c.preventDefault();
|
|
260
319
|
return;
|
|
261
320
|
}
|
|
262
|
-
const
|
|
263
|
-
|
|
321
|
+
const u = l[0], h = l[l.length - 1];
|
|
322
|
+
t.current?.contains(document.activeElement) ? c.shiftKey && document.activeElement === u ? (c.preventDefault(), h.focus()) : !c.shiftKey && document.activeElement === h && (c.preventDefault(), u.focus()) : (c.preventDefault(), (c.shiftKey ? h : u).focus());
|
|
264
323
|
}, s = document.body.style.overflow;
|
|
265
|
-
return document.addEventListener("keydown",
|
|
266
|
-
document.removeEventListener("keydown",
|
|
324
|
+
return document.addEventListener("keydown", a), document.body.style.overflow = "hidden", window.setTimeout(() => t.current?.focus(), 0), () => {
|
|
325
|
+
document.removeEventListener("keydown", a), document.body.style.overflow = s, r?.focus?.();
|
|
267
326
|
};
|
|
268
|
-
}, [
|
|
327
|
+
}, [t, n, i]);
|
|
269
328
|
}
|
|
270
|
-
function
|
|
329
|
+
function oe({
|
|
271
330
|
trigger: i = "Open popover",
|
|
272
|
-
children:
|
|
273
|
-
position:
|
|
331
|
+
children: n,
|
|
332
|
+
position: t = "bottom-start",
|
|
274
333
|
tone: r = "neutral",
|
|
275
|
-
open:
|
|
334
|
+
open: a,
|
|
276
335
|
onOpenChange: s
|
|
277
336
|
}) {
|
|
278
|
-
const [
|
|
279
|
-
|
|
337
|
+
const [c, l] = C(!1), u = E(null), h = a ?? c, b = (w) => {
|
|
338
|
+
a === void 0 && l(w), s?.(w);
|
|
280
339
|
};
|
|
281
|
-
return
|
|
282
|
-
if (!
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
},
|
|
286
|
-
|
|
340
|
+
return D(() => {
|
|
341
|
+
if (!h) return;
|
|
342
|
+
const w = (N) => {
|
|
343
|
+
u.current?.contains(N.target) || b(!1);
|
|
344
|
+
}, g = (N) => {
|
|
345
|
+
N.key === "Escape" && b(!1);
|
|
287
346
|
};
|
|
288
|
-
return document.addEventListener("pointerdown",
|
|
289
|
-
document.removeEventListener("pointerdown",
|
|
347
|
+
return document.addEventListener("pointerdown", w), document.addEventListener("keydown", g), () => {
|
|
348
|
+
document.removeEventListener("pointerdown", w), document.removeEventListener("keydown", g);
|
|
290
349
|
};
|
|
291
|
-
}, [
|
|
350
|
+
}, [h]), /* @__PURE__ */ d("div", { className: "ui-popover", ref: u, children: [
|
|
292
351
|
/* @__PURE__ */ e(
|
|
293
|
-
|
|
352
|
+
A,
|
|
294
353
|
{
|
|
295
354
|
variant: "secondary",
|
|
296
355
|
size: "sm",
|
|
297
356
|
"aria-haspopup": "dialog",
|
|
298
|
-
"aria-expanded":
|
|
299
|
-
onClick: () =>
|
|
357
|
+
"aria-expanded": h,
|
|
358
|
+
onClick: () => b(!h),
|
|
300
359
|
children: i
|
|
301
360
|
}
|
|
302
361
|
),
|
|
303
|
-
|
|
362
|
+
h && /* @__PURE__ */ e(
|
|
304
363
|
"div",
|
|
305
364
|
{
|
|
306
|
-
className: `ui-popover__panel ui-popover--${
|
|
365
|
+
className: `ui-popover__panel ui-popover--${t} ui-popover--${r}`,
|
|
307
366
|
role: "dialog",
|
|
308
|
-
children:
|
|
367
|
+
children: n
|
|
309
368
|
}
|
|
310
369
|
)
|
|
311
370
|
] });
|
|
312
371
|
}
|
|
313
|
-
function
|
|
372
|
+
function ce({
|
|
373
|
+
children: i,
|
|
374
|
+
items: n,
|
|
375
|
+
trigger: t,
|
|
376
|
+
label: r = "Context menu target",
|
|
377
|
+
menuLabel: a = "Context menu",
|
|
378
|
+
className: s = ""
|
|
379
|
+
}) {
|
|
380
|
+
const c = x(), l = E(null), u = E(null), h = E(null), [b, w] = C({ x: 0, y: 0 }), [g, N] = C(!1), k = (o, m, f = l.current) => {
|
|
381
|
+
h.current = f, w({ x: o, y: m }), N(!0);
|
|
382
|
+
}, v = (o = !1) => {
|
|
383
|
+
N(!1), o && h.current?.focus();
|
|
384
|
+
};
|
|
385
|
+
O(() => {
|
|
386
|
+
if (!g || !u.current) return;
|
|
387
|
+
const o = u.current, m = o.getBoundingClientRect(), f = Math.max(8, Math.min(b.x, window.innerWidth - m.width - 8)), y = Math.max(8, Math.min(b.y, window.innerHeight - m.height - 8));
|
|
388
|
+
(f !== b.x || y !== b.y) && w({ x: f, y }), o.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
389
|
+
}, [g, b.x, b.y]), D(() => {
|
|
390
|
+
if (!g) return;
|
|
391
|
+
const o = (f) => {
|
|
392
|
+
u.current?.contains(f.target) || N(!1);
|
|
393
|
+
}, m = () => N(!1);
|
|
394
|
+
return document.addEventListener("pointerdown", o), document.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
395
|
+
document.removeEventListener("pointerdown", o), document.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
396
|
+
};
|
|
397
|
+
}, [g]);
|
|
398
|
+
const _ = (o) => {
|
|
399
|
+
if (!g && (o.key === "ContextMenu" || o.shiftKey && o.key === "F10")) {
|
|
400
|
+
o.preventDefault();
|
|
401
|
+
const $ = l.current.getBoundingClientRect(), I = typeof o.target?.focus == "function" ? o.target : l.current;
|
|
402
|
+
k($.left, $.bottom, I);
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
if (!g) return;
|
|
406
|
+
if (o.key === "Escape") {
|
|
407
|
+
o.preventDefault(), v(!0);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
if (o.key === "Tab") {
|
|
411
|
+
v(!0);
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
const m = [
|
|
415
|
+
...u.current?.querySelectorAll('[role="menuitem"]:not(:disabled)') ?? []
|
|
416
|
+
];
|
|
417
|
+
if (!m.length) return;
|
|
418
|
+
const f = m.indexOf(document.activeElement);
|
|
419
|
+
let y;
|
|
420
|
+
if (o.key === "ArrowDown")
|
|
421
|
+
y = f < 0 ? 0 : (f + 1) % m.length;
|
|
422
|
+
else if (o.key === "ArrowUp")
|
|
423
|
+
y = f < 0 ? m.length - 1 : (f - 1 + m.length) % m.length;
|
|
424
|
+
else if (o.key === "Home")
|
|
425
|
+
y = 0;
|
|
426
|
+
else if (o.key === "End")
|
|
427
|
+
y = m.length - 1;
|
|
428
|
+
else
|
|
429
|
+
return;
|
|
430
|
+
o.preventDefault(), m[y].focus();
|
|
431
|
+
};
|
|
432
|
+
return /* @__PURE__ */ d(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
className: p("ui-context-menu", s),
|
|
436
|
+
ref: l,
|
|
437
|
+
role: "group",
|
|
438
|
+
"aria-label": r,
|
|
439
|
+
"aria-haspopup": "menu",
|
|
440
|
+
"aria-expanded": g,
|
|
441
|
+
"aria-controls": g ? c : void 0,
|
|
442
|
+
tabIndex: 0,
|
|
443
|
+
onContextMenu: (o) => {
|
|
444
|
+
o.preventDefault(), k(o.clientX, o.clientY, l.current);
|
|
445
|
+
},
|
|
446
|
+
onKeyDown: _,
|
|
447
|
+
children: [
|
|
448
|
+
i,
|
|
449
|
+
t && /* @__PURE__ */ e(
|
|
450
|
+
"button",
|
|
451
|
+
{
|
|
452
|
+
className: "ui-context-menu__trigger",
|
|
453
|
+
type: "button",
|
|
454
|
+
"aria-haspopup": "menu",
|
|
455
|
+
"aria-expanded": g,
|
|
456
|
+
"aria-controls": g ? c : void 0,
|
|
457
|
+
onClick: (o) => {
|
|
458
|
+
const m = o.currentTarget.getBoundingClientRect();
|
|
459
|
+
k(m.left, m.bottom, o.currentTarget);
|
|
460
|
+
},
|
|
461
|
+
children: t
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
g && /* @__PURE__ */ e(
|
|
465
|
+
"div",
|
|
466
|
+
{
|
|
467
|
+
className: "ui-context-menu__panel",
|
|
468
|
+
id: c,
|
|
469
|
+
role: "menu",
|
|
470
|
+
"aria-label": a,
|
|
471
|
+
ref: u,
|
|
472
|
+
style: { left: b.x, top: b.y },
|
|
473
|
+
children: n.map(
|
|
474
|
+
(o, m) => o.type === "separator" ? /* @__PURE__ */ e(
|
|
475
|
+
"div",
|
|
476
|
+
{
|
|
477
|
+
className: "ui-context-menu__separator",
|
|
478
|
+
role: "separator"
|
|
479
|
+
},
|
|
480
|
+
`separator-${m}`
|
|
481
|
+
) : /* @__PURE__ */ d(
|
|
482
|
+
"button",
|
|
483
|
+
{
|
|
484
|
+
className: p("ui-context-menu__item", o.destructive && "is-destructive"),
|
|
485
|
+
type: "button",
|
|
486
|
+
role: "menuitem",
|
|
487
|
+
tabIndex: -1,
|
|
488
|
+
disabled: o.disabled,
|
|
489
|
+
onClick: (f) => {
|
|
490
|
+
v(!0), o.onSelect?.(f);
|
|
491
|
+
},
|
|
492
|
+
children: [
|
|
493
|
+
/* @__PURE__ */ e("span", { children: o.label }),
|
|
494
|
+
o.shortcut && /* @__PURE__ */ e("kbd", { children: o.shortcut })
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
`${o.label}-${m}`
|
|
498
|
+
)
|
|
499
|
+
)
|
|
500
|
+
}
|
|
501
|
+
)
|
|
502
|
+
]
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
function de({
|
|
314
507
|
open: i,
|
|
315
|
-
title:
|
|
316
|
-
children:
|
|
508
|
+
title: n,
|
|
509
|
+
children: t,
|
|
317
510
|
onClose: r,
|
|
318
|
-
position:
|
|
511
|
+
position: a = "center",
|
|
319
512
|
size: s = "md",
|
|
320
|
-
footer:
|
|
513
|
+
footer: c
|
|
321
514
|
}) {
|
|
322
|
-
const l =
|
|
323
|
-
return
|
|
515
|
+
const l = x(), u = E(null);
|
|
516
|
+
return F(i, r, u), i ? /* @__PURE__ */ e(
|
|
324
517
|
"div",
|
|
325
518
|
{
|
|
326
|
-
className: `ui-modal-backdrop ui-modal-backdrop--${
|
|
519
|
+
className: `ui-modal-backdrop ui-modal-backdrop--${a}`,
|
|
327
520
|
role: "presentation",
|
|
328
|
-
onMouseDown: (
|
|
329
|
-
|
|
521
|
+
onMouseDown: (h) => {
|
|
522
|
+
h.target === h.currentTarget && r();
|
|
330
523
|
},
|
|
331
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ d(
|
|
332
525
|
"section",
|
|
333
526
|
{
|
|
334
527
|
className: `ui-modal ui-modal--${s}`,
|
|
@@ -336,105 +529,105 @@ function H({
|
|
|
336
529
|
"aria-modal": "true",
|
|
337
530
|
"aria-labelledby": l,
|
|
338
531
|
tabIndex: -1,
|
|
339
|
-
ref:
|
|
532
|
+
ref: u,
|
|
340
533
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ d("div", { className: "ui-modal__header", children: [
|
|
535
|
+
/* @__PURE__ */ d("div", { children: [
|
|
343
536
|
/* @__PURE__ */ e("span", { className: "ui-modal__eyebrow", children: "Modal" }),
|
|
344
|
-
/* @__PURE__ */ e("h2", { id: l, children:
|
|
537
|
+
/* @__PURE__ */ e("h2", { id: l, children: n })
|
|
345
538
|
] }),
|
|
346
|
-
/* @__PURE__ */ e(
|
|
539
|
+
/* @__PURE__ */ e(S, { label: "Close modal", onClick: r, children: "×" })
|
|
347
540
|
] }),
|
|
348
|
-
/* @__PURE__ */ e("div", { className: "ui-modal__body", children:
|
|
349
|
-
|
|
541
|
+
/* @__PURE__ */ e("div", { className: "ui-modal__body", children: t }),
|
|
542
|
+
c && /* @__PURE__ */ e("div", { className: "ui-modal__footer", children: c })
|
|
350
543
|
]
|
|
351
544
|
}
|
|
352
545
|
)
|
|
353
546
|
}
|
|
354
547
|
) : null;
|
|
355
548
|
}
|
|
356
|
-
function
|
|
549
|
+
function ue({
|
|
357
550
|
open: i,
|
|
358
|
-
title:
|
|
359
|
-
children:
|
|
551
|
+
title: n,
|
|
552
|
+
children: t,
|
|
360
553
|
onClose: r,
|
|
361
|
-
position:
|
|
554
|
+
position: a = "right",
|
|
362
555
|
size: s = "md",
|
|
363
|
-
footer:
|
|
556
|
+
footer: c
|
|
364
557
|
}) {
|
|
365
|
-
const l =
|
|
366
|
-
return
|
|
558
|
+
const l = x(), u = E(null);
|
|
559
|
+
return F(i, r, u), i ? /* @__PURE__ */ e(
|
|
367
560
|
"div",
|
|
368
561
|
{
|
|
369
562
|
className: "ui-drawer-backdrop",
|
|
370
563
|
role: "presentation",
|
|
371
|
-
onMouseDown: (
|
|
372
|
-
|
|
564
|
+
onMouseDown: (h) => {
|
|
565
|
+
h.target === h.currentTarget && r();
|
|
373
566
|
},
|
|
374
|
-
children: /* @__PURE__ */
|
|
567
|
+
children: /* @__PURE__ */ d(
|
|
375
568
|
"aside",
|
|
376
569
|
{
|
|
377
|
-
className: `ui-drawer ui-drawer--${
|
|
570
|
+
className: `ui-drawer ui-drawer--${a} ui-drawer--${s}`,
|
|
378
571
|
role: "dialog",
|
|
379
572
|
"aria-modal": "true",
|
|
380
573
|
"aria-labelledby": l,
|
|
381
574
|
tabIndex: -1,
|
|
382
|
-
ref:
|
|
575
|
+
ref: u,
|
|
383
576
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ d("div", { className: "ui-drawer__header", children: [
|
|
578
|
+
/* @__PURE__ */ d("div", { children: [
|
|
386
579
|
/* @__PURE__ */ e("span", { children: "Drawer" }),
|
|
387
|
-
/* @__PURE__ */ e("h2", { id: l, children:
|
|
580
|
+
/* @__PURE__ */ e("h2", { id: l, children: n })
|
|
388
581
|
] }),
|
|
389
|
-
/* @__PURE__ */ e(
|
|
582
|
+
/* @__PURE__ */ e(S, { label: "Close drawer", onClick: r, children: "×" })
|
|
390
583
|
] }),
|
|
391
|
-
/* @__PURE__ */ e("div", { className: "ui-drawer__body", children:
|
|
392
|
-
|
|
584
|
+
/* @__PURE__ */ e("div", { className: "ui-drawer__body", children: t }),
|
|
585
|
+
c && /* @__PURE__ */ e("div", { className: "ui-drawer__footer", children: c })
|
|
393
586
|
]
|
|
394
587
|
}
|
|
395
588
|
)
|
|
396
589
|
}
|
|
397
590
|
) : null;
|
|
398
591
|
}
|
|
399
|
-
function
|
|
400
|
-
return /* @__PURE__ */ e("div", { className:
|
|
592
|
+
function me({ items: i, renderItem: n, className: t = "" }) {
|
|
593
|
+
return /* @__PURE__ */ e("div", { className: p("ui-grid", t), children: i.map(n) });
|
|
401
594
|
}
|
|
402
|
-
function
|
|
403
|
-
return /* @__PURE__ */ e("div", { className: "ui-accordion", children: i.map((
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
|
|
595
|
+
function he({ items: i }) {
|
|
596
|
+
return /* @__PURE__ */ e("div", { className: "ui-accordion", children: i.map((n, t) => /* @__PURE__ */ d("details", { open: t === 0, children: [
|
|
597
|
+
/* @__PURE__ */ d("summary", { children: [
|
|
598
|
+
n.title,
|
|
406
599
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: "+" })
|
|
407
600
|
] }),
|
|
408
|
-
/* @__PURE__ */ e("p", { children:
|
|
409
|
-
] },
|
|
601
|
+
/* @__PURE__ */ e("p", { children: n.body })
|
|
602
|
+
] }, n.title)) });
|
|
410
603
|
}
|
|
411
|
-
function
|
|
412
|
-
return /* @__PURE__ */ e("div", { className: "ui-tabs", role: "tablist", "aria-label": r, children: i.map((
|
|
604
|
+
function pe({ items: i, value: n, onChange: t, label: r = "Tabs" }) {
|
|
605
|
+
return /* @__PURE__ */ e("div", { className: "ui-tabs", role: "tablist", "aria-label": r, children: i.map((a) => /* @__PURE__ */ e(
|
|
413
606
|
"button",
|
|
414
607
|
{
|
|
415
608
|
type: "button",
|
|
416
609
|
role: "tab",
|
|
417
|
-
"aria-selected":
|
|
418
|
-
className:
|
|
419
|
-
onClick: () =>
|
|
420
|
-
children:
|
|
610
|
+
"aria-selected": n === a.value,
|
|
611
|
+
className: n === a.value ? "is-active" : "",
|
|
612
|
+
onClick: () => t(a.value),
|
|
613
|
+
children: a.label
|
|
421
614
|
},
|
|
422
|
-
|
|
615
|
+
a.value
|
|
423
616
|
)) });
|
|
424
617
|
}
|
|
425
|
-
function
|
|
426
|
-
const
|
|
427
|
-
const
|
|
428
|
-
|
|
618
|
+
function fe({ count: i, page: n, onPageChange: t, className: r = "" }) {
|
|
619
|
+
const a = Math.max(1, Number(i) || 1), s = Math.min(a, Math.max(1, Number(n) || 1)), c = (l) => {
|
|
620
|
+
const u = Math.min(a, Math.max(1, l));
|
|
621
|
+
u !== s && t(u);
|
|
429
622
|
};
|
|
430
|
-
return /* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
623
|
+
return /* @__PURE__ */ d("nav", { className: p("ui-pagination", r), "aria-label": "Pagination", children: [
|
|
624
|
+
/* @__PURE__ */ d(
|
|
432
625
|
"button",
|
|
433
626
|
{
|
|
434
627
|
type: "button",
|
|
435
628
|
className: "ui-pagination__previous",
|
|
436
629
|
disabled: s === 1,
|
|
437
|
-
onClick: () =>
|
|
630
|
+
onClick: () => c(s - 1),
|
|
438
631
|
"aria-label": "Go to previous page",
|
|
439
632
|
children: [
|
|
440
633
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: "←" }),
|
|
@@ -442,25 +635,25 @@ function Y({ count: i, page: a, onPageChange: n, className: r = "" }) {
|
|
|
442
635
|
]
|
|
443
636
|
}
|
|
444
637
|
),
|
|
445
|
-
/* @__PURE__ */ e("div", { className: "ui-pagination__pages", children: Array.from({ length:
|
|
638
|
+
/* @__PURE__ */ e("div", { className: "ui-pagination__pages", children: Array.from({ length: a }, (l, u) => u + 1).map((l) => /* @__PURE__ */ e(
|
|
446
639
|
"button",
|
|
447
640
|
{
|
|
448
641
|
type: "button",
|
|
449
642
|
className: l === s ? "is-active" : "",
|
|
450
643
|
"aria-current": l === s ? "page" : void 0,
|
|
451
644
|
"aria-label": `Go to page ${l}`,
|
|
452
|
-
onClick: () =>
|
|
645
|
+
onClick: () => c(l),
|
|
453
646
|
children: l
|
|
454
647
|
},
|
|
455
648
|
l
|
|
456
649
|
)) }),
|
|
457
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ d(
|
|
458
651
|
"button",
|
|
459
652
|
{
|
|
460
653
|
type: "button",
|
|
461
654
|
className: "ui-pagination__next",
|
|
462
|
-
disabled: s ===
|
|
463
|
-
onClick: () =>
|
|
655
|
+
disabled: s === a,
|
|
656
|
+
onClick: () => c(s + 1),
|
|
464
657
|
"aria-label": "Go to next page",
|
|
465
658
|
children: [
|
|
466
659
|
"Next",
|
|
@@ -470,31 +663,31 @@ function Y({ count: i, page: a, onPageChange: n, className: r = "" }) {
|
|
|
470
663
|
)
|
|
471
664
|
] });
|
|
472
665
|
}
|
|
473
|
-
function
|
|
474
|
-
return /* @__PURE__ */ e("nav", { className: "ui-breadcrumbs", "aria-label": "Breadcrumb", children: /* @__PURE__ */ e("ol", { children: i.map((
|
|
475
|
-
|
|
476
|
-
/* @__PURE__ */ e("span", { "aria-current":
|
|
477
|
-
] },
|
|
666
|
+
function be({ items: i }) {
|
|
667
|
+
return /* @__PURE__ */ e("nav", { className: "ui-breadcrumbs", "aria-label": "Breadcrumb", children: /* @__PURE__ */ e("ol", { children: i.map((n, t) => /* @__PURE__ */ d("li", { children: [
|
|
668
|
+
t > 0 && /* @__PURE__ */ e("span", { "aria-hidden": "true", children: "/" }),
|
|
669
|
+
/* @__PURE__ */ e("span", { "aria-current": t === i.length - 1 ? "page" : void 0, children: n })
|
|
670
|
+
] }, n)) }) });
|
|
478
671
|
}
|
|
479
|
-
function
|
|
480
|
-
return /* @__PURE__ */ e("div", { className: "ui-table-wrap", children: /* @__PURE__ */
|
|
481
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: i.map((
|
|
482
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
672
|
+
function ge({ columns: i, rows: n, rowKey: t = "id", emptyMessage: r = "No matching records." }) {
|
|
673
|
+
return /* @__PURE__ */ e("div", { className: "ui-table-wrap", children: /* @__PURE__ */ d("table", { className: "ui-table", children: [
|
|
674
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: i.map((a) => /* @__PURE__ */ e("th", { scope: "col", children: a.label }, a.key)) }) }),
|
|
675
|
+
/* @__PURE__ */ e("tbody", { children: n.length ? n.map((a) => /* @__PURE__ */ e("tr", { children: i.map((s) => /* @__PURE__ */ e("td", { children: s.render ? s.render(a) : a[s.key] }, s.key)) }, a[t])) : /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: i.length, className: "ui-table__empty", children: r }) }) })
|
|
483
676
|
] }) });
|
|
484
677
|
}
|
|
485
|
-
function
|
|
678
|
+
function ve({ open: i, title: n, onClose: t, children: r }) {
|
|
486
679
|
return i ? /* @__PURE__ */ e(
|
|
487
680
|
"div",
|
|
488
681
|
{
|
|
489
682
|
className: "ui-dialog-backdrop",
|
|
490
683
|
role: "presentation",
|
|
491
|
-
onMouseDown: (
|
|
492
|
-
|
|
684
|
+
onMouseDown: (a) => {
|
|
685
|
+
a.target === a.currentTarget && t();
|
|
493
686
|
},
|
|
494
|
-
children: /* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */ e("h2", { id: "dialog-title", children:
|
|
497
|
-
/* @__PURE__ */ e(
|
|
687
|
+
children: /* @__PURE__ */ d("section", { className: "ui-dialog", role: "dialog", "aria-modal": "true", "aria-labelledby": "dialog-title", children: [
|
|
688
|
+
/* @__PURE__ */ d("div", { className: "ui-dialog__heading", children: [
|
|
689
|
+
/* @__PURE__ */ e("h2", { id: "dialog-title", children: n }),
|
|
690
|
+
/* @__PURE__ */ e(S, { label: "Close dialog", onClick: t, children: "×" })
|
|
498
691
|
] }),
|
|
499
692
|
r
|
|
500
693
|
] })
|
|
@@ -502,37 +695,39 @@ function ie({ open: i, title: a, onClose: n, children: r }) {
|
|
|
502
695
|
) : null;
|
|
503
696
|
}
|
|
504
697
|
export {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
P as
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
698
|
+
he as Accordion,
|
|
699
|
+
le as Alert,
|
|
700
|
+
X as AutoSelect,
|
|
701
|
+
Z as Avatar,
|
|
702
|
+
Q as Badge,
|
|
703
|
+
be as Breadcrumbs,
|
|
704
|
+
A as Button,
|
|
705
|
+
J as ButtonGroup,
|
|
706
|
+
ae as Card,
|
|
707
|
+
R as Checkbox,
|
|
708
|
+
ce as ContextMenu,
|
|
709
|
+
ge as DataTable,
|
|
710
|
+
q as DatePicker,
|
|
711
|
+
ve as Dialog,
|
|
712
|
+
re as Divider,
|
|
713
|
+
ue as Drawer,
|
|
714
|
+
H as FileUpload,
|
|
715
|
+
me as Grid,
|
|
716
|
+
S as IconButton,
|
|
717
|
+
P as Input,
|
|
718
|
+
de as Modal,
|
|
719
|
+
Y as MultiSelect,
|
|
720
|
+
fe as Pagination,
|
|
721
|
+
oe as Popover,
|
|
722
|
+
ie as Progress,
|
|
723
|
+
V as Radio,
|
|
724
|
+
U as Select,
|
|
725
|
+
te as Skeleton,
|
|
726
|
+
ne as Slider,
|
|
727
|
+
W as Switch,
|
|
728
|
+
pe as Tabs,
|
|
729
|
+
G as Textarea,
|
|
730
|
+
se as Toast,
|
|
731
|
+
ee as Tooltip
|
|
537
732
|
};
|
|
538
733
|
//# sourceMappingURL=index.js.map
|