@seed-design/react-drawer 1.0.3 → 1.0.4

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.
@@ -1114,7 +1114,7 @@ const LONG_HANDLE_PRESS_TIMEOUT = 250;
1114
1114
  const DOUBLE_TAP_TIMEOUT = 120;
1115
1115
  const DrawerHandle = /*#__PURE__*/ forwardRef((props, ref)=>{
1116
1116
  const { preventCycle = false, children, ...rest } = props;
1117
- const { closeDrawer, isDragging, snapPoints, activeSnapPoint, setActiveSnapPoint, dismissible, handleOnly, isOpen, onPress, onDrag } = useDrawerContext();
1117
+ const { closeDrawer, isDragging, snapPoints, activeSnapPoint, setActiveSnapPoint, dismissible, handleOnly, isOpen, onPress, onDrag, onRelease } = useDrawerContext();
1118
1118
  const closeTimeoutIdRef = useRef(null);
1119
1119
  const shouldCancelInteractionRef = useRef(false);
1120
1120
  function handleStartCycle() {
@@ -1174,7 +1174,10 @@ const DrawerHandle = /*#__PURE__*/ forwardRef((props, ref)=>{
1174
1174
  onPointerMove: (e)=>{
1175
1175
  if (handleOnly) onDrag(e);
1176
1176
  },
1177
- // onPointerUp is already handled by the content component
1177
+ onPointerUp: (e)=>{
1178
+ if (handleOnly) onRelease(e);
1179
+ handleCancelInteraction();
1180
+ },
1178
1181
  "data-drawer-visible": isOpen ? "true" : "false",
1179
1182
  "data-handle": "",
1180
1183
  "aria-hidden": "true",
@@ -1137,7 +1137,7 @@ const LONG_HANDLE_PRESS_TIMEOUT = 250;
1137
1137
  const DOUBLE_TAP_TIMEOUT = 120;
1138
1138
  const DrawerHandle = /*#__PURE__*/ React.forwardRef((props, ref)=>{
1139
1139
  const { preventCycle = false, children, ...rest } = props;
1140
- const { closeDrawer, isDragging, snapPoints, activeSnapPoint, setActiveSnapPoint, dismissible, handleOnly, isOpen, onPress, onDrag } = useDrawerContext();
1140
+ const { closeDrawer, isDragging, snapPoints, activeSnapPoint, setActiveSnapPoint, dismissible, handleOnly, isOpen, onPress, onDrag, onRelease } = useDrawerContext();
1141
1141
  const closeTimeoutIdRef = React.useRef(null);
1142
1142
  const shouldCancelInteractionRef = React.useRef(false);
1143
1143
  function handleStartCycle() {
@@ -1197,7 +1197,10 @@ const DrawerHandle = /*#__PURE__*/ React.forwardRef((props, ref)=>{
1197
1197
  onPointerMove: (e)=>{
1198
1198
  if (handleOnly) onDrag(e);
1199
1199
  },
1200
- // onPointerUp is already handled by the content component
1200
+ onPointerUp: (e)=>{
1201
+ if (handleOnly) onRelease(e);
1202
+ handleCancelInteraction();
1203
+ },
1201
1204
  "data-drawer-visible": isOpen ? "true" : "false",
1202
1205
  "data-handle": "",
1203
1206
  "aria-hidden": "true",
package/lib/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- var Drawer12s = require('./Drawer-12s-D1dD-wen.cjs');
1
+ var Drawer12s = require('./Drawer-12s-Yr_NcCoF.cjs');
2
2
 
3
3
  var Drawer_namespace = {
4
4
  __proto__: null,
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DrawerBackdrop, a as DrawerCloseButton, b as DrawerContent, c as DrawerDescription, d as DrawerHandle, e as DrawerPositioner, f as DrawerRoot, g as DrawerTitle, h as DrawerTrigger } from './Drawer-12s-Cg9AJtdN.js';
2
- export { u as useDrawer, i as useDrawerContext } from './Drawer-12s-Cg9AJtdN.js';
1
+ import { D as DrawerBackdrop, a as DrawerCloseButton, b as DrawerContent, c as DrawerDescription, d as DrawerHandle, e as DrawerPositioner, f as DrawerRoot, g as DrawerTitle, h as DrawerTrigger } from './Drawer-12s-BOMSoUDc.js';
2
+ export { u as useDrawer, i as useDrawerContext } from './Drawer-12s-BOMSoUDc.js';
3
3
 
4
4
  var Drawer_namespace = {
5
5
  __proto__: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-design/react-drawer",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/daangn/seed-design.git",
package/src/Drawer.tsx CHANGED
@@ -325,6 +325,7 @@ export const DrawerHandle = forwardRef<HTMLDivElement, DrawerHandleProps>((props
325
325
  isOpen,
326
326
  onPress,
327
327
  onDrag,
328
+ onRelease,
328
329
  } = useDrawerContext();
329
330
 
330
331
  const closeTimeoutIdRef = useRef<number | null>(null);
@@ -396,7 +397,10 @@ export const DrawerHandle = forwardRef<HTMLDivElement, DrawerHandleProps>((props
396
397
  onPointerMove={(e) => {
397
398
  if (handleOnly) onDrag(e);
398
399
  }}
399
- // onPointerUp is already handled by the content component
400
+ onPointerUp={(e) => {
401
+ if (handleOnly) onRelease(e);
402
+ handleCancelInteraction();
403
+ }}
400
404
  data-drawer-visible={isOpen ? "true" : "false"}
401
405
  data-handle=""
402
406
  aria-hidden="true"