@fluentui/react-tabs 9.3.7 → 9.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@fluentui/react-tabs",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 04 Apr 2023 18:42:19 GMT",
5
+ "date": "Thu, 06 Apr 2023 23:59:54 GMT",
6
+ "tag": "@fluentui/react-tabs_v9.3.8",
7
+ "version": "9.3.8",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "gcox@microsoft.com",
12
+ "package": "@fluentui/react-tabs",
13
+ "commit": "fe885a29eaaae84a902c66ea0af118c22358228b",
14
+ "comment": "fix: Merged onClick callbacks in Tab"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 04 Apr 2023 18:44:50 GMT",
6
21
  "tag": "@fluentui/react-tabs_v9.3.7",
7
22
  "version": "9.3.7",
8
23
  "comments": {
@@ -11,19 +26,19 @@
11
26
  "author": "beachball",
12
27
  "package": "@fluentui/react-tabs",
13
28
  "comment": "Bump @fluentui/react-context-selector to v9.1.16",
14
- "commit": "37a3a6eda1fd41086edd99a0b1560a8740f8c6c5"
29
+ "commit": "6778d76bbbad7e1975c151c797f28c2708cde2ce"
15
30
  },
16
31
  {
17
32
  "author": "beachball",
18
33
  "package": "@fluentui/react-tabs",
19
34
  "comment": "Bump @fluentui/react-tabster to v9.6.3",
20
- "commit": "37a3a6eda1fd41086edd99a0b1560a8740f8c6c5"
35
+ "commit": "6778d76bbbad7e1975c151c797f28c2708cde2ce"
21
36
  },
22
37
  {
23
38
  "author": "beachball",
24
39
  "package": "@fluentui/react-tabs",
25
40
  "comment": "Bump @fluentui/react-utilities to v9.7.3",
26
- "commit": "37a3a6eda1fd41086edd99a0b1560a8740f8c6c5"
41
+ "commit": "6778d76bbbad7e1975c151c797f28c2708cde2ce"
27
42
  }
28
43
  ]
29
44
  }
package/CHANGELOG.md CHANGED
@@ -1,19 +1,28 @@
1
1
  # Change Log - @fluentui/react-tabs
2
2
 
3
- This log was last generated on Tue, 04 Apr 2023 18:42:19 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 06 Apr 2023 23:59:54 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.3.8)
8
+
9
+ Thu, 06 Apr 2023 23:59:54 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.3.7..@fluentui/react-tabs_v9.3.8)
11
+
12
+ ### Patches
13
+
14
+ - fix: Merged onClick callbacks in Tab ([PR #27477](https://github.com/microsoft/fluentui/pull/27477) by gcox@microsoft.com)
15
+
7
16
  ## [9.3.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.3.7)
8
17
 
9
- Tue, 04 Apr 2023 18:42:19 GMT
18
+ Tue, 04 Apr 2023 18:44:50 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabs_v9.3.5..@fluentui/react-tabs_v9.3.7)
11
20
 
12
21
  ### Patches
13
22
 
14
- - Bump @fluentui/react-context-selector to v9.1.16 ([PR #27430](https://github.com/microsoft/fluentui/pull/27430) by beachball)
15
- - Bump @fluentui/react-tabster to v9.6.3 ([PR #27430](https://github.com/microsoft/fluentui/pull/27430) by beachball)
16
- - Bump @fluentui/react-utilities to v9.7.3 ([PR #27430](https://github.com/microsoft/fluentui/pull/27430) by beachball)
23
+ - Bump @fluentui/react-context-selector to v9.1.16 ([PR #27434](https://github.com/microsoft/fluentui/pull/27434) by beachball)
24
+ - Bump @fluentui/react-tabster to v9.6.3 ([PR #27434](https://github.com/microsoft/fluentui/pull/27434) by beachball)
25
+ - Bump @fluentui/react-utilities to v9.7.3 ([PR #27434](https://github.com/microsoft/fluentui/pull/27434) by beachball)
17
26
 
18
27
  ## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabs_v9.3.5)
19
28
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
2
+ import { getNativeElementProps, mergeCallbacks, resolveShorthand, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
3
3
  import { useTabListContext_unstable } from '../TabList/TabListContext';
4
4
  /**
5
5
  * Create the state required to render Tab.
@@ -15,6 +15,7 @@ export const useTab_unstable = (props, ref) => {
15
15
  content,
16
16
  disabled: tabDisabled = false,
17
17
  icon,
18
+ onClick,
18
19
  value
19
20
  } = props;
20
21
  const appearance = useTabListContext_unstable(ctx => ctx.appearance);
@@ -28,9 +29,9 @@ export const useTab_unstable = (props, ref) => {
28
29
  const vertical = useTabListContext_unstable(ctx => !!ctx.vertical);
29
30
  const disabled = listDisabled || tabDisabled;
30
31
  const innerRef = React.useRef(null);
31
- const onClick = useEventCallback(event => onSelect(event, {
32
+ const onTabClick = useEventCallback(mergeCallbacks(onClick, event => onSelect(event, {
32
33
  value
33
- }));
34
+ })));
34
35
  React.useEffect(() => {
35
36
  onRegister({
36
37
  value,
@@ -65,7 +66,7 @@ export const useTab_unstable = (props, ref) => {
65
66
  'aria-selected': disabled ? undefined : `${selected}`,
66
67
  ...props,
67
68
  disabled,
68
- onClick
69
+ onClick: onTabClick
69
70
  }),
70
71
  icon: iconShorthand,
71
72
  iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !contentShorthand.children),
@@ -1 +1 @@
1
- {"version":3,"names":["React","getNativeElementProps","resolveShorthand","useEventCallback","useMergedRefs","useTabListContext_unstable","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"],"sources":["../../../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 { useTabListContext_unstable } from '../TabList/TabListContext';\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 = useTabListContext_unstable(ctx => ctx.appearance);\n const reserveSelectedTabSpace = useTabListContext_unstable(ctx => ctx.reserveSelectedTabSpace);\n const listDisabled = useTabListContext_unstable(ctx => ctx.disabled);\n const selected = useTabListContext_unstable(ctx => ctx.selectedValue === value);\n const onRegister = useTabListContext_unstable(ctx => ctx.onRegister);\n const onUnregister = useTabListContext_unstable(ctx => ctx.onUnregister);\n const onSelect = useTabListContext_unstable(ctx => ctx.onSelect);\n const size = useTabListContext_unstable(ctx => ctx.size);\n const vertical = useTabListContext_unstable(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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ;AAEzF,SAASC,0BAA0B,QAAQ;AAG3C;;;;;;;;;AASA,OAAO,MAAMC,eAAA,GAAkBA,CAACC,KAAA,EAAiBC,GAAA,KAA0C;EACzF,MAAM;IAAEC,OAAA;IAASC,QAAA,EAAUC,WAAA,GAAc,KAAK;IAAEC,IAAA;IAAMC;EAAK,CAAE,GAAGN,KAAA;EAEhE,MAAMO,UAAA,GAAaT,0BAAA,CAA2BU,GAAA,IAAOA,GAAA,CAAID,UAAU;EACnE,MAAME,uBAAA,GAA0BX,0BAAA,CAA2BU,GAAA,IAAOA,GAAA,CAAIC,uBAAuB;EAC7F,MAAMC,YAAA,GAAeZ,0BAAA,CAA2BU,GAAA,IAAOA,GAAA,CAAIL,QAAQ;EACnE,MAAMQ,QAAA,GAAWb,0BAAA,CAA2BU,GAAA,IAAOA,GAAA,CAAII,aAAa,KAAKN,KAAA;EACzE,MAAMO,UAAA,GAAaf,0BAAA,CAA2BU,GAAA,IAAOA,GAAA,CAAIK,UAAU;EACnE,MAAMC,YAAA,GAAehB,0BAAA,CAA2BU,GAAA,IAAOA,GAAA,CAAIM,YAAY;EACvE,MAAMC,QAAA,GAAWjB,0BAAA,CAA2BU,GAAA,IAAOA,GAAA,CAAIO,QAAQ;EAC/D,MAAMC,IAAA,GAAOlB,0BAAA,CAA2BU,GAAA,IAAOA,GAAA,CAAIQ,IAAI;EACvD,MAAMC,QAAA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,EAASsB,gBAAA;IACTjB,UAAA;IACA4B,6BAAA,EAA+B1B,uBAAA,GAA0B,KAAKuB,SAAS;IACvE7B,QAAA;IACAQ,QAAA;IACAK,IAAA;IACAV,KAAA;IACAW;EACF;AACF"}
1
+ {"version":3,"names":["React","getNativeElementProps","mergeCallbacks","resolveShorthand","useEventCallback","useMergedRefs","useTabListContext_unstable","useTab_unstable","props","ref","content","disabled","tabDisabled","icon","onClick","value","appearance","ctx","reserveSelectedTabSpace","listDisabled","selected","selectedValue","onRegister","onUnregister","onSelect","size","vertical","innerRef","useRef","onTabClick","event","useEffect","iconShorthand","contentShorthand","required","defaultProps","children","components","root","role","type","undefined","iconOnly","Boolean","contentReservedSpaceClassName"],"sources":["../../../src/components/Tab/useTab.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n mergeCallbacks,\n resolveShorthand,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport type { TabProps, TabState } from './Tab.types';\nimport { useTabListContext_unstable } from '../TabList/TabListContext';\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, onClick, value } = props;\n\n const appearance = useTabListContext_unstable(ctx => ctx.appearance);\n const reserveSelectedTabSpace = useTabListContext_unstable(ctx => ctx.reserveSelectedTabSpace);\n const listDisabled = useTabListContext_unstable(ctx => ctx.disabled);\n const selected = useTabListContext_unstable(ctx => ctx.selectedValue === value);\n const onRegister = useTabListContext_unstable(ctx => ctx.onRegister);\n const onUnregister = useTabListContext_unstable(ctx => ctx.onUnregister);\n const onSelect = useTabListContext_unstable(ctx => ctx.onSelect);\n const size = useTabListContext_unstable(ctx => ctx.size);\n const vertical = useTabListContext_unstable(ctx => !!ctx.vertical);\n const disabled = listDisabled || tabDisabled;\n\n const innerRef = React.useRef<HTMLElement>(null);\n const onTabClick = useEventCallback(mergeCallbacks(onClick, (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: onTabClick,\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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,qBAAqB,EACrBC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,QACR;AAEP,SAASC,0BAA0B,QAAQ;AAG3C;;;;;;;;;AASA,OAAO,MAAMC,eAAA,GAAkBA,CAACC,KAAA,EAAiBC,GAAA,KAA0C;EACzF,MAAM;IAAEC,OAAA;IAASC,QAAA,EAAUC,WAAA,GAAc,KAAK;IAAEC,IAAA;IAAMC,OAAA;IAASC;EAAK,CAAE,GAAGP,KAAA;EAEzE,MAAMQ,UAAA,GAAaV,0BAAA,CAA2BW,GAAA,IAAOA,GAAA,CAAID,UAAU;EACnE,MAAME,uBAAA,GAA0BZ,0BAAA,CAA2BW,GAAA,IAAOA,GAAA,CAAIC,uBAA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4B;IAAS;EAAE;EAChH,OAAO;IACLC,UAAA,EAAY;MACVC,IAAA,EAAM;MACNzB,IAAA,EAAM;MACNH,OAAA,EAAS;IACX;IACA4B,IAAA,EAAMrC,qBAAA,CAAsB,UAAU;MACpCQ,GAAA,EAAKJ,aAAA,CAAcI,GAAA,EAAKkB,QAAA;MACxBY,IAAA,EAAM;MACNC,IAAA,EAAM;MACN;MACA;MACA,iBAAiB7B,QAAA,GAAW8B,SAAA,GAAa,GAAErB,QAAS,EAAC;MACrD,GAAGZ,KAAK;MACRG,QAAA;MACAG,OAAA,EAASe;IACX;IACAhB,IAAA,EAAMmB,aAAA;IACNU,QAAA,EAAUC,OAAA,CAAQ,CAAAX,aAAA,aAAAA,aAAA,uBAAAA,aAAA,CAAeI,QAAQ,KAAI,CAACH,gBAAA,CAAiBG,QAAQ;IACvE1B,OAAA,EAASuB,gBAAA;IACTjB,UAAA;IACA4B,6BAAA,EAA+B1B,uBAAA,GAA0B,KAAKuB,SAAS;IACvE9B,QAAA;IACAS,QAAA;IACAK,IAAA;IACAV,KAAA;IACAW;EACF;AACF"}
@@ -11,7 +11,7 @@ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
11
  const _reactUtilities = require("@fluentui/react-utilities");
12
12
  const _tabListContext = require("../TabList/TabListContext");
13
13
  const useTab_unstable = (props, ref)=>{
14
- const { content , disabled: tabDisabled = false , icon , value } = props;
14
+ const { content , disabled: tabDisabled = false , icon , onClick , value } = props;
15
15
  const appearance = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.appearance);
16
16
  const reserveSelectedTabSpace = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.reserveSelectedTabSpace);
17
17
  const listDisabled = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.disabled);
@@ -23,9 +23,9 @@ const useTab_unstable = (props, ref)=>{
23
23
  const vertical = (0, _tabListContext.useTabListContext_unstable)((ctx)=>!!ctx.vertical);
24
24
  const disabled = listDisabled || tabDisabled;
25
25
  const innerRef = _react.useRef(null);
26
- const onClick = (0, _reactUtilities.useEventCallback)((event)=>onSelect(event, {
26
+ const onTabClick = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)(onClick, (event)=>onSelect(event, {
27
27
  value
28
- }));
28
+ })));
29
29
  _react.useEffect(()=>{
30
30
  onRegister({
31
31
  value,
@@ -65,7 +65,7 @@ const useTab_unstable = (props, ref)=>{
65
65
  'aria-selected': disabled ? undefined : `${selected}`,
66
66
  ...props,
67
67
  disabled,
68
- onClick
68
+ onClick: onTabClick
69
69
  }),
70
70
  icon: iconShorthand,
71
71
  iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !contentShorthand.children),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/Tab/useTab.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useTabListContext_unstable } from '../TabList/TabListContext';\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, ref) => {\n const {\n content,\n disabled: tabDisabled = false,\n icon,\n value\n } = props;\n const appearance = useTabListContext_unstable(ctx => ctx.appearance);\n const reserveSelectedTabSpace = useTabListContext_unstable(ctx => ctx.reserveSelectedTabSpace);\n const listDisabled = useTabListContext_unstable(ctx => ctx.disabled);\n const selected = useTabListContext_unstable(ctx => ctx.selectedValue === value);\n const onRegister = useTabListContext_unstable(ctx => ctx.onRegister);\n const onUnregister = useTabListContext_unstable(ctx => ctx.onUnregister);\n const onSelect = useTabListContext_unstable(ctx => ctx.onSelect);\n const size = useTabListContext_unstable(ctx => ctx.size);\n const vertical = useTabListContext_unstable(ctx => !!ctx.vertical);\n const disabled = listDisabled || tabDisabled;\n const innerRef = React.useRef(null);\n const onClick = useEventCallback(event => onSelect(event, {\n value\n }));\n React.useEffect(() => {\n onRegister({\n value,\n ref: innerRef\n });\n return () => {\n onUnregister({\n value,\n ref: innerRef\n });\n };\n }, [onRegister, onUnregister, innerRef, value]);\n const iconShorthand = resolveShorthand(icon);\n const contentShorthand = resolveShorthand(content, {\n required: true,\n defaultProps: {\n children: props.children\n }\n });\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 === null || iconShorthand === void 0 ? void 0 : 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//# sourceMappingURL=useTab.js.map"],"names":["useTab_unstable","props","ref","content","disabled","tabDisabled","icon","value","appearance","useTabListContext_unstable","ctx","reserveSelectedTabSpace","listDisabled","selected","selectedValue","onRegister","onUnregister","onSelect","size","vertical","innerRef","React","useRef","onClick","useEventCallback","event","useEffect","iconShorthand","resolveShorthand","contentShorthand","required","defaultProps","children","components","root","getNativeElementProps","useMergedRefs","role","type","undefined","iconOnly","Boolean","contentReservedSpaceClassName"],"mappings":";;;;+BAYaA;;aAAAA;;;6DAZU;gCACkE;gCAC9C;AAUpC,MAAMA,kBAAkB,CAACC,OAAOC,MAAQ;IAC7C,MAAM,EACJC,QAAO,EACPC,UAAUC,cAAc,KAAK,CAAA,EAC7BC,KAAI,EACJC,MAAK,EACN,GAAGN;IACJ,MAAMO,aAAaC,IAAAA,0CAA0B,EAACC,CAAAA,MAAOA,IAAIF,UAAU;IACnE,MAAMG,0BAA0BF,IAAA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iB,MAAM;YACNC,MAAM;YACN,yDAAyD;YACzD,iEAAiE;YACjE,iBAAiBlC,WAAWmC,YAAY,CAAC,EAAE1B,SAAS,CAAC;YACrD,GAAGZ,KAAK;YACRG;YACAmB;QACF;QACAjB,MAAMqB;QACNa,UAAUC,QAAQ,AAACd,CAAAA,kBAAkB,IAAI,IAAIA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcK,QAAQ,AAAD,KAAM,CAACH,iBAAiBG,QAAQ;QACtI7B,SAAS0B;QACTrB;QACAkC,+BAA+B/B,0BAA0B,KAAK4B,SAAS;QACvEnC;QACAS;QACAK;QACAX;QACAY;IACF;AACF,GACA,kCAAkC"}
1
+ {"version":3,"sources":["../../../lib/components/Tab/useTab.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useTabListContext_unstable } from '../TabList/TabListContext';\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, ref) => {\n const {\n content,\n disabled: tabDisabled = false,\n icon,\n onClick,\n value\n } = props;\n const appearance = useTabListContext_unstable(ctx => ctx.appearance);\n const reserveSelectedTabSpace = useTabListContext_unstable(ctx => ctx.reserveSelectedTabSpace);\n const listDisabled = useTabListContext_unstable(ctx => ctx.disabled);\n const selected = useTabListContext_unstable(ctx => ctx.selectedValue === value);\n const onRegister = useTabListContext_unstable(ctx => ctx.onRegister);\n const onUnregister = useTabListContext_unstable(ctx => ctx.onUnregister);\n const onSelect = useTabListContext_unstable(ctx => ctx.onSelect);\n const size = useTabListContext_unstable(ctx => ctx.size);\n const vertical = useTabListContext_unstable(ctx => !!ctx.vertical);\n const disabled = listDisabled || tabDisabled;\n const innerRef = React.useRef(null);\n const onTabClick = useEventCallback(mergeCallbacks(onClick, event => onSelect(event, {\n value\n })));\n React.useEffect(() => {\n onRegister({\n value,\n ref: innerRef\n });\n return () => {\n onUnregister({\n value,\n ref: innerRef\n });\n };\n }, [onRegister, onUnregister, innerRef, value]);\n const iconShorthand = resolveShorthand(icon);\n const contentShorthand = resolveShorthand(content, {\n required: true,\n defaultProps: {\n children: props.children\n }\n });\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: onTabClick\n }),\n icon: iconShorthand,\n iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : 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//# sourceMappingURL=useTab.js.map"],"names":["useTab_unstable","props","ref","content","disabled","tabDisabled","icon","onClick","value","appearance","useTabListContext_unstable","ctx","reserveSelectedTabSpace","listDisabled","selected","selectedValue","onRegister","onUnregister","onSelect","size","vertical","innerRef","React","useRef","onTabClick","useEventCallback","mergeCallbacks","event","useEffect","iconShorthand","resolveShorthand","contentShorthand","required","defaultProps","children","components","root","getNativeElementProps","useMergedRefs","role","type","undefined","iconOnly","Boolean","contentReservedSpaceClassName"],"mappings":";;;;+BAYaA;;aAAAA;;;6DAZU;gCACkF;gCAC9D;AAUpC,MAAMA,kBAAkB,CAACC,OAAOC,MAAQ;IAC7C,MAAM,EACJC,QAAO,EACPC,UAAUC,cAAc,KAAK,CAAA,EAC7BC,KAAI,EACJC,QAAO,EACPC,MAAK,EACN,GAAGP;IACJ,MAAMQ,aAAaC,IAAAA,0CAA0B,EAACC,CAAAA,MAAOA,IAAIF,UAAU;IACn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AU;YACpCnC,KAAKoC,IAAAA,6BAAa,EAACpC,KAAKmB;YACxBkB,MAAM;YACNC,MAAM;YACN,yDAAyD;YACzD,iEAAiE;YACjE,iBAAiBpC,WAAWqC,YAAY,CAAC,EAAE3B,SAAS,CAAC;YACrD,GAAGb,KAAK;YACRG;YACAG,SAASiB;QACX;QACAlB,MAAMuB;QACNa,UAAUC,QAAQ,AAACd,CAAAA,kBAAkB,IAAI,IAAIA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcK,QAAQ,AAAD,KAAM,CAACH,iBAAiBG,QAAQ;QACtI/B,SAAS4B;QACTtB;QACAmC,+BAA+BhC,0BAA0B,KAAK6B,SAAS;QACvErC;QACAU;QACAK;QACAX;QACAY;IACF;AACF,GACA,kCAAkC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tabs",
3
- "version": "9.3.7",
3
+ "version": "9.3.8",
4
4
  "description": "Fluent UI React tabs components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",