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

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