@sima-land/ui-nucleons 40.0.0 → 40.2.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.
Files changed (83) hide show
  1. package/_internal/custom-scrollbar/index.js +3 -3
  2. package/alert/index.js +1 -1
  3. package/autocomplete/index.js +12 -17
  4. package/avatar/index.d.ts +1 -1
  5. package/avatar/index.js +2 -4
  6. package/avatar/user.d.ts +1 -1
  7. package/avatar/user.js +2 -2
  8. package/avatar/utils.js +7 -1
  9. package/base-input/index.d.ts +1 -1
  10. package/base-input/index.js +1 -1
  11. package/bordered-layout/index.d.ts +1 -1
  12. package/bordered-layout/index.js +1 -1
  13. package/box/index.js +17 -36
  14. package/button/index.d.ts +3 -3
  15. package/button/index.js +4 -4
  16. package/card/slots.js +1 -1
  17. package/carousel/draggable.js +14 -16
  18. package/carousel/index.d.ts +1 -1
  19. package/carousel/index.js +17 -37
  20. package/chips/index.js +1 -1
  21. package/clean-buttons/index.js +1 -3
  22. package/dot-nav/dot-nav.module.scss +2 -2
  23. package/dropdown/dropdown.module.scss +1 -3
  24. package/field-grid/index.d.ts +2 -2
  25. package/field-grid/index.js +3 -3
  26. package/file-icon/index.js +5 -6
  27. package/helpers/bounds-of.js +1 -3
  28. package/helpers/find-child-element.js +1 -3
  29. package/helpers/find-offset-parent.js +4 -3
  30. package/helpers/fit-element-height.js +1 -1
  31. package/helpers/format-date.js +3 -1
  32. package/helpers/get-fraction-depth.js +1 -3
  33. package/hooks/breakpoint/index.js +3 -2
  34. package/hooks/identity.d.ts +1 -0
  35. package/hooks/identity.js +1 -0
  36. package/hooks/index.d.ts +5 -0
  37. package/hooks/index.js +7 -2
  38. package/layout/index.js +1 -1
  39. package/link/index.js +1 -3
  40. package/loading-overlay/index.d.ts +1 -1
  41. package/loading-overlay/index.js +1 -1
  42. package/modal/index.js +2 -2
  43. package/modal/utils.d.ts +3 -2
  44. package/modal/utils.js +8 -7
  45. package/nav-bar/index.d.ts +1 -0
  46. package/nav-bar/index.js +1 -1
  47. package/package.json +14 -10
  48. package/pagination/base-pagination.js +18 -20
  49. package/pagination/index.js +1 -3
  50. package/pagination/utils.d.ts +2 -2
  51. package/pagination/utils.js +7 -6
  52. package/panel/index.js +1 -3
  53. package/phone-input/index.js +19 -20
  54. package/portal/index.js +3 -4
  55. package/price/utils.js +1 -3
  56. package/range/index.js +11 -14
  57. package/rating/index.js +2 -2
  58. package/readme.md +1 -1
  59. package/screen/index.js +14 -16
  60. package/screen/screen-layout.js +10 -4
  61. package/select/index.js +5 -7
  62. package/side-page/index.d.ts +39 -0
  63. package/side-page/index.js +91 -0
  64. package/side-page/side-page.module.scss +81 -0
  65. package/side-page/slots.d.ts +32 -0
  66. package/side-page/slots.js +59 -0
  67. package/spinner/index.d.ts +1 -1
  68. package/spinner/index.js +1 -1
  69. package/spinner/spinner.module.scss +1 -4
  70. package/styling/fonts.js +1 -3
  71. package/styling/utils.js +1 -3
  72. package/text-field/index.js +3 -10
  73. package/timer/index.d.ts +3 -3
  74. package/timer/index.js +4 -4
  75. package/timer/utils.js +1 -4
  76. package/top-bar/index.js +1 -1
  77. package/upload/area.js +3 -1
  78. package/upload/utils.d.ts +2 -2
  79. package/upload/utils.js +2 -2
  80. package/with-hint/positioning-hint.d.ts +1 -1
  81. package/with-hint/positioning-hint.js +1 -1
  82. package/with-hint/utils.js +5 -7
  83. package/with-in-viewport-observer/index.js +1 -1
package/timer/utils.js CHANGED
@@ -14,10 +14,7 @@ const UNITS = ['day', 'hour', 'minute', 'second'];
14
14
  * @param distance Оставшееся время.
15
15
  * @return Отформатированное время.
16
16
  */
17
- const formatDistance = ({ days, hours, minutes, seconds }) => [
18
- days,
19
- ...[hours % 24, minutes % 60, seconds % 60].map(s => `${s}`.padStart(2, '0')),
20
- ].join(':');
17
+ const formatDistance = ({ days, hours, minutes, seconds }) => [days, ...[hours % 24, minutes % 60, seconds % 60].map(s => `${s}`.padStart(2, '0'))].join(':');
21
18
  exports.formatDistance = formatDistance;
22
19
  /**
23
20
  * Возвращает объект с данными об оставшемся времени от текущего момента.
package/top-bar/index.js CHANGED
@@ -43,7 +43,7 @@ const TopBar = ({ divided, size = 'm', title, subtitle, buttonsProps: { start, s
43
43
  hasStartSecondary ? react_1.default.createElement(exports.IconButton, Object.assign({}, startSecondary)) : secondaryStub,
44
44
  react_1.default.createElement("div", { className: cx('main-section') },
45
45
  react_1.default.createElement("div", { className: cx('title', 'ellipsis') }, title),
46
- Boolean(subtitle) && (react_1.default.createElement("div", { className: cx('subtitle', 'ellipsis') }, subtitle))),
46
+ Boolean(subtitle) && react_1.default.createElement("div", { className: cx('subtitle', 'ellipsis') }, subtitle)),
47
47
  hasEndSecondary ? react_1.default.createElement(exports.IconButton, Object.assign({}, endSecondary)) : secondaryStub,
48
48
  hasEnd ? react_1.default.createElement(exports.IconButton, Object.assign({}, end)) : stub));
49
49
  };
package/upload/area.js CHANGED
@@ -33,7 +33,9 @@ const cx = bind_1.default.bind(area_module_scss_1.default);
33
33
  const UploadArea = (_a) => {
34
34
  var { onSelect, className, fileRole = 'файл', formats, sizeLimit = '2 Mb', multiple, countLimit = multiple ? undefined : 1, failed, 'data-testid': testId = 'upload-area' } = _a, restProps = __rest(_a, ["onSelect", "className", "fileRole", "formats", "sizeLimit", "multiple", "countLimit", "failed", 'data-testid']);
35
35
  const secondaryInfo = (0, lodash_1.upperFirst)([
36
- countLimit && countLimit > 0 && `${countLimit} ${(0, get_declination_1.default)(countLimit, ['файл', 'файла', 'файлов'])}`,
36
+ countLimit &&
37
+ countLimit > 0 &&
38
+ `${countLimit} ${(0, get_declination_1.default)(countLimit, ['файл', 'файла', 'файлов'])}`,
37
39
  formats && `формат ${formats}`,
38
40
  `до ${sizeLimit}`,
39
41
  ]
package/upload/utils.d.ts CHANGED
@@ -16,13 +16,13 @@ declare type DnDResult<T> = {
16
16
  * @param options Опции.
17
17
  * @return Данные.
18
18
  */
19
- export declare const useDragAndDrop: <T extends HTMLElement = HTMLElement>({ onDrop }: DnDProps<T>) => DnDResult<T>;
19
+ export declare const useDragAndDrop: <T extends HTMLElement = HTMLElement>({ onDrop, }: DnDProps<T>) => DnDResult<T>;
20
20
  /**
21
21
  * Возвращает функцию обработки FileList по заданным ограничениям.
22
22
  * @param props Свойства.
23
23
  * @return Функция.
24
24
  */
25
- export declare const getFilesPreparer: ({ multiple, countLimit, }: {
25
+ export declare const getFilesPreparer: ({ multiple, countLimit }: {
26
26
  multiple?: boolean | undefined;
27
27
  countLimit?: number | undefined;
28
28
  }) => (list: File[] | FileList) => File[];
package/upload/utils.js CHANGED
@@ -11,7 +11,7 @@ const with_prevent_1 = __importDefault(require("../helpers/with-prevent"));
11
11
  * @param options Опции.
12
12
  * @return Данные.
13
13
  */
14
- const useDragAndDrop = ({ onDrop }) => {
14
+ const useDragAndDrop = ({ onDrop, }) => {
15
15
  const [active, setActive] = (0, react_1.useState)(false);
16
16
  return {
17
17
  active,
@@ -35,7 +35,7 @@ exports.useDragAndDrop = useDragAndDrop;
35
35
  * @param props Свойства.
36
36
  * @return Функция.
37
37
  */
38
- const getFilesPreparer = ({ multiple, countLimit, }) => (list) => {
38
+ const getFilesPreparer = ({ multiple, countLimit }) => (list) => {
39
39
  const files = [...list];
40
40
  multiple
41
41
  ? countLimit && Number.isFinite(countLimit) && files.splice(countLimit)
@@ -8,5 +8,5 @@ interface Props extends HintProps {
8
8
  * @param props Свойства.
9
9
  * @return Элемент.
10
10
  */
11
- export declare const PositioningHint: ({ children, direction, openerRef, }: Props) => JSX.Element;
11
+ export declare const PositioningHint: ({ children, direction, openerRef }: Props) => JSX.Element;
12
12
  export {};
@@ -35,7 +35,7 @@ const cx = bind_1.default.bind(positioning_hint_module_scss_1.default);
35
35
  * @param props Свойства.
36
36
  * @return Элемент.
37
37
  */
38
- const PositioningHint = ({ children, direction, openerRef, }) => {
38
+ const PositioningHint = ({ children, direction, openerRef }) => {
39
39
  const layer = (0, layer_1.useLayer)();
40
40
  const ref = (0, react_1.useRef)(null);
41
41
  (0, react_1.useEffect)(() => {
@@ -16,23 +16,23 @@ exports.PlaceAt = {
16
16
  ],
17
17
  top: (hint, opener) => {
18
18
  const [hintRect, openerRect, correct] = exports.PlaceAt.commons(hint, opener);
19
- hint.style.left = `${correct.x + openerRect.left + (openerRect.width / 2) - (hintRect.width / 2)}px`;
19
+ hint.style.left = `${correct.x + openerRect.left + openerRect.width / 2 - hintRect.width / 2}px`;
20
20
  hint.style.top = `${correct.y - SPACE + openerRect.top - hintRect.height}px`;
21
21
  },
22
22
  right: (hint, opener) => {
23
23
  const [hintRect, openerRect, correct] = exports.PlaceAt.commons(hint, opener);
24
24
  hint.style.left = `${correct.x + SPACE + openerRect.right}px`;
25
- hint.style.top = `${correct.y + openerRect.top + (openerRect.height / 2) - (hintRect.height / 2)}px`;
25
+ hint.style.top = `${correct.y + openerRect.top + openerRect.height / 2 - hintRect.height / 2}px`;
26
26
  },
27
27
  bottom: (hint, opener) => {
28
28
  const [hintRect, openerRect, correct] = exports.PlaceAt.commons(hint, opener);
29
- hint.style.left = `${correct.x + openerRect.left + (openerRect.width / 2) - (hintRect.width / 2)}px`;
29
+ hint.style.left = `${correct.x + openerRect.left + openerRect.width / 2 - hintRect.width / 2}px`;
30
30
  hint.style.top = `${correct.y + SPACE + openerRect.bottom}px`;
31
31
  },
32
32
  left: (hint, opener) => {
33
33
  const [hintRect, openerRect, correct] = exports.PlaceAt.commons(hint, opener);
34
34
  hint.style.left = `${correct.x - SPACE + openerRect.left - hintRect.width}px`;
35
- hint.style.top = `${correct.y + openerRect.top + (openerRect.height / 2) - (hintRect.height / 2)}px`;
35
+ hint.style.top = `${correct.y + openerRect.top + openerRect.height / 2 - hintRect.height / 2}px`;
36
36
  },
37
37
  };
38
38
  /**
@@ -44,9 +44,7 @@ exports.PlaceAt = {
44
44
  const onParentScroll = (element, callback) => {
45
45
  let scrollParent = (0, get_scroll_parent_1.getScrollParent)(element);
46
46
  // прокрутка на body не работает с addEventListener, https://stackoverflow.com/a/43632204/13166471
47
- scrollParent = scrollParent === document.body
48
- ? document
49
- : scrollParent;
47
+ scrollParent = scrollParent === document.body ? document : scrollParent;
50
48
  return (0, on_1.default)(scrollParent, 'scroll', callback);
51
49
  };
52
50
  exports.onParentScroll = onParentScroll;
@@ -32,7 +32,7 @@ function makeInViewportObserverHOC(observersDataList) {
32
32
  * @param props Свойства для оборачиваемого компонента.
33
33
  * @return Компонент высшего порядка.
34
34
  */
35
- const Wrapper = (props) => react_1.default.createElement(Component, Object.assign({}, { [propName]: addObserve }, props));
35
+ const Wrapper = (props) => (react_1.default.createElement(Component, Object.assign({}, { [propName]: addObserve }, props)));
36
36
  Wrapper.displayName = `withInViewportObserver(${Component.displayName || Component.name})`;
37
37
  return Wrapper;
38
38
  };