@mshuja288/aksuicore 0.2.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/index.js ADDED
@@ -0,0 +1,1127 @@
1
+ "use client";
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { useId, useRef, useState, useLayoutEffect, useEffect, useMemo, useSyncExternalStore } from 'react';
4
+ import { createPortal } from 'react-dom';
5
+
6
+ // src/theme/tokens.ts
7
+ var aksuiTokens = {
8
+ brand: "#1E2735",
9
+ accent: "#E67E22",
10
+ ink: "#1E2735",
11
+ muted: "#667085",
12
+ line: "#e6e4df",
13
+ field: "#f6f5f3",
14
+ card: "#ffffff",
15
+ danger: "#b42318",
16
+ dangerBg: "#fff1f0",
17
+ ok: "#067647",
18
+ okBg: "#ecfdf3",
19
+ radius: "8px",
20
+ rowHeight: "34px",
21
+ tableHeaderHeight: "36px",
22
+ sideRailCollapsed: "52px",
23
+ sideRailExpanded: "280px",
24
+ previewPanelWidth: "300px"
25
+ };
26
+
27
+ // src/theme/index.ts
28
+ var aksuiThemeVersion = "0.2.0";
29
+ var variantClass = {
30
+ primary: "",
31
+ secondary: "secondary",
32
+ ghost: "ghost",
33
+ danger: "danger"
34
+ };
35
+ function Button({
36
+ variant = "primary",
37
+ className = "",
38
+ children,
39
+ ...props
40
+ }) {
41
+ const classes = ["aks-button", variantClass[variant], className].filter(Boolean).join(" ");
42
+ return /* @__PURE__ */ jsx("button", { type: "button", className: classes, ...props, children });
43
+ }
44
+ function Select({
45
+ value,
46
+ options,
47
+ onChange,
48
+ placeholder = "Select",
49
+ disabled = false,
50
+ required = false,
51
+ className = ""
52
+ }) {
53
+ const listId = useId();
54
+ const rootRef = useRef(null);
55
+ const menuRef = useRef(null);
56
+ const [open, setOpen] = useState(false);
57
+ const [menuPos, setMenuPos] = useState(null);
58
+ const selected = options.find((option) => option.value === value) ?? null;
59
+ function updatePosition() {
60
+ const root = rootRef.current;
61
+ if (!root) {
62
+ return;
63
+ }
64
+ const rect = root.getBoundingClientRect();
65
+ const spaceBelow = window.innerHeight - rect.bottom - 12;
66
+ const spaceAbove = rect.top - 12;
67
+ const openUp = spaceBelow < 220 && spaceAbove > spaceBelow;
68
+ const maxHeight = Math.max(160, Math.min(280, openUp ? spaceAbove : spaceBelow));
69
+ setMenuPos({
70
+ top: openUp ? rect.top - 8 : rect.bottom + 6,
71
+ left: rect.left,
72
+ width: rect.width,
73
+ maxHeight,
74
+ openUp
75
+ });
76
+ }
77
+ useLayoutEffect(() => {
78
+ if (!open) {
79
+ return;
80
+ }
81
+ updatePosition();
82
+ function onReposition() {
83
+ updatePosition();
84
+ }
85
+ window.addEventListener("resize", onReposition);
86
+ window.addEventListener("scroll", onReposition, true);
87
+ return () => {
88
+ window.removeEventListener("resize", onReposition);
89
+ window.removeEventListener("scroll", onReposition, true);
90
+ };
91
+ }, [open]);
92
+ useEffect(() => {
93
+ if (!open) {
94
+ return;
95
+ }
96
+ function onPointerDown(event) {
97
+ const target = event.target;
98
+ if (rootRef.current?.contains(target) || menuRef.current?.contains(target)) {
99
+ return;
100
+ }
101
+ setOpen(false);
102
+ }
103
+ function onKeyDown(event) {
104
+ if (event.key === "Escape") {
105
+ setOpen(false);
106
+ }
107
+ }
108
+ document.addEventListener("mousedown", onPointerDown);
109
+ document.addEventListener("keydown", onKeyDown);
110
+ return () => {
111
+ document.removeEventListener("mousedown", onPointerDown);
112
+ document.removeEventListener("keydown", onKeyDown);
113
+ };
114
+ }, [open]);
115
+ function choose(next) {
116
+ onChange(next);
117
+ setOpen(false);
118
+ }
119
+ return /* @__PURE__ */ jsxs("div", { className: `app-select ${className}`.trim(), ref: rootRef, children: [
120
+ /* @__PURE__ */ jsx(
121
+ "input",
122
+ {
123
+ className: "app-select-mirror",
124
+ tabIndex: -1,
125
+ value,
126
+ required,
127
+ onChange: () => void 0,
128
+ "aria-hidden": "true"
129
+ }
130
+ ),
131
+ /* @__PURE__ */ jsxs(
132
+ "button",
133
+ {
134
+ type: "button",
135
+ className: open ? "app-select-trigger open" : "app-select-trigger",
136
+ disabled,
137
+ "aria-haspopup": "listbox",
138
+ "aria-expanded": open,
139
+ "aria-controls": listId,
140
+ onClick: () => {
141
+ if (!disabled) {
142
+ setOpen((current) => !current);
143
+ }
144
+ },
145
+ children: [
146
+ /* @__PURE__ */ jsx("span", { className: selected ? "app-select-value" : "app-select-placeholder", children: selected ? /* @__PURE__ */ jsxs(Fragment, { children: [
147
+ selected.tone ? /* @__PURE__ */ jsx("span", { className: `app-select-dot ${selected.tone}`, "aria-hidden": "true" }) : null,
148
+ selected.label
149
+ ] }) : placeholder }),
150
+ /* @__PURE__ */ jsx("svg", { className: "app-select-chevron", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M5 7.5 10 12.5 15 7.5", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) })
151
+ ]
152
+ }
153
+ ),
154
+ open && menuPos ? createPortal(
155
+ /* @__PURE__ */ jsx(
156
+ "div",
157
+ {
158
+ ref: menuRef,
159
+ id: listId,
160
+ className: menuPos.openUp ? "app-select-menu open-up" : "app-select-menu",
161
+ role: "listbox",
162
+ style: {
163
+ top: menuPos.openUp ? void 0 : menuPos.top,
164
+ bottom: menuPos.openUp ? window.innerHeight - menuPos.top : void 0,
165
+ left: menuPos.left,
166
+ width: menuPos.width,
167
+ maxHeight: menuPos.maxHeight
168
+ },
169
+ children: options.length === 0 ? /* @__PURE__ */ jsx("div", { className: "app-select-empty", children: "No options" }) : options.map((option) => {
170
+ const active = option.value === value;
171
+ return /* @__PURE__ */ jsxs(
172
+ "button",
173
+ {
174
+ type: "button",
175
+ role: "option",
176
+ "aria-selected": active,
177
+ className: active ? "app-select-option active" : "app-select-option",
178
+ onClick: () => choose(option.value),
179
+ children: [
180
+ option.tone ? /* @__PURE__ */ jsx("span", { className: `app-select-dot ${option.tone}`, "aria-hidden": "true" }) : null,
181
+ /* @__PURE__ */ jsx("span", { children: option.label }),
182
+ active ? /* @__PURE__ */ jsx("svg", { className: "app-select-check", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M4.5 10.5 8.2 14.2 15.5 6", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) : null
183
+ ]
184
+ },
185
+ option.value || "__empty"
186
+ );
187
+ })
188
+ }
189
+ ),
190
+ document.body
191
+ ) : null
192
+ ] });
193
+ }
194
+ var AppSelect = Select;
195
+ var weekdayLabels = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
196
+ function pad(value) {
197
+ return String(value).padStart(2, "0");
198
+ }
199
+ function toIso(date) {
200
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
201
+ }
202
+ function parseIso(value) {
203
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) {
204
+ return null;
205
+ }
206
+ const [year, month, day] = value.split("-").map(Number);
207
+ const date = new Date(year, month - 1, day);
208
+ if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
209
+ return null;
210
+ }
211
+ return date;
212
+ }
213
+ function formatDisplay(value) {
214
+ const date = parseIso(value);
215
+ if (!date) {
216
+ return "";
217
+ }
218
+ return `${pad(date.getDate())}/${pad(date.getMonth() + 1)}/${date.getFullYear()}`;
219
+ }
220
+ function startOfMonth(date) {
221
+ return new Date(date.getFullYear(), date.getMonth(), 1);
222
+ }
223
+ function buildCells(month) {
224
+ const first = startOfMonth(month);
225
+ const mondayBased = (first.getDay() + 6) % 7;
226
+ const start = new Date(first);
227
+ start.setDate(first.getDate() - mondayBased);
228
+ return Array.from({ length: 42 }, (_, index) => {
229
+ const day = new Date(start);
230
+ day.setDate(start.getDate() + index);
231
+ return day;
232
+ });
233
+ }
234
+ function DateField({
235
+ value,
236
+ onChange,
237
+ placeholder = "dd/mm/yyyy",
238
+ disabled = false,
239
+ readOnly = false
240
+ }) {
241
+ const rootRef = useRef(null);
242
+ const menuRef = useRef(null);
243
+ const selected = parseIso(value);
244
+ const [open, setOpen] = useState(false);
245
+ const [menuPos, setMenuPos] = useState(null);
246
+ const [viewMonth, setViewMonth] = useState(() => startOfMonth(selected ?? /* @__PURE__ */ new Date()));
247
+ const cells = useMemo(() => buildCells(viewMonth), [viewMonth]);
248
+ const today = toIso(/* @__PURE__ */ new Date());
249
+ const locked = disabled || readOnly;
250
+ function updatePosition() {
251
+ const root = rootRef.current;
252
+ if (!root) {
253
+ return;
254
+ }
255
+ const rect = root.getBoundingClientRect();
256
+ const openUp = window.innerHeight - rect.bottom < 340 && rect.top > 340;
257
+ setMenuPos({
258
+ top: openUp ? rect.top - 8 : rect.bottom + 6,
259
+ left: rect.left,
260
+ width: Math.max(rect.width, 280),
261
+ openUp
262
+ });
263
+ }
264
+ useLayoutEffect(() => {
265
+ if (!open) {
266
+ return;
267
+ }
268
+ updatePosition();
269
+ function onReposition() {
270
+ updatePosition();
271
+ }
272
+ window.addEventListener("resize", onReposition);
273
+ window.addEventListener("scroll", onReposition, true);
274
+ return () => {
275
+ window.removeEventListener("resize", onReposition);
276
+ window.removeEventListener("scroll", onReposition, true);
277
+ };
278
+ }, [open]);
279
+ useEffect(() => {
280
+ if (!open) {
281
+ return;
282
+ }
283
+ function onPointerDown(event) {
284
+ const target = event.target;
285
+ if (rootRef.current?.contains(target) || menuRef.current?.contains(target)) {
286
+ return;
287
+ }
288
+ setOpen(false);
289
+ }
290
+ function onKeyDown(event) {
291
+ if (event.key === "Escape") {
292
+ setOpen(false);
293
+ }
294
+ }
295
+ document.addEventListener("mousedown", onPointerDown);
296
+ document.addEventListener("keydown", onKeyDown);
297
+ return () => {
298
+ document.removeEventListener("mousedown", onPointerDown);
299
+ document.removeEventListener("keydown", onKeyDown);
300
+ };
301
+ }, [open]);
302
+ function openPicker() {
303
+ if (locked) {
304
+ return;
305
+ }
306
+ setViewMonth(startOfMonth(selected ?? /* @__PURE__ */ new Date()));
307
+ setOpen(true);
308
+ }
309
+ function choose(date) {
310
+ onChange?.(toIso(date));
311
+ setOpen(false);
312
+ }
313
+ const monthLabel = viewMonth.toLocaleString(void 0, { month: "long", year: "numeric" });
314
+ return /* @__PURE__ */ jsxs("div", { className: readOnly ? "date-field read-only" : "date-field", ref: rootRef, children: [
315
+ /* @__PURE__ */ jsxs(
316
+ "button",
317
+ {
318
+ type: "button",
319
+ className: open ? "date-field-trigger open" : "date-field-trigger",
320
+ disabled,
321
+ onClick: () => {
322
+ if (locked) {
323
+ return;
324
+ }
325
+ if (open) {
326
+ setOpen(false);
327
+ } else {
328
+ openPicker();
329
+ }
330
+ },
331
+ children: [
332
+ /* @__PURE__ */ jsx("span", { className: value ? "date-field-value" : "date-field-placeholder", children: value ? formatDisplay(value) : placeholder }),
333
+ /* @__PURE__ */ jsxs("svg", { className: "date-field-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
334
+ /* @__PURE__ */ jsx("rect", { x: "3.5", y: "5", width: "17", height: "15.5", rx: "2", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
335
+ /* @__PURE__ */ jsx("path", { d: "M3.5 9.5h17M8 3.5v3M16 3.5v3", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" })
336
+ ] })
337
+ ]
338
+ }
339
+ ),
340
+ open && menuPos ? createPortal(
341
+ /* @__PURE__ */ jsxs(
342
+ "div",
343
+ {
344
+ ref: menuRef,
345
+ className: "date-picker",
346
+ style: {
347
+ top: menuPos.openUp ? void 0 : menuPos.top,
348
+ bottom: menuPos.openUp ? window.innerHeight - menuPos.top : void 0,
349
+ left: menuPos.left,
350
+ width: menuPos.width
351
+ },
352
+ children: [
353
+ /* @__PURE__ */ jsxs("div", { className: "date-picker-head", children: [
354
+ /* @__PURE__ */ jsx("strong", { children: monthLabel }),
355
+ /* @__PURE__ */ jsxs("div", { className: "date-picker-nav", children: [
356
+ /* @__PURE__ */ jsx("button", { type: "button", className: "ghost", "aria-label": "Previous month", onClick: () => setViewMonth(new Date(viewMonth.getFullYear(), viewMonth.getMonth() - 1, 1)), children: "\u2039" }),
357
+ /* @__PURE__ */ jsx("button", { type: "button", className: "ghost", "aria-label": "Next month", onClick: () => setViewMonth(new Date(viewMonth.getFullYear(), viewMonth.getMonth() + 1, 1)), children: "\u203A" })
358
+ ] })
359
+ ] }),
360
+ /* @__PURE__ */ jsx("div", { className: "date-picker-weekdays", children: weekdayLabels.map((label) => /* @__PURE__ */ jsx("span", { children: label }, label)) }),
361
+ /* @__PURE__ */ jsx("div", { className: "date-picker-grid", children: cells.map((day) => {
362
+ const iso = toIso(day);
363
+ const outside = day.getMonth() !== viewMonth.getMonth();
364
+ const isSelected = value === iso;
365
+ const isToday = today === iso;
366
+ const className = [
367
+ "date-picker-day",
368
+ outside ? "outside" : "",
369
+ isSelected ? "selected" : "",
370
+ isToday ? "today" : ""
371
+ ].filter(Boolean).join(" ");
372
+ return /* @__PURE__ */ jsx("button", { type: "button", className, onClick: () => choose(day), children: day.getDate() }, iso + String(outside));
373
+ }) }),
374
+ /* @__PURE__ */ jsxs("div", { className: "date-picker-footer", children: [
375
+ /* @__PURE__ */ jsx(
376
+ "button",
377
+ {
378
+ type: "button",
379
+ className: "ghost",
380
+ onClick: () => {
381
+ onChange?.("");
382
+ setOpen(false);
383
+ },
384
+ children: "Clear"
385
+ }
386
+ ),
387
+ /* @__PURE__ */ jsx(
388
+ "button",
389
+ {
390
+ type: "button",
391
+ className: "ghost",
392
+ onClick: () => {
393
+ const now = /* @__PURE__ */ new Date();
394
+ setViewMonth(startOfMonth(now));
395
+ choose(now);
396
+ },
397
+ children: "Today"
398
+ }
399
+ )
400
+ ] })
401
+ ]
402
+ }
403
+ ),
404
+ document.body
405
+ ) : null
406
+ ] });
407
+ }
408
+ function Dialog({
409
+ title,
410
+ open,
411
+ onClose,
412
+ children,
413
+ wide = true
414
+ }) {
415
+ if (!open) {
416
+ return null;
417
+ }
418
+ return /* @__PURE__ */ jsx("div", { className: "dialog-backdrop", onClick: onClose, children: /* @__PURE__ */ jsxs(
419
+ "div",
420
+ {
421
+ className: wide ? "dialog form-dialog" : "dialog",
422
+ role: "dialog",
423
+ "aria-modal": "true",
424
+ "aria-label": title,
425
+ onClick: (event) => event.stopPropagation(),
426
+ children: [
427
+ /* @__PURE__ */ jsxs("div", { className: "dialog-head", children: [
428
+ /* @__PURE__ */ jsx("h2", { children: title }),
429
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onClose, children: "Close" })
430
+ ] }),
431
+ children
432
+ ]
433
+ }
434
+ ) });
435
+ }
436
+ var FormDialog = Dialog;
437
+ function useIsClient() {
438
+ return useSyncExternalStore(
439
+ () => () => {
440
+ },
441
+ () => true,
442
+ () => false
443
+ );
444
+ }
445
+ function SuccessIcon() {
446
+ return /* @__PURE__ */ jsxs("svg", { className: "snackbar-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
447
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9", fill: "none", stroke: "currentColor", strokeWidth: "1.8" }),
448
+ /* @__PURE__ */ jsx(
449
+ "path",
450
+ {
451
+ d: "M8.2 12.2 10.8 14.8 15.8 9.6",
452
+ fill: "none",
453
+ stroke: "currentColor",
454
+ strokeWidth: "1.8",
455
+ strokeLinecap: "round",
456
+ strokeLinejoin: "round"
457
+ }
458
+ )
459
+ ] });
460
+ }
461
+ function AlertIcon() {
462
+ return /* @__PURE__ */ jsxs("svg", { className: "snackbar-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
463
+ /* @__PURE__ */ jsx(
464
+ "path",
465
+ {
466
+ d: "M12 3.8 3.8 19.2h16.4L12 3.8Z",
467
+ fill: "none",
468
+ stroke: "currentColor",
469
+ strokeWidth: "1.8",
470
+ strokeLinejoin: "round"
471
+ }
472
+ ),
473
+ /* @__PURE__ */ jsx("path", { d: "M12 10v4.2", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }),
474
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "16.8", r: "1", fill: "currentColor" })
475
+ ] });
476
+ }
477
+ function Snackbar({
478
+ message,
479
+ success,
480
+ onDismiss
481
+ }) {
482
+ const isClient = useIsClient();
483
+ useEffect(() => {
484
+ if (!message || !onDismiss) {
485
+ return;
486
+ }
487
+ const timeout = window.setTimeout(onDismiss, success ? 3200 : 4800);
488
+ return () => window.clearTimeout(timeout);
489
+ }, [message, success, onDismiss]);
490
+ if (!isClient || !message) {
491
+ return null;
492
+ }
493
+ return createPortal(
494
+ /* @__PURE__ */ jsx("div", { className: "snackbar-host", "aria-live": "polite", children: /* @__PURE__ */ jsxs("div", { className: success ? "snackbar success" : "snackbar", role: "status", children: [
495
+ success ? /* @__PURE__ */ jsx(SuccessIcon, {}) : /* @__PURE__ */ jsx(AlertIcon, {}),
496
+ /* @__PURE__ */ jsx("p", { children: message }),
497
+ onDismiss ? /* @__PURE__ */ jsx("button", { type: "button", className: "snackbar-close", "aria-label": "Dismiss", onClick: onDismiss, children: "\xD7" }) : null
498
+ ] }) }),
499
+ document.body
500
+ );
501
+ }
502
+ var StatusMessage = Snackbar;
503
+ function Topbar({
504
+ title,
505
+ logoSrc,
506
+ logoAlt = "Logo",
507
+ username = "",
508
+ onLogout,
509
+ children
510
+ }) {
511
+ const [menuOpen, setMenuOpen] = useState(false);
512
+ const menuRef = useRef(null);
513
+ const initial = (username || "U").slice(0, 1).toUpperCase();
514
+ useEffect(() => {
515
+ if (!menuOpen) {
516
+ return;
517
+ }
518
+ function onPointerDown(event) {
519
+ if (menuRef.current && !menuRef.current.contains(event.target)) {
520
+ setMenuOpen(false);
521
+ }
522
+ }
523
+ document.addEventListener("mousedown", onPointerDown);
524
+ return () => document.removeEventListener("mousedown", onPointerDown);
525
+ }, [menuOpen]);
526
+ return /* @__PURE__ */ jsxs("header", { className: "topbar", children: [
527
+ /* @__PURE__ */ jsxs("div", { className: "topbar-brand", children: [
528
+ logoSrc ? /* @__PURE__ */ jsx(
529
+ "img",
530
+ {
531
+ className: "topbar-logo",
532
+ src: logoSrc,
533
+ alt: logoAlt,
534
+ onError: (event) => {
535
+ event.currentTarget.hidden = true;
536
+ }
537
+ }
538
+ ) : null,
539
+ /* @__PURE__ */ jsx("h1", { children: title })
540
+ ] }),
541
+ /* @__PURE__ */ jsxs("div", { className: "topbar-actions", ref: menuRef, children: [
542
+ children,
543
+ onLogout ? /* @__PURE__ */ jsxs(Fragment, { children: [
544
+ /* @__PURE__ */ jsx(
545
+ "button",
546
+ {
547
+ type: "button",
548
+ className: "avatar-button",
549
+ "aria-haspopup": "menu",
550
+ "aria-expanded": menuOpen,
551
+ onClick: () => setMenuOpen((open) => !open),
552
+ title: username || "Account",
553
+ children: /* @__PURE__ */ jsx("span", { className: "avatar", children: initial })
554
+ }
555
+ ),
556
+ menuOpen ? /* @__PURE__ */ jsxs("div", { className: "avatar-menu", role: "menu", children: [
557
+ username ? /* @__PURE__ */ jsx("p", { className: "avatar-name", children: username }) : null,
558
+ /* @__PURE__ */ jsx(
559
+ Button,
560
+ {
561
+ variant: "ghost",
562
+ role: "menuitem",
563
+ onClick: () => {
564
+ setMenuOpen(false);
565
+ onLogout();
566
+ },
567
+ children: "Logout"
568
+ }
569
+ )
570
+ ] }) : null
571
+ ] }) : null
572
+ ] })
573
+ ] });
574
+ }
575
+ function SideNav({
576
+ items,
577
+ activeId,
578
+ onSelect,
579
+ label = "Sections"
580
+ }) {
581
+ return /* @__PURE__ */ jsx("nav", { className: "side-nav", "aria-label": label, children: items.map((item) => /* @__PURE__ */ jsx(
582
+ "button",
583
+ {
584
+ type: "button",
585
+ className: activeId === item.id ? "active" : "",
586
+ onClick: () => onSelect(item.id),
587
+ children: item.label
588
+ },
589
+ item.id
590
+ )) });
591
+ }
592
+ var defaultPageSizes = [
593
+ { value: "15", label: "15" },
594
+ { value: "20", label: "20" },
595
+ { value: "50", label: "50" },
596
+ { value: "100", label: "100" },
597
+ { value: "all", label: "All" }
598
+ ];
599
+ function Pagination({
600
+ page,
601
+ pageCount,
602
+ pageSize,
603
+ onPageChange,
604
+ onPageSizeChange,
605
+ summary,
606
+ pageSizeOptions = defaultPageSizes,
607
+ disabled = false
608
+ }) {
609
+ const showAll = pageSize === "all";
610
+ return /* @__PURE__ */ jsxs("div", { className: "table-pagination", children: [
611
+ /* @__PURE__ */ jsxs("label", { className: "page-size", children: [
612
+ "Rows",
613
+ /* @__PURE__ */ jsx(
614
+ Select,
615
+ {
616
+ className: "page-size-select",
617
+ value: pageSize,
618
+ options: pageSizeOptions,
619
+ onChange: onPageSizeChange,
620
+ disabled
621
+ }
622
+ )
623
+ ] }),
624
+ /* @__PURE__ */ jsx("p", { className: "page-summary", children: summary }),
625
+ /* @__PURE__ */ jsxs("div", { className: "page-buttons", children: [
626
+ /* @__PURE__ */ jsx(
627
+ "button",
628
+ {
629
+ type: "button",
630
+ className: "ghost",
631
+ disabled: disabled || showAll || page <= 1,
632
+ onClick: () => onPageChange(page - 1),
633
+ children: "Previous"
634
+ }
635
+ ),
636
+ /* @__PURE__ */ jsxs("span", { className: "page-indicator", children: [
637
+ "Page ",
638
+ showAll ? 1 : page,
639
+ " of ",
640
+ pageCount
641
+ ] }),
642
+ /* @__PURE__ */ jsx(
643
+ "button",
644
+ {
645
+ type: "button",
646
+ className: "ghost",
647
+ disabled: disabled || showAll || page >= pageCount,
648
+ onClick: () => onPageChange(page + 1),
649
+ children: "Next"
650
+ }
651
+ )
652
+ ] })
653
+ ] });
654
+ }
655
+ function FormActions({
656
+ pending,
657
+ editing,
658
+ saveLabel,
659
+ updateLabel,
660
+ newLabel,
661
+ onNew,
662
+ saveDisabled = false,
663
+ replaceSaveWhenEditing = false
664
+ }) {
665
+ if (editing && replaceSaveWhenEditing) {
666
+ return null;
667
+ }
668
+ return /* @__PURE__ */ jsxs("div", { className: "actions", children: [
669
+ /* @__PURE__ */ jsx("button", { type: "submit", disabled: pending || saveDisabled, children: editing && updateLabel ? updateLabel : saveLabel }),
670
+ /* @__PURE__ */ jsx("button", { type: "button", className: "ghost", onClick: onNew, children: newLabel })
671
+ ] });
672
+ }
673
+ function AppShell({
674
+ title,
675
+ logoSrc,
676
+ logoAlt,
677
+ username,
678
+ onLogout,
679
+ navItems,
680
+ activeNavId,
681
+ onNavSelect,
682
+ navLabel = "Sections",
683
+ showBottomNav = true,
684
+ topbarActions,
685
+ children,
686
+ screenClassName = ""
687
+ }) {
688
+ return /* @__PURE__ */ jsxs("div", { className: "aksui-root app-shell", children: [
689
+ /* @__PURE__ */ jsx(Topbar, { title, logoSrc, logoAlt, username, onLogout, children: topbarActions }),
690
+ /* @__PURE__ */ jsxs("div", { className: "app-body", children: [
691
+ /* @__PURE__ */ jsx(SideNav, { items: navItems, activeId: activeNavId, onSelect: onNavSelect, label: navLabel }),
692
+ /* @__PURE__ */ jsx("div", { className: ["screen", screenClassName].filter(Boolean).join(" "), children })
693
+ ] }),
694
+ showBottomNav ? /* @__PURE__ */ jsx("nav", { className: "bottom-nav", "aria-label": navLabel, children: navItems.map((item) => /* @__PURE__ */ jsx(
695
+ "button",
696
+ {
697
+ type: "button",
698
+ className: activeNavId === item.id ? "active" : "",
699
+ onClick: () => onNavSelect(item.id),
700
+ children: item.short ?? item.label
701
+ },
702
+ item.id
703
+ )) }) : null
704
+ ] });
705
+ }
706
+ function useIsClient2() {
707
+ return useSyncExternalStore(
708
+ () => () => {
709
+ },
710
+ () => true,
711
+ () => false
712
+ );
713
+ }
714
+ function compareColumnValues(column, left, right) {
715
+ const leftRaw = column.display ? column.display(left) : column.value(left);
716
+ const rightRaw = column.display ? column.display(right) : column.value(right);
717
+ if (leftRaw === null || leftRaw === void 0 || leftRaw === "") {
718
+ return rightRaw === null || rightRaw === void 0 || rightRaw === "" ? 0 : 1;
719
+ }
720
+ if (rightRaw === null || rightRaw === void 0 || rightRaw === "") {
721
+ return -1;
722
+ }
723
+ if (typeof leftRaw === "number" && typeof rightRaw === "number") {
724
+ return leftRaw - rightRaw;
725
+ }
726
+ const leftText = String(leftRaw);
727
+ const rightText = String(rightRaw);
728
+ const leftNumber = Number(leftText);
729
+ const rightNumber = Number(rightText);
730
+ if (leftText.trim() !== "" && rightText.trim() !== "" && Number.isFinite(leftNumber) && Number.isFinite(rightNumber) && /^-?\d+(\.\d+)?$/.test(leftText.trim()) && /^-?\d+(\.\d+)?$/.test(rightText.trim())) {
731
+ return leftNumber - rightNumber;
732
+ }
733
+ return leftText.localeCompare(rightText, void 0, { sensitivity: "base", numeric: true });
734
+ }
735
+ function PlusIcon() {
736
+ return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M10 4v12M4 10h12", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) });
737
+ }
738
+ function FilterIcon() {
739
+ return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M3 5h14M5.5 10h9M8 15h4", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) });
740
+ }
741
+ function ResetIcon() {
742
+ return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 20 20", "aria-hidden": "true", children: [
743
+ /* @__PURE__ */ jsx("path", { d: "M4.5 8.2A6 6 0 1 1 4.8 13", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }),
744
+ /* @__PURE__ */ jsx("path", { d: "M4.5 4.2v4h4", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" })
745
+ ] });
746
+ }
747
+ function ChevronIcon({ open }) {
748
+ return /* @__PURE__ */ jsx("svg", { className: open ? "side-rail-chevron open" : "side-rail-chevron", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M8 4.5 13.5 10 8 15.5", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) });
749
+ }
750
+ function PreviewIcon() {
751
+ return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 20 20", "aria-hidden": "true", children: [
752
+ /* @__PURE__ */ jsx("path", { d: "M2.8 10S5.5 4.8 10 4.8 17.2 10 17.2 10 14.5 15.2 10 15.2 2.8 10 2.8 10Z", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
753
+ /* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "2.4", fill: "none", stroke: "currentColor", strokeWidth: "1.6" })
754
+ ] });
755
+ }
756
+ function DetailList({ lines }) {
757
+ return /* @__PURE__ */ jsx("dl", { className: "record-detail-list", children: lines.map((line) => /* @__PURE__ */ jsxs("div", { className: "record-detail-row", children: [
758
+ /* @__PURE__ */ jsx("dt", { children: line.label }),
759
+ /* @__PURE__ */ jsx("dd", { children: line.value })
760
+ ] }, line.label)) });
761
+ }
762
+ function RecordWorkspace({
763
+ title,
764
+ columns,
765
+ items,
766
+ rowKey,
767
+ empty,
768
+ onAdd,
769
+ addLabel = "Add",
770
+ canAdd = true,
771
+ onView,
772
+ onUpdate,
773
+ onDelete,
774
+ canUpdate,
775
+ canDelete,
776
+ toolbar,
777
+ form
778
+ }) {
779
+ const filterableColumns = columns.filter((column) => column.filterable !== false);
780
+ const [filters, setFilters] = useState({});
781
+ const [sort, setSort] = useState(null);
782
+ const [sideOpen, setSideOpen] = useState(false);
783
+ const [previewEnabled, setPreviewEnabled] = useState(false);
784
+ const [previewKey, setPreviewKey] = useState(null);
785
+ const [tooltip, setTooltip] = useState(null);
786
+ const [pageSize, setPageSize] = useState("15");
787
+ const [page, setPage] = useState(1);
788
+ const isClient = useIsClient2();
789
+ const filtered = useMemo(() => {
790
+ const activeFilters = columns.filter((column) => column.filterable !== false);
791
+ return items.filter(
792
+ (item) => activeFilters.every((column) => {
793
+ const query = (filters[column.key] ?? "").trim();
794
+ if (!query) {
795
+ return true;
796
+ }
797
+ const raw = column.value(item);
798
+ const text = raw === null || raw === void 0 ? "" : String(raw);
799
+ if (column.filterOptions) {
800
+ return text === query;
801
+ }
802
+ return text.toLowerCase().includes(query.toLowerCase());
803
+ })
804
+ );
805
+ }, [items, filters, columns]);
806
+ const sorted = useMemo(() => {
807
+ if (!sort) {
808
+ return filtered;
809
+ }
810
+ const column = columns.find((entry) => entry.key === sort.key);
811
+ if (!column || column.sortable === false) {
812
+ return filtered;
813
+ }
814
+ const direction = sort.direction === "asc" ? 1 : -1;
815
+ return [...filtered].sort((left, right) => compareColumnValues(column, left, right) * direction);
816
+ }, [filtered, sort, columns]);
817
+ const activeFilterCount = useMemo(
818
+ () => filterableColumns.reduce((count, column) => count + ((filters[column.key] ?? "").trim() ? 1 : 0), 0),
819
+ [filterableColumns, filters]
820
+ );
821
+ const showAll = pageSize === "all";
822
+ const numericPageSize = showAll ? Math.max(sorted.length, 1) : Number(pageSize);
823
+ const pageCount = showAll ? 1 : Math.max(1, Math.ceil(sorted.length / numericPageSize));
824
+ const currentPage = Math.min(page, pageCount);
825
+ const start = showAll ? 0 : (currentPage - 1) * numericPageSize;
826
+ const pageItems = showAll ? sorted : sorted.slice(start, start + numericPageSize);
827
+ const showAdd = canAdd && Boolean(onAdd);
828
+ const showFilters = filterableColumns.length > 0;
829
+ const previewItem = previewKey === null ? null : sorted.find((item) => rowKey(item) === previewKey) ?? null;
830
+ function cellText(column, item) {
831
+ const raw = column.display ? column.display(item) : column.value(item);
832
+ return raw === null || raw === void 0 || raw === "" ? "\u2014" : String(raw);
833
+ }
834
+ function detailLines(item) {
835
+ return columns.map((column) => ({
836
+ label: column.header,
837
+ value: cellText(column, item)
838
+ }));
839
+ }
840
+ const previewTitle = previewItem && columns[0] ? cellText(columns[0], previewItem) : null;
841
+ function changeFilter(key, value) {
842
+ setFilters((current) => ({ ...current, [key]: value }));
843
+ setPage(1);
844
+ }
845
+ function clearFilters() {
846
+ setFilters({});
847
+ setPage(1);
848
+ }
849
+ function toggleSort(column) {
850
+ if (column.sortable === false) {
851
+ return;
852
+ }
853
+ setSort((current) => {
854
+ if (!current || current.key !== column.key) {
855
+ return { key: column.key, direction: "asc" };
856
+ }
857
+ if (current.direction === "asc") {
858
+ return { key: column.key, direction: "desc" };
859
+ }
860
+ return null;
861
+ });
862
+ setPage(1);
863
+ }
864
+ function setPreviewEnabledValue(enabled) {
865
+ setPreviewEnabled(enabled);
866
+ setTooltip(null);
867
+ if (!enabled) {
868
+ setPreviewKey(null);
869
+ }
870
+ }
871
+ function focusRecord(item) {
872
+ if (previewEnabled) {
873
+ setPreviewKey(rowKey(item));
874
+ }
875
+ }
876
+ function showTooltip(item, event) {
877
+ const padding = 16;
878
+ const width = 280;
879
+ const x = Math.min(event.clientX + 14, window.innerWidth - width - padding);
880
+ const y = Math.min(event.clientY + 14, window.innerHeight - padding - 24);
881
+ setTooltip({ x, y, lines: detailLines(item) });
882
+ }
883
+ const summary = sorted.length === 0 ? "0 records" : showAll ? `1\u2013${sorted.length} of ${sorted.length}` : `${start + 1}\u2013${Math.min(start + numericPageSize, sorted.length)} of ${sorted.length}`;
884
+ return /* @__PURE__ */ jsxs("div", { className: "list-workspace", "aria-label": title, children: [
885
+ /* @__PURE__ */ jsxs(
886
+ "div",
887
+ {
888
+ className: ["list-body", sideOpen ? "side-open" : "", previewEnabled ? "preview-open" : ""].filter(Boolean).join(" "),
889
+ children: [
890
+ /* @__PURE__ */ jsx("div", { className: "list-main", children: /* @__PURE__ */ jsxs("section", { className: "table-card", children: [
891
+ toolbar ? /* @__PURE__ */ jsx("div", { className: "table-card-bar", children: /* @__PURE__ */ jsx("div", { className: "table-card-context", children: toolbar }) }) : null,
892
+ /* @__PURE__ */ jsx("div", { className: "table-wrap", children: /* @__PURE__ */ jsxs("table", { className: "data-table", children: [
893
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
894
+ columns.map((column) => {
895
+ const sortable = column.sortable !== false;
896
+ const active = sort?.key === column.key ? sort.direction : null;
897
+ return /* @__PURE__ */ jsx(
898
+ "th",
899
+ {
900
+ "aria-sort": active === "asc" ? "ascending" : active === "desc" ? "descending" : "none",
901
+ children: sortable ? /* @__PURE__ */ jsxs(
902
+ "button",
903
+ {
904
+ type: "button",
905
+ className: active ? `sort-header active ${active}` : "sort-header",
906
+ onClick: () => toggleSort(column),
907
+ children: [
908
+ /* @__PURE__ */ jsx("span", { children: column.header }),
909
+ /* @__PURE__ */ jsx("span", { className: "sort-indicator", "aria-hidden": "true", children: active === "asc" ? "\u25B2" : active === "desc" ? "\u25BC" : "\u2195" })
910
+ ]
911
+ }
912
+ ) : column.header
913
+ },
914
+ column.key
915
+ );
916
+ }),
917
+ /* @__PURE__ */ jsx("th", { className: "actions-col", children: "Actions" })
918
+ ] }) }),
919
+ /* @__PURE__ */ jsx("tbody", { children: pageItems.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: columns.length + 1, children: /* @__PURE__ */ jsx("p", { className: "hint table-empty", children: items.length === 0 ? empty : "No records match the current filters." }) }) }) : pageItems.map((item) => {
920
+ const key = rowKey(item);
921
+ const updateAllowed = canUpdate ? canUpdate(item) : Boolean(onUpdate);
922
+ const deleteAllowed = canDelete ? canDelete(item) : Boolean(onDelete);
923
+ const selected = previewEnabled && previewKey === key;
924
+ return /* @__PURE__ */ jsxs(
925
+ "tr",
926
+ {
927
+ className: selected ? "data-row selected" : "data-row",
928
+ onMouseEnter: (event) => {
929
+ if (!previewEnabled) {
930
+ showTooltip(item, event);
931
+ }
932
+ focusRecord(item);
933
+ },
934
+ onMouseMove: (event) => {
935
+ if (!previewEnabled) {
936
+ showTooltip(item, event);
937
+ }
938
+ },
939
+ onMouseLeave: () => setTooltip(null),
940
+ onClick: () => focusRecord(item),
941
+ children: [
942
+ columns.map((column) => /* @__PURE__ */ jsx("td", { children: cellText(column, item) }, column.key)),
943
+ /* @__PURE__ */ jsx("td", { className: "actions-col", onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsxs("div", { className: "row-actions", children: [
944
+ onView ? /* @__PURE__ */ jsx("button", { type: "button", className: "ghost row-action", onClick: () => onView(item), children: "View" }) : null,
945
+ onUpdate ? /* @__PURE__ */ jsx(
946
+ "button",
947
+ {
948
+ type: "button",
949
+ className: "ghost row-action",
950
+ disabled: !updateAllowed,
951
+ title: updateAllowed ? "Update" : "Update is not available",
952
+ onClick: () => onUpdate(item),
953
+ children: "Update"
954
+ }
955
+ ) : null,
956
+ onDelete ? /* @__PURE__ */ jsx(
957
+ "button",
958
+ {
959
+ type: "button",
960
+ className: "ghost row-action danger",
961
+ disabled: !deleteAllowed,
962
+ title: deleteAllowed ? "Delete" : "Delete is not available",
963
+ onClick: () => onDelete(item),
964
+ children: "Delete"
965
+ }
966
+ ) : null
967
+ ] }) })
968
+ ]
969
+ },
970
+ key
971
+ );
972
+ }) })
973
+ ] }) }),
974
+ /* @__PURE__ */ jsx(
975
+ Pagination,
976
+ {
977
+ page: currentPage,
978
+ pageCount,
979
+ pageSize,
980
+ onPageChange: setPage,
981
+ onPageSizeChange: (value) => {
982
+ setPageSize(value);
983
+ setPage(1);
984
+ },
985
+ summary
986
+ }
987
+ )
988
+ ] }) }),
989
+ previewEnabled ? /* @__PURE__ */ jsxs("aside", { className: "preview-panel", "aria-label": "Record preview", children: [
990
+ /* @__PURE__ */ jsx("div", { className: "preview-panel-head", children: /* @__PURE__ */ jsxs("div", { children: [
991
+ /* @__PURE__ */ jsx("p", { className: "preview-kicker", children: "Preview" }),
992
+ /* @__PURE__ */ jsx("h3", { children: previewTitle ?? "No record selected" })
993
+ ] }) }),
994
+ /* @__PURE__ */ jsx("div", { className: "preview-panel-body", children: previewItem ? /* @__PURE__ */ jsx(DetailList, { lines: detailLines(previewItem) }) : /* @__PURE__ */ jsx("p", { className: "preview-empty", children: "Hover or click a row to preview its details here." }) })
995
+ ] }) : null,
996
+ /* @__PURE__ */ jsxs("aside", { className: sideOpen ? "side-rail open" : "side-rail", "aria-label": "Actions and filters", children: [
997
+ /* @__PURE__ */ jsxs(
998
+ "button",
999
+ {
1000
+ type: "button",
1001
+ className: "ghost side-rail-toggle",
1002
+ "aria-expanded": sideOpen,
1003
+ title: sideOpen ? "Collapse" : "Expand",
1004
+ onClick: () => setSideOpen((open) => !open),
1005
+ children: [
1006
+ /* @__PURE__ */ jsx(ChevronIcon, { open: sideOpen }),
1007
+ sideOpen ? /* @__PURE__ */ jsx("span", { children: "Collapse" }) : null
1008
+ ]
1009
+ }
1010
+ ),
1011
+ sideOpen ? /* @__PURE__ */ jsxs("div", { className: "side-rail-body", children: [
1012
+ /* @__PURE__ */ jsxs("div", { className: "preview-check", children: [
1013
+ /* @__PURE__ */ jsx(
1014
+ "input",
1015
+ {
1016
+ type: "checkbox",
1017
+ checked: previewEnabled,
1018
+ onChange: (event) => setPreviewEnabledValue(event.target.checked),
1019
+ "aria-label": "Preview"
1020
+ }
1021
+ ),
1022
+ /* @__PURE__ */ jsx(PreviewIcon, {}),
1023
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "Preview" })
1024
+ ] }),
1025
+ showAdd ? /* @__PURE__ */ jsxs("button", { type: "button", className: "side-rail-add", onClick: onAdd, children: [
1026
+ /* @__PURE__ */ jsx(PlusIcon, {}),
1027
+ /* @__PURE__ */ jsx("span", { children: addLabel })
1028
+ ] }) : null,
1029
+ showFilters ? /* @__PURE__ */ jsxs("div", { className: "side-rail-filters", children: [
1030
+ /* @__PURE__ */ jsxs("div", { className: "filter-panel-head", children: [
1031
+ /* @__PURE__ */ jsx("h3", { children: "Filters" }),
1032
+ /* @__PURE__ */ jsxs(
1033
+ "button",
1034
+ {
1035
+ type: "button",
1036
+ className: "ghost filter-clear",
1037
+ title: "Reset filters",
1038
+ "aria-label": "Reset filters",
1039
+ disabled: activeFilterCount === 0,
1040
+ onClick: clearFilters,
1041
+ children: [
1042
+ /* @__PURE__ */ jsx(ResetIcon, {}),
1043
+ /* @__PURE__ */ jsx("span", { children: "Reset" })
1044
+ ]
1045
+ }
1046
+ )
1047
+ ] }),
1048
+ /* @__PURE__ */ jsx("div", { className: "filter-panel-stack", children: filterableColumns.map((column) => /* @__PURE__ */ jsxs("label", { children: [
1049
+ column.header,
1050
+ column.filterOptions ? /* @__PURE__ */ jsx(
1051
+ Select,
1052
+ {
1053
+ value: filters[column.key] ?? "",
1054
+ options: [{ value: "", label: column.filterPlaceholder ?? "All" }, ...column.filterOptions],
1055
+ onChange: (value) => changeFilter(column.key, value),
1056
+ placeholder: column.filterPlaceholder ?? "All"
1057
+ }
1058
+ ) : /* @__PURE__ */ jsx(
1059
+ "input",
1060
+ {
1061
+ value: filters[column.key] ?? "",
1062
+ onChange: (event) => changeFilter(column.key, event.target.value),
1063
+ placeholder: `Filter ${column.header.toLowerCase()}`
1064
+ }
1065
+ )
1066
+ ] }, column.key)) })
1067
+ ] }) : null
1068
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "side-rail-icons", children: [
1069
+ /* @__PURE__ */ jsxs("label", { className: "side-rail-icon preview-check-icon", title: "Preview", children: [
1070
+ /* @__PURE__ */ jsx(
1071
+ "input",
1072
+ {
1073
+ type: "checkbox",
1074
+ checked: previewEnabled,
1075
+ onChange: (event) => setPreviewEnabledValue(event.target.checked),
1076
+ "aria-label": "Preview"
1077
+ }
1078
+ ),
1079
+ /* @__PURE__ */ jsx(PreviewIcon, {})
1080
+ ] }),
1081
+ showAdd ? /* @__PURE__ */ jsx("button", { type: "button", className: "ghost side-rail-icon", title: addLabel, "aria-label": addLabel, onClick: onAdd, children: /* @__PURE__ */ jsx(PlusIcon, {}) }) : null,
1082
+ showFilters ? /* @__PURE__ */ jsxs(
1083
+ "button",
1084
+ {
1085
+ type: "button",
1086
+ className: "ghost side-rail-icon",
1087
+ title: "Show filters",
1088
+ "aria-label": "Show filters",
1089
+ onClick: () => setSideOpen(true),
1090
+ children: [
1091
+ /* @__PURE__ */ jsx(FilterIcon, {}),
1092
+ activeFilterCount > 0 ? /* @__PURE__ */ jsx("span", { className: "filter-badge", children: activeFilterCount }) : null
1093
+ ]
1094
+ }
1095
+ ) : null,
1096
+ showFilters ? /* @__PURE__ */ jsx(
1097
+ "button",
1098
+ {
1099
+ type: "button",
1100
+ className: "ghost side-rail-icon",
1101
+ title: "Reset filters",
1102
+ "aria-label": "Reset filters",
1103
+ disabled: activeFilterCount === 0,
1104
+ onClick: clearFilters,
1105
+ children: /* @__PURE__ */ jsx(ResetIcon, {})
1106
+ }
1107
+ ) : null
1108
+ ] })
1109
+ ] })
1110
+ ]
1111
+ }
1112
+ ),
1113
+ form,
1114
+ isClient && tooltip && !previewEnabled ? createPortal(
1115
+ /* @__PURE__ */ jsxs("div", { className: "record-tooltip", style: { left: tooltip.x, top: tooltip.y }, role: "tooltip", children: [
1116
+ /* @__PURE__ */ jsx("p", { className: "record-tooltip-title", children: title }),
1117
+ /* @__PURE__ */ jsx(DetailList, { lines: tooltip.lines })
1118
+ ] }),
1119
+ document.body
1120
+ ) : null
1121
+ ] });
1122
+ }
1123
+ var RecordTable = RecordWorkspace;
1124
+
1125
+ export { AppSelect, AppShell, Button, DateField, Dialog, FormActions, FormDialog, Pagination, RecordTable, RecordWorkspace, Select, SideNav, Snackbar, StatusMessage, Topbar, aksuiThemeVersion, aksuiTokens };
1126
+ //# sourceMappingURL=index.js.map
1127
+ //# sourceMappingURL=index.js.map