@finam/web-ui-kit-components 3.32.0 → 3.33.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
@@ -1,3 +1,5 @@
1
+ ## 3.33.0
2
+ * Добавлен спред пропсов для корневого div в `EmptyScreen`
1
3
  ## 3.32.0
2
4
  * Добавлен экспорт `version` с версией пакета
3
5
  * Сборка переведена на rslib: рантайм-хелперы берутся из `@swc/helpers` вместо `tslib`
@@ -1,7 +1,7 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode, HTMLAttributes } from 'react';
2
2
  export type Size = 'medium' | 'small';
3
3
  export type Variant = 'brand' | 'base';
4
- export interface Props {
4
+ export interface Props extends HTMLAttributes<HTMLDivElement> {
5
5
  /** Класс для контейнера */
6
6
  className?: string;
7
7
  /** Иконка */
@@ -27,6 +27,6 @@ export interface Props {
27
27
  /** Атрибут target для ссылки */
28
28
  target?: string;
29
29
  }
30
- declare const _default: import("react").MemoExoticComponent<({ className, icon, iconClassName, title, size, variant, description, buttonText, buttonClassName, href, target, onClick, }: Props) => import("react/jsx-runtime").JSX.Element>;
30
+ declare const _default: import("react").MemoExoticComponent<({ className, icon, iconClassName, title, size, variant, description, buttonText, buttonClassName, href, target, onClick, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element>;
31
31
  export default _default;
32
32
  //# sourceMappingURL=EmptyScreen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyScreen.d.ts","sourceRoot":"","sources":["../../src/EmptyScreen/EmptyScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAMxC,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEvC,MAAM,WAAW,KAAK;IACpB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CA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CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;uMAuCE,KAAK;AAuDR,wBAAiC"}
@@ -1,3 +1,6 @@
1
+ import { _ } from "@swc/helpers/_/_object_spread";
2
+ import { _ as _object_spread_props__ } from "@swc/helpers/_/_object_spread_props";
3
+ import { _ as _object_without_properties__ } from "@swc/helpers/_/_object_without_properties";
1
4
  import { jsx, jsxs } from "react/jsx-runtime";
2
5
  import { memo } from "react";
3
6
  import clsx from "clsx";
@@ -26,13 +29,27 @@ const buttonStylesMap = {
26
29
  color: 'alternative'
27
30
  }
28
31
  };
29
- const EmptyScreen = ({ className, icon, iconClassName, title, size = 'medium', variant = 'brand', description, buttonText, buttonClassName, href, target, onClick })=>{
32
+ const EmptyScreen = (_0)=>{
33
+ let { className, icon, iconClassName, title, size = 'medium', variant = 'brand', description, buttonText, buttonClassName, href, target, onClick } = _0, otherProps = _object_without_properties__(_0, [
34
+ "className",
35
+ "icon",
36
+ "iconClassName",
37
+ "title",
38
+ "size",
39
+ "variant",
40
+ "description",
41
+ "buttonText",
42
+ "buttonClassName",
43
+ "href",
44
+ "target",
45
+ "onClick"
46
+ ]);
30
47
  const buttonSize = buttonSizeMap[size];
31
48
  const titleSize = titleSizeMap[size];
32
49
  const descSize = descSizeMap[size];
33
50
  const { variant: buttonVariant, color: buttonColor } = buttonStylesMap[variant];
34
51
  const iconClassNames = clsx(iconClassName, 'medium' === size ? iconMedium : iconSmall, 'brand' === variant && icoNoBg);
35
- return /*#__PURE__*/ jsxs(Root, {
52
+ return /*#__PURE__*/ jsxs(Root, _object_spread_props__(_({}, otherProps), {
36
53
  className: className,
37
54
  children: [
38
55
  icon && /*#__PURE__*/ jsx(IconWrapper, {
@@ -65,7 +82,7 @@ const EmptyScreen = ({ className, icon, iconClassName, title, size = 'medium', v
65
82
  children: buttonText
66
83
  })
67
84
  ]
68
- });
85
+ }));
69
86
  };
70
87
  const EmptyScreen_EmptyScreen = /*#__PURE__*/ memo(EmptyScreen);
71
88
  export default EmptyScreen_EmptyScreen;
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyScreen/EmptyScreen.js","sources":["../../src/EmptyScreen/EmptyScreen.tsx"],"sourcesContent":["import { memo, ReactNode } from 'react';\nimport classNames from 'clsx';\nimport Typography, { type TypographyVariant } from '../Typography/index.js';\nimport Button, { type ButtonSize, type ButtonColor, type ButtonVariant } from '../Button/index.js';\nimport { Root, IconWrapper, Content, iconMedium, iconSmall, icoNoBg } from './EmptyScreen.styles.js';\n\nexport type Size = 'medium' | 'small';\nexport type Variant = 'brand' | 'base';\n\nexport interface Props {\n /** Класс для контейнера */\n className?: string;\n /** Иконка */\n icon?: ReactNode;\n /** Класс для контейнера иконки */\n iconClassName?: string;\n /** Заголовок */\n title?: string;\n /** Размер */\n size?: Size;\n /** Вариант кнопки и иконки */\n variant?: Variant;\n /** Описание */\n description?: string;\n /** Текст кнопки */\n buttonText?: string;\n /** Класс для кнопки */\n buttonClassName?: string;\n /** Ссылка для кнопки */\n href?: string;\n /** Обработчик клика по кнопке */\n onClick?: VoidFunction;\n /** Атрибут target для ссылки */\n target?: string;\n}\n\nconst buttonSizeMap: Record<Size, ButtonSize> = {\n medium: 's',\n small: 'xs',\n};\nconst titleSizeMap: Record<Size, TypographyVariant> = {\n medium: 'h5',\n small: 'caption12',\n};\nconst descSizeMap: Record<Size, TypographyVariant> = {\n medium: 'body14',\n small: 'caption11',\n};\nconst buttonStylesMap: Record<Variant, { variant: ButtonVariant; color: ButtonColor; }> = {\n brand: {\n variant: 'secondary',\n color: 'default',\n },\n base: {\n variant: 'primary',\n color: 'alternative',\n },\n};\n\nconst EmptyScreen = ({\n className,\n icon,\n iconClassName,\n title,\n size = 'medium',\n variant = 'brand',\n description,\n buttonText,\n buttonClassName,\n href,\n target,\n onClick,\n}: Props) => {\n const buttonSize = buttonSizeMap[size];\n const titleSize = titleSizeMap[size];\n const descSize = descSizeMap[size];\n\n const { variant: buttonVariant, color: buttonColor } = buttonStylesMap[variant];\n\n const iconClassNames = classNames(\n iconClassName,\n size === 'medium' ? iconMedium : iconSmall,\n variant === 'brand' && icoNoBg,\n );\n return (\n <Root className={className}>\n {icon && (\n <IconWrapper className={iconClassNames}>\n {icon}\n </IconWrapper>\n )}\n <Content>\n {Boolean(title) && (\n <Typography\n variant={titleSize}\n weight=\"semiBold\"\n >\n {title}\n </Typography>\n )}\n {Boolean(description) && (\n <Typography\n variant={descSize}\n weight=\"medium\"\n color=\"secondary\"\n >\n {description}\n </Typography>\n )}\n </Content>\n {Boolean(buttonText) && (\n <Button\n size={buttonSize}\n variant={buttonVariant}\n color={buttonColor}\n href={href}\n onClick={onClick}\n className={buttonClassName}\n target={target}\n >\n {buttonText}\n </Button>\n )}\n </Root>\n );\n};\n\nexport default memo(EmptyScreen);\n"],"names":["buttonSizeMap","titleSizeMap","descSizeMap","buttonStylesMap","EmptyScreen","className","icon","iconClassName","title","size","variant","description","buttonText","buttonClassName","href","target","onClick","buttonSize","titleSize","descSize","buttonVariant","buttonColor","iconClassNames","classNames","iconMedium","iconSmall","icoNoBg","Root","IconWrapper","Content","Boolean","Typography","Button","memo"],"mappings":";;;;;;AAoCA,MAAMA,gBAA0C;IAC9C,QAAQ;IACR,OAAO;AACT;AACA,MAAMC,eAAgD;IACpD,QAAQ;IACR,OAAO;AACT;AACA,MAAMC,cAA+C;IACnD,QAAQ;IACR,OAAO;AACT;AACA,MAAMC,kBAAoF;IACxF,OAAO;QACL,SAAS;QACT,OAAO;IACT;IACA,MAAM;QACJ,SAAS;QACT,OAAO;IACT;AACF;AAEA,MAAMC,cAAc,CAAC,EACnBC,SAAS,EACTC,IAAI,EACJC,aAAa,EACbC,KAAK,EACLC,OAAO,QAAQ,EACfC,UAAU,OAAO,EACjBC,WAAW,EACXC,UAAU,EACVC,eAAe,EACfC,IAAI,EACJC,MAAM,EACNC,OAAO,EACD;IACN,MAAMC,aAAajB,aAAa,CAACS,KAAK;IACtC,MAAMS,YAAYjB,YAAY,CAACQ,KAAK;IACpC,MAAMU,WAAWjB,WAAW,CAACO,KAAK;IAElC,MAAM,EAAE,SAASW,aAAa,EAAE,OAAOC,WAAW,EAAE,GAAGlB,eAAe,CAACO,QAAQ;IAE/E,MAAMY,iBAAiBC,KACrBhB,eACAE,AAAS,aAATA,OAAoBe,aAAaC,WACjCf,AAAY,YAAZA,WAAuBgB;IAEzB,OAAO,WAAP,GACE,KAACC,MAAIA;QAAC,WAAWtB;;YACdC,QAAQ,WAARA,GACC,IAACsB,aAAWA;gBAAC,WAAWN;0BACrBhB;;0BAGL,KAACuB,SAAOA;;oBACLC,QAAQtB,UAAU,WAAVA,GACP,IAACuB,YAAUA;wBACT,SAASb;wBACT,QAAO;kCAENV;;oBAGJsB,QAAQnB,gBAAgB,WAAhBA,GACP,IAACoB,YAAUA;wBACT,SAASZ;wBACT,QAAO;wBACP,OAAM;kCAELR;;;;YAINmB,QAAQlB,eAAe,WAAfA,GACP,IAACoB,QAAMA;gBACL,MAAMf;gBACN,SAASG;gBACT,OAAOC;gBACP,MAAMP;gBACN,SAASE;gBACT,WAAWH;gBACX,QAAQE;0BAEPH;;;;AAKX;AAEA,8CAAeqB,KAAK7B"}
1
+ {"version":3,"file":"EmptyScreen/EmptyScreen.js","sources":["../../src/EmptyScreen/EmptyScreen.tsx"],"sourcesContent":["import type { ReactNode, HTMLAttributes } from 'react';\nimport { memo } from 'react';\nimport classNames from 'clsx';\nimport Typography, { type TypographyVariant } from '../Typography/index.js';\nimport Button, { type ButtonSize, type ButtonColor, type ButtonVariant } from '../Button/index.js';\nimport { Root, IconWrapper, Content, iconMedium, iconSmall, icoNoBg } from './EmptyScreen.styles.js';\n\nexport type Size = 'medium' | 'small';\nexport type Variant = 'brand' | 'base';\n\nexport interface Props extends HTMLAttributes<HTMLDivElement> {\n /** Класс для контейнера */\n className?: string;\n /** Иконка */\n icon?: ReactNode;\n /** Класс для контейнера иконки */\n iconClassName?: string;\n /** Заголовок */\n title?: string;\n /** Размер */\n size?: Size;\n /** Вариант кнопки и иконки */\n variant?: Variant;\n /** Описание */\n description?: string;\n /** Текст кнопки */\n buttonText?: string;\n /** Класс для кнопки */\n buttonClassName?: string;\n /** Ссылка для кнопки */\n href?: string;\n /** Обработчик клика по кнопке */\n onClick?: VoidFunction;\n /** Атрибут target для ссылки */\n target?: string;\n}\n\nconst buttonSizeMap: Record<Size, ButtonSize> = {\n medium: 's',\n small: 'xs',\n};\nconst titleSizeMap: Record<Size, TypographyVariant> = {\n medium: 'h5',\n small: 'caption12',\n};\nconst descSizeMap: Record<Size, TypographyVariant> = {\n medium: 'body14',\n small: 'caption11',\n};\nconst buttonStylesMap: Record<Variant, { variant: ButtonVariant; color: ButtonColor; }> = {\n brand: {\n variant: 'secondary',\n color: 'default',\n },\n base: {\n variant: 'primary',\n color: 'alternative',\n },\n};\n\nconst EmptyScreen = ({\n className,\n icon,\n iconClassName,\n title,\n size = 'medium',\n variant = 'brand',\n description,\n buttonText,\n buttonClassName,\n href,\n target,\n onClick,\n ...otherProps\n}: Props) => {\n const buttonSize = buttonSizeMap[size];\n const titleSize = titleSizeMap[size];\n const descSize = descSizeMap[size];\n\n const { variant: buttonVariant, color: buttonColor } = buttonStylesMap[variant];\n\n const iconClassNames = classNames(\n iconClassName,\n size === 'medium' ? iconMedium : iconSmall,\n variant === 'brand' && icoNoBg,\n );\n return (\n <Root {...otherProps} className={className}>\n {icon && (\n <IconWrapper className={iconClassNames}>\n {icon}\n </IconWrapper>\n )}\n <Content>\n {Boolean(title) && (\n <Typography\n variant={titleSize}\n weight=\"semiBold\"\n >\n {title}\n </Typography>\n )}\n {Boolean(description) && (\n <Typography\n variant={descSize}\n weight=\"medium\"\n color=\"secondary\"\n >\n {description}\n </Typography>\n )}\n </Content>\n {Boolean(buttonText) && (\n <Button\n size={buttonSize}\n variant={buttonVariant}\n color={buttonColor}\n href={href}\n onClick={onClick}\n className={buttonClassName}\n target={target}\n >\n {buttonText}\n </Button>\n )}\n </Root>\n );\n};\n\nexport default memo(EmptyScreen);\n"],"names":["buttonSizeMap","titleSizeMap","descSizeMap","buttonStylesMap","EmptyScreen","className","icon","iconClassName","title","size","variant","description","buttonText","buttonClassName","href","target","onClick","otherProps","buttonSize","titleSize","descSize","buttonVariant","buttonColor","iconClassNames","classNames","iconMedium","iconSmall","icoNoBg","Root","IconWrapper","Content","Boolean","Typography","Button","memo"],"mappings":";;;;;;;;;AAqCA,MAAMA,gBAA0C;IAC9C,QAAQ;IACR,OAAO;AACT;AACA,MAAMC,eAAgD;IACpD,QAAQ;IACR,OAAO;AACT;AACA,MAAMC,cAA+C;IACnD,QAAQ;IACR,OAAO;AACT;AACA,MAAMC,kBAAoF;IACxF,OAAO;QACL,SAAS;QACT,OAAO;IACT;IACA,MAAM;QACJ,SAAS;QACT,OAAO;IACT;AACF;AAEA,MAAMC,cAAc,CAAC;QAAA,EACnBC,SAAS,EACTC,IAAI,EACJC,aAAa,EACbC,KAAK,EACLC,OAAO,QAAQ,EACfC,UAAU,OAAO,EACjBC,WAAW,EACXC,UAAU,EACVC,eAAe,EACfC,IAAI,EACJC,MAAM,EACNC,OAAO,EAED,OADHC,aAAAA,6BAAAA,IAAAA;;;;;;;;;;;;;;IAEH,MAAMC,aAAalB,aAAa,CAACS,KAAK;IACtC,MAAMU,YAAYlB,YAAY,CAACQ,KAAK;IACpC,MAAMW,WAAWlB,WAAW,CAACO,KAAK;IAElC,MAAM,EAAE,SAASY,aAAa,EAAE,OAAOC,WAAW,EAAE,GAAGnB,eAAe,CAACO,QAAQ;IAE/E,MAAMa,iBAAiBC,KACrBjB,eACAE,AAAS,aAATA,OAAoBgB,aAAaC,WACjChB,AAAY,YAAZA,WAAuBiB;IAEzB,OAAO,WAAP,GACE,KAACC,MAAIA,uBAAAA,EAAAA,CAAAA,GAAKX,aAAAA;QAAY,WAAWZ;;YAC9BC,QAAQ,WAARA,GACC,IAACuB,aAAWA;gBAAC,WAAWN;0BACrBjB;;0BAGL,KAACwB,SAAOA;;oBACLC,QAAQvB,UAAU,WAAVA,GACP,IAACwB,YAAUA;wBACT,SAASb;wBACT,QAAO;kCAENX;;oBAGJuB,QAAQpB,gBAAgB,WAAhBA,GACP,IAACqB,YAAUA;wBACT,SAASZ;wBACT,QAAO;wBACP,OAAM;kCAELT;;;;YAINoB,QAAQnB,eAAe,WAAfA,GACP,IAACqB,QAAMA;gBACL,MAAMf;gBACN,SAASG;gBACT,OAAOC;gBACP,MAAMR;gBACN,SAASE;gBACT,WAAWH;gBACX,QAAQE;0BAEPH;;;;AAKX;AAEA,8CAAesB,KAAK9B"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./types.js";
2
- const version = "3.32.0";
2
+ const version = "3.33.0";
3
3
  export { default as Button } from "./Button/index.js";
4
4
  export { default as ButtonAsync } from "./ButtonAsync/index.js";
5
5
  export { default as MarketingButton } from "./MarketingButton/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finam/web-ui-kit-components",
3
- "version": "3.32.0",
3
+ "version": "3.33.0",
4
4
  "description": "Components library for web-ui-kit",
5
5
  "author": "",
6
6
  "license": "ISC",