@juspay/svelte-ui-components 2.111.0 → 2.111.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.
- package/dist/Accordion/Accordion.svelte +1 -0
- package/dist/Animations/ModalAnimation.svelte +4 -0
- package/dist/Animations/OverlayAnimation.svelte +5 -1
- package/dist/AreaChart/AreaChart.svelte +1 -0
- package/dist/Avatar/Avatar.svelte +8 -1
- package/dist/Badge/Badge.svelte +6 -1
- package/dist/Banner/Banner.svelte +1 -0
- package/dist/BarChart/BarChart.svelte +4 -0
- package/dist/Book/Book.svelte +1 -0
- package/dist/BrandLoader/BrandLoader.svelte +5 -1
- package/dist/Breadcrumb/Breadcrumb.svelte +1 -0
- package/dist/Browser/Browser.svelte +7 -1
- package/dist/Button/Button.svelte +1 -0
- package/dist/Calendar/Calendar.svelte +7 -1
- package/dist/Card/Card.svelte +1 -0
- package/dist/Carousel/Carousel.svelte +3 -0
- package/dist/CheckListItem/CheckListItem.svelte +1 -1
- package/dist/Checkbox/Checkbox.svelte +3 -0
- package/dist/Choicebox/Choicebox.svelte +1 -0
- package/dist/ColorPicker/ColorPicker.svelte +1 -0
- package/dist/Combobox/Combobox.svelte +10 -1
- package/dist/CommandMenu/CommandMenu.svelte +3 -0
- package/dist/ContextMenu/ContextMenu.svelte +2 -0
- package/dist/DateRangePicker/DateRangePicker.svelte +299 -17
- package/dist/DateRangePicker/properties.d.ts +7 -2
- package/dist/DateRangePicker/timeUtils.d.ts +6 -0
- package/dist/DateRangePicker/timeUtils.js +71 -0
- package/dist/DeltaIndicator/DeltaIndicator.svelte +1 -0
- package/dist/DualAxisBarChart/DualAxisBarChart.svelte +2 -0
- package/dist/EmptyState/EmptyState.svelte +5 -1
- package/dist/FileInput/FileInput.svelte +2 -0
- package/dist/FunnelChart/FunnelChart.svelte +2 -0
- package/dist/Gauge/Gauge.svelte +1 -0
- package/dist/GridItem/GridItem.svelte +1 -0
- package/dist/Icon/Icon.svelte +1 -0
- package/dist/IconStack/IconStack.svelte +5 -1
- package/dist/IframeViewer/IframeViewer.svelte +1 -1
- package/dist/Img/Img.svelte +9 -1
- package/dist/Input/Input.svelte +3 -0
- package/dist/InputButton/InputButton.svelte +5 -1
- package/dist/KeyValue/KeyValue.svelte +2 -1
- package/dist/KeyboardInput/KeyboardInput.svelte +1 -0
- package/dist/LineChart/LineChart.svelte +3 -0
- package/dist/ListItem/ListItem.svelte +5 -0
- package/dist/Loader/Loader.svelte +5 -1
- package/dist/LoadingDots/LoadingDots.svelte +2 -0
- package/dist/LottiePlayer/LottiePlayer.svelte +1 -0
- package/dist/Menu/Menu.svelte +2 -0
- package/dist/Modal/Modal.svelte +4 -1
- package/dist/Pagination/Pagination.svelte +4 -0
- package/dist/Phone/Phone.svelte +5 -1
- package/dist/PieChart/PieChart.svelte +1 -0
- package/dist/Pill/Pill.svelte +1 -0
- package/dist/Progress/Progress.svelte +5 -1
- package/dist/ProportionBar/ProportionBar.svelte +4 -0
- package/dist/Radio/Radio.svelte +1 -0
- package/dist/RelativeTime/RelativeTime.svelte +2 -0
- package/dist/SankeyChart/SankeyChart.svelte +1 -0
- package/dist/Scroller/Scroller.svelte +1 -0
- package/dist/Select/Select.svelte +18 -5
- package/dist/Sheet/Sheet.svelte +2 -0
- package/dist/Shimmer/Shimmer.svelte +5 -1
- package/dist/Slider/Slider.svelte +1 -0
- package/dist/Snippet/Snippet.svelte +5 -1
- package/dist/SplitButton/SplitButton.svelte +1 -0
- package/dist/SplitInput/SplitInput.svelte +1 -1
- package/dist/StatCard/StatCard.svelte +31 -4
- package/dist/Status/Status.svelte +5 -1
- package/dist/Stepper/Stepper.svelte +6 -1
- package/dist/Table/BuiltinCell.svelte +13 -2
- package/dist/Table/Table.svelte +24 -1
- package/dist/Tabs/Tabs.svelte +2 -1
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte +6 -1
- package/dist/Toast/Toast.svelte +4 -2
- package/dist/Toggle/Toggle.svelte +7 -1
- package/dist/Toolbar/Toolbar.svelte +7 -3
- package/dist/Tooltip/Tooltip.svelte +5 -4
- package/dist/_chart/Axis.svelte +8 -1
- package/dist/_chart/ChartContainer.svelte +1 -0
- package/dist/_chart/ChartTooltip.svelte +3 -1
- package/dist/_chart/Legend.svelte +1 -0
- package/dist/testing-attributes.d.ts +36 -0
- package/package.json +1 -1
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
in:fly|global={flyAnimationProperties}
|
|
46
46
|
out:fly|global={flyAnimationProperties}
|
|
47
47
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
48
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
48
49
|
>
|
|
49
50
|
{@render children?.()}
|
|
50
51
|
</div>
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
<div
|
|
53
54
|
in:fly|global={flyAnimationProperties}
|
|
54
55
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
56
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
55
57
|
>
|
|
56
58
|
{@render children?.()}
|
|
57
59
|
</div>
|
|
@@ -60,6 +62,7 @@
|
|
|
60
62
|
in:fade|global={fadeAnimationProperties}
|
|
61
63
|
out:fade|global={fadeAnimationProperties}
|
|
62
64
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
65
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
63
66
|
>
|
|
64
67
|
{@render children?.()}
|
|
65
68
|
</div>
|
|
@@ -67,6 +70,7 @@
|
|
|
67
70
|
<div
|
|
68
71
|
in:fade|global={fadeAnimationProperties}
|
|
69
72
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
73
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
70
74
|
>
|
|
71
75
|
{@render children?.()}
|
|
72
76
|
</div>
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
let { children, testId }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<div
|
|
13
|
+
<div
|
|
14
|
+
out:fade={{ duration: 350 }}
|
|
15
|
+
data-pw={typeof testId === 'string' ? testId : null}
|
|
16
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
17
|
+
>
|
|
14
18
|
{@render children?.()}
|
|
15
19
|
</div>
|
|
@@ -350,6 +350,7 @@
|
|
|
350
350
|
class="area-chart {classes ?? ''}"
|
|
351
351
|
bind:this={containerEl}
|
|
352
352
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
353
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
353
354
|
>
|
|
354
355
|
{#if isEmpty && typeof empty === 'function'}
|
|
355
356
|
<div class="chart-empty">{@render empty()}</div>
|
|
@@ -47,12 +47,19 @@
|
|
|
47
47
|
type="button"
|
|
48
48
|
aria-label={alt}
|
|
49
49
|
data-pw={testId}
|
|
50
|
+
testID={testId}
|
|
50
51
|
{onclick}
|
|
51
52
|
>
|
|
52
53
|
{@render content()}
|
|
53
54
|
</button>
|
|
54
55
|
{:else}
|
|
55
|
-
<div
|
|
56
|
+
<div
|
|
57
|
+
class="avatar avatar-{size} {classes ?? ''}"
|
|
58
|
+
role="img"
|
|
59
|
+
aria-label={alt}
|
|
60
|
+
data-pw={testId}
|
|
61
|
+
testID={testId}
|
|
62
|
+
>
|
|
56
63
|
{@render content()}
|
|
57
64
|
</div>
|
|
58
65
|
{/if}
|
package/dist/Badge/Badge.svelte
CHANGED
|
@@ -23,7 +23,11 @@
|
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
{#if showImage}
|
|
26
|
-
<div
|
|
26
|
+
<div
|
|
27
|
+
class="badge-icon {classes ?? ''}"
|
|
28
|
+
data-pw={typeof testId === 'string' ? testId : null}
|
|
29
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
30
|
+
>
|
|
27
31
|
<div class="badge-wrap">
|
|
28
32
|
<img class="icon-img" src={image} {alt} />
|
|
29
33
|
{#if showBadge}
|
|
@@ -38,6 +42,7 @@
|
|
|
38
42
|
role={standaloneRole}
|
|
39
43
|
aria-label={standaloneAriaLabel}
|
|
40
44
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
45
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
41
46
|
>
|
|
42
47
|
{isDot ? '' : (value ?? '')}
|
|
43
48
|
</div>
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
role={role !== null ? role : interactive ? 'button' : null}
|
|
54
54
|
tabindex={interactive ? 0 : null}
|
|
55
55
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
56
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
56
57
|
transition:slide={{ duration: 300 }}
|
|
57
58
|
>
|
|
58
59
|
{#if typeof icon === 'function'}
|
|
@@ -796,6 +796,7 @@
|
|
|
796
796
|
class="bar-chart {classes ?? ''}"
|
|
797
797
|
bind:this={containerEl}
|
|
798
798
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
799
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
799
800
|
>
|
|
800
801
|
{#if isEmpty && typeof empty === 'function'}
|
|
801
802
|
<div class="chart-empty">{@render empty()}</div>
|
|
@@ -951,6 +952,7 @@
|
|
|
951
952
|
d={stackedBarPath(bar)}
|
|
952
953
|
fill={barFillAttr(bar)}
|
|
953
954
|
data-pw={`bar-${i}`}
|
|
955
|
+
testID={`bar-${i}`}
|
|
954
956
|
tabindex="0"
|
|
955
957
|
role="button"
|
|
956
958
|
aria-label="{bar.dataPoint.label}: {getDisplayValue(bar)}"
|
|
@@ -975,6 +977,7 @@
|
|
|
975
977
|
d={valueEndBarPath(bar)}
|
|
976
978
|
fill={barFillAttr(bar)}
|
|
977
979
|
data-pw={`bar-${i}`}
|
|
980
|
+
testID={`bar-${i}`}
|
|
978
981
|
tabindex="0"
|
|
979
982
|
role="button"
|
|
980
983
|
aria-label="{bar.dataPoint.label}: {getDisplayValue(bar)}"
|
|
@@ -999,6 +1002,7 @@
|
|
|
999
1002
|
text-anchor={bl.p.textAnchor}
|
|
1000
1003
|
dominant-baseline={bl.p.dominantBaseline}
|
|
1001
1004
|
data-pw={`bar-value-${i}`}
|
|
1005
|
+
testID={`bar-value-${i}`}
|
|
1002
1006
|
style={bl.p.placement === 'inside'
|
|
1003
1007
|
? `fill: ${getContrastColor(bl.bar.color)}; stroke: ${contrastOutline(bl.bar.color)};`
|
|
1004
1008
|
: ''}>{bl.text}</text
|
package/dist/Book/Book.svelte
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
let { brandLogoURL, brandText, subText, classes, testId }: BrandLoaderProperties = $props();
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
<div
|
|
7
|
+
<div
|
|
8
|
+
class="background {classes ?? ''}"
|
|
9
|
+
data-pw={typeof testId === 'string' ? testId : null}
|
|
10
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
11
|
+
>
|
|
8
12
|
<div class="loader">
|
|
9
13
|
<img src={brandLogoURL} alt="" />
|
|
10
14
|
<div class="text">{brandText}</div>
|
|
@@ -17,7 +17,13 @@
|
|
|
17
17
|
}: BrowserProperties = $props();
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
class="browser {variant} {classes ?? ''}"
|
|
22
|
+
class:shadow
|
|
23
|
+
class:rounded
|
|
24
|
+
data-pw={testId}
|
|
25
|
+
testID={testId}
|
|
26
|
+
>
|
|
21
27
|
<div class="chrome">
|
|
22
28
|
<div class="titlebar">
|
|
23
29
|
<div class="dots">
|
|
@@ -301,7 +301,13 @@
|
|
|
301
301
|
}
|
|
302
302
|
</script>
|
|
303
303
|
|
|
304
|
-
<div
|
|
304
|
+
<div
|
|
305
|
+
class="calendar {classes ?? ''}"
|
|
306
|
+
data-pw={testId}
|
|
307
|
+
testID={testId}
|
|
308
|
+
role="application"
|
|
309
|
+
aria-label="Calendar"
|
|
310
|
+
>
|
|
305
311
|
<div class="header">
|
|
306
312
|
<div class="nav-button nav-prev">
|
|
307
313
|
<Button onclick={() => navigateMonth(-1)} ariaLabel="Previous month">
|
package/dist/Card/Card.svelte
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
class:card-has-scroll={scrollable}
|
|
46
46
|
style={styleAttr}
|
|
47
47
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
48
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
48
49
|
role={isInteractive ? 'button' : null}
|
|
49
50
|
tabindex={isInteractive ? 0 : null}
|
|
50
51
|
onclick={isInteractive ? onclick : null}
|
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
<div
|
|
145
145
|
class="carousel-container {classes ?? ''}"
|
|
146
146
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
147
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
147
148
|
>
|
|
148
149
|
{#if views.length > 0}
|
|
149
150
|
<div class="carousel" bind:this={carouselDiv}>
|
|
@@ -164,6 +165,7 @@
|
|
|
164
165
|
<div
|
|
165
166
|
class="dots-wrapper"
|
|
166
167
|
data-pw={typeof dotsWrapperTestId === 'string' ? dotsWrapperTestId : null}
|
|
168
|
+
testID={typeof dotsWrapperTestId === 'string' ? dotsWrapperTestId : null}
|
|
167
169
|
>
|
|
168
170
|
<!-- eslint-disable-next-line -->
|
|
169
171
|
{#each views as _, index}
|
|
@@ -173,6 +175,7 @@
|
|
|
173
175
|
{onkeydown}
|
|
174
176
|
role="none"
|
|
175
177
|
data-pw={typeof dotTestId === 'string' ? `${dotTestId}-${index + 1}` : null}
|
|
178
|
+
testID={typeof dotTestId === 'string' ? `${dotTestId}-${index + 1}` : null}
|
|
176
179
|
></div>
|
|
177
180
|
{/each}
|
|
178
181
|
</div>
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
handleClick();
|
|
50
50
|
}}
|
|
51
51
|
data-pw={testId}
|
|
52
|
+
testID={testId}
|
|
52
53
|
>
|
|
53
54
|
<input
|
|
54
55
|
type="checkbox"
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
aria-hidden="true"
|
|
60
61
|
onclick={(e: MouseEvent) => e.stopPropagation()}
|
|
61
62
|
data-pw={typeof testId === 'string' ? `${testId}-native-input` : null}
|
|
63
|
+
testID={typeof testId === 'string' ? `${testId}-native-input` : null}
|
|
62
64
|
/>
|
|
63
65
|
<span
|
|
64
66
|
class="box"
|
|
@@ -71,6 +73,7 @@
|
|
|
71
73
|
aria-controls={ariaControls ?? null}
|
|
72
74
|
onkeydown={handleKeyDown}
|
|
73
75
|
data-pw={typeof testId === 'string' ? `${testId}-box` : null}
|
|
76
|
+
testID={typeof testId === 'string' ? `${testId}-box` : null}
|
|
74
77
|
>
|
|
75
78
|
{#if checked && !indeterminate}
|
|
76
79
|
{#if typeof checkedIcon === 'function'}
|
|
@@ -345,7 +345,13 @@
|
|
|
345
345
|
});
|
|
346
346
|
</script>
|
|
347
347
|
|
|
348
|
-
<div
|
|
348
|
+
<div
|
|
349
|
+
class="combobox {classes ?? ''}"
|
|
350
|
+
class:disabled
|
|
351
|
+
bind:this={containerEl}
|
|
352
|
+
data-pw={testId}
|
|
353
|
+
testID={testId}
|
|
354
|
+
>
|
|
349
355
|
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->
|
|
350
356
|
<div class="combobox-input-wrapper" class:multiple onclick={handleControlClick}>
|
|
351
357
|
{#if typeof inputPrefix === 'function'}
|
|
@@ -423,6 +429,7 @@
|
|
|
423
429
|
}
|
|
424
430
|
}}
|
|
425
431
|
data-pw={typeof testId === 'string' ? `${testId}-option-${item.id}` : null}
|
|
432
|
+
testID={typeof testId === 'string' ? `${testId}-option-${item.id}` : null}
|
|
426
433
|
>
|
|
427
434
|
{#if typeof itemSnippet === 'function'}
|
|
428
435
|
{@render itemSnippet(item, isHighlighted)}
|
|
@@ -446,6 +453,7 @@
|
|
|
446
453
|
onclick={() => create()}
|
|
447
454
|
onmouseenter={() => (highlightedIndex = createNavIndex)}
|
|
448
455
|
data-pw={typeof testId === 'string' ? `${testId}-create` : null}
|
|
456
|
+
testID={typeof testId === 'string' ? `${testId}-create` : null}
|
|
449
457
|
>
|
|
450
458
|
<span class="combobox-create-icon" aria-hidden="true">
|
|
451
459
|
<svg viewBox="0 0 20 20" width="14" height="14" fill="none">
|
|
@@ -474,6 +482,7 @@
|
|
|
474
482
|
onclick={() => runAction()}
|
|
475
483
|
onmouseenter={() => (highlightedIndex = actionNavIndex)}
|
|
476
484
|
data-pw={typeof testId === 'string' ? `${testId}-action` : null}
|
|
485
|
+
testID={typeof testId === 'string' ? `${testId}-action` : null}
|
|
477
486
|
>
|
|
478
487
|
{#if typeof actionIcon === 'function'}
|
|
479
488
|
<span class="combobox-action-icon" aria-hidden="true">{@render actionIcon()}</span>
|
|
@@ -198,6 +198,7 @@
|
|
|
198
198
|
aria-label="Command menu"
|
|
199
199
|
tabindex="-1"
|
|
200
200
|
data-pw={typeof testId === 'string' ? testId : null}
|
|
201
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
201
202
|
>
|
|
202
203
|
<div class="command-menu-dialog">
|
|
203
204
|
<div class="command-menu-input-wrapper">
|
|
@@ -219,6 +220,7 @@
|
|
|
219
220
|
autocomplete="off"
|
|
220
221
|
spellcheck="false"
|
|
221
222
|
data-pw={typeof testId === 'string' ? `${testId}-input` : null}
|
|
223
|
+
testID={typeof testId === 'string' ? `${testId}-input` : null}
|
|
222
224
|
/>
|
|
223
225
|
</div>
|
|
224
226
|
|
|
@@ -253,6 +255,7 @@
|
|
|
253
255
|
aria-disabled={item.disabled}
|
|
254
256
|
tabindex="-1"
|
|
255
257
|
data-pw={typeof testId === 'string' ? `${testId}-item-${item.value}` : null}
|
|
258
|
+
testID={typeof testId === 'string' ? `${testId}-item-${item.value}` : null}
|
|
256
259
|
>
|
|
257
260
|
{#if typeof itemIcon === 'function'}
|
|
258
261
|
<span class="command-menu-item-icon">
|
|
@@ -164,6 +164,7 @@
|
|
|
164
164
|
oncontextmenu={handleContextMenu}
|
|
165
165
|
role="application"
|
|
166
166
|
data-pw={testId}
|
|
167
|
+
testID={testId}
|
|
167
168
|
>
|
|
168
169
|
{#if typeof children === 'function'}
|
|
169
170
|
{@render children()}
|
|
@@ -203,6 +204,7 @@
|
|
|
203
204
|
}
|
|
204
205
|
}}
|
|
205
206
|
data-pw={testId ? `${testId}-item-${item.value}` : null}
|
|
207
|
+
testID={testId ? `${testId}-item-${item.value}` : null}
|
|
206
208
|
>
|
|
207
209
|
{#if item.icon}
|
|
208
210
|
<img class="context-menu-item-icon" src={item.icon} alt="" />
|