@dxos/react-ui-stack 0.8.2-staging.7ac8446 → 0.8.3-main.672df60

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 (114) hide show
  1. package/dist/lib/browser/index.mjs +960 -419
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/testing/index.mjs.map +3 -3
  5. package/dist/lib/node/index.cjs +949 -408
  6. package/dist/lib/node/index.cjs.map +4 -4
  7. package/dist/lib/node/meta.json +1 -1
  8. package/dist/lib/node/testing/index.cjs.map +3 -3
  9. package/dist/lib/node-esm/index.mjs +960 -419
  10. package/dist/lib/node-esm/index.mjs.map +4 -4
  11. package/dist/lib/node-esm/meta.json +1 -1
  12. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  13. package/dist/types/src/components/{Stack.d.ts → Stack/Stack.d.ts} +4 -1
  14. package/dist/types/src/components/Stack/Stack.d.ts.map +1 -0
  15. package/dist/types/src/components/Stack/Stack.stories.d.ts +9 -0
  16. package/dist/types/src/components/Stack/Stack.stories.d.ts.map +1 -0
  17. package/dist/types/src/components/Stack/index.d.ts +2 -0
  18. package/dist/types/src/components/Stack/index.d.ts.map +1 -0
  19. package/dist/types/src/components/StackContext.d.ts +14 -10
  20. package/dist/types/src/components/StackContext.d.ts.map +1 -1
  21. package/dist/types/src/components/StackItem/MenuSignifier.d.ts.map +1 -0
  22. package/dist/types/src/components/{StackItem.d.ts → StackItem/StackItem.d.ts} +15 -6
  23. package/dist/types/src/components/StackItem/StackItem.d.ts.map +1 -0
  24. package/dist/types/src/components/StackItem/StackItem.stories.d.ts +8 -0
  25. package/dist/types/src/components/StackItem/StackItem.stories.d.ts.map +1 -0
  26. package/dist/types/src/components/StackItem/StackItemContent.d.ts.map +1 -0
  27. package/dist/types/src/components/{StackItemDragHandle.d.ts → StackItem/StackItemDragHandle.d.ts} +1 -1
  28. package/dist/types/src/components/StackItem/StackItemDragHandle.d.ts.map +1 -0
  29. package/dist/types/src/components/{StackItemHeading.d.ts → StackItem/StackItemHeading.d.ts} +4 -2
  30. package/dist/types/src/components/StackItem/StackItemHeading.d.ts.map +1 -0
  31. package/dist/types/src/components/StackItem/StackItemResizeHandle.d.ts.map +1 -0
  32. package/dist/types/src/components/StackItem/StackItemSigil.d.ts.map +1 -0
  33. package/dist/types/src/components/StackItem/index.d.ts +2 -0
  34. package/dist/types/src/components/StackItem/index.d.ts.map +1 -0
  35. package/dist/types/src/components/defs.d.ts +18 -0
  36. package/dist/types/src/components/defs.d.ts.map +1 -0
  37. package/dist/types/src/components/deprecated/LayoutControls.d.ts.map +1 -0
  38. package/dist/types/src/components/index.d.ts +1 -2
  39. package/dist/types/src/components/index.d.ts.map +1 -1
  40. package/dist/types/src/exemplars/Card/Card.d.ts +58 -0
  41. package/dist/types/src/exemplars/Card/Card.d.ts.map +1 -0
  42. package/dist/types/src/exemplars/Card/Card.stories-todo.d.ts +1 -0
  43. package/dist/types/src/exemplars/Card/Card.stories-todo.d.ts.map +1 -0
  44. package/dist/types/src/exemplars/Card/CardDragPreview.d.ts +6 -0
  45. package/dist/types/src/exemplars/Card/CardDragPreview.d.ts.map +1 -0
  46. package/dist/types/src/exemplars/Card/fragments.d.ts +6 -0
  47. package/dist/types/src/exemplars/Card/fragments.d.ts.map +1 -0
  48. package/dist/types/src/exemplars/Card/index.d.ts +3 -0
  49. package/dist/types/src/exemplars/Card/index.d.ts.map +1 -0
  50. package/dist/types/src/exemplars/CardStack/CardStack.d.ts +34 -0
  51. package/dist/types/src/exemplars/CardStack/CardStack.d.ts.map +1 -0
  52. package/dist/types/src/exemplars/CardStack/CardStack.stories-todo.d.ts +1 -0
  53. package/dist/types/src/exemplars/CardStack/CardStack.stories-todo.d.ts.map +1 -0
  54. package/dist/types/src/exemplars/CardStack/CardStackDragPreview.d.ts +9 -0
  55. package/dist/types/src/exemplars/CardStack/CardStackDragPreview.d.ts.map +1 -0
  56. package/dist/types/src/exemplars/CardStack/index.d.ts +3 -0
  57. package/dist/types/src/exemplars/CardStack/index.d.ts.map +1 -0
  58. package/dist/types/src/exemplars/index.d.ts +3 -0
  59. package/dist/types/src/exemplars/index.d.ts.map +1 -0
  60. package/dist/types/src/hooks/useStackDropForElements.d.ts +4 -4
  61. package/dist/types/src/hooks/useStackDropForElements.d.ts.map +1 -1
  62. package/dist/types/src/index.d.ts +1 -0
  63. package/dist/types/src/index.d.ts.map +1 -1
  64. package/dist/types/src/testing/stack-manager.d.ts.map +1 -1
  65. package/dist/types/src/translations.d.ts +1 -0
  66. package/dist/types/src/translations.d.ts.map +1 -1
  67. package/dist/types/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +22 -20
  69. package/src/components/{Stack.stories.tsx → Stack/Stack.stories.tsx} +29 -17
  70. package/src/components/{Stack.tsx → Stack/Stack.tsx} +55 -5
  71. package/src/components/Stack/index.ts +5 -0
  72. package/src/components/StackContext.tsx +21 -13
  73. package/src/components/StackItem/StackItem.stories.tsx +49 -0
  74. package/src/components/{StackItem.tsx → StackItem/StackItem.tsx} +90 -11
  75. package/src/components/{StackItemContent.tsx → StackItem/StackItemContent.tsx} +2 -1
  76. package/src/components/{StackItemDragHandle.tsx → StackItem/StackItemDragHandle.tsx} +2 -2
  77. package/src/components/{StackItemHeading.tsx → StackItem/StackItemHeading.tsx} +10 -6
  78. package/src/components/{StackItemResizeHandle.tsx → StackItem/StackItemResizeHandle.tsx} +1 -1
  79. package/src/components/{StackItemSigil.tsx → StackItem/StackItemSigil.tsx} +3 -15
  80. package/src/components/StackItem/index.ts +5 -0
  81. package/src/components/defs.ts +26 -0
  82. package/src/components/{LayoutControls.tsx → deprecated/LayoutControls.tsx} +3 -23
  83. package/src/components/index.ts +2 -2
  84. package/src/exemplars/Card/Card.stories-todo.tsx +135 -0
  85. package/src/exemplars/Card/Card.tsx +178 -0
  86. package/src/exemplars/Card/CardDragPreview.tsx +22 -0
  87. package/src/exemplars/Card/fragments.ts +14 -0
  88. package/src/exemplars/Card/index.ts +6 -0
  89. package/src/exemplars/CardStack/CardStack.stories-todo.tsx +80 -0
  90. package/src/exemplars/CardStack/CardStack.tsx +118 -0
  91. package/src/exemplars/CardStack/CardStackDragPreview.tsx +61 -0
  92. package/src/exemplars/CardStack/index.ts +6 -0
  93. package/src/exemplars/index.ts +6 -0
  94. package/src/hooks/useStackDropForElements.ts +7 -6
  95. package/src/index.ts +4 -0
  96. package/src/testing/stack-manager.ts +6 -6
  97. package/src/translations.ts +1 -0
  98. package/dist/types/src/components/LayoutControls.d.ts.map +0 -1
  99. package/dist/types/src/components/MenuSignifier.d.ts.map +0 -1
  100. package/dist/types/src/components/Stack.d.ts.map +0 -1
  101. package/dist/types/src/components/Stack.stories.d.ts +0 -8
  102. package/dist/types/src/components/Stack.stories.d.ts.map +0 -1
  103. package/dist/types/src/components/StackItem.d.ts.map +0 -1
  104. package/dist/types/src/components/StackItemContent.d.ts.map +0 -1
  105. package/dist/types/src/components/StackItemDragHandle.d.ts.map +0 -1
  106. package/dist/types/src/components/StackItemHeading.d.ts.map +0 -1
  107. package/dist/types/src/components/StackItemResizeHandle.d.ts.map +0 -1
  108. package/dist/types/src/components/StackItemSigil.d.ts.map +0 -1
  109. /package/dist/types/src/components/{MenuSignifier.d.ts → StackItem/MenuSignifier.d.ts} +0 -0
  110. /package/dist/types/src/components/{StackItemContent.d.ts → StackItem/StackItemContent.d.ts} +0 -0
  111. /package/dist/types/src/components/{StackItemResizeHandle.d.ts → StackItem/StackItemResizeHandle.d.ts} +0 -0
  112. /package/dist/types/src/components/{StackItemSigil.d.ts → StackItem/StackItemSigil.d.ts} +0 -0
  113. /package/dist/types/src/components/{LayoutControls.d.ts → deprecated/LayoutControls.d.ts} +0 -0
  114. /package/src/components/{MenuSignifier.tsx → StackItem/MenuSignifier.tsx} +0 -0
@@ -28,82 +28,103 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var node_exports = {};
30
30
  __export(node_exports, {
31
+ Card: () => Card,
32
+ CardDragPreview: () => CardDragPreview2,
33
+ CardStack: () => CardStack,
34
+ CardStackDragPreview: () => CardStackDragPreview,
31
35
  DEFAULT_EXTRINSIC_SIZE: () => DEFAULT_EXTRINSIC_SIZE,
32
36
  DEFAULT_HORIZONTAL_SIZE: () => DEFAULT_HORIZONTAL_SIZE,
33
37
  DEFAULT_VERTICAL_SIZE: () => DEFAULT_VERTICAL_SIZE,
34
- LayoutControls: () => LayoutControls,
35
38
  Stack: () => Stack,
36
39
  StackContext: () => StackContext,
37
40
  StackItem: () => StackItem,
38
- StackItemContext: () => StackItemContext,
41
+ StackItemDragPreview: () => StackItemDragPreview,
39
42
  autoScrollRootAttributes: () => autoScrollRootAttributes,
43
+ cardChrome: () => cardChrome,
44
+ cardContent: () => cardContent,
45
+ cardHeading: () => cardHeading,
46
+ cardRoot: () => cardRoot,
47
+ cardStackContent: () => cardStackContent,
48
+ cardStackFooter: () => cardStackFooter,
49
+ cardStackHeading: () => cardStackHeading,
50
+ cardStackRoot: () => cardStackRoot,
51
+ cardText: () => cardText,
40
52
  railGridHorizontal: () => railGridHorizontal,
41
53
  railGridHorizontalContainFitContent: () => railGridHorizontalContainFitContent,
42
54
  railGridVertical: () => railGridVertical,
43
55
  railGridVerticalContainFitContent: () => railGridVerticalContainFitContent,
44
- translations: () => translations_default,
45
- useStack: () => useStack,
46
- useStackItem: () => useStackItem
56
+ translations: () => translations_default
47
57
  });
48
58
  module.exports = __toCommonJS(node_exports);
59
+ var import_tracking = require("@preact-signals/safe-react/tracking");
49
60
  var import_react_tabster = require("@fluentui/react-tabster");
50
61
  var import_react_compose_refs = require("@radix-ui/react-compose-refs");
51
62
  var import_react = __toESM(require("react"));
52
63
  var import_react_ui = require("@dxos/react-ui");
53
64
  var import_react_ui_theme = require("@dxos/react-ui-theme");
54
- var import_react2 = require("react");
55
65
  var import_combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
56
66
  var import_adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
57
67
  var import_element = require("@atlaskit/pragmatic-drag-and-drop-auto-scroll/element");
58
68
  var import_closest_edge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
69
+ var import_react2 = require("react");
59
70
  var import_react3 = require("react");
71
+ var import_tracking2 = require("@preact-signals/safe-react/tracking");
60
72
  var import_combine2 = require("@atlaskit/pragmatic-drag-and-drop/combine");
61
73
  var import_adapter2 = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
62
74
  var import_preserve_offset_on_source = require("@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source");
63
- var import_scroll_just_enough_into_view = require("@atlaskit/pragmatic-drag-and-drop/element/scroll-just-enough-into-view");
75
+ var import_set_custom_native_drag_preview = require("@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview");
64
76
  var import_closest_edge2 = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
65
77
  var import_react_tabster2 = require("@fluentui/react-tabster");
66
78
  var import_react_compose_refs2 = require("@radix-ui/react-compose-refs");
67
79
  var import_react4 = __toESM(require("react"));
80
+ var import_react_dom = require("react-dom");
68
81
  var import_react_ui2 = require("@dxos/react-ui");
69
82
  var import_react_ui_dnd = require("@dxos/react-ui-dnd");
70
83
  var import_react_ui_theme2 = require("@dxos/react-ui-theme");
84
+ var import_tracking3 = require("@preact-signals/safe-react/tracking");
71
85
  var import_react5 = __toESM(require("react"));
72
86
  var import_react_ui_theme3 = require("@dxos/react-ui-theme");
87
+ var import_tracking4 = require("@preact-signals/safe-react/tracking");
73
88
  var import_react_slot = require("@radix-ui/react-slot");
74
89
  var import_react6 = __toESM(require("react"));
90
+ var import_tracking5 = require("@preact-signals/safe-react/tracking");
75
91
  var import_react_tabster3 = require("@fluentui/react-tabster");
92
+ var import_react_slot2 = require("@radix-ui/react-slot");
76
93
  var import_react7 = __toESM(require("react"));
77
94
  var import_react_ui_attention = require("@dxos/react-ui-attention");
78
95
  var import_react_ui_theme4 = require("@dxos/react-ui-theme");
96
+ var import_tracking6 = require("@preact-signals/safe-react/tracking");
79
97
  var import_react8 = __toESM(require("react"));
80
98
  var import_react_ui_dnd2 = require("@dxos/react-ui-dnd");
99
+ var import_tracking7 = require("@preact-signals/safe-react/tracking");
81
100
  var import_react9 = __toESM(require("react"));
82
101
  var import_keyboard = require("@dxos/keyboard");
83
102
  var import_react_ui3 = require("@dxos/react-ui");
84
103
  var import_react_ui_attention2 = require("@dxos/react-ui-attention");
85
104
  var import_react_ui_theme5 = require("@dxos/react-ui-theme");
86
105
  var import_util = require("@dxos/util");
106
+ var import_tracking8 = require("@preact-signals/safe-react/tracking");
87
107
  var import_react10 = __toESM(require("react"));
108
+ var import_tracking9 = require("@preact-signals/safe-react/tracking");
109
+ var import_react_primitive = require("@radix-ui/react-primitive");
110
+ var import_react_slot3 = require("@radix-ui/react-slot");
88
111
  var import_react11 = __toESM(require("react"));
89
112
  var import_react_ui4 = require("@dxos/react-ui");
90
- var StackContext = /* @__PURE__ */ (0, import_react2.createContext)({
91
- orientation: "vertical",
92
- rail: true,
93
- size: "intrinsic"
94
- });
95
- var useStack = () => (0, import_react2.useContext)(StackContext);
96
- var StackItemContext = /* @__PURE__ */ (0, import_react2.createContext)({
97
- selfDragHandleRef: () => {
98
- },
99
- size: "min-content",
100
- setSize: () => {
101
- }
102
- });
103
- var useStackItem = () => (0, import_react2.useContext)(StackItemContext);
104
- var useStackDropForElements = ({ element, selfDroppable, orientation, id, onRearrange }) => {
105
- const [dropping, setDropping] = (0, import_react3.useState)(false);
106
- (0, import_react3.useLayoutEffect)(() => {
113
+ var import_react_ui_theme6 = require("@dxos/react-ui-theme");
114
+ var import_tracking10 = require("@preact-signals/safe-react/tracking");
115
+ var import_react12 = __toESM(require("react"));
116
+ var import_react_ui_theme7 = require("@dxos/react-ui-theme");
117
+ var import_tracking11 = require("@preact-signals/safe-react/tracking");
118
+ var import_react_slot4 = require("@radix-ui/react-slot");
119
+ var import_react13 = __toESM(require("react"));
120
+ var import_react_ui_theme8 = require("@dxos/react-ui-theme");
121
+ var import_tracking12 = require("@preact-signals/safe-react/tracking");
122
+ var import_react14 = __toESM(require("react"));
123
+ var import_react_ui5 = require("@dxos/react-ui");
124
+ var import_react_ui_theme9 = require("@dxos/react-ui-theme");
125
+ var useStackDropForElements = ({ id, element, scrollElement = element, selfDroppable, orientation, onRearrange }) => {
126
+ const [dropping, setDropping] = (0, import_react2.useState)(false);
127
+ (0, import_react2.useLayoutEffect)(() => {
107
128
  if (!element || !selfDroppable) {
108
129
  return;
109
130
  }
@@ -142,11 +163,12 @@ var useStackDropForElements = ({ element, selfDroppable, orientation, id, onRear
142
163
  }
143
164
  }
144
165
  }), (0, import_element.autoScrollForElements)({
145
- element,
166
+ element: scrollElement,
146
167
  getAllowedAxis: () => orientation
147
168
  }));
148
169
  }, [
149
170
  element,
171
+ scrollElement,
150
172
  selfDroppable,
151
173
  orientation,
152
174
  id,
@@ -156,6 +178,26 @@ var useStackDropForElements = ({ element, selfDroppable, orientation, id, onRear
156
178
  dropping
157
179
  };
158
180
  };
181
+ var StackContext = /* @__PURE__ */ (0, import_react3.createContext)({
182
+ orientation: "vertical",
183
+ rail: true,
184
+ size: "intrinsic"
185
+ });
186
+ var useStack = () => (0, import_react3.useContext)(StackContext);
187
+ var idle = {
188
+ type: "idle"
189
+ };
190
+ var StackItemContext = /* @__PURE__ */ (0, import_react3.createContext)({
191
+ selfDragHandleRef: () => {
192
+ },
193
+ size: "min-content",
194
+ setSize: () => {
195
+ },
196
+ state: idle,
197
+ setState: () => {
198
+ }
199
+ });
200
+ var useStackItem = () => (0, import_react3.useContext)(StackItemContext);
159
201
  var railGridHorizontal = "grid-rows-[[rail-start]_var(--rail-size)_[content-start]_1fr_[content-end]]";
160
202
  var railGridVertical = "grid-cols-[[rail-start]_var(--rail-size)_[content-start]_1fr_[content-end]]";
161
203
  var railGridHorizontalContainFitContent = "grid-rows-[[rail-start]_var(--rail-size)_[content-start]_fit-content(calc(100%-var(--rail-size)*2+2px))_[content-end]]";
@@ -163,146 +205,224 @@ var railGridVerticalContainFitContent = "grid-cols-[[rail-start]_var(--rail-size
163
205
  var autoScrollRootAttributes = {
164
206
  "data-drag-autoscroll": "idle"
165
207
  };
166
- var Stack = /* @__PURE__ */ (0, import_react.forwardRef)(({ children, classNames, style, orientation = "vertical", rail = true, size = "intrinsic", onRearrange, itemsCount = import_react.Children.count(children), ...props }, forwardedRef) => {
167
- const [stackElement, stackRef] = (0, import_react.useState)(null);
168
- const composedItemRef = (0, import_react_compose_refs.composeRefs)(stackRef, forwardedRef);
169
- const arrowNavigationAttrs = (0, import_react_tabster.useArrowNavigationGroup)({
170
- axis: orientation
171
- });
172
- const styles = {
173
- [orientation === "horizontal" ? "gridTemplateColumns" : "gridTemplateRows"]: `repeat(${itemsCount}, min-content) [tabster-dummies] 0`,
174
- ...style
175
- };
176
- const selfDroppable = !!(itemsCount < 1 && onRearrange && props.id);
177
- const { dropping } = useStackDropForElements({
178
- id: props.id,
179
- element: stackElement,
180
- selfDroppable,
181
- orientation,
182
- onRearrange
183
- });
184
- const gridClasses = (0, import_react.useMemo)(() => {
185
- if (!rail) {
186
- return orientation === "horizontal" ? "grid-rows-1 pli-1" : "grid-cols-1 plb-1";
187
- }
188
- if (orientation === "horizontal") {
189
- return size === "contain-fit-content" ? railGridHorizontalContainFitContent : railGridHorizontal;
190
- } else {
191
- return size === "contain-fit-content" ? railGridVerticalContainFitContent : railGridVertical;
192
- }
193
- }, [
194
- rail,
195
- orientation,
196
- size
197
- ]);
198
- return /* @__PURE__ */ import_react.default.createElement(StackContext.Provider, {
199
- value: {
208
+ var Stack = /* @__PURE__ */ (0, import_react.forwardRef)(({ children, classNames, style, orientation = "vertical", rail = true, size = "intrinsic", onRearrange, itemsCount = import_react.Children.count(children), getDropElement, separatorOnScroll, ...props }, forwardedRef) => {
209
+ var _effect = (0, import_tracking.useSignals)();
210
+ try {
211
+ const [stackElement, stackRef] = (0, import_react.useState)(null);
212
+ const composedItemRef = (0, import_react_compose_refs.composeRefs)(stackRef, forwardedRef);
213
+ const arrowNavigationAttrs = (0, import_react_tabster.useArrowNavigationGroup)({
214
+ axis: orientation
215
+ });
216
+ const styles = {
217
+ [orientation === "horizontal" ? "gridTemplateColumns" : "gridTemplateRows"]: `repeat(${itemsCount}, min-content) [tabster-dummies] 0`,
218
+ ...style
219
+ };
220
+ const selfDroppable = !!(itemsCount < 1 && onRearrange && props.id);
221
+ const { dropping } = useStackDropForElements({
222
+ id: props.id,
223
+ element: getDropElement && stackElement ? getDropElement(stackElement) : stackElement,
224
+ scrollElement: stackElement,
225
+ selfDroppable,
200
226
  orientation,
201
- rail,
202
- size,
203
227
  onRearrange
204
- }
205
- }, /* @__PURE__ */ import_react.default.createElement("div", {
206
- ...props,
207
- ...arrowNavigationAttrs,
208
- className: (0, import_react_ui_theme.mx)("grid relative", gridClasses, (size === "contain" || size === "contain-fit-content") && (orientation === "horizontal" ? "overflow-x-auto min-bs-0 max-bs-full bs-full" : "overflow-y-auto min-is-0 max-is-full is-full"), classNames),
209
- "data-rail": rail,
210
- "aria-orientation": orientation,
211
- style: styles,
212
- ref: composedItemRef
213
- }, children, selfDroppable && dropping && /* @__PURE__ */ import_react.default.createElement(import_react_ui.ListItem.DropIndicator, {
214
- lineInset: 8,
215
- terminalInset: -8,
216
- gap: -8,
217
- edge: orientation === "horizontal" ? "left" : "top"
218
- })));
228
+ });
229
+ const handleScroll = (0, import_react.useCallback)(() => {
230
+ if (stackElement && Number.isFinite(separatorOnScroll)) {
231
+ const scrollPosition = orientation === "horizontal" ? stackElement.scrollLeft : stackElement.scrollTop;
232
+ const scrollSize = orientation === "horizontal" ? stackElement.scrollWidth : stackElement.scrollHeight;
233
+ const clientSize = orientation === "horizontal" ? stackElement.clientWidth : stackElement.clientHeight;
234
+ const separatorHost = stackElement.closest("[data-scroll-separator]");
235
+ if (separatorHost) {
236
+ separatorHost.setAttribute("data-scroll-separator", String(scrollPosition > separatorOnScroll));
237
+ separatorHost.setAttribute("data-scroll-separator-end", String(scrollSize - (scrollPosition + clientSize) > separatorOnScroll));
238
+ }
239
+ }
240
+ }, [
241
+ stackElement,
242
+ separatorOnScroll,
243
+ orientation
244
+ ]);
245
+ const gridClasses = (0, import_react.useMemo)(() => {
246
+ if (!rail) {
247
+ return orientation === "horizontal" ? "grid-rows-1 pli-1" : "grid-cols-1 plb-1";
248
+ }
249
+ if (orientation === "horizontal") {
250
+ return size === "contain-fit-content" ? railGridHorizontalContainFitContent : railGridHorizontal;
251
+ } else {
252
+ return size === "contain-fit-content" ? railGridVerticalContainFitContent : railGridVertical;
253
+ }
254
+ }, [
255
+ rail,
256
+ orientation,
257
+ size
258
+ ]);
259
+ (0, import_react.useEffect)(() => {
260
+ if (!(stackElement && Number.isFinite(separatorOnScroll))) {
261
+ return;
262
+ }
263
+ const observer = new MutationObserver(() => {
264
+ handleScroll();
265
+ });
266
+ observer.observe(stackElement, {
267
+ childList: true,
268
+ subtree: true
269
+ });
270
+ return () => {
271
+ observer.disconnect();
272
+ };
273
+ }, [
274
+ stackElement,
275
+ handleScroll
276
+ ]);
277
+ return /* @__PURE__ */ import_react.default.createElement(StackContext.Provider, {
278
+ value: {
279
+ orientation,
280
+ rail,
281
+ size,
282
+ onRearrange
283
+ }
284
+ }, /* @__PURE__ */ import_react.default.createElement("div", {
285
+ ...props,
286
+ ...arrowNavigationAttrs,
287
+ className: (0, import_react_ui_theme.mx)("grid relative", gridClasses, (size === "contain" || size === "contain-fit-content") && (orientation === "horizontal" ? "overflow-x-auto min-bs-0 max-bs-full bs-full" : "overflow-y-auto min-is-0 max-is-full is-full"), classNames),
288
+ "data-rail": rail,
289
+ "aria-orientation": orientation,
290
+ style: styles,
291
+ ref: composedItemRef,
292
+ ...Number.isFinite(separatorOnScroll) && {
293
+ onScroll: handleScroll
294
+ }
295
+ }, children, selfDroppable && dropping && /* @__PURE__ */ import_react.default.createElement(import_react_ui.ListItem.DropIndicator, {
296
+ lineInset: 8,
297
+ terminalInset: -8,
298
+ gap: -8,
299
+ edge: orientation === "horizontal" ? "left" : "top"
300
+ })));
301
+ } finally {
302
+ _effect.f();
303
+ }
219
304
  });
220
305
  var StackItemContent = /* @__PURE__ */ (0, import_react5.forwardRef)(({ children, toolbar, statusbar, classNames, size = "intrinsic", ...props }, forwardedRef) => {
221
- const { size: stackItemSize } = useStack();
222
- return /* @__PURE__ */ import_react5.default.createElement("div", {
223
- role: "none",
224
- ...props,
225
- className: (0, import_react_ui_theme3.mx)("group grid grid-cols-[100%]", stackItemSize === "contain" && "min-bs-0 overflow-hidden", size === "video" ? "aspect-video" : size === "square" && "aspect-square", classNames),
226
- style: {
227
- gridTemplateRows: [
228
- ...toolbar ? [
229
- "var(--rail-action)"
230
- ] : [],
231
- "1fr",
232
- ...statusbar ? [
233
- "var(--statusbar-size)"
234
- ] : []
235
- ].join(" ")
236
- },
237
- ref: forwardedRef
238
- }, children);
306
+ var _effect = (0, import_tracking3.useSignals)();
307
+ try {
308
+ const { size: stackItemSize } = useStack();
309
+ return /* @__PURE__ */ import_react5.default.createElement("div", {
310
+ role: "none",
311
+ ...props,
312
+ className: (0, import_react_ui_theme3.mx)("group grid grid-cols-[100%]", stackItemSize === "contain" && "min-bs-0 overflow-hidden", size === "video" ? "aspect-video" : size === "square" && "aspect-square", classNames),
313
+ style: {
314
+ gridTemplateRows: [
315
+ ...toolbar ? [
316
+ "var(--rail-action)"
317
+ ] : [],
318
+ "1fr",
319
+ ...statusbar ? [
320
+ "var(--statusbar-size)"
321
+ ] : []
322
+ ].join(" ")
323
+ },
324
+ "data-popover-collision-boundary": true,
325
+ ref: forwardedRef
326
+ }, children);
327
+ } finally {
328
+ _effect.f();
329
+ }
239
330
  });
240
331
  var StackItemDragHandle = ({ asChild, children }) => {
241
- const { selfDragHandleRef } = useStackItem();
242
- const Root = asChild ? import_react_slot.Slot : "div";
243
- return /* @__PURE__ */ import_react6.default.createElement(Root, {
244
- ref: selfDragHandleRef,
245
- role: "button"
246
- }, children);
332
+ var _effect = (0, import_tracking4.useSignals)();
333
+ try {
334
+ const { selfDragHandleRef } = useStackItem();
335
+ const Root = asChild ? import_react_slot.Slot : "div";
336
+ return /* @__PURE__ */ import_react6.default.createElement(Root, {
337
+ ref: selfDragHandleRef,
338
+ role: "button"
339
+ }, children);
340
+ } finally {
341
+ _effect.f();
342
+ }
247
343
  };
248
- var StackItemHeading = ({ children, classNames, ...props }) => {
249
- const { orientation } = useStack();
250
- const focusableGroupAttrs = (0, import_react_tabster3.useFocusableGroup)({
251
- tabBehavior: "limited"
252
- });
253
- return /* @__PURE__ */ import_react7.default.createElement("div", {
254
- role: "heading",
255
- ...props,
256
- tabIndex: 0,
257
- ...focusableGroupAttrs,
258
- className: (0, import_react_ui_theme4.mx)("flex items-center dx-focus-ring-inset-over-all relative !border-is-0", orientation === "horizontal" ? "bs-[--rail-size]" : "is-[--rail-size] flex-col", classNames)
259
- }, children);
344
+ var StackItemHeading = ({ children, classNames, asChild, ...props }) => {
345
+ var _effect = (0, import_tracking5.useSignals)();
346
+ try {
347
+ const { orientation } = useStack();
348
+ const focusableGroupAttrs = (0, import_react_tabster3.useFocusableGroup)({
349
+ tabBehavior: "limited"
350
+ });
351
+ const Root = asChild ? import_react_slot2.Slot : "div";
352
+ return /* @__PURE__ */ import_react7.default.createElement(Root, {
353
+ role: "heading",
354
+ ...props,
355
+ tabIndex: 0,
356
+ ...focusableGroupAttrs,
357
+ className: (0, import_react_ui_theme4.mx)('flex items-center dx-focus-ring-inset-over-all relative !border-is-0 bg-headerSurface border-transparent [[data-scroll-separator="true"]_&]:border-subduedSeparator', orientation === "horizontal" ? "bs-[--rail-size]" : "is-[--rail-size] flex-col", orientation === "horizontal" ? "border-be" : "border-ie", classNames)
358
+ }, children);
359
+ } finally {
360
+ _effect.f();
361
+ }
260
362
  };
261
363
  var StackItemHeadingLabel = /* @__PURE__ */ (0, import_react7.forwardRef)(({ attendableId, related, classNames, ...props }, forwardedRef) => {
262
- const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(attendableId);
263
- return /* @__PURE__ */ import_react7.default.createElement("h1", {
264
- ...props,
265
- "data-attention": (related && isRelated || hasAttention || isAncestor).toString(),
266
- className: (0, import_react_ui_theme4.mx)("pli-1 min-is-0 is-0 grow truncate font-medium text-baseText data-[attention=true]:text-accentText self-center", classNames),
267
- ref: forwardedRef
268
- });
364
+ var _effect = (0, import_tracking5.useSignals)();
365
+ try {
366
+ const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(attendableId);
367
+ return /* @__PURE__ */ import_react7.default.createElement("h1", {
368
+ ...props,
369
+ "data-attention": (related && isRelated || hasAttention || isAncestor).toString(),
370
+ className: (0, import_react_ui_theme4.mx)("pli-1 min-is-0 is-0 grow truncate font-medium text-baseText data-[attention=true]:text-accentText self-center", classNames),
371
+ ref: forwardedRef
372
+ });
373
+ } finally {
374
+ _effect.f();
375
+ }
269
376
  });
270
377
  var MIN_WIDTH = 20;
271
378
  var MIN_HEIGHT = 3;
272
379
  var StackItemResizeHandle = () => {
273
- const { orientation } = useStack();
274
- const { setSize, size } = useStackItem();
275
- return /* @__PURE__ */ import_react8.default.createElement(import_react_ui_dnd2.ResizeHandle, {
276
- side: orientation === "horizontal" ? "inline-end" : "block-end",
277
- fallbackSize: DEFAULT_EXTRINSIC_SIZE,
278
- minSize: orientation === "horizontal" ? MIN_WIDTH : MIN_HEIGHT,
279
- size,
280
- onSizeChange: setSize
281
- });
380
+ var _effect = (0, import_tracking6.useSignals)();
381
+ try {
382
+ const { orientation } = useStack();
383
+ const { setSize, size } = useStackItem();
384
+ return /* @__PURE__ */ import_react8.default.createElement(import_react_ui_dnd2.ResizeHandle, {
385
+ side: orientation === "horizontal" ? "inline-end" : "block-end",
386
+ fallbackSize: DEFAULT_EXTRINSIC_SIZE,
387
+ minSize: orientation === "horizontal" ? MIN_WIDTH : MIN_HEIGHT,
388
+ size,
389
+ onSizeChange: setSize
390
+ });
391
+ } finally {
392
+ _effect.f();
393
+ }
394
+ };
395
+ var MenuSignifierHorizontal = () => {
396
+ var _effect = (0, import_tracking8.useSignals)();
397
+ try {
398
+ return /* @__PURE__ */ import_react10.default.createElement("svg", {
399
+ className: "absolute block-end-[7px]",
400
+ width: 20,
401
+ height: 2,
402
+ viewBox: "0 0 20 2",
403
+ stroke: "currentColor",
404
+ opacity: 0.5
405
+ }, /* @__PURE__ */ import_react10.default.createElement("line", {
406
+ x1: 0.5,
407
+ y1: 0.75,
408
+ x2: 19,
409
+ y2: 0.75,
410
+ strokeWidth: 1.25,
411
+ strokeLinecap: "round",
412
+ strokeDasharray: "6 20",
413
+ strokeDashoffset: "-6.5"
414
+ }));
415
+ } finally {
416
+ _effect.f();
417
+ }
282
418
  };
283
- var MenuSignifierHorizontal = () => /* @__PURE__ */ import_react10.default.createElement("svg", {
284
- className: "absolute block-end-[7px]",
285
- width: 20,
286
- height: 2,
287
- viewBox: "0 0 20 2",
288
- stroke: "currentColor",
289
- opacity: 0.5
290
- }, /* @__PURE__ */ import_react10.default.createElement("line", {
291
- x1: 0.5,
292
- y1: 0.75,
293
- x2: 19,
294
- y2: 0.75,
295
- strokeWidth: 1.25,
296
- strokeLinecap: "round",
297
- strokeDasharray: "6 20",
298
- strokeDashoffset: "-6.5"
299
- }));
300
419
  var translationKey = "stack";
301
420
  var translations_default = [
302
421
  {
303
422
  "en-US": {
304
423
  [translationKey]: {
305
424
  "resize label": "Drag to resize",
425
+ "drag handle label": "Drag to rearrange",
306
426
  "pin start label": "Pin to the left sidebar",
307
427
  "pin end label": "Pin to the right sidebar",
308
428
  "increment start label": "Move to the left",
@@ -314,219 +434,278 @@ var translations_default = [
314
434
  }
315
435
  ];
316
436
  var StackItemSigilButton = /* @__PURE__ */ (0, import_react9.forwardRef)(({ attendableId, classNames, related, isMenu = true, children, ...props }, forwardedRef) => {
317
- const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention2.useAttention)(attendableId);
318
- const variant = related && isRelated || hasAttention || isAncestor ? "primary" : "ghost";
319
- return /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Button, {
320
- ...props,
321
- variant,
322
- classNames: [
323
- "shrink-0 pli-0 min-bs-0 is-[--rail-action] bs-[--rail-action] relative app-no-drag",
324
- classNames
325
- ],
326
- ref: forwardedRef
327
- }, isMenu && /* @__PURE__ */ import_react9.default.createElement(MenuSignifierHorizontal, null), children);
437
+ var _effect = (0, import_tracking7.useSignals)();
438
+ try {
439
+ const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention2.useAttention)(attendableId);
440
+ const variant = related && isRelated || hasAttention || isAncestor ? "primary" : "ghost";
441
+ return /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Button, {
442
+ ...props,
443
+ variant,
444
+ classNames: [
445
+ "shrink-0 pli-0 min-bs-0 is-[--rail-action] bs-[--rail-action] relative app-no-drag",
446
+ classNames
447
+ ],
448
+ ref: forwardedRef
449
+ }, isMenu && /* @__PURE__ */ import_react9.default.createElement(MenuSignifierHorizontal, null), children);
450
+ } finally {
451
+ _effect.f();
452
+ }
328
453
  });
329
454
  var StackItemSigil = /* @__PURE__ */ (0, import_react9.forwardRef)(({ actions: actionGroups, onAction, triggerLabel, attendableId, icon, related, children }, forwardedRef) => {
330
- const { t } = (0, import_react_ui3.useTranslation)(translationKey);
331
- const suppressNextTooltip = (0, import_react9.useRef)(false);
332
- const [optionsMenuOpen, setOptionsMenuOpen] = (0, import_react9.useState)(false);
333
- const hasActions = actionGroups && actionGroups.length > 0;
334
- const button = /* @__PURE__ */ import_react9.default.createElement(StackItemSigilButton, {
335
- attendableId,
336
- related,
337
- isMenu: hasActions,
338
- // TODO(wittjosiah): Better disabling of interactive styles when no action are available.
339
- // Remove underscore icon when no actions are available?
340
- classNames: !hasActions && "cursor-default"
341
- }, /* @__PURE__ */ import_react9.default.createElement("span", {
342
- className: "sr-only"
343
- }, triggerLabel), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
344
- icon,
345
- size: 5
346
- }));
347
- if (!hasActions) {
348
- return button;
349
- }
350
- return /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Root, {
351
- open: optionsMenuOpen,
352
- onOpenChange: (nextOpen) => {
353
- if (!nextOpen) {
354
- suppressNextTooltip.current = true;
355
- }
356
- return setOptionsMenuOpen(nextOpen);
455
+ var _effect = (0, import_tracking7.useSignals)();
456
+ try {
457
+ const { t } = (0, import_react_ui3.useTranslation)(translationKey);
458
+ const [optionsMenuOpen, setOptionsMenuOpen] = (0, import_react9.useState)(false);
459
+ const hasActions = actionGroups && actionGroups.length > 0;
460
+ const button = /* @__PURE__ */ import_react9.default.createElement(StackItemSigilButton, {
461
+ attendableId,
462
+ related,
463
+ isMenu: hasActions,
464
+ // TODO(wittjosiah): Better disabling of interactive styles when no action are available.
465
+ // Remove underscore icon when no actions are available?
466
+ classNames: !hasActions && "cursor-default"
467
+ }, /* @__PURE__ */ import_react9.default.createElement("span", {
468
+ className: "sr-only"
469
+ }, triggerLabel), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
470
+ icon,
471
+ size: 5
472
+ }));
473
+ if (!hasActions) {
474
+ return button;
357
475
  }
358
- }, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Trigger, {
359
- asChild: true,
360
- ref: forwardedRef
361
- }, button), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Portal, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Content, {
362
- classNames: "z-[31]"
363
- }, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Viewport, null, actionGroups?.map((actions, index) => {
364
- const separator = index > 0 ? /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Separator, null) : null;
365
- return /* @__PURE__ */ import_react9.default.createElement(import_react9.Fragment, {
366
- key: index
367
- }, separator, actions.map((action) => {
368
- const shortcut = typeof action.properties.keyBinding === "string" ? action.properties.keyBinding : action.properties.keyBinding?.[(0, import_util.getHostPlatform)()];
369
- const menuItemType = action.properties.menuItemType;
370
- const Root = menuItemType === "toggle" ? import_react_ui3.DropdownMenu.CheckboxItem : import_react_ui3.DropdownMenu.Item;
371
- return /* @__PURE__ */ import_react9.default.createElement(Root, {
372
- key: action.id,
373
- onClick: (event) => {
374
- if (action.properties.disabled) {
375
- return;
476
+ return /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Root, {
477
+ open: optionsMenuOpen,
478
+ onOpenChange: setOptionsMenuOpen
479
+ }, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Trigger, {
480
+ asChild: true,
481
+ ref: forwardedRef
482
+ }, button), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Portal, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Content, {
483
+ classNames: "z-[31]"
484
+ }, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Viewport, null, actionGroups?.map((actions, index) => {
485
+ const separator = index > 0 ? /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Separator, null) : null;
486
+ return /* @__PURE__ */ import_react9.default.createElement(import_react9.Fragment, {
487
+ key: index
488
+ }, separator, actions.map((action) => {
489
+ const shortcut = typeof action.properties.keyBinding === "string" ? action.properties.keyBinding : action.properties.keyBinding?.[(0, import_util.getHostPlatform)()];
490
+ const menuItemType = action.properties.menuItemType;
491
+ const Root = menuItemType === "toggle" ? import_react_ui3.DropdownMenu.CheckboxItem : import_react_ui3.DropdownMenu.Item;
492
+ return /* @__PURE__ */ import_react9.default.createElement(Root, {
493
+ key: action.id,
494
+ onClick: (event) => {
495
+ if (action.properties.disabled) {
496
+ return;
497
+ }
498
+ event.stopPropagation();
499
+ setOptionsMenuOpen(false);
500
+ onAction?.(action);
501
+ },
502
+ classNames: "gap-2",
503
+ disabled: action.properties.disabled,
504
+ checked: menuItemType === "toggle" ? action.properties.isChecked : void 0,
505
+ ...action.properties?.testId && {
506
+ "data-testid": action.properties.testId
376
507
  }
377
- event.stopPropagation();
378
- suppressNextTooltip.current = true;
379
- setOptionsMenuOpen(false);
380
- onAction?.(action);
381
- },
382
- classNames: "gap-2",
383
- disabled: action.properties.disabled,
384
- checked: menuItemType === "toggle" ? action.properties.isChecked : void 0,
385
- ...action.properties?.testId && {
386
- "data-testid": action.properties.testId
387
- }
388
- }, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
389
- icon: action.properties.icon ?? "ph--placeholder--regular",
390
- size: 4
391
- }), /* @__PURE__ */ import_react9.default.createElement("span", {
392
- className: "grow truncate"
393
- }, (0, import_react_ui3.toLocalizedString)(action.properties.label ?? "", t)), menuItemType === "toggle" && /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.ItemIndicator, {
394
- asChild: true
395
- }, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
396
- icon: "ph--check--regular",
397
- size: 4
398
- })), shortcut && /* @__PURE__ */ import_react9.default.createElement("span", {
399
- className: (0, import_react_ui_theme5.mx)("shrink-0", import_react_ui_theme5.descriptionText)
400
- }, (0, import_keyboard.keySymbols)(shortcut).join("")));
401
- }));
402
- }), children), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Arrow, null))));
508
+ }, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
509
+ icon: action.properties.icon ?? "ph--placeholder--regular",
510
+ size: 4
511
+ }), /* @__PURE__ */ import_react9.default.createElement("span", {
512
+ className: "grow truncate"
513
+ }, (0, import_react_ui3.toLocalizedString)(action.properties.label ?? "", t)), menuItemType === "toggle" && /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.ItemIndicator, {
514
+ asChild: true
515
+ }, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
516
+ icon: "ph--check--regular",
517
+ size: 4
518
+ })), shortcut && /* @__PURE__ */ import_react9.default.createElement("span", {
519
+ className: (0, import_react_ui_theme5.mx)("shrink-0", import_react_ui_theme5.descriptionText)
520
+ }, (0, import_keyboard.keySymbols)(shortcut).join("")));
521
+ }));
522
+ }), children), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DropdownMenu.Arrow, null))));
523
+ } finally {
524
+ _effect.f();
525
+ }
403
526
  });
404
527
  var DEFAULT_HORIZONTAL_SIZE = 48;
405
528
  var DEFAULT_VERTICAL_SIZE = "min-content";
406
529
  var DEFAULT_EXTRINSIC_SIZE = DEFAULT_HORIZONTAL_SIZE;
407
- var StackItemRoot = /* @__PURE__ */ (0, import_react4.forwardRef)(({ item, children, classNames, size: propsSize, onSizeChange, role, order, style, disableRearrange, focusIndicatorVariant = "over-all", ...props }, forwardedRef) => {
408
- const [itemElement, itemRef] = (0, import_react4.useState)(null);
409
- const [selfDragHandleElement, selfDragHandleRef] = (0, import_react4.useState)(null);
410
- const [closestEdge, setEdge] = (0, import_react4.useState)(null);
411
- const { orientation, rail, onRearrange } = useStack();
412
- const [size = orientation === "horizontal" ? DEFAULT_HORIZONTAL_SIZE : DEFAULT_VERTICAL_SIZE, setInternalSize] = (0, import_react4.useState)(propsSize);
413
- const Root = role ?? "div";
414
- const composedItemRef = (0, import_react_compose_refs2.composeRefs)(itemRef, forwardedRef);
415
- const setSize = (0, import_react4.useCallback)((nextSize, commit) => {
416
- setInternalSize(nextSize);
417
- if (commit) {
418
- onSizeChange?.(nextSize);
419
- }
420
- }, [
421
- onSizeChange
422
- ]);
423
- const type = orientation === "horizontal" ? "column" : "card";
424
- (0, import_react4.useLayoutEffect)(() => {
425
- if (!itemElement || !onRearrange || disableRearrange) {
426
- return;
427
- }
428
- return (0, import_combine2.combine)((0, import_adapter2.draggable)({
429
- element: itemElement,
430
- ...selfDragHandleElement && {
431
- dragHandle: selfDragHandleElement
432
- },
433
- getInitialData: () => ({
434
- id: item.id,
435
- type
436
- }),
437
- onGenerateDragPreview: ({ nativeSetDragImage, source, location }) => {
438
- document.body.setAttribute("data-drag-preview", "true");
439
- (0, import_scroll_just_enough_into_view.scrollJustEnoughIntoView)({
440
- element: source.element
441
- });
442
- const { x, y } = (0, import_preserve_offset_on_source.preserveOffsetOnSource)({
443
- element: source.element,
444
- input: location.current.input
445
- })({
446
- container: source.element.offsetParent ?? document.body
447
- });
448
- nativeSetDragImage?.(source.element, x, y);
449
- },
450
- onDragStart: () => {
451
- document.body.removeAttribute("data-drag-preview");
452
- itemElement?.closest("[data-drag-autoscroll]")?.setAttribute("data-drag-autoscroll", "active");
453
- },
454
- onDrop: () => {
455
- itemElement?.closest("[data-drag-autoscroll]")?.setAttribute("data-drag-autoscroll", "idle");
530
+ var StackItemRoot = /* @__PURE__ */ (0, import_react4.forwardRef)(({ item, children, classNames, size: propsSize, onSizeChange, role, order, prevSiblingId, nextSiblingId, style, disableRearrange, focusIndicatorVariant = "over-all", ...props }, forwardedRef) => {
531
+ var _effect = (0, import_tracking2.useSignals)();
532
+ try {
533
+ const [itemElement, itemRef] = (0, import_react4.useState)(null);
534
+ const [selfDragHandleElement, selfDragHandleRef] = (0, import_react4.useState)(null);
535
+ const [closestEdge, setEdge] = (0, import_react4.useState)(null);
536
+ const [sourceId, setSourceId] = (0, import_react4.useState)(null);
537
+ const [dragState, setDragState] = (0, import_react4.useState)(idle);
538
+ const { orientation, rail, onRearrange } = useStack();
539
+ const [size = orientation === "horizontal" ? DEFAULT_HORIZONTAL_SIZE : DEFAULT_VERTICAL_SIZE, setInternalSize] = (0, import_react4.useState)(propsSize);
540
+ const Root = role ?? "div";
541
+ const composedItemRef = (0, import_react_compose_refs2.composeRefs)(itemRef, forwardedRef);
542
+ const setSize = (0, import_react4.useCallback)((nextSize, commit) => {
543
+ setInternalSize(nextSize);
544
+ if (commit) {
545
+ onSizeChange?.(nextSize);
546
+ }
547
+ }, [
548
+ onSizeChange
549
+ ]);
550
+ const type = orientation === "horizontal" ? "column" : "card";
551
+ (0, import_react4.useLayoutEffect)(() => {
552
+ if (!itemElement || !onRearrange || disableRearrange) {
553
+ return;
456
554
  }
457
- }), (0, import_adapter2.dropTargetForElements)({
458
- element: itemElement,
459
- getData: ({ input, element }) => {
460
- return (0, import_closest_edge2.attachClosestEdge)({
555
+ return (0, import_combine2.combine)((0, import_adapter2.draggable)({
556
+ element: itemElement,
557
+ ...selfDragHandleElement && {
558
+ dragHandle: selfDragHandleElement
559
+ },
560
+ getInitialData: () => ({
461
561
  id: item.id,
462
562
  type
463
- }, {
464
- input,
465
- element,
466
- allowedEdges: orientation === "horizontal" ? [
467
- "left",
468
- "right"
469
- ] : [
470
- "top",
471
- "bottom"
472
- ]
473
- });
474
- },
475
- onDragEnter: ({ self, source }) => {
476
- if (source.data.type === self.data.type) {
477
- setEdge((0, import_closest_edge2.extractClosestEdge)(self.data));
478
- }
479
- },
480
- onDrag: ({ self, source }) => {
481
- if (source.data.type === self.data.type) {
482
- setEdge((0, import_closest_edge2.extractClosestEdge)(self.data));
563
+ }),
564
+ onGenerateDragPreview: ({ nativeSetDragImage, source, location }) => {
565
+ document.body.setAttribute("data-drag-preview", "true");
566
+ const offsetFn = (0, import_preserve_offset_on_source.preserveOffsetOnSource)({
567
+ element: source.element,
568
+ input: location.current.input
569
+ });
570
+ const rect = source.element.getBoundingClientRect();
571
+ (0, import_set_custom_native_drag_preview.setCustomNativeDragPreview)({
572
+ nativeSetDragImage,
573
+ getOffset: ({ container }) => {
574
+ return offsetFn({
575
+ container
576
+ });
577
+ },
578
+ render: ({ container }) => {
579
+ container.style.width = rect.width + "px";
580
+ setDragState({
581
+ type: "preview",
582
+ container,
583
+ item
584
+ });
585
+ return () => {
586
+ };
587
+ }
588
+ });
589
+ },
590
+ onDragStart: () => {
591
+ document.body.removeAttribute("data-drag-preview");
592
+ itemElement?.closest("[data-drag-autoscroll]")?.setAttribute("data-drag-autoscroll", "active");
593
+ setDragState({
594
+ type: "is-dragging",
595
+ item
596
+ });
597
+ },
598
+ onDrop: () => {
599
+ itemElement?.closest("[data-drag-autoscroll]")?.setAttribute("data-drag-autoscroll", "idle");
600
+ setDragState(idle);
483
601
  }
484
- },
485
- onDragLeave: () => setEdge(null),
486
- onDrop: ({ self, source }) => {
487
- setEdge(null);
488
- if (source.data.type === self.data.type) {
489
- onRearrange(source.data, self.data, (0, import_closest_edge2.extractClosestEdge)(self.data));
602
+ }), (0, import_adapter2.dropTargetForElements)({
603
+ element: itemElement,
604
+ getData: ({ input, element }) => {
605
+ return (0, import_closest_edge2.attachClosestEdge)({
606
+ id: item.id,
607
+ type
608
+ }, {
609
+ input,
610
+ element,
611
+ allowedEdges: orientation === "horizontal" ? [
612
+ "left",
613
+ "right"
614
+ ] : [
615
+ "top",
616
+ "bottom"
617
+ ]
618
+ });
619
+ },
620
+ onDragEnter: ({ self, source }) => {
621
+ if (source.data.type === self.data.type) {
622
+ setEdge((0, import_closest_edge2.extractClosestEdge)(self.data));
623
+ setSourceId(source.data.id);
624
+ }
625
+ },
626
+ onDrag: ({ self, source }) => {
627
+ if (source.data.type === self.data.type) {
628
+ setEdge((0, import_closest_edge2.extractClosestEdge)(self.data));
629
+ setSourceId(source.data.id);
630
+ }
631
+ },
632
+ onDragLeave: () => {
633
+ setEdge(null);
634
+ setSourceId(null);
635
+ },
636
+ onDrop: ({ self, source }) => {
637
+ setEdge(null);
638
+ setSourceId(null);
639
+ if (source.data.type === self.data.type) {
640
+ onRearrange(source.data, self.data, (0, import_closest_edge2.extractClosestEdge)(self.data));
641
+ }
490
642
  }
643
+ }));
644
+ }, [
645
+ orientation,
646
+ item,
647
+ onRearrange,
648
+ selfDragHandleElement,
649
+ itemElement
650
+ ]);
651
+ const focusableGroupAttrs = (0, import_react_tabster2.useFocusableGroup)({
652
+ tabBehavior: "limited"
653
+ });
654
+ const shouldShowDropIndicator = () => {
655
+ if (!closestEdge || !sourceId) {
656
+ return false;
491
657
  }
492
- }));
493
- }, [
494
- orientation,
495
- item,
496
- onRearrange,
497
- selfDragHandleElement,
498
- itemElement
499
- ]);
500
- const focusableGroupAttrs = (0, import_react_tabster2.useFocusableGroup)({
501
- tabBehavior: "limited"
502
- });
503
- return /* @__PURE__ */ import_react4.default.createElement(StackItemContext.Provider, {
504
- value: {
505
- selfDragHandleRef,
506
- size,
507
- setSize
508
- }
509
- }, /* @__PURE__ */ import_react4.default.createElement(Root, {
510
- ...props,
511
- tabIndex: 0,
512
- ...focusableGroupAttrs,
513
- className: (0, import_react_ui_theme2.mx)("group/stack-item grid relative", focusIndicatorVariant === "over-all" ? "dx-focus-ring-inset-over-all" : orientation === "horizontal" ? "dx-focus-ring-group-x" : "dx-focus-ring-group-y", orientation === "horizontal" ? "grid-rows-subgrid" : "grid-cols-subgrid", rail && (orientation === "horizontal" ? "row-span-2" : "col-span-2"), classNames),
514
- "data-dx-stack-item": true,
515
- ...import_react_ui_dnd.resizeAttributes,
516
- style: {
517
- ...(0, import_react_ui_dnd.sizeStyle)(size, orientation),
518
- ...Number.isFinite(order) && {
519
- [orientation === "horizontal" ? "gridColumn" : "gridRow"]: `${order}`
658
+ if (sourceId === item.id) {
659
+ return false;
660
+ }
661
+ const isTrailingEdgeOfPrevSibling = prevSiblingId !== void 0 && sourceId === prevSiblingId && (orientation === "horizontal" && closestEdge === "left" || orientation === "vertical" && closestEdge === "top");
662
+ if (isTrailingEdgeOfPrevSibling) {
663
+ return false;
664
+ }
665
+ const isLeadingEdgeOfNextSibling = nextSiblingId !== void 0 && sourceId === nextSiblingId && (orientation === "horizontal" && closestEdge === "right" || orientation === "vertical" && closestEdge === "bottom");
666
+ if (isLeadingEdgeOfNextSibling) {
667
+ return false;
668
+ }
669
+ return true;
670
+ };
671
+ return /* @__PURE__ */ import_react4.default.createElement(StackItemContext.Provider, {
672
+ value: {
673
+ selfDragHandleRef,
674
+ size,
675
+ setSize,
676
+ state: dragState,
677
+ setState: setDragState
678
+ }
679
+ }, /* @__PURE__ */ import_react4.default.createElement(Root, {
680
+ ...props,
681
+ tabIndex: 0,
682
+ ...focusableGroupAttrs,
683
+ className: (0, import_react_ui_theme2.mx)("group/stack-item grid relative", focusIndicatorVariant === "over-all" ? "dx-focus-ring-inset-over-all" : orientation === "horizontal" ? "dx-focus-ring-group-x" : "dx-focus-ring-group-y", orientation === "horizontal" ? "grid-rows-subgrid" : "grid-cols-subgrid", rail && (orientation === "horizontal" ? "row-span-2" : "col-span-2"), classNames),
684
+ "data-dx-stack-item": true,
685
+ ...import_react_ui_dnd.resizeAttributes,
686
+ style: {
687
+ ...(0, import_react_ui_dnd.sizeStyle)(size, orientation),
688
+ ...Number.isFinite(order) && {
689
+ [orientation === "horizontal" ? "gridColumn" : "gridRow"]: `${order}`
690
+ },
691
+ ...style
520
692
  },
521
- ...style
522
- },
523
- ref: composedItemRef
524
- }, children, closestEdge && /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.ListItem.DropIndicator, {
525
- lineInset: 8,
526
- terminalInset: -8,
527
- edge: closestEdge
528
- })));
693
+ ref: composedItemRef
694
+ }, children, shouldShowDropIndicator() && closestEdge && /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.ListItem.DropIndicator, {
695
+ lineInset: 8,
696
+ terminalInset: -8,
697
+ edge: closestEdge
698
+ })));
699
+ } finally {
700
+ _effect.f();
701
+ }
529
702
  });
703
+ var StackItemDragPreview = ({ children }) => {
704
+ const { state } = useStackItem();
705
+ return state?.type === "preview" ? /* @__PURE__ */ (0, import_react_dom.createPortal)(children({
706
+ item: state.item
707
+ }), state.container) : null;
708
+ };
530
709
  var StackItem = {
531
710
  Root: StackItemRoot,
532
711
  Content: StackItemContent,
@@ -535,87 +714,449 @@ var StackItem = {
535
714
  ResizeHandle: StackItemResizeHandle,
536
715
  DragHandle: StackItemDragHandle,
537
716
  Sigil: StackItemSigil,
538
- SigilButton: StackItemSigilButton
717
+ SigilButton: StackItemSigilButton,
718
+ DragPreview: StackItemDragPreview
539
719
  };
540
- var LayoutControl = ({ icon, label, ...props }) => {
541
- return /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Tooltip.Root, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Tooltip.Trigger, {
542
- asChild: true
543
- }, /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Button, {
544
- variant: "ghost",
545
- ...props
546
- }, /* @__PURE__ */ import_react11.default.createElement("span", {
547
- className: "sr-only"
548
- }, label), /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Icon, {
549
- icon
550
- }))), /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Tooltip.Portal, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Tooltip.Content, {
551
- side: "bottom"
552
- }, label)));
720
+ var cardRoot = "contain-layout pli-2 plb-1 first-of-type:pbs-0 last-of-type:pbe-0";
721
+ var cardContent = "rounded overflow-hidden bg-cardSurface border border-separator dark:border-subduedSeparator dx-focus-ring-group-y-indicator relative min-bs-[--rail-item] group/card";
722
+ var cardText = "pli-3 mlb-3";
723
+ var cardHeading = "text-lg font-medium line-clamp-2";
724
+ var cardChrome = "pli-1.5 mlb-1.5 [&_.dx-button]:pli-1.5 [&_.dx-button]:text-start [&_.dx-button]:is-full";
725
+ var CardRoot = /* @__PURE__ */ (0, import_react11.forwardRef)(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
726
+ var _effect = (0, import_tracking9.useSignals)();
727
+ try {
728
+ const Root = asChild ? import_react_slot3.Slot : "div";
729
+ const rootProps = asChild ? {
730
+ classNames: [
731
+ cardRoot,
732
+ classNames
733
+ ]
734
+ } : {
735
+ className: (0, import_react_ui_theme6.mx)(cardRoot, classNames),
736
+ role
737
+ };
738
+ return /* @__PURE__ */ import_react11.default.createElement(Root, {
739
+ ...props,
740
+ ...rootProps,
741
+ ref: forwardedRef
742
+ }, children);
743
+ } finally {
744
+ _effect.f();
745
+ }
746
+ });
747
+ var CardContent = /* @__PURE__ */ (0, import_react11.forwardRef)(({ children, classNames, asChild, role = "group", ...props }, forwardedRef) => {
748
+ var _effect = (0, import_tracking9.useSignals)();
749
+ try {
750
+ const Root = asChild ? import_react_slot3.Slot : "div";
751
+ const rootProps = asChild ? {
752
+ classNames: [
753
+ cardContent,
754
+ classNames
755
+ ]
756
+ } : {
757
+ className: (0, import_react_ui_theme6.mx)(cardContent, classNames),
758
+ role
759
+ };
760
+ return /* @__PURE__ */ import_react11.default.createElement(Root, {
761
+ ...props,
762
+ ...rootProps,
763
+ ref: forwardedRef
764
+ }, children);
765
+ } finally {
766
+ _effect.f();
767
+ }
768
+ });
769
+ var CardConditionalContent = ({ role, children }) => {
770
+ var _effect = (0, import_tracking9.useSignals)();
771
+ try {
772
+ if ([
773
+ "popover",
774
+ "card--kanban"
775
+ ].includes(role ?? "never")) {
776
+ return /* @__PURE__ */ import_react11.default.createElement("div", {
777
+ className: role === "popover" ? "popover-card-width" : role === "card--kanban" ? "contents" : ""
778
+ }, children);
779
+ } else {
780
+ return /* @__PURE__ */ import_react11.default.createElement(CardContent, null, children);
781
+ }
782
+ } finally {
783
+ _effect.f();
784
+ }
553
785
  };
554
- var LayoutControls = /* @__PURE__ */ (0, import_react11.forwardRef)(({ onClick, variant = "default", capabilities: can, isSolo, pin, close = false, children, ...props }, forwardedRef) => {
555
- const { t } = (0, import_react_ui4.useTranslation)(translationKey);
556
- const buttonClassNames = variant === "hide-disabled" ? "disabled:hidden !p-1" : "!p-1";
557
- return /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.ButtonGroup, {
558
- ...props,
559
- ref: forwardedRef
560
- }, pin && !isSolo && [
561
- "both",
562
- "start"
563
- ].includes(pin) && /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
564
- label: t("pin start label"),
565
- variant: "ghost",
566
- classNames: buttonClassNames,
567
- onClick: () => onClick?.("pin-start"),
568
- icon: "ph--caret-line-left--regular"
569
- }), can.solo && /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
570
- label: t("solo layout label"),
571
- classNames: buttonClassNames,
572
- onClick: () => onClick?.("solo"),
573
- icon: isSolo ? "ph--arrows-in--regular" : "ph--arrows-out--regular"
574
- }), !isSolo && can.solo && /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
575
- label: t("increment start label"),
576
- disabled: !can.incrementStart,
577
- classNames: buttonClassNames,
578
- onClick: () => onClick?.("increment-start"),
579
- icon: "ph--caret-left--regular"
580
- }), /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
581
- label: t("increment end label"),
582
- disabled: !can.incrementEnd,
583
- classNames: buttonClassNames,
584
- onClick: () => onClick?.("increment-end"),
585
- icon: "ph--caret-right--regular"
586
- })), pin && !isSolo && [
587
- "both",
588
- "end"
589
- ].includes(pin) && /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
590
- label: t("pin end label"),
591
- classNames: buttonClassNames,
592
- onClick: () => onClick?.("pin-end"),
593
- icon: "ph--caret-line-right--regular"
594
- }), close && !isSolo && /* @__PURE__ */ import_react11.default.createElement(LayoutControl, {
595
- label: t(`${typeof close === "string" ? "minify" : "close"} label`),
596
- classNames: buttonClassNames,
597
- onClick: () => onClick?.("close"),
598
- "data-testid": "layoutHeading.close",
599
- icon: close === "minify-start" ? "ph--caret-line-left--regular" : close === "minify-end" ? "ph--caret-line-right--regular" : "ph--x--regular"
600
- }), children);
786
+ var CardHeading = /* @__PURE__ */ (0, import_react11.forwardRef)(({ children, classNames, asChild, role = "heading", ...props }, forwardedRef) => {
787
+ var _effect = (0, import_tracking9.useSignals)();
788
+ try {
789
+ const Root = asChild ? import_react_slot3.Slot : "div";
790
+ const rootProps = asChild ? {
791
+ classNames: [
792
+ cardHeading,
793
+ cardText,
794
+ classNames
795
+ ]
796
+ } : {
797
+ className: (0, import_react_ui_theme6.mx)(cardHeading, cardText, classNames),
798
+ role
799
+ };
800
+ return /* @__PURE__ */ import_react11.default.createElement(Root, {
801
+ ...props,
802
+ ...rootProps,
803
+ ref: forwardedRef
804
+ }, children);
805
+ } finally {
806
+ _effect.f();
807
+ }
601
808
  });
809
+ var CardToolbar = /* @__PURE__ */ (0, import_react11.forwardRef)(({ children, ...props }, forwardedRef) => {
810
+ var _effect = (0, import_tracking9.useSignals)();
811
+ try {
812
+ return /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Toolbar.Root, {
813
+ ...props,
814
+ ref: forwardedRef
815
+ }, children);
816
+ } finally {
817
+ _effect.f();
818
+ }
819
+ });
820
+ var CardToolbarIconButton = import_react_ui4.Toolbar.IconButton;
821
+ var CardToolbarSeparator = import_react_ui4.Toolbar.Separator;
822
+ var CardDragHandle = /* @__PURE__ */ (0, import_react11.forwardRef)(({ toolbarItem }, forwardedRef) => {
823
+ var _effect = (0, import_tracking9.useSignals)();
824
+ try {
825
+ const { t } = (0, import_react_ui4.useTranslation)(translationKey);
826
+ const Root = toolbarItem ? import_react_ui4.Toolbar.IconButton : import_react_ui4.IconButton;
827
+ return /* @__PURE__ */ import_react11.default.createElement(Root, {
828
+ iconOnly: true,
829
+ icon: "ph--dots-six-vertical--regular",
830
+ variant: "ghost",
831
+ label: t("card drag handle label"),
832
+ classNames: "pli-2",
833
+ ref: forwardedRef
834
+ });
835
+ } finally {
836
+ _effect.f();
837
+ }
838
+ });
839
+ var CardDragPreview = StackItem.DragPreview;
840
+ var CardMenu = import_react_primitive.Primitive.div;
841
+ var CardPoster = (props) => {
842
+ var _effect = (0, import_tracking9.useSignals)();
843
+ try {
844
+ const aspect = props.aspect === "auto" ? "aspect-auto" : "aspect-video";
845
+ if (props.image) {
846
+ return /* @__PURE__ */ import_react11.default.createElement("img", {
847
+ className: `dx-card__poster ${aspect} object-cover is-full bs-auto`,
848
+ src: props.image,
849
+ alt: props.alt
850
+ });
851
+ }
852
+ if (props.icon) {
853
+ return /* @__PURE__ */ import_react11.default.createElement("div", {
854
+ role: "image",
855
+ className: `dx-card__poster grid ${aspect} place-items-center bg-inputSurface text-subdued`,
856
+ "aria-label": props.alt
857
+ }, /* @__PURE__ */ import_react11.default.createElement(import_react_ui4.Icon, {
858
+ icon: props.icon,
859
+ size: 10
860
+ }));
861
+ }
862
+ } finally {
863
+ _effect.f();
864
+ }
865
+ };
866
+ var CardChrome = /* @__PURE__ */ (0, import_react11.forwardRef)(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
867
+ var _effect = (0, import_tracking9.useSignals)();
868
+ try {
869
+ const Root = asChild ? import_react_slot3.Slot : "div";
870
+ const rootProps = asChild ? {
871
+ classNames: [
872
+ cardChrome,
873
+ classNames
874
+ ]
875
+ } : {
876
+ className: (0, import_react_ui_theme6.mx)(cardChrome, classNames),
877
+ role
878
+ };
879
+ return /* @__PURE__ */ import_react11.default.createElement(Root, {
880
+ ...props,
881
+ ...rootProps,
882
+ ref: forwardedRef
883
+ }, children);
884
+ } finally {
885
+ _effect.f();
886
+ }
887
+ });
888
+ var CardText = /* @__PURE__ */ (0, import_react11.forwardRef)(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
889
+ var _effect = (0, import_tracking9.useSignals)();
890
+ try {
891
+ const Root = asChild ? import_react_slot3.Slot : "p";
892
+ const rootProps = asChild ? {
893
+ classNames: [
894
+ cardText,
895
+ classNames
896
+ ]
897
+ } : {
898
+ className: (0, import_react_ui_theme6.mx)(cardText, classNames),
899
+ role
900
+ };
901
+ return /* @__PURE__ */ import_react11.default.createElement(Root, {
902
+ ...props,
903
+ ...rootProps,
904
+ ref: forwardedRef
905
+ }, children);
906
+ } finally {
907
+ _effect.f();
908
+ }
909
+ });
910
+ var Card = {
911
+ Root: CardRoot,
912
+ Content: CardContent,
913
+ Container: CardConditionalContent,
914
+ Heading: CardHeading,
915
+ Toolbar: CardToolbar,
916
+ ToolbarIconButton: CardToolbarIconButton,
917
+ ToolbarSeparator: CardToolbarSeparator,
918
+ DragHandle: CardDragHandle,
919
+ DragPreview: CardDragPreview,
920
+ Menu: CardMenu,
921
+ Poster: CardPoster,
922
+ Chrome: CardChrome,
923
+ Text: CardText
924
+ };
925
+ var CardDragPreviewRoot = ({ children }) => {
926
+ var _effect = (0, import_tracking10.useSignals)();
927
+ try {
928
+ return /* @__PURE__ */ import_react12.default.createElement("div", {
929
+ className: "p-2"
930
+ }, children);
931
+ } finally {
932
+ _effect.f();
933
+ }
934
+ };
935
+ var CardDragPreviewContent = ({ children }) => {
936
+ var _effect = (0, import_tracking10.useSignals)();
937
+ try {
938
+ return /* @__PURE__ */ import_react12.default.createElement("div", {
939
+ className: (0, import_react_ui_theme7.mx)(cardContent, "ring-focusLine ring-neutralFocusIndicator")
940
+ }, children);
941
+ } finally {
942
+ _effect.f();
943
+ }
944
+ };
945
+ var CardDragPreview2 = {
946
+ Root: CardDragPreviewRoot,
947
+ Content: CardDragPreviewContent
948
+ };
949
+ var CardStackStack = /* @__PURE__ */ (0, import_react13.forwardRef)(({ children, classNames, itemsCount = 0, ...props }, forwardedRef) => {
950
+ var _effect = (0, import_tracking11.useSignals)();
951
+ try {
952
+ return /* @__PURE__ */ import_react13.default.createElement(Stack, {
953
+ orientation: "vertical",
954
+ size: "contain",
955
+ rail: false,
956
+ classNames: (
957
+ /* NOTE(thure): Do not let this element have zero intrinsic size, otherwise the drop indicator will not display. See #9035. */
958
+ [
959
+ "plb-1",
960
+ itemsCount > 0 && "plb-2",
961
+ classNames
962
+ ]
963
+ ),
964
+ itemsCount,
965
+ separatorOnScroll: 9,
966
+ ...props,
967
+ ref: forwardedRef
968
+ }, children);
969
+ } finally {
970
+ _effect.f();
971
+ }
972
+ });
973
+ var CardStackDragHandle = Card.DragHandle;
974
+ var cardStackHeading = "mli-2 order-first bg-transparent rounded-bs-md flex items-center";
975
+ var CardStackHeading = /* @__PURE__ */ (0, import_react13.forwardRef)(({ children, classNames, asChild, role = "heading", ...props }, forwardedRef) => {
976
+ var _effect = (0, import_tracking11.useSignals)();
977
+ try {
978
+ const Root = asChild ? import_react_slot4.Slot : "div";
979
+ const rootProps = asChild ? {
980
+ classNames: [
981
+ cardStackHeading,
982
+ classNames
983
+ ]
984
+ } : {
985
+ className: (0, import_react_ui_theme8.mx)(cardStackHeading, classNames),
986
+ role
987
+ };
988
+ return /* @__PURE__ */ import_react13.default.createElement(Root, {
989
+ ...props,
990
+ ...rootProps,
991
+ ref: forwardedRef
992
+ }, children);
993
+ } finally {
994
+ _effect.f();
995
+ }
996
+ });
997
+ var cardStackFooter = 'plb-2 mli-2 border-bs border-transparent [[data-scroll-separator-end="true"]_&]:border-subduedSeparator';
998
+ var CardStackFooter = /* @__PURE__ */ (0, import_react13.forwardRef)(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
999
+ var _effect = (0, import_tracking11.useSignals)();
1000
+ try {
1001
+ const Root = asChild ? import_react_slot4.Slot : "div";
1002
+ const rootProps = asChild ? {
1003
+ classNames: [
1004
+ cardStackFooter,
1005
+ classNames
1006
+ ]
1007
+ } : {
1008
+ className: (0, import_react_ui_theme8.mx)(cardStackFooter, classNames),
1009
+ role
1010
+ };
1011
+ return /* @__PURE__ */ import_react13.default.createElement(Root, {
1012
+ ...props,
1013
+ ...rootProps,
1014
+ ref: forwardedRef
1015
+ }, children);
1016
+ } finally {
1017
+ _effect.f();
1018
+ }
1019
+ });
1020
+ var cardStackContent = [
1021
+ "shrink min-bs-0 bg-baseSurface border border-separator rounded-md grid dx-focus-ring-group-x-indicator kanban-drop",
1022
+ railGridHorizontalContainFitContent
1023
+ ];
1024
+ var CardStackContent = /* @__PURE__ */ (0, import_react13.forwardRef)(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
1025
+ var _effect = (0, import_tracking11.useSignals)();
1026
+ try {
1027
+ const Root = asChild ? import_react_slot4.Slot : "div";
1028
+ const rootProps = asChild ? {
1029
+ classNames: [
1030
+ ...cardStackContent,
1031
+ classNames
1032
+ ]
1033
+ } : {
1034
+ className: (0, import_react_ui_theme8.mx)(...cardStackContent, classNames),
1035
+ role
1036
+ };
1037
+ return /* @__PURE__ */ import_react13.default.createElement(Root, {
1038
+ ...props,
1039
+ ...rootProps,
1040
+ "data-scroll-separator": "false",
1041
+ ref: forwardedRef
1042
+ }, children);
1043
+ } finally {
1044
+ _effect.f();
1045
+ }
1046
+ });
1047
+ var cardStackRoot = "flex flex-col pli-2 plb-2";
1048
+ var CardStackRoot = /* @__PURE__ */ (0, import_react13.forwardRef)(({ children, classNames, asChild, role = "none", ...props }, forwardedRef) => {
1049
+ var _effect = (0, import_tracking11.useSignals)();
1050
+ try {
1051
+ const Root = asChild ? import_react_slot4.Slot : "div";
1052
+ const rootProps = asChild ? {
1053
+ classNames: [
1054
+ cardStackRoot,
1055
+ classNames
1056
+ ]
1057
+ } : {
1058
+ className: (0, import_react_ui_theme8.mx)(cardStackRoot, classNames),
1059
+ role
1060
+ };
1061
+ return /* @__PURE__ */ import_react13.default.createElement(Root, {
1062
+ ...props,
1063
+ ...rootProps,
1064
+ ref: forwardedRef
1065
+ }, children);
1066
+ } finally {
1067
+ _effect.f();
1068
+ }
1069
+ });
1070
+ var CardStack = {
1071
+ Root: CardStackRoot,
1072
+ Content: CardStackContent,
1073
+ Stack: CardStackStack,
1074
+ Heading: CardStackHeading,
1075
+ Footer: CardStackFooter,
1076
+ DragHandle: CardStackDragHandle
1077
+ };
1078
+ var CardStackDragPreviewRoot = ({ children }) => {
1079
+ var _effect = (0, import_tracking12.useSignals)();
1080
+ try {
1081
+ return /* @__PURE__ */ import_react14.default.createElement("div", {
1082
+ className: "p-2"
1083
+ }, /* @__PURE__ */ import_react14.default.createElement("div", {
1084
+ className: "rounded-md max-bs-[calc(100dvh-1rem)] overflow-hidden bg-baseSurface border border-separator ring-focusLine ring-neutralFocusIndicator flex flex-col"
1085
+ }, children));
1086
+ } finally {
1087
+ _effect.f();
1088
+ }
1089
+ };
1090
+ var CardStackDragPreviewHeading = ({ children }) => {
1091
+ var _effect = (0, import_tracking12.useSignals)();
1092
+ try {
1093
+ const { t } = (0, import_react_ui5.useTranslation)(translationKey);
1094
+ return /* @__PURE__ */ import_react14.default.createElement("div", {
1095
+ className: "flex items-center p-2"
1096
+ }, /* @__PURE__ */ import_react14.default.createElement(import_react_ui5.IconButton, {
1097
+ iconOnly: true,
1098
+ icon: "ph--dots-six-vertical--regular",
1099
+ variant: "ghost",
1100
+ label: t("column drag handle label"),
1101
+ classNames: "pli-2"
1102
+ }), children);
1103
+ } finally {
1104
+ _effect.f();
1105
+ }
1106
+ };
1107
+ var CardStackDragPreviewContent = ({ children, itemsCount = 0 }) => {
1108
+ var _effect = (0, import_tracking12.useSignals)();
1109
+ try {
1110
+ return /* @__PURE__ */ import_react14.default.createElement("div", {
1111
+ className: (0, import_react_ui_theme9.mx)("overflow-y-auto flex-1 pli-2 flex flex-col gap-2", "plb-1", itemsCount > 0 ? "plb-2" : "plb-1")
1112
+ }, children);
1113
+ } finally {
1114
+ _effect.f();
1115
+ }
1116
+ };
1117
+ var CardStackDragPreviewFooter = ({ children }) => {
1118
+ var _effect = (0, import_tracking12.useSignals)();
1119
+ try {
1120
+ return /* @__PURE__ */ import_react14.default.createElement("div", {
1121
+ className: "p-2 border-t border-separator"
1122
+ }, children);
1123
+ } finally {
1124
+ _effect.f();
1125
+ }
1126
+ };
1127
+ var CardStackDragPreview = {
1128
+ Root: CardStackDragPreviewRoot,
1129
+ Heading: CardStackDragPreviewHeading,
1130
+ Content: CardStackDragPreviewContent,
1131
+ Footer: CardStackDragPreviewFooter
1132
+ };
602
1133
  // Annotate the CommonJS export names for ESM import in node:
603
1134
  0 && (module.exports = {
1135
+ Card,
1136
+ CardDragPreview,
1137
+ CardStack,
1138
+ CardStackDragPreview,
604
1139
  DEFAULT_EXTRINSIC_SIZE,
605
1140
  DEFAULT_HORIZONTAL_SIZE,
606
1141
  DEFAULT_VERTICAL_SIZE,
607
- LayoutControls,
608
1142
  Stack,
609
1143
  StackContext,
610
1144
  StackItem,
611
- StackItemContext,
1145
+ StackItemDragPreview,
612
1146
  autoScrollRootAttributes,
1147
+ cardChrome,
1148
+ cardContent,
1149
+ cardHeading,
1150
+ cardRoot,
1151
+ cardStackContent,
1152
+ cardStackFooter,
1153
+ cardStackHeading,
1154
+ cardStackRoot,
1155
+ cardText,
613
1156
  railGridHorizontal,
614
1157
  railGridHorizontalContainFitContent,
615
1158
  railGridVertical,
616
1159
  railGridVerticalContainFitContent,
617
- translations,
618
- useStack,
619
- useStackItem
1160
+ translations
620
1161
  });
621
1162
  //# sourceMappingURL=index.cjs.map