@khipu/design-system 0.1.0-alpha.55 → 0.1.0-alpha.56
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-04T19:11:26.827Z
|
|
15
15
|
*
|
|
16
16
|
* To regenerate:
|
|
17
17
|
* cd design-system && npm run tokens:generate
|
|
@@ -5234,6 +5234,11 @@ dialog#surveyModal button.circle {
|
|
|
5234
5234
|
font-weight: var(--kds-font-weight-semibold);
|
|
5235
5235
|
}
|
|
5236
5236
|
|
|
5237
|
+
/* Auto-managed tab panels: hidden attribute must win over any display rule */
|
|
5238
|
+
[data-kds-tab-panel][hidden] {
|
|
5239
|
+
display: none;
|
|
5240
|
+
}
|
|
5241
|
+
|
|
5237
5242
|
|
|
5238
5243
|
/* ========================================
|
|
5239
5244
|
PAYMENT FLOW — DOMAIN COMPONENTS
|
|
@@ -5698,6 +5703,7 @@ button.kds-btn-success::after {
|
|
|
5698
5703
|
margin-top: var(--kds-spacing-1);
|
|
5699
5704
|
}
|
|
5700
5705
|
|
|
5706
|
+
|
|
5701
5707
|
/* -- Field group spacing -- */
|
|
5702
5708
|
.kds-field-group {
|
|
5703
5709
|
margin-top: var(--kds-spacing-1-75);
|
|
@@ -1136,13 +1136,14 @@ const ui = _context.ui;
|
|
|
1136
1136
|
* Initialize segmented tabs
|
|
1137
1137
|
* Delegated click on .kds-segmented-tabs button toggles .active and aria-selected
|
|
1138
1138
|
* Sets --_active-idx and --_tab-count CSS custom properties for sliding pill animation
|
|
1139
|
+
* Auto-manages tab panels via data-kds-tab-panel attributes on sibling elements
|
|
1139
1140
|
* Dispatches kds:tab:change with { index, button }
|
|
1140
1141
|
* @param {Element} root - Root element to scope listeners (default: document)
|
|
1141
1142
|
*/
|
|
1142
1143
|
function initSegmentedTabs(root) {
|
|
1143
1144
|
root = root || document;
|
|
1144
1145
|
|
|
1145
|
-
/* Set initial CSS vars on all segmented-tab containers */
|
|
1146
|
+
/* Set initial CSS vars and panel visibility on all segmented-tab containers */
|
|
1146
1147
|
root.querySelectorAll('.kds-segmented-tabs').forEach(function(tabs) {
|
|
1147
1148
|
var buttons = tabs.querySelectorAll('button');
|
|
1148
1149
|
tabs.style.setProperty('--_tab-count', buttons.length);
|
|
@@ -1151,6 +1152,15 @@ const ui = _context.ui;
|
|
|
1151
1152
|
if (b.classList.contains('active') || b.getAttribute('aria-selected') === 'true') activeIdx = i;
|
|
1152
1153
|
});
|
|
1153
1154
|
tabs.style.setProperty('--_active-idx', activeIdx);
|
|
1155
|
+
|
|
1156
|
+
/* Auto-bind panels: find sibling elements with data-kds-tab-panel */
|
|
1157
|
+
var parent = tabs.parentElement;
|
|
1158
|
+
if (parent) {
|
|
1159
|
+
var panels = parent.querySelectorAll('[data-kds-tab-panel]');
|
|
1160
|
+
panels.forEach(function(panel, i) {
|
|
1161
|
+
panel.hidden = i !== activeIdx;
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1154
1164
|
});
|
|
1155
1165
|
|
|
1156
1166
|
root.addEventListener('click', function(e) {
|
|
@@ -1171,6 +1181,14 @@ const ui = _context.ui;
|
|
|
1171
1181
|
var index = Array.prototype.indexOf.call(buttons, btn);
|
|
1172
1182
|
tabs.style.setProperty('--_active-idx', index);
|
|
1173
1183
|
|
|
1184
|
+
/* Auto-toggle panels */
|
|
1185
|
+
var parent = tabs.parentElement;
|
|
1186
|
+
if (parent) {
|
|
1187
|
+
parent.querySelectorAll('[data-kds-tab-panel]').forEach(function(panel, i) {
|
|
1188
|
+
panel.hidden = i !== index;
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1174
1192
|
tabs.dispatchEvent(new CustomEvent('kds:tab:change', {
|
|
1175
1193
|
bubbles: true,
|
|
1176
1194
|
detail: { index: index, button: btn }
|