@juspay/svelte-ui-components 1.5.0 → 1.6.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.
@@ -23,14 +23,14 @@
23
23
  position: var(--banner-position, sticky);
24
24
  top: var(--banner-top, 0px);
25
25
  display: var(--banner-display, flex);
26
- align-items: center;
26
+ align-items: var(--banner-align-items, center);
27
27
  background-color: var(--banner-bg-color, #637c9529);
28
28
  width: var(--banner-width, 100%);
29
29
  height: var(--banner-height, 37px);
30
30
  padding: var(--banner-padding, 10px 12px, 10px, 12px);
31
31
  gap: var(--banner-gap, 8px);
32
- justify-content: center;
33
- cursor: pointer;
32
+ justify-content: var(--banner-justify-content, center);
33
+ cursor: var(--banner-cursor, pointer);
34
34
  }
35
35
 
36
36
  .banner-image {
@@ -38,7 +38,7 @@
38
38
  width: var(--banner-img-width, 18px);
39
39
  height: var(--banner-img-height, 11.69px);
40
40
  margin-bottom: var(--banner-img-margin-bottom, 6px);
41
- align-items: center;
41
+ align-items: var(--banner-image-align-items, center);
42
42
  }
43
43
 
44
44
  .banner-text {
@@ -49,10 +49,10 @@
49
49
  font-size: var(--banner-font-size, 14px);
50
50
  line-height: var(--banner-line-height, 17.75px);
51
51
  font-weight: var(--banner-font-weight, 500);
52
- overflow: hidden;
53
- text-overflow: ellipsis;
54
- white-space: nowrap;
55
- align-items: center;
52
+ overflow: var(--banner-overflow, hidden);
53
+ text-overflow: var(--banner-text-overflow, ellipsis);
54
+ white-space: var(--banner-text-white-space, nowrap);
55
+ align-items: var(--banner-text-align-items, center);
56
56
  }
57
57
 
58
58
  .link-text {
@@ -0,0 +1,5 @@
1
+ export type ImgProps = {
2
+ src: string;
3
+ alt: string;
4
+ fallback: string | null;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -175,7 +175,7 @@ function handleTopSectionClick() {
175
175
  }
176
176
 
177
177
  .left-content {
178
- display: flex;
178
+ display: var(--list-item-left-content-display, flex);
179
179
  --image-height: var(--list-item-left-image-height, 24px);
180
180
  --image-width: var(--list-item-left-image-width, 24px);
181
181
  --image-padding: var(--list-item-left-image-padding, 0px);
@@ -218,7 +218,7 @@ function handleTopSectionClick() {
218
218
  }
219
219
 
220
220
  .right-content {
221
- display: flex;
221
+ display: var(--list-item-right-content-display, flex);
222
222
  }
223
223
 
224
224
  .bottom-section {
@@ -1,6 +1,8 @@
1
1
  <script>import { createEventDispatcher, onDestroy, onMount } from "svelte";
2
+ import Img from "../Img/Img.svelte";
2
3
  import Button from "../Button/Button.svelte";
3
4
  let selectedElementDiv = null;
5
+ export let dropDownIconAlt = "";
4
6
  export let properties = {
5
7
  placeholder: "",
6
8
  label: "",
@@ -8,8 +10,10 @@ export let properties = {
8
10
  selectedItem: "",
9
11
  selectedItemLabel: null,
10
12
  showSelectedItemInDropdown: false,
11
- selectMultipleItems: false
13
+ selectMultipleItems: false,
14
+ leftIcon: null
12
15
  };
16
+ const dropDownIcon = properties.dropDownIcon ?? "https://sdk.breeze.in/gallery/icons/down-arrow.svg";
13
17
  const applyButtonProps = {
14
18
  text: "Apply",
15
19
  enable: true,
@@ -111,6 +115,11 @@ onDestroy(() => {
111
115
  role="button"
112
116
  tabindex="0"
113
117
  >
118
+ {#if properties.leftIcon !== null}
119
+ <div class="icon-container">
120
+ <Img {...properties.leftIcon} />
121
+ </div>
122
+ {/if}
114
123
  {#if properties.selectMultipleItems && Array.isArray(properties.selectedItemLabel) && Array.isArray(properties.selectedItem)}
115
124
  {#if properties.selectedItem.length === 0}
116
125
  {properties.placeholder}
@@ -127,11 +136,13 @@ onDestroy(() => {
127
136
  {properties.selectedItemLabel}
128
137
  {/if}
129
138
  <div class="filler" />
130
- <img
131
- src="https://sdk.breeze.in/gallery/icons/right-arrow.svg"
132
- alt=""
133
- class="arrow {isSelectOpen ? 'active' : ''}"
134
- />
139
+ {#if !properties.hideDropDownIcon}
140
+ <img
141
+ src={dropDownIcon}
142
+ alt= {dropDownIconAlt}
143
+ class="arrow {isSelectOpen ? 'active' : ''}"
144
+ />
145
+ {/if}
135
146
  </div>
136
147
  <div
137
148
  class="non-selected-items"
@@ -173,7 +184,7 @@ onDestroy(() => {
173
184
  font-weight: var(--select-font-weight, 400);
174
185
  width: var(--select-width, 100%);
175
186
  min-width: var(--select-min-width);
176
- box-shadow: 0px 1px 8px #2f537733;
187
+ box-shadow: var(--select-box-shadow, 0px 1px 8px #2f537733);
177
188
  -webkit-appearance: none !important; /* For Safari MWeb */
178
189
  outline: none;
179
190
  cursor: pointer;
@@ -187,15 +198,18 @@ onDestroy(() => {
187
198
  --button-border-radius: 2px;
188
199
  }
189
200
 
201
+ .select:hover {
202
+ background-color: var(--select-hover-bgcolor, #ffffff);
203
+ }
204
+
190
205
  .arrow {
191
- height: 16px;
192
- width: 16px;
193
- transform: rotate(-0.25turn);
206
+ height: var(--dropdown-arrow-icon-height, 16px);
207
+ width: var(--dropdown-arrow-icon-width, 16px);
194
208
  transition: transform 0.1s;
195
209
  }
196
210
 
197
211
  .active {
198
- transform: rotate(0.25turn);
212
+ transform: rotate(0.5turn);
199
213
  }
200
214
 
201
215
  .item {
@@ -227,15 +241,17 @@ onDestroy(() => {
227
241
  .non-selected-items {
228
242
  display: var(--non-selected-display);
229
243
  background-color: var(--non-selected-item-bgcolor, #ffffff);
244
+ color: var(--non-selected-item-color);
230
245
  box-shadow: 0px 1px 8px #2f537733;
231
246
  width: var(--non-selected-width, fit-content);
232
247
  min-width: var(--non-selected-min-width, 100%);
233
248
  position: absolute;
234
- border-radius: 4px 4px 4px 4px;
235
- margin: 4px 0px 0px 0px;
249
+ border-radius: var(--non-selected-border-radius, 4px);
250
+ margin: var(--non-selected-margin, 4px 0px 0px 0px);
236
251
  z-index: 10;
237
252
  word-wrap: var(--non-selected-word-break, break-word);
238
253
  white-space: var(--non-selected-white-space);
254
+ font-weight: var(--non-select-font-weight, 500);
239
255
  }
240
256
 
241
257
  ::-webkit-scrollbar {
@@ -249,7 +265,7 @@ onDestroy(() => {
249
265
  }
250
266
 
251
267
  .item-selected::after {
252
- content: '✔';
268
+ content: var(--selected-option-icon, '✔');
253
269
  position: absolute;
254
270
  right: 7px;
255
271
  }
@@ -268,4 +284,19 @@ onDestroy(() => {
268
284
  white-space: var(--multipleSelect-btn-white-space, nowrap);
269
285
  padding: var(--multipleSelect-btn-padding, 2px);
270
286
  }
287
+
288
+ .icon-container {
289
+ width: var(--select-icon-container-width, fit-content);
290
+ height: var(--select-icon-container-height, fit-content);
291
+ border-radius: var(--select-icon-container-border-radius);
292
+ opacity: var(--select-icon-container-opacity);
293
+ background: var(--select-icon-container-background);
294
+ display: flex;
295
+ align-items: center;
296
+ justify-content: center;
297
+ margin: var(--select-icon-container-margin, 0px 8px 0px 0px);
298
+ padding: var(--select-icon-container-padding);
299
+ --image-height: var(--select-icon-height);
300
+ --image-width: var(--select-icon-height);
301
+ }
271
302
  </style>
@@ -2,6 +2,7 @@ import { SvelteComponent } from "svelte";
2
2
  import type { SelectProperties } from './properties';
3
3
  declare const __propDef: {
4
4
  props: {
5
+ dropDownIconAlt?: string | undefined;
5
6
  properties?: SelectProperties | undefined;
6
7
  };
7
8
  events: {
@@ -1,3 +1,4 @@
1
+ import type { ImgProps } from "../Img/properties";
1
2
  export type SelectProperties = {
2
3
  placeholder: string;
3
4
  label: string;
@@ -6,4 +7,7 @@ export type SelectProperties = {
6
7
  selectedItemLabel: string | string[] | null;
7
8
  showSelectedItemInDropdown: boolean;
8
9
  selectMultipleItems: boolean;
10
+ hideDropDownIcon?: boolean;
11
+ dropDownIcon?: string;
12
+ leftIcon: ImgProps | null;
9
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",
@@ -54,7 +54,7 @@
54
54
  "svelte-check": "^3.6.0",
55
55
  "tslib": "^2.6.2",
56
56
  "typescript": "^5.2.2",
57
- "vite": "^4.5.2",
57
+ "vite": "^4.5.3",
58
58
  "vitest": "^0.34.6",
59
59
  "type-decoder": "^1.2.0"
60
60
  },