@voltro/ui 0.85.0 → 0.87.0
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/CHANGELOG.md +5987 -0
- package/THIRD-PARTY-NOTICES.md +1125 -34
- package/dist/achievementStrings.js +29 -0
- package/dist/agentChat.js +117 -0
- package/dist/appAgent.js +30 -0
- package/dist/asyncSelect.js +63 -0
- package/dist/autoForm.js +104 -0
- package/dist/commentsThread.js +163 -0
- package/dist/connectAccount.js +99 -0
- package/dist/dataCopilot.js +77 -0
- package/dist/dataTable.js +60 -0
- package/dist/filters.js +105 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +19 -1408
- package/dist/presence.js +43 -0
- package/dist/questStrings.js +41 -0
- package/dist/recordView.js +52 -0
- package/dist/richText.js +81 -0
- package/dist/skeleton.js +52 -0
- package/dist/strings.js +148 -0
- package/dist/widgets.js +247 -0
- package/dist/workflow.js +92 -0
- package/package.json +3 -3
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useUiStrings as e } from "./strings.js";
|
|
2
|
+
import { memo as t, useMemo as n } from "react";
|
|
3
|
+
import { useDataTable as r } from "@voltro/client";
|
|
4
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/dataTable.tsx
|
|
6
|
+
var s = (e) => e == null ? "" : typeof e == "boolean" ? e ? "✓" : "✗" : String(e), c = (e, t) => e ? t === "asc" ? "ascending" : "descending" : "none";
|
|
7
|
+
function l({ row: e, columns: t, renderCell: n, rowActions: r }) {
|
|
8
|
+
return /* @__PURE__ */ o("tr", { children: [t.map((t) => /* @__PURE__ */ a("td", {
|
|
9
|
+
"data-column": t.name,
|
|
10
|
+
children: n ? n(e, t) : s(e[t.name])
|
|
11
|
+
}, t.name)), r ? /* @__PURE__ */ a("td", { children: r(e) }) : null] });
|
|
12
|
+
}
|
|
13
|
+
var u = t(l);
|
|
14
|
+
function d(t) {
|
|
15
|
+
let { api: s, query: l, emptyText: d, loadingText: f, loadMoreText: p, renderCell: m, rowActions: h, rowKey: g, ..._ } = t, v = e().dataTable, y = r(s, l, _), b = n(() => y.loading ? null : y.rows.map((e, t) => /* @__PURE__ */ a(u, {
|
|
16
|
+
row: e,
|
|
17
|
+
columns: y.columns,
|
|
18
|
+
renderCell: m,
|
|
19
|
+
rowActions: h
|
|
20
|
+
}, g ? g(e) : String(e.id ?? t))), [
|
|
21
|
+
y.loading,
|
|
22
|
+
y.rows,
|
|
23
|
+
y.columns,
|
|
24
|
+
m,
|
|
25
|
+
h,
|
|
26
|
+
g
|
|
27
|
+
]);
|
|
28
|
+
return y.loading ? /* @__PURE__ */ a("p", {
|
|
29
|
+
"data-voltro-datatable-loading": !0,
|
|
30
|
+
"aria-busy": "true",
|
|
31
|
+
children: f ?? "Loading…"
|
|
32
|
+
}) : y.rows.length === 0 ? /* @__PURE__ */ a("p", {
|
|
33
|
+
"data-voltro-datatable-empty": !0,
|
|
34
|
+
children: d ?? "No rows."
|
|
35
|
+
}) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("table", {
|
|
36
|
+
"data-voltro-datatable": l,
|
|
37
|
+
children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [y.columns.map((e) => {
|
|
38
|
+
let t = y.sort?.column === e.name, n = y.sort?.direction ?? "asc";
|
|
39
|
+
return /* @__PURE__ */ a("th", {
|
|
40
|
+
"aria-sort": c(t, n),
|
|
41
|
+
scope: "col",
|
|
42
|
+
children: /* @__PURE__ */ o("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: () => y.toggleSort(e.name),
|
|
45
|
+
children: [e.label, t ? n === "asc" ? " ▲" : " ▼" : ""]
|
|
46
|
+
})
|
|
47
|
+
}, e.name);
|
|
48
|
+
}), h ? /* @__PURE__ */ a("th", {
|
|
49
|
+
scope: "col",
|
|
50
|
+
children: v.actions
|
|
51
|
+
}) : null] }) }), /* @__PURE__ */ a("tbody", { children: b })]
|
|
52
|
+
}), y.hasMore ? /* @__PURE__ */ a("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
"data-voltro-datatable-more": !0,
|
|
55
|
+
onClick: () => y.loadMore(),
|
|
56
|
+
children: p ?? "Load more"
|
|
57
|
+
}) : null] });
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { d as DataTable };
|
package/dist/filters.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useUiStrings as e } from "./strings.js";
|
|
2
|
+
import { useQueryFilters as t } from "@voltro/client";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/filters.tsx
|
|
5
|
+
var i = (e) => e == null ? "" : String(e);
|
|
6
|
+
function a(t) {
|
|
7
|
+
let { filter: a, value: o, onChange: s } = t, c = e().filters, l = {
|
|
8
|
+
"data-filter": a.name,
|
|
9
|
+
"aria-label": a.label
|
|
10
|
+
};
|
|
11
|
+
switch (a.kind) {
|
|
12
|
+
case "select": return /* @__PURE__ */ r("select", {
|
|
13
|
+
...l,
|
|
14
|
+
value: i(o),
|
|
15
|
+
onChange: (e) => s(e.target.value || void 0),
|
|
16
|
+
children: [/* @__PURE__ */ n("option", {
|
|
17
|
+
value: "",
|
|
18
|
+
children: c.anyOption(a.label)
|
|
19
|
+
}), (a.options ?? []).map((e) => /* @__PURE__ */ n("option", {
|
|
20
|
+
value: e.value,
|
|
21
|
+
children: e.label
|
|
22
|
+
}, e.value))]
|
|
23
|
+
});
|
|
24
|
+
case "multi-select": return /* @__PURE__ */ n("select", {
|
|
25
|
+
...l,
|
|
26
|
+
multiple: !0,
|
|
27
|
+
value: Array.isArray(o) ? o : [],
|
|
28
|
+
onChange: (e) => s(Array.from(e.target.selectedOptions, (e) => e.value)),
|
|
29
|
+
children: (a.options ?? []).map((e) => /* @__PURE__ */ n("option", {
|
|
30
|
+
value: e.value,
|
|
31
|
+
children: e.label
|
|
32
|
+
}, e.value))
|
|
33
|
+
});
|
|
34
|
+
case "boolean": return /* @__PURE__ */ n("input", {
|
|
35
|
+
...l,
|
|
36
|
+
type: "checkbox",
|
|
37
|
+
checked: o === !0,
|
|
38
|
+
onChange: (e) => s(e.target.checked ? !0 : void 0)
|
|
39
|
+
});
|
|
40
|
+
case "number-range":
|
|
41
|
+
case "date-range": {
|
|
42
|
+
let e = a.kind === "number-range" ? "number" : "date", t = o ?? {};
|
|
43
|
+
return /* @__PURE__ */ r("span", {
|
|
44
|
+
"data-filter": a.name,
|
|
45
|
+
"data-range": a.kind,
|
|
46
|
+
children: [/* @__PURE__ */ n("input", {
|
|
47
|
+
"aria-label": `${a.label} from`,
|
|
48
|
+
type: e,
|
|
49
|
+
value: i(t.gte),
|
|
50
|
+
onChange: (e) => s({
|
|
51
|
+
...t,
|
|
52
|
+
gte: e.target.value || void 0
|
|
53
|
+
})
|
|
54
|
+
}), /* @__PURE__ */ n("input", {
|
|
55
|
+
"aria-label": `${a.label} to`,
|
|
56
|
+
type: e,
|
|
57
|
+
value: i(t.lte),
|
|
58
|
+
onChange: (e) => s({
|
|
59
|
+
...t,
|
|
60
|
+
lte: e.target.value || void 0
|
|
61
|
+
})
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
default: return /* @__PURE__ */ n("input", {
|
|
66
|
+
...l,
|
|
67
|
+
type: "text",
|
|
68
|
+
value: i(o),
|
|
69
|
+
onChange: (e) => s(e.target.value || void 0)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function o(i) {
|
|
74
|
+
let o = t(i.api, i.query, i.initial ? { initial: i.initial } : {}), s = e().filters;
|
|
75
|
+
return /* @__PURE__ */ r("div", {
|
|
76
|
+
"data-voltro-query-filters": i.query,
|
|
77
|
+
children: [/* @__PURE__ */ r("div", {
|
|
78
|
+
"data-filter-controls": !0,
|
|
79
|
+
role: "group",
|
|
80
|
+
"aria-label": s.filtersLabel,
|
|
81
|
+
children: [
|
|
82
|
+
o.filters.map((e) => /* @__PURE__ */ r("label", {
|
|
83
|
+
"data-filter-label": !0,
|
|
84
|
+
children: [/* @__PURE__ */ n("span", { children: e.label }), /* @__PURE__ */ n(a, {
|
|
85
|
+
filter: e,
|
|
86
|
+
value: o.values[e.name],
|
|
87
|
+
onChange: (t) => o.setFilter(e.name, t)
|
|
88
|
+
})]
|
|
89
|
+
}, e.name)),
|
|
90
|
+
/* @__PURE__ */ n("button", {
|
|
91
|
+
type: "button",
|
|
92
|
+
"data-filter-clear": !0,
|
|
93
|
+
onClick: () => o.clear(),
|
|
94
|
+
children: s.clear
|
|
95
|
+
}),
|
|
96
|
+
i.showCount ?? !0 ? /* @__PURE__ */ n("span", {
|
|
97
|
+
"data-filter-count": !0,
|
|
98
|
+
children: s.resultCount(o.count ?? "…")
|
|
99
|
+
}) : null
|
|
100
|
+
]
|
|
101
|
+
}), i.children ? i.children(o) : null]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { o as QueryFilters };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,21 @@ import { UseDataTableOptions } from '@voltro/client';
|
|
|
13
13
|
import { WidgetKind } from '@voltro/client';
|
|
14
14
|
import { WorkflowRunStatus } from '@voltro/client';
|
|
15
15
|
|
|
16
|
+
export declare interface AchievementUiStrings {
|
|
17
|
+
readonly title: string;
|
|
18
|
+
readonly loading: string;
|
|
19
|
+
readonly empty: string;
|
|
20
|
+
readonly unavailable: string;
|
|
21
|
+
readonly invalid: string;
|
|
22
|
+
readonly locked: string;
|
|
23
|
+
readonly unlocked: string;
|
|
24
|
+
readonly tier: (id: string) => string;
|
|
25
|
+
readonly progress: (stat: string, value: string, target: string) => string;
|
|
26
|
+
readonly unlockedDate: (date: string) => string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare const achievementUiStrings: Readonly<Record<'en' | 'de', AchievementUiStrings>>;
|
|
30
|
+
|
|
16
31
|
/** Kit-styled default chat surface. Streaming bubbles, the live typewriter
|
|
17
32
|
* row, an input box wired to `<agent>.send`. */
|
|
18
33
|
export declare function AgentChat(props: AgentChatProps): ReactNode;
|
|
@@ -327,6 +342,27 @@ export declare interface QueryFiltersProps<Row> {
|
|
|
327
342
|
readonly children?: (state: QueryFiltersState<Row>) => ReactNode;
|
|
328
343
|
}
|
|
329
344
|
|
|
345
|
+
export declare interface QuestUiStrings {
|
|
346
|
+
readonly title: string;
|
|
347
|
+
readonly loading: string;
|
|
348
|
+
readonly empty: string;
|
|
349
|
+
readonly unavailable: string;
|
|
350
|
+
readonly active: string;
|
|
351
|
+
readonly completed: string;
|
|
352
|
+
readonly expired: string;
|
|
353
|
+
readonly reroll: string;
|
|
354
|
+
readonly rerollPending: string;
|
|
355
|
+
readonly recover: string;
|
|
356
|
+
readonly recoverPending: string;
|
|
357
|
+
readonly rerollError: string;
|
|
358
|
+
readonly invalid: string;
|
|
359
|
+
readonly objective: (name: string, progress: number, target: number) => string;
|
|
360
|
+
readonly expires: (date: string) => string;
|
|
361
|
+
readonly remaining: (count: number) => string;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export declare const questUiStrings: Readonly<Record<'en' | 'de', QuestUiStrings>>;
|
|
365
|
+
|
|
330
366
|
export declare function RecordView<R extends Record<string, unknown> = Record<string, unknown>>(props: RecordViewProps<R>): ReactNode;
|
|
331
367
|
|
|
332
368
|
export declare interface RecordViewProps<R extends Record<string, unknown>> {
|
|
@@ -397,6 +433,8 @@ export declare interface TableSkeletonProps {
|
|
|
397
433
|
* that interpolates a value (count, name, label) is a function so a locale can
|
|
398
434
|
* reorder/pluralize. English defaults live in {@link defaultUiStrings}. */
|
|
399
435
|
export declare interface UiStrings {
|
|
436
|
+
readonly achievements: AchievementUiStrings;
|
|
437
|
+
readonly quests: QuestUiStrings;
|
|
400
438
|
/** <QueryFilters> — the reset button, the "Any <label>" option, the result
|
|
401
439
|
* count, and the group's aria-label. */
|
|
402
440
|
readonly filters: {
|