@khipu/design-system 0.2.0-alpha.8 → 0.2.0-alpha.81

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.
@@ -991,10 +991,15 @@ const ui = _context.ui;
991
991
 
992
992
  if (!logoSource) return;
993
993
 
994
+ // Insert inside the amount div (first child of .kds-invoice-header)
995
+ var header = card.querySelector('.kds-invoice-header');
996
+ var amountDiv = header ? header.firstElementChild : null;
997
+ if (!amountDiv) return;
998
+
994
999
  var inner = document.createElement('div');
995
1000
  inner.className = 'kds-brand-inner';
996
1001
  inner.appendChild(logoSource.cloneNode(true));
997
- card.insertBefore(inner, card.firstChild);
1002
+ amountDiv.insertBefore(inner, amountDiv.firstChild);
998
1003
  });
999
1004
  }
1000
1005
 
@@ -1325,9 +1330,9 @@ const ui = _context.ui;
1325
1330
  function initStickyInvoice(root) {
1326
1331
  root = root || document;
1327
1332
 
1328
- // Progressive collapse range: 0px (expanded) to 60px (collapsed)
1333
+ // Progressive collapse range: 0px (expanded) to 20px (collapsed)
1329
1334
  var COLLAPSE_START = 0;
1330
- var COLLAPSE_END = 60;
1335
+ var COLLAPSE_END = 20;
1331
1336
 
1332
1337
  var lastScrollY = 0;
1333
1338
  var ticking = false;
@@ -1382,9 +1387,11 @@ const ui = _context.ui;
1382
1387
  // Single DOM write per frame — set on screen (parent) so it cascades to sticky + siblings
1383
1388
  currentScreen.style.setProperty('--collapse-progress', progress);
1384
1389
 
1385
- // Close expand panels inside the sticky card when fully collapsed
1386
- // so they don't reappear open when scrolling back up
1387
- if (progress === 1) {
1390
+ // Toggle collapsed state class for discrete styling that can't interpolate (e.g. align-items)
1391
+ currentSticky.classList.toggle('is-collapsed', progress >= 1);
1392
+
1393
+ // Close expand panels as soon as the sticky header starts collapsing
1394
+ if (progress > 0) {
1388
1395
  currentSticky.querySelectorAll('[data-expand-toggle][aria-expanded="true"]').forEach(function(toggle) {
1389
1396
  toggle.setAttribute('aria-expanded', 'false');
1390
1397
  var panelId = toggle.getAttribute('aria-controls');
@@ -1406,6 +1413,9 @@ const ui = _context.ui;
1406
1413
  screen.style.removeProperty('--collapse-progress');
1407
1414
  screen.style.removeProperty('--collapse-collapsible-h');
1408
1415
  });
1416
+ root.querySelectorAll('.kds-invoice-sticky.is-collapsed').forEach(function(el) {
1417
+ el.classList.remove('is-collapsed');
1418
+ });
1409
1419
  }
1410
1420
  });
1411
1421
 
@@ -1457,7 +1467,7 @@ const ui = _context.ui;
1457
1467
  var rows = container.querySelectorAll('.kds-copyable-table-row[data-copy]');
1458
1468
  var values = [];
1459
1469
  rows.forEach(function(r) {
1460
- var key = r.querySelector('.k');
1470
+ var key = r.querySelector('.kds-key');
1461
1471
  var val = r.dataset.copy;
1462
1472
  if (key) {
1463
1473
  values.push(key.textContent.trim() + ': ' + val);