@juspay/svelte-ui-components 1.9.0 → 1.11.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.
@@ -28,12 +28,12 @@ function handleButtonClick() {
28
28
  type={properties.type}
29
29
  >
30
30
  {#if properties.showLoader && properties.loaderType === 'Circular'}
31
- <Loader />
31
+ <div class="button-loader"><Loader /></div>
32
32
  {/if}
33
33
  {#if $$slots.icon}
34
- <slot name="icon" />
34
+ <div class="button-icon"><slot name="icon" /></div>
35
35
  {/if}
36
- {properties.text}
36
+ <div class="button-text">{properties.text}</div>
37
37
  </button>
38
38
  </div>
39
39
 
@@ -61,11 +61,23 @@ function handleButtonClick() {
61
61
  display: flex;
62
62
  justify-content: var(--button-justify-content, center);
63
63
  align-items: center;
64
- flex-direction: row;
64
+ flex-direction: var(--button-content-flex-direction, row);
65
65
  gap: var(--button-content-gap, 16px);
66
66
  visibility: var(--button-visibility, visible);
67
67
  }
68
68
 
69
+ .button-loader {
70
+ order: var(--button-loader-order, 1);
71
+ }
72
+
73
+ .button-icon {
74
+ order: var(--button-icon-order, 2);
75
+ }
76
+
77
+ .button-text {
78
+ order: var(--button-text-order, 3);
79
+ }
80
+
69
81
  button:hover {
70
82
  background: var(--button-hover-color, var(--button-color, #3a4550));
71
83
  color: var(--button-hover-text-color, var(--button-text-color, white));
@@ -133,6 +133,7 @@ $: {
133
133
  on:focusout={onFocusOut}
134
134
  on:input={onInput}
135
135
  on:paste={onPaste}
136
+ data-pw={properties.dataPw}
136
137
  class="
137
138
  {properties.actionInput ? 'action-input' : ''}
138
139
  "
@@ -21,5 +21,6 @@ export type InputProperties = {
21
21
  autoComplete: AutoCompleteType;
22
22
  name: string;
23
23
  textTransformers: TextTransformer[];
24
+ dataPw?: string;
24
25
  };
25
26
  export declare const defaultInputProperties: InputProperties;
@@ -69,7 +69,7 @@ function onFocusOut(event) {
69
69
  />
70
70
  </div>
71
71
  {#if properties.rightButtonProperties != null}
72
- <div class="button">
72
+ <div class="right-button">
73
73
  <Button properties={properties.rightButtonProperties} on:click={rightButtonClick} />
74
74
  </div>
75
75
  {/if}
@@ -119,12 +119,6 @@ function onFocusOut(event) {
119
119
  min-width: 0px;
120
120
  }
121
121
 
122
- .button {
123
- flex: 1;
124
- min-width: 0px;
125
- --button-height: 54px;
126
- }
127
-
128
122
  .bottom-button {
129
123
  padding: var(--input-bottom-btn-padding, 10px 0px);
130
124
  --cursor: var(--bottom-button-cursor);
@@ -182,5 +176,30 @@ function onFocusOut(event) {
182
176
  align-items: center;
183
177
  flex-direction: row;
184
178
  --button-content-gap: var(--left-button-content-gap);
179
+ --button-content-flex-direction: var(--left-button-content-flex-direction, row);
180
+ }
181
+
182
+ .right-button {
183
+ flex: var(--right-button-flex, 1);
184
+ display: flex;
185
+ justify-content: center;
186
+ align-items: center;
187
+ flex-direction: row;
188
+ min-width: var(--right-button-min-width, 0px);
189
+ --button-color: var(--right-button-color);
190
+ --button-text-color: var(--right-button-text-color);
191
+ --button-font-family: var(--right-button-font-family);
192
+ --button-font-weight: var(--right-button-font-weight);
193
+ --button-font-size: var(--right-button-font-size);
194
+ --button-height: var(--right-button-height, 54px);
195
+ --button-padding: var(--right-button-padding);
196
+ --button-border-radius: var(--right-button-border-radius);
197
+ --button-width: var(--right-button-width, 100%);
198
+ --cursor: var(--right-button-cursor);
199
+ --opacity: var(--right-button-opacity);
200
+ --button-border: var(--right-button-border);
201
+ --button-content-gap: var(--right-button-content-gap);
202
+ --button-visibility: var(--right-button-visibility, visible);
203
+ --button-content-flex-direction: var(--right-button-content-flex-direction, row);
185
204
  }
186
205
  </style>
@@ -11,7 +11,8 @@ export let properties = {
11
11
  selectedItemLabel: null,
12
12
  showSelectedItemInDropdown: false,
13
13
  selectMultipleItems: false,
14
- leftIcon: null
14
+ leftIcon: null,
15
+ showSelectedItem: true
15
16
  };
16
17
  const dropDownIcon = properties.dropDownIcon ?? "https://sdk.breeze.in/gallery/icons/down-arrow.svg";
17
18
  let applyButtonProps;
@@ -110,7 +111,7 @@ onDestroy(() => {
110
111
  });
111
112
  </script>
112
113
 
113
- {#if properties.label !== null}
114
+ {#if properties.label !== null && properties.label !== ''}
114
115
  <label class="label-container" for={properties.label}>
115
116
  {properties.label}
116
117
  </label>
@@ -135,17 +136,21 @@ onDestroy(() => {
135
136
  {#if properties.selectMultipleItems && Array.isArray(properties.selectedItemLabel) && Array.isArray(properties.selectedItem)}
136
137
  {#if properties.selectedItem.length === 0}
137
138
  {properties.placeholder}
138
- {:else if properties.selectedItemLabel?.length === 0 || properties.showSelectedItemInDropdown}
139
+ {:else if properties.selectedItemLabel?.length === 0 || (properties.showSelectedItemInDropdown && properties.showSelectedItem !== false)}
139
140
  {properties.selectedItem.join(', ')}
140
- {:else}
141
+ {:else if properties.showSelectedItem !== false}
141
142
  {properties.selectedItemLabel.join(', ')}
143
+ {:else}
144
+ {properties.placeholder}
142
145
  {/if}
143
146
  {:else if properties.selectedItem === ''}
144
147
  {properties.placeholder}
145
- {:else if properties.selectedItemLabel === null || properties.selectedItemLabel === ''}
148
+ {:else if properties.selectedItemLabel === null || (properties.selectedItemLabel === '' && properties.showSelectedItem !== false)}
146
149
  {properties.selectedItem}
147
- {:else}
150
+ {:else if properties.showSelectedItem !== false}
148
151
  {properties.selectedItemLabel}
152
+ {:else}
153
+ {properties.placeholder}
149
154
  {/if}
150
155
  </div>
151
156
  <div class="filler" />
@@ -226,8 +231,6 @@ onDestroy(() => {
226
231
  height: var(--dropdown-arrow-icon-height, 16px);
227
232
  width: var(--dropdown-arrow-icon-width, 16px);
228
233
  transition: transform 0.1s;
229
- position: absolute;
230
- right: 10px;
231
234
  }
232
235
 
233
236
  .active {
@@ -260,7 +263,8 @@ onDestroy(() => {
260
263
  white-space: var(--selected-item-white-space, nowrap);
261
264
  overflow: var(--selected-item-overflow, hidden);
262
265
  text-overflow: var(--selected-item-text-overflow, ellipsis);
263
- max-width: var(--selected-item-max-widhh, 100%);
266
+ max-width: var(--selected-item-max-width, 100%);
267
+ padding: var(--selected-item-padding, var(--item-padding, 8px 16px));
264
268
  }
265
269
 
266
270
  .selected-content {
@@ -329,20 +333,6 @@ onDestroy(() => {
329
333
  --button-width: var(--multipleSelect-btn-width, 100%);
330
334
  }
331
335
 
332
- .icon-container {
333
- width: var(--select-icon-container-width, fit-content);
334
- height: var(--select-icon-container-height, fit-content);
335
- border-radius: var(--select-icon-container-border-radius);
336
- opacity: var(--select-icon-container-opacity);
337
- background: var(--select-icon-container-background);
338
- display: flex;
339
- align-items: center;
340
- justify-content: center;
341
- margin: var(--select-icon-container-margin, 0px 8px 0px 0px);
342
- padding: var(--select-icon-container-padding);
343
- --image-height: var(--select-icon-height);
344
- --image-width: var(--select-icon-height);
345
- }
346
336
 
347
337
  .apply-btn-container {
348
338
  padding: var(--apply-btn-container-padding, 5px);
@@ -11,4 +11,5 @@ export type SelectProperties = {
11
11
  dropDownIcon?: string;
12
12
  leftIcon: ImgProps | null;
13
13
  showSingleSelectButton?: boolean | null;
14
+ showSelectedItem?: boolean;
14
15
  };
@@ -79,6 +79,13 @@ onDestroy(() => {
79
79
 
80
80
  <div class="toast-message">
81
81
  {properties.message}
82
+ {#if properties.subtext}
83
+ <div class="toast-subtext">{properties.subtext}</div>
84
+ {/if}
85
+
86
+ {#if $$slots.bottomContent}
87
+ <slot name="bottomContent" />
88
+ {/if}
82
89
  </div>
83
90
 
84
91
  {#if properties.rightIcon}
@@ -93,14 +100,18 @@ onDestroy(() => {
93
100
  .toast {
94
101
  padding: var(--toast-padding, 10px);
95
102
  font-size: var(--toast-font-size, 14px);
103
+ font-family: var(--toast-font-family);
104
+ font-weight: var(--toast-font-weight);
96
105
  height: var(--toast-height, auto);
97
106
  border-radius: var(--toast-border-radius, 0px);
107
+ border: var(--toast-border, none);
108
+ border-style: var(--toast-border-style);
98
109
  width: var(--toast-width, auto);
99
110
  align-items: var(--toast-align-items, center);
100
111
  margin: var(--toast-margin, 0px 10px 10px 10px);
101
112
  justify-content: var(--toast-justify-content, space-between);
102
113
  z-index: var(--toast-z-index, 1000);
103
- display: var(--taost-dispay, flex);
114
+ display: var(--toast-display, flex);
104
115
  position: var(--toast-position, absolute);
105
116
  top: var(--toast-top, 10px);
106
117
  left: var(--toast-left, 0);
@@ -115,7 +126,7 @@ onDestroy(() => {
115
126
  .toast-icon-wrapper {
116
127
  width: var(--toast-icon-wrapper-width, 20px);
117
128
  height: var(--toast-icon-wrapper-height, 20px);
118
- margin: var(--toast-icon-margin, 0 6px 0 0);
129
+ margin: var(--toast-icon-margin, 0px 6px 0px 0px);
119
130
  padding: var(--toast-icon-wrapper-padding, 1px);
120
131
  }
121
132
 
@@ -126,8 +137,16 @@ onDestroy(() => {
126
137
 
127
138
  .toast-message {
128
139
  display: var(--toast-message-display, flex);
129
- flex: var(--taost-message-flex, 1);
140
+ flex: var(--toast-message-flex, 1);
130
141
  padding: var(--toast-message-padding, 1px);
142
+ flex-direction: column;
143
+ }
144
+
145
+ .toast-subtext {
146
+ color: var(--toast-subtext-color, #c7c7c7);
147
+ font-size: var(--toast-subtext-font-size, 10px);
148
+ font-weight: var(--toast-subtext-font-weight, 400);
149
+ margin: var(--toast-subtext-margin, 10px 0px 0px 0px);
131
150
  }
132
151
 
133
152
  .close-button {
@@ -135,7 +154,7 @@ onDestroy(() => {
135
154
  height: var(--toast-close-button-height, 20px);
136
155
  cursor: var(--toast-close-button-cursor, pointer);
137
156
  gap: var(--toast-close-button-gap, 6px);
138
- margin: var(--toast-close-button-margin, 0 0 0 10px);
157
+ margin: var(--toast-close-button-margin, 0px 0px 0px 10px);
139
158
  display: var(--toast-close-button-display, flex);
140
159
  align-items: var(--toast-close-button-align-items, center);
141
160
  justify-content: var(--toast-close-button-justify-content, center);
@@ -145,20 +164,24 @@ onDestroy(() => {
145
164
  .success {
146
165
  color: var(--toast-success-text, #fff);
147
166
  background-color: var(--toast-background-color, #24aa5a);
167
+ --toast-border: var(--toast-success-border);
148
168
  }
149
169
 
150
170
  .info {
151
171
  color: var(--toast-info-text, #fff);
152
172
  background-color: var(--toast-background-color, #87ceeb);
173
+ --toast-border: var(--toast-info-border);
153
174
  }
154
175
 
155
176
  .warn {
156
177
  color: var(--toast-warn-text, #fff);
157
178
  background-color: var(--toast-background-color, #f3a42d);
179
+ --toast-border: var(--toast-warn-border);
158
180
  }
159
181
 
160
182
  .error {
161
183
  color: var(--toast-error-text, #fff);
162
184
  background-color: var(--toast-background-color, #f04438);
185
+ --toast-border: var(--toast-error-border);
163
186
  }
164
187
  </style>
@@ -10,7 +10,9 @@ declare const __propDef: {
10
10
  } & {
11
11
  [evt: string]: CustomEvent<any>;
12
12
  };
13
- slots: {};
13
+ slots: {
14
+ bottomContent: {};
15
+ };
14
16
  };
15
17
  export type ToastProps = typeof __propDef.props;
16
18
  export type ToastEvents = typeof __propDef.events;
@@ -4,6 +4,7 @@ export type ToastProperties = {
4
4
  duration: number;
5
5
  leftIcon?: string;
6
6
  message: string;
7
+ subtext?: string;
7
8
  rightIcon?: string;
8
9
  type?: ToastType;
9
10
  direction?: ToastDirection;
@@ -12,9 +12,9 @@ export let toggleText = "";
12
12
 
13
13
  <style>
14
14
  .toggle-container {
15
- display: flex;
15
+ display: var(--toggle-container-display, flex);
16
16
  align-items: center;
17
- gap: 8px;
17
+ gap: var(--toggle-containter-gap, 8px);
18
18
  }
19
19
 
20
20
  .toggle-text {
@@ -27,8 +27,8 @@ export let toggleText = "";
27
27
  .switch {
28
28
  position: relative;
29
29
  display: inline-block;
30
- width: 46px;
31
- height: 25px;
30
+ width: var(--toggle-switch-width, 46px);
31
+ height: var(--toggle-switch-height, 25px);
32
32
  }
33
33
 
34
34
  .switch .input-checkbox {
@@ -40,10 +40,10 @@ export let toggleText = "";
40
40
  .slider {
41
41
  position: absolute;
42
42
  cursor: pointer;
43
- top: 0;
44
- left: 0;
45
- right: 0;
46
- bottom: 0;
43
+ top: var(--toggle-slider-top, 0);
44
+ left: var(--toggle-slider-left, 0);
45
+ right: var(--toggle-slider-right, 0);
46
+ bottom: var(--toggle-slider-bottom, 0);
47
47
  background-color: var(--slider-unchecked-color, #ccc);
48
48
  -webkit-transition: 0.4s;
49
49
  transition: 0.4s;
@@ -52,12 +52,12 @@ export let toggleText = "";
52
52
  .slider:before {
53
53
  position: absolute;
54
54
  content: '';
55
- height: 23px;
56
- width: 23px;
57
- left: 2px;
58
- bottom: 1px;
59
- top: 1px;
60
- background-color: white;
55
+ height: var(--toggle-slider-before-height, 23px);
56
+ width: var(--toggle-slider-before-width, 23px);
57
+ left: var(--toggle-slider-before-left, 2px);
58
+ bottom: var(--toggle-slider-before-bottom, 1px);
59
+ top: var(--toggle-slider-before-top, 1px);
60
+ background-color: var(--toggle-slider-before-background-color, white);
61
61
  -webkit-transition: 0.4s;
62
62
  transition: 0.4s;
63
63
  }
@@ -77,10 +77,10 @@ export let toggleText = "";
77
77
  }
78
78
 
79
79
  .slider.round {
80
- border-radius: 23px;
80
+ border-radius: var(--slider-round-border-radius, 23px);
81
81
  }
82
82
 
83
83
  .slider.round:before {
84
- border-radius: 50%;
84
+ border-radius: var(--slider-round-before-border-radius, 50%);
85
85
  }
86
86
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",