@react-hive/honey-layout 1.3.0-beta → 2.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.
@@ -1,2 +1,2 @@
1
1
  import { HoneyGridColumnStyledProps } from './HoneyGridColumn.styled';
2
- export type HoneyGridColumnProps = Omit<HoneyGridColumnStyledProps, 'columns' | 'spacing' | 'totalColumns' | 'totalTakeColumns'> & {};
2
+ export type HoneyGridColumnProps = Omit<HoneyGridColumnStyledProps, 'columns' | 'spacing' | 'totalColumns' | 'totalTakeColumns' | 'applyMaxWidth'> & {};
@@ -1,12 +1,14 @@
1
- import { ReactNode } from 'react';
2
- import { ComponentWithAs, HoneyStatusContentOptions } from '../../types';
3
- import { HoneyListItem, HoneyListItemKey } from './HoneyList.types';
1
+ import { RefAttributes, default as React } from 'react';
2
+ import { HoneyStatusContentOptions } from '../../types';
3
+ import { HoneyListGenericProps, HoneyListItem } from './HoneyList.types';
4
4
  import { HoneyBoxProps } from '../HoneyBox';
5
- export type HoneyListGenericProps<Item extends HoneyListItem, T = unknown> = HoneyBoxProps & {
6
- children: (item: Item, itemIndex: number, thisItems: Item[]) => ReactNode;
7
- items: Item[] | undefined;
8
- itemKey?: HoneyListItemKey<Item>;
9
- } & T;
10
- type HoneyListProps<Item extends HoneyListItem> = HoneyListGenericProps<Item, Omit<HoneyStatusContentOptions, 'isNoContent'>>;
11
- export declare const HoneyList: <Item extends HoneyListItem>({ children, items, itemKey, isLoading, loadingContent, isError, errorContent, noContent, ...boxProps }: ComponentWithAs<HoneyListProps<Item>>) => import("react/jsx-runtime").JSX.Element;
5
+ type HoneyListProps<Item extends HoneyListItem> = HoneyBoxProps & HoneyListGenericProps<Item, Omit<HoneyStatusContentOptions, 'isNoContent'>>;
6
+ /**
7
+ * The `HoneyList` is a forward-ref component that renders a list of items
8
+ * and allows a ref to be forwarded to the underlying DOM element.
9
+ *
10
+ * @template Item - Represents the type of items to be rendered in the list.
11
+ * @template Element - Represents the type of the HTML element that will receive the ref.
12
+ */
13
+ export declare const HoneyList: <Item extends HoneyListItem, Element extends HTMLElement>(props: HoneyListProps<Item> & RefAttributes<Element>) => React.ReactElement;
12
14
  export {};
@@ -1,3 +1,34 @@
1
+ import { ReactNode } from 'react';
1
2
  export type HoneyListItem = object | string | number;
2
3
  export type HoneyListItemKey<Item extends HoneyListItem> = ((item: Item) => string) | keyof Item;
3
4
  export type HoneyListItemId<Item extends HoneyListItem> = Item[keyof Item] | string | number;
5
+ /**
6
+ * Generic props for HoneyList component.
7
+ *
8
+ * @template Item - The type of the items to be rendered in the list.
9
+ * @template T - Additional props type.
10
+ */
11
+ export type HoneyListGenericProps<Item extends HoneyListItem, T = unknown> = {
12
+ /**
13
+ * Function to render each item in the list.
14
+ *
15
+ * @param {Item} item - The current item to be rendered.
16
+ * @param {number} itemIndex - The index of the current item.
17
+ * @param {Item[]} thisItems - The array of all items.
18
+ *
19
+ * @returns {ReactNode} - The node to be rendered for each item.
20
+ */
21
+ children: (item: Item, itemIndex: number, thisItems: Item[]) => ReactNode;
22
+ /**
23
+ * The array of items to be displayed in the list.
24
+ *
25
+ * @type {Item[] | undefined}
26
+ */
27
+ items: Item[] | undefined;
28
+ /**
29
+ * Optional function or key to uniquely identify each item in the list.
30
+ *
31
+ * @type {HoneyListItemKey<Item>}
32
+ */
33
+ itemKey?: HoneyListItemKey<Item>;
34
+ } & T;