@wavv/ui 1.8.21 → 1.9.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.
- package/build/cjs/index.js +1 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/types/components/Tabs.d.ts +20 -0
- package/build/cjs/types/hooks/index.d.ts +1 -0
- package/build/cjs/types/hooks/usePrevious.d.ts +2 -0
- package/build/cjs/types/index.d.ts +2 -0
- package/build/esm/index.js +8 -8
- package/build/esm/index.js.map +1 -1
- package/build/esm/types/components/Tabs.d.ts +20 -0
- package/build/esm/types/hooks/index.d.ts +1 -0
- package/build/esm/types/hooks/usePrevious.d.ts +2 -0
- package/build/esm/types/index.d.ts +2 -0
- package/build/index.d.ts +25 -5
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Margin } from './types';
|
|
3
|
+
type TabItem = {
|
|
4
|
+
id: string | number;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
type Props<ItemType> = {
|
|
8
|
+
/** The tab items to be rendered */
|
|
9
|
+
items: ItemType[];
|
|
10
|
+
/** The id of the active tab */
|
|
11
|
+
activeItem: string | number;
|
|
12
|
+
/** Controls whether the tabs fill the space of the container */
|
|
13
|
+
itemWidth?: 'auto' | 'fill';
|
|
14
|
+
/** The gap between each tab item */
|
|
15
|
+
itemGap?: string | number;
|
|
16
|
+
/** The function called with the tab item after the tab is changed */
|
|
17
|
+
onChange: (tab: ItemType) => void;
|
|
18
|
+
} & Margin;
|
|
19
|
+
declare const Tabs: <ItemType extends TabItem>({ items, activeItem, itemWidth, itemGap, onChange, ...props }: Props<ItemType>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default Tabs;
|
|
@@ -4,3 +4,4 @@ export { default as useSelectAll } from './useSelectAll';
|
|
|
4
4
|
export { default as useEventListener } from './useEventListener';
|
|
5
5
|
export { default as useSelect } from './useSelect';
|
|
6
6
|
export { default as useElementObserver } from './useElementObserver';
|
|
7
|
+
export { default as usePrevious } from './usePrevious';
|
|
@@ -39,6 +39,7 @@ export { default as TransferList } from './components/TransferList';
|
|
|
39
39
|
export { default as Table } from './components/Table';
|
|
40
40
|
export { default as Toggle } from './components/Toggle';
|
|
41
41
|
export { default as Tooltip } from './components/Tooltip';
|
|
42
|
+
export { default as Tabs } from './components/Tabs';
|
|
42
43
|
export { default as theme } from './theme';
|
|
43
44
|
export type { ITheme, ThemeProp } from './theme/ThemeTypes';
|
|
44
45
|
export type { IconNames } from './components/Icon/icons';
|
|
@@ -52,6 +53,7 @@ export { default as useSelectAll } from './hooks/useSelectAll';
|
|
|
52
53
|
export { default as useWindowSize } from './hooks/useWindowSize';
|
|
53
54
|
export { default as useConfirm } from './hooks/useConfirm';
|
|
54
55
|
export { default as useElementObserver } from './hooks/useElementObserver';
|
|
56
|
+
export { default as usePrevious } from './hooks/usePrevious';
|
|
55
57
|
export { default as formatDate } from './utils/formatDate';
|
|
56
58
|
export { default as copyToClipboard } from './utils/copyToClipboard';
|
|
57
59
|
export { default as numberWithCommas } from './utils/numberWithCommas';
|