@juspay/svelte-ui-components 1.31.0 → 1.33.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
  "
@@ -173,7 +173,7 @@ $: {
173
173
  <style>
174
174
  textarea,
175
175
  input {
176
- box-sizing: border-box;
176
+ box-sizing: var(--input-box-sizing, border-box);
177
177
  height: var(--input-height, fit-content);
178
178
  background-color: var(--input-background, white);
179
179
  font-size: var(--input-font-size, 16px) !important;
@@ -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;
@@ -150,11 +150,12 @@ export function focus() {
150
150
  font-weight: var(--input-label-msg-text-weight, 400);
151
151
  font-size: var(--input-label-msg-text-size, 12px);
152
152
  color: var(--input-label-msg-text-color, #637c95);
153
+ line-height: var(--input-label-msg-text-line-height);
153
154
  margin-bottom: 6px;
154
155
  }
155
156
 
156
157
  .invalid {
157
- outline: 1px solid var(--input-field-error-stroke, #e11900);
158
+ outline: var(--invalid-outline, 1px solid var(--input-field-error-stroke, #e11900));
158
159
  }
159
160
 
160
161
  .error-message {
@@ -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}
@@ -323,5 +317,6 @@ onDestroy(() => {
323
317
  .header-right-img {
324
318
  width: var(--header-right-image-width, 25px);
325
319
  height: var(--header-right-image-height, 25px);
320
+ padding: var(--header-right-image-padding);
326
321
  }
327
322
  </style>
@@ -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.31.0",
3
+ "version": "1.33.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",