@juspay/svelte-ui-components 2.98.1 → 2.98.2
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.
|
@@ -227,7 +227,13 @@
|
|
|
227
227
|
return visible;
|
|
228
228
|
});
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
// The centre snippet (e.g. a currency total like "₹31.24k") is clipped by the
|
|
231
|
+
// foreignObject bounds, so the box must be wide enough for it. The inner hole
|
|
232
|
+
// has diameter 2*innerR; a square of side ~1.9*innerR keeps every edge inside
|
|
233
|
+
// the hole at the text's mid-line while giving the label the room a plain
|
|
234
|
+
// "innerR*1.3" (≈2/3 of the hole) did not — the old value cut the ₹/k off the
|
|
235
|
+
// sides and forced the caption onto two lines.
|
|
236
|
+
let centerBoxSize = $derived(innerR > 0 ? Math.max(0, innerR * 1.9) : 0);
|
|
231
237
|
|
|
232
238
|
// The foreignObject for the center snippet is positioned relative to the <g>
|
|
233
239
|
// origin (which is at cx, cy in SVG space). The box is always centred on
|
|
@@ -201,13 +201,15 @@
|
|
|
201
201
|
: null}
|
|
202
202
|
>
|
|
203
203
|
<div class="statcard-breakdown-label">{breakdownItem.label}</div>
|
|
204
|
-
<div class="statcard-breakdown-value">
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
204
|
+
<div class="statcard-breakdown-value-line">
|
|
205
|
+
<div class="statcard-breakdown-value">{breakdownItem.value}</div>
|
|
206
|
+
{#if typeof breakdownItem.change === 'number'}
|
|
207
|
+
<DeltaIndicator
|
|
208
|
+
value={breakdownItem.change}
|
|
209
|
+
invertColors={breakdownItem.invertChangeColors ?? false}
|
|
210
|
+
/>
|
|
211
|
+
{/if}
|
|
212
|
+
</div>
|
|
211
213
|
</div>
|
|
212
214
|
{/each}
|
|
213
215
|
</div>
|
|
@@ -488,6 +490,16 @@
|
|
|
488
490
|
gap: var(--statcard-breakdown-item-gap, 2px);
|
|
489
491
|
}
|
|
490
492
|
|
|
493
|
+
/* The metric value and its change indicator share one line (label sits above
|
|
494
|
+
as the caption). Previously the delta was a third stacked child, so it
|
|
495
|
+
rendered on its own line beneath the number. */
|
|
496
|
+
.statcard-breakdown-value-line {
|
|
497
|
+
display: flex;
|
|
498
|
+
align-items: baseline;
|
|
499
|
+
gap: var(--statcard-breakdown-value-gap, 6px);
|
|
500
|
+
flex-wrap: wrap;
|
|
501
|
+
}
|
|
502
|
+
|
|
491
503
|
.statcard-breakdown-label {
|
|
492
504
|
font-size: var(--statcard-breakdown-label-font-size, 11px);
|
|
493
505
|
font-weight: var(--statcard-breakdown-label-font-weight, 400);
|