@fluentui/react-tabs 9.1.3 → 9.1.5

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 (59) hide show
  1. package/CHANGELOG.json +75 -1
  2. package/CHANGELOG.md +25 -2
  3. package/lib/components/Tab/Tab.js +0 -1
  4. package/lib/components/Tab/Tab.js.map +1 -1
  5. package/lib/components/Tab/renderTab.js +8 -5
  6. package/lib/components/Tab/renderTab.js.map +1 -1
  7. package/lib/components/Tab/useTab.js +0 -1
  8. package/lib/components/Tab/useTab.js.map +1 -1
  9. package/lib/components/Tab/useTabAnimatedIndicator.js +27 -38
  10. package/lib/components/Tab/useTabAnimatedIndicator.js.map +1 -1
  11. package/lib/components/Tab/useTabStyles.js +334 -349
  12. package/lib/components/Tab/useTabStyles.js.map +1 -1
  13. package/lib/components/TabList/TabList.js +0 -1
  14. package/lib/components/TabList/TabList.js.map +1 -1
  15. package/lib/components/TabList/TabListContext.js +2 -2
  16. package/lib/components/TabList/TabListContext.js.map +1 -1
  17. package/lib/components/TabList/renderTabList.js +2 -2
  18. package/lib/components/TabList/renderTabList.js.map +1 -1
  19. package/lib/components/TabList/useTabList.js +2 -3
  20. package/lib/components/TabList/useTabList.js.map +1 -1
  21. package/lib/components/TabList/useTabListContextValues.js.map +1 -1
  22. package/lib/components/TabList/useTabListStyles.js +13 -16
  23. package/lib/components/TabList/useTabListStyles.js.map +1 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib-commonjs/Tab.js +0 -2
  26. package/lib-commonjs/Tab.js.map +1 -1
  27. package/lib-commonjs/TabList.js +0 -2
  28. package/lib-commonjs/TabList.js.map +1 -1
  29. package/lib-commonjs/components/Tab/Tab.js +0 -6
  30. package/lib-commonjs/components/Tab/Tab.js.map +1 -1
  31. package/lib-commonjs/components/Tab/Tab.types.js.map +1 -1
  32. package/lib-commonjs/components/Tab/index.js +0 -7
  33. package/lib-commonjs/components/Tab/index.js.map +1 -1
  34. package/lib-commonjs/components/Tab/renderTab.js +8 -9
  35. package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
  36. package/lib-commonjs/components/Tab/useTab.js +0 -7
  37. package/lib-commonjs/components/Tab/useTab.js.map +1 -1
  38. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js +27 -45
  39. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js.map +1 -1
  40. package/lib-commonjs/components/Tab/useTabStyles.js +334 -355
  41. package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
  42. package/lib-commonjs/components/TabList/TabList.js +0 -7
  43. package/lib-commonjs/components/TabList/TabList.js.map +1 -1
  44. package/lib-commonjs/components/TabList/TabList.types.js.map +1 -1
  45. package/lib-commonjs/components/TabList/TabListContext.js +2 -4
  46. package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
  47. package/lib-commonjs/components/TabList/index.js +0 -6
  48. package/lib-commonjs/components/TabList/index.js.map +1 -1
  49. package/lib-commonjs/components/TabList/renderTabList.js +2 -7
  50. package/lib-commonjs/components/TabList/renderTabList.js.map +1 -1
  51. package/lib-commonjs/components/TabList/useTabList.js +2 -8
  52. package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
  53. package/lib-commonjs/components/TabList/useTabListContextValues.js +0 -2
  54. package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
  55. package/lib-commonjs/components/TabList/useTabListStyles.js +13 -19
  56. package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -1
  57. package/lib-commonjs/index.js +0 -4
  58. package/lib-commonjs/index.js.map +1 -1
  59. package/package.json +8 -8
package/CHANGELOG.json CHANGED
@@ -2,7 +2,81 @@
2
2
  "name": "@fluentui/react-tabs",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 20 Dec 2022 14:55:58 GMT",
5
+ "date": "Wed, 04 Jan 2023 01:35:55 GMT",
6
+ "tag": "@fluentui/react-tabs_v9.1.5",
7
+ "version": "9.1.5",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "martinhochel@microsoft.com",
12
+ "package": "@fluentui/react-tabs",
13
+ "commit": "194b0cf0cc27c1c1233aa945f09b3ad29778d8ca",
14
+ "comment": "chore(scripts): use for @fluentui/scripts version within all package.json"
15
+ },
16
+ {
17
+ "author": "martinhochel@microsoft.com",
18
+ "package": "@fluentui/react-tabs",
19
+ "commit": "4ec2b998b294d6d9c3196d3d82893bdd97d0c105",
20
+ "comment": "chore(scripts): move index.ts to to follow sub-folder domain packaging"
21
+ }
22
+ ],
23
+ "patch": [
24
+ {
25
+ "author": "olfedias@microsoft.com",
26
+ "package": "@fluentui/react-tabs",
27
+ "commit": "2c38f1e4ae07b2b60df596efe11015a68f166dbf",
28
+ "comment": "chore: Update Griffel to latest version"
29
+ },
30
+ {
31
+ "author": "beachball",
32
+ "package": "@fluentui/react-tabs",
33
+ "comment": "Bump @fluentui/react-context-selector to v9.1.4",
34
+ "commit": "3e322d15529451be153e97298873253e21af4082"
35
+ },
36
+ {
37
+ "author": "beachball",
38
+ "package": "@fluentui/react-tabs",
39
+ "comment": "Bump @fluentui/react-tabster to v9.3.5",
40
+ "commit": "3e322d15529451be153e97298873253e21af4082"
41
+ },
42
+ {
43
+ "author": "beachball",
44
+ "package": "@fluentui/react-tabs",
45
+ "comment": "Bump @fluentui/react-utilities to v9.3.1",
46
+ "commit": "3e322d15529451be153e97298873253e21af4082"
47
+ },
48
+ {
49
+ "author": "beachball",
50
+ "package": "@fluentui/react-tabs",
51
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19",
52
+ "commit": "3e322d15529451be153e97298873253e21af4082"
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ {
58
+ "date": "Wed, 21 Dec 2022 10:20:33 GMT",
59
+ "tag": "@fluentui/react-tabs_v9.1.4",
60
+ "version": "9.1.4",
61
+ "comments": {
62
+ "patch": [
63
+ {
64
+ "author": "beachball",
65
+ "package": "@fluentui/react-tabs",
66
+ "comment": "Bump @fluentui/react-tabster to v9.3.4",
67
+ "commit": "66bf89f634cad4a275e957d7a2214c7e73ff8c2e"
68
+ },
69
+ {
70
+ "author": "beachball",
71
+ "package": "@fluentui/react-tabs",
72
+ "comment": "Bump @fluentui/react-theme to v9.1.5",
73
+ "commit": "66bf89f634cad4a275e957d7a2214c7e73ff8c2e"
74
+ }
75
+ ]
76
+ }
77
+ },
78
+ {
79
+ "date": "Tue, 20 Dec 2022 14:59:34 GMT",
6
80
  "tag": "@fluentui/react-tabs_v9.1.3",
7
81
  "version": "9.1.3",
8
82
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,35 @@
1
1
  # Change Log - @fluentui/react-tabs
2
2
 
3
- This log was last generated on Tue, 20 Dec 2022 14:55:58 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 04 Jan 2023 01:35:55 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.1.5)
8
+
9
+ Wed, 04 Jan 2023 01:35:55 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.1.4..@fluentui/react-tabs_v9.1.5)
11
+
12
+ ### Patches
13
+
14
+ - chore: Update Griffel to latest version ([PR #26045](https://github.com/microsoft/fluentui/pull/26045) by olfedias@microsoft.com)
15
+ - Bump @fluentui/react-context-selector to v9.1.4 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
16
+ - Bump @fluentui/react-tabster to v9.3.5 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
17
+ - Bump @fluentui/react-utilities to v9.3.1 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
18
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
19
+
20
+ ## [9.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.1.4)
21
+
22
+ Wed, 21 Dec 2022 10:20:33 GMT
23
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.1.3..@fluentui/react-tabs_v9.1.4)
24
+
25
+ ### Patches
26
+
27
+ - Bump @fluentui/react-tabster to v9.3.4 ([commit](https://github.com/microsoft/fluentui/commit/66bf89f634cad4a275e957d7a2214c7e73ff8c2e) by beachball)
28
+ - Bump @fluentui/react-theme to v9.1.5 ([commit](https://github.com/microsoft/fluentui/commit/66bf89f634cad4a275e957d7a2214c7e73ff8c2e) by beachball)
29
+
7
30
  ## [9.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.1.3)
8
31
 
9
- Tue, 20 Dec 2022 14:55:58 GMT
32
+ Tue, 20 Dec 2022 14:59:34 GMT
10
33
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.1.2..@fluentui/react-tabs_v9.1.3)
11
34
 
12
35
  ### Patches
@@ -5,7 +5,6 @@ import { useTabStyles_unstable } from './useTabStyles';
5
5
  /**
6
6
  * A tab provides a selectable item in a tab list.
7
7
  */
8
-
9
8
  export const Tab = /*#__PURE__*/React.forwardRef((props, ref) => {
10
9
  const state = useTab_unstable(props, ref);
11
10
  useTabStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-tabs/src/components/Tab/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,eAAT,QAAgC,UAAhC;AACA,SAAS,kBAAT,QAAmC,aAAnC;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AAIA;;AAEG;;AACH,OAAO,MAAM,GAAG,gBAAkC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChF,MAAM,KAAK,GAAG,eAAe,CAAC,KAAD,EAAQ,GAAR,CAA7B;EAEA,qBAAqB,CAAC,KAAD,CAArB;EACA,OAAO,kBAAkB,CAAC,KAAD,CAAzB;AACD,CALiD,CAA3C;AAOP,GAAG,CAAC,WAAJ,GAAkB,KAAlB","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,eAAe,QAAQ,UAAU;AAC1C,SAASC,kBAAkB,QAAQ,aAAa;AAChD,SAASC,qBAAqB,QAAQ,gBAAgB;AAItD;;;AAGA,OAAO,MAAMC,GAAG,gBAAkCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChF,MAAMC,KAAK,GAAGP,eAAe,CAACK,KAAK,EAAEC,GAAG,CAAC;EAEzCJ,qBAAqB,CAACK,KAAK,CAAC;EAC5B,OAAON,kBAAkB,CAACM,KAAK,CAAC;AAClC,CAAC,CAAC;AAEFJ,GAAG,CAACK,WAAW,GAAG,KAAK","names":["React","useTab_unstable","renderTab_unstable","useTabStyles_unstable","Tab","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabs/src/components/Tab/Tab.tsx"],"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"]}
@@ -3,16 +3,19 @@ import { getSlots } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Render the final JSX of Tab
5
5
  */
6
-
7
6
  export const renderTab_unstable = state => {
8
7
  const {
9
8
  slots,
10
9
  slotProps
11
10
  } = getSlots(state);
12
- return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
13
- }, slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
14
- }), !state.iconOnly && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
15
- }), !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content,
11
+ return /*#__PURE__*/React.createElement(slots.root, {
12
+ ...slotProps.root
13
+ }, slots.icon && /*#__PURE__*/React.createElement(slots.icon, {
14
+ ...slotProps.icon
15
+ }), !state.iconOnly && /*#__PURE__*/React.createElement(slots.content, {
16
+ ...slotProps.content
17
+ }), !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && /*#__PURE__*/React.createElement(slots.content, {
18
+ ...slotProps.content,
16
19
  className: state.contentReservedSpaceClassName
17
20
  }));
18
21
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-tabs/src/components/Tab/renderTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,kBAAkB,GAAI,KAAD,IAAoB;EACpD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAW,KAAX,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADjB,EAEG,CAAC,KAAK,CAAC,QAAP,iBAAmB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;EAAf,CAAd,CAFtB,EAGG,CAAC,KAAK,CAAC,QAAP,IAAmB,CAAC,KAAK,CAAC,QAA1B,IAAsC,KAAK,CAAC,6BAAN,KAAwC,SAA9E,iBACC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC,OAAf;IAAwB,SAAS,EAAE,KAAK,CAAC;EAAzC,CAAd,CAJJ,CADF;AASD,CAZM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TabState, TabSlots } from './Tab.types';\n\n/**\n * Render the final JSX of Tab\n */\nexport const renderTab_unstable = (state: TabState) => {\n const { slots, slotProps } = getSlots<TabSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {!state.iconOnly && <slots.content {...slotProps.content} />}\n {!state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && (\n <slots.content {...slotProps.content} className={state.contentReservedSpaceClassName} />\n )}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,kBAAkB,GAAIC,KAAe,IAAI;EACpD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAWE,KAAK,CAAC;EAEtD,oBACEH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,GAC3BF,KAAK,CAACG,IAAI,iBAAIP,oBAACI,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,EAAI,EAChD,CAACJ,KAAK,CAACK,QAAQ,iBAAIR,oBAACI,KAAK,CAACK,OAAO;IAAA,GAAKJ,SAAS,CAACI;EAAO,EAAI,EAC3D,CAACN,KAAK,CAACO,QAAQ,IAAI,CAACP,KAAK,CAACK,QAAQ,IAAIL,KAAK,CAACQ,6BAA6B,KAAKC,SAAS,iBACtFZ,oBAACI,KAAK,CAACK,OAAO;IAAA,GAAKJ,SAAS,CAACI,OAAO;IAAEI,SAAS,EAAEV,KAAK,CAACQ;EAA6B,EACrF,CACU;AAEjB,CAAC","names":["React","getSlots","renderTab_unstable","state","slots","slotProps","root","icon","iconOnly","content","selected","contentReservedSpaceClassName","undefined","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabs/src/components/Tab/renderTab.tsx"],"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"]}
@@ -11,7 +11,6 @@ import { useContextSelector } from '@fluentui/react-context-selector';
11
11
  * @param props - props from this instance of Tab
12
12
  * @param ref - reference to root HTMLElement of Tab
13
13
  */
14
-
15
14
  export const useTab_unstable = (props, ref) => {
16
15
  const {
17
16
  content,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-tabs/src/components/Tab/useTab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,gBAAlD,EAAoE,aAApE,QAAyF,2BAAzF;AAEA,SAAS,cAAT,QAA+B,2BAA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,IAxBK;IAyBL,KAzBK;IA0BL;EA1BK,CAAP;AA4BD,CA1DM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport type { TabProps, TabState } from './Tab.types';\nimport { TabListContext } from '../TabList/TabListContext';\nimport { useContextSelector } from '@fluentui/react-context-selector';\nimport { SelectTabEvent } from '../TabList/TabList.types';\n\n/**\n * Create the state required to render Tab.\n *\n * The returned state can be modified with hooks such as useTabStyles_unstable,\n * before being passed to renderTab_unstable.\n *\n * @param props - props from this instance of Tab\n * @param ref - reference to root HTMLElement of Tab\n */\nexport const useTab_unstable = (props: TabProps, ref: React.Ref<HTMLElement>): TabState => {\n const { content, disabled: tabDisabled = false, icon, value } = props;\n\n const appearance = useContextSelector(TabListContext, ctx => ctx.appearance);\n const reserveSelectedTabSpace = useContextSelector(TabListContext, ctx => ctx.reserveSelectedTabSpace);\n const listDisabled = useContextSelector(TabListContext, ctx => ctx.disabled);\n const selected = useContextSelector(TabListContext, ctx => ctx.selectedValue === value);\n const onRegister = useContextSelector(TabListContext, ctx => ctx.onRegister);\n const onUnregister = useContextSelector(TabListContext, ctx => ctx.onUnregister);\n const onSelect = useContextSelector(TabListContext, ctx => ctx.onSelect);\n const size = useContextSelector(TabListContext, ctx => ctx.size);\n const vertical = useContextSelector(TabListContext, ctx => !!ctx.vertical);\n const disabled = listDisabled || tabDisabled;\n\n const innerRef = React.useRef<HTMLElement>(null);\n const onClick = useEventCallback((event: SelectTabEvent) => onSelect(event, { value }));\n\n React.useEffect(() => {\n onRegister({\n value,\n ref: innerRef,\n });\n\n return () => {\n onUnregister({ value, ref: innerRef });\n };\n }, [onRegister, onUnregister, innerRef, value]);\n\n const iconShorthand = resolveShorthand(icon);\n const contentShorthand = resolveShorthand(content, { required: true, defaultProps: { children: props.children } });\n return {\n components: {\n root: 'button',\n icon: 'span',\n content: 'span',\n },\n root: getNativeElementProps('button', {\n ref: useMergedRefs(ref, innerRef),\n role: 'tab',\n type: 'button',\n // aria-selected undefined indicates it is not selectable\n // according to https://www.w3.org/TR/wai-aria-1.1/#aria-selected\n 'aria-selected': disabled ? undefined : `${selected}`,\n ...props,\n disabled,\n onClick,\n }),\n icon: iconShorthand,\n iconOnly: Boolean(iconShorthand?.children && !contentShorthand.children),\n content: contentShorthand,\n appearance,\n contentReservedSpaceClassName: reserveSelectedTabSpace ? '' : undefined,\n disabled,\n selected,\n size,\n value,\n vertical,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ,2BAA2B;AAEpH,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SAASC,kBAAkB,QAAQ,kCAAkC;AAGrE;;;;;;;;;AASA,OAAO,MAAMC,eAAe,GAAG,CAACC,KAAe,EAAEC,GAA2B,KAAc;EACxF,MAAM;IAAEC,OAAO;IAAEC,QAAQ,EAAEC,WAAW,GAAG,KAAK;IAAEC,IAAI;IAAEC;EAAK,CAAE,GAAGN,KAAK;EAErE,MAAMO,UAAU,GAAGT,kBAAkB,CAACD,cAAc,EAAEW,GAAG,IAAIA,GAAG,CAACD,UAAU,CAAC;EAC5E,MAAME,uBAAuB,GAAGX,kBAAkB,CAACD,cAAc,EAAEW,GAAG,IAAIA,GAAG,CAACC,uBAAuB,CAAC;EACtG,MAAMC,YAAY,GAAGZ,kBAAkB,CAACD,cAAc,EAAEW,GAAG,IAAIA,GAAG,CAACL,QAAQ,CAAC;EAC5E,MAAMQ,QAAQ,GAAGb,kBAAkB,CAACD,cAAc,EAAEW,GAAG,IAAIA,GAAG,CAACI,aAAa,KAAKN,KAAK,CAAC;EACvF,MAAMO,UAAU,GAAGf,kBAAkB,CAACD,cAAc,EAAEW,GAAG,IAAIA,GAAG,CAACK,UAAU,CAAC;EAC5E,MAAMC,YAAY,GAA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EpC,qBAAqB,CAAC,QAAQ,EAAE;MACpCQ,GAAG,EAAEL,aAAa,CAACK,GAAG,EAAEiB,QAAQ,CAAC;MACjCY,IAAI,EAAE,KAAK;MACXC,IAAI,EAAE,QAAQ;MACd;MACA;MACA,eAAe,EAAE5B,QAAQ,GAAG6B,SAAS,GAAG,GAAGrB,QAAQ,EAAE;MACrD,GAAGX,KAAK;MACRG,QAAQ;MACRiB;KACD,CAAC;IACFf,IAAI,EAAEkB,aAAa;IACnBU,QAAQ,EAAEC,OAAO,CAAC,cAAa,aAAbX,aAAa,uBAAbA,aAAa,CAAEI,QAAQ,KAAI,CAACH,gBAAgB,CAACG,QAAQ,CAAC;IACxEzB,OAAO,EAAEsB,gBAAgB;IACzBjB,UAAU;IACV4B,6BAA6B,EAAE1B,uBAAuB,GAAG,EAAE,GAAGuB,SAAS;IACvE7B,QAAQ;IACRQ,QAAQ;IACRK,IAAI;IACJV,KAAK;IACLW;GACD;AACH,CAAC","names":["React","getNativeElementProps","resolveShorthand","useEventCallback","useMergedRefs","TabListContext","useContextSelector","useTab_unstable","props","ref","content","disabled","tabDisabled","icon","value","appearance","ctx","reserveSelectedTabSpace","listDisabled","selected","selectedValue","onRegister","onUnregister","onSelect","size","vertical","innerRef","useRef","onClick","event","useEffect","iconShorthand","contentShorthand","required","defaultProps","children","components","root","role","type","undefined","iconOnly","Boolean","contentReservedSpaceClassName"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabs/src/components/Tab/useTab.ts"],"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"]}
@@ -2,45 +2,42 @@ import * as React from 'react';
2
2
  import { __styles, mergeClasses, shorthands } from '@griffel/react';
3
3
  import { useContextSelector } from '@fluentui/react-context-selector';
4
4
  import { TabListContext } from '../TabList/TabListContext';
5
- import { tokens } from '@fluentui/react-theme'; // eslint-disable-next-line @typescript-eslint/naming-convention
6
-
5
+ import { tokens } from '@fluentui/react-theme';
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
7
  const tabIndicatorCssVars_unstable = {
8
8
  offsetVar: '--fui-Tab__indicator--offset',
9
9
  scaleVar: '--fui-Tab__indicator--scale'
10
10
  };
11
-
12
11
  const useActiveIndicatorStyles = /*#__PURE__*/__styles({
13
- "base": {
14
- "B68tc82": "f1mtd64y",
15
- "Bmxbyg5": "f1y7q3j9"
12
+ base: {
13
+ B68tc82: "f1mtd64y",
14
+ Bmxbyg5: "f1y7q3j9"
16
15
  },
17
- "animated": {
18
- "Ba2ppi3": "fhwpy7i",
19
- "F2fol1": "f6zz20j",
20
- "B1dyfl9": "f1ai4sc1",
21
- "B0vmy72": "f9qxlq5",
22
- "u9bimw": "f1aql376"
16
+ animated: {
17
+ Ba2ppi3: "fhwpy7i",
18
+ F2fol1: "f6zz20j",
19
+ B1dyfl9: "f1ai4sc1",
20
+ B0vmy72: "f9qxlq5",
21
+ u9bimw: "f1aql376"
23
22
  },
24
- "horizontal": {
25
- "sjv3b2": ["fug4aj8", "f1i5xzg7"],
26
- "b1kco5": "f1q7ujh"
23
+ horizontal: {
24
+ sjv3b2: ["fug4aj8", "f1i5xzg7"],
25
+ b1kco5: "f1q7ujh"
27
26
  },
28
- "vertical": {
29
- "sjv3b2": "f1hqboyk",
30
- "b1kco5": "f1dxupa6"
27
+ vertical: {
28
+ sjv3b2: "f1hqboyk",
29
+ b1kco5: "f1dxupa6"
31
30
  }
32
31
  }, {
33
- "d": [".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".fhwpy7i::after{transition-property:transform;}", ".f6zz20j::after{transition-duration:var(--durationSlow);}", ".f1ai4sc1::after{transition-timing-function:var(--curveDecelerateMax);}", ".fug4aj8::after{transform-origin:left;}", ".f1i5xzg7::after{transform-origin:right;}", ".f1q7ujh::after{-webkit-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));-moz-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));-ms-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));}", ".f1hqboyk::after{transform-origin:top;}", ".f1dxupa6::after{-webkit-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));-moz-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));-ms-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));}"],
34
- "m": [["@media (prefers-reduced-motion: reduce){.f9qxlq5::after{transition-property:none;}}", {
35
- "m": "(prefers-reduced-motion: reduce)"
32
+ d: [".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".fhwpy7i::after{transition-property:transform;}", ".f6zz20j::after{transition-duration:var(--durationSlow);}", ".f1ai4sc1::after{transition-timing-function:var(--curveDecelerateMax);}", ".fug4aj8::after{transform-origin:left;}", ".f1i5xzg7::after{transform-origin:right;}", ".f1q7ujh::after{-webkit-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));-moz-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));-ms-transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));transform:translateX(var(--fui-Tab__indicator--offset)) scaleX(var(--fui-Tab__indicator--scale));}", ".f1hqboyk::after{transform-origin:top;}", ".f1dxupa6::after{-webkit-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));-moz-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));-ms-transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));transform:translateY(var(--fui-Tab__indicator--offset)) scaleY(var(--fui-Tab__indicator--scale));}"],
33
+ m: [["@media (prefers-reduced-motion: reduce){.f9qxlq5::after{transition-property:none;}}", {
34
+ m: "(prefers-reduced-motion: reduce)"
36
35
  }], ["@media (prefers-reduced-motion: reduce){.f1aql376::after{transition-duration:0.01ms;}}", {
37
- "m": "(prefers-reduced-motion: reduce)"
36
+ m: "(prefers-reduced-motion: reduce)"
38
37
  }]]
39
38
  });
40
-
41
39
  const calculateTabRect = element => {
42
40
  var _a;
43
-
44
41
  if (element) {
45
42
  const parentRect = ((_a = element.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || {
46
43
  x: 0,
@@ -56,21 +53,16 @@ const calculateTabRect = element => {
56
53
  height: tabRect.height
57
54
  };
58
55
  }
59
-
60
56
  return undefined;
61
57
  };
62
-
63
58
  const getRegisteredTabRect = (registeredTabs, value) => {
64
59
  var _a;
65
-
66
60
  const element = value !== undefined && value !== null ? (_a = registeredTabs[JSON.stringify(value)]) === null || _a === void 0 ? void 0 : _a.ref.current : undefined;
67
61
  return element ? calculateTabRect(element) : undefined;
68
62
  };
69
63
  /**
70
64
  * Adds additional styling to the active tab selection indicator to create a sliding animation.
71
65
  */
72
-
73
-
74
66
  export const useTabAnimatedIndicatorStyles_unstable = state => {
75
67
  const {
76
68
  disabled,
@@ -92,7 +84,6 @@ export const useTabAnimatedIndicatorStyles_unstable = state => {
92
84
  });
93
85
  }
94
86
  }, [lastAnimatedFrom]);
95
-
96
87
  if (selected) {
97
88
  const {
98
89
  previousSelectedValue,
@@ -101,7 +92,6 @@ export const useTabAnimatedIndicatorStyles_unstable = state => {
101
92
  } = getRegisteredTabs();
102
93
  const previousSelectedTabRect = getRegisteredTabRect(registeredTabs, previousSelectedValue);
103
94
  const selectedTabRect = getRegisteredTabRect(registeredTabs, selectedValue);
104
-
105
95
  if (selectedTabRect && previousSelectedTabRect && previousSelectedValue && lastAnimatedFrom !== previousSelectedValue) {
106
96
  const offset = vertical ? previousSelectedTabRect.y - selectedTabRect.y : previousSelectedTabRect.x - selectedTabRect.x;
107
97
  const scale = vertical ? previousSelectedTabRect.height / selectedTabRect.height : previousSelectedTabRect.width / selectedTabRect.width;
@@ -115,22 +105,21 @@ export const useTabAnimatedIndicatorStyles_unstable = state => {
115
105
  // need to clear the last animated from so that if this tab is selected again
116
106
  // from the same previous tab as last time, that animation still happens.
117
107
  setLastAnimatedFrom(undefined);
118
- } // do not apply any animation if the tab is disabled
119
-
120
-
108
+ }
109
+ // do not apply any animation if the tab is disabled
121
110
  if (disabled) {
122
111
  return state;
123
- } // the animation should only happen as the selection indicator returns to its
112
+ }
113
+ // the animation should only happen as the selection indicator returns to its
124
114
  // original position and not when set at the previous tabs position.
125
-
126
-
127
115
  const animating = animationValues.offset === 0 && animationValues.scale === 1;
128
116
  state.root.className = mergeClasses(state.root.className, selected && activeIndicatorStyles.base, selected && animating && activeIndicatorStyles.animated, selected && (vertical ? activeIndicatorStyles.vertical : activeIndicatorStyles.horizontal));
129
117
  const rootCssVars = {
130
118
  [tabIndicatorCssVars_unstable.offsetVar]: `${animationValues.offset}px`,
131
119
  [tabIndicatorCssVars_unstable.scaleVar]: `${animationValues.scale}`
132
120
  };
133
- state.root.style = { ...rootCssVars,
121
+ state.root.style = {
122
+ ...rootCssVars,
134
123
  ...state.root.style
135
124
  };
136
125
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-tabs/src/components/Tab/useTabAnimatedIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,kBAAT,QAAmC,kCAA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AuB,CAAC,CAAxB,GAA4B,eAAe,CAAC,CAFhD;MAIA,MAAM,KAAK,GAAG,QAAQ,GAClB,uBAAuB,CAAC,MAAxB,GAAiC,eAAe,CAAC,MAD/B,GAElB,uBAAuB,CAAC,KAAxB,GAAgC,eAAe,CAAC,KAFpD;MAIA,kBAAkB,CAAC;QAAE,MAAF;QAAU;MAAV,CAAD,CAAlB;MACA,mBAAmB,CAAC,qBAAD,CAAnB;IACD;EACF,CAtBD,MAsBO,IAAI,gBAAJ,EAAsB;IAC3B;IACA;IACA,mBAAmB,CAAC,SAAD,CAAnB;EACD,CAxCiF,CA0ClF;;;EACA,IAAI,QAAJ,EAAc;IACZ,OAAO,KAAP;EACD,CA7CiF,CA+ClF;EACA;;;EACA,MAAM,SAAS,GAAG,eAAe,CAAC,MAAhB,KAA2B,CAA3B,IAAgC,eAAe,CAAC,KAAhB,KAA0B,CAA5E;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,KAAK,CAAC,IAAN,CAAW,SADsB,EAEjC,QAAQ,IAAI,qBAAqB,CAAC,IAFD,EAGjC,QAAQ,IAAI,SAAZ,IAAyB,qBAAqB,CAAC,QAHd,EAIjC,QAAQ,KAAK,QAAQ,GAAG,qBAAqB,CAAC,QAAzB,GAAoC,qBAAqB,CAAC,UAAvE,CAJyB,CAAnC;EAOA,MAAM,WAAW,GAAG;IAClB,CAAC,4BAA4B,CAAC,SAA9B,GAA0C,GAAG,eAAe,CAAC,MAAM,IADjD;IAElB,CAAC,4BAA4B,CAAC,QAA9B,GAAyC,GAAG,eAAe,CAAC,KAAK;EAF/C,CAApB;EAKA,KAAK,CAAC,IAAN,CAAW,KAAX,GAAmB,EACjB,GAAG,WADc;IAEjB,GAAG,KAAK,CAAC,IAAN,CAAW;EAFG,CAAnB;EAKA,OAAO,KAAP;AACD,CArEM","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 ...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ACd,CAAC","names":["React","mergeClasses","shorthands","useContextSelector","TabListContext","tokens","tabIndicatorCssVars_unstable","offsetVar","scaleVar","useActiveIndicatorStyles","calculateTabRect","element","parentRect","parentElement","getBoundingClientRect","x","y","width","height","tabRect","undefined","getRegisteredTabRect","registeredTabs","value","JSON","stringify","ref","current","useTabAnimatedIndicatorStyles_unstable","state","disabled","selected","vertical","activeIndicatorStyles","lastAnimatedFrom","setLastAnimatedFrom","useState","animationValues","setAnimationValues","offset","scale","getRegisteredTabs","ctx","useEffect","previousSelectedValue","selectedValue","previousSelectedTabRect","selectedTabRect","animating","root","className","base","animated","horizontal","rootCssVars","style"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabs/src/components/Tab/useTabAnimatedIndicator.ts"],"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"]}