@alfalab/core-components-tabs 8.6.8 → 8.7.1

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 (84) hide show
  1. package/components/primary-tablist/Component.collapsible.js +2 -2
  2. package/components/primary-tablist/Component.desktop.js +1 -1
  3. package/components/primary-tablist/Component.mobile.js +2 -2
  4. package/components/primary-tablist/index.css +133 -133
  5. package/components/primary-tablist/mobile.css +394 -368
  6. package/components/scroll-controls/Component.js +1 -1
  7. package/components/scroll-controls/index.css +12 -12
  8. package/components/scrollable-container/Component.js +1 -1
  9. package/components/scrollable-container/index.css +6 -6
  10. package/components/secondary-tablist/Component.desktop.js +1 -1
  11. package/components/secondary-tablist/Component.mobile.js +2 -2
  12. package/components/secondary-tablist/index.css +11 -11
  13. package/components/secondary-tablist/mobile.css +186 -160
  14. package/components/tab/Component.js +1 -1
  15. package/components/tab/index.css +3 -3
  16. package/components/tabs/Component.d.ts +1 -1
  17. package/components/tabs/Component.js +2 -2
  18. package/components/title/Component.d.ts +1 -1
  19. package/cssm/components/primary-tablist/Component.collapsible.js +1 -1
  20. package/cssm/components/primary-tablist/index.module.css +1 -1
  21. package/cssm/components/tabs/Component.d.ts +1 -1
  22. package/cssm/components/tabs/Component.js +2 -2
  23. package/cssm/components/title/Component.d.ts +1 -1
  24. package/cssm/hooks/use-tablist-titles.d.ts +1 -1
  25. package/cssm/typings.d.ts +7 -2
  26. package/esm/components/primary-tablist/Component.collapsible.js +2 -2
  27. package/esm/components/primary-tablist/Component.desktop.js +1 -1
  28. package/esm/components/primary-tablist/Component.mobile.js +2 -2
  29. package/esm/components/primary-tablist/index.css +133 -133
  30. package/esm/components/primary-tablist/mobile.css +394 -368
  31. package/esm/components/scroll-controls/Component.js +1 -1
  32. package/esm/components/scroll-controls/index.css +12 -12
  33. package/esm/components/scrollable-container/Component.js +1 -1
  34. package/esm/components/scrollable-container/index.css +6 -6
  35. package/esm/components/secondary-tablist/Component.desktop.js +1 -1
  36. package/esm/components/secondary-tablist/Component.mobile.js +2 -2
  37. package/esm/components/secondary-tablist/index.css +11 -11
  38. package/esm/components/secondary-tablist/mobile.css +186 -160
  39. package/esm/components/tab/Component.js +1 -1
  40. package/esm/components/tab/index.css +3 -3
  41. package/esm/components/tabs/Component.d.ts +1 -1
  42. package/esm/components/tabs/Component.js +2 -2
  43. package/esm/components/title/Component.d.ts +1 -1
  44. package/esm/hooks/use-tablist-titles.d.ts +1 -1
  45. package/esm/index.module-7f53615c.js +4 -0
  46. package/esm/index.module-f25eb728.js +4 -0
  47. package/esm/typings.d.ts +7 -2
  48. package/hooks/use-tablist-titles.d.ts +1 -1
  49. package/index.module-1eb43fb9.js +6 -0
  50. package/index.module-c88e5a5a.js +6 -0
  51. package/modern/components/primary-tablist/Component.collapsible.js +2 -2
  52. package/modern/components/primary-tablist/Component.desktop.js +1 -1
  53. package/modern/components/primary-tablist/Component.mobile.js +2 -2
  54. package/modern/components/primary-tablist/index.css +133 -133
  55. package/modern/components/primary-tablist/mobile.css +394 -368
  56. package/modern/components/scroll-controls/Component.js +1 -1
  57. package/modern/components/scroll-controls/index.css +12 -12
  58. package/modern/components/scrollable-container/Component.js +1 -1
  59. package/modern/components/scrollable-container/index.css +6 -6
  60. package/modern/components/secondary-tablist/Component.desktop.js +1 -1
  61. package/modern/components/secondary-tablist/Component.mobile.js +2 -2
  62. package/modern/components/secondary-tablist/index.css +11 -11
  63. package/modern/components/secondary-tablist/mobile.css +186 -160
  64. package/modern/components/tab/Component.js +1 -1
  65. package/modern/components/tab/index.css +3 -3
  66. package/modern/components/tabs/Component.d.ts +1 -1
  67. package/modern/components/tabs/Component.js +2 -2
  68. package/modern/components/title/Component.d.ts +1 -1
  69. package/modern/hooks/use-tablist-titles.d.ts +1 -1
  70. package/modern/index.module-8121bd57.js +4 -0
  71. package/modern/index.module-c6da7192.js +4 -0
  72. package/modern/typings.d.ts +7 -2
  73. package/package.json +3 -3
  74. package/src/components/primary-tablist/Component.collapsible.tsx +1 -1
  75. package/src/components/tabs/Component.tsx +2 -1
  76. package/src/components/title/Component.tsx +4 -1
  77. package/src/typings.ts +7 -2
  78. package/typings.d.ts +7 -2
  79. package/esm/index.module-72926b9d.js +0 -4
  80. package/esm/index.module-98725e10.js +0 -4
  81. package/index.module-4fce9d75.js +0 -6
  82. package/index.module-5e20b70a.js +0 -6
  83. package/modern/index.module-322d9547.js +0 -4
  84. package/modern/index.module-6c45f929.js +0 -4
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { TabsProps } from "../../typings";
4
- declare const Tabs: ({ TabList, className, containerClassName, size, defaultMatchMediaValue, children, selectedId, scrollable, collapsedTabsIds, fullWidthScroll, keepMounted, dataTestId, onChange, breakpoint, tagShape, tagView, textStyle, }: Omit<TabsProps, 'view'>) => React.JSX.Element;
4
+ declare const Tabs: ({ TabList, className, containerClassName, size, defaultMatchMediaValue, children, selectedId, scrollable, collapsedTabsIds, fullWidthScroll, keepMounted, dataTestId, onChange, breakpoint, tagShape, tagView, textStyle, style, }: Omit<TabsProps, 'view'>) => React.JSX.Element;
5
5
  export { Tabs };
@@ -9,7 +9,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
9
9
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
10
 
11
11
  var Tabs = function (_a) {
12
- var TabList = _a.TabList, className = _a.className, containerClassName = _a.containerClassName, size = _a.size, defaultMatchMediaValue = _a.defaultMatchMediaValue, children = _a.children, selectedId = _a.selectedId, scrollable = _a.scrollable, collapsedTabsIds = _a.collapsedTabsIds, _b = _a.fullWidthScroll, fullWidthScroll = _b === void 0 ? false : _b, _c = _a.keepMounted, keepMounted = _c === void 0 ? false : _c, dataTestId = _a.dataTestId, onChange = _a.onChange, _d = _a.breakpoint, breakpoint = _d === void 0 ? 1024 : _d, tagShape = _a.tagShape, tagView = _a.tagView, textStyle = _a.textStyle;
12
+ var TabList = _a.TabList, className = _a.className, containerClassName = _a.containerClassName, size = _a.size, defaultMatchMediaValue = _a.defaultMatchMediaValue, children = _a.children, selectedId = _a.selectedId, scrollable = _a.scrollable, collapsedTabsIds = _a.collapsedTabsIds, _b = _a.fullWidthScroll, fullWidthScroll = _b === void 0 ? false : _b, _c = _a.keepMounted, keepMounted = _c === void 0 ? false : _c, dataTestId = _a.dataTestId, onChange = _a.onChange, _d = _a.breakpoint, breakpoint = _d === void 0 ? 1024 : _d, tagShape = _a.tagShape, tagView = _a.tagView, textStyle = _a.textStyle, style = _a.style;
13
13
  var tabsArray = React__default.default.Children.toArray(children);
14
14
  var titles = tabsArray.map(function (_a) {
15
15
  var _b = _a.props, title = _b.title, id = _b.id, rightAddons = _b.rightAddons, disabled = _b.disabled, hidden = _b.hidden, toggleClassName = _b.toggleClassName, toggleTestId = _b.dataTestId, toggleRef = _b.toggleRef;
@@ -25,7 +25,7 @@ var Tabs = function (_a) {
25
25
  });
26
26
  });
27
27
  var tabs = tabsArray.filter(function (tab) { return tab.props.id === selectedId || tab.props.keepMounted || keepMounted; });
28
- return (React__default.default.createElement("div", { className: className },
28
+ return (React__default.default.createElement("div", { className: className, style: style },
29
29
  React__default.default.createElement(TabList, { containerClassName: containerClassName, size: size, titles: titles, selectedId: selectedId, scrollable: scrollable, collapsedTabsIds: collapsedTabsIds, onChange: onChange, dataTestId: dataTestId, defaultMatchMediaValue: defaultMatchMediaValue, fullWidthScroll: fullWidthScroll, breakpoint: breakpoint, tagShape: tagShape, tagView: tagView, textStyle: textStyle }),
30
30
  tabs.map(function (tab) { return React.cloneElement(tab, { hidden: tab.props.id !== selectedId }); })));
31
31
  };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { Styles, TabListTitle } from "../../typings";
4
- declare const Title: React.ForwardRefExoticComponent<TabListTitle & Styles & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "id"> & {
4
+ declare const Title: React.ForwardRefExoticComponent<TabListTitle & Styles & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "title" | "id"> & {
5
5
  focused?: boolean | undefined;
6
6
  isOption?: boolean | undefined;
7
7
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -41,7 +41,7 @@ var CollapsiblePrimaryTabList = function (_a) {
41
41
  var toggleRef = _a.toggleRef, title = tslib.__rest(_a, ["toggleRef"]);
42
42
  if (title.collapsed) {
43
43
  options.push({
44
- key: title.title,
44
+ key: String(title.id),
45
45
  value: title.id,
46
46
  content: (React__default.default.createElement(components_title_Component.Title, tslib.__assign({}, title, { ref: toggleRef, styles: styles__default.default, isOption: true }))),
47
47
  });
@@ -3,7 +3,7 @@
3
3
  --color-light-accent-primary: #ef3124;
4
4
  --color-light-border-link: #2288fa;
5
5
  --color-light-neutral-translucent-500: rgba(9, 12, 37, 0.28);
6
- --color-light-text-primary: #0e0e0e;
6
+ --color-light-text-primary: rgba(3, 3, 6, 0.88);
7
7
  --color-light-text-secondary: rgba(4, 4, 19, 0.55);
8
8
  --color-light-text-tertiary: rgba(5, 8, 29, 0.38); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
9
9
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { TabsProps } from "../../typings";
4
- declare const Tabs: ({ TabList, className, containerClassName, size, defaultMatchMediaValue, children, selectedId, scrollable, collapsedTabsIds, fullWidthScroll, keepMounted, dataTestId, onChange, breakpoint, tagShape, tagView, textStyle, }: Omit<TabsProps, 'view'>) => React.JSX.Element;
4
+ declare const Tabs: ({ TabList, className, containerClassName, size, defaultMatchMediaValue, children, selectedId, scrollable, collapsedTabsIds, fullWidthScroll, keepMounted, dataTestId, onChange, breakpoint, tagShape, tagView, textStyle, style, }: Omit<TabsProps, 'view'>) => React.JSX.Element;
5
5
  export { Tabs };
@@ -9,7 +9,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
9
9
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
10
 
11
11
  var Tabs = function (_a) {
12
- var TabList = _a.TabList, className = _a.className, containerClassName = _a.containerClassName, size = _a.size, defaultMatchMediaValue = _a.defaultMatchMediaValue, children = _a.children, selectedId = _a.selectedId, scrollable = _a.scrollable, collapsedTabsIds = _a.collapsedTabsIds, _b = _a.fullWidthScroll, fullWidthScroll = _b === void 0 ? false : _b, _c = _a.keepMounted, keepMounted = _c === void 0 ? false : _c, dataTestId = _a.dataTestId, onChange = _a.onChange, _d = _a.breakpoint, breakpoint = _d === void 0 ? 1024 : _d, tagShape = _a.tagShape, tagView = _a.tagView, textStyle = _a.textStyle;
12
+ var TabList = _a.TabList, className = _a.className, containerClassName = _a.containerClassName, size = _a.size, defaultMatchMediaValue = _a.defaultMatchMediaValue, children = _a.children, selectedId = _a.selectedId, scrollable = _a.scrollable, collapsedTabsIds = _a.collapsedTabsIds, _b = _a.fullWidthScroll, fullWidthScroll = _b === void 0 ? false : _b, _c = _a.keepMounted, keepMounted = _c === void 0 ? false : _c, dataTestId = _a.dataTestId, onChange = _a.onChange, _d = _a.breakpoint, breakpoint = _d === void 0 ? 1024 : _d, tagShape = _a.tagShape, tagView = _a.tagView, textStyle = _a.textStyle, style = _a.style;
13
13
  var tabsArray = React__default.default.Children.toArray(children);
14
14
  var titles = tabsArray.map(function (_a) {
15
15
  var _b = _a.props, title = _b.title, id = _b.id, rightAddons = _b.rightAddons, disabled = _b.disabled, hidden = _b.hidden, toggleClassName = _b.toggleClassName, toggleTestId = _b.dataTestId, toggleRef = _b.toggleRef;
@@ -25,7 +25,7 @@ var Tabs = function (_a) {
25
25
  });
26
26
  });
27
27
  var tabs = tabsArray.filter(function (tab) { return tab.props.id === selectedId || tab.props.keepMounted || keepMounted; });
28
- return (React__default.default.createElement("div", { className: className },
28
+ return (React__default.default.createElement("div", { className: className, style: style },
29
29
  React__default.default.createElement(TabList, { containerClassName: containerClassName, size: size, titles: titles, selectedId: selectedId, scrollable: scrollable, collapsedTabsIds: collapsedTabsIds, onChange: onChange, dataTestId: dataTestId, defaultMatchMediaValue: defaultMatchMediaValue, fullWidthScroll: fullWidthScroll, breakpoint: breakpoint, tagShape: tagShape, tagView: tagView, textStyle: textStyle }),
30
30
  tabs.map(function (tab) { return React.cloneElement(tab, { hidden: tab.props.id !== selectedId }); })));
31
31
  };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { Styles, TabListTitle } from "../../typings";
4
- declare const Title: React.ForwardRefExoticComponent<TabListTitle & Styles & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "id"> & {
4
+ declare const Title: React.ForwardRefExoticComponent<TabListTitle & Styles & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "title" | "id"> & {
5
5
  focused?: boolean | undefined;
6
6
  isOption?: boolean | undefined;
7
7
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -6,7 +6,7 @@ declare const useTablistTitles: ({ titles, selectedId, collapsedTabsIds, breakpo
6
6
  tablistTitles: {
7
7
  collapsed: boolean;
8
8
  selected: boolean;
9
- title: string;
9
+ title: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal;
10
10
  id: import("../typings").SelectedId;
11
11
  disabled?: boolean | undefined;
12
12
  rightAddons?: import("react").ReactNode;
package/cssm/typings.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FC, MouseEvent, ReactElement, ReactNode, Ref } from 'react';
2
3
  import { TagProps } from "@alfalab/core-components-tag";
3
4
  type SelectedId = string | number;
@@ -81,6 +82,10 @@ type TabsProps = {
81
82
  * Стиль тега (для view secondary только)
82
83
  */
83
84
  tagView?: TagProps['view'];
85
+ /**
86
+ * Дополнительные инлайн стили для враппера
87
+ */
88
+ style?: React.CSSProperties;
84
89
  };
85
90
  type TabProps = {
86
91
  /**
@@ -90,7 +95,7 @@ type TabProps = {
90
95
  /**
91
96
  * Заголовок таба
92
97
  */
93
- title: string;
98
+ title: NonNullable<ReactNode>;
94
99
  /**
95
100
  * Дополнительный класс для контейнера содержимого таба
96
101
  */
@@ -129,7 +134,7 @@ type TabProps = {
129
134
  toggleRef?: Ref<HTMLDivElement>;
130
135
  };
131
136
  type TabListTitle = {
132
- title: string;
137
+ title: NonNullable<ReactNode>;
133
138
  id: SelectedId;
134
139
  disabled?: boolean;
135
140
  rightAddons?: ReactNode;
@@ -7,7 +7,7 @@ import { PickerButtonDesktop } from '@alfalab/core-components-picker-button/esm/
7
7
  import { useTablistTitles } from '../../hooks/use-tablist-titles.js';
8
8
  import { createSyntheticMouseEvent } from '../../synthetic-events.js';
9
9
  import { Title } from '../title/Component.js';
10
- import { s as styles } from '../../index.module-98725e10.js';
10
+ import { s as styles } from '../../index.module-7f53615c.js';
11
11
 
12
12
  var CollapsiblePrimaryTabList = function (_a) {
13
13
  var _b = _a.size, size = _b === void 0 ? 'm' : _b, className = _a.className, containerClassName = _a.containerClassName, _c = _a.titles, titles = _c === void 0 ? [] : _c, _d = _a.selectedId, selectedId = _d === void 0 ? titles.length ? titles[0].id : undefined : _d, collapsedTabsIds = _a.collapsedTabsIds, fullWidthScroll = _a.fullWidthScroll, onChange = _a.onChange, dataTestId = _a.dataTestId, _e = _a.breakpoint, breakpoint = _e === void 0 ? 1024 : _e, defaultMatchMediaValue = _a.defaultMatchMediaValue, textStyle = _a.textStyle;
@@ -31,7 +31,7 @@ var CollapsiblePrimaryTabList = function (_a) {
31
31
  var toggleRef = _a.toggleRef, title = __rest(_a, ["toggleRef"]);
32
32
  if (title.collapsed) {
33
33
  options.push({
34
- key: title.title,
34
+ key: String(title.id),
35
35
  value: title.id,
36
36
  content: (React.createElement(Title, __assign({}, title, { ref: toggleRef, styles: styles, isOption: true }))),
37
37
  });
@@ -1,7 +1,7 @@
1
1
  import { __rest, __assign } from 'tslib';
2
2
  import React from 'react';
3
3
  import { PrimaryTabList } from './Component.js';
4
- import { s as styles } from '../../index.module-98725e10.js';
4
+ import { s as styles } from '../../index.module-7f53615c.js';
5
5
 
6
6
  var PrimaryTabListDesktop = function (_a) {
7
7
  var _b = _a.size, size = _b === void 0 ? 'm' : _b, restProps = __rest(_a, ["size"]);
@@ -1,9 +1,9 @@
1
1
  import { __assign } from 'tslib';
2
2
  import React from 'react';
3
3
  import { PrimaryTabList } from './Component.js';
4
- import { s as styles$1 } from '../../index.module-98725e10.js';
4
+ import { s as styles$1 } from '../../index.module-7f53615c.js';
5
5
 
6
- var mobileStyles = {"title":"tabs__title_18jc9 tabs__title_17jvt","mobile":"tabs__mobile_18jc9","paragraph-primary-large":"tabs__paragraph-primary-large_18jc9","paragraph-primary-medium":"tabs__paragraph-primary-medium_18jc9","paragraph-primary-small":"tabs__paragraph-primary-small_18jc9","action-primary-large":"tabs__action-primary-large_18jc9","action-primary-medium":"tabs__action-primary-medium_18jc9","action-primary-small":"tabs__action-primary-small_18jc9","accent-primary-large":"tabs__accent-primary-large_18jc9","accent-primary-medium":"tabs__accent-primary-medium_18jc9","accent-primary-small":"tabs__accent-primary-small_18jc9","pickerWrapper":"tabs__pickerWrapper_18jc9","option":"tabs__option_18jc9","scrollControls":"tabs__scrollControls_18jc9","headline-system-xlarge":"tabs__headline-system-xlarge_18jc9","headline-system-large":"tabs__headline-system-large_18jc9","headline-system-medium":"tabs__headline-system-medium_18jc9","headline-system-small":"tabs__headline-system-small_18jc9","headline-system-xsmall":"tabs__headline-system-xsmall_18jc9","headline-xlarge":"tabs__headline-xlarge_18jc9","headline-large":"tabs__headline-large_18jc9","headline-medium":"tabs__headline-medium_18jc9","headline-small":"tabs__headline-small_18jc9","headline-xsmall":"tabs__headline-xsmall_18jc9"};
6
+ var mobileStyles = {"title":"tabs__title_i1462 tabs__title_15a3z","mobile":"tabs__mobile_i1462","paragraph-primary-large":"tabs__paragraph-primary-large_i1462","paragraph-primary-medium":"tabs__paragraph-primary-medium_i1462","paragraph-primary-small":"tabs__paragraph-primary-small_i1462","action-primary-large":"tabs__action-primary-large_i1462","action-primary-medium":"tabs__action-primary-medium_i1462","action-primary-small":"tabs__action-primary-small_i1462","accent-primary-large":"tabs__accent-primary-large_i1462","accent-primary-medium":"tabs__accent-primary-medium_i1462","accent-primary-small":"tabs__accent-primary-small_i1462","pickerWrapper":"tabs__pickerWrapper_i1462","option":"tabs__option_i1462","scrollControls":"tabs__scrollControls_i1462","headline-system-xlarge":"tabs__headline-system-xlarge_i1462","headline-system-large":"tabs__headline-system-large_i1462","headline-system-medium":"tabs__headline-system-medium_i1462","headline-system-small":"tabs__headline-system-small_i1462","headline-system-xsmall":"tabs__headline-system-xsmall_i1462","headline-xlarge":"tabs__headline-xlarge_i1462","headline-large":"tabs__headline-large_i1462","headline-medium":"tabs__headline-medium_i1462","headline-small":"tabs__headline-small_i1462","headline-xsmall":"tabs__headline-xsmall_i1462"};
7
7
  require('./mobile.css')
8
8
 
9
9
  var styles = __assign(__assign({}, styles$1), mobileStyles);