@juspay/svelte-ui-components 2.120.2 → 2.120.3

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.
@@ -263,7 +263,7 @@
263
263
  </span>
264
264
  {:else if typeof item.icon === 'string' && item.icon.length > 0}
265
265
  <div class="command-menu-item-icon-img-wrapper">
266
- <Img src={item.icon} alt="" />
266
+ <Img inlineSvg src={item.icon} alt="" />
267
267
  </div>
268
268
  {/if}
269
269
  <span class="command-menu-item-label">{item.label}</span>
@@ -17,7 +17,7 @@
17
17
  {#if compact}
18
18
  <div class="file-dropzone-trigger-compact {classes ?? ''}">
19
19
  <div class="file-dropzone-trigger-icon-sm" aria-hidden="true">
20
- <Img src={icon} alt="" fallback="" classes="file-dropzone-trigger-icon-sm-img" />
20
+ <Img inlineSvg src={icon} alt="" fallback="" classes="file-dropzone-trigger-icon-sm-img" />
21
21
  </div>
22
22
  <span class="file-dropzone-trigger-heading" data-pw={testId} testID={testId}>{heading}</span>
23
23
  </div>
@@ -28,7 +28,7 @@
28
28
  {...typeof testId === 'string' ? { testId } : {}}
29
29
  >
30
30
  <div class="file-dropzone-trigger-icon" aria-hidden="true">
31
- <Img src={icon} alt="" fallback="" classes="file-dropzone-trigger-icon-img" />
31
+ <Img inlineSvg src={icon} alt="" fallback="" classes="file-dropzone-trigger-icon-img" />
32
32
  </div>
33
33
  <p class="file-dropzone-trigger-heading-wrap">
34
34
  <span class="file-dropzone-trigger-heading">{heading}</span>
@@ -406,8 +406,10 @@
406
406
  >
407
407
  {#if typeof leftIcon === 'string' && leftIcon.length > 0}
408
408
  <Img
409
+ inlineSvg
409
410
  src={leftIcon}
410
411
  alt=""
412
+ fallback=""
411
413
  classes="select-left-icon"
412
414
  {...typeof leftIconTestId === 'string' ? { testId: leftIconTestId } : {}}
413
415
  />
@@ -601,7 +603,13 @@
601
603
  {/if}
602
604
  {/if}
603
605
  {#if typeof row.item.icon === 'string' && row.item.icon.length > 0}
604
- <Img src={row.item.icon} alt="" fallback="" classes="select-option-icon" />
606
+ <Img
607
+ inlineSvg
608
+ src={row.item.icon}
609
+ alt=""
610
+ fallback=""
611
+ classes="select-option-icon"
612
+ />
605
613
  {/if}
606
614
  <span class="select-option-label">{row.item.label}</span>
607
615
  {#if showSelectedTick && !multiple && value.includes(row.item.id)}
@@ -9,6 +9,8 @@ export type SelectItem = {
9
9
  * Optional image src (URL or data URI) rendered at the left of the option row,
10
10
  * before the label — for icon pickers and any list whose options carry a glyph.
11
11
  * Size is controlled by the `--select-option-icon-size` CSS variable (default 16px).
12
+ * An SVG source is inlined, so an icon drawn with `currentColor` inherits the
13
+ * option row's text colour; anything else renders as a plain `<img>`.
12
14
  * Pair with the trigger's `leftIcon` (driven by the selected option's icon) to show
13
15
  * the current selection in the closed trigger.
14
16
  */
@@ -70,7 +72,12 @@ export type OptionalSelectProperties = {
70
72
  }]>;
71
73
  /** Visual hierarchy of the trigger. `'ghost'` renders a transparent, borderless trigger — useful when the Select is embedded in a toolbar or header where a full bordered input would be visually heavy. Defaults to `'default'`. */
72
74
  hierarchy?: SelectHierarchy;
73
- /** Optional image src (URL or data URI) rendered at the left of the trigger. Size is controlled by the `--select-left-icon-size` CSS variable (default 16px). */
75
+ /**
76
+ * Optional image src (URL or data URI) rendered at the left of the trigger.
77
+ * Size is controlled by the `--select-left-icon-size` CSS variable (default 16px).
78
+ * An SVG source is inlined, so an icon drawn with `currentColor` inherits the
79
+ * trigger's text colour; anything else renders as a plain `<img>`.
80
+ */
74
81
  leftIcon?: string;
75
82
  /** `data-pw` test id forwarded to the leading icon `<Img>` element. */
76
83
  leftIconTestId?: string;
@@ -25,7 +25,7 @@
25
25
  {#if icon}
26
26
  {@render icon()}
27
27
  {:else}
28
- <Img src={statusIcon} alt="status" />
28
+ <Img inlineSvg src={statusIcon} alt="status" />
29
29
  {/if}
30
30
  </div>
31
31
  <div class="status-text">{statusText}</div>
@@ -146,7 +146,7 @@
146
146
  data-pw={column.testId ? `${column.testId}-icon-${iconIndex}` : null}
147
147
  testID={column.testId ? `${column.testId}-icon-${iconIndex}` : null}
148
148
  >
149
- <Img src={String(iconSrc)} alt="" fallback="" />
149
+ <Img inlineSvg src={String(iconSrc)} alt="" fallback="" />
150
150
  </span>
151
151
  {/each}
152
152
  <span>{typeof data.label === 'string' ? data.label : '-'}</span>
@@ -281,7 +281,7 @@
281
281
  })}
282
282
  {:else}
283
283
  {#if typeof tabItem?.icon === 'string' && tabItem.icon.length > 0}
284
- <Img src={tabItem.icon} alt="" fallback="" classes="tabs-item-icon" />
284
+ <Img inlineSvg src={tabItem.icon} alt="" fallback="" classes="tabs-item-icon" />
285
285
  {/if}
286
286
  <span class="tabs-item-label" data-text={label}>{label}</span>
287
287
  {#if tabItem?.status && tabItem.status !== 'none'}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.120.2",
3
+ "version": "2.120.3",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",