@auldrant/ui 0.10.0 → 0.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.
@@ -15,6 +15,8 @@ interface IDialogProps extends IBaseProps {
15
15
  defaultAction?: IDialogAction;
16
16
  /** Additional action buttons. */
17
17
  actions?: IDialogAction[];
18
+ /** Whether the dialog can be dragged by its header. Defaults to true. */
19
+ draggable?: boolean;
18
20
  /** Rich body content. Renders below message if both provided. */
19
21
  children?: ComponentChildren;
20
22
  }
@@ -21,6 +21,8 @@ interface IDialogBaseProps extends IBaseProps {
21
21
  title: string;
22
22
  /** Whether this is an alert dialog (role="alertdialog"). */
23
23
  alert?: boolean;
24
+ /** Whether the dialog can be dragged by its header. */
25
+ draggable?: boolean;
24
26
  /** Called when the dialog is dismissed via Escape. */
25
27
  onDismiss: () => void;
26
28
  /** Called when the backdrop is clicked. Only Dialog wires this. */
@@ -20,6 +20,8 @@ interface IModalProps extends IBaseProps {
20
20
  /** Focus the Cancel button on open instead of defaultAction.
21
21
  * Use for destructive/dangerous actions to prevent accidental confirmation. */
22
22
  focusCancel?: boolean;
23
+ /** Whether the modal can be dragged by its header. Defaults to false. */
24
+ draggable?: boolean;
23
25
  /** Rich body content. Renders below message if both provided. */
24
26
  children?: ComponentChildren;
25
27
  }
@@ -0,0 +1,13 @@
1
+ import { RefObject } from 'preact';
2
+ interface IDraggableResult {
3
+ /** Whether a drag is currently in progress. */
4
+ isDragging: boolean;
5
+ /** Reset position to center (removes CSS custom properties). */
6
+ reset: () => void;
7
+ }
8
+ /**
9
+ * Makes an element draggable via pointer events.
10
+ * Sets `--drag-x` and `--drag-y` CSS custom properties on the container.
11
+ */
12
+ declare function useDraggable(handleRef: RefObject<HTMLElement>, containerRef: RefObject<HTMLElement>, enabled: boolean): IDraggableResult;
13
+ export default useDraggable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auldrant/ui",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "description": "Accessible Preact component library with design tokens and CSS modules",
6
6
  "author": "Colonel Jade",