@koslibs/components 1.14.0 → 1.14.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @koslibs/components
2
2
 
3
+ ## 1.14.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#17](https://github.com/koslibs/components/pull/17) [`b2d48a4`](https://github.com/koslibs/components/commit/b2d48a4827770b38f6320f3e760eb568b3cc6b1d) Thanks [@holypower777](https://github.com/holypower777)! - Исправлен Sidepanel Footer: primary и secondary принимают готовые JSX-элементы кнопок вместо типов компонентов. Пропсы, обработчики и ref кнопок задаются снаружи и сохраняются. primary остаётся обязательным, secondary — необязательным; gap, layout и sticky работают как прежде. Обновлены типы, Storybook и тесты.
8
+
9
+ ## 1.14.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`ea1a3d1`](https://github.com/koslibs/components/commit/ea1a3d1be5c397c4b5d56d761bef4abf8c885149) Thanks [@holypower777](https://github.com/holypower777)! - Обновлены @koslibs/builder и @koslibs/configs до 3.0.0, @koslibs/icons до 1.2.2. Обновлены транзитивные зависимости для устранения уязвимостей Happy DOM, Storybook, Vite и fast-uri. CI и release используют workflows configs v3.0.0. Тесты Modal, Sidepanel, Spinner и Typography адаптированы к jsdom без изменения API и поведения компонентов.
14
+
3
15
  ## 1.14.0
4
16
 
5
17
  ### Minor Changes
@@ -1,16 +1,16 @@
1
- import { type ComponentType, type HTMLAttributes } from 'react';
1
+ import { type HTMLAttributes, type ReactElement } from 'react';
2
2
  import type { ButtonProps } from '../../../Button/index.js';
3
3
  export type FooterProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dangerouslySetInnerHTML'> & {
4
4
  /**
5
- * Компонент основной кнопки. Обязателен; располагается после secondary (справа в строке).
6
- * Внешний вид и обработчики задаются внутри переданного компонента.
5
+ * JSX-элемент основной кнопки. Обязателен; располагается после secondary (справа в строке).
6
+ * Внешний вид, обработчики и ref задаются непосредственно на кнопке.
7
7
  */
8
- primary: ComponentType<ButtonProps>;
8
+ primary: ReactElement<ButtonProps>;
9
9
  /**
10
- * Компонент вторичной кнопки. Располагается перед primary (слева в строке).
10
+ * JSX-элемент вторичной кнопки. Располагается перед primary (слева в строке).
11
11
  * Не выводится, если проп не передан.
12
12
  */
13
- secondary?: ComponentType<ButtonProps>;
13
+ secondary?: ReactElement<ButtonProps>;
14
14
  /**
15
15
  * Минимальное расстояние между кнопками в пикселях из общей шкалы отступов.
16
16
  * @default 12
@@ -34,15 +34,15 @@ export type FooterProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dan
34
34
  };
35
35
  export declare const Footer: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML"> & {
36
36
  /**
37
- * Компонент основной кнопки. Обязателен; располагается после secondary (справа в строке).
38
- * Внешний вид и обработчики задаются внутри переданного компонента.
37
+ * JSX-элемент основной кнопки. Обязателен; располагается после secondary (справа в строке).
38
+ * Внешний вид, обработчики и ref задаются непосредственно на кнопке.
39
39
  */
40
- primary: ComponentType<ButtonProps>;
40
+ primary: ReactElement<ButtonProps>;
41
41
  /**
42
- * Компонент вторичной кнопки. Располагается перед primary (слева в строке).
42
+ * JSX-элемент вторичной кнопки. Располагается перед primary (слева в строке).
43
43
  * Не выводится, если проп не передан.
44
44
  */
45
- secondary?: ComponentType<ButtonProps>;
45
+ secondary?: ReactElement<ButtonProps>;
46
46
  /**
47
47
  * Минимальное расстояние между кнопками в пикселях из общей шкалы отступов.
48
48
  * @default 12
@@ -1,11 +1,11 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsxs } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
3
  import { forwardRef, useContext } from "react";
4
4
  import { useDataTestId } from "../../../../hooks/use-data-test-id.js";
5
5
  import { SidepanelContext } from "../../context.js";
6
6
  import index_module from "../../index.module.js";
7
7
  import index_module_0 from "./index.module.js";
8
- const Footer = /*#__PURE__*/ forwardRef(({ primary: Primary, secondary: Secondary, gap = 12, sticky = true, layout = 'space-between', className, dataTestId, ...restProps }, ref)=>{
8
+ const Footer = /*#__PURE__*/ forwardRef(({ primary, secondary, gap = 12, sticky = true, layout = 'space-between', className, dataTestId, ...restProps }, ref)=>{
9
9
  const { dataTestId: panelDataTestId } = useContext(SidepanelContext);
10
10
  const getDataTestId = useDataTestId(dataTestId ?? panelDataTestId);
11
11
  return /*#__PURE__*/ jsxs("div", {
@@ -16,8 +16,8 @@ const Footer = /*#__PURE__*/ forwardRef(({ primary: Primary, secondary: Secondar
16
16
  }, className),
17
17
  "data-test-id": getDataTestId('footer'),
18
18
  children: [
19
- Secondary && /*#__PURE__*/ jsx(Secondary, {}),
20
- /*#__PURE__*/ jsx(Primary, {})
19
+ secondary,
20
+ primary
21
21
  ]
22
22
  });
23
23
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koslibs/components",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "Shared React components for koslibs projects",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -68,8 +68,8 @@
68
68
  ]
69
69
  },
70
70
  "devDependencies": {
71
- "@koslibs/builder": "^2.0.0",
72
- "@koslibs/configs": "^2.0.0",
71
+ "@koslibs/builder": "^3.0.0",
72
+ "@koslibs/configs": "^3.0.0",
73
73
  "@types/node": "^24.19.0",
74
74
  "@types/react": "^18.3.18",
75
75
  "@types/react-dom": "^18.3.5",
@@ -81,7 +81,7 @@
81
81
  "react-dom": "^18.3.1 || ^19.0.0"
82
82
  },
83
83
  "dependencies": {
84
- "@koslibs/icons": "1.2.1",
84
+ "@koslibs/icons": "1.2.2",
85
85
  "@popperjs/core": "2.11.8",
86
86
  "classnames": "2.5.1"
87
87
  }