@foris/avocado-suite 1.8.4 → 1.8.5

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,11 +1,22 @@
1
1
  import React from 'react';
2
- interface DrawerProps {
2
+ export interface DrawerProps {
3
+ /** Optional custom header row content (shown next to the title area). */
3
4
  header?: React.ReactNode;
5
+ /** Renders below the main header row when a header is shown. */
4
6
  headerExtra?: React.ReactNode;
7
+ /** Title shown in the header; omit with `header` / `headerExtra` to control visibility. */
5
8
  title?: React.ReactNode;
9
+ /** Main panel content (scrollable body). */
6
10
  children: React.ReactNode;
11
+ /** Sticky footer below the body. */
7
12
  footer?: React.ReactNode;
13
+ /** When `true`, the drawer is visible (open animation). Controlled from the parent. */
8
14
  isOpen: boolean;
15
+ /**
16
+ * If `true`, clicking the backdrop closes the drawer. If there is no header, this is often the only way to dismiss without `onClose` from children.
17
+ *
18
+ * @default false
19
+ */
9
20
  closeOnOverlayClick?: boolean;
10
21
  /**
11
22
  * @description Height gap in pixels to subtract from the drawer's height, so the drawer appears shorter by this amount. Useful for keeping the app header visible above the drawer.
@@ -15,9 +26,31 @@ interface DrawerProps {
15
26
  * <Drawer heightGap={50} />
16
27
  */
17
28
  heightGap?: number;
29
+ /**
30
+ * Slide-in edge: `right` (default) or `left`.
31
+ *
32
+ * @default 'right'
33
+ */
18
34
  origin?: 'left' | 'right';
35
+ /** Class name on the root overlay `section`. */
19
36
  className?: string;
37
+ /** Class name on the inner panel (`drawer_content`), e.g. to override max-width. */
20
38
  contentClassName?: string;
39
+ /**
40
+ * When false, the drawer body has no horizontal/vertical padding (default padding is kept for typical form layouts).
41
+ *
42
+ * @default true
43
+ */
44
+ bodyPadding?: boolean;
45
+ /**
46
+ * `fit` sizes the panel to the child block width (`width: auto`, capped at 600px). Use with children that define a stable width (e.g. ChatPanel min/max). `default` keeps full-width panel behavior (max 540px).
47
+ *
48
+ * @default 'default'
49
+ */
50
+ contentWidth?: 'default' | 'fit';
51
+ /**
52
+ * Called after the close animation finishes and the drawer unmounts from the tree (when transitioning from open to closed).
53
+ */
21
54
  onClose: () => void;
22
55
  }
23
56
  declare const Drawer: React.FC<DrawerProps>;
package/dist/index.d.ts CHANGED
@@ -77,6 +77,7 @@ export type { TextareaProps } from './components/textarea/Textarea';
77
77
  export type { TextProps } from './components/text/Text';
78
78
  export type { TimerTime } from './components/timer/Timer';
79
79
  export type { ModalProps } from './components/modal/Modal';
80
+ export type { DrawerProps } from './components/drawer/Drawer';
80
81
  export type { PillProps } from './components/Pill/Pill';
81
82
  export type { ThemeMode, Theme } from './types/theme.types';
82
83
  export * from './types/table.types';