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