@juspay/svelte-ui-components 2.117.0 → 2.117.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.
@@ -283,7 +283,7 @@
283
283
  {#if typeof tabItem?.icon === 'string' && tabItem.icon.length > 0}
284
284
  <Img src={tabItem.icon} alt="" fallback="" classes="tabs-item-icon" />
285
285
  {/if}
286
- {label}
286
+ <span class="tabs-item-label" data-text={label}>{label}</span>
287
287
  {#if tabItem?.status && tabItem.status !== 'none'}
288
288
  <span class="tabs-item-status status-{tabItem.status}" aria-hidden="true"></span>
289
289
  {/if}
@@ -448,6 +448,28 @@
448
448
  flex-shrink: 0;
449
449
  }
450
450
 
451
+ /* Reserves the active-state (bolder) width of the label so selecting a tab
452
+ never reflows the tab bar: without this, .tabs-item.active's font-weight
453
+ jump makes the tab (and every tab after it) physically resize, which
454
+ visibly shifts sibling tabs and defeats the indicator's slide animation
455
+ with a jump. The ::after ghost renders data-text at the active weight
456
+ with height:0/visibility:hidden -- invisible, but its width still sets
457
+ the shrink-to-fit width of the inline-block label, so the box is already
458
+ as wide as the active state needs even while showing the lighter weight. */
459
+ .tabs-item-label {
460
+ position: relative;
461
+ display: inline-block;
462
+ }
463
+
464
+ .tabs-item-label::after {
465
+ content: attr(data-text);
466
+ display: block;
467
+ height: 0;
468
+ overflow: hidden;
469
+ visibility: hidden;
470
+ font-weight: var(--tabs-active-font-weight, 600);
471
+ }
472
+
451
473
  /* Trailing status dot for nav/menu tabs. margin-left:auto pushes it to the row's
452
474
  end (e.g. a settings menu); harmless on a normal tab bar where the item shrinks
453
475
  to content. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.117.0",
3
+ "version": "2.117.1",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",