beez-ui 0.6.2 → 0.8.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 +150 -96
- package/README.md +33 -6
- package/dist/components/account-menu.d.ts +53 -0
- package/dist/components/account-menu.js +405 -0
- package/dist/components/alert.js +1 -1
- package/dist/components/animated-collapse.d.ts +19 -0
- package/dist/components/animated-collapse.js +81 -0
- package/dist/components/animated-count.d.ts +13 -0
- package/dist/components/animated-count.js +105 -0
- package/dist/components/animated-list-item.d.ts +25 -0
- package/dist/components/animated-list-item.js +132 -0
- package/dist/components/avatar.d.ts +2 -1
- package/dist/components/avatar.js +4 -3
- package/dist/components/bouncing-dots-loader.d.ts +19 -0
- package/dist/components/bouncing-dots-loader.js +47 -0
- package/dist/components/calendar.js +102 -0
- package/dist/components/carousel.js +61 -48
- package/dist/components/checkbox.js +1 -1
- package/dist/components/confirm-delete-button.d.ts +29 -0
- package/dist/components/confirm-delete-button.js +254 -0
- package/dist/components/data-table.js +34 -4
- package/dist/components/dropdown-menu.js +5 -2
- package/dist/components/empty-state.d.ts +24 -0
- package/dist/components/empty-state.js +37 -0
- package/dist/components/error-state.d.ts +20 -0
- package/dist/components/error-state.js +145 -0
- package/dist/components/external-browser-handoff.d.ts +27 -0
- package/dist/components/external-browser-handoff.js +306 -0
- package/dist/components/file-upload.d.ts +78 -0
- package/dist/components/file-upload.js +678 -0
- package/dist/components/filter-query-bar.js +11 -6
- package/dist/components/form.d.ts +5 -0
- package/dist/components/form.js +11 -9
- package/dist/components/info-popover.d.ts +23 -0
- package/dist/components/info-popover.js +158 -0
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/month-calendar-header.d.ts +65 -0
- package/dist/components/month-calendar-header.js +337 -0
- package/dist/components/month-grid.d.ts +59 -0
- package/dist/components/month-grid.js +301 -0
- package/dist/components/notification-bell.d.ts +50 -0
- package/dist/components/notification-bell.js +338 -0
- package/dist/components/notification-panel.d.ts +56 -0
- package/dist/components/notification-panel.js +281 -0
- package/dist/components/open-in-browser-cta.d.ts +22 -0
- package/dist/components/open-in-browser-cta.js +61 -0
- package/dist/components/pagination.d.ts +1 -0
- package/dist/components/pagination.js +9 -4
- package/dist/components/presence-swap.d.ts +22 -0
- package/dist/components/presence-swap.js +162 -0
- package/dist/components/progress-ring.d.ts +20 -0
- package/dist/components/progress-ring.js +53 -0
- package/dist/components/pwa-update-control.d.ts +18 -0
- package/dist/components/pwa-update-control.js +119 -0
- package/dist/components/radio-group.js +1 -1
- package/dist/components/reaction-button.d.ts +26 -0
- package/dist/components/reaction-button.js +114 -0
- package/dist/components/rich-link-editor.d.ts +25 -0
- package/dist/components/rich-link-editor.js +320 -0
- package/dist/components/rich-markdown-content.d.ts +10 -0
- package/dist/components/rich-markdown-content.js +56 -0
- package/dist/components/rich-text-content.d.ts +19 -0
- package/dist/components/rich-text-content.js +26 -0
- package/dist/components/select.js +1 -1
- package/dist/components/sheet.js +12 -9
- package/dist/components/sidebar.js +9 -5
- package/dist/components/skeleton.d.ts +6 -0
- package/dist/components/skeleton.js +7 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/typing-animation.js +42 -15
- package/dist/emoji-picker.d.ts +27 -0
- package/dist/emoji-picker.js +283 -0
- package/dist/hooks/use-horizontal-swipe.d.ts +23 -0
- package/dist/hooks/use-horizontal-swipe.js +80 -0
- package/dist/hooks/use-is-hydrated.d.ts +6 -0
- package/dist/hooks/use-is-hydrated.js +20 -0
- package/dist/hooks/use-minute-clock.d.ts +23 -0
- package/dist/hooks/use-minute-clock.js +147 -0
- package/dist/hooks/use-month-transition-direction.d.ts +21 -0
- package/dist/hooks/use-month-transition-direction.js +110 -0
- package/dist/hooks/use-rich-link-editor.d.ts +55 -0
- package/dist/hooks/use-rich-link-editor.js +515 -0
- package/dist/hooks/use-viewer-time-zone.d.ts +6 -0
- package/dist/hooks/use-viewer-time-zone.js +20 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +43 -0
- package/dist/lib/browser-clipboard.d.ts +13 -0
- package/dist/lib/browser-clipboard.js +48 -0
- package/dist/lib/browser-navigation.d.ts +21 -0
- package/dist/lib/browser-navigation.js +42 -0
- package/dist/lib/column-filter-value.d.ts +12 -0
- package/dist/lib/column-filter-value.js +52 -0
- package/dist/lib/file-acceptance.d.ts +43 -0
- package/dist/lib/file-acceptance.js +107 -0
- package/dist/lib/format-file-size.d.ts +16 -0
- package/dist/lib/format-file-size.js +34 -0
- package/dist/lib/fuzzy-search.d.ts +17 -0
- package/dist/lib/fuzzy-search.js +183 -0
- package/dist/lib/horizontal-swipe.d.ts +23 -0
- package/dist/lib/horizontal-swipe.js +29 -0
- package/dist/lib/in-app-browser.d.ts +35 -0
- package/dist/lib/in-app-browser.js +80 -0
- package/dist/lib/month-grid.d.ts +42 -0
- package/dist/lib/month-grid.js +74 -0
- package/dist/lib/name-initials.d.ts +7 -0
- package/dist/lib/name-initials.js +11 -0
- package/dist/lib/rich-text/link-markdown-constants.d.ts +147 -0
- package/dist/lib/rich-text/link-markdown-constants.js +458 -0
- package/dist/lib/rich-text/link-markdown-types.d.ts +53 -0
- package/dist/lib/rich-text/link-markdown-types.js +1 -0
- package/dist/lib/rich-text/link-markdown.d.ts +193 -0
- package/dist/lib/rich-text/link-markdown.js +592 -0
- package/dist/lib/rich-text/rich-markdown.d.ts +41 -0
- package/dist/lib/rich-text/rich-markdown.js +105 -0
- package/dist/lib/rich-text/rich-text-editor-dom.d.ts +26 -0
- package/dist/lib/rich-text/rich-text-editor-dom.js +79 -0
- package/dist/motion/glide-indicator.d.ts +37 -3
- package/dist/motion/glide-indicator.js +37 -3
- package/dist/motion/motion-slot.js +47 -18
- package/dist/motion/surface-keyframes.js +18 -6
- package/dist/motion/tokens.d.ts +41 -2
- package/dist/motion/tokens.js +40 -1
- package/dist/providers/beez-ui-provider.js +49 -17
- package/dist/styles.css +1 -1
- package/package.json +212 -2
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
/** Row action menu whose destructive item asks for an inline confirmation before running. */
|
|
4
|
+
import { useId, useRef, useState } from "react";
|
|
5
|
+
import { MoreVertical, Trash2 } from "lucide-react";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { Button } from "./button.js";
|
|
8
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
9
|
+
import { Popover, PopoverAnchor, PopoverContent } from "./popover.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const CONFIRM_DELETE_DEFAULT_LABELS = {
|
|
12
|
+
cancel: "Cancelar",
|
|
13
|
+
confirm: "Confirmar",
|
|
14
|
+
delete: "Eliminar",
|
|
15
|
+
menu: "Abrir acciones"
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Renders an icon menu with a destructive item. Choosing it opens a confirmation anchored to
|
|
19
|
+
* the trigger; only its confirm button runs `onConfirm`. Escape, an outside click or Cancel
|
|
20
|
+
* dismiss it without side effects.
|
|
21
|
+
* @param props - Confirmation copy, callback, extra items and optional labels.
|
|
22
|
+
* @returns The menu trigger with its confirmation.
|
|
23
|
+
*/
|
|
24
|
+
export function ConfirmDeleteButton(t0) {
|
|
25
|
+
const $ = _c(43);
|
|
26
|
+
const { message, onConfirm, extraMenuItems: t1, labels, className } = t0;
|
|
27
|
+
const extraMenuItems = t1 === undefined ? null : t1;
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[0] !== labels) {
|
|
30
|
+
t2 = {
|
|
31
|
+
...CONFIRM_DELETE_DEFAULT_LABELS,
|
|
32
|
+
...labels
|
|
33
|
+
};
|
|
34
|
+
$[0] = labels;
|
|
35
|
+
$[1] = t2;
|
|
36
|
+
} else {
|
|
37
|
+
t2 = $[1];
|
|
38
|
+
}
|
|
39
|
+
const resolvedLabels = t2;
|
|
40
|
+
const [isConfirming, setIsConfirming] = useState(false);
|
|
41
|
+
const isOpeningConfirmationRef = useRef(false);
|
|
42
|
+
const messageId = useId();
|
|
43
|
+
let t3;
|
|
44
|
+
if ($[2] !== className) {
|
|
45
|
+
t3 = cn("inline-flex justify-end", className);
|
|
46
|
+
$[2] = className;
|
|
47
|
+
$[3] = t3;
|
|
48
|
+
} else {
|
|
49
|
+
t3 = $[3];
|
|
50
|
+
}
|
|
51
|
+
let t4;
|
|
52
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
53
|
+
t4 = /* @__PURE__ */ _jsx(MoreVertical, { "aria-hidden": "true" });
|
|
54
|
+
$[4] = t4;
|
|
55
|
+
} else {
|
|
56
|
+
t4 = $[4];
|
|
57
|
+
}
|
|
58
|
+
let t5;
|
|
59
|
+
if ($[5] !== resolvedLabels.menu) {
|
|
60
|
+
t5 = /* @__PURE__ */ _jsx(PopoverAnchor, {
|
|
61
|
+
asChild: true,
|
|
62
|
+
children: /* @__PURE__ */ _jsx(DropdownMenuTrigger, {
|
|
63
|
+
asChild: true,
|
|
64
|
+
children: /* @__PURE__ */ _jsx(Button, {
|
|
65
|
+
"aria-label": resolvedLabels.menu,
|
|
66
|
+
size: "icon-sm",
|
|
67
|
+
type: "button",
|
|
68
|
+
variant: "ghost",
|
|
69
|
+
children: t4
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
$[5] = resolvedLabels.menu;
|
|
74
|
+
$[6] = t5;
|
|
75
|
+
} else {
|
|
76
|
+
t5 = $[6];
|
|
77
|
+
}
|
|
78
|
+
let t6;
|
|
79
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
80
|
+
t6 = (event) => {
|
|
81
|
+
if (!isOpeningConfirmationRef.current) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
isOpeningConfirmationRef.current = false;
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
};
|
|
87
|
+
$[7] = t6;
|
|
88
|
+
} else {
|
|
89
|
+
t6 = $[7];
|
|
90
|
+
}
|
|
91
|
+
let t7;
|
|
92
|
+
let t8;
|
|
93
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
94
|
+
t7 = () => {
|
|
95
|
+
isOpeningConfirmationRef.current = true;
|
|
96
|
+
setIsConfirming(true);
|
|
97
|
+
};
|
|
98
|
+
t8 = /* @__PURE__ */ _jsx(Trash2, { "aria-hidden": "true" });
|
|
99
|
+
$[8] = t7;
|
|
100
|
+
$[9] = t8;
|
|
101
|
+
} else {
|
|
102
|
+
t7 = $[8];
|
|
103
|
+
t8 = $[9];
|
|
104
|
+
}
|
|
105
|
+
let t9;
|
|
106
|
+
if ($[10] !== resolvedLabels.delete) {
|
|
107
|
+
t9 = /* @__PURE__ */ _jsxs(DropdownMenuItem, {
|
|
108
|
+
variant: "destructive",
|
|
109
|
+
onSelect: t7,
|
|
110
|
+
children: [t8, resolvedLabels.delete]
|
|
111
|
+
});
|
|
112
|
+
$[10] = resolvedLabels.delete;
|
|
113
|
+
$[11] = t9;
|
|
114
|
+
} else {
|
|
115
|
+
t9 = $[11];
|
|
116
|
+
}
|
|
117
|
+
let t10;
|
|
118
|
+
if ($[12] !== extraMenuItems || $[13] !== t9) {
|
|
119
|
+
t10 = /* @__PURE__ */ _jsxs(DropdownMenuContent, {
|
|
120
|
+
align: "end",
|
|
121
|
+
onCloseAutoFocus: t6,
|
|
122
|
+
children: [extraMenuItems, t9]
|
|
123
|
+
});
|
|
124
|
+
$[12] = extraMenuItems;
|
|
125
|
+
$[13] = t9;
|
|
126
|
+
$[14] = t10;
|
|
127
|
+
} else {
|
|
128
|
+
t10 = $[14];
|
|
129
|
+
}
|
|
130
|
+
let t11;
|
|
131
|
+
if ($[15] !== t10 || $[16] !== t5) {
|
|
132
|
+
t11 = /* @__PURE__ */ _jsxs(DropdownMenu, { children: [t5, t10] });
|
|
133
|
+
$[15] = t10;
|
|
134
|
+
$[16] = t5;
|
|
135
|
+
$[17] = t11;
|
|
136
|
+
} else {
|
|
137
|
+
t11 = $[17];
|
|
138
|
+
}
|
|
139
|
+
let t12;
|
|
140
|
+
if ($[18] !== message || $[19] !== messageId) {
|
|
141
|
+
t12 = /* @__PURE__ */ _jsx("p", {
|
|
142
|
+
id: messageId,
|
|
143
|
+
className: "m-0 text-sm text-foreground",
|
|
144
|
+
children: message
|
|
145
|
+
});
|
|
146
|
+
$[18] = message;
|
|
147
|
+
$[19] = messageId;
|
|
148
|
+
$[20] = t12;
|
|
149
|
+
} else {
|
|
150
|
+
t12 = $[20];
|
|
151
|
+
}
|
|
152
|
+
let t13;
|
|
153
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
154
|
+
t13 = () => setIsConfirming(false);
|
|
155
|
+
$[21] = t13;
|
|
156
|
+
} else {
|
|
157
|
+
t13 = $[21];
|
|
158
|
+
}
|
|
159
|
+
let t14;
|
|
160
|
+
if ($[22] !== resolvedLabels.cancel) {
|
|
161
|
+
t14 = /* @__PURE__ */ _jsx(Button, {
|
|
162
|
+
size: "sm",
|
|
163
|
+
type: "button",
|
|
164
|
+
variant: "outline",
|
|
165
|
+
onClick: t13,
|
|
166
|
+
children: resolvedLabels.cancel
|
|
167
|
+
});
|
|
168
|
+
$[22] = resolvedLabels.cancel;
|
|
169
|
+
$[23] = t14;
|
|
170
|
+
} else {
|
|
171
|
+
t14 = $[23];
|
|
172
|
+
}
|
|
173
|
+
let t15;
|
|
174
|
+
if ($[24] !== onConfirm) {
|
|
175
|
+
t15 = () => {
|
|
176
|
+
setIsConfirming(false);
|
|
177
|
+
onConfirm();
|
|
178
|
+
};
|
|
179
|
+
$[24] = onConfirm;
|
|
180
|
+
$[25] = t15;
|
|
181
|
+
} else {
|
|
182
|
+
t15 = $[25];
|
|
183
|
+
}
|
|
184
|
+
let t16;
|
|
185
|
+
if ($[26] !== resolvedLabels.confirm || $[27] !== t15) {
|
|
186
|
+
t16 = /* @__PURE__ */ _jsx(Button, {
|
|
187
|
+
size: "sm",
|
|
188
|
+
type: "button",
|
|
189
|
+
variant: "destructive",
|
|
190
|
+
onClick: t15,
|
|
191
|
+
children: resolvedLabels.confirm
|
|
192
|
+
});
|
|
193
|
+
$[26] = resolvedLabels.confirm;
|
|
194
|
+
$[27] = t15;
|
|
195
|
+
$[28] = t16;
|
|
196
|
+
} else {
|
|
197
|
+
t16 = $[28];
|
|
198
|
+
}
|
|
199
|
+
let t17;
|
|
200
|
+
if ($[29] !== t14 || $[30] !== t16) {
|
|
201
|
+
t17 = /* @__PURE__ */ _jsxs("div", {
|
|
202
|
+
className: "flex items-center gap-2",
|
|
203
|
+
children: [t14, t16]
|
|
204
|
+
});
|
|
205
|
+
$[29] = t14;
|
|
206
|
+
$[30] = t16;
|
|
207
|
+
$[31] = t17;
|
|
208
|
+
} else {
|
|
209
|
+
t17 = $[31];
|
|
210
|
+
}
|
|
211
|
+
let t18;
|
|
212
|
+
if ($[32] !== messageId || $[33] !== t12 || $[34] !== t17) {
|
|
213
|
+
t18 = /* @__PURE__ */ _jsxs(PopoverContent, {
|
|
214
|
+
align: "end",
|
|
215
|
+
"aria-labelledby": messageId,
|
|
216
|
+
className: "w-[min(18rem,calc(100vw-2rem))] gap-3 p-3.5",
|
|
217
|
+
children: [t12, t17]
|
|
218
|
+
});
|
|
219
|
+
$[32] = messageId;
|
|
220
|
+
$[33] = t12;
|
|
221
|
+
$[34] = t17;
|
|
222
|
+
$[35] = t18;
|
|
223
|
+
} else {
|
|
224
|
+
t18 = $[35];
|
|
225
|
+
}
|
|
226
|
+
let t19;
|
|
227
|
+
if ($[36] !== isConfirming || $[37] !== t11 || $[38] !== t18) {
|
|
228
|
+
t19 = /* @__PURE__ */ _jsxs(Popover, {
|
|
229
|
+
open: isConfirming,
|
|
230
|
+
onOpenChange: setIsConfirming,
|
|
231
|
+
children: [t11, t18]
|
|
232
|
+
});
|
|
233
|
+
$[36] = isConfirming;
|
|
234
|
+
$[37] = t11;
|
|
235
|
+
$[38] = t18;
|
|
236
|
+
$[39] = t19;
|
|
237
|
+
} else {
|
|
238
|
+
t19 = $[39];
|
|
239
|
+
}
|
|
240
|
+
let t20;
|
|
241
|
+
if ($[40] !== t19 || $[41] !== t3) {
|
|
242
|
+
t20 = /* @__PURE__ */ _jsx("div", {
|
|
243
|
+
"data-slot": "confirm-delete-button",
|
|
244
|
+
className: t3,
|
|
245
|
+
children: t19
|
|
246
|
+
});
|
|
247
|
+
$[40] = t19;
|
|
248
|
+
$[41] = t3;
|
|
249
|
+
$[42] = t20;
|
|
250
|
+
} else {
|
|
251
|
+
t20 = $[42];
|
|
252
|
+
}
|
|
253
|
+
return t20;
|
|
254
|
+
}
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { flexRender, getCoreRowModel, getFilteredRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
|
|
4
4
|
import { CircleAlert, ChevronDown, ChevronRight, Ellipsis, Eraser, X } from "lucide-react";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { matchesColumnFilterValue, normalizeFilterToken } from "../lib/column-filter-value.js";
|
|
6
7
|
import { MotionSlot } from "../motion/motion-slot.js";
|
|
7
8
|
import { Button } from "./button.js";
|
|
8
9
|
import { Badge } from "./badge.js";
|
|
@@ -12,7 +13,6 @@ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMe
|
|
|
12
13
|
import { Input } from "./input.js";
|
|
13
14
|
import { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./table.js";
|
|
14
15
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
-
const DIACRITICS_PATTERN = /[\u0300-\u036f]/g;
|
|
16
16
|
const CLEAR_FILTER_ARIA_LABEL = "Limpiar filtro";
|
|
17
17
|
const ACTIVE_EXCLUSIONS_SR_LABEL = "Filtros de exclusión activos";
|
|
18
18
|
const HIDE_EXCLUDE_FILTERS_ARIA_LABEL = "Ocultar filtros de exclusión";
|
|
@@ -22,8 +22,37 @@ const EXCLUDED_ROWS_SUMMARY_LABEL = "Total excluidas";
|
|
|
22
22
|
const CLEAR_ALL_EXCLUSIONS_ARIA_LABEL = "Quitar todas las exclusiones";
|
|
23
23
|
const CLEAR_ALL_EXCLUSIONS_FROM_INPUT_ARIA_LABEL = "Limpiar filtros excluidos";
|
|
24
24
|
const REVERSE_FILTER_PENDING_MESSAGE = "Estás escribiendo una exclusión. Presioná Enter para aplicarla.";
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
/** Filters a column with the structured values the query bar writes, or plain text. */
|
|
26
|
+
const columnFilterValueFn = (row, columnId, filterValue) => matchesColumnFilterValue(row.getValue(columnId), filterValue);
|
|
27
|
+
/** Mirrors TanStack's column id resolution: explicit id, else the accessor key with dots as `_`. */
|
|
28
|
+
function getColumnDefId(column) {
|
|
29
|
+
if (column.id) return column.id;
|
|
30
|
+
const accessorKey = column.accessorKey;
|
|
31
|
+
return typeof accessorKey === "string" ? accessorKey.replaceAll(".", "_") : undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Gives the columns targeted by query qualifiers a filter that understands the query bar's
|
|
35
|
+
* structured values. TanStack would otherwise infer one from the data (`inNumberRange` for
|
|
36
|
+
* numbers, which crashes on an object). A consumer's own `filterFn` always wins.
|
|
37
|
+
*/
|
|
38
|
+
function withQueryFilterFns(columns, targetedColumnIds) {
|
|
39
|
+
if (targetedColumnIds.size === 0) return columns;
|
|
40
|
+
return columns.map((column) => {
|
|
41
|
+
if ("columns" in column && column.columns) {
|
|
42
|
+
return {
|
|
43
|
+
...column,
|
|
44
|
+
columns: withQueryFilterFns(column.columns, targetedColumnIds)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const columnId = getColumnDefId(column);
|
|
48
|
+
if (column.filterFn != null || columnId == null || !targetedColumnIds.has(columnId)) {
|
|
49
|
+
return column;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
...column,
|
|
53
|
+
filterFn: columnFilterValueFn
|
|
54
|
+
};
|
|
55
|
+
});
|
|
27
56
|
}
|
|
28
57
|
function getTableFilterValue(filterValue, showExcludeFilterToggle) {
|
|
29
58
|
const normalizedFilterValue = filterValue.trimStart();
|
|
@@ -310,8 +339,9 @@ export function DataTable({ columns, data, emptyMessage, toolbarActions, onVisib
|
|
|
310
339
|
onColumnVisibilityChange?.(updater);
|
|
311
340
|
}, [controlledColumnVisibility, onColumnVisibilityChange]);
|
|
312
341
|
// TanStack Table manages internal reactive state through this hook.
|
|
342
|
+
const tableColumns = React.useMemo(() => withQueryFilterFns(columns, advancedFilterColumnIds), [columns, advancedFilterColumnIds]);
|
|
313
343
|
const table = useReactTable({
|
|
314
|
-
columns,
|
|
344
|
+
columns: tableColumns,
|
|
315
345
|
data,
|
|
316
346
|
// La tabla no pagina (no hay `getPaginationRowModel`). Con el auto-reset por
|
|
317
347
|
// defecto, cada cambio de filtro dispara `resetPageIndex` → `setPagination`,
|
|
@@ -586,7 +586,7 @@ function DropdownMenuSubTrigger(t0) {
|
|
|
586
586
|
}
|
|
587
587
|
let t1;
|
|
588
588
|
if ($[5] !== className) {
|
|
589
|
-
t1 = cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className);
|
|
589
|
+
t1 = cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground data-open:*:data-[slot=dropdown-menu-sub-trigger-icon]:translate-x-0.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className);
|
|
590
590
|
$[5] = className;
|
|
591
591
|
$[6] = t1;
|
|
592
592
|
} else {
|
|
@@ -594,7 +594,10 @@ function DropdownMenuSubTrigger(t0) {
|
|
|
594
594
|
}
|
|
595
595
|
let t2;
|
|
596
596
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
597
|
-
t2 = /* @__PURE__ */ _jsx(ChevronRightIcon, {
|
|
597
|
+
t2 = /* @__PURE__ */ _jsx(ChevronRightIcon, {
|
|
598
|
+
"data-slot": "dropdown-menu-sub-trigger-icon",
|
|
599
|
+
className: "ml-auto transition-transform duration-200 ease-out"
|
|
600
|
+
});
|
|
598
601
|
$[7] = t2;
|
|
599
602
|
} else {
|
|
600
603
|
t2 = $[7];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Placeholder for regions without content yet: empty lists, sections in construction or first steps. */
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export type EmptyStateTitleElement = "h1" | "h2" | "h3" | "p";
|
|
4
|
+
export interface EmptyStateProps {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** Heading level that fits the surrounding outline; a paragraph for minor regions. */
|
|
7
|
+
titleAs?: EmptyStateTitleElement;
|
|
8
|
+
/** Short uppercase label above the title, such as "Próximamente". */
|
|
9
|
+
eyebrow?: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/** Actions or extra content, such as buttons or a template list. */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
align?: "start" | "center";
|
|
14
|
+
/** `page` uses display typography for full sections; `inline` stays compact inside panels. */
|
|
15
|
+
size?: "page" | "inline";
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Renders the empty region as a labelled section. It does not add a landmark besides the
|
|
20
|
+
* section, so it composes inside an existing `main`.
|
|
21
|
+
* @param props - Title, optional eyebrow, description, actions and layout.
|
|
22
|
+
* @returns The empty state.
|
|
23
|
+
*/
|
|
24
|
+
export declare function EmptyState({ title, titleAs: TitleElement, eyebrow, description, children, align, size, className, }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/** Copy settles in one line after another; reduced motion drops it through the shared fallback. */
|
|
4
|
+
const ENTER_CLASS_NAME = "animate-in fade-in slide-in-from-bottom-1.5 fill-mode-both duration-300";
|
|
5
|
+
/**
|
|
6
|
+
* Renders the empty region as a labelled section. It does not add a landmark besides the
|
|
7
|
+
* section, so it composes inside an existing `main`.
|
|
8
|
+
* @param props - Title, optional eyebrow, description, actions and layout.
|
|
9
|
+
* @returns The empty state.
|
|
10
|
+
*/
|
|
11
|
+
export function EmptyState({ title, titleAs: TitleElement = "h2", eyebrow, description, children, align = "start", size = "inline", className }) {
|
|
12
|
+
const isCentered = align === "center";
|
|
13
|
+
const isPage = size === "page";
|
|
14
|
+
return /* @__PURE__ */ _jsxs("section", {
|
|
15
|
+
"data-slot": "empty-state",
|
|
16
|
+
"data-size": size,
|
|
17
|
+
className: cn("grid gap-2", isCentered ? "justify-items-center text-center" : "justify-items-start", isPage ? "max-w-2xl gap-2.5 py-6" : "py-6", className),
|
|
18
|
+
children: [
|
|
19
|
+
eyebrow ? /* @__PURE__ */ _jsx("p", {
|
|
20
|
+
className: cn("m-0 text-[0.78rem] font-bold tracking-[0.08em] text-[color-mix(in_oklab,var(--primary)_76%,var(--foreground))] uppercase", ENTER_CLASS_NAME),
|
|
21
|
+
children: eyebrow
|
|
22
|
+
}) : null,
|
|
23
|
+
/* @__PURE__ */ _jsx(TitleElement, {
|
|
24
|
+
className: cn("m-0 text-balance [overflow-wrap:anywhere]", isPage ? "font-display text-[clamp(2rem,6vw,4rem)] leading-[1.05] font-semibold" : "font-semibold", ENTER_CLASS_NAME, "delay-40"),
|
|
25
|
+
children: title
|
|
26
|
+
}),
|
|
27
|
+
description ? /* @__PURE__ */ _jsx("p", {
|
|
28
|
+
className: cn("m-0 max-w-xl text-pretty text-muted-foreground", isPage && "text-[clamp(1rem,2vw,1.15rem)] leading-relaxed", ENTER_CLASS_NAME, "delay-80"),
|
|
29
|
+
children: description
|
|
30
|
+
}) : null,
|
|
31
|
+
children ? /* @__PURE__ */ _jsx("div", {
|
|
32
|
+
className: cn("mt-2 flex w-full flex-wrap gap-2", isCentered && "justify-center", ENTER_CLASS_NAME, "delay-120"),
|
|
33
|
+
children
|
|
34
|
+
}) : null
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Full-page recovery view for route and global error boundaries: explains the failure and offers a retry. */
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export interface ErrorStateProps {
|
|
4
|
+
eyebrow?: ReactNode;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description: ReactNode;
|
|
7
|
+
retryLabel: string;
|
|
8
|
+
onRetry: () => void;
|
|
9
|
+
/** Destination of the secondary action. Without it, only the retry action is shown. */
|
|
10
|
+
homeHref?: string;
|
|
11
|
+
homeLabel?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders a full-height section with the error copy, a retry button and an optional way home.
|
|
16
|
+
* The home link uses the router adapter configured in `BeezUIProvider`.
|
|
17
|
+
* @param props - Copy, retry callback and optional home destination.
|
|
18
|
+
* @returns The error view.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ErrorState({ eyebrow, title, description, retryLabel, onRetry, homeHref, homeLabel, className }: ErrorStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { Link } from "./link.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/** Copy and actions settle in one after another; reduced motion drops it through the shared fallback. */
|
|
8
|
+
const ENTER_CLASS_NAME = "animate-in fade-in slide-in-from-bottom-1.5 fill-mode-both duration-300";
|
|
9
|
+
/**
|
|
10
|
+
* Renders a full-height section with the error copy, a retry button and an optional way home.
|
|
11
|
+
* The home link uses the router adapter configured in `BeezUIProvider`.
|
|
12
|
+
* @param props - Copy, retry callback and optional home destination.
|
|
13
|
+
* @returns The error view.
|
|
14
|
+
*/
|
|
15
|
+
export function ErrorState(t0) {
|
|
16
|
+
const $ = _c(26);
|
|
17
|
+
const { eyebrow, title, description, retryLabel, onRetry, homeHref, homeLabel, className } = t0;
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[0] !== className) {
|
|
20
|
+
t1 = cn("relative isolate grid h-full min-h-svh w-full content-center justify-items-start gap-5 overflow-hidden bg-background p-[clamp(2rem,5vw,5rem)] text-foreground", className);
|
|
21
|
+
$[0] = className;
|
|
22
|
+
$[1] = t1;
|
|
23
|
+
} else {
|
|
24
|
+
t1 = $[1];
|
|
25
|
+
}
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[2] !== eyebrow) {
|
|
28
|
+
t2 = eyebrow ? /* @__PURE__ */ _jsx("p", {
|
|
29
|
+
className: cn("m-0 font-mono text-[0.8rem] tracking-[0.2em] text-foreground/60 uppercase", ENTER_CLASS_NAME),
|
|
30
|
+
children: eyebrow
|
|
31
|
+
}) : null;
|
|
32
|
+
$[2] = eyebrow;
|
|
33
|
+
$[3] = t2;
|
|
34
|
+
} else {
|
|
35
|
+
t2 = $[3];
|
|
36
|
+
}
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
39
|
+
t3 = cn("m-0 max-w-[14ch] font-display text-[clamp(2.8rem,8vw,5.5rem)] leading-[0.96] font-semibold text-balance sm:max-w-[12ch]", ENTER_CLASS_NAME, "delay-40");
|
|
40
|
+
$[4] = t3;
|
|
41
|
+
} else {
|
|
42
|
+
t3 = $[4];
|
|
43
|
+
}
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[5] !== title) {
|
|
46
|
+
t4 = /* @__PURE__ */ _jsx("h1", {
|
|
47
|
+
className: t3,
|
|
48
|
+
children: title
|
|
49
|
+
});
|
|
50
|
+
$[5] = title;
|
|
51
|
+
$[6] = t4;
|
|
52
|
+
} else {
|
|
53
|
+
t4 = $[6];
|
|
54
|
+
}
|
|
55
|
+
let t5;
|
|
56
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57
|
+
t5 = cn("m-0 max-w-[40rem] text-[clamp(1rem,2vw,1.15rem)] leading-[1.75] text-pretty text-muted-foreground", ENTER_CLASS_NAME, "delay-80");
|
|
58
|
+
$[7] = t5;
|
|
59
|
+
} else {
|
|
60
|
+
t5 = $[7];
|
|
61
|
+
}
|
|
62
|
+
let t6;
|
|
63
|
+
if ($[8] !== description) {
|
|
64
|
+
t6 = /* @__PURE__ */ _jsx("p", {
|
|
65
|
+
className: t5,
|
|
66
|
+
children: description
|
|
67
|
+
});
|
|
68
|
+
$[8] = description;
|
|
69
|
+
$[9] = t6;
|
|
70
|
+
} else {
|
|
71
|
+
t6 = $[9];
|
|
72
|
+
}
|
|
73
|
+
let t7;
|
|
74
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
75
|
+
t7 = cn("flex w-full flex-wrap gap-3.5 pt-2 sm:w-auto", ENTER_CLASS_NAME, "delay-120");
|
|
76
|
+
$[10] = t7;
|
|
77
|
+
} else {
|
|
78
|
+
t7 = $[10];
|
|
79
|
+
}
|
|
80
|
+
let t8;
|
|
81
|
+
if ($[11] !== onRetry || $[12] !== retryLabel) {
|
|
82
|
+
t8 = /* @__PURE__ */ _jsx(Button, {
|
|
83
|
+
size: "lg",
|
|
84
|
+
type: "button",
|
|
85
|
+
onClick: onRetry,
|
|
86
|
+
children: retryLabel
|
|
87
|
+
});
|
|
88
|
+
$[11] = onRetry;
|
|
89
|
+
$[12] = retryLabel;
|
|
90
|
+
$[13] = t8;
|
|
91
|
+
} else {
|
|
92
|
+
t8 = $[13];
|
|
93
|
+
}
|
|
94
|
+
let t9;
|
|
95
|
+
if ($[14] !== homeHref || $[15] !== homeLabel) {
|
|
96
|
+
t9 = homeHref && homeLabel ? /* @__PURE__ */ _jsx(Button, {
|
|
97
|
+
asChild: true,
|
|
98
|
+
size: "lg",
|
|
99
|
+
variant: "outline",
|
|
100
|
+
children: /* @__PURE__ */ _jsx(Link, {
|
|
101
|
+
href: homeHref,
|
|
102
|
+
children: homeLabel
|
|
103
|
+
})
|
|
104
|
+
}) : null;
|
|
105
|
+
$[14] = homeHref;
|
|
106
|
+
$[15] = homeLabel;
|
|
107
|
+
$[16] = t9;
|
|
108
|
+
} else {
|
|
109
|
+
t9 = $[16];
|
|
110
|
+
}
|
|
111
|
+
let t10;
|
|
112
|
+
if ($[17] !== t8 || $[18] !== t9) {
|
|
113
|
+
t10 = /* @__PURE__ */ _jsxs("div", {
|
|
114
|
+
className: t7,
|
|
115
|
+
children: [t8, t9]
|
|
116
|
+
});
|
|
117
|
+
$[17] = t8;
|
|
118
|
+
$[18] = t9;
|
|
119
|
+
$[19] = t10;
|
|
120
|
+
} else {
|
|
121
|
+
t10 = $[19];
|
|
122
|
+
}
|
|
123
|
+
let t11;
|
|
124
|
+
if ($[20] !== t1 || $[21] !== t10 || $[22] !== t2 || $[23] !== t4 || $[24] !== t6) {
|
|
125
|
+
t11 = /* @__PURE__ */ _jsxs("section", {
|
|
126
|
+
"data-slot": "error-state",
|
|
127
|
+
className: t1,
|
|
128
|
+
children: [
|
|
129
|
+
t2,
|
|
130
|
+
t4,
|
|
131
|
+
t6,
|
|
132
|
+
t10
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
$[20] = t1;
|
|
136
|
+
$[21] = t10;
|
|
137
|
+
$[22] = t2;
|
|
138
|
+
$[23] = t4;
|
|
139
|
+
$[24] = t6;
|
|
140
|
+
$[25] = t11;
|
|
141
|
+
} else {
|
|
142
|
+
t11 = $[25];
|
|
143
|
+
}
|
|
144
|
+
return t11;
|
|
145
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ExternalBrowserHandoffCopy {
|
|
2
|
+
eyebrow?: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
countdownDescription: string;
|
|
6
|
+
primaryAction: string;
|
|
7
|
+
fallbackLink: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ExternalBrowserHandoffProps {
|
|
10
|
+
/** Deep link that opens the page in the default browser (see `buildExternalBrowserUrl`). */
|
|
11
|
+
externalBrowserUrl: string;
|
|
12
|
+
/** In-app destination used when the deep link does not open another app. */
|
|
13
|
+
fallbackUrl: string;
|
|
14
|
+
countdownSeconds?: number;
|
|
15
|
+
copy?: Partial<ExternalBrowserHandoffCopy>;
|
|
16
|
+
/** Navigates to the fallback. Defaults to a full browser navigation. */
|
|
17
|
+
onFallback?: (fallbackUrl: string) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Counts down and then follows `fallbackUrl`, unless the page was hidden because the external
|
|
22
|
+
* browser opened. Repeated taps on the primary action restart one fallback window instead of
|
|
23
|
+
* stacking redirects.
|
|
24
|
+
* @param props - Deep link, fallback, countdown and copy.
|
|
25
|
+
* @returns The handoff section.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ExternalBrowserHandoff({ externalBrowserUrl, fallbackUrl, countdownSeconds, copy, onFallback, className, }: ExternalBrowserHandoffProps): import("react").JSX.Element;
|