@juspay/svelte-ui-components 2.114.0 → 2.115.0

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.
@@ -198,6 +198,10 @@
198
198
  font-weight: var(--button-font-weight, 500);
199
199
  font-size: var(--button-font-size, var(--_btn-font-size, 14px));
200
200
  background-color: var(--button-color, var(--_btn-color, #3a4550));
201
+ /* Image layer, deliberately not the `background` shorthand — the shorthand
202
+ would reset a consumer's own background-image/position/size layers
203
+ whenever the hook is unset. Gradients go here; solids stay on --button-color. */
204
+ background-image: var(--button-background, none);
201
205
  color: var(--button-text-color, var(--_btn-text-color, white));
202
206
  height: var(--button-height, fit-content);
203
207
  padding: var(--button-padding, var(--_btn-padding, 16px));
@@ -216,6 +220,7 @@
216
220
  gap: var(--button-content-gap, 16px);
217
221
  visibility: var(--button-visibility, visible);
218
222
  box-shadow: var(--button-box-shadow, none);
223
+ transition: var(--button-transition, none);
219
224
 
220
225
  /* A button label should never soft-wrap onto a second line as the label text
221
226
  changes (e.g. "Select" -> "Select (1)") — that jitters the layout around it.
@@ -232,7 +237,10 @@
232
237
  font-weight: var(--disabled-font-weight);
233
238
  /* Preserve the variant border when disabled so secondary (bordered) stays distinct from ghost. */
234
239
  border: var(--disabled-border, var(--button-border, var(--_btn-border, none)));
235
- background: var(--disabled-background-color, var(--button-color, var(--_btn-color, #3a4550)));
240
+ background: var(
241
+ --disabled-background-color,
242
+ var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))
243
+ );
236
244
  box-shadow: var(
237
245
  --button-disabled-box-shadow,
238
246
  var(--disabled-box-shadow, var(--button-box-shadow, none))
@@ -262,7 +270,10 @@
262
270
  .button-el:hover:not(.disabled) {
263
271
  background: var(
264
272
  --button-hover-color,
265
- var(--_btn-hover-color, var(--button-color, var(--_btn-color, #3a4550)))
273
+ var(
274
+ --_btn-hover-color,
275
+ var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))
276
+ )
266
277
  );
267
278
  color: var(
268
279
  --button-hover-text-color,
@@ -278,7 +289,10 @@
278
289
 
279
290
  .button-el:active:not(.disabled) {
280
291
  transform: var(--button-active-transform);
281
- background: var(--button-active-background, var(--button-color, var(--_btn-color, #3a4550)));
292
+ background: var(
293
+ --button-active-background,
294
+ var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))
295
+ );
282
296
  box-shadow: var(--button-active-box-shadow, var(--button-box-shadow, none));
283
297
  }
284
298
 
@@ -158,25 +158,35 @@
158
158
  {#if (typeof header?.leftImage === 'string' && header.leftImage.length > 0) || (typeof header?.text === 'string' && header.text.length > 0) || (typeof header?.rightImage === 'string' && header.rightImage.length > 0)}
159
159
  <div class="header">
160
160
  {#if typeof header.leftImage === 'string' && header.leftImage.length > 0}
161
- <div
162
- onclick={handleLeftImageClick}
163
- onkeydown={handleLeftImageKeyDown}
164
- role="button"
165
- tabindex="0"
166
- aria-label={leftImageAriaLabel ?? null}
167
- data-pw={leftImageTestId}
168
- testID={leftImageTestId}
169
- >
161
+ {@const leftImageSrc = header.leftImage}
162
+ {#snippet leftImage()}
170
163
  <!-- Inline SVGs so currentColor icons inherit the header text
171
164
  colour; non-SVG URLs fall back to a plain <img>. -->
172
- <Img
173
- inlineSvg
174
- src={header.leftImage}
175
- alt=""
176
- fallback=""
177
- classes="header-left-img"
178
- />
179
- </div>
165
+ <Img inlineSvg src={leftImageSrc} alt="" fallback="" classes="header-left-img" />
166
+ {/snippet}
167
+ <!-- The left image is only a control when a click handler is actually supplied.
168
+ Consumers pass a decorative brand/source logo here far more often than a back
169
+ button, and announcing those as a focusable "button" that does nothing when
170
+ activated is worse for assistive tech than leaving them unannounced. The two
171
+ branches are written out rather than computed so the role/tabindex pairing
172
+ stays statically checkable. -->
173
+ {#if typeof onheaderLeftImageClick === 'function'}
174
+ <div
175
+ onclick={handleLeftImageClick}
176
+ onkeydown={handleLeftImageKeyDown}
177
+ role="button"
178
+ tabindex="0"
179
+ aria-label={leftImageAriaLabel ?? null}
180
+ data-pw={leftImageTestId}
181
+ testID={leftImageTestId}
182
+ >
183
+ {@render leftImage()}
184
+ </div>
185
+ {:else}
186
+ <div data-pw={leftImageTestId} testID={leftImageTestId}>
187
+ {@render leftImage()}
188
+ </div>
189
+ {/if}
180
190
  {/if}
181
191
  {#if typeof header.text === 'string' && header.text.length > 0}
182
192
  <div class="header-text" data-pw={header.testId} testID={header.testId}>
@@ -177,6 +177,7 @@
177
177
  top: var(--toast-top, 10px);
178
178
  left: var(--toast-left, 0);
179
179
  right: var(--toast-right, 0);
180
+ bottom: var(--toast-bottom, auto);
180
181
  background-color: var(--toast-background-color, #87ceeb);
181
182
  opacity: var(--toast-opacity, 1);
182
183
  box-sizing: var(--toast-box-sizing);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.114.0",
3
+ "version": "2.115.0",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",