@fluentui/react-tabs 9.0.0-beta.9 → 9.0.0-rc.4
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 +298 -6
- package/CHANGELOG.md +95 -10
- package/README.md +47 -1
- package/dist/{react-tabs.d.ts → index.d.ts} +46 -55
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Tab/Tab.types.js.map +1 -1
- package/lib/components/Tab/useTab.js +3 -0
- package/lib/components/Tab/useTab.js.map +1 -1
- package/lib/components/Tab/useTabAnimatedIndicator.js +6 -6
- package/lib/components/Tab/useTabAnimatedIndicator.js.map +1 -1
- package/lib/components/Tab/useTabStyles.js +117 -181
- package/lib/components/Tab/useTabStyles.js.map +1 -1
- package/lib/components/TabList/TabList.types.js.map +1 -1
- package/lib/components/TabList/useTabList.js +2 -1
- package/lib/components/TabList/useTabList.js.map +1 -1
- package/lib/components/TabList/useTabListStyles.js +10 -5
- 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/useTab.js +3 -0
- package/lib-commonjs/components/Tab/useTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js +7 -7
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js.map +1 -1
- package/lib-commonjs/components/Tab/useTabStyles.js +117 -182
- package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabList.js +2 -1
- package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabListStyles.js +11 -6
- package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -13
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +11 -11
- 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 -61
- package/lib/components/Tab/index.d.ts +0 -6
- package/lib/components/Tab/renderTab.d.ts +0 -5
- package/lib/components/Tab/useTab.d.ts +0 -12
- package/lib/components/Tab/useTabAnimatedIndicator.d.ts +0 -5
- package/lib/components/Tab/useTabStyles.d.ts +0 -8
- package/lib/components/TabList/TabList.d.ts +0 -6
- package/lib/components/TabList/TabList.types.d.ts +0 -104
- 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 -8
- package/lib/index.d.ts +0 -4
- package/lib/tab.constants.d.ts +0 -62
- package/lib/tab.constants.js +0 -68
- 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 -61
- package/lib-commonjs/components/Tab/index.d.ts +0 -6
- 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/useTabAnimatedIndicator.d.ts +0 -5
- package/lib-commonjs/components/Tab/useTabStyles.d.ts +0 -8
- package/lib-commonjs/components/TabList/TabList.d.ts +0 -6
- package/lib-commonjs/components/TabList/TabList.types.d.ts +0 -104
- 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 -8
- package/lib-commonjs/index.d.ts +0 -4
- package/lib-commonjs/tab.constants.d.ts +0 -62
- package/lib-commonjs/tab.constants.js +0 -75
- package/lib-commonjs/tab.constants.js.map +0 -1
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useTabListStyles_unstable = exports.
|
|
6
|
+
exports.useTabListStyles_unstable = exports.tabListClassNames = void 0;
|
|
7
7
|
|
|
8
8
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
9
|
|
|
10
10
|
exports.tabListClassNames = {
|
|
11
11
|
root: 'fui-TabList'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
exports.tabListClassName = exports.tabListClassNames.root;
|
|
12
|
+
};
|
|
15
13
|
/**
|
|
16
14
|
* Styles for the root slot
|
|
17
15
|
*/
|
|
@@ -20,13 +18,20 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
20
18
|
"root": {
|
|
21
19
|
"mc9l5x": "f22iagw",
|
|
22
20
|
"Beiy3e4": "f1063pyq",
|
|
21
|
+
"Bnnss6s": "fi64zpg",
|
|
22
|
+
"Eh141a": "flvyvdh",
|
|
23
23
|
"qhf8xq": "f10pi13n"
|
|
24
24
|
},
|
|
25
|
+
"horizontal": {
|
|
26
|
+
"Bt984gj": "f1q9h2pe",
|
|
27
|
+
"Beiy3e4": "f1063pyq"
|
|
28
|
+
},
|
|
25
29
|
"vertical": {
|
|
30
|
+
"Bt984gj": "f1q9h2pe",
|
|
26
31
|
"Beiy3e4": "f1vx9l62"
|
|
27
32
|
}
|
|
28
33
|
}, {
|
|
29
|
-
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".f10pi13n{position:relative;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}"]
|
|
34
|
+
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".flvyvdh{-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}", ".f10pi13n{position:relative;}", ".f1q9h2pe{-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}"]
|
|
30
35
|
});
|
|
31
36
|
/**
|
|
32
37
|
* Apply styling to the TabList slots based on the state
|
|
@@ -38,7 +43,7 @@ const useTabListStyles_unstable = state => {
|
|
|
38
43
|
vertical
|
|
39
44
|
} = state;
|
|
40
45
|
const styles = useStyles();
|
|
41
|
-
state.root.className = react_1.mergeClasses(exports.
|
|
46
|
+
state.root.className = react_1.mergeClasses(exports.tabListClassNames.root, styles.root, vertical ? styles.vertical : styles.horizontal, state.root.className);
|
|
42
47
|
return state;
|
|
43
48
|
};
|
|
44
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/TabList/useTabListStyles.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGa,OAAA,CAAA,iBAAA,GAAkD;AAC7D,EAAA,IAAI,EAAE;AADuD,CAAlD
|
|
1
|
+
{"version":3,"sources":["components/TabList/useTabListStyles.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGa,OAAA,CAAA,iBAAA,GAAkD;AAC7D,EAAA,IAAI,EAAE;AADuD,CAAlD;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAkBA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAAsC;AAC7E,QAAM;AAAE,IAAA;AAAF,MAAe,KAArB;AAEA,QAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,iBAAA,CAAkB,IADG,EAErB,MAAM,CAAC,IAFc,EAGrB,QAAQ,GAAG,MAAM,CAAC,QAAV,GAAqB,MAAM,CAAC,UAHf,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;AAOA,SAAO,KAAP;AACD,CAbM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { TabListSlots, TabListState } from './TabList.types';\n\nexport const tabListClassNames: SlotClassNames<TabListSlots> = {\n root: 'fui-TabList',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'nowrap',\n position: 'relative',\n },\n horizontal: {\n alignItems: 'stretch',\n flexDirection: 'row',\n },\n vertical: {\n alignItems: 'stretch',\n flexDirection: 'column',\n },\n});\n\n/**\n * Apply styling to the TabList slots based on the state\n */\nexport const useTabListStyles_unstable = (state: TabListState): TabListState => {\n const { vertical } = state;\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(\n tabListClassNames.root,\n styles.root,\n vertical ? styles.vertical : styles.horizontal,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useTabList_unstable = exports.useTabListStyles_unstable = exports.tabListClassNames = exports.
|
|
6
|
+
exports.useTabList_unstable = exports.useTabListStyles_unstable = exports.tabListClassNames = exports.TabList = exports.renderTabList_unstable = exports.useTab_unstable = exports.useTabStyles_unstable = exports.tabClassNames = exports.Tab = exports.renderTab_unstable = void 0;
|
|
7
7
|
|
|
8
8
|
var Tab_1 = /*#__PURE__*/require("./Tab");
|
|
9
9
|
|
|
@@ -19,12 +19,6 @@ Object.defineProperty(exports, "Tab", {
|
|
|
19
19
|
return Tab_1.Tab;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
Object.defineProperty(exports, "tabClassName", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function () {
|
|
25
|
-
return Tab_1.tabClassName;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
22
|
Object.defineProperty(exports, "tabClassNames", {
|
|
29
23
|
enumerable: true,
|
|
30
24
|
get: function () {
|
|
@@ -58,12 +52,6 @@ Object.defineProperty(exports, "TabList", {
|
|
|
58
52
|
return TabList_1.TabList;
|
|
59
53
|
}
|
|
60
54
|
});
|
|
61
|
-
Object.defineProperty(exports, "tabListClassName", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () {
|
|
64
|
-
return TabList_1.tabListClassName;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
55
|
Object.defineProperty(exports, "tabListClassNames", {
|
|
68
56
|
enumerable: true,
|
|
69
57
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AACA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,KAAA,CAAA,kBAAA;AAAkB;AAAlB,CAAA;AAAoB,MAAA,CAAA,cAAA,CAAA,OAAA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A;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,SAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,OAAA;AAAO;AAAP,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,yBAAA;AAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,mBAAA;AAAmB;AAAnB,CAAA","sourcesContent":["export type { TabProps, TabSlots, TabState, TabValue } from './Tab';\nexport { renderTab_unstable, Tab, tabClassNames, useTabStyles_unstable, useTab_unstable } from './Tab';\nexport type {\n TabRegisterData,\n RegisterTabEventHandler,\n SelectTabData,\n SelectTabEvent,\n SelectTabEventHandler,\n TabListContextValue,\n TabListContextValues,\n TabListProps,\n TabListSlots,\n TabListState,\n} from './TabList';\nexport {\n renderTabList_unstable,\n TabList,\n tabListClassNames,\n useTabListStyles_unstable,\n useTabList_unstable,\n} from './TabList';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-tabs",
|
|
3
|
-
"version": "9.0.0-
|
|
3
|
+
"version": "9.0.0-rc.4",
|
|
4
4
|
"description": "Fluent UI React tabs components",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
|
-
"typings": "
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -20,23 +20,23 @@
|
|
|
20
20
|
"start": "yarn storybook",
|
|
21
21
|
"test": "jest --passWithNoTests",
|
|
22
22
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
|
23
|
-
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node
|
|
24
|
-
"storybook": "node
|
|
23
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-tabs/src && yarn docs",
|
|
24
|
+
"storybook": "node ../../../scripts/storybook/runner",
|
|
25
25
|
"type-check": "tsc -b tsconfig.json"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
|
29
29
|
"@fluentui/react-conformance": "*",
|
|
30
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
31
|
-
"@fluentui/react-context-selector": "9.0.0-rc.
|
|
30
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.7",
|
|
31
|
+
"@fluentui/react-context-selector": "9.0.0-rc.9",
|
|
32
32
|
"@fluentui/scripts": "^1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@griffel/react": "1.0.
|
|
36
|
-
"@fluentui/react-context-selector": "9.0.0-rc.
|
|
37
|
-
"@fluentui/react-tabster": "9.0.0-rc.
|
|
38
|
-
"@fluentui/react-theme": "9.0.0-rc.
|
|
39
|
-
"@fluentui/react-utilities": "9.0.0-rc.
|
|
35
|
+
"@griffel/react": "1.0.5",
|
|
36
|
+
"@fluentui/react-context-selector": "9.0.0-rc.9",
|
|
37
|
+
"@fluentui/react-tabster": "9.0.0-rc.12",
|
|
38
|
+
"@fluentui/react-theme": "9.0.0-rc.9",
|
|
39
|
+
"@fluentui/react-utilities": "9.0.0-rc.9",
|
|
40
40
|
"tslib": "^2.1.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
package/lib/Tab.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Tab/index';
|
package/lib/TabList.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/TabList/index';
|
|
@@ -1,61 +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<'button'>;
|
|
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
|
-
* A tab can be set to disable interaction.
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* The value that identifies this tab when selected.
|
|
29
|
-
*/
|
|
30
|
-
value: TabValue;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Tab Props
|
|
34
|
-
*/
|
|
35
|
-
export declare type TabProps = ComponentProps<Partial<TabSlots>> & TabCommons;
|
|
36
|
-
/**
|
|
37
|
-
* State used in rendering Tab
|
|
38
|
-
*/
|
|
39
|
-
export declare type TabState = ComponentState<TabSlots> & Omit<TabCommons, 'disabled'> & Required<Pick<TabCommons, 'disabled'>> & {
|
|
40
|
-
/**
|
|
41
|
-
* A tab supports 'transparent' and 'subtle' appearance.
|
|
42
|
-
*/
|
|
43
|
-
appearance?: 'transparent' | 'subtle';
|
|
44
|
-
/**
|
|
45
|
-
* A tab can have only an icon slot filled and no content.
|
|
46
|
-
*/
|
|
47
|
-
iconOnly: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* If this tab is selected
|
|
50
|
-
*/
|
|
51
|
-
selected: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* A tab can be either 'small' or 'medium' size.
|
|
54
|
-
*/
|
|
55
|
-
size: 'small' | 'medium';
|
|
56
|
-
/**
|
|
57
|
-
* A tab can arrange its content based on if the tabs in the list are arranged vertically.
|
|
58
|
-
*/
|
|
59
|
-
vertical: boolean;
|
|
60
|
-
};
|
|
61
|
-
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,8 +0,0 @@
|
|
|
1
|
-
import type { TabSlots, TabState } from './Tab.types';
|
|
2
|
-
import { SlotClassNames } from '@fluentui/react-utilities';
|
|
3
|
-
export declare const tabClassNames: SlotClassNames<TabSlots>;
|
|
4
|
-
export declare const tabClassName: string;
|
|
5
|
-
/**
|
|
6
|
-
* Apply styling to the Tab slots based on the state
|
|
7
|
-
*/
|
|
8
|
-
export declare const useTabStyles_unstable: (state: TabState) => TabState;
|
|
@@ -1,104 +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 TabRegisterData = {
|
|
5
|
-
/**
|
|
6
|
-
* The value of the tab.
|
|
7
|
-
*/
|
|
8
|
-
value: TabValue;
|
|
9
|
-
/**
|
|
10
|
-
* The reference to the tab HTML element.
|
|
11
|
-
*/
|
|
12
|
-
ref: React.RefObject<HTMLElement>;
|
|
13
|
-
};
|
|
14
|
-
export declare type RegisterTabEventHandler = (data: TabRegisterData) => void;
|
|
15
|
-
export declare type SelectTabData = {
|
|
16
|
-
/**
|
|
17
|
-
* The value of the selected tab.
|
|
18
|
-
*/
|
|
19
|
-
value: TabValue;
|
|
20
|
-
};
|
|
21
|
-
export declare type SelectTabEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;
|
|
22
|
-
export declare type SelectTabEventHandler = (event: SelectTabEvent, data: SelectTabData) => void;
|
|
23
|
-
export declare type TabListSlots = {
|
|
24
|
-
/**
|
|
25
|
-
* The slot associated with the root element of this tab list.
|
|
26
|
-
*/
|
|
27
|
-
root: Slot<'div'>;
|
|
28
|
-
};
|
|
29
|
-
declare type TabListCommons = {
|
|
30
|
-
/**
|
|
31
|
-
* A tab list can supports 'transparent' and 'subtle' appearance.
|
|
32
|
-
*- 'subtle': Minimizes emphasis to blend into the background until hovered or focused.
|
|
33
|
-
*- 'transparent': No background and border styling
|
|
34
|
-
* The appearance affects each of the contained tabs.
|
|
35
|
-
* @default 'transparent'
|
|
36
|
-
*/
|
|
37
|
-
appearance?: 'transparent' | 'subtle';
|
|
38
|
-
/**
|
|
39
|
-
* A tab list can be set to disable interaction.
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
disabled?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Raised when a tab is selected.
|
|
45
|
-
*/
|
|
46
|
-
onTabSelect?: SelectTabEventHandler;
|
|
47
|
-
/**
|
|
48
|
-
* The value of the currently selected tab.
|
|
49
|
-
*/
|
|
50
|
-
selectedValue?: TabValue;
|
|
51
|
-
/**
|
|
52
|
-
* A tab list can be either 'small' or 'medium' size.
|
|
53
|
-
* The size affects each of the contained tabs.
|
|
54
|
-
* @default 'medium'
|
|
55
|
-
*/
|
|
56
|
-
size?: 'small' | 'medium';
|
|
57
|
-
/**
|
|
58
|
-
* A tab list can arrange its tabs vertically.
|
|
59
|
-
* @default false
|
|
60
|
-
*/
|
|
61
|
-
vertical?: boolean;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* TabList Props
|
|
65
|
-
*/
|
|
66
|
-
export declare type TabListProps = ComponentProps<TabListSlots> & TabListCommons & {
|
|
67
|
-
/**
|
|
68
|
-
* The value of the tab to be selected by default.
|
|
69
|
-
* Typically useful when the selectedValue is uncontrolled.
|
|
70
|
-
*/
|
|
71
|
-
defaultSelectedValue?: TabValue;
|
|
72
|
-
};
|
|
73
|
-
export declare type TabListContextValue = Pick<TabListCommons, 'onTabSelect' | 'selectedValue'> & Required<Pick<TabListCommons, 'appearance' | 'disabled' | 'size' | 'vertical'>> & {
|
|
74
|
-
/** A callback to allow a tab to register itself with the tab list. */
|
|
75
|
-
onRegister: RegisterTabEventHandler;
|
|
76
|
-
/** A callback to allow a tab to unregister itself with the tab list. */
|
|
77
|
-
onUnregister: RegisterTabEventHandler;
|
|
78
|
-
/**
|
|
79
|
-
* A callback to allow a tab to select itself when pressed.
|
|
80
|
-
*/
|
|
81
|
-
onSelect: SelectTabEventHandler;
|
|
82
|
-
/**
|
|
83
|
-
* Gets the registered tab data along with current and previous selected values.
|
|
84
|
-
*/
|
|
85
|
-
getRegisteredTabs: () => {
|
|
86
|
-
selectedValue?: TabValue;
|
|
87
|
-
previousSelectedValue?: TabValue;
|
|
88
|
-
registeredTabs: Record<string, TabRegisterData>;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* Context values used in rendering TabList.
|
|
93
|
-
*/
|
|
94
|
-
export declare type TabListContextValues = {
|
|
95
|
-
/**
|
|
96
|
-
* The context of the tab list available to each tab.
|
|
97
|
-
*/
|
|
98
|
-
tabList: TabListContextValue;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* State used in rendering TabList.
|
|
102
|
-
*/
|
|
103
|
-
export declare type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue;
|
|
104
|
-
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,8 +0,0 @@
|
|
|
1
|
-
import { SlotClassNames } from '@fluentui/react-utilities';
|
|
2
|
-
import type { TabListSlots, TabListState } from './TabList.types';
|
|
3
|
-
export declare const tabListClassNames: SlotClassNames<TabListSlots>;
|
|
4
|
-
export declare const tabListClassName: string;
|
|
5
|
-
/**
|
|
6
|
-
* Apply styling to the TabList slots based on the state
|
|
7
|
-
*/
|
|
8
|
-
export declare const useTabListStyles_unstable: (state: TabListState) => TabListState;
|
package/lib/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type { TabProps, TabSlots, TabState, TabValue } from './Tab';
|
|
2
|
-
export { renderTab_unstable, Tab, tabClassName, tabClassNames, useTabStyles_unstable, useTab_unstable } from './Tab';
|
|
3
|
-
export type { TabRegisterData, RegisterTabEventHandler, SelectTabData, SelectTabEvent, SelectTabEventHandler, TabListContextValue, TabListContextValues, TabListProps, TabListSlots, TabListState, } from './TabList';
|
|
4
|
-
export { renderTabList_unstable, TabList, tabListClassName, tabListClassNames, useTabListStyles_unstable, useTabList_unstable, } from './TabList';
|
package/lib/tab.constants.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export declare const pendingContentSizeTokens: {
|
|
2
|
-
body1: {
|
|
3
|
-
fontSize: string;
|
|
4
|
-
fontWeight: string;
|
|
5
|
-
lineHeight: string;
|
|
6
|
-
};
|
|
7
|
-
body1Strong: {
|
|
8
|
-
fontSize: string;
|
|
9
|
-
fontWeight: string;
|
|
10
|
-
lineHeight: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare const pendingSpacingTokens: {
|
|
14
|
-
none: string;
|
|
15
|
-
xxs: string;
|
|
16
|
-
xs: string;
|
|
17
|
-
sNudge: string;
|
|
18
|
-
s: string;
|
|
19
|
-
mNudge: string;
|
|
20
|
-
m: string;
|
|
21
|
-
l: string;
|
|
22
|
-
xl: string;
|
|
23
|
-
xxl: string;
|
|
24
|
-
xxxl: string;
|
|
25
|
-
};
|
|
26
|
-
export declare const pendingAnimationDurationTokens: {
|
|
27
|
-
ultraFast: string;
|
|
28
|
-
faster: string;
|
|
29
|
-
fast: string;
|
|
30
|
-
normal: string;
|
|
31
|
-
slow: string;
|
|
32
|
-
slower: string;
|
|
33
|
-
ultraSlow: string;
|
|
34
|
-
};
|
|
35
|
-
export declare const pendingAnimationEasingTokens: {
|
|
36
|
-
accelerateMax: string;
|
|
37
|
-
accelerateMid: string;
|
|
38
|
-
accelerateMin: string;
|
|
39
|
-
declerateMax: string;
|
|
40
|
-
decelerateMid: string;
|
|
41
|
-
decelarateMin: string;
|
|
42
|
-
maxEasyEase: string;
|
|
43
|
-
easyEase: string;
|
|
44
|
-
linear: string;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Provides shared values between tab style hooks
|
|
48
|
-
* useTabStyles
|
|
49
|
-
* useTabAnimatedIndicator
|
|
50
|
-
*/
|
|
51
|
-
export declare const tabIndicatorPadding: {
|
|
52
|
-
mediumHorizontal: string;
|
|
53
|
-
mediumVertical: string;
|
|
54
|
-
smallHorizontal: string;
|
|
55
|
-
smallVertical: string;
|
|
56
|
-
};
|
|
57
|
-
export declare const tabIndicatorStrokeWidths: {
|
|
58
|
-
mediumHorizontal: string;
|
|
59
|
-
mediumVertical: string;
|
|
60
|
-
smallHorizontal: string;
|
|
61
|
-
smallVertical: string;
|
|
62
|
-
};
|
package/lib/tab.constants.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// TODO: Constants prefixed with pending should be replaced with design tokens
|
|
2
|
-
// These values were taken from the design token superset figma
|
|
3
|
-
import { tokens } from '@fluentui/react-theme';
|
|
4
|
-
export const pendingContentSizeTokens = {
|
|
5
|
-
// Only body sizes are defined here currently
|
|
6
|
-
body1: {
|
|
7
|
-
fontSize: tokens.fontSizeBase300,
|
|
8
|
-
fontWeight: tokens.fontWeightRegular,
|
|
9
|
-
lineHeight: tokens.lineHeightBase300
|
|
10
|
-
},
|
|
11
|
-
body1Strong: {
|
|
12
|
-
fontSize: tokens.fontSizeBase300,
|
|
13
|
-
fontWeight: tokens.fontWeightSemibold,
|
|
14
|
-
lineHeight: tokens.lineHeightBase300
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
export const pendingSpacingTokens = {
|
|
18
|
-
none: '0',
|
|
19
|
-
xxs: '2px',
|
|
20
|
-
xs: '4px',
|
|
21
|
-
sNudge: '6px',
|
|
22
|
-
s: '8px',
|
|
23
|
-
mNudge: '10px',
|
|
24
|
-
m: '12px',
|
|
25
|
-
l: '16px',
|
|
26
|
-
xl: '20px',
|
|
27
|
-
xxl: '24px',
|
|
28
|
-
xxxl: '32px'
|
|
29
|
-
};
|
|
30
|
-
export const pendingAnimationDurationTokens = {
|
|
31
|
-
ultraFast: '50ms',
|
|
32
|
-
faster: '100ms',
|
|
33
|
-
fast: '150ms',
|
|
34
|
-
normal: '200ms',
|
|
35
|
-
slow: '300ms',
|
|
36
|
-
slower: '400ms',
|
|
37
|
-
ultraSlow: '500ms'
|
|
38
|
-
};
|
|
39
|
-
export const pendingAnimationEasingTokens = {
|
|
40
|
-
accelerateMax: 'cubic-bezier(1,0,1,1)',
|
|
41
|
-
accelerateMid: 'cubic-bezier(0.7,0,1,0.5)',
|
|
42
|
-
accelerateMin: 'cubic-bezier(0.8,0,1,1)',
|
|
43
|
-
declerateMax: 'cubic-bezier(0,0,0,1)',
|
|
44
|
-
decelerateMid: 'cubic-bezier(0.1,0.9,0.2,1)',
|
|
45
|
-
decelarateMin: 'cubic-bezier(0.33,0,0.1,1)',
|
|
46
|
-
maxEasyEase: 'cubic-bezier(0.8,0,0.1,1)',
|
|
47
|
-
easyEase: 'cubic-bezier(0.33,0,0.67,1)',
|
|
48
|
-
linear: 'cubic-bezier(0,0,1,1)'
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Provides shared values between tab style hooks
|
|
52
|
-
* useTabStyles
|
|
53
|
-
* useTabAnimatedIndicator
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
export const tabIndicatorPadding = {
|
|
57
|
-
mediumHorizontal: pendingSpacingTokens.m,
|
|
58
|
-
mediumVertical: pendingSpacingTokens.s,
|
|
59
|
-
smallHorizontal: pendingSpacingTokens.sNudge,
|
|
60
|
-
smallVertical: pendingSpacingTokens.xs
|
|
61
|
-
};
|
|
62
|
-
export const tabIndicatorStrokeWidths = {
|
|
63
|
-
mediumHorizontal: tokens.strokeWidthThicker,
|
|
64
|
-
mediumVertical: tokens.strokeWidthThicker,
|
|
65
|
-
smallHorizontal: tokens.strokeWidthThick,
|
|
66
|
-
smallVertical: tokens.strokeWidthThicker
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=tab.constants.js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;AAE1C,EAAA,aAAa,EAAE,2BAF2B;AAG1C,EAAA,aAAa,EAAE,yBAH2B;AAI1C,EAAA,YAAY,EAAE,uBAJ4B;AAK1C,EAAA,aAAa,EAAE,6BAL2B;AAM1C,EAAA,aAAa,EAAE,4BAN2B;AAO1C,EAAA,WAAW,EAAE,2BAP6B;AAQ1C,EAAA,QAAQ,EAAE,6BARgC;AAS1C,EAAA,MAAM,EAAE;AATkC,CAArC;AAYP;;;;AAIG;;AACH,OAAO,MAAM,mBAAmB,GAAG;AACjC,EAAA,gBAAgB,EAAE,oBAAoB,CAAC,CADN;AAEjC,EAAA,cAAc,EAAE,oBAAoB,CAAC,CAFJ;AAGjC,EAAA,eAAe,EAAE,oBAAoB,CAAC,MAHL;AAIjC,EAAA,aAAa,EAAE,oBAAoB,CAAC;AAJH,CAA5B;AAOP,OAAO,MAAM,wBAAwB,GAAG;AACtC,EAAA,gBAAgB,EAAE,MAAM,CAAC,kBADa;AAEtC,EAAA,cAAc,EAAE,MAAM,CAAC,kBAFe;AAGtC,EAAA,eAAe,EAAE,MAAM,CAAC,gBAHc;AAItC,EAAA,aAAa,EAAE,MAAM,CAAC;AAJgB,CAAjC","sourcesContent":["// TODO: Constants prefixed with pending should be replaced with design tokens\n// These values were taken from the design token superset figma\n\nimport { tokens } from '@fluentui/react-theme';\n\nexport const pendingContentSizeTokens = {\n // Only body sizes are defined here currently\n body1: {\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightRegular,\n lineHeight: tokens.lineHeightBase300,\n },\n body1Strong: {\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: tokens.lineHeightBase300,\n },\n};\n\nexport const pendingSpacingTokens = {\n none: '0',\n xxs: '2px',\n xs: '4px',\n sNudge: '6px',\n s: '8px',\n mNudge: '10px',\n m: '12px',\n l: '16px',\n xl: '20px',\n xxl: '24px',\n xxxl: '32px',\n};\n\nexport const pendingAnimationDurationTokens = {\n ultraFast: '50ms',\n faster: '100ms',\n fast: '150ms',\n normal: '200ms',\n slow: '300ms',\n slower: '400ms',\n ultraSlow: '500ms',\n};\n\nexport const pendingAnimationEasingTokens = {\n accelerateMax: 'cubic-bezier(1,0,1,1)',\n accelerateMid: 'cubic-bezier(0.7,0,1,0.5)',\n accelerateMin: 'cubic-bezier(0.8,0,1,1)',\n declerateMax: 'cubic-bezier(0,0,0,1)',\n decelerateMid: 'cubic-bezier(0.1,0.9,0.2,1)',\n decelarateMin: 'cubic-bezier(0.33,0,0.1,1)',\n maxEasyEase: 'cubic-bezier(0.8,0,0.1,1)',\n easyEase: 'cubic-bezier(0.33,0,0.67,1)',\n linear: 'cubic-bezier(0,0,1,1)',\n};\n\n/**\n * Provides shared values between tab style hooks\n * useTabStyles\n * useTabAnimatedIndicator\n */\nexport const tabIndicatorPadding = {\n mediumHorizontal: pendingSpacingTokens.m,\n mediumVertical: pendingSpacingTokens.s,\n smallHorizontal: pendingSpacingTokens.sNudge,\n smallVertical: pendingSpacingTokens.xs,\n};\n\nexport const tabIndicatorStrokeWidths = {\n mediumHorizontal: tokens.strokeWidthThicker,\n mediumVertical: tokens.strokeWidthThicker,\n smallHorizontal: tokens.strokeWidthThick,\n smallVertical: tokens.strokeWidthThicker,\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';
|