intelicoreact 2.0.11 → 2.0.12

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.
@@ -1,5 +1,21 @@
1
1
  import type React from 'react';
2
2
  import type { IUniProps } from '../../../types/base.interface';
3
+ /**
4
+ * Компонент ссылки для menu-пунктов аккордеона (`item.children`).
5
+ * По умолчанию AccordionItem рендерит обычный `<a href>` и НЕ зависит от
6
+ * react-router-dom (это позволяет Table -> TdCell жить в subpath "ui" без
7
+ * роутера). Router-aware Accordion (subpath "router-ui") передаёт сюда
8
+ * NavLink, сохраняя SPA-навигацию и active-состояние.
9
+ *
10
+ * Намеренно голая call-signature, а не React.ComponentType: у NavLink поле
11
+ * propTypes типизировано Validator<To>, и ComponentType-вариант ломает
12
+ * assignability (Validator<To> vs Validator<string>).
13
+ */
14
+ export type AccordionLinkComponent = (props: {
15
+ to: string;
16
+ className?: string;
17
+ children?: React.ReactNode;
18
+ }) => React.ReactElement | null;
3
19
  export interface IAccordionItemProps extends IUniProps {
4
20
  item: {
5
21
  icon: string;
@@ -26,6 +42,7 @@ export interface IAccordionItemProps extends IUniProps {
26
42
  isOpen: boolean;
27
43
  children?: React.ReactNode;
28
44
  noChevron?: boolean;
45
+ linkComponent?: AccordionLinkComponent;
29
46
  }
30
47
  export interface IAccordionProps extends IUniProps {
31
48
  items: Array<{
@@ -1,3 +1,3 @@
1
1
  import Accordion from './Accordion';
2
2
  export default Accordion;
3
- export type { IAccordionItemProps, IAccordionProps } from './Accordion.interface';
3
+ export type { AccordionLinkComponent, IAccordionItemProps, IAccordionProps } from './Accordion.interface';