@juspay/svelte-ui-components 2.116.1 → 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.
@@ -158,6 +158,21 @@
158
158
  --_btn-hover-border: none;
159
159
  }
160
160
 
161
+ /* Transparent chassis for gradient marketing CTAs — deliberately no background
162
+ of its own. Pair with a --button-background gradient (and usually a matching
163
+ --button-hover-color, since --_btn-hover-color sits before --button-background
164
+ in the hover fallback chain and would otherwise flatten the gradient to
165
+ transparent on hover). Geometry (padding/font-size) is intentionally left to
166
+ the size preset, not this variant. */
167
+ .variant-brand {
168
+ --_btn-color: transparent;
169
+ --_btn-text-color: #ffffff;
170
+ --_btn-border: none;
171
+ --_btn-hover-color: transparent;
172
+ --_btn-hover-text-color: #ffffff;
173
+ --_btn-hover-border: none;
174
+ }
175
+
161
176
  /* ---- Size defaults (md reproduces the legacy 16px padding / 14px font) ---- */
162
177
  .size-sm {
163
178
  --_btn-padding: 8px 12px;
@@ -1,7 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  export type LoaderType = 'Circular' | 'ProgressBar';
3
3
  /** Visual style of the button. Maps to a built-in palette via `--button-*` variables. */
4
- export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';
4
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive' | 'brand';
5
5
  /** Size preset controlling padding/height/font-size. */
6
6
  export type ButtonSize = 'sm' | 'md' | 'lg';
7
7
  export type ButtonProperties = OptionalButtonProperties & ButtonEventProperties;
@@ -9,7 +9,8 @@ export type OptionalButtonProperties = {
9
9
  text?: string;
10
10
  /**
11
11
  * Visual style: `primary` (default, filled), `secondary` (outlined), `ghost`
12
- * (transparent), `destructive` (danger). Each maps to the `--button-*` variables, so an
12
+ * (transparent), `destructive` (danger), `brand` (transparent chassis for gradient CTAs
13
+ * pair with a `--button-background` gradient). Each maps to the `--button-*` variables, so an
13
14
  * explicit `--button-color` / `classes` override always wins over the variant default.
14
15
  */
15
16
  variant?: ButtonVariant;
@@ -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.116.1",
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",