@alfalab/core-components-tabs 9.1.0 → 9.2.0

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 (309) hide show
  1. package/components/primary-tablist/Component.collapsible.d.ts +1 -1
  2. package/components/primary-tablist/Component.collapsible.js.map +1 -1
  3. package/components/primary-tablist/Component.d.ts +1 -1
  4. package/components/primary-tablist/Component.desktop.d.ts +1 -1
  5. package/components/primary-tablist/Component.desktop.js.map +1 -1
  6. package/components/primary-tablist/Component.js.map +1 -1
  7. package/components/primary-tablist/Component.mobile.d.ts +1 -1
  8. package/components/primary-tablist/Component.mobile.js.map +1 -1
  9. package/components/primary-tablist/Component.responsive.d.ts +1 -1
  10. package/components/primary-tablist/Component.responsive.js.map +1 -1
  11. package/components/primary-tablist/index.css +138 -135
  12. package/components/primary-tablist/index.module.css.js +1 -1
  13. package/components/primary-tablist/index.module.css.js.map +1 -1
  14. package/components/primary-tablist/mobile.css +230 -226
  15. package/components/primary-tablist/mobile.module.css.js +1 -1
  16. package/components/scroll-controls/Component.d.ts +2 -2
  17. package/components/scroll-controls/Component.js.map +1 -1
  18. package/components/scroll-controls/index.css +11 -11
  19. package/components/scroll-controls/index.module.css.js +1 -1
  20. package/components/scroll-controls/utils.js.map +1 -1
  21. package/components/scrollable-container/Component.d.ts +2 -2
  22. package/components/scrollable-container/Component.js.map +1 -1
  23. package/components/scrollable-container/index.css +5 -5
  24. package/components/scrollable-container/index.module.css.js +1 -1
  25. package/components/secondary-tablist/Component.d.ts +1 -1
  26. package/components/secondary-tablist/Component.desktop.d.ts +1 -1
  27. package/components/secondary-tablist/Component.desktop.js.map +1 -1
  28. package/components/secondary-tablist/Component.js.map +1 -1
  29. package/components/secondary-tablist/Component.mobile.d.ts +1 -1
  30. package/components/secondary-tablist/Component.mobile.js.map +1 -1
  31. package/components/secondary-tablist/Component.responsive.d.ts +1 -1
  32. package/components/secondary-tablist/Component.responsive.js.map +1 -1
  33. package/components/secondary-tablist/index.css +18 -18
  34. package/components/secondary-tablist/index.module.css.js +1 -1
  35. package/components/secondary-tablist/mobile.css +22 -22
  36. package/components/secondary-tablist/mobile.module.css.js +1 -1
  37. package/components/tab/Component.d.ts +1 -1
  38. package/components/tab/Component.js.map +1 -1
  39. package/components/tab/index.css +2 -2
  40. package/components/tab/index.module.css.js +1 -1
  41. package/components/tabs/Component.collapsible.d.ts +1 -1
  42. package/components/tabs/Component.collapsible.js.map +1 -1
  43. package/components/tabs/Component.d.ts +2 -2
  44. package/components/tabs/Component.desktop.d.ts +1 -1
  45. package/components/tabs/Component.desktop.js.map +1 -1
  46. package/components/tabs/Component.js +2 -11
  47. package/components/tabs/Component.js.map +1 -1
  48. package/components/tabs/Component.mobile.d.ts +1 -1
  49. package/components/tabs/Component.mobile.js.map +1 -1
  50. package/components/tabs/Component.responsive.d.ts +1 -1
  51. package/components/tabs/Component.responsive.js.map +1 -1
  52. package/components/title/Component.d.ts +2 -2
  53. package/components/title/Component.js.map +1 -1
  54. package/cssm/components/primary-tablist/Component.collapsible.d.ts +1 -1
  55. package/cssm/components/primary-tablist/Component.collapsible.js.map +1 -1
  56. package/cssm/components/primary-tablist/Component.d.ts +1 -1
  57. package/cssm/components/primary-tablist/Component.desktop.d.ts +1 -1
  58. package/cssm/components/primary-tablist/Component.desktop.js.map +1 -1
  59. package/cssm/components/primary-tablist/Component.js.map +1 -1
  60. package/cssm/components/primary-tablist/Component.mobile.d.ts +1 -1
  61. package/cssm/components/primary-tablist/Component.mobile.js.map +1 -1
  62. package/cssm/components/primary-tablist/Component.responsive.d.ts +1 -1
  63. package/cssm/components/primary-tablist/Component.responsive.js.map +1 -1
  64. package/cssm/components/primary-tablist/index.module.css +7 -4
  65. package/cssm/components/primary-tablist/mobile.module.css +4 -3
  66. package/cssm/components/scroll-controls/Component.d.ts +2 -2
  67. package/cssm/components/scroll-controls/Component.js.map +1 -1
  68. package/cssm/components/scroll-controls/utils.js.map +1 -1
  69. package/cssm/components/scrollable-container/Component.d.ts +2 -2
  70. package/cssm/components/scrollable-container/Component.js.map +1 -1
  71. package/cssm/components/secondary-tablist/Component.d.ts +1 -1
  72. package/cssm/components/secondary-tablist/Component.desktop.d.ts +1 -1
  73. package/cssm/components/secondary-tablist/Component.desktop.js.map +1 -1
  74. package/cssm/components/secondary-tablist/Component.js.map +1 -1
  75. package/cssm/components/secondary-tablist/Component.mobile.d.ts +1 -1
  76. package/cssm/components/secondary-tablist/Component.mobile.js.map +1 -1
  77. package/cssm/components/secondary-tablist/Component.responsive.d.ts +1 -1
  78. package/cssm/components/secondary-tablist/Component.responsive.js.map +1 -1
  79. package/cssm/components/tab/Component.d.ts +1 -1
  80. package/cssm/components/tab/Component.js.map +1 -1
  81. package/cssm/components/tabs/Component.collapsible.d.ts +1 -1
  82. package/cssm/components/tabs/Component.collapsible.js.map +1 -1
  83. package/cssm/components/tabs/Component.d.ts +2 -2
  84. package/cssm/components/tabs/Component.desktop.d.ts +1 -1
  85. package/cssm/components/tabs/Component.desktop.js.map +1 -1
  86. package/cssm/components/tabs/Component.js +2 -11
  87. package/cssm/components/tabs/Component.js.map +1 -1
  88. package/cssm/components/tabs/Component.mobile.d.ts +1 -1
  89. package/cssm/components/tabs/Component.mobile.js.map +1 -1
  90. package/cssm/components/tabs/Component.responsive.d.ts +1 -1
  91. package/cssm/components/tabs/Component.responsive.js.map +1 -1
  92. package/cssm/components/title/Component.d.ts +2 -2
  93. package/cssm/components/title/Component.js.map +1 -1
  94. package/cssm/hooks/use-collapsible-elements.d.ts +1 -1
  95. package/cssm/hooks/use-collapsible-elements.js.map +1 -1
  96. package/cssm/hooks/use-tablist-titles.d.ts +50 -1
  97. package/cssm/hooks/use-tablist-titles.js.map +1 -1
  98. package/cssm/hooks/use-tabs.d.ts +2 -2
  99. package/cssm/hooks/use-tabs.js.map +1 -1
  100. package/cssm/synthetic-events.d.ts +1 -1
  101. package/cssm/synthetic-events.js.map +1 -1
  102. package/cssm/typings.d.ts +14 -4
  103. package/esm/components/primary-tablist/Component.collapsible.d.ts +1 -1
  104. package/esm/components/primary-tablist/Component.collapsible.js.map +1 -1
  105. package/esm/components/primary-tablist/Component.d.ts +1 -1
  106. package/esm/components/primary-tablist/Component.desktop.d.ts +1 -1
  107. package/esm/components/primary-tablist/Component.desktop.js.map +1 -1
  108. package/esm/components/primary-tablist/Component.js.map +1 -1
  109. package/esm/components/primary-tablist/Component.mobile.d.ts +1 -1
  110. package/esm/components/primary-tablist/Component.mobile.js.map +1 -1
  111. package/esm/components/primary-tablist/Component.responsive.d.ts +1 -1
  112. package/esm/components/primary-tablist/Component.responsive.js.map +1 -1
  113. package/esm/components/primary-tablist/index.css +138 -135
  114. package/esm/components/primary-tablist/index.module.css.js +1 -1
  115. package/esm/components/primary-tablist/index.module.css.js.map +1 -1
  116. package/esm/components/primary-tablist/mobile.css +230 -226
  117. package/esm/components/primary-tablist/mobile.module.css.js +1 -1
  118. package/esm/components/scroll-controls/Component.d.ts +2 -2
  119. package/esm/components/scroll-controls/Component.js.map +1 -1
  120. package/esm/components/scroll-controls/index.css +11 -11
  121. package/esm/components/scroll-controls/index.module.css.js +1 -1
  122. package/esm/components/scroll-controls/utils.js.map +1 -1
  123. package/esm/components/scrollable-container/Component.d.ts +2 -2
  124. package/esm/components/scrollable-container/Component.js.map +1 -1
  125. package/esm/components/scrollable-container/index.css +5 -5
  126. package/esm/components/scrollable-container/index.module.css.js +1 -1
  127. package/esm/components/secondary-tablist/Component.d.ts +1 -1
  128. package/esm/components/secondary-tablist/Component.desktop.d.ts +1 -1
  129. package/esm/components/secondary-tablist/Component.desktop.js.map +1 -1
  130. package/esm/components/secondary-tablist/Component.js.map +1 -1
  131. package/esm/components/secondary-tablist/Component.mobile.d.ts +1 -1
  132. package/esm/components/secondary-tablist/Component.mobile.js.map +1 -1
  133. package/esm/components/secondary-tablist/Component.responsive.d.ts +1 -1
  134. package/esm/components/secondary-tablist/Component.responsive.js.map +1 -1
  135. package/esm/components/secondary-tablist/index.css +18 -18
  136. package/esm/components/secondary-tablist/index.module.css.js +1 -1
  137. package/esm/components/secondary-tablist/mobile.css +22 -22
  138. package/esm/components/secondary-tablist/mobile.module.css.js +1 -1
  139. package/esm/components/tab/Component.d.ts +1 -1
  140. package/esm/components/tab/Component.js.map +1 -1
  141. package/esm/components/tab/index.css +2 -2
  142. package/esm/components/tab/index.module.css.js +1 -1
  143. package/esm/components/tabs/Component.collapsible.d.ts +1 -1
  144. package/esm/components/tabs/Component.collapsible.js.map +1 -1
  145. package/esm/components/tabs/Component.d.ts +2 -2
  146. package/esm/components/tabs/Component.desktop.d.ts +1 -1
  147. package/esm/components/tabs/Component.desktop.js.map +1 -1
  148. package/esm/components/tabs/Component.js +2 -11
  149. package/esm/components/tabs/Component.js.map +1 -1
  150. package/esm/components/tabs/Component.mobile.d.ts +1 -1
  151. package/esm/components/tabs/Component.mobile.js.map +1 -1
  152. package/esm/components/tabs/Component.responsive.d.ts +1 -1
  153. package/esm/components/tabs/Component.responsive.js.map +1 -1
  154. package/esm/components/title/Component.d.ts +2 -2
  155. package/esm/components/title/Component.js.map +1 -1
  156. package/esm/hooks/use-collapsible-elements.d.ts +1 -1
  157. package/esm/hooks/use-collapsible-elements.js.map +1 -1
  158. package/esm/hooks/use-tablist-titles.d.ts +50 -1
  159. package/esm/hooks/use-tablist-titles.js.map +1 -1
  160. package/esm/hooks/use-tabs.d.ts +2 -2
  161. package/esm/hooks/use-tabs.js.map +1 -1
  162. package/esm/synthetic-events.d.ts +1 -1
  163. package/esm/synthetic-events.js.map +1 -1
  164. package/esm/typings.d.ts +14 -4
  165. package/hooks/use-collapsible-elements.d.ts +1 -1
  166. package/hooks/use-collapsible-elements.js.map +1 -1
  167. package/hooks/use-tablist-titles.d.ts +50 -1
  168. package/hooks/use-tablist-titles.js.map +1 -1
  169. package/hooks/use-tabs.d.ts +2 -2
  170. package/hooks/use-tabs.js.map +1 -1
  171. package/modern/components/primary-tablist/Component.collapsible.d.ts +1 -1
  172. package/modern/components/primary-tablist/Component.collapsible.js.map +1 -1
  173. package/modern/components/primary-tablist/Component.d.ts +1 -1
  174. package/modern/components/primary-tablist/Component.desktop.d.ts +1 -1
  175. package/modern/components/primary-tablist/Component.desktop.js.map +1 -1
  176. package/modern/components/primary-tablist/Component.js.map +1 -1
  177. package/modern/components/primary-tablist/Component.mobile.d.ts +1 -1
  178. package/modern/components/primary-tablist/Component.mobile.js.map +1 -1
  179. package/modern/components/primary-tablist/Component.responsive.d.ts +1 -1
  180. package/modern/components/primary-tablist/Component.responsive.js.map +1 -1
  181. package/modern/components/primary-tablist/index.css +138 -135
  182. package/modern/components/primary-tablist/index.module.css.js +1 -1
  183. package/modern/components/primary-tablist/index.module.css.js.map +1 -1
  184. package/modern/components/primary-tablist/mobile.css +230 -226
  185. package/modern/components/primary-tablist/mobile.module.css.js +1 -1
  186. package/modern/components/scroll-controls/Component.d.ts +2 -2
  187. package/modern/components/scroll-controls/Component.js.map +1 -1
  188. package/modern/components/scroll-controls/index.css +11 -11
  189. package/modern/components/scroll-controls/index.module.css.js +1 -1
  190. package/modern/components/scroll-controls/utils.js.map +1 -1
  191. package/modern/components/scrollable-container/Component.d.ts +2 -2
  192. package/modern/components/scrollable-container/Component.js.map +1 -1
  193. package/modern/components/scrollable-container/index.css +5 -5
  194. package/modern/components/scrollable-container/index.module.css.js +1 -1
  195. package/modern/components/secondary-tablist/Component.d.ts +1 -1
  196. package/modern/components/secondary-tablist/Component.desktop.d.ts +1 -1
  197. package/modern/components/secondary-tablist/Component.desktop.js.map +1 -1
  198. package/modern/components/secondary-tablist/Component.js.map +1 -1
  199. package/modern/components/secondary-tablist/Component.mobile.d.ts +1 -1
  200. package/modern/components/secondary-tablist/Component.mobile.js.map +1 -1
  201. package/modern/components/secondary-tablist/Component.responsive.d.ts +1 -1
  202. package/modern/components/secondary-tablist/Component.responsive.js.map +1 -1
  203. package/modern/components/secondary-tablist/index.css +18 -18
  204. package/modern/components/secondary-tablist/index.module.css.js +1 -1
  205. package/modern/components/secondary-tablist/mobile.css +22 -22
  206. package/modern/components/secondary-tablist/mobile.module.css.js +1 -1
  207. package/modern/components/tab/Component.d.ts +1 -1
  208. package/modern/components/tab/Component.js.map +1 -1
  209. package/modern/components/tab/index.css +2 -2
  210. package/modern/components/tab/index.module.css.js +1 -1
  211. package/modern/components/tabs/Component.collapsible.d.ts +1 -1
  212. package/modern/components/tabs/Component.collapsible.js.map +1 -1
  213. package/modern/components/tabs/Component.d.ts +2 -2
  214. package/modern/components/tabs/Component.desktop.d.ts +1 -1
  215. package/modern/components/tabs/Component.desktop.js.map +1 -1
  216. package/modern/components/tabs/Component.js +2 -1
  217. package/modern/components/tabs/Component.js.map +1 -1
  218. package/modern/components/tabs/Component.mobile.d.ts +1 -1
  219. package/modern/components/tabs/Component.mobile.js.map +1 -1
  220. package/modern/components/tabs/Component.responsive.d.ts +1 -1
  221. package/modern/components/tabs/Component.responsive.js.map +1 -1
  222. package/modern/components/title/Component.d.ts +2 -2
  223. package/modern/components/title/Component.js.map +1 -1
  224. package/modern/hooks/use-collapsible-elements.d.ts +1 -1
  225. package/modern/hooks/use-collapsible-elements.js.map +1 -1
  226. package/modern/hooks/use-tablist-titles.d.ts +50 -1
  227. package/modern/hooks/use-tablist-titles.js.map +1 -1
  228. package/modern/hooks/use-tabs.d.ts +2 -2
  229. package/modern/hooks/use-tabs.js.map +1 -1
  230. package/modern/synthetic-events.d.ts +1 -1
  231. package/modern/synthetic-events.js.map +1 -1
  232. package/modern/typings.d.ts +14 -4
  233. package/moderncssm/components/primary-tablist/Component.collapsible.d.ts +1 -1
  234. package/moderncssm/components/primary-tablist/Component.collapsible.js.map +1 -1
  235. package/moderncssm/components/primary-tablist/Component.d.ts +1 -1
  236. package/moderncssm/components/primary-tablist/Component.desktop.d.ts +1 -1
  237. package/moderncssm/components/primary-tablist/Component.desktop.js.map +1 -1
  238. package/moderncssm/components/primary-tablist/Component.js.map +1 -1
  239. package/moderncssm/components/primary-tablist/Component.mobile.d.ts +1 -1
  240. package/moderncssm/components/primary-tablist/Component.mobile.js.map +1 -1
  241. package/moderncssm/components/primary-tablist/Component.responsive.d.ts +1 -1
  242. package/moderncssm/components/primary-tablist/Component.responsive.js.map +1 -1
  243. package/moderncssm/components/primary-tablist/index.module.css +3 -1
  244. package/moderncssm/components/scroll-controls/Component.d.ts +2 -2
  245. package/moderncssm/components/scroll-controls/Component.js.map +1 -1
  246. package/moderncssm/components/scroll-controls/utils.js.map +1 -1
  247. package/moderncssm/components/scrollable-container/Component.d.ts +2 -2
  248. package/moderncssm/components/scrollable-container/Component.js.map +1 -1
  249. package/moderncssm/components/secondary-tablist/Component.d.ts +1 -1
  250. package/moderncssm/components/secondary-tablist/Component.desktop.d.ts +1 -1
  251. package/moderncssm/components/secondary-tablist/Component.desktop.js.map +1 -1
  252. package/moderncssm/components/secondary-tablist/Component.js.map +1 -1
  253. package/moderncssm/components/secondary-tablist/Component.mobile.d.ts +1 -1
  254. package/moderncssm/components/secondary-tablist/Component.mobile.js.map +1 -1
  255. package/moderncssm/components/secondary-tablist/Component.responsive.d.ts +1 -1
  256. package/moderncssm/components/secondary-tablist/Component.responsive.js.map +1 -1
  257. package/moderncssm/components/tab/Component.d.ts +1 -1
  258. package/moderncssm/components/tab/Component.js.map +1 -1
  259. package/moderncssm/components/tabs/Component.collapsible.d.ts +1 -1
  260. package/moderncssm/components/tabs/Component.collapsible.js.map +1 -1
  261. package/moderncssm/components/tabs/Component.d.ts +2 -2
  262. package/moderncssm/components/tabs/Component.desktop.d.ts +1 -1
  263. package/moderncssm/components/tabs/Component.desktop.js.map +1 -1
  264. package/moderncssm/components/tabs/Component.js +2 -1
  265. package/moderncssm/components/tabs/Component.js.map +1 -1
  266. package/moderncssm/components/tabs/Component.mobile.d.ts +1 -1
  267. package/moderncssm/components/tabs/Component.mobile.js.map +1 -1
  268. package/moderncssm/components/tabs/Component.responsive.d.ts +1 -1
  269. package/moderncssm/components/tabs/Component.responsive.js.map +1 -1
  270. package/moderncssm/components/title/Component.d.ts +2 -2
  271. package/moderncssm/components/title/Component.js.map +1 -1
  272. package/moderncssm/hooks/use-collapsible-elements.d.ts +1 -1
  273. package/moderncssm/hooks/use-collapsible-elements.js.map +1 -1
  274. package/moderncssm/hooks/use-tablist-titles.d.ts +50 -1
  275. package/moderncssm/hooks/use-tablist-titles.js.map +1 -1
  276. package/moderncssm/hooks/use-tabs.d.ts +2 -2
  277. package/moderncssm/hooks/use-tabs.js.map +1 -1
  278. package/moderncssm/synthetic-events.d.ts +1 -1
  279. package/moderncssm/synthetic-events.js.map +1 -1
  280. package/moderncssm/typings.d.ts +14 -4
  281. package/package.json +3 -3
  282. package/src/components/primary-tablist/Component.collapsible.tsx +3 -3
  283. package/src/components/primary-tablist/Component.desktop.tsx +1 -1
  284. package/src/components/primary-tablist/Component.mobile.tsx +1 -1
  285. package/src/components/primary-tablist/Component.responsive.tsx +1 -1
  286. package/src/components/primary-tablist/Component.tsx +1 -1
  287. package/src/components/primary-tablist/index.module.css +3 -1
  288. package/src/components/scroll-controls/Component.tsx +2 -2
  289. package/src/components/scroll-controls/utils.ts +10 -7
  290. package/src/components/scrollable-container/Component.tsx +2 -2
  291. package/src/components/secondary-tablist/Component.desktop.tsx +1 -1
  292. package/src/components/secondary-tablist/Component.mobile.tsx +1 -1
  293. package/src/components/secondary-tablist/Component.responsive.tsx +1 -1
  294. package/src/components/secondary-tablist/Component.tsx +1 -1
  295. package/src/components/tab/Component.tsx +2 -3
  296. package/src/components/tabs/Component.collapsible.tsx +1 -1
  297. package/src/components/tabs/Component.desktop.tsx +1 -1
  298. package/src/components/tabs/Component.mobile.tsx +1 -1
  299. package/src/components/tabs/Component.responsive.tsx +1 -1
  300. package/src/components/tabs/Component.tsx +4 -1
  301. package/src/components/title/Component.tsx +3 -3
  302. package/src/hooks/use-collapsible-elements.ts +2 -2
  303. package/src/hooks/use-tablist-titles.ts +1 -1
  304. package/src/hooks/{use-tabs.tsx → use-tabs.ts} +5 -5
  305. package/src/synthetic-events.ts +1 -1
  306. package/src/typings.ts +78 -47
  307. package/synthetic-events.d.ts +1 -1
  308. package/synthetic-events.js.map +1 -1
  309. package/typings.d.ts +14 -4
@@ -1,16 +1,16 @@
1
- import React, { Ref, useEffect, useMemo, useRef } from 'react';
1
+ import React, { type Ref, useEffect, useMemo, useRef } from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
4
  import { Badge } from '@alfalab/core-components-badge';
5
5
  import { KeyboardFocusable } from '@alfalab/core-components-keyboard-focusable';
6
6
  import {
7
7
  PickerButtonDesktop,
8
- PickerButtonDesktopProps,
8
+ type PickerButtonDesktopProps,
9
9
  } from '@alfalab/core-components-picker-button/desktop';
10
10
 
11
11
  import { useTablistTitles } from '../../hooks/use-tablist-titles';
12
12
  import { createSyntheticMouseEvent } from '../../synthetic-events';
13
- import { TabListProps } from '../../typings';
13
+ import { type TabListProps } from '../../typings';
14
14
  import { Title } from '../title';
15
15
 
16
16
  import styles from './index.module.css';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { TabListProps } from '../../typings';
3
+ import { type TabListProps } from '../../typings';
4
4
 
5
5
  import { PrimaryTabList } from './Component';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { TabListProps } from '../../typings';
3
+ import { type TabListProps } from '../../typings';
4
4
 
5
5
  import { PrimaryTabList } from './Component';
6
6
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { useIsDesktop } from '@alfalab/core-components-mq';
4
4
 
5
- import { TabListProps } from '../../typings';
5
+ import { type TabListProps } from '../../typings';
6
6
 
7
7
  import { PrimaryTabListDesktop } from './Component.desktop';
8
8
  import { PrimaryTabListMobile } from './Component.mobile';
@@ -6,7 +6,7 @@ import { KeyboardFocusable } from '@alfalab/core-components-keyboard-focusable';
6
6
  import { fnUtils } from '@alfalab/core-components-shared';
7
7
 
8
8
  import { useTabs } from '../../hooks/use-tabs';
9
- import { PlatformProps, Styles, TabListProps } from '../../typings';
9
+ import { type PlatformProps, type Styles, type TabListProps } from '../../typings';
10
10
  import { ScrollableContainer } from '../scrollable-container';
11
11
  import { Title } from '../title';
12
12
 
@@ -83,7 +83,9 @@
83
83
  bottom: var(--gap-0);
84
84
  left: var(--gap-0);
85
85
  background-color: var(--primary-tablist-line-color);
86
- transition: transform 0.2s ease, width 0.2s ease;
86
+ transition:
87
+ transform 0.2s ease,
88
+ width 0.2s ease;
87
89
  }
88
90
 
89
91
  .option {
@@ -1,4 +1,4 @@
1
- import React, { forwardRef, RefObject, useEffect, useState } from 'react';
1
+ import React, { forwardRef, type RefObject, useEffect, useState } from 'react';
2
2
  import cn from 'classnames';
3
3
  import _debounce from 'lodash/debounce';
4
4
 
@@ -6,7 +6,7 @@ import { IconButton } from '@alfalab/core-components-icon-button';
6
6
  import { ChevronLeftCompactSIcon } from '@alfalab/icons-glyph/ChevronLeftCompactSIcon';
7
7
  import { ChevronRightCompactSIcon } from '@alfalab/icons-glyph/ChevronRightCompactSIcon';
8
8
 
9
- import { TabsProps } from '../../typings';
9
+ import { type TabsProps } from '../../typings';
10
10
 
11
11
  import { getDisabledState, scrollIntoFirstTab, scrollIntoLastTab } from './utils';
12
12
 
@@ -1,7 +1,7 @@
1
1
  const ADDITIONAL_OFFSET = 15;
2
2
 
3
3
  function getTabs(container: HTMLDivElement) {
4
- return Array.from(container.querySelectorAll('button[role="tab"]')) as HTMLButtonElement[];
4
+ return Array.from(container.querySelectorAll<HTMLButtonElement>('button[role="tab"]'));
5
5
  }
6
6
 
7
7
  function findLastVisibleTab(container: HTMLDivElement) {
@@ -19,13 +19,16 @@ function findLastVisibleTab(container: HTMLDivElement) {
19
19
  function findFirstVisibleTab(container: HTMLDivElement) {
20
20
  const tabs = getTabs(container);
21
21
 
22
- return tabs.reduceRight((res, tab) => {
23
- if (tab.offsetLeft + tab.clientWidth > container.scrollLeft + ADDITIONAL_OFFSET) {
24
- return tab;
25
- }
22
+ return tabs.reduceRight(
23
+ (res, tab) => {
24
+ if (tab.offsetLeft + tab.clientWidth > container.scrollLeft + ADDITIONAL_OFFSET) {
25
+ return tab;
26
+ }
26
27
 
27
- return res;
28
- }, tabs[tabs.length - 1]);
28
+ return res;
29
+ },
30
+ tabs[tabs.length - 1],
31
+ );
29
32
  }
30
33
 
31
34
  export function scrollIntoLastTab(container: HTMLDivElement | null) {
@@ -1,8 +1,8 @@
1
- import React, { ReactNode, useEffect, useRef, useState } from 'react';
1
+ import React, { type ReactNode, useEffect, useRef, useState } from 'react';
2
2
  import cn from 'classnames';
3
3
  import { compute } from 'compute-scroll-into-view';
4
4
 
5
- import { PlatformProps, TabsProps } from '../../typings';
5
+ import { type PlatformProps, type TabsProps } from '../../typings';
6
6
  import { ScrollControls } from '../scroll-controls';
7
7
 
8
8
  import styles from './index.module.css';
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
 
4
4
  import { TagDesktop } from '@alfalab/core-components-tag/desktop';
5
5
 
6
- import { SecondaryTabListProps } from '../../typings';
6
+ import { type SecondaryTabListProps } from '../../typings';
7
7
 
8
8
  import { SecondaryTabList } from './Component';
9
9
 
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
 
4
4
  import { TagMobile } from '@alfalab/core-components-tag/mobile';
5
5
 
6
- import { SecondaryTabListProps } from '../../typings';
6
+ import { type SecondaryTabListProps } from '../../typings';
7
7
 
8
8
  import { SecondaryTabList } from './Component';
9
9
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { useIsDesktop } from '@alfalab/core-components-mq';
4
4
 
5
- import { SecondaryTabListProps } from '../../typings';
5
+ import { type SecondaryTabListProps } from '../../typings';
6
6
 
7
7
  import { SecondaryTabListDesktop } from './Component.desktop';
8
8
  import { SecondaryTabListMobile } from './Component.mobile';
@@ -4,7 +4,7 @@ import cn from 'classnames';
4
4
  import { Skeleton } from '@alfalab/core-components-skeleton';
5
5
 
6
6
  import { useTabs } from '../../hooks/use-tabs';
7
- import { PlatformProps, SecondaryTabListProps, Styles } from '../../typings';
7
+ import { type PlatformProps, type SecondaryTabListProps, type Styles } from '../../typings';
8
8
  import { ScrollableContainer } from '../scrollable-container';
9
9
 
10
10
  function getBorderRadius(
@@ -1,8 +1,7 @@
1
- import type { AriaAttributes } from 'react';
2
- import React from 'react';
1
+ import React, { type AriaAttributes } from 'react';
3
2
  import cn from 'classnames';
4
3
 
5
- import { TabProps } from '../../typings';
4
+ import { type TabProps } from '../../typings';
6
5
 
7
6
  import styles from './index.module.css';
8
7
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { TabsProps } from '../../typings';
3
+ import { type TabsProps } from '../../typings';
4
4
  import { CollapsiblePrimaryTabList } from '../primary-tablist/Component.collapsible';
5
5
 
6
6
  import { Tabs } from './Component';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { TabsProps } from '../../typings';
3
+ import { type TabsProps } from '../../typings';
4
4
  import { PrimaryTabListDesktop } from '../primary-tablist/Component.desktop';
5
5
  import { SecondaryTabListDesktop } from '../secondary-tablist/Component.desktop';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { TabsProps } from '../../typings';
3
+ import { type TabsProps } from '../../typings';
4
4
  import { PrimaryTabListMobile } from '../primary-tablist/Component.mobile';
5
5
  import { SecondaryTabListMobile } from '../secondary-tablist/Component.mobile';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { TabsProps } from '../../typings';
3
+ import { type TabsProps } from '../../typings';
4
4
  import { PrimaryTabListResponsive } from '../primary-tablist/Component.responsive';
5
5
  import { SecondaryTabListResponsive } from '../secondary-tablist/Component.responsive';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React, { cloneElement } from 'react';
2
2
 
3
- import { TabsProps } from '../../typings';
3
+ import { type TabsProps } from '../../typings';
4
4
 
5
5
  export const Tabs = ({
6
6
  TabList,
@@ -24,9 +24,11 @@ export const Tabs = ({
24
24
  skeletonProps,
25
25
  textStyle,
26
26
  style,
27
+ titleProps,
27
28
  ...restProps
28
29
  }: Omit<TabsProps, 'view'>) => {
29
30
  const tabsArray = React.Children.toArray(children) as TabsProps['children'];
31
+
30
32
  const titles = tabsArray.map(
31
33
  ({
32
34
  props: {
@@ -48,6 +50,7 @@ export const Tabs = ({
48
50
  toggleClassName,
49
51
  dataTestId: toggleTestId,
50
52
  toggleRef,
53
+ ...titleProps,
51
54
  }),
52
55
  );
53
56
 
@@ -1,10 +1,10 @@
1
- import React, { ButtonHTMLAttributes, forwardRef, useEffect, useRef } from 'react';
1
+ import React, { type ButtonHTMLAttributes, forwardRef, useEffect, useRef } from 'react';
2
2
  import mergeRefs from 'react-merge-refs';
3
3
  import cn from 'classnames';
4
4
 
5
- import { Skeleton, SkeletonProps } from '@alfalab/core-components-skeleton';
5
+ import { Skeleton, type SkeletonProps } from '@alfalab/core-components-skeleton';
6
6
 
7
- import { Styles, TabListTitle } from '../../typings';
7
+ import { type Styles, type TabListTitle } from '../../typings';
8
8
 
9
9
  type Props = TabListTitle &
10
10
  Styles &
@@ -1,4 +1,4 @@
1
- import { DependencyList, useRef, useState } from 'react';
1
+ import { type DependencyList, useRef, useState } from 'react';
2
2
  import { ResizeObserver as ResizeObserverPolyfill } from '@juggle/resize-observer';
3
3
 
4
4
  import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
@@ -24,7 +24,7 @@ export const useCollapsibleElements = <
24
24
  const addon = addonRef.current;
25
25
  const containerWidth =
26
26
  (inlineSize || container.clientWidth) - (addon?.scrollWidth || 0) * 1.5; // при расчётах, даём кнопке "Ещё" чуть больше места, чтобы точно влезла
27
- const elements = Array.from(container.querySelectorAll(selectors)) as HTMLElement[];
27
+ const elements = Array.from(container.querySelectorAll<HTMLElement>(selectors));
28
28
 
29
29
  const collapsedIds = elements.reduce<string[]>((acc, element) => {
30
30
  const { offsetLeft, scrollWidth, id } = element;
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
2
2
 
3
3
  import { useIsDesktop } from '@alfalab/core-components-mq';
4
4
 
5
- import { TabListProps } from '../typings';
5
+ import { type TabListProps } from '../typings';
6
6
 
7
7
  import { useCollapsibleElements } from './use-collapsible-elements';
8
8
  import { useTabs } from './use-tabs';
@@ -1,8 +1,8 @@
1
1
  import {
2
- KeyboardEvent,
3
- MouseEvent,
4
- MutableRefObject,
5
- Ref,
2
+ type KeyboardEvent,
3
+ type MouseEvent,
4
+ type MutableRefObject,
5
+ type Ref,
6
6
  useCallback,
7
7
  useRef,
8
8
  useState,
@@ -11,7 +11,7 @@ import mergeRefs from 'react-merge-refs';
11
11
 
12
12
  import { getDataTestId } from '@alfalab/core-components-shared';
13
13
 
14
- import { TabListTitle, UseTabsProps } from '../typings';
14
+ import { type TabListTitle, type UseTabsProps } from '../typings';
15
15
 
16
16
  export function useTabs({ titles = [], selectedId, onChange }: UseTabsProps) {
17
17
  const [selectedTab, setSelectedTab] = useState<HTMLButtonElement | null>(null);
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
 
3
3
  export const createSyntheticEvent = <T extends Element, E extends Event>(
4
4
  event: E,
package/src/typings.ts CHANGED
@@ -1,14 +1,33 @@
1
- import { AriaAttributes, FC, HTMLAttributes, MouseEvent, ReactElement, ReactNode, Ref } from 'react';
2
-
3
- import { SkeletonProps } from '@alfalab/core-components-skeleton';
4
- import { TagProps } from '@alfalab/core-components-tag';
1
+ import {
2
+ type AriaAttributes,
3
+ type FC,
4
+ type HTMLAttributes,
5
+ type MouseEvent,
6
+ type ReactElement,
7
+ type ReactNode,
8
+ type Ref,
9
+ } from 'react';
10
+
11
+ import { type SkeletonProps } from '@alfalab/core-components-skeleton';
12
+ import { type TagProps } from '@alfalab/core-components-tag';
5
13
 
6
14
  export type SelectedId = string | number;
7
-
8
- export interface TabsProps extends Omit<
9
- HTMLAttributes<HTMLDivElement>,
10
- 'onChange' | 'children' | 'className'
11
- >, AriaAttributes {
15
+ export type TitleProps = Omit<
16
+ HTMLAttributes<HTMLButtonElement>,
17
+ | 'onClick'
18
+ | 'onKeyDown'
19
+ | 'className'
20
+ | 'disabled'
21
+ | 'id'
22
+ | 'role'
23
+ | 'tabIndex'
24
+ | 'aria-selected'
25
+ > &
26
+ AriaAttributes;
27
+
28
+ export interface TabsProps
29
+ extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'children' | 'className'>,
30
+ AriaAttributes {
12
31
  /**
13
32
  * Дополнительный класс
14
33
  */
@@ -38,25 +57,25 @@ export interface TabsProps extends Omit<
38
57
  * Стиль текста. Имеет приоритет над size. Работает только в primary табах.
39
58
  */
40
59
  textStyle?:
41
- | 'paragraph-primary-large'
42
- | 'paragraph-primary-medium'
43
- | 'paragraph-primary-small'
44
- | 'action-primary-large'
45
- | 'action-primary-medium'
46
- | 'action-primary-small'
47
- | 'accent-primary-large'
48
- | 'accent-primary-medium'
49
- | 'accent-primary-small'
50
- | 'headline-system-xlarge'
51
- | 'headline-system-large'
52
- | 'headline-system-medium'
53
- | 'headline-system-small'
54
- | 'headline-system-xsmall'
55
- | 'headline-xlarge'
56
- | 'headline-large'
57
- | 'headline-medium'
58
- | 'headline-small'
59
- | 'headline-xsmall';
60
+ | 'paragraph-primary-large'
61
+ | 'paragraph-primary-medium'
62
+ | 'paragraph-primary-small'
63
+ | 'action-primary-large'
64
+ | 'action-primary-medium'
65
+ | 'action-primary-small'
66
+ | 'accent-primary-large'
67
+ | 'accent-primary-medium'
68
+ | 'accent-primary-small'
69
+ | 'headline-system-xlarge'
70
+ | 'headline-system-large'
71
+ | 'headline-system-medium'
72
+ | 'headline-system-small'
73
+ | 'headline-system-xsmall'
74
+ | 'headline-xlarge'
75
+ | 'headline-large'
76
+ | 'headline-medium'
77
+ | 'headline-small'
78
+ | 'headline-xsmall';
60
79
 
61
80
  /**
62
81
  * Высота заголовков табов
@@ -144,6 +163,11 @@ export interface TabsProps extends Omit<
144
163
  * Доп. пропсы для скелетона
145
164
  */
146
165
  skeletonProps?: Omit<SkeletonProps, 'visible'>;
166
+
167
+ /**
168
+ * Доп. пропсы для заголовка таба
169
+ */
170
+ titleProps?: TitleProps;
147
171
  }
148
172
 
149
173
  export interface TabProps extends AriaAttributes {
@@ -201,9 +225,14 @@ export interface TabProps extends AriaAttributes {
201
225
  * Реф для кнопки переключения таба
202
226
  */
203
227
  toggleRef?: Ref<HTMLDivElement>;
228
+
229
+ /**
230
+ * Доп. пропсы для заголовка таба
231
+ */
232
+ titleProps?: TitleProps;
204
233
  }
205
234
 
206
- export interface TabListTitle {
235
+ export interface TabListTitle extends AriaAttributes {
207
236
  title: NonNullable<ReactNode>;
208
237
  id: SelectedId;
209
238
  disabled?: boolean;
@@ -214,26 +243,28 @@ export interface TabListTitle {
214
243
  collapsed?: boolean;
215
244
  dataTestId?: string;
216
245
  toggleRef?: Ref<HTMLDivElement>;
246
+ titleProps?: TitleProps;
217
247
  }
218
248
 
219
- export interface TabListProps extends Pick<
220
- TabsProps,
221
- | 'className'
222
- | 'containerClassName'
223
- | 'size'
224
- | 'defaultMatchMediaValue'
225
- | 'selectedId'
226
- | 'scrollable'
227
- | 'collapsedTabsIds'
228
- | 'onChange'
229
- | 'dataTestId'
230
- | 'fullWidthScroll'
231
- | 'tagShape'
232
- | 'tagView'
233
- | 'textStyle'
234
- | 'showSkeleton'
235
- | 'skeletonProps'
236
- > {
249
+ export interface TabListProps
250
+ extends Pick<
251
+ TabsProps,
252
+ | 'className'
253
+ | 'containerClassName'
254
+ | 'size'
255
+ | 'defaultMatchMediaValue'
256
+ | 'selectedId'
257
+ | 'scrollable'
258
+ | 'collapsedTabsIds'
259
+ | 'onChange'
260
+ | 'dataTestId'
261
+ | 'fullWidthScroll'
262
+ | 'tagShape'
263
+ | 'tagView'
264
+ | 'textStyle'
265
+ | 'showSkeleton'
266
+ | 'skeletonProps'
267
+ > {
237
268
  /**
238
269
  * Заголовки табов
239
270
  */
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  export declare const createSyntheticEvent: <T extends Element, E extends Event>(event: E) => React.SyntheticEvent<T, E>;
3
3
  export declare const createUIEvent: <T extends Element, E extends Event>(event: E) => React.UIEvent<T, E>;
4
4
  export declare const createSyntheticMouseEvent: <T extends Element>(event: MouseEvent) => React.MouseEvent<T, MouseEvent>;
@@ -1 +1 @@
1
- {"version":3,"file":"synthetic-events.js","sources":["src/synthetic-events.ts"],"sourcesContent":["import React from 'react';\n\nexport const createSyntheticEvent = <T extends Element, E extends Event>(\n event: E,\n): React.SyntheticEvent<T, E> => {\n let isDefaultPrevented = false;\n let isPropagationStopped = false;\n const preventDefault = () => {\n isDefaultPrevented = true;\n event.preventDefault();\n };\n const stopPropagation = () => {\n isPropagationStopped = true;\n event.stopPropagation();\n };\n\n return {\n nativeEvent: event,\n currentTarget: event.currentTarget as EventTarget & T,\n target: event.target as EventTarget & T,\n bubbles: event.bubbles,\n cancelable: event.cancelable,\n defaultPrevented: event.defaultPrevented,\n eventPhase: event.eventPhase,\n isTrusted: event.isTrusted,\n preventDefault,\n isDefaultPrevented: () => isDefaultPrevented,\n stopPropagation,\n isPropagationStopped: () => isPropagationStopped,\n persist: () => {},\n timeStamp: event.timeStamp,\n type: event.type,\n };\n};\n\nexport const createUIEvent = <T extends Element, E extends Event>(\n event: E,\n): React.UIEvent<T, E> => ({\n ...createSyntheticEvent(event),\n detail: 0,\n view: {\n styleMedia: {\n type: '',\n matchMedium: () => false,\n },\n document,\n },\n});\n\nexport const createSyntheticMouseEvent = <T extends Element>(\n event: MouseEvent,\n): React.MouseEvent<T, MouseEvent> => ({\n ...createUIEvent<T, MouseEvent>(event),\n altKey: event.altKey,\n button: event.button,\n buttons: event.buttons,\n clientX: event.clientX,\n clientY: event.clientY,\n ctrlKey: event.ctrlKey,\n getModifierState: event.getModifierState,\n metaKey: event.metaKey,\n movementX: event.movementX,\n movementY: event.movementY,\n pageX: event.pageX,\n pageY: event.pageY,\n relatedTarget: event.relatedTarget,\n screenX: event.screenX,\n screenY: event.screenY,\n shiftKey: event.shiftKey,\n});\n"],"names":["__assign"],"mappings":";;;;;;AAEO,IAAM,oBAAoB,GAAG,UAChC,KAAQ,EAAA;IAER,IAAI,kBAAkB,GAAG,KAAK;IAC9B,IAAI,oBAAoB,GAAG,KAAK;AAChC,IAAA,IAAM,cAAc,GAAG,YAAA;QACnB,kBAAkB,GAAG,IAAI;QACzB,KAAK,CAAC,cAAc,EAAE;AAC1B,KAAC;AACD,IAAA,IAAM,eAAe,GAAG,YAAA;QACpB,oBAAoB,GAAG,IAAI;QAC3B,KAAK,CAAC,eAAe,EAAE;AAC3B,KAAC;IAED,OAAO;AACH,QAAA,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,KAAK,CAAC,aAAgC;QACrD,MAAM,EAAE,KAAK,CAAC,MAAyB;QACvC,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;AAC1B,QAAA,cAAc,EAAA,cAAA;AACd,QAAA,kBAAkB,EAAE,YAAA,EAAM,OAAA,kBAAkB,GAAA;AAC5C,QAAA,eAAe,EAAA,eAAA;AACf,QAAA,oBAAoB,EAAE,YAAA,EAAM,OAAA,oBAAoB,GAAA;QAChD,OAAO,EAAE,eAAQ;QACjB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,IAAI,EAAE,KAAK,CAAC,IAAI;KACnB;AACL;AAEa,IAAA,aAAa,GAAG,UACzB,KAAQ,IACc,QAAAA,cAAA,CAAAA,cAAA,CAAA,EAAA,EACnB,oBAAoB,CAAC,KAAK,CAAC,CAC9B,EAAA,EAAA,MAAM,EAAE,CAAC,EACT,IAAI,EAAE;AACF,QAAA,UAAU,EAAE;AACR,YAAA,IAAI,EAAE,EAAE;AACR,YAAA,WAAW,EAAE,YAAA,EAAM,OAAA,KAAK,GAAA;AAC3B,SAAA;AACD,QAAA,QAAQ,EAAA,QAAA;KACX,EACH,CAAA,EAAA;AAEW,IAAA,yBAAyB,GAAG,UACrC,KAAiB,EACiB,EAAA,QAC/BA,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAA,aAAa,CAAgB,KAAK,CAAC,CACtC,EAAA,EAAA,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EACxC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAA,CAAA,EAjBU;;;;;;"}
1
+ {"version":3,"file":"synthetic-events.js","sources":["src/synthetic-events.ts"],"sourcesContent":["import type React from 'react';\n\nexport const createSyntheticEvent = <T extends Element, E extends Event>(\n event: E,\n): React.SyntheticEvent<T, E> => {\n let isDefaultPrevented = false;\n let isPropagationStopped = false;\n const preventDefault = () => {\n isDefaultPrevented = true;\n event.preventDefault();\n };\n const stopPropagation = () => {\n isPropagationStopped = true;\n event.stopPropagation();\n };\n\n return {\n nativeEvent: event,\n currentTarget: event.currentTarget as EventTarget & T,\n target: event.target as EventTarget & T,\n bubbles: event.bubbles,\n cancelable: event.cancelable,\n defaultPrevented: event.defaultPrevented,\n eventPhase: event.eventPhase,\n isTrusted: event.isTrusted,\n preventDefault,\n isDefaultPrevented: () => isDefaultPrevented,\n stopPropagation,\n isPropagationStopped: () => isPropagationStopped,\n persist: () => {},\n timeStamp: event.timeStamp,\n type: event.type,\n };\n};\n\nexport const createUIEvent = <T extends Element, E extends Event>(\n event: E,\n): React.UIEvent<T, E> => ({\n ...createSyntheticEvent(event),\n detail: 0,\n view: {\n styleMedia: {\n type: '',\n matchMedium: () => false,\n },\n document,\n },\n});\n\nexport const createSyntheticMouseEvent = <T extends Element>(\n event: MouseEvent,\n): React.MouseEvent<T, MouseEvent> => ({\n ...createUIEvent<T, MouseEvent>(event),\n altKey: event.altKey,\n button: event.button,\n buttons: event.buttons,\n clientX: event.clientX,\n clientY: event.clientY,\n ctrlKey: event.ctrlKey,\n getModifierState: event.getModifierState,\n metaKey: event.metaKey,\n movementX: event.movementX,\n movementY: event.movementY,\n pageX: event.pageX,\n pageY: event.pageY,\n relatedTarget: event.relatedTarget,\n screenX: event.screenX,\n screenY: event.screenY,\n shiftKey: event.shiftKey,\n});\n"],"names":["__assign"],"mappings":";;;;;;AAEO,IAAM,oBAAoB,GAAG,UAChC,KAAQ,EAAA;IAER,IAAI,kBAAkB,GAAG,KAAK;IAC9B,IAAI,oBAAoB,GAAG,KAAK;AAChC,IAAA,IAAM,cAAc,GAAG,YAAA;QACnB,kBAAkB,GAAG,IAAI;QACzB,KAAK,CAAC,cAAc,EAAE;AAC1B,KAAC;AACD,IAAA,IAAM,eAAe,GAAG,YAAA;QACpB,oBAAoB,GAAG,IAAI;QAC3B,KAAK,CAAC,eAAe,EAAE;AAC3B,KAAC;IAED,OAAO;AACH,QAAA,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,KAAK,CAAC,aAAgC;QACrD,MAAM,EAAE,KAAK,CAAC,MAAyB;QACvC,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;AAC1B,QAAA,cAAc,EAAA,cAAA;AACd,QAAA,kBAAkB,EAAE,YAAA,EAAM,OAAA,kBAAkB,GAAA;AAC5C,QAAA,eAAe,EAAA,eAAA;AACf,QAAA,oBAAoB,EAAE,YAAA,EAAM,OAAA,oBAAoB,GAAA;QAChD,OAAO,EAAE,eAAQ;QACjB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,IAAI,EAAE,KAAK,CAAC,IAAI;KACnB;AACL;AAEa,IAAA,aAAa,GAAG,UACzB,KAAQ,IACc,QAAAA,cAAA,CAAAA,cAAA,CAAA,EAAA,EACnB,oBAAoB,CAAC,KAAK,CAAC,CAC9B,EAAA,EAAA,MAAM,EAAE,CAAC,EACT,IAAI,EAAE;AACF,QAAA,UAAU,EAAE;AACR,YAAA,IAAI,EAAE,EAAE;AACR,YAAA,WAAW,EAAE,YAAA,EAAM,OAAA,KAAK,GAAA;AAC3B,SAAA;AACD,QAAA,QAAQ,EAAA,QAAA;KACX,EACH,CAAA,EAAA;AAEW,IAAA,yBAAyB,GAAG,UACrC,KAAiB,EACiB,EAAA,QAC/BA,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAA,aAAa,CAAgB,KAAK,CAAC,CACtC,EAAA,EAAA,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EACxC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAA,CAAA,EAjBU;;;;;;"}
package/typings.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { AriaAttributes, FC, HTMLAttributes, MouseEvent, ReactElement, ReactNode, Ref } from 'react';
2
- import { SkeletonProps } from '@alfalab/core-components-skeleton';
3
- import { TagProps } from '@alfalab/core-components-tag';
1
+ import { type AriaAttributes, type FC, type HTMLAttributes, type MouseEvent, type ReactElement, type ReactNode, type Ref } from 'react';
2
+ import { type SkeletonProps } from '@alfalab/core-components-skeleton';
3
+ import { type TagProps } from '@alfalab/core-components-tag';
4
4
  export declare type SelectedId = string | number;
5
+ export declare type TitleProps = Omit<HTMLAttributes<HTMLButtonElement>, 'onClick' | 'onKeyDown' | 'className' | 'disabled' | 'id' | 'role' | 'tabIndex' | 'aria-selected'> & AriaAttributes;
5
6
  export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'children' | 'className'>, AriaAttributes {
6
7
  /**
7
8
  * Дополнительный класс
@@ -99,6 +100,10 @@ export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChang
99
100
  * Доп. пропсы для скелетона
100
101
  */
101
102
  skeletonProps?: Omit<SkeletonProps, 'visible'>;
103
+ /**
104
+ * Доп. пропсы для заголовка таба
105
+ */
106
+ titleProps?: TitleProps;
102
107
  }
103
108
  export interface TabProps extends AriaAttributes {
104
109
  /**
@@ -145,8 +150,12 @@ export interface TabProps extends AriaAttributes {
145
150
  * Реф для кнопки переключения таба
146
151
  */
147
152
  toggleRef?: Ref<HTMLDivElement>;
153
+ /**
154
+ * Доп. пропсы для заголовка таба
155
+ */
156
+ titleProps?: TitleProps;
148
157
  }
149
- export interface TabListTitle {
158
+ export interface TabListTitle extends AriaAttributes {
150
159
  title: NonNullable<ReactNode>;
151
160
  id: SelectedId;
152
161
  disabled?: boolean;
@@ -157,6 +166,7 @@ export interface TabListTitle {
157
166
  collapsed?: boolean;
158
167
  dataTestId?: string;
159
168
  toggleRef?: Ref<HTMLDivElement>;
169
+ titleProps?: TitleProps;
160
170
  }
161
171
  export interface TabListProps extends Pick<TabsProps, 'className' | 'containerClassName' | 'size' | 'defaultMatchMediaValue' | 'selectedId' | 'scrollable' | 'collapsedTabsIds' | 'onChange' | 'dataTestId' | 'fullWidthScroll' | 'tagShape' | 'tagView' | 'textStyle' | 'showSkeleton' | 'skeletonProps'> {
162
172
  /**