@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.
Files changed (189) hide show
  1. package/README.md +337 -77
  2. package/dist/Accordion/Accordion.svelte +4 -2
  3. package/dist/Accordion/Accordion.svelte.d.ts +2 -4
  4. package/dist/Accordion/properties.d.ts +6 -0
  5. package/dist/Accordion/properties.js +1 -0
  6. package/dist/Animations/ModalAnimation.svelte +11 -9
  7. package/dist/Avatar/Avatar.svelte +122 -0
  8. package/dist/Avatar/Avatar.svelte.d.ts +4 -0
  9. package/dist/Avatar/properties.d.ts +15 -0
  10. package/dist/Avatar/properties.js +1 -0
  11. package/dist/Badge/Badge.svelte +2 -2
  12. package/dist/Badge/properties.d.ts +1 -0
  13. package/dist/Banner/Banner.svelte +132 -48
  14. package/dist/Banner/Banner.svelte.d.ts +1 -1
  15. package/dist/Banner/properties.d.ts +8 -3
  16. package/dist/Book/Book.svelte +281 -0
  17. package/dist/Book/Book.svelte.d.ts +4 -0
  18. package/dist/Book/properties.d.ts +24 -0
  19. package/dist/Book/properties.js +1 -0
  20. package/dist/BrandLoader/BrandLoader.svelte +3 -3
  21. package/dist/BrandLoader/properties.d.ts +1 -0
  22. package/dist/Browser/Browser.svelte +193 -0
  23. package/dist/Browser/Browser.svelte.d.ts +3 -0
  24. package/dist/Browser/properties.d.ts +16 -0
  25. package/dist/Browser/properties.js +1 -0
  26. package/dist/Button/Button.svelte +20 -7
  27. package/dist/Button/properties.d.ts +7 -4
  28. package/dist/Calendar/Calendar.svelte +476 -0
  29. package/dist/Calendar/Calendar.svelte.d.ts +4 -0
  30. package/dist/Calendar/properties.d.ts +30 -0
  31. package/dist/Calendar/properties.js +1 -0
  32. package/dist/Carousel/Carousel.svelte +19 -16
  33. package/dist/Carousel/properties.d.ts +1 -0
  34. package/dist/CheckListItem/CheckListItem.svelte +31 -26
  35. package/dist/CheckListItem/properties.d.ts +4 -1
  36. package/dist/Checkbox/Checkbox.svelte +157 -0
  37. package/dist/Checkbox/Checkbox.svelte.d.ts +4 -0
  38. package/dist/Checkbox/properties.d.ts +17 -0
  39. package/dist/Checkbox/properties.js +1 -0
  40. package/dist/Choicebox/Choicebox.svelte +85 -0
  41. package/dist/Choicebox/Choicebox.svelte.d.ts +4 -0
  42. package/dist/Choicebox/properties.d.ts +14 -0
  43. package/dist/Choicebox/properties.js +1 -0
  44. package/dist/CommandMenu/CommandMenu.svelte +452 -0
  45. package/dist/CommandMenu/CommandMenu.svelte.d.ts +4 -0
  46. package/dist/CommandMenu/properties.d.ts +26 -0
  47. package/dist/CommandMenu/properties.js +1 -0
  48. package/dist/ContextMenu/ContextMenu.svelte +308 -0
  49. package/dist/ContextMenu/ContextMenu.svelte.d.ts +4 -0
  50. package/dist/ContextMenu/properties.d.ts +26 -0
  51. package/dist/ContextMenu/properties.js +1 -0
  52. package/dist/Gauge/Gauge.svelte +70 -0
  53. package/dist/Gauge/Gauge.svelte.d.ts +4 -0
  54. package/dist/Gauge/properties.d.ts +9 -0
  55. package/dist/Gauge/properties.js +1 -0
  56. package/dist/GridItem/GridItem.svelte +5 -4
  57. package/dist/GridItem/properties.d.ts +1 -0
  58. package/dist/Icon/Icon.svelte +3 -3
  59. package/dist/Icon/properties.d.ts +1 -0
  60. package/dist/IconStack/IconStack.svelte +3 -3
  61. package/dist/IconStack/properties.d.ts +1 -0
  62. package/dist/Img/Img.svelte +5 -3
  63. package/dist/Img/properties.d.ts +5 -1
  64. package/dist/Input/Input.svelte +12 -6
  65. package/dist/Input/properties.d.ts +1 -0
  66. package/dist/InputButton/InputButton.svelte +4 -3
  67. package/dist/InputButton/properties.d.ts +5 -6
  68. package/dist/KeyboardInput/KeyboardInput.svelte +93 -0
  69. package/dist/KeyboardInput/KeyboardInput.svelte.d.ts +4 -0
  70. package/dist/KeyboardInput/properties.d.ts +12 -0
  71. package/dist/KeyboardInput/properties.js +1 -0
  72. package/dist/ListItem/ListItem.svelte +31 -28
  73. package/dist/ListItem/properties.d.ts +1 -0
  74. package/dist/Loader/Loader.svelte +10 -6
  75. package/dist/Loader/Loader.svelte.d.ts +3 -25
  76. package/dist/Loader/properties.d.ts +3 -0
  77. package/dist/Loader/properties.js +1 -0
  78. package/dist/LoadingDots/LoadingDots.svelte +64 -0
  79. package/dist/LoadingDots/LoadingDots.svelte.d.ts +3 -0
  80. package/dist/LoadingDots/properties.d.ts +8 -0
  81. package/dist/LoadingDots/properties.js +1 -0
  82. package/dist/Menu/Menu.svelte +349 -0
  83. package/dist/Menu/Menu.svelte.d.ts +4 -0
  84. package/dist/Menu/properties.d.ts +24 -0
  85. package/dist/Menu/properties.js +1 -0
  86. package/dist/Modal/Modal.svelte +10 -9
  87. package/dist/Modal/properties.d.ts +1 -0
  88. package/dist/Pagination/Pagination.svelte +152 -0
  89. package/dist/Pagination/Pagination.svelte.d.ts +4 -0
  90. package/dist/Pagination/properties.d.ts +14 -0
  91. package/dist/Pagination/properties.js +1 -0
  92. package/dist/Phone/Phone.svelte +234 -0
  93. package/dist/Phone/Phone.svelte.d.ts +3 -0
  94. package/dist/Phone/properties.d.ts +11 -0
  95. package/dist/Phone/properties.js +1 -0
  96. package/dist/Pill/Pill.svelte +130 -0
  97. package/dist/Pill/Pill.svelte.d.ts +4 -0
  98. package/dist/Pill/properties.d.ts +16 -0
  99. package/dist/Pill/properties.js +1 -0
  100. package/dist/Progress/Progress.svelte +68 -0
  101. package/dist/Progress/Progress.svelte.d.ts +4 -0
  102. package/dist/Progress/properties.d.ts +10 -0
  103. package/dist/Progress/properties.js +1 -0
  104. package/dist/Radio/Radio.svelte +128 -0
  105. package/dist/Radio/Radio.svelte.d.ts +4 -0
  106. package/dist/Radio/properties.d.ts +15 -0
  107. package/dist/Radio/properties.js +1 -0
  108. package/dist/RelativeTime/RelativeTime.svelte +117 -0
  109. package/dist/RelativeTime/RelativeTime.svelte.d.ts +4 -0
  110. package/dist/RelativeTime/properties.d.ts +13 -0
  111. package/dist/RelativeTime/properties.js +1 -0
  112. package/dist/Scroller/Scroller.svelte +389 -0
  113. package/dist/Scroller/Scroller.svelte.d.ts +4 -0
  114. package/dist/Scroller/properties.d.ts +30 -0
  115. package/dist/Scroller/properties.js +1 -0
  116. package/dist/Select/Select.svelte +382 -344
  117. package/dist/Select/Select.svelte.d.ts +1 -1
  118. package/dist/Select/properties.d.ts +16 -26
  119. package/dist/Sheet/Sheet.svelte +264 -0
  120. package/dist/Sheet/Sheet.svelte.d.ts +4 -0
  121. package/dist/Sheet/properties.d.ts +19 -0
  122. package/dist/Sheet/properties.js +1 -0
  123. package/dist/Shimmer/Shimmer.svelte +44 -0
  124. package/dist/Shimmer/Shimmer.svelte.d.ts +4 -0
  125. package/dist/Shimmer/properties.d.ts +4 -0
  126. package/dist/Shimmer/properties.js +1 -0
  127. package/dist/Slider/Slider.svelte +144 -0
  128. package/dist/Slider/Slider.svelte.d.ts +4 -0
  129. package/dist/Slider/properties.d.ts +17 -0
  130. package/dist/Slider/properties.js +1 -0
  131. package/dist/Snippet/Snippet.svelte +123 -0
  132. package/dist/Snippet/Snippet.svelte.d.ts +4 -0
  133. package/dist/Snippet/properties.d.ts +15 -0
  134. package/dist/Snippet/properties.js +1 -0
  135. package/dist/SplitButton/SplitButton.svelte +135 -0
  136. package/dist/SplitButton/SplitButton.svelte.d.ts +4 -0
  137. package/dist/SplitButton/properties.d.ts +17 -0
  138. package/dist/SplitButton/properties.js +1 -0
  139. package/dist/Status/Status.svelte +5 -3
  140. package/dist/Status/properties.d.ts +1 -0
  141. package/dist/Stepper/Step.svelte +3 -3
  142. package/dist/Stepper/Stepper.svelte +3 -3
  143. package/dist/Stepper/properties.d.ts +2 -0
  144. package/dist/Table/Table.svelte +15 -8
  145. package/dist/Table/properties.d.ts +1 -0
  146. package/dist/Tabs/Tabs.svelte +240 -0
  147. package/dist/Tabs/Tabs.svelte.d.ts +4 -0
  148. package/dist/Tabs/properties.d.ts +16 -0
  149. package/dist/Tabs/properties.js +1 -0
  150. package/dist/ThemeSwitcher/ThemeSwitcher.svelte +249 -0
  151. package/dist/ThemeSwitcher/ThemeSwitcher.svelte.d.ts +4 -0
  152. package/dist/ThemeSwitcher/properties.d.ts +19 -0
  153. package/dist/ThemeSwitcher/properties.js +1 -0
  154. package/dist/Toast/Toast.svelte +25 -30
  155. package/dist/Toast/properties.d.ts +1 -0
  156. package/dist/Toggle/Toggle.svelte +2 -2
  157. package/dist/Toggle/properties.d.ts +1 -0
  158. package/dist/Toolbar/Toolbar.svelte +8 -7
  159. package/dist/Toolbar/properties.d.ts +1 -0
  160. package/dist/Tooltip/Tooltip.svelte +153 -0
  161. package/dist/Tooltip/Tooltip.svelte.d.ts +4 -0
  162. package/dist/Tooltip/properties.d.ts +13 -0
  163. package/dist/Tooltip/properties.js +1 -0
  164. package/dist/assets/battery.svg +5 -0
  165. package/dist/assets/checkmark.svg +3 -0
  166. package/dist/assets/chevron-down-sm.svg +3 -0
  167. package/dist/assets/chevron-down.svg +3 -0
  168. package/dist/assets/chevron-left-lg.svg +3 -0
  169. package/dist/assets/chevron-left.svg +3 -0
  170. package/dist/assets/chevron-right-lg.svg +3 -0
  171. package/dist/assets/chevron-right.svg +3 -0
  172. package/dist/assets/chevron-up.svg +3 -0
  173. package/dist/assets/close.svg +4 -0
  174. package/dist/assets/copy.svg +4 -0
  175. package/dist/assets/error-circle.svg +5 -0
  176. package/dist/assets/lock.svg +3 -0
  177. package/dist/assets/minus.svg +3 -0
  178. package/dist/assets/monitor.svg +5 -0
  179. package/dist/assets/moon.svg +3 -0
  180. package/dist/assets/palette.svg +7 -0
  181. package/dist/assets/search.svg +4 -0
  182. package/dist/assets/signal.svg +6 -0
  183. package/dist/assets/sun.svg +11 -0
  184. package/dist/assets/wifi.svg +3 -0
  185. package/dist/index.d.ts +55 -0
  186. package/dist/index.js +27 -0
  187. package/dist/utils.d.ts +2 -0
  188. package/dist/utils.js +18 -4
  189. 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,4 @@
1
+ import type { KeyboardInputProperties } from './properties';
2
+ declare const KeyboardInput: import("svelte").Component<KeyboardInputProperties, {}, "">;
3
+ type KeyboardInput = ReturnType<typeof KeyboardInput>;
4
+ export default KeyboardInput;
@@ -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
- <img class="right-img" src={rightImageUrl} alt="" />
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
- border: var(--list-item-right-image-hover-border, var(--list-item-right-image-border));
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
- <div class="loader"></div>
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, 0);
62
- left: var(--loader-after-left, 0);
63
- bottom: var(--loader-after-bottom, 0);
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,3 @@
1
+ export type LoaderProperties = {
2
+ classes?: string;
3
+ };
@@ -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,3 @@
1
+ declare const LoadingDots: import("svelte").Component<import("./properties").OptionalLoadingDotsProperties, {}, "">;
2
+ type LoadingDots = ReturnType<typeof LoadingDots>;
3
+ export default LoadingDots;
@@ -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 {};