@flytedan/flytebot-design-system 0.11.1 → 0.11.3
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/index.cjs +20 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -288,7 +288,7 @@ var parsePlacement = (p) => {
|
|
|
288
288
|
};
|
|
289
289
|
var samePosition = (a, b) => {
|
|
290
290
|
if (!a || !b) return a === b;
|
|
291
|
-
return a.left === b.left && a.top === b.top && a.bottom === b.bottom && a.width === b.width && a.minWidth === b.minWidth && a.maxH === b.maxH && a.side === b.side && a.anchorWidth === b.anchorWidth;
|
|
291
|
+
return a.left === b.left && a.top === b.top && a.bottom === b.bottom && a.width === b.width && a.minWidth === b.minWidth && a.maxH === b.maxH && a.maxW === b.maxW && a.side === b.side && a.anchorWidth === b.anchorWidth;
|
|
292
292
|
};
|
|
293
293
|
var SCROLL_REGIONS = ".fd-pop-body, .fd-pop-list";
|
|
294
294
|
var PINNED_REGIONS = ":scope > .fd-pop-header, :scope > .fd-pop-footer";
|
|
@@ -345,9 +345,10 @@ function usePopoverPosition(open, anchorRef, opts) {
|
|
|
345
345
|
const top = side === "bottom" ? beside ? r.bottom + offset : edge : null;
|
|
346
346
|
const bottom = side === "top" ? beside ? vh - r.top + offset : edge : null;
|
|
347
347
|
const maxH = beside ? room : vh - MARGIN - edge;
|
|
348
|
+
const maxW = Math.max(0, window.innerWidth - 2 * MARGIN);
|
|
348
349
|
const exact = o.matchWidth === true;
|
|
349
350
|
const width = exact ? r.width : Math.max(o.width || 0, o.minWidth || 0, o.matchWidth === "min" ? r.width : 0);
|
|
350
|
-
const w = exact || o.width ? width : Math.max(layer.width, width) || o.estWidth || 260;
|
|
351
|
+
const w = Math.min(maxW, exact || o.width ? width : Math.max(layer.width, width) || o.estWidth || 260);
|
|
351
352
|
let left = align === "end" ? r.right - w : align === "center" ? r.left + r.width / 2 - w / 2 : r.left;
|
|
352
353
|
left = Math.max(MARGIN, Math.min(left, window.innerWidth - w - MARGIN));
|
|
353
354
|
const next = {
|
|
@@ -357,6 +358,7 @@ function usePopoverPosition(open, anchorRef, opts) {
|
|
|
357
358
|
top,
|
|
358
359
|
bottom,
|
|
359
360
|
maxH,
|
|
361
|
+
maxW,
|
|
360
362
|
side,
|
|
361
363
|
anchorWidth: r.width
|
|
362
364
|
};
|
|
@@ -381,6 +383,7 @@ function usePopoverPosition(open, anchorRef, opts) {
|
|
|
381
383
|
}, [open, o.placement, o.offset, o.matchWidth, o.width, o.minWidth, o.maxHeight, o.estHeight]);
|
|
382
384
|
return pos;
|
|
383
385
|
}
|
|
386
|
+
var capWidth = (value, max) => value == null ? void 0 : Math.min(value, max);
|
|
384
387
|
var portal = (node) => {
|
|
385
388
|
if (typeof document !== "undefined") return (0, import_react_dom.createPortal)(node, document.body);
|
|
386
389
|
return node;
|
|
@@ -472,7 +475,14 @@ function Popover({
|
|
|
472
475
|
top: pos.top == null ? "auto" : pos.top,
|
|
473
476
|
bottom: pos.bottom == null ? "auto" : pos.bottom,
|
|
474
477
|
width: matchWidth === true ? pos.width : width,
|
|
475
|
-
|
|
478
|
+
// CSS lets min-width win over max-width, so every minimum is capped to the viewport too.
|
|
479
|
+
minWidth: capWidth(
|
|
480
|
+
matchWidth === "min" ? Math.max(pos.anchorWidth, minWidth || 0) : minWidth || (matchWidth ? void 0 : 200),
|
|
481
|
+
pos.maxW
|
|
482
|
+
),
|
|
483
|
+
// The surface never runs past the viewport edge, whatever fixed `width` a caller asked
|
|
484
|
+
// for: pos.maxW is the viewport less its margins, and `left` is clamped against it.
|
|
485
|
+
maxWidth: pos.maxW,
|
|
476
486
|
// Size to content by default — cap only at real available room between the
|
|
477
487
|
// anchor and the viewport edge (pos.maxH, computed by usePopoverPosition).
|
|
478
488
|
// A caller-supplied `maxHeight` narrows that further (e.g. a long menu that
|
|
@@ -3370,15 +3380,20 @@ function TransferList({
|
|
|
3370
3380
|
if (isBeingDragged) {
|
|
3371
3381
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "fd-erow-placeholder", "aria-hidden": "true" });
|
|
3372
3382
|
}
|
|
3383
|
+
const content = renderRow(item);
|
|
3384
|
+
const destination = (side === "left" ? right : left).label || "the other list";
|
|
3373
3385
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3374
3386
|
EntityRow,
|
|
3375
3387
|
{
|
|
3376
|
-
...
|
|
3388
|
+
...content,
|
|
3377
3389
|
draggable: true,
|
|
3378
3390
|
onPointerDown: (e) => beginDrag(e, item, side),
|
|
3379
3391
|
action: {
|
|
3380
3392
|
icon: side === "left" ? "plus" : "minus",
|
|
3381
|
-
|
|
3393
|
+
// Names the row AND where it goes. A list repeats this button on every
|
|
3394
|
+
// row, so a name without the row's title is the same word fifty times
|
|
3395
|
+
// over to a screen reader, with nothing to tell one button from the next.
|
|
3396
|
+
label: "Move " + content.title + " to " + destination,
|
|
3382
3397
|
tone: side === "left" ? "add" : "remove",
|
|
3383
3398
|
onClick: () => onMove(item, side, opposite)
|
|
3384
3399
|
}
|