@fluentui/react-tabs 1.0.0-beta.99 → 9.0.0-beta.6

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 (223) hide show
  1. package/CHANGELOG.json +51 -1912
  2. package/CHANGELOG.md +17 -763
  3. package/README.md +0 -17
  4. package/Spec.md +433 -0
  5. package/dist/react-tabs.d.ts +171 -137
  6. package/lib/Tab.d.ts +1 -0
  7. package/lib/Tab.js +2 -0
  8. package/lib/Tab.js.map +1 -0
  9. package/lib/TabList.d.ts +1 -0
  10. package/lib/TabList.js +2 -0
  11. package/lib/TabList.js.map +1 -0
  12. package/lib/components/Tab/Tab.d.ts +6 -0
  13. package/lib/components/Tab/Tab.js +15 -0
  14. package/lib/components/Tab/Tab.js.map +1 -0
  15. package/lib/components/Tab/Tab.types.d.ts +52 -0
  16. package/lib/components/Tab/Tab.types.js +2 -0
  17. package/lib/components/Tab/Tab.types.js.map +1 -0
  18. package/lib/components/Tab/index.d.ts +5 -0
  19. package/lib/components/Tab/index.js +6 -0
  20. package/lib/components/Tab/index.js.map +1 -0
  21. package/lib/components/Tab/renderTab.d.ts +5 -0
  22. package/lib/components/Tab/renderTab.js +18 -0
  23. package/lib/components/Tab/renderTab.js.map +1 -0
  24. package/lib/components/Tab/useTab.d.ts +12 -0
  25. package/lib/components/Tab/useTab.js +82 -0
  26. package/lib/components/Tab/useTab.js.map +1 -0
  27. package/lib/components/Tab/useTabStyles.d.ts +6 -0
  28. package/lib/components/Tab/useTabStyles.js +205 -0
  29. package/lib/components/Tab/useTabStyles.js.map +1 -0
  30. package/lib/components/TabList/TabList.d.ts +6 -0
  31. package/lib/components/TabList/TabList.js +17 -0
  32. package/lib/components/TabList/TabList.js.map +1 -0
  33. package/lib/components/TabList/TabList.types.d.ts +99 -0
  34. package/lib/components/TabList/TabList.types.js +2 -0
  35. package/lib/components/TabList/TabList.types.js.map +1 -0
  36. package/lib/components/TabList/TabListContext.d.ts +3 -0
  37. package/lib/components/TabList/TabListContext.js +17 -0
  38. package/lib/components/TabList/TabListContext.js.map +1 -0
  39. package/lib/components/TabList/index.d.ts +5 -0
  40. package/lib/components/TabList/index.js +6 -0
  41. package/lib/components/TabList/index.js.map +1 -0
  42. package/lib/components/TabList/renderTabList.d.ts +5 -0
  43. package/lib/components/TabList/renderTabList.js +19 -0
  44. package/lib/components/TabList/renderTabList.js.map +1 -0
  45. package/lib/components/TabList/useTabList.d.ts +12 -0
  46. package/lib/components/TabList/useTabList.js +106 -0
  47. package/lib/components/TabList/useTabList.js.map +1 -0
  48. package/lib/components/TabList/useTabListContextValues.d.ts +2 -0
  49. package/lib/components/TabList/useTabListContextValues.js +24 -0
  50. package/lib/components/TabList/useTabListContextValues.js.map +1 -0
  51. package/lib/components/TabList/useTabListStyles.d.ts +9 -0
  52. package/lib/components/TabList/useTabListStyles.js +118 -0
  53. package/lib/components/TabList/useTabListStyles.js.map +1 -0
  54. package/lib/index.d.ts +2 -1
  55. package/lib/index.js +2 -1
  56. package/lib/index.js.map +1 -1
  57. package/lib/tab.constants.d.ts +15 -0
  58. package/lib/tab.constants.js +17 -0
  59. package/lib/tab.constants.js.map +1 -0
  60. package/lib/tsdoc-metadata.json +1 -1
  61. package/lib-commonjs/Tab.d.ts +1 -0
  62. package/lib-commonjs/Tab.js +10 -0
  63. package/lib-commonjs/Tab.js.map +1 -0
  64. package/lib-commonjs/TabList.d.ts +1 -0
  65. package/lib-commonjs/TabList.js +10 -0
  66. package/lib-commonjs/TabList.js.map +1 -0
  67. package/lib-commonjs/components/Tab/Tab.d.ts +6 -0
  68. package/lib-commonjs/components/Tab/Tab.js +26 -0
  69. package/lib-commonjs/components/Tab/Tab.js.map +1 -0
  70. package/lib-commonjs/components/Tab/Tab.types.d.ts +52 -0
  71. package/lib-commonjs/components/Tab/Tab.types.js +6 -0
  72. package/lib-commonjs/components/Tab/Tab.types.js.map +1 -0
  73. package/lib-commonjs/components/Tab/index.d.ts +5 -0
  74. package/lib-commonjs/components/Tab/index.js +18 -0
  75. package/lib-commonjs/components/Tab/index.js.map +1 -0
  76. package/lib-commonjs/components/Tab/renderTab.d.ts +5 -0
  77. package/lib-commonjs/components/Tab/renderTab.js +29 -0
  78. package/lib-commonjs/components/Tab/renderTab.js.map +1 -0
  79. package/lib-commonjs/components/Tab/useTab.d.ts +12 -0
  80. package/lib-commonjs/components/Tab/useTab.js +95 -0
  81. package/lib-commonjs/components/Tab/useTab.js.map +1 -0
  82. package/lib-commonjs/components/Tab/useTabStyles.d.ts +6 -0
  83. package/lib-commonjs/components/Tab/useTabStyles.js +218 -0
  84. package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -0
  85. package/lib-commonjs/components/TabList/TabList.d.ts +6 -0
  86. package/lib-commonjs/components/TabList/TabList.js +29 -0
  87. package/lib-commonjs/components/TabList/TabList.js.map +1 -0
  88. package/lib-commonjs/components/TabList/TabList.types.d.ts +99 -0
  89. package/lib-commonjs/components/TabList/TabList.types.js +6 -0
  90. package/lib-commonjs/components/TabList/TabList.types.js.map +1 -0
  91. package/lib-commonjs/components/TabList/TabListContext.d.ts +3 -0
  92. package/lib-commonjs/components/TabList/TabListContext.js +25 -0
  93. package/lib-commonjs/components/TabList/TabListContext.js.map +1 -0
  94. package/lib-commonjs/components/TabList/index.d.ts +5 -0
  95. package/lib-commonjs/components/TabList/index.js +18 -0
  96. package/lib-commonjs/components/TabList/index.js.map +1 -0
  97. package/lib-commonjs/components/TabList/renderTabList.d.ts +5 -0
  98. package/lib-commonjs/components/TabList/renderTabList.js +31 -0
  99. package/lib-commonjs/components/TabList/renderTabList.js.map +1 -0
  100. package/lib-commonjs/components/TabList/useTabList.d.ts +12 -0
  101. package/lib-commonjs/components/TabList/useTabList.js +118 -0
  102. package/lib-commonjs/components/TabList/useTabList.js.map +1 -0
  103. package/lib-commonjs/components/TabList/useTabListContextValues.d.ts +2 -0
  104. package/lib-commonjs/components/TabList/useTabListContextValues.js +33 -0
  105. package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -0
  106. package/lib-commonjs/components/TabList/useTabListStyles.d.ts +9 -0
  107. package/lib-commonjs/components/TabList/useTabListStyles.js +131 -0
  108. package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -0
  109. package/lib-commonjs/index.d.ts +2 -1
  110. package/lib-commonjs/index.js +10 -3
  111. package/lib-commonjs/index.js.map +1 -1
  112. package/lib-commonjs/tab.constants.d.ts +15 -0
  113. package/lib-commonjs/tab.constants.js +23 -0
  114. package/lib-commonjs/tab.constants.js.map +1 -0
  115. package/package.json +18 -13
  116. package/config/api-extractor.json +0 -3
  117. package/config/tests.js +0 -14
  118. package/etc/react-tabs.api.md +0 -104
  119. package/just.config.ts +0 -3
  120. package/lib/Tabs.d.ts +0 -1
  121. package/lib/Tabs.js +0 -2
  122. package/lib/Tabs.js.map +0 -1
  123. package/lib/common/isConformant.d.ts +0 -4
  124. package/lib/common/isConformant.js +0 -9
  125. package/lib/common/isConformant.js.map +0 -1
  126. package/lib/components/Tabs/TabItem.d.ts +0 -6
  127. package/lib/components/Tabs/TabItem.js +0 -18
  128. package/lib/components/Tabs/TabItem.js.map +0 -1
  129. package/lib/components/Tabs/TabItem.types.d.ts +0 -61
  130. package/lib/components/Tabs/TabItem.types.js +0 -2
  131. package/lib/components/Tabs/TabItem.types.js.map +0 -1
  132. package/lib/components/Tabs/Tabs.base.d.ts +0 -3
  133. package/lib/components/Tabs/Tabs.base.js +0 -179
  134. package/lib/components/Tabs/Tabs.base.js.map +0 -1
  135. package/lib/components/Tabs/Tabs.d.ts +0 -8
  136. package/lib/components/Tabs/Tabs.js +0 -12
  137. package/lib/components/Tabs/Tabs.js.map +0 -1
  138. package/lib/components/Tabs/Tabs.styles.d.ts +0 -2
  139. package/lib/components/Tabs/Tabs.styles.js +0 -264
  140. package/lib/components/Tabs/Tabs.styles.js.map +0 -1
  141. package/lib/components/Tabs/Tabs.types.d.ts +0 -113
  142. package/lib/components/Tabs/Tabs.types.js +0 -2
  143. package/lib/components/Tabs/Tabs.types.js.map +0 -1
  144. package/lib/components/Tabs/index.d.ts +0 -5
  145. package/lib/components/Tabs/index.js +0 -6
  146. package/lib/components/Tabs/index.js.map +0 -1
  147. package/lib/utilities/observeResize.d.ts +0 -21
  148. package/lib/utilities/observeResize.js +0 -46
  149. package/lib/utilities/observeResize.js.map +0 -1
  150. package/lib/utilities/useOverflow.d.ts +0 -45
  151. package/lib/utilities/useOverflow.js +0 -126
  152. package/lib/utilities/useOverflow.js.map +0 -1
  153. package/lib-amd/Tabs.d.ts +0 -1
  154. package/lib-amd/Tabs.js +0 -6
  155. package/lib-amd/Tabs.js.map +0 -1
  156. package/lib-amd/common/isConformant.d.ts +0 -4
  157. package/lib-amd/common/isConformant.js +0 -14
  158. package/lib-amd/common/isConformant.js.map +0 -1
  159. package/lib-amd/components/Tabs/TabItem.d.ts +0 -6
  160. package/lib-amd/components/Tabs/TabItem.js +0 -20
  161. package/lib-amd/components/Tabs/TabItem.js.map +0 -1
  162. package/lib-amd/components/Tabs/TabItem.types.d.ts +0 -61
  163. package/lib-amd/components/Tabs/TabItem.types.js +0 -5
  164. package/lib-amd/components/Tabs/TabItem.types.js.map +0 -1
  165. package/lib-amd/components/Tabs/Tabs.base.d.ts +0 -3
  166. package/lib-amd/components/Tabs/Tabs.base.js +0 -176
  167. package/lib-amd/components/Tabs/Tabs.base.js.map +0 -1
  168. package/lib-amd/components/Tabs/Tabs.d.ts +0 -8
  169. package/lib-amd/components/Tabs/Tabs.js +0 -14
  170. package/lib-amd/components/Tabs/Tabs.js.map +0 -1
  171. package/lib-amd/components/Tabs/Tabs.styles.d.ts +0 -2
  172. package/lib-amd/components/Tabs/Tabs.styles.js +0 -267
  173. package/lib-amd/components/Tabs/Tabs.styles.js.map +0 -1
  174. package/lib-amd/components/Tabs/Tabs.types.d.ts +0 -113
  175. package/lib-amd/components/Tabs/Tabs.types.js +0 -5
  176. package/lib-amd/components/Tabs/Tabs.types.js.map +0 -1
  177. package/lib-amd/components/Tabs/index.d.ts +0 -5
  178. package/lib-amd/components/Tabs/index.js +0 -11
  179. package/lib-amd/components/Tabs/index.js.map +0 -1
  180. package/lib-amd/index.d.ts +0 -1
  181. package/lib-amd/index.js +0 -6
  182. package/lib-amd/index.js.map +0 -1
  183. package/lib-amd/utilities/observeResize.d.ts +0 -21
  184. package/lib-amd/utilities/observeResize.js +0 -51
  185. package/lib-amd/utilities/observeResize.js.map +0 -1
  186. package/lib-amd/utilities/useOverflow.d.ts +0 -45
  187. package/lib-amd/utilities/useOverflow.js +0 -128
  188. package/lib-amd/utilities/useOverflow.js.map +0 -1
  189. package/lib-commonjs/Tabs.d.ts +0 -1
  190. package/lib-commonjs/Tabs.js +0 -5
  191. package/lib-commonjs/Tabs.js.map +0 -1
  192. package/lib-commonjs/common/isConformant.d.ts +0 -4
  193. package/lib-commonjs/common/isConformant.js +0 -13
  194. package/lib-commonjs/common/isConformant.js.map +0 -1
  195. package/lib-commonjs/components/Tabs/TabItem.d.ts +0 -6
  196. package/lib-commonjs/components/Tabs/TabItem.js +0 -21
  197. package/lib-commonjs/components/Tabs/TabItem.js.map +0 -1
  198. package/lib-commonjs/components/Tabs/TabItem.types.d.ts +0 -61
  199. package/lib-commonjs/components/Tabs/TabItem.types.js +0 -3
  200. package/lib-commonjs/components/Tabs/TabItem.types.js.map +0 -1
  201. package/lib-commonjs/components/Tabs/Tabs.base.d.ts +0 -3
  202. package/lib-commonjs/components/Tabs/Tabs.base.js +0 -182
  203. package/lib-commonjs/components/Tabs/Tabs.base.js.map +0 -1
  204. package/lib-commonjs/components/Tabs/Tabs.d.ts +0 -8
  205. package/lib-commonjs/components/Tabs/Tabs.js +0 -15
  206. package/lib-commonjs/components/Tabs/Tabs.js.map +0 -1
  207. package/lib-commonjs/components/Tabs/Tabs.styles.d.ts +0 -2
  208. package/lib-commonjs/components/Tabs/Tabs.styles.js +0 -268
  209. package/lib-commonjs/components/Tabs/Tabs.styles.js.map +0 -1
  210. package/lib-commonjs/components/Tabs/Tabs.types.d.ts +0 -113
  211. package/lib-commonjs/components/Tabs/Tabs.types.js +0 -3
  212. package/lib-commonjs/components/Tabs/Tabs.types.js.map +0 -1
  213. package/lib-commonjs/components/Tabs/index.d.ts +0 -5
  214. package/lib-commonjs/components/Tabs/index.js +0 -11
  215. package/lib-commonjs/components/Tabs/index.js.map +0 -1
  216. package/lib-commonjs/utilities/observeResize.d.ts +0 -21
  217. package/lib-commonjs/utilities/observeResize.js +0 -50
  218. package/lib-commonjs/utilities/observeResize.js.map +0 -1
  219. package/lib-commonjs/utilities/useOverflow.d.ts +0 -45
  220. package/lib-commonjs/utilities/useOverflow.js +0 -130
  221. package/lib-commonjs/utilities/useOverflow.js.map +0 -1
  222. package/src/components/Tabs/TabItem.types.ts +0 -69
  223. package/src/components/Tabs/Tabs.types.ts +0 -131
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/TabList/useTabList.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AASA;;;;;;;;AAQG;AACH;;;AACO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAsB,GAAtB,KAAmE;AACpG,QAAM;AAAE,IAAA,UAAU,GAAG,aAAf;AAA8B,IAAA,WAA9B;AAA2C,IAAA,IAAI,GAAG,QAAlD;AAA4D,IAAA,QAAQ,GAAG;AAAvE,MAAiF,KAAvF;AAEA,QAAM,QAAQ,GAAG,KAAK,CAAC,MAAN,CAA0B,IAA1B,CAAjB;AAEA,QAAM,eAAe,GAAG,eAAA,CAAA,uBAAA,CAAwB;AAAE,IAAA,QAAQ,EAAE,IAAZ;AAAkB,IAAA,IAAI,EAAE,QAAQ,GAAG,UAAH,GAAgB;AAAhD,GAAxB,CAAxB;AAEA,QAAM,CAAC,aAAD,EAAgB,gBAAhB,IAAoC,i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AAA,EAAA,GAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,OAAR,MAAe,IAAf,IAAe,EAAA,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAe,EAAA,CAAE,qBAAF,EAA/B;;AAEA,QAAI,QAAQ,IAAI,OAAhB,EAAyB;AACvB,aAAO;AACL,QAAA,CAAC,EAAE,OAAO,CAAC,CAAR,GAAY,QAAQ,CAAC,CADnB;AAEL,QAAA,CAAC,EAAE,OAAO,CAAC,CAAR,GAAY,QAAQ,CAAC,CAFnB;AAGL,QAAA,KAAK,EAAE,OAAO,CAAC,KAHV;AAIL,QAAA,MAAM,EAAE,OAAO,CAAC;AAJX,OAAP;AAMD,KAZwC,CAazC;AACA;;AACD,GAfuB,EAerB,CAAC,QAAD,EAAW,aAAX,CAfqB,CAAxB;AAiBA,SAAO;AACL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KADP;AAIL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;AACjC,MAAA,GAAG,EAAE,iBAAA,CAAA,aAAA,CAAc,GAAd,EAAmB,QAAnB,CAD4B;AAEjC,MAAA,IAAI,EAAE,SAF2B;AAGjC,SAAG,eAH8B;AAIjC,SAAG;AAJ8B,KAA7B,CAJD;AAUL,IAAA,UAVK;AAWL,IAAA,eAXK;AAYL,IAAA,aAZK;AAaL,IAAA,IAbK;AAcL,IAAA,QAdK;AAeL,IAAA,UAfK;AAgBL,IAAA,YAhBK;AAiBL,IAAA;AAjBK,GAAP;AAmBD,CA7FM;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","sourcesContent":["import * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport {\n getNativeElementProps,\n useConst,\n useControllableState,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport type { RegisterTabData, SelectTabData, SelectTabEvent, TabListProps, TabListState } from './TabList.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 */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const useTabList_unstable = (props: TabListProps, ref: React.Ref<HTMLElement>): TabListState => {\n const { appearance = 'transparent', onTabSelect, size = 'medium', vertical = false } = props;\n\n const innerRef = React.useRef<HTMLElement>(null);\n\n const focusAttributes = useArrowNavigationGroup({ circular: true, axis: vertical ? 'vertical' : 'horizontal' });\n\n const [selectedValue, setSelectedValue] = useControllableState({\n state: props.selectedValue,\n defaultState: props.defaultSelectedValue,\n initialState: undefined,\n });\n\n const onSelect = useEventCallback((event: SelectTabEvent, data: SelectTabData) => {\n onTabSelect?.(event, data);\n setSelectedValue(data.value);\n });\n\n // provide force recalculation of the selection indicator rectangle\n const [calcRect, setCalcRect] = React.useState(0);\n const recalcRect = useConst(() => () => setCalcRect(value => ++value));\n\n // when this list or any tab resizes, recalculate the selection indicator rectangle\n const resizeObserver = React.useMemo(\n () =>\n new ResizeObserver(entries => {\n recalcRect();\n }),\n [recalcRect],\n );\n\n // observe this list for resize\n React.useEffect(() => {\n const currentRef = innerRef.current;\n currentRef && resizeObserver.observe(currentRef);\n\n return () => {\n currentRef && resizeObserver.unobserve(currentRef);\n };\n }, [resizeObserver]);\n\n // when tabs register their refs, observe them for resize\n const registeredTabs = React.useRef<Record<string, RegisterTabData>>({});\n\n const onRegister = useEventCallback((data: RegisterTabData) => {\n registeredTabs.current[JSON.stringify(data.value)] = data;\n data.ref?.current && resizeObserver.observe(data.ref.current);\n recalcRect();\n });\n\n const onUnregister = useEventCallback((data: RegisterTabData) => {\n delete registeredTabs.current[JSON.stringify(data.value)];\n data.ref?.current && resizeObserver.unobserve(data.ref.current);\n recalcRect();\n });\n\n // calculate the selection indicator rectangle\n const selectedTabRect = React.useMemo(() => {\n const listRect = innerRef.current?.getBoundingClientRect();\n const tabRef: React.Ref<HTMLElement> = registeredTabs.current[JSON.stringify(selectedValue)]?.ref;\n const tabRect = tabRef?.current?.getBoundingClientRect();\n\n if (listRect && tabRect) {\n return {\n x: tabRect.x - listRect.x,\n y: tabRect.y - listRect.y,\n width: tabRect.width,\n height: tabRect.height,\n };\n }\n // calcRect is used to force updates when registered tabs change or resize occurs\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [calcRect, selectedValue]);\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, innerRef),\n role: 'tablist',\n ...focusAttributes,\n ...props,\n }),\n appearance,\n selectedTabRect,\n selectedValue,\n size,\n vertical,\n onRegister,\n onUnregister,\n onSelect,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,2 @@
1
+ import { TabListContextValues, TabListState } from './TabList.types';
2
+ export declare function useTabListContextValues(state: TabListState): TabListContextValues;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useTabListContextValues = void 0;
7
+
8
+ function useTabListContextValues(state) {
9
+ const {
10
+ appearance,
11
+ selectedValue: selectedKey,
12
+ onRegister,
13
+ onUnregister,
14
+ onSelect,
15
+ size,
16
+ vertical
17
+ } = state;
18
+ const tabList = {
19
+ appearance,
20
+ selectedValue: selectedKey,
21
+ onSelect,
22
+ onRegister,
23
+ onUnregister,
24
+ size,
25
+ vertical
26
+ };
27
+ return {
28
+ tabList
29
+ };
30
+ }
31
+
32
+ exports.useTabListContextValues = useTabListContextValues;
33
+ //# sourceMappingURL=useTabListContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/TabList/useTabListContextValues.tsx"],"names":[],"mappings":";;;;;;;AAEA,SAAgB,uBAAhB,CAAwC,KAAxC,EAA2D;AACzD,QAAM;AAAE,IAAA,UAAF;AAAc,IAAA,aAAa,EAAE,WAA7B;AAA0C,IAAA,UAA1C;AAAsD,IAAA,YAAtD;AAAoE,IAAA,QAApE;AAA8E,IAAA,IAA9E;AAAoF,IAAA;AAApF,MAAiG,KAAvG;AAEA,QAAM,OAAO,GAAwB;AACnC,IAAA,UADmC;AAEnC,IAAA,aAAa,EAAE,WAFoB;AAGnC,IAAA,QAHmC;AAInC,IAAA,UAJmC;AAKnC,IAAA,YALmC;AAMnC,IAAA,IANmC;AAOnC,IAAA;AAPmC,GAArC;AAUA,SAAO;AAAE,IAAA;AAAF,GAAP;AACD;;AAdD,OAAA,CAAA,uBAAA,GAAA,uBAAA","sourcesContent":["import { TabListContextValue, TabListContextValues, TabListState } from './TabList.types';\n\nexport function useTabListContextValues(state: TabListState): TabListContextValues {\n const { appearance, selectedValue: selectedKey, onRegister, onUnregister, onSelect, size, vertical } = state;\n\n const tabList: TabListContextValue = {\n appearance,\n selectedValue: selectedKey,\n onSelect,\n onRegister,\n onUnregister,\n size,\n vertical,\n };\n\n return { tabList };\n}\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,9 @@
1
+ import type { TabListState } from './TabList.types';
2
+ export declare const tabListClassName = "fui-TabList";
3
+ export declare const tabListSelectionIndicatorName = "fui-TabList_SelectionIndicator";
4
+ export declare const indicatorOffsetVar = "--selection-indicator-offset";
5
+ export declare const indicatorLengthVar = "--selection-indicator-length";
6
+ /**
7
+ * Apply styling to the TabList slots based on the state
8
+ */
9
+ export declare const useTabListStyles_unstable: (state: TabListState) => TabListState;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useTabListStyles_unstable = exports.indicatorLengthVar = exports.indicatorOffsetVar = exports.tabListSelectionIndicatorName = exports.tabListClassName = void 0;
7
+
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
+
10
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
+
12
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
+
14
+ const tab_constants_1 = /*#__PURE__*/require("../../tab.constants");
15
+
16
+ exports.tabListClassName = 'fui-TabList';
17
+ exports.tabListSelectionIndicatorName = 'fui-TabList_SelectionIndicator';
18
+ exports.indicatorOffsetVar = '--selection-indicator-offset';
19
+ exports.indicatorLengthVar = '--selection-indicator-length';
20
+ /**
21
+ * Styles for the root slot
22
+ */
23
+
24
+ const useStyles = /*#__PURE__*/react_1.__styles({
25
+ "root": {
26
+ "mc9l5x": "f22iagw",
27
+ "Beiy3e4": "f1063pyq",
28
+ "qhf8xq": "f10pi13n"
29
+ },
30
+ "vertical": {
31
+ "Beiy3e4": "f1vx9l62"
32
+ }
33
+ }, {
34
+ "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".f10pi13n{position:relative;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}"]
35
+ });
36
+ /**
37
+ * Styles for the selection indicator slot when horizontal.
38
+ */
39
+
40
+
41
+ const useHorizontalIndicatorStyles = /*#__PURE__*/react_1.__styles({
42
+ "base": {
43
+ "Bkbwdz4": "f30248y",
44
+ "frdscb": ["fvxed1z", "f1j2a01o"],
45
+ "B9nohqn": ["f1j2a01o", "fvxed1z"],
46
+ "B1dhsta": ["fsamouo", "f1aazreq"],
47
+ "Bjdmjzx": ["f1aazreq", "fsamouo"],
48
+ "Bj55yzk": "fw2wsqs",
49
+ "oqd9ik": "ffdc0f3",
50
+ "Bs6t6z0": "fqc6z8f",
51
+ "mpb1vu": "f119hevp",
52
+ "jc51t6": ["f1uyszuw", "f1xp83vy"],
53
+ "Hdbjpj": "f11ef69",
54
+ "Biobvvw": "f1tzy5p2",
55
+ "Bunff0j": "fs357bs"
56
+ },
57
+ "small": {
58
+ "jc51t6": ["f1w3ykbk", "f1xm0lqg"],
59
+ "Biobvvw": "f1akpkq3"
60
+ },
61
+ "animated": {
62
+ "wbfbqe": ["fjzde92", "f1xfxhj5"],
63
+ "mafdb0": "f1fuwhvj"
64
+ }
65
+ }, {
66
+ "d": [".f30248y:after{background-color:var(--colorBrandStroke1);}", ".fvxed1z:after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1j2a01o:after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fsamouo:after{border-top-right-radius:var(--borderRadiusMedium);}", ".f1aazreq:after{border-top-left-radius:var(--borderRadiusMedium);}", ".fw2wsqs:after{bottom:0;}", ".ffdc0f3:after{box-sizing:border-box;}", ".fqc6z8f:after{content:\"\";}", ".f119hevp:after{height:2px;}", ".f1uyszuw:after{left:calc(var(--selection-indicator-offset) + 10px);}", ".f1xp83vy:after{right:calc(var(--selection-indicator-offset) + 10px);}", ".f11ef69:after{position:absolute;}", ".f1tzy5p2:after{width:calc(var(--selection-indicator-length) - (2 * 10px));}", ".fs357bs:after{z-index:1;}", ".f1w3ykbk:after{left:calc(var(--selection-indicator-offset) + 6px);}", ".f1xm0lqg:after{right:calc(var(--selection-indicator-offset) + 6px);}", ".f1akpkq3:after{width:calc(var(--selection-indicator-length) - (2 * 6px));}", ".fjzde92:after{transition-property:left,width;}", ".f1xfxhj5:after{transition-property:right,width;}", ".f1fuwhvj:after{transition-duration:350ms,350ms;}"]
67
+ });
68
+ /**
69
+ * Styles for the selection indicator slot when vertical.
70
+ */
71
+
72
+
73
+ const useVerticalIndicatorStyles = /*#__PURE__*/react_1.__styles({
74
+ "base": {
75
+ "B1dvbpk": "fa05st",
76
+ "px8gyy": ["f16to4m4", "f1ceoihi"],
77
+ "B5c9fhp": ["f1ceoihi", "f16to4m4"],
78
+ "Bhe99jt": ["fkibbow", "fnlo9u7"],
79
+ "B2r1szc": ["fnlo9u7", "fkibbow"],
80
+ "Bmqnesq": "f170vdtw",
81
+ "rurcny": "fuzzvh5",
82
+ "Bbc2r3f": "f13xaayz",
83
+ "Byque4d": ["f1t0u0az", "fmlx6bj"],
84
+ "xx9plb": "fxf9f1y",
85
+ "Bf8kmfk": "fwt37qm",
86
+ "Bdn98qo": "f15bpuwh",
87
+ "Bab4cu6": "f1ijlm3k"
88
+ },
89
+ "small": {
90
+ "Bf8kmfk": "f8k0k00",
91
+ "Bbc2r3f": "fyephjl"
92
+ },
93
+ "animated": {
94
+ "iukgx1": "fcs48rj",
95
+ "B5szp9g": "f1u309tb"
96
+ }
97
+ }, {
98
+ "d": [".fa05st:before{background-color:var(--colorBrandStroke1);}", ".f16to4m4:before{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1ceoihi:before{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fkibbow:before{border-top-right-radius:var(--borderRadiusMedium);}", ".fnlo9u7:before{border-top-left-radius:var(--borderRadiusMedium);}", ".f170vdtw:before{box-sizing:border-box;}", ".fuzzvh5:before{content:\"\";}", ".f13xaayz:before{height:calc(var(--selection-indicator-length) - (2 * 10px));}", ".f1t0u0az:before{left:0;}", ".fmlx6bj:before{right:0;}", ".fxf9f1y:before{position:absolute;}", ".fwt37qm:before{top:calc(var(--selection-indicator-offset) + 10px);}", ".f15bpuwh:before{width:2px;}", ".f1ijlm3k:before{z-index:1;}", ".f8k0k00:before{top:calc(var(--selection-indicator-offset) + 6px);}", ".fyephjl:before{height:calc(var(--selection-indicator-length) - (2 * 6px));}", ".fcs48rj:before{transition-property:top,height;}", ".f1u309tb:before{transition-duration:350ms,350ms;}"]
99
+ });
100
+ /**
101
+ * Apply styling to the TabList slots based on the state
102
+ */
103
+ // eslint-disable-next-line @typescript-eslint/naming-convention
104
+
105
+
106
+ const useTabListStyles_unstable = state => {
107
+ const {
108
+ selectedTabRect: selectionIndicatorRect,
109
+ selectedValue,
110
+ size,
111
+ vertical
112
+ } = state; // only animate when the selected value has changed
113
+
114
+ const previousSelectedValue = react_utilities_1.usePrevious(selectedValue);
115
+ const shouldAnimate = !!previousSelectedValue && previousSelectedValue !== selectedValue;
116
+ const styles = useStyles();
117
+ const horizontalIndicatorStyles = useHorizontalIndicatorStyles();
118
+ const verticalIndicatorStyles = useVerticalIndicatorStyles();
119
+ state.root.className = react_1.mergeClasses(exports.tabListClassName, styles.root, vertical && styles.vertical, !!selectedValue && (vertical ? verticalIndicatorStyles.base : horizontalIndicatorStyles.base), !!selectedValue && size === 'small' && (vertical ? verticalIndicatorStyles.small : horizontalIndicatorStyles.small), !!selectedValue && shouldAnimate && (vertical ? verticalIndicatorStyles.animated : horizontalIndicatorStyles.animated), state.root.className);
120
+ const rootCssVars = selectionIndicatorRect ? {
121
+ [exports.indicatorOffsetVar]: vertical ? `${selectionIndicatorRect.y}px` : `${selectionIndicatorRect.x}px`,
122
+ [exports.indicatorLengthVar]: vertical ? `${selectionIndicatorRect.height}px` : `${selectionIndicatorRect.width}px`
123
+ } : {};
124
+ state.root.style = { ...rootCssVars,
125
+ ...state.root.style
126
+ };
127
+ return state;
128
+ };
129
+
130
+ exports.useTabListStyles_unstable = useTabListStyles_unstable;
131
+ //# sourceMappingURL=useTabListStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/TabList/useTabListStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AAEa,OAAA,CAAA,gBAAA,GAAmB,aAAnB;AACA,OAAA,CAAA,6BAAA,GAAgC,gCAAhC;AAEA,OAAA,CAAA,kBAAA,GAAqB,8BAArB;AACA,OAAA,CAAA,kBAAA,GAAqB,8BAArB;AAEb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAWA;;AAEG;;;AACH,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yB,CAAC,KAA7G,CALqB,EAMrB,CAAC,CAAC,aAAF,IACE,aADF,KAEG,QAAQ,GAAG,uBAAuB,CAAC,QAA3B,GAAsC,yBAAyB,CAAC,QAF3E,CANqB,EASrB,KAAK,CAAC,IAAN,CAAW,SATU,CAAvB;AAYA,QAAM,WAAW,GAAG,sBAAsB,GACtC;AACE,KAAC,OAAA,CAAA,kBAAD,GAAsB,QAAQ,GAAG,GAAG,sBAAsB,CAAC,CAAC,IAA9B,GAAqC,GAAG,sBAAsB,CAAC,CAAC,IADhG;AAEE,KAAC,OAAA,CAAA,kBAAD,GAAsB,QAAQ,GAAG,GAAG,sBAAsB,CAAC,MAAM,IAAnC,GAA0C,GAAG,sBAAsB,CAAC,KAAK;AAFzG,GADsC,GAKtC,EALJ;AAOA,EAAA,KAAK,CAAC,IAAN,CAAW,KAAX,GAAmB,EACjB,GAAG,WADc;AAEjB,OAAG,KAAK,CAAC,IAAN,CAAW;AAFG,GAAnB;AAKA,SAAO,KAAP;AACD,CApCM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { TabListState } from './TabList.types';\nimport { tokens } from '@fluentui/react-theme';\nimport { usePrevious } from '@fluentui/react-utilities';\nimport { tabPendingDesignTokens } from '../../tab.constants';\n\nexport const tabListClassName = 'fui-TabList';\nexport const tabListSelectionIndicatorName = 'fui-TabList_SelectionIndicator';\n\nexport const indicatorOffsetVar = '--selection-indicator-offset';\nexport const indicatorLengthVar = '--selection-indicator-length';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'row',\n position: 'relative',\n },\n vertical: {\n flexDirection: 'column',\n },\n});\n\n/**\n * Styles for the selection indicator slot when horizontal.\n */\nconst useHorizontalIndicatorStyles = makeStyles({\n base: {\n ':after': {\n backgroundColor: tokens.colorBrandStroke1,\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n bottom: 0,\n boxSizing: 'border-box',\n content: '\"\"',\n height: tabPendingDesignTokens.indicatorThickness,\n left: `calc(var(${indicatorOffsetVar}) + ${tabPendingDesignTokens.tabPadding.medium})`,\n position: 'absolute',\n width: `calc(var(${indicatorLengthVar}) - (2 * ${tabPendingDesignTokens.tabPadding.medium}))`,\n zIndex: 1,\n },\n },\n small: {\n ':after': {\n left: `calc(var(${indicatorOffsetVar}) + ${tabPendingDesignTokens.tabPadding.small})`,\n width: `calc(var(${indicatorLengthVar}) - (2 * ${tabPendingDesignTokens.tabPadding.small}))`,\n },\n },\n animated: {\n ':after': {\n transitionProperty: 'left, width',\n transitionDuration: `350ms, 350ms`,\n },\n },\n});\n\n/**\n * Styles for the selection indicator slot when vertical.\n */\nconst useVerticalIndicatorStyles = makeStyles({\n base: {\n ':before': {\n backgroundColor: tokens.colorBrandStroke1,\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n height: `calc(var(${indicatorLengthVar}) - (2 * ${tabPendingDesignTokens.tabPadding.medium}))`,\n left: '0',\n position: 'absolute',\n top: `calc(var(${indicatorOffsetVar}) + ${tabPendingDesignTokens.tabPadding.medium})`,\n width: tabPendingDesignTokens.indicatorThickness,\n zIndex: 1,\n },\n },\n small: {\n ':before': {\n top: `calc(var(${indicatorOffsetVar}) + ${tabPendingDesignTokens.tabPadding.small})`,\n height: `calc(var(${indicatorLengthVar}) - (2 * ${tabPendingDesignTokens.tabPadding.small}))`,\n },\n },\n animated: {\n ':before': {\n transitionProperty: 'top, height',\n transitionDuration: `350ms, 350ms`,\n },\n },\n});\n\n/**\n * Apply styling to the TabList slots based on the state\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const useTabListStyles_unstable = (state: TabListState): TabListState => {\n const { selectedTabRect: selectionIndicatorRect, selectedValue, size, vertical } = state;\n\n // only animate when the selected value has changed\n const previousSelectedValue = usePrevious(selectedValue);\n const shouldAnimate = !!previousSelectedValue && previousSelectedValue !== selectedValue;\n\n const styles = useStyles();\n const horizontalIndicatorStyles = useHorizontalIndicatorStyles();\n const verticalIndicatorStyles = useVerticalIndicatorStyles();\n\n state.root.className = mergeClasses(\n tabListClassName,\n styles.root,\n vertical && styles.vertical,\n !!selectedValue && (vertical ? verticalIndicatorStyles.base : horizontalIndicatorStyles.base),\n !!selectedValue && size === 'small' && (vertical ? verticalIndicatorStyles.small : horizontalIndicatorStyles.small),\n !!selectedValue &&\n shouldAnimate &&\n (vertical ? verticalIndicatorStyles.animated : horizontalIndicatorStyles.animated),\n state.root.className,\n );\n\n const rootCssVars = selectionIndicatorRect\n ? {\n [indicatorOffsetVar]: vertical ? `${selectionIndicatorRect.y}px` : `${selectionIndicatorRect.x}px`,\n [indicatorLengthVar]: vertical ? `${selectionIndicatorRect.height}px` : `${selectionIndicatorRect.width}px`,\n }\n : {};\n\n state.root.style = {\n ...rootCssVars,\n ...state.root.style,\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1,2 @@
1
- export * from './Tabs';
1
+ export * from './Tab';
2
+ export * from './TabList';
@@ -1,5 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./Tabs"), exports);
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
9
+ tslib_1.__exportStar(require("./Tab"), exports);
10
+
11
+ tslib_1.__exportStar(require("./TabList"), exports);
5
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB","sourcesContent":["export * from './Tabs';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,OAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Tab';\nexport * from './TabList';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,15 @@
1
+ export declare const tabPendingDesignTokens: {
2
+ tabPadding: {
3
+ medium: string;
4
+ small: string;
5
+ };
6
+ indicatorThickness: string;
7
+ gap: {
8
+ medium: string;
9
+ small: string;
10
+ };
11
+ contentPadding: {
12
+ medium: string;
13
+ small: string;
14
+ };
15
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tabPendingDesignTokens = void 0; // TODO: These constants should be replaced with design tokens
7
+
8
+ exports.tabPendingDesignTokens = {
9
+ tabPadding: {
10
+ medium: '10px',
11
+ small: '6px'
12
+ },
13
+ indicatorThickness: '2px',
14
+ gap: {
15
+ medium: '6px',
16
+ small: '2px'
17
+ },
18
+ contentPadding: {
19
+ medium: '2px',
20
+ small: '2px'
21
+ }
22
+ };
23
+ //# sourceMappingURL=tab.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["tab.constants.ts"],"names":[],"mappings":";;;;;yCAAA;;AACa,OAAA,CAAA,sBAAA,GAAyB;AACpC,EAAA,UAAU,EAAE;AACV,IAAA,MAAM,EAAE,MADE;AAEV,IAAA,KAAK,EAAE;AAFG,GADwB;AAKpC,EAAA,kBAAkB,EAAE,KALgB;AAMpC,EAAA,GAAG,EAAE;AAAE,IAAA,MAAM,EAAE,KAAV;AAAiB,IAAA,KAAK,EAAE;AAAxB,GAN+B;AAOpC,EAAA,cAAc,EAAE;AACd,IAAA,MAAM,EAAE,KADM;AAEd,IAAA,KAAK,EAAE;AAFO;AAPoB,CAAzB","sourcesContent":["// TODO: These constants should be replaced with design tokens\nexport const tabPendingDesignTokens = {\n tabPadding: {\n medium: '10px',\n small: '6px',\n },\n indicatorThickness: '2px',\n gap: { medium: '6px', small: '2px' },\n contentPadding: {\n medium: '2px',\n small: '2px',\n },\n};\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fluentui/react-tabs",
3
- "version": "1.0.0-beta.99",
4
- "description": "Fluent UI React Tabs component",
3
+ "version": "9.0.0-beta.6",
4
+ "description": "Fluent UI React tabs components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
7
  "typings": "lib/index.d.ts",
@@ -17,14 +17,18 @@
17
17
  "code-style": "just-scripts code-style",
18
18
  "just": "just-scripts",
19
19
  "lint": "just-scripts lint",
20
- "start": "just-scripts dev:storybook",
21
- "start-test": "just-scripts jest-watch",
22
- "test": "just-scripts test",
23
- "update-snapshots": "just-scripts jest -u"
20
+ "start": "yarn storybook",
21
+ "test": "jest --passWithNoTests",
22
+ "docs": "api-extractor run --config=config/api-extractor.local.json --local",
23
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-tabs/src && yarn docs",
24
+ "storybook": "node ../../scripts/storybook/runner",
25
+ "type-check": "tsc -b tsconfig.json"
24
26
  },
25
27
  "devDependencies": {
26
- "@fluentui/eslint-plugin": "^1.3.0",
27
- "@fluentui/react-conformance": "^0.4.0",
28
+ "@fluentui/eslint-plugin": "*",
29
+ "@fluentui/react-conformance": "*",
30
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.3",
31
+ "@fluentui/react-context-selector": "9.0.0-rc.3",
28
32
  "@fluentui/scripts": "^1.0.0",
29
33
  "@types/enzyme": "3.10.3",
30
34
  "@types/enzyme-adapter-react-16": "1.0.3",
@@ -32,14 +36,15 @@
32
36
  "@types/react-dom": "16.9.10",
33
37
  "@types/react-test-renderer": "^16.0.0",
34
38
  "enzyme": "~3.10.0",
39
+ "enzyme-adapter-react-16": "^1.15.0",
35
40
  "react": "16.8.6",
36
- "react-dom": "16.8.6"
41
+ "react-dom": "16.8.6",
42
+ "react-test-renderer": "^16.3.0"
37
43
  },
38
44
  "dependencies": {
39
- "@fluentui/react": "^8.14.12",
40
- "@fluentui/react-hooks": "^8.2.1",
41
- "@fluentui/style-utilities": "^8.1.1",
42
- "@fluentui/utilities": "^8.1.1",
45
+ "@griffel/react": "1.0.0",
46
+ "@fluentui/react-tabster": "9.0.0-rc.3",
47
+ "@fluentui/react-utilities": "9.0.0-rc.3",
43
48
  "tslib": "^2.1.0"
44
49
  },
45
50
  "peerDependencies": {
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@fluentui/scripts/api-extractor/api-extractor.common.json"
3
- }
package/config/tests.js DELETED
@@ -1,14 +0,0 @@
1
- /** Jest test setup file. */
2
-
3
- const { configure } = require('enzyme');
4
- const { initializeIcons } = require('@fluentui/font-icons-mdl2');
5
- const Adapter = require('enzyme-adapter-react-16');
6
- const { resetIds } = require('@fluentui/utilities');
7
-
8
- // Initialize icons.
9
- initializeIcons('');
10
-
11
- // Configure enzyme.
12
- configure({ adapter: new Adapter() });
13
-
14
- resetIds();
@@ -1,104 +0,0 @@
1
- ## API Report File for "@fluentui/react-tabs"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import { IButtonProps } from '@fluentui/react/lib/Button';
8
- import { IKeytipProps } from '@fluentui/react';
9
- import { IRefObject } from '@fluentui/utilities';
10
- import { IRenderFunction } from '@fluentui/utilities';
11
- import { IStyle } from '@fluentui/style-utilities';
12
- import { IStyleFunctionOrObject } from '@fluentui/utilities';
13
- import { ITheme } from '@fluentui/style-utilities';
14
- import * as React_2 from 'react';
15
-
16
- // @public
17
- export type TabFormatType = 'links' | 'tabs';
18
-
19
- // @public (undocumented)
20
- export class TabItem extends React_2.Component<TabItemProps, {}> {
21
- constructor(props: TabItemProps);
22
- // (undocumented)
23
- render(): JSX.Element;
24
- }
25
-
26
- // @public (undocumented)
27
- export interface TabItemProps extends React_2.HTMLAttributes<HTMLDivElement> {
28
- alwaysRender?: boolean;
29
- ariaLabel?: string;
30
- componentRef?: IRefObject<{}>;
31
- headerButtonProps?: IButtonProps | {
32
- [key: string]: string | number | boolean;
33
- };
34
- headerText?: string;
35
- itemCount?: number | string;
36
- itemIcon?: string;
37
- itemKey?: string;
38
- keytipProps?: IKeytipProps;
39
- onRenderTab?: IRenderFunction<TabItemProps>;
40
- }
41
-
42
- // @public
43
- export const Tabs: React_2.FunctionComponent<TabsProps>;
44
-
45
- // @public (undocumented)
46
- export const TabsBase: React_2.FunctionComponent<TabsProps>;
47
-
48
- // @public (undocumented)
49
- export interface TabsImperativeHandle {
50
- focus(): void;
51
- }
52
-
53
- // @public
54
- export type TabSizeType = 'normal' | 'large';
55
-
56
- // @public (undocumented)
57
- export interface TabsProps extends React_2.HTMLAttributes<HTMLDivElement>, React_2.RefAttributes<HTMLDivElement> {
58
- className?: string;
59
- componentRef?: React_2.RefObject<TabsImperativeHandle>;
60
- defaultSelectedKey?: string;
61
- getTabId?: (itemKey: string, index: number) => string;
62
- headersOnly?: boolean;
63
- onTabClick?: (item?: TabItem, ev?: React_2.MouseEvent<HTMLElement>) => void;
64
- overflowBehavior?: 'none' | 'menu';
65
- selectedKey?: string | null;
66
- styles?: IStyleFunctionOrObject<TabsStyleProps, TabsStyles>;
67
- tabFormat?: TabFormatType;
68
- tabSize?: TabSizeType;
69
- theme?: ITheme;
70
- }
71
-
72
- // @public (undocumented)
73
- export type TabsStyleProps = Required<Pick<TabsProps, 'theme'>> & Pick<TabsProps, 'className'> & {
74
- tabSize?: TabSizeType;
75
- tabFormat?: TabFormatType;
76
- };
77
-
78
- // @public (undocumented)
79
- export interface TabsStyles {
80
- // (undocumented)
81
- count: IStyle;
82
- // (undocumented)
83
- icon: IStyle;
84
- // (undocumented)
85
- itemContainer?: IStyle;
86
- // (undocumented)
87
- overflowMenuButton: IStyle;
88
- root: IStyle;
89
- // (undocumented)
90
- tab: IStyle;
91
- // (undocumented)
92
- tabContent: IStyle;
93
- // (undocumented)
94
- tabInMenu: IStyle;
95
- // (undocumented)
96
- tabIsSelected: IStyle;
97
- // (undocumented)
98
- text: IStyle;
99
- }
100
-
101
-
102
- // (No @packageDocumentation comment for this package)
103
-
104
- ```
package/just.config.ts DELETED
@@ -1,3 +0,0 @@
1
- import { preset } from '@fluentui/scripts';
2
-
3
- preset();
package/lib/Tabs.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Tabs/index';
package/lib/Tabs.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './components/Tabs/index';
2
- //# sourceMappingURL=Tabs.js.map
package/lib/Tabs.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.js","sourceRoot":"../src/","sources":["Tabs.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './components/Tabs/index';\n"]}
@@ -1,4 +0,0 @@
1
- import { IsConformantOptions } from '@fluentui/react-conformance';
2
- export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
- componentPath?: string;
4
- }): void;
@@ -1,9 +0,0 @@
1
- import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
2
- export function isConformant(testInfo) {
3
- var defaultOptions = {
4
- disabledTests: ['has-docblock', 'kebab-aria-attributes'],
5
- componentPath: module.parent.filename.replace('.test', ''),
6
- };
7
- baseIsConformant(defaultOptions, testInfo);
8
- }
9
- //# sourceMappingURL=isConformant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAuB,MAAM,6BAA6B,CAAC;AAEpG,MAAM,UAAU,YAAY,CAC1B,QAAyF;IAEzF,IAAM,cAAc,GAAyC;QAC3D,aAAa,EAAE,CAAC,cAAc,EAAE,uBAAuB,CAAC;QACxD,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;KAC7D,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n disabledTests: ['has-docblock', 'kebab-aria-attributes'],\n componentPath: module!.parent!.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import { TabItemProps } from './TabItem.types';
3
- export declare class TabItem extends React.Component<TabItemProps, {}> {
4
- constructor(props: TabItemProps);
5
- render(): JSX.Element;
6
- }
@@ -1,18 +0,0 @@
1
- import { __assign, __extends } from "tslib";
2
- import * as React from 'react';
3
- import { getNativeProps, divProperties, initializeComponentRef } from '@fluentui/utilities';
4
- // const COMPONENT_NAME = 'TabItem';
5
- var TabItem = /** @class */ (function (_super) {
6
- __extends(TabItem, _super);
7
- function TabItem(props) {
8
- var _this = _super.call(this, props) || this;
9
- initializeComponentRef(_this);
10
- return _this;
11
- }
12
- TabItem.prototype.render = function () {
13
- return React.createElement("div", __assign({}, getNativeProps(this.props, divProperties)), this.props.children);
14
- };
15
- return TabItem;
16
- }(React.Component));
17
- export { TabItem };
18
- //# sourceMappingURL=TabItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabItem.js","sourceRoot":"../src/","sources":["components/Tabs/TabItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG5F,oCAAoC;AAEpC;IAA6B,2BAAiC;IAC5D,iBAAY,KAAmB;QAA/B,YACE,kBAAM,KAAK,CAAC,SAGb;QADC,sBAAsB,CAAC,KAAI,CAAC,CAAC;;IAC/B,CAAC;IAEM,wBAAM,GAAb;QACE,OAAO,wCAAS,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAO,CAAC;IACzF,CAAC;IACH,cAAC;AAAD,CAAC,AAVD,CAA6B,KAAK,CAAC,SAAS,GAU3C","sourcesContent":["import * as React from 'react';\nimport { getNativeProps, divProperties, initializeComponentRef } from '@fluentui/utilities';\nimport { TabItemProps } from './TabItem.types';\n\n// const COMPONENT_NAME = 'TabItem';\n\nexport class TabItem extends React.Component<TabItemProps, {}> {\n constructor(props: TabItemProps) {\n super(props);\n\n initializeComponentRef(this);\n }\n\n public render(): JSX.Element {\n return <div {...getNativeProps(this.props, divProperties)}>{this.props.children}</div>;\n }\n}\n"]}
@@ -1,61 +0,0 @@
1
- import * as React from 'react';
2
- import { IKeytipProps } from '@fluentui/react';
3
- import { IButtonProps } from '@fluentui/react/lib/Button';
4
- import { IRefObject, IRenderFunction } from '@fluentui/utilities';
5
- /**
6
- * {@docCategory Tabs}
7
- */
8
- export interface TabItemProps extends React.HTMLAttributes<HTMLDivElement> {
9
- /**
10
- * Gets the component ref.
11
- */
12
- componentRef?: IRefObject<{}>;
13
- /**
14
- * The text displayed of each tab.
15
- */
16
- headerText?: string;
17
- /**
18
- * Props for the header command button. This provides a way to pass in native props, such as data-* and aria-*,
19
- * for each tab element.
20
- */
21
- headerButtonProps?: IButtonProps | {
22
- [key: string]: string | number | boolean;
23
- };
24
- /**
25
- * An required key to uniquely identify a tab item.
26
- *
27
- * Note: The 'key' from react props cannot be used inside component.
28
- */
29
- itemKey?: string;
30
- /**
31
- * The aria label of each tab which will read by screen reader instead of headerText.
32
- *
33
- * Note that unless you have compelling requirements you should not override aria-label.
34
- */
35
- ariaLabel?: string;
36
- /**
37
- * Defines an optional item count displayed in parentheses just after the `headerText`.
38
- *
39
- * Examples: completed (4), Unread (99+)
40
- */
41
- itemCount?: number | string;
42
- /**
43
- * An optional icon to show next to the tab.
44
- */
45
- itemIcon?: string;
46
- /**
47
- * Optional custom renderer for the tab
48
- */
49
- onRenderTab?: IRenderFunction<TabItemProps>;
50
- /**
51
- * Optional keytip for this TabItem
52
- */
53
- keytipProps?: IKeytipProps;
54
- /**
55
- * Defines whether to always render the tab item (regardless of whether it is selected or not).
56
- * Useful if you're rendering content that is expensive to mount.
57
- *
58
- * @defaultvalue false
59
- */
60
- alwaysRender?: boolean;
61
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TabItem.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabItem.types.js","sourceRoot":"../src/","sources":["components/Tabs/TabItem.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { IKeytipProps } from '@fluentui/react';\nimport { IButtonProps } from '@fluentui/react/lib/Button';\nimport { IRefObject, IRenderFunction } from '@fluentui/utilities';\n\n/**\n * {@docCategory Tabs}\n */\nexport interface TabItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Gets the component ref.\n */\n componentRef?: IRefObject<{}>;\n\n /**\n * The text displayed of each tab.\n */\n headerText?: string;\n\n /**\n * Props for the header command button. This provides a way to pass in native props, such as data-* and aria-*,\n * for each tab element.\n */\n headerButtonProps?: IButtonProps | { [key: string]: string | number | boolean };\n\n /**\n * An required key to uniquely identify a tab item.\n *\n * Note: The 'key' from react props cannot be used inside component.\n */\n itemKey?: string;\n\n /**\n * The aria label of each tab which will read by screen reader instead of headerText.\n *\n * Note that unless you have compelling requirements you should not override aria-label.\n */\n ariaLabel?: string;\n\n /**\n * Defines an optional item count displayed in parentheses just after the `headerText`.\n *\n * Examples: completed (4), Unread (99+)\n */\n itemCount?: number | string;\n\n /**\n * An optional icon to show next to the tab.\n */\n itemIcon?: string;\n\n /**\n * Optional custom renderer for the tab\n */\n onRenderTab?: IRenderFunction<TabItemProps>;\n\n /**\n * Optional keytip for this TabItem\n */\n keytipProps?: IKeytipProps;\n\n /**\n * Defines whether to always render the tab item (regardless of whether it is selected or not).\n * Useful if you're rendering content that is expensive to mount.\n *\n * @defaultvalue false\n */\n alwaysRender?: boolean;\n}\n"]}
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- import { TabsProps } from './index';
3
- export declare const TabsBase: React.FunctionComponent<TabsProps>;