@hh.ru/magritte-ui-floating-button 2.1.3 → 3.0.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/index.mock.js CHANGED
@@ -1,7 +1,12 @@
1
1
  import './index.css';
2
2
  import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
3
3
 
4
- const FloatingButton = mockComponent('FloatingButton', undefined, {
4
+ const staticProps = {
5
+ Item: mockComponent('Item', undefined, {
6
+ withChildren: true,
7
+ }),
8
+ };
9
+ const FloatingButton = mockComponent('FloatingButton', staticProps, {
5
10
  withChildren: true,
6
11
  });
7
12
  const FloatingButtonStack = mockComponent('FloatingButtonStack', undefined, {
package/index.mock.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mock.js","sources":["../src/index.mock.ts"],"sourcesContent":["import { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport * from '@hh.ru/magritte-ui-floating-button/types';\n\nexport const FloatingButton = mockComponent('FloatingButton', undefined, {\n withChildren: true,\n});\n\nexport const FloatingButtonStack = mockComponent('FloatingButtonStack', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;MAIa,cAAc,GAAG,aAAa,CAAC,gBAAgB,EAAE,SAAS,EAAE;AACrE,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA,EAAE;MAEU,mBAAmB,GAAG,aAAa,CAAC,qBAAqB,EAAE,SAAS,EAAE;AAC/E,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
1
+ {"version":3,"file":"index.mock.js","sources":["../src/index.mock.ts"],"sourcesContent":["import { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport * from '@hh.ru/magritte-ui-floating-button/types';\n\nconst staticProps = {\n Item: mockComponent('Item', undefined, {\n withChildren: true,\n }),\n};\n\nexport const FloatingButton = mockComponent('FloatingButton', staticProps, {\n withChildren: true,\n});\n\nexport const FloatingButtonStack = mockComponent('FloatingButtonStack', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;AAIA,MAAM,WAAW,GAAG;AAChB,IAAA,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE;AACnC,QAAA,YAAY,EAAE,IAAI;KACrB,CAAC;CACL,CAAC;MAEW,cAAc,GAAG,aAAa,CAAC,gBAAgB,EAAE,WAAW,EAAE;AACvE,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA,EAAE;MAEU,mBAAmB,GAAG,aAAa,CAAC,qBAAqB,EAAE,SAAS,EAAE;AAC/E,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-floating-button",
3
- "version": "2.1.3",
3
+ "version": "3.0.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "c9930c21240dac1610236be666e8d0c45c60f4bc"
42
+ "gitHead": "8cc4f2bcbe11ad59875a4d94d03373275f937aa8"
43
43
  }
package/types.d.ts CHANGED
@@ -1,19 +1,29 @@
1
- import { CSSProperties, PropsWithChildren, ReactElement, ReactNode, type RefObject } from 'react';
1
+ import { CSSProperties, ReactElement, ReactNode, type RefObject } from 'react';
2
2
  import { IconWrapperComponentSize24, IconProps } from '@hh.ru/magritte-ui-icon';
3
3
  export type FloatingButtonStyle = 'neutral' | 'inverse';
4
4
  export type FloatingButtonPosition = 'left' | 'right' | 'center';
5
5
  export type FloatingButtonRadius = 12 | 'halfHeight';
6
- export interface FloatingButtonProps extends PropsWithChildren {
6
+ interface FloatingButtonBaseProps {
7
7
  /** Кастомный компонент 'a', 'button', 'span' или функция */
8
8
  Element?: 'a' | 'button' | 'span';
9
- style?: FloatingButtonStyle;
10
9
  /** Флаг видимости **/
11
10
  visible?: boolean;
12
- /** Заблокирована ли кнопка */
13
- disabled?: boolean;
14
11
  /** Отображение индикации загрузки */
15
12
  loading?: boolean;
13
+ /** Иконка floating кнопки */
16
14
  icon?: IconWrapperComponentSize24;
15
+ /** Скругления */
16
+ borderRadius?: FloatingButtonRadius;
17
+ /** Компонент Badge */
18
+ badge?: ReactElement;
19
+ 'data-qa'?: string;
20
+ }
21
+ export interface FloatingButtonProps extends FloatingButtonBaseProps {
22
+ style?: FloatingButtonStyle;
23
+ /** Текст floating button кнопки */
24
+ children?: ReactNode;
25
+ /** Заблокирована ли кнопка */
26
+ disabled?: boolean;
17
27
  /** Постфикс */
18
28
  postfix?: ReactNode;
19
29
  /** Показывать ли лейбл только при ховере */
@@ -22,23 +32,21 @@ export interface FloatingButtonProps extends PropsWithChildren {
22
32
  hideLabel?: boolean;
23
33
  /** Расположение (задает дефолтное положение и используется для анимации) */
24
34
  position?: FloatingButtonPosition;
25
- /** Скругления */
26
- borderRadius?: FloatingButtonRadius;
27
- /** Компонент Badge */
28
- badge?: ReactElement;
29
35
  /** css-класс для позиционирования кнопки */
30
36
  className?: string;
31
37
  /** инлайн стили для позиционирования кнопки */
32
38
  inlineStyle?: CSSProperties;
33
39
  /** Хост для отрисовки */
34
40
  host?: RefObject<HTMLElement>;
35
- 'data-qa'?: string;
36
41
  }
37
42
  export interface FloatingButtonPropsWithStackMode extends FloatingButtonProps {
38
43
  /** Флаг, включающий stack режим для кнопки (отключает тени, меняется позиция badge) */
39
44
  stackMode?: boolean;
40
45
  }
41
- export interface FloatingButtonStackProps extends PropsWithChildren {
46
+ export type FloatingButtonStackItemProps = FloatingButtonBaseProps;
47
+ export interface FloatingButtonStackProps {
48
+ /** Компоненты FloatingButtonStack.Item */
49
+ children?: ReactNode;
42
50
  /** Стилизация компонента */
43
51
  style?: FloatingButtonStyle;
44
52
  /** Расположение компонента */
@@ -57,3 +65,4 @@ export interface FloatingButtonStackProps extends PropsWithChildren {
57
65
  /** Обработчик события клика кнопки Наверх */
58
66
  onUpButtonClick?: IconProps['onClick'];
59
67
  }
68
+ export {};