@fluentui/react-tabs 9.3.16 → 9.3.17

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 (72) hide show
  1. package/CHANGELOG.json +46 -1
  2. package/CHANGELOG.md +16 -2
  3. package/lib/Tab.js +0 -1
  4. package/lib/Tab.js.map +1 -1
  5. package/lib/TabList.js +0 -1
  6. package/lib/TabList.js.map +1 -1
  7. package/lib/components/Tab/Tab.js +5 -7
  8. package/lib/components/Tab/Tab.js.map +1 -1
  9. package/lib/components/Tab/Tab.types.js +1 -2
  10. package/lib/components/Tab/Tab.types.js.map +1 -1
  11. package/lib/components/Tab/index.js +0 -1
  12. package/lib/components/Tab/index.js.map +1 -1
  13. package/lib/components/Tab/renderTab.js +7 -12
  14. package/lib/components/Tab/renderTab.js.map +1 -1
  15. package/lib/components/Tab/useTab.js +65 -68
  16. package/lib/components/Tab/useTab.js.map +1 -1
  17. package/lib/components/Tab/useTabAnimatedIndicator.styles.js.map +1 -1
  18. package/lib/components/Tab/useTabStyles.styles.js.map +1 -1
  19. package/lib/components/TabList/TabList.js +6 -8
  20. package/lib/components/TabList/TabList.js.map +1 -1
  21. package/lib/components/TabList/TabList.types.js +0 -1
  22. package/lib/components/TabList/TabList.types.js.map +1 -1
  23. package/lib/components/TabList/TabListContext.js +19 -20
  24. package/lib/components/TabList/TabListContext.js.map +1 -1
  25. package/lib/components/TabList/index.js +0 -1
  26. package/lib/components/TabList/index.js.map +1 -1
  27. package/lib/components/TabList/renderTabList.js +6 -11
  28. package/lib/components/TabList/renderTabList.js.map +1 -1
  29. package/lib/components/TabList/useTabList.js +63 -70
  30. package/lib/components/TabList/useTabList.js.map +1 -1
  31. package/lib/components/TabList/useTabListContextValues.js +16 -28
  32. package/lib/components/TabList/useTabListContextValues.js.map +1 -1
  33. package/lib/components/TabList/useTabListStyles.styles.js.map +1 -1
  34. package/lib/index.js +0 -1
  35. package/lib/index.js.map +1 -1
  36. package/lib-commonjs/Tab.js +0 -3
  37. package/lib-commonjs/Tab.js.map +1 -1
  38. package/lib-commonjs/TabList.js +0 -3
  39. package/lib-commonjs/TabList.js.map +1 -1
  40. package/lib-commonjs/components/Tab/Tab.js +1 -3
  41. package/lib-commonjs/components/Tab/Tab.js.map +1 -1
  42. package/lib-commonjs/components/Tab/Tab.types.js +0 -3
  43. package/lib-commonjs/components/Tab/Tab.types.js.map +1 -1
  44. package/lib-commonjs/components/Tab/index.js +0 -3
  45. package/lib-commonjs/components/Tab/index.js.map +1 -1
  46. package/lib-commonjs/components/Tab/renderTab.js +1 -3
  47. package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
  48. package/lib-commonjs/components/Tab/useTab.js +1 -3
  49. package/lib-commonjs/components/Tab/useTab.js.map +1 -1
  50. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.styles.js +0 -2
  51. package/lib-commonjs/components/Tab/useTabAnimatedIndicator.styles.js.map +1 -1
  52. package/lib-commonjs/components/Tab/useTabStyles.styles.js +0 -2
  53. package/lib-commonjs/components/Tab/useTabStyles.styles.js.map +1 -1
  54. package/lib-commonjs/components/TabList/TabList.js +1 -3
  55. package/lib-commonjs/components/TabList/TabList.js.map +1 -1
  56. package/lib-commonjs/components/TabList/TabList.types.js +0 -3
  57. package/lib-commonjs/components/TabList/TabList.types.js.map +1 -1
  58. package/lib-commonjs/components/TabList/TabListContext.js +2 -4
  59. package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
  60. package/lib-commonjs/components/TabList/index.js +0 -3
  61. package/lib-commonjs/components/TabList/index.js.map +1 -1
  62. package/lib-commonjs/components/TabList/renderTabList.js +1 -3
  63. package/lib-commonjs/components/TabList/renderTabList.js.map +1 -1
  64. package/lib-commonjs/components/TabList/useTabList.js +1 -3
  65. package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
  66. package/lib-commonjs/components/TabList/useTabListContextValues.js +1 -3
  67. package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
  68. package/lib-commonjs/components/TabList/useTabListStyles.styles.js +0 -2
  69. package/lib-commonjs/components/TabList/useTabListStyles.styles.js.map +1 -1
  70. package/lib-commonjs/index.js +0 -3
  71. package/lib-commonjs/index.js.map +1 -1
  72. package/package.json +7 -7
@@ -1,2 +1 @@
1
1
  import * as React from 'react';
2
- //# sourceMappingURL=TabList.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React"],"sources":["../../../src/components/TabList/TabList.types.ts"],"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
1
+ {"version":3,"sources":["TabList.types.ts"],"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"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -1,24 +1,23 @@
1
1
  import { createContext, useContextSelector } from '@fluentui/react-context-selector';
2
2
  const tabListContextDefaultValue = {
3
- appearance: 'transparent',
4
- reserveSelectedTabSpace: true,
5
- disabled: false,
6
- selectedValue: undefined,
7
- onRegister: () => {
8
- /* noop */},
9
- onUnregister: () => {
10
- /* noop */},
11
- onSelect: () => {
12
- /* noop */},
13
- getRegisteredTabs: () => {
14
- return {
15
- registeredTabs: {}
16
- };
17
- },
18
- size: 'medium',
19
- vertical: false
3
+ appearance: 'transparent',
4
+ reserveSelectedTabSpace: true,
5
+ disabled: false,
6
+ selectedValue: undefined,
7
+ onRegister: ()=>{
8
+ /* noop */ },
9
+ onUnregister: ()=>{
10
+ /* noop */ },
11
+ onSelect: ()=>{
12
+ /* noop */ },
13
+ getRegisteredTabs: ()=>{
14
+ return {
15
+ registeredTabs: {}
16
+ };
17
+ },
18
+ size: 'medium',
19
+ vertical: false
20
20
  };
21
- export const TabListContext = /*#__PURE__*/createContext(undefined);
21
+ export const TabListContext = createContext(undefined);
22
22
  export const TabListProvider = TabListContext.Provider;
23
- export const useTabListContext_unstable = selector => useContextSelector(TabListContext, (ctx = tabListContextDefaultValue) => selector(ctx));
24
- //# sourceMappingURL=TabListContext.js.map
23
+ export const useTabListContext_unstable = (selector)=>useContextSelector(TabListContext, (ctx = tabListContextDefaultValue)=>selector(ctx));
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContextSelector","tabListContextDefaultValue","appearance","reserveSelectedTabSpace","disabled","selectedValue","undefined","onRegister","onUnregister","onSelect","getRegisteredTabs","registeredTabs","size","vertical","TabListContext","TabListProvider","Provider","useTabListContext_unstable","selector","ctx"],"sources":["../../../src/components/TabList/TabListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport { TabListContextValue } from './TabList.types';\n\nconst tabListContextDefaultValue: 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\nexport const TabListContext: Context<TabListContextValue> = createContext<TabListContextValue | undefined>(\n undefined,\n) as Context<TabListContextValue>;\n\nexport const TabListProvider = TabListContext.Provider;\nexport const useTabListContext_unstable = <T>(selector: ContextSelector<TabListContextValue, T>): T =>\n useContextSelector(TabListContext, (ctx = tabListContextDefaultValue) => selector(ctx));\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ;AAIlD,MAAMC,0BAAA,GAAkD;EACtDC,UAAA,EAAY;EACZC,uBAAA,EAAyB,IAAI;EAC7BC,QAAA,EAAU,KAAK;EACfC,aAAA,EAAeC,SAAA;EACfC,UAAA,EAAYA,CAAA,KAAM;IAChB,WACF;EACAC,YAAA,EAAcA,CAAA,KAAM;IAClB,WACF;EACAC,QAAA,EAAUA,CAAA,KAAM;IACd,WACF;EACAC,iBAAA,EAAmBA,CAAA,KAAM;IACvB,OAAO;MACLC,cAAA,EAAgB,CAAC;IACnB;EACF;EACAC,IAAA,EAAM;EACNC,QAAA,EAAU;AACZ;AAEA,OAAO,MAAMC,cAAA,gBAA+Cf,aAAA,CAC1DO,SAAA;AAGF,OAAO,MAAMS,eAAA,GAAkBD,cAAA,CAAeE,QAAQ;AACtD,OAAO,MAAMC,0BAAA,GAAiCC,QAAA,IAC5ClB,kBAAA,CAAmBc,cAAA,EAAgB,CAACK,GAAA,GAAMlB,0BAA0B,KAAKiB,QAAA,CAASC,GAAA"}
1
+ {"version":3,"sources":["TabListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport { TabListContextValue } from './TabList.types';\n\nconst tabListContextDefaultValue: 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\nexport const TabListContext: Context<TabListContextValue> = createContext<TabListContextValue | undefined>(\n undefined,\n) as Context<TabListContextValue>;\n\nexport const TabListProvider = TabListContext.Provider;\nexport const useTabListContext_unstable = <T>(selector: ContextSelector<TabListContextValue, T>): T =>\n useContextSelector(TabListContext, (ctx = tabListContextDefaultValue) => selector(ctx));\n"],"names":["createContext","useContextSelector","tabListContextDefaultValue","appearance","reserveSelectedTabSpace","disabled","selectedValue","undefined","onRegister","onUnregister","onSelect","getRegisteredTabs","registeredTabs","size","vertical","TabListContext","TabListProvider","Provider","useTabListContext_unstable","selector","ctx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAIrF,MAAMC,6BAAkD;IACtDC,YAAY;IACZC,yBAAyB,IAAI;IAC7BC,UAAU,KAAK;IACfC,eAAeC;IACfC,YAAY,IAAM;IAChB,QAAQ,GACV;IACAC,cAAc,IAAM;IAClB,QAAQ,GACV;IACAC,UAAU,IAAM;IACd,QAAQ,GACV;IACAC,mBAAmB,IAAM;QACvB,OAAO;YACLC,gBAAgB,CAAC;QACnB;IACF;IACAC,MAAM;IACNC,UAAU,KAAK;AACjB;AAEA,OAAO,MAAMC,iBAA+Cf,cAC1DO,WACgC;AAElC,OAAO,MAAMS,kBAAkBD,eAAeE,QAAQ,CAAC;AACvD,OAAO,MAAMC,6BAA6B,CAAIC,WAC5ClB,mBAAmBc,gBAAgB,CAACK,MAAMlB,0BAA0B,GAAKiB,SAASC,MAAM"}
@@ -5,4 +5,3 @@ export * from './renderTabList';
5
5
  export * from './useTabList';
6
6
  export * from './useTabListContextValues';
7
7
  export * from './useTabListStyles.styles';
8
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/TabList/index.ts"],"sourcesContent":["export * from './TabList';\nexport * from './TabList.types';\nexport * from './TabListContext';\nexport * from './renderTabList';\nexport * from './useTabList';\nexport * from './useTabListContextValues';\nexport * from './useTabListStyles.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './TabList';\nexport * from './TabList.types';\nexport * from './TabListContext';\nexport * from './renderTabList';\nexport * from './useTabList';\nexport * from './useTabListContextValues';\nexport * from './useTabListStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,eAAe;AAC7B,cAAc,4BAA4B;AAC1C,cAAc,4BAA4B"}
@@ -1,16 +1,11 @@
1
- /** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
1
+ /** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
2
2
  import { getSlotsNext } from '@fluentui/react-utilities';
3
3
  import { TabListProvider } from './TabListContext';
4
4
  /**
5
5
  * Render the final JSX of TabList
6
- */
7
- export const renderTabList_unstable = (state, contextValues) => {
8
- const {
9
- slots,
10
- slotProps
11
- } = getSlotsNext(state);
12
- return /*#__PURE__*/createElement(slots.root, slotProps.root, /*#__PURE__*/createElement(TabListProvider, {
13
- value: contextValues.tabList
14
- }, state.root.children));
6
+ */ export const renderTabList_unstable = (state, contextValues)=>{
7
+ const { slots , slotProps } = getSlotsNext(state);
8
+ return /*#__PURE__*/ createElement(slots.root, slotProps.root, /*#__PURE__*/ createElement(TabListProvider, {
9
+ value: contextValues.tabList
10
+ }, state.root.children));
15
11
  };
16
- //# sourceMappingURL=renderTabList.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createElement","getSlotsNext","TabListProvider","renderTabList_unstable","state","contextValues","slots","slotProps","root","value","tabList","children"],"sources":["../../../src/components/TabList/renderTabList.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { TabListState, TabListSlots, TabListContextValues } from './TabList.types';\nimport { TabListProvider } from './TabListContext';\n\n/**\n * Render the final JSX of TabList\n */\nexport const renderTabList_unstable = (state: TabListState, contextValues: TabListContextValues) => {\n const { slots, slotProps } = getSlotsNext<TabListSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <TabListProvider value={contextValues.tabList}>{state.root.children}</TabListProvider>\n </slots.root>\n );\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAC9B,SAASC,YAAY,QAAQ;AAE7B,SAASC,eAAe,QAAQ;AAEhC;;;AAGA,OAAO,MAAMC,sBAAA,GAAyBA,CAACC,KAAA,EAAqBC,aAAA,KAAwC;EAClG,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGN,YAAA,CAA2BG,KAAA;EAExD,oBACEJ,aAdJ,CAcKM,KAAA,CAAME,IAAI,EAAKD,SAAA,CAAUC,IAAI,eAC5BR,aAfN,CAeOE,eAAA;IAAgBO,KAAA,EAAOJ,aAAA,CAAcK;KAAUN,KAAA,CAAMI,IAAI,CAACG,QAAQ;AAGzE"}
1
+ {"version":3,"sources":["renderTabList.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { TabListState, TabListSlots, TabListContextValues } from './TabList.types';\nimport { TabListProvider } from './TabListContext';\n\n/**\n * Render the final JSX of TabList\n */\nexport const renderTabList_unstable = (state: TabListState, contextValues: TabListContextValues) => {\n const { slots, slotProps } = getSlotsNext<TabListSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <TabListProvider value={contextValues.tabList}>{state.root.children}</TabListProvider>\n </slots.root>\n );\n};\n"],"names":["createElement","getSlotsNext","TabListProvider","renderTabList_unstable","state","contextValues","slots","slotProps","root","value","tabList","children"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,YAAY,QAAQ,4BAA4B;AAEzD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAqBC,gBAAwC;IAClG,MAAM,EAAEC,MAAK,EAAEC,UAAS,EAAE,GAAGN,aAA2BG;IAExD,qBACE,AAdJ,cAcKE,MAAME,IAAI,EAAKD,UAAUC,IAAI,gBAC5B,AAfN,cAeON;QAAgBO,OAAOJ,cAAcK,OAAO;OAAGN,MAAMI,IAAI,CAACG,QAAQ;AAGzE,EAAE"}
@@ -9,76 +9,69 @@ import { getNativeElementProps, useControllableState, useEventCallback, useMerge
9
9
  *
10
10
  * @param props - props from this instance of TabList
11
11
  * @param ref - reference to root HTMLElement of TabList
12
- */
13
- export const useTabList_unstable = (props, ref) => {
14
- const {
15
- appearance = 'transparent',
16
- reserveSelectedTabSpace = true,
17
- disabled = false,
18
- onTabSelect,
19
- size = 'medium',
20
- vertical = false
21
- } = props;
22
- const innerRef = React.useRef(null);
23
- const focusAttributes = useArrowNavigationGroup({
24
- circular: true,
25
- axis: vertical ? 'vertical' : 'horizontal',
26
- memorizeCurrent: true
27
- });
28
- const [selectedValue, setSelectedValue] = useControllableState({
29
- state: props.selectedValue,
30
- defaultState: props.defaultSelectedValue,
31
- initialState: undefined
32
- });
33
- // considered usePrevious, but it is sensitive to re-renders
34
- // this could cause the previous to move to current in the case where the tab list re-renders.
35
- // these refs avoid getRegisteredTabs changing when selectedValue changes and causing
36
- // renders for tabs that have not changed.
37
- const currentSelectedValue = React.useRef(undefined);
38
- const previousSelectedValue = React.useRef(undefined);
39
- React.useEffect(() => {
40
- previousSelectedValue.current = currentSelectedValue.current;
41
- currentSelectedValue.current = selectedValue;
42
- }, [selectedValue]);
43
- const onSelect = useEventCallback((event, data) => {
44
- setSelectedValue(data.value);
45
- onTabSelect === null || onTabSelect === void 0 ? void 0 : onTabSelect(event, data);
46
- });
47
- const registeredTabs = React.useRef({});
48
- const onRegister = useEventCallback(data => {
49
- registeredTabs.current[JSON.stringify(data.value)] = data;
50
- });
51
- const onUnregister = useEventCallback(data => {
52
- delete registeredTabs.current[JSON.stringify(data.value)];
53
- });
54
- const getRegisteredTabs = React.useCallback(() => {
12
+ */ export const useTabList_unstable = (props, ref)=>{
13
+ const { appearance ='transparent' , reserveSelectedTabSpace =true , disabled =false , onTabSelect , size ='medium' , vertical =false } = props;
14
+ const innerRef = React.useRef(null);
15
+ const focusAttributes = useArrowNavigationGroup({
16
+ circular: true,
17
+ axis: vertical ? 'vertical' : 'horizontal',
18
+ memorizeCurrent: true
19
+ });
20
+ const [selectedValue, setSelectedValue] = useControllableState({
21
+ state: props.selectedValue,
22
+ defaultState: props.defaultSelectedValue,
23
+ initialState: undefined
24
+ });
25
+ // considered usePrevious, but it is sensitive to re-renders
26
+ // this could cause the previous to move to current in the case where the tab list re-renders.
27
+ // these refs avoid getRegisteredTabs changing when selectedValue changes and causing
28
+ // renders for tabs that have not changed.
29
+ const currentSelectedValue = React.useRef(undefined);
30
+ const previousSelectedValue = React.useRef(undefined);
31
+ React.useEffect(()=>{
32
+ previousSelectedValue.current = currentSelectedValue.current;
33
+ currentSelectedValue.current = selectedValue;
34
+ }, [
35
+ selectedValue
36
+ ]);
37
+ const onSelect = useEventCallback((event, data)=>{
38
+ setSelectedValue(data.value);
39
+ onTabSelect === null || onTabSelect === void 0 ? void 0 : onTabSelect(event, data);
40
+ });
41
+ const registeredTabs = React.useRef({});
42
+ const onRegister = useEventCallback((data)=>{
43
+ registeredTabs.current[JSON.stringify(data.value)] = data;
44
+ });
45
+ const onUnregister = useEventCallback((data)=>{
46
+ delete registeredTabs.current[JSON.stringify(data.value)];
47
+ });
48
+ const getRegisteredTabs = React.useCallback(()=>{
49
+ return {
50
+ selectedValue: currentSelectedValue.current,
51
+ previousSelectedValue: previousSelectedValue.current,
52
+ registeredTabs: registeredTabs.current
53
+ };
54
+ }, []);
55
55
  return {
56
- selectedValue: currentSelectedValue.current,
57
- previousSelectedValue: previousSelectedValue.current,
58
- registeredTabs: registeredTabs.current
56
+ components: {
57
+ root: 'div'
58
+ },
59
+ root: getNativeElementProps('div', {
60
+ ref: useMergedRefs(ref, innerRef),
61
+ role: 'tablist',
62
+ 'aria-orientation': vertical ? 'vertical' : 'horizontal',
63
+ ...focusAttributes,
64
+ ...props
65
+ }),
66
+ appearance,
67
+ reserveSelectedTabSpace,
68
+ disabled,
69
+ selectedValue,
70
+ size,
71
+ vertical,
72
+ onRegister,
73
+ onUnregister,
74
+ onSelect,
75
+ getRegisteredTabs
59
76
  };
60
- }, []);
61
- return {
62
- components: {
63
- root: 'div'
64
- },
65
- root: getNativeElementProps('div', {
66
- ref: useMergedRefs(ref, innerRef),
67
- role: 'tablist',
68
- 'aria-orientation': vertical ? 'vertical' : 'horizontal',
69
- ...focusAttributes,
70
- ...props
71
- }),
72
- appearance,
73
- reserveSelectedTabSpace,
74
- disabled,
75
- selectedValue,
76
- size,
77
- vertical,
78
- onRegister,
79
- onUnregister,
80
- onSelect,
81
- getRegisteredTabs
82
- };
83
77
  };
84
- //# sourceMappingURL=useTabList.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useArrowNavigationGroup","getNativeElementProps","useControllableState","useEventCallback","useMergedRefs","useTabList_unstable","props","ref","appearance","reserveSelectedTabSpace","disabled","onTabSelect","size","vertical","innerRef","useRef","focusAttributes","circular","axis","memorizeCurrent","selectedValue","setSelectedValue","state","defaultState","defaultSelectedValue","initialState","undefined","currentSelectedValue","previousSelectedValue","useEffect","current","onSelect","event","data","value","registeredTabs","onRegister","JSON","stringify","onUnregister","getRegisteredTabs","useCallback","components","root","role"],"sources":["../../../src/components/TabList/useTabList.ts"],"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 'aria-orientation': vertical ? 'vertical' : 'horizontal',\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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SACEC,qBAAqB,EACrBC,oBAAoB,EACpBC,gBAAgB,EAChBC,aAAa,QACR;AAIP;;;;;;;;;AASA,OAAO,MAAMC,mBAAA,GAAsBA,CAACC,KAAA,EAAqBC,GAAA,KAA8C;EACrG,MAAM;IACJC,UAAA,GAAa;IACbC,uBAAA,GAA0B,IAAI;IAC9BC,QAAA,GAAW,KAAK;IAChBC,WAAA;IACAC,IAAA,GAAO;IACPC,QAAA,GAAW;EAAK,CACjB,GAAGP,KAAA;EAEJ,MAAMQ,QAAA,GAAWf,KAAA,CAAMgB,MAAM,CAAc,IAAI;EAE/C,MAAMC,eAAA,GAAkBhB,uBAAA,CAAwB;IAC9CiB,QAAA,EAAU,IAAI;IACdC,IAAA,EAAML,QAAA,GAAW,aAAa,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MAC3CF,qBAAA,EAAuBA,qBAAA,CAAsBE,OAAO;MACpDK,cAAA,EAAgBA,cAAA,CAAeL;IACjC;EACF,GAAG,EAAE;EAEL,OAAO;IACLY,UAAA,EAAY;MACVC,IAAA,EAAM;IACR;IACAA,IAAA,EAAM1C,qBAAA,CAAsB,OAAO;MACjCM,GAAA,EAAKH,aAAA,CAAcG,GAAA,EAAKO,QAAA;MACxB8B,IAAA,EAAM;MACN,oBAAoB/B,QAAA,GAAW,aAAa,YAAY;MACxD,GAAGG,eAAe;MAClB,GAAGV;IACL;IACAE,UAAA;IACAC,uBAAA;IACAC,QAAA;IACAU,aAAA;IACAR,IAAA;IACAC,QAAA;IACAuB,UAAA;IACAG,YAAA;IACAR,QAAA;IACAS;EACF;AACF"}
1
+ {"version":3,"sources":["useTabList.ts"],"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 'aria-orientation': vertical ? 'vertical' : 'horizontal',\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"],"names":["React","useArrowNavigationGroup","getNativeElementProps","useControllableState","useEventCallback","useMergedRefs","useTabList_unstable","props","ref","appearance","reserveSelectedTabSpace","disabled","onTabSelect","size","vertical","innerRef","useRef","focusAttributes","circular","axis","memorizeCurrent","selectedValue","setSelectedValue","state","defaultState","defaultSelectedValue","initialState","undefined","currentSelectedValue","previousSelectedValue","useEffect","current","onSelect","event","data","value","registeredTabs","onRegister","JSON","stringify","onUnregister","getRegisteredTabs","useCallback","components","root","role"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SA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GAAGD;IACvD;IAEA,MAAMM,eAAepC,iBAAiB,CAAC8B,OAA0B;QAC/D,OAAOE,eAAeL,OAAO,CAACO,KAAKC,SAAS,CAACL,KAAKC,KAAK,EAAE;IAC3D;IAEA,MAAMM,oBAAoBzC,MAAM0C,WAAW,CAAC,IAAM;QAChD,OAAO;YACLrB,eAAeO,qBAAqBG,OAAO;YAC3CF,uBAAuBA,sBAAsBE,OAAO;YACpDK,gBAAgBA,eAAeL,OAAO;QACxC;IACF,GAAG,EAAE;IAEL,OAAO;QACLY,YAAY;YACVC,MAAM;QACR;QACAA,MAAM1C,sBAAsB,OAAO;YACjCM,KAAKH,cAAcG,KAAKO;YACxB8B,MAAM;YACN,oBAAoB/B,WAAW,aAAa,YAAY;YACxD,GAAGG,eAAe;YAClB,GAAGV,KAAK;QACV;QACAE;QACAC;QACAC;QACAU;QACAR;QACAC;QACAuB;QACAG;QACAR;QACAS;IACF;AACF,EAAE"}
@@ -1,30 +1,18 @@
1
1
  export function useTabListContextValues_unstable(state) {
2
- const {
3
- appearance,
4
- reserveSelectedTabSpace,
5
- disabled,
6
- selectedValue: selectedKey,
7
- onRegister,
8
- onUnregister,
9
- onSelect,
10
- getRegisteredTabs,
11
- size,
12
- vertical
13
- } = state;
14
- const tabList = {
15
- appearance,
16
- reserveSelectedTabSpace,
17
- disabled,
18
- selectedValue: selectedKey,
19
- onSelect,
20
- onRegister,
21
- onUnregister,
22
- getRegisteredTabs,
23
- size,
24
- vertical
25
- };
26
- return {
27
- tabList
28
- };
2
+ const { appearance , reserveSelectedTabSpace , disabled , selectedValue: selectedKey , onRegister , onUnregister , onSelect , getRegisteredTabs , size , vertical } = state;
3
+ const tabList = {
4
+ appearance,
5
+ reserveSelectedTabSpace,
6
+ disabled,
7
+ selectedValue: selectedKey,
8
+ onSelect,
9
+ onRegister,
10
+ onUnregister,
11
+ getRegisteredTabs,
12
+ size,
13
+ vertical
14
+ };
15
+ return {
16
+ tabList
17
+ };
29
18
  }
30
- //# sourceMappingURL=useTabListContextValues.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useTabListContextValues_unstable","state","appearance","reserveSelectedTabSpace","disabled","selectedValue","selectedKey","onRegister","onUnregister","onSelect","getRegisteredTabs","size","vertical","tabList"],"sources":["../../../src/components/TabList/useTabListContextValues.tsx"],"sourcesContent":["import { TabListContextValue, TabListContextValues, TabListState } from './TabList.types';\n\nexport function useTabListContextValues_unstable(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"],"mappings":"AAEA,OAAO,SAASA,iCAAiCC,KAAmB,EAAwB;EAC1F,MAAM;IACJC,UAAA;IACAC,uBAAA;IACAC,QAAA;IACAC,aAAA,EAAeC,WAAA;IACfC,UAAA;IACAC,YAAA;IACAC,QAAA;IACAC,iBAAA;IACAC,IAAA;IACAC;EAAQ,CACT,GAAGX,KAAA;EAEJ,MAAMY,OAAA,GAA+B;IACnCX,UAAA;IACAC,uBAAA;IACAC,QAAA;IACAC,aAAA,EAAeC,WAAA;IACfG,QAAA;IACAF,UAAA;IACAC,YAAA;IACAE,iBAAA;IACAC,IAAA;IACAC;EACF;EAEA,OAAO;IAAEC;EAAQ;AACnB"}
1
+ {"version":3,"sources":["useTabListContextValues.tsx"],"sourcesContent":["import { TabListContextValue, TabListContextValues, TabListState } from './TabList.types';\n\nexport function useTabListContextValues_unstable(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"],"names":["useTabListContextValues_unstable","state","appearance","reserveSelectedTabSpace","disabled","selectedValue","selectedKey","onRegister","onUnregister","onSelect","getRegisteredTabs","size","vertical","tabList"],"mappings":"AAEA,OAAO,SAASA,iCAAiCC,KAAmB,EAAwB;IAC1F,MAAM,EACJC,WAAU,EACVC,wBAAuB,EACvBC,SAAQ,EACRC,eAAeC,YAAW,EAC1BC,WAAU,EACVC,aAAY,EACZC,SAAQ,EACRC,kBAAiB,EACjBC,KAAI,EACJC,SAAQ,EACT,GAAGX;IAEJ,MAAMY,UAA+B;QACnCX;QACAC;QACAC;QACAC,eAAeC;QACfG;QACAF;QACAC;QACAE;QACAC;QACAC;IACF;IAEA,OAAO;QAAEC;IAAQ;AACnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","tabListClassNames","root","useStyles","mc9l5x","Beiy3e4","Bnnss6s","Eh141a","qhf8xq","horizontal","Bt984gj","vertical","d","useTabListStyles_unstable","state","styles","className"],"sources":["../../../src/components/TabList/useTabListStyles.styles.ts"],"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"],"mappings":"AACA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ;AAGzC,OAAO,MAAMC,iBAAA,GAAkD;EAC7DC,IAAA,EAAM;AACR;AAEA;;;AAGA,MAAMC,SAAA,gBAAYJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAC,OAAA;IAAAL,OAAA;EAAA;EAAAM,QAAA;IAAAD,OAAA;IAAAL,OAAA;EAAA;AAAA;EAAAO,CAAA;AAAA,EAgBlB;AAEA;;;AAGA,OAAO,MAAMC,yBAAA,GAA6BC,KAAA,IAAsC;EAC9E,MAAM;IAAEH;EAAQ,CAAE,GAAGG,KAAA;EAErB,MAAMC,MAAA,GAASZ,SAAA;EAEfW,KAAA,CAAMZ,IAAI,CAACc,SAAS,GAAGhB,YAAA,CACrBC,iBAAA,CAAkBC,IAAI,EACtBa,MAAA,CAAOb,IAAI,EACXS,QAAA,GAAWI,MAAA,CAAOJ,QAAQ,GAAGI,MAAA,CAAON,UAAU,EAC9CK,KAAA,CAAMZ,IAAI,CAACc,SAAS;EAGtB,OAAOF,KAAA;AACT"}
1
+ {"version":3,"names":["__styles","mergeClasses","tabListClassNames","root","useStyles","mc9l5x","Beiy3e4","Bnnss6s","Eh141a","qhf8xq","horizontal","Bt984gj","vertical","d","useTabListStyles_unstable","state","styles","className"],"sources":["useTabListStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nexport const tabListClassNames = {\n root: 'fui-TabList'\n};\n/**\n * Styles for the root slot\n */ const 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 * Apply styling to the TabList slots based on the state\n */ export const useTabListStyles_unstable = (state)=>{\n const { vertical } = state;\n const styles = useStyles();\n state.root.className = mergeClasses(tabListClassNames.root, styles.root, vertical ? styles.vertical : styles.horizontal, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAC,OAAA;IAAAL,OAAA;EAAA;EAAAM,QAAA;IAAAD,OAAA;IAAAL,OAAA;EAAA;AAAA;EAAAO,CAAA;AAAA,CAgBrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,yBAAyB,GAAIC,KAAK,IAAG;EAClD,MAAM;IAAEH;EAAU,CAAC,GAAGG,KAAK;EAC3B,MAAMC,MAAM,GAAGZ,SAAS,CAAC,CAAC;EAC1BW,KAAK,CAACZ,IAAI,CAACc,SAAS,GAAGhB,YAAY,CAACC,iBAAiB,CAACC,IAAI,EAAEa,MAAM,CAACb,IAAI,EAAES,QAAQ,GAAGI,MAAM,CAACJ,QAAQ,GAAGI,MAAM,CAACN,UAAU,EAAEK,KAAK,CAACZ,IAAI,CAACc,SAAS,CAAC;EAC9I,OAAOF,KAAK;AAChB,CAAC"}
package/lib/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export { renderTab_unstable, Tab, tabClassNames, useTabStyles_unstable, useTab_unstable } from './Tab';
2
2
  export { renderTabList_unstable, TabList, TabListProvider, tabListClassNames, useTabListContext_unstable, useTabListContextValues_unstable, useTabListStyles_unstable, useTabList_unstable } from './TabList';
3
- //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["renderTab_unstable","Tab","tabClassNames","useTabStyles_unstable","useTab_unstable","renderTabList_unstable","TabList","TabListProvider","tabListClassNames","useTabListContext_unstable","useTabListContextValues_unstable","useTabListStyles_unstable","useTabList_unstable"],"sources":["../src/index.ts"],"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 TabListProvider,\n tabListClassNames,\n useTabListContext_unstable,\n useTabListContextValues_unstable,\n useTabListStyles_unstable,\n useTabList_unstable,\n} from './TabList';\n"],"mappings":"AACA,SAASA,kBAAkB,EAAEC,GAAG,EAAEC,aAAa,EAAEC,qBAAqB,EAAEC,eAAe,QAAQ;AAa/F,SACEC,sBAAsB,EACtBC,OAAO,EACPC,eAAe,EACfC,iBAAiB,EACjBC,0BAA0B,EAC1BC,gCAAgC,EAChCC,yBAAyB,EACzBC,mBAAmB,QACd"}
1
+ {"version":3,"sources":["index.ts"],"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 TabListProvider,\n tabListClassNames,\n useTabListContext_unstable,\n useTabListContextValues_unstable,\n useTabListStyles_unstable,\n useTabList_unstable,\n} from './TabList';\n"],"names":["renderTab_unstable","Tab","tabClassNames","useTabStyles_unstable","useTab_unstable","renderTabList_unstable","TabList","TabListProvider","tabListClassNames","useTabListContext_unstable","useTabListContextValues_unstable","useTabListStyles_unstable","useTabList_unstable"],"mappings":"AACA,SAASA,kBAAkB,EAAEC,GAAG,EAAEC,aAAa,EAAEC,qBAAqB,EAAEC,eAAe,QAAQ,QAAQ;AAavG,SACEC,sBAAsB,EACtBC,OAAO,EACPC,eAAe,EACfC,iBAAiB,EACjBC,0BAA0B,EAC1BC,gCAAgC,EAChCC,yBAAyB,EACzBC,mBAAmB,QACd,YAAY"}
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
6
  _exportStar(require("./components/Tab/index"), exports);
7
- //# sourceMappingURL=Tab.js.map
8
-
9
- //# sourceMappingURL=Tab.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/Tab.js"],"sourcesContent":["export * from './components/Tab/index';\n//# sourceMappingURL=Tab.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,+BAA+B"}
1
+ {"version":3,"sources":["Tab.js"],"sourcesContent":["export * from './components/Tab/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
6
  _exportStar(require("./components/TabList/index"), exports);
7
- //# sourceMappingURL=TabList.js.map
8
-
9
- //# sourceMappingURL=TabList.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/TabList.js"],"sourcesContent":["export * from './components/TabList/index';\n//# sourceMappingURL=TabList.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,mCAAmC"}
1
+ {"version":3,"sources":["TabList.js"],"sourcesContent":["export * from './components/TabList/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
@@ -18,6 +18,4 @@ const Tab = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
18
  (0, _reactSharedContexts.useCustomStyleHook_unstable)('useTabStyles_unstable')(state);
19
19
  return (0, _renderTab.renderTab_unstable)(state);
20
20
  });
21
- Tab.displayName = 'Tab'; //# sourceMappingURL=Tab.js.map
22
-
23
- //# sourceMappingURL=Tab.js.map
21
+ Tab.displayName = 'Tab';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/Tab/Tab.js"],"sourcesContent":["import * as React from 'react';\nimport { useTab_unstable } from './useTab';\nimport { renderTab_unstable } from './renderTab';\nimport { useTabStyles_unstable } from './useTabStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * A tab provides a selectable item in a tab list.\n */\nexport const Tab = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useTab_unstable(props, ref);\n useTabStyles_unstable(state);\n useCustomStyleHook_unstable('useTabStyles_unstable')(state);\n return renderTab_unstable(state);\n});\nTab.displayName = 'Tab';\n//# sourceMappingURL=Tab.js.map"],"names":["Tab","React","forwardRef","props","ref","state","useTab_unstable","useTabStyles_unstable","useCustomStyleHook_unstable","renderTab_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;wBACS;2BACG;oCACG;qCACM;AAIrC,MAAMA,MAAM,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC/D,MAAMC,QAAQC,IAAAA,uBAAe,EAACH,OAAOC;IACrCG,IAAAA,yCAAqB,EAACF;IACtBG,IAAAA,gDAA2B,EAAC,yBAAyBH;IACrD,OAAOI,IAAAA,6BAAkB,EAACJ;AAC5B;AACAL,IAAIU,WAAW,GAAG,OAClB,+BAA+B"}
1
+ {"version":3,"sources":["Tab.js"],"sourcesContent":["import * as React from 'react';\nimport { useTab_unstable } from './useTab';\nimport { renderTab_unstable } from './renderTab';\nimport { useTabStyles_unstable } from './useTabStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * A tab provides a selectable item in a tab list.\n */ export const Tab = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useTab_unstable(props, ref);\n useTabStyles_unstable(state);\n useCustomStyleHook_unstable('useTabStyles_unstable')(state);\n return renderTab_unstable(state);\n});\nTab.displayName = 'Tab';\n"],"names":["Tab","React","forwardRef","props","ref","state","useTab_unstable","useTabStyles_unstable","useCustomStyleHook_unstable","renderTab_unstable","displayName"],"mappings":";;;;+BAOiBA;;aAAAA;;;6DAPM;wBACS;2BACG;oCACG;qCACM;AAGjC,MAAMA,MAAM,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IAChE,MAAMC,QAAQC,IAAAA,uBAAe,EAACH,OAAOC;IACrCG,IAAAA,yCAAqB,EAACF;IACtBG,IAAAA,gDAA2B,EAAC,yBAAyBH;IACrD,OAAOI,IAAAA,6BAAkB,EAACJ;AAC9B;AACAL,IAAIU,WAAW,GAAG"}
@@ -2,6 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- //# sourceMappingURL=Tab.types.js.map
6
-
7
- //# sourceMappingURL=Tab.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/Tab/Tab.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Tab.types.js.map"],"names":[],"mappings":";;;;CACA,qCAAqC"}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -9,6 +9,3 @@ _exportStar(require("./renderTab"), exports);
9
9
  _exportStar(require("./useTab"), exports);
10
10
  _exportStar(require("./useTabStyles.styles"), exports);
11
11
  _exportStar(require("./useTabAnimatedIndicator.styles"), exports);
12
- //# sourceMappingURL=index.js.map
13
-
14
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/Tab/index.js"],"sourcesContent":["export * from './Tab';\nexport * from './Tab.types';\nexport * from './renderTab';\nexport * from './useTab';\nexport * from './useTabStyles.styles';\nexport * from './useTabAnimatedIndicator.styles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Tab';\nexport * from './Tab.types';\nexport * from './renderTab';\nexport * from './useTab';\nexport * from './useTabStyles.styles';\nexport * from './useTabAnimatedIndicator.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA"}
@@ -14,6 +14,4 @@ const renderTab_unstable = (state)=>{
14
14
  ...slotProps.content,
15
15
  className: state.contentReservedSpaceClassName
16
16
  }));
17
- }; //# sourceMappingURL=renderTab.js.map
18
-
19
- //# sourceMappingURL=renderTab.js.map
17
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/Tab/renderTab.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Tab\n */\nexport const renderTab_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlotsNext(state);\n return /*#__PURE__*/createElement(slots.root, slotProps.root, slots.icon && /*#__PURE__*/createElement(slots.icon, slotProps.icon), !state.iconOnly && /*#__PURE__*/createElement(slots.content, slotProps.content), !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && /*#__PURE__*/createElement(slots.content, {\n ...slotProps.content,\n className: state.contentReservedSpaceClassName\n }));\n};\n//# sourceMappingURL=renderTab.js.map"],"names":["renderTab_unstable","state","slots","slotProps","getSlotsNext","createElement","root","icon","iconOnly","content","selected","contentReservedSpaceClassName","undefined","className"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAKrCA;;aAAAA;;iCALqE;gCACrD;AAItB,MAAMA,qBAAqBC,CAAAA,QAAS;IACzC,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,4BAAY,EAACH;IACjB,OAAO,WAAW,GAAEI,IAAAA,8BAAa,EAACH,MAAMI,IAAI,EAAEH,UAAUG,IAAI,EAAEJ,MAAMK,IAAI,IAAI,WAAW,GAAEF,IAAAA,8BAAa,EAACH,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,GAAG,CAACN,MAAMO,QAAQ,IAAI,WAAW,GAAEH,IAAAA,8BAAa,EAACH,MAAMO,OAAO,EAAEN,UAAUM,OAAO,GAAG,CAACR,MAAMS,QAAQ,IAAI,CAACT,MAAMO,QAAQ,IAAIP,MAAMU,6BAA6B,KAAKC,aAAa,WAAW,GAAEP,IAAAA,8BAAa,EAACH,MAAMO,OAAO,EAAE;QACxV,GAAGN,UAAUM,OAAO;QACpBI,WAAWZ,MAAMU,6BAA6B;IAChD;AACF,GACA,qCAAqC"}
1
+ {"version":3,"sources":["renderTab.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Tab\n */ export const renderTab_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(slots.root, slotProps.root, slots.icon && /*#__PURE__*/ createElement(slots.icon, slotProps.icon), !state.iconOnly && /*#__PURE__*/ createElement(slots.content, slotProps.content), !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && /*#__PURE__*/ createElement(slots.content, {\n ...slotProps.content,\n className: state.contentReservedSpaceClassName\n }));\n};\n"],"names":["renderTab_unstable","state","slots","slotProps","getSlotsNext","createElement","root","icon","iconOnly","content","selected","contentReservedSpaceClassName","undefined","className"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAIjCA;;aAAAA;;iCAJkE;gCACtD;AAGlB,MAAMA,qBAAqB,CAACC,QAAQ;IAC3C,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACH,MAAMI,IAAI,EAAEH,UAAUG,IAAI,EAAEJ,MAAMK,IAAI,IAAI,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,GAAG,CAACN,MAAMO,QAAQ,IAAI,WAAW,GAAGH,IAAAA,8BAAa,EAACH,MAAMO,OAAO,EAAEN,UAAUM,OAAO,GAAG,CAACR,MAAMS,QAAQ,IAAI,CAACT,MAAMO,QAAQ,IAAIP,MAAMU,6BAA6B,KAAKC,aAAa,WAAW,GAAGP,IAAAA,8BAAa,EAACH,MAAMO,OAAO,EAAE;QAC1V,GAAGN,UAAUM,OAAO;QACpBI,WAAWZ,MAAMU,6BAA6B;IAClD;AACJ"}
@@ -78,6 +78,4 @@ const useTab_unstable = (props, ref)=>{
78
78
  value,
79
79
  vertical
80
80
  };
81
- }; //# sourceMappingURL=useTab.js.map
82
-
83
- //# sourceMappingURL=useTab.js.map
81
+ };
@@ -1 +1 @@
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,E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AU,IAAI;QACdC,cAAc;YACZC,UAAUjC,MAAMiC,QAAQ;QAC1B;IACF;IACA,OAAO;QACLC,YAAY;YACVC,MAAM;YACN9B,MAAM;YACNH,SAAS;QACX;QACAiC,MAAMC,IAAAA,qCAAqB,EAAC,UAAU;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"}
1
+ {"version":3,"sources":["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 */ export const useTab_unstable = (props, ref)=>{\n const { content , disabled: tabDisabled = false , icon , onClick , value } = 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 }, [\n onRegister,\n onUnregister,\n innerRef,\n value\n ]);\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"],"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":";;;;+BAWiBA;;aAAAA;;;6DAXM;gCACkF;gCAC9D;AAShC,M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IAAAA,gCAAgB,EAAC3B,SAAS;QAC/C6B,UAAU,IAAI;QACdC,cAAc;YACVC,UAAUjC,MAAMiC,QAAQ;QAC5B;IACJ;IACA,OAAO;QACHC,YAAY;YACRC,MAAM;YACN9B,MAAM;YACNH,SAAS;QACb;QACAiC,MAAMC,IAAAA,qCAAqB,EAAC,UAAU;YAClCnC,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;QACb;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;IACJ;AACJ"}
@@ -145,5 +145,3 @@ const useTabAnimatedIndicatorStyles_unstable = (state)=>{
145
145
  };
146
146
  return state;
147
147
  }; //# sourceMappingURL=useTabAnimatedIndicator.styles.js.map
148
-
149
- //# sourceMappingURL=useTabAnimatedIndicator.styles.js.map