@juspay/svelte-ui-components 1.2.0 → 1.4.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.
- package/README.md +6 -7
- package/dist/Img/Img.svelte +33 -0
- package/dist/Img/Img.svelte.d.ts +18 -0
- package/dist/Input/Input.svelte +1 -0
- package/dist/ListItem/ListItem.svelte +37 -19
- package/dist/ListItem/properties.d.ts +1 -0
- package/dist/ListItem/properties.js +1 -0
- package/dist/Modal/Modal.svelte +8 -10
- package/dist/Toolbar/Toolbar.svelte +9 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -41,11 +41,11 @@ All of the components can be easily imported from the 'svelte-ui-components' pac
|
|
|
41
41
|
#### Example: Importing component from the package
|
|
42
42
|
|
|
43
43
|
```svelte
|
|
44
|
-
<script>
|
|
45
|
-
import { Button } from '@juspay/svelte-ui-components';
|
|
44
|
+
<script lang="ts">
|
|
45
|
+
import { Button, defaultButtonProperties } from '@juspay/svelte-ui-components';
|
|
46
46
|
</script>
|
|
47
47
|
|
|
48
|
-
<Button
|
|
48
|
+
<Button properties={{ ...defaultButtonProperties, text: 'Click' }} />
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### Customizing the components
|
|
@@ -65,7 +65,7 @@ There are two ways to customize the component.
|
|
|
65
65
|
|
|
66
66
|
#### Example: Customizing the component
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
```svelte
|
|
69
69
|
<script lang="ts">
|
|
70
70
|
import {
|
|
71
71
|
Button,
|
|
@@ -83,7 +83,6 @@ There are two ways to customize the component.
|
|
|
83
83
|
}
|
|
84
84
|
</script>
|
|
85
85
|
|
|
86
|
-
```svelte
|
|
87
86
|
<div class="form">
|
|
88
87
|
<Button properties={buttonProperties} on:click={handleSubmitClick} />
|
|
89
88
|
</div>
|
|
@@ -92,10 +91,10 @@ There are two ways to customize the component.
|
|
|
92
91
|
.form {
|
|
93
92
|
--button-color: black;
|
|
94
93
|
--button-text-color: white;
|
|
95
|
-
|
|
94
|
+
/* Other styling values */
|
|
96
95
|
}
|
|
97
96
|
</style>
|
|
98
|
-
|
|
97
|
+
```
|
|
99
98
|
|
|
100
99
|
### Contributing
|
|
101
100
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script>export let src;
|
|
2
|
+
export let alt;
|
|
3
|
+
export let fallback = null;
|
|
4
|
+
function handleFallback() {
|
|
5
|
+
if (fallback !== null) {
|
|
6
|
+
src = fallback;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{#if typeof src === 'string' && typeof alt === 'string'}
|
|
12
|
+
<img {src} {alt} on:error|once={handleFallback} />
|
|
13
|
+
{/if}
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
img {
|
|
17
|
+
object-fit: var(--image-object-fit);
|
|
18
|
+
height: var(--image-height, 24px);
|
|
19
|
+
width: var(--image-width, 24px);
|
|
20
|
+
padding: var(--image-padding, 0px);
|
|
21
|
+
border-radius: var(--image-border-radius, 0px);
|
|
22
|
+
margin: var(--image-margin, 0px);
|
|
23
|
+
filter: var(--image-filter, none);
|
|
24
|
+
background: var(--image-background);
|
|
25
|
+
border: var(--image-border);
|
|
26
|
+
transition: var(--image-transition);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
img:hover {
|
|
30
|
+
background: var(--image-hover-background, var(--image-background));
|
|
31
|
+
border: var(--image-hover-border, var(--image-border));
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
src: string;
|
|
5
|
+
alt: string;
|
|
6
|
+
fallback?: string | null | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type ImgProps = typeof __propDef.props;
|
|
14
|
+
export type ImgEvents = typeof __propDef.events;
|
|
15
|
+
export type ImgSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Img extends SvelteComponent<ImgProps, ImgEvents, ImgSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
package/dist/Input/Input.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import Accordion from "../Accordion/Accordion.svelte";
|
|
2
2
|
import Loader from "../Loader/Loader.svelte";
|
|
3
|
+
import Img from "../Img/Img.svelte";
|
|
3
4
|
import { defaultListItemProperties } from "./properties";
|
|
4
5
|
import { createEventDispatcher } from "svelte";
|
|
5
6
|
const dispatch = createEventDispatcher();
|
|
@@ -55,7 +56,11 @@ function handleTopSectionClick() {
|
|
|
55
56
|
role="button"
|
|
56
57
|
tabindex="0"
|
|
57
58
|
>
|
|
58
|
-
<
|
|
59
|
+
<Img
|
|
60
|
+
src={properties.leftImageUrl}
|
|
61
|
+
alt=""
|
|
62
|
+
fallback={properties.leftImageFallbackUrl}
|
|
63
|
+
/>
|
|
59
64
|
</div>
|
|
60
65
|
{/if}
|
|
61
66
|
{#if $$slots.leftContent}
|
|
@@ -171,12 +176,39 @@ function handleTopSectionClick() {
|
|
|
171
176
|
|
|
172
177
|
.left-content {
|
|
173
178
|
display: flex;
|
|
179
|
+
--image-height: var(--list-item-left-image-height, 24px);
|
|
180
|
+
--image-width: var(--list-item-left-image-width, 24px);
|
|
181
|
+
--image-padding: var(--list-item-left-image-padding, 0px);
|
|
182
|
+
--image-border-radius: var(--list-item-left-image-border-radius, 0px);
|
|
183
|
+
--image-margin: var(--list-item-left-image-margin, 0px);
|
|
184
|
+
--image-filter: var(--list-item-left-image-filter, none);
|
|
185
|
+
--image-background: var(--list-item-left-image-background);
|
|
186
|
+
--image-border: var(--list-item-left-image-border);
|
|
187
|
+
--image-transition: var(--list-item-transition);
|
|
188
|
+
--image-object-fit: var(--list-item-left-image-object-fit);
|
|
189
|
+
--image-hover-background: var(
|
|
190
|
+
--list-item-left-image-hover-background,
|
|
191
|
+
var(--list-item-left-image-background)
|
|
192
|
+
);
|
|
193
|
+
--image-hover-border: var(
|
|
194
|
+
--list-item-left-image-hover-border,
|
|
195
|
+
var(--list-item-left-image-border)
|
|
196
|
+
);
|
|
174
197
|
}
|
|
175
198
|
|
|
176
199
|
.center-text {
|
|
177
200
|
display: flex;
|
|
178
201
|
flex-direction: column;
|
|
202
|
+
justify-content: var(--list-item-center-text-justify-content, flex-start);
|
|
179
203
|
padding: var(--list-item-center-text-padding, 0px 20px);
|
|
204
|
+
color: var(--list-item-center-text-color, #2f3841);
|
|
205
|
+
font-size: var(--list-item-center-text-font-size, 12px);
|
|
206
|
+
font-weight: var(--list-item-center-text-font-weight, 300);
|
|
207
|
+
align-items: var(--list-item-center-text-vertical-align);
|
|
208
|
+
margin: var(--list-item-center-text-margin);
|
|
209
|
+
border: var(--list-item-center-text-border);
|
|
210
|
+
cursor: var(--list-item-center-text-cursor, pointer);
|
|
211
|
+
font-family: var(--list-item-center-text-font-family);
|
|
180
212
|
}
|
|
181
213
|
|
|
182
214
|
.center-content {
|
|
@@ -194,23 +226,6 @@ function handleTopSectionClick() {
|
|
|
194
226
|
margin-top: 0;
|
|
195
227
|
}
|
|
196
228
|
|
|
197
|
-
.left-img {
|
|
198
|
-
height: var(--list-item-left-image-height, 24px);
|
|
199
|
-
width: var(--list-item-left-image-width, 24px);
|
|
200
|
-
padding: var(--list-item-left-image-padding, 0px);
|
|
201
|
-
border-radius: var(--list-item-left-image-border-radius, 0px);
|
|
202
|
-
margin: var(--list-item-left-image-margin, 0px);
|
|
203
|
-
filter: var(--list-item-left-image-filter, none);
|
|
204
|
-
background: var(--list-item-left-image-background);
|
|
205
|
-
border: var(--list-item-left-image-border);
|
|
206
|
-
transition: var(--list-item-transition);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.left-img:hover {
|
|
210
|
-
background: var(--list-item-left-image-hover-background, var(--list-item-left-image-background));
|
|
211
|
-
border: var(--list-item-left-image-hover-border, var(--list-item-left-image-border));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
229
|
.right-img {
|
|
215
230
|
height: var(--list-item-right-image-height, 18px);
|
|
216
231
|
width: var(--list-item-right-image-width, 18px);
|
|
@@ -224,7 +239,10 @@ function handleTopSectionClick() {
|
|
|
224
239
|
}
|
|
225
240
|
|
|
226
241
|
.right-img:hover {
|
|
227
|
-
background: var(
|
|
242
|
+
background: var(
|
|
243
|
+
--list-item-right-image-hover-background,
|
|
244
|
+
var(--list-item-right-image-background)
|
|
245
|
+
);
|
|
228
246
|
border: var(--list-item-right-image-hover-border, var(--list-item-right-image-border));
|
|
229
247
|
}
|
|
230
248
|
|
package/dist/Modal/Modal.svelte
CHANGED
|
@@ -102,16 +102,13 @@ onDestroy(() => {
|
|
|
102
102
|
bottom: 0;
|
|
103
103
|
left: 0;
|
|
104
104
|
right: 0;
|
|
105
|
-
width: 100vw;
|
|
106
|
-
height: 100vh;
|
|
105
|
+
width: var(--modal-width, 100vw);
|
|
106
|
+
height: var(--modal-height, 100vh);
|
|
107
107
|
display: flex;
|
|
108
108
|
flex-direction: column;
|
|
109
109
|
z-index: var(--modal-z-index, 15);
|
|
110
110
|
-webkit-tap-highlight-color: transparent;
|
|
111
|
-
margin
|
|
112
|
-
margin-bottom: var(--margin-bottom, 0px);
|
|
113
|
-
margin-left: var(--margin-left, 0px);
|
|
114
|
-
margin-right: var(--margin-right, 0px);
|
|
111
|
+
margin: var(--modal-margin);
|
|
115
112
|
}
|
|
116
113
|
|
|
117
114
|
.overlay-active {
|
|
@@ -125,7 +122,7 @@ onDestroy(() => {
|
|
|
125
122
|
|
|
126
123
|
.modal-content {
|
|
127
124
|
pointer-events: auto;
|
|
128
|
-
background-color: var(--content-background-color, #ffffff);
|
|
125
|
+
background-color: var(--modal-content-background-color, #ffffff);
|
|
129
126
|
cursor: auto;
|
|
130
127
|
display: flex;
|
|
131
128
|
flex-direction: column;
|
|
@@ -175,14 +172,15 @@ onDestroy(() => {
|
|
|
175
172
|
.header {
|
|
176
173
|
display: flex;
|
|
177
174
|
background-color: var(--modal-header-background-color, #f6f7f9);
|
|
178
|
-
padding: 18px 20px;
|
|
175
|
+
padding: var(--modal-header-padding, 18px 20px);
|
|
176
|
+
border-radius: var(--modal-header-border-radius, 0px);
|
|
179
177
|
}
|
|
180
178
|
|
|
181
179
|
.header-text {
|
|
182
180
|
display: flex;
|
|
183
181
|
align-items: center;
|
|
184
182
|
flex: 1;
|
|
185
|
-
font-size: 16px;
|
|
183
|
+
font-size: var(--header-text-size, 16px);
|
|
186
184
|
}
|
|
187
185
|
|
|
188
186
|
.header-left-img,
|
|
@@ -192,7 +190,7 @@ onDestroy(() => {
|
|
|
192
190
|
}
|
|
193
191
|
|
|
194
192
|
.header-left-img {
|
|
195
|
-
margin
|
|
193
|
+
margin: var(--header-left-image-margin, 0px 18px 0px 0px);
|
|
196
194
|
width: var(--header-left-image-width, 25px);
|
|
197
195
|
height: var(--header-left-image-height, 25px);
|
|
198
196
|
}
|
|
@@ -74,10 +74,15 @@ function handleBackClick() {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.back {
|
|
77
|
-
height: 20px;
|
|
78
|
-
width: 20px;
|
|
79
|
-
padding: 20px 14px;
|
|
80
|
-
cursor: pointer;
|
|
77
|
+
height: var(--toolbar-back-button-height, 20px);
|
|
78
|
+
width: var(--toolbar-back-button-width, 20px);
|
|
79
|
+
padding: var(--toolbar-back-button-padding, 20px 14px);
|
|
80
|
+
cursor: var(--toolbar-back-button-cursor, pointer);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.back img {
|
|
84
|
+
height: var(--toolbar-back-image-height, 16px);
|
|
85
|
+
width: var(--toolbar-back-image-width, 16px);
|
|
81
86
|
}
|
|
82
87
|
|
|
83
88
|
.center-content {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/svelte-ui-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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.
|
|
57
|
+
"vite": "^4.5.2",
|
|
58
58
|
"vitest": "^0.34.6",
|
|
59
59
|
"type-decoder": "^1.2.0"
|
|
60
60
|
},
|