prime-ui-kit 0.20.0 → 0.20.1

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.
@@ -16407,22 +16407,51 @@ function translate(point, grab) {
16407
16407
  function isTransparent(color) {
16408
16408
  return color === "" || color === "transparent" || /rgba?\([^)]*,\s*0\s*\)$/.test(color);
16409
16409
  }
16410
+ var CONTAINER_SHELL = {
16411
+ display: "block",
16412
+ "box-sizing": "content-box",
16413
+ "min-width": "0",
16414
+ "max-width": "none",
16415
+ "min-height": "0",
16416
+ "max-height": "none",
16417
+ margin: "0",
16418
+ padding: "0",
16419
+ border: "none",
16420
+ background: "none",
16421
+ "box-shadow": "none",
16422
+ outline: "none",
16423
+ overflow: "visible",
16424
+ position: "static",
16425
+ transform: "none",
16426
+ translate: "none",
16427
+ scale: "none",
16428
+ rotate: "none",
16429
+ opacity: "1",
16430
+ filter: "none",
16431
+ "clip-path": "none"
16432
+ };
16410
16433
  function inHostCopy(parent, inner2) {
16411
16434
  let outer = inner2;
16412
- const wrap = (node2) => {
16413
- const shell = node2.cloneNode(false);
16414
- shell.style.display = "contents";
16415
- shell.append(outer);
16416
- outer = shell;
16417
- };
16418
16435
  let node = parent;
16419
- while (node && node !== document.body) {
16420
- wrap(node);
16421
- if (node.hasAttribute("data-depth")) {
16422
- const theme = node.parentElement?.closest("[data-theme]");
16423
- if (theme && theme !== document.documentElement && theme !== document.body) wrap(theme);
16424
- break;
16436
+ while (node && node !== document.body && node !== document.documentElement) {
16437
+ const shell = node.cloneNode(false);
16438
+ const source = getComputedStyle(node);
16439
+ const container = source.getPropertyValue("container-type").trim();
16440
+ if (container === "inline-size" || container === "size") {
16441
+ for (const [property, value] of Object.entries(CONTAINER_SHELL))
16442
+ shell.style.setProperty(property, value ?? null);
16443
+ const px3 = (value) => Number.parseFloat(value) || 0;
16444
+ const width = node.clientWidth - px3(source.paddingLeft) - px3(source.paddingRight);
16445
+ shell.style.setProperty("width", `${Math.max(0, width)}px`);
16446
+ if (container === "size") {
16447
+ const height = node.clientHeight - px3(source.paddingTop) - px3(source.paddingBottom);
16448
+ shell.style.setProperty("height", `${Math.max(0, height)}px`);
16449
+ } else shell.style.setProperty("height", "auto");
16450
+ } else {
16451
+ shell.style.display = "contents";
16425
16452
  }
16453
+ shell.append(outer);
16454
+ outer = shell;
16426
16455
  node = node.parentElement;
16427
16456
  }
16428
16457
  return outer;
@@ -16474,11 +16503,6 @@ function cloneFor(preview) {
16474
16503
  clone.style.width = `${preview.origin.width}px`;
16475
16504
  clone.style.height = `${preview.origin.height}px`;
16476
16505
  clone.style.margin = "0";
16477
- const source = getComputedStyle(preview.element);
16478
- if (isTransparent(source.backgroundColor)) {
16479
- const layer = source.getPropertyValue("--prime-color-layer-current").trim();
16480
- if (layer) clone.style.backgroundColor = layer;
16481
- }
16482
16506
  const row = preview.element instanceof HTMLTableRowElement ? preview.element : null;
16483
16507
  const cell = preview.element instanceof HTMLTableCellElement ? preview.element : null;
16484
16508
  const lifted = row ? inTableCopy(row, clone, preview.origin) : cell ? inHeadCopy(cell, clone, preview.origin) : clone;
@@ -16503,6 +16527,12 @@ function cloneFor(preview) {
16503
16527
  lifted.classList.add(Dnd_default.lift);
16504
16528
  return outer;
16505
16529
  }
16530
+ function fillBareCopy(host, source) {
16531
+ const copy = host.querySelector("[data-dnd-copy]");
16532
+ if (!copy || !isTransparent(getComputedStyle(copy).backgroundColor)) return;
16533
+ const layer = getComputedStyle(source).getPropertyValue("--prime-color-layer-current").trim();
16534
+ if (layer) copy.style.backgroundColor = layer;
16535
+ }
16506
16536
  function liftedIn(host) {
16507
16537
  return host.querySelector(`.${Dnd_default.lift}`);
16508
16538
  }
@@ -16687,6 +16717,7 @@ function DragOverlay({ controller }) {
16687
16717
  mirrorRef.current = null;
16688
16718
  const copy = cloneFor(event.preview);
16689
16719
  host.replaceChildren(copy);
16720
+ fillBareCopy(host, event.preview.element);
16690
16721
  host.style.transform = translate(event.preview.point, event.preview.grab);
16691
16722
  const source = event.preview.element;
16692
16723
  if (typeof MutationObserver === "function" && source.querySelector("[data-dnd-mirror]")) {
@@ -26383,6 +26414,8 @@ function FieldList({
26383
26414
  fieldTierClass,
26384
26415
  FieldList_default.row,
26385
26416
  FieldList_default.record,
26417
+ // A list on its own fill draws lines between its rows; a plain one only once they stack
26418
+ // (its one-line rows are parted by air: FieldList.module.css).
26386
26419
  hairline_default.between,
26387
26420
  presence.entering.has(id) && enterMotion_default.enter
26388
26421
  ),