@pibit.ai/cure-design-system 0.6.44 → 0.6.46
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/_virtual/index.js +3 -2
- package/dist/_virtual/index2.js +2 -3
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +345 -331
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/patterns/section-scroll-hint/index.d.ts +2 -0
- package/dist/patterns/section-scroll-hint/index.d.ts.map +1 -0
- package/dist/patterns/section-scroll-hint/section-scroll-hint-row.d.ts +15 -0
- package/dist/patterns/section-scroll-hint/section-scroll-hint-row.d.ts.map +1 -0
- package/dist/patterns/section-scroll-hint/section-scroll-hint-row.js +170 -0
- package/dist/patterns/table/index.d.ts +2 -2
- package/dist/patterns/table/index.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/TableToolbar.d.ts +3 -0
- package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/TableToolbar.js +137 -134
- package/dist/patterns/table/toolbar/ToolbarRefreshButton.d.ts +12 -0
- package/dist/patterns/table/toolbar/ToolbarRefreshButton.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ToolbarRefreshButton.js +20 -0
- package/dist/patterns/table/toolbar/index.d.ts +1 -0
- package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
- package/dist/primitives/avatar/avatar-label-group.d.ts +9 -0
- package/dist/primitives/avatar/avatar-label-group.d.ts.map +1 -0
- package/dist/primitives/avatar/avatar-label-group.js +40 -0
- package/dist/primitives/avatar/get-initials.d.ts +11 -0
- package/dist/primitives/avatar/get-initials.d.ts.map +1 -0
- package/dist/primitives/avatar/get-initials.js +9 -0
- package/dist/primitives/avatar/index.d.ts +2 -0
- package/dist/primitives/avatar/index.d.ts.map +1 -1
- package/dist/primitives/loading-dots/index.d.ts +2 -0
- package/dist/primitives/loading-dots/index.d.ts.map +1 -0
- package/dist/primitives/loading-dots/loading-dots.d.ts +13 -0
- package/dist/primitives/loading-dots/loading-dots.d.ts.map +1 -0
- package/dist/primitives/loading-dots/loading-dots.js +22 -0
- package/dist/primitives/score-indicator/index.d.ts +2 -0
- package/dist/primitives/score-indicator/index.d.ts.map +1 -0
- package/dist/primitives/score-indicator/score-indicator.d.ts +8 -0
- package/dist/primitives/score-indicator/score-indicator.d.ts.map +1 -0
- package/dist/primitives/score-indicator/score-indicator.js +56 -0
- package/dist/primitives/scroll-container/index.d.ts +2 -0
- package/dist/primitives/scroll-container/index.d.ts.map +1 -0
- package/dist/primitives/scroll-container/scroll-container.d.ts +22 -0
- package/dist/primitives/scroll-container/scroll-container.d.ts.map +1 -0
- package/dist/primitives/scroll-container/scroll-container.js +63 -0
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { FlipBackward as
|
|
1
|
+
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as N, isValidElement as F, cloneElement as P, useRef as k, useState as W, useEffect as M, useLayoutEffect as K } from "react";
|
|
3
|
+
import { FlipBackward as T, FlipForward as G, ChevronSelectorVertical as _, DotsHorizontal as $ } from "@untitledui/icons";
|
|
4
4
|
import { cx as j } from "../../../utils/cn.js";
|
|
5
|
-
import { AlignDropdown as
|
|
6
|
-
import { GroupByDropdown as
|
|
7
|
-
import { HideFieldsDropdown as
|
|
8
|
-
import { RowHeightDropdown as
|
|
9
|
-
import { ShowSummaryDropdown as
|
|
10
|
-
import { resolveColumnLabel as
|
|
11
|
-
import { useUndoRedoShortcuts as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
5
|
+
import { AlignDropdown as q } from "./AlignDropdown.js";
|
|
6
|
+
import { GroupByDropdown as J } from "./GroupByDropdown.js";
|
|
7
|
+
import { HideFieldsDropdown as Q } from "./HideFieldsDropdown.js";
|
|
8
|
+
import { RowHeightDropdown as X } from "./RowHeightDropdown.js";
|
|
9
|
+
import { ShowSummaryDropdown as Y } from "./ShowSummaryDropdown.js";
|
|
10
|
+
import { resolveColumnLabel as Z } from "./tableToolbarHelpers.js";
|
|
11
|
+
import { useUndoRedoShortcuts as E } from "./useUndoRedoShortcuts.js";
|
|
12
|
+
import { ToolbarRefreshButton as ee } from "./ToolbarRefreshButton.js";
|
|
13
|
+
import { TableViewDirtyActions as ne } from "./TableViewDirtyActions.js";
|
|
14
|
+
import { hasSavedOrSharedViews as oe, TableViewsDropdown as re } from "./TableViewsDropdown.js";
|
|
15
|
+
import { ExpandableSearchInput as ie } from "../../../primitives/select/ExpandableSearchInput.js";
|
|
16
|
+
import { Button as A } from "../../../primitives/button/button.js";
|
|
17
|
+
import { Dropdown as S } from "../../../primitives/dropdown/dropdown.js";
|
|
18
|
+
import { Icon as te } from "../../../primitives/icon/icon.js";
|
|
19
|
+
function se(e, t) {
|
|
19
20
|
return F(e) ? P(e, {
|
|
20
21
|
onApply: t.onApply,
|
|
21
22
|
onClear: t.onClear,
|
|
22
23
|
clearAllSorts: t.onClear
|
|
23
24
|
}) : e;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function le(e, t) {
|
|
26
27
|
return F(e) ? P(e, {
|
|
27
28
|
onApply: t.onApply,
|
|
28
29
|
onClearAll: t.onClearAll
|
|
29
30
|
}) : e;
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
+
const ae = ({ config: e }) => (E({
|
|
32
33
|
enabled: e.shortcut ?? !0,
|
|
33
34
|
canUndo: e.canUndo,
|
|
34
35
|
canRedo: e.canRedo,
|
|
35
36
|
onUndo: e.onUndo,
|
|
36
37
|
onRedo: e.onRedo,
|
|
37
38
|
isDisabled: e.isDisabled
|
|
38
|
-
}), /* @__PURE__ */
|
|
39
|
+
}), /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
39
40
|
/* @__PURE__ */ n(
|
|
40
|
-
|
|
41
|
+
A,
|
|
41
42
|
{
|
|
42
43
|
size: "xs",
|
|
43
44
|
color: "secondary",
|
|
44
|
-
iconLeading: /* @__PURE__ */ n(
|
|
45
|
+
iconLeading: /* @__PURE__ */ n(T, { size: 16 }),
|
|
45
46
|
"aria-label": "Undo",
|
|
46
47
|
title: "Undo",
|
|
47
48
|
isDisabled: e.isDisabled || !e.canUndo,
|
|
@@ -49,7 +50,7 @@ const se = ({ config: e }) => (Z({
|
|
|
49
50
|
}
|
|
50
51
|
),
|
|
51
52
|
/* @__PURE__ */ n(
|
|
52
|
-
|
|
53
|
+
A,
|
|
53
54
|
{
|
|
54
55
|
size: "xs",
|
|
55
56
|
color: "secondary",
|
|
@@ -60,10 +61,10 @@ const se = ({ config: e }) => (Z({
|
|
|
60
61
|
onClick: e.onRedo
|
|
61
62
|
}
|
|
62
63
|
)
|
|
63
|
-
] })),
|
|
64
|
+
] })), de = ({ config: e, content: t, isDisabled: d }) => {
|
|
64
65
|
const i = e.sorts.some((s) => s.field !== "" && s.direction !== "");
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
|
|
66
|
+
return /* @__PURE__ */ f(
|
|
67
|
+
S.Root,
|
|
67
68
|
{
|
|
68
69
|
isOpen: e.isOpen,
|
|
69
70
|
onOpenChange: (s) => {
|
|
@@ -72,13 +73,13 @@ const se = ({ config: e }) => (Z({
|
|
|
72
73
|
), e.onOpenChange(s);
|
|
73
74
|
},
|
|
74
75
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
76
|
+
/* @__PURE__ */ f(
|
|
77
|
+
A,
|
|
77
78
|
{
|
|
78
79
|
size: "xs",
|
|
79
80
|
color: "secondary",
|
|
80
81
|
isDisabled: d,
|
|
81
|
-
iconLeading: /* @__PURE__ */ n(
|
|
82
|
+
iconLeading: /* @__PURE__ */ n(_, { size: 12 }),
|
|
82
83
|
className: j(
|
|
83
84
|
i && "ring-1 ring-brand-600 bg-brand-primary text-brand-600 hover:bg-brand-primary hover:text-brand-600"
|
|
84
85
|
),
|
|
@@ -88,20 +89,20 @@ const se = ({ config: e }) => (Z({
|
|
|
88
89
|
]
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
|
-
/* @__PURE__ */ n(
|
|
92
|
+
/* @__PURE__ */ n(S.Popover, { className: "w-auto min-w-[300px]", children: t })
|
|
92
93
|
]
|
|
93
94
|
}
|
|
94
95
|
);
|
|
95
|
-
},
|
|
96
|
+
}, ce = ({ config: e, content: t, isDisabled: d }) => {
|
|
96
97
|
const i = e.meaningfulConditionsCount > 0;
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
98
|
+
return /* @__PURE__ */ f(S.Root, { isOpen: e.isOpen, onOpenChange: e.onOpenChange, children: [
|
|
99
|
+
/* @__PURE__ */ f(
|
|
100
|
+
A,
|
|
100
101
|
{
|
|
101
102
|
size: "xs",
|
|
102
103
|
color: "secondary",
|
|
103
104
|
isDisabled: d,
|
|
104
|
-
iconLeading: /* @__PURE__ */ n(
|
|
105
|
+
iconLeading: /* @__PURE__ */ n(te, { name: "FilterLines", size: 12 }),
|
|
105
106
|
className: j(
|
|
106
107
|
i && "ring-1 ring-brand-600 bg-brand-primary text-brand-600 hover:bg-brand-primary hover:text-brand-600"
|
|
107
108
|
),
|
|
@@ -111,105 +112,106 @@ const se = ({ config: e }) => (Z({
|
|
|
111
112
|
]
|
|
112
113
|
}
|
|
113
114
|
),
|
|
114
|
-
/* @__PURE__ */ n(
|
|
115
|
+
/* @__PURE__ */ n(S.Popover, { className: "w-auto min-w-[300px]", children: t })
|
|
115
116
|
] });
|
|
116
|
-
},
|
|
117
|
+
}, Le = ({
|
|
117
118
|
className: e,
|
|
118
119
|
fallbackTitle: t,
|
|
119
120
|
undoRedo: d,
|
|
120
121
|
sort: i,
|
|
121
122
|
filter: s,
|
|
122
123
|
search: c,
|
|
123
|
-
rowHeight:
|
|
124
|
-
hideFields:
|
|
125
|
-
align:
|
|
126
|
-
groupBy:
|
|
127
|
-
summary:
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
rowHeight: g,
|
|
125
|
+
hideFields: b,
|
|
126
|
+
align: y,
|
|
127
|
+
groupBy: m,
|
|
128
|
+
summary: x,
|
|
129
|
+
refresh: O,
|
|
130
|
+
beforeSearch: v,
|
|
131
|
+
trailing: L,
|
|
130
132
|
searchCollapsible: U,
|
|
131
133
|
disableExtendedTools: a = !1,
|
|
132
|
-
isEditMode:
|
|
133
|
-
sortContent:
|
|
134
|
-
filterContent:
|
|
134
|
+
isEditMode: p = !0,
|
|
135
|
+
sortContent: o,
|
|
136
|
+
filterContent: l,
|
|
135
137
|
views: r
|
|
136
138
|
}) => {
|
|
137
|
-
const
|
|
138
|
-
() => i &&
|
|
139
|
-
[i,
|
|
140
|
-
), D =
|
|
141
|
-
() => s &&
|
|
142
|
-
[s,
|
|
143
|
-
),
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
|
|
139
|
+
const C = N(
|
|
140
|
+
() => i && o ? se(o, i) : o,
|
|
141
|
+
[i, o]
|
|
142
|
+
), D = N(
|
|
143
|
+
() => s && l ? le(l, s) : l,
|
|
144
|
+
[s, l]
|
|
145
|
+
), u = N(() => {
|
|
146
|
+
const h = [];
|
|
147
|
+
if (p && d && h.push({ id: "undo-redo", node: /* @__PURE__ */ n(ae, { config: d }) }), i && C) {
|
|
148
|
+
const w = i.sorts.some((I) => I.field !== "" && I.direction !== "");
|
|
149
|
+
h.push({
|
|
148
150
|
id: "sort",
|
|
149
|
-
widthKey:
|
|
151
|
+
widthKey: w ? String(i.sorts.length) : "",
|
|
150
152
|
node: /* @__PURE__ */ n(
|
|
151
|
-
|
|
153
|
+
de,
|
|
152
154
|
{
|
|
153
155
|
config: i,
|
|
154
|
-
content:
|
|
156
|
+
content: C,
|
|
155
157
|
isDisabled: a
|
|
156
158
|
}
|
|
157
159
|
)
|
|
158
160
|
});
|
|
159
161
|
}
|
|
160
|
-
if (s && D &&
|
|
162
|
+
if (s && D && h.push({
|
|
161
163
|
id: "filter",
|
|
162
164
|
widthKey: s.meaningfulConditionsCount > 0 ? String(s.meaningfulConditionsCount) : "",
|
|
163
165
|
node: /* @__PURE__ */ n(
|
|
164
|
-
|
|
166
|
+
ce,
|
|
165
167
|
{
|
|
166
168
|
config: s,
|
|
167
169
|
content: D,
|
|
168
170
|
isDisabled: a
|
|
169
171
|
}
|
|
170
172
|
)
|
|
171
|
-
}),
|
|
173
|
+
}), p && g && h.push({
|
|
172
174
|
id: "row-height",
|
|
173
|
-
node: /* @__PURE__ */ n(
|
|
174
|
-
}),
|
|
175
|
+
node: /* @__PURE__ */ n(X, { ...g, isDisabled: a })
|
|
176
|
+
}), b && h.push({
|
|
175
177
|
id: "hide-fields",
|
|
176
|
-
widthKey:
|
|
177
|
-
node: /* @__PURE__ */ n(
|
|
178
|
-
}),
|
|
179
|
-
const
|
|
180
|
-
|
|
178
|
+
widthKey: b.hiddenColumns.size > 0 ? String(b.hiddenColumns.size) : "",
|
|
179
|
+
node: /* @__PURE__ */ n(Q, { ...b, isDisabled: a })
|
|
180
|
+
}), y && h.push({ id: "align", node: /* @__PURE__ */ n(q, { ...y, isDisabled: a }) }), p && m) {
|
|
181
|
+
const w = m.value ? m.schema.find((H) => H.value === m.value) : void 0, I = w ? Z(w, m.labelMeta) : "";
|
|
182
|
+
h.push({
|
|
181
183
|
id: "group-by",
|
|
182
|
-
widthKey:
|
|
183
|
-
node: /* @__PURE__ */ n(
|
|
184
|
+
widthKey: I,
|
|
185
|
+
node: /* @__PURE__ */ n(J, { ...m, isDisabled: a })
|
|
184
186
|
});
|
|
185
187
|
}
|
|
186
|
-
return
|
|
188
|
+
return p && x && h.push({
|
|
187
189
|
id: "summary",
|
|
188
|
-
node: /* @__PURE__ */ n(
|
|
189
|
-
}),
|
|
190
|
+
node: /* @__PURE__ */ n(Y, { ...x, isDisabled: a })
|
|
191
|
+
}), v && h.push({ id: "zoom", node: v }), h;
|
|
190
192
|
}, [
|
|
191
193
|
d,
|
|
192
194
|
i,
|
|
193
|
-
|
|
195
|
+
C,
|
|
194
196
|
s,
|
|
195
197
|
D,
|
|
198
|
+
g,
|
|
199
|
+
b,
|
|
200
|
+
y,
|
|
201
|
+
m,
|
|
196
202
|
x,
|
|
197
|
-
|
|
198
|
-
N,
|
|
199
|
-
h,
|
|
200
|
-
C,
|
|
201
|
-
A,
|
|
203
|
+
v,
|
|
202
204
|
a,
|
|
203
|
-
|
|
204
|
-
]),
|
|
205
|
-
return /* @__PURE__ */
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
p
|
|
206
|
+
]), z = !!(p && r && (r.onSelectInitial || oe(r.items))), R = p && r && r.dirtyAction !== "none" ? /* @__PURE__ */ n(ne, { config: r, isDisabled: a }) : null, B = z || u.length > 0 || R != null;
|
|
207
|
+
return /* @__PURE__ */ f("div", { className: j("flex justify-between items-center gap-2", e), children: [
|
|
208
|
+
B ? /* @__PURE__ */ f("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
209
|
+
z && r && /* @__PURE__ */ n(re, { config: r, isDisabled: a }),
|
|
210
|
+
u.length > 0 ? /* @__PURE__ */ n(me, { items: u, suffix: R }) : R
|
|
209
211
|
] }) : t ? /* @__PURE__ */ n("h4", { className: "text-sm font-normal text-secondary", children: t }) : /* @__PURE__ */ n("div", {}),
|
|
210
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ f("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
211
213
|
c && /* @__PURE__ */ n(
|
|
212
|
-
|
|
214
|
+
ie,
|
|
213
215
|
{
|
|
214
216
|
size: "sm",
|
|
215
217
|
placeholder: "Search",
|
|
@@ -220,103 +222,104 @@ const se = ({ config: e }) => (Z({
|
|
|
220
222
|
shortcut: c.shortcut
|
|
221
223
|
}
|
|
222
224
|
),
|
|
223
|
-
|
|
225
|
+
O && /* @__PURE__ */ n(ee, { config: O }),
|
|
226
|
+
L
|
|
224
227
|
] })
|
|
225
228
|
] });
|
|
226
|
-
},
|
|
229
|
+
}, he = 40, V = 8, me = ({
|
|
227
230
|
items: e,
|
|
228
231
|
suffix: t
|
|
229
232
|
}) => {
|
|
230
|
-
const d = k(null), i = k(null), s = k(/* @__PURE__ */ new Map()), [c,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}, [
|
|
233
|
+
const d = k(null), i = k(null), s = k(/* @__PURE__ */ new Map()), [c, g] = W(() => /* @__PURE__ */ new Map()), [b, y] = W(null), [m, x] = W(0), O = N(() => e.map((o) => `${o.id}:${o.widthKey ?? ""}`).join("|"), [e]);
|
|
234
|
+
M(() => {
|
|
235
|
+
g(/* @__PURE__ */ new Map());
|
|
236
|
+
}, [O]), K(() => {
|
|
234
237
|
if (c.size === e.length) return;
|
|
235
238
|
const o = /* @__PURE__ */ new Map();
|
|
236
|
-
for (const
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
+
for (const l of e) {
|
|
240
|
+
const r = s.current.get(l.id);
|
|
241
|
+
r && o.set(l.id, r.getBoundingClientRect().width);
|
|
239
242
|
}
|
|
240
|
-
o.size === e.length &&
|
|
243
|
+
o.size === e.length && g(o);
|
|
241
244
|
}, [e, c]), K(() => {
|
|
242
245
|
const o = d.current;
|
|
243
246
|
if (!o) return;
|
|
244
|
-
const
|
|
245
|
-
d.current &&
|
|
247
|
+
const l = () => {
|
|
248
|
+
d.current && y(d.current.clientWidth);
|
|
246
249
|
};
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
return
|
|
250
|
+
l();
|
|
251
|
+
const r = new ResizeObserver(l);
|
|
252
|
+
return r.observe(o), () => r.disconnect();
|
|
250
253
|
}, []), K(() => {
|
|
251
254
|
const o = i.current;
|
|
252
255
|
if (!o) {
|
|
253
|
-
|
|
256
|
+
x(0);
|
|
254
257
|
return;
|
|
255
258
|
}
|
|
256
|
-
const
|
|
257
|
-
i.current &&
|
|
259
|
+
const l = () => {
|
|
260
|
+
i.current && x(i.current.getBoundingClientRect().width);
|
|
258
261
|
};
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
return
|
|
262
|
+
l();
|
|
263
|
+
const r = new ResizeObserver(l);
|
|
264
|
+
return r.observe(o), () => r.disconnect();
|
|
262
265
|
}, [t]);
|
|
263
|
-
const
|
|
264
|
-
if (!
|
|
266
|
+
const v = c.size === e.length, { visibleIds: L, overflowIds: U } = N(() => {
|
|
267
|
+
if (!v || b == null)
|
|
265
268
|
return {
|
|
266
269
|
visibleIds: new Set(e.map((u) => u.id)),
|
|
267
270
|
overflowIds: /* @__PURE__ */ new Set()
|
|
268
271
|
};
|
|
269
|
-
const o =
|
|
270
|
-
let
|
|
271
|
-
const
|
|
272
|
+
const o = m > 0 ? m + V : 0, l = Math.max(0, b - o);
|
|
273
|
+
let r = 0;
|
|
274
|
+
const C = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ new Set();
|
|
272
275
|
for (let u = 0; u < e.length; u++) {
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
275
|
-
for (let
|
|
276
|
+
const z = e[u].id, R = c.get(z) ?? 0, h = e.length - u - 1 > 0 ? he + V : 0;
|
|
277
|
+
if (r + R + h > l) {
|
|
278
|
+
for (let w = u; w < e.length; w++) D.add(e[w].id);
|
|
276
279
|
break;
|
|
277
280
|
}
|
|
278
|
-
|
|
281
|
+
r += R + V, C.add(z);
|
|
279
282
|
}
|
|
280
|
-
return { visibleIds:
|
|
281
|
-
}, [e, c,
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
+
return { visibleIds: C, overflowIds: D };
|
|
284
|
+
}, [e, c, b, v, m]), a = e.filter((o) => L.has(o.id)), p = e.filter((o) => U.has(o.id));
|
|
285
|
+
return /* @__PURE__ */ f(
|
|
283
286
|
"div",
|
|
284
287
|
{
|
|
285
288
|
ref: d,
|
|
286
289
|
className: "flex items-center gap-2 min-w-0 flex-1 overflow-visible",
|
|
287
|
-
style:
|
|
290
|
+
style: v ? void 0 : { visibility: "hidden" },
|
|
288
291
|
children: [
|
|
289
|
-
(
|
|
292
|
+
(v ? a : e).map((o) => /* @__PURE__ */ n(
|
|
290
293
|
"div",
|
|
291
294
|
{
|
|
292
|
-
ref: (
|
|
293
|
-
s.current.set(o.id,
|
|
295
|
+
ref: (l) => {
|
|
296
|
+
s.current.set(o.id, l);
|
|
294
297
|
},
|
|
295
298
|
className: "shrink-0",
|
|
296
299
|
children: o.node
|
|
297
300
|
},
|
|
298
301
|
o.id
|
|
299
302
|
)),
|
|
300
|
-
|
|
303
|
+
v && p.length > 0 && /* @__PURE__ */ f(S.Root, { children: [
|
|
301
304
|
/* @__PURE__ */ n(
|
|
302
|
-
|
|
305
|
+
A,
|
|
303
306
|
{
|
|
304
307
|
size: "xs",
|
|
305
308
|
color: "secondary",
|
|
306
|
-
iconLeading: /* @__PURE__ */ n(
|
|
309
|
+
iconLeading: /* @__PURE__ */ n($, { size: 16 }),
|
|
307
310
|
"aria-label": "More tools",
|
|
308
311
|
title: "More tools",
|
|
309
312
|
className: "shrink-0"
|
|
310
313
|
}
|
|
311
314
|
),
|
|
312
|
-
/* @__PURE__ */ n(
|
|
315
|
+
/* @__PURE__ */ n(S.Popover, { className: "w-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col items-stretch gap-2 p-2 min-w-[180px]", children: p.map((o) => /* @__PURE__ */ n("div", { className: "[&>*]:w-full", children: o.node }, o.id)) }) })
|
|
313
316
|
] }),
|
|
314
317
|
t != null && /* @__PURE__ */ n("div", { ref: i, className: "shrink-0", children: t })
|
|
315
318
|
]
|
|
316
319
|
}
|
|
317
320
|
);
|
|
318
321
|
};
|
|
319
|
-
function
|
|
322
|
+
function Ue(e) {
|
|
320
323
|
return {
|
|
321
324
|
sort: e.sort,
|
|
322
325
|
filter: e.filter,
|
|
@@ -324,6 +327,6 @@ function Oe(e) {
|
|
|
324
327
|
};
|
|
325
328
|
}
|
|
326
329
|
export {
|
|
327
|
-
|
|
328
|
-
|
|
330
|
+
Le as TableToolbar,
|
|
331
|
+
Ue as pickCoreToolbarProps
|
|
329
332
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface RefreshToolConfig {
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
/** Spins the icon and disables the button while the list request is in flight. */
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ToolbarRefreshButton: FC<{
|
|
9
|
+
config: RefreshToolConfig;
|
|
10
|
+
}>;
|
|
11
|
+
export default ToolbarRefreshButton;
|
|
12
|
+
//# sourceMappingURL=ToolbarRefreshButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarRefreshButton.d.ts","sourceRoot":"","sources":["../../../../src/patterns/table/toolbar/ToolbarRefreshButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAUhC,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC;IAAE,MAAM,EAAE,iBAAiB,CAAA;CAAE,CAWlE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { RefreshCw04 as s } from "@untitledui/icons";
|
|
3
|
+
import { ButtonUtility as e } from "../../../primitives/button/button-utility.js";
|
|
4
|
+
const l = ({ config: i }) => /* @__PURE__ */ o(
|
|
5
|
+
e,
|
|
6
|
+
{
|
|
7
|
+
size: "xs",
|
|
8
|
+
color: "tertiary",
|
|
9
|
+
icon: s,
|
|
10
|
+
tooltip: "Refresh",
|
|
11
|
+
"aria-label": "Refresh",
|
|
12
|
+
onClick: i.onClick,
|
|
13
|
+
isDisabled: i.isDisabled || i.isLoading,
|
|
14
|
+
className: i.isLoading ? "[&_svg]:animate-spin" : void 0
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
export {
|
|
18
|
+
l as ToolbarRefreshButton,
|
|
19
|
+
l as default
|
|
20
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { TableToolbar, pickCoreToolbarProps } from './TableToolbar';
|
|
2
|
+
export { ToolbarRefreshButton, type RefreshToolConfig } from './ToolbarRefreshButton';
|
|
2
3
|
export type { TableToolbarProps, SortToolConfig, FilterToolConfig, SearchToolConfig, RowHeightToolConfig, HideFieldsToolConfig, AlignToolConfig, GroupByToolConfig, SummaryToolConfig, UndoRedoToolConfig, } from './TableToolbar';
|
|
3
4
|
export { TableViewsDropdown, hasSavedOrSharedViews } from './TableViewsDropdown';
|
|
4
5
|
export { TableViewDirtyActions } from './TableViewDirtyActions';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/patterns/table/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACpE,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,qBA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BAAqB,CAAC;AACtE,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,SAAS,EACT,kBAAkB,EAClB,8BAA8B,EAC9B,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/patterns/table/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtF,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B,MAA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AAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,SAAS,EACT,kBAAkB,EAClB,8BAA8B,EAC9B,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AvatarProps } from './avatar';
|
|
3
|
+
export interface AvatarLabelGroupProps extends AvatarProps {
|
|
4
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
title: string | ReactNode;
|
|
6
|
+
subtitle: string | ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const AvatarLabelGroup: ({ title, subtitle, className, ...props }: AvatarLabelGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=avatar-label-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar-label-group.d.ts","sourceRoot":"","sources":["../../../src/primitives/avatar/avatar-label-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAWpD,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACvC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,gBAAgB,GAAI,0CAK9B,qBAAqB,4CAoBvB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar as m } from "./avatar.js";
|
|
3
|
+
import { cx as s } from "../../utils/cn.js";
|
|
4
|
+
const i = {
|
|
5
|
+
xs: { root: "gap-2", title: "text-xs", subtitle: "text-xs" },
|
|
6
|
+
sm: { root: "gap-2", title: "text-sm", subtitle: "text-xs" },
|
|
7
|
+
md: { root: "gap-2", title: "text-sm", subtitle: "text-sm" },
|
|
8
|
+
lg: { root: "gap-3", title: "text-md", subtitle: "text-md" },
|
|
9
|
+
xl: { root: "gap-4", title: "text-lg", subtitle: "text-md" }
|
|
10
|
+
}, u = ({
|
|
11
|
+
title: r,
|
|
12
|
+
subtitle: x,
|
|
13
|
+
className: a,
|
|
14
|
+
...t
|
|
15
|
+
}) => /* @__PURE__ */ l(
|
|
16
|
+
"figure",
|
|
17
|
+
{
|
|
18
|
+
className: s(
|
|
19
|
+
"group flex min-w-0 flex-1 items-center",
|
|
20
|
+
i[t.size].root,
|
|
21
|
+
a
|
|
22
|
+
),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ e(m, { ...t }),
|
|
25
|
+
/* @__PURE__ */ l("figcaption", { className: "min-w-0 flex-1", children: [
|
|
26
|
+
/* @__PURE__ */ e("p", { className: s(i[t.size].title), children: r }),
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
"p",
|
|
29
|
+
{
|
|
30
|
+
className: s("truncate text-tertiary", i[t.size].subtitle),
|
|
31
|
+
children: x
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
export {
|
|
39
|
+
u as AvatarLabelGroup
|
|
40
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the initials from a full name, for the `Avatar` `initials` prop.
|
|
3
|
+
*
|
|
4
|
+
* @param name - The full name from which to extract initials.
|
|
5
|
+
* @returns The initials of the provided name. If the name contains only one word,
|
|
6
|
+
* it returns the first character of that word. With `showLastName`, it
|
|
7
|
+
* returns the first character of the first and last words. Returns an
|
|
8
|
+
* empty string if the name is undefined/null/empty.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getInitials: (name: string | undefined | null, showLastName?: boolean) => string;
|
|
11
|
+
//# sourceMappingURL=get-initials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-initials.d.ts","sourceRoot":"","sources":["../../../src/primitives/avatar/get-initials.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,GAAG,SAAS,GAAG,IAAI,EAC/B,eAAc,OAAe,WAS9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const s = (t, p = !1) => {
|
|
2
|
+
if (!t || typeof t != "string" || t.trim().length === 0)
|
|
3
|
+
return "";
|
|
4
|
+
const [e, r] = t.split(" ");
|
|
5
|
+
return p && r ? `${e.charAt(0).toUpperCase()}${r == null ? void 0 : r.charAt(0).toUpperCase()}` : e.charAt(0).toUpperCase();
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
s as getInitials
|
|
9
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/loading-dots/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface LoadingDotsProps {
|
|
2
|
+
/** @default 'Loading' */
|
|
3
|
+
text?: string;
|
|
4
|
+
/** Milliseconds between dot steps. @default 500 */
|
|
5
|
+
speed?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Inline text loader that cycles an ellipsis after the text ("Loading", "Loading.", …).
|
|
10
|
+
* The dots render in an absolutely-positioned span so the text never shifts.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LoadingDots: ({ text, speed, className, }: LoadingDotsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=loading-dots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading-dots.d.ts","sourceRoot":"","sources":["../../../src/primitives/loading-dots/loading-dots.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,6BAIzB,gBAAgB,4CAoBlB,CAAC"}
|