@almadar/ui 5.130.0 → 5.132.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/avl/index.cjs +266 -186
- package/dist/avl/index.js +266 -186
- package/dist/components/index.cjs +270 -188
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +270 -189
- package/dist/hooks/index.cjs +16 -0
- package/dist/hooks/index.d.cts +10 -1
- package/dist/hooks/index.d.ts +10 -1
- package/dist/hooks/index.js +16 -1
- package/dist/marketing/index.cjs +4 -2
- package/dist/marketing/index.js +4 -2
- package/dist/providers/index.cjs +266 -186
- package/dist/providers/index.js +266 -186
- package/dist/runtime/index.cjs +266 -186
- package/dist/runtime/index.js +266 -186
- package/package.json +3 -3
package/dist/avl/index.cjs
CHANGED
|
@@ -5126,7 +5126,7 @@ var init_Button = __esm({
|
|
|
5126
5126
|
"cursor-pointer",
|
|
5127
5127
|
"chrome-button",
|
|
5128
5128
|
"transition-all duration-normal",
|
|
5129
|
-
"focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
|
|
5129
|
+
"focus:outline-none focus-visible:ring-[length:var(--focus-ring-width)] focus-visible:ring-ring focus-visible:ring-offset-[length:var(--focus-ring-offset)]",
|
|
5130
5130
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
5131
5131
|
variantStyles2[variant],
|
|
5132
5132
|
sizeStyles[size],
|
|
@@ -5723,6 +5723,8 @@ var init_Badge = __esm({
|
|
|
5723
5723
|
};
|
|
5724
5724
|
const iconPx = size === "lg" ? 20 : 16;
|
|
5725
5725
|
const resolvedIcon = iconAsset?.url ? /* @__PURE__ */ jsxRuntime.jsx(AtlasImage, { asset: iconAsset, size: iconPx, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : typeof icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, className: iconSizes3[size] }) : icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon, className: iconSizes3[size] }) : null;
|
|
5726
|
+
const hasText = Boolean(children) || amount != null || label !== void 0 && label !== null && label !== "";
|
|
5727
|
+
if (!hasText && !resolvedIcon && !onRemove) return null;
|
|
5726
5728
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5727
5729
|
"span",
|
|
5728
5730
|
{
|
|
@@ -5749,7 +5751,7 @@ var init_Badge = __esm({
|
|
|
5749
5751
|
},
|
|
5750
5752
|
className: cn(
|
|
5751
5753
|
"inline-flex items-center justify-center rounded-sm",
|
|
5752
|
-
"hover:bg-foreground/10 focus:outline-none focus:ring-1 focus:ring-ring",
|
|
5754
|
+
"hover:bg-foreground/10 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
5753
5755
|
"transition-colors",
|
|
5754
5756
|
size === "sm" ? "w-4 h-4 ml-0.5" : size === "md" ? "w-5 h-5 ml-1" : "w-6 h-6 ml-1"
|
|
5755
5757
|
),
|
|
@@ -7107,7 +7109,7 @@ function NativeSelect({
|
|
|
7107
7109
|
"block w-full border-[length:var(--border-width)] shadow-sm appearance-none",
|
|
7108
7110
|
"px-3 py-2 pr-10 text-sm text-foreground font-medium",
|
|
7109
7111
|
"bg-card",
|
|
7110
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-ring",
|
|
7112
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-ring",
|
|
7111
7113
|
"disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed",
|
|
7112
7114
|
error ? "border-error focus:border-error" : "border-border focus:border-primary",
|
|
7113
7115
|
className
|
|
@@ -7214,7 +7216,7 @@ function RichSelect({
|
|
|
7214
7216
|
"block w-full border-[length:var(--border-width)] shadow-sm",
|
|
7215
7217
|
"px-3 py-2 pr-10 text-sm text-start font-medium",
|
|
7216
7218
|
"bg-card rounded-sm",
|
|
7217
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-ring",
|
|
7219
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-ring",
|
|
7218
7220
|
"disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed",
|
|
7219
7221
|
error ? "border-error focus:border-error" : "border-border focus:border-primary",
|
|
7220
7222
|
!hasValue && "text-muted-foreground"
|
|
@@ -8137,9 +8139,9 @@ var init_Radio = __esm({
|
|
|
8137
8139
|
"flex items-center justify-center",
|
|
8138
8140
|
"border-[length:var(--border-width)] transition-all cursor-pointer",
|
|
8139
8141
|
sizeClasses4[size],
|
|
8140
|
-
hasError ? "border-error peer-focus:ring-error/20" : "border-border peer-focus:ring-ring/20",
|
|
8142
|
+
hasError ? "border-error peer-focus-visible:ring-error/20" : "border-border peer-focus-visible:ring-ring/20",
|
|
8141
8143
|
isChecked2 ? hasError ? "border-error" : "border-primary bg-primary" : "",
|
|
8142
|
-
"peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-offset-2",
|
|
8144
|
+
"peer-focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2",
|
|
8143
8145
|
disabled && "opacity-50 cursor-not-allowed",
|
|
8144
8146
|
!disabled && "hover:border-[var(--color-border-hover)]"
|
|
8145
8147
|
),
|
|
@@ -8525,7 +8527,7 @@ var init_ThemeToggle = __esm({
|
|
|
8525
8527
|
"inline-flex items-center justify-center gap-2",
|
|
8526
8528
|
"text-foreground",
|
|
8527
8529
|
"hover:bg-muted border-[length:var(--border-width)] border-transparent hover:border-border",
|
|
8528
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8530
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
8529
8531
|
"transition-colors duration-fast",
|
|
8530
8532
|
sizeClasses5[size],
|
|
8531
8533
|
className
|
|
@@ -8960,11 +8962,13 @@ var init_TrendIndicator = __esm({
|
|
|
8960
8962
|
size = "md",
|
|
8961
8963
|
...props
|
|
8962
8964
|
}, ref) => {
|
|
8963
|
-
const
|
|
8965
|
+
const hasValue = typeof value === "number" && Number.isFinite(value);
|
|
8966
|
+
if (!hasValue && !direction) return null;
|
|
8967
|
+
const dir = resolveDirection(hasValue ? value : void 0, direction);
|
|
8964
8968
|
const colorClass = resolveColor(dir, invert);
|
|
8965
8969
|
const iconName = iconNameMap[dir];
|
|
8966
8970
|
const styles = sizeStyles6[size];
|
|
8967
|
-
const formattedValue =
|
|
8971
|
+
const formattedValue = hasValue ? `${value > 0 ? "+" : ""}${value}%` : void 0;
|
|
8968
8972
|
const ariaLabel = label ?? (formattedValue ? `${dir} ${formattedValue}` : dir);
|
|
8969
8973
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8970
8974
|
"span",
|
|
@@ -14912,10 +14916,12 @@ var init_Container = __esm({
|
|
|
14912
14916
|
};
|
|
14913
14917
|
paddingStyles3 = {
|
|
14914
14918
|
none: "px-0",
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
+
// Mobile-tighter, desktop-identical: fixed px-6 on a 360px phone eats ~13% of
|
|
14920
|
+
// the viewport, so each token steps down below the sm breakpoint.
|
|
14921
|
+
sm: "px-3 sm:px-4",
|
|
14922
|
+
md: "px-4 sm:px-6",
|
|
14923
|
+
lg: "px-4 sm:px-6 md:px-8",
|
|
14924
|
+
xl: "px-4 sm:px-8 md:px-12"
|
|
14919
14925
|
};
|
|
14920
14926
|
Container = ({
|
|
14921
14927
|
size,
|
|
@@ -15614,7 +15620,7 @@ var init_Accordion = __esm({
|
|
|
15614
15620
|
"bg-card",
|
|
15615
15621
|
"hover:bg-muted",
|
|
15616
15622
|
"transition-colors duration-fast",
|
|
15617
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-inset",
|
|
15623
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
15618
15624
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
15619
15625
|
isOpen && "bg-muted font-bold"
|
|
15620
15626
|
),
|
|
@@ -20384,26 +20390,19 @@ var init_BookViewer = __esm({
|
|
|
20384
20390
|
function BoxPattern({
|
|
20385
20391
|
p,
|
|
20386
20392
|
m,
|
|
20387
|
-
|
|
20388
|
-
|
|
20389
|
-
|
|
20390
|
-
|
|
20391
|
-
|
|
20392
|
-
style,
|
|
20393
|
-
children
|
|
20393
|
+
radius,
|
|
20394
|
+
isLoading: _isLoading,
|
|
20395
|
+
error: _error,
|
|
20396
|
+
entity: _entity,
|
|
20397
|
+
...boxProps
|
|
20394
20398
|
}) {
|
|
20395
20399
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20396
20400
|
Box,
|
|
20397
20401
|
{
|
|
20398
|
-
padding: p,
|
|
20399
|
-
margin: m,
|
|
20400
|
-
|
|
20401
|
-
|
|
20402
|
-
rounded: radius,
|
|
20403
|
-
shadow,
|
|
20404
|
-
className,
|
|
20405
|
-
style,
|
|
20406
|
-
children
|
|
20402
|
+
padding: boxProps.padding ?? p,
|
|
20403
|
+
margin: boxProps.margin ?? m,
|
|
20404
|
+
rounded: boxProps.rounded ?? radius,
|
|
20405
|
+
...boxProps
|
|
20407
20406
|
}
|
|
20408
20407
|
);
|
|
20409
20408
|
}
|
|
@@ -20992,7 +20991,7 @@ var init_Breadcrumb = __esm({
|
|
|
20992
20991
|
},
|
|
20993
20992
|
className: cn(
|
|
20994
20993
|
"flex items-center gap-1.5 transition-colors",
|
|
20995
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
20994
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
20996
20995
|
isLast ? "text-foreground font-bold cursor-default" : "text-muted-foreground hover:text-foreground"
|
|
20997
20996
|
),
|
|
20998
20997
|
"aria-current": isLast ? "page" : void 0,
|
|
@@ -24094,17 +24093,19 @@ var init_DashboardLayout = __esm({
|
|
|
24094
24093
|
const [sidebarOpen, setSidebarOpen] = React91.useState(false);
|
|
24095
24094
|
const [userMenuOpen, setUserMenuOpen] = React91.useState(false);
|
|
24096
24095
|
const layoutRef = React91.useRef(null);
|
|
24097
|
-
const [
|
|
24096
|
+
const [layoutWidth, setLayoutWidth] = React91.useState(null);
|
|
24098
24097
|
React91.useEffect(() => {
|
|
24099
24098
|
const el = layoutRef.current;
|
|
24100
24099
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
24101
24100
|
const ro = new ResizeObserver((entries) => {
|
|
24102
24101
|
const w = entries[0]?.contentRect.width ?? el.clientWidth;
|
|
24103
|
-
|
|
24102
|
+
setLayoutWidth(w);
|
|
24104
24103
|
});
|
|
24105
24104
|
ro.observe(el);
|
|
24106
24105
|
return () => ro.disconnect();
|
|
24107
24106
|
}, []);
|
|
24107
|
+
const isMobile = layoutWidth !== null && layoutWidth < 768;
|
|
24108
|
+
const isRail = layoutWidth !== null && layoutWidth >= 768 && layoutWidth < 1024;
|
|
24108
24109
|
React91.useEffect(() => {
|
|
24109
24110
|
if (!isMobile && sidebarOpen) setSidebarOpen(false);
|
|
24110
24111
|
}, [isMobile, sidebarOpen]);
|
|
@@ -24137,7 +24138,8 @@ var init_DashboardLayout = __esm({
|
|
|
24137
24138
|
{
|
|
24138
24139
|
as: "aside",
|
|
24139
24140
|
className: cn(
|
|
24140
|
-
"z-30
|
|
24141
|
+
"z-30 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
24142
|
+
isRail ? "w-16" : "w-64",
|
|
24141
24143
|
"flex flex-col"
|
|
24142
24144
|
),
|
|
24143
24145
|
style: isMobile ? {
|
|
@@ -24153,10 +24155,10 @@ var init_DashboardLayout = __esm({
|
|
|
24153
24155
|
HStack,
|
|
24154
24156
|
{
|
|
24155
24157
|
align: "center",
|
|
24156
|
-
justify: "between",
|
|
24157
|
-
className: "h-16
|
|
24158
|
+
justify: isRail ? "center" : "between",
|
|
24159
|
+
className: cn("h-16 border-b border-border dark:border-border", isRail ? "px-2" : "px-4"),
|
|
24158
24160
|
children: [
|
|
24159
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: "/", className: "flex items-center gap-2", children: [
|
|
24161
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: "/", className: "flex items-center gap-2", title: isRail ? appName : void 0, children: [
|
|
24160
24162
|
logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-8 h-8 bg-primary rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
24161
24163
|
Typography,
|
|
24162
24164
|
{
|
|
@@ -24166,7 +24168,7 @@ var init_DashboardLayout = __esm({
|
|
|
24166
24168
|
children: appName.charAt(0).toUpperCase()
|
|
24167
24169
|
}
|
|
24168
24170
|
) }),
|
|
24169
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24171
|
+
!isRail && /* @__PURE__ */ jsxRuntime.jsx(
|
|
24170
24172
|
Typography,
|
|
24171
24173
|
{
|
|
24172
24174
|
variant: "label",
|
|
@@ -24193,12 +24195,13 @@ var init_DashboardLayout = __esm({
|
|
|
24193
24195
|
{
|
|
24194
24196
|
as: "nav",
|
|
24195
24197
|
gap: "none",
|
|
24196
|
-
className: "flex-1
|
|
24198
|
+
className: cn("flex-1 py-4 space-y-1 overflow-y-auto", isRail ? "px-2" : "px-3"),
|
|
24197
24199
|
children: navItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
24198
24200
|
NavLink,
|
|
24199
24201
|
{
|
|
24200
24202
|
item,
|
|
24201
|
-
currentPath: activePath
|
|
24203
|
+
currentPath: activePath,
|
|
24204
|
+
compact: isRail
|
|
24202
24205
|
},
|
|
24203
24206
|
item.href
|
|
24204
24207
|
))
|
|
@@ -24453,13 +24456,40 @@ var init_DashboardLayout = __esm({
|
|
|
24453
24456
|
DashboardLayout.displayName = "DashboardLayout";
|
|
24454
24457
|
NavLink = ({
|
|
24455
24458
|
item,
|
|
24456
|
-
currentPath
|
|
24459
|
+
currentPath,
|
|
24460
|
+
compact = false
|
|
24457
24461
|
}) => {
|
|
24458
24462
|
const isActive = currentPath === item.href || currentPath.startsWith(item.href + "/");
|
|
24459
24463
|
const iconClassName = cn(
|
|
24460
24464
|
"h-5 w-5",
|
|
24461
24465
|
isActive ? "text-primary-foreground" : "text-muted-foreground"
|
|
24462
24466
|
);
|
|
24467
|
+
if (compact) {
|
|
24468
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24469
|
+
reactRouterDom.Link,
|
|
24470
|
+
{
|
|
24471
|
+
to: item.href,
|
|
24472
|
+
title: item.label,
|
|
24473
|
+
"aria-label": item.label,
|
|
24474
|
+
className: cn(
|
|
24475
|
+
"flex items-center justify-center px-2 py-2 rounded-lg transition-colors",
|
|
24476
|
+
isActive ? "bg-primary text-primary-foreground shadow-sm" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
24477
|
+
),
|
|
24478
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { as: "span", className: "relative inline-flex", children: [
|
|
24479
|
+
item.icon ? typeof item.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: item.icon, className: iconClassName }) : /* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: iconClassName }) : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-semibold", as: "span", children: item.label.charAt(0).toUpperCase() }),
|
|
24480
|
+
item.badge && /* @__PURE__ */ jsxRuntime.jsx(
|
|
24481
|
+
Badge,
|
|
24482
|
+
{
|
|
24483
|
+
variant: isActive ? "primary" : "default",
|
|
24484
|
+
size: "sm",
|
|
24485
|
+
className: "absolute -top-2 -right-2 px-1 py-0 text-[10px] leading-4",
|
|
24486
|
+
children: item.badge
|
|
24487
|
+
}
|
|
24488
|
+
)
|
|
24489
|
+
] })
|
|
24490
|
+
}
|
|
24491
|
+
);
|
|
24492
|
+
}
|
|
24463
24493
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
24464
24494
|
reactRouterDom.Link,
|
|
24465
24495
|
{
|
|
@@ -25525,40 +25555,55 @@ function DataGrid({
|
|
|
25525
25555
|
{
|
|
25526
25556
|
"data-entity-row": true,
|
|
25527
25557
|
"data-entity-id": id,
|
|
25528
|
-
className: cn(isSelected && "ring-2 ring-primary rounded-lg"),
|
|
25558
|
+
className: cn("relative group/rowactions", isSelected && "ring-2 ring-primary rounded-lg"),
|
|
25529
25559
|
children: [
|
|
25530
25560
|
children(itemData, index),
|
|
25531
|
-
actionDefs.length > 0 && /* @__PURE__ */ jsxRuntime.
|
|
25532
|
-
|
|
25533
|
-
|
|
25534
|
-
|
|
25535
|
-
|
|
25536
|
-
|
|
25537
|
-
|
|
25538
|
-
|
|
25539
|
-
|
|
25540
|
-
|
|
25541
|
-
|
|
25542
|
-
|
|
25543
|
-
|
|
25544
|
-
|
|
25545
|
-
|
|
25546
|
-
|
|
25547
|
-
|
|
25548
|
-
|
|
25561
|
+
actionDefs.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "absolute top-2 right-2 z-10 opacity-0 group-hover/rowactions:opacity-100 focus-within:opacity-100 [@media(pointer:coarse)]:opacity-100 transition-opacity duration-fast", children: [
|
|
25562
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "rounded-md border border-border bg-card/95 backdrop-blur-sm shadow-sm p-0.5 [@media(pointer:coarse)]:hidden", children: [
|
|
25563
|
+
(maxInlineActions != null ? actionDefs.slice(0, maxInlineActions) : actionDefs).map((action, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
25564
|
+
Button,
|
|
25565
|
+
{
|
|
25566
|
+
variant: action.variant === "primary" ? "primary" : "ghost",
|
|
25567
|
+
size: "sm",
|
|
25568
|
+
onClick: handleActionClick(action, itemData),
|
|
25569
|
+
"data-testid": `action-${action.event}`,
|
|
25570
|
+
"data-row-id": String(itemData.id),
|
|
25571
|
+
className: action.variant === "danger" ? "text-error hover:text-error hover:bg-error/10" : void 0,
|
|
25572
|
+
children: [
|
|
25573
|
+
action.icon && renderIconInput(action.icon, { size: "xs", className: "mr-1" }),
|
|
25574
|
+
action.label
|
|
25575
|
+
]
|
|
25576
|
+
},
|
|
25577
|
+
idx
|
|
25578
|
+
)),
|
|
25579
|
+
maxInlineActions != null && actionDefs.length > maxInlineActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
25580
|
+
Menu,
|
|
25581
|
+
{
|
|
25582
|
+
position: "bottom-end",
|
|
25583
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
25584
|
+
items: actionDefs.slice(maxInlineActions).map((action) => ({
|
|
25585
|
+
label: action.label,
|
|
25586
|
+
icon: action.icon,
|
|
25587
|
+
event: action.event,
|
|
25588
|
+
onClick: () => fireAction(action, itemData)
|
|
25589
|
+
}))
|
|
25590
|
+
}
|
|
25591
|
+
)
|
|
25592
|
+
] }),
|
|
25593
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "hidden [@media(pointer:coarse)]:block rounded-md border border-border bg-card/95 backdrop-blur-sm shadow-sm p-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
25549
25594
|
Menu,
|
|
25550
25595
|
{
|
|
25551
25596
|
position: "bottom-end",
|
|
25552
25597
|
trigger: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
25553
|
-
items: actionDefs.
|
|
25598
|
+
items: actionDefs.map((action) => ({
|
|
25554
25599
|
label: action.label,
|
|
25555
25600
|
icon: action.icon,
|
|
25556
25601
|
event: action.event,
|
|
25557
25602
|
onClick: () => fireAction(action, itemData)
|
|
25558
25603
|
}))
|
|
25559
25604
|
}
|
|
25560
|
-
)
|
|
25561
|
-
] })
|
|
25605
|
+
) })
|
|
25606
|
+
] })
|
|
25562
25607
|
]
|
|
25563
25608
|
},
|
|
25564
25609
|
id
|
|
@@ -25594,7 +25639,7 @@ function DataGrid({
|
|
|
25594
25639
|
}
|
|
25595
25640
|
) });
|
|
25596
25641
|
})(),
|
|
25597
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "p-4 pb-0", children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "justify-between items-start", children: [
|
|
25642
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("p-4", bodyFields.length > 0 && "pb-0"), children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "justify-between items-start", children: [
|
|
25598
25643
|
selectable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
25599
25644
|
"input",
|
|
25600
25645
|
{
|
|
@@ -25627,79 +25672,77 @@ function DataGrid({
|
|
|
25627
25672
|
] }, field.name);
|
|
25628
25673
|
}) })
|
|
25629
25674
|
] }),
|
|
25630
|
-
dangerActions.length > 0 && /* @__PURE__ */ jsxRuntime.
|
|
25631
|
-
|
|
25632
|
-
|
|
25633
|
-
|
|
25634
|
-
|
|
25635
|
-
|
|
25636
|
-
|
|
25637
|
-
|
|
25638
|
-
|
|
25639
|
-
|
|
25640
|
-
|
|
25641
|
-
|
|
25642
|
-
|
|
25643
|
-
|
|
25644
|
-
|
|
25645
|
-
|
|
25646
|
-
|
|
25647
|
-
|
|
25648
|
-
|
|
25649
|
-
|
|
25650
|
-
|
|
25651
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
|
|
25652
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
25653
|
-
field.icon && renderIconInput(field.icon, { size: "xs", className: "text-muted-foreground" }),
|
|
25654
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
|
|
25655
|
-
] }),
|
|
25656
|
-
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: value ? "success" : "neutral", children: value ? t("common.yes") || "Yes" : t("common.no") || "No" })
|
|
25657
|
-
] }, field.name);
|
|
25658
|
-
}
|
|
25659
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
|
|
25660
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
25661
|
-
field.icon && renderIconInput(field.icon, { size: "xs", className: "text-muted-foreground" }),
|
|
25662
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
|
|
25663
|
-
] }),
|
|
25664
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25665
|
-
Typography,
|
|
25675
|
+
(primaryActions.length > 0 || dangerActions.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "flex-shrink-0", children: [
|
|
25676
|
+
(maxInlineActions != null ? primaryActions.slice(0, maxInlineActions) : primaryActions).map((action, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
25677
|
+
Button,
|
|
25678
|
+
{
|
|
25679
|
+
variant: action.variant === "primary" ? "primary" : "ghost",
|
|
25680
|
+
size: "sm",
|
|
25681
|
+
onClick: handleActionClick(action, itemData),
|
|
25682
|
+
"data-testid": `action-${action.event}`,
|
|
25683
|
+
"data-row-id": String(itemData.id),
|
|
25684
|
+
"aria-label": action.label,
|
|
25685
|
+
title: action.label,
|
|
25686
|
+
className: cn(
|
|
25687
|
+
action.variant === "primary" ? void 0 : "text-muted-foreground hover:text-foreground",
|
|
25688
|
+
action.icon && "px-2"
|
|
25689
|
+
),
|
|
25690
|
+
children: action.icon ? renderIconInput(action.icon, { size: "xs" }) : action.label
|
|
25691
|
+
},
|
|
25692
|
+
idx
|
|
25693
|
+
)),
|
|
25694
|
+
maxInlineActions != null && primaryActions.length > maxInlineActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
25695
|
+
Menu,
|
|
25666
25696
|
{
|
|
25667
|
-
|
|
25668
|
-
|
|
25669
|
-
|
|
25697
|
+
position: "bottom-end",
|
|
25698
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
25699
|
+
items: primaryActions.slice(maxInlineActions).map((action) => ({
|
|
25700
|
+
label: action.label,
|
|
25701
|
+
icon: action.icon,
|
|
25702
|
+
event: action.event,
|
|
25703
|
+
onClick: () => fireAction(action, itemData)
|
|
25704
|
+
}))
|
|
25670
25705
|
}
|
|
25671
|
-
)
|
|
25672
|
-
|
|
25673
|
-
|
|
25674
|
-
|
|
25675
|
-
|
|
25676
|
-
|
|
25677
|
-
|
|
25678
|
-
|
|
25679
|
-
|
|
25680
|
-
|
|
25681
|
-
|
|
25682
|
-
|
|
25683
|
-
|
|
25684
|
-
|
|
25685
|
-
|
|
25686
|
-
|
|
25687
|
-
|
|
25688
|
-
|
|
25689
|
-
|
|
25690
|
-
|
|
25691
|
-
|
|
25692
|
-
|
|
25693
|
-
|
|
25694
|
-
|
|
25695
|
-
|
|
25696
|
-
|
|
25697
|
-
|
|
25698
|
-
|
|
25699
|
-
|
|
25700
|
-
|
|
25706
|
+
),
|
|
25707
|
+
dangerActions.map((action, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
25708
|
+
Button,
|
|
25709
|
+
{
|
|
25710
|
+
variant: "ghost",
|
|
25711
|
+
size: "sm",
|
|
25712
|
+
onClick: handleActionClick(action, itemData),
|
|
25713
|
+
"data-testid": `action-${action.event}`,
|
|
25714
|
+
"data-row-id": String(itemData.id),
|
|
25715
|
+
"aria-label": action.label,
|
|
25716
|
+
title: action.label,
|
|
25717
|
+
className: "text-error hover:text-error hover:bg-error/10 px-2",
|
|
25718
|
+
children: action.icon ? renderIconInput(action.icon, { size: "xs" }) : action.label
|
|
25719
|
+
},
|
|
25720
|
+
`danger-${idx}`
|
|
25721
|
+
))
|
|
25722
|
+
] })
|
|
25723
|
+
] }) }),
|
|
25724
|
+
bodyFields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-4 pt-2 pb-4 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
25725
|
+
bodyFields.filter((f3) => f3.variant === "caption" && f3.format !== "boolean").map((field) => {
|
|
25726
|
+
const value = getNestedValue(itemData, field.name);
|
|
25727
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
25728
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "secondary", className: "line-clamp-2", children: formatValue(value, field.format) }, field.name);
|
|
25729
|
+
}),
|
|
25730
|
+
/* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "md", className: "flex-wrap gap-y-1", children: bodyFields.filter((f3) => f3.variant !== "caption" || f3.format === "boolean").map((field) => {
|
|
25731
|
+
const value = getNestedValue(itemData, field.name);
|
|
25732
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
25733
|
+
if (field.format === "boolean") {
|
|
25734
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
25735
|
+
field.icon && renderIconInput(field.icon, { size: "xs", className: "text-muted-foreground" }),
|
|
25736
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) }),
|
|
25737
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: value ? "success" : "neutral", children: value ? t("common.yes") || "Yes" : t("common.no") || "No" })
|
|
25738
|
+
] }, field.name);
|
|
25701
25739
|
}
|
|
25702
|
-
|
|
25740
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
25741
|
+
field.icon && renderIconInput(field.icon, { size: "xs", className: "text-muted-foreground" }),
|
|
25742
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", children: (field.label ?? fieldLabel2(field.name)) + ":" }),
|
|
25743
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", children: formatValue(value, field.format) })
|
|
25744
|
+
] }, field.name);
|
|
25745
|
+
}) })
|
|
25703
25746
|
] }) })
|
|
25704
25747
|
]
|
|
25705
25748
|
},
|
|
@@ -26047,11 +26090,29 @@ function DataList({
|
|
|
26047
26090
|
const wrapDnd = (node) => dnd.isZone ? /* @__PURE__ */ jsxRuntime.jsx(dnd.SortableItem, { id: dndId, children: node }, dndId) : node;
|
|
26048
26091
|
if (hasRenderProp) {
|
|
26049
26092
|
const id2 = itemData.id || String(index);
|
|
26093
|
+
const actions = renderItemActions(itemData);
|
|
26050
26094
|
return wrapDnd(
|
|
26051
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
26052
|
-
|
|
26053
|
-
|
|
26054
|
-
|
|
26095
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn("relative group/rowactions", itemClickEvent && "cursor-pointer"), children: [
|
|
26096
|
+
children(itemData, index),
|
|
26097
|
+
actions && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "absolute top-2 right-2 z-10 opacity-0 group-hover/rowactions:opacity-100 focus-within:opacity-100 [@media(pointer:coarse)]:opacity-100 transition-opacity duration-fast", children: [
|
|
26098
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "rounded-md border border-border bg-card/95 backdrop-blur-sm shadow-sm p-0.5 [@media(pointer:coarse)]:hidden", children: actions }),
|
|
26099
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "hidden [@media(pointer:coarse)]:block rounded-md border border-border bg-card/95 backdrop-blur-sm shadow-sm p-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
26100
|
+
Menu,
|
|
26101
|
+
{
|
|
26102
|
+
position: "bottom-end",
|
|
26103
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
26104
|
+
items: (itemActions ?? []).map((action) => ({
|
|
26105
|
+
label: action.label,
|
|
26106
|
+
icon: action.icon,
|
|
26107
|
+
event: action.event,
|
|
26108
|
+
variant: action.variant === "danger" ? "danger" : "default",
|
|
26109
|
+
onClick: () => eventBus.emit(`UI:${action.event}`, {
|
|
26110
|
+
id: itemData.id,
|
|
26111
|
+
row: itemData
|
|
26112
|
+
})
|
|
26113
|
+
}))
|
|
26114
|
+
}
|
|
26115
|
+
) })
|
|
26055
26116
|
] }),
|
|
26056
26117
|
isCard && !isLast && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "mx-6 border-b border-border/40" })
|
|
26057
26118
|
] }, id2)
|
|
@@ -26091,7 +26152,7 @@ function DataList({
|
|
|
26091
26152
|
] }, field.name);
|
|
26092
26153
|
})
|
|
26093
26154
|
] }),
|
|
26094
|
-
bodyFields.length > 0 &&
|
|
26155
|
+
bodyFields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "md", className: cn("flex-wrap", isCompact ? "mt-0.5" : "mt-1.5"), children: bodyFields.map((field) => {
|
|
26095
26156
|
const value = getNestedValue(itemData, field.name);
|
|
26096
26157
|
if (value === void 0 || value === null || value === "") return null;
|
|
26097
26158
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
@@ -26441,10 +26502,7 @@ var init_FileTree = __esm({
|
|
|
26441
26502
|
className,
|
|
26442
26503
|
indent = 16
|
|
26443
26504
|
}) => {
|
|
26444
|
-
|
|
26445
|
-
if (tree.length === 0) {
|
|
26446
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: `p-4 ${className ?? ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "muted", children: t("fileTree.noFiles") }) });
|
|
26447
|
-
}
|
|
26505
|
+
if (tree.length === 0) return null;
|
|
26448
26506
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: `py-1 overflow-y-auto ${className ?? ""}`, role: "tree", children: tree.map((node) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
26449
26507
|
TreeNodeItem,
|
|
26450
26508
|
{
|
|
@@ -29690,7 +29748,7 @@ var init_MapView = __esm({
|
|
|
29690
29748
|
shadowSize: [41, 41]
|
|
29691
29749
|
});
|
|
29692
29750
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29693
|
-
const { useEffect: useEffect63, useRef: useRef62, useCallback:
|
|
29751
|
+
const { useEffect: useEffect63, useRef: useRef62, useCallback: useCallback94, useState: useState97 } = React91__namespace.default;
|
|
29694
29752
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29695
29753
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29696
29754
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -29736,7 +29794,7 @@ var init_MapView = __esm({
|
|
|
29736
29794
|
}) {
|
|
29737
29795
|
const eventBus = useEventBus2();
|
|
29738
29796
|
const [clickedPosition, setClickedPosition] = useState97(null);
|
|
29739
|
-
const handleMapClick =
|
|
29797
|
+
const handleMapClick = useCallback94((lat, lng) => {
|
|
29740
29798
|
if (showClickedPin) {
|
|
29741
29799
|
setClickedPosition({ lat, lng });
|
|
29742
29800
|
}
|
|
@@ -29745,7 +29803,7 @@ var init_MapView = __esm({
|
|
|
29745
29803
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
29746
29804
|
}
|
|
29747
29805
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
29748
|
-
const handleMarkerClick =
|
|
29806
|
+
const handleMarkerClick = useCallback94((marker) => {
|
|
29749
29807
|
onMarkerClick?.(marker);
|
|
29750
29808
|
if (markerClickEvent) {
|
|
29751
29809
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -29947,7 +30005,7 @@ var init_NumberStepper = __esm({
|
|
|
29947
30005
|
"active:bg-muted",
|
|
29948
30006
|
"transition-colors duration-instant",
|
|
29949
30007
|
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
29950
|
-
"focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
|
|
30008
|
+
"focus:outline-none focus-visible:ring-[length:var(--focus-ring-width)] focus-visible:ring-ring focus-visible:ring-inset",
|
|
29951
30009
|
styles.button
|
|
29952
30010
|
),
|
|
29953
30011
|
"aria-label": t("aria.decrease"),
|
|
@@ -29988,7 +30046,7 @@ var init_NumberStepper = __esm({
|
|
|
29988
30046
|
"active:bg-muted",
|
|
29989
30047
|
"transition-colors duration-instant",
|
|
29990
30048
|
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
29991
|
-
"focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
|
|
30049
|
+
"focus:outline-none focus-visible:ring-[length:var(--focus-ring-width)] focus-visible:ring-ring focus-visible:ring-inset",
|
|
29992
30050
|
styles.button
|
|
29993
30051
|
),
|
|
29994
30052
|
"aria-label": t("aria.increase"),
|
|
@@ -30444,7 +30502,7 @@ var init_Lightbox = __esm({
|
|
|
30444
30502
|
"p-2 rounded-full",
|
|
30445
30503
|
"text-[var(--color-foreground)] bg-[var(--color-card)]",
|
|
30446
30504
|
"hover:bg-opacity-70 transition-opacity",
|
|
30447
|
-
"focus:outline-none focus:ring-2 focus:ring-ring"
|
|
30505
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
30448
30506
|
),
|
|
30449
30507
|
"aria-label": t("aria.closeModal"),
|
|
30450
30508
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "x", className: "w-6 h-6" })
|
|
@@ -30463,7 +30521,7 @@ var init_Lightbox = __esm({
|
|
|
30463
30521
|
"p-2 rounded-full",
|
|
30464
30522
|
"text-[var(--color-foreground)] bg-[var(--color-card)]",
|
|
30465
30523
|
"hover:bg-opacity-70 transition-opacity",
|
|
30466
|
-
"focus:outline-none focus:ring-2 focus:ring-ring"
|
|
30524
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
30467
30525
|
),
|
|
30468
30526
|
"aria-label": t("aria.previousImage"),
|
|
30469
30527
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-left", className: "w-8 h-8" })
|
|
@@ -30500,7 +30558,7 @@ var init_Lightbox = __esm({
|
|
|
30500
30558
|
"p-2 rounded-full",
|
|
30501
30559
|
"text-[var(--color-foreground)] bg-[var(--color-card)]",
|
|
30502
30560
|
"hover:bg-opacity-70 transition-opacity",
|
|
30503
|
-
"focus:outline-none focus:ring-2 focus:ring-ring"
|
|
30561
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
30504
30562
|
),
|
|
30505
30563
|
"aria-label": t("aria.nextImage"),
|
|
30506
30564
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-right", className: "w-8 h-8" })
|
|
@@ -30521,6 +30579,26 @@ var init_Lightbox = __esm({
|
|
|
30521
30579
|
Lightbox.displayName = "Lightbox";
|
|
30522
30580
|
}
|
|
30523
30581
|
});
|
|
30582
|
+
function useMediaQuery(query) {
|
|
30583
|
+
const subscribe = React91.useCallback(
|
|
30584
|
+
(onChange) => {
|
|
30585
|
+
const mql = window.matchMedia(query);
|
|
30586
|
+
mql.addEventListener("change", onChange);
|
|
30587
|
+
return () => mql.removeEventListener("change", onChange);
|
|
30588
|
+
},
|
|
30589
|
+
[query]
|
|
30590
|
+
);
|
|
30591
|
+
return React91.useSyncExternalStore(
|
|
30592
|
+
subscribe,
|
|
30593
|
+
() => window.matchMedia(query).matches,
|
|
30594
|
+
() => false
|
|
30595
|
+
);
|
|
30596
|
+
}
|
|
30597
|
+
var init_useMediaQuery = __esm({
|
|
30598
|
+
"hooks/useMediaQuery.ts"() {
|
|
30599
|
+
"use client";
|
|
30600
|
+
}
|
|
30601
|
+
});
|
|
30524
30602
|
function renderIconInput3(icon, props) {
|
|
30525
30603
|
return typeof icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, ...props }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon, ...props });
|
|
30526
30604
|
}
|
|
@@ -30627,6 +30705,7 @@ function TableView({
|
|
|
30627
30705
|
const hasMore = pageSize > 0 && visibleCount < ordered.length;
|
|
30628
30706
|
const hasRenderProp = typeof children === "function";
|
|
30629
30707
|
const idField = dndItemIdField ?? "id";
|
|
30708
|
+
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
30630
30709
|
const selected = selectedIds ? new Set(selectedIds) : localSelected;
|
|
30631
30710
|
const emitSelection = (next) => {
|
|
30632
30711
|
if (!selectedIds) setLocalSelected(next);
|
|
@@ -30659,6 +30738,17 @@ function TableView({
|
|
|
30659
30738
|
};
|
|
30660
30739
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
30661
30740
|
};
|
|
30741
|
+
const colFloors = React91__namespace.default.useMemo(
|
|
30742
|
+
() => colDefs.map((col) => {
|
|
30743
|
+
const longest = data.reduce((widest, row) => {
|
|
30744
|
+
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
30745
|
+
return Math.max(widest, cell.length);
|
|
30746
|
+
}, columnLabel(col).length);
|
|
30747
|
+
const chrome = col.format === "badge" ? BADGE_CHROME_CH : 0;
|
|
30748
|
+
return Math.min(longest + chrome, MAX_MEASURED_COL_CH);
|
|
30749
|
+
}),
|
|
30750
|
+
[colDefs, data]
|
|
30751
|
+
);
|
|
30662
30752
|
if (isLoading) {
|
|
30663
30753
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") }) });
|
|
30664
30754
|
}
|
|
@@ -30671,19 +30761,10 @@ function TableView({
|
|
|
30671
30761
|
}
|
|
30672
30762
|
const lk = LOOKS[look];
|
|
30673
30763
|
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
30674
|
-
const
|
|
30675
|
-
const
|
|
30764
|
+
const effectiveMaxInline = isCoarsePointer ? 0 : maxInlineActions;
|
|
30765
|
+
const inlineActionCount = hasActions ? effectiveMaxInline != null ? Math.min(itemActions.length, effectiveMaxInline) : itemActions.length : 0;
|
|
30766
|
+
const hasOverflowActions = hasActions && effectiveMaxInline != null && itemActions.length > effectiveMaxInline;
|
|
30676
30767
|
const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
|
|
30677
|
-
const colFloors = React91__namespace.default.useMemo(
|
|
30678
|
-
() => colDefs.map((col) => {
|
|
30679
|
-
const longest = data.reduce((widest, row) => {
|
|
30680
|
-
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
30681
|
-
return Math.max(widest, cell.length);
|
|
30682
|
-
}, columnLabel(col).length);
|
|
30683
|
-
return Math.min(longest, MAX_MEASURED_COL_CH);
|
|
30684
|
-
}),
|
|
30685
|
-
[colDefs, data]
|
|
30686
|
-
);
|
|
30687
30768
|
const gridTemplateColumns = [
|
|
30688
30769
|
selectable ? "auto" : null,
|
|
30689
30770
|
...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
|
|
@@ -30770,9 +30851,9 @@ function TableView({
|
|
|
30770
30851
|
col.className
|
|
30771
30852
|
);
|
|
30772
30853
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
30773
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
30854
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", className: "whitespace-nowrap", children: String(raw) }) }, col.key);
|
|
30774
30855
|
}
|
|
30775
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
30856
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-foreground", children: formatCell(raw, col.format) }) }, col.key);
|
|
30776
30857
|
}),
|
|
30777
30858
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30778
30859
|
HStack,
|
|
@@ -30786,15 +30867,15 @@ function TableView({
|
|
|
30786
30867
|
lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
|
|
30787
30868
|
),
|
|
30788
30869
|
children: [
|
|
30789
|
-
(
|
|
30870
|
+
(effectiveMaxInline != null ? itemActions.slice(0, effectiveMaxInline) : itemActions).map((action, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30790
30871
|
Button,
|
|
30791
30872
|
{
|
|
30792
|
-
variant: action.variant
|
|
30873
|
+
variant: action.variant === "primary" ? "primary" : "ghost",
|
|
30793
30874
|
size: "sm",
|
|
30794
30875
|
onClick: handleActionClick(action, row),
|
|
30795
30876
|
"data-testid": `action-${action.event}`,
|
|
30796
30877
|
"data-row-id": String(row.id),
|
|
30797
|
-
className: cn(action.variant === "danger" && "text-error hover:bg-error/10"),
|
|
30878
|
+
className: cn(action.variant === "danger" && "text-error hover:text-error hover:bg-error/10"),
|
|
30798
30879
|
children: [
|
|
30799
30880
|
action.icon && renderIconInput3(action.icon, { size: "xs", className: "mr-1" }),
|
|
30800
30881
|
action.label
|
|
@@ -30802,12 +30883,12 @@ function TableView({
|
|
|
30802
30883
|
},
|
|
30803
30884
|
i
|
|
30804
30885
|
)),
|
|
30805
|
-
|
|
30886
|
+
effectiveMaxInline != null && itemActions.length > effectiveMaxInline && /* @__PURE__ */ jsxRuntime.jsx(
|
|
30806
30887
|
Menu,
|
|
30807
30888
|
{
|
|
30808
30889
|
position: "bottom-end",
|
|
30809
30890
|
trigger: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
30810
|
-
items: itemActions.slice(
|
|
30891
|
+
items: itemActions.slice(effectiveMaxInline).map((action) => ({
|
|
30811
30892
|
label: action.label,
|
|
30812
30893
|
icon: action.icon,
|
|
30813
30894
|
event: action.event,
|
|
@@ -30853,13 +30934,14 @@ function TableView({
|
|
|
30853
30934
|
}
|
|
30854
30935
|
);
|
|
30855
30936
|
}
|
|
30856
|
-
var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
|
|
30937
|
+
var MAX_MEASURED_COL_CH, BADGE_CHROME_CH, alignClass, weightClass, LOOKS;
|
|
30857
30938
|
var init_TableView = __esm({
|
|
30858
30939
|
"components/core/molecules/TableView.tsx"() {
|
|
30859
30940
|
"use client";
|
|
30860
30941
|
init_cn();
|
|
30861
30942
|
init_getNestedValue();
|
|
30862
30943
|
init_useEventBus();
|
|
30944
|
+
init_useMediaQuery();
|
|
30863
30945
|
init_Box();
|
|
30864
30946
|
init_Stack();
|
|
30865
30947
|
init_Typography();
|
|
@@ -30872,6 +30954,7 @@ var init_TableView = __esm({
|
|
|
30872
30954
|
init_useDataDnd();
|
|
30873
30955
|
logger.createLogger("almadar:ui:table-view");
|
|
30874
30956
|
MAX_MEASURED_COL_CH = 32;
|
|
30957
|
+
BADGE_CHROME_CH = 4;
|
|
30875
30958
|
alignClass = {
|
|
30876
30959
|
left: "justify-start text-left",
|
|
30877
30960
|
center: "justify-center text-center",
|
|
@@ -30883,7 +30966,7 @@ var init_TableView = __esm({
|
|
|
30883
30966
|
semibold: "font-semibold"
|
|
30884
30967
|
};
|
|
30885
30968
|
LOOKS = {
|
|
30886
|
-
dense: { rowPad: "px-card-md py-
|
|
30969
|
+
dense: { rowPad: "px-card-md py-2", headPad: "px-card-md py-2", striped: false, divider: true },
|
|
30887
30970
|
spacious: { rowPad: "px-card-lg py-card-md", headPad: "px-card-lg py-card-sm", striped: false, divider: true },
|
|
30888
30971
|
striped: { rowPad: "px-card-md py-card-sm", headPad: "px-card-md py-card-sm", striped: true, divider: false },
|
|
30889
30972
|
borderless: { rowPad: "px-card-md py-card-sm", headPad: "px-card-md py-card-sm", striped: false, divider: false },
|
|
@@ -33107,7 +33190,7 @@ var init_VoteStack = __esm({
|
|
|
33107
33190
|
"active:bg-muted",
|
|
33108
33191
|
"transition-colors duration-instant",
|
|
33109
33192
|
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
33110
|
-
"focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
|
|
33193
|
+
"focus:outline-none focus-visible:ring-[length:var(--focus-ring-width)] focus-visible:ring-ring focus-visible:ring-inset",
|
|
33111
33194
|
styles.button
|
|
33112
33195
|
),
|
|
33113
33196
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-up", className: styles.icon })
|
|
@@ -33144,7 +33227,7 @@ var init_VoteStack = __esm({
|
|
|
33144
33227
|
"active:bg-muted",
|
|
33145
33228
|
"transition-colors duration-instant",
|
|
33146
33229
|
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
33147
|
-
"focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
|
|
33230
|
+
"focus:outline-none focus-visible:ring-[length:var(--focus-ring-width)] focus-visible:ring-ring focus-visible:ring-inset",
|
|
33148
33231
|
styles.button
|
|
33149
33232
|
),
|
|
33150
33233
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-down", className: styles.icon })
|
|
@@ -33665,7 +33748,7 @@ var init_QrScanner = __esm({
|
|
|
33665
33748
|
// eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
|
|
33666
33749
|
"rounded-full bg-black bg-opacity-60 p-2 text-white",
|
|
33667
33750
|
// eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
|
|
33668
|
-
"hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
|
|
33751
|
+
"hover:bg-opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-white"
|
|
33669
33752
|
),
|
|
33670
33753
|
"aria-label": isPaused ? t("qrScanner.resumeScanning") : t("qrScanner.pauseScanning"),
|
|
33671
33754
|
children: isPaused ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "play", className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "pause", className: "h-4 w-4" })
|
|
@@ -33680,7 +33763,7 @@ var init_QrScanner = __esm({
|
|
|
33680
33763
|
// eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
|
|
33681
33764
|
"rounded-full bg-black bg-opacity-60 p-2 text-white",
|
|
33682
33765
|
// eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
|
|
33683
|
-
"hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
|
|
33766
|
+
"hover:bg-opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-white"
|
|
33684
33767
|
),
|
|
33685
33768
|
"aria-label": currentFacing === "environment" ? t("qrScanner.switchToFrontCamera") : t("qrScanner.switchToRearCamera"),
|
|
33686
33769
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "refresh-cw", className: "h-4 w-4" })
|
|
@@ -33695,7 +33778,7 @@ var init_QrScanner = __esm({
|
|
|
33695
33778
|
// eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
|
|
33696
33779
|
"rounded-full bg-black bg-opacity-60 px-3 py-2 text-xs text-white",
|
|
33697
33780
|
// eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
|
|
33698
|
-
"hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
|
|
33781
|
+
"hover:bg-opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-white"
|
|
33699
33782
|
),
|
|
33700
33783
|
"aria-label": t("aria.mockScanDev"),
|
|
33701
33784
|
children: t("qrScanner.mockScan")
|
|
@@ -41531,27 +41614,24 @@ var init_MasterDetailLayout = __esm({
|
|
|
41531
41614
|
masterClassName,
|
|
41532
41615
|
detailClassName
|
|
41533
41616
|
}) => {
|
|
41534
|
-
masterWidth.endsWith("%") ? parseInt(masterWidth, 10) : 30;
|
|
41535
41617
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
41536
41618
|
"div",
|
|
41537
41619
|
{
|
|
41538
|
-
className: cn("
|
|
41539
|
-
style: {
|
|
41540
|
-
display: "grid",
|
|
41541
|
-
gridTemplateColumns: masterWidth.endsWith("%") ? `${masterWidth} 1fr` : `${masterWidth} 1fr`
|
|
41542
|
-
},
|
|
41620
|
+
className: cn("w-full h-full md:grid md:grid-cols-[var(--master-detail-cols)]", className),
|
|
41621
|
+
style: { "--master-detail-cols": `${masterWidth} 1fr` },
|
|
41543
41622
|
children: [
|
|
41544
41623
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
41545
41624
|
"div",
|
|
41546
41625
|
{
|
|
41547
41626
|
className: cn(
|
|
41548
|
-
"border-r
|
|
41627
|
+
"border-r border-border overflow-auto",
|
|
41628
|
+
hasSelection && "hidden md:block",
|
|
41549
41629
|
masterClassName
|
|
41550
41630
|
),
|
|
41551
41631
|
children: master
|
|
41552
41632
|
}
|
|
41553
41633
|
),
|
|
41554
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("overflow-auto", detailClassName), children: hasSelection ? detail : emptyDetail || /* @__PURE__ */ jsxRuntime.jsx(DefaultEmptyDetail, {}) })
|
|
41634
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("overflow-auto", !hasSelection && "hidden md:block", detailClassName), children: hasSelection ? detail : emptyDetail || /* @__PURE__ */ jsxRuntime.jsx(DefaultEmptyDetail, {}) })
|
|
41555
41635
|
]
|
|
41556
41636
|
}
|
|
41557
41637
|
);
|
|
@@ -45123,7 +45203,7 @@ var init_TabbedContainer = __esm({
|
|
|
45123
45203
|
onClick: () => !isDisabled && handleTabChange(tab.id),
|
|
45124
45204
|
className: cn(
|
|
45125
45205
|
"flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors",
|
|
45126
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
45206
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
45127
45207
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
45128
45208
|
isActive ? "bg-primary text-primary-foreground" : "bg-card text-foreground hover:bg-muted",
|
|
45129
45209
|
isVertical ? "justify-start" : "justify-center"
|