@almadar/ui 4.52.0 → 4.53.1
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 +16 -0
package/dist/providers/index.cjs
CHANGED
|
@@ -21588,12 +21588,12 @@ var init_DashboardLayout = __esm({
|
|
|
21588
21588
|
HStack,
|
|
21589
21589
|
{
|
|
21590
21590
|
gap: "none",
|
|
21591
|
-
className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21591
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21592
21592
|
children: [
|
|
21593
21593
|
sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21594
21594
|
Box,
|
|
21595
21595
|
{
|
|
21596
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
|
|
21596
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
21597
21597
|
onClick: () => setSidebarOpen(false)
|
|
21598
21598
|
}
|
|
21599
21599
|
),
|
|
@@ -21603,7 +21603,7 @@ var init_DashboardLayout = __esm({
|
|
|
21603
21603
|
as: "aside",
|
|
21604
21604
|
className: cn(
|
|
21605
21605
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
21606
|
-
"fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
|
|
21606
|
+
"fixed inset-y-0 left-0 @lg/dashboard:static @lg/dashboard:translate-x-0 @lg/dashboard:h-auto",
|
|
21607
21607
|
"transform transition-transform duration-200 ease-in-out",
|
|
21608
21608
|
"flex flex-col",
|
|
21609
21609
|
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
@@ -21640,7 +21640,7 @@ var init_DashboardLayout = __esm({
|
|
|
21640
21640
|
Button,
|
|
21641
21641
|
{
|
|
21642
21642
|
variant: "ghost",
|
|
21643
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21643
|
+
className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21644
21644
|
onClick: () => setSidebarOpen(false),
|
|
21645
21645
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.X, { className: "h-5 w-5" })
|
|
21646
21646
|
}
|
|
@@ -21679,19 +21679,19 @@ var init_DashboardLayout = __esm({
|
|
|
21679
21679
|
{
|
|
21680
21680
|
align: "center",
|
|
21681
21681
|
justify: "between",
|
|
21682
|
-
className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
|
|
21682
|
+
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21683
21683
|
children: [
|
|
21684
21684
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21685
21685
|
Button,
|
|
21686
21686
|
{
|
|
21687
21687
|
variant: "ghost",
|
|
21688
|
-
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",
|
|
21688
|
+
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",
|
|
21689
21689
|
onClick: () => setSidebarOpen(true),
|
|
21690
21690
|
"aria-label": "Open sidebar",
|
|
21691
21691
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Menu, { className: "h-5 w-5" })
|
|
21692
21692
|
}
|
|
21693
21693
|
),
|
|
21694
|
-
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: [
|
|
21694
|
+
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: [
|
|
21695
21695
|
/* @__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" }),
|
|
21696
21696
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21697
21697
|
Input,
|
|
@@ -21776,12 +21776,12 @@ var init_DashboardLayout = __esm({
|
|
|
21776
21776
|
Typography,
|
|
21777
21777
|
{
|
|
21778
21778
|
variant: "small",
|
|
21779
|
-
className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
|
|
21779
|
+
className: "hidden @sm/dashboard:block text-sm font-medium text-foreground dark:text-foreground",
|
|
21780
21780
|
as: "span",
|
|
21781
21781
|
children: user.name
|
|
21782
21782
|
}
|
|
21783
21783
|
),
|
|
21784
|
-
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
21784
|
+
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "hidden @sm/dashboard:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
21785
21785
|
]
|
|
21786
21786
|
}
|
|
21787
21787
|
),
|
|
@@ -21838,7 +21838,7 @@ var init_DashboardLayout = __esm({
|
|
|
21838
21838
|
)
|
|
21839
21839
|
}
|
|
21840
21840
|
),
|
|
21841
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
|
|
21841
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
21842
21842
|
] })
|
|
21843
21843
|
]
|
|
21844
21844
|
}
|
|
@@ -29395,7 +29395,16 @@ var init_StepFlow = __esm({
|
|
|
29395
29395
|
"flex items-center justify-center",
|
|
29396
29396
|
"bg-primary text-primary-foreground"
|
|
29397
29397
|
),
|
|
29398
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29398
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29399
|
+
Typography,
|
|
29400
|
+
{
|
|
29401
|
+
as: "span",
|
|
29402
|
+
variant: "small",
|
|
29403
|
+
weight: "semibold",
|
|
29404
|
+
className: "text-primary-foreground leading-none",
|
|
29405
|
+
children: step.number ?? index + 1
|
|
29406
|
+
}
|
|
29407
|
+
)
|
|
29399
29408
|
}
|
|
29400
29409
|
);
|
|
29401
29410
|
};
|
|
@@ -31120,64 +31129,68 @@ var init_PositionedCanvas = __esm({
|
|
|
31120
31129
|
},
|
|
31121
31130
|
[onSelect, selectEvent, eventBus]
|
|
31122
31131
|
);
|
|
31123
|
-
return
|
|
31124
|
-
|
|
31125
|
-
|
|
31126
|
-
|
|
31127
|
-
|
|
31128
|
-
|
|
31129
|
-
|
|
31130
|
-
|
|
31131
|
-
|
|
31132
|
-
|
|
31133
|
-
|
|
31134
|
-
|
|
31135
|
-
|
|
31136
|
-
|
|
31137
|
-
|
|
31138
|
-
|
|
31139
|
-
|
|
31140
|
-
|
|
31141
|
-
|
|
31142
|
-
|
|
31143
|
-
|
|
31144
|
-
|
|
31145
|
-
|
|
31146
|
-
"
|
|
31147
|
-
"
|
|
31148
|
-
|
|
31149
|
-
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
31153
|
-
|
|
31154
|
-
|
|
31155
|
-
|
|
31156
|
-
|
|
31157
|
-
|
|
31158
|
-
|
|
31159
|
-
|
|
31160
|
-
|
|
31161
|
-
|
|
31162
|
-
|
|
31163
|
-
|
|
31164
|
-
|
|
31165
|
-
|
|
31166
|
-
|
|
31167
|
-
|
|
31168
|
-
{
|
|
31169
|
-
|
|
31170
|
-
|
|
31171
|
-
|
|
31172
|
-
|
|
31173
|
-
|
|
31174
|
-
|
|
31175
|
-
|
|
31176
|
-
|
|
31177
|
-
|
|
31178
|
-
|
|
31179
|
-
|
|
31180
|
-
|
|
31132
|
+
return (
|
|
31133
|
+
// Outer scroll viewport: caps the visual footprint to the parent's
|
|
31134
|
+
// available width on small screens. The inner plane keeps its fixed
|
|
31135
|
+
// {width × height} coordinate system (items are positioned by
|
|
31136
|
+
// absolute item.x/item.y), so a phone-sized viewport pans inside
|
|
31137
|
+
// the larger logical canvas rather than busting the layout.
|
|
31138
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("max-w-full overflow-auto rounded-md", className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
31139
|
+
Box,
|
|
31140
|
+
{
|
|
31141
|
+
ref: containerRef,
|
|
31142
|
+
"data-testid": "positioned-canvas",
|
|
31143
|
+
className: "relative bg-background border border-border rounded-md overflow-hidden",
|
|
31144
|
+
style: { width, height },
|
|
31145
|
+
onClick: handleContainerClick,
|
|
31146
|
+
children: items.map((item) => {
|
|
31147
|
+
const status = item.status ?? "empty";
|
|
31148
|
+
const shape = item.shape ?? "round";
|
|
31149
|
+
const isSelected = selectedId === item.id;
|
|
31150
|
+
const isDragging = draggingId === item.id;
|
|
31151
|
+
const statusBadge = STATUS_BADGE[status];
|
|
31152
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31153
|
+
Box,
|
|
31154
|
+
{
|
|
31155
|
+
"data-testid": `item-node-${item.id}`,
|
|
31156
|
+
"data-status": status,
|
|
31157
|
+
className: cn(
|
|
31158
|
+
"absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
|
|
31159
|
+
"transition-shadow",
|
|
31160
|
+
STATUS_CLASSES[status],
|
|
31161
|
+
getShapeClasses(shape),
|
|
31162
|
+
editable ? "cursor-move" : "cursor-pointer",
|
|
31163
|
+
isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
|
|
31164
|
+
isDragging && "shadow-lg z-10"
|
|
31165
|
+
),
|
|
31166
|
+
style: { left: item.x, top: item.y, touchAction: "none" },
|
|
31167
|
+
onPointerDown: (e) => handlePointerDown(e, item),
|
|
31168
|
+
onPointerMove: handlePointerMove,
|
|
31169
|
+
onPointerUp: (e) => handlePointerUp(e, item),
|
|
31170
|
+
onPointerCancel: (e) => handlePointerUp(e, item),
|
|
31171
|
+
children: [
|
|
31172
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", children: [
|
|
31173
|
+
getStatusIcon(status),
|
|
31174
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
|
|
31175
|
+
] }),
|
|
31176
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
|
|
31177
|
+
status === "seated" && item.serverName && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
|
|
31178
|
+
isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
31179
|
+
Badge,
|
|
31180
|
+
{
|
|
31181
|
+
variant: statusBadge.variant,
|
|
31182
|
+
size: "sm",
|
|
31183
|
+
className: "absolute -top-2 -right-2",
|
|
31184
|
+
children: statusBadge.label
|
|
31185
|
+
}
|
|
31186
|
+
)
|
|
31187
|
+
]
|
|
31188
|
+
},
|
|
31189
|
+
item.id
|
|
31190
|
+
);
|
|
31191
|
+
})
|
|
31192
|
+
}
|
|
31193
|
+
) })
|
|
31181
31194
|
);
|
|
31182
31195
|
};
|
|
31183
31196
|
PositionedCanvas.displayName = "PositionedCanvas";
|
package/dist/providers/index.js
CHANGED
|
@@ -21542,12 +21542,12 @@ var init_DashboardLayout = __esm({
|
|
|
21542
21542
|
HStack,
|
|
21543
21543
|
{
|
|
21544
21544
|
gap: "none",
|
|
21545
|
-
className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21545
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21546
21546
|
children: [
|
|
21547
21547
|
sidebarOpen && /* @__PURE__ */ jsx(
|
|
21548
21548
|
Box,
|
|
21549
21549
|
{
|
|
21550
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
|
|
21550
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
21551
21551
|
onClick: () => setSidebarOpen(false)
|
|
21552
21552
|
}
|
|
21553
21553
|
),
|
|
@@ -21557,7 +21557,7 @@ var init_DashboardLayout = __esm({
|
|
|
21557
21557
|
as: "aside",
|
|
21558
21558
|
className: cn(
|
|
21559
21559
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
21560
|
-
"fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
|
|
21560
|
+
"fixed inset-y-0 left-0 @lg/dashboard:static @lg/dashboard:translate-x-0 @lg/dashboard:h-auto",
|
|
21561
21561
|
"transform transition-transform duration-200 ease-in-out",
|
|
21562
21562
|
"flex flex-col",
|
|
21563
21563
|
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
@@ -21594,7 +21594,7 @@ var init_DashboardLayout = __esm({
|
|
|
21594
21594
|
Button,
|
|
21595
21595
|
{
|
|
21596
21596
|
variant: "ghost",
|
|
21597
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21597
|
+
className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21598
21598
|
onClick: () => setSidebarOpen(false),
|
|
21599
21599
|
children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
|
|
21600
21600
|
}
|
|
@@ -21633,19 +21633,19 @@ var init_DashboardLayout = __esm({
|
|
|
21633
21633
|
{
|
|
21634
21634
|
align: "center",
|
|
21635
21635
|
justify: "between",
|
|
21636
|
-
className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
|
|
21636
|
+
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21637
21637
|
children: [
|
|
21638
21638
|
/* @__PURE__ */ jsx(
|
|
21639
21639
|
Button,
|
|
21640
21640
|
{
|
|
21641
21641
|
variant: "ghost",
|
|
21642
|
-
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",
|
|
21642
|
+
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",
|
|
21643
21643
|
onClick: () => setSidebarOpen(true),
|
|
21644
21644
|
"aria-label": "Open sidebar",
|
|
21645
21645
|
children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
|
|
21646
21646
|
}
|
|
21647
21647
|
),
|
|
21648
|
-
searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
21648
|
+
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: [
|
|
21649
21649
|
/* @__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" }),
|
|
21650
21650
|
/* @__PURE__ */ jsx(
|
|
21651
21651
|
Input,
|
|
@@ -21730,12 +21730,12 @@ var init_DashboardLayout = __esm({
|
|
|
21730
21730
|
Typography,
|
|
21731
21731
|
{
|
|
21732
21732
|
variant: "small",
|
|
21733
|
-
className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
|
|
21733
|
+
className: "hidden @sm/dashboard:block text-sm font-medium text-foreground dark:text-foreground",
|
|
21734
21734
|
as: "span",
|
|
21735
21735
|
children: user.name
|
|
21736
21736
|
}
|
|
21737
21737
|
),
|
|
21738
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
21738
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "hidden @sm/dashboard:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
21739
21739
|
]
|
|
21740
21740
|
}
|
|
21741
21741
|
),
|
|
@@ -21792,7 +21792,7 @@ var init_DashboardLayout = __esm({
|
|
|
21792
21792
|
)
|
|
21793
21793
|
}
|
|
21794
21794
|
),
|
|
21795
|
-
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
|
|
21795
|
+
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
21796
21796
|
] })
|
|
21797
21797
|
]
|
|
21798
21798
|
}
|
|
@@ -29349,7 +29349,16 @@ var init_StepFlow = __esm({
|
|
|
29349
29349
|
"flex items-center justify-center",
|
|
29350
29350
|
"bg-primary text-primary-foreground"
|
|
29351
29351
|
),
|
|
29352
|
-
children: /* @__PURE__ */ jsx(
|
|
29352
|
+
children: /* @__PURE__ */ jsx(
|
|
29353
|
+
Typography,
|
|
29354
|
+
{
|
|
29355
|
+
as: "span",
|
|
29356
|
+
variant: "small",
|
|
29357
|
+
weight: "semibold",
|
|
29358
|
+
className: "text-primary-foreground leading-none",
|
|
29359
|
+
children: step.number ?? index + 1
|
|
29360
|
+
}
|
|
29361
|
+
)
|
|
29353
29362
|
}
|
|
29354
29363
|
);
|
|
29355
29364
|
};
|
|
@@ -31074,64 +31083,68 @@ var init_PositionedCanvas = __esm({
|
|
|
31074
31083
|
},
|
|
31075
31084
|
[onSelect, selectEvent, eventBus]
|
|
31076
31085
|
);
|
|
31077
|
-
return
|
|
31078
|
-
|
|
31079
|
-
|
|
31080
|
-
|
|
31081
|
-
|
|
31082
|
-
|
|
31083
|
-
|
|
31084
|
-
|
|
31085
|
-
|
|
31086
|
-
|
|
31087
|
-
|
|
31088
|
-
|
|
31089
|
-
|
|
31090
|
-
|
|
31091
|
-
|
|
31092
|
-
|
|
31093
|
-
|
|
31094
|
-
|
|
31095
|
-
|
|
31096
|
-
|
|
31097
|
-
|
|
31098
|
-
|
|
31099
|
-
|
|
31100
|
-
"
|
|
31101
|
-
"
|
|
31102
|
-
|
|
31103
|
-
|
|
31104
|
-
|
|
31105
|
-
|
|
31106
|
-
|
|
31107
|
-
|
|
31108
|
-
|
|
31109
|
-
|
|
31110
|
-
|
|
31111
|
-
|
|
31112
|
-
|
|
31113
|
-
|
|
31114
|
-
|
|
31115
|
-
|
|
31116
|
-
|
|
31117
|
-
|
|
31118
|
-
|
|
31119
|
-
|
|
31120
|
-
|
|
31121
|
-
|
|
31122
|
-
{
|
|
31123
|
-
|
|
31124
|
-
|
|
31125
|
-
|
|
31126
|
-
|
|
31127
|
-
|
|
31128
|
-
|
|
31129
|
-
|
|
31130
|
-
|
|
31131
|
-
|
|
31132
|
-
|
|
31133
|
-
|
|
31134
|
-
|
|
31086
|
+
return (
|
|
31087
|
+
// Outer scroll viewport: caps the visual footprint to the parent's
|
|
31088
|
+
// available width on small screens. The inner plane keeps its fixed
|
|
31089
|
+
// {width × height} coordinate system (items are positioned by
|
|
31090
|
+
// absolute item.x/item.y), so a phone-sized viewport pans inside
|
|
31091
|
+
// the larger logical canvas rather than busting the layout.
|
|
31092
|
+
/* @__PURE__ */ jsx(Box, { className: cn("max-w-full overflow-auto rounded-md", className), children: /* @__PURE__ */ jsx(
|
|
31093
|
+
Box,
|
|
31094
|
+
{
|
|
31095
|
+
ref: containerRef,
|
|
31096
|
+
"data-testid": "positioned-canvas",
|
|
31097
|
+
className: "relative bg-background border border-border rounded-md overflow-hidden",
|
|
31098
|
+
style: { width, height },
|
|
31099
|
+
onClick: handleContainerClick,
|
|
31100
|
+
children: items.map((item) => {
|
|
31101
|
+
const status = item.status ?? "empty";
|
|
31102
|
+
const shape = item.shape ?? "round";
|
|
31103
|
+
const isSelected = selectedId === item.id;
|
|
31104
|
+
const isDragging = draggingId === item.id;
|
|
31105
|
+
const statusBadge = STATUS_BADGE[status];
|
|
31106
|
+
return /* @__PURE__ */ jsxs(
|
|
31107
|
+
Box,
|
|
31108
|
+
{
|
|
31109
|
+
"data-testid": `item-node-${item.id}`,
|
|
31110
|
+
"data-status": status,
|
|
31111
|
+
className: cn(
|
|
31112
|
+
"absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
|
|
31113
|
+
"transition-shadow",
|
|
31114
|
+
STATUS_CLASSES[status],
|
|
31115
|
+
getShapeClasses(shape),
|
|
31116
|
+
editable ? "cursor-move" : "cursor-pointer",
|
|
31117
|
+
isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
|
|
31118
|
+
isDragging && "shadow-lg z-10"
|
|
31119
|
+
),
|
|
31120
|
+
style: { left: item.x, top: item.y, touchAction: "none" },
|
|
31121
|
+
onPointerDown: (e) => handlePointerDown(e, item),
|
|
31122
|
+
onPointerMove: handlePointerMove,
|
|
31123
|
+
onPointerUp: (e) => handlePointerUp(e, item),
|
|
31124
|
+
onPointerCancel: (e) => handlePointerUp(e, item),
|
|
31125
|
+
children: [
|
|
31126
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", children: [
|
|
31127
|
+
getStatusIcon(status),
|
|
31128
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
|
|
31129
|
+
] }),
|
|
31130
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
|
|
31131
|
+
status === "seated" && item.serverName && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
|
|
31132
|
+
isSelected && /* @__PURE__ */ jsx(
|
|
31133
|
+
Badge,
|
|
31134
|
+
{
|
|
31135
|
+
variant: statusBadge.variant,
|
|
31136
|
+
size: "sm",
|
|
31137
|
+
className: "absolute -top-2 -right-2",
|
|
31138
|
+
children: statusBadge.label
|
|
31139
|
+
}
|
|
31140
|
+
)
|
|
31141
|
+
]
|
|
31142
|
+
},
|
|
31143
|
+
item.id
|
|
31144
|
+
);
|
|
31145
|
+
})
|
|
31146
|
+
}
|
|
31147
|
+
) })
|
|
31135
31148
|
);
|
|
31136
31149
|
};
|
|
31137
31150
|
PositionedCanvas.displayName = "PositionedCanvas";
|