@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/runtime/index.cjs
CHANGED
|
@@ -21357,12 +21357,12 @@ var init_DashboardLayout = __esm({
|
|
|
21357
21357
|
HStack,
|
|
21358
21358
|
{
|
|
21359
21359
|
gap: "none",
|
|
21360
|
-
className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21360
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21361
21361
|
children: [
|
|
21362
21362
|
sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21363
21363
|
Box,
|
|
21364
21364
|
{
|
|
21365
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
|
|
21365
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
21366
21366
|
onClick: () => setSidebarOpen(false)
|
|
21367
21367
|
}
|
|
21368
21368
|
),
|
|
@@ -21372,7 +21372,7 @@ var init_DashboardLayout = __esm({
|
|
|
21372
21372
|
as: "aside",
|
|
21373
21373
|
className: cn(
|
|
21374
21374
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
21375
|
-
"fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
|
|
21375
|
+
"fixed inset-y-0 left-0 @lg/dashboard:static @lg/dashboard:translate-x-0 @lg/dashboard:h-auto",
|
|
21376
21376
|
"transform transition-transform duration-200 ease-in-out",
|
|
21377
21377
|
"flex flex-col",
|
|
21378
21378
|
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
@@ -21409,7 +21409,7 @@ var init_DashboardLayout = __esm({
|
|
|
21409
21409
|
Button,
|
|
21410
21410
|
{
|
|
21411
21411
|
variant: "ghost",
|
|
21412
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21412
|
+
className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21413
21413
|
onClick: () => setSidebarOpen(false),
|
|
21414
21414
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.X, { className: "h-5 w-5" })
|
|
21415
21415
|
}
|
|
@@ -21448,19 +21448,19 @@ var init_DashboardLayout = __esm({
|
|
|
21448
21448
|
{
|
|
21449
21449
|
align: "center",
|
|
21450
21450
|
justify: "between",
|
|
21451
|
-
className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
|
|
21451
|
+
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21452
21452
|
children: [
|
|
21453
21453
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21454
21454
|
Button,
|
|
21455
21455
|
{
|
|
21456
21456
|
variant: "ghost",
|
|
21457
|
-
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",
|
|
21457
|
+
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",
|
|
21458
21458
|
onClick: () => setSidebarOpen(true),
|
|
21459
21459
|
"aria-label": "Open sidebar",
|
|
21460
21460
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Menu, { className: "h-5 w-5" })
|
|
21461
21461
|
}
|
|
21462
21462
|
),
|
|
21463
|
-
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: [
|
|
21463
|
+
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: [
|
|
21464
21464
|
/* @__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" }),
|
|
21465
21465
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21466
21466
|
Input,
|
|
@@ -21545,12 +21545,12 @@ var init_DashboardLayout = __esm({
|
|
|
21545
21545
|
Typography,
|
|
21546
21546
|
{
|
|
21547
21547
|
variant: "small",
|
|
21548
|
-
className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
|
|
21548
|
+
className: "hidden @sm/dashboard:block text-sm font-medium text-foreground dark:text-foreground",
|
|
21549
21549
|
as: "span",
|
|
21550
21550
|
children: user.name
|
|
21551
21551
|
}
|
|
21552
21552
|
),
|
|
21553
|
-
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
21553
|
+
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, { className: "hidden @sm/dashboard:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
21554
21554
|
]
|
|
21555
21555
|
}
|
|
21556
21556
|
),
|
|
@@ -21607,7 +21607,7 @@ var init_DashboardLayout = __esm({
|
|
|
21607
21607
|
)
|
|
21608
21608
|
}
|
|
21609
21609
|
),
|
|
21610
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
|
|
21610
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
21611
21611
|
] })
|
|
21612
21612
|
]
|
|
21613
21613
|
}
|
|
@@ -28962,7 +28962,16 @@ var init_StepFlow = __esm({
|
|
|
28962
28962
|
"flex items-center justify-center",
|
|
28963
28963
|
"bg-primary text-primary-foreground"
|
|
28964
28964
|
),
|
|
28965
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
28965
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
28966
|
+
Typography,
|
|
28967
|
+
{
|
|
28968
|
+
as: "span",
|
|
28969
|
+
variant: "small",
|
|
28970
|
+
weight: "semibold",
|
|
28971
|
+
className: "text-primary-foreground leading-none",
|
|
28972
|
+
children: step.number ?? index + 1
|
|
28973
|
+
}
|
|
28974
|
+
)
|
|
28966
28975
|
}
|
|
28967
28976
|
);
|
|
28968
28977
|
};
|
|
@@ -30687,64 +30696,68 @@ var init_PositionedCanvas = __esm({
|
|
|
30687
30696
|
},
|
|
30688
30697
|
[onSelect, selectEvent, eventBus]
|
|
30689
30698
|
);
|
|
30690
|
-
return
|
|
30691
|
-
|
|
30692
|
-
|
|
30693
|
-
|
|
30694
|
-
|
|
30695
|
-
|
|
30696
|
-
|
|
30697
|
-
|
|
30698
|
-
|
|
30699
|
-
|
|
30700
|
-
|
|
30701
|
-
|
|
30702
|
-
|
|
30703
|
-
|
|
30704
|
-
|
|
30705
|
-
|
|
30706
|
-
|
|
30707
|
-
|
|
30708
|
-
|
|
30709
|
-
|
|
30710
|
-
|
|
30711
|
-
|
|
30712
|
-
|
|
30713
|
-
"
|
|
30714
|
-
"
|
|
30715
|
-
|
|
30716
|
-
|
|
30717
|
-
|
|
30718
|
-
|
|
30719
|
-
|
|
30720
|
-
|
|
30721
|
-
|
|
30722
|
-
|
|
30723
|
-
|
|
30724
|
-
|
|
30725
|
-
|
|
30726
|
-
|
|
30727
|
-
|
|
30728
|
-
|
|
30729
|
-
|
|
30730
|
-
|
|
30731
|
-
|
|
30732
|
-
|
|
30733
|
-
|
|
30734
|
-
|
|
30735
|
-
{
|
|
30736
|
-
|
|
30737
|
-
|
|
30738
|
-
|
|
30739
|
-
|
|
30740
|
-
|
|
30741
|
-
|
|
30742
|
-
|
|
30743
|
-
|
|
30744
|
-
|
|
30745
|
-
|
|
30746
|
-
|
|
30747
|
-
|
|
30699
|
+
return (
|
|
30700
|
+
// Outer scroll viewport: caps the visual footprint to the parent's
|
|
30701
|
+
// available width on small screens. The inner plane keeps its fixed
|
|
30702
|
+
// {width × height} coordinate system (items are positioned by
|
|
30703
|
+
// absolute item.x/item.y), so a phone-sized viewport pans inside
|
|
30704
|
+
// the larger logical canvas rather than busting the layout.
|
|
30705
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("max-w-full overflow-auto rounded-md", className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30706
|
+
Box,
|
|
30707
|
+
{
|
|
30708
|
+
ref: containerRef,
|
|
30709
|
+
"data-testid": "positioned-canvas",
|
|
30710
|
+
className: "relative bg-background border border-border rounded-md overflow-hidden",
|
|
30711
|
+
style: { width, height },
|
|
30712
|
+
onClick: handleContainerClick,
|
|
30713
|
+
children: items.map((item) => {
|
|
30714
|
+
const status = item.status ?? "empty";
|
|
30715
|
+
const shape = item.shape ?? "round";
|
|
30716
|
+
const isSelected = selectedId === item.id;
|
|
30717
|
+
const isDragging = draggingId === item.id;
|
|
30718
|
+
const statusBadge = STATUS_BADGE[status];
|
|
30719
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30720
|
+
Box,
|
|
30721
|
+
{
|
|
30722
|
+
"data-testid": `item-node-${item.id}`,
|
|
30723
|
+
"data-status": status,
|
|
30724
|
+
className: cn(
|
|
30725
|
+
"absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
|
|
30726
|
+
"transition-shadow",
|
|
30727
|
+
STATUS_CLASSES[status],
|
|
30728
|
+
getShapeClasses(shape),
|
|
30729
|
+
editable ? "cursor-move" : "cursor-pointer",
|
|
30730
|
+
isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
|
|
30731
|
+
isDragging && "shadow-lg z-10"
|
|
30732
|
+
),
|
|
30733
|
+
style: { left: item.x, top: item.y, touchAction: "none" },
|
|
30734
|
+
onPointerDown: (e) => handlePointerDown(e, item),
|
|
30735
|
+
onPointerMove: handlePointerMove,
|
|
30736
|
+
onPointerUp: (e) => handlePointerUp(e, item),
|
|
30737
|
+
onPointerCancel: (e) => handlePointerUp(e, item),
|
|
30738
|
+
children: [
|
|
30739
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", children: [
|
|
30740
|
+
getStatusIcon(status),
|
|
30741
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
|
|
30742
|
+
] }),
|
|
30743
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
|
|
30744
|
+
status === "seated" && item.serverName && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
|
|
30745
|
+
isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
30746
|
+
Badge,
|
|
30747
|
+
{
|
|
30748
|
+
variant: statusBadge.variant,
|
|
30749
|
+
size: "sm",
|
|
30750
|
+
className: "absolute -top-2 -right-2",
|
|
30751
|
+
children: statusBadge.label
|
|
30752
|
+
}
|
|
30753
|
+
)
|
|
30754
|
+
]
|
|
30755
|
+
},
|
|
30756
|
+
item.id
|
|
30757
|
+
);
|
|
30758
|
+
})
|
|
30759
|
+
}
|
|
30760
|
+
) })
|
|
30748
30761
|
);
|
|
30749
30762
|
};
|
|
30750
30763
|
PositionedCanvas.displayName = "PositionedCanvas";
|
package/dist/runtime/index.js
CHANGED
|
@@ -21311,12 +21311,12 @@ var init_DashboardLayout = __esm({
|
|
|
21311
21311
|
HStack,
|
|
21312
21312
|
{
|
|
21313
21313
|
gap: "none",
|
|
21314
|
-
className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21314
|
+
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21315
21315
|
children: [
|
|
21316
21316
|
sidebarOpen && /* @__PURE__ */ jsx(
|
|
21317
21317
|
Box,
|
|
21318
21318
|
{
|
|
21319
|
-
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
|
|
21319
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
21320
21320
|
onClick: () => setSidebarOpen(false)
|
|
21321
21321
|
}
|
|
21322
21322
|
),
|
|
@@ -21326,7 +21326,7 @@ var init_DashboardLayout = __esm({
|
|
|
21326
21326
|
as: "aside",
|
|
21327
21327
|
className: cn(
|
|
21328
21328
|
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
21329
|
-
"fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
|
|
21329
|
+
"fixed inset-y-0 left-0 @lg/dashboard:static @lg/dashboard:translate-x-0 @lg/dashboard:h-auto",
|
|
21330
21330
|
"transform transition-transform duration-200 ease-in-out",
|
|
21331
21331
|
"flex flex-col",
|
|
21332
21332
|
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
@@ -21363,7 +21363,7 @@ var init_DashboardLayout = __esm({
|
|
|
21363
21363
|
Button,
|
|
21364
21364
|
{
|
|
21365
21365
|
variant: "ghost",
|
|
21366
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21366
|
+
className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
21367
21367
|
onClick: () => setSidebarOpen(false),
|
|
21368
21368
|
children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
|
|
21369
21369
|
}
|
|
@@ -21402,19 +21402,19 @@ var init_DashboardLayout = __esm({
|
|
|
21402
21402
|
{
|
|
21403
21403
|
align: "center",
|
|
21404
21404
|
justify: "between",
|
|
21405
|
-
className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
|
|
21405
|
+
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21406
21406
|
children: [
|
|
21407
21407
|
/* @__PURE__ */ jsx(
|
|
21408
21408
|
Button,
|
|
21409
21409
|
{
|
|
21410
21410
|
variant: "ghost",
|
|
21411
|
-
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",
|
|
21411
|
+
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",
|
|
21412
21412
|
onClick: () => setSidebarOpen(true),
|
|
21413
21413
|
"aria-label": "Open sidebar",
|
|
21414
21414
|
children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
|
|
21415
21415
|
}
|
|
21416
21416
|
),
|
|
21417
|
-
searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
21417
|
+
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: [
|
|
21418
21418
|
/* @__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" }),
|
|
21419
21419
|
/* @__PURE__ */ jsx(
|
|
21420
21420
|
Input,
|
|
@@ -21499,12 +21499,12 @@ var init_DashboardLayout = __esm({
|
|
|
21499
21499
|
Typography,
|
|
21500
21500
|
{
|
|
21501
21501
|
variant: "small",
|
|
21502
|
-
className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
|
|
21502
|
+
className: "hidden @sm/dashboard:block text-sm font-medium text-foreground dark:text-foreground",
|
|
21503
21503
|
as: "span",
|
|
21504
21504
|
children: user.name
|
|
21505
21505
|
}
|
|
21506
21506
|
),
|
|
21507
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
21507
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "hidden @sm/dashboard:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
21508
21508
|
]
|
|
21509
21509
|
}
|
|
21510
21510
|
),
|
|
@@ -21561,7 +21561,7 @@ var init_DashboardLayout = __esm({
|
|
|
21561
21561
|
)
|
|
21562
21562
|
}
|
|
21563
21563
|
),
|
|
21564
|
-
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
|
|
21564
|
+
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
21565
21565
|
] })
|
|
21566
21566
|
]
|
|
21567
21567
|
}
|
|
@@ -28916,7 +28916,16 @@ var init_StepFlow = __esm({
|
|
|
28916
28916
|
"flex items-center justify-center",
|
|
28917
28917
|
"bg-primary text-primary-foreground"
|
|
28918
28918
|
),
|
|
28919
|
-
children: /* @__PURE__ */ jsx(
|
|
28919
|
+
children: /* @__PURE__ */ jsx(
|
|
28920
|
+
Typography,
|
|
28921
|
+
{
|
|
28922
|
+
as: "span",
|
|
28923
|
+
variant: "small",
|
|
28924
|
+
weight: "semibold",
|
|
28925
|
+
className: "text-primary-foreground leading-none",
|
|
28926
|
+
children: step.number ?? index + 1
|
|
28927
|
+
}
|
|
28928
|
+
)
|
|
28920
28929
|
}
|
|
28921
28930
|
);
|
|
28922
28931
|
};
|
|
@@ -30641,64 +30650,68 @@ var init_PositionedCanvas = __esm({
|
|
|
30641
30650
|
},
|
|
30642
30651
|
[onSelect, selectEvent, eventBus]
|
|
30643
30652
|
);
|
|
30644
|
-
return
|
|
30645
|
-
|
|
30646
|
-
|
|
30647
|
-
|
|
30648
|
-
|
|
30649
|
-
|
|
30650
|
-
|
|
30651
|
-
|
|
30652
|
-
|
|
30653
|
-
|
|
30654
|
-
|
|
30655
|
-
|
|
30656
|
-
|
|
30657
|
-
|
|
30658
|
-
|
|
30659
|
-
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
|
|
30663
|
-
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
"
|
|
30668
|
-
"
|
|
30669
|
-
|
|
30670
|
-
|
|
30671
|
-
|
|
30672
|
-
|
|
30673
|
-
|
|
30674
|
-
|
|
30675
|
-
|
|
30676
|
-
|
|
30677
|
-
|
|
30678
|
-
|
|
30679
|
-
|
|
30680
|
-
|
|
30681
|
-
|
|
30682
|
-
|
|
30683
|
-
|
|
30684
|
-
|
|
30685
|
-
|
|
30686
|
-
|
|
30687
|
-
|
|
30688
|
-
|
|
30689
|
-
{
|
|
30690
|
-
|
|
30691
|
-
|
|
30692
|
-
|
|
30693
|
-
|
|
30694
|
-
|
|
30695
|
-
|
|
30696
|
-
|
|
30697
|
-
|
|
30698
|
-
|
|
30699
|
-
|
|
30700
|
-
|
|
30701
|
-
|
|
30653
|
+
return (
|
|
30654
|
+
// Outer scroll viewport: caps the visual footprint to the parent's
|
|
30655
|
+
// available width on small screens. The inner plane keeps its fixed
|
|
30656
|
+
// {width × height} coordinate system (items are positioned by
|
|
30657
|
+
// absolute item.x/item.y), so a phone-sized viewport pans inside
|
|
30658
|
+
// the larger logical canvas rather than busting the layout.
|
|
30659
|
+
/* @__PURE__ */ jsx(Box, { className: cn("max-w-full overflow-auto rounded-md", className), children: /* @__PURE__ */ jsx(
|
|
30660
|
+
Box,
|
|
30661
|
+
{
|
|
30662
|
+
ref: containerRef,
|
|
30663
|
+
"data-testid": "positioned-canvas",
|
|
30664
|
+
className: "relative bg-background border border-border rounded-md overflow-hidden",
|
|
30665
|
+
style: { width, height },
|
|
30666
|
+
onClick: handleContainerClick,
|
|
30667
|
+
children: items.map((item) => {
|
|
30668
|
+
const status = item.status ?? "empty";
|
|
30669
|
+
const shape = item.shape ?? "round";
|
|
30670
|
+
const isSelected = selectedId === item.id;
|
|
30671
|
+
const isDragging = draggingId === item.id;
|
|
30672
|
+
const statusBadge = STATUS_BADGE[status];
|
|
30673
|
+
return /* @__PURE__ */ jsxs(
|
|
30674
|
+
Box,
|
|
30675
|
+
{
|
|
30676
|
+
"data-testid": `item-node-${item.id}`,
|
|
30677
|
+
"data-status": status,
|
|
30678
|
+
className: cn(
|
|
30679
|
+
"absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
|
|
30680
|
+
"transition-shadow",
|
|
30681
|
+
STATUS_CLASSES[status],
|
|
30682
|
+
getShapeClasses(shape),
|
|
30683
|
+
editable ? "cursor-move" : "cursor-pointer",
|
|
30684
|
+
isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
|
|
30685
|
+
isDragging && "shadow-lg z-10"
|
|
30686
|
+
),
|
|
30687
|
+
style: { left: item.x, top: item.y, touchAction: "none" },
|
|
30688
|
+
onPointerDown: (e) => handlePointerDown(e, item),
|
|
30689
|
+
onPointerMove: handlePointerMove,
|
|
30690
|
+
onPointerUp: (e) => handlePointerUp(e, item),
|
|
30691
|
+
onPointerCancel: (e) => handlePointerUp(e, item),
|
|
30692
|
+
children: [
|
|
30693
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", children: [
|
|
30694
|
+
getStatusIcon(status),
|
|
30695
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
|
|
30696
|
+
] }),
|
|
30697
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
|
|
30698
|
+
status === "seated" && item.serverName && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
|
|
30699
|
+
isSelected && /* @__PURE__ */ jsx(
|
|
30700
|
+
Badge,
|
|
30701
|
+
{
|
|
30702
|
+
variant: statusBadge.variant,
|
|
30703
|
+
size: "sm",
|
|
30704
|
+
className: "absolute -top-2 -right-2",
|
|
30705
|
+
children: statusBadge.label
|
|
30706
|
+
}
|
|
30707
|
+
)
|
|
30708
|
+
]
|
|
30709
|
+
},
|
|
30710
|
+
item.id
|
|
30711
|
+
);
|
|
30712
|
+
})
|
|
30713
|
+
}
|
|
30714
|
+
) })
|
|
30702
30715
|
);
|
|
30703
30716
|
};
|
|
30704
30717
|
PositionedCanvas.displayName = "PositionedCanvas";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.53.2",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -167,6 +167,7 @@
|
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
169
|
"@almadar/eslint-plugin": ">=2.3.0",
|
|
170
|
+
"@tailwindcss/container-queries": "^0.1.1",
|
|
170
171
|
"@react-three/drei": "^10.7.7",
|
|
171
172
|
"@react-three/fiber": "^9.6.0",
|
|
172
173
|
"@react-three/postprocessing": "3.0.4",
|
package/tailwind-preset.cjs
CHANGED
|
@@ -330,6 +330,19 @@ module.exports = {
|
|
|
330
330
|
normal: 'var(--transition-normal, 250ms)',
|
|
331
331
|
slow: 'var(--transition-slow, 400ms)',
|
|
332
332
|
},
|
|
333
|
+
// Container-query breakpoints aligned 1:1 with Tailwind's default
|
|
334
|
+
// viewport breakpoints (sm 640 / md 768 / lg 1024 / xl 1280 /
|
|
335
|
+
// 2xl 1536). Lets components use `@lg/foo:hidden` as a drop-in
|
|
336
|
+
// replacement for `lg:hidden` when they're rendered inside a
|
|
337
|
+
// CSS Container (the Studio preview, embedded iframes, etc.) so
|
|
338
|
+
// the layout responds to the container's width, not the viewport.
|
|
339
|
+
containers: {
|
|
340
|
+
sm: '40rem',
|
|
341
|
+
md: '48rem',
|
|
342
|
+
lg: '64rem',
|
|
343
|
+
xl: '80rem',
|
|
344
|
+
'2xl': '96rem',
|
|
345
|
+
},
|
|
333
346
|
},
|
|
334
347
|
},
|
|
335
348
|
};
|