@almadar/ui 4.52.0 → 4.53.2
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 +82 -69
- package/dist/avl/index.js +82 -69
- package/dist/components/index.cjs +82 -69
- package/dist/components/index.js +82 -69
- package/dist/marketing/index.cjs +10 -1
- package/dist/marketing/index.js +10 -1
- package/dist/providers/index.cjs +82 -69
- package/dist/providers/index.js +82 -69
- package/dist/runtime/index.cjs +82 -69
- package/dist/runtime/index.js +82 -69
- package/package.json +2 -1
- package/tailwind-preset.cjs +13 -0
package/dist/avl/index.cjs
CHANGED
|
@@ -25176,12 +25176,12 @@ var init_DashboardLayout = __esm({
|
|
|
25176
25176
|
HStack,
|
|
25177
25177
|
{
|
|
25178
25178
|
gap: "none",
|
|
25179
|
-
className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
25179
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
25180
25180
|
children: [
|
|
25181
25181
|
sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
25182
25182
|
Box,
|
|
25183
25183
|
{
|
|
25184
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
|
|
25184
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
25185
25185
|
onClick: () => setSidebarOpen(false)
|
|
25186
25186
|
}
|
|
25187
25187
|
),
|
|
@@ -25191,7 +25191,7 @@ var init_DashboardLayout = __esm({
|
|
|
25191
25191
|
as: "aside",
|
|
25192
25192
|
className: cn(
|
|
25193
25193
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
25194
|
-
"fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
|
|
25194
|
+
"fixed inset-y-0 left-0 @lg/dashboard:static @lg/dashboard:translate-x-0 @lg/dashboard:h-auto",
|
|
25195
25195
|
"transform transition-transform duration-200 ease-in-out",
|
|
25196
25196
|
"flex flex-col",
|
|
25197
25197
|
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
@@ -25228,7 +25228,7 @@ var init_DashboardLayout = __esm({
|
|
|
25228
25228
|
Button,
|
|
25229
25229
|
{
|
|
25230
25230
|
variant: "ghost",
|
|
25231
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
25231
|
+
className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
25232
25232
|
onClick: () => setSidebarOpen(false),
|
|
25233
25233
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.X, { className: "h-5 w-5" })
|
|
25234
25234
|
}
|
|
@@ -25267,19 +25267,19 @@ var init_DashboardLayout = __esm({
|
|
|
25267
25267
|
{
|
|
25268
25268
|
align: "center",
|
|
25269
25269
|
justify: "between",
|
|
25270
|
-
className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
|
|
25270
|
+
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
25271
25271
|
children: [
|
|
25272
25272
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25273
25273
|
Button,
|
|
25274
25274
|
{
|
|
25275
25275
|
variant: "ghost",
|
|
25276
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
25276
|
+
className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
25277
25277
|
onClick: () => setSidebarOpen(true),
|
|
25278
25278
|
"aria-label": "Open sidebar",
|
|
25279
25279
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Menu, { className: "h-5 w-5" })
|
|
25280
25280
|
}
|
|
25281
25281
|
),
|
|
25282
|
-
searchEnabled && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "relative", children: [
|
|
25282
|
+
searchEnabled && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "hidden @sm/dashboard:block flex-1 min-w-0 @xl/dashboard:max-w-md", children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "relative", children: [
|
|
25283
25283
|
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
|
|
25284
25284
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25285
25285
|
Input,
|
|
@@ -25364,12 +25364,12 @@ var init_DashboardLayout = __esm({
|
|
|
25364
25364
|
Typography,
|
|
25365
25365
|
{
|
|
25366
25366
|
variant: "small",
|
|
25367
|
-
className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
|
|
25367
|
+
className: "hidden @sm/dashboard:block text-sm font-medium text-foreground dark:text-foreground",
|
|
25368
25368
|
as: "span",
|
|
25369
25369
|
children: user.name
|
|
25370
25370
|
}
|
|
25371
25371
|
),
|
|
25372
|
-
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
25372
|
+
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "hidden @sm/dashboard:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
25373
25373
|
]
|
|
25374
25374
|
}
|
|
25375
25375
|
),
|
|
@@ -25426,7 +25426,7 @@ var init_DashboardLayout = __esm({
|
|
|
25426
25426
|
)
|
|
25427
25427
|
}
|
|
25428
25428
|
),
|
|
25429
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
|
|
25429
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
25430
25430
|
] })
|
|
25431
25431
|
]
|
|
25432
25432
|
}
|
|
@@ -32983,7 +32983,16 @@ var init_StepFlow = __esm({
|
|
|
32983
32983
|
"flex items-center justify-center",
|
|
32984
32984
|
"bg-primary text-primary-foreground"
|
|
32985
32985
|
),
|
|
32986
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
32986
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
32987
|
+
Typography,
|
|
32988
|
+
{
|
|
32989
|
+
as: "span",
|
|
32990
|
+
variant: "small",
|
|
32991
|
+
weight: "semibold",
|
|
32992
|
+
className: "text-primary-foreground leading-none",
|
|
32993
|
+
children: step.number ?? index + 1
|
|
32994
|
+
}
|
|
32995
|
+
)
|
|
32987
32996
|
}
|
|
32988
32997
|
);
|
|
32989
32998
|
};
|
|
@@ -34708,64 +34717,68 @@ var init_PositionedCanvas = __esm({
|
|
|
34708
34717
|
},
|
|
34709
34718
|
[onSelect, selectEvent, eventBus]
|
|
34710
34719
|
);
|
|
34711
|
-
return
|
|
34712
|
-
|
|
34713
|
-
|
|
34714
|
-
|
|
34715
|
-
|
|
34716
|
-
|
|
34717
|
-
|
|
34718
|
-
|
|
34719
|
-
|
|
34720
|
-
|
|
34721
|
-
|
|
34722
|
-
|
|
34723
|
-
|
|
34724
|
-
|
|
34725
|
-
|
|
34726
|
-
|
|
34727
|
-
|
|
34728
|
-
|
|
34729
|
-
|
|
34730
|
-
|
|
34731
|
-
|
|
34732
|
-
|
|
34733
|
-
|
|
34734
|
-
"
|
|
34735
|
-
"
|
|
34736
|
-
|
|
34737
|
-
|
|
34738
|
-
|
|
34739
|
-
|
|
34740
|
-
|
|
34741
|
-
|
|
34742
|
-
|
|
34743
|
-
|
|
34744
|
-
|
|
34745
|
-
|
|
34746
|
-
|
|
34747
|
-
|
|
34748
|
-
|
|
34749
|
-
|
|
34750
|
-
|
|
34751
|
-
|
|
34752
|
-
|
|
34753
|
-
|
|
34754
|
-
|
|
34755
|
-
|
|
34756
|
-
{
|
|
34757
|
-
|
|
34758
|
-
|
|
34759
|
-
|
|
34760
|
-
|
|
34761
|
-
|
|
34762
|
-
|
|
34763
|
-
|
|
34764
|
-
|
|
34765
|
-
|
|
34766
|
-
|
|
34767
|
-
|
|
34768
|
-
|
|
34720
|
+
return (
|
|
34721
|
+
// Outer scroll viewport: caps the visual footprint to the parent's
|
|
34722
|
+
// available width on small screens. The inner plane keeps its fixed
|
|
34723
|
+
// {width × height} coordinate system (items are positioned by
|
|
34724
|
+
// absolute item.x/item.y), so a phone-sized viewport pans inside
|
|
34725
|
+
// the larger logical canvas rather than busting the layout.
|
|
34726
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("max-w-full overflow-auto rounded-md", className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
34727
|
+
Box,
|
|
34728
|
+
{
|
|
34729
|
+
ref: containerRef,
|
|
34730
|
+
"data-testid": "positioned-canvas",
|
|
34731
|
+
className: "relative bg-background border border-border rounded-md overflow-hidden",
|
|
34732
|
+
style: { width, height },
|
|
34733
|
+
onClick: handleContainerClick,
|
|
34734
|
+
children: items.map((item) => {
|
|
34735
|
+
const status = item.status ?? "empty";
|
|
34736
|
+
const shape = item.shape ?? "round";
|
|
34737
|
+
const isSelected = selectedId === item.id;
|
|
34738
|
+
const isDragging = draggingId === item.id;
|
|
34739
|
+
const statusBadge = STATUS_BADGE[status];
|
|
34740
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
34741
|
+
Box,
|
|
34742
|
+
{
|
|
34743
|
+
"data-testid": `item-node-${item.id}`,
|
|
34744
|
+
"data-status": status,
|
|
34745
|
+
className: cn(
|
|
34746
|
+
"absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
|
|
34747
|
+
"transition-shadow",
|
|
34748
|
+
STATUS_CLASSES[status],
|
|
34749
|
+
getShapeClasses(shape),
|
|
34750
|
+
editable ? "cursor-move" : "cursor-pointer",
|
|
34751
|
+
isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
|
|
34752
|
+
isDragging && "shadow-lg z-10"
|
|
34753
|
+
),
|
|
34754
|
+
style: { left: item.x, top: item.y, touchAction: "none" },
|
|
34755
|
+
onPointerDown: (e) => handlePointerDown(e, item),
|
|
34756
|
+
onPointerMove: handlePointerMove,
|
|
34757
|
+
onPointerUp: (e) => handlePointerUp(e, item),
|
|
34758
|
+
onPointerCancel: (e) => handlePointerUp(e, item),
|
|
34759
|
+
children: [
|
|
34760
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", children: [
|
|
34761
|
+
getStatusIcon(status),
|
|
34762
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
|
|
34763
|
+
] }),
|
|
34764
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
|
|
34765
|
+
status === "seated" && item.serverName && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
|
|
34766
|
+
isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
34767
|
+
Badge,
|
|
34768
|
+
{
|
|
34769
|
+
variant: statusBadge.variant,
|
|
34770
|
+
size: "sm",
|
|
34771
|
+
className: "absolute -top-2 -right-2",
|
|
34772
|
+
children: statusBadge.label
|
|
34773
|
+
}
|
|
34774
|
+
)
|
|
34775
|
+
]
|
|
34776
|
+
},
|
|
34777
|
+
item.id
|
|
34778
|
+
);
|
|
34779
|
+
})
|
|
34780
|
+
}
|
|
34781
|
+
) })
|
|
34769
34782
|
);
|
|
34770
34783
|
};
|
|
34771
34784
|
PositionedCanvas.displayName = "PositionedCanvas";
|
package/dist/avl/index.js
CHANGED
|
@@ -25130,12 +25130,12 @@ var init_DashboardLayout = __esm({
|
|
|
25130
25130
|
HStack,
|
|
25131
25131
|
{
|
|
25132
25132
|
gap: "none",
|
|
25133
|
-
className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
25133
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
25134
25134
|
children: [
|
|
25135
25135
|
sidebarOpen && /* @__PURE__ */ jsx(
|
|
25136
25136
|
Box,
|
|
25137
25137
|
{
|
|
25138
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
|
|
25138
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
25139
25139
|
onClick: () => setSidebarOpen(false)
|
|
25140
25140
|
}
|
|
25141
25141
|
),
|
|
@@ -25145,7 +25145,7 @@ var init_DashboardLayout = __esm({
|
|
|
25145
25145
|
as: "aside",
|
|
25146
25146
|
className: cn(
|
|
25147
25147
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
25148
|
-
"fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
|
|
25148
|
+
"fixed inset-y-0 left-0 @lg/dashboard:static @lg/dashboard:translate-x-0 @lg/dashboard:h-auto",
|
|
25149
25149
|
"transform transition-transform duration-200 ease-in-out",
|
|
25150
25150
|
"flex flex-col",
|
|
25151
25151
|
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
@@ -25182,7 +25182,7 @@ var init_DashboardLayout = __esm({
|
|
|
25182
25182
|
Button,
|
|
25183
25183
|
{
|
|
25184
25184
|
variant: "ghost",
|
|
25185
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
25185
|
+
className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
25186
25186
|
onClick: () => setSidebarOpen(false),
|
|
25187
25187
|
children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
|
|
25188
25188
|
}
|
|
@@ -25221,19 +25221,19 @@ var init_DashboardLayout = __esm({
|
|
|
25221
25221
|
{
|
|
25222
25222
|
align: "center",
|
|
25223
25223
|
justify: "between",
|
|
25224
|
-
className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
|
|
25224
|
+
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
25225
25225
|
children: [
|
|
25226
25226
|
/* @__PURE__ */ jsx(
|
|
25227
25227
|
Button,
|
|
25228
25228
|
{
|
|
25229
25229
|
variant: "ghost",
|
|
25230
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
25230
|
+
className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
25231
25231
|
onClick: () => setSidebarOpen(true),
|
|
25232
25232
|
"aria-label": "Open sidebar",
|
|
25233
25233
|
children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
|
|
25234
25234
|
}
|
|
25235
25235
|
),
|
|
25236
|
-
searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
25236
|
+
searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden @sm/dashboard:block flex-1 min-w-0 @xl/dashboard:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
25237
25237
|
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
|
|
25238
25238
|
/* @__PURE__ */ jsx(
|
|
25239
25239
|
Input,
|
|
@@ -25318,12 +25318,12 @@ var init_DashboardLayout = __esm({
|
|
|
25318
25318
|
Typography,
|
|
25319
25319
|
{
|
|
25320
25320
|
variant: "small",
|
|
25321
|
-
className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
|
|
25321
|
+
className: "hidden @sm/dashboard:block text-sm font-medium text-foreground dark:text-foreground",
|
|
25322
25322
|
as: "span",
|
|
25323
25323
|
children: user.name
|
|
25324
25324
|
}
|
|
25325
25325
|
),
|
|
25326
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
25326
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "hidden @sm/dashboard:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
25327
25327
|
]
|
|
25328
25328
|
}
|
|
25329
25329
|
),
|
|
@@ -25380,7 +25380,7 @@ var init_DashboardLayout = __esm({
|
|
|
25380
25380
|
)
|
|
25381
25381
|
}
|
|
25382
25382
|
),
|
|
25383
|
-
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
|
|
25383
|
+
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
25384
25384
|
] })
|
|
25385
25385
|
]
|
|
25386
25386
|
}
|
|
@@ -32937,7 +32937,16 @@ var init_StepFlow = __esm({
|
|
|
32937
32937
|
"flex items-center justify-center",
|
|
32938
32938
|
"bg-primary text-primary-foreground"
|
|
32939
32939
|
),
|
|
32940
|
-
children: /* @__PURE__ */ jsx(
|
|
32940
|
+
children: /* @__PURE__ */ jsx(
|
|
32941
|
+
Typography,
|
|
32942
|
+
{
|
|
32943
|
+
as: "span",
|
|
32944
|
+
variant: "small",
|
|
32945
|
+
weight: "semibold",
|
|
32946
|
+
className: "text-primary-foreground leading-none",
|
|
32947
|
+
children: step.number ?? index + 1
|
|
32948
|
+
}
|
|
32949
|
+
)
|
|
32941
32950
|
}
|
|
32942
32951
|
);
|
|
32943
32952
|
};
|
|
@@ -34662,64 +34671,68 @@ var init_PositionedCanvas = __esm({
|
|
|
34662
34671
|
},
|
|
34663
34672
|
[onSelect, selectEvent, eventBus]
|
|
34664
34673
|
);
|
|
34665
|
-
return
|
|
34666
|
-
|
|
34667
|
-
|
|
34668
|
-
|
|
34669
|
-
|
|
34670
|
-
|
|
34671
|
-
|
|
34672
|
-
|
|
34673
|
-
|
|
34674
|
-
|
|
34675
|
-
|
|
34676
|
-
|
|
34677
|
-
|
|
34678
|
-
|
|
34679
|
-
|
|
34680
|
-
|
|
34681
|
-
|
|
34682
|
-
|
|
34683
|
-
|
|
34684
|
-
|
|
34685
|
-
|
|
34686
|
-
|
|
34687
|
-
|
|
34688
|
-
"
|
|
34689
|
-
"
|
|
34690
|
-
|
|
34691
|
-
|
|
34692
|
-
|
|
34693
|
-
|
|
34694
|
-
|
|
34695
|
-
|
|
34696
|
-
|
|
34697
|
-
|
|
34698
|
-
|
|
34699
|
-
|
|
34700
|
-
|
|
34701
|
-
|
|
34702
|
-
|
|
34703
|
-
|
|
34704
|
-
|
|
34705
|
-
|
|
34706
|
-
|
|
34707
|
-
|
|
34708
|
-
|
|
34709
|
-
|
|
34710
|
-
{
|
|
34711
|
-
|
|
34712
|
-
|
|
34713
|
-
|
|
34714
|
-
|
|
34715
|
-
|
|
34716
|
-
|
|
34717
|
-
|
|
34718
|
-
|
|
34719
|
-
|
|
34720
|
-
|
|
34721
|
-
|
|
34722
|
-
|
|
34674
|
+
return (
|
|
34675
|
+
// Outer scroll viewport: caps the visual footprint to the parent's
|
|
34676
|
+
// available width on small screens. The inner plane keeps its fixed
|
|
34677
|
+
// {width × height} coordinate system (items are positioned by
|
|
34678
|
+
// absolute item.x/item.y), so a phone-sized viewport pans inside
|
|
34679
|
+
// the larger logical canvas rather than busting the layout.
|
|
34680
|
+
/* @__PURE__ */ jsx(Box, { className: cn("max-w-full overflow-auto rounded-md", className), children: /* @__PURE__ */ jsx(
|
|
34681
|
+
Box,
|
|
34682
|
+
{
|
|
34683
|
+
ref: containerRef,
|
|
34684
|
+
"data-testid": "positioned-canvas",
|
|
34685
|
+
className: "relative bg-background border border-border rounded-md overflow-hidden",
|
|
34686
|
+
style: { width, height },
|
|
34687
|
+
onClick: handleContainerClick,
|
|
34688
|
+
children: items.map((item) => {
|
|
34689
|
+
const status = item.status ?? "empty";
|
|
34690
|
+
const shape = item.shape ?? "round";
|
|
34691
|
+
const isSelected = selectedId === item.id;
|
|
34692
|
+
const isDragging = draggingId === item.id;
|
|
34693
|
+
const statusBadge = STATUS_BADGE[status];
|
|
34694
|
+
return /* @__PURE__ */ jsxs(
|
|
34695
|
+
Box,
|
|
34696
|
+
{
|
|
34697
|
+
"data-testid": `item-node-${item.id}`,
|
|
34698
|
+
"data-status": status,
|
|
34699
|
+
className: cn(
|
|
34700
|
+
"absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
|
|
34701
|
+
"transition-shadow",
|
|
34702
|
+
STATUS_CLASSES[status],
|
|
34703
|
+
getShapeClasses(shape),
|
|
34704
|
+
editable ? "cursor-move" : "cursor-pointer",
|
|
34705
|
+
isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
|
|
34706
|
+
isDragging && "shadow-lg z-10"
|
|
34707
|
+
),
|
|
34708
|
+
style: { left: item.x, top: item.y, touchAction: "none" },
|
|
34709
|
+
onPointerDown: (e) => handlePointerDown(e, item),
|
|
34710
|
+
onPointerMove: handlePointerMove,
|
|
34711
|
+
onPointerUp: (e) => handlePointerUp(e, item),
|
|
34712
|
+
onPointerCancel: (e) => handlePointerUp(e, item),
|
|
34713
|
+
children: [
|
|
34714
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", children: [
|
|
34715
|
+
getStatusIcon(status),
|
|
34716
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
|
|
34717
|
+
] }),
|
|
34718
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
|
|
34719
|
+
status === "seated" && item.serverName && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
|
|
34720
|
+
isSelected && /* @__PURE__ */ jsx(
|
|
34721
|
+
Badge,
|
|
34722
|
+
{
|
|
34723
|
+
variant: statusBadge.variant,
|
|
34724
|
+
size: "sm",
|
|
34725
|
+
className: "absolute -top-2 -right-2",
|
|
34726
|
+
children: statusBadge.label
|
|
34727
|
+
}
|
|
34728
|
+
)
|
|
34729
|
+
]
|
|
34730
|
+
},
|
|
34731
|
+
item.id
|
|
34732
|
+
);
|
|
34733
|
+
})
|
|
34734
|
+
}
|
|
34735
|
+
) })
|
|
34723
34736
|
);
|
|
34724
34737
|
};
|
|
34725
34738
|
PositionedCanvas.displayName = "PositionedCanvas";
|