@voxel51/voodo 0.0.31 → 0.0.32

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,68 +1,24 @@
1
1
  import { default as React } from 'react';
2
2
  import { UseDisclosureOptions } from '../../util/useDisclosure';
3
- /**
4
- * Edge of the viewport the drawer is anchored to. Determines both the
5
- * drag axis (`left`/`right` resize horizontally; `top`/`bottom` resize
6
- * vertically) and the direction the drawer expands when opened.
7
- */
8
3
  export type DrawerSide = "left" | "right" | "top" | "bottom";
9
- /**
10
- * State passed to the {@link DrawerProps.header} render prop so callers
11
- * can react to and control the drawer's open/closed state from within
12
- * their header content (e.g. a toggle button).
13
- */
14
4
  export interface DrawerHeaderState {
15
- /** Whether the drawer is currently expanded. */
16
5
  open: boolean;
17
- /** Flip the drawer between open and closed. */
18
6
  toggle: () => void;
19
7
  }
20
- /**
21
- * Props for the {@link Drawer} component. Extends `UseDisclosureOptions`
22
- * so callers can drive the open state in either controlled
23
- * (`open` + `onOpenChange`) or uncontrolled (`defaultOpen`) mode.
24
- */
25
8
  export interface DrawerProps extends UseDisclosureOptions {
26
- /** Edge the drawer is anchored to. Defaults to `"bottom"`. */
27
9
  side?: DrawerSide;
28
- /** Size (in px) the drawer opens to when first rendered or re-opened. */
29
- defaultSize: number;
30
- /** Minimum size (in px) the user can drag the drawer down to while open. */
31
- minSize: number;
32
- /** Maximum size (in px) the user can drag the drawer up to. */
33
- maxSize: number;
34
10
  /**
35
- * How the drawer relates to surrounding layout.
36
- * - `"push"` (default): the drawer occupies space and pushes siblings.
37
- * - `"float"`: the drawer overlays content without affecting layout.
11
+ * Maximum content-area size in pixels. The header and resize handle are
12
+ * excluded — `maxSize` caps only the scrollable body region.
38
13
  */
14
+ maxSize: number;
39
15
  mode?: "push" | "float";
40
- /**
41
- * Render prop for the always-visible header area. Receives open state and
42
- * toggle. Everything the caller renders here stays visible when collapsed —
43
- * toggle button, ruler, pinned rows, etc. Its height is measured and used
44
- * as the drawer's closed size automatically.
45
- */
46
16
  header?: (state: DrawerHeaderState) => React.ReactNode;
47
- /** Called whenever the user finishes resizing the drawer. */
48
17
  onSizeChange?: (size: number) => void;
49
- /** Ref forwarded to the scrollable body element wrapping `children`. */
50
- bodyRef?: React.RefObject<HTMLDivElement | null>;
51
- /** Drawer body content, rendered inside the scrollable area. */
52
18
  children?: React.ReactNode;
53
- /** Additional class name applied to the drawer root. */
54
19
  className?: string;
55
- /** Inline styles merged into the drawer root (after the sizing style). */
56
20
  style?: React.CSSProperties;
57
21
  }
58
- /**
59
- * Resizable, collapsible drawer anchored to one edge of its container.
60
- *
61
- * The drawer is draggable along its perpendicular axis between `minSize`
62
- * and `maxSize`, and collapses to the measured height of its `header`
63
- * render prop (plus the drag handle) when closed. Open state can be
64
- * controlled or uncontrolled via the inherited disclosure props.
65
- */
66
22
  declare const Drawer: React.FC<DrawerProps>;
67
23
  export default Drawer;
68
24
  //# sourceMappingURL=Drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAMjE;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,+CAA+C;IAC/C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAcD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACvD,8DAA8D;IAC9D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,OAAO,EAAE,MAA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