@snack-uikit/drawer 0.10.6 → 0.10.8-preview-95f36d41.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.10.7 (2024-12-17)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@snack-uikit/button@0.19.5](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/button/CHANGELOG.md)
10
+
11
+
12
+
13
+
14
+
6
15
  ## 0.10.6 (2024-12-12)
7
16
 
8
17
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -10,20 +10,43 @@
10
10
  [//]: DOCUMENTATION_SECTION_START
11
11
  [//]: THIS_SECTION_IS_AUTOGENERATED_PLEASE_DONT_EDIT_IT
12
12
  ## DrawerCustom
13
- Компонент-конструктор
14
13
  ### Props
15
14
  | name | type | default value | description |
16
15
  |------|------|---------------|-------------|
17
16
  | onClose* | `() => void` | - | Колбэк закрытия |
18
17
  | open* | `boolean` | - | Управление состоянием показан/не показан. |
19
- | mode | enum Mode: `"regular"`, `"soft"` | - | Режим отображения |
20
- | position | enum Position: `"right"`, `"left"` | - | Расположение открытого Drawer |
18
+ | mode | enum Mode: `"regular"`, `"soft"` | regular | Режим отображения |
19
+ | position | enum Position: `"right"`, `"left"` | right | Расположение открытого Drawer |
21
20
  | className | `string` | - | CSS-класс для элемента с контентом |
22
21
  | rootClassName | `string` | - | CSS-класс для корневого элемента |
23
- | size | `string \| number` | - | Размер |
22
+ | size | `string \| number` | s | Размер |
24
23
  | push | `boolean \| PushConfig` | - | Смещение при открытии "вложенного" компонента |
25
24
  | container | `string \| HTMLElement` | - | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
26
25
  | nestedDrawer | `ReactElement<DrawerCustomProps, string \| JSXElementConstructor<any>>` | - | Вложенный Drawer |
26
+ ## DrawerCustom.Header
27
+ Вспомогательный компонент для добавления "шапки" в DrawerCustom
28
+ ### Props
29
+ | name | type | default value | description |
30
+ |------|------|---------------|-------------|
31
+ | title* | `ReactNode` | - | Заголовок |
32
+ | image | `{ src: string; alt: string; }` | - | Изображение |
33
+ | titleTooltip | `ReactNode` | - | Тултип для заголовка |
34
+ | subtitle | `ReactNode` | - | Подзаголовок |
35
+ | className | `string` | - | CSS-класс |
36
+ ## DrawerCustom.Body
37
+ Вспомогательный компонент для добавления "тела" в DrawerCustom
38
+ ### Props
39
+ | name | type | default value | description |
40
+ |------|------|---------------|-------------|
41
+ | content* | `ReactNode` | - | Контент |
42
+ | className | `string` | - | CSS-класс |
43
+ ## DrawerCustom.Footer
44
+ Вспомогательный компонент для добавления "футера" в DrawerCustom
45
+ ### Props
46
+ | name | type | default value | description |
47
+ |------|------|---------------|-------------|
48
+ | actions* | `ReactNode` | - | Слот для добавления кнопок-действий |
49
+ | className | `string` | - | CSS-класс |
27
50
  ## Drawer
28
51
  Готовый компонент Drawer
29
52
  ### Props
@@ -38,8 +61,8 @@
38
61
  | className | `string` | - | CSS-класс для элемента с контентом |
39
62
  | rootClassName | `string` | - | CSS-класс для корневого элемента |
40
63
  | container | `string \| HTMLElement` | - | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
41
- | titleTooltip | `ReactNode` | - | Тултип для заголовка |
42
64
  | image | `{ src: string; alt: string; }` | - | Изображение |
65
+ | titleTooltip | `ReactNode` | - | Тултип для заголовка |
43
66
  | subtitle | `string` | - | Подзаголовок |
44
67
  | size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
45
68
  | approveButton | `Omit<ButtonFilledProps, "size"> & { tooltip?: TooltipProps; }` | - | Основная кнопка |
@@ -26,16 +26,14 @@ export type DrawerCustomProps = WithSupportProps<PropsWithChildren<{
26
26
  /** Вложенный Drawer */
27
27
  nestedDrawer?: ReactElement<DrawerCustomProps>;
28
28
  }>>;
29
- declare function DrawerCustomComponent({ open, mode, position, onClose, rootClassName, className, size, push, container, children, nestedDrawer, ...rest }: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
30
- /** Компонент-конструктор */
31
- export declare const DrawerCustom: typeof DrawerCustomComponent & {
32
- Header: typeof DrawerHeader;
33
- Body: typeof DrawerBody;
34
- Footer: typeof DrawerFooter;
35
- };
29
+ export declare function DrawerCustom({ open, mode, position, onClose, rootClassName, className, size, push, container, children, nestedDrawer, ...rest }: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare namespace DrawerCustom {
31
+ var Header: typeof DrawerHeader;
32
+ var Body: typeof DrawerBody;
33
+ var Footer: typeof DrawerFooter;
34
+ }
36
35
  export declare namespace DrawerCustom {
37
36
  type HeaderProps = DrawerHeaderProps;
38
37
  type BodyProps = DrawerBodyProps;
39
38
  type FooterProps = DrawerFooterProps;
40
39
  }
41
- export {};
@@ -16,7 +16,7 @@ var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", {
17
17
  value: true
18
18
  });
19
- exports.DrawerCustom = void 0;
19
+ exports.DrawerCustom = DrawerCustom;
20
20
  const jsx_runtime_1 = require("react/jsx-runtime");
21
21
  require("rc-drawer/assets/index.css");
22
22
  const classnames_1 = __importDefault(require("classnames"));
@@ -26,7 +26,7 @@ const constants_1 = require("../../constants");
26
26
  const helperComponents_1 = require("../../helperComponents");
27
27
  const constants_2 = require("./constants");
28
28
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
29
- function DrawerCustomComponent(_a) {
29
+ function DrawerCustom(_a) {
30
30
  var {
31
31
  open,
32
32
  mode = constants_1.MODE.Regular,
@@ -70,8 +70,6 @@ function DrawerCustomComponent(_a) {
70
70
  }), children, nestedDrawer]
71
71
  }));
72
72
  }
73
- /** Компонент-конструктор */
74
- exports.DrawerCustom = DrawerCustomComponent;
75
- exports.DrawerCustom.Header = helperComponents_1.DrawerHeader;
76
- exports.DrawerCustom.Body = helperComponents_1.DrawerBody;
77
- exports.DrawerCustom.Footer = helperComponents_1.DrawerFooter;
73
+ DrawerCustom.Header = helperComponents_1.DrawerHeader;
74
+ DrawerCustom.Body = helperComponents_1.DrawerBody;
75
+ DrawerCustom.Footer = helperComponents_1.DrawerFooter;
@@ -26,16 +26,14 @@ export type DrawerCustomProps = WithSupportProps<PropsWithChildren<{
26
26
  /** Вложенный Drawer */
27
27
  nestedDrawer?: ReactElement<DrawerCustomProps>;
28
28
  }>>;
29
- declare function DrawerCustomComponent({ open, mode, position, onClose, rootClassName, className, size, push, container, children, nestedDrawer, ...rest }: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
30
- /** Компонент-конструктор */
31
- export declare const DrawerCustom: typeof DrawerCustomComponent & {
32
- Header: typeof DrawerHeader;
33
- Body: typeof DrawerBody;
34
- Footer: typeof DrawerFooter;
35
- };
29
+ export declare function DrawerCustom({ open, mode, position, onClose, rootClassName, className, size, push, container, children, nestedDrawer, ...rest }: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare namespace DrawerCustom {
31
+ var Header: typeof DrawerHeader;
32
+ var Body: typeof DrawerBody;
33
+ var Footer: typeof DrawerFooter;
34
+ }
36
35
  export declare namespace DrawerCustom {
37
36
  type HeaderProps = DrawerHeaderProps;
38
37
  type BodyProps = DrawerBodyProps;
39
38
  type FooterProps = DrawerFooterProps;
40
39
  }
41
- export {};
@@ -18,14 +18,12 @@ import { MODE, POSITION, SIZE, SIZE_AS_VALUES } from '../../constants';
18
18
  import { ButtonClose, DrawerBody, DrawerFooter, DrawerHeader, } from '../../helperComponents';
19
19
  import { motionProps } from './constants';
20
20
  import styles from './styles.module.css';
21
- function DrawerCustomComponent(_a) {
21
+ export function DrawerCustom(_a) {
22
22
  var { open, mode = MODE.Regular, position = POSITION.Right, onClose, rootClassName, className, size = SIZE.S, push, container, children, nestedDrawer } = _a, rest = __rest(_a, ["open", "mode", "position", "onClose", "rootClassName", "className", "size", "push", "container", "children", "nestedDrawer"]);
23
23
  const isRegular = mode === MODE.Regular;
24
24
  const isPredefinedSize = typeof size === 'string' && SIZE_AS_VALUES.includes(size);
25
25
  return (_jsxs(RcDrawer, Object.assign({ mask: isRegular, maskClosable: isRegular, maskClassName: styles.mask, keyboard: isRegular, width: isPredefinedSize ? 'null' : size, open: open, placement: position, destroyOnClose: true, push: push, onClose: onClose, getContainer: container, className: cn(styles.drawer, className), rootClassName: cn(styles.drawerRoot, rootClassName) }, extractSupportProps(rest), { "data-content-wrapper": true, "data-size": isPredefinedSize ? size : undefined, "data-mode": mode }, motionProps, { children: [_jsx("div", { className: styles.headerElements, children: _jsx(ButtonClose, { onClick: onClose }) }), children, nestedDrawer] })));
26
26
  }
27
- /** Компонент-конструктор */
28
- export const DrawerCustom = DrawerCustomComponent;
29
27
  DrawerCustom.Header = DrawerHeader;
30
28
  DrawerCustom.Body = DrawerBody;
31
29
  DrawerCustom.Footer = DrawerFooter;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Drawer",
7
- "version": "0.10.6",
7
+ "version": "0.10.8-preview-95f36d41.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -36,15 +36,15 @@
36
36
  "license": "Apache-2.0",
37
37
  "scripts": {},
38
38
  "dependencies": {
39
- "@snack-uikit/button": "0.19.4",
39
+ "@snack-uikit/button": "0.19.5",
40
40
  "@snack-uikit/icons": "0.24.1",
41
41
  "@snack-uikit/scroll": "0.9.2",
42
- "@snack-uikit/tooltip": "0.15.2",
43
- "@snack-uikit/truncate-string": "0.6.2",
42
+ "@snack-uikit/tooltip": "0.15.3-preview-95f36d41.0",
43
+ "@snack-uikit/truncate-string": "0.6.3-preview-95f36d41.0",
44
44
  "@snack-uikit/typography": "0.8.3",
45
45
  "@snack-uikit/utils": "3.6.0",
46
46
  "classnames": "2.5.1",
47
47
  "rc-drawer": "6.4.1"
48
48
  },
49
- "gitHead": "ac8fa414e1a84f72594d9c509b0daca04b5e48be"
49
+ "gitHead": "e866724aaa8b037109a05efa3e188a2c17989aa6"
50
50
  }
@@ -45,7 +45,7 @@ export type DrawerCustomProps = WithSupportProps<
45
45
  }>
46
46
  >;
47
47
 
48
- function DrawerCustomComponent({
48
+ export function DrawerCustom({
49
49
  open,
50
50
  mode = MODE.Regular,
51
51
  position = POSITION.Right,
@@ -94,13 +94,6 @@ function DrawerCustomComponent({
94
94
  );
95
95
  }
96
96
 
97
- /** Компонент-конструктор */
98
- export const DrawerCustom = DrawerCustomComponent as typeof DrawerCustomComponent & {
99
- Header: typeof DrawerHeader;
100
- Body: typeof DrawerBody;
101
- Footer: typeof DrawerFooter;
102
- };
103
-
104
97
  DrawerCustom.Header = DrawerHeader;
105
98
  DrawerCustom.Body = DrawerBody;
106
99
  DrawerCustom.Footer = DrawerFooter;