@juspay/svelte-ui-components 2.135.0 → 2.136.1
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/Chat/Chat.svelte +12 -0
- package/dist/Chat/properties.d.ts +7 -0
- package/dist/ChatMessageList/ChatMessageList.svelte +54 -1
- package/dist/CheckListItem/CheckListItem.svelte +4 -1
- package/dist/ChipInput/ChipInput.svelte +150 -10
- package/dist/ChipInput/properties.d.ts +18 -1
- package/dist/CommandMenu/CommandMenu.svelte +7 -3
- package/dist/EmptyState/EmptyState.svelte +17 -3
- package/dist/Input/Input.svelte +1 -0
- package/dist/ListItem/ListItem.svelte +14 -12
- package/dist/ListItem/properties.d.ts +7 -0
- package/dist/Menu/Menu.svelte +2 -1
- package/dist/Menu/properties.d.ts +2 -0
- package/dist/Modal/Modal.svelte +3 -3
- package/dist/Pill/Pill.svelte +2 -0
- package/dist/Pill/properties.d.ts +1 -0
- package/dist/Sheet/Sheet.svelte +3 -23
- package/dist/StatCard/StatCard.svelte +64 -1
- package/dist/StatCard/properties.d.ts +44 -2
- package/dist/Status/Status.svelte +2 -1
- package/dist/Status/properties.d.ts +10 -0
- package/dist/Stepper/Step.svelte +95 -2
- package/dist/Stepper/Stepper.svelte +52 -7
- package/dist/Stepper/properties.d.ts +34 -1
- package/dist/Table/BuiltinCell.svelte +46 -23
- package/dist/Table/Table.svelte +63 -40
- package/dist/Table/cellData.js +3 -0
- package/dist/Table/properties.d.ts +70 -0
- package/dist/TypewriterText/TypewriterText.svelte +67 -2
- package/dist/TypewriterText/properties.d.ts +97 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +30 -0
- package/dist-wc/index.js +1186 -926
- package/package.json +1 -1
package/dist/utils.d.ts
CHANGED
|
@@ -26,3 +26,5 @@ export declare function hslToHsv(hDeg: number, sPct: number, lPct: number): Hsv;
|
|
|
26
26
|
export declare function isValidHex(hex: string): boolean;
|
|
27
27
|
export declare function clampInt(v: string, min: number, max: number): number;
|
|
28
28
|
export declare function createDebouncer(delay: number): <T extends unknown[]>(callback: (...args: T) => void, ...args: T) => void;
|
|
29
|
+
export declare function lockBodyScroll(): void;
|
|
30
|
+
export declare function unlockBodyScroll(): void;
|
package/dist/utils.js
CHANGED
|
@@ -292,3 +292,33 @@ export function createDebouncer(delay) {
|
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* Body scroll lock, reference counted.
|
|
297
|
+
*
|
|
298
|
+
* Modal, Sheet and CommandMenu each hide body overflow while they are open. Doing
|
|
299
|
+
* that with a bare assignment means the FIRST of them to unmount restores
|
|
300
|
+
* scrolling for all of them, so closing a confirmation dialog inside a still-open
|
|
301
|
+
* modal silently lets the page behind it scroll again. Counting the holders keeps
|
|
302
|
+
* the lock until the last one releases it.
|
|
303
|
+
*
|
|
304
|
+
* Callers must pair every lock with exactly one unlock.
|
|
305
|
+
*/
|
|
306
|
+
let bodyScrollLockCount = 0;
|
|
307
|
+
export function lockBodyScroll() {
|
|
308
|
+
if (typeof document === 'undefined') {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
if (bodyScrollLockCount === 0) {
|
|
312
|
+
document.body.style.overflow = 'hidden';
|
|
313
|
+
}
|
|
314
|
+
bodyScrollLockCount += 1;
|
|
315
|
+
}
|
|
316
|
+
export function unlockBodyScroll() {
|
|
317
|
+
if (typeof document === 'undefined') {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
bodyScrollLockCount = Math.max(0, bodyScrollLockCount - 1);
|
|
321
|
+
if (bodyScrollLockCount === 0) {
|
|
322
|
+
document.body.style.overflow = '';
|
|
323
|
+
}
|
|
324
|
+
}
|