@fluentui/react-tabs 9.0.0-beta.8 → 9.0.0-rc.3
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/CHANGELOG.json +371 -1
- package/CHANGELOG.md +101 -4
- package/dist/{react-tabs.d.ts → index.d.ts} +73 -70
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Tab/Tab.types.js.map +1 -1
- package/lib/components/Tab/index.js +1 -0
- package/lib/components/Tab/index.js.map +1 -1
- package/lib/components/Tab/renderTab.js +1 -2
- package/lib/components/Tab/renderTab.js.map +1 -1
- package/lib/components/Tab/useTab.js +28 -29
- package/lib/components/Tab/useTab.js.map +1 -1
- package/lib/components/Tab/useTabAnimatedIndicator.js +134 -0
- package/lib/components/Tab/useTabAnimatedIndicator.js.map +1 -0
- package/lib/components/Tab/useTabStyles.js +220 -88
- package/lib/components/Tab/useTabStyles.js.map +1 -1
- package/lib/components/TabList/TabList.types.js.map +1 -1
- package/lib/components/TabList/TabListContext.js +6 -0
- package/lib/components/TabList/TabListContext.js.map +1 -1
- package/lib/components/TabList/renderTabList.js +0 -1
- package/lib/components/TabList/renderTabList.js.map +1 -1
- package/lib/components/TabList/useTabList.js +28 -52
- package/lib/components/TabList/useTabList.js.map +1 -1
- package/lib/components/TabList/useTabListContextValues.js +4 -0
- package/lib/components/TabList/useTabListContextValues.js.map +1 -1
- package/lib/components/TabList/useTabListStyles.js +14 -91
- package/lib/components/TabList/useTabListStyles.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Tab/index.js +2 -0
- package/lib-commonjs/components/Tab/index.js.map +1 -1
- package/lib-commonjs/components/Tab/renderTab.js +1 -2
- package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTab.js +28 -29
- package/lib-commonjs/components/Tab/useTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js +148 -0
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js.map +1 -0
- package/lib-commonjs/components/Tab/useTabStyles.js +220 -88
- package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
- package/lib-commonjs/components/TabList/TabListContext.js +6 -0
- package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
- package/lib-commonjs/components/TabList/renderTabList.js +0 -1
- package/lib-commonjs/components/TabList/renderTabList.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabList.js +27 -51
- package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabListContextValues.js +4 -0
- package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabListStyles.js +14 -94
- package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -1
- package/lib-commonjs/index.js +64 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +12 -21
- package/lib/Tab.d.ts +0 -1
- package/lib/TabList.d.ts +0 -1
- package/lib/components/Tab/Tab.d.ts +0 -6
- package/lib/components/Tab/Tab.types.d.ts +0 -52
- package/lib/components/Tab/index.d.ts +0 -5
- package/lib/components/Tab/renderTab.d.ts +0 -5
- package/lib/components/Tab/useTab.d.ts +0 -12
- package/lib/components/Tab/useTabStyles.d.ts +0 -6
- package/lib/components/TabList/TabList.d.ts +0 -6
- package/lib/components/TabList/TabList.types.d.ts +0 -99
- package/lib/components/TabList/TabListContext.d.ts +0 -3
- package/lib/components/TabList/index.d.ts +0 -5
- package/lib/components/TabList/renderTabList.d.ts +0 -5
- package/lib/components/TabList/useTabList.d.ts +0 -12
- package/lib/components/TabList/useTabListContextValues.d.ts +0 -2
- package/lib/components/TabList/useTabListStyles.d.ts +0 -9
- package/lib/index.d.ts +0 -2
- package/lib/tab.constants.d.ts +0 -15
- package/lib/tab.constants.js +0 -17
- package/lib/tab.constants.js.map +0 -1
- package/lib-commonjs/Tab.d.ts +0 -1
- package/lib-commonjs/TabList.d.ts +0 -1
- package/lib-commonjs/components/Tab/Tab.d.ts +0 -6
- package/lib-commonjs/components/Tab/Tab.types.d.ts +0 -52
- package/lib-commonjs/components/Tab/index.d.ts +0 -5
- package/lib-commonjs/components/Tab/renderTab.d.ts +0 -5
- package/lib-commonjs/components/Tab/useTab.d.ts +0 -12
- package/lib-commonjs/components/Tab/useTabStyles.d.ts +0 -6
- package/lib-commonjs/components/TabList/TabList.d.ts +0 -6
- package/lib-commonjs/components/TabList/TabList.types.d.ts +0 -99
- package/lib-commonjs/components/TabList/TabListContext.d.ts +0 -3
- package/lib-commonjs/components/TabList/index.d.ts +0 -5
- package/lib-commonjs/components/TabList/renderTabList.d.ts +0 -5
- package/lib-commonjs/components/TabList/useTabList.d.ts +0 -12
- package/lib-commonjs/components/TabList/useTabListContextValues.d.ts +0 -2
- package/lib-commonjs/components/TabList/useTabListStyles.d.ts +0 -9
- package/lib-commonjs/index.d.ts +0 -2
- package/lib-commonjs/tab.constants.d.ts +0 -15
- package/lib-commonjs/tab.constants.js +0 -23
- package/lib-commonjs/tab.constants.js.map +0 -1
package/lib/TabList.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/TabList/index';
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
|
-
/**
|
|
3
|
-
* Any value that identifies a specific tab.
|
|
4
|
-
*/
|
|
5
|
-
export declare type TabValue = unknown;
|
|
6
|
-
export declare type TabSlots = {
|
|
7
|
-
/**
|
|
8
|
-
* Root of the component.
|
|
9
|
-
*/
|
|
10
|
-
root: Slot<'div'>;
|
|
11
|
-
/**
|
|
12
|
-
* Icon that renders before the content.
|
|
13
|
-
*/
|
|
14
|
-
icon?: Slot<'span'>;
|
|
15
|
-
/**
|
|
16
|
-
* Component children are placed in this slot
|
|
17
|
-
* Avoid using the `children` property in this slot in favour of Component children whenever possible.
|
|
18
|
-
*/
|
|
19
|
-
content: NonNullable<Slot<'span'>>;
|
|
20
|
-
};
|
|
21
|
-
declare type TabCommons = {
|
|
22
|
-
/**
|
|
23
|
-
* The value that identifies this tab when selected.
|
|
24
|
-
*/
|
|
25
|
-
value: TabValue;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Tab Props
|
|
29
|
-
*/
|
|
30
|
-
export declare type TabProps = ComponentProps<Partial<TabSlots>> & TabCommons;
|
|
31
|
-
/**
|
|
32
|
-
* State used in rendering Tab
|
|
33
|
-
*/
|
|
34
|
-
export declare type TabState = ComponentState<TabSlots> & TabCommons & {
|
|
35
|
-
/**
|
|
36
|
-
* A tab supports 'transparent' and 'subtle' appearance.
|
|
37
|
-
*/
|
|
38
|
-
appearance?: string;
|
|
39
|
-
/**
|
|
40
|
-
* If this tab is selected.
|
|
41
|
-
*/
|
|
42
|
-
selected?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* A tab can be either 'small' or 'medium' size.
|
|
45
|
-
*/
|
|
46
|
-
size: 'small' | 'medium';
|
|
47
|
-
/**
|
|
48
|
-
* A tab can arrange its content based on if the tabs in the list are arranged vertically.
|
|
49
|
-
*/
|
|
50
|
-
vertical: boolean;
|
|
51
|
-
};
|
|
52
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { TabProps, TabState } from './Tab.types';
|
|
3
|
-
/**
|
|
4
|
-
* Create the state required to render Tab.
|
|
5
|
-
*
|
|
6
|
-
* The returned state can be modified with hooks such as useTabStyles_unstable,
|
|
7
|
-
* before being passed to renderTab_unstable.
|
|
8
|
-
*
|
|
9
|
-
* @param props - props from this instance of Tab
|
|
10
|
-
* @param ref - reference to root HTMLElement of Tab
|
|
11
|
-
*/
|
|
12
|
-
export declare const useTab_unstable: (props: TabProps, ref: React.Ref<HTMLElement>) => TabState;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
3
|
-
import { TabValue } from '../Tab/Tab.types';
|
|
4
|
-
export declare type RegisterTabData = {
|
|
5
|
-
/**
|
|
6
|
-
* The value of the selected tab.
|
|
7
|
-
*/
|
|
8
|
-
value: TabValue;
|
|
9
|
-
ref: React.RefObject<HTMLElement>;
|
|
10
|
-
};
|
|
11
|
-
export declare type RegisterTabEventHandler = (data: RegisterTabData) => void;
|
|
12
|
-
export declare type SelectTabData = {
|
|
13
|
-
/**
|
|
14
|
-
* The value of the selected tab.
|
|
15
|
-
*/
|
|
16
|
-
value: TabValue;
|
|
17
|
-
};
|
|
18
|
-
export declare type SelectTabEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;
|
|
19
|
-
export declare type SelectTabEventHandler = (event: SelectTabEvent, data: SelectTabData) => void;
|
|
20
|
-
export declare type TabListSlots = {
|
|
21
|
-
/**
|
|
22
|
-
* The slot associated with the root element of this tab list.
|
|
23
|
-
*/
|
|
24
|
-
root: Slot<'div'>;
|
|
25
|
-
};
|
|
26
|
-
declare type TabListCommons = {
|
|
27
|
-
/**
|
|
28
|
-
* A tab list can supports 'transparent' and 'subtle' appearance.
|
|
29
|
-
*- 'subtle': Minimizes emphasis to blend into the background until hovered or focused.
|
|
30
|
-
*- 'transparent': No background and border styling
|
|
31
|
-
* The appearance affects each of the contained tabs.
|
|
32
|
-
* @default 'transparent'
|
|
33
|
-
*/
|
|
34
|
-
appearance?: 'transparent' | 'subtle';
|
|
35
|
-
/**
|
|
36
|
-
* Raised when a tab is selected.
|
|
37
|
-
*/
|
|
38
|
-
onTabSelect?: SelectTabEventHandler;
|
|
39
|
-
/**
|
|
40
|
-
* The value of the currently selected tab.
|
|
41
|
-
*/
|
|
42
|
-
selectedValue?: TabValue;
|
|
43
|
-
/**
|
|
44
|
-
* A tab list can be either 'small' or 'medium' size.
|
|
45
|
-
* The size affects each of the contained tabs.
|
|
46
|
-
* @default 'medium'
|
|
47
|
-
*/
|
|
48
|
-
size?: 'small' | 'medium';
|
|
49
|
-
/**
|
|
50
|
-
* A tab list can arrange its tabs vertically.
|
|
51
|
-
* @default false
|
|
52
|
-
*/
|
|
53
|
-
vertical?: boolean;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* TabList Props
|
|
57
|
-
*/
|
|
58
|
-
export declare type TabListProps = ComponentProps<TabListSlots> & TabListCommons & {
|
|
59
|
-
/**
|
|
60
|
-
* The value of the tab to be selected by default.
|
|
61
|
-
* Typically useful when the selectedValue is uncontrolled.
|
|
62
|
-
*/
|
|
63
|
-
defaultSelectedValue?: TabValue;
|
|
64
|
-
};
|
|
65
|
-
export declare type TabListContextValue = Pick<TabListCommons, 'onTabSelect' | 'selectedValue'> & Required<Pick<TabListCommons, 'appearance' | 'size' | 'vertical'>> & {
|
|
66
|
-
/** A callback to allow a tab to register itself with the tab list. */
|
|
67
|
-
onRegister: RegisterTabEventHandler;
|
|
68
|
-
/** A callback to allow a tab to unregister itself with the tab list. */
|
|
69
|
-
onUnregister: RegisterTabEventHandler;
|
|
70
|
-
/**
|
|
71
|
-
* A callback to allow a tab to select itself when pressed.
|
|
72
|
-
*/
|
|
73
|
-
onSelect: SelectTabEventHandler;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Context values used in rendering TabList.
|
|
77
|
-
*/
|
|
78
|
-
export declare type TabListContextValues = {
|
|
79
|
-
/**
|
|
80
|
-
* The context of the tab list available to each tab.
|
|
81
|
-
*/
|
|
82
|
-
tabList: TabListContextValue;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* A bounding rectangle of a tab
|
|
86
|
-
*/
|
|
87
|
-
export declare type TabContentRect = {
|
|
88
|
-
x: number;
|
|
89
|
-
y: number;
|
|
90
|
-
width: number;
|
|
91
|
-
height: number;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* State used in rendering TabList.
|
|
95
|
-
*/
|
|
96
|
-
export declare type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue & {
|
|
97
|
-
selectedTabRect?: TabContentRect;
|
|
98
|
-
};
|
|
99
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { TabListProps, TabListState } from './TabList.types';
|
|
3
|
-
/**
|
|
4
|
-
* Create the state required to render TabList.
|
|
5
|
-
*
|
|
6
|
-
* The returned state can be modified with hooks such as useTabListStyles_unstable,
|
|
7
|
-
* before being passed to renderTabList_unstable.
|
|
8
|
-
*
|
|
9
|
-
* @param props - props from this instance of TabList
|
|
10
|
-
* @param ref - reference to root HTMLElement of TabList
|
|
11
|
-
*/
|
|
12
|
-
export declare const useTabList_unstable: (props: TabListProps, ref: React.Ref<HTMLElement>) => TabListState;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TabListState } from './TabList.types';
|
|
2
|
-
export declare const tabListClassName = "fui-TabList";
|
|
3
|
-
export declare const tabListSelectionIndicatorName = "fui-TabList_SelectionIndicator";
|
|
4
|
-
export declare const indicatorOffsetVar = "--selection-indicator-offset";
|
|
5
|
-
export declare const indicatorLengthVar = "--selection-indicator-length";
|
|
6
|
-
/**
|
|
7
|
-
* Apply styling to the TabList slots based on the state
|
|
8
|
-
*/
|
|
9
|
-
export declare const useTabListStyles_unstable: (state: TabListState) => TabListState;
|
package/lib/index.d.ts
DELETED
package/lib/tab.constants.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const tabPendingDesignTokens: {
|
|
2
|
-
tabPadding: {
|
|
3
|
-
medium: string;
|
|
4
|
-
small: string;
|
|
5
|
-
};
|
|
6
|
-
indicatorThickness: string;
|
|
7
|
-
gap: {
|
|
8
|
-
medium: string;
|
|
9
|
-
small: string;
|
|
10
|
-
};
|
|
11
|
-
contentPadding: {
|
|
12
|
-
medium: string;
|
|
13
|
-
small: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
package/lib/tab.constants.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// TODO: These constants should be replaced with design tokens
|
|
2
|
-
export const tabPendingDesignTokens = {
|
|
3
|
-
tabPadding: {
|
|
4
|
-
medium: '10px',
|
|
5
|
-
small: '6px'
|
|
6
|
-
},
|
|
7
|
-
indicatorThickness: '2px',
|
|
8
|
-
gap: {
|
|
9
|
-
medium: '6px',
|
|
10
|
-
small: '2px'
|
|
11
|
-
},
|
|
12
|
-
contentPadding: {
|
|
13
|
-
medium: '2px',
|
|
14
|
-
small: '2px'
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=tab.constants.js.map
|
package/lib/tab.constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["tab.constants.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,MAAM,sBAAsB,GAAG;AACpC,EAAA,UAAU,EAAE;AACV,IAAA,MAAM,EAAE,MADE;AAEV,IAAA,KAAK,EAAE;AAFG,GADwB;AAKpC,EAAA,kBAAkB,EAAE,KALgB;AAMpC,EAAA,GAAG,EAAE;AAAE,IAAA,MAAM,EAAE,KAAV;AAAiB,IAAA,KAAK,EAAE;AAAxB,GAN+B;AAOpC,EAAA,cAAc,EAAE;AACd,IAAA,MAAM,EAAE,KADM;AAEd,IAAA,KAAK,EAAE;AAFO;AAPoB,CAA/B","sourcesContent":["// TODO: These constants should be replaced with design tokens\nexport const tabPendingDesignTokens = {\n tabPadding: {\n medium: '10px',\n small: '6px',\n },\n indicatorThickness: '2px',\n gap: { medium: '6px', small: '2px' },\n contentPadding: {\n medium: '2px',\n small: '2px',\n },\n};\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/Tab.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Tab/index';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/TabList/index';
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
|
-
/**
|
|
3
|
-
* Any value that identifies a specific tab.
|
|
4
|
-
*/
|
|
5
|
-
export declare type TabValue = unknown;
|
|
6
|
-
export declare type TabSlots = {
|
|
7
|
-
/**
|
|
8
|
-
* Root of the component.
|
|
9
|
-
*/
|
|
10
|
-
root: Slot<'div'>;
|
|
11
|
-
/**
|
|
12
|
-
* Icon that renders before the content.
|
|
13
|
-
*/
|
|
14
|
-
icon?: Slot<'span'>;
|
|
15
|
-
/**
|
|
16
|
-
* Component children are placed in this slot
|
|
17
|
-
* Avoid using the `children` property in this slot in favour of Component children whenever possible.
|
|
18
|
-
*/
|
|
19
|
-
content: NonNullable<Slot<'span'>>;
|
|
20
|
-
};
|
|
21
|
-
declare type TabCommons = {
|
|
22
|
-
/**
|
|
23
|
-
* The value that identifies this tab when selected.
|
|
24
|
-
*/
|
|
25
|
-
value: TabValue;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Tab Props
|
|
29
|
-
*/
|
|
30
|
-
export declare type TabProps = ComponentProps<Partial<TabSlots>> & TabCommons;
|
|
31
|
-
/**
|
|
32
|
-
* State used in rendering Tab
|
|
33
|
-
*/
|
|
34
|
-
export declare type TabState = ComponentState<TabSlots> & TabCommons & {
|
|
35
|
-
/**
|
|
36
|
-
* A tab supports 'transparent' and 'subtle' appearance.
|
|
37
|
-
*/
|
|
38
|
-
appearance?: string;
|
|
39
|
-
/**
|
|
40
|
-
* If this tab is selected.
|
|
41
|
-
*/
|
|
42
|
-
selected?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* A tab can be either 'small' or 'medium' size.
|
|
45
|
-
*/
|
|
46
|
-
size: 'small' | 'medium';
|
|
47
|
-
/**
|
|
48
|
-
* A tab can arrange its content based on if the tabs in the list are arranged vertically.
|
|
49
|
-
*/
|
|
50
|
-
vertical: boolean;
|
|
51
|
-
};
|
|
52
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { TabProps, TabState } from './Tab.types';
|
|
3
|
-
/**
|
|
4
|
-
* Create the state required to render Tab.
|
|
5
|
-
*
|
|
6
|
-
* The returned state can be modified with hooks such as useTabStyles_unstable,
|
|
7
|
-
* before being passed to renderTab_unstable.
|
|
8
|
-
*
|
|
9
|
-
* @param props - props from this instance of Tab
|
|
10
|
-
* @param ref - reference to root HTMLElement of Tab
|
|
11
|
-
*/
|
|
12
|
-
export declare const useTab_unstable: (props: TabProps, ref: React.Ref<HTMLElement>) => TabState;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
3
|
-
import { TabValue } from '../Tab/Tab.types';
|
|
4
|
-
export declare type RegisterTabData = {
|
|
5
|
-
/**
|
|
6
|
-
* The value of the selected tab.
|
|
7
|
-
*/
|
|
8
|
-
value: TabValue;
|
|
9
|
-
ref: React.RefObject<HTMLElement>;
|
|
10
|
-
};
|
|
11
|
-
export declare type RegisterTabEventHandler = (data: RegisterTabData) => void;
|
|
12
|
-
export declare type SelectTabData = {
|
|
13
|
-
/**
|
|
14
|
-
* The value of the selected tab.
|
|
15
|
-
*/
|
|
16
|
-
value: TabValue;
|
|
17
|
-
};
|
|
18
|
-
export declare type SelectTabEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;
|
|
19
|
-
export declare type SelectTabEventHandler = (event: SelectTabEvent, data: SelectTabData) => void;
|
|
20
|
-
export declare type TabListSlots = {
|
|
21
|
-
/**
|
|
22
|
-
* The slot associated with the root element of this tab list.
|
|
23
|
-
*/
|
|
24
|
-
root: Slot<'div'>;
|
|
25
|
-
};
|
|
26
|
-
declare type TabListCommons = {
|
|
27
|
-
/**
|
|
28
|
-
* A tab list can supports 'transparent' and 'subtle' appearance.
|
|
29
|
-
*- 'subtle': Minimizes emphasis to blend into the background until hovered or focused.
|
|
30
|
-
*- 'transparent': No background and border styling
|
|
31
|
-
* The appearance affects each of the contained tabs.
|
|
32
|
-
* @default 'transparent'
|
|
33
|
-
*/
|
|
34
|
-
appearance?: 'transparent' | 'subtle';
|
|
35
|
-
/**
|
|
36
|
-
* Raised when a tab is selected.
|
|
37
|
-
*/
|
|
38
|
-
onTabSelect?: SelectTabEventHandler;
|
|
39
|
-
/**
|
|
40
|
-
* The value of the currently selected tab.
|
|
41
|
-
*/
|
|
42
|
-
selectedValue?: TabValue;
|
|
43
|
-
/**
|
|
44
|
-
* A tab list can be either 'small' or 'medium' size.
|
|
45
|
-
* The size affects each of the contained tabs.
|
|
46
|
-
* @default 'medium'
|
|
47
|
-
*/
|
|
48
|
-
size?: 'small' | 'medium';
|
|
49
|
-
/**
|
|
50
|
-
* A tab list can arrange its tabs vertically.
|
|
51
|
-
* @default false
|
|
52
|
-
*/
|
|
53
|
-
vertical?: boolean;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* TabList Props
|
|
57
|
-
*/
|
|
58
|
-
export declare type TabListProps = ComponentProps<TabListSlots> & TabListCommons & {
|
|
59
|
-
/**
|
|
60
|
-
* The value of the tab to be selected by default.
|
|
61
|
-
* Typically useful when the selectedValue is uncontrolled.
|
|
62
|
-
*/
|
|
63
|
-
defaultSelectedValue?: TabValue;
|
|
64
|
-
};
|
|
65
|
-
export declare type TabListContextValue = Pick<TabListCommons, 'onTabSelect' | 'selectedValue'> & Required<Pick<TabListCommons, 'appearance' | 'size' | 'vertical'>> & {
|
|
66
|
-
/** A callback to allow a tab to register itself with the tab list. */
|
|
67
|
-
onRegister: RegisterTabEventHandler;
|
|
68
|
-
/** A callback to allow a tab to unregister itself with the tab list. */
|
|
69
|
-
onUnregister: RegisterTabEventHandler;
|
|
70
|
-
/**
|
|
71
|
-
* A callback to allow a tab to select itself when pressed.
|
|
72
|
-
*/
|
|
73
|
-
onSelect: SelectTabEventHandler;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Context values used in rendering TabList.
|
|
77
|
-
*/
|
|
78
|
-
export declare type TabListContextValues = {
|
|
79
|
-
/**
|
|
80
|
-
* The context of the tab list available to each tab.
|
|
81
|
-
*/
|
|
82
|
-
tabList: TabListContextValue;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* A bounding rectangle of a tab
|
|
86
|
-
*/
|
|
87
|
-
export declare type TabContentRect = {
|
|
88
|
-
x: number;
|
|
89
|
-
y: number;
|
|
90
|
-
width: number;
|
|
91
|
-
height: number;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* State used in rendering TabList.
|
|
95
|
-
*/
|
|
96
|
-
export declare type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue & {
|
|
97
|
-
selectedTabRect?: TabContentRect;
|
|
98
|
-
};
|
|
99
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { TabListProps, TabListState } from './TabList.types';
|
|
3
|
-
/**
|
|
4
|
-
* Create the state required to render TabList.
|
|
5
|
-
*
|
|
6
|
-
* The returned state can be modified with hooks such as useTabListStyles_unstable,
|
|
7
|
-
* before being passed to renderTabList_unstable.
|
|
8
|
-
*
|
|
9
|
-
* @param props - props from this instance of TabList
|
|
10
|
-
* @param ref - reference to root HTMLElement of TabList
|
|
11
|
-
*/
|
|
12
|
-
export declare const useTabList_unstable: (props: TabListProps, ref: React.Ref<HTMLElement>) => TabListState;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TabListState } from './TabList.types';
|
|
2
|
-
export declare const tabListClassName = "fui-TabList";
|
|
3
|
-
export declare const tabListSelectionIndicatorName = "fui-TabList_SelectionIndicator";
|
|
4
|
-
export declare const indicatorOffsetVar = "--selection-indicator-offset";
|
|
5
|
-
export declare const indicatorLengthVar = "--selection-indicator-length";
|
|
6
|
-
/**
|
|
7
|
-
* Apply styling to the TabList slots based on the state
|
|
8
|
-
*/
|
|
9
|
-
export declare const useTabListStyles_unstable: (state: TabListState) => TabListState;
|
package/lib-commonjs/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const tabPendingDesignTokens: {
|
|
2
|
-
tabPadding: {
|
|
3
|
-
medium: string;
|
|
4
|
-
small: string;
|
|
5
|
-
};
|
|
6
|
-
indicatorThickness: string;
|
|
7
|
-
gap: {
|
|
8
|
-
medium: string;
|
|
9
|
-
small: string;
|
|
10
|
-
};
|
|
11
|
-
contentPadding: {
|
|
12
|
-
medium: string;
|
|
13
|
-
small: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.tabPendingDesignTokens = void 0; // TODO: These constants should be replaced with design tokens
|
|
7
|
-
|
|
8
|
-
exports.tabPendingDesignTokens = {
|
|
9
|
-
tabPadding: {
|
|
10
|
-
medium: '10px',
|
|
11
|
-
small: '6px'
|
|
12
|
-
},
|
|
13
|
-
indicatorThickness: '2px',
|
|
14
|
-
gap: {
|
|
15
|
-
medium: '6px',
|
|
16
|
-
small: '2px'
|
|
17
|
-
},
|
|
18
|
-
contentPadding: {
|
|
19
|
-
medium: '2px',
|
|
20
|
-
small: '2px'
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=tab.constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["tab.constants.ts"],"names":[],"mappings":";;;;;yCAAA;;AACa,OAAA,CAAA,sBAAA,GAAyB;AACpC,EAAA,UAAU,EAAE;AACV,IAAA,MAAM,EAAE,MADE;AAEV,IAAA,KAAK,EAAE;AAFG,GADwB;AAKpC,EAAA,kBAAkB,EAAE,KALgB;AAMpC,EAAA,GAAG,EAAE;AAAE,IAAA,MAAM,EAAE,KAAV;AAAiB,IAAA,KAAK,EAAE;AAAxB,GAN+B;AAOpC,EAAA,cAAc,EAAE;AACd,IAAA,MAAM,EAAE,KADM;AAEd,IAAA,KAAK,EAAE;AAFO;AAPoB,CAAzB","sourcesContent":["// TODO: These constants should be replaced with design tokens\nexport const tabPendingDesignTokens = {\n tabPadding: {\n medium: '10px',\n small: '6px',\n },\n indicatorThickness: '2px',\n gap: { medium: '6px', small: '2px' },\n contentPadding: {\n medium: '2px',\n small: '2px',\n },\n};\n"],"sourceRoot":"../src/"}
|