@juspay/svelte-ui-components 2.2.3 → 2.7.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/dist/Banner/properties.d.ts +7 -2
- package/dist/Button/Button.svelte +6 -2
- package/dist/Button/properties.d.ts +7 -2
- package/dist/Carousel/properties.d.ts +6 -1
- package/dist/CheckListItem/properties.d.ts +6 -1
- package/dist/GridItem/properties.d.ts +6 -1
- package/dist/Icon/properties.d.ts +6 -1
- package/dist/Img/properties.d.ts +4 -1
- package/dist/Input/Input.svelte +32 -8
- package/dist/Input/properties.d.ts +7 -2
- package/dist/InputButton/InputButton.svelte +66 -51
- package/dist/InputButton/properties.d.ts +16 -7
- package/dist/ListItem/properties.d.ts +3 -1
- package/dist/Modal/properties.d.ts +3 -1
- package/dist/Select/properties.d.ts +3 -1
- package/dist/Status/properties.d.ts +3 -1
- package/dist/Stepper/properties.d.ts +5 -1
- package/dist/Toast/Toast.svelte +11 -6
- package/dist/Toast/properties.d.ts +4 -2
- package/dist/Toggle/properties.d.ts +3 -1
- package/dist/Toolbar/properties.d.ts +3 -1
- package/dist/index.d.ts +20 -22
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
export type BannerProperties =
|
|
3
|
-
|
|
2
|
+
export type BannerProperties = MandatoryBannerProperties & OptionalBannerProperties & BannerEventProperties;
|
|
3
|
+
export type MandatoryBannerProperties = {
|
|
4
4
|
text: string;
|
|
5
|
+
};
|
|
6
|
+
export type OptionalBannerProperties = {
|
|
7
|
+
icon?: string | null;
|
|
5
8
|
linkText?: string | null;
|
|
6
9
|
rightContent?: Snippet;
|
|
10
|
+
};
|
|
11
|
+
export type BannerEventProperties = {
|
|
7
12
|
onclick?: (event: MouseEvent) => void;
|
|
8
13
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
9
14
|
};
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
<div class="button-progress-bar"></div>
|
|
32
32
|
{/if}
|
|
33
33
|
<button
|
|
34
|
-
|
|
35
|
-
style:--cursor={enable ? 'pointer' : 'not-allowed'}
|
|
34
|
+
class:disabled={!enable}
|
|
36
35
|
onclick={handleButtonClick}
|
|
37
36
|
{onkeyup}
|
|
38
37
|
disabled={!(enable && !showLoader)}
|
|
@@ -81,6 +80,11 @@
|
|
|
81
80
|
box-shadow: var(--button-box-shadow, none);
|
|
82
81
|
}
|
|
83
82
|
|
|
83
|
+
.disabled {
|
|
84
|
+
cursor: var(--disabled-cursor, not-allowed);
|
|
85
|
+
opacity: var(--disabled-opacity, 0.4);
|
|
86
|
+
}
|
|
87
|
+
|
|
84
88
|
.button-loader {
|
|
85
89
|
order: var(--button-loader-order, 1);
|
|
86
90
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
export type LoaderType = 'Circular' | 'ProgressBar';
|
|
3
|
-
export type ButtonProperties =
|
|
3
|
+
export type ButtonProperties = OptionalButtonProperties & ButtonEventProperties & MandatoryButtonProperties;
|
|
4
|
+
export type MandatoryButtonProperties = {
|
|
4
5
|
text: string;
|
|
6
|
+
};
|
|
7
|
+
export type OptionalButtonProperties = {
|
|
5
8
|
enable?: boolean;
|
|
6
9
|
showProgressBar?: boolean;
|
|
7
10
|
showLoader?: boolean;
|
|
8
11
|
loaderType?: LoaderType;
|
|
9
12
|
type?: 'submit' | 'reset' | 'button';
|
|
10
13
|
testId?: string;
|
|
14
|
+
icon?: Snippet;
|
|
15
|
+
};
|
|
16
|
+
export type ButtonEventProperties = {
|
|
11
17
|
onclick?: (event: MouseEvent) => void;
|
|
12
18
|
onkeyup?: (event: KeyboardEvent) => void;
|
|
13
|
-
icon?: Snippet;
|
|
14
19
|
};
|
|
@@ -3,11 +3,16 @@ export type CarouselView = {
|
|
|
3
3
|
properties?: Record<string, unknown>;
|
|
4
4
|
component: Component<Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
-
export type CarouselProperties =
|
|
6
|
+
export type CarouselProperties = CarouselEventProperties & OptionalCarouselProperties & MandatoryCarouselProperties;
|
|
7
|
+
export type MandatoryCarouselProperties = {
|
|
7
8
|
views: CarouselView[];
|
|
9
|
+
};
|
|
10
|
+
export type OptionalCarouselProperties = {
|
|
8
11
|
autoplay?: boolean;
|
|
9
12
|
autoplayInterval?: number;
|
|
10
13
|
showDots?: boolean;
|
|
11
14
|
isScrollableLast?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type CarouselEventProperties = {
|
|
12
17
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
13
18
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
export type CheckListItemProperties =
|
|
2
|
+
export type CheckListItemProperties = OptionalCheckListItemProperties & CheckListItemEventProperties & MandatoryCheckListItemProperties;
|
|
3
|
+
export type MandatoryCheckListItemProperties = {
|
|
3
4
|
text: string;
|
|
5
|
+
};
|
|
6
|
+
export type OptionalCheckListItemProperties = {
|
|
4
7
|
checked?: boolean;
|
|
5
8
|
checkboxLabel?: Snippet;
|
|
9
|
+
};
|
|
10
|
+
export type CheckListItemEventProperties = {
|
|
6
11
|
onclick?: (checked: boolean) => void;
|
|
7
12
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export type GridItemProperties =
|
|
1
|
+
export type GridItemProperties = OptionalGridItemProperties & GridItemEventProperties & MandatoryGridItemProperties;
|
|
2
|
+
export type MandatoryGridItemProperties = {
|
|
2
3
|
icon: string;
|
|
3
4
|
text: string;
|
|
5
|
+
};
|
|
6
|
+
export type OptionalGridItemProperties = {
|
|
4
7
|
headerIcon?: string | null;
|
|
5
8
|
showLoader?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type GridItemEventProperties = {
|
|
6
11
|
onclick?: (event: MouseEvent) => void;
|
|
7
12
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
8
13
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
export type IconProperties =
|
|
1
|
+
export type IconProperties = OptionalIconProperties & IconEventProperties & MandatoryIconProperties;
|
|
2
|
+
export type MandatoryIconProperties = {
|
|
2
3
|
icon: string;
|
|
4
|
+
};
|
|
5
|
+
export type OptionalIconProperties = {
|
|
3
6
|
text?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export type IconEventProperties = {
|
|
4
9
|
onclick?: (event: MouseEvent) => void;
|
|
5
10
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
6
11
|
};
|
package/dist/Img/properties.d.ts
CHANGED
package/dist/Input/Input.svelte
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
name = '',
|
|
24
24
|
testId = '',
|
|
25
25
|
textTransformers = [],
|
|
26
|
+
textViewPresentation = [],
|
|
27
|
+
onFocus = () => {},
|
|
26
28
|
onFocusout = () => {},
|
|
27
29
|
onInput = () => {},
|
|
28
30
|
onPaste = () => {},
|
|
@@ -60,7 +62,7 @@
|
|
|
60
62
|
return valueValidation;
|
|
61
63
|
});
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
const showErrorMessage = $derived(validationState === 'Invalid');
|
|
64
66
|
|
|
65
67
|
function handleOnInput(event: Event) {
|
|
66
68
|
if (inputElement === null) {
|
|
@@ -81,12 +83,16 @@
|
|
|
81
83
|
}
|
|
82
84
|
if (numberLength > maxLength) {
|
|
83
85
|
const existingInput = value;
|
|
84
|
-
if (existingInput.length
|
|
85
|
-
inputElement.value = value;
|
|
86
|
+
if (existingInput.length === maxLength) {
|
|
87
|
+
inputElement.value = applyTextPresentation(value);
|
|
86
88
|
return;
|
|
87
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* choose last max length number of digits if length is bigger than max length passed in props
|
|
92
|
+
*/
|
|
88
93
|
currentValue = currentValue.substring(numberLength - maxLength);
|
|
89
94
|
}
|
|
95
|
+
currentValue = applyTextPresentation(currentValue);
|
|
90
96
|
inputElement.value = currentValue;
|
|
91
97
|
}
|
|
92
98
|
value = inputElement.value;
|
|
@@ -128,7 +134,9 @@
|
|
|
128
134
|
/**
|
|
129
135
|
* choose last max length number of digits if length is bigger than max length passed in props
|
|
130
136
|
*/
|
|
131
|
-
const finalValue =
|
|
137
|
+
const finalValue = applyTextPresentation(
|
|
138
|
+
filteredNumber.substring(filteredNumberLength - maxLength)
|
|
139
|
+
);
|
|
132
140
|
// Adding reactivity
|
|
133
141
|
value = finalValue;
|
|
134
142
|
onPaste(event);
|
|
@@ -141,6 +149,13 @@
|
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
151
|
|
|
152
|
+
function applyTextPresentation(currentValue: string): string {
|
|
153
|
+
return textViewPresentation.reduce((prevValue, currIndexFunction) => {
|
|
154
|
+
let newValue = currIndexFunction(prevValue);
|
|
155
|
+
return newValue;
|
|
156
|
+
}, currentValue);
|
|
157
|
+
}
|
|
158
|
+
|
|
144
159
|
function _onFocusOut(event: FocusEvent) {
|
|
145
160
|
if (validationState === 'InProgress' && value.length > 0) {
|
|
146
161
|
validationState = 'Invalid';
|
|
@@ -167,6 +182,7 @@
|
|
|
167
182
|
{placeholder}
|
|
168
183
|
autocomplete={autoComplete}
|
|
169
184
|
{name}
|
|
185
|
+
onfocus={onFocus}
|
|
170
186
|
onfocusout={_onFocusOut}
|
|
171
187
|
oninput={handleOnInput}
|
|
172
188
|
onpaste={handleOnPaste}
|
|
@@ -185,9 +201,11 @@
|
|
|
185
201
|
{placeholder}
|
|
186
202
|
autocomplete={autoComplete}
|
|
187
203
|
{name}
|
|
204
|
+
onfocus={onFocus}
|
|
188
205
|
onfocusout={_onFocusOut}
|
|
189
206
|
oninput={handleOnInput}
|
|
190
|
-
onpaste={
|
|
207
|
+
onpaste={handleOnPaste}
|
|
208
|
+
onclick={onClick}
|
|
191
209
|
data-pw={testId}
|
|
192
210
|
class:action-input={actionInput}
|
|
193
211
|
disabled={disable}
|
|
@@ -239,13 +257,19 @@
|
|
|
239
257
|
}
|
|
240
258
|
|
|
241
259
|
.input-error {
|
|
242
|
-
--input-focus-border: var(
|
|
243
|
-
|
|
260
|
+
--input-focus-border: var(
|
|
261
|
+
--input-error-border,
|
|
262
|
+
1px solid var(--input-error-msg-text-color, #fa1405)
|
|
263
|
+
) !important;
|
|
264
|
+
--input-border: var(
|
|
265
|
+
--input-error-border,
|
|
266
|
+
1px solid var(--input-error-msg-text-color, #fa1405)
|
|
267
|
+
) !important;
|
|
244
268
|
}
|
|
245
269
|
|
|
246
270
|
.action-input {
|
|
247
271
|
border-radius: var(--input-radius, 4px 0px 0px 4px);
|
|
248
|
-
box-shadow: 0px 0px 0px #ffffff;
|
|
272
|
+
box-shadow: var(--input-box-shadow, 0px 0px 0px #ffffff);
|
|
249
273
|
margin-bottom: 0;
|
|
250
274
|
}
|
|
251
275
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { AutoCompleteType, CustomValidator, InputDataType, TextTransformer, ValidationState } from '../types';
|
|
2
|
-
export type InputProperties =
|
|
2
|
+
export type InputProperties = OptionalInputProperties & InputEventProperties & MandatoryInputProperties;
|
|
3
|
+
export type MandatoryInputProperties = {
|
|
3
4
|
value: string;
|
|
4
5
|
};
|
|
5
|
-
export type
|
|
6
|
+
export type OptionalInputProperties = {
|
|
6
7
|
placeholder?: string | null;
|
|
7
8
|
dataType?: InputDataType;
|
|
8
9
|
label?: string | null;
|
|
@@ -20,8 +21,12 @@ export type OptionalInputProps = {
|
|
|
20
21
|
autoComplete?: AutoCompleteType;
|
|
21
22
|
name?: string;
|
|
22
23
|
textTransformers?: TextTransformer[];
|
|
24
|
+
textViewPresentation?: TextTransformer[];
|
|
23
25
|
testId?: string;
|
|
26
|
+
};
|
|
27
|
+
export type InputEventProperties = {
|
|
24
28
|
onInput?: (value: string, event: Event) => void;
|
|
29
|
+
onFocus?: (event: FocusEvent) => void;
|
|
25
30
|
onFocusout?: (event: FocusEvent) => void;
|
|
26
31
|
onPaste?: (event: ClipboardEvent) => void;
|
|
27
32
|
onClick?: (event: MouseEvent) => void;
|
|
@@ -11,7 +11,12 @@
|
|
|
11
11
|
rightButtonProperties,
|
|
12
12
|
leftButtonProperties,
|
|
13
13
|
bottomButtonProperties,
|
|
14
|
-
|
|
14
|
+
inputEventProperties,
|
|
15
|
+
rightButtonEventProperties,
|
|
16
|
+
leftButtonEventProperties,
|
|
17
|
+
bottomButtonEventProperties,
|
|
18
|
+
leftIcon,
|
|
19
|
+
rightIcon
|
|
15
20
|
}: InputButtonProperties = $props();
|
|
16
21
|
|
|
17
22
|
let validationState = $state<ValidationState>('InProgress');
|
|
@@ -19,29 +24,29 @@
|
|
|
19
24
|
let inputRef: SvelteComponent | null = $state(null);
|
|
20
25
|
|
|
21
26
|
// Derive enable state for right button
|
|
22
|
-
|
|
27
|
+
const isRightButtonEnabled = $derived(validationState === 'Valid');
|
|
23
28
|
|
|
24
29
|
function rightButtonClick(event: MouseEvent): void {
|
|
25
30
|
if (validationState === 'Valid') {
|
|
26
|
-
|
|
31
|
+
rightButtonEventProperties?.onclick?.(event);
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
function bottomButtonClick(event: MouseEvent): void {
|
|
31
36
|
if (validationState === 'Valid') {
|
|
32
|
-
|
|
37
|
+
bottomButtonEventProperties?.onclick?.(event);
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
function triggerRightClickIfValid(event: KeyboardEvent): void {
|
|
37
42
|
if (event?.key === 'Enter' && validationState === 'Valid') {
|
|
38
|
-
|
|
43
|
+
rightButtonEventProperties?.onkeyup?.(event);
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
function handleStateChange(state: ValidationState): void {
|
|
43
48
|
validationState = state;
|
|
44
|
-
|
|
49
|
+
inputEventProperties?.onStateChange?.(state);
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
export function focus() {
|
|
@@ -49,59 +54,59 @@
|
|
|
49
54
|
}
|
|
50
55
|
</script>
|
|
51
56
|
|
|
52
|
-
|
|
53
57
|
<div class="container">
|
|
54
|
-
{#if inputProperties.label && inputProperties.label !== ''}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{/if}
|
|
59
|
-
|
|
60
|
-
<div class="input-button-container">
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
{#if inputProperties.label && inputProperties.label !== ''}
|
|
59
|
+
<label class="label" for={inputProperties.name}>
|
|
60
|
+
{inputProperties.label}
|
|
61
|
+
</label>
|
|
62
|
+
{/if}
|
|
63
|
+
|
|
64
|
+
<div class="input-button-container">
|
|
65
|
+
<div class="input-button {validationState === 'Invalid' ? 'invalid' : 'valid'}">
|
|
66
|
+
{#if leftButtonProperties != null}
|
|
67
|
+
<div class="left-button">
|
|
68
|
+
<Button {...leftButtonProperties} {...leftButtonEventProperties} icon={leftIcon} />
|
|
69
|
+
</div>
|
|
70
|
+
{/if}
|
|
71
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
72
|
+
<div class="input" onkeyup={triggerRightClickIfValid}>
|
|
73
|
+
<Input
|
|
74
|
+
{...inputProperties}
|
|
75
|
+
{...inputEventProperties}
|
|
76
|
+
bind:value
|
|
77
|
+
bind:this={inputRef}
|
|
78
|
+
onStateChange={handleStateChange}
|
|
79
|
+
actionInput={true}
|
|
80
|
+
/>
|
|
65
81
|
</div>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
{#if rightButtonProperties != null}
|
|
83
|
+
<div class="right-button">
|
|
84
|
+
<Button
|
|
85
|
+
{...rightButtonProperties}
|
|
86
|
+
enable={isRightButtonEnabled}
|
|
87
|
+
onclick={rightButtonClick}
|
|
88
|
+
icon={rightIcon}
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
{/if}
|
|
76
92
|
</div>
|
|
77
|
-
{#if
|
|
78
|
-
<div class="
|
|
79
|
-
<Button
|
|
80
|
-
{...rightButtonProperties}
|
|
81
|
-
enable={isRightButtonEnabled}
|
|
82
|
-
onclick={rightButtonClick}
|
|
83
|
-
/>
|
|
93
|
+
{#if bottomButtonProperties != null}
|
|
94
|
+
<div class="bottom-button">
|
|
95
|
+
<Button {...bottomButtonProperties} onclick={bottomButtonClick} />
|
|
84
96
|
</div>
|
|
85
97
|
{/if}
|
|
86
98
|
</div>
|
|
87
|
-
{#if
|
|
88
|
-
<div class="
|
|
89
|
-
|
|
99
|
+
{#if inputProperties.onErrorMessage !== '' && validationState === 'Invalid'}
|
|
100
|
+
<div class="error-message">
|
|
101
|
+
{inputProperties.onErrorMessage}
|
|
102
|
+
</div>
|
|
103
|
+
{/if}
|
|
104
|
+
{#if inputProperties.infoMessage !== ''}
|
|
105
|
+
<div class="info-message">
|
|
106
|
+
{inputProperties.infoMessage}
|
|
90
107
|
</div>
|
|
91
108
|
{/if}
|
|
92
109
|
</div>
|
|
93
|
-
{#if inputProperties.onErrorMessage !== '' && validationState === 'Invalid'}
|
|
94
|
-
<div class="error-message">
|
|
95
|
-
{inputProperties.onErrorMessage}
|
|
96
|
-
</div>
|
|
97
|
-
{/if}
|
|
98
|
-
{#if inputProperties.infoMessage !== ''}
|
|
99
|
-
<div class="info-message">
|
|
100
|
-
{inputProperties.infoMessage}
|
|
101
|
-
</div>
|
|
102
|
-
{/if}
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
110
|
|
|
106
111
|
<style>
|
|
107
112
|
.container {
|
|
@@ -161,7 +166,7 @@
|
|
|
161
166
|
font-size: var(--input-label-msg-text-size, 12px);
|
|
162
167
|
color: var(--input-label-msg-text-color, #637c95);
|
|
163
168
|
line-height: var(--input-label-msg-text-line-height);
|
|
164
|
-
margin
|
|
169
|
+
margin: var(--input-label-msg-text-margin, 0px 0px 6px 0px);
|
|
165
170
|
}
|
|
166
171
|
|
|
167
172
|
.invalid {
|
|
@@ -201,6 +206,11 @@
|
|
|
201
206
|
flex-direction: row;
|
|
202
207
|
--button-content-gap: var(--left-button-content-gap);
|
|
203
208
|
--button-content-flex-direction: var(--left-button-content-flex-direction, row);
|
|
209
|
+
--button-icon-order: var(--left-button-icon-order);
|
|
210
|
+
--button-icon-display: var(--left-button-icon-display);
|
|
211
|
+
--button-text-order: var(--left-button-text-order);
|
|
212
|
+
--disabled-cursor: var(--left-button-disabled-cursor);
|
|
213
|
+
--disabled-opacity: var(--left-button-disabled-opacity);
|
|
204
214
|
}
|
|
205
215
|
|
|
206
216
|
.right-button {
|
|
@@ -225,5 +235,10 @@
|
|
|
225
235
|
--button-content-gap: var(--right-button-content-gap);
|
|
226
236
|
--button-visibility: var(--right-button-visibility, visible);
|
|
227
237
|
--button-content-flex-direction: var(--right-button-content-flex-direction, row);
|
|
238
|
+
--button-icon-order: var(--right-button-icon-order);
|
|
239
|
+
--button-icon-display: var(--right-button-icon-display);
|
|
240
|
+
--button-text-order: var(--right-button-text-order);
|
|
241
|
+
--disabled-cursor: var(--right-button-disabled-cursor);
|
|
242
|
+
--disabled-opacity: var(--right-button-disabled-opacity);
|
|
228
243
|
}
|
|
229
244
|
</style>
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ButtonEventProperties, MandatoryButtonProperties, OptionalButtonProperties } from '../Button/properties';
|
|
2
|
+
import type { InputEventProperties, OptionalInputProperties } from '../Input/properties';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
|
-
export type InputButtonProperties = OptionalInputButtonProperties & {
|
|
4
|
+
export type InputButtonProperties = OptionalInputButtonProperties & InputButtonEventProperties & {
|
|
5
5
|
value: string;
|
|
6
6
|
};
|
|
7
|
+
type _ButtonProperties = OptionalButtonProperties & MandatoryButtonProperties;
|
|
7
8
|
export type OptionalInputButtonProperties = {
|
|
8
|
-
inputProperties:
|
|
9
|
-
rightButtonProperties?:
|
|
10
|
-
leftButtonProperties?:
|
|
11
|
-
bottomButtonProperties?:
|
|
9
|
+
inputProperties: OptionalInputProperties;
|
|
10
|
+
rightButtonProperties?: _ButtonProperties | null;
|
|
11
|
+
leftButtonProperties?: _ButtonProperties | null;
|
|
12
|
+
bottomButtonProperties?: _ButtonProperties | null;
|
|
12
13
|
leftIcon?: Snippet;
|
|
14
|
+
rightIcon?: Snippet;
|
|
13
15
|
};
|
|
16
|
+
export type InputButtonEventProperties = {
|
|
17
|
+
inputEventProperties?: InputEventProperties;
|
|
18
|
+
rightButtonEventProperties?: ButtonEventProperties | null;
|
|
19
|
+
leftButtonEventProperties?: ButtonEventProperties | null;
|
|
20
|
+
bottomButtonEventProperties?: ButtonEventProperties | null;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
export type ListItemProperties = {
|
|
2
|
+
export type ListItemProperties = ListItemEventProperties & {
|
|
3
3
|
leftImageUrl?: string | null;
|
|
4
4
|
leftImageFallbackUrl?: string | null;
|
|
5
5
|
rightImageUrl?: string | null;
|
|
@@ -19,6 +19,8 @@ export type ListItemProperties = {
|
|
|
19
19
|
centerContent?: Snippet;
|
|
20
20
|
rightContent?: Snippet;
|
|
21
21
|
bottomContent?: Snippet;
|
|
22
|
+
};
|
|
23
|
+
export type ListItemEventProperties = {
|
|
22
24
|
onleftImageClick?: (event: MouseEvent) => void;
|
|
23
25
|
onrightImageClick?: (event: MouseEvent) => void;
|
|
24
26
|
oncenterTextClick?: (event: MouseEvent) => void;
|
|
@@ -3,7 +3,7 @@ import type { ModalTransition } from '../types';
|
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
export type ModalSize = 'large' | 'medium' | 'small' | 'fit-content';
|
|
5
5
|
export type ModalAlign = 'top' | 'center' | 'bottom';
|
|
6
|
-
export type ModalProperties = {
|
|
6
|
+
export type ModalProperties = ModalEventProperties & {
|
|
7
7
|
size?: ModalSize;
|
|
8
8
|
align?: ModalAlign;
|
|
9
9
|
showOverlay?: boolean;
|
|
@@ -26,6 +26,8 @@ export type ModalProperties = {
|
|
|
26
26
|
testId?: string;
|
|
27
27
|
content?: Snippet;
|
|
28
28
|
footerSnippet?: Snippet;
|
|
29
|
+
};
|
|
30
|
+
export type ModalEventProperties = {
|
|
29
31
|
onclose?: () => void;
|
|
30
32
|
onheaderRightImageClick?: (event: MouseEvent) => void;
|
|
31
33
|
onheaderLeftImageClick?: (event: MouseEvent) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { ImgProperties } from '../Img/properties';
|
|
3
|
-
export type SelectProperties = {
|
|
3
|
+
export type SelectProperties = SelectEventProperties & {
|
|
4
4
|
dropDownIconAlt?: string;
|
|
5
5
|
placeholder?: string | null;
|
|
6
6
|
label?: string | null;
|
|
@@ -20,6 +20,8 @@ export type SelectProperties = {
|
|
|
20
20
|
itemTestId?: string;
|
|
21
21
|
leftContent?: Snippet;
|
|
22
22
|
bottomContent?: Snippet;
|
|
23
|
+
};
|
|
24
|
+
export type SelectEventProperties = {
|
|
23
25
|
onselect?: (event: {
|
|
24
26
|
selectedItems: string | string[];
|
|
25
27
|
}) => void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ButtonProperties } from '../Button/properties';
|
|
2
|
-
export type StatusProperties = {
|
|
2
|
+
export type StatusProperties = StatusEventProperties & {
|
|
3
3
|
statusIcon: string;
|
|
4
4
|
statusText: string;
|
|
5
5
|
statusDescription: string;
|
|
6
6
|
buttonProperties?: ButtonProperties;
|
|
7
|
+
};
|
|
8
|
+
export type StatusEventProperties = {
|
|
7
9
|
onbuttonClick?: () => void;
|
|
8
10
|
};
|
|
@@ -9,10 +9,14 @@ export type Step = {
|
|
|
9
9
|
label: string;
|
|
10
10
|
icon?: string;
|
|
11
11
|
};
|
|
12
|
-
export type StepProperties = {
|
|
12
|
+
export type StepProperties = OptionalStepProperties & StepEventProperties & {
|
|
13
13
|
stepIndex: number;
|
|
14
14
|
label: string;
|
|
15
|
+
};
|
|
16
|
+
export type OptionalStepProperties = {
|
|
15
17
|
icon?: string;
|
|
18
|
+
};
|
|
19
|
+
export type StepEventProperties = {
|
|
16
20
|
onclick?: (event: {
|
|
17
21
|
selectedIndex: number;
|
|
18
22
|
}) => void;
|
package/dist/Toast/Toast.svelte
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
*/
|
|
47
47
|
function getAnimationConfig(
|
|
48
48
|
overlapPage: boolean,
|
|
49
|
-
toastDirection?: ToastDirection
|
|
49
|
+
toastDirection?: ToastDirection
|
|
50
50
|
): FlyAnimationConfig {
|
|
51
51
|
// Initializing variables to store animation offsets
|
|
52
52
|
let inX: number = 0;
|
|
@@ -172,7 +172,9 @@
|
|
|
172
172
|
top: var(--toast-top, 10px);
|
|
173
173
|
left: var(--toast-left, 0);
|
|
174
174
|
right: var(--toast-right, 0);
|
|
175
|
-
background-color: var(--
|
|
175
|
+
background-color: var(--toast-background-color, #87ceeb);
|
|
176
|
+
opacity: var(--toast-opacity, 1);
|
|
177
|
+
box-sizing: var(--toast-box-sizing);
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
.no-page-overlap {
|
|
@@ -180,14 +182,17 @@
|
|
|
180
182
|
}
|
|
181
183
|
|
|
182
184
|
.toast-icon-wrapper {
|
|
185
|
+
display: flex;
|
|
183
186
|
width: var(--toast-icon-wrapper-width, 20px);
|
|
184
187
|
height: var(--toast-icon-wrapper-height, 20px);
|
|
185
188
|
margin: var(--toast-icon-margin, 0px 6px 0px 0px);
|
|
186
189
|
padding: var(--toast-icon-wrapper-padding, 1px);
|
|
190
|
+
align-items: center;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
.toast-icon {
|
|
190
194
|
height: var(--toast-icon-height, 100%);
|
|
195
|
+
filter: var(--toast-icon-filter);
|
|
191
196
|
border-radius: var(--toast-icon-border-radius, 50%);
|
|
192
197
|
}
|
|
193
198
|
|
|
@@ -219,25 +224,25 @@
|
|
|
219
224
|
|
|
220
225
|
.success {
|
|
221
226
|
color: var(--toast-success-text, #fff);
|
|
222
|
-
background-color: var(--toast-background-color, #24aa5a);
|
|
227
|
+
background-color: var(--toast-success-background-color, var(--toast-background-color, #24aa5a));
|
|
223
228
|
--toast-border: var(--toast-success-border);
|
|
224
229
|
}
|
|
225
230
|
|
|
226
231
|
.info {
|
|
227
232
|
color: var(--toast-info-text, #fff);
|
|
228
|
-
background-color: var(--toast-background-color, #87ceeb);
|
|
233
|
+
background-color: var(--toast-info-background-color, var(--toast-background-color, #87ceeb));
|
|
229
234
|
--toast-border: var(--toast-info-border);
|
|
230
235
|
}
|
|
231
236
|
|
|
232
237
|
.warn {
|
|
233
238
|
color: var(--toast-warn-text, #fff);
|
|
234
|
-
background-color: var(--toast-background-color, #f3a42d);
|
|
239
|
+
background-color: var(--toast-warn-background-color, var(--toast-background-color, #f3a42d));
|
|
235
240
|
--toast-border: var(--toast-warn-border);
|
|
236
241
|
}
|
|
237
242
|
|
|
238
243
|
.error {
|
|
239
244
|
color: var(--toast-error-text, #fff);
|
|
240
|
-
background-color: var(--toast-background-color, #f04438);
|
|
245
|
+
background-color: var(--toast-error-background-color, var(--toast-background-color, #f04438));
|
|
241
246
|
--toast-border: var(--toast-error-border);
|
|
242
247
|
}
|
|
243
248
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
2
|
export type ToastType = 'success' | 'error' | 'info' | 'warn';
|
|
3
3
|
export type ToastDirection = 'left-to-right' | 'right-to-left' | 'top-to-bottom' | 'bottom-to-top';
|
|
4
|
-
export type ToastProperties = {
|
|
4
|
+
export type ToastProperties = ToastEventProperties & {
|
|
5
5
|
duration?: number;
|
|
6
6
|
leftIcon?: string | null;
|
|
7
7
|
message: string;
|
|
@@ -19,5 +19,7 @@ export type ToastProperties = {
|
|
|
19
19
|
subTextTestId?: string;
|
|
20
20
|
closeIconTestId?: string;
|
|
21
21
|
bottomContent?: Snippet;
|
|
22
|
+
};
|
|
23
|
+
export type ToastEventProperties = {
|
|
22
24
|
onToastHide?: () => void;
|
|
23
25
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
export type ToolbarProperties = {
|
|
2
|
+
export type ToolbarProperties = ToolbarEventProperties & {
|
|
3
3
|
showBackButton?: boolean;
|
|
4
4
|
text?: string | null;
|
|
5
5
|
backIcon?: string | null;
|
|
@@ -7,6 +7,8 @@ export type ToolbarProperties = {
|
|
|
7
7
|
centerContent?: Snippet;
|
|
8
8
|
rightContent?: Snippet;
|
|
9
9
|
additionalContent?: Snippet;
|
|
10
|
+
};
|
|
11
|
+
export type ToolbarEventProperties = {
|
|
10
12
|
onbackClick?: () => void;
|
|
11
13
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
12
14
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -23,26 +23,24 @@ export { default as Step } from './Stepper/Step.svelte';
|
|
|
23
23
|
export { default as Toast } from './Toast/Toast.svelte';
|
|
24
24
|
export { default as GridItem } from './GridItem/GridItem.svelte';
|
|
25
25
|
export { default as IconStack } from './IconStack/IconStack.svelte';
|
|
26
|
-
export
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
34
|
-
export type
|
|
35
|
-
export type
|
|
36
|
-
export type
|
|
37
|
-
export type
|
|
38
|
-
export type
|
|
39
|
-
export type
|
|
40
|
-
export type
|
|
41
|
-
export type
|
|
42
|
-
export type
|
|
43
|
-
export type
|
|
44
|
-
export type
|
|
45
|
-
export type
|
|
46
|
-
export type { ToastProperties } from './Toast/properties';
|
|
47
|
-
export type { IconStackProperties } from './IconStack/properties';
|
|
26
|
+
export { default as Img } from './Img/Img.svelte';
|
|
27
|
+
export type * from './Button/properties';
|
|
28
|
+
export type * from './Modal/properties';
|
|
29
|
+
export type * from './Input/properties';
|
|
30
|
+
export type * from './InputButton/properties';
|
|
31
|
+
export type * from './ListItem/properties';
|
|
32
|
+
export type * from './types';
|
|
33
|
+
export type * from './Icon/properties';
|
|
34
|
+
export type * from './BrandLoader/properties';
|
|
35
|
+
export type * from './Status/properties';
|
|
36
|
+
export type * from './Select/properties';
|
|
37
|
+
export type * from './Toolbar/properties';
|
|
38
|
+
export type * from './Carousel/properties';
|
|
39
|
+
export type * from './Badge/properties';
|
|
40
|
+
export type * from './Banner/properties';
|
|
41
|
+
export type * from './Table/properties';
|
|
42
|
+
export type * from './Stepper/properties';
|
|
43
|
+
export type * from './Toast/properties';
|
|
44
|
+
export type * from './IconStack/properties';
|
|
45
|
+
export type * from './Img/properties';
|
|
48
46
|
export { validateInput } from './utils';
|
package/dist/index.js
CHANGED
|
@@ -23,4 +23,5 @@ export { default as Step } from './Stepper/Step.svelte';
|
|
|
23
23
|
export { default as Toast } from './Toast/Toast.svelte';
|
|
24
24
|
export { default as GridItem } from './GridItem/GridItem.svelte';
|
|
25
25
|
export { default as IconStack } from './IconStack/IconStack.svelte';
|
|
26
|
+
export { default as Img } from './Img/Img.svelte';
|
|
26
27
|
export { validateInput } from './utils';
|