@khipu/design-system 0.2.0-alpha.6 → 0.2.0-alpha.8
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.
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
|
|
13
13
|
* Source: design-system/src/tokens/tokens.json
|
|
14
|
-
* Generated: 2026-05-
|
|
14
|
+
* Generated: 2026-05-15T14:55:41.527Z
|
|
15
15
|
*
|
|
16
16
|
* To regenerate:
|
|
17
17
|
* cd design-system && npm run tokens:generate
|
|
@@ -1050,6 +1050,7 @@ a.kds-btn.kds-btn-md {
|
|
|
1050
1050
|
padding: var(--kds-spacing-2);
|
|
1051
1051
|
box-shadow: var(--kds-shadow-card);
|
|
1052
1052
|
transition: box-shadow 0.3s ease;
|
|
1053
|
+
margin-block-start: 0 !important;
|
|
1053
1054
|
}
|
|
1054
1055
|
|
|
1055
1056
|
.kds-card-elevated:hover,
|
|
@@ -1726,7 +1727,7 @@ a.kds-btn.kds-btn-md {
|
|
|
1726
1727
|
}
|
|
1727
1728
|
|
|
1728
1729
|
/* ========================================
|
|
1729
|
-
Snackbar Positioning
|
|
1730
|
+
Snackbar Positioning & Styling
|
|
1730
1731
|
======================================== */
|
|
1731
1732
|
|
|
1732
1733
|
.snackbar {
|
|
@@ -1738,41 +1739,99 @@ a.kds-btn.kds-btn-md {
|
|
|
1738
1739
|
min-width: 344px;
|
|
1739
1740
|
max-width: var(--kds-snackbar-max-width);
|
|
1740
1741
|
box-shadow: var(--kds-shadow-8);
|
|
1742
|
+
border-radius: var(--kds-radius-md);
|
|
1743
|
+
padding: var(--kds-spacing-1-5) var(--kds-spacing-2);
|
|
1744
|
+
gap: var(--kds-spacing-1);
|
|
1745
|
+
font-family: var(--kds-font-family-primary);
|
|
1746
|
+
font-size: var(--kds-font-size-body2);
|
|
1747
|
+
font-weight: var(--kds-font-weight-medium);
|
|
1748
|
+
line-height: var(--kds-line-height-normal);
|
|
1749
|
+
letter-spacing: var(--kds-letter-spacing-normal);
|
|
1750
|
+
overflow: hidden;
|
|
1741
1751
|
}
|
|
1742
1752
|
|
|
1743
1753
|
/* Snackbar active state - ensure visibility when toggled via JS */
|
|
1744
1754
|
.snackbar.active {
|
|
1745
1755
|
visibility: visible !important;
|
|
1746
1756
|
opacity: 1 !important;
|
|
1747
|
-
transform: translateX(-50%) !important;
|
|
1748
1757
|
}
|
|
1749
1758
|
|
|
1750
|
-
/* Snackbar semantic variants
|
|
1759
|
+
/* Snackbar semantic variants
|
|
1760
|
+
All use white text (--kds-color-primary-contrast) on solid semantic backgrounds */
|
|
1751
1761
|
.snackbar.error {
|
|
1752
1762
|
background-color: var(--kds-color-error-main) !important;
|
|
1753
|
-
color: var(--
|
|
1763
|
+
color: var(--kds-color-primary-contrast) !important;
|
|
1754
1764
|
}
|
|
1755
1765
|
|
|
1756
1766
|
.snackbar.error i {
|
|
1757
|
-
color: var(--
|
|
1767
|
+
color: var(--kds-color-primary-contrast) !important;
|
|
1758
1768
|
}
|
|
1759
1769
|
|
|
1760
1770
|
.snackbar.info {
|
|
1761
1771
|
background-color: var(--kds-color-info-main) !important;
|
|
1762
|
-
color: var(--
|
|
1772
|
+
color: var(--kds-color-primary-contrast) !important;
|
|
1763
1773
|
}
|
|
1764
1774
|
|
|
1765
1775
|
.snackbar.info i {
|
|
1766
|
-
color: var(--
|
|
1776
|
+
color: var(--kds-color-primary-contrast) !important;
|
|
1767
1777
|
}
|
|
1768
1778
|
|
|
1769
1779
|
.snackbar.success {
|
|
1770
1780
|
background-color: var(--kds-color-success-main) !important;
|
|
1771
|
-
color: var(--
|
|
1781
|
+
color: var(--kds-color-primary-contrast) !important;
|
|
1772
1782
|
}
|
|
1773
1783
|
|
|
1774
1784
|
.snackbar.success i {
|
|
1775
|
-
color: var(--
|
|
1785
|
+
color: var(--kds-color-primary-contrast) !important;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
/* Snackbar progress bar — animated timer for auto-dismiss */
|
|
1789
|
+
.snackbar[data-auto-dismiss]::after {
|
|
1790
|
+
content: '';
|
|
1791
|
+
position: absolute;
|
|
1792
|
+
bottom: 0;
|
|
1793
|
+
left: 0;
|
|
1794
|
+
height: 3px;
|
|
1795
|
+
width: 100%;
|
|
1796
|
+
background: rgba(255, 255, 255, 0.35);
|
|
1797
|
+
border-radius: 0 0 var(--kds-radius-md) var(--kds-radius-md);
|
|
1798
|
+
animation: kds-snackbar-timer var(--kds-snackbar-duration, 5s) linear forwards;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
@keyframes kds-snackbar-timer {
|
|
1802
|
+
from { width: 100%; }
|
|
1803
|
+
to { width: 0; }
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
/* Snackbar close button */
|
|
1807
|
+
.kds-snackbar-close {
|
|
1808
|
+
background: none !important;
|
|
1809
|
+
border: none !important;
|
|
1810
|
+
color: var(--kds-color-primary-contrast) !important;
|
|
1811
|
+
cursor: pointer;
|
|
1812
|
+
padding: var(--kds-spacing-0-5) !important;
|
|
1813
|
+
margin: calc(-1 * var(--kds-spacing-0-5)) !important;
|
|
1814
|
+
margin-left: 0 !important;
|
|
1815
|
+
border-radius: var(--kds-radius-full) !important;
|
|
1816
|
+
display: flex;
|
|
1817
|
+
align-items: center;
|
|
1818
|
+
justify-content: center;
|
|
1819
|
+
flex-shrink: 0;
|
|
1820
|
+
opacity: 0.7;
|
|
1821
|
+
transition: opacity 150ms;
|
|
1822
|
+
min-width: auto !important;
|
|
1823
|
+
width: auto !important;
|
|
1824
|
+
height: auto !important;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
.kds-snackbar-close:hover {
|
|
1828
|
+
opacity: 1;
|
|
1829
|
+
background: rgba(255, 255, 255, 0.15) !important;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
.kds-snackbar-close i {
|
|
1833
|
+
font-size: 18px !important;
|
|
1834
|
+
color: var(--kds-color-primary-contrast) !important;
|
|
1776
1835
|
}
|
|
1777
1836
|
|
|
1778
1837
|
/* ========================================
|
|
@@ -2192,12 +2251,16 @@ body.dark {
|
|
|
2192
2251
|
Asegurar que el dropdown arrow sea visible
|
|
2193
2252
|
========================================== */
|
|
2194
2253
|
|
|
2195
|
-
/* Select:
|
|
2254
|
+
/* Select: reset nativo + arrow custom via SVG (iOS Safari ignora estilos con appearance:auto) */
|
|
2196
2255
|
.field select {
|
|
2197
|
-
|
|
2198
|
-
appearance:
|
|
2199
|
-
|
|
2200
|
-
-
|
|
2256
|
+
-webkit-appearance: none;
|
|
2257
|
+
-moz-appearance: none;
|
|
2258
|
+
appearance: none;
|
|
2259
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23333' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
|
|
2260
|
+
background-repeat: no-repeat;
|
|
2261
|
+
background-position: right var(--kds-spacing-1) center;
|
|
2262
|
+
background-size: 20px;
|
|
2263
|
+
padding-right: var(--kds-spacing-4) !important;
|
|
2201
2264
|
}
|
|
2202
2265
|
|
|
2203
2266
|
/* ==========================================
|
|
@@ -2745,7 +2808,8 @@ dialog.modal .field.border:focus-within {
|
|
|
2745
2808
|
padding: var(--kds-spacing-2);
|
|
2746
2809
|
}
|
|
2747
2810
|
|
|
2748
|
-
.snackbar
|
|
2811
|
+
.snackbar,
|
|
2812
|
+
.snackbar.active {
|
|
2749
2813
|
min-width: calc(100% - 32px);
|
|
2750
2814
|
left: 16px;
|
|
2751
2815
|
right: 16px;
|
|
@@ -4928,6 +4992,10 @@ dialog#surveyModal button.circle {
|
|
|
4928
4992
|
.kds-screen > .kds-secure-footer {
|
|
4929
4993
|
display: none;
|
|
4930
4994
|
}
|
|
4995
|
+
|
|
4996
|
+
.kds-screen > form {
|
|
4997
|
+
margin-block-start: 0 !important;
|
|
4998
|
+
}
|
|
4931
4999
|
}
|
|
4932
5000
|
|
|
4933
5001
|
.kds-secure-footer-lock {
|
|
@@ -6192,7 +6260,8 @@ button.kds-btn-success::after {
|
|
|
6192
6260
|
}
|
|
6193
6261
|
.kds-brand-inner svg,
|
|
6194
6262
|
.kds-brand-inner img {
|
|
6195
|
-
|
|
6263
|
+
width: calc(50px - 16px * var(--collapse-progress, 0));
|
|
6264
|
+
height: auto;
|
|
6196
6265
|
display: block;
|
|
6197
6266
|
}
|
|
6198
6267
|
|
|
@@ -923,16 +923,34 @@ const ui = _context.ui;
|
|
|
923
923
|
}
|
|
924
924
|
|
|
925
925
|
/**
|
|
926
|
-
*
|
|
926
|
+
* Dismiss and remove a snackbar with fade-out
|
|
927
|
+
*/
|
|
928
|
+
function dismissSnackbar(snackbar) {
|
|
929
|
+
snackbar.classList.remove('active');
|
|
930
|
+
setTimeout(function() { snackbar.remove(); }, 300);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* Initialize flash messages with auto-dismiss and close button
|
|
927
935
|
*/
|
|
928
936
|
function initFlashMessages() {
|
|
929
|
-
|
|
937
|
+
var snackbars = document.querySelectorAll('.snackbar[data-auto-dismiss="true"]');
|
|
930
938
|
|
|
931
939
|
snackbars.forEach(function(snackbar) {
|
|
940
|
+
// Give text span flex-grow so close button stays right
|
|
941
|
+
var span = snackbar.querySelector('span');
|
|
942
|
+
if (span) span.classList.add('max');
|
|
943
|
+
|
|
944
|
+
// Inject close button
|
|
945
|
+
var closeBtn = document.createElement('button');
|
|
946
|
+
closeBtn.className = 'kds-snackbar-close';
|
|
947
|
+
closeBtn.setAttribute('aria-label', 'Cerrar');
|
|
948
|
+
closeBtn.innerHTML = '<i class="material-symbols-outlined">close</i>';
|
|
949
|
+
closeBtn.onclick = function() { dismissSnackbar(snackbar); };
|
|
950
|
+
snackbar.appendChild(closeBtn);
|
|
951
|
+
|
|
932
952
|
// Auto-dismiss after 5 seconds
|
|
933
|
-
setTimeout(function() {
|
|
934
|
-
snackbar.classList.remove('active');
|
|
935
|
-
}, 5000);
|
|
953
|
+
setTimeout(function() { dismissSnackbar(snackbar); }, 5000);
|
|
936
954
|
});
|
|
937
955
|
}
|
|
938
956
|
|
|
@@ -1364,6 +1382,17 @@ const ui = _context.ui;
|
|
|
1364
1382
|
// Single DOM write per frame — set on screen (parent) so it cascades to sticky + siblings
|
|
1365
1383
|
currentScreen.style.setProperty('--collapse-progress', progress);
|
|
1366
1384
|
|
|
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) {
|
|
1388
|
+
currentSticky.querySelectorAll('[data-expand-toggle][aria-expanded="true"]').forEach(function(toggle) {
|
|
1389
|
+
toggle.setAttribute('aria-expanded', 'false');
|
|
1390
|
+
var panelId = toggle.getAttribute('aria-controls');
|
|
1391
|
+
var panel = panelId ? document.getElementById(panelId) : null;
|
|
1392
|
+
if (panel) panel.classList.remove('open');
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1367
1396
|
lastScrollY = scrollY;
|
|
1368
1397
|
});
|
|
1369
1398
|
}
|
|
@@ -1511,25 +1540,24 @@ const ui = _context.ui;
|
|
|
1511
1540
|
type = type || 'info';
|
|
1512
1541
|
duration = duration || 5000;
|
|
1513
1542
|
|
|
1514
|
-
|
|
1543
|
+
var snackbar = document.createElement('div');
|
|
1515
1544
|
snackbar.className = 'snackbar active ' + type;
|
|
1545
|
+
snackbar.setAttribute('data-auto-dismiss', 'true');
|
|
1546
|
+
snackbar.style.setProperty('--kds-snackbar-duration', duration + 'ms');
|
|
1516
1547
|
|
|
1517
|
-
|
|
1548
|
+
var icon = document.createElement('i');
|
|
1518
1549
|
icon.className = 'material-symbols-outlined';
|
|
1519
1550
|
icon.textContent = type === 'success' ? 'check_circle' : (type === 'error' ? 'error' : 'info');
|
|
1520
1551
|
|
|
1521
|
-
|
|
1552
|
+
var span = document.createElement('span');
|
|
1553
|
+
span.className = 'max';
|
|
1522
1554
|
span.textContent = message;
|
|
1523
1555
|
|
|
1524
|
-
|
|
1525
|
-
closeBtn.className = '
|
|
1556
|
+
var closeBtn = document.createElement('button');
|
|
1557
|
+
closeBtn.className = 'kds-snackbar-close';
|
|
1558
|
+
closeBtn.setAttribute('aria-label', 'Cerrar');
|
|
1526
1559
|
closeBtn.innerHTML = '<i class="material-symbols-outlined">close</i>';
|
|
1527
|
-
closeBtn.onclick = function() {
|
|
1528
|
-
snackbar.classList.remove('active');
|
|
1529
|
-
setTimeout(function() {
|
|
1530
|
-
snackbar.remove();
|
|
1531
|
-
}, 300);
|
|
1532
|
-
};
|
|
1560
|
+
closeBtn.onclick = function() { dismissSnackbar(snackbar); };
|
|
1533
1561
|
|
|
1534
1562
|
snackbar.appendChild(icon);
|
|
1535
1563
|
snackbar.appendChild(span);
|
|
@@ -1537,12 +1565,7 @@ const ui = _context.ui;
|
|
|
1537
1565
|
|
|
1538
1566
|
document.body.appendChild(snackbar);
|
|
1539
1567
|
|
|
1540
|
-
setTimeout(function() {
|
|
1541
|
-
snackbar.classList.remove('active');
|
|
1542
|
-
setTimeout(function() {
|
|
1543
|
-
snackbar.remove();
|
|
1544
|
-
}, 300);
|
|
1545
|
-
}, duration);
|
|
1568
|
+
setTimeout(function() { dismissSnackbar(snackbar); }, duration);
|
|
1546
1569
|
}
|
|
1547
1570
|
|
|
1548
1571
|
// Export utilities to window for backward compatibility
|