@fluentui/react-tabs 9.1.0 → 9.1.1

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.
Files changed (39) hide show
  1. package/CHANGELOG.json +36 -1
  2. package/CHANGELOG.md +13 -2
  3. package/lib-amd/Tab.js +6 -0
  4. package/lib-amd/Tab.js.map +1 -0
  5. package/lib-amd/TabList.js +6 -0
  6. package/lib-amd/TabList.js.map +1 -0
  7. package/lib-amd/components/Tab/Tab.js +15 -0
  8. package/lib-amd/components/Tab/Tab.js.map +1 -0
  9. package/lib-amd/components/Tab/Tab.types.js +5 -0
  10. package/lib-amd/components/Tab/Tab.types.js.map +1 -0
  11. package/lib-amd/components/Tab/index.js +11 -0
  12. package/lib-amd/components/Tab/index.js.map +1 -0
  13. package/lib-amd/components/Tab/renderTab.js +17 -0
  14. package/lib-amd/components/Tab/renderTab.js.map +1 -0
  15. package/lib-amd/components/Tab/useTab.js +63 -0
  16. package/lib-amd/components/Tab/useTab.js.map +1 -0
  17. package/lib-amd/components/Tab/useTabAnimatedIndicator.js +112 -0
  18. package/lib-amd/components/Tab/useTabAnimatedIndicator.js.map +1 -0
  19. package/lib-amd/components/Tab/useTabStyles.js +380 -0
  20. package/lib-amd/components/Tab/useTabStyles.js.map +1 -0
  21. package/lib-amd/components/TabList/TabList.js +16 -0
  22. package/lib-amd/components/TabList/TabList.js.map +1 -0
  23. package/lib-amd/components/TabList/TabList.types.js +5 -0
  24. package/lib-amd/components/TabList/TabList.types.js.map +1 -0
  25. package/lib-amd/components/TabList/TabListContext.js +29 -0
  26. package/lib-amd/components/TabList/TabListContext.js.map +1 -0
  27. package/lib-amd/components/TabList/index.js +10 -0
  28. package/lib-amd/components/TabList/index.js.map +1 -0
  29. package/lib-amd/components/TabList/renderTabList.js +15 -0
  30. package/lib-amd/components/TabList/renderTabList.js.map +1 -0
  31. package/lib-amd/components/TabList/useTabList.js +74 -0
  32. package/lib-amd/components/TabList/useTabList.js.map +1 -0
  33. package/lib-amd/components/TabList/useTabListContextValues.js +23 -0
  34. package/lib-amd/components/TabList/useTabListContextValues.js.map +1 -0
  35. package/lib-amd/components/TabList/useTabListStyles.js +39 -0
  36. package/lib-amd/components/TabList/useTabListStyles.js.map +1 -0
  37. package/lib-amd/index.js +16 -0
  38. package/lib-amd/index.js.map +1 -0
  39. package/package.json +4 -4
package/CHANGELOG.json CHANGED
@@ -2,7 +2,42 @@
2
2
  "name": "@fluentui/react-tabs",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 11 Nov 2022 14:53:30 GMT",
5
+ "date": "Thu, 17 Nov 2022 23:02:46 GMT",
6
+ "tag": "@fluentui/react-tabs_v9.1.1",
7
+ "version": "9.1.1",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "martinhochel@microsoft.com",
12
+ "package": "@fluentui/react-tabs",
13
+ "commit": "ea768501802d65d63ddc63fff3816fb6b5008ae4",
14
+ "comment": "chore: update package scaffold"
15
+ }
16
+ ],
17
+ "patch": [
18
+ {
19
+ "author": "beachball",
20
+ "package": "@fluentui/react-tabs",
21
+ "comment": "Bump @fluentui/react-context-selector to v9.1.2",
22
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
23
+ },
24
+ {
25
+ "author": "beachball",
26
+ "package": "@fluentui/react-tabs",
27
+ "comment": "Bump @fluentui/react-tabster to v9.3.1",
28
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
29
+ },
30
+ {
31
+ "author": "beachball",
32
+ "package": "@fluentui/react-tabs",
33
+ "comment": "Bump @fluentui/react-utilities to v9.2.2",
34
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ "date": "Fri, 11 Nov 2022 14:57:43 GMT",
6
41
  "tag": "@fluentui/react-tabs_v9.1.0",
7
42
  "version": "9.1.0",
8
43
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,23 @@
1
1
  # Change Log - @fluentui/react-tabs
2
2
 
3
- This log was last generated on Fri, 11 Nov 2022 14:53:30 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Nov 2022 23:02:46 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.1.1)
8
+
9
+ Thu, 17 Nov 2022 23:02:46 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.1.0..@fluentui/react-tabs_v9.1.1)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-context-selector to v9.1.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
15
+ - Bump @fluentui/react-tabster to v9.3.1 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.2.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
17
+
7
18
  ## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.1.0)
8
19
 
9
- Fri, 11 Nov 2022 14:53:30 GMT
20
+ Fri, 11 Nov 2022 14:57:43 GMT
10
21
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.0.10..@fluentui/react-tabs_v9.1.0)
11
22
 
12
23
  ### Minor changes
package/lib-amd/Tab.js ADDED
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/Tab/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=Tab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-tabs/src/Tab.ts"],"names":[],"mappings":";;;IAAA,uCAAuC","sourcesContent":["export * from './components/Tab/index';\n"]}
@@ -0,0 +1,6 @@
1
+ define(["require", "exports", "tslib", "./components/TabList/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(index_1, exports);
5
+ });
6
+ //# sourceMappingURL=TabList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabList.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-tabs/src/TabList.ts"],"names":[],"mappings":";;;IAAA,uCAA2C","sourcesContent":["export * from './components/TabList/index';\n"]}
@@ -0,0 +1,15 @@
1
+ define(["require", "exports", "react", "./useTab", "./renderTab", "./useTabStyles"], function (require, exports, React, useTab_1, renderTab_1, useTabStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Tab = void 0;
5
+ /**
6
+ * A tab provides a selectable item in a tab list.
7
+ */
8
+ exports.Tab = React.forwardRef(function (props, ref) {
9
+ var state = useTab_1.useTab_unstable(props, ref);
10
+ useTabStyles_1.useTabStyles_unstable(state);
11
+ return renderTab_1.renderTab_unstable(state);
12
+ });
13
+ exports.Tab.displayName = 'Tab';
14
+ });
15
+ //# sourceMappingURL=Tab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/Tab/Tab.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,GAAG,GAAkC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC5E,IAAM,KAAK,GAAG,wBAAe,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE1C,oCAAqB,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,8BAAkB,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,WAAG,CAAC,WAAW,GAAG,KAAK,CAAC","sourcesContent":["import * as React from 'react';\nimport { useTab_unstable } from './useTab';\nimport { renderTab_unstable } from './renderTab';\nimport { useTabStyles_unstable } from './useTabStyles';\nimport type { TabProps } from './Tab.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A tab provides a selectable item in a tab list.\n */\nexport const Tab: ForwardRefComponent<TabProps> = React.forwardRef((props, ref) => {\n const state = useTab_unstable(props, ref);\n\n useTabStyles_unstable(state);\n return renderTab_unstable(state);\n});\n\nTab.displayName = 'Tab';\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=Tab.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tab.types.js","sourceRoot":"","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"]}
@@ -0,0 +1,11 @@
1
+ define(["require", "exports", "tslib", "./Tab", "./Tab.types", "./renderTab", "./useTab", "./useTabStyles", "./useTabAnimatedIndicator"], function (require, exports, tslib_1, Tab_1, Tab_types_1, renderTab_1, useTab_1, useTabStyles_1, useTabAnimatedIndicator_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(Tab_1, exports);
5
+ tslib_1.__exportStar(Tab_types_1, exports);
6
+ tslib_1.__exportStar(renderTab_1, exports);
7
+ tslib_1.__exportStar(useTab_1, exports);
8
+ tslib_1.__exportStar(useTabStyles_1, exports);
9
+ tslib_1.__exportStar(useTabAnimatedIndicator_1, exports);
10
+ });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/Tab/index.ts"],"names":[],"mappings":";;;IAAA,qCAAsB;IACtB,2CAA4B;IAC5B,2CAA4B;IAC5B,wCAAyB;IACzB,8CAA+B;IAC/B,yDAA0C","sourcesContent":["export * from './Tab';\nexport * from './Tab.types';\nexport * from './renderTab';\nexport * from './useTab';\nexport * from './useTabStyles';\nexport * from './useTabAnimatedIndicator';\n"]}
@@ -0,0 +1,17 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderTab_unstable = void 0;
5
+ /**
6
+ * Render the final JSX of Tab
7
+ */
8
+ var renderTab_unstable = function (state) {
9
+ var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
10
+ return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
+ slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
12
+ !state.iconOnly && React.createElement(slots.content, tslib_1.__assign({}, slotProps.content)),
13
+ !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && (React.createElement(slots.content, tslib_1.__assign({}, slotProps.content, { className: state.contentReservedSpaceClassName })))));
14
+ };
15
+ exports.renderTab_unstable = renderTab_unstable;
16
+ });
17
+ //# sourceMappingURL=renderTab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderTab.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/Tab/renderTab.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,kBAAkB,GAAG,UAAC,KAAe;QAC1C,IAAA,KAAuB,0BAAQ,CAAW,KAAK,CAAC,EAA9C,KAAK,WAAA,EAAE,SAAS,eAA8B,CAAC;QAEvD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YAChD,CAAC,KAAK,CAAC,QAAQ,IAAI,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI;YAC3D,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,6BAA6B,KAAK,SAAS,IAAI,CAC1F,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,IAAE,SAAS,EAAE,KAAK,CAAC,6BAA6B,IAAI,CACzF,CACU,CACd,CAAC;IACJ,CAAC,CAAC;IAZW,QAAA,kBAAkB,sBAY7B","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"]}
@@ -0,0 +1,63 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "../TabList/TabListContext", "@fluentui/react-context-selector"], function (require, exports, tslib_1, React, react_utilities_1, TabListContext_1, react_context_selector_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useTab_unstable = void 0;
5
+ /**
6
+ * Create the state required to render Tab.
7
+ *
8
+ * The returned state can be modified with hooks such as useTabStyles_unstable,
9
+ * before being passed to renderTab_unstable.
10
+ *
11
+ * @param props - props from this instance of Tab
12
+ * @param ref - reference to root HTMLElement of Tab
13
+ */
14
+ var useTab_unstable = function (props, ref) {
15
+ var content = props.content, _a = props.disabled, tabDisabled = _a === void 0 ? false : _a, icon = props.icon, value = props.value;
16
+ var appearance = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.appearance; });
17
+ var reserveSelectedTabSpace = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.reserveSelectedTabSpace; });
18
+ var listDisabled = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.disabled; });
19
+ var selected = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.selectedValue === value; });
20
+ var onRegister = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.onRegister; });
21
+ var onUnregister = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.onUnregister; });
22
+ var onSelect = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.onSelect; });
23
+ var size = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.size; });
24
+ var vertical = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return !!ctx.vertical; });
25
+ var disabled = listDisabled || tabDisabled;
26
+ var innerRef = React.useRef(null);
27
+ var onClick = react_utilities_1.useEventCallback(function (event) { return onSelect(event, { value: value }); });
28
+ React.useEffect(function () {
29
+ onRegister({
30
+ value: value,
31
+ ref: innerRef,
32
+ });
33
+ return function () {
34
+ onUnregister({ value: value, ref: innerRef });
35
+ };
36
+ }, [onRegister, onUnregister, innerRef, value]);
37
+ var iconShorthand = react_utilities_1.resolveShorthand(icon);
38
+ var contentShorthand = react_utilities_1.resolveShorthand(content, { required: true, defaultProps: { children: props.children } });
39
+ return {
40
+ components: {
41
+ root: 'button',
42
+ icon: 'span',
43
+ content: 'span',
44
+ },
45
+ root: react_utilities_1.getNativeElementProps('button', tslib_1.__assign(tslib_1.__assign({ ref: react_utilities_1.useMergedRefs(ref, innerRef), role: 'tab', type: 'button',
46
+ // aria-selected undefined indicates it is not selectable
47
+ // according to https://www.w3.org/TR/wai-aria-1.1/#aria-selected
48
+ 'aria-selected': disabled ? undefined : "" + selected }, props), { disabled: disabled, onClick: onClick })),
49
+ icon: iconShorthand,
50
+ iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !contentShorthand.children),
51
+ content: contentShorthand,
52
+ appearance: appearance,
53
+ contentReservedSpaceClassName: reserveSelectedTabSpace ? '' : undefined,
54
+ disabled: disabled,
55
+ selected: selected,
56
+ size: size,
57
+ value: value,
58
+ vertical: vertical,
59
+ };
60
+ };
61
+ exports.useTab_unstable = useTab_unstable;
62
+ });
63
+ //# sourceMappingURL=useTab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTab.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/Tab/useTab.ts"],"names":[],"mappings":";;;;IA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AAC,CAAC,CAAC,KAAG,QAAU,IAClD,KAAK,KACR,QAAQ,UAAA,EACR,OAAO,SAAA,IACP;YACF,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE,OAAO,CAAC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,KAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;YACxE,OAAO,EAAE,gBAAgB;YACzB,UAAU,YAAA;YACV,6BAA6B,EAAE,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;YACvE,QAAQ,UAAA;YACR,QAAQ,UAAA;YACR,IAAI,MAAA;YACJ,KAAK,OAAA;YACL,QAAQ,UAAA;SACT,CAAC;IACJ,CAAC,CAAC;IA1DW,QAAA,eAAe,mBA0D1B","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"]}
@@ -0,0 +1,112 @@
1
+ define(["require", "exports", "tslib", "react", "@griffel/react", "@fluentui/react-context-selector", "../TabList/TabListContext", "@fluentui/react-theme"], function (require, exports, tslib_1, React, react_1, react_context_selector_1, TabListContext_1, react_theme_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useTabAnimatedIndicatorStyles_unstable = void 0;
5
+ // eslint-disable-next-line @typescript-eslint/naming-convention
6
+ var tabIndicatorCssVars_unstable = {
7
+ offsetVar: '--fui-Tab__indicator--offset',
8
+ scaleVar: '--fui-Tab__indicator--scale',
9
+ };
10
+ var useActiveIndicatorStyles = react_1.makeStyles({
11
+ base: tslib_1.__assign({}, react_1.shorthands.overflow('visible')),
12
+ animated: {
13
+ '::after': {
14
+ transitionProperty: 'transform',
15
+ transitionDuration: "" + react_theme_1.tokens.durationSlow,
16
+ transitionTimingFunction: "" + react_theme_1.tokens.curveDecelerateMax,
17
+ },
18
+ '@media (prefers-reduced-motion: reduce)': {
19
+ '::after': {
20
+ transitionProperty: 'none',
21
+ transitionDuration: '0.01ms',
22
+ },
23
+ },
24
+ },
25
+ horizontal: {
26
+ '::after': {
27
+ transformOrigin: 'left',
28
+ transform: "translateX(var(" + tabIndicatorCssVars_unstable.offsetVar + "))\n scaleX(var(" + tabIndicatorCssVars_unstable.scaleVar + "))",
29
+ },
30
+ },
31
+ vertical: {
32
+ '::after': {
33
+ transformOrigin: 'top',
34
+ transform: "translateY(var(" + tabIndicatorCssVars_unstable.offsetVar + "))\n scaleY(var(" + tabIndicatorCssVars_unstable.scaleVar + "))",
35
+ },
36
+ },
37
+ });
38
+ var calculateTabRect = function (element) {
39
+ var _a;
40
+ if (element) {
41
+ var parentRect = ((_a = element.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || { x: 0, y: 0, width: 0, height: 0 };
42
+ var tabRect = element.getBoundingClientRect();
43
+ return {
44
+ x: tabRect.x - parentRect.x,
45
+ y: tabRect.y - parentRect.y,
46
+ width: tabRect.width,
47
+ height: tabRect.height,
48
+ };
49
+ }
50
+ return undefined;
51
+ };
52
+ var getRegisteredTabRect = function (registeredTabs, value) {
53
+ var _a;
54
+ var element = value !== undefined && value !== null ? (_a = registeredTabs[JSON.stringify(value)]) === null || _a === void 0 ? void 0 : _a.ref.current : undefined;
55
+ return element ? calculateTabRect(element) : undefined;
56
+ };
57
+ /**
58
+ * Adds additional styling to the active tab selection indicator to create a sliding animation.
59
+ */
60
+ var useTabAnimatedIndicatorStyles_unstable = function (state) {
61
+ var _a;
62
+ var disabled = state.disabled, selected = state.selected, vertical = state.vertical;
63
+ var activeIndicatorStyles = useActiveIndicatorStyles();
64
+ var _b = React.useState(), lastAnimatedFrom = _b[0], setLastAnimatedFrom = _b[1];
65
+ var _c = React.useState({ offset: 0, scale: 1 }), animationValues = _c[0], setAnimationValues = _c[1];
66
+ var getRegisteredTabs = react_context_selector_1.useContextSelector(TabListContext_1.TabListContext, function (ctx) { return ctx.getRegisteredTabs; });
67
+ React.useEffect(function () {
68
+ if (lastAnimatedFrom) {
69
+ setAnimationValues({ offset: 0, scale: 1 });
70
+ }
71
+ }, [lastAnimatedFrom]);
72
+ if (selected) {
73
+ var _d = getRegisteredTabs(), previousSelectedValue = _d.previousSelectedValue, selectedValue = _d.selectedValue, registeredTabs = _d.registeredTabs;
74
+ var previousSelectedTabRect = getRegisteredTabRect(registeredTabs, previousSelectedValue);
75
+ var selectedTabRect = getRegisteredTabRect(registeredTabs, selectedValue);
76
+ if (selectedTabRect &&
77
+ previousSelectedTabRect &&
78
+ previousSelectedValue &&
79
+ lastAnimatedFrom !== previousSelectedValue) {
80
+ var offset = vertical
81
+ ? previousSelectedTabRect.y - selectedTabRect.y
82
+ : previousSelectedTabRect.x - selectedTabRect.x;
83
+ var scale = vertical
84
+ ? previousSelectedTabRect.height / selectedTabRect.height
85
+ : previousSelectedTabRect.width / selectedTabRect.width;
86
+ setAnimationValues({ offset: offset, scale: scale });
87
+ setLastAnimatedFrom(previousSelectedValue);
88
+ }
89
+ }
90
+ else if (lastAnimatedFrom) {
91
+ // need to clear the last animated from so that if this tab is selected again
92
+ // from the same previous tab as last time, that animation still happens.
93
+ setLastAnimatedFrom(undefined);
94
+ }
95
+ // do not apply any animation if the tab is disabled
96
+ if (disabled) {
97
+ return state;
98
+ }
99
+ // the animation should only happen as the selection indicator returns to its
100
+ // original position and not when set at the previous tabs position.
101
+ var animating = animationValues.offset === 0 && animationValues.scale === 1;
102
+ state.root.className = react_1.mergeClasses(state.root.className, selected && activeIndicatorStyles.base, selected && animating && activeIndicatorStyles.animated, selected && (vertical ? activeIndicatorStyles.vertical : activeIndicatorStyles.horizontal));
103
+ var rootCssVars = (_a = {},
104
+ _a[tabIndicatorCssVars_unstable.offsetVar] = animationValues.offset + "px",
105
+ _a[tabIndicatorCssVars_unstable.scaleVar] = "" + animationValues.scale,
106
+ _a);
107
+ state.root.style = tslib_1.__assign(tslib_1.__assign({}, rootCssVars), state.root.style);
108
+ return state;
109
+ };
110
+ exports.useTabAnimatedIndicatorStyles_unstable = useTabAnimatedIndicatorStyles_unstable;
111
+ });
112
+ //# sourceMappingURL=useTabAnimatedIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabAnimatedIndicator.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/Tab/useTabAnimatedIndicator.ts"],"names":[],"mappings":";;;;IASA,gEAAgE;IAChE,IAAM,4BAA4B,GAAG;QACnC,SAAS,EAAE,8BAA8B;QACzC,QAAQ,EAAE,6BAA6B;KACxC,CAAC;IAEF,IAAM,wBAAwB,GAAG,kBAAU,CAAC;QAC1C,IAAI,uBAEC,kBAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAClC;QACD,QAAQ,EAAE;YACR,SAAS,EAAE;gBACT,kBAAkB,EAAE,WAAW;gBAC/B,kBAAkB,EAAE,KAAG,oBAAM,CAAC,YAAc;gBAC5C,wBAAwB,EAAE,KAAG,oBAAM,CAAC,kBAAoB;aACzD;YACD,yCAAyC,EAAE;gBACzC,SAAS,EAAE;oBACT,kBAAkB,EAAE,MAAM;oBAC1B,kBAAkB,EAAE,QAAQ;iBAC7B;aACF;SACF;QACD,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,eAAe,EAAE,MAAM;gBACvB,SAAS,EAAE,oBAAkB,4BAA4B,CAAC,SAAS,2BACxD,4BAA4B,CAAC,QAAQ,OAAI;aACrD;SACF;QACD,QAAQ,EAAE;YACR,SAAS,EAAE;gBACT,eAAe,EAAE,KAAK;gBACtB,SAAS,EAAE,oBAAkB,4BAA4B,CAAC,SAAS,+BACpD,4BAA4B,CAAC,QAAQ,OAAI;aACzD;SACF;KACF,CAAC,CAAC;IAEH,IAAM,gBAAgB,GAAG,UAAC,OAA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AAmB,CAAC,qBAAqB,CAAC,CAAC;aAC5C;SACF;aAAM,IAAI,gBAAgB,EAAE;YAC3B,6EAA6E;YAC7E,yEAAyE;YACzE,mBAAmB,CAAC,SAAS,CAAC,CAAC;SAChC;QAED,oDAAoD;QACpD,IAAI,QAAQ,EAAE;YACZ,OAAO,KAAK,CAAC;SACd;QAED,6EAA6E;QAC7E,oEAAoE;QACpE,IAAM,SAAS,GAAG,eAAe,CAAC,MAAM,KAAK,CAAC,IAAI,eAAe,CAAC,KAAK,KAAK,CAAC,CAAC;QAE9E,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,KAAK,CAAC,IAAI,CAAC,SAAS,EACpB,QAAQ,IAAI,qBAAqB,CAAC,IAAI,EACtC,QAAQ,IAAI,SAAS,IAAI,qBAAqB,CAAC,QAAQ,EACvD,QAAQ,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAC3F,CAAC;QAEF,IAAM,WAAW;YACf,GAAC,4BAA4B,CAAC,SAAS,IAAM,eAAe,CAAC,MAAM,OAAI;YACvE,GAAC,4BAA4B,CAAC,QAAQ,IAAG,KAAG,eAAe,CAAC,KAAO;eACpE,CAAC;QAEF,KAAK,CAAC,IAAI,CAAC,KAAK,yCACX,WAAW,GACX,KAAK,CAAC,IAAI,CAAC,KAAK,CACpB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IArEW,QAAA,sCAAsC,0CAqEjD","sourcesContent":["import * as React from 'react';\nimport type { TabState, TabValue } from './Tab.types';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { useContextSelector } from '@fluentui/react-context-selector';\nimport { TabListContext } from '../TabList/TabListContext';\nimport { TabRegisterData } from '../TabList/TabList.types';\nimport { tokens } from '@fluentui/react-theme';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst tabIndicatorCssVars_unstable = {\n offsetVar: '--fui-Tab__indicator--offset',\n scaleVar: '--fui-Tab__indicator--scale',\n};\n\nconst useActiveIndicatorStyles = makeStyles({\n base: {\n // overflow is required to allow the selection indicator to animate outside the tab area.\n ...shorthands.overflow('visible'),\n },\n animated: {\n '::after': {\n transitionProperty: 'transform',\n transitionDuration: `${tokens.durationSlow}`,\n transitionTimingFunction: `${tokens.curveDecelerateMax}`,\n },\n '@media (prefers-reduced-motion: reduce)': {\n '::after': {\n transitionProperty: 'none',\n transitionDuration: '0.01ms',\n },\n },\n },\n horizontal: {\n '::after': {\n transformOrigin: 'left',\n transform: `translateX(var(${tabIndicatorCssVars_unstable.offsetVar}))\n scaleX(var(${tabIndicatorCssVars_unstable.scaleVar}))`,\n },\n },\n vertical: {\n '::after': {\n transformOrigin: 'top',\n transform: `translateY(var(${tabIndicatorCssVars_unstable.offsetVar}))\n scaleY(var(${tabIndicatorCssVars_unstable.scaleVar}))`,\n },\n },\n});\n\nconst calculateTabRect = (element: HTMLElement) => {\n if (element) {\n const parentRect = element.parentElement?.getBoundingClientRect() || { x: 0, y: 0, width: 0, height: 0 };\n const tabRect = element.getBoundingClientRect();\n\n return {\n x: tabRect.x - parentRect.x,\n y: tabRect.y - parentRect.y,\n width: tabRect.width,\n height: tabRect.height,\n };\n }\n return undefined;\n};\n\nconst getRegisteredTabRect = (registeredTabs: Record<string, TabRegisterData>, value?: TabValue) => {\n const element =\n value !== undefined && value !== null ? registeredTabs[JSON.stringify(value)]?.ref.current : undefined;\n return element ? calculateTabRect(element) : undefined;\n};\n\n/**\n * Adds additional styling to the active tab selection indicator to create a sliding animation.\n */\nexport const useTabAnimatedIndicatorStyles_unstable = (state: TabState): TabState => {\n const { disabled, selected, vertical } = state;\n\n const activeIndicatorStyles = useActiveIndicatorStyles();\n const [lastAnimatedFrom, setLastAnimatedFrom] = React.useState<TabValue>();\n const [animationValues, setAnimationValues] = React.useState({ offset: 0, scale: 1 });\n const getRegisteredTabs = useContextSelector(TabListContext, ctx => ctx.getRegisteredTabs);\n\n React.useEffect(() => {\n if (lastAnimatedFrom) {\n setAnimationValues({ offset: 0, scale: 1 });\n }\n }, [lastAnimatedFrom]);\n\n if (selected) {\n const { previousSelectedValue, selectedValue, registeredTabs } = getRegisteredTabs();\n const previousSelectedTabRect = getRegisteredTabRect(registeredTabs, previousSelectedValue);\n const selectedTabRect = getRegisteredTabRect(registeredTabs, selectedValue);\n\n if (\n selectedTabRect &&\n previousSelectedTabRect &&\n previousSelectedValue &&\n lastAnimatedFrom !== previousSelectedValue\n ) {\n const offset = vertical\n ? previousSelectedTabRect.y - selectedTabRect.y\n : previousSelectedTabRect.x - selectedTabRect.x;\n\n const scale = vertical\n ? previousSelectedTabRect.height / selectedTabRect.height\n : previousSelectedTabRect.width / selectedTabRect.width;\n\n setAnimationValues({ offset, scale });\n setLastAnimatedFrom(previousSelectedValue);\n }\n } else if (lastAnimatedFrom) {\n // need to clear the last animated from so that if this tab is selected again\n // from the same previous tab as last time, that animation still happens.\n setLastAnimatedFrom(undefined);\n }\n\n // do not apply any animation if the tab is disabled\n if (disabled) {\n return state;\n }\n\n // the animation should only happen as the selection indicator returns to its\n // original position and not when set at the previous tabs position.\n const animating = animationValues.offset === 0 && animationValues.scale === 1;\n\n state.root.className = mergeClasses(\n state.root.className,\n selected && activeIndicatorStyles.base,\n selected && animating && activeIndicatorStyles.animated,\n selected && (vertical ? activeIndicatorStyles.vertical : activeIndicatorStyles.horizontal),\n );\n\n const rootCssVars = {\n [tabIndicatorCssVars_unstable.offsetVar]: `${animationValues.offset}px`,\n [tabIndicatorCssVars_unstable.scaleVar]: `${animationValues.scale}`,\n };\n\n state.root.style = {\n ...rootCssVars,\n ...state.root.style,\n };\n\n return state;\n};\n"]}
@@ -0,0 +1,380 @@
1
+ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-tabster", "@fluentui/react-theme", "./useTabAnimatedIndicator"], function (require, exports, tslib_1, react_1, react_tabster_1, react_theme_1, useTabAnimatedIndicator_1) {
2
+ "use strict";
3
+ var _a, _b;
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.useTabStyles_unstable = exports.tabClassNames = void 0;
6
+ exports.tabClassNames = {
7
+ root: 'fui-Tab',
8
+ icon: 'fui-Tab__icon',
9
+ content: 'fui-Tab__content',
10
+ };
11
+ var reservedSpaceClassNames = {
12
+ content: 'fui-Tab__content--reserved-space',
13
+ };
14
+ // These should match the constants defined in @fluentui/react-icons
15
+ // This package avoids taking a dependency on the icons package for only the constants.
16
+ var iconClassNames = {
17
+ filled: 'fui-Icon-filled',
18
+ regular: 'fui-Icon-regular',
19
+ };
20
+ /**
21
+ * Styles for the root slot
22
+ */
23
+ /* eslint-disable @typescript-eslint/naming-convention */
24
+ var useRootStyles = react_1.makeStyles({
25
+ base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ alignItems: 'center' }, react_1.shorthands.borderColor('none')), react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)), react_1.shorthands.borderWidth(0)), { cursor: 'pointer', display: 'grid', flexShrink: 0, gridAutoFlow: 'column', gridTemplateColumns: 'auto', gridTemplateRows: 'auto', fontFamily: react_theme_1.tokens.fontFamilyBase, lineHeight: react_theme_1.tokens.lineHeightBase300, outlineStyle: 'none', position: 'relative' }), react_1.shorthands.overflow('hidden')), { textTransform: 'none' }),
26
+ horizontal: {
27
+ justifyContent: 'center',
28
+ },
29
+ vertical: {
30
+ justifyContent: 'start',
31
+ },
32
+ smallHorizontal: tslib_1.__assign({ columnGap: react_theme_1.tokens.spacingHorizontalXXS }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalSNudge, react_theme_1.tokens.spacingHorizontalSNudge)),
33
+ smallVertical: tslib_1.__assign({
34
+ // horizontal spacing is deliberate. This is the gap between icon and content.
35
+ columnGap: react_theme_1.tokens.spacingHorizontalXXS }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalXXS, react_theme_1.tokens.spacingHorizontalSNudge)),
36
+ mediumHorizontal: tslib_1.__assign({ columnGap: react_theme_1.tokens.spacingHorizontalSNudge }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalM, react_theme_1.tokens.spacingHorizontalMNudge)),
37
+ mediumVertical: tslib_1.__assign({
38
+ // horizontal spacing is deliberate. This is the gap between icon and content.
39
+ columnGap: react_theme_1.tokens.spacingHorizontalSNudge }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalSNudge, react_theme_1.tokens.spacingHorizontalMNudge)),
40
+ largeHorizontal: tslib_1.__assign({ columnGap: react_theme_1.tokens.spacingHorizontalSNudge }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalL, react_theme_1.tokens.spacingHorizontalMNudge)),
41
+ largeVertical: tslib_1.__assign({
42
+ // horizontal spacing is deliberate. This is the gap between icon and content.
43
+ columnGap: react_theme_1.tokens.spacingHorizontalSNudge }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalS, react_theme_1.tokens.spacingHorizontalMNudge)),
44
+ transparent: {
45
+ backgroundColor: react_theme_1.tokens.colorTransparentBackground,
46
+ ':hover': {
47
+ backgroundColor: react_theme_1.tokens.colorTransparentBackgroundHover,
48
+ },
49
+ ':active': {
50
+ backgroundColor: react_theme_1.tokens.colorTransparentBackgroundPressed,
51
+ },
52
+ '& .fui-Tab__icon': {
53
+ color: react_theme_1.tokens.colorNeutralForeground2,
54
+ },
55
+ ':hover .fui-Tab__icon': {
56
+ color: react_theme_1.tokens.colorNeutralForeground2Hover,
57
+ },
58
+ ':active .fui-Tab__icon': {
59
+ color: react_theme_1.tokens.colorNeutralForeground2Pressed,
60
+ },
61
+ '& .fui-Tab__content': {
62
+ color: react_theme_1.tokens.colorNeutralForeground2,
63
+ },
64
+ ':hover .fui-Tab__content': {
65
+ color: react_theme_1.tokens.colorNeutralForeground2Hover,
66
+ },
67
+ ':active .fui-Tab__content': {
68
+ color: react_theme_1.tokens.colorNeutralForeground2Pressed,
69
+ },
70
+ },
71
+ subtle: {
72
+ backgroundColor: react_theme_1.tokens.colorSubtleBackground,
73
+ ':hover': {
74
+ backgroundColor: react_theme_1.tokens.colorSubtleBackgroundHover,
75
+ },
76
+ ':active': {
77
+ backgroundColor: react_theme_1.tokens.colorSubtleBackgroundPressed,
78
+ },
79
+ '& .fui-Tab__icon': {
80
+ color: react_theme_1.tokens.colorNeutralForeground2,
81
+ },
82
+ ':hover .fui-Tab__icon': {
83
+ color: react_theme_1.tokens.colorNeutralForeground2Hover,
84
+ },
85
+ ':active .fui-Tab__icon': {
86
+ color: react_theme_1.tokens.colorNeutralForeground2Pressed,
87
+ },
88
+ '& .fui-Tab__content': {
89
+ color: react_theme_1.tokens.colorNeutralForeground2,
90
+ },
91
+ ':hover .fui-Tab__content': {
92
+ color: react_theme_1.tokens.colorNeutralForeground2Hover,
93
+ },
94
+ ':active .fui-Tab__content': {
95
+ color: react_theme_1.tokens.colorNeutralForeground2Pressed,
96
+ },
97
+ },
98
+ disabled: {
99
+ backgroundColor: react_theme_1.tokens.colorTransparentBackground,
100
+ '& .fui-Tab__icon': {
101
+ color: react_theme_1.tokens.colorNeutralForegroundDisabled,
102
+ },
103
+ '& .fui-Tab__content': {
104
+ color: react_theme_1.tokens.colorNeutralForegroundDisabled,
105
+ },
106
+ cursor: 'not-allowed',
107
+ },
108
+ selected: {
109
+ '& .fui-Tab__icon': {
110
+ color: react_theme_1.tokens.colorCompoundBrandForeground1,
111
+ },
112
+ ':hover .fui-Tab__icon': {
113
+ color: react_theme_1.tokens.colorCompoundBrandForeground1Hover,
114
+ },
115
+ ':active .fui-Tab__icon': {
116
+ color: react_theme_1.tokens.colorCompoundBrandForeground1Pressed,
117
+ },
118
+ '& .fui-Tab__content': {
119
+ color: react_theme_1.tokens.colorNeutralForeground1,
120
+ },
121
+ ':hover .fui-Tab__content': {
122
+ color: react_theme_1.tokens.colorNeutralForeground1Hover,
123
+ },
124
+ ':active .fui-Tab__content': {
125
+ color: react_theme_1.tokens.colorNeutralForeground1Pressed,
126
+ },
127
+ },
128
+ });
129
+ /* eslint-enable @typescript-eslint/naming-convention */
130
+ /**
131
+ * Focus styles for the root slot
132
+ */
133
+ var useFocusStyles = react_1.makeStyles({
134
+ // Tab creates a custom focus indicator because the default focus indicator
135
+ // is applied using an ::after pseudo-element on the root. Since the selection
136
+ // indicator uses an ::after pseudo-element on the root, there is a conflict.
137
+ base: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.borderColor('transparent')), { outlineWidth: react_theme_1.tokens.strokeWidthThick, outlineColor: 'transparent', outlineStyle: 'solid', boxShadow: "\n " + react_theme_1.tokens.shadow4 + ",\n 0 0 0 " + react_theme_1.tokens.strokeWidthThick + " " + react_theme_1.tokens.colorStrokeFocus2 + "\n ", zIndex: 1 })),
138
+ });
139
+ /** Indicator styles for when pending selection */
140
+ var usePendingIndicatorStyles = react_1.makeStyles({
141
+ base: {
142
+ ':hover::before': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralStroke1Hover }, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), { content: '""', position: 'absolute' }),
143
+ ':active::before': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralStroke1Pressed }, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), { content: '""', position: 'absolute' }),
144
+ '@media (forced-colors: active)': {
145
+ ':hover::before': {
146
+ backgroundColor: 'Highlight',
147
+ },
148
+ ':active::before': {
149
+ backgroundColor: 'Highlight',
150
+ },
151
+ },
152
+ },
153
+ disabled: {
154
+ ':hover::before': {
155
+ backgroundColor: react_theme_1.tokens.colorTransparentStroke,
156
+ },
157
+ ':active::before': {
158
+ backgroundColor: react_theme_1.tokens.colorTransparentStroke,
159
+ },
160
+ },
161
+ smallHorizontal: {
162
+ '::before': {
163
+ bottom: 0,
164
+ height: react_theme_1.tokens.strokeWidthThick,
165
+ left: react_theme_1.tokens.spacingHorizontalSNudge,
166
+ right: react_theme_1.tokens.spacingHorizontalSNudge,
167
+ },
168
+ },
169
+ smallVertical: {
170
+ '::before': {
171
+ bottom: react_theme_1.tokens.spacingVerticalXS,
172
+ left: 0,
173
+ top: react_theme_1.tokens.spacingVerticalXS,
174
+ width: react_theme_1.tokens.strokeWidthThicker,
175
+ },
176
+ },
177
+ mediumHorizontal: {
178
+ '::before': {
179
+ bottom: 0,
180
+ height: react_theme_1.tokens.strokeWidthThicker,
181
+ left: react_theme_1.tokens.spacingHorizontalM,
182
+ right: react_theme_1.tokens.spacingHorizontalM,
183
+ },
184
+ },
185
+ mediumVertical: {
186
+ '::before': {
187
+ bottom: react_theme_1.tokens.spacingVerticalS,
188
+ left: 0,
189
+ top: react_theme_1.tokens.spacingVerticalS,
190
+ width: react_theme_1.tokens.strokeWidthThicker,
191
+ },
192
+ },
193
+ largeHorizontal: {
194
+ '::before': {
195
+ bottom: 0,
196
+ height: react_theme_1.tokens.strokeWidthThicker,
197
+ left: react_theme_1.tokens.spacingHorizontalM,
198
+ right: react_theme_1.tokens.spacingHorizontalM,
199
+ },
200
+ },
201
+ largeVertical: {
202
+ '::before': {
203
+ bottom: react_theme_1.tokens.spacingVerticalMNudge,
204
+ left: 0,
205
+ top: react_theme_1.tokens.spacingVerticalMNudge,
206
+ width: react_theme_1.tokens.strokeWidthThicker,
207
+ },
208
+ },
209
+ });
210
+ var useActiveIndicatorStyles = react_1.makeStyles({
211
+ base: {
212
+ '::after': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentStroke }, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), { content: '""', position: 'absolute', zIndex: 1 }),
213
+ },
214
+ selected: {
215
+ '::after': {
216
+ backgroundColor: react_theme_1.tokens.colorCompoundBrandStroke,
217
+ },
218
+ ':hover::after': {
219
+ backgroundColor: react_theme_1.tokens.colorCompoundBrandStrokeHover,
220
+ },
221
+ ':active::after': {
222
+ backgroundColor: react_theme_1.tokens.colorCompoundBrandStrokePressed,
223
+ },
224
+ '@media (forced-colors: active)': {
225
+ '::after': {
226
+ backgroundColor: 'ButtonText',
227
+ },
228
+ ':hover::after': {
229
+ backgroundColor: 'ButtonText',
230
+ },
231
+ ':active::after': {
232
+ backgroundColor: 'ButtonText',
233
+ },
234
+ },
235
+ },
236
+ disabled: {
237
+ '::after': {
238
+ backgroundColor: react_theme_1.tokens.colorNeutralForegroundDisabled,
239
+ },
240
+ },
241
+ smallHorizontal: {
242
+ '::after': {
243
+ bottom: 0,
244
+ height: react_theme_1.tokens.strokeWidthThick,
245
+ left: react_theme_1.tokens.spacingHorizontalSNudge,
246
+ right: react_theme_1.tokens.spacingHorizontalSNudge,
247
+ },
248
+ },
249
+ smallVertical: {
250
+ '::after': {
251
+ bottom: react_theme_1.tokens.spacingVerticalXS,
252
+ left: '0',
253
+ top: react_theme_1.tokens.spacingVerticalXS,
254
+ width: react_theme_1.tokens.strokeWidthThicker,
255
+ },
256
+ },
257
+ mediumHorizontal: {
258
+ '::after': {
259
+ bottom: '0',
260
+ height: react_theme_1.tokens.strokeWidthThicker,
261
+ left: react_theme_1.tokens.spacingHorizontalM,
262
+ right: react_theme_1.tokens.spacingHorizontalM,
263
+ },
264
+ },
265
+ mediumVertical: {
266
+ '::after': {
267
+ bottom: react_theme_1.tokens.spacingVerticalS,
268
+ left: 0,
269
+ top: react_theme_1.tokens.spacingVerticalS,
270
+ width: react_theme_1.tokens.strokeWidthThicker,
271
+ },
272
+ },
273
+ largeHorizontal: {
274
+ '::after': {
275
+ bottom: 0,
276
+ height: react_theme_1.tokens.strokeWidthThicker,
277
+ left: react_theme_1.tokens.spacingHorizontalM,
278
+ right: react_theme_1.tokens.spacingHorizontalM,
279
+ },
280
+ },
281
+ largeVertical: {
282
+ '::after': {
283
+ bottom: react_theme_1.tokens.spacingVerticalMNudge,
284
+ left: 0,
285
+ top: react_theme_1.tokens.spacingVerticalMNudge,
286
+ width: react_theme_1.tokens.strokeWidthThicker,
287
+ },
288
+ },
289
+ });
290
+ /**
291
+ * Styles for the icon slot.
292
+ */
293
+ var useIconStyles = react_1.makeStyles({
294
+ base: tslib_1.__assign(tslib_1.__assign({ gridColumnStart: 1, gridRowStart: 1, alignItems: 'center', display: 'inline-flex', justifyContent: 'center' }, react_1.shorthands.overflow('hidden')), (_a = {}, _a["& ." + iconClassNames.filled] = {
295
+ display: 'none',
296
+ }, _a["& ." + iconClassNames.regular] = {
297
+ display: 'inline',
298
+ }, _a)),
299
+ // per design, the small and medium font sizes are the same.
300
+ // the size prop only affects spacing.
301
+ small: {
302
+ fontSize: '20px',
303
+ height: '20px',
304
+ width: '20px',
305
+ },
306
+ medium: {
307
+ fontSize: '20px',
308
+ height: '20px',
309
+ width: '20px',
310
+ },
311
+ large: {
312
+ fontSize: '24px',
313
+ height: '24px',
314
+ width: '24px',
315
+ },
316
+ selected: (_b = {},
317
+ _b["& ." + iconClassNames.filled] = {
318
+ display: 'inline',
319
+ },
320
+ _b["& ." + iconClassNames.regular] = {
321
+ display: 'none',
322
+ },
323
+ _b),
324
+ });
325
+ /**
326
+ * Styles for the content slot (children)
327
+ */
328
+ var useContentStyles = react_1.makeStyles({
329
+ base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, react_theme_1.typographyStyles.body1), react_1.shorthands.overflow('hidden')), react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalNone, react_theme_1.tokens.spacingHorizontalXXS)),
330
+ selected: tslib_1.__assign({}, react_theme_1.typographyStyles.body1Strong),
331
+ large: tslib_1.__assign({}, react_theme_1.typographyStyles.body2),
332
+ largeSelected: tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle2),
333
+ noIconBefore: {
334
+ gridColumnStart: 1,
335
+ gridRowStart: 1,
336
+ },
337
+ iconBefore: {
338
+ gridColumnStart: 2,
339
+ gridRowStart: 1,
340
+ },
341
+ placeholder: {
342
+ visibility: 'hidden',
343
+ },
344
+ });
345
+ /**
346
+ * Apply styling to the Tab slots based on the state
347
+ */
348
+ var useTabStyles_unstable = function (state) {
349
+ var rootStyles = useRootStyles();
350
+ var focusStyles = useFocusStyles();
351
+ var pendingIndicatorStyles = usePendingIndicatorStyles();
352
+ var activeIndicatorStyles = useActiveIndicatorStyles();
353
+ var iconStyles = useIconStyles();
354
+ var contentStyles = useContentStyles();
355
+ var appearance = state.appearance, disabled = state.disabled, selected = state.selected, size = state.size, vertical = state.vertical;
356
+ state.root.className = react_1.mergeClasses(exports.tabClassNames.root, rootStyles.base, vertical ? rootStyles.vertical : rootStyles.horizontal, size === 'small' && (vertical ? rootStyles.smallVertical : rootStyles.smallHorizontal), size === 'medium' && (vertical ? rootStyles.mediumVertical : rootStyles.mediumHorizontal), size === 'large' && (vertical ? rootStyles.largeVertical : rootStyles.largeHorizontal), focusStyles.base, !disabled && appearance === 'subtle' && rootStyles.subtle, !disabled && appearance === 'transparent' && rootStyles.transparent, !disabled && selected && rootStyles.selected, disabled && rootStyles.disabled,
357
+ // pending indicator (before pseudo element)
358
+ pendingIndicatorStyles.base, size === 'small' && (vertical ? pendingIndicatorStyles.smallVertical : pendingIndicatorStyles.smallHorizontal), size === 'medium' && (vertical ? pendingIndicatorStyles.mediumVertical : pendingIndicatorStyles.mediumHorizontal), size === 'large' && (vertical ? pendingIndicatorStyles.largeVertical : pendingIndicatorStyles.largeHorizontal), disabled && pendingIndicatorStyles.disabled,
359
+ // active indicator (after pseudo element)
360
+ selected && activeIndicatorStyles.base, selected && !disabled && activeIndicatorStyles.selected, selected &&
361
+ size === 'small' &&
362
+ (vertical ? activeIndicatorStyles.smallVertical : activeIndicatorStyles.smallHorizontal), selected &&
363
+ size === 'medium' &&
364
+ (vertical ? activeIndicatorStyles.mediumVertical : activeIndicatorStyles.mediumHorizontal), selected &&
365
+ size === 'large' &&
366
+ (vertical ? activeIndicatorStyles.largeVertical : activeIndicatorStyles.largeHorizontal), selected && disabled && activeIndicatorStyles.disabled, state.root.className);
367
+ if (state.icon) {
368
+ state.icon.className = react_1.mergeClasses(exports.tabClassNames.icon, iconStyles.base, iconStyles[size], selected && iconStyles.selected, state.icon.className);
369
+ }
370
+ // This needs to be before state.content.className is updated
371
+ if (state.contentReservedSpaceClassName !== undefined) {
372
+ state.contentReservedSpaceClassName = react_1.mergeClasses(reservedSpaceClassNames.content, contentStyles.base, size === 'large' ? contentStyles.largeSelected : contentStyles.selected, state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore, contentStyles.placeholder, state.content.className);
373
+ }
374
+ state.content.className = react_1.mergeClasses(exports.tabClassNames.content, contentStyles.base, size === 'large' && contentStyles.large, selected && (size === 'large' ? contentStyles.largeSelected : contentStyles.selected), state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore, state.content.className);
375
+ useTabAnimatedIndicator_1.useTabAnimatedIndicatorStyles_unstable(state);
376
+ return state;
377
+ };
378
+ exports.useTabStyles_unstable = useTabStyles_unstable;
379
+ });
380
+ //# sourceMappingURL=useTabStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/Tab/useTabStyles.ts"],"names":[],"mappings":";;;;;IAQa,QAAA,aAAa,GAA6B;QACrD,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,kBAAkB;KAC5B,CAAC;IAEF,IAAM,uBAAuB,GAAG;QAC9B,OAAO,EAAE,kCAAkC;KAC5C,CAAC;IAEF,oEAAoE;IACpE,uFAAuF;IACvF,IAAM,cAAc,GAAG;QACrB,MAAM,EAAE,iBAAiB;QACzB,OAAO,EAAE,kBAAkB;KAC5B,CAAC;IAEF;;OAEG;IACH,yDAAyD;IACzD,IAAM,aAAa,GAAG,kBAAU,CAAC;QAC/B,IAAI,0GACF,UAAU,EAAE,QAAQ,IACjB,kBAAU,CAAC,WAAW,CAAC,MAAM,CAAC,GAC9B,kBAAU,CAAC,YAAY,CAAC,oBAAM,CAAC,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AC,CAAC,aAAa,CAAC,YAAY,EAClE,KAAK,CAAC,OAAO,CAAC,SAAS,CACxB,CAAC;QAEF,gEAAsC,CAAC,KAAK,CAAC,CAAC;QAE9C,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAjFW,QAAA,qBAAqB,yBAiFhC","sourcesContent":["import type { TabSlots, TabState } from './Tab.types';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTabAnimatedIndicatorStyles_unstable } from './useTabAnimatedIndicator';\n\nexport const tabClassNames: SlotClassNames<TabSlots> = {\n root: 'fui-Tab',\n icon: 'fui-Tab__icon',\n content: 'fui-Tab__content',\n};\n\nconst reservedSpaceClassNames = {\n content: 'fui-Tab__content--reserved-space',\n};\n\n// These should match the constants defined in @fluentui/react-icons\n// This package avoids taking a dependency on the icons package for only the constants.\nconst iconClassNames = {\n filled: 'fui-Icon-filled',\n regular: 'fui-Icon-regular',\n};\n\n/**\n * Styles for the root slot\n */\n/* eslint-disable @typescript-eslint/naming-convention */\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n ...shorthands.borderColor('none'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.borderWidth(0),\n cursor: 'pointer',\n display: 'grid',\n flexShrink: 0,\n gridAutoFlow: 'column',\n gridTemplateColumns: 'auto',\n gridTemplateRows: 'auto',\n fontFamily: tokens.fontFamilyBase,\n lineHeight: tokens.lineHeightBase300,\n outlineStyle: 'none',\n position: 'relative',\n ...shorthands.overflow('hidden'),\n textTransform: 'none',\n },\n horizontal: {\n justifyContent: 'center',\n },\n vertical: {\n justifyContent: 'start',\n },\n smallHorizontal: {\n columnGap: tokens.spacingHorizontalXXS,\n ...shorthands.padding(tokens.spacingVerticalSNudge, tokens.spacingHorizontalSNudge),\n },\n smallVertical: {\n // horizontal spacing is deliberate. This is the gap between icon and content.\n columnGap: tokens.spacingHorizontalXXS,\n ...shorthands.padding(tokens.spacingVerticalXXS, tokens.spacingHorizontalSNudge),\n },\n mediumHorizontal: {\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalM, tokens.spacingHorizontalMNudge),\n },\n mediumVertical: {\n // horizontal spacing is deliberate. This is the gap between icon and content.\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalSNudge, tokens.spacingHorizontalMNudge),\n },\n largeHorizontal: {\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalL, tokens.spacingHorizontalMNudge),\n },\n largeVertical: {\n // horizontal spacing is deliberate. This is the gap between icon and content.\n columnGap: tokens.spacingHorizontalSNudge,\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalMNudge),\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground2,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n\n '& .fui-Tab__icon': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n cursor: 'not-allowed',\n },\n selected: {\n '& .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1,\n },\n ':hover .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n ':active .fui-Tab__icon': {\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n '& .fui-Tab__content': {\n color: tokens.colorNeutralForeground1,\n },\n ':hover .fui-Tab__content': {\n color: tokens.colorNeutralForeground1Hover,\n },\n ':active .fui-Tab__content': {\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n});\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Focus styles for the root slot\n */\nconst useFocusStyles = makeStyles({\n // Tab creates a custom focus indicator because the default focus indicator\n // is applied using an ::after pseudo-element on the root. Since the selection\n // indicator uses an ::after pseudo-element on the root, there is a conflict.\n base: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineWidth: tokens.strokeWidthThick,\n outlineColor: 'transparent',\n outlineStyle: 'solid',\n boxShadow: `\n ${tokens.shadow4},\n 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}\n `,\n zIndex: 1,\n }),\n});\n\n/** Indicator styles for when pending selection */\nconst usePendingIndicatorStyles = makeStyles({\n base: {\n ':hover::before': {\n backgroundColor: tokens.colorNeutralStroke1Hover,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n },\n ':active::before': {\n backgroundColor: tokens.colorNeutralStroke1Pressed,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n },\n '@media (forced-colors: active)': {\n ':hover::before': {\n backgroundColor: 'Highlight',\n },\n ':active::before': {\n backgroundColor: 'Highlight',\n },\n },\n },\n disabled: {\n ':hover::before': {\n backgroundColor: tokens.colorTransparentStroke,\n },\n ':active::before': {\n backgroundColor: tokens.colorTransparentStroke,\n },\n },\n smallHorizontal: {\n '::before': {\n bottom: 0,\n height: tokens.strokeWidthThick,\n left: tokens.spacingHorizontalSNudge,\n right: tokens.spacingHorizontalSNudge,\n },\n },\n smallVertical: {\n '::before': {\n bottom: tokens.spacingVerticalXS,\n left: 0,\n top: tokens.spacingVerticalXS,\n width: tokens.strokeWidthThicker,\n },\n },\n mediumHorizontal: {\n '::before': {\n bottom: 0,\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n mediumVertical: {\n '::before': {\n bottom: tokens.spacingVerticalS,\n left: 0,\n top: tokens.spacingVerticalS,\n width: tokens.strokeWidthThicker,\n },\n },\n largeHorizontal: {\n '::before': {\n bottom: 0,\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n largeVertical: {\n '::before': {\n bottom: tokens.spacingVerticalMNudge,\n left: 0,\n top: tokens.spacingVerticalMNudge,\n width: tokens.strokeWidthThicker,\n },\n },\n});\n\nconst useActiveIndicatorStyles = makeStyles({\n base: {\n '::after': {\n backgroundColor: tokens.colorTransparentStroke,\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n content: '\"\"',\n position: 'absolute',\n zIndex: 1,\n },\n },\n selected: {\n '::after': {\n backgroundColor: tokens.colorCompoundBrandStroke,\n },\n ':hover::after': {\n backgroundColor: tokens.colorCompoundBrandStrokeHover,\n },\n ':active::after': {\n backgroundColor: tokens.colorCompoundBrandStrokePressed,\n },\n '@media (forced-colors: active)': {\n '::after': {\n backgroundColor: 'ButtonText',\n },\n ':hover::after': {\n backgroundColor: 'ButtonText',\n },\n ':active::after': {\n backgroundColor: 'ButtonText',\n },\n },\n },\n disabled: {\n '::after': {\n backgroundColor: tokens.colorNeutralForegroundDisabled,\n },\n },\n smallHorizontal: {\n '::after': {\n bottom: 0,\n height: tokens.strokeWidthThick,\n left: tokens.spacingHorizontalSNudge,\n right: tokens.spacingHorizontalSNudge,\n },\n },\n smallVertical: {\n '::after': {\n bottom: tokens.spacingVerticalXS,\n left: '0',\n top: tokens.spacingVerticalXS,\n width: tokens.strokeWidthThicker,\n },\n },\n mediumHorizontal: {\n '::after': {\n bottom: '0',\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n mediumVertical: {\n '::after': {\n bottom: tokens.spacingVerticalS,\n left: 0,\n top: tokens.spacingVerticalS,\n width: tokens.strokeWidthThicker,\n },\n },\n largeHorizontal: {\n '::after': {\n bottom: 0,\n height: tokens.strokeWidthThicker,\n left: tokens.spacingHorizontalM,\n right: tokens.spacingHorizontalM,\n },\n },\n largeVertical: {\n '::after': {\n bottom: tokens.spacingVerticalMNudge,\n left: 0,\n top: tokens.spacingVerticalMNudge,\n width: tokens.strokeWidthThicker,\n },\n },\n});\n\n/**\n * Styles for the icon slot.\n */\nconst useIconStyles = makeStyles({\n base: {\n gridColumnStart: 1,\n gridRowStart: 1,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n ...shorthands.overflow('hidden'),\n [`& .${iconClassNames.filled}`]: {\n display: 'none',\n },\n [`& .${iconClassNames.regular}`]: {\n display: 'inline',\n },\n },\n // per design, the small and medium font sizes are the same.\n // the size prop only affects spacing.\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n medium: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n large: {\n fontSize: '24px',\n height: '24px',\n width: '24px',\n },\n selected: {\n [`& .${iconClassNames.filled}`]: {\n display: 'inline',\n },\n [`& .${iconClassNames.regular}`]: {\n display: 'none',\n },\n },\n});\n\n/**\n * Styles for the content slot (children)\n */\nconst useContentStyles = makeStyles({\n base: {\n ...typographyStyles.body1,\n ...shorthands.overflow('hidden'),\n // content padding is the same for medium & small, horiztonal & vertical\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalXXS),\n },\n selected: {\n ...typographyStyles.body1Strong,\n },\n large: {\n ...typographyStyles.body2,\n },\n largeSelected: {\n ...typographyStyles.subtitle2,\n },\n noIconBefore: {\n gridColumnStart: 1,\n gridRowStart: 1,\n },\n iconBefore: {\n gridColumnStart: 2,\n gridRowStart: 1,\n },\n placeholder: {\n visibility: 'hidden',\n },\n});\n\n/**\n * Apply styling to the Tab slots based on the state\n */\nexport const useTabStyles_unstable = (state: TabState): TabState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n const pendingIndicatorStyles = usePendingIndicatorStyles();\n const activeIndicatorStyles = useActiveIndicatorStyles();\n const iconStyles = useIconStyles();\n const contentStyles = useContentStyles();\n\n const { appearance, disabled, selected, size, vertical } = state;\n\n state.root.className = mergeClasses(\n tabClassNames.root,\n rootStyles.base,\n vertical ? rootStyles.vertical : rootStyles.horizontal,\n size === 'small' && (vertical ? rootStyles.smallVertical : rootStyles.smallHorizontal),\n size === 'medium' && (vertical ? rootStyles.mediumVertical : rootStyles.mediumHorizontal),\n size === 'large' && (vertical ? rootStyles.largeVertical : rootStyles.largeHorizontal),\n focusStyles.base,\n !disabled && appearance === 'subtle' && rootStyles.subtle,\n !disabled && appearance === 'transparent' && rootStyles.transparent,\n !disabled && selected && rootStyles.selected,\n disabled && rootStyles.disabled,\n\n // pending indicator (before pseudo element)\n pendingIndicatorStyles.base,\n size === 'small' && (vertical ? pendingIndicatorStyles.smallVertical : pendingIndicatorStyles.smallHorizontal),\n size === 'medium' && (vertical ? pendingIndicatorStyles.mediumVertical : pendingIndicatorStyles.mediumHorizontal),\n size === 'large' && (vertical ? pendingIndicatorStyles.largeVertical : pendingIndicatorStyles.largeHorizontal),\n disabled && pendingIndicatorStyles.disabled,\n\n // active indicator (after pseudo element)\n selected && activeIndicatorStyles.base,\n selected && !disabled && activeIndicatorStyles.selected,\n selected &&\n size === 'small' &&\n (vertical ? activeIndicatorStyles.smallVertical : activeIndicatorStyles.smallHorizontal),\n selected &&\n size === 'medium' &&\n (vertical ? activeIndicatorStyles.mediumVertical : activeIndicatorStyles.mediumHorizontal),\n selected &&\n size === 'large' &&\n (vertical ? activeIndicatorStyles.largeVertical : activeIndicatorStyles.largeHorizontal),\n selected && disabled && activeIndicatorStyles.disabled,\n\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n tabClassNames.icon,\n iconStyles.base,\n iconStyles[size],\n selected && iconStyles.selected,\n state.icon.className,\n );\n }\n\n // This needs to be before state.content.className is updated\n if (state.contentReservedSpaceClassName !== undefined) {\n state.contentReservedSpaceClassName = mergeClasses(\n reservedSpaceClassNames.content,\n contentStyles.base,\n size === 'large' ? contentStyles.largeSelected : contentStyles.selected,\n state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore,\n contentStyles.placeholder,\n state.content.className,\n );\n }\n\n state.content.className = mergeClasses(\n tabClassNames.content,\n contentStyles.base,\n size === 'large' && contentStyles.large,\n selected && (size === 'large' ? contentStyles.largeSelected : contentStyles.selected),\n state.icon ? contentStyles.iconBefore : contentStyles.noIconBefore,\n state.content.className,\n );\n\n useTabAnimatedIndicatorStyles_unstable(state);\n\n return state;\n};\n"]}
@@ -0,0 +1,16 @@
1
+ define(["require", "exports", "react", "./useTabList", "./renderTabList", "./useTabListStyles", "./useTabListContextValues"], function (require, exports, React, useTabList_1, renderTabList_1, useTabListStyles_1, useTabListContextValues_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TabList = void 0;
5
+ /**
6
+ * A tab list provides single selection from a set of tabs.
7
+ */
8
+ exports.TabList = React.forwardRef(function (props, ref) {
9
+ var state = useTabList_1.useTabList_unstable(props, ref);
10
+ var contextValues = useTabListContextValues_1.useTabListContextValues(state);
11
+ useTabListStyles_1.useTabListStyles_unstable(state);
12
+ return renderTabList_1.renderTabList_unstable(state, contextValues);
13
+ });
14
+ exports.TabList.displayName = 'TabList';
15
+ });
16
+ //# sourceMappingURL=TabList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabList.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/TabList.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,OAAO,GAAsC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QACpF,IAAM,KAAK,GAAG,gCAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC9C,IAAM,aAAa,GAAG,iDAAuB,CAAC,KAAK,CAAC,CAAC;QAErD,4CAAyB,CAAC,KAAK,CAAC,CAAC;QACjC,OAAO,sCAAsB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,eAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import * as React from 'react';\nimport { useTabList_unstable } from './useTabList';\nimport { renderTabList_unstable } from './renderTabList';\nimport { useTabListStyles_unstable } from './useTabListStyles';\nimport type { TabListProps } from './TabList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTabListContextValues } from './useTabListContextValues';\n\n/**\n * A tab list provides single selection from a set of tabs.\n */\nexport const TabList: ForwardRefComponent<TabListProps> = React.forwardRef((props, ref) => {\n const state = useTabList_unstable(props, ref);\n const contextValues = useTabListContextValues(state);\n\n useTabListStyles_unstable(state);\n return renderTabList_unstable(state, contextValues);\n});\n\nTabList.displayName = 'TabList';\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=TabList.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabList.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/TabList.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TabValue } from '../Tab/Tab.types';\n\nexport type TabRegisterData = {\n /**\n * The value of the tab.\n */\n value: TabValue;\n\n /**\n * The reference to the tab HTML element.\n */\n ref: React.RefObject<HTMLElement>;\n};\n\nexport type RegisterTabEventHandler = (data: TabRegisterData) => void;\n\nexport type SelectTabData = {\n /**\n * The value of the selected tab.\n */\n value: TabValue;\n};\n\nexport type SelectTabEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;\n\nexport type SelectTabEventHandler = (event: SelectTabEvent, data: SelectTabData) => void;\n\nexport type TabListSlots = {\n /**\n * The slot associated with the root element of this tab list.\n */\n root: Slot<'div'>;\n};\n\n/**\n * TabList Props\n */\nexport type TabListProps = ComponentProps<TabListSlots> & {\n /**\n * A tab list can supports 'transparent' and 'subtle' appearance.\n *- 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n *- 'transparent': No background and border styling\n * The appearance affects each of the contained tabs.\n * @default 'transparent'\n */\n appearance?: 'transparent' | 'subtle';\n\n /**\n * Tab size may change between unselected and selected states.\n * The default scenario is a selected tab has bold text.\n *\n * When true, this property requests tabs be the same size whether unselected or selected.\n * @default true\n */\n reserveSelectedTabSpace?: boolean;\n\n /**\n * The value of the tab to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n */\n defaultSelectedValue?: TabValue;\n /**\n * A tab list can be set to disable interaction.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Raised when a tab is selected.\n */\n onTabSelect?: SelectTabEventHandler;\n\n /**\n * The value of the currently selected tab.\n */\n selectedValue?: TabValue;\n\n /**\n * A tab list can be either 'small', 'medium', or 'large' size.\n * The size affects each of the contained tabs.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * A tab list can arrange its tabs vertically.\n * @default false\n */\n vertical?: boolean;\n};\n\nexport type TabListContextValue = Pick<TabListProps, 'onTabSelect' | 'selectedValue' | 'reserveSelectedTabSpace'> &\n Required<Pick<TabListProps, 'appearance' | 'disabled' | 'size' | 'vertical'>> & {\n /** A callback to allow a tab to register itself with the tab list. */\n onRegister: RegisterTabEventHandler;\n\n /** A callback to allow a tab to unregister itself with the tab list. */\n onUnregister: RegisterTabEventHandler;\n /**\n * A callback to allow a tab to select itself when pressed.\n */\n onSelect: SelectTabEventHandler;\n /**\n * Gets the registered tab data along with current and previous selected values.\n */\n getRegisteredTabs: () => {\n selectedValue?: TabValue;\n previousSelectedValue?: TabValue;\n registeredTabs: Record<string, TabRegisterData>;\n };\n };\n\n/**\n * Context values used in rendering TabList.\n */\nexport type TabListContextValues = {\n /**\n * The context of the tab list available to each tab.\n */\n tabList: TabListContextValue;\n};\n\n/**\n * State used in rendering TabList.\n */\nexport type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue;\n"]}
@@ -0,0 +1,29 @@
1
+ define(["require", "exports", "@fluentui/react-context-selector"], function (require, exports, react_context_selector_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TabListContext = void 0;
5
+ // eslint-disable-next-line @fluentui/no-context-default-value
6
+ exports.TabListContext = react_context_selector_1.createContext({
7
+ appearance: 'transparent',
8
+ reserveSelectedTabSpace: true,
9
+ disabled: false,
10
+ selectedValue: undefined,
11
+ onRegister: function () {
12
+ /* noop */
13
+ },
14
+ onUnregister: function () {
15
+ /* noop */
16
+ },
17
+ onSelect: function () {
18
+ /* noop */
19
+ },
20
+ getRegisteredTabs: function () {
21
+ return {
22
+ registeredTabs: {},
23
+ };
24
+ },
25
+ size: 'medium',
26
+ vertical: false,
27
+ });
28
+ });
29
+ //# sourceMappingURL=TabListContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabListContext.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/TabListContext.ts"],"names":[],"mappings":";;;;IAIA,8DAA8D;IACjD,QAAA,cAAc,GAAiC,sCAAa,CAAsB;QAC7F,UAAU,EAAE,aAAa;QACzB,uBAAuB,EAAE,IAAI;QAC7B,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,SAAS;QACxB,UAAU,EAAE;YACV,UAAU;QACZ,CAAC;QACD,YAAY,EAAE;YACZ,UAAU;QACZ,CAAC;QACD,QAAQ,EAAE;YACR,UAAU;QACZ,CAAC;QACD,iBAAiB,EAAE;YACjB,OAAO;gBACL,cAAc,EAAE,EAAE;aACnB,CAAC;QACJ,CAAC;QACD,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC","sourcesContent":["import { createContext } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport { TabListContextValue } from './TabList.types';\n\n// eslint-disable-next-line @fluentui/no-context-default-value\nexport const TabListContext: Context<TabListContextValue> = createContext<TabListContextValue>({\n appearance: 'transparent',\n reserveSelectedTabSpace: true,\n disabled: false,\n selectedValue: undefined,\n onRegister: () => {\n /* noop */\n },\n onUnregister: () => {\n /* noop */\n },\n onSelect: () => {\n /* noop */\n },\n getRegisteredTabs: () => {\n return {\n registeredTabs: {},\n };\n },\n size: 'medium',\n vertical: false,\n});\n"]}
@@ -0,0 +1,10 @@
1
+ define(["require", "exports", "tslib", "./TabList", "./TabList.types", "./renderTabList", "./useTabList", "./useTabListStyles"], function (require, exports, tslib_1, TabList_1, TabList_types_1, renderTabList_1, useTabList_1, useTabListStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(TabList_1, exports);
5
+ tslib_1.__exportStar(TabList_types_1, exports);
6
+ tslib_1.__exportStar(renderTabList_1, exports);
7
+ tslib_1.__exportStar(useTabList_1, exports);
8
+ tslib_1.__exportStar(useTabListStyles_1, exports);
9
+ });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/index.ts"],"names":[],"mappings":";;;IAAA,yCAA0B;IAC1B,+CAAgC;IAChC,+CAAgC;IAChC,4CAA6B;IAC7B,kDAAmC","sourcesContent":["export * from './TabList';\nexport * from './TabList.types';\nexport * from './renderTabList';\nexport * from './useTabList';\nexport * from './useTabListStyles';\n"]}
@@ -0,0 +1,15 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./TabListContext"], function (require, exports, tslib_1, React, react_utilities_1, TabListContext_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderTabList_unstable = void 0;
5
+ /**
6
+ * Render the final JSX of TabList
7
+ */
8
+ var renderTabList_unstable = function (state, contextValues) {
9
+ var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
10
+ return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
+ React.createElement(TabListContext_1.TabListContext.Provider, { value: contextValues.tabList }, state.root.children)));
12
+ };
13
+ exports.renderTabList_unstable = renderTabList_unstable;
14
+ });
15
+ //# sourceMappingURL=renderTabList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderTabList.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/renderTabList.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,sBAAsB,GAAG,UAAC,KAAmB,EAAE,aAAmC;QACvF,IAAA,KAAuB,0BAAQ,CAAe,KAAK,CAAC,EAAlD,KAAK,WAAA,EAAE,SAAS,eAAkC,CAAC;QAE3D,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,+BAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,CAAC,OAAO,IAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAA2B,CAC3F,CACd,CAAC;IACJ,CAAC,CAAC;IARW,QAAA,sBAAsB,0BAQjC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TabListState, TabListSlots, TabListContextValues } from './TabList.types';\nimport { TabListContext } from './TabListContext';\n\n/**\n * Render the final JSX of TabList\n */\nexport const renderTabList_unstable = (state: TabListState, contextValues: TabListContextValues) => {\n const { slots, slotProps } = getSlots<TabListSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <TabListContext.Provider value={contextValues.tabList}>{state.root.children}</TabListContext.Provider>\n </slots.root>\n );\n};\n"]}
@@ -0,0 +1,74 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-tabster", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_tabster_1, react_utilities_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useTabList_unstable = void 0;
5
+ /**
6
+ * Create the state required to render TabList.
7
+ *
8
+ * The returned state can be modified with hooks such as useTabListStyles_unstable,
9
+ * before being passed to renderTabList_unstable.
10
+ *
11
+ * @param props - props from this instance of TabList
12
+ * @param ref - reference to root HTMLElement of TabList
13
+ */
14
+ var useTabList_unstable = function (props, ref) {
15
+ var _a = props.appearance, appearance = _a === void 0 ? 'transparent' : _a, _b = props.reserveSelectedTabSpace, reserveSelectedTabSpace = _b === void 0 ? true : _b, _c = props.disabled, disabled = _c === void 0 ? false : _c, onTabSelect = props.onTabSelect, _d = props.size, size = _d === void 0 ? 'medium' : _d, _e = props.vertical, vertical = _e === void 0 ? false : _e;
16
+ var innerRef = React.useRef(null);
17
+ var focusAttributes = react_tabster_1.useArrowNavigationGroup({
18
+ circular: true,
19
+ axis: vertical ? 'vertical' : 'horizontal',
20
+ memorizeCurrent: true,
21
+ });
22
+ var _f = react_utilities_1.useControllableState({
23
+ state: props.selectedValue,
24
+ defaultState: props.defaultSelectedValue,
25
+ initialState: undefined,
26
+ }), selectedValue = _f[0], setSelectedValue = _f[1];
27
+ // considered usePrevious, but it is sensitive to re-renders
28
+ // this could cause the previous to move to current in the case where the tab list re-renders.
29
+ // these refs avoid getRegisteredTabs changing when selectedValue changes and causing
30
+ // renders for tabs that have not changed.
31
+ var currentSelectedValue = React.useRef(undefined);
32
+ var previousSelectedValue = React.useRef(undefined);
33
+ React.useEffect(function () {
34
+ previousSelectedValue.current = currentSelectedValue.current;
35
+ currentSelectedValue.current = selectedValue;
36
+ }, [selectedValue]);
37
+ var onSelect = react_utilities_1.useEventCallback(function (event, data) {
38
+ setSelectedValue(data.value);
39
+ onTabSelect === null || onTabSelect === void 0 ? void 0 : onTabSelect(event, data);
40
+ });
41
+ var registeredTabs = React.useRef({});
42
+ var onRegister = react_utilities_1.useEventCallback(function (data) {
43
+ registeredTabs.current[JSON.stringify(data.value)] = data;
44
+ });
45
+ var onUnregister = react_utilities_1.useEventCallback(function (data) {
46
+ delete registeredTabs.current[JSON.stringify(data.value)];
47
+ });
48
+ var getRegisteredTabs = React.useCallback(function () {
49
+ return {
50
+ selectedValue: currentSelectedValue.current,
51
+ previousSelectedValue: previousSelectedValue.current,
52
+ registeredTabs: registeredTabs.current,
53
+ };
54
+ }, []);
55
+ return {
56
+ components: {
57
+ root: 'div',
58
+ },
59
+ root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign({ ref: react_utilities_1.useMergedRefs(ref, innerRef), role: 'tablist' }, focusAttributes), props)),
60
+ appearance: appearance,
61
+ reserveSelectedTabSpace: reserveSelectedTabSpace,
62
+ disabled: disabled,
63
+ selectedValue: selectedValue,
64
+ size: size,
65
+ vertical: vertical,
66
+ onRegister: onRegister,
67
+ onUnregister: onUnregister,
68
+ onSelect: onSelect,
69
+ getRegisteredTabs: getRegisteredTabs,
70
+ };
71
+ };
72
+ exports.useTabList_unstable = useTabList_unstable;
73
+ });
74
+ //# sourceMappingURL=useTabList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabList.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/useTabList.ts"],"names":[],"mappings":";;;;IAWA;;;;;;;;OAQG;IACI,IAAM,mBAAmB,GAAG,UAAC,KAAmB,EAAE,GAA2B;QAEhF,IAAA,KAME,KAAK,WANmB,EAA1B,UAAU,mBAAG,aAAa,KAAA,EAC1B,KAKE,KAAK,wBALuB,EAA9B,uBAAuB,mBAAG,IAAI,KAAA,EAC9B,KAIE,KAAK,SAJS,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,WAAW,GAGT,KAAK,YAHI,EACX,KAEE,KAAK,KAFQ,EAAf,IAAI,mBAAG,QAAQ,KAAA,EACf,KACE,KAAK,SADS,EAAhB,QAAQ,mBAAG,KAAK,KAAA,CACR;QAEV,IAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC;QAEjD,IAAM,eAAe,GAAG,uCAAuB,CAAC;YAC9C,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;YAC1C,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;QAEG,IAAA,KAAoC,sCAAoB,CAAC;YAC7D,KAAK,EAAE,KAAK,CAAC,aAAa;YAC1B,YAAY,EAAE,KAAK,CAAC,oBAAoB;YACxC,YAAY,EAAE,SAAS;SACxB,CAAC,EAJK,aAAa,QAAA,EAAE,gBAAgB,QAIpC,CAAC;QAEH,4DAA4D;QAC5D,8FAA8F;QAC9F,qFAAqF;QACrF,0CAA0C;QAC1C,IAAM,oBAAoB,GAAG,KAAK,CAAC,MAAM,CAAuB,SAAS,CAAC,CAAC;QAC3E,IAAM,qBAAqB,GAAG,KAAK,CAAC,MAAM,CAAuB,SAAS,CAAC,CAAC;QAE5E,KAAK,CAAC,SAAS,CAAC;YACd,qBAAqB,CAAC,OAAO,GAAG,o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AAA;YACvB,QAAQ,UAAA;YACR,aAAa,eAAA;YACb,IAAI,MAAA;YACJ,QAAQ,UAAA;YACR,UAAU,YAAA;YACV,YAAY,cAAA;YACZ,QAAQ,UAAA;YACR,iBAAiB,mBAAA;SAClB,CAAC;IACJ,CAAC,CAAC;IAhFW,QAAA,mBAAmB,uBAgF9B","sourcesContent":["import * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport {\n getNativeElementProps,\n useControllableState,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport type { TabRegisterData, SelectTabData, SelectTabEvent, TabListProps, TabListState } from './TabList.types';\nimport { TabValue } from '../Tab/Tab.types';\n\n/**\n * Create the state required to render TabList.\n *\n * The returned state can be modified with hooks such as useTabListStyles_unstable,\n * before being passed to renderTabList_unstable.\n *\n * @param props - props from this instance of TabList\n * @param ref - reference to root HTMLElement of TabList\n */\nexport const useTabList_unstable = (props: TabListProps, ref: React.Ref<HTMLElement>): TabListState => {\n const {\n appearance = 'transparent',\n reserveSelectedTabSpace = true,\n disabled = false,\n onTabSelect,\n size = 'medium',\n vertical = false,\n } = props;\n\n const innerRef = React.useRef<HTMLElement>(null);\n\n const focusAttributes = useArrowNavigationGroup({\n circular: true,\n axis: vertical ? 'vertical' : 'horizontal',\n memorizeCurrent: true,\n });\n\n const [selectedValue, setSelectedValue] = useControllableState({\n state: props.selectedValue,\n defaultState: props.defaultSelectedValue,\n initialState: undefined,\n });\n\n // considered usePrevious, but it is sensitive to re-renders\n // this could cause the previous to move to current in the case where the tab list re-renders.\n // these refs avoid getRegisteredTabs changing when selectedValue changes and causing\n // renders for tabs that have not changed.\n const currentSelectedValue = React.useRef<TabValue | undefined>(undefined);\n const previousSelectedValue = React.useRef<TabValue | undefined>(undefined);\n\n React.useEffect(() => {\n previousSelectedValue.current = currentSelectedValue.current;\n currentSelectedValue.current = selectedValue;\n }, [selectedValue]);\n\n const onSelect = useEventCallback((event: SelectTabEvent, data: SelectTabData) => {\n setSelectedValue(data.value);\n onTabSelect?.(event, data);\n });\n\n const registeredTabs = React.useRef<Record<string, TabRegisterData>>({});\n\n const onRegister = useEventCallback((data: TabRegisterData) => {\n registeredTabs.current[JSON.stringify(data.value)] = data;\n });\n\n const onUnregister = useEventCallback((data: TabRegisterData) => {\n delete registeredTabs.current[JSON.stringify(data.value)];\n });\n\n const getRegisteredTabs = React.useCallback(() => {\n return {\n selectedValue: currentSelectedValue.current,\n previousSelectedValue: previousSelectedValue.current,\n registeredTabs: registeredTabs.current,\n };\n }, []);\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, innerRef),\n role: 'tablist',\n ...focusAttributes,\n ...props,\n }),\n appearance,\n reserveSelectedTabSpace,\n disabled,\n selectedValue,\n size,\n vertical,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredTabs,\n };\n};\n"]}
@@ -0,0 +1,23 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useTabListContextValues = void 0;
5
+ function useTabListContextValues(state) {
6
+ var appearance = state.appearance, reserveSelectedTabSpace = state.reserveSelectedTabSpace, disabled = state.disabled, selectedKey = state.selectedValue, onRegister = state.onRegister, onUnregister = state.onUnregister, onSelect = state.onSelect, getRegisteredTabs = state.getRegisteredTabs, size = state.size, vertical = state.vertical;
7
+ var tabList = {
8
+ appearance: appearance,
9
+ reserveSelectedTabSpace: reserveSelectedTabSpace,
10
+ disabled: disabled,
11
+ selectedValue: selectedKey,
12
+ onSelect: onSelect,
13
+ onRegister: onRegister,
14
+ onUnregister: onUnregister,
15
+ getRegisteredTabs: getRegisteredTabs,
16
+ size: size,
17
+ vertical: vertical,
18
+ };
19
+ return { tabList: tabList };
20
+ }
21
+ exports.useTabListContextValues = useTabListContextValues;
22
+ });
23
+ //# sourceMappingURL=useTabListContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabListContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/useTabListContextValues.tsx"],"names":[],"mappings":";;;;IAEA,SAAgB,uBAAuB,CAAC,KAAmB;QAEvD,IAAA,UAAU,GAUR,KAAK,WAVG,EACV,uBAAuB,GASrB,KAAK,wBATgB,EACvB,QAAQ,GAQN,KAAK,SARC,EACO,WAAW,GAOxB,KAAK,cAPmB,EAC1B,UAAU,GAMR,KAAK,WANG,EACV,YAAY,GAKV,KAAK,aALK,EACZ,QAAQ,GAIN,KAAK,SAJC,EACR,iBAAiB,GAGf,KAAK,kBAHU,EACjB,IAAI,GAEF,KAAK,KAFH,EACJ,QAAQ,GACN,KAAK,SADC,CACA;QAEV,IAAM,OAAO,GAAwB;YACnC,UAAU,YAAA;YACV,uBAAuB,yBAAA;YACvB,QAAQ,UAAA;YACR,aAAa,EAAE,WAAW;YAC1B,QAAQ,UAAA;YACR,UAAU,YAAA;YACV,YAAY,cAAA;YACZ,iBAAiB,mBAAA;YACjB,IAAI,MAAA;YACJ,QAAQ,UAAA;SACT,CAAC;QAEF,OAAO,EAAE,OAAO,SAAA,EAAE,CAAC;IACrB,CAAC;IA5BD,0DA4BC","sourcesContent":["import { TabListContextValue, TabListContextValues, TabListState } from './TabList.types';\n\nexport function useTabListContextValues(state: TabListState): TabListContextValues {\n const {\n appearance,\n reserveSelectedTabSpace,\n disabled,\n selectedValue: selectedKey,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredTabs,\n size,\n vertical,\n } = state;\n\n const tabList: TabListContextValue = {\n appearance,\n reserveSelectedTabSpace,\n disabled,\n selectedValue: selectedKey,\n onSelect,\n onRegister,\n onUnregister,\n getRegisteredTabs,\n size,\n vertical,\n };\n\n return { tabList };\n}\n"]}
@@ -0,0 +1,39 @@
1
+ define(["require", "exports", "@griffel/react"], function (require, exports, react_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useTabListStyles_unstable = exports.tabListClassNames = void 0;
5
+ exports.tabListClassNames = {
6
+ root: 'fui-TabList',
7
+ };
8
+ /**
9
+ * Styles for the root slot
10
+ */
11
+ var useStyles = react_1.makeStyles({
12
+ root: {
13
+ display: 'flex',
14
+ flexDirection: 'row',
15
+ flexShrink: 0,
16
+ flexWrap: 'nowrap',
17
+ position: 'relative',
18
+ },
19
+ horizontal: {
20
+ alignItems: 'stretch',
21
+ flexDirection: 'row',
22
+ },
23
+ vertical: {
24
+ alignItems: 'stretch',
25
+ flexDirection: 'column',
26
+ },
27
+ });
28
+ /**
29
+ * Apply styling to the TabList slots based on the state
30
+ */
31
+ var useTabListStyles_unstable = function (state) {
32
+ var vertical = state.vertical;
33
+ var styles = useStyles();
34
+ state.root.className = react_1.mergeClasses(exports.tabListClassNames.root, styles.root, vertical ? styles.vertical : styles.horizontal, state.root.className);
35
+ return state;
36
+ };
37
+ exports.useTabListStyles_unstable = useTabListStyles_unstable;
38
+ });
39
+ //# sourceMappingURL=useTabListStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabListStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-tabs/src/components/TabList/useTabListStyles.ts"],"names":[],"mappings":";;;;IAIa,QAAA,iBAAiB,GAAiC;QAC7D,IAAI,EAAE,aAAa;KACpB,CAAC;IAEF;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,UAAU;SACrB;QACD,UAAU,EAAE;YACV,UAAU,EAAE,SAAS;YACrB,aAAa,EAAE,KAAK;SACrB;QACD,QAAQ,EAAE;YACR,UAAU,EAAE,SAAS;YACrB,aAAa,EAAE,QAAQ;SACxB;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,yBAAyB,GAAG,UAAC,KAAmB;QACnD,IAAA,QAAQ,GAAK,KAAK,SAAV,CAAW;QAE3B,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAE3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,yBAAiB,CAAC,IAAI,EACtB,MAAM,CAAC,IAAI,EACX,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAC9C,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAbW,QAAA,yBAAyB,6BAapC","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"]}
@@ -0,0 +1,16 @@
1
+ define(["require", "exports", "./Tab", "./TabList"], function (require, exports, Tab_1, TabList_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ 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;
5
+ Object.defineProperty(exports, "renderTab_unstable", { enumerable: true, get: function () { return Tab_1.renderTab_unstable; } });
6
+ Object.defineProperty(exports, "Tab", { enumerable: true, get: function () { return Tab_1.Tab; } });
7
+ Object.defineProperty(exports, "tabClassNames", { enumerable: true, get: function () { return Tab_1.tabClassNames; } });
8
+ Object.defineProperty(exports, "useTabStyles_unstable", { enumerable: true, get: function () { return Tab_1.useTabStyles_unstable; } });
9
+ Object.defineProperty(exports, "useTab_unstable", { enumerable: true, get: function () { return Tab_1.useTab_unstable; } });
10
+ Object.defineProperty(exports, "renderTabList_unstable", { enumerable: true, get: function () { return TabList_1.renderTabList_unstable; } });
11
+ Object.defineProperty(exports, "TabList", { enumerable: true, get: function () { return TabList_1.TabList; } });
12
+ Object.defineProperty(exports, "tabListClassNames", { enumerable: true, get: function () { return TabList_1.tabListClassNames; } });
13
+ Object.defineProperty(exports, "useTabListStyles_unstable", { enumerable: true, get: function () { return TabList_1.useTabListStyles_unstable; } });
14
+ Object.defineProperty(exports, "useTabList_unstable", { enumerable: true, get: function () { return TabList_1.useTabList_unstable; } });
15
+ });
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-tabs/src/index.ts"],"names":[],"mappings":";;;;IACS,yGAAA,kBAAkB,OAAA;IAAE,0FAAA,GAAG,OAAA;IAAE,oGAAA,aAAa,OAAA;IAAE,4GAAA,qBAAqB,OAAA;IAAE,sGAAA,eAAe,OAAA;IAcrF,iHAAA,sBAAsB,OAAA;IACtB,kGAAA,OAAO,OAAA;IACP,4GAAA,iBAAiB,OAAA;IACjB,oHAAA,yBAAyB,OAAA;IACzB,8GAAA,mBAAmB,OAAA","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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tabs",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "description": "Fluent UI React tabs components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -30,10 +30,10 @@
30
30
  "@fluentui/scripts": "^1.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "@fluentui/react-context-selector": "^9.1.1",
34
- "@fluentui/react-tabster": "^9.3.0",
33
+ "@fluentui/react-context-selector": "^9.1.2",
34
+ "@fluentui/react-tabster": "^9.3.1",
35
35
  "@fluentui/react-theme": "^9.1.2",
36
- "@fluentui/react-utilities": "^9.2.1",
36
+ "@fluentui/react-utilities": "^9.2.2",
37
37
  "@griffel/react": "^1.4.2",
38
38
  "tslib": "^2.1.0"
39
39
  },