@devvie/bottom-sheet
Version:
The 😎smart , 📦tiny , and 🎗flexible bottom sheet your app craves 🚀
30 lines (26 loc) • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SNAP_VELOCITY_FACTOR = exports.DEFAULT_SNAP_INDEX = exports.DEFAULT_OPEN_ANIMATION_DURATION = exports.DEFAULT_HEIGHT = exports.DEFAULT_CLOSE_ANIMATION_DURATION = exports.DEFAULT_BACKDROP_MASK_COLOR = exports.DEFAULT_ANIMATION = exports.CLOSE_SNAP_RATIO = void 0;
var _typesD = require("../types.d.js");
const DEFAULT_BACKDROP_MASK_COLOR = exports.DEFAULT_BACKDROP_MASK_COLOR = '#00000052';
const DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = '50%';
const DEFAULT_ANIMATION = exports.DEFAULT_ANIMATION = _typesD.ANIMATIONS.SLIDE;
const DEFAULT_OPEN_ANIMATION_DURATION = exports.DEFAULT_OPEN_ANIMATION_DURATION = 500;
const DEFAULT_CLOSE_ANIMATION_DURATION = exports.DEFAULT_CLOSE_ANIMATION_DURATION = 500;
/** Snap index the sheet opens to when `snapPoints` is provided */
const DEFAULT_SNAP_INDEX = exports.DEFAULT_SNAP_INDEX = 0;
/**
* Velocity look-ahead (in pixels per `px/ms` of release velocity) used to project
* where a flick would land, so a fast drag carries the sheet to a farther snap point
* instead of always settling on the nearest one.
*/
const SNAP_VELOCITY_FACTOR = exports.SNAP_VELOCITY_FACTOR = 50;
/**
* When the projected release position falls below `lowestSnapPoint * CLOSE_SNAP_RATIO`
* (and `closeOnDragDown` is enabled) the sheet closes instead of snapping. With a single
* snap point this reproduces the legacy "close when dragged past 1/3 of its height" rule.
*/
const CLOSE_SNAP_RATIO = exports.CLOSE_SNAP_RATIO = 2 / 3;
//# sourceMappingURL=index.js.map