@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.
- package/dist/components/Drawer/Drawer.d.ts +3 -47
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1829 -1816
- package/dist/index.js.map +1 -1
- package/dist/util/useResizableDrawer.d.ts +23 -45
- package/dist/util/useResizableDrawer.d.ts.map +1 -1
- package/dist/voodo.css +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
*
|
|
36
|
-
*
|
|
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;
|
|
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;AAKjE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAYD,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACvD,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,KAAK,CAAC,SAAS,CAAC;IACvD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmEjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|