@khipu/design-system 0.1.0-alpha.29 → 0.1.0-alpha.30

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-03-26T19:18:15.487Z
14
+ * Generated: 2026-03-27T13:16:02.917Z
15
15
  *
16
16
  * To regenerate:
17
17
  * cd design-system && npm run tokens:generate
@@ -267,13 +267,115 @@
267
267
 
268
268
 
269
269
  /* Breakpoints */
270
- --kds-breakpoint-mobile: 768px;
271
- --kds-breakpoint-tablet: 1024px;
272
- --kds-breakpoint-desktop: 1025px;
270
+ --kds-breakpoint-mobile: 600px;
271
+ --kds-breakpoint-tablet: 840px;
272
+ --kds-breakpoint-desktop: 1280px;
273
+ --kds-breakpoint-legacyMobile: 768px;
274
+ --kds-breakpoint-legacyTablet: 1024px;
273
275
 
276
+ /* ==========================================================================
277
+ RESPONSIVE SPACING (MOBILE BASE)
278
+ ========================================================================== */
279
+
280
+
281
+ /* Container */
282
+ --kds-container-padding: 16px;
283
+
284
+ /* Cards */
285
+ --kds-card-padding: 16px;
286
+
287
+ /* Sections */
288
+ --kds-section-gap: 24px;
289
+
290
+ /* Elements */
291
+ --kds-element-gap: 12px;
292
+
293
+ /* Margins */
294
+ --kds-section-margin: 16px;
295
+
296
+ /* ==========================================================================
297
+ RESPONSIVE TYPOGRAPHY (MOBILE BASE)
298
+ ========================================================================== */
299
+
300
+
301
+ /* Headings */
302
+ --kds-font-size-h1: 1.75rem;
303
+ --kds-font-size-h2: 1.5rem;
304
+ --kds-font-size-h3: 1.25rem;
305
+ --kds-font-size-h4: 1.125rem;
306
+ --kds-font-size-h5: 1rem;
307
+ --kds-font-size-h6: 1rem;
308
+
309
+ /* Body */
310
+ --kds-font-size-body1: 0.875rem;
311
+ --kds-font-size-body2: 0.8125rem;
312
+
313
+ /* Components */
314
+ --kds-font-size-button: 0.875rem;
315
+ --kds-font-size-caption: 0.6875rem;
316
+
317
+ }
318
+
319
+ /* ============================================================================
320
+ RESPONSIVE TOKENS (Mobile-First)
321
+ ============================================================================ */
322
+
323
+ /* Tablet (600px+) - Spacing */
324
+ @media (min-width: 600px) {
325
+ :root {
326
+ --kds-container-padding: 24px;
327
+ --kds-card-padding: 20px;
328
+ --kds-section-gap: 32px;
329
+ --kds-element-gap: 16px;
330
+ --kds-section-margin: 24px;
331
+ }
332
+ }
333
+
334
+ /* Tablet (600px+) - Typography */
335
+ @media (min-width: 600px) {
336
+ :root {
337
+ --kds-font-size-h1: 2rem;
338
+ --kds-font-size-h2: 1.75rem;
339
+ --kds-font-size-h3: 1.5rem;
340
+ --kds-font-size-h4: 1.25rem;
341
+ --kds-font-size-h5: 1.125rem;
342
+ --kds-font-size-h6: 1rem;
343
+ --kds-font-size-body1: 0.9375rem;
344
+ --kds-font-size-body2: 0.875rem;
345
+ --kds-font-size-button: 0.9375rem;
346
+ --kds-font-size-caption: 0.75rem;
347
+ }
348
+ }
349
+
350
+ /* Desktop (840px+) - Spacing */
351
+ @media (min-width: 840px) {
352
+ :root {
353
+ --kds-container-padding: 32px;
354
+ --kds-card-padding: 24px;
355
+ --kds-section-gap: 48px;
356
+ --kds-element-gap: 24px;
357
+ --kds-section-margin: 32px;
358
+ }
359
+ }
360
+
361
+ /* Desktop (840px+) - Typography */
362
+ @media (min-width: 840px) {
363
+ :root {
364
+ --kds-font-size-h1: 2.5rem;
365
+ --kds-font-size-h2: 2rem;
366
+ --kds-font-size-h3: 1.75rem;
367
+ --kds-font-size-h4: 1.5rem;
368
+ --kds-font-size-h5: 1.25rem;
369
+ --kds-font-size-h6: 1.25rem;
370
+ --kds-font-size-body1: 1rem;
371
+ --kds-font-size-body2: 0.875rem;
372
+ --kds-font-size-button: 0.9375rem;
373
+ --kds-font-size-caption: 0.75rem;
374
+ }
274
375
  }
275
376
 
276
377
 
378
+
277
379
  /* Khipu BeerCSS Variable Mappings */
278
380
  /* Khipu Material Design 3 Brand Tokens for BeerCSS
279
381
  * Imports core tokens from css-variables.css (auto-generated from src/tokens/index.ts)
@@ -700,8 +802,7 @@ a.kds-btn > .kds-icon > i {
700
802
  .kds-card-elevated,
701
803
  .khipu-card-elevated,
702
804
  .kds-card-main {
703
- padding: 20px;
704
- margin: 16px;
805
+ padding: 12px;
705
806
  }
706
807
  }
707
808
 
@@ -3418,6 +3519,13 @@ dialog.modal::backdrop {
3418
3519
  overflow-y: auto;
3419
3520
  }
3420
3521
 
3522
+ @media (max-width: 768px) {
3523
+
3524
+ .kds-main-content {
3525
+ padding: var(--kds-spacing-4)
3526
+ }
3527
+ }
3528
+
3421
3529
  /* ============================================
3422
3530
  MOBILE RESPONSIVE SIDEBAR
3423
3531
  ============================================ */
@@ -3536,7 +3644,39 @@ dialog.modal::backdrop {
3536
3644
  }
3537
3645
 
3538
3646
  /* ============================================
3539
- DEMO PAGE STYLES
3647
+ LIST UTILITIES
3648
+ ============================================ */
3649
+
3650
+ /* Standard list with compact spacing */
3651
+ .kds-list {
3652
+ margin: 0;
3653
+ padding-left: var(--kds-spacing-2);
3654
+ list-style-position: outside;
3655
+ line-height: var(--kds-line-height-relaxed);
3656
+ }
3657
+
3658
+ .kds-list > li {
3659
+ margin-bottom: var(--kds-spacing-2);
3660
+ }
3661
+
3662
+ .kds-list > li:last-child {
3663
+ margin-bottom: 0;
3664
+ }
3665
+
3666
+ /* Code block for displaying code snippets */
3667
+ .kds-code-block {
3668
+ background: var(--kds-color-background-elevated);
3669
+ padding: var(--kds-spacing-4);
3670
+ border-radius: var(--kds-radius-md);
3671
+ overflow-x: auto;
3672
+ font-family: 'Courier New', monospace;
3673
+ font-size: var(--kds-font-size-sm);
3674
+ line-height: var(--kds-line-height-relaxed);
3675
+ color: var(--kds-color-text-primary);
3676
+ }
3677
+
3678
+ /* ============================================
3679
+ DEMO PAGE STYLES (DEPRECATED - Use kds-card-* instead)
3540
3680
  ============================================ */
3541
3681
 
3542
3682
  .demo-card {
@@ -656,156 +656,6 @@ function H(e){return e<0?-1:e===0?0:1}function nt(e,t,r){return(1-r)*e+r*t}funct
656
656
 
657
657
 
658
658
 
659
- /* Khipu Initialization */
660
- /**
661
- * Khipu Material Design 3 Initialization
662
- * Vanilla JavaScript initialization for BeerCSS components
663
- *
664
- * Provides initialization for:
665
- * - Mobile sidenav toggle
666
- * - Flash messages auto-dismiss
667
- * - Modal dialogs
668
- * - Programmatic snackbar API
669
- */
670
-
671
- (function() {
672
- 'use strict';
673
-
674
- // Wait for DOM to be ready
675
- if (document.readyState === 'loading') {
676
- document.addEventListener('DOMContentLoaded', initKhipuMaterial);
677
- } else {
678
- initKhipuMaterial();
679
- }
680
-
681
- /**
682
- * Main initialization function
683
- */
684
- function initKhipuMaterial() {
685
- console.log('Initializing Khipu Material Design components...');
686
-
687
- // Initialize sidenav toggle
688
- initSidenav();
689
-
690
- // Initialize flash messages auto-dismiss
691
- initFlashMessages();
692
-
693
- // Initialize modals
694
- initModals();
695
-
696
- console.log('Material Design initialization complete!');
697
- }
698
-
699
- /**
700
- * Initialize sidenav for mobile navigation
701
- */
702
- function initSidenav() {
703
- const menuToggle = document.getElementById('menu-toggle');
704
- const sidenav = document.getElementById('material-sidenav');
705
-
706
- if (menuToggle && sidenav) {
707
- menuToggle.addEventListener('click', function() {
708
- // Beer CSS uses 'active' class to show/hide drawer
709
- sidenav.classList.toggle('active');
710
- });
711
-
712
- // Close sidenav when clicking outside
713
- document.addEventListener('click', function(event) {
714
- if (sidenav.classList.contains('active')) {
715
- const isClickInside = sidenav.contains(event.target) || menuToggle.contains(event.target);
716
- if (!isClickInside) {
717
- sidenav.classList.remove('active');
718
- }
719
- }
720
- });
721
- }
722
- }
723
-
724
- /**
725
- * Initialize flash messages with auto-dismiss
726
- */
727
- function initFlashMessages() {
728
- const snackbars = document.querySelectorAll('.snackbar[data-auto-dismiss="true"]');
729
-
730
- snackbars.forEach(function(snackbar) {
731
- // Auto-dismiss after 5 seconds
732
- setTimeout(function() {
733
- snackbar.classList.remove('active');
734
- }, 5000);
735
- });
736
- }
737
-
738
- /**
739
- * Initialize modal dialogs
740
- */
741
- function initModals() {
742
- // Beer CSS modals are activated via onclick="ui('#modal-id')"
743
- // Additional custom initialization can go here if needed
744
- window.closeModal = function(modalId) {
745
- const modal = document.getElementById(modalId);
746
- if (modal) {
747
- modal.classList.remove('active');
748
- }
749
- };
750
- }
751
-
752
- /**
753
- * Utility: Show a snackbar programmatically
754
- * @param {string} message - The message to display
755
- * @param {string} type - The type: 'info', 'success', 'error'
756
- * @param {number} duration - Duration in milliseconds (default: 5000)
757
- */
758
- function showSnackbar(message, type, duration) {
759
- type = type || 'info';
760
- duration = duration || 5000;
761
-
762
- const snackbar = document.createElement('div');
763
- snackbar.className = 'snackbar active ' + type;
764
-
765
- const icon = document.createElement('i');
766
- icon.className = 'material-symbols-outlined';
767
- icon.textContent = type === 'success' ? 'check_circle' : (type === 'error' ? 'error' : 'info');
768
-
769
- const span = document.createElement('span');
770
- span.textContent = message;
771
-
772
- const closeBtn = document.createElement('button');
773
- closeBtn.className = 'transparent circle';
774
- closeBtn.innerHTML = '<i class="material-symbols-outlined">close</i>';
775
- closeBtn.onclick = function() {
776
- snackbar.classList.remove('active');
777
- setTimeout(function() {
778
- snackbar.remove();
779
- }, 300);
780
- };
781
-
782
- snackbar.appendChild(icon);
783
- snackbar.appendChild(span);
784
- snackbar.appendChild(closeBtn);
785
-
786
- document.body.appendChild(snackbar);
787
-
788
- setTimeout(function() {
789
- snackbar.classList.remove('active');
790
- setTimeout(function() {
791
- snackbar.remove();
792
- }, 300);
793
- }, duration);
794
- }
795
-
796
- // Export utilities to window for backward compatibility
797
- if (!window.Khipu) {
798
- window.Khipu = {};
799
- }
800
- window.Khipu.showSnackbar = showSnackbar;
801
- window.Khipu.closeModal = window.closeModal;
802
-
803
- // Also export showSnackbar to global scope for backward compatibility
804
- window.showSnackbar = showSnackbar;
805
-
806
- })();
807
-
808
-
809
659
  /* Khipu Sidebar Navigation */
810
660
  /**
811
661
  * Khipu Sidebar Navigation - Internal Interactions
@@ -1779,3 +1629,158 @@ function H(e){return e<0?-1:e===0?0:1}function nt(e,t,r){return(1-r)*e+r*t}funct
1779
1629
 
1780
1630
  })(window);
1781
1631
 
1632
+
1633
+ /* Khipu Initialization (must be last to initialize all components) */
1634
+ /**
1635
+ * Khipu Material Design 3 Initialization
1636
+ * Vanilla JavaScript initialization for BeerCSS components
1637
+ *
1638
+ * Provides initialization for:
1639
+ * - Mobile sidenav toggle
1640
+ * - Flash messages auto-dismiss
1641
+ * - Modal dialogs
1642
+ * - Programmatic snackbar API
1643
+ */
1644
+
1645
+ (function() {
1646
+ 'use strict';
1647
+
1648
+ // Wait for DOM to be ready
1649
+ if (document.readyState === 'loading') {
1650
+ document.addEventListener('DOMContentLoaded', initKhipuMaterial);
1651
+ } else {
1652
+ initKhipuMaterial();
1653
+ }
1654
+
1655
+ /**
1656
+ * Main initialization function
1657
+ */
1658
+ function initKhipuMaterial() {
1659
+ console.log('Initializing Khipu Material Design components...');
1660
+
1661
+ // Initialize new Khipu Sidebar (if available)
1662
+ if (typeof window.KhipuSidebar !== 'undefined') {
1663
+ window.KhipuSidebar.init();
1664
+ }
1665
+
1666
+ // Initialize sidenav toggle (legacy support)
1667
+ initSidenav();
1668
+
1669
+ // Initialize flash messages auto-dismiss
1670
+ initFlashMessages();
1671
+
1672
+ // Initialize modals
1673
+ initModals();
1674
+
1675
+ console.log('Material Design initialization complete!');
1676
+ }
1677
+
1678
+ /**
1679
+ * Initialize sidenav for mobile navigation
1680
+ */
1681
+ function initSidenav() {
1682
+ const menuToggle = document.getElementById('menu-toggle');
1683
+ const sidenav = document.getElementById('material-sidenav');
1684
+
1685
+ if (menuToggle && sidenav) {
1686
+ menuToggle.addEventListener('click', function() {
1687
+ // Beer CSS uses 'active' class to show/hide drawer
1688
+ sidenav.classList.toggle('active');
1689
+ });
1690
+
1691
+ // Close sidenav when clicking outside
1692
+ document.addEventListener('click', function(event) {
1693
+ if (sidenav.classList.contains('active')) {
1694
+ const isClickInside = sidenav.contains(event.target) || menuToggle.contains(event.target);
1695
+ if (!isClickInside) {
1696
+ sidenav.classList.remove('active');
1697
+ }
1698
+ }
1699
+ });
1700
+ }
1701
+ }
1702
+
1703
+ /**
1704
+ * Initialize flash messages with auto-dismiss
1705
+ */
1706
+ function initFlashMessages() {
1707
+ const snackbars = document.querySelectorAll('.snackbar[data-auto-dismiss="true"]');
1708
+
1709
+ snackbars.forEach(function(snackbar) {
1710
+ // Auto-dismiss after 5 seconds
1711
+ setTimeout(function() {
1712
+ snackbar.classList.remove('active');
1713
+ }, 5000);
1714
+ });
1715
+ }
1716
+
1717
+ /**
1718
+ * Initialize modal dialogs
1719
+ */
1720
+ function initModals() {
1721
+ // Beer CSS modals are activated via onclick="ui('#modal-id')"
1722
+ // Additional custom initialization can go here if needed
1723
+ window.closeModal = function(modalId) {
1724
+ const modal = document.getElementById(modalId);
1725
+ if (modal) {
1726
+ modal.classList.remove('active');
1727
+ }
1728
+ };
1729
+ }
1730
+
1731
+ /**
1732
+ * Utility: Show a snackbar programmatically
1733
+ * @param {string} message - The message to display
1734
+ * @param {string} type - The type: 'info', 'success', 'error'
1735
+ * @param {number} duration - Duration in milliseconds (default: 5000)
1736
+ */
1737
+ function showSnackbar(message, type, duration) {
1738
+ type = type || 'info';
1739
+ duration = duration || 5000;
1740
+
1741
+ const snackbar = document.createElement('div');
1742
+ snackbar.className = 'snackbar active ' + type;
1743
+
1744
+ const icon = document.createElement('i');
1745
+ icon.className = 'material-symbols-outlined';
1746
+ icon.textContent = type === 'success' ? 'check_circle' : (type === 'error' ? 'error' : 'info');
1747
+
1748
+ const span = document.createElement('span');
1749
+ span.textContent = message;
1750
+
1751
+ const closeBtn = document.createElement('button');
1752
+ closeBtn.className = 'transparent circle';
1753
+ closeBtn.innerHTML = '<i class="material-symbols-outlined">close</i>';
1754
+ closeBtn.onclick = function() {
1755
+ snackbar.classList.remove('active');
1756
+ setTimeout(function() {
1757
+ snackbar.remove();
1758
+ }, 300);
1759
+ };
1760
+
1761
+ snackbar.appendChild(icon);
1762
+ snackbar.appendChild(span);
1763
+ snackbar.appendChild(closeBtn);
1764
+
1765
+ document.body.appendChild(snackbar);
1766
+
1767
+ setTimeout(function() {
1768
+ snackbar.classList.remove('active');
1769
+ setTimeout(function() {
1770
+ snackbar.remove();
1771
+ }, 300);
1772
+ }, duration);
1773
+ }
1774
+
1775
+ // Export utilities to window for backward compatibility
1776
+ if (!window.Khipu) {
1777
+ window.Khipu = {};
1778
+ }
1779
+ window.Khipu.showSnackbar = showSnackbar;
1780
+ window.Khipu.closeModal = window.closeModal;
1781
+
1782
+ // Also export showSnackbar to global scope for backward compatibility
1783
+ window.showSnackbar = showSnackbar;
1784
+
1785
+ })();
1786
+