@juspay/svelte-ui-components 2.120.3 → 2.122.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.
@@ -5,6 +5,8 @@
5
5
  children,
6
6
  title,
7
7
  description,
8
+ titleSnippet,
9
+ descriptionSnippet,
8
10
  classes,
9
11
  testId,
10
12
  onclick,
@@ -64,13 +66,17 @@
64
66
  onclick={onclick ?? null}
65
67
  onkeydown={!isAnchor && isInteractive ? handleKeydown : null}
66
68
  >
67
- {#if (typeof title === 'string' && title.length > 0) || typeof headerRight === 'function'}
69
+ {#if (typeof title === 'string' && title.length > 0) || typeof titleSnippet === 'function' || typeof headerRight === 'function'}
68
70
  <div class="card-header" class:card-header-split={typeof headerRight === 'function'}>
69
71
  <div class="card-header-main">
70
- {#if typeof title === 'string' && title.length > 0}
72
+ {#if typeof titleSnippet === 'function'}
73
+ <div class="card-title">{@render titleSnippet()}</div>
74
+ {:else if typeof title === 'string' && title.length > 0}
71
75
  <div class="card-title">{title}</div>
72
76
  {/if}
73
- {#if typeof description === 'string' && description.length > 0}
77
+ {#if typeof descriptionSnippet === 'function'}
78
+ <div class="card-description">{@render descriptionSnippet()}</div>
79
+ {:else if typeof description === 'string' && description.length > 0}
74
80
  <div class="card-description">{description}</div>
75
81
  {/if}
76
82
  </div>
@@ -8,6 +8,22 @@ export type OptionalCardProperties = {
8
8
  children?: Snippet;
9
9
  title?: string;
10
10
  description?: string;
11
+ /**
12
+ * Optional snippet rendered in place of the `title` string, inside the same
13
+ * `.card-title` container. When provided, `title` is not rendered — the snippet
14
+ * takes priority — and the header row is shown even if `title` is omitted
15
+ * entirely. Use this when the title needs markup a string prop cannot carry:
16
+ * rich text, an inline icon, or a test hook such as `data-pw` /
17
+ * `use:testAttributes` that must sit on the title element itself.
18
+ */
19
+ titleSnippet?: Snippet;
20
+ /**
21
+ * Optional snippet rendered in place of the `description` string, inside the
22
+ * same `.card-description` container. When provided, `description` is not
23
+ * rendered. Like `titleSnippet`, this exists for descriptions that need markup
24
+ * or a test hook on the element itself.
25
+ */
26
+ descriptionSnippet?: Snippet;
11
27
  classes?: string;
12
28
  /** Renders as `data-pw` on the root element for Playwright test selection. */
13
29
  testId?: string;
@@ -416,6 +416,9 @@
416
416
  .command-menu-item-icon-img-wrapper {
417
417
  --image-width: var(--command-menu-item-icon-size, 20px);
418
418
  --image-height: var(--command-menu-item-icon-size, 20px);
419
+
420
+ /* Mirrors --command-menu-search-icon-color, which this component already had. */
421
+ color: var(--command-menu-item-icon-color, inherit);
419
422
  flex-shrink: 0;
420
423
  display: flex;
421
424
  align-items: center;
@@ -57,11 +57,17 @@
57
57
  .file-dropzone-trigger-icon-sm :global(.file-dropzone-trigger-icon-sm-img) {
58
58
  --image-width: var(--file-dropzone-trigger-icon-sm-size, 16px);
59
59
  --image-height: var(--file-dropzone-trigger-icon-sm-size, 16px);
60
+
61
+ color: var(--file-dropzone-trigger-icon-color, inherit);
60
62
  }
61
63
 
62
64
  .file-dropzone-trigger-icon :global(.file-dropzone-trigger-icon-img) {
63
65
  --image-width: var(--file-dropzone-trigger-icon-size, 24px);
64
66
  --image-height: var(--file-dropzone-trigger-icon-size, 24px);
67
+
68
+ /* Both sizes share one colour token deliberately: they are the same icon at two
69
+ scales, and splitting them would invite the two to drift apart. */
70
+ color: var(--file-dropzone-trigger-icon-color, inherit);
65
71
  }
66
72
 
67
73
  .file-dropzone-trigger-heading {
@@ -664,6 +664,13 @@
664
664
  --image-width: var(--select-left-icon-size, 16px);
665
665
  --image-height: var(--select-left-icon-size, 16px);
666
666
  --image-object-fit: contain;
667
+
668
+ /* The icon inlines, so a currentColor asset resolves against this. Defaults to
669
+ `inherit` — the trigger's text colour, which is what it already did — so this is
670
+ a hook, not a change. Without it a consumer cannot tint the icon independently
671
+ of the label, and an icon migrated to currentColor is forced to match its label
672
+ exactly, flattening any deliberate muted-icon/strong-label hierarchy. */
673
+ color: var(--select-left-icon-color, inherit);
667
674
  flex: none;
668
675
  }
669
676
 
@@ -785,6 +792,7 @@
785
792
  --image-height: var(--select-option-icon-size, 16px);
786
793
  --image-object-fit: contain;
787
794
 
795
+ color: var(--select-option-icon-color, inherit);
788
796
  vertical-align: middle;
789
797
  margin-right: var(--select-option-icon-gap, 8px);
790
798
  }
@@ -54,6 +54,7 @@
54
54
  }
55
55
 
56
56
  .status-image {
57
+ color: var(--status-icon-color, inherit);
57
58
  display: flex;
58
59
  margin-bottom: 25px;
59
60
  }
@@ -589,6 +589,8 @@
589
589
  .builtin-icon-label-icon :global(svg) {
590
590
  width: var(--table-cell-icon-size, 16px);
591
591
  height: var(--table-cell-icon-size, 16px);
592
+
593
+ color: var(--table-cell-icon-color, inherit);
592
594
  display: block;
593
595
  }
594
596
 
@@ -445,6 +445,7 @@
445
445
  --image-height: var(--tabs-item-icon-size, 16px);
446
446
  --image-object-fit: contain;
447
447
 
448
+ color: var(--tabs-item-icon-color, inherit);
448
449
  flex-shrink: 0;
449
450
  }
450
451
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.120.3",
3
+ "version": "2.122.0",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",