@fluentui/react-tabs 1.0.0-beta.98 → 9.0.0-beta.7

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 +71 -1840
  2. package/CHANGELOG.md +24 -743
  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 +19 -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 -2
  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 -2
  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 -2
  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,218 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useTabStyles_unstable = exports.tabClassName = void 0;
7
+
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
+
10
+ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
+
12
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
13
+
14
+ const tab_constants_1 = /*#__PURE__*/require("../../tab.constants");
15
+
16
+ exports.tabClassName = 'fui-Tab';
17
+ /**
18
+ * Styles for the root slot
19
+ */
20
+
21
+ const useRootStyles = /*#__PURE__*/react_1.__styles({
22
+ "base": {
23
+ "De3pzq": "flu3bqm",
24
+ "g2u3we": "fwhevhj",
25
+ "h3c5rm": ["f61n433", "f1q8l70w"],
26
+ "B9xav0g": "fv1dfc8",
27
+ "zhjwy3": ["f1q8l70w", "f61n433"],
28
+ "Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
29
+ "Beyfa6y": ["f16jpd5f", "f1aa9q02"],
30
+ "B7oj6ja": ["f1jar5jt", "fyu767a"],
31
+ "Btl43ni": ["fyu767a", "f1jar5jt"],
32
+ "B4j52fo": "f192inf7",
33
+ "Bekrc4i": ["f5tn483", "f1ojsxk5"],
34
+ "Bn0qgzm": "f1vxd6vx",
35
+ "ibv6hh": ["f1ojsxk5", "f5tn483"],
36
+ "i8kkvl": "fgfbwa2",
37
+ "Bceei9c": "f1k6fduh",
38
+ "mc9l5x": "f22iagw",
39
+ "Beiy3e4": "f1063pyq",
40
+ "Bahqtrf": "fk6fouc",
41
+ "Be2twd7": "fkhj508",
42
+ "Bg96gwp": "f1i3iumi",
43
+ "z8tnut": "f1809wu7",
44
+ "z189sj": ["f81rol6", "frdkuqy"],
45
+ "Byoj8tv": "f1fow5ox",
46
+ "uwmqm3": ["frdkuqy", "f81rol6"],
47
+ "qhf8xq": "f10pi13n",
48
+ "B68tc82": "f1p9o1ba",
49
+ "Bmxbyg5": "f1sil6mw"
50
+ },
51
+ "horizontal": {
52
+ "Bt984gj": "f122n59",
53
+ "Brf1p80": "f4d9j23"
54
+ },
55
+ "vertical": {
56
+ "Bt984gj": "f122n59",
57
+ "Brf1p80": "fbhxue7"
58
+ },
59
+ "small": {
60
+ "z8tnut": "f1xp5gbu",
61
+ "z189sj": ["f1sgzk6v", "f1bg5zqg"],
62
+ "Byoj8tv": "f1d7kygh",
63
+ "uwmqm3": ["f1bg5zqg", "f1sgzk6v"],
64
+ "i8kkvl": "f16mnhsx"
65
+ },
66
+ "subtle": {
67
+ "Jwef8y": "f1knas48"
68
+ }
69
+ }, {
70
+ "d": [".flu3bqm{background-color:none;}", ".fwhevhj{border-top-color:none;}", ".f61n433{border-right-color:none;}", ".f1q8l70w{border-left-color:none;}", ".fv1dfc8{border-bottom-color:none;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fgfbwa2{-webkit-column-gap:6px;column-gap:6px;}", ".f1k6fduh{cursor:pointer;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1809wu7{padding-top:10px;}", ".f81rol6{padding-right:10px;}", ".frdkuqy{padding-left:10px;}", ".f1fow5ox{padding-bottom:10px;}", ".f10pi13n{position:relative;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fbhxue7{-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;}", ".f1xp5gbu{padding-top:6px;}", ".f1sgzk6v{padding-right:6px;}", ".f1bg5zqg{padding-left:6px;}", ".f1d7kygh{padding-bottom:6px;}", ".f16mnhsx{-webkit-column-gap:2px;column-gap:2px;}"],
71
+ "h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}"]
72
+ });
73
+ /**
74
+ * Focus styles for the root slot
75
+ */
76
+
77
+
78
+ const useFocusStyles = /*#__PURE__*/react_1.__styles({
79
+ "base": {
80
+ "B486eqv": "f2hkw1w",
81
+ "Bnmjwt4": "flfsvnh",
82
+ "Jopkrh": ["f1781m5e", "flvaaa9"],
83
+ "hhrs2v": "f50u1b5",
84
+ "B7jbng7": ["flvaaa9", "f1781m5e"],
85
+ "B32s92o": "fgeg2qa",
86
+ "Bh48x57": "f19j8a82",
87
+ "B5hngm5": "fhcq1yo",
88
+ "D4py6b": "f1gkya50",
89
+ "Bgwpjed": "fpt6wn7"
90
+ }
91
+ }, {
92
+ "i": [".f2hkw1w:focus-visible{outline-style:none;}"],
93
+ "d": ["[data-keyboard-nav] .flfsvnh:focus{border-top-color:transparent;}", "[data-keyboard-nav] .f1781m5e:focus{border-right-color:transparent;}", "[data-keyboard-nav] .flvaaa9:focus{border-left-color:transparent;}", "[data-keyboard-nav] .f50u1b5:focus{border-bottom-color:transparent;}", "[data-keyboard-nav] .fgeg2qa:focus{outline-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .f19j8a82:focus{outline-color:transparent;}", "[data-keyboard-nav] .fhcq1yo:focus{outline-style:solid;}", "[data-keyboard-nav] .f1gkya50:focus{box-shadow:var(--shadow4),0 0 0 var(--strokeWidthThick) var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fpt6wn7:focus{z-index:1;}"]
94
+ });
95
+ /**
96
+ * Indicator styles for the root slot when horizontal.
97
+ */
98
+
99
+
100
+ const useHorizontalIndicatorStyles = /*#__PURE__*/react_1.__styles({
101
+ "base": {
102
+ "Bkbwdz4": "f1mif8u4",
103
+ "frdscb": ["fvxed1z", "f1j2a01o"],
104
+ "B9nohqn": ["f1j2a01o", "fvxed1z"],
105
+ "B1dhsta": ["fsamouo", "f1aazreq"],
106
+ "Bjdmjzx": ["f1aazreq", "fsamouo"],
107
+ "oqd9ik": "ffdc0f3",
108
+ "Bs6t6z0": "fqc6z8f",
109
+ "Hdbjpj": "f11ef69",
110
+ "mpb1vu": "f119hevp",
111
+ "Bj55yzk": "fw2wsqs",
112
+ "jc51t6": ["f1l9humg", "f3c5rjh"],
113
+ "cnmfks": ["f3c5rjh", "f1l9humg"],
114
+ "Bt86n75": "fg6xmog"
115
+ },
116
+ "small": {
117
+ "jc51t6": ["f1i8k3s6", "fy447wy"],
118
+ "cnmfks": ["fy447wy", "f1i8k3s6"]
119
+ }
120
+ }, {
121
+ "d": [".f1mif8u4:after{background-color:none;}", ".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);}", ".ffdc0f3:after{box-sizing:border-box;}", ".fqc6z8f:after{content:\"\";}", ".f11ef69:after{position:absolute;}", ".f119hevp:after{height:2px;}", ".fw2wsqs:after{bottom:0;}", ".f1l9humg:after{left:10px;}", ".f3c5rjh:after{right:10px;}", ".f1i8k3s6:after{left:6px;}", ".fy447wy:after{right:6px;}"],
122
+ "h": [".fg6xmog:hover:after{background-color:var(--colorNeutralStroke1);}"]
123
+ });
124
+ /**
125
+ * Indicator styles for the root slot when vertical.
126
+ */
127
+
128
+
129
+ const useVerticalIndicatorStyles = /*#__PURE__*/react_1.__styles({
130
+ "base": {
131
+ "B1dvbpk": "ffgj6zs",
132
+ "px8gyy": ["f16to4m4", "f1ceoihi"],
133
+ "B5c9fhp": ["f1ceoihi", "f16to4m4"],
134
+ "Bhe99jt": ["fkibbow", "fnlo9u7"],
135
+ "B2r1szc": ["fnlo9u7", "fkibbow"],
136
+ "Bmqnesq": "f170vdtw",
137
+ "rurcny": "fuzzvh5",
138
+ "xx9plb": "fxf9f1y",
139
+ "Bdn98qo": "f15bpuwh",
140
+ "Byque4d": ["f1t0u0az", "fmlx6bj"],
141
+ "Bf8kmfk": "f1bwym7p",
142
+ "Bj2wrql": "fk3f4e0",
143
+ "Cgij5x": "fl6lm7t"
144
+ },
145
+ "small": {
146
+ "Bf8kmfk": "fp6nmmp",
147
+ "Bj2wrql": "f14i0ki9"
148
+ }
149
+ }, {
150
+ "d": [".ffgj6zs:before{background-color:none;}", ".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:\"\";}", ".fxf9f1y:before{position:absolute;}", ".f15bpuwh:before{width:2px;}", ".f1t0u0az:before{left:0;}", ".fmlx6bj:before{right:0;}", ".f1bwym7p:before{top:10px;}", ".fk3f4e0:before{bottom:10px;}", ".fp6nmmp:before{top:6px;}", ".f14i0ki9:before{bottom:6px;}"],
151
+ "h": [".fl6lm7t:hover:before{background-color:var(--colorNeutralStroke1);}"]
152
+ });
153
+ /**
154
+ * Styles for the icon slot.
155
+ */
156
+
157
+
158
+ const useIconStyles = /*#__PURE__*/react_1.__styles({
159
+ "base": {
160
+ "Bt984gj": "f122n59",
161
+ "mc9l5x": "ftuwxu6",
162
+ "Brf1p80": "f4d9j23"
163
+ },
164
+ "small": {
165
+ "Be2twd7": "fe5j1ua",
166
+ "Bqenvij": "fjamq6b",
167
+ "a9b677": "f64fuq3"
168
+ },
169
+ "medium": {
170
+ "Be2twd7": "fe5j1ua",
171
+ "Bqenvij": "fjamq6b",
172
+ "a9b677": "f64fuq3"
173
+ }
174
+ }, {
175
+ "d": [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}"]
176
+ });
177
+ /**
178
+ * Styles for the content slot (children)
179
+ */
180
+
181
+
182
+ const useContentStyles = /*#__PURE__*/react_1.__styles({
183
+ "base": {
184
+ "uwmqm3": ["f161knb0", "f12huiiw"],
185
+ "z189sj": ["f12huiiw", "f161knb0"]
186
+ },
187
+ "small": {
188
+ "uwmqm3": ["f161knb0", "f12huiiw"],
189
+ "z189sj": ["f12huiiw", "f161knb0"]
190
+ }
191
+ }, {
192
+ "d": [".f161knb0{padding-left:2px;}", ".f12huiiw{padding-right:2px;}"]
193
+ });
194
+ /**
195
+ * Apply styling to the Tab slots based on the state
196
+ */
197
+ // eslint-disable-next-line @typescript-eslint/naming-convention
198
+
199
+
200
+ const useTabStyles_unstable = state => {
201
+ const rootStyles = useRootStyles();
202
+ const focusStyles = useFocusStyles();
203
+ const horizontalIndicatorStyles = useHorizontalIndicatorStyles();
204
+ const verticalIndicatorStyles = useVerticalIndicatorStyles();
205
+ const iconStyles = useIconStyles();
206
+ const contentStyles = useContentStyles();
207
+ state.root.className = react_1.mergeClasses(exports.tabClassName, rootStyles.base, focusStyles.base, state.size === 'small' && rootStyles.small, state.appearance === 'subtle' && rootStyles.subtle, state.vertical ? verticalIndicatorStyles.base : horizontalIndicatorStyles.base, state.size === 'small' && (state.vertical ? verticalIndicatorStyles.small : horizontalIndicatorStyles.small), state.root.className);
208
+
209
+ if (state.icon) {
210
+ state.icon.className = react_1.mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);
211
+ }
212
+
213
+ state.content.className = react_1.mergeClasses(contentStyles.base, state.size === 'small' && contentStyles.small, state.content.className);
214
+ return state;
215
+ };
216
+
217
+ exports.useTabStyles_unstable = useTabStyles_unstable;
218
+ //# sourceMappingURL=useTabStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Tab/useTabStyles.ts"],"names":[],"mappings":"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","sourcesContent":["import type { TabState } from './Tab.types';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { tabPendingDesignTokens } from '../../tab.constants';\n\nexport const tabClassName = 'fui-Tab';\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n backgroundColor: 'none',\n ...shorthands.borderColor('none'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n columnGap: tabPendingDesignTokens.gap.medium,\n cursor: 'pointer',\n display: 'flex',\n flexDirection: 'row',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n ...shorthands.padding(tabPendingDesignTokens.tabPadding.medium),\n position: 'relative',\n ...shorthands.overflow('hidden'),\n },\n horizontal: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n vertical: {\n alignItems: 'center',\n justifyContent: 'flex-start',\n },\n small: {\n ...shorthands.padding(tabPendingDesignTokens.tabPadding.small),\n columnGap: tabPendingDesignTokens.gap.small,\n },\n subtle: {\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n },\n },\n});\n\n/**\n * Focus styles for the root slot\n */\nconst useFocusStyles = makeStyles({\n // Tab creates a custom focus indicator because the default focus indicator\n // is applied using an :after pseudo-element on the root. Since the selection\n // indicator uses an :after pseudo-element on the root, there is a conflict.\n base: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineWidth: tokens.strokeWidthThick,\n outlineColor: 'transparent',\n outlineStyle: 'solid',\n boxShadow: `\n ${tokens.shadow4},\n 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}\n `,\n zIndex: 1,\n }),\n});\n\n/**\n * Indicator styles for the root slot when horizontal.\n */\nconst useHorizontalIndicatorStyles = makeStyles({\n base: {\n ':after': {\n backgroundColor: 'none',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n height: tabPendingDesignTokens.indicatorThickness,\n bottom: '0',\n left: tabPendingDesignTokens.tabPadding.medium,\n right: tabPendingDesignTokens.tabPadding.medium,\n },\n ':hover': {\n ':after': {\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n },\n small: {\n ':after': {\n left: tabPendingDesignTokens.tabPadding.small,\n right: tabPendingDesignTokens.tabPadding.small,\n },\n },\n});\n\n/**\n * Indicator styles for the root slot when vertical.\n */\nconst useVerticalIndicatorStyles = makeStyles({\n base: {\n ':before': {\n backgroundColor: 'none',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n width: tabPendingDesignTokens.indicatorThickness,\n left: '0',\n top: tabPendingDesignTokens.tabPadding.medium,\n bottom: tabPendingDesignTokens.tabPadding.medium,\n },\n ':hover': {\n ':before': {\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n },\n small: {\n ':before': {\n top: tabPendingDesignTokens.tabPadding.small,\n bottom: tabPendingDesignTokens.tabPadding.small,\n },\n },\n});\n\n/**\n * Styles for the icon slot.\n */\nconst useIconStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n // per design, the small and medium font sizes are the same.\n // the size prop only affects spacing.\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n medium: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n});\n\n/**\n * Styles for the content slot (children)\n */\nconst useContentStyles = makeStyles({\n base: {\n paddingLeft: tabPendingDesignTokens.contentPadding.medium,\n paddingRight: tabPendingDesignTokens.contentPadding.medium,\n },\n small: {\n paddingLeft: tabPendingDesignTokens.contentPadding.small,\n paddingRight: tabPendingDesignTokens.contentPadding.small,\n },\n});\n\n/**\n * Apply styling to the Tab slots based on the state\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const useTabStyles_unstable = (state: TabState): TabState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n const horizontalIndicatorStyles = useHorizontalIndicatorStyles();\n const verticalIndicatorStyles = useVerticalIndicatorStyles();\n const iconStyles = useIconStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n tabClassName,\n rootStyles.base,\n focusStyles.base,\n state.size === 'small' && rootStyles.small,\n state.appearance === 'subtle' && rootStyles.subtle,\n state.vertical ? verticalIndicatorStyles.base : horizontalIndicatorStyles.base,\n state.size === 'small' && (state.vertical ? verticalIndicatorStyles.small : horizontalIndicatorStyles.small),\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);\n }\n\n state.content.className = mergeClasses(\n contentStyles.base,\n state.size === 'small' && contentStyles.small,\n state.content.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,6 @@
1
+ import type { TabListProps } from './TabList.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
+ /**
4
+ * A tab list provides single selection from a set of tabs.
5
+ */
6
+ export declare const TabList: ForwardRefComponent<TabListProps>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TabList = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const useTabList_1 = /*#__PURE__*/require("./useTabList");
11
+
12
+ const renderTabList_1 = /*#__PURE__*/require("./renderTabList");
13
+
14
+ const useTabListStyles_1 = /*#__PURE__*/require("./useTabListStyles");
15
+
16
+ const useTabListContextValues_1 = /*#__PURE__*/require("./useTabListContextValues");
17
+ /**
18
+ * A tab list provides single selection from a set of tabs.
19
+ */
20
+
21
+
22
+ exports.TabList = /*#__PURE__*/React.forwardRef((props, ref) => {
23
+ const state = useTabList_1.useTabList_unstable(props, ref);
24
+ const contextValues = useTabListContextValues_1.useTabListContextValues(state);
25
+ useTabListStyles_1.useTabListStyles_unstable(state);
26
+ return renderTabList_1.renderTabList_unstable(state, contextValues);
27
+ });
28
+ exports.TabList.displayName = 'TabList';
29
+ //# sourceMappingURL=TabList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/TabList/TabList.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AAGA,MAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAEA;;AAEG;;;AACU,OAAA,CAAA,OAAA,gBAA6C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACxF,QAAM,KAAK,GAAG,YAAA,CAAA,mBAAA,CAAoB,KAApB,EAA2B,GAA3B,CAAd;AACA,QAAM,aAAa,GAAG,yBAAA,CAAA,uBAAA,CAAwB,KAAxB,CAAtB;AAEA,EAAA,kBAAA,CAAA,yBAAA,CAA0B,KAA1B;AACA,SAAO,eAAA,CAAA,sBAAA,CAAuB,KAAvB,EAA8B,aAA9B,CAAP;AACD,CANyD,CAA7C;AAQb,OAAA,CAAA,OAAA,CAAQ,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { useTabList_unstable } from './useTabList';\nimport { renderTabList_unstable } from './renderTabList';\nimport { useTabListStyles_unstable } from './useTabListStyles';\nimport type { TabListProps } from './TabList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTabListContextValues } from './useTabListContextValues';\n\n/**\n * A tab list provides single selection from a set of tabs.\n */\nexport const TabList: ForwardRefComponent<TabListProps> = React.forwardRef((props, ref) => {\n const state = useTabList_unstable(props, ref);\n const contextValues = useTabListContextValues(state);\n\n useTabListStyles_unstable(state);\n return renderTabList_unstable(state, contextValues);\n});\n\nTabList.displayName = 'TabList';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,99 @@
1
+ import * as React from 'react';
2
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
+ import { TabValue } from '../Tab/Tab.types';
4
+ export declare type RegisterTabData = {
5
+ /**
6
+ * The value of the selected tab.
7
+ */
8
+ value: TabValue;
9
+ ref: React.RefObject<HTMLElement>;
10
+ };
11
+ export declare type RegisterTabEventHandler = (data: RegisterTabData) => void;
12
+ export declare type SelectTabData = {
13
+ /**
14
+ * The value of the selected tab.
15
+ */
16
+ value: TabValue;
17
+ };
18
+ export declare type SelectTabEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;
19
+ export declare type SelectTabEventHandler = (event: SelectTabEvent, data: SelectTabData) => void;
20
+ export declare type TabListSlots = {
21
+ /**
22
+ * The slot associated with the root element of this tab list.
23
+ */
24
+ root: Slot<'div'>;
25
+ };
26
+ declare type TabListCommons = {
27
+ /**
28
+ * A tab list can supports 'transparent' and 'subtle' appearance.
29
+ *- 'subtle': Minimizes emphasis to blend into the background until hovered or focused.
30
+ *- 'transparent': No background and border styling
31
+ * The appearance affects each of the contained tabs.
32
+ * @default 'transparent'
33
+ */
34
+ appearance?: 'transparent' | 'subtle';
35
+ /**
36
+ * Raised when a tab is selected.
37
+ */
38
+ onTabSelect?: SelectTabEventHandler;
39
+ /**
40
+ * The value of the currently selected tab.
41
+ */
42
+ selectedValue?: TabValue;
43
+ /**
44
+ * A tab list can be either 'small' or 'medium' size.
45
+ * The size affects each of the contained tabs.
46
+ * @default 'medium'
47
+ */
48
+ size?: 'small' | 'medium';
49
+ /**
50
+ * A tab list can arrange its tabs vertically.
51
+ * @default false
52
+ */
53
+ vertical?: boolean;
54
+ };
55
+ /**
56
+ * TabList Props
57
+ */
58
+ export declare type TabListProps = ComponentProps<TabListSlots> & TabListCommons & {
59
+ /**
60
+ * The value of the tab to be selected by default.
61
+ * Typically useful when the selectedValue is uncontrolled.
62
+ */
63
+ defaultSelectedValue?: TabValue;
64
+ };
65
+ export declare type TabListContextValue = Pick<TabListCommons, 'onTabSelect' | 'selectedValue'> & Required<Pick<TabListCommons, 'appearance' | 'size' | 'vertical'>> & {
66
+ /** A callback to allow a tab to register itself with the tab list. */
67
+ onRegister: RegisterTabEventHandler;
68
+ /** A callback to allow a tab to unregister itself with the tab list. */
69
+ onUnregister: RegisterTabEventHandler;
70
+ /**
71
+ * A callback to allow a tab to select itself when pressed.
72
+ */
73
+ onSelect: SelectTabEventHandler;
74
+ };
75
+ /**
76
+ * Context values used in rendering TabList.
77
+ */
78
+ export declare type TabListContextValues = {
79
+ /**
80
+ * The context of the tab list available to each tab.
81
+ */
82
+ tabList: TabListContextValue;
83
+ };
84
+ /**
85
+ * A bounding rectangle of a tab
86
+ */
87
+ export declare type TabContentRect = {
88
+ x: number;
89
+ y: number;
90
+ width: number;
91
+ height: number;
92
+ };
93
+ /**
94
+ * State used in rendering TabList.
95
+ */
96
+ export declare type TabListState = ComponentState<Required<TabListSlots>> & TabListContextValue & {
97
+ selectedTabRect?: TabContentRect;
98
+ };
99
+ export {};
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=TabList.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -0,0 +1,3 @@
1
+ import type { Context } from '@fluentui/react-context-selector';
2
+ import { TabListContextValue } from './TabList.types';
3
+ export declare const TabListContext: Context<TabListContextValue>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TabListContext = void 0;
7
+
8
+ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
9
+
10
+ exports.TabListContext = /*#__PURE__*/react_context_selector_1.createContext({
11
+ appearance: 'transparent',
12
+ selectedValue: undefined,
13
+ onRegister: () => {
14
+ /* noop */
15
+ },
16
+ onUnregister: () => {
17
+ /* noop */
18
+ },
19
+ onSelect: () => {
20
+ /* noop */
21
+ },
22
+ size: 'medium',
23
+ vertical: false
24
+ });
25
+ //# sourceMappingURL=TabListContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/TabList/TabListContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,gBAA+C,wBAAA,CAAA,aAAA,CAAmC;AAC7F,EAAA,UAAU,EAAE,aADiF;AAE7F,EAAA,aAAa,EAAE,SAF8E;AAG7F,EAAA,UAAU,EAAE,MAAK;AACf;AACD,GAL4F;AAM7F,EAAA,YAAY,EAAE,MAAK;AACjB;AACD,GAR4F;AAS7F,EAAA,QAAQ,EAAE,MAAK;AACb;AACD,GAX4F;AAY7F,EAAA,IAAI,EAAE,QAZuF;AAa7F,EAAA,QAAQ,EAAE;AAbmF,CAAnC,CAA/C","sourcesContent":["import { createContext } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport { TabListContextValue } from './TabList.types';\n\nexport const TabListContext: Context<TabListContextValue> = createContext<TabListContextValue>({\n appearance: 'transparent',\n selectedValue: undefined,\n onRegister: () => {\n /* noop */\n },\n onUnregister: () => {\n /* noop */\n },\n onSelect: () => {\n /* noop */\n },\n size: 'medium',\n vertical: false,\n});\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,5 @@
1
+ export * from './TabList';
2
+ export * from './TabList.types';
3
+ export * from './renderTabList';
4
+ export * from './useTabList';
5
+ export * from './useTabListStyles';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
9
+ tslib_1.__exportStar(require("./TabList"), exports);
10
+
11
+ tslib_1.__exportStar(require("./TabList.types"), exports);
12
+
13
+ tslib_1.__exportStar(require("./renderTabList"), exports);
14
+
15
+ tslib_1.__exportStar(require("./useTabList"), exports);
16
+
17
+ tslib_1.__exportStar(require("./useTabListStyles"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/TabList/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './TabList';\nexport * from './TabList.types';\nexport * from './renderTabList';\nexport * from './useTabList';\nexport * from './useTabListStyles';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,5 @@
1
+ import type { TabListState, TabListContextValues } from './TabList.types';
2
+ /**
3
+ * Render the final JSX of TabList
4
+ */
5
+ export declare const renderTabList_unstable: (state: TabListState, contextValues: TabListContextValues) => JSX.Element;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderTabList_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ const TabListContext_1 = /*#__PURE__*/require("./TabListContext");
13
+ /**
14
+ * Render the final JSX of TabList
15
+ */
16
+ // eslint-disable-next-line @typescript-eslint/naming-convention
17
+
18
+
19
+ const renderTabList_unstable = (state, contextValues) => {
20
+ const {
21
+ slots,
22
+ slotProps
23
+ } = react_utilities_1.getSlots(state);
24
+ return React.createElement(slots.root, { ...slotProps.root
25
+ }, React.createElement(TabListContext_1.TabListContext.Provider, {
26
+ value: contextValues.tabList
27
+ }, state.root.children));
28
+ };
29
+
30
+ exports.renderTabList_unstable = renderTabList_unstable;
31
+ //# sourceMappingURL=renderTabList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/TabList/renderTabList.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;AAEA;;AAEG;AACH;;;AACO,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAsB,aAAtB,KAA6D;AACjG,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAuB,KAAvB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACE,KAAA,CAAA,aAAA,CAAC,gBAAA,CAAA,cAAA,CAAe,QAAhB,EAAwB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAxB,EAAwD,KAAK,CAAC,IAAN,CAAW,QAAnE,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TabListState, TabListSlots, TabListContextValues } from './TabList.types';\nimport { TabListContext } from './TabListContext';\n\n/**\n * Render the final JSX of TabList\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const renderTabList_unstable = (state: TabListState, contextValues: TabListContextValues) => {\n const { slots, slotProps } = getSlots<TabListSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <TabListContext.Provider value={contextValues.tabList}>{state.root.children}</TabListContext.Provider>\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import type { TabListProps, TabListState } from './TabList.types';
3
+ /**
4
+ * Create the state required to render TabList.
5
+ *
6
+ * The returned state can be modified with hooks such as useTabListStyles_unstable,
7
+ * before being passed to renderTabList_unstable.
8
+ *
9
+ * @param props - props from this instance of TabList
10
+ * @param ref - reference to root HTMLElement of TabList
11
+ */
12
+ export declare const useTabList_unstable: (props: TabListProps, ref: React.Ref<HTMLElement>) => TabListState;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useTabList_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
+
12
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
+ /**
14
+ * Create the state required to render TabList.
15
+ *
16
+ * The returned state can be modified with hooks such as useTabListStyles_unstable,
17
+ * before being passed to renderTabList_unstable.
18
+ *
19
+ * @param props - props from this instance of TabList
20
+ * @param ref - reference to root HTMLElement of TabList
21
+ */
22
+ // eslint-disable-next-line @typescript-eslint/naming-convention
23
+
24
+
25
+ const useTabList_unstable = (props, ref) => {
26
+ const {
27
+ appearance = 'transparent',
28
+ onTabSelect,
29
+ size = 'medium',
30
+ vertical = false
31
+ } = props;
32
+ const innerRef = React.useRef(null);
33
+ const focusAttributes = react_tabster_1.useArrowNavigationGroup({
34
+ circular: true,
35
+ axis: vertical ? 'vertical' : 'horizontal'
36
+ });
37
+ const [selectedValue, setSelectedValue] = react_utilities_1.useControllableState({
38
+ state: props.selectedValue,
39
+ defaultState: props.defaultSelectedValue,
40
+ initialState: undefined
41
+ });
42
+ const onSelect = react_utilities_1.useEventCallback((event, data) => {
43
+ onTabSelect === null || onTabSelect === void 0 ? void 0 : onTabSelect(event, data);
44
+ setSelectedValue(data.value);
45
+ }); // provide force recalculation of the selection indicator rectangle
46
+
47
+ const [calcRect, setCalcRect] = React.useState(0);
48
+ const recalcRect = react_utilities_1.useConst(() => () => setCalcRect(value => ++value)); // when this list or any tab resizes, recalculate the selection indicator rectangle
49
+
50
+ const resizeObserver = React.useMemo(() => new ResizeObserver(entries => {
51
+ recalcRect();
52
+ }), [recalcRect]); // observe this list for resize
53
+
54
+ React.useEffect(() => {
55
+ const currentRef = innerRef.current;
56
+ currentRef && resizeObserver.observe(currentRef);
57
+ return () => {
58
+ currentRef && resizeObserver.unobserve(currentRef);
59
+ };
60
+ }, [resizeObserver]); // when tabs register their refs, observe them for resize
61
+
62
+ const registeredTabs = React.useRef({});
63
+ const onRegister = react_utilities_1.useEventCallback(data => {
64
+ var _a;
65
+
66
+ registeredTabs.current[JSON.stringify(data.value)] = data;
67
+ ((_a = data.ref) === null || _a === void 0 ? void 0 : _a.current) && resizeObserver.observe(data.ref.current);
68
+ recalcRect();
69
+ });
70
+ const onUnregister = react_utilities_1.useEventCallback(data => {
71
+ var _a;
72
+
73
+ delete registeredTabs.current[JSON.stringify(data.value)];
74
+ ((_a = data.ref) === null || _a === void 0 ? void 0 : _a.current) && resizeObserver.unobserve(data.ref.current);
75
+ recalcRect();
76
+ }); // calculate the selection indicator rectangle
77
+
78
+ const selectedTabRect = React.useMemo(() => {
79
+ var _a, _b, _c;
80
+
81
+ const listRect = (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
82
+ const tabRef = (_b = registeredTabs.current[JSON.stringify(selectedValue)]) === null || _b === void 0 ? void 0 : _b.ref;
83
+ const tabRect = (_c = tabRef === null || tabRef === void 0 ? void 0 : tabRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect();
84
+
85
+ if (listRect && tabRect) {
86
+ return {
87
+ x: tabRect.x - listRect.x,
88
+ y: tabRect.y - listRect.y,
89
+ width: tabRect.width,
90
+ height: tabRect.height
91
+ };
92
+ } // calcRect is used to force updates when registered tabs change or resize occurs
93
+ // eslint-disable-next-line react-hooks/exhaustive-deps
94
+
95
+ }, [calcRect, selectedValue]);
96
+ return {
97
+ components: {
98
+ root: 'div'
99
+ },
100
+ root: react_utilities_1.getNativeElementProps('div', {
101
+ ref: react_utilities_1.useMergedRefs(ref, innerRef),
102
+ role: 'tablist',
103
+ ...focusAttributes,
104
+ ...props
105
+ }),
106
+ appearance,
107
+ selectedTabRect,
108
+ selectedValue,
109
+ size,
110
+ vertical,
111
+ onRegister,
112
+ onUnregister,
113
+ onSelect
114
+ };
115
+ };
116
+
117
+ exports.useTabList_unstable = useTabList_unstable;
118
+ //# sourceMappingURL=useTabList.js.map