@srimandir/common 2.34.0 → 2.36.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.
@@ -1,6 +1,12 @@
1
1
  import { default as React } from 'react';
2
2
  /** Which affordance triggered `onClose` — optional so existing `() => void` callers keep compiling unchanged. */
3
3
  export type BottomSheetCloseReason = 'close_button' | 'backdrop' | 'escape';
4
+ /** Raw scroll position of the sheet's own scrolling body — no debouncing/percentage math here, that's the caller's job (e.g. for swipe-depth analytics). */
5
+ export interface BottomSheetScrollInfo {
6
+ scrollTop: number;
7
+ scrollHeight: number;
8
+ clientHeight: number;
9
+ }
4
10
  export interface BottomSheetProps {
5
11
  isOpen: boolean;
6
12
  /** Called by the close button, backdrop tap and Escape — with which one, if the caller wants to tell them apart (e.g. for dismiss analytics). */
@@ -11,6 +17,8 @@ export interface BottomSheetProps {
11
17
  header?: React.ReactNode;
12
18
  /** Pinned below the scroll area, e.g. a primary CTA. */
13
19
  footer?: React.ReactNode;
20
+ /** Fired on every scroll of the body content — raw values only, no debouncing here. */
21
+ onScroll?: (info: BottomSheetScrollInfo) => void;
14
22
  /** Round close button in the top-right corner. */
15
23
  showCloseButton?: boolean;
16
24
  /** Places the close button above the sheet's top edge instead of inside it. */
@@ -1 +1 @@
1
- export { BottomSheet, type BottomSheetProps, type BottomSheetCloseReason, } from './BottomSheet';
1
+ export { BottomSheet, type BottomSheetProps, type BottomSheetCloseReason, type BottomSheetScrollInfo, } from './BottomSheet';
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * extracted from the product packages.
8
8
  */
9
9
  export { BottomSheet } from './components/BottomSheet';
10
- export type { BottomSheetProps, BottomSheetCloseReason, } from './components/BottomSheet';
10
+ export type { BottomSheetProps, BottomSheetCloseReason, BottomSheetScrollInfo, } from './components/BottomSheet';
11
11
  export { cn } from './utils/cn';
12
12
  export { validatePhoneByCountryCode, getMaxLengthForCountry } from './utils/phoneValidation';
13
13
  export { DEFAULT_COUNTRIES, getFlagEmoji } from './utils/countries';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@srimandir/common",
3
- "version": "2.34.0",
3
+ "version": "2.36.0",
4
4
  "description": "Generic, product-agnostic UI primitives (bottom sheet, buttons, modals) shared across the Srimandir packages",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -54,5 +54,5 @@
54
54
  "react"
55
55
  ],
56
56
  "license": "MIT",
57
- "gitHead": "81c4c747666ecd12d042bde2bacd8b14d2b322c4"
58
- }
57
+ "gitHead": "8a76cd0449693063a6be98bf7ded439bf325192d"
58
+ }