@dxos/react-ui-stack 0.8.4-main.f9ba587 → 0.8.4-main.fffef41

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.
Files changed (88) hide show
  1. package/dist/lib/browser/chunk-3F2KBXLP.mjs +1482 -0
  2. package/dist/lib/browser/chunk-3F2KBXLP.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +45 -1158
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/playwright/index.mjs +61 -0
  7. package/dist/lib/browser/playwright/index.mjs.map +7 -0
  8. package/dist/lib/browser/testing/index.mjs +25 -51
  9. package/dist/lib/browser/testing/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/chunk-SYKFLQGK.mjs +1484 -0
  11. package/dist/lib/node-esm/chunk-SYKFLQGK.mjs.map +7 -0
  12. package/dist/lib/node-esm/index.mjs +45 -1159
  13. package/dist/lib/node-esm/index.mjs.map +4 -4
  14. package/dist/lib/node-esm/meta.json +1 -1
  15. package/dist/lib/node-esm/playwright/index.mjs +63 -0
  16. package/dist/lib/node-esm/playwright/index.mjs.map +7 -0
  17. package/dist/lib/node-esm/testing/index.mjs +24 -51
  18. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  19. package/dist/types/src/components/Image/Image.d.ts +14 -0
  20. package/dist/types/src/components/Image/Image.d.ts.map +1 -0
  21. package/dist/types/src/components/Image/Image.stories.d.ts +33 -0
  22. package/dist/types/src/components/Image/Image.stories.d.ts.map +1 -0
  23. package/dist/types/src/components/Image/index.d.ts +2 -0
  24. package/dist/types/src/components/Image/index.d.ts.map +1 -0
  25. package/dist/types/src/components/Stack/Stack.d.ts +15 -7
  26. package/dist/types/src/components/Stack/Stack.d.ts.map +1 -1
  27. package/dist/types/src/components/Stack/Stack.stories.d.ts +12 -3
  28. package/dist/types/src/components/Stack/Stack.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/StackContext.d.ts +2 -1
  30. package/dist/types/src/components/StackContext.d.ts.map +1 -1
  31. package/dist/types/src/components/StackItem/StackItem.d.ts +7 -6
  32. package/dist/types/src/components/StackItem/StackItem.d.ts.map +1 -1
  33. package/dist/types/src/components/StackItem/StackItem.stories.d.ts +13 -5
  34. package/dist/types/src/components/StackItem/StackItem.stories.d.ts.map +1 -1
  35. package/dist/types/src/components/StackItem/StackItemContent.d.ts +20 -10
  36. package/dist/types/src/components/StackItem/StackItemContent.d.ts.map +1 -1
  37. package/dist/types/src/components/StackItem/StackItemHeading.d.ts +1 -1
  38. package/dist/types/src/components/StackItem/StackItemHeading.d.ts.map +1 -1
  39. package/dist/types/src/components/StackItem/StackItemResizeHandle.d.ts.map +1 -1
  40. package/dist/types/src/components/StackItem/StackItemSigil.d.ts.map +1 -1
  41. package/dist/types/src/components/index.d.ts +2 -1
  42. package/dist/types/src/components/index.d.ts.map +1 -1
  43. package/dist/types/src/exemplars/Card/Card.d.ts +25 -13
  44. package/dist/types/src/exemplars/Card/Card.d.ts.map +1 -1
  45. package/dist/types/src/exemplars/Card/Card.stories.d.ts +12 -4
  46. package/dist/types/src/exemplars/Card/Card.stories.d.ts.map +1 -1
  47. package/dist/types/src/exemplars/Card/fragments.d.ts +3 -2
  48. package/dist/types/src/exemplars/Card/fragments.d.ts.map +1 -1
  49. package/dist/types/src/exemplars/CardStack/CardStack.d.ts +3 -1
  50. package/dist/types/src/exemplars/CardStack/CardStack.d.ts.map +1 -1
  51. package/dist/types/src/exemplars/CardStack/CardStack.stories.d.ts +9 -3
  52. package/dist/types/src/exemplars/CardStack/CardStack.stories.d.ts.map +1 -1
  53. package/dist/types/src/hooks/useStackDropForElements.d.ts +3 -3
  54. package/dist/types/src/hooks/useStackDropForElements.d.ts.map +1 -1
  55. package/dist/types/src/playwright/index.d.ts +2 -0
  56. package/dist/types/src/playwright/index.d.ts.map +1 -0
  57. package/dist/types/src/playwright/stack-manager.d.ts.map +1 -0
  58. package/dist/types/src/testing/CardContainer.d.ts +6 -0
  59. package/dist/types/src/testing/CardContainer.d.ts.map +1 -0
  60. package/dist/types/src/testing/index.d.ts +1 -1
  61. package/dist/types/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +36 -30
  63. package/src/components/Image/Image.stories.tsx +84 -0
  64. package/src/components/Image/Image.tsx +222 -0
  65. package/src/components/Image/index.ts +5 -0
  66. package/src/components/Stack/Stack.stories.tsx +8 -9
  67. package/src/components/Stack/Stack.tsx +222 -25
  68. package/src/components/StackContext.tsx +2 -1
  69. package/src/components/StackItem/StackItem.stories.tsx +16 -14
  70. package/src/components/StackItem/StackItem.tsx +26 -18
  71. package/src/components/StackItem/StackItemContent.tsx +21 -9
  72. package/src/components/StackItem/StackItemHeading.tsx +4 -8
  73. package/src/components/StackItem/StackItemResizeHandle.tsx +2 -1
  74. package/src/components/StackItem/StackItemSigil.tsx +2 -1
  75. package/src/components/index.ts +2 -1
  76. package/src/exemplars/Card/Card.stories.tsx +29 -43
  77. package/src/exemplars/Card/Card.tsx +67 -24
  78. package/src/exemplars/Card/fragments.ts +3 -2
  79. package/src/exemplars/CardStack/CardStack.stories.tsx +11 -10
  80. package/src/exemplars/CardStack/CardStack.tsx +12 -9
  81. package/src/hooks/useStackDropForElements.ts +43 -36
  82. package/src/playwright/index.ts +5 -0
  83. package/src/playwright/smoke.spec.ts +1 -1
  84. package/src/testing/CardContainer.tsx +37 -0
  85. package/src/testing/index.ts +1 -1
  86. package/dist/types/src/testing/stack-manager.d.ts.map +0 -1
  87. /package/dist/types/src/{testing → playwright}/stack-manager.d.ts +0 -0
  88. /package/src/{testing → playwright}/stack-manager.ts +0 -0
@@ -0,0 +1,1484 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/components/Image/Image.tsx
4
+ import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
5
+ import React, { useCallback, useRef, useState } from "react";
6
+ import { mx } from "@dxos/react-ui-theme";
7
+ var cache = /* @__PURE__ */ new Map();
8
+ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
9
+ var _effect = _useSignals();
10
+ try {
11
+ const [crossOriginState, setCrossOriginState] = useState(crossOrigin);
12
+ const [dominantColor, setDominantColor] = useState(void 0);
13
+ const [imageLoaded, setImageLoaded] = useState(false);
14
+ const canvasRef = useRef(null);
15
+ const handleImageError = () => {
16
+ setCrossOriginState(void 0);
17
+ };
18
+ const handleImageLoad = useCallback(({ target }) => {
19
+ const rgb = cache.get(src);
20
+ if (rgb) {
21
+ setDominantColor(rgb);
22
+ setImageLoaded(true);
23
+ return;
24
+ }
25
+ const img = target;
26
+ if (!canvasRef.current) {
27
+ return;
28
+ }
29
+ try {
30
+ const color = extractDominantColor(canvasRef.current, img, {
31
+ sampleSize,
32
+ contrast
33
+ });
34
+ if (color) {
35
+ const rgb2 = `rgb(${color[0]}, ${color[1]}, ${color[2]})`;
36
+ cache.set(src, rgb2);
37
+ setDominantColor(rgb2);
38
+ }
39
+ } catch {
40
+ setCrossOriginState(void 0);
41
+ }
42
+ setImageLoaded(true);
43
+ }, [
44
+ sampleSize,
45
+ contrast,
46
+ src
47
+ ]);
48
+ return /* @__PURE__ */ React.createElement("div", {
49
+ className: mx(`relative flex is-full justify-center overflow-hidden transition-all duration-700`, classNames),
50
+ style: {
51
+ backgroundColor: dominantColor
52
+ }
53
+ }, /* @__PURE__ */ React.createElement("canvas", {
54
+ ref: canvasRef,
55
+ style: {
56
+ display: "none"
57
+ },
58
+ "aria-hidden": "true"
59
+ }), /* @__PURE__ */ React.createElement("div", {
60
+ className: "absolute inset-0 pointer-events-none",
61
+ style: {
62
+ background: dominantColor ? `radial-gradient(circle at center, transparent 30%, ${dominantColor} 100%)` : void 0,
63
+ transition: "opacity 0.7s ease-in-out",
64
+ opacity: 0.5
65
+ }
66
+ }), /* @__PURE__ */ React.createElement("img", {
67
+ src,
68
+ alt,
69
+ crossOrigin: crossOriginState,
70
+ onError: handleImageError,
71
+ onLoad: handleImageLoad,
72
+ className: mx("z-10 object-contain transition-opacity duration-500", classNames),
73
+ style: {
74
+ opacity: imageLoaded ? 1 : 0
75
+ }
76
+ }));
77
+ } finally {
78
+ _effect.f();
79
+ }
80
+ };
81
+ var extractDominantColor = (canvas, img, { sampleSize = 64, contrast = 0.95 }) => {
82
+ const ctx = canvas.getContext("2d");
83
+ if (!ctx) {
84
+ return null;
85
+ }
86
+ canvas.width = sampleSize;
87
+ canvas.height = sampleSize;
88
+ ctx.drawImage(img, 0, 0, sampleSize, sampleSize);
89
+ const imageData = ctx.getImageData(0, 0, sampleSize, sampleSize);
90
+ const pixels = imageData.data;
91
+ if (isTransparent(pixels, sampleSize)) {
92
+ return null;
93
+ }
94
+ let r = 0;
95
+ let g = 0;
96
+ let b = 0;
97
+ let totalWeight = 0;
98
+ const cornerSize = Math.floor(sampleSize * 0.125);
99
+ for (let y = 0; y < sampleSize; y++) {
100
+ for (let x = 0; x < sampleSize; x++) {
101
+ const isInTopLeft = x < cornerSize && y < cornerSize;
102
+ const isInTopRight = x >= sampleSize - cornerSize && y < cornerSize;
103
+ const isInBottomLeft = x < cornerSize && y >= sampleSize - cornerSize;
104
+ const isInBottomRight = x >= sampleSize - cornerSize && y >= sampleSize - cornerSize;
105
+ if (!isInTopLeft && !isInTopRight && !isInBottomLeft && !isInBottomRight) {
106
+ continue;
107
+ }
108
+ const i = (y * sampleSize + x) * 4;
109
+ const red = pixels[i];
110
+ const green = pixels[i + 1];
111
+ const blue = pixels[i + 2];
112
+ const alpha = pixels[i + 3];
113
+ if (alpha === 0) continue;
114
+ const max = Math.max(red, green, blue);
115
+ const min = Math.min(red, green, blue);
116
+ const saturation = max === 0 ? 0 : (max - min) / max;
117
+ const weight = 1 + saturation * 2;
118
+ r += red * weight;
119
+ g += green * weight;
120
+ b += blue * weight;
121
+ totalWeight += weight;
122
+ }
123
+ }
124
+ if (totalWeight > 0) {
125
+ r = Math.round(Math.round(r / totalWeight) * contrast);
126
+ g = Math.round(Math.round(g / totalWeight) * contrast);
127
+ b = Math.round(Math.round(b / totalWeight) * contrast);
128
+ return [
129
+ r,
130
+ g,
131
+ b
132
+ ];
133
+ }
134
+ return null;
135
+ };
136
+ var isTransparent = (pixels, sampleSize, threshold = 0.5) => {
137
+ let edgeTransparentPixels = 0;
138
+ const edgePixels = sampleSize * 4 - 4;
139
+ for (let x = 0; x < sampleSize; x++) {
140
+ const topIndex = x * 4;
141
+ if (pixels[topIndex + 3] === 0) edgeTransparentPixels++;
142
+ const bottomIndex = ((sampleSize - 1) * sampleSize + x) * 4;
143
+ if (pixels[bottomIndex + 3] === 0) edgeTransparentPixels++;
144
+ }
145
+ for (let y = 1; y < sampleSize - 1; y++) {
146
+ const leftIndex = y * sampleSize * 4;
147
+ if (pixels[leftIndex + 3] === 0) edgeTransparentPixels++;
148
+ const rightIndex = (y * sampleSize + sampleSize - 1) * 4;
149
+ if (pixels[rightIndex + 3] === 0) edgeTransparentPixels++;
150
+ }
151
+ return edgeTransparentPixels / edgePixels > threshold;
152
+ };
153
+
154
+ // src/components/StackContext.tsx
155
+ import { createContext, useContext } from "react";
156
+ var StackContext = /* @__PURE__ */ createContext({
157
+ orientation: "vertical",
158
+ rail: true,
159
+ size: "intrinsic"
160
+ });
161
+ var useStack = () => useContext(StackContext);
162
+ var idle = {
163
+ type: "idle"
164
+ };
165
+ var StackItemContext = /* @__PURE__ */ createContext({
166
+ selfDragHandleRef: () => {
167
+ },
168
+ size: "min-content",
169
+ setSize: () => {
170
+ },
171
+ state: idle,
172
+ setState: () => {
173
+ }
174
+ });
175
+ var useStackItem = () => useContext(StackItemContext);
176
+
177
+ // src/components/Stack/Stack.tsx
178
+ import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
179
+ import { composeRefs } from "@radix-ui/react-compose-refs";
180
+ import React2, { Children, forwardRef, useCallback as useCallback2, useEffect, useMemo, useState as useState3 } from "react";
181
+ import { ListItem, useId } from "@dxos/react-ui";
182
+ import { mx as mx2 } from "@dxos/react-ui-theme";
183
+
184
+ // src/hooks/useStackDropForElements.ts
185
+ import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
186
+ import { dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
187
+ import { autoScrollForElements } from "@atlaskit/pragmatic-drag-and-drop-auto-scroll/element";
188
+ import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
189
+ import { useLayoutEffect, useState as useState2 } from "react";
190
+ var noop = () => {
191
+ };
192
+ var useStackDropForElements = ({ id, element, scrollElement = element, orientation, selfDroppable, onRearrange }) => {
193
+ const [dropping, setDropping] = useState2(false);
194
+ useLayoutEffect(() => {
195
+ if (!element) {
196
+ return;
197
+ }
198
+ const acceptSourceType = orientation === "horizontal" ? "column" : "card";
199
+ return combine(selfDroppable ? dropTargetForElements({
200
+ element,
201
+ getData: ({ input, element: element2 }) => {
202
+ return attachClosestEdge({
203
+ id,
204
+ type: orientation === "horizontal" ? "card" : "column"
205
+ }, {
206
+ input,
207
+ element: element2,
208
+ allowedEdges: [
209
+ orientation === "horizontal" ? "left" : "top"
210
+ ]
211
+ });
212
+ },
213
+ onDragEnter: ({ source }) => {
214
+ if (source.data.type === acceptSourceType) {
215
+ setDropping(true);
216
+ }
217
+ },
218
+ onDrag: ({ source }) => {
219
+ if (source.data.type === acceptSourceType) {
220
+ setDropping(true);
221
+ }
222
+ },
223
+ onDragLeave: () => {
224
+ return setDropping(false);
225
+ },
226
+ onDrop: ({ self, source }) => {
227
+ setDropping(false);
228
+ if (source.data.type === acceptSourceType && selfDroppable && onRearrange) {
229
+ onRearrange(source.data, self.data, extractClosestEdge(self.data));
230
+ }
231
+ }
232
+ }) : noop, scrollElement ? autoScrollForElements({
233
+ element: scrollElement,
234
+ getAllowedAxis: () => orientation
235
+ }) : noop);
236
+ }, [
237
+ element,
238
+ scrollElement,
239
+ selfDroppable,
240
+ orientation,
241
+ id,
242
+ onRearrange
243
+ ]);
244
+ return {
245
+ dropping
246
+ };
247
+ };
248
+
249
+ // src/components/Stack/Stack.tsx
250
+ var railGridHorizontal = "grid-rows-[[rail-start]_var(--rail-size)_[content-start]_1fr_[content-end]]";
251
+ var railGridVertical = "grid-cols-[[rail-start]_var(--rail-size)_[content-start]_1fr_[content-end]]";
252
+ var railGridHorizontalContainFitContent = "grid-rows-[[rail-start]_var(--rail-size)_[content-start]_fit-content(calc(100%-var(--rail-size)*2+2px))_[content-end]]";
253
+ var railGridVerticalContainFitContent = "grid-cols-[[rail-start]_var(--rail-size)_[content-start]_fit-content(calc(100%-var(--rail-size)*2+2px))_[content-end]]";
254
+ var autoScrollRootAttributes = {
255
+ "data-drag-autoscroll": "idle"
256
+ };
257
+ var PERPENDICULAR_FOCUS_THRESHHOLD = 128;
258
+ var scrollIntoViewAndFocus = (el, orientation) => {
259
+ el.scrollIntoView({
260
+ behavior: "instant",
261
+ [orientation === "vertical" ? "block" : "inline"]: "center"
262
+ });
263
+ return el.focus();
264
+ };
265
+ var Stack = /* @__PURE__ */ forwardRef(({ children, classNames, style, orientation = "vertical", rail = true, size = "intrinsic", onRearrange, itemsCount = Children.count(children), getDropElement, separatorOnScroll, circularFocus, ...props }, forwardedRef) => {
266
+ var _effect = _useSignals2();
267
+ try {
268
+ const stackId = useId("stack", props.id);
269
+ const [stackElement, stackRef] = useState3(null);
270
+ const [lastFocusedItem, setLastFocusedItem] = useState3();
271
+ const composedItemRef = composeRefs(stackRef, forwardedRef);
272
+ const styles = {
273
+ [orientation === "horizontal" ? "gridTemplateColumns" : "gridTemplateRows"]: size === "split" ? `repeat(${itemsCount}, 1fr)` : `repeat(${itemsCount}, min-content) [tabster-dummies] 0`,
274
+ ...style
275
+ };
276
+ const selfDroppable = !!(itemsCount < 1 && onRearrange && props.id);
277
+ const { dropping } = useStackDropForElements({
278
+ id: props.id,
279
+ element: getDropElement && stackElement ? getDropElement(stackElement) : stackElement,
280
+ scrollElement: stackElement,
281
+ selfDroppable,
282
+ orientation,
283
+ onRearrange
284
+ });
285
+ const handleScroll = useCallback2(() => {
286
+ if (stackElement && Number.isFinite(separatorOnScroll)) {
287
+ const scrollPosition = orientation === "horizontal" ? stackElement.scrollLeft : stackElement.scrollTop;
288
+ const scrollSize = orientation === "horizontal" ? stackElement.scrollWidth : stackElement.scrollHeight;
289
+ const clientSize = orientation === "horizontal" ? stackElement.clientWidth : stackElement.clientHeight;
290
+ const separatorHost = stackElement.closest("[data-scroll-separator]");
291
+ if (separatorHost) {
292
+ separatorHost.setAttribute("data-scroll-separator", String(scrollPosition > separatorOnScroll));
293
+ separatorHost.setAttribute("data-scroll-separator-end", String(scrollSize - (scrollPosition + clientSize) > separatorOnScroll));
294
+ }
295
+ }
296
+ }, [
297
+ stackElement,
298
+ separatorOnScroll,
299
+ orientation
300
+ ]);
301
+ const handleBlur = useCallback2((event) => {
302
+ if (event.target) {
303
+ const target = event.target;
304
+ const closestStackItem = target.closest(`[data-dx-item-id]`);
305
+ if (closestStackItem?.closest(`[data-dx-stack="${stackId}"]`)) {
306
+ setLastFocusedItem(closestStackItem?.getAttribute("data-dx-item-id") ?? void 0);
307
+ }
308
+ }
309
+ props.onBlur?.(event);
310
+ }, [
311
+ stackId,
312
+ props.onBlur
313
+ ]);
314
+ const handleKeyDown = useCallback2((event) => {
315
+ const target = event.target;
316
+ if (event.key.startsWith("Arrow") && !target.closest(`input, textarea, [role="textbox"], [data-tabster*="mover"], [data-arrow-keys="all"], [data-arrow-keys~="${event.key.toLowerCase().slice(5)}"]`)) {
317
+ const closestOwnedItem = target.closest(`[data-dx-stack-item="${stackId}"]`);
318
+ const closestStack = target.closest("[data-dx-stack]");
319
+ const closestStackItems = Array.from(closestStack?.querySelectorAll(`[data-dx-stack-item="${stackId}"]`) ?? []);
320
+ const closestStackOrientation = closestStack?.getAttribute("aria-orientation");
321
+ const ancestorStack = closestStack?.parentElement?.closest("[data-dx-stack]");
322
+ if (closestOwnedItem && closestStack) {
323
+ const ancestorOrientation = ancestorStack?.getAttribute("aria-orientation");
324
+ const parallelDelta = (closestStackOrientation === "vertical" ? event.key === "ArrowUp" : event.key === "ArrowLeft") ? -1 : (closestStackOrientation === "vertical" ? event.key === "ArrowDown" : event.key === "ArrowRight") ? 1 : 0;
325
+ const perpendicularDelta = (closestStackOrientation === "vertical" ? event.key === "ArrowLeft" : event.key === "ArrowUp") ? -1 : (closestStackOrientation === "vertical" ? event.key === "ArrowRight" : event.key === "ArrowDown") ? 1 : 0;
326
+ if (parallelDelta !== 0) {
327
+ const currentIndex = closestStackItems.indexOf(closestOwnedItem);
328
+ const nextIndex = currentIndex + parallelDelta;
329
+ let adjacentItem;
330
+ if (circularFocus) {
331
+ adjacentItem = closestStackItems[(nextIndex + closestStackItems.length) % closestStackItems.length];
332
+ } else {
333
+ if (nextIndex >= 0 && nextIndex < closestStackItems.length) {
334
+ adjacentItem = closestStackItems[nextIndex];
335
+ }
336
+ }
337
+ if (adjacentItem) {
338
+ event.preventDefault();
339
+ scrollIntoViewAndFocus(adjacentItem, closestStackOrientation);
340
+ }
341
+ }
342
+ if (perpendicularDelta !== 0) {
343
+ if (ancestorStack && ancestorOrientation !== closestStackOrientation) {
344
+ const siblingStacks = Array.from(ancestorStack.querySelectorAll(`[data-dx-stack-item="${ancestorStack.getAttribute("data-dx-stack")}"] [data-dx-stack]`));
345
+ const currentStackIndex = siblingStacks.indexOf(closestStack);
346
+ const nextStackIndex = currentStackIndex + perpendicularDelta;
347
+ let adjacentStack;
348
+ if (ancestorStack.getAttribute("data-dx-stack-circular-focus") === "true") {
349
+ adjacentStack = siblingStacks[(nextStackIndex + siblingStacks.length) % siblingStacks.length];
350
+ } else {
351
+ if (nextStackIndex >= 0 && nextStackIndex < siblingStacks.length) {
352
+ adjacentStack = siblingStacks[nextStackIndex];
353
+ }
354
+ }
355
+ const adjacentStackSelfItem = adjacentStack?.closest(`[data-dx-stack-item=${ancestorStack.getAttribute("data-dx-stack")}]`);
356
+ const adjacentStackItems = adjacentStack ? Array.from(adjacentStack.querySelectorAll(`[data-dx-stack-item="${adjacentStack.getAttribute("data-dx-stack")}"]`)) : [];
357
+ if (adjacentStack && adjacentStackItems.length > 0) {
358
+ let closestItem = adjacentStackItems[0];
359
+ const lastFocusedItem2 = adjacentStack.querySelector(`[data-dx-item-id="${adjacentStack.getAttribute("data-dx-last-focused-item") ?? "never"}"]`);
360
+ if (lastFocusedItem2) {
361
+ closestItem = lastFocusedItem2;
362
+ } else {
363
+ const ownedItemRect = closestOwnedItem.getBoundingClientRect();
364
+ const targetPosition = closestStackOrientation === "vertical" ? ownedItemRect.top : ownedItemRect.left;
365
+ let closestDistance = Infinity;
366
+ for (const item of adjacentStackItems) {
367
+ const itemRect = item.getBoundingClientRect();
368
+ const itemPosition = closestStackOrientation === "vertical" ? itemRect.top : itemRect.left;
369
+ const distance = Math.abs(itemPosition - targetPosition);
370
+ if (distance < closestDistance) {
371
+ closestDistance = distance;
372
+ closestItem = item;
373
+ }
374
+ if (closestDistance <= PERPENDICULAR_FOCUS_THRESHHOLD) {
375
+ break;
376
+ }
377
+ }
378
+ }
379
+ event.preventDefault();
380
+ scrollIntoViewAndFocus(closestItem, closestStackOrientation);
381
+ } else if (adjacentStackSelfItem) {
382
+ event.preventDefault();
383
+ scrollIntoViewAndFocus(adjacentStackSelfItem, ancestorOrientation);
384
+ }
385
+ } else if (closestOwnedItem) {
386
+ const closestOwnedItemStack = closestOwnedItem.querySelector("[data-dx-stack]");
387
+ const closestOwnedItemStackItems = closestOwnedItemStack ? Array.from(closestOwnedItemStack.querySelectorAll(`[data-dx-stack-item="${closestOwnedItemStack.getAttribute("data-dx-stack")}"]`)) : [];
388
+ if (closestOwnedItemStackItems.length > 0) {
389
+ event.preventDefault();
390
+ scrollIntoViewAndFocus(closestOwnedItemStackItems[[
391
+ "ArrowUp",
392
+ "ArrowLeft"
393
+ ].includes(event.key) ? closestOwnedItemStackItems.length - 1 : 0], closestOwnedItemStack?.getAttribute("aria-orientation"));
394
+ }
395
+ }
396
+ }
397
+ }
398
+ }
399
+ props.onKeyDown?.(event);
400
+ }, [
401
+ props.onKeyDown,
402
+ stackId,
403
+ circularFocus
404
+ ]);
405
+ const gridClasses = useMemo(() => {
406
+ if (!rail) {
407
+ return orientation === "horizontal" ? "grid-rows-1 pli-[--stack-gap]" : "grid-cols-1 plb-[--stack-gap]";
408
+ }
409
+ if (orientation === "horizontal") {
410
+ return railGridHorizontal;
411
+ } else {
412
+ return railGridVertical;
413
+ }
414
+ }, [
415
+ rail,
416
+ orientation,
417
+ size
418
+ ]);
419
+ useEffect(() => {
420
+ if (!(stackElement && Number.isFinite(separatorOnScroll))) {
421
+ return;
422
+ }
423
+ const observer = new MutationObserver(() => {
424
+ handleScroll();
425
+ });
426
+ observer.observe(stackElement, {
427
+ childList: true,
428
+ subtree: true
429
+ });
430
+ return () => {
431
+ observer.disconnect();
432
+ };
433
+ }, [
434
+ stackElement,
435
+ handleScroll
436
+ ]);
437
+ return /* @__PURE__ */ React2.createElement(StackContext.Provider, {
438
+ value: {
439
+ orientation,
440
+ rail,
441
+ size,
442
+ onRearrange,
443
+ stackId
444
+ }
445
+ }, /* @__PURE__ */ React2.createElement("div", {
446
+ ...props,
447
+ className: mx2("grid relative [--stack-gap:var(--dx-trimXs)]", gridClasses, size === "contain" && (orientation === "horizontal" ? "overflow-x-auto overscroll-x-contain min-bs-0 max-bs-full bs-full" : "overflow-y-auto min-is-0 max-is-full is-full"), classNames),
448
+ onKeyDown: handleKeyDown,
449
+ onBlur: handleBlur,
450
+ "data-dx-stack": stackId,
451
+ "data-dx-stack-circular-focus": circularFocus,
452
+ "data-dx-last-focused-item": lastFocusedItem,
453
+ "data-rail": rail,
454
+ "aria-orientation": orientation,
455
+ style: styles,
456
+ ref: composedItemRef,
457
+ ...Number.isFinite(separatorOnScroll) && {
458
+ onScroll: handleScroll
459
+ }
460
+ }, children, selfDroppable && dropping && /* @__PURE__ */ React2.createElement(ListItem.DropIndicator, {
461
+ lineInset: 8,
462
+ terminalInset: -8,
463
+ gap: -8,
464
+ edge: orientation === "horizontal" ? "left" : "top"
465
+ })));
466
+ } finally {
467
+ _effect.f();
468
+ }
469
+ });
470
+
471
+ // src/translations.ts
472
+ var translationKey = "react-ui-stack";
473
+ var translations = [
474
+ {
475
+ "en-US": {
476
+ [translationKey]: {
477
+ "resize label": "Drag to resize",
478
+ "drag handle label": "Drag to rearrange",
479
+ "pin start label": "Pin to the left sidebar",
480
+ "pin end label": "Pin to the right sidebar",
481
+ "increment start label": "Move to the left",
482
+ "increment end label": "Move to the right",
483
+ "close label": "Close",
484
+ "minify label": "Minify"
485
+ }
486
+ }
487
+ }
488
+ ];
489
+
490
+ // src/components/StackItem/StackItem.tsx
491
+ import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
492
+ import { combine as combine2 } from "@atlaskit/pragmatic-drag-and-drop/combine";
493
+ import { draggable, dropTargetForElements as dropTargetForElements2 } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
494
+ import { preserveOffsetOnSource } from "@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source";
495
+ import { setCustomNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview";
496
+ import { attachClosestEdge as attachClosestEdge2, extractClosestEdge as extractClosestEdge2 } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
497
+ import { useFocusableGroup } from "@fluentui/react-tabster";
498
+ import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
499
+ import React9, { forwardRef as forwardRef5, useCallback as useCallback3, useLayoutEffect as useLayoutEffect2, useMemo as useMemo3, useState as useState5 } from "react";
500
+ import { createPortal } from "react-dom";
501
+ import { ListItem as ListItem2 } from "@dxos/react-ui";
502
+ import { resizeAttributes, sizeStyle } from "@dxos/react-ui-dnd";
503
+ import { mx as mx6 } from "@dxos/react-ui-theme";
504
+
505
+ // src/components/StackItem/StackItemContent.tsx
506
+ import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
507
+ import React3, { forwardRef as forwardRef2, useMemo as useMemo2 } from "react";
508
+ import { mx as mx3 } from "@dxos/react-ui-theme";
509
+ var StackItemContent = /* @__PURE__ */ forwardRef2(({ children, toolbar, statusbar, layoutManaged, classNames, size = "intrinsic", scrollable, ...props }, forwardedRef) => {
510
+ var _effect = _useSignals3();
511
+ try {
512
+ const { size: stackItemSize } = useStack();
513
+ const { role } = useStackItem();
514
+ const style = useMemo2(() => layoutManaged ? {} : {
515
+ gridTemplateRows: [
516
+ ...toolbar ? [
517
+ role === "section" ? "calc(var(--toolbar-size) - 1px)" : "var(--toolbar-size)"
518
+ ] : [],
519
+ "1fr",
520
+ ...statusbar ? [
521
+ "var(--statusbar-size)"
522
+ ] : []
523
+ ].join(" ")
524
+ }, [
525
+ toolbar,
526
+ statusbar,
527
+ layoutManaged
528
+ ]);
529
+ return /* @__PURE__ */ React3.createElement("div", {
530
+ role: "none",
531
+ ...props,
532
+ className: mx3("group grid grid-cols-[100%] density-coarse", size === "video" ? "aspect-video" : size === "square" && "aspect-square", stackItemSize === "contain" && "min-bs-0 overflow-hidden", scrollable ? "min-bs-0 overflow-y-auto scrollbar-thin contain-layout" : "overflow-hidden", role === "section" && toolbar && "[&_.dx-toolbar]:sticky [&_.dx-toolbar]:z-[1] [&_.dx-toolbar]:block-start-0 [&_.dx-toolbar]:-mbe-px [&_.dx-toolbar]:min-is-0", toolbar && "[&>.dx-toolbar]:relative [&>.dx-toolbar]:border-be [&>.dx-toolbar]:border-subduedSeparator", classNames),
533
+ style,
534
+ "data-popover-collision-boundary": true,
535
+ ref: forwardedRef
536
+ }, children);
537
+ } finally {
538
+ _effect.f();
539
+ }
540
+ });
541
+
542
+ // src/components/StackItem/StackItemDragHandle.tsx
543
+ import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
544
+ import { Slot } from "@radix-ui/react-slot";
545
+ import React4 from "react";
546
+ var StackItemDragHandle = ({ asChild, children }) => {
547
+ var _effect = _useSignals4();
548
+ try {
549
+ const { selfDragHandleRef } = useStackItem();
550
+ const Root = asChild ? Slot : "div";
551
+ return /* @__PURE__ */ React4.createElement(Root, {
552
+ ref: selfDragHandleRef,
553
+ role: "button"
554
+ }, children);
555
+ } finally {
556
+ _effect.f();
557
+ }
558
+ };
559
+
560
+ // src/components/StackItem/StackItemHeading.tsx
561
+ import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
562
+ import { Slot as Slot2 } from "@radix-ui/react-slot";
563
+ import React5, { forwardRef as forwardRef3 } from "react";
564
+ import { useAttention } from "@dxos/react-ui-attention";
565
+ import { mx as mx4 } from "@dxos/react-ui-theme";
566
+ var StackItemHeading = ({ children, classNames, asChild, separateOnScroll, ...props }) => {
567
+ var _effect = _useSignals5();
568
+ try {
569
+ const { orientation } = useStack();
570
+ const Root = asChild ? Slot2 : "div";
571
+ return /* @__PURE__ */ React5.createElement(Root, {
572
+ role: "heading",
573
+ ...props,
574
+ className: mx4("flex items-center !border-is-0 bg-headerSurface", separateOnScroll ? 'border-transparent [[data-scroll-separator="true"]_&]:border-subduedSeparator' : "border-subduedSeparator", orientation === "horizontal" ? "bs-[--rail-size]" : "is-[--rail-size] flex-col", orientation === "horizontal" ? "border-be" : "border-ie", classNames)
575
+ }, children);
576
+ } finally {
577
+ _effect.f();
578
+ }
579
+ };
580
+ var StackItemHeadingStickyContent = ({ children }) => {
581
+ var _effect = _useSignals5();
582
+ try {
583
+ return /* @__PURE__ */ React5.createElement("div", {
584
+ role: "none",
585
+ className: "sticky block-start-0 bg-[--sticky-bg] p-1 is-full"
586
+ }, children);
587
+ } finally {
588
+ _effect.f();
589
+ }
590
+ };
591
+ var StackItemHeadingLabel = /* @__PURE__ */ forwardRef3(({ attendableId, related, classNames, ...props }, forwardedRef) => {
592
+ var _effect = _useSignals5();
593
+ try {
594
+ const { hasAttention, isAncestor, isRelated } = useAttention(attendableId);
595
+ return /* @__PURE__ */ React5.createElement("h1", {
596
+ ...props,
597
+ "data-attention": (related && isRelated || hasAttention || isAncestor).toString(),
598
+ className: mx4("pli-1 min-is-0 is-0 grow truncate font-medium text-baseText data-[attention=true]:text-accentText self-center", classNames),
599
+ ref: forwardedRef
600
+ });
601
+ } finally {
602
+ _effect.f();
603
+ }
604
+ });
605
+
606
+ // src/components/StackItem/StackItemResizeHandle.tsx
607
+ import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
608
+ import React6 from "react";
609
+ import { ResizeHandle } from "@dxos/react-ui-dnd";
610
+ var MIN_WIDTH = 20;
611
+ var MIN_HEIGHT = 3;
612
+ var StackItemResizeHandle = () => {
613
+ var _effect = _useSignals6();
614
+ try {
615
+ const { orientation } = useStack();
616
+ const { setSize, size } = useStackItem();
617
+ return /* @__PURE__ */ React6.createElement(ResizeHandle, {
618
+ side: orientation === "horizontal" ? "inline-end" : "block-end",
619
+ fallbackSize: DEFAULT_EXTRINSIC_SIZE,
620
+ minSize: orientation === "horizontal" ? MIN_WIDTH : MIN_HEIGHT,
621
+ size,
622
+ onSizeChange: setSize
623
+ });
624
+ } finally {
625
+ _effect.f();
626
+ }
627
+ };
628
+
629
+ // src/components/StackItem/StackItemSigil.tsx
630
+ import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
631
+ import React8, { Fragment, forwardRef as forwardRef4, useState as useState4 } from "react";
632
+ import { keySymbols } from "@dxos/keyboard";
633
+ import { Button, DropdownMenu, Icon, toLocalizedString, useTranslation } from "@dxos/react-ui";
634
+ import { useAttention as useAttention2 } from "@dxos/react-ui-attention";
635
+ import { descriptionText, mx as mx5 } from "@dxos/react-ui-theme";
636
+ import { getHostPlatform } from "@dxos/util";
637
+
638
+ // src/components/StackItem/MenuSignifier.tsx
639
+ import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
640
+ import React7 from "react";
641
+ var MenuSignifierHorizontal = () => {
642
+ var _effect = _useSignals7();
643
+ try {
644
+ return /* @__PURE__ */ React7.createElement("svg", {
645
+ className: "absolute block-end-[7px]",
646
+ width: 20,
647
+ height: 2,
648
+ viewBox: "0 0 20 2",
649
+ stroke: "currentColor",
650
+ opacity: 0.5
651
+ }, /* @__PURE__ */ React7.createElement("line", {
652
+ x1: 0.5,
653
+ y1: 0.75,
654
+ x2: 19,
655
+ y2: 0.75,
656
+ strokeWidth: 1.25,
657
+ strokeLinecap: "round",
658
+ strokeDasharray: "6 20",
659
+ strokeDashoffset: "-6.5"
660
+ }));
661
+ } finally {
662
+ _effect.f();
663
+ }
664
+ };
665
+
666
+ // src/components/StackItem/StackItemSigil.tsx
667
+ var StackItemSigilButton = /* @__PURE__ */ forwardRef4(({ attendableId, classNames, related, isMenu = true, children, ...props }, forwardedRef) => {
668
+ var _effect = _useSignals8();
669
+ try {
670
+ const { hasAttention, isAncestor, isRelated } = useAttention2(attendableId);
671
+ const variant = related && isRelated || hasAttention || isAncestor ? "primary" : "ghost";
672
+ return /* @__PURE__ */ React8.createElement(Button, {
673
+ ...props,
674
+ variant,
675
+ classNames: [
676
+ "shrink-0 pli-0 min-bs-0 is-[--rail-action] bs-[--rail-action] relative app-no-drag",
677
+ classNames
678
+ ],
679
+ ref: forwardedRef
680
+ }, isMenu && /* @__PURE__ */ React8.createElement(MenuSignifierHorizontal, null), children);
681
+ } finally {
682
+ _effect.f();
683
+ }
684
+ });
685
+ var StackItemSigil = /* @__PURE__ */ forwardRef4(({ actions: actionGroups, onAction, triggerLabel, attendableId, icon, related, children }, forwardedRef) => {
686
+ var _effect = _useSignals8();
687
+ try {
688
+ const { t } = useTranslation(translationKey);
689
+ const [optionsMenuOpen, setOptionsMenuOpen] = useState4(false);
690
+ const hasActions = actionGroups && actionGroups.length > 0;
691
+ const button = /* @__PURE__ */ React8.createElement(StackItemSigilButton, {
692
+ attendableId,
693
+ related,
694
+ isMenu: hasActions,
695
+ // TODO(wittjosiah): Better disabling of interactive styles when no action are available.
696
+ // Remove underscore icon when no actions are available?
697
+ classNames: !hasActions && "cursor-default"
698
+ }, /* @__PURE__ */ React8.createElement("span", {
699
+ className: "sr-only"
700
+ }, triggerLabel), /* @__PURE__ */ React8.createElement(Icon, {
701
+ icon,
702
+ size: 5
703
+ }));
704
+ if (!hasActions) {
705
+ return button;
706
+ }
707
+ return /* @__PURE__ */ React8.createElement(DropdownMenu.Root, {
708
+ open: optionsMenuOpen,
709
+ onOpenChange: setOptionsMenuOpen
710
+ }, /* @__PURE__ */ React8.createElement(DropdownMenu.Trigger, {
711
+ asChild: true,
712
+ ref: forwardedRef
713
+ }, button), /* @__PURE__ */ React8.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React8.createElement(DropdownMenu.Content, {
714
+ classNames: "z-[31]"
715
+ }, /* @__PURE__ */ React8.createElement(DropdownMenu.Viewport, null, actionGroups?.map((actions, index) => {
716
+ const separator = index > 0 ? /* @__PURE__ */ React8.createElement(DropdownMenu.Separator, null) : null;
717
+ return /* @__PURE__ */ React8.createElement(Fragment, {
718
+ key: index
719
+ }, separator, actions.map((action) => {
720
+ const shortcut = typeof action.properties.keyBinding === "string" ? action.properties.keyBinding : action.properties.keyBinding?.[getHostPlatform()];
721
+ const menuItemType = action.properties.menuItemType;
722
+ const Root = menuItemType === "toggle" ? DropdownMenu.CheckboxItem : DropdownMenu.Item;
723
+ return /* @__PURE__ */ React8.createElement(Root, {
724
+ key: action.id,
725
+ onClick: (event) => {
726
+ if (action.properties.disabled) {
727
+ return;
728
+ }
729
+ event.stopPropagation();
730
+ setOptionsMenuOpen(false);
731
+ onAction?.(action);
732
+ },
733
+ classNames: "gap-2",
734
+ disabled: action.properties.disabled,
735
+ checked: menuItemType === "toggle" ? action.properties.isChecked : void 0,
736
+ ...action.properties?.testId && {
737
+ "data-testid": action.properties.testId
738
+ }
739
+ }, /* @__PURE__ */ React8.createElement(Icon, {
740
+ icon: action.properties.icon ?? "ph--placeholder--regular",
741
+ size: 4
742
+ }), /* @__PURE__ */ React8.createElement("span", {
743
+ className: "grow truncate"
744
+ }, toLocalizedString(action.properties.label ?? "", t)), menuItemType === "toggle" && /* @__PURE__ */ React8.createElement(DropdownMenu.ItemIndicator, {
745
+ asChild: true
746
+ }, /* @__PURE__ */ React8.createElement(Icon, {
747
+ icon: "ph--check--regular",
748
+ size: 4
749
+ })), shortcut && /* @__PURE__ */ React8.createElement("span", {
750
+ className: mx5("shrink-0", descriptionText)
751
+ }, keySymbols(shortcut).join("")));
752
+ }));
753
+ }), children), /* @__PURE__ */ React8.createElement(DropdownMenu.Arrow, null))));
754
+ } finally {
755
+ _effect.f();
756
+ }
757
+ });
758
+
759
+ // src/components/StackItem/StackItem.tsx
760
+ var DEFAULT_HORIZONTAL_SIZE = 48;
761
+ var DEFAULT_VERTICAL_SIZE = "min-content";
762
+ var DEFAULT_EXTRINSIC_SIZE = DEFAULT_HORIZONTAL_SIZE;
763
+ var StackItemRoot = /* @__PURE__ */ forwardRef5(({ item, children, classNames, size: propsSize, onSizeChange, role, order, prevSiblingId, nextSiblingId, style, disableRearrange, focusIndicatorVariant = "over-all", ...props }, forwardedRef) => {
764
+ var _effect = _useSignals9();
765
+ try {
766
+ const [itemElement, itemRef] = useState5(null);
767
+ const [selfDragHandleElement, selfDragHandleRef] = useState5(null);
768
+ const [closestEdge, setEdge] = useState5(null);
769
+ const [sourceId, setSourceId] = useState5(null);
770
+ const [dragState, setDragState] = useState5(idle);
771
+ const { orientation, rail, onRearrange, size: stackSize, stackId } = useStack();
772
+ const [size = orientation === "horizontal" ? DEFAULT_HORIZONTAL_SIZE : DEFAULT_VERTICAL_SIZE, setInternalSize] = useState5(propsSize);
773
+ const Root = role ?? "div";
774
+ const composedItemRef = composeRefs2(itemRef, forwardedRef);
775
+ const setSize = useCallback3((nextSize, commit) => {
776
+ setInternalSize(nextSize);
777
+ if (commit) {
778
+ onSizeChange?.(nextSize);
779
+ }
780
+ }, [
781
+ onSizeChange
782
+ ]);
783
+ const type = orientation === "horizontal" ? "column" : "card";
784
+ useLayoutEffect2(() => {
785
+ if (!itemElement || !onRearrange || disableRearrange) {
786
+ return;
787
+ }
788
+ return combine2(draggable({
789
+ element: itemElement,
790
+ ...selfDragHandleElement && {
791
+ dragHandle: selfDragHandleElement
792
+ },
793
+ getInitialData: () => ({
794
+ id: item.id,
795
+ type
796
+ }),
797
+ onGenerateDragPreview: ({ nativeSetDragImage, source, location }) => {
798
+ document.body.setAttribute("data-drag-preview", "true");
799
+ const offsetFn = preserveOffsetOnSource({
800
+ element: source.element,
801
+ input: location.current.input
802
+ });
803
+ const rect = source.element.getBoundingClientRect();
804
+ setCustomNativeDragPreview({
805
+ nativeSetDragImage,
806
+ getOffset: ({ container }) => {
807
+ return offsetFn({
808
+ container
809
+ });
810
+ },
811
+ render: ({ container }) => {
812
+ container.style.width = rect.width + "px";
813
+ setDragState({
814
+ type: "preview",
815
+ container,
816
+ item
817
+ });
818
+ return () => {
819
+ };
820
+ }
821
+ });
822
+ },
823
+ onDragStart: () => {
824
+ document.body.removeAttribute("data-drag-preview");
825
+ itemElement?.closest("[data-drag-autoscroll]")?.setAttribute("data-drag-autoscroll", "active");
826
+ setDragState({
827
+ type: "is-dragging",
828
+ item
829
+ });
830
+ },
831
+ onDrop: () => {
832
+ itemElement?.closest("[data-drag-autoscroll]")?.setAttribute("data-drag-autoscroll", "idle");
833
+ setDragState(idle);
834
+ }
835
+ }), dropTargetForElements2({
836
+ element: itemElement,
837
+ getData: ({ input, element }) => {
838
+ return attachClosestEdge2({
839
+ id: item.id,
840
+ type
841
+ }, {
842
+ input,
843
+ element,
844
+ allowedEdges: orientation === "horizontal" ? [
845
+ "left",
846
+ "right"
847
+ ] : [
848
+ "top",
849
+ "bottom"
850
+ ]
851
+ });
852
+ },
853
+ onDragEnter: ({ self, source }) => {
854
+ if (source.data.type === self.data.type) {
855
+ setEdge(extractClosestEdge2(self.data));
856
+ setSourceId(source.data.id);
857
+ }
858
+ },
859
+ onDrag: ({ self, source }) => {
860
+ if (source.data.type === self.data.type) {
861
+ setEdge(extractClosestEdge2(self.data));
862
+ setSourceId(source.data.id);
863
+ }
864
+ },
865
+ onDragLeave: () => {
866
+ setEdge(null);
867
+ setSourceId(null);
868
+ },
869
+ onDrop: ({ self, source }) => {
870
+ setEdge(null);
871
+ setSourceId(null);
872
+ if (source.data.type === self.data.type) {
873
+ onRearrange(source.data, self.data, extractClosestEdge2(self.data));
874
+ }
875
+ }
876
+ }));
877
+ }, [
878
+ orientation,
879
+ item,
880
+ onRearrange,
881
+ selfDragHandleElement,
882
+ itemElement
883
+ ]);
884
+ const focusableGroupAttrs = useFocusableGroup({
885
+ tabBehavior: "limited"
886
+ });
887
+ const shouldShowDropIndicator = () => {
888
+ if (!closestEdge || !sourceId) {
889
+ return false;
890
+ }
891
+ if (sourceId === item.id) {
892
+ return false;
893
+ }
894
+ const isTrailingEdgeOfPrevSibling = prevSiblingId !== void 0 && sourceId === prevSiblingId && (orientation === "horizontal" && closestEdge === "left" || orientation === "vertical" && closestEdge === "top");
895
+ if (isTrailingEdgeOfPrevSibling) {
896
+ return false;
897
+ }
898
+ const isLeadingEdgeOfNextSibling = nextSiblingId !== void 0 && sourceId === nextSiblingId && (orientation === "horizontal" && closestEdge === "right" || orientation === "vertical" && closestEdge === "bottom");
899
+ if (isLeadingEdgeOfNextSibling) {
900
+ return false;
901
+ }
902
+ return true;
903
+ };
904
+ const stackItemContextValue = useMemo3(() => ({
905
+ selfDragHandleRef,
906
+ size,
907
+ setSize,
908
+ state: dragState,
909
+ setState: setDragState,
910
+ role
911
+ }), [
912
+ selfDragHandleRef,
913
+ size,
914
+ setSize,
915
+ dragState,
916
+ setDragState,
917
+ role
918
+ ]);
919
+ return /* @__PURE__ */ React9.createElement(StackItemContext.Provider, {
920
+ value: stackItemContextValue
921
+ }, /* @__PURE__ */ React9.createElement(Root, {
922
+ ...props,
923
+ tabIndex: 0,
924
+ ...focusableGroupAttrs,
925
+ className: mx6("group/stack-item grid relative", focusIndicatorVariant === "over-all" ? "dx-focus-ring-inset-over-all" : focusIndicatorVariant === "over-all-always" ? "dx-focus-ring-inset-over-all-always" : orientation === "horizontal" ? focusIndicatorVariant === "group-always" ? "dx-focus-ring-group-x-always" : "dx-focus-ring-group-x" : focusIndicatorVariant === "group-always" ? "dx-focus-ring-group-y-always" : "dx-focus-ring-group-y", orientation === "horizontal" ? "grid-rows-subgrid" : "grid-cols-subgrid", rail && (orientation === "horizontal" ? "row-span-2" : "col-span-2"), role === "section" && orientation !== "horizontal" && "border-be border-subduedSeparator", classNames),
926
+ "data-dx-stack-item": stackId,
927
+ "data-dx-item-id": item.id,
928
+ ...resizeAttributes,
929
+ style: {
930
+ ...stackSize !== "split" && sizeStyle(size, orientation),
931
+ ...Number.isFinite(order) && {
932
+ [orientation === "horizontal" ? "gridColumn" : "gridRow"]: `${order}`
933
+ },
934
+ ...style
935
+ },
936
+ ref: composedItemRef
937
+ }, children, shouldShowDropIndicator() && closestEdge && /* @__PURE__ */ React9.createElement(ListItem2.DropIndicator, {
938
+ lineInset: 8,
939
+ terminalInset: -8,
940
+ edge: closestEdge
941
+ })));
942
+ } finally {
943
+ _effect.f();
944
+ }
945
+ });
946
+ var StackItemDragPreview = ({ children }) => {
947
+ const { state } = useStackItem();
948
+ return state?.type === "preview" ? /* @__PURE__ */ createPortal(children({
949
+ item: state.item
950
+ }), state.container) : null;
951
+ };
952
+ var StackItem = {
953
+ Root: StackItemRoot,
954
+ Content: StackItemContent,
955
+ Heading: StackItemHeading,
956
+ HeadingLabel: StackItemHeadingLabel,
957
+ HeadingStickyContent: StackItemHeadingStickyContent,
958
+ ResizeHandle: StackItemResizeHandle,
959
+ DragHandle: StackItemDragHandle,
960
+ Sigil: StackItemSigil,
961
+ SigilButton: StackItemSigilButton,
962
+ DragPreview: StackItemDragPreview
963
+ };
964
+
965
+ // src/exemplars/Card/fragments.ts
966
+ var cardRoot = "rounded overflow-hidden bg-cardSurface border border-separator dark:border-subduedSeparator dx-focus-ring-group-y-indicator relative min-bs-[--rail-item] group/card";
967
+ var cardSpacing = "pli-cardSpacingInline mlb-cardSpacingBlock";
968
+ var cardNoSpacing = "pli-0 mlb-0";
969
+ var labelSpacing = "mbs-inputSpacingBlock mbe-labelSpacingBlock";
970
+ var cardDialogContent = "p-0 bs-content min-bs-[8rem] max-bs-full md:max-is-[32rem] overflow-hidden";
971
+ var cardDialogHeader = "pli-cardSpacingInline mbs-cardSpacingBlock flex justify-between";
972
+ var cardDialogOverflow = "overflow-y-auto min-bs-0 flex-1";
973
+ var cardDialogPaddedOverflow = `${cardDialogOverflow} plb-cardSpacingBlock`;
974
+ var cardDialogSearchListRoot = "pli-cardSpacingInline pbs-cardSpacingBlock [&>input]:mbe-0 min-bs-0 flex-1 flex flex-col";
975
+ var cardText = cardSpacing;
976
+ var cardHeading = "text-lg font-medium line-clamp-2 grow";
977
+ var cardChrome = "pli-[--dx-cardSpacingChrome] mlb-[--dx-cardSpacingChrome] [&_.dx-button]:text-start [&_.dx-button]:is-full [&_.dx-button]:pis-[calc(var(--dx-cardSpacingInline)-var(--dx-cardSpacingChrome))]";
978
+
979
+ // src/exemplars/Card/Card.tsx
980
+ import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
981
+ import { Primitive } from "@radix-ui/react-primitive";
982
+ import { Slot as Slot3 } from "@radix-ui/react-slot";
983
+ import React10, { forwardRef as forwardRef6 } from "react";
984
+ import { Icon as Icon2, IconButton, Toolbar, useTranslation as useTranslation2 } from "@dxos/react-ui";
985
+ import { cardMinInlineSize, hoverableControls, mx as mx7 } from "@dxos/react-ui-theme";
986
+ var cardDefaultInlineSize = cardMinInlineSize;
987
+ var cardStackDefaultInlineSizeRem = cardDefaultInlineSize + 2.125;
988
+ var CardStaticRoot = /* @__PURE__ */ forwardRef6(({ children, classNames, id, asChild, role = "group", ...props }, forwardedRef) => {
989
+ var _effect = _useSignals10();
990
+ try {
991
+ const Root = asChild ? Slot3 : "div";
992
+ const rootProps = asChild ? {
993
+ classNames: [
994
+ cardRoot,
995
+ classNames
996
+ ]
997
+ } : {
998
+ className: mx7(cardRoot, classNames),
999
+ role
1000
+ };
1001
+ return /* @__PURE__ */ React10.createElement(Root, {
1002
+ ...id && {
1003
+ "data-object-id": id
1004
+ },
1005
+ ...props,
1006
+ ...rootProps,
1007
+ ref: forwardedRef
1008
+ }, children);
1009
+ } finally {
1010
+ _effect.f();
1011
+ }
1012
+ });
1013
+ var CardSurfaceRoot = ({ id, role = "never", children, classNames }) => {
1014
+ var _effect = _useSignals10();
1015
+ try {
1016
+ if ([
1017
+ "card--popover",
1018
+ "card--intrinsic",
1019
+ "card--extrinsic"
1020
+ ].includes(role)) {
1021
+ return /* @__PURE__ */ React10.createElement("div", {
1022
+ ...id && {
1023
+ "data-object-id": id
1024
+ },
1025
+ className: mx7(role === "card--popover" ? "popover-card-width" : [
1026
+ "card--intrinsic",
1027
+ "card--extrinsic"
1028
+ ].includes(role) ? "contents" : "", classNames)
1029
+ }, children);
1030
+ } else {
1031
+ return /* @__PURE__ */ React10.createElement(CardStaticRoot, {
1032
+ id,
1033
+ classNames: [
1034
+ role === "card--transclusion" && "mlb-1",
1035
+ role === "card--transclusion" && hoverableControls,
1036
+ classNames
1037
+ ]
1038
+ }, children);
1039
+ }
1040
+ } finally {
1041
+ _effect.f();
1042
+ }
1043
+ };
1044
+ var CardHeading = /* @__PURE__ */ forwardRef6(({ children, classNames, asChild, role = "heading", ...props }, forwardedRef) => {
1045
+ var _effect = _useSignals10();
1046
+ try {
1047
+ const Root = asChild ? Slot3 : "div";
1048
+ const rootProps = asChild ? {
1049
+ classNames: [
1050
+ cardHeading,
1051
+ cardText,
1052
+ classNames
1053
+ ]
1054
+ } : {
1055
+ className: mx7(cardHeading, cardText, classNames),
1056
+ role
1057
+ };
1058
+ return /* @__PURE__ */ React10.createElement(Root, {
1059
+ ...props,
1060
+ ...rootProps,
1061
+ ref: forwardedRef
1062
+ }, children);
1063
+ } finally {
1064
+ _effect.f();
1065
+ }
1066
+ });
1067
+ var CardToolbar = /* @__PURE__ */ forwardRef6(({ children, classNames, ...props }, forwardedRef) => {
1068
+ var _effect = _useSignals10();
1069
+ try {
1070
+ return /* @__PURE__ */ React10.createElement(Toolbar.Root, {
1071
+ ...props,
1072
+ classNames: [
1073
+ "bg-transparent density-coarse",
1074
+ classNames
1075
+ ],
1076
+ ref: forwardedRef
1077
+ }, children);
1078
+ } finally {
1079
+ _effect.f();
1080
+ }
1081
+ });
1082
+ var CardToolbarIconButton = Toolbar.IconButton;
1083
+ var CardToolbarSeparator = Toolbar.Separator;
1084
+ var CardDragHandle = /* @__PURE__ */ forwardRef6(({ toolbarItem }, forwardedRef) => {
1085
+ var _effect = _useSignals10();
1086
+ try {
1087
+ const { t } = useTranslation2(translationKey);
1088
+ const Root = toolbarItem ? Toolbar.IconButton : IconButton;
1089
+ return /* @__PURE__ */ React10.createElement(Root, {
1090
+ iconOnly: true,
1091
+ icon: "ph--dots-six-vertical--regular",
1092
+ variant: "ghost",
1093
+ label: t("drag handle label"),
1094
+ classNames: "pli-2",
1095
+ ref: forwardedRef
1096
+ });
1097
+ } finally {
1098
+ _effect.f();
1099
+ }
1100
+ });
1101
+ var CardDragPreview = StackItem.DragPreview;
1102
+ var CardMenu = Primitive.div;
1103
+ var CardPoster = (props) => {
1104
+ var _effect = _useSignals10();
1105
+ try {
1106
+ const aspect = props.aspect === "auto" ? "aspect-auto" : "aspect-video";
1107
+ if (props.image) {
1108
+ return /* @__PURE__ */ React10.createElement(Image, {
1109
+ classNames: [
1110
+ `dx-card__poster is-full`,
1111
+ aspect,
1112
+ props.classNames
1113
+ ],
1114
+ src: props.image,
1115
+ alt: props.alt
1116
+ });
1117
+ }
1118
+ if (props.icon) {
1119
+ return /* @__PURE__ */ React10.createElement("div", {
1120
+ role: "image",
1121
+ className: mx7(`dx-card__poster grid place-items-center bg-inputSurface text-subdued`, aspect, props.classNames),
1122
+ "aria-label": props.alt
1123
+ }, /* @__PURE__ */ React10.createElement(Icon2, {
1124
+ icon: props.icon,
1125
+ size: 10
1126
+ }));
1127
+ }
1128
+ } finally {
1129
+ _effect.f();
1130
+ }
1131
+ };
1132
+ var CardChrome = /* @__PURE__ */ forwardRef6(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
1133
+ var _effect = _useSignals10();
1134
+ try {
1135
+ const Root = asChild ? Slot3 : "div";
1136
+ const rootProps = asChild ? {
1137
+ classNames: [
1138
+ cardChrome,
1139
+ classNames
1140
+ ]
1141
+ } : {
1142
+ className: mx7(cardChrome, classNames),
1143
+ role
1144
+ };
1145
+ return /* @__PURE__ */ React10.createElement(Root, {
1146
+ ...props,
1147
+ ...rootProps,
1148
+ ref: forwardedRef
1149
+ }, children);
1150
+ } finally {
1151
+ _effect.f();
1152
+ }
1153
+ });
1154
+ var CardText = /* @__PURE__ */ forwardRef6(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
1155
+ var _effect = _useSignals10();
1156
+ try {
1157
+ const Root = asChild ? Slot3 : "div";
1158
+ const rootProps = asChild ? {
1159
+ classNames: [
1160
+ cardText,
1161
+ classNames
1162
+ ]
1163
+ } : {
1164
+ className: mx7(cardText, classNames),
1165
+ role
1166
+ };
1167
+ return /* @__PURE__ */ React10.createElement(Root, {
1168
+ ...props,
1169
+ ...rootProps,
1170
+ ref: forwardedRef
1171
+ }, children);
1172
+ } finally {
1173
+ _effect.f();
1174
+ }
1175
+ });
1176
+ var Card = {
1177
+ StaticRoot: CardStaticRoot,
1178
+ SurfaceRoot: CardSurfaceRoot,
1179
+ Heading: CardHeading,
1180
+ Toolbar: CardToolbar,
1181
+ ToolbarIconButton: CardToolbarIconButton,
1182
+ ToolbarSeparator: CardToolbarSeparator,
1183
+ DragHandle: CardDragHandle,
1184
+ DragPreview: CardDragPreview,
1185
+ Menu: CardMenu,
1186
+ Poster: CardPoster,
1187
+ Chrome: CardChrome,
1188
+ Text: CardText
1189
+ };
1190
+
1191
+ // src/exemplars/Card/CardDragPreview.tsx
1192
+ import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
1193
+ import React11 from "react";
1194
+ import { mx as mx8 } from "@dxos/react-ui-theme";
1195
+ var CardDragPreviewRoot = ({ children }) => {
1196
+ var _effect = _useSignals11();
1197
+ try {
1198
+ return /* @__PURE__ */ React11.createElement("div", {
1199
+ className: "p-2"
1200
+ }, children);
1201
+ } finally {
1202
+ _effect.f();
1203
+ }
1204
+ };
1205
+ var CardDragPreviewContent = ({ children }) => {
1206
+ var _effect = _useSignals11();
1207
+ try {
1208
+ return /* @__PURE__ */ React11.createElement("div", {
1209
+ className: mx8(cardRoot, "ring-focusLine ring-neutralFocusIndicator")
1210
+ }, children);
1211
+ } finally {
1212
+ _effect.f();
1213
+ }
1214
+ };
1215
+ var CardDragPreview2 = {
1216
+ Root: CardDragPreviewRoot,
1217
+ Content: CardDragPreviewContent
1218
+ };
1219
+
1220
+ // src/exemplars/CardStack/CardStack.tsx
1221
+ import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
1222
+ import { Slot as Slot4 } from "@radix-ui/react-slot";
1223
+ import React12, { forwardRef as forwardRef7 } from "react";
1224
+ import { mx as mx9 } from "@dxos/react-ui-theme";
1225
+ var CardStackStack = /* @__PURE__ */ forwardRef7(({ children, classNames, itemsCount = 0, ...props }, forwardedRef) => {
1226
+ var _effect = _useSignals12();
1227
+ try {
1228
+ return /* @__PURE__ */ React12.createElement(Stack, {
1229
+ orientation: "vertical",
1230
+ size: "contain",
1231
+ rail: false,
1232
+ classNames: (
1233
+ /* NOTE(thure): Do not let this element have zero intrinsic size, otherwise the drop indicator will not display. See #9035. */
1234
+ [
1235
+ "plb-1",
1236
+ itemsCount > 0 && "plb-2",
1237
+ classNames
1238
+ ]
1239
+ ),
1240
+ itemsCount,
1241
+ separatorOnScroll: 9,
1242
+ "data-density": "fine",
1243
+ ...props,
1244
+ ref: forwardedRef
1245
+ }, children);
1246
+ } finally {
1247
+ _effect.f();
1248
+ }
1249
+ });
1250
+ var CardStackDragHandle = Card.DragHandle;
1251
+ var cardStackHeading = "mli-2 order-first bg-transparent rounded-bs-md flex items-center";
1252
+ var CardStackHeading = /* @__PURE__ */ forwardRef7(({ children, classNames, asChild, role = "heading", ...props }, forwardedRef) => {
1253
+ var _effect = _useSignals12();
1254
+ try {
1255
+ const Root = asChild ? Slot4 : "div";
1256
+ const rootProps = asChild ? {
1257
+ classNames: [
1258
+ cardStackHeading,
1259
+ classNames
1260
+ ]
1261
+ } : {
1262
+ className: mx9(cardStackHeading, classNames),
1263
+ role
1264
+ };
1265
+ return /* @__PURE__ */ React12.createElement(Root, {
1266
+ ...props,
1267
+ ...rootProps,
1268
+ ref: forwardedRef
1269
+ }, children);
1270
+ } finally {
1271
+ _effect.f();
1272
+ }
1273
+ });
1274
+ var cardStackFooter = 'plb-2 mli-2 border-bs border-transparent [[data-scroll-separator-end="true"]_&]:border-subduedSeparator';
1275
+ var CardStackFooter = /* @__PURE__ */ forwardRef7(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
1276
+ var _effect = _useSignals12();
1277
+ try {
1278
+ const Root = asChild ? Slot4 : "div";
1279
+ const rootProps = asChild ? {
1280
+ classNames: [
1281
+ cardStackFooter,
1282
+ classNames
1283
+ ]
1284
+ } : {
1285
+ className: mx9(cardStackFooter, classNames),
1286
+ role
1287
+ };
1288
+ return /* @__PURE__ */ React12.createElement(Root, {
1289
+ ...props,
1290
+ ...rootProps,
1291
+ ref: forwardedRef
1292
+ }, children);
1293
+ } finally {
1294
+ _effect.f();
1295
+ }
1296
+ });
1297
+ var cardStackContent = "shrink min-bs-0 bg-baseSurface border border-separator rounded-md grid dx-focus-ring-group-x-indicator kanban-drop";
1298
+ var CardStackContent = /* @__PURE__ */ forwardRef7(({ children, classNames, asChild, role = "none", footer = true, ...props }, forwardedRef) => {
1299
+ var _effect = _useSignals12();
1300
+ try {
1301
+ const Root = asChild ? Slot4 : "div";
1302
+ const baseClassNames = footer ? [
1303
+ cardStackContent,
1304
+ railGridHorizontalContainFitContent
1305
+ ] : [
1306
+ cardStackContent
1307
+ ];
1308
+ const rootProps = asChild ? {
1309
+ classNames: [
1310
+ ...baseClassNames,
1311
+ classNames
1312
+ ]
1313
+ } : {
1314
+ className: mx9(...baseClassNames, classNames),
1315
+ role
1316
+ };
1317
+ return /* @__PURE__ */ React12.createElement(Root, {
1318
+ ...props,
1319
+ ...rootProps,
1320
+ "data-scroll-separator": "false",
1321
+ ref: forwardedRef
1322
+ }, children);
1323
+ } finally {
1324
+ _effect.f();
1325
+ }
1326
+ });
1327
+ var cardStackRoot = "flex flex-col pli-2 plb-2";
1328
+ var CardStackRoot = /* @__PURE__ */ forwardRef7(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
1329
+ var _effect = _useSignals12();
1330
+ try {
1331
+ const Root = asChild ? Slot4 : "div";
1332
+ const rootProps = asChild ? {
1333
+ classNames: [
1334
+ cardStackRoot,
1335
+ classNames
1336
+ ]
1337
+ } : {
1338
+ className: mx9(cardStackRoot, classNames),
1339
+ role
1340
+ };
1341
+ return /* @__PURE__ */ React12.createElement(Root, {
1342
+ ...props,
1343
+ ...rootProps,
1344
+ ref: forwardedRef
1345
+ }, children);
1346
+ } finally {
1347
+ _effect.f();
1348
+ }
1349
+ });
1350
+ var cardStackItem = "contain-layout pli-2 plb-1 first-of-type:pbs-0 last-of-type:pbe-0";
1351
+ var CardStackItem = /* @__PURE__ */ forwardRef7(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
1352
+ var _effect = _useSignals12();
1353
+ try {
1354
+ const Root = asChild ? Slot4 : "div";
1355
+ const rootProps = asChild ? {
1356
+ classNames: [
1357
+ cardStackItem,
1358
+ classNames
1359
+ ]
1360
+ } : {
1361
+ className: mx9(cardStackItem, classNames),
1362
+ role
1363
+ };
1364
+ return /* @__PURE__ */ React12.createElement(Root, {
1365
+ ...props,
1366
+ ...rootProps,
1367
+ ref: forwardedRef
1368
+ }, children);
1369
+ } finally {
1370
+ _effect.f();
1371
+ }
1372
+ });
1373
+ var CardStack = {
1374
+ Root: CardStackRoot,
1375
+ Content: CardStackContent,
1376
+ Stack: CardStackStack,
1377
+ Heading: CardStackHeading,
1378
+ Footer: CardStackFooter,
1379
+ DragHandle: CardStackDragHandle,
1380
+ Item: CardStackItem
1381
+ };
1382
+
1383
+ // src/exemplars/CardStack/CardStackDragPreview.tsx
1384
+ import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
1385
+ import React13 from "react";
1386
+ import { IconButton as IconButton2, useTranslation as useTranslation3 } from "@dxos/react-ui";
1387
+ import { mx as mx10 } from "@dxos/react-ui-theme";
1388
+ var CardStackDragPreviewRoot = ({ children }) => {
1389
+ var _effect = _useSignals13();
1390
+ try {
1391
+ return /* @__PURE__ */ React13.createElement("div", {
1392
+ className: "p-2"
1393
+ }, /* @__PURE__ */ React13.createElement("div", {
1394
+ className: "rounded-md max-bs-[calc(100dvh-1rem)] overflow-hidden bg-baseSurface border border-separator ring-focusLine ring-neutralFocusIndicator flex flex-col"
1395
+ }, children));
1396
+ } finally {
1397
+ _effect.f();
1398
+ }
1399
+ };
1400
+ var CardStackDragPreviewHeading = ({ children }) => {
1401
+ var _effect = _useSignals13();
1402
+ try {
1403
+ const { t } = useTranslation3(translationKey);
1404
+ return /* @__PURE__ */ React13.createElement("div", {
1405
+ className: "flex items-center p-2"
1406
+ }, /* @__PURE__ */ React13.createElement(IconButton2, {
1407
+ iconOnly: true,
1408
+ icon: "ph--dots-six-vertical--regular",
1409
+ variant: "ghost",
1410
+ label: t("column drag handle label"),
1411
+ classNames: "pli-2"
1412
+ }), children);
1413
+ } finally {
1414
+ _effect.f();
1415
+ }
1416
+ };
1417
+ var CardStackDragPreviewContent = ({ children, itemsCount = 0 }) => {
1418
+ var _effect = _useSignals13();
1419
+ try {
1420
+ return /* @__PURE__ */ React13.createElement("div", {
1421
+ className: mx10("overflow-y-auto flex-1 pli-2 flex flex-col gap-2", "plb-1", itemsCount > 0 ? "plb-2" : "plb-1")
1422
+ }, children);
1423
+ } finally {
1424
+ _effect.f();
1425
+ }
1426
+ };
1427
+ var CardStackDragPreviewFooter = ({ children }) => {
1428
+ var _effect = _useSignals13();
1429
+ try {
1430
+ return /* @__PURE__ */ React13.createElement("div", {
1431
+ className: "p-2 border-t border-separator"
1432
+ }, children);
1433
+ } finally {
1434
+ _effect.f();
1435
+ }
1436
+ };
1437
+ var CardStackDragPreview = {
1438
+ Root: CardStackDragPreviewRoot,
1439
+ Heading: CardStackDragPreviewHeading,
1440
+ Content: CardStackDragPreviewContent,
1441
+ Footer: CardStackDragPreviewFooter
1442
+ };
1443
+
1444
+ export {
1445
+ Image,
1446
+ StackContext,
1447
+ railGridHorizontal,
1448
+ railGridVertical,
1449
+ railGridHorizontalContainFitContent,
1450
+ railGridVerticalContainFitContent,
1451
+ autoScrollRootAttributes,
1452
+ Stack,
1453
+ translationKey,
1454
+ translations,
1455
+ DEFAULT_HORIZONTAL_SIZE,
1456
+ DEFAULT_VERTICAL_SIZE,
1457
+ DEFAULT_EXTRINSIC_SIZE,
1458
+ StackItemDragPreview,
1459
+ StackItem,
1460
+ cardRoot,
1461
+ cardSpacing,
1462
+ cardNoSpacing,
1463
+ labelSpacing,
1464
+ cardDialogContent,
1465
+ cardDialogHeader,
1466
+ cardDialogOverflow,
1467
+ cardDialogPaddedOverflow,
1468
+ cardDialogSearchListRoot,
1469
+ cardText,
1470
+ cardHeading,
1471
+ cardChrome,
1472
+ cardDefaultInlineSize,
1473
+ cardStackDefaultInlineSizeRem,
1474
+ Card,
1475
+ CardDragPreview2 as CardDragPreview,
1476
+ cardStackHeading,
1477
+ cardStackFooter,
1478
+ cardStackContent,
1479
+ cardStackRoot,
1480
+ cardStackItem,
1481
+ CardStack,
1482
+ CardStackDragPreview
1483
+ };
1484
+ //# sourceMappingURL=chunk-SYKFLQGK.mjs.map