cattle-care-ui 0.1.2 → 0.1.4
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/components/Dropdown.d.ts +21 -0
- package/dist/components/Tabs.d.ts +3 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +327 -136
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment as r, createContext as i, createElement as a, forwardRef as o, useContext as s, useEffect as c, useId as l,
|
|
3
|
-
var
|
|
2
|
+
import { Fragment as r, createContext as i, createElement as a, forwardRef as o, useContext as s, useEffect as c, useId as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
3
|
+
var p = {
|
|
4
4
|
primary: "_primary_1fqpm_1",
|
|
5
5
|
secondary: "_secondary_1fqpm_2",
|
|
6
6
|
tertiary: "_tertiary_1fqpm_3",
|
|
@@ -13,26 +13,26 @@ var f = {
|
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/components/Button.tsx
|
|
16
|
-
function
|
|
16
|
+
function m({ variant: e = "primary", size: r = "base", leadingIcon: i, trailingIcon: a, children: o, ...s }) {
|
|
17
17
|
let c = !o && !!i;
|
|
18
18
|
return /* @__PURE__ */ n("button", {
|
|
19
19
|
type: "button",
|
|
20
|
-
className: `${
|
|
20
|
+
className: `${p[e]} ${p[r]}${c ? ` ${p.iconOnly}` : ""}`,
|
|
21
21
|
...s,
|
|
22
22
|
children: [
|
|
23
23
|
i && /* @__PURE__ */ t("span", {
|
|
24
|
-
className:
|
|
24
|
+
className: p.icon,
|
|
25
25
|
children: i
|
|
26
26
|
}),
|
|
27
27
|
o,
|
|
28
28
|
a && /* @__PURE__ */ t("span", {
|
|
29
|
-
className:
|
|
29
|
+
className: p.icon,
|
|
30
30
|
children: a
|
|
31
31
|
})
|
|
32
32
|
]
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var h = {
|
|
36
36
|
wrap: "_wrap_ewoh2_1",
|
|
37
37
|
fluid: "_fluid_ewoh2_9",
|
|
38
38
|
backing: "_backing_ewoh2_14",
|
|
@@ -44,23 +44,23 @@ var m = {
|
|
|
44
44
|
};
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/components/Card.tsx
|
|
47
|
-
function
|
|
47
|
+
function g({ stacked: e, completed: r, interactive: i, draggable: a, dragging: o, fluid: s, children: c, ...l }) {
|
|
48
48
|
return /* @__PURE__ */ n("div", {
|
|
49
|
-
className: `${
|
|
50
|
-
children: [e && /* @__PURE__ */ t("div", { className: `${
|
|
49
|
+
className: `${h.wrap} ${s ? h.fluid : ""}`,
|
|
50
|
+
children: [e && /* @__PURE__ */ t("div", { className: `${h.backing} ${r ? h.completed : ""}` }), /* @__PURE__ */ t("div", {
|
|
51
51
|
className: [
|
|
52
|
-
|
|
53
|
-
r ?
|
|
54
|
-
i ?
|
|
55
|
-
a ?
|
|
56
|
-
o ?
|
|
52
|
+
h.card,
|
|
53
|
+
r ? h.completed : "",
|
|
54
|
+
i ? h.interactive : "",
|
|
55
|
+
a ? h.grabbable : "",
|
|
56
|
+
o ? h.dragging : ""
|
|
57
57
|
].filter(Boolean).join(" "),
|
|
58
58
|
...l,
|
|
59
59
|
children: c
|
|
60
60
|
})]
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
var
|
|
63
|
+
var _ = {
|
|
64
64
|
neutral: "_neutral_c7c7e_1",
|
|
65
65
|
pill: "_pill_c7c7e_2",
|
|
66
66
|
accent: "_accent_c7c7e_3",
|
|
@@ -70,22 +70,22 @@ var g = {
|
|
|
70
70
|
};
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/components/Tag.tsx
|
|
73
|
-
function
|
|
73
|
+
function v({ variant: e = "neutral", children: n, ...r }) {
|
|
74
74
|
return /* @__PURE__ */ t("span", {
|
|
75
|
-
className:
|
|
75
|
+
className: _[e],
|
|
76
76
|
...r,
|
|
77
77
|
children: n
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs
|
|
82
|
-
var
|
|
82
|
+
var y = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.mjs
|
|
85
|
-
function
|
|
85
|
+
function b(e, t, n = []) {
|
|
86
86
|
if (t == null) throw Error("[lucide]: iconNode is required when icon name is used");
|
|
87
87
|
return {
|
|
88
|
-
name:
|
|
88
|
+
name: y(e),
|
|
89
89
|
size: 24,
|
|
90
90
|
node: t,
|
|
91
91
|
...n.length > 0 ? { aliases: n } : {}
|
|
@@ -93,7 +93,7 @@ function y(e, t, n = []) {
|
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs
|
|
96
|
-
var
|
|
96
|
+
var x = (e) => {
|
|
97
97
|
let t = "", n = !1;
|
|
98
98
|
for (let r of e) {
|
|
99
99
|
if (r === "-" || r === "_" || r <= " ") {
|
|
@@ -103,10 +103,10 @@ var b = (e) => {
|
|
|
103
103
|
t.length === 0 ? t += r.toLowerCase() : t += n ? r.toUpperCase() : r, n = !1;
|
|
104
104
|
}
|
|
105
105
|
return t;
|
|
106
|
-
},
|
|
107
|
-
let t =
|
|
106
|
+
}, S = (e) => {
|
|
107
|
+
let t = x(e);
|
|
108
108
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
109
|
-
},
|
|
109
|
+
}, C = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), w = {
|
|
110
110
|
xmlns: "http://www.w3.org/2000/svg",
|
|
111
111
|
width: 24,
|
|
112
112
|
height: 24,
|
|
@@ -119,22 +119,22 @@ var b = (e) => {
|
|
|
119
119
|
};
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.mjs
|
|
122
|
-
function
|
|
122
|
+
function T(e) {
|
|
123
123
|
return e != null;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ??
|
|
125
|
+
function E(e, t = {}) {
|
|
126
|
+
let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ?? w.width, a = e.size ?? e.height ?? w.height, o = e.aliases?.filter((e) => typeof e == "string" && e.trim() !== "").map((e) => `lucide-${e}`) ?? [], s = [...e.name ? [`lucide-${e.name}`] : [], ...o], c = t.className?.split(" ").filter(Boolean) ?? [], l = t.includeDefaultClasses === !1 ? C(...c) : C("lucide", ...s, ...c), u = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? w["stroke-width"]) * Number(e.size ?? e.width ?? w.width) / Number(t.size ?? t.width ?? w.width) : t.strokeWidth ?? w["stroke-width"];
|
|
127
127
|
return [
|
|
128
128
|
"svg",
|
|
129
129
|
{
|
|
130
|
-
...Object.entries(
|
|
130
|
+
...Object.entries(w).reduce((e, [t, n]) => (e[r(t)] = n, e), {}),
|
|
131
131
|
..."color" in t && t.color && { [r("stroke")]: t.color },
|
|
132
|
-
..."size" in t &&
|
|
132
|
+
..."size" in t && T(t.size) && {
|
|
133
133
|
[r("width")]: t.size,
|
|
134
134
|
[r("height")]: t.size
|
|
135
135
|
},
|
|
136
|
-
..."width" in t &&
|
|
137
|
-
..."height" in t &&
|
|
136
|
+
..."width" in t && T(t.width) && { [r("width")]: t.width },
|
|
137
|
+
..."height" in t && T(t.height) && { [r("height")]: t.height },
|
|
138
138
|
[r("stroke-width")]: u,
|
|
139
139
|
...l && { [r("class")]: l },
|
|
140
140
|
[r("viewBox")]: `0 0 ${i} ${a}`,
|
|
@@ -156,8 +156,8 @@ function T(e, t = {}) {
|
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.mjs
|
|
159
|
-
function
|
|
160
|
-
return
|
|
159
|
+
function D(e, t = {}) {
|
|
160
|
+
return E(e, {
|
|
161
161
|
...t,
|
|
162
162
|
attributeNames: {
|
|
163
163
|
...t.attributeNames,
|
|
@@ -171,44 +171,62 @@ function E(e, t = {}) {
|
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs
|
|
174
|
-
var
|
|
174
|
+
var O = (e) => {
|
|
175
175
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
176
176
|
return !1;
|
|
177
|
-
},
|
|
177
|
+
}, ee = i({}), te = () => s(ee), ne = o(({ color: e, size: t, width: n, height: r, strokeWidth: i, absoluteStrokeWidth: o, nonScalingStroke: s, className: c = "", children: l, iconNode: u = [], icon: d = {
|
|
178
178
|
node: u,
|
|
179
179
|
aliases: [],
|
|
180
180
|
size: 24
|
|
181
181
|
}, ...f }, p) => {
|
|
182
|
-
let { size: m = 24, strokeWidth: h = 2, absoluteStrokeWidth: g = !1, nonScalingStroke: _ = !1, color: v = "currentColor", className: y = "" } =
|
|
182
|
+
let { size: m = 24, strokeWidth: h = 2, absoluteStrokeWidth: g = !1, nonScalingStroke: _ = !1, color: v = "currentColor", className: y = "" } = te() ?? {}, b = !!l || O(f), [x, S, w = []] = D(d, {
|
|
183
183
|
color: e ?? v,
|
|
184
184
|
width: n ?? t ?? m,
|
|
185
185
|
height: r ?? t ?? m,
|
|
186
186
|
strokeWidth: i ?? h,
|
|
187
187
|
absoluteStrokeWidth: o ?? g,
|
|
188
188
|
nonScalingStroke: s ?? _,
|
|
189
|
-
className:
|
|
189
|
+
className: C(y, c),
|
|
190
190
|
hasA11yProp: b,
|
|
191
191
|
attributes: f
|
|
192
192
|
});
|
|
193
193
|
return a(x, {
|
|
194
194
|
ref: p,
|
|
195
|
-
...
|
|
195
|
+
...S
|
|
196
196
|
}, [...w.map(([e, t]) => a(e, t)), ...Array.isArray(l) ? l : [l]]);
|
|
197
197
|
});
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region node_modules/lucide-react/dist/esm/createLucideIcon.mjs
|
|
200
|
-
function
|
|
201
|
-
let r = typeof e == "string" ?
|
|
200
|
+
function k(e, t = [], n = []) {
|
|
201
|
+
let r = typeof e == "string" ? b(e, t, n) : e, i = o(({ className: e, ...t }, n) => a(ne, {
|
|
202
202
|
ref: n,
|
|
203
203
|
icon: r,
|
|
204
204
|
className: e,
|
|
205
205
|
...t
|
|
206
206
|
}));
|
|
207
|
-
return r.name && (i.displayName =
|
|
207
|
+
return r.name && (i.displayName = S(r.name)), i;
|
|
208
208
|
}
|
|
209
209
|
//#endregion
|
|
210
|
-
//#region node_modules/lucide-react/dist/esm/icons/
|
|
211
|
-
var
|
|
210
|
+
//#region node_modules/lucide-react/dist/esm/icons/check.mjs
|
|
211
|
+
var A = {
|
|
212
|
+
name: "check",
|
|
213
|
+
size: 24,
|
|
214
|
+
node: [["path", {
|
|
215
|
+
d: "M20 6 9 17l-5-5",
|
|
216
|
+
key: "1gmf2c"
|
|
217
|
+
}]]
|
|
218
|
+
};
|
|
219
|
+
A.node;
|
|
220
|
+
var j = k(A), M = {
|
|
221
|
+
name: "chevron-down",
|
|
222
|
+
size: 24,
|
|
223
|
+
node: [["path", {
|
|
224
|
+
d: "m6 9 6 6 6-6",
|
|
225
|
+
key: "qrunsl"
|
|
226
|
+
}]]
|
|
227
|
+
};
|
|
228
|
+
M.node;
|
|
229
|
+
var N = k(M), P = {
|
|
212
230
|
name: "search",
|
|
213
231
|
size: 24,
|
|
214
232
|
node: [["path", {
|
|
@@ -221,8 +239,8 @@ var j = {
|
|
|
221
239
|
key: "4ej97u"
|
|
222
240
|
}]]
|
|
223
241
|
};
|
|
224
|
-
|
|
225
|
-
var
|
|
242
|
+
P.node;
|
|
243
|
+
var F = k(P), I = {
|
|
226
244
|
toolbar: "_toolbar_1rsvo_1",
|
|
227
245
|
searchWrap: "_searchWrap_1rsvo_14",
|
|
228
246
|
searchIcon: "_searchIcon_1rsvo_33",
|
|
@@ -232,44 +250,44 @@ var M = A(j), N = {
|
|
|
232
250
|
};
|
|
233
251
|
//#endregion
|
|
234
252
|
//#region src/components/Toolbar.tsx
|
|
235
|
-
function
|
|
236
|
-
let l =
|
|
253
|
+
function L({ searchValue: e, onSearchChange: r, placeholder: i = "Search…", shortcutLabel: a = "⌘K", shortcutKey: o = "k", children: s }) {
|
|
254
|
+
let l = d(null);
|
|
237
255
|
return c(() => {
|
|
238
256
|
function e(e) {
|
|
239
257
|
(e.metaKey || e.ctrlKey) && e.key.toLowerCase() === o.toLowerCase() && (e.preventDefault(), l.current?.focus());
|
|
240
258
|
}
|
|
241
259
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
242
260
|
}, [o]), /* @__PURE__ */ n("div", {
|
|
243
|
-
className:
|
|
261
|
+
className: I.toolbar,
|
|
244
262
|
children: [/* @__PURE__ */ n("div", {
|
|
245
|
-
className:
|
|
263
|
+
className: I.searchWrap,
|
|
246
264
|
children: [
|
|
247
265
|
/* @__PURE__ */ t("span", {
|
|
248
|
-
className:
|
|
249
|
-
children: /* @__PURE__ */ t(
|
|
266
|
+
className: I.searchIcon,
|
|
267
|
+
children: /* @__PURE__ */ t(F, {})
|
|
250
268
|
}),
|
|
251
269
|
/* @__PURE__ */ t("input", {
|
|
252
270
|
ref: l,
|
|
253
271
|
type: "text",
|
|
254
|
-
className:
|
|
272
|
+
className: I.search,
|
|
255
273
|
placeholder: i,
|
|
256
274
|
autoComplete: "off",
|
|
257
275
|
value: e,
|
|
258
276
|
onChange: (e) => r?.(e.target.value)
|
|
259
277
|
}),
|
|
260
278
|
a && /* @__PURE__ */ t("span", {
|
|
261
|
-
className:
|
|
279
|
+
className: I.searchShortcut,
|
|
262
280
|
"aria-hidden": "true",
|
|
263
281
|
children: a
|
|
264
282
|
})
|
|
265
283
|
]
|
|
266
284
|
}), s && /* @__PURE__ */ t("div", {
|
|
267
|
-
className:
|
|
285
|
+
className: I.controls,
|
|
268
286
|
children: s
|
|
269
287
|
})]
|
|
270
288
|
});
|
|
271
289
|
}
|
|
272
|
-
var
|
|
290
|
+
var R = {
|
|
273
291
|
checkbox: "_checkbox_veqkz_1",
|
|
274
292
|
input: "_input_veqkz_11",
|
|
275
293
|
box: "_box_veqkz_18",
|
|
@@ -277,19 +295,19 @@ var F = {
|
|
|
277
295
|
};
|
|
278
296
|
//#endregion
|
|
279
297
|
//#region src/components/Checkbox.tsx
|
|
280
|
-
function
|
|
298
|
+
function z({ checked: e, onChange: r, ariaLabel: i, className: a }) {
|
|
281
299
|
return /* @__PURE__ */ n("label", {
|
|
282
|
-
className: `${
|
|
300
|
+
className: `${R.checkbox} ${a ?? ""}`,
|
|
283
301
|
children: [/* @__PURE__ */ t("input", {
|
|
284
302
|
type: "checkbox",
|
|
285
|
-
className:
|
|
303
|
+
className: R.input,
|
|
286
304
|
checked: e,
|
|
287
305
|
onChange: r,
|
|
288
306
|
"aria-label": i
|
|
289
307
|
}), /* @__PURE__ */ t("span", {
|
|
290
|
-
className:
|
|
308
|
+
className: R.box,
|
|
291
309
|
children: /* @__PURE__ */ t("svg", {
|
|
292
|
-
className:
|
|
310
|
+
className: R.icon,
|
|
293
311
|
viewBox: "0 0 17 18",
|
|
294
312
|
"aria-hidden": "true",
|
|
295
313
|
children: /* @__PURE__ */ t("polyline", { points: "1 9 7 14 15 4" })
|
|
@@ -297,7 +315,7 @@ function I({ checked: e, onChange: r, ariaLabel: i, className: a }) {
|
|
|
297
315
|
})]
|
|
298
316
|
});
|
|
299
317
|
}
|
|
300
|
-
var
|
|
318
|
+
var B = {
|
|
301
319
|
radio: "_radio_7q2jv_1",
|
|
302
320
|
input: "_input_7q2jv_11",
|
|
303
321
|
circle: "_circle_7q2jv_18",
|
|
@@ -305,24 +323,24 @@ var L = {
|
|
|
305
323
|
};
|
|
306
324
|
//#endregion
|
|
307
325
|
//#region src/components/RadioButton.tsx
|
|
308
|
-
function
|
|
326
|
+
function V({ checked: e, onChange: r, name: i, value: a, ariaLabel: o, className: s }) {
|
|
309
327
|
return /* @__PURE__ */ n("label", {
|
|
310
|
-
className: `${
|
|
328
|
+
className: `${B.radio} ${s ?? ""}`,
|
|
311
329
|
children: [/* @__PURE__ */ t("input", {
|
|
312
330
|
type: "radio",
|
|
313
|
-
className:
|
|
331
|
+
className: B.input,
|
|
314
332
|
checked: e,
|
|
315
333
|
onChange: r,
|
|
316
334
|
name: i,
|
|
317
335
|
value: a,
|
|
318
336
|
"aria-label": o
|
|
319
337
|
}), /* @__PURE__ */ t("span", {
|
|
320
|
-
className:
|
|
321
|
-
children: /* @__PURE__ */ t("span", { className:
|
|
338
|
+
className: B.circle,
|
|
339
|
+
children: /* @__PURE__ */ t("span", { className: B.dot })
|
|
322
340
|
})]
|
|
323
341
|
});
|
|
324
342
|
}
|
|
325
|
-
var
|
|
343
|
+
var H = {
|
|
326
344
|
field: "_field_133ye_1",
|
|
327
345
|
label: "_label_133ye_6",
|
|
328
346
|
inputWrap: "_inputWrap_133ye_12",
|
|
@@ -337,72 +355,73 @@ var z = {
|
|
|
337
355
|
};
|
|
338
356
|
//#endregion
|
|
339
357
|
//#region src/components/TextField.tsx
|
|
340
|
-
function
|
|
358
|
+
function U({ label: e, helperText: r, error: i, size: a = "base", leadingIcon: o, id: s, ...c }) {
|
|
341
359
|
let u = l(), d = s ?? u;
|
|
342
360
|
return /* @__PURE__ */ n("div", {
|
|
343
|
-
className:
|
|
361
|
+
className: H.field,
|
|
344
362
|
children: [
|
|
345
363
|
e && /* @__PURE__ */ t("label", {
|
|
346
|
-
className:
|
|
364
|
+
className: H.label,
|
|
347
365
|
htmlFor: d,
|
|
348
366
|
children: e
|
|
349
367
|
}),
|
|
350
368
|
/* @__PURE__ */ n("div", {
|
|
351
|
-
className: `${
|
|
369
|
+
className: `${H.inputWrap} ${H[a]} ${i ? H.errorWrap : ""}`,
|
|
352
370
|
children: [o && /* @__PURE__ */ t("span", {
|
|
353
|
-
className:
|
|
371
|
+
className: H.icon,
|
|
354
372
|
children: o
|
|
355
373
|
}), /* @__PURE__ */ t("input", {
|
|
356
374
|
id: d,
|
|
357
|
-
className:
|
|
375
|
+
className: H.input,
|
|
358
376
|
...c
|
|
359
377
|
})]
|
|
360
378
|
}),
|
|
361
379
|
i ? /* @__PURE__ */ t("span", {
|
|
362
|
-
className:
|
|
380
|
+
className: H.errorText,
|
|
363
381
|
children: i
|
|
364
382
|
}) : r ? /* @__PURE__ */ t("span", {
|
|
365
|
-
className:
|
|
383
|
+
className: H.helperText,
|
|
366
384
|
children: r
|
|
367
385
|
}) : null
|
|
368
386
|
]
|
|
369
387
|
});
|
|
370
388
|
}
|
|
371
|
-
var
|
|
389
|
+
var W = {
|
|
372
390
|
menu: "_menu_471l2_1",
|
|
373
391
|
divider: "_divider_471l2_15"
|
|
374
392
|
};
|
|
375
393
|
//#endregion
|
|
376
394
|
//#region src/components/Menu.tsx
|
|
377
|
-
function
|
|
395
|
+
function G({ children: e, ...n }) {
|
|
378
396
|
return /* @__PURE__ */ t("div", {
|
|
379
397
|
role: "menu",
|
|
380
|
-
className:
|
|
398
|
+
className: W.menu,
|
|
381
399
|
...n,
|
|
382
400
|
children: e
|
|
383
401
|
});
|
|
384
402
|
}
|
|
385
|
-
function
|
|
403
|
+
function K() {
|
|
386
404
|
return /* @__PURE__ */ t("div", {
|
|
387
|
-
className:
|
|
405
|
+
className: W.divider,
|
|
388
406
|
role: "separator"
|
|
389
407
|
});
|
|
390
408
|
}
|
|
391
|
-
var
|
|
392
|
-
item: "
|
|
393
|
-
icon: "
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
409
|
+
var q = {
|
|
410
|
+
item: "_item_1j7n9_1",
|
|
411
|
+
icon: "_icon_1j7n9_24",
|
|
412
|
+
check: "_check_1j7n9_25",
|
|
413
|
+
label: "_label_1j7n9_52",
|
|
414
|
+
trailing: "_trailing_1j7n9_59",
|
|
415
|
+
selected: "_selected_1j7n9_64",
|
|
416
|
+
destructive: "_destructive_1j7n9_85"
|
|
398
417
|
};
|
|
399
418
|
//#endregion
|
|
400
419
|
//#region src/components/MenuItem.tsx
|
|
401
|
-
function
|
|
420
|
+
function J({ icon: e, trailing: r, selected: i, destructive: a, children: o, ...s }) {
|
|
402
421
|
let c = [
|
|
403
|
-
|
|
404
|
-
i &&
|
|
405
|
-
a &&
|
|
422
|
+
q.item,
|
|
423
|
+
i && q.selected,
|
|
424
|
+
a && q.destructive
|
|
406
425
|
].filter(Boolean).join(" ");
|
|
407
426
|
return /* @__PURE__ */ n("button", {
|
|
408
427
|
type: "button",
|
|
@@ -411,35 +430,158 @@ function G({ icon: e, trailing: r, selected: i, destructive: a, children: o, ...
|
|
|
411
430
|
...s,
|
|
412
431
|
children: [
|
|
413
432
|
e && /* @__PURE__ */ t("span", {
|
|
414
|
-
className:
|
|
433
|
+
className: q.icon,
|
|
415
434
|
children: e
|
|
416
435
|
}),
|
|
417
436
|
/* @__PURE__ */ t("span", {
|
|
418
|
-
className:
|
|
437
|
+
className: q.label,
|
|
419
438
|
children: o
|
|
420
439
|
}),
|
|
421
440
|
r && /* @__PURE__ */ t("span", {
|
|
422
|
-
className:
|
|
441
|
+
className: q.trailing,
|
|
423
442
|
children: r
|
|
443
|
+
}),
|
|
444
|
+
i && /* @__PURE__ */ t("span", {
|
|
445
|
+
className: q.check,
|
|
446
|
+
children: /* @__PURE__ */ t(j, {})
|
|
424
447
|
})
|
|
425
448
|
]
|
|
426
449
|
});
|
|
427
450
|
}
|
|
428
|
-
var
|
|
451
|
+
var Y = {
|
|
452
|
+
field: "_field_1bvdj_1",
|
|
453
|
+
label: "_label_1bvdj_7",
|
|
454
|
+
trigger: "_trigger_1bvdj_13",
|
|
455
|
+
errorWrap: "_errorWrap_1bvdj_31",
|
|
456
|
+
sm: "_sm_1bvdj_40",
|
|
457
|
+
base: "_base_1bvdj_47",
|
|
458
|
+
lg: "_lg_1bvdj_54",
|
|
459
|
+
icon: "_icon_1bvdj_62",
|
|
460
|
+
value: "_value_1bvdj_76",
|
|
461
|
+
placeholder: "_placeholder_1bvdj_84",
|
|
462
|
+
chevron: "_chevron_1bvdj_87",
|
|
463
|
+
chevronOpen: "_chevronOpen_1bvdj_102",
|
|
464
|
+
menuWrap: "_menuWrap_1bvdj_106",
|
|
465
|
+
helperText: "_helperText_1bvdj_113",
|
|
466
|
+
errorText: "_errorText_1bvdj_118"
|
|
467
|
+
};
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region src/components/Dropdown.tsx
|
|
470
|
+
function X({ label: e, helperText: r, error: i, size: a = "base", placeholder: o = "Select…", options: s, value: u, onChange: p, disabled: m }) {
|
|
471
|
+
let [h, g] = f(!1), _ = d(null), v = l(), y = s.find((e) => e.value === u), b = s.filter((e) => !e.disabled).map((e) => e.value);
|
|
472
|
+
c(() => {
|
|
473
|
+
if (!h) return;
|
|
474
|
+
let e = u ?? b[0];
|
|
475
|
+
(_.current?.querySelector(`[data-value="${e}"]`))?.focus();
|
|
476
|
+
}, [h]), c(() => {
|
|
477
|
+
if (!h) return;
|
|
478
|
+
function e(e) {
|
|
479
|
+
_.current?.contains(e.target) || g(!1);
|
|
480
|
+
}
|
|
481
|
+
function t(e) {
|
|
482
|
+
e.key === "Escape" && g(!1);
|
|
483
|
+
}
|
|
484
|
+
return window.addEventListener("pointerdown", e), window.addEventListener("keydown", t), () => {
|
|
485
|
+
window.removeEventListener("pointerdown", e), window.removeEventListener("keydown", t);
|
|
486
|
+
};
|
|
487
|
+
}, [h]);
|
|
488
|
+
function x(e) {
|
|
489
|
+
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
490
|
+
e.preventDefault(), g(!0);
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
e.key === "Escape" && g(!1);
|
|
494
|
+
}
|
|
495
|
+
function S(e, t) {
|
|
496
|
+
let n = b.indexOf(t);
|
|
497
|
+
if (n === -1) return;
|
|
498
|
+
let r = null;
|
|
499
|
+
if (e.key === "ArrowDown" && (r = (n + 1) % b.length), e.key === "ArrowUp" && (r = (n - 1 + b.length) % b.length), e.key === "Home" && (r = 0), e.key === "End" && (r = b.length - 1), r !== null) {
|
|
500
|
+
e.preventDefault();
|
|
501
|
+
let t = b[r];
|
|
502
|
+
(_.current?.querySelector(`[data-value="${t}"]`))?.focus();
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
e.key === "Escape" && g(!1);
|
|
506
|
+
}
|
|
507
|
+
return /* @__PURE__ */ n("div", {
|
|
508
|
+
className: Y.field,
|
|
509
|
+
ref: _,
|
|
510
|
+
children: [
|
|
511
|
+
e && /* @__PURE__ */ t("label", {
|
|
512
|
+
className: Y.label,
|
|
513
|
+
htmlFor: v,
|
|
514
|
+
children: e
|
|
515
|
+
}),
|
|
516
|
+
/* @__PURE__ */ n("button", {
|
|
517
|
+
id: v,
|
|
518
|
+
type: "button",
|
|
519
|
+
className: `${Y.trigger} ${Y[a]} ${i ? Y.errorWrap : ""}`,
|
|
520
|
+
"aria-haspopup": "listbox",
|
|
521
|
+
"aria-expanded": h,
|
|
522
|
+
disabled: m,
|
|
523
|
+
onClick: () => g((e) => !e),
|
|
524
|
+
onKeyDown: x,
|
|
525
|
+
children: [
|
|
526
|
+
y?.icon && /* @__PURE__ */ t("span", {
|
|
527
|
+
className: Y.icon,
|
|
528
|
+
children: y.icon
|
|
529
|
+
}),
|
|
530
|
+
/* @__PURE__ */ t("span", {
|
|
531
|
+
className: `${Y.value} ${y ? "" : Y.placeholder}`,
|
|
532
|
+
children: y ? y.label : o
|
|
533
|
+
}),
|
|
534
|
+
/* @__PURE__ */ t("span", {
|
|
535
|
+
className: `${Y.chevron} ${h ? Y.chevronOpen : ""}`,
|
|
536
|
+
children: /* @__PURE__ */ t(N, {})
|
|
537
|
+
})
|
|
538
|
+
]
|
|
539
|
+
}),
|
|
540
|
+
h && /* @__PURE__ */ t("div", {
|
|
541
|
+
className: Y.menuWrap,
|
|
542
|
+
children: /* @__PURE__ */ t(G, {
|
|
543
|
+
role: "listbox",
|
|
544
|
+
style: { width: "100%" },
|
|
545
|
+
children: s.map((e) => /* @__PURE__ */ t(J, {
|
|
546
|
+
"data-value": e.value,
|
|
547
|
+
role: "option",
|
|
548
|
+
"aria-selected": e.value === u,
|
|
549
|
+
icon: e.icon,
|
|
550
|
+
selected: e.value === u,
|
|
551
|
+
disabled: e.disabled,
|
|
552
|
+
onClick: () => {
|
|
553
|
+
p(e.value), g(!1);
|
|
554
|
+
},
|
|
555
|
+
onKeyDown: (t) => S(t, e.value),
|
|
556
|
+
children: e.label
|
|
557
|
+
}, e.value))
|
|
558
|
+
})
|
|
559
|
+
}),
|
|
560
|
+
i ? /* @__PURE__ */ t("span", {
|
|
561
|
+
className: Y.errorText,
|
|
562
|
+
children: i
|
|
563
|
+
}) : r ? /* @__PURE__ */ t("span", {
|
|
564
|
+
className: Y.helperText,
|
|
565
|
+
children: r
|
|
566
|
+
}) : null
|
|
567
|
+
]
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
var re = { highlight: "_highlight_1anli_1" };
|
|
429
571
|
//#endregion
|
|
430
572
|
//#region src/components/HighlightText.tsx
|
|
431
|
-
function
|
|
573
|
+
function ie(e) {
|
|
432
574
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
433
575
|
}
|
|
434
|
-
function
|
|
576
|
+
function ae({ text: n, query: i }) {
|
|
435
577
|
if (!i) return /* @__PURE__ */ t(e, { children: n });
|
|
436
|
-
let a = n.split(RegExp(`(${
|
|
578
|
+
let a = n.split(RegExp(`(${ie(i)})`, "ig"));
|
|
437
579
|
return /* @__PURE__ */ t(e, { children: a.map((e, n) => e.toLowerCase() === i.toLowerCase() ? /* @__PURE__ */ t("mark", {
|
|
438
|
-
className:
|
|
580
|
+
className: re.highlight,
|
|
439
581
|
children: e
|
|
440
582
|
}, n) : /* @__PURE__ */ t(r, { children: e }, n)) });
|
|
441
583
|
}
|
|
442
|
-
var
|
|
584
|
+
var Z = {
|
|
443
585
|
group: "_group_51gk7_1",
|
|
444
586
|
btn: "_btn_51gk7_4",
|
|
445
587
|
caret: "_caret_51gk7_29",
|
|
@@ -461,24 +603,24 @@ var Y = {
|
|
|
461
603
|
};
|
|
462
604
|
//#endregion
|
|
463
605
|
//#region src/components/FilterSection.tsx
|
|
464
|
-
function
|
|
465
|
-
let [l, u] =
|
|
606
|
+
function oe({ label: e, options: r, optionLabel: i, activeSet: a, onToggle: o, onSetAll: s, searchable: c }) {
|
|
607
|
+
let [l, u] = f(""), d = l.trim().toLowerCase(), p = d ? r.filter((e) => i(e).toLowerCase().includes(d)) : r, m = r.length > 0 && a.size === r.length;
|
|
466
608
|
return /* @__PURE__ */ n("div", { children: [
|
|
467
609
|
/* @__PURE__ */ n("div", {
|
|
468
|
-
className:
|
|
610
|
+
className: Z.sectionHeader,
|
|
469
611
|
children: [/* @__PURE__ */ t("div", {
|
|
470
|
-
className:
|
|
612
|
+
className: Z.sectionLabel,
|
|
471
613
|
children: e
|
|
472
614
|
}), s && /* @__PURE__ */ t("button", {
|
|
473
615
|
type: "button",
|
|
474
|
-
className:
|
|
616
|
+
className: Z.allToggle,
|
|
475
617
|
onClick: () => s(m ? [] : r),
|
|
476
618
|
children: m ? "Deselect all" : "Select all"
|
|
477
619
|
})]
|
|
478
620
|
}),
|
|
479
621
|
c && /* @__PURE__ */ t("input", {
|
|
480
622
|
type: "text",
|
|
481
|
-
className:
|
|
623
|
+
className: Z.search,
|
|
482
624
|
placeholder: `Search ${e.toLowerCase()}…`,
|
|
483
625
|
autoComplete: "off",
|
|
484
626
|
value: l,
|
|
@@ -486,13 +628,13 @@ function X({ label: e, options: r, optionLabel: i, activeSet: a, onToggle: o, on
|
|
|
486
628
|
onChange: (e) => u(e.target.value)
|
|
487
629
|
}),
|
|
488
630
|
/* @__PURE__ */ n("div", {
|
|
489
|
-
className:
|
|
631
|
+
className: Z.optionsList,
|
|
490
632
|
children: [p.length === 0 && /* @__PURE__ */ t("div", {
|
|
491
|
-
className:
|
|
633
|
+
className: Z.empty,
|
|
492
634
|
children: "No match"
|
|
493
635
|
}), p.map((e) => /* @__PURE__ */ n("label", {
|
|
494
|
-
className:
|
|
495
|
-
children: [/* @__PURE__ */ t(
|
|
636
|
+
className: Z.option,
|
|
637
|
+
children: [/* @__PURE__ */ t(z, {
|
|
496
638
|
checked: a.has(e),
|
|
497
639
|
onChange: () => o(e)
|
|
498
640
|
}), /* @__PURE__ */ t("span", { children: i(e) })]
|
|
@@ -500,7 +642,7 @@ function X({ label: e, options: r, optionLabel: i, activeSet: a, onToggle: o, on
|
|
|
500
642
|
})
|
|
501
643
|
] });
|
|
502
644
|
}
|
|
503
|
-
var
|
|
645
|
+
var Q = {
|
|
504
646
|
sidebar: "_sidebar_1fx39_1",
|
|
505
647
|
title: "_title_1fx39_16",
|
|
506
648
|
navLink: "_navLink_1fx39_22",
|
|
@@ -508,47 +650,96 @@ var Z = {
|
|
|
508
650
|
};
|
|
509
651
|
//#endregion
|
|
510
652
|
//#region src/components/UiElementsSidebar.tsx
|
|
511
|
-
function
|
|
653
|
+
function se({ sections: e }) {
|
|
512
654
|
return /* @__PURE__ */ n("aside", {
|
|
513
|
-
className:
|
|
655
|
+
className: Q.sidebar,
|
|
514
656
|
children: [/* @__PURE__ */ t("div", {
|
|
515
|
-
className:
|
|
657
|
+
className: Q.title,
|
|
516
658
|
children: "UI Elements"
|
|
517
659
|
}), e.map((e) => /* @__PURE__ */ n("a", {
|
|
518
660
|
href: `#${e.id}`,
|
|
519
|
-
className:
|
|
661
|
+
className: Q.navLink,
|
|
520
662
|
children: [/* @__PURE__ */ t("span", { children: e.label }), /* @__PURE__ */ t("span", {
|
|
521
|
-
className:
|
|
663
|
+
className: Q.count,
|
|
522
664
|
children: e.count
|
|
523
665
|
})]
|
|
524
666
|
}, e.id))]
|
|
525
667
|
});
|
|
526
668
|
}
|
|
527
669
|
var $ = {
|
|
528
|
-
line: "
|
|
529
|
-
box: "
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
670
|
+
line: "_line_mndgo_1",
|
|
671
|
+
box: "_box_mndgo_2",
|
|
672
|
+
indicator: "_indicator_mndgo_9",
|
|
673
|
+
settling: "_settling_mndgo_17",
|
|
674
|
+
indicatorLine: "_indicatorLine_mndgo_21",
|
|
675
|
+
indicatorBox: "_indicatorBox_mndgo_27",
|
|
676
|
+
tab: "_tab_mndgo_35",
|
|
677
|
+
selected: "_selected_mndgo_80",
|
|
678
|
+
icon: "_icon_mndgo_89",
|
|
679
|
+
sm: "_sm_mndgo_148"
|
|
533
680
|
};
|
|
534
681
|
//#endregion
|
|
535
682
|
//#region src/components/Tabs.tsx
|
|
536
|
-
function
|
|
537
|
-
let
|
|
538
|
-
|
|
539
|
-
let
|
|
683
|
+
function ce({ items: e, value: r, onChange: i, variant: a = "line", size: o = "base", ...s }) {
|
|
684
|
+
let c = e.filter((e) => !e.disabled).map((e) => e.value), l = d(null), p = d(/* @__PURE__ */ new Map()), m = d(r), [h, g] = f(null), [_, v] = f("idle");
|
|
685
|
+
u(() => {
|
|
686
|
+
let e = p.current.get(r);
|
|
687
|
+
e && (g({
|
|
688
|
+
left: e.offsetLeft,
|
|
689
|
+
width: e.offsetWidth
|
|
690
|
+
}), a === "box" && m.current !== r && v("moving"), m.current = r);
|
|
691
|
+
}, [
|
|
692
|
+
r,
|
|
693
|
+
e,
|
|
694
|
+
a,
|
|
695
|
+
o
|
|
696
|
+
]);
|
|
697
|
+
function y(e) {
|
|
698
|
+
e.propertyName === "scale" && (_ === "moving" ? v("settling") : _ === "settling" && v("idle"));
|
|
699
|
+
}
|
|
700
|
+
u(() => {
|
|
701
|
+
let e = l.current;
|
|
702
|
+
if (!e) return;
|
|
703
|
+
let t = new ResizeObserver(() => {
|
|
704
|
+
let e = p.current.get(r);
|
|
705
|
+
e && g({
|
|
706
|
+
left: e.offsetLeft,
|
|
707
|
+
width: e.offsetWidth
|
|
708
|
+
});
|
|
709
|
+
});
|
|
710
|
+
return t.observe(e), () => t.disconnect();
|
|
711
|
+
}, [r]);
|
|
712
|
+
function b(e) {
|
|
713
|
+
let t = c.indexOf(r);
|
|
540
714
|
if (t === -1) return;
|
|
541
715
|
let n = null;
|
|
542
|
-
e.key === "ArrowRight" && (n = (t + 1) %
|
|
716
|
+
e.key === "ArrowRight" && (n = (t + 1) % c.length), e.key === "ArrowLeft" && (n = (t - 1 + c.length) % c.length), e.key === "Home" && (n = 0), e.key === "End" && (n = c.length - 1), n !== null && (e.preventDefault(), i(c[n]));
|
|
543
717
|
}
|
|
544
|
-
return /* @__PURE__ */
|
|
718
|
+
return /* @__PURE__ */ n("div", {
|
|
719
|
+
ref: l,
|
|
545
720
|
role: "tablist",
|
|
546
|
-
className: $[a],
|
|
547
|
-
onKeyDown:
|
|
548
|
-
...
|
|
549
|
-
children:
|
|
721
|
+
className: [$[a], a === "box" && o === "sm" && $.sm].filter(Boolean).join(" "),
|
|
722
|
+
onKeyDown: b,
|
|
723
|
+
...s,
|
|
724
|
+
children: [h && /* @__PURE__ */ t("span", {
|
|
725
|
+
"aria-hidden": !0,
|
|
726
|
+
className: [
|
|
727
|
+
$.indicator,
|
|
728
|
+
a === "line" ? $.indicatorLine : $.indicatorBox,
|
|
729
|
+
_ === "settling" && $.settling
|
|
730
|
+
].filter(Boolean).join(" "),
|
|
731
|
+
onTransitionEnd: y,
|
|
732
|
+
style: {
|
|
733
|
+
translate: `${h.left}px 0`,
|
|
734
|
+
scale: a === "box" && _ === "moving" ? .92 : 1,
|
|
735
|
+
width: h.width
|
|
736
|
+
}
|
|
737
|
+
}), e.map((e) => {
|
|
550
738
|
let a = e.value === r;
|
|
551
739
|
return /* @__PURE__ */ n("button", {
|
|
740
|
+
ref: (t) => {
|
|
741
|
+
t ? p.current.set(e.value, t) : p.current.delete(e.value);
|
|
742
|
+
},
|
|
552
743
|
type: "button",
|
|
553
744
|
role: "tab",
|
|
554
745
|
"aria-selected": a,
|
|
@@ -561,20 +752,20 @@ function te({ items: e, value: r, onChange: i, variant: a = "line", ...o }) {
|
|
|
561
752
|
children: e.icon
|
|
562
753
|
}), e.label]
|
|
563
754
|
}, e.value);
|
|
564
|
-
})
|
|
755
|
+
})]
|
|
565
756
|
});
|
|
566
757
|
}
|
|
567
758
|
//#endregion
|
|
568
759
|
//#region src/utils/format.ts
|
|
569
|
-
function
|
|
760
|
+
function le(e) {
|
|
570
761
|
let t = Math.floor(e / 60), n = e % 60;
|
|
571
762
|
return `${t}h:${String(n).padStart(2, "0")}m`;
|
|
572
763
|
}
|
|
573
|
-
function
|
|
764
|
+
function ue(e, t) {
|
|
574
765
|
let n = Math.floor(e / 60), r = e % 60, i = (e) => String(e).padStart(2, "0");
|
|
575
766
|
return `${i(n)}:${i(r)}:${i(t)}`;
|
|
576
767
|
}
|
|
577
768
|
//#endregion
|
|
578
|
-
export {
|
|
769
|
+
export { m as Button, g as Card, z as Checkbox, X as Dropdown, oe as FilterSection, ae as HighlightText, G as Menu, K as MenuDivider, J as MenuItem, V as RadioButton, ce as Tabs, v as Tag, U as TextField, L as Toolbar, se as UiElementsSidebar, le as formatDuration, ue as formatDurationHMS };
|
|
579
770
|
|
|
580
771
|
//# sourceMappingURL=index.js.map
|