@react-hive/honey-layout 8.1.0 → 9.2.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.
@@ -2,16 +2,16 @@ import { FastOmit } from '@react-hive/honey-style';
2
2
  import { HoneyListGenericProps, HoneyListItem } from './HoneyList.types';
3
3
  import { HoneyStatusContentProps } from '../HoneyStatusContent';
4
4
  import { HoneyListStyledProps } from './HoneyListStyled';
5
- export type HoneyListProps<Item extends HoneyListItem> = FastOmit<HoneyListStyledProps, 'children'> & HoneyListGenericProps<Item> & FastOmit<HoneyStatusContentProps, 'isNoContent'>;
5
+ export type HoneyListProps<Item extends HoneyListItem> = FastOmit<HoneyListStyledProps, 'children'> & HoneyListGenericProps<Item> & FastOmit<HoneyStatusContentProps, 'empty'>;
6
6
  /**
7
7
  * A generic and reusable list component that handles different states such as loading, error, or no content,
8
8
  * and dynamically renders a list of items with custom content for each item.
9
9
  *
10
10
  * This component provides a flexible and accessible way to display lists, with built-in support for
11
- * various states to enhance user experience. It accepts a `ref` to access the underlying HTML element
11
+ * various states to enhance the user experience. It accepts a `ref` to access the underlying HTML element
12
12
  * for greater control and customization.
13
13
  *
14
14
  * @template Item - Represents the type of the items to be rendered in the list. This allows the component
15
15
  * to be used with any item type.
16
16
  */
17
- export declare const HoneyList: <Item extends HoneyListItem>({ ref, children, items, itemKey, isLoading, isLoadingOverContent, loadingContent, isError, errorContent, noContent, ...props }: HoneyListProps<Item>) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const HoneyList: <Item extends HoneyListItem>({ ref, children, items, itemKey, loading, loadingOverContent, loadingContent, error, errorContent, emptyContent, ...props }: HoneyListProps<Item>) => import("react/jsx-runtime").JSX.Element;
@@ -9,45 +9,45 @@ export interface HoneyStatusContentProps {
9
9
  *
10
10
  * @default false
11
11
  */
12
- isLoading?: boolean;
12
+ loading?: boolean;
13
13
  /**
14
- * A flag indicating whether the loading content should appear on top of the content.
14
+ * The content to display when the component is in a loading state.
15
15
  *
16
- * @default false
16
+ * @default null
17
17
  */
18
- isLoadingOverContent?: boolean;
18
+ loadingContent?: ReactNode;
19
19
  /**
20
- * A flag indicating whether the component has encountered an error.
20
+ * A flag indicating whether the loading content should appear on top of the content.
21
21
  *
22
22
  * @default false
23
23
  */
24
- isError?: boolean;
24
+ loadingOverContent?: boolean;
25
25
  /**
26
- * A flag indicating whether the component has no content to display.
26
+ * A flag indicating whether the component has encountered an error.
27
27
  *
28
28
  * @default false
29
29
  */
30
- isNoContent?: boolean;
30
+ error?: boolean;
31
31
  /**
32
- * The content to display when the component is in a loading state.
32
+ * The content to display when the component has encountered an error.
33
33
  *
34
34
  * @default null
35
35
  */
36
- loadingContent?: ReactNode;
36
+ errorContent?: ReactNode;
37
37
  /**
38
- * The content to display when the component has encountered an error.
38
+ * A flag indicating whether the component has no content to display.
39
39
  *
40
- * @default null
40
+ * @default false
41
41
  */
42
- errorContent?: ReactNode;
42
+ empty?: boolean;
43
43
  /**
44
44
  * The content to display when the component has no content to display.
45
45
  *
46
46
  * @default null
47
47
  */
48
- noContent?: ReactNode;
48
+ emptyContent?: ReactNode;
49
49
  }
50
50
  /**
51
51
  * A component that conditionally renders blocks based on specified boolean flags.
52
52
  */
53
- export declare const HoneyStatusContent: ({ children, isLoading, isLoadingOverContent, isError, isNoContent, loadingContent, errorContent, noContent, }: PropsWithChildren<HoneyStatusContentProps>) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
53
+ export declare const HoneyStatusContent: ({ children, loading, loadingOverContent, error, empty, loadingContent, errorContent, emptyContent, }: PropsWithChildren<HoneyStatusContentProps>) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
@@ -6,12 +6,13 @@ import { Nullable } from '../types';
6
6
  * @template Element - The type of the draggable element (must extend HTMLElement).
7
7
  *
8
8
  * @param draggableElement - The element being dragged.
9
+ * @param e - The event that initiated the drag. Can be either a `MouseEvent` or a `TouchEvent`.
9
10
  *
10
11
  * @returns A Promise that resolves to a boolean:
11
12
  * - `false` to cancel the drag.
12
13
  * - `true` to proceed with the drag.
13
14
  */
14
- export type HoneyDragOnStartHandler<Element extends HTMLElement> = (draggableElement: Element) => Promise<boolean>;
15
+ export type HoneyDragOnStartHandler<Element extends HTMLElement> = (draggableElement: Element, e: MouseEvent | TouchEvent) => Promise<boolean>;
15
16
  /**
16
17
  * Context provided to the move handler, containing information about the drag's movement.
17
18
  */
@@ -83,10 +84,11 @@ interface HoneyDragEndContext {
83
84
  * @param context - The context containing details about the drag operation at its end.
84
85
  * Provides information such as the final position and drag result.
85
86
  * @param draggableElement - The element that was being dragged.
87
+ * @param e - The event that ended the drag. Can be either a `MouseEvent` or a `TouchEvent`.
86
88
  *
87
89
  * @returns A Promise that resolves when the end handler completes its operations.
88
90
  */
89
- export type HoneyDragOnEndHandler<Element extends HTMLElement> = (context: HoneyDragEndContext, draggableElement: Element) => Promise<void>;
91
+ export type HoneyDragOnEndHandler<Element extends HTMLElement> = (context: HoneyDragEndContext, draggableElement: Element, e: MouseEvent | TouchEvent) => Promise<void>;
90
92
  /**
91
93
  * A set of handlers that define the behavior of the drag operation at different stages.
92
94
  * These handlers are customizable for managing drag initialization, movement, and completion.