@fluentui/react-tabs 9.0.9 → 9.1.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/CHANGELOG.json +112 -6
- package/CHANGELOG.md +39 -7
- package/dist/index.d.ts +18 -5
- package/lib/components/Tab/Tab.types.js.map +1 -1
- package/lib/components/Tab/renderTab.js +2 -0
- package/lib/components/Tab/renderTab.js.map +1 -1
- package/lib/components/Tab/useTab.js +2 -0
- package/lib/components/Tab/useTab.js.map +1 -1
- package/lib/components/Tab/useTabStyles.js +125 -37
- 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 +1 -0
- package/lib/components/TabList/TabListContext.js.map +1 -1
- package/lib/components/TabList/useTabList.js +2 -0
- package/lib/components/TabList/useTabList.js.map +1 -1
- package/lib/components/TabList/useTabListContextValues.js +2 -0
- package/lib/components/TabList/useTabListContextValues.js.map +1 -1
- package/lib-commonjs/components/Tab/renderTab.js +2 -0
- package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTab.js +2 -0
- package/lib-commonjs/components/Tab/useTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTabStyles.js +125 -37
- package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
- package/lib-commonjs/components/TabList/TabListContext.js +1 -0
- package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabList.js +2 -0
- package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabListContextValues.js +2 -0
- package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,113 @@
|
|
|
2
2
|
"name": "@fluentui/react-tabs",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 11 Nov 2022 14:53:30 GMT",
|
|
6
|
+
"tag": "@fluentui/react-tabs_v9.1.0",
|
|
7
|
+
"version": "9.1.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "gcox@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-tabs",
|
|
13
|
+
"commit": "715bd7f0686e1080ec0cbbdb5aa14c0d6ef18498",
|
|
14
|
+
"comment": "Added support for regular/filled icon toggling"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"minor": [
|
|
18
|
+
{
|
|
19
|
+
"author": "gcox@microsoft.com",
|
|
20
|
+
"package": "@fluentui/react-tabs",
|
|
21
|
+
"commit": "b0f2a9accff1456c09a3df81b46a7e84191cb3d6",
|
|
22
|
+
"comment": "Added support for reserving space for selected state"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"author": "gcox@microsoft.com",
|
|
26
|
+
"package": "@fluentui/react-tabs",
|
|
27
|
+
"commit": "d5d03853c4aabcf7cedd715caddd987ba44c1a60",
|
|
28
|
+
"comment": "Added large size tabs"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"author": "beachball",
|
|
32
|
+
"package": "@fluentui/react-tabs",
|
|
33
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.1",
|
|
34
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"author": "beachball",
|
|
38
|
+
"package": "@fluentui/react-tabs",
|
|
39
|
+
"comment": "Bump @fluentui/react-tabster to v9.3.0",
|
|
40
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"author": "beachball",
|
|
44
|
+
"package": "@fluentui/react-tabs",
|
|
45
|
+
"comment": "Bump @fluentui/react-theme to v9.1.2",
|
|
46
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"author": "beachball",
|
|
50
|
+
"package": "@fluentui/react-tabs",
|
|
51
|
+
"comment": "Bump @fluentui/react-utilities to v9.2.1",
|
|
52
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"author": "beachball",
|
|
56
|
+
"package": "@fluentui/react-tabs",
|
|
57
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18",
|
|
58
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"none": [
|
|
62
|
+
{
|
|
63
|
+
"author": "martinhochel@microsoft.com",
|
|
64
|
+
"package": "@fluentui/react-tabs",
|
|
65
|
+
"commit": "87859b052155ca206ef3540a2a9623803f6e2b93",
|
|
66
|
+
"comment": "test: replace deprecated module.parent with require.main within isConformance"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"date": "Wed, 02 Nov 2022 11:58:03 GMT",
|
|
73
|
+
"tag": "@fluentui/react-tabs_v9.0.10",
|
|
74
|
+
"version": "9.0.10",
|
|
75
|
+
"comments": {
|
|
76
|
+
"patch": [
|
|
77
|
+
{
|
|
78
|
+
"author": "olfedias@microsoft.com",
|
|
79
|
+
"package": "@fluentui/react-tabs",
|
|
80
|
+
"commit": "c619ba066f11a8654e95375314824ba6b81b003e",
|
|
81
|
+
"comment": "chore: Update Griffel to latest version"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"author": "beachball",
|
|
85
|
+
"package": "@fluentui/react-tabs",
|
|
86
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.0",
|
|
87
|
+
"commit": "393a7b169155997a97a6ce1ad36ee3eafc6f461b"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"author": "beachball",
|
|
91
|
+
"package": "@fluentui/react-tabs",
|
|
92
|
+
"comment": "Bump @fluentui/react-tabster to v9.2.1",
|
|
93
|
+
"commit": "393a7b169155997a97a6ce1ad36ee3eafc6f461b"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"author": "beachball",
|
|
97
|
+
"package": "@fluentui/react-tabs",
|
|
98
|
+
"comment": "Bump @fluentui/react-utilities to v9.2.0",
|
|
99
|
+
"commit": "393a7b169155997a97a6ce1ad36ee3eafc6f461b"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"author": "beachball",
|
|
103
|
+
"package": "@fluentui/react-tabs",
|
|
104
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.17",
|
|
105
|
+
"commit": "393a7b169155997a97a6ce1ad36ee3eafc6f461b"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"date": "Thu, 20 Oct 2022 08:39:51 GMT",
|
|
6
112
|
"tag": "@fluentui/react-tabs_v9.0.9",
|
|
7
113
|
"version": "9.0.9",
|
|
8
114
|
"comments": {
|
|
@@ -29,31 +135,31 @@
|
|
|
29
135
|
"author": "beachball",
|
|
30
136
|
"package": "@fluentui/react-tabs",
|
|
31
137
|
"comment": "Bump @fluentui/react-context-selector to v9.0.5",
|
|
32
|
-
"commit": "
|
|
138
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
33
139
|
},
|
|
34
140
|
{
|
|
35
141
|
"author": "beachball",
|
|
36
142
|
"package": "@fluentui/react-tabs",
|
|
37
143
|
"comment": "Bump @fluentui/react-tabster to v9.2.0",
|
|
38
|
-
"commit": "
|
|
144
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
39
145
|
},
|
|
40
146
|
{
|
|
41
147
|
"author": "beachball",
|
|
42
148
|
"package": "@fluentui/react-tabs",
|
|
43
149
|
"comment": "Bump @fluentui/react-theme to v9.1.1",
|
|
44
|
-
"commit": "
|
|
150
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
45
151
|
},
|
|
46
152
|
{
|
|
47
153
|
"author": "beachball",
|
|
48
154
|
"package": "@fluentui/react-tabs",
|
|
49
155
|
"comment": "Bump @fluentui/react-utilities to v9.1.2",
|
|
50
|
-
"commit": "
|
|
156
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
51
157
|
},
|
|
52
158
|
{
|
|
53
159
|
"author": "beachball",
|
|
54
160
|
"package": "@fluentui/react-tabs",
|
|
55
161
|
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16",
|
|
56
|
-
"commit": "
|
|
162
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
57
163
|
}
|
|
58
164
|
]
|
|
59
165
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-tabs
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 11 Nov 2022 14:53:30 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.1.0)
|
|
8
|
+
|
|
9
|
+
Fri, 11 Nov 2022 14:53:30 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.0.10..@fluentui/react-tabs_v9.1.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- Added support for reserving space for selected state ([PR #25542](https://github.com/microsoft/fluentui/pull/25542) by gcox@microsoft.com)
|
|
15
|
+
- Added large size tabs ([PR #25577](https://github.com/microsoft/fluentui/pull/25577) by gcox@microsoft.com)
|
|
16
|
+
- Bump @fluentui/react-context-selector to v9.1.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
17
|
+
- Bump @fluentui/react-tabster to v9.3.0 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
18
|
+
- Bump @fluentui/react-theme to v9.1.2 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
19
|
+
- Bump @fluentui/react-utilities to v9.2.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
20
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
21
|
+
|
|
22
|
+
### Patches
|
|
23
|
+
|
|
24
|
+
- Added support for regular/filled icon toggling ([PR #25597](https://github.com/microsoft/fluentui/pull/25597) by gcox@microsoft.com)
|
|
25
|
+
|
|
26
|
+
## [9.0.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.0.10)
|
|
27
|
+
|
|
28
|
+
Wed, 02 Nov 2022 11:58:03 GMT
|
|
29
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.0.9..@fluentui/react-tabs_v9.0.10)
|
|
30
|
+
|
|
31
|
+
### Patches
|
|
32
|
+
|
|
33
|
+
- chore: Update Griffel to latest version ([PR #25412](https://github.com/microsoft/fluentui/pull/25412) by olfedias@microsoft.com)
|
|
34
|
+
- Bump @fluentui/react-context-selector to v9.1.0 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
35
|
+
- Bump @fluentui/react-tabster to v9.2.1 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
36
|
+
- Bump @fluentui/react-utilities to v9.2.0 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
37
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.17 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
38
|
+
|
|
7
39
|
## [9.0.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.0.9)
|
|
8
40
|
|
|
9
|
-
Thu, 20 Oct 2022 08:
|
|
41
|
+
Thu, 20 Oct 2022 08:39:51 GMT
|
|
10
42
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.0.8..@fluentui/react-tabs_v9.0.9)
|
|
11
43
|
|
|
12
44
|
### Patches
|
|
@@ -14,11 +46,11 @@ Thu, 20 Oct 2022 08:35:27 GMT
|
|
|
14
46
|
- chore: Migrate to new package structure. ([PR #25241](https://github.com/microsoft/fluentui/pull/25241) by tristan.watanabe@gmail.com)
|
|
15
47
|
- chore: Update Griffel to latest version ([PR #25212](https://github.com/microsoft/fluentui/pull/25212) by olfedias@microsoft.com)
|
|
16
48
|
- chore: Bump peer deps to support React 18 ([PR #24972](https://github.com/microsoft/fluentui/pull/24972) by mgodbolt@microsoft.com)
|
|
17
|
-
- Bump @fluentui/react-context-selector to v9.0.5 ([
|
|
18
|
-
- Bump @fluentui/react-tabster to v9.2.0 ([
|
|
19
|
-
- Bump @fluentui/react-theme to v9.1.1 ([
|
|
20
|
-
- Bump @fluentui/react-utilities to v9.1.2 ([
|
|
21
|
-
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16 ([
|
|
49
|
+
- Bump @fluentui/react-context-selector to v9.0.5 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
50
|
+
- Bump @fluentui/react-tabster to v9.2.0 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
51
|
+
- Bump @fluentui/react-theme to v9.1.1 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
52
|
+
- Bump @fluentui/react-utilities to v9.1.2 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
53
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
22
54
|
|
|
23
55
|
## [9.0.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.0.8)
|
|
24
56
|
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare const TabList: ForwardRefComponent<TabListProps>;
|
|
|
42
42
|
|
|
43
43
|
export declare const tabListClassNames: SlotClassNames<TabListSlots>;
|
|
44
44
|
|
|
45
|
-
export declare type TabListContextValue = Pick<TabListProps, 'onTabSelect' | 'selectedValue'> & Required<Pick<TabListProps, 'appearance' | 'disabled' | 'size' | 'vertical'>> & {
|
|
45
|
+
export declare type TabListContextValue = Pick<TabListProps, 'onTabSelect' | 'selectedValue' | 'reserveSelectedTabSpace'> & Required<Pick<TabListProps, 'appearance' | 'disabled' | 'size' | 'vertical'>> & {
|
|
46
46
|
/** A callback to allow a tab to register itself with the tab list. */
|
|
47
47
|
onRegister: RegisterTabEventHandler;
|
|
48
48
|
/** A callback to allow a tab to unregister itself with the tab list. */
|
|
@@ -83,6 +83,14 @@ export declare type TabListProps = ComponentProps<TabListSlots> & {
|
|
|
83
83
|
* @default 'transparent'
|
|
84
84
|
*/
|
|
85
85
|
appearance?: 'transparent' | 'subtle';
|
|
86
|
+
/**
|
|
87
|
+
* Tab size may change between unselected and selected states.
|
|
88
|
+
* The default scenario is a selected tab has bold text.
|
|
89
|
+
*
|
|
90
|
+
* When true, this property requests tabs be the same size whether unselected or selected.
|
|
91
|
+
* @default true
|
|
92
|
+
*/
|
|
93
|
+
reserveSelectedTabSpace?: boolean;
|
|
86
94
|
/**
|
|
87
95
|
* The value of the tab to be selected by default.
|
|
88
96
|
* Typically useful when the selectedValue is uncontrolled.
|
|
@@ -102,11 +110,11 @@ export declare type TabListProps = ComponentProps<TabListSlots> & {
|
|
|
102
110
|
*/
|
|
103
111
|
selectedValue?: TabValue;
|
|
104
112
|
/**
|
|
105
|
-
* A tab list can be either 'small' or '
|
|
113
|
+
* A tab list can be either 'small', 'medium', or 'large' size.
|
|
106
114
|
* The size affects each of the contained tabs.
|
|
107
115
|
* @default 'medium'
|
|
108
116
|
*/
|
|
109
|
-
size?: 'small' | 'medium';
|
|
117
|
+
size?: 'small' | 'medium' | 'large';
|
|
110
118
|
/**
|
|
111
119
|
* A tab list can arrange its tabs vertically.
|
|
112
120
|
* @default false
|
|
@@ -185,9 +193,14 @@ export declare type TabState = ComponentState<TabSlots> & Pick<TabProps, 'value'
|
|
|
185
193
|
*/
|
|
186
194
|
selected: boolean;
|
|
187
195
|
/**
|
|
188
|
-
*
|
|
196
|
+
* When defined, tab content with selected style is rendered hidden to reserve space.
|
|
197
|
+
* This keeps consistent content size between unselected and selected states.
|
|
198
|
+
*/
|
|
199
|
+
contentReservedSpaceClassName?: string;
|
|
200
|
+
/**
|
|
201
|
+
* A tab can be either 'small', 'medium', or 'large' size.
|
|
189
202
|
*/
|
|
190
|
-
size: 'small' | 'medium';
|
|
203
|
+
size: 'small' | 'medium' | 'large';
|
|
191
204
|
/**
|
|
192
205
|
* A tab can arrange its content based on if the tabs in the list are arranged vertically.
|
|
193
206
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-tabs/src/components/Tab/Tab.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Any value that identifies a specific tab.\n */\nexport type TabValue = unknown;\n\nexport type TabSlots = {\n /**\n * Root of the component.\n */\n root: Slot<'button'>;\n\n /**\n * Icon that renders before the content.\n */\n icon?: Slot<'span'>;\n\n /**\n * Component children are placed in this slot\n * Avoid using the `children` property in this slot in favour of Component children whenever possible.\n */\n content: NonNullable<Slot<'span'>>;\n};\n\n/**\n * Tab Props\n */\nexport type TabProps = ComponentProps<Partial<TabSlots>> & {\n /**\n * A tab can be set to disable interaction.\n * @default false\n */\n disabled?: boolean;\n /**\n * The value that identifies this tab when selected.\n */\n value: TabValue;\n};\n\n/**\n * State used in rendering Tab\n */\nexport type TabState = ComponentState<TabSlots> &\n Pick<TabProps, 'value'> &\n Required<Pick<TabProps, 'disabled'>> & {\n /**\n * A tab supports 'transparent' and 'subtle' appearance.\n */\n appearance?: 'transparent' | 'subtle';\n /**\n * A tab can have only an icon slot filled and no content.\n */\n iconOnly: boolean;\n /**\n * If this tab is selected\n */\n selected: boolean;\n /**\n * A tab can be either 'small' or '
|
|
1
|
+
{"version":3,"file":"Tab.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-tabs/src/components/Tab/Tab.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Any value that identifies a specific tab.\n */\nexport type TabValue = unknown;\n\nexport type TabSlots = {\n /**\n * Root of the component.\n */\n root: Slot<'button'>;\n\n /**\n * Icon that renders before the content.\n */\n icon?: Slot<'span'>;\n\n /**\n * Component children are placed in this slot\n * Avoid using the `children` property in this slot in favour of Component children whenever possible.\n */\n content: NonNullable<Slot<'span'>>;\n};\n\n/**\n * Tab Props\n */\nexport type TabProps = ComponentProps<Partial<TabSlots>> & {\n /**\n * A tab can be set to disable interaction.\n * @default false\n */\n disabled?: boolean;\n /**\n * The value that identifies this tab when selected.\n */\n value: TabValue;\n};\n\n/**\n * State used in rendering Tab\n */\nexport type TabState = ComponentState<TabSlots> &\n Pick<TabProps, 'value'> &\n Required<Pick<TabProps, 'disabled'>> & {\n /**\n * A tab supports 'transparent' and 'subtle' appearance.\n */\n appearance?: 'transparent' | 'subtle';\n /**\n * A tab can have only an icon slot filled and no content.\n */\n iconOnly: boolean;\n /**\n * If this tab is selected\n */\n selected: boolean;\n /**\n * When defined, tab content with selected style is rendered hidden to reserve space.\n * This keeps consistent content size between unselected and selected states.\n */\n contentReservedSpaceClassName?: string;\n /**\n * A tab can be either 'small', 'medium', or 'large' size.\n */\n size: 'small' | 'medium' | 'large';\n /**\n * A tab can arrange its content based on if the tabs in the list are arranged vertically.\n */\n vertical: boolean;\n };\n"]}
|
|
@@ -12,6 +12,8 @@ export const renderTab_unstable = state => {
|
|
|
12
12
|
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
13
13
|
}, slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
|
14
14
|
}), !state.iconOnly && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
|
|
15
|
+
}), !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content,
|
|
16
|
+
className: state.contentReservedSpaceClassName
|
|
15
17
|
}));
|
|
16
18
|
};
|
|
17
19
|
//# sourceMappingURL=renderTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-tabs/src/components/Tab/renderTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,kBAAkB,GAAI,KAAD,IAAoB;EACpD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAW,KAAX,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADjB,EAEG,CAAC,KAAK,CAAC,QAAP,iBAAmB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;EAAf,CAAd,CAFtB,CADF;
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-tabs/src/components/Tab/renderTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,kBAAkB,GAAI,KAAD,IAAoB;EACpD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAW,KAAX,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADjB,EAEG,CAAC,KAAK,CAAC,QAAP,iBAAmB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;EAAf,CAAd,CAFtB,EAGG,CAAC,KAAK,CAAC,QAAP,IAAmB,CAAC,KAAK,CAAC,QAA1B,IAAsC,KAAK,CAAC,6BAAN,KAAwC,SAA9E,iBACC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC,OAAf;IAAwB,SAAS,EAAE,KAAK,CAAC;EAAzC,CAAd,CAJJ,CADF;AASD,CAZM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TabState, TabSlots } from './Tab.types';\n\n/**\n * Render the final JSX of Tab\n */\nexport const renderTab_unstable = (state: TabState) => {\n const { slots, slotProps } = getSlots<TabSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {!state.iconOnly && <slots.content {...slotProps.content} />}\n {!state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && (\n <slots.content {...slotProps.content} className={state.contentReservedSpaceClassName} />\n )}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -20,6 +20,7 @@ export const useTab_unstable = (props, ref) => {
|
|
|
20
20
|
value
|
|
21
21
|
} = props;
|
|
22
22
|
const appearance = useContextSelector(TabListContext, ctx => ctx.appearance);
|
|
23
|
+
const reserveSelectedTabSpace = useContextSelector(TabListContext, ctx => ctx.reserveSelectedTabSpace);
|
|
23
24
|
const listDisabled = useContextSelector(TabListContext, ctx => ctx.disabled);
|
|
24
25
|
const selected = useContextSelector(TabListContext, ctx => ctx.selectedValue === value);
|
|
25
26
|
const onRegister = useContextSelector(TabListContext, ctx => ctx.onRegister);
|
|
@@ -72,6 +73,7 @@ export const useTab_unstable = (props, ref) => {
|
|
|
72
73
|
iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !contentShorthand.children),
|
|
73
74
|
content: contentShorthand,
|
|
74
75
|
appearance,
|
|
76
|
+
contentReservedSpaceClassName: reserveSelectedTabSpace ? '' : undefined,
|
|
75
77
|
disabled,
|
|
76
78
|
selected,
|
|
77
79
|
size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-tabs/src/components/Tab/useTab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,gBAAlD,EAAoE,aAApE,QAAyF,2BAAzF;AAEA,SAAS,cAAT,QAA+B,2BAA/B;AACA,SAAS,kBAAT,QAAmC,kCAAnC;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,eAAe,GAAG,CAAC,KAAD,EAAkB,GAAlB,KAA2D;EACxF,MAAM;IAAE,OAAF;IAAW,QAAQ,EAAE,WAAW,GAAG,KAAnC;IAA0C,IAA1C;IAAgD;EAAhD,IAA0D,KAAhE;EAEA,MAAM,UAAU,GAAG,kBAAkB,CAAC,cAAD,EAAiB,GAAG,IAAI,GAAG,CAAC,UAA5B,CAArC;EACA,MAAM,YAAY,GAAG,kBAAkB,CAAC,cAAD,EAAiB,GAAG,IAAI,GAAG,CAAC,QAA5B,CAAvC;EACA,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAD,EAAiB,GAAG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IAAE,QAAQ,EAAE,IAAZ;IAAkB,YAAY,EAAE;MAAE,QAAQ,EAAE,KAAK,CAAC;IAAlB;EAAhC,CAAV,CAAzC;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE,QADI;MAEV,IAAI,EAAE,MAFI;MAGV,OAAO,EAAE;IAHC,CADP;IAML,IAAI,EAAE,qBAAqB,CAAC,QAAD,EAAW;MACpC,GAAG,EAAE,aAAa,CAAC,GAAD,EAAM,QAAN,CADkB;MAEpC,IAAI,EAAE,KAF8B;MAGpC,IAAI,EAAE,QAH8B;MAIpC;MACA;MACA,iBAAiB,QAAQ,GAAG,SAAH,GAAe,GAAG,QAAQ,EANf;MAOpC,GAAG,KAPiC;MAQpC,QARoC;MASpC;IAToC,CAAX,CANtB;IAiBL,IAAI,EAAE,aAjBD;IAkBL,QAAQ,EAAE,OAAO,CAAC,CAAA,aAAa,KAAA,IAAb,IAAA,aAAa,KAAA,KAAA,CAAb,GAAa,KAAA,CAAb,GAAA,aAAa,CAAE,QAAf,KAA2B,CAAC,gBAAgB,CAAC,QAA9C,CAlBZ;IAmBL,OAAO,EAAE,gBAnBJ;IAoBL,UApBK;IAqBL,6BAA6B,EAAE,uBAAuB,GAAG,EAAH,GAAQ,SArBzD;IAsBL,QAtBK;IAuBL,QAvBK;IAwBL,IAxBK;IAyBL,KAzBK;IA0BL;EA1BK,CAAP;AA4BD,CA1DM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport type { TabProps, TabState } from './Tab.types';\nimport { TabListContext } from '../TabList/TabListContext';\nimport { useContextSelector } from '@fluentui/react-context-selector';\nimport { SelectTabEvent } from '../TabList/TabList.types';\n\n/**\n * Create the state required to render Tab.\n *\n * The returned state can be modified with hooks such as useTabStyles_unstable,\n * before being passed to renderTab_unstable.\n *\n * @param props - props from this instance of Tab\n * @param ref - reference to root HTMLElement of Tab\n */\nexport const useTab_unstable = (props: TabProps, ref: React.Ref<HTMLElement>): TabState => {\n const { content, disabled: tabDisabled = false, icon, value } = props;\n\n const appearance = useContextSelector(TabListContext, ctx => ctx.appearance);\n const reserveSelectedTabSpace = useContextSelector(TabListContext, ctx => ctx.reserveSelectedTabSpace);\n const listDisabled = useContextSelector(TabListContext, ctx => ctx.disabled);\n const selected = useContextSelector(TabListContext, ctx => ctx.selectedValue === value);\n const onRegister = useContextSelector(TabListContext, ctx => ctx.onRegister);\n const onUnregister = useContextSelector(TabListContext, ctx => ctx.onUnregister);\n const onSelect = useContextSelector(TabListContext, ctx => ctx.onSelect);\n const size = useContextSelector(TabListContext, ctx => ctx.size);\n const vertical = useContextSelector(TabListContext, ctx => !!ctx.vertical);\n const disabled = listDisabled || tabDisabled;\n\n const innerRef = React.useRef<HTMLElement>(null);\n const onClick = useEventCallback((event: SelectTabEvent) => onSelect(event, { value }));\n\n React.useEffect(() => {\n onRegister({\n value,\n ref: innerRef,\n });\n\n return () => {\n onUnregister({ value, ref: innerRef });\n };\n }, [onRegister, onUnregister, innerRef, value]);\n\n const iconShorthand = resolveShorthand(icon);\n const contentShorthand = resolveShorthand(content, { required: true, defaultProps: { children: props.children } });\n return {\n components: {\n root: 'button',\n icon: 'span',\n content: 'span',\n },\n root: getNativeElementProps('button', {\n ref: useMergedRefs(ref, innerRef),\n role: 'tab',\n type: 'button',\n // aria-selected undefined indicates it is not selectable\n // according to https://www.w3.org/TR/wai-aria-1.1/#aria-selected\n 'aria-selected': disabled ? undefined : `${selected}`,\n ...props,\n disabled,\n onClick,\n }),\n icon: iconShorthand,\n iconOnly: Boolean(iconShorthand?.children && !contentShorthand.children),\n content: contentShorthand,\n appearance,\n contentReservedSpaceClassName: reserveSelectedTabSpace ? '' : undefined,\n disabled,\n selected,\n size,\n value,\n vertical,\n };\n};\n"],"sourceRoot":"../src/"}
|