@juspay/svelte-ui-components 2.9.0 → 2.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.
- package/README.md +337 -77
- package/dist/Accordion/Accordion.svelte +4 -2
- package/dist/Accordion/Accordion.svelte.d.ts +2 -4
- package/dist/Accordion/properties.d.ts +6 -0
- package/dist/Accordion/properties.js +1 -0
- package/dist/Animations/ModalAnimation.svelte +11 -9
- package/dist/Avatar/Avatar.svelte +122 -0
- package/dist/Avatar/Avatar.svelte.d.ts +4 -0
- package/dist/Avatar/properties.d.ts +15 -0
- package/dist/Avatar/properties.js +1 -0
- package/dist/Badge/Badge.svelte +2 -2
- package/dist/Badge/properties.d.ts +1 -0
- package/dist/Banner/Banner.svelte +132 -48
- package/dist/Banner/Banner.svelte.d.ts +1 -1
- package/dist/Banner/properties.d.ts +8 -3
- package/dist/Book/Book.svelte +281 -0
- package/dist/Book/Book.svelte.d.ts +4 -0
- package/dist/Book/properties.d.ts +24 -0
- package/dist/Book/properties.js +1 -0
- package/dist/BrandLoader/BrandLoader.svelte +3 -3
- package/dist/BrandLoader/properties.d.ts +1 -0
- package/dist/Browser/Browser.svelte +193 -0
- package/dist/Browser/Browser.svelte.d.ts +3 -0
- package/dist/Browser/properties.d.ts +16 -0
- package/dist/Browser/properties.js +1 -0
- package/dist/Button/Button.svelte +20 -7
- package/dist/Button/properties.d.ts +7 -4
- package/dist/Calendar/Calendar.svelte +476 -0
- package/dist/Calendar/Calendar.svelte.d.ts +4 -0
- package/dist/Calendar/properties.d.ts +30 -0
- package/dist/Calendar/properties.js +1 -0
- package/dist/Carousel/Carousel.svelte +19 -16
- package/dist/Carousel/properties.d.ts +1 -0
- package/dist/CheckListItem/CheckListItem.svelte +31 -26
- package/dist/CheckListItem/properties.d.ts +4 -1
- package/dist/Checkbox/Checkbox.svelte +157 -0
- package/dist/Checkbox/Checkbox.svelte.d.ts +4 -0
- package/dist/Checkbox/properties.d.ts +17 -0
- package/dist/Checkbox/properties.js +1 -0
- package/dist/Choicebox/Choicebox.svelte +85 -0
- package/dist/Choicebox/Choicebox.svelte.d.ts +4 -0
- package/dist/Choicebox/properties.d.ts +14 -0
- package/dist/Choicebox/properties.js +1 -0
- package/dist/CommandMenu/CommandMenu.svelte +452 -0
- package/dist/CommandMenu/CommandMenu.svelte.d.ts +4 -0
- package/dist/CommandMenu/properties.d.ts +26 -0
- package/dist/CommandMenu/properties.js +1 -0
- package/dist/ContextMenu/ContextMenu.svelte +308 -0
- package/dist/ContextMenu/ContextMenu.svelte.d.ts +4 -0
- package/dist/ContextMenu/properties.d.ts +26 -0
- package/dist/ContextMenu/properties.js +1 -0
- package/dist/Gauge/Gauge.svelte +70 -0
- package/dist/Gauge/Gauge.svelte.d.ts +4 -0
- package/dist/Gauge/properties.d.ts +9 -0
- package/dist/Gauge/properties.js +1 -0
- package/dist/GridItem/GridItem.svelte +5 -4
- package/dist/GridItem/properties.d.ts +1 -0
- package/dist/Icon/Icon.svelte +3 -3
- package/dist/Icon/properties.d.ts +1 -0
- package/dist/IconStack/IconStack.svelte +3 -3
- package/dist/IconStack/properties.d.ts +1 -0
- package/dist/Img/Img.svelte +5 -3
- package/dist/Img/properties.d.ts +5 -1
- package/dist/Input/Input.svelte +12 -6
- package/dist/Input/properties.d.ts +1 -0
- package/dist/InputButton/InputButton.svelte +4 -3
- package/dist/InputButton/properties.d.ts +5 -6
- package/dist/KeyboardInput/KeyboardInput.svelte +93 -0
- package/dist/KeyboardInput/KeyboardInput.svelte.d.ts +4 -0
- package/dist/KeyboardInput/properties.d.ts +12 -0
- package/dist/KeyboardInput/properties.js +1 -0
- package/dist/ListItem/ListItem.svelte +31 -28
- package/dist/ListItem/properties.d.ts +1 -0
- package/dist/Loader/Loader.svelte +10 -6
- package/dist/Loader/Loader.svelte.d.ts +3 -25
- package/dist/Loader/properties.d.ts +3 -0
- package/dist/Loader/properties.js +1 -0
- package/dist/LoadingDots/LoadingDots.svelte +64 -0
- package/dist/LoadingDots/LoadingDots.svelte.d.ts +3 -0
- package/dist/LoadingDots/properties.d.ts +8 -0
- package/dist/LoadingDots/properties.js +1 -0
- package/dist/Menu/Menu.svelte +349 -0
- package/dist/Menu/Menu.svelte.d.ts +4 -0
- package/dist/Menu/properties.d.ts +24 -0
- package/dist/Menu/properties.js +1 -0
- package/dist/Modal/Modal.svelte +10 -9
- package/dist/Modal/properties.d.ts +1 -0
- package/dist/Pagination/Pagination.svelte +152 -0
- package/dist/Pagination/Pagination.svelte.d.ts +4 -0
- package/dist/Pagination/properties.d.ts +14 -0
- package/dist/Pagination/properties.js +1 -0
- package/dist/Phone/Phone.svelte +234 -0
- package/dist/Phone/Phone.svelte.d.ts +3 -0
- package/dist/Phone/properties.d.ts +11 -0
- package/dist/Phone/properties.js +1 -0
- package/dist/Pill/Pill.svelte +130 -0
- package/dist/Pill/Pill.svelte.d.ts +4 -0
- package/dist/Pill/properties.d.ts +16 -0
- package/dist/Pill/properties.js +1 -0
- package/dist/Progress/Progress.svelte +68 -0
- package/dist/Progress/Progress.svelte.d.ts +4 -0
- package/dist/Progress/properties.d.ts +10 -0
- package/dist/Progress/properties.js +1 -0
- package/dist/Radio/Radio.svelte +128 -0
- package/dist/Radio/Radio.svelte.d.ts +4 -0
- package/dist/Radio/properties.d.ts +15 -0
- package/dist/Radio/properties.js +1 -0
- package/dist/RelativeTime/RelativeTime.svelte +117 -0
- package/dist/RelativeTime/RelativeTime.svelte.d.ts +4 -0
- package/dist/RelativeTime/properties.d.ts +13 -0
- package/dist/RelativeTime/properties.js +1 -0
- package/dist/Scroller/Scroller.svelte +389 -0
- package/dist/Scroller/Scroller.svelte.d.ts +4 -0
- package/dist/Scroller/properties.d.ts +30 -0
- package/dist/Scroller/properties.js +1 -0
- package/dist/Select/Select.svelte +382 -344
- package/dist/Select/Select.svelte.d.ts +1 -1
- package/dist/Select/properties.d.ts +16 -26
- package/dist/Sheet/Sheet.svelte +264 -0
- package/dist/Sheet/Sheet.svelte.d.ts +4 -0
- package/dist/Sheet/properties.d.ts +19 -0
- package/dist/Sheet/properties.js +1 -0
- package/dist/Shimmer/Shimmer.svelte +44 -0
- package/dist/Shimmer/Shimmer.svelte.d.ts +4 -0
- package/dist/Shimmer/properties.d.ts +4 -0
- package/dist/Shimmer/properties.js +1 -0
- package/dist/Slider/Slider.svelte +144 -0
- package/dist/Slider/Slider.svelte.d.ts +4 -0
- package/dist/Slider/properties.d.ts +17 -0
- package/dist/Slider/properties.js +1 -0
- package/dist/Snippet/Snippet.svelte +123 -0
- package/dist/Snippet/Snippet.svelte.d.ts +4 -0
- package/dist/Snippet/properties.d.ts +15 -0
- package/dist/Snippet/properties.js +1 -0
- package/dist/SplitButton/SplitButton.svelte +135 -0
- package/dist/SplitButton/SplitButton.svelte.d.ts +4 -0
- package/dist/SplitButton/properties.d.ts +17 -0
- package/dist/SplitButton/properties.js +1 -0
- package/dist/Status/Status.svelte +5 -3
- package/dist/Status/properties.d.ts +1 -0
- package/dist/Stepper/Step.svelte +3 -3
- package/dist/Stepper/Stepper.svelte +3 -3
- package/dist/Stepper/properties.d.ts +2 -0
- package/dist/Table/Table.svelte +15 -8
- package/dist/Table/properties.d.ts +1 -0
- package/dist/Tabs/Tabs.svelte +240 -0
- package/dist/Tabs/Tabs.svelte.d.ts +4 -0
- package/dist/Tabs/properties.d.ts +16 -0
- package/dist/Tabs/properties.js +1 -0
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte +249 -0
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte.d.ts +4 -0
- package/dist/ThemeSwitcher/properties.d.ts +19 -0
- package/dist/ThemeSwitcher/properties.js +1 -0
- package/dist/Toast/Toast.svelte +25 -30
- package/dist/Toast/properties.d.ts +1 -0
- package/dist/Toggle/Toggle.svelte +2 -2
- package/dist/Toggle/properties.d.ts +1 -0
- package/dist/Toolbar/Toolbar.svelte +8 -7
- package/dist/Toolbar/properties.d.ts +1 -0
- package/dist/Tooltip/Tooltip.svelte +153 -0
- package/dist/Tooltip/Tooltip.svelte.d.ts +4 -0
- package/dist/Tooltip/properties.d.ts +13 -0
- package/dist/Tooltip/properties.js +1 -0
- package/dist/assets/battery.svg +5 -0
- package/dist/assets/checkmark.svg +3 -0
- package/dist/assets/chevron-down-sm.svg +3 -0
- package/dist/assets/chevron-down.svg +3 -0
- package/dist/assets/chevron-left-lg.svg +3 -0
- package/dist/assets/chevron-left.svg +3 -0
- package/dist/assets/chevron-right-lg.svg +3 -0
- package/dist/assets/chevron-right.svg +3 -0
- package/dist/assets/chevron-up.svg +3 -0
- package/dist/assets/close.svg +4 -0
- package/dist/assets/copy.svg +4 -0
- package/dist/assets/error-circle.svg +5 -0
- package/dist/assets/lock.svg +3 -0
- package/dist/assets/minus.svg +3 -0
- package/dist/assets/monitor.svg +5 -0
- package/dist/assets/moon.svg +3 -0
- package/dist/assets/palette.svg +7 -0
- package/dist/assets/search.svg +4 -0
- package/dist/assets/signal.svg +6 -0
- package/dist/assets/sun.svg +11 -0
- package/dist/assets/wifi.svg +3 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +27 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +18 -4
- package/package.json +26 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { KeyboardInputProperties } from './properties';
|
|
3
|
+
|
|
4
|
+
let { keys, separator = '+', testId, onclick, classes }: KeyboardInputProperties = $props();
|
|
5
|
+
|
|
6
|
+
const KEY_SYMBOLS: Record<string, string> = {
|
|
7
|
+
cmd: '\u2318',
|
|
8
|
+
command: '\u2318',
|
|
9
|
+
ctrl: '\u2303',
|
|
10
|
+
control: '\u2303',
|
|
11
|
+
alt: '\u2325',
|
|
12
|
+
option: '\u2325',
|
|
13
|
+
shift: '\u21E7',
|
|
14
|
+
enter: '\u21B5',
|
|
15
|
+
backspace: '\u232B',
|
|
16
|
+
delete: '\u2326',
|
|
17
|
+
tab: '\u21E5',
|
|
18
|
+
escape: 'Esc',
|
|
19
|
+
esc: 'Esc',
|
|
20
|
+
up: '\u2191',
|
|
21
|
+
down: '\u2193',
|
|
22
|
+
left: '\u2190',
|
|
23
|
+
right: '\u2192',
|
|
24
|
+
space: '\u2423'
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
let keyList = $derived(Array.isArray(keys) ? keys : keys.split(separator).map((k) => k.trim()));
|
|
28
|
+
let interactive = $derived(typeof onclick === 'function');
|
|
29
|
+
|
|
30
|
+
function getSymbol(key: string): string {
|
|
31
|
+
return KEY_SYMBOLS[key.toLowerCase()] ?? key;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function handleKeydown(event: KeyboardEvent): void {
|
|
35
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
onclick?.(new MouseEvent('click'));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
43
|
+
<span
|
|
44
|
+
class="keyboard-input {classes ?? ''}"
|
|
45
|
+
data-pw={typeof testId === 'string' ? testId : null}
|
|
46
|
+
onclick={interactive ? onclick : null}
|
|
47
|
+
onkeydown={interactive ? handleKeydown : null}
|
|
48
|
+
role={interactive ? 'button' : null}
|
|
49
|
+
tabindex={interactive ? 0 : null}
|
|
50
|
+
>
|
|
51
|
+
{#each keyList as key, i (i)}
|
|
52
|
+
{#if i > 0}
|
|
53
|
+
<span class="separator">{separator}</span>
|
|
54
|
+
{/if}
|
|
55
|
+
<kbd class="key">{getSymbol(key)}</kbd>
|
|
56
|
+
{/each}
|
|
57
|
+
</span>
|
|
58
|
+
|
|
59
|
+
<style>
|
|
60
|
+
.keyboard-input {
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: var(--keyboard-input-gap, 4px);
|
|
64
|
+
font-family: var(--keyboard-input-font-family, inherit);
|
|
65
|
+
font-size: var(--keyboard-input-font-size, 13px);
|
|
66
|
+
vertical-align: baseline;
|
|
67
|
+
cursor: var(--keyboard-input-cursor, default);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.separator {
|
|
71
|
+
color: var(--keyboard-input-separator-color, #888888);
|
|
72
|
+
font-size: var(--keyboard-input-separator-font-size, 0.85em);
|
|
73
|
+
user-select: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.key {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
font-family: var(--keyboard-input-key-font-family, inherit);
|
|
81
|
+
font-weight: var(--keyboard-input-key-font-weight, 500);
|
|
82
|
+
color: var(--keyboard-input-key-color, #333333);
|
|
83
|
+
background-color: var(--keyboard-input-key-background, #f5f5f5);
|
|
84
|
+
border: var(--keyboard-input-key-border, 1px solid #d1d1d1);
|
|
85
|
+
border-radius: var(--keyboard-input-key-border-radius, 4px);
|
|
86
|
+
box-shadow: var(--keyboard-input-key-box-shadow, 0 1px 0 #c4c4c4);
|
|
87
|
+
min-width: var(--keyboard-input-key-min-width, 1.6em);
|
|
88
|
+
padding: var(--keyboard-input-key-padding, 2px 6px);
|
|
89
|
+
text-align: center;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type KeyboardInputProperties = MandatoryKeyboardInputProperties & OptionalKeyboardInputProperties & KeyboardInputEventProperties;
|
|
2
|
+
export type MandatoryKeyboardInputProperties = {
|
|
3
|
+
keys: string[] | string;
|
|
4
|
+
};
|
|
5
|
+
export type OptionalKeyboardInputProperties = {
|
|
6
|
+
separator?: string;
|
|
7
|
+
testId?: string;
|
|
8
|
+
classes?: string;
|
|
9
|
+
};
|
|
10
|
+
export type KeyboardInputEventProperties = {
|
|
11
|
+
onclick?: (event: MouseEvent) => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
oncenterTextClick,
|
|
30
30
|
onitemClick,
|
|
31
31
|
ontopSectionClick,
|
|
32
|
-
onkeydown
|
|
32
|
+
onkeydown,
|
|
33
|
+
classes
|
|
33
34
|
}: ListItemProperties = $props();
|
|
34
35
|
|
|
35
36
|
function handleLeftImageClick(event: MouseEvent): void {
|
|
@@ -53,8 +54,8 @@
|
|
|
53
54
|
}
|
|
54
55
|
</script>
|
|
55
56
|
|
|
56
|
-
{#if leftImageUrl || rightImageUrl || label || leftContent || centerContent || rightContent || bottomContent}
|
|
57
|
-
<div class="item-container">
|
|
57
|
+
{#if (typeof leftImageUrl === 'string' && leftImageUrl.length > 0) || (typeof rightImageUrl === 'string' && rightImageUrl.length > 0) || (typeof label === 'string' && label.length > 0) || typeof leftContent === 'function' || typeof centerContent === 'function' || typeof rightContent === 'function' || typeof bottomContent === 'function'}
|
|
58
|
+
<div class="item-container {classes ?? ''}">
|
|
58
59
|
{#if showLoader}
|
|
59
60
|
<div class="item-loader"></div>
|
|
60
61
|
{/if}
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
data-pw={topSectionTestId}
|
|
78
79
|
>
|
|
79
80
|
<div class="left-content">
|
|
80
|
-
{#if leftImageUrl}
|
|
81
|
+
{#if typeof leftImageUrl === 'string' && leftImageUrl.length > 0}
|
|
81
82
|
<div
|
|
82
83
|
class:prevent-focus={preventFocus}
|
|
83
84
|
onclick={handleLeftImageClick}
|
|
@@ -89,12 +90,12 @@
|
|
|
89
90
|
<Img src={leftImageUrl} alt="" fallback={leftImageFallbackUrl} />
|
|
90
91
|
</div>
|
|
91
92
|
{/if}
|
|
92
|
-
{#if leftContent}
|
|
93
|
+
{#if typeof leftContent === 'function'}
|
|
93
94
|
{@render leftContent?.()}
|
|
94
95
|
{/if}
|
|
95
96
|
</div>
|
|
96
97
|
<div class="center-content">
|
|
97
|
-
{#if label}
|
|
98
|
+
{#if typeof label === 'string' && label.length > 0}
|
|
98
99
|
<div
|
|
99
100
|
class="center-text"
|
|
100
101
|
class:prevent-focus={preventFocus}
|
|
@@ -108,15 +109,15 @@
|
|
|
108
109
|
{@html label}
|
|
109
110
|
</div>
|
|
110
111
|
{/if}
|
|
111
|
-
{#if centerContent}
|
|
112
|
+
{#if typeof centerContent === 'function'}
|
|
112
113
|
{@render centerContent?.()}
|
|
113
114
|
{/if}
|
|
114
115
|
</div>
|
|
115
116
|
<div class="right-content">
|
|
116
|
-
{#if rightContent}
|
|
117
|
+
{#if typeof rightContent === 'function'}
|
|
117
118
|
{@render rightContent?.()}
|
|
118
119
|
{/if}
|
|
119
|
-
{#if rightImageUrl}
|
|
120
|
+
{#if typeof rightImageUrl === 'string' && rightImageUrl.length > 0}
|
|
120
121
|
<div
|
|
121
122
|
class:prevent-focus={preventFocus}
|
|
122
123
|
onclick={handleRightImageClick}
|
|
@@ -125,7 +126,9 @@
|
|
|
125
126
|
tabindex="0"
|
|
126
127
|
data-pw={rightImageTestId}
|
|
127
128
|
>
|
|
128
|
-
<
|
|
129
|
+
<div class="right-img-wrapper">
|
|
130
|
+
<Img src={rightImageUrl} alt="" />
|
|
131
|
+
</div>
|
|
129
132
|
</div>
|
|
130
133
|
{/if}
|
|
131
134
|
{#if showRightContentLoader}
|
|
@@ -133,15 +136,15 @@
|
|
|
133
136
|
<Loader />
|
|
134
137
|
</div>
|
|
135
138
|
{/if}
|
|
136
|
-
{#if rightContentText && rightContentText
|
|
139
|
+
{#if typeof rightContentText === 'string' && rightContentText.length > 0}
|
|
137
140
|
<span class="right-content-text">{rightContentText}</span>
|
|
138
141
|
{/if}
|
|
139
142
|
</div>
|
|
140
143
|
</div>
|
|
141
144
|
<div class="bottom-section">
|
|
142
|
-
{#if bottomContent && useAccordion}
|
|
145
|
+
{#if typeof bottomContent === 'function' && useAccordion}
|
|
143
146
|
<Accordion {expand}>
|
|
144
|
-
{@render bottomContent
|
|
147
|
+
{@render bottomContent()}
|
|
145
148
|
</Accordion>
|
|
146
149
|
{/if}
|
|
147
150
|
</div>
|
|
@@ -260,24 +263,24 @@
|
|
|
260
263
|
margin-top: 0;
|
|
261
264
|
}
|
|
262
265
|
|
|
263
|
-
.right-img {
|
|
264
|
-
height: var(--list-item-right-image-height, 18px);
|
|
265
|
-
width: var(--list-item-right-image-width, 18px);
|
|
266
|
-
padding: var(--list-item-right-image-padding, 0px);
|
|
267
|
-
border-radius: var(--list-item-right-image-border-radius, 0px);
|
|
268
|
-
margin: var(--list-item-right-image-margin, 0px);
|
|
269
|
-
filter: var(--list-item-right-image-filter);
|
|
270
|
-
background: var(--list-item-right-image-background);
|
|
271
|
-
border: var(--list-item-right-image-border);
|
|
272
|
-
transition: var(--list-item-transition);
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
.right-img:hover {
|
|
276
|
-
background: var(
|
|
266
|
+
.right-img-wrapper {
|
|
267
|
+
--image-height: var(--list-item-right-image-height, 18px);
|
|
268
|
+
--image-width: var(--list-item-right-image-width, 18px);
|
|
269
|
+
--image-padding: var(--list-item-right-image-padding, 0px);
|
|
270
|
+
--image-border-radius: var(--list-item-right-image-border-radius, 0px);
|
|
271
|
+
--image-margin: var(--list-item-right-image-margin, 0px);
|
|
272
|
+
--image-filter: var(--list-item-right-image-filter);
|
|
273
|
+
--image-background: var(--list-item-right-image-background);
|
|
274
|
+
--image-border: var(--list-item-right-image-border);
|
|
275
|
+
--image-transition: var(--list-item-transition);
|
|
276
|
+
--image-hover-background: var(
|
|
277
277
|
--list-item-right-image-hover-background,
|
|
278
278
|
var(--list-item-right-image-background)
|
|
279
279
|
);
|
|
280
|
-
|
|
280
|
+
--image-hover-border: var(
|
|
281
|
+
--list-item-right-image-hover-border,
|
|
282
|
+
var(--list-item-right-image-border)
|
|
283
|
+
);
|
|
281
284
|
}
|
|
282
285
|
|
|
283
286
|
.right-content-text {
|
|
@@ -19,6 +19,7 @@ export type ListItemProperties = ListItemEventProperties & {
|
|
|
19
19
|
centerContent?: Snippet;
|
|
20
20
|
rightContent?: Snippet;
|
|
21
21
|
bottomContent?: Snippet;
|
|
22
|
+
classes?: string;
|
|
22
23
|
};
|
|
23
24
|
export type ListItemEventProperties = {
|
|
24
25
|
onleftImageClick?: (event: MouseEvent) => void;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
<
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { LoaderProperties } from './properties';
|
|
3
|
+
|
|
4
|
+
let { classes }: LoaderProperties = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class="loader {classes ?? ''}"></div>
|
|
2
8
|
|
|
3
9
|
<style>
|
|
4
10
|
.loader {
|
|
@@ -56,12 +62,10 @@
|
|
|
56
62
|
height: var(--loader-after-height, 15px);
|
|
57
63
|
border-radius: var(--loader-after-border-radius, 50%);
|
|
58
64
|
content: '';
|
|
59
|
-
margin: var(--loader-after-margin, auto);
|
|
60
65
|
position: var(--loader-after-position, absolute);
|
|
61
|
-
top: var(--loader-after-top,
|
|
62
|
-
left: var(--loader-after-left,
|
|
63
|
-
|
|
64
|
-
right: var(--loader-after-right, 0);
|
|
66
|
+
top: var(--loader-after-top, 50%);
|
|
67
|
+
left: var(--loader-after-left, 50%);
|
|
68
|
+
transform: translate(-50%, -50%);
|
|
65
69
|
}
|
|
66
70
|
@-webkit-keyframes load3 {
|
|
67
71
|
0% {
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
+
import type { LoaderProperties } from './properties';
|
|
2
|
+
declare const Loader: import("svelte").Component<LoaderProperties, {}, "">;
|
|
3
|
+
type Loader = ReturnType<typeof Loader>;
|
|
1
4
|
export default Loader;
|
|
2
|
-
type Loader = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Loader: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { LoadingDotsProperties } from './properties';
|
|
3
|
+
|
|
4
|
+
let { dots = 3, animation = 'bounce', testId, classes }: LoadingDotsProperties = $props();
|
|
5
|
+
|
|
6
|
+
let count = $derived(Math.max(1, Math.round(dots)));
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<span
|
|
10
|
+
class="loading-dots {classes ?? ''}"
|
|
11
|
+
role="status"
|
|
12
|
+
aria-label="Loading"
|
|
13
|
+
data-pw={typeof testId === 'string' ? testId : null}
|
|
14
|
+
>
|
|
15
|
+
{#each { length: count } as _, i (i)}
|
|
16
|
+
<span class="dot" class:pulse={animation === 'pulse'} style="--i: {i}"></span>
|
|
17
|
+
{/each}
|
|
18
|
+
</span>
|
|
19
|
+
|
|
20
|
+
<style>
|
|
21
|
+
.loading-dots {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: var(--loading-dots-gap, 3px);
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dot {
|
|
30
|
+
display: block;
|
|
31
|
+
width: var(--loading-dots-size, 6px);
|
|
32
|
+
height: var(--loading-dots-size, 6px);
|
|
33
|
+
border-radius: var(--loading-dots-border-radius, 50%);
|
|
34
|
+
background-color: var(--loading-dots-color, currentColor);
|
|
35
|
+
animation: loading-dots-bounce var(--loading-dots-duration, 1.4s) ease-in-out infinite;
|
|
36
|
+
animation-delay: calc(var(--i) * var(--loading-dots-stagger, 0.16s));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dot.pulse {
|
|
40
|
+
animation-name: loading-dots-pulse;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes loading-dots-bounce {
|
|
44
|
+
0%,
|
|
45
|
+
80%,
|
|
46
|
+
100% {
|
|
47
|
+
transform: translateY(0);
|
|
48
|
+
}
|
|
49
|
+
40% {
|
|
50
|
+
transform: translateY(var(--loading-dots-bounce-height, -6px));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes loading-dots-pulse {
|
|
55
|
+
0%,
|
|
56
|
+
80%,
|
|
57
|
+
100% {
|
|
58
|
+
opacity: var(--loading-dots-pulse-min-opacity, 0.2);
|
|
59
|
+
}
|
|
60
|
+
40% {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type LoadingDotsAnimation = 'bounce' | 'pulse';
|
|
2
|
+
export type LoadingDotsProperties = OptionalLoadingDotsProperties;
|
|
3
|
+
export type OptionalLoadingDotsProperties = {
|
|
4
|
+
dots?: number;
|
|
5
|
+
animation?: LoadingDotsAnimation;
|
|
6
|
+
testId?: string;
|
|
7
|
+
classes?: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|