@salutejs/sdds-finportal 0.168.1-canary.1569.11908076676.0 → 0.168.2-canary.1524.11926491838.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,8 +92,11 @@ import { DrawerContentProps } from '@salutejs/plasma-new-hope/styled-components'
92
92
  import { DrawerFooterProps } from '@salutejs/plasma-new-hope/styled-components';
93
93
  import { DrawerHeaderProps } from '@salutejs/plasma-new-hope/styled-components';
94
94
  import { DrawerProps } from '@salutejs/plasma-new-hope/styled-components';
95
+ import type { DropdownItemOption } from '@salutejs/plasma-new-hope';
96
+ import type { DropdownNewProps } from '@salutejs/plasma-new-hope';
95
97
  import { DropdownNodeSelect } from '@salutejs/plasma-new-hope/styled-components';
96
- import { DropdownProps } from '@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types';
98
+ import { DropdownPlacement } from '@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types';
99
+ import { DropdownTrigger } from '@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types';
97
100
  import { dsplL } from '@salutejs/sdds-themes/tokens';
98
101
  import { dsplLBold } from '@salutejs/sdds-themes/tokens';
99
102
  import { dsplM } from '@salutejs/sdds-themes/tokens';
@@ -1239,7 +1242,7 @@ export { DrawerHeaderProps }
1239
1242
  export { DrawerProps }
1240
1243
 
1241
1244
  // @public (undocumented)
1242
- export const Dropdown: FunctionComponent<PropsType< {
1245
+ export const Dropdown: <T extends DropdownItemOption>(props: Omit<DropdownNewProps<T>, "view" | "size"> & Pick<PropsType< {
1243
1246
  size: {
1244
1247
  l: PolymorphicClassName;
1245
1248
  m: PolymorphicClassName;
@@ -1249,7 +1252,31 @@ xs: PolymorphicClassName;
1249
1252
  view: {
1250
1253
  default: PolymorphicClassName;
1251
1254
  };
1252
- }> & DropdownProps & RefAttributes<HTMLDivElement>>;
1255
+ }> & {
1256
+ items: DropdownItemOption[];
1257
+ alwaysOpened?: boolean | undefined;
1258
+ children?: React_2.ReactNode;
1259
+ itemRole?: string | undefined;
1260
+ onHover?: ((index: number) => void) | undefined;
1261
+ onItemSelect?: ((item: DropdownItemOption, event: React_2.SyntheticEvent<Element, Event>) => void) | undefined;
1262
+ trigger?: DropdownTrigger | undefined;
1263
+ placement?: DropdownPlacement | undefined;
1264
+ offset?: [number, number] | undefined;
1265
+ listWidth?: Property.Width<string | number> | undefined;
1266
+ hasArrow?: boolean | undefined;
1267
+ closeOnSelect?: boolean | undefined;
1268
+ closeOnOverlayClick?: boolean | undefined;
1269
+ onToggle?: ((isOpen: boolean, event: Event | React_2.SyntheticEvent<Element, Event>) => void) | undefined;
1270
+ size?: string | undefined;
1271
+ view?: string | undefined;
1272
+ variant?: "normal" | "tight" | undefined;
1273
+ portal?: string | React_2.RefObject<HTMLElement> | undefined;
1274
+ renderItem?: ((item: DropdownItemOption) => React_2.ReactNode) | undefined;
1275
+ onItemClick?: ((item: DropdownItemOption, event: React_2.SyntheticEvent<Element, Event>) => void) | undefined;
1276
+ listOverflow?: Property.Overflow | undefined;
1277
+ listHeight?: Property.Height<string | number> | undefined;
1278
+ hoverIndex?: number | undefined;
1279
+ } & React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>, "view" | "size"> & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
1253
1280
 
1254
1281
  // @public (undocumented)
1255
1282
  export const DsplL: FunctionComponent<PropsType< {
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
- declare const Dropdown: import("react").FunctionComponent<import("@salutejs/plasma-new-hope/types/engines/types").PropsType<{
1
+ import type { DropdownItemOption, DropdownNewProps } from '@salutejs/plasma-new-hope';
2
+ import React from 'react';
3
+ declare const Dropdown: <T extends DropdownItemOption>(props: Omit<DropdownNewProps<T>, "view" | "size"> & Pick<import("@salutejs/plasma-new-hope/types/engines/types").PropsType<{
3
4
  size: {
4
5
  l: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
5
6
  m: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
@@ -9,5 +10,29 @@ declare const Dropdown: import("react").FunctionComponent<import("@salutejs/plas
9
10
  view: {
10
11
  default: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
11
12
  };
12
- }> & import("@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types").DropdownProps & import("react").RefAttributes<HTMLDivElement>>;
13
+ }> & {
14
+ items: DropdownItemOption[];
15
+ alwaysOpened?: boolean | undefined;
16
+ children?: React.ReactNode;
17
+ itemRole?: string | undefined;
18
+ onHover?: ((index: number) => void) | undefined;
19
+ onItemSelect?: ((item: DropdownItemOption, event: React.SyntheticEvent<Element, Event>) => void) | undefined;
20
+ trigger?: import("@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types").DropdownTrigger | undefined;
21
+ placement?: import("@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types").DropdownPlacement | undefined;
22
+ offset?: [number, number] | undefined;
23
+ listWidth?: import("csstype").Property.Width<string | number> | undefined;
24
+ hasArrow?: boolean | undefined;
25
+ closeOnSelect?: boolean | undefined;
26
+ closeOnOverlayClick?: boolean | undefined;
27
+ onToggle?: ((isOpen: boolean, event: Event | React.SyntheticEvent<Element, Event>) => void) | undefined;
28
+ size?: string | undefined;
29
+ view?: string | undefined;
30
+ variant?: "normal" | "tight" | undefined;
31
+ portal?: string | React.RefObject<HTMLElement> | undefined;
32
+ renderItem?: ((item: DropdownItemOption) => React.ReactNode) | undefined;
33
+ onItemClick?: ((item: DropdownItemOption, event: React.SyntheticEvent<Element, Event>) => void) | undefined;
34
+ listOverflow?: import("csstype").Property.Overflow | undefined;
35
+ listHeight?: import("csstype").Property.Height<string | number> | undefined;
36
+ hoverIndex?: number | undefined;
37
+ } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "view" | "size"> & React.RefAttributes<HTMLButtonElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
13
38
  export { Dropdown };
@@ -5,6 +5,15 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Dropdown = void 0;
7
7
  var _styledComponents = /*#__PURE__*/require("@salutejs/plasma-new-hope/styled-components");
8
+ var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
8
9
  var _Dropdown = /*#__PURE__*/require("./Dropdown.config");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
12
  var mergedConfig = /*#__PURE__*/(0, _styledComponents.mergeConfig)(_styledComponents.dropdownConfig, _Dropdown.config);
10
- var Dropdown = exports.Dropdown = /*#__PURE__*/(0, _styledComponents.component)(mergedConfig);
13
+ var DropdownNewHope = /*#__PURE__*/(0, _styledComponents.component)(mergedConfig);
14
+ var DropdownComponent = function DropdownComponent(props, ref) {
15
+ return /*#__PURE__*/_react["default"].createElement(DropdownNewHope, _extends({
16
+ ref: ref
17
+ }, props));
18
+ };
19
+ var Dropdown = exports.Dropdown = /*#__PURE__*/(0, _styledComponents.fixedForwardRef)(DropdownComponent);
@@ -26,7 +26,7 @@ var config = exports.config = {
26
26
  s: /*#__PURE__*/(0, _styledComponents.css)(_templateObject5 || (_templateObject5 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": 2rem;\n ", ": 1.25rem;\n ", ": calc(var(", ") / 2);\n ", ": 1rem;\n ", ": calc(var(", ") / 2);\n ", ": 0.125rem;\n ", ": 1.25;\n "])), _styledComponents.switchTokens.trackWidth, _styledComponents.switchTokens.trackHeight, _styledComponents.switchTokens.trackBorderRadius, _styledComponents.switchTokens.trackHeight, _styledComponents.switchTokens.thumbSize, _styledComponents.switchTokens.thumbBorderRadius, _styledComponents.switchTokens.thumbSize, _styledComponents.switchTokens.thumbOffset, _styledComponents.switchTokens.thumbPressScale)
27
27
  },
28
28
  view: {
29
- "default": /*#__PURE__*/(0, _styledComponents.css)(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--text-primary);\n ", ": var(--text-secondary);\n ", ": var(--surface-accent);\n ", ": var(--surface-accent-hover);\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-transparent-tertiary-hover);\n ", ": 0;\n ", ": 0;\n ", ": var(--on-dark-surface-solid-default);\n ", ": var(--on-dark-surface-solid-default);\n ", ": 0 1px 1px rgba(0, 0, 0, 0.11);\n "])), _styledComponents.switchTokens.labelColor, _styledComponents.switchTokens.descriptionColor, _styledComponents.switchTokens.trackBackgroundColorOn, _styledComponents.switchTokens.trackBackgroundColorOnHover, _styledComponents.switchTokens.trackBackgroundColorOff, _styledComponents.switchTokens.trackBackgroundColorOffHover, _styledComponents.switchTokens.trackBorderWidthOn, _styledComponents.switchTokens.trackBorderWidthOff, _styledComponents.switchTokens.thumbBackgroundColorOff, _styledComponents.switchTokens.thumbBackgroundColorOn, _styledComponents.switchTokens.thumbBoxShadow)
29
+ "default": /*#__PURE__*/(0, _styledComponents.css)(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--text-primary);\n ", ": var(--text-secondary);\n ", ": var(--surface-accent);\n ", ": var(--surface-accent-hover);\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-transparent-tertiary-hover);\n ", ": 0rem;\n ", ": var(--on-dark-surface-solid-default);\n ", ": var(--on-dark-surface-solid-default);\n ", ": 0 1px 1px rgba(0, 0, 0, 0.11);\n "])), _styledComponents.switchTokens.labelColor, _styledComponents.switchTokens.descriptionColor, _styledComponents.switchTokens.trackBackgroundColorOn, _styledComponents.switchTokens.trackBackgroundColorOnHover, _styledComponents.switchTokens.trackBackgroundColorOff, _styledComponents.switchTokens.trackBackgroundColorOffHover, _styledComponents.switchTokens.trackBorderWidth, _styledComponents.switchTokens.thumbBackgroundColorOff, _styledComponents.switchTokens.thumbBackgroundColorOn, _styledComponents.switchTokens.thumbBoxShadow)
30
30
  },
31
31
  disabled: {
32
32
  "true": /*#__PURE__*/(0, _styledComponents.css)(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": 0.4;\n "])), _styledComponents.switchTokens.disabledOpacity)
@@ -1,5 +1,13 @@
1
- import { dropdownConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import { dropdownConfig, component, mergeConfig, fixedForwardRef } from '@salutejs/plasma-new-hope/styled-components';
3
+ import React from 'react';
2
4
  import { config } from './Dropdown.config';
3
5
  var mergedConfig = /*#__PURE__*/mergeConfig(dropdownConfig, config);
4
- var Dropdown = /*#__PURE__*/component(mergedConfig);
6
+ var DropdownNewHope = /*#__PURE__*/component(mergedConfig);
7
+ var DropdownComponent = function DropdownComponent(props, ref) {
8
+ return /*#__PURE__*/React.createElement(DropdownNewHope, _extends({
9
+ ref: ref
10
+ }, props));
11
+ };
12
+ var Dropdown = /*#__PURE__*/fixedForwardRef(DropdownComponent);
5
13
  export { Dropdown };
@@ -20,7 +20,7 @@ export var config = {
20
20
  s: /*#__PURE__*/css(_templateObject5 || (_templateObject5 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": 2rem;\n ", ": 1.25rem;\n ", ": calc(var(", ") / 2);\n ", ": 1rem;\n ", ": calc(var(", ") / 2);\n ", ": 0.125rem;\n ", ": 1.25;\n "])), switchTokens.trackWidth, switchTokens.trackHeight, switchTokens.trackBorderRadius, switchTokens.trackHeight, switchTokens.thumbSize, switchTokens.thumbBorderRadius, switchTokens.thumbSize, switchTokens.thumbOffset, switchTokens.thumbPressScale)
21
21
  },
22
22
  view: {
23
- "default": /*#__PURE__*/css(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--text-primary);\n ", ": var(--text-secondary);\n ", ": var(--surface-accent);\n ", ": var(--surface-accent-hover);\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-transparent-tertiary-hover);\n ", ": 0;\n ", ": 0;\n ", ": var(--on-dark-surface-solid-default);\n ", ": var(--on-dark-surface-solid-default);\n ", ": 0 1px 1px rgba(0, 0, 0, 0.11);\n "])), switchTokens.labelColor, switchTokens.descriptionColor, switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.trackBorderWidthOn, switchTokens.trackBorderWidthOff, switchTokens.thumbBackgroundColorOff, switchTokens.thumbBackgroundColorOn, switchTokens.thumbBoxShadow)
23
+ "default": /*#__PURE__*/css(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--text-primary);\n ", ": var(--text-secondary);\n ", ": var(--surface-accent);\n ", ": var(--surface-accent-hover);\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-transparent-tertiary-hover);\n ", ": 0rem;\n ", ": var(--on-dark-surface-solid-default);\n ", ": var(--on-dark-surface-solid-default);\n ", ": 0 1px 1px rgba(0, 0, 0, 0.11);\n "])), switchTokens.labelColor, switchTokens.descriptionColor, switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.trackBorderWidth, switchTokens.thumbBackgroundColorOff, switchTokens.thumbBackgroundColorOn, switchTokens.thumbBoxShadow)
24
24
  },
25
25
  disabled: {
26
26
  "true": /*#__PURE__*/css(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": 0.4;\n "])), switchTokens.disabledOpacity)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/sdds-finportal",
3
- "version": "0.168.1-canary.1569.11908076676.0",
3
+ "version": "0.168.2-canary.1524.11926491838.0",
4
4
  "description": "Salute Design System / React UI kit for SDDS FinPortal web applications",
5
5
  "author": "Salute Frontend Team <salute.developers@gmail.com>",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  "directory": "packages/sdds-finportal"
20
20
  },
21
21
  "dependencies": {
22
- "@salutejs/plasma-new-hope": "0.194.1-canary.1569.11908076676.0",
22
+ "@salutejs/plasma-new-hope": "0.194.1-dev.0",
23
23
  "@salutejs/sdds-themes": "0.27.0"
24
24
  },
25
25
  "peerDependencies": {
@@ -78,6 +78,8 @@
78
78
  "build:esm": "BABEL_ENV=esm SC_NAMESPACE=sdds-srvc babel ./src --out-dir ./es --extensions .ts,.tsx",
79
79
  "generate:typings": "tsc --outDir . --emitDeclarationOnly",
80
80
  "storybook": "storybook dev -p ${PORT:-7007} -c .storybook",
81
+ "storybook:draft": "IS_DRAFT=true storybook dev -p ${PORT:-7007} -c .storybook",
82
+ "storybook:build:draft": "IS_DRAFT=true storybook build -c .storybook -o build-sb-draft",
81
83
  "storybook:build": "storybook build -c .storybook -o build-sb",
82
84
  "typescript-coverage": "npx typescript-coverage-report > /dev/null",
83
85
  "lint": "../../node_modules/.bin/eslint ./src --ext .js,.ts,.tsx --quiet"
@@ -94,5 +96,5 @@
94
96
  "Vasiliy Loginevskiy"
95
97
  ],
96
98
  "sideEffects": false,
97
- "gitHead": "c410afdbf526a38220b90aefd5e992025d260ec7"
99
+ "gitHead": "6451b24fb529d7c5638da23e7c8d7d8c14d2fc18"
98
100
  }
@@ -92,8 +92,11 @@ import { DrawerContentProps } from '@salutejs/plasma-new-hope/styled-components'
92
92
  import { DrawerFooterProps } from '@salutejs/plasma-new-hope/styled-components';
93
93
  import { DrawerHeaderProps } from '@salutejs/plasma-new-hope/styled-components';
94
94
  import { DrawerProps } from '@salutejs/plasma-new-hope/styled-components';
95
+ import type { DropdownItemOption } from '@salutejs/plasma-new-hope';
96
+ import type { DropdownNewProps } from '@salutejs/plasma-new-hope';
95
97
  import { DropdownNodeSelect } from '@salutejs/plasma-new-hope/styled-components';
96
- import { DropdownProps } from '@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types';
98
+ import { DropdownPlacement } from '@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types';
99
+ import { DropdownTrigger } from '@salutejs/plasma-new-hope/types/components/Dropdown/Dropdown.types';
97
100
  import { dsplL } from '@salutejs/sdds-themes/tokens';
98
101
  import { dsplLBold } from '@salutejs/sdds-themes/tokens';
99
102
  import { dsplM } from '@salutejs/sdds-themes/tokens';
@@ -1239,7 +1242,7 @@ export { DrawerHeaderProps }
1239
1242
  export { DrawerProps }
1240
1243
 
1241
1244
  // @public (undocumented)
1242
- export const Dropdown: FunctionComponent<PropsType< {
1245
+ export const Dropdown: <T extends DropdownItemOption>(props: Omit<DropdownNewProps<T>, "view" | "size"> & Pick<PropsType< {
1243
1246
  size: {
1244
1247
  l: PolymorphicClassName;
1245
1248
  m: PolymorphicClassName;
@@ -1249,7 +1252,31 @@ xs: PolymorphicClassName;
1249
1252
  view: {
1250
1253
  default: PolymorphicClassName;
1251
1254
  };
1252
- }> & DropdownProps & RefAttributes<HTMLDivElement>>;
1255
+ }> & {
1256
+ items: DropdownItemOption[];
1257
+ alwaysOpened?: boolean | undefined;
1258
+ children?: React_2.ReactNode;
1259
+ itemRole?: string | undefined;
1260
+ onHover?: ((index: number) => void) | undefined;
1261
+ onItemSelect?: ((item: DropdownItemOption, event: React_2.SyntheticEvent<Element, Event>) => void) | undefined;
1262
+ trigger?: DropdownTrigger | undefined;
1263
+ placement?: DropdownPlacement | undefined;
1264
+ offset?: [number, number] | undefined;
1265
+ listWidth?: Property.Width<string | number> | undefined;
1266
+ hasArrow?: boolean | undefined;
1267
+ closeOnSelect?: boolean | undefined;
1268
+ closeOnOverlayClick?: boolean | undefined;
1269
+ onToggle?: ((isOpen: boolean, event: Event | React_2.SyntheticEvent<Element, Event>) => void) | undefined;
1270
+ size?: string | undefined;
1271
+ view?: string | undefined;
1272
+ variant?: "normal" | "tight" | undefined;
1273
+ portal?: string | React_2.RefObject<HTMLElement> | undefined;
1274
+ renderItem?: ((item: DropdownItemOption) => React_2.ReactNode) | undefined;
1275
+ onItemClick?: ((item: DropdownItemOption, event: React_2.SyntheticEvent<Element, Event>) => void) | undefined;
1276
+ listOverflow?: Property.Overflow | undefined;
1277
+ listHeight?: Property.Height<string | number> | undefined;
1278
+ hoverIndex?: number | undefined;
1279
+ } & React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>, "view" | "size"> & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | null;
1253
1280
 
1254
1281
  // @public (undocumented)
1255
1282
  export const DsplL: FunctionComponent<PropsType< {