@skiddph/prui 0.7.0 → 0.9.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/dist/app/resource.d.ts +44 -1
- package/dist/app.js +1 -1
- package/dist/chunks/auth-shell-DQJ4UmUv.js +1208 -0
- package/dist/chunks/data-table-toolbar-B-5J2Ozl.js +736 -0
- package/dist/core/accordion.d.ts +16 -0
- package/dist/core/accordion.js +108 -0
- package/dist/core/alert.d.ts +20 -0
- package/dist/core/alert.js +63 -0
- package/dist/core/anchor.d.ts +35 -0
- package/dist/core/anchor.js +39 -0
- package/dist/core/breadcrumb.d.ts +30 -0
- package/dist/core/breadcrumb.js +67 -0
- package/dist/core/button.d.ts +8 -1
- package/dist/core/button.js +23 -18
- package/dist/core/calendar.d.ts +29 -0
- package/dist/core/calendar.js +180 -0
- package/dist/core/card.d.ts +5 -1
- package/dist/core/card.js +33 -29
- package/dist/core/checkbox.d.ts +19 -0
- package/dist/core/checkbox.js +55 -0
- package/dist/core/combobox.d.ts +32 -0
- package/dist/core/combobox.js +193 -0
- package/dist/core/date-picker.d.ts +62 -0
- package/dist/core/date-picker.js +314 -0
- package/dist/core/dialog.d.ts +15 -0
- package/dist/core/dialog.js +77 -60
- package/dist/core/drawer.d.ts +34 -0
- package/dist/core/drawer.js +129 -0
- package/dist/core/dropdown.d.ts +8 -4
- package/dist/core/dropdown.js +136 -51
- package/dist/core/file-upload.d.ts +28 -0
- package/dist/core/file-upload.js +111 -0
- package/dist/core/index.d.ts +23 -1
- package/dist/core/list-nav.d.ts +27 -0
- package/dist/core/list-nav.js +51 -0
- package/dist/core/modal.d.ts +14 -5
- package/dist/core/modal.js +163 -156
- package/dist/core/overlay.d.ts +93 -0
- package/dist/core/overlay.js +189 -0
- package/dist/core/popover.d.ts +29 -0
- package/dist/core/popover.js +124 -0
- package/dist/core/progress.d.ts +21 -0
- package/dist/core/progress.js +59 -0
- package/dist/core/radio.d.ts +20 -0
- package/dist/core/radio.js +115 -0
- package/dist/core/select.d.ts +6 -0
- package/dist/core/select.js +187 -98
- package/dist/core/skeleton.d.ts +20 -0
- package/dist/core/skeleton.js +41 -0
- package/dist/core/spinner.d.ts +15 -0
- package/dist/core/spinner.js +41 -0
- package/dist/core/tabs.js +82 -53
- package/dist/core/time-picker.d.ts +68 -0
- package/dist/core/time-picker.js +305 -0
- package/dist/core/timeline.d.ts +22 -0
- package/dist/core/timeline.js +57 -0
- package/dist/core/toast.d.ts +36 -0
- package/dist/core/toast.js +123 -0
- package/dist/core/tooltip.d.ts +23 -0
- package/dist/core/tooltip.js +96 -0
- package/dist/core/tree-view.d.ts +34 -0
- package/dist/core/tree-view.js +133 -0
- package/dist/core.js +160 -62
- package/dist/data-table/data-table.d.ts +22 -1
- package/dist/data-table.js +1 -1
- package/dist/forms/form.d.ts +8 -0
- package/dist/forms.js +213 -200
- package/dist/i18n/index.d.ts +89 -0
- package/dist/i18n.js +105 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +263 -155
- package/dist/prui-utilities.css +1 -1
- package/dist/prui.css +111 -4
- package/dist/theme/base.css +110 -3
- package/dist/theme/index.d.ts +27 -0
- package/dist/theme.js +86 -58
- package/package.json +9 -2
- package/dist/chunks/auth-shell-BG5vx9eG.js +0 -1054
- package/dist/chunks/data-table-toolbar-BUy2EWPy.js +0 -581
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as d, jsxs as R, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { cn as w } from "./cn.js";
|
|
4
|
+
import { useReducedMotion as F, useOverlayStack as j, useEscapeKey as B, Portal as L } from "./overlay.js";
|
|
5
|
+
import { useAnchoredPosition as P } from "./anchor.js";
|
|
6
|
+
const z = s.forwardRef(function({ content: x, children: p, side: v = "top", align: y = "center", delay: g = 300, className: h }, S) {
|
|
7
|
+
const [i, c] = s.useState(!1), f = s.useRef(null), n = s.useRef(null), b = F(), { setElement: E, isTop: T } = j(i);
|
|
8
|
+
B(i, T, () => c(!1));
|
|
9
|
+
const { ref: M, position: l } = P({ active: i, anchorRef: f, side: v, align: y, offsetHeight: 32 }), a = () => {
|
|
10
|
+
n.current != null && window.clearTimeout(n.current), n.current = window.setTimeout(() => c(!0), g);
|
|
11
|
+
}, u = () => {
|
|
12
|
+
n.current != null && window.clearTimeout(n.current), c(!1);
|
|
13
|
+
};
|
|
14
|
+
s.useEffect(
|
|
15
|
+
() => () => {
|
|
16
|
+
n.current != null && window.clearTimeout(n.current);
|
|
17
|
+
},
|
|
18
|
+
[]
|
|
19
|
+
);
|
|
20
|
+
let m;
|
|
21
|
+
if (s.isValidElement(p)) {
|
|
22
|
+
const t = p;
|
|
23
|
+
m = s.cloneElement(t, {
|
|
24
|
+
ref: (o) => {
|
|
25
|
+
f.current = o;
|
|
26
|
+
const e = t.props.ref;
|
|
27
|
+
typeof e == "function" ? e(o) : e && typeof e == "object" && (e.current = o);
|
|
28
|
+
},
|
|
29
|
+
onFocus: (o) => {
|
|
30
|
+
var e, r;
|
|
31
|
+
(r = (e = t.props).onFocus) == null || r.call(e, o), a();
|
|
32
|
+
},
|
|
33
|
+
onBlur: (o) => {
|
|
34
|
+
var e, r;
|
|
35
|
+
(r = (e = t.props).onBlur) == null || r.call(e, o), u();
|
|
36
|
+
},
|
|
37
|
+
onMouseEnter: (o) => {
|
|
38
|
+
var e, r;
|
|
39
|
+
(r = (e = t.props).onMouseEnter) == null || r.call(e, o), a();
|
|
40
|
+
},
|
|
41
|
+
onMouseLeave: (o) => {
|
|
42
|
+
var e, r;
|
|
43
|
+
(r = (e = t.props).onMouseLeave) == null || r.call(e, o), u();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
} else
|
|
47
|
+
m = /* @__PURE__ */ d(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
ref: f,
|
|
51
|
+
tabIndex: 0,
|
|
52
|
+
className: w("inline-flex", h),
|
|
53
|
+
onMouseEnter: a,
|
|
54
|
+
onMouseLeave: u,
|
|
55
|
+
onFocus: a,
|
|
56
|
+
onBlur: u,
|
|
57
|
+
children: p
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
return /* @__PURE__ */ R(N, { children: [
|
|
61
|
+
m,
|
|
62
|
+
i ? /* @__PURE__ */ d(L, { children: /* @__PURE__ */ d(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
ref: (t) => {
|
|
66
|
+
M(t), E((t == null ? void 0 : t.parentElement) ?? null);
|
|
67
|
+
},
|
|
68
|
+
role: "tooltip",
|
|
69
|
+
"data-state": "open",
|
|
70
|
+
"data-side": (l == null ? void 0 : l.side) ?? v,
|
|
71
|
+
className: w(
|
|
72
|
+
"prui-tooltip fixed z-[var(--prui-z-tooltip)] max-w-60 rounded-[var(--prui-radius-1)]",
|
|
73
|
+
"border border-[var(--prui-line)] bg-[var(--prui-surface)] px-2 py-1 text-xs text-[var(--prui-fg)]",
|
|
74
|
+
"shadow-[var(--prui-shadow-md)] pointer-events-none",
|
|
75
|
+
!b && "prui-anim-fade"
|
|
76
|
+
),
|
|
77
|
+
style: l ? { top: l.top, left: l.left } : { top: -9999, left: -9999 },
|
|
78
|
+
children: x
|
|
79
|
+
}
|
|
80
|
+
) }) : null
|
|
81
|
+
] });
|
|
82
|
+
});
|
|
83
|
+
z.displayName = "Tooltip";
|
|
84
|
+
const K = {
|
|
85
|
+
name: "Tooltip",
|
|
86
|
+
props: [
|
|
87
|
+
{ name: "content", type: "ReactNode", default: null, control: "text" },
|
|
88
|
+
{ name: "side", type: "'top' | 'bottom' | 'left' | 'right'", default: "'top'", control: "select", options: ["top", "bottom", "left", "right"] },
|
|
89
|
+
{ name: "align", type: "'start' | 'center' | 'end'", default: "'center'", control: "select", options: ["start", "center", "end"] },
|
|
90
|
+
{ name: "delay", type: "number (ms)", default: "300", control: "number" }
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
z as Tooltip,
|
|
95
|
+
K as tooltipPropsMeta
|
|
96
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PropsMeta } from './props-meta';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* TreeView: nested expandable nodes (files/folders, categories). Full tree
|
|
5
|
+
* keyboard pattern: ArrowUp/Down move between visible nodes, ArrowRight
|
|
6
|
+
* expands (or moves into), ArrowLeft collapses (or moves to parent),
|
|
7
|
+
* Home/End jump. aria-level/aria-expanded/role=tree/treeitem carry the
|
|
8
|
+
* structure to assistive tech.
|
|
9
|
+
*/
|
|
10
|
+
export interface TreeViewItem {
|
|
11
|
+
id: string;
|
|
12
|
+
label: React.ReactNode;
|
|
13
|
+
children?: TreeViewItem[];
|
|
14
|
+
/** Render as a leaf action (no expander). Default: has children. */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Extra data passed back on events. */
|
|
17
|
+
meta?: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface TreeViewProps {
|
|
20
|
+
items: TreeViewItem[];
|
|
21
|
+
/** Expanded node ids (controlled). */
|
|
22
|
+
expanded?: string[];
|
|
23
|
+
defaultExpanded?: string[];
|
|
24
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
25
|
+
/** Selected node id (controlled). */
|
|
26
|
+
selected?: string;
|
|
27
|
+
defaultSelected?: string;
|
|
28
|
+
onSelect?: (id: string, item: TreeViewItem) => void;
|
|
29
|
+
/** Accessible label for the tree landmark. */
|
|
30
|
+
ariaLabel?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const TreeView: React.ForwardRefExoticComponent<TreeViewProps & React.RefAttributes<HTMLUListElement>>;
|
|
34
|
+
export declare const treeViewPropsMeta: PropsMeta;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { jsx as p, jsxs as M } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { ChevronRight as H } from "lucide-react";
|
|
4
|
+
import { cn as h } from "./cn.js";
|
|
5
|
+
const O = c.forwardRef(function({ items: D, expanded: b, defaultExpanded: C = [], onExpandedChange: o, selected: v, defaultSelected: I, onSelect: u, ariaLabel: N, className: R }, V) {
|
|
6
|
+
const [j, T] = c.useState(C), [A, E] = c.useState(I), x = b !== void 0, l = x ? b : j, g = v !== void 0, S = g ? v : A, f = c.useRef(/* @__PURE__ */ new Map()), U = (e) => {
|
|
7
|
+
x || T(e), o == null || o(e);
|
|
8
|
+
}, m = (e) => {
|
|
9
|
+
U(l.includes(e) ? l.filter((t) => t !== e) : [...l, e]);
|
|
10
|
+
}, w = (e) => {
|
|
11
|
+
e.item.disabled || (g || E(e.item.id), u == null || u(e.item.id, e.item));
|
|
12
|
+
}, r = [], y = (e, t, a, i) => {
|
|
13
|
+
var d;
|
|
14
|
+
for (const s of e) {
|
|
15
|
+
if (!i) continue;
|
|
16
|
+
const k = !!((d = s.children) != null && d.length), L = { item: s, level: t, hasChildren: k, parentIds: a };
|
|
17
|
+
r.push(L), k && l.includes(s.id) && y(s.children, t + 1, [...a, s.id], i && l.includes(s.id));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
y(D, 1, [], !0);
|
|
21
|
+
const n = (e) => {
|
|
22
|
+
var t;
|
|
23
|
+
(t = f.current.get(e)) == null || t.focus();
|
|
24
|
+
}, K = (e, t) => {
|
|
25
|
+
const a = r.findIndex((i) => i.item.id === t.item.id);
|
|
26
|
+
switch (e.key) {
|
|
27
|
+
case "ArrowDown":
|
|
28
|
+
a < r.length - 1 && (e.preventDefault(), n(r[a + 1].item.id));
|
|
29
|
+
break;
|
|
30
|
+
case "ArrowUp":
|
|
31
|
+
a > 0 && (e.preventDefault(), n(r[a - 1].item.id));
|
|
32
|
+
break;
|
|
33
|
+
case "ArrowRight":
|
|
34
|
+
if (e.preventDefault(), t.hasChildren && !l.includes(t.item.id)) m(t.item.id);
|
|
35
|
+
else if (t.hasChildren) {
|
|
36
|
+
const i = r.find((d) => d.parentIds[d.parentIds.length - 1] === t.item.id);
|
|
37
|
+
i && n(i.item.id);
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
case "ArrowLeft":
|
|
41
|
+
if (e.preventDefault(), t.hasChildren && l.includes(t.item.id)) m(t.item.id);
|
|
42
|
+
else {
|
|
43
|
+
const i = t.parentIds[t.parentIds.length - 1];
|
|
44
|
+
i && n(i);
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
case "Home":
|
|
48
|
+
r.length && (e.preventDefault(), n(r[0].item.id));
|
|
49
|
+
break;
|
|
50
|
+
case "End":
|
|
51
|
+
r.length && (e.preventDefault(), n(r[r.length - 1].item.id));
|
|
52
|
+
break;
|
|
53
|
+
case "Enter":
|
|
54
|
+
case " ":
|
|
55
|
+
e.preventDefault(), w(t);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ p(
|
|
60
|
+
"ul",
|
|
61
|
+
{
|
|
62
|
+
ref: V,
|
|
63
|
+
role: "tree",
|
|
64
|
+
"aria-label": N,
|
|
65
|
+
className: h("prui-tree-view flex flex-col gap-0.5 text-sm", R),
|
|
66
|
+
children: r.map((e) => {
|
|
67
|
+
const t = l.includes(e.item.id), a = S === e.item.id;
|
|
68
|
+
return /* @__PURE__ */ p(
|
|
69
|
+
"li",
|
|
70
|
+
{
|
|
71
|
+
role: "treeitem",
|
|
72
|
+
"aria-level": e.level,
|
|
73
|
+
"aria-expanded": e.hasChildren ? t : void 0,
|
|
74
|
+
"aria-selected": a,
|
|
75
|
+
"aria-disabled": e.item.disabled || void 0,
|
|
76
|
+
className: "rounded-[var(--prui-radius-1)]",
|
|
77
|
+
style: { paddingInlineStart: `${(e.level - 1) * 16}px` },
|
|
78
|
+
children: /* @__PURE__ */ M(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
type: "button",
|
|
82
|
+
ref: (i) => {
|
|
83
|
+
i ? f.current.set(e.item.id, i) : f.current.delete(e.item.id);
|
|
84
|
+
},
|
|
85
|
+
tabIndex: a ? 0 : -1,
|
|
86
|
+
disabled: e.item.disabled,
|
|
87
|
+
"data-selected": a || void 0,
|
|
88
|
+
onClick: () => {
|
|
89
|
+
e.hasChildren && m(e.item.id), w(e);
|
|
90
|
+
},
|
|
91
|
+
onKeyDown: (i) => K(i, e),
|
|
92
|
+
className: h(
|
|
93
|
+
"flex w-full cursor-pointer items-center gap-1.5 rounded-[var(--prui-radius-1)] px-2 py-1 text-left outline-none",
|
|
94
|
+
"focus-visible:ring-2 focus-visible:ring-[var(--prui-brand)]",
|
|
95
|
+
a ? "bg-[var(--prui-brand)]/15 text-[var(--prui-brand)]" : "text-[var(--prui-fg)] hover:bg-[var(--prui-raise)]",
|
|
96
|
+
e.item.disabled && "opacity-50 cursor-not-allowed"
|
|
97
|
+
),
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ p(
|
|
100
|
+
H,
|
|
101
|
+
{
|
|
102
|
+
className: h("h-3.5 w-3.5 shrink-0 text-[var(--prui-dim)] transition-transform", t && "rotate-90", !e.hasChildren && "invisible"),
|
|
103
|
+
"aria-hidden": !0
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
e.item.label
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
},
|
|
111
|
+
e.item.id
|
|
112
|
+
);
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
O.displayName = "TreeView";
|
|
118
|
+
const F = {
|
|
119
|
+
name: "TreeView",
|
|
120
|
+
props: [
|
|
121
|
+
{ name: "items", type: "TreeViewItem[]", default: null, control: "object" },
|
|
122
|
+
{ name: "expanded", type: "string[]", default: "undefined", control: "object" },
|
|
123
|
+
{ name: "defaultExpanded", type: "string[]", default: "[]", control: "object" },
|
|
124
|
+
{ name: "onExpandedChange", type: "(ids: string[]) => void", default: null, control: "none" },
|
|
125
|
+
{ name: "selected", type: "string", default: "undefined", control: "text" },
|
|
126
|
+
{ name: "onSelect", type: "(id, item) => void", default: null, control: "none" },
|
|
127
|
+
{ name: "ariaLabel", type: "string", default: null, control: "text" }
|
|
128
|
+
]
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
O as TreeView,
|
|
132
|
+
F as treeViewPropsMeta
|
|
133
|
+
};
|
package/dist/core.js
CHANGED
|
@@ -1,67 +1,165 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as r } from "./core/cn.js";
|
|
2
2
|
import { resolveSurface as a, withSurface as p } from "./core/surface.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
3
|
+
import { Portal as i, getFocusable as l, isTopOverlay as m, overlayCount as P, overlayPropsMeta as c, pushOverlay as d, removeOverlay as n, useEscapeKey as x, useFocusTrap as M, useInertBackground as f, useOverlay as u, useOverlayStack as g, useReducedMotion as b, useScrollLock as T } from "./core/overlay.js";
|
|
4
|
+
import { endIndex as D, homeIndex as S, moveIndex as v, typeaheadIndex as C } from "./core/list-nav.js";
|
|
5
|
+
import { Button as h, buttonPropsMeta as w } from "./core/button.js";
|
|
6
|
+
import { Input as A, Textarea as B, inputPropsMeta as R, textareaPropsMeta as F } from "./core/input.js";
|
|
7
|
+
import { Label as K, Separator as L, labelPropsMeta as V, separatorPropsMeta as E } from "./core/label.js";
|
|
8
|
+
import { Select as H, SelectContent as U, SelectItem as j, SelectTrigger as q, SelectValue as z, selectPropsMeta as J } from "./core/select.js";
|
|
9
|
+
import { Switch as Q, switchPropsMeta as W } from "./core/switch.js";
|
|
10
|
+
import { Tabs as Y, TabsContent as Z, TabsList as _, TabsTrigger as $, tabsPropsMeta as ee } from "./core/tabs.js";
|
|
11
|
+
import { Avatar as re, Badge as te, Card as ae, CardContent as pe, CardDescription as se, CardFooter as ie, CardHeader as le, CardTitle as me, avatarPropsMeta as Pe, badgePropsMeta as ce, cardPropsMeta as de } from "./core/card.js";
|
|
12
|
+
import { Dialog as xe, DialogBody as Me, DialogContent as fe, DialogDescription as ue, DialogFooter as ge, DialogHeader as be, DialogTitle as Te, dialogBodyPropsMeta as ke, dialogPropsMeta as De } from "./core/dialog.js";
|
|
13
|
+
import { Dropdown as ve, dropdownPropsMeta as Ce } from "./core/dropdown.js";
|
|
14
|
+
import { ScrollArea as he, scrollAreaPropsMeta as we } from "./core/scroll-area.js";
|
|
15
|
+
import { Modal as Ae, confirmModal as Be, confirmModalPropsMeta as Re, modalPropsMeta as Fe } from "./core/modal.js";
|
|
16
|
+
import { computePosition as Ke, useAnchoredPosition as Le } from "./core/anchor.js";
|
|
17
|
+
import { Spinner as Ee, spinnerPropsMeta as Ge } from "./core/spinner.js";
|
|
18
|
+
import { Skeleton as Ue, skeletonPropsMeta as je } from "./core/skeleton.js";
|
|
19
|
+
import { Alert as ze, alertPropsMeta as Je } from "./core/alert.js";
|
|
20
|
+
import { Progress as Qe, progressPropsMeta as We } from "./core/progress.js";
|
|
21
|
+
import { Toaster as Ye, dismissAllToasts as Ze, toast as _e, toastPropsMeta as $e, toasterPropsMeta as eo } from "./core/toast.js";
|
|
22
|
+
import { Tooltip as ro, tooltipPropsMeta as to } from "./core/tooltip.js";
|
|
23
|
+
import { Popover as po, popoverPropsMeta as so } from "./core/popover.js";
|
|
24
|
+
import { Drawer as lo, Sheet as mo, drawerPropsMeta as Po, sheetPropsMeta as co } from "./core/drawer.js";
|
|
25
|
+
import { Checkbox as xo, checkboxPropsMeta as Mo } from "./core/checkbox.js";
|
|
26
|
+
import { Radio as uo, RadioGroup as go, radioGroupPropsMeta as bo } from "./core/radio.js";
|
|
27
|
+
import { Combobox as ko, comboboxPropsMeta as Do } from "./core/combobox.js";
|
|
28
|
+
import { Accordion as vo, AccordionItem as Co, accordionPropsMeta as yo } from "./core/accordion.js";
|
|
29
|
+
import { Breadcrumb as wo, BreadcrumbEllipsis as Io, BreadcrumbItem as Ao, breadcrumbPropsMeta as Bo } from "./core/breadcrumb.js";
|
|
30
|
+
import { TreeView as Fo, treeViewPropsMeta as Oo } from "./core/tree-view.js";
|
|
31
|
+
import { Timeline as Lo, timelinePropsMeta as Vo } from "./core/timeline.js";
|
|
32
|
+
import { Calendar as Go, calendarPropsMeta as Ho, fromDateKey as Uo, toDateKey as jo } from "./core/calendar.js";
|
|
33
|
+
import { DatePicker as zo, DateRangePicker as Jo, datePickerPropsMeta as No, dateRangePickerPropsMeta as Qo } from "./core/date-picker.js";
|
|
34
|
+
import { TimePanel as Xo, TimePicker as Yo, TimeRangePicker as Zo, timePickerPropsMeta as _o, timeRangePickerPropsMeta as $o } from "./core/time-picker.js";
|
|
35
|
+
import { FileUpload as or, fileUploadPropsMeta as rr } from "./core/file-upload.js";
|
|
14
36
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
i as
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
vo as Accordion,
|
|
38
|
+
Co as AccordionItem,
|
|
39
|
+
ze as Alert,
|
|
40
|
+
re as Avatar,
|
|
41
|
+
te as Badge,
|
|
42
|
+
wo as Breadcrumb,
|
|
43
|
+
Io as BreadcrumbEllipsis,
|
|
44
|
+
Ao as BreadcrumbItem,
|
|
45
|
+
h as Button,
|
|
46
|
+
Go as Calendar,
|
|
47
|
+
ae as Card,
|
|
48
|
+
pe as CardContent,
|
|
49
|
+
se as CardDescription,
|
|
50
|
+
ie as CardFooter,
|
|
51
|
+
le as CardHeader,
|
|
52
|
+
me as CardTitle,
|
|
53
|
+
xo as Checkbox,
|
|
54
|
+
ko as Combobox,
|
|
55
|
+
zo as DatePicker,
|
|
56
|
+
Jo as DateRangePicker,
|
|
57
|
+
xe as Dialog,
|
|
58
|
+
Me as DialogBody,
|
|
59
|
+
fe as DialogContent,
|
|
60
|
+
ue as DialogDescription,
|
|
61
|
+
ge as DialogFooter,
|
|
62
|
+
be as DialogHeader,
|
|
63
|
+
Te as DialogTitle,
|
|
64
|
+
lo as Drawer,
|
|
65
|
+
ve as Dropdown,
|
|
66
|
+
or as FileUpload,
|
|
67
|
+
A as Input,
|
|
68
|
+
K as Label,
|
|
69
|
+
Ae as Modal,
|
|
70
|
+
po as Popover,
|
|
71
|
+
i as Portal,
|
|
72
|
+
Qe as Progress,
|
|
73
|
+
uo as Radio,
|
|
74
|
+
go as RadioGroup,
|
|
75
|
+
he as ScrollArea,
|
|
76
|
+
H as Select,
|
|
77
|
+
U as SelectContent,
|
|
78
|
+
j as SelectItem,
|
|
79
|
+
q as SelectTrigger,
|
|
80
|
+
z as SelectValue,
|
|
81
|
+
L as Separator,
|
|
82
|
+
mo as Sheet,
|
|
83
|
+
Ue as Skeleton,
|
|
84
|
+
Ee as Spinner,
|
|
85
|
+
Q as Switch,
|
|
86
|
+
Y as Tabs,
|
|
87
|
+
Z as TabsContent,
|
|
88
|
+
_ as TabsList,
|
|
89
|
+
$ as TabsTrigger,
|
|
90
|
+
B as Textarea,
|
|
91
|
+
Xo as TimePanel,
|
|
92
|
+
Yo as TimePicker,
|
|
93
|
+
Zo as TimeRangePicker,
|
|
94
|
+
Lo as Timeline,
|
|
95
|
+
Ye as Toaster,
|
|
96
|
+
ro as Tooltip,
|
|
97
|
+
Fo as TreeView,
|
|
98
|
+
yo as accordionPropsMeta,
|
|
99
|
+
Je as alertPropsMeta,
|
|
100
|
+
Pe as avatarPropsMeta,
|
|
101
|
+
ce as badgePropsMeta,
|
|
102
|
+
Bo as breadcrumbPropsMeta,
|
|
103
|
+
w as buttonPropsMeta,
|
|
104
|
+
Ho as calendarPropsMeta,
|
|
105
|
+
de as cardPropsMeta,
|
|
106
|
+
Mo as checkboxPropsMeta,
|
|
107
|
+
r as cn,
|
|
108
|
+
Do as comboboxPropsMeta,
|
|
109
|
+
Ke as computePosition,
|
|
110
|
+
Be as confirmModal,
|
|
111
|
+
Re as confirmModalPropsMeta,
|
|
112
|
+
No as datePickerPropsMeta,
|
|
113
|
+
Qo as dateRangePickerPropsMeta,
|
|
114
|
+
ke as dialogBodyPropsMeta,
|
|
115
|
+
De as dialogPropsMeta,
|
|
116
|
+
Ze as dismissAllToasts,
|
|
117
|
+
Po as drawerPropsMeta,
|
|
118
|
+
Ce as dropdownPropsMeta,
|
|
119
|
+
D as endIndex,
|
|
120
|
+
rr as fileUploadPropsMeta,
|
|
121
|
+
Uo as fromDateKey,
|
|
122
|
+
l as getFocusable,
|
|
123
|
+
S as homeIndex,
|
|
124
|
+
R as inputPropsMeta,
|
|
125
|
+
m as isTopOverlay,
|
|
126
|
+
V as labelPropsMeta,
|
|
127
|
+
Fe as modalPropsMeta,
|
|
128
|
+
v as moveIndex,
|
|
129
|
+
P as overlayCount,
|
|
130
|
+
c as overlayPropsMeta,
|
|
131
|
+
so as popoverPropsMeta,
|
|
132
|
+
We as progressPropsMeta,
|
|
133
|
+
d as pushOverlay,
|
|
134
|
+
bo as radioGroupPropsMeta,
|
|
135
|
+
n as removeOverlay,
|
|
59
136
|
a as resolveSurface,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
137
|
+
we as scrollAreaPropsMeta,
|
|
138
|
+
J as selectPropsMeta,
|
|
139
|
+
E as separatorPropsMeta,
|
|
140
|
+
co as sheetPropsMeta,
|
|
141
|
+
je as skeletonPropsMeta,
|
|
142
|
+
Ge as spinnerPropsMeta,
|
|
143
|
+
W as switchPropsMeta,
|
|
144
|
+
ee as tabsPropsMeta,
|
|
145
|
+
F as textareaPropsMeta,
|
|
146
|
+
_o as timePickerPropsMeta,
|
|
147
|
+
$o as timeRangePickerPropsMeta,
|
|
148
|
+
Vo as timelinePropsMeta,
|
|
149
|
+
jo as toDateKey,
|
|
150
|
+
_e as toast,
|
|
151
|
+
$e as toastPropsMeta,
|
|
152
|
+
eo as toasterPropsMeta,
|
|
153
|
+
to as tooltipPropsMeta,
|
|
154
|
+
Oo as treeViewPropsMeta,
|
|
155
|
+
C as typeaheadIndex,
|
|
156
|
+
Le as useAnchoredPosition,
|
|
157
|
+
x as useEscapeKey,
|
|
158
|
+
M as useFocusTrap,
|
|
159
|
+
f as useInertBackground,
|
|
160
|
+
u as useOverlay,
|
|
161
|
+
g as useOverlayStack,
|
|
162
|
+
b as useReducedMotion,
|
|
163
|
+
T as useScrollLock,
|
|
66
164
|
p as withSurface
|
|
67
165
|
};
|
|
@@ -4,6 +4,10 @@ import * as React from "react";
|
|
|
4
4
|
* DataTable family: column config, sorting, cursor pagination.
|
|
5
5
|
* Callers provide rows plus an optional cursor contract; filtering helpers
|
|
6
6
|
* live in the toolbar/filter components.
|
|
7
|
+
*
|
|
8
|
+
* Enterprise additions: row selection (with a checkbox column), expandable
|
|
9
|
+
* rows (renderExpandedRow), memoized row rendering, and an opt-in windowed
|
|
10
|
+
* rendering mode (virtualized) for very large row sets.
|
|
7
11
|
*/
|
|
8
12
|
export type SortDirection = "asc" | "desc";
|
|
9
13
|
export interface Column<T> {
|
|
@@ -41,7 +45,24 @@ export interface DataTableProps<T> {
|
|
|
41
45
|
loading?: boolean;
|
|
42
46
|
emptyMessage?: React.ReactNode;
|
|
43
47
|
onRowClick?: (row: T, index: number) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Row selection: renders a checkbox column. `true` = multiple selection,
|
|
50
|
+
* `{ multiple: false }` = single.
|
|
51
|
+
*/
|
|
52
|
+
selectable?: boolean | {
|
|
53
|
+
multiple?: boolean;
|
|
54
|
+
};
|
|
55
|
+
/** Selected row keys (controlled). */
|
|
56
|
+
selectedRowKeys?: (string | number)[];
|
|
57
|
+
onSelectionChange?: (keys: (string | number)[], rows: T[]) => void;
|
|
58
|
+
/** Expandable rows: renders an expander column and this content when open. */
|
|
59
|
+
renderExpandedRow?: (row: T) => React.ReactNode;
|
|
60
|
+
/** Expanded row keys (controlled). */
|
|
61
|
+
expandedRowKeys?: (string | number)[];
|
|
62
|
+
onExpandedRowsChange?: (keys: (string | number)[]) => void;
|
|
63
|
+
/** Window-render large row sets (render only the visible slice + spacers). */
|
|
64
|
+
virtualized?: boolean;
|
|
44
65
|
className?: string;
|
|
45
66
|
}
|
|
46
|
-
export declare function DataTable<T extends Record<string, unknown>>({ columns, rows, rowKey, sort: sortProp, onSortChange, defaultSort, loading, emptyMessage, onRowClick, className, }: DataTableProps<T>): React.JSX.Element;
|
|
67
|
+
export declare function DataTable<T extends Record<string, unknown>>({ columns, rows, rowKey, sort: sortProp, onSortChange, defaultSort, loading, emptyMessage, onRowClick, selectable, selectedRowKeys, onSelectionChange, renderExpandedRow, expandedRowKeys, onExpandedRowsChange, virtualized, className, }: DataTableProps<T>): React.JSX.Element;
|
|
47
68
|
export declare const dataTablePropsMeta: PropsMeta;
|
package/dist/data-table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as t, a as r, b as s, c as l, d as i, F as o, N as b, P as T, T as F, e as n, f as P, g } from "./chunks/data-table-toolbar-
|
|
1
|
+
import { D as t, a as r, b as s, c as l, d as i, F as o, N as b, P as T, T as F, e as n, f as P, g } from "./chunks/data-table-toolbar-B-5J2Ozl.js";
|
|
2
2
|
export {
|
|
3
3
|
t as DataTable,
|
|
4
4
|
r as DataTablePagination,
|
package/dist/forms/form.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ export interface FormProps {
|
|
|
15
15
|
validateOnChange?: boolean;
|
|
16
16
|
className?: string;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Registry-driven form (deprecated).
|
|
20
|
+
*
|
|
21
|
+
* @deprecated Superseded by the schema-driven Form from `@skiddph/prui/app`.
|
|
22
|
+
* This implementation keeps working (FormButton, the form registry, and
|
|
23
|
+
* cross-scope control all remain); it will not be removed before v2.
|
|
24
|
+
* See the docs Forms page for migration notes.
|
|
25
|
+
*/
|
|
18
26
|
export declare function Form({ id, children, schema, initialValues, onSubmit, onReset, validateOnChange, className }: FormProps): React.JSX.Element;
|
|
19
27
|
export interface FormGroupProps {
|
|
20
28
|
label?: string;
|