@juspay/svelte-ui-components 1.32.0 → 1.34.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.
@@ -26,7 +26,7 @@ function handleButtonClick() {
26
26
  on:click={handleButtonClick}
27
27
  disabled={!(properties.enable && !properties.showLoader)}
28
28
  type={properties.type}
29
- data-pw={properties.dataPw}
29
+ data-pw={properties.testId}
30
30
  >
31
31
  {#if properties.showLoader && properties.loaderType === 'Circular'}
32
32
  <div class="button-loader"><Loader /></div>
@@ -5,6 +5,6 @@ export type ButtonProperties = {
5
5
  showLoader: boolean;
6
6
  loaderType: LoaderType | null;
7
7
  type: 'submit' | 'reset' | 'button';
8
- dataPw?: string;
8
+ testId?: string;
9
9
  };
10
10
  export declare const defaultButtonProperties: ButtonProperties;
@@ -147,7 +147,7 @@ $: {
147
147
  on:input={onInput}
148
148
  on:paste={onPaste}
149
149
  on:click={onClick}
150
- data-pw={properties.dataPw}
150
+ data-pw={properties.testId}
151
151
  class="
152
152
  {properties.actionInput ? 'action-input' : ''}
153
153
  "
@@ -21,6 +21,6 @@ export type InputProperties = {
21
21
  autoComplete: AutoCompleteType;
22
22
  name: string;
23
23
  textTransformers: TextTransformer[];
24
- dataPw?: string;
24
+ testId?: string;
25
25
  };
26
26
  export declare const defaultInputProperties: InputProperties;
@@ -93,18 +93,12 @@ onDestroy(() => {
93
93
  </div>
94
94
  {/if}
95
95
  {#if properties.header.text}
96
- <div class="header-text">
96
+ <div class="header-text" data-pw={properties.header.testId}>
97
97
  {properties.header.text}
98
98
  </div>
99
99
  {/if}
100
100
  {#if properties.header.rightImage}
101
- <div
102
- role="button"
103
- tabindex="0"
104
- on:click={handleRightImageClick}
105
- on:keydown
106
- data-pw={properties.rightImageTestId}
107
- >
101
+ <div role="button" tabindex="0" on:click={handleRightImageClick} on:keydown data-pw={properties.header.buttonTestId}>
108
102
  <img class="header-right-img" src={properties.header.rightImage} alt="" />
109
103
  </div>
110
104
  {/if}
@@ -178,6 +172,7 @@ onDestroy(() => {
178
172
  flex-direction: column;
179
173
  border-radius: var(--modal-border-radius, 0px);
180
174
  overflow: var(--modal-content-overflow, auto);
175
+ border-top: var(--modal-content-border-top);
181
176
  }
182
177
 
183
178
  .slot-content {
@@ -306,6 +301,9 @@ onDestroy(() => {
306
301
  align-items: center;
307
302
  flex: 1;
308
303
  font-size: var(--header-text-size, 16px);
304
+ font-weight: var(--modal-header-text-weight);
305
+ line-height: var(--modal-header-text-line-height);
306
+ letter-spacing: var(--modal-header-text-letter-spacing);
309
307
  }
310
308
 
311
309
  .header-left-img,
@@ -13,6 +13,8 @@ export type ModalProperties = {
13
13
  leftImage: string | null;
14
14
  rightImage: string | null;
15
15
  text: string | null;
16
+ testId?: string;
17
+ buttonTestId?: string;
16
18
  };
17
19
  footer?: {
18
20
  primaryButton?: ButtonProperties;
@@ -109,7 +109,7 @@ onDestroy(() => {
109
109
  </script>
110
110
 
111
111
  {#if properties.label !== null && properties.label !== ''}
112
- <label class="label-container" for={properties.label}>
112
+ <label class="label-container" for={properties.label} data-pw={properties.labelTestId}>
113
113
  {properties.label}
114
114
  </label>
115
115
  {/if}
@@ -123,6 +123,7 @@ onDestroy(() => {
123
123
  on:keydown
124
124
  role="button"
125
125
  tabindex="0"
126
+ data-pw={properties.testId}
126
127
  >
127
128
  {#if properties.leftIcon !== null}
128
129
  <div class="icon-container">
@@ -190,6 +191,7 @@ onDestroy(() => {
190
191
  class="item {isSelected(properties.selectedItem, item) ? ' item-selected' : ''}"
191
192
  role="button"
192
193
  tabindex="0"
194
+ data-pw={`${properties.itemTestId}-${item}`}
193
195
  >
194
196
  {#if properties.selectMultipleItems}
195
197
  <CheckListItem checked={isSelected(properties.selectedItem, item)} text="" />
@@ -13,4 +13,7 @@ export type SelectProperties = {
13
13
  showSingleSelectButton?: boolean | null;
14
14
  showSelectedItem?: boolean;
15
15
  showSelectedItemCount?: boolean;
16
+ testId?: string;
17
+ labelTestId?: string;
18
+ itemTestId?: string;
16
19
  };
@@ -77,10 +77,10 @@ onDestroy(() => {
77
77
  </div>
78
78
  {/if}
79
79
 
80
- <div class="toast-message">
80
+ <div class="toast-message" data-pw={properties.messageTestId}>
81
81
  {properties.message}
82
82
  {#if properties.subtext}
83
- <div class="toast-subtext">{properties.subtext}</div>
83
+ <div class="toast-subtext" data-pw={properties.subTextTestId}>{properties.subtext}</div>
84
84
  {/if}
85
85
 
86
86
  {#if $$slots.bottomContent}
@@ -89,7 +89,7 @@ onDestroy(() => {
89
89
  </div>
90
90
 
91
91
  {#if properties.rightIcon}
92
- <div class="close-button" tabindex="0" role="button" on:click={hideToast} on:keypress>
92
+ <div class="close-button" tabindex="0" role="button" on:click={hideToast} on:keypress data-pw={properties.closeIconTestId}>
93
93
  <img class="toast-icon" src={properties.rightIcon} alt="close-icon" />
94
94
  </div>
95
95
  {/if}
@@ -13,5 +13,9 @@ export type ToastProperties = {
13
13
  inAnimationDuration?: number;
14
14
  outAnimationOffset?: number;
15
15
  outAnimationDuration?: number;
16
+ testId?: string;
17
+ messageTestId?: string;
18
+ subTextTestId?: string;
19
+ closeIconTestId?: string;
16
20
  };
17
21
  export declare const defaultToastProperties: ToastProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "1.32.0",
3
+ "version": "1.34.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev --host",
6
6
  "build": "vite build && npm run package",
@@ -36,7 +36,7 @@
36
36
  "@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1",
37
37
  "@playwright/test": "^1.39.0",
38
38
  "@sveltejs/adapter-auto": "^2.1.1",
39
- "@sveltejs/kit": "^1.27.6",
39
+ "@sveltejs/kit": "^2.20.6",
40
40
  "@sveltejs/package": "^2.2.2",
41
41
  "@typescript-eslint/eslint-plugin": "^6.11.0",
42
42
  "@typescript-eslint/parser": "^6.11.0",