mimir-ui-kit 1.14.4 → 1.14.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/README.md +62 -62
  2. package/dist/SelectSearchOption-snHM9uZX.js +3796 -0
  3. package/dist/assets/Image.css +1 -0
  4. package/dist/assets/SelectSearch.css +1 -1
  5. package/dist/assets/SelectSearchOption.css +1 -0
  6. package/dist/assets/Tag.css +1 -1
  7. package/dist/components/Image/Image.d.ts +12 -0
  8. package/dist/components/Image/Image.js +42 -15
  9. package/dist/components/Input/Input.js +1 -1
  10. package/dist/components/SelectSearch/SelectSearch.d.ts +7 -12
  11. package/dist/components/SelectSearch/SelectSearch.js +681 -3792
  12. package/dist/components/SelectSearch/constants.d.ts +2 -2
  13. package/dist/components/SelectSearch/constants.js +1 -1
  14. package/dist/components/SelectSearch/index.d.ts +2 -1
  15. package/dist/components/SelectSearch/types.d.ts +40 -0
  16. package/dist/components/SelectSearch/types.js +1 -0
  17. package/dist/components/SelectSearchOption/SelectSearchOption.d.ts +10 -0
  18. package/dist/components/SelectSearchOption/SelectSearchOption.js +8 -0
  19. package/dist/components/SelectSearchOption/index.d.ts +2 -0
  20. package/dist/components/SelectSearchOption/index.js +4 -0
  21. package/dist/components/Slider/Slider.d.ts +2 -0
  22. package/dist/components/Slider/Slider.js +4 -2
  23. package/dist/components/Tag/Tag.js +6 -6
  24. package/dist/components/Uploader/Uploader.d.ts +4 -4
  25. package/dist/components/Uploader/Uploader.js +5 -4
  26. package/dist/components/Uploader/constants.d.ts +1 -1
  27. package/dist/components/Uploader/constants.js +1 -1
  28. package/dist/components/Uploader/index.d.ts +1 -1
  29. package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +3 -3
  30. package/dist/components/UploaderPhotos/UploaderPhotos.js +2 -2
  31. package/dist/components/UploaderPhotos/index.d.ts +1 -1
  32. package/dist/components/index.d.ts +8 -2
  33. package/dist/components/index.js +8 -1
  34. package/dist/hooks/index.d.ts +1 -1
  35. package/dist/hooks/index.js +2 -1
  36. package/dist/hooks/useMediaQuery/constants.d.ts +10 -0
  37. package/dist/hooks/useMediaQuery/constants.js +13 -1
  38. package/dist/hooks/useMediaQuery/index.d.ts +1 -1
  39. package/dist/hooks/useMediaQuery/index.js +2 -1
  40. package/dist/index.js +10 -2
  41. package/package.json +130 -128
@@ -0,0 +1 @@
1
+ ._picture_9zemz_2,._image_9zemz_3{display:block;width:100%;height:auto}._loading_9zemz_9{filter:blur(20px);transition:.3s filter ease}
@@ -1 +1 @@
1
- ._select-search_1eksg_2{position:relative}._container_1eksg_6{display:flex;gap:var(--select-search-gap);align-items:center;justify-content:space-between;height:var(--select-search-height);padding:var(--select-search-space);background-color:var(--black-5);border-radius:var(--select-search-radius)}._container-open_1eksg_16{border-bottom:1px solid var(--citrine-100)}._full_1eksg_20{width:100%}._selectorIcon-open_1eksg_24{transform:rotate(180deg)}._placeholder_1eksg_28{position:absolute;top:var(--select-search-input-top);left:0;color:var(--black-60);font-size:var(--select-search-input-font-size);transition:all .3s ease;pointer-events:none}._placeholder-top_1eksg_37{font-size:var(--size-text-s);transform:translateY(-10px);transition-duration:.2s,.1s}._active-placeholder_1eksg_43:not(:-moz-placeholder-shown)~._placeholder_1eksg_28{font-size:var(--size-text-s);transform:translateY(-10px);transition-duration:.2s,.1s}._active-placeholder_1eksg_43:not(:placeholder-shown)~._placeholder_1eksg_28{font-size:var(--size-text-s);transform:translateY(-10px);transition-duration:.2s,.1s}._input_1eksg_49{width:100%;height:100%;color:var(--black-100);font-size:var(--select-search-input-font-size);background-color:var(--black-5)}._input_1eksg_49:focus~._placeholder_1eksg_28{font-size:var(--size-text-s);transform:translateY(-10px);transition-duration:.2s,.1s}._input-container_1eksg_61{position:relative;align-self:flex-end;width:100%}._button_1eksg_67{display:flex;align-items:center;background:none;border:none;cursor:pointer}._options_1eksg_75{position:absolute;top:100%;z-index:10;width:100%;height:-webkit-max-content;height:-moz-max-content;height:max-content;max-height:var(--select-search-options-height-desktop);overflow-y:auto;font-size:var(--size-text-l);background:var(--white);border-radius:0 0 var(--select-search-radius) var(--select-search-radius);box-shadow:var(--box-shadow-select-search)}._options_1eksg_75::-webkit-scrollbar{width:2px}._options_1eksg_75::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._options_1eksg_75::-webkit-scrollbar-track{background-color:var(--white)}@media (max-width: 600px){._options_1eksg_75{max-height:var(--select-search-options-height-mobile)}}._option_1eksg_75{padding:var(--select-search-option-space);cursor:pointer;transition:background-color .2s ease-in-out}._option-active_1eksg_109{background-color:var(--black-5)}._option-inner_1eksg_112{display:flex;gap:var(--space-m);align-items:center;justify-content:space-between}._no-options_1eksg_119{padding:var(--select-search-option-space);color:var(--black-80)}._l_1eksg_124{--select-search-height: var(--select-search-height-l);--select-search-space: var(--space-xss) var(--space-m);--select-search-radius: var(--control-radius);--select-search-input-font-size: var(--size-text-l);--select-search-gap: var(--space-2xs);--select-search-option-space: var(--space-2s) var(--space-m);--select-search-input-top: var(--select-search-input-top-l)}._xxl_1eksg_134{--select-search-height: var(--select-search-height-xxl);--select-search-space: var(--space-xss) var(--space-m);--select-search-radius: var(--control-radius-s);--select-search-input-font-size: var(--size-text-xl);--select-search-gap: var(--space-xs);--select-search-option-space: var(--space-2l) var(--space-m);--select-search-input-top: var(--select-search-input-top-xxl)}._selected-icon_1eksg_144 path{fill:var(--sapphire-100)}
1
+ ._select-search_1c0m8_2{position:relative}._container_1c0m8_6{display:block;gap:var(--select-search-gap);align-items:center;justify-content:space-between;height:var(--select-search-height);background-color:var(--black-5);border-radius:var(--select-search-radius)}._container-open_1c0m8_15{border-bottom:1px solid var(--citrine-100)}._full_1c0m8_19{width:100%}._selector-icon-open_1c0m8_23{transform:rotate(180deg)}._button_1c0m8_27{position:absolute;top:0;right:0;display:flex;align-items:center;margin:var(--select-search-btn-space);background:none;border:none;cursor:pointer}._options_1c0m8_39{position:absolute;top:100%;z-index:10;width:100%;height:-webkit-max-content;height:-moz-max-content;height:max-content;max-height:var(--select-search-options-height-desktop);overflow-y:auto;font-size:var(--size-text-l);background:var(--white);border-radius:0 0 var(--select-search-radius) var(--select-search-radius);box-shadow:var(--box-shadow-select-search)}._options_1c0m8_39::-webkit-scrollbar{width:2px}._options_1c0m8_39::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._options_1c0m8_39::-webkit-scrollbar-track{background-color:var(--white)}@media (max-width: 600px){._options_1c0m8_39{max-height:var(--select-search-options-height-mobile)}}._no-options_1c0m8_68{padding:var(--select-search-option-space);color:var(--black-80)}._m_1c0m8_73{--select-search-height: var(--select-search-height-l);--select-search-space: var(--space-xss) var(--space-m);--select-search-radius: var(--control-radius);--select-search-gap: var(--space-2xs);--select-search-btn-space: var(--space-m) var(--space-m) var(--space-m) var(--space-xs);--select-search-option-space: var(--space-2s) var(--space-m)}._l_1c0m8_83{--select-search-height: var(--select-search-height-xxl);--select-search-space: var(--space-xss) var(--space-m);--select-search-radius: var(--control-radius-s);--select-search-gap: var(--space-xs);--select-search-btn-space: var(--space-l) var(--space-m) var(--space-l) var(--space-xs);--select-search-option-space: var(--space-2l) var(--space-m)}._list_1c0m8_93{height:100%}._list_1c0m8_93::-webkit-scrollbar{width:2px}._list_1c0m8_93::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._list_1c0m8_93::-webkit-scrollbar-track{background-color:var(--white)}._custom-input-class_1c0m8_107{width:100%!important}._custom-input-class_1c0m8_107:last-child{padding-right:var(--space-4xl)}
@@ -0,0 +1 @@
1
+ ._option_5wfzg_2{display:flex;height:100%;padding:var(--select-search-option-space);cursor:pointer;transition:background-color .2s ease-in-out}._option-active_5wfzg_9{background-color:var(--black-5)}._option-inner_5wfzg_12{display:flex;gap:var(--space-m);align-items:center;align-self:center;justify-content:space-between;width:100%}._selected-icon_5wfzg_21 path{fill:var(--sapphire-100)}._m_5wfzg_25{--select-search-gap: var(--space-2xs);--select-search-option-space: var(--space-2s) var(--space-m)}._l_5wfzg_30{--select-search-gap: var(--space-xs);--select-search-option-space: var(--space-2l) var(--space-m)}
@@ -1 +1 @@
1
- ._container_1f2sk_2{display:flex;align-items:center;justify-content:center;color:var(--sapphire-normal);border:none;border:1px solid var(--sapphire-normal);border-top-left-radius:var(--control-radius-s);border-bottom-right-radius:var(--control-radius-s);transform:skew(-23.48deg)}._container_1f2sk_2:hover{color:var(--sapphire-hover);border-color:var(--sapphire-hover)}._container_1f2sk_2:active{color:var(--white);background-color:var(--sapphire-normal)}._container_1f2sk_2:focus{box-shadow:0 0 4px 0 var(--box-shadow-focus)}._container_1f2sk_2._disabled_1f2sk_24{color:var(--white);background-color:var(--disabled);border-color:var(--disabled)}._container_1f2sk_2 ._inner_1f2sk_29{display:inline-block;font-weight:var(--font-weight-text-regular);font-size:var(--size-text-l);font-family:var(--inter-font-family);line-height:var(--line-height-text-s1);transform:skew(23.48deg)}._container_1f2sk_2._M_1f2sk_37{height:40px;padding:0 15px}._container_1f2sk_2._S_1f2sk_41{height:32px;padding:0 11px}._container_1f2sk_2._S_1f2sk_41 ._inner_1f2sk_29{font-size:var(--size-text-m);line-height:16px}._container_1f2sk_2._XS_1f2sk_49{height:26px;padding:0 8px}._container_1f2sk_2._XS_1f2sk_49 ._inner_1f2sk_29{font-size:var(--size-text-s);line-height:20px}
1
+ ._container_ok6fq_2{display:flex;align-items:center;justify-content:center;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;color:var(--sapphire-normal);border:none;border:1px solid var(--sapphire-normal);border-top-left-radius:var(--control-radius-s);border-bottom-right-radius:var(--control-radius-s);transform:skew(-23.48deg)}._container_ok6fq_2:hover{color:var(--sapphire-hover);border-color:var(--sapphire-hover)}._container_ok6fq_2:active{color:var(--white);background-color:var(--sapphire-normal)}._container_ok6fq_2:focus{box-shadow:0 0 4px 0 var(--box-shadow-focus)}._container_ok6fq_2._disabled_ok6fq_25{color:var(--white);background-color:var(--disabled);border-color:var(--disabled)}._container_ok6fq_2 ._inner_ok6fq_30{display:inline-block;font-weight:var(--font-weight-text-regular);font-size:var(--size-text-l);font-family:var(--inter-font-family);line-height:var(--line-height-text-s1);transform:skew(23.48deg)}._container_ok6fq_2._M_ok6fq_38{height:40px;padding:0 15px}._container_ok6fq_2._S_ok6fq_42{height:32px;padding:0 11px}._container_ok6fq_2._S_ok6fq_42 ._inner_ok6fq_30{font-size:var(--size-text-m);line-height:16px}._container_ok6fq_2._XS_ok6fq_50{height:26px;padding:0 8px}._container_ok6fq_2._XS_ok6fq_50 ._inner_ok6fq_30{font-size:var(--size-text-s);line-height:20px}
@@ -5,6 +5,10 @@ type TProps = ComponentProps<'img'> & {
5
5
  * Дополнительный класс к компоненту
6
6
  */
7
7
  className?: string;
8
+ /**
9
+ * Дополнительный класс к контейнеру picture
10
+ */
11
+ pictureClassName?: string;
8
12
  /**
9
13
  * Компонент, который буде показываться, пока идет загрузка изображения
10
14
  */
@@ -13,6 +17,14 @@ type TProps = ComponentProps<'img'> & {
13
17
  * Компонент, который буде показываться, если произошла ошибка при загрузке изображения
14
18
  */
15
19
  errorFallback?: ReactElement;
20
+ /**
21
+ * Изображение для десктопной версии
22
+ */
23
+ desktopImage?: string;
24
+ /**
25
+ * Изображение для мобильной версии
26
+ */
27
+ mobileImage?: string;
16
28
  };
17
29
  /**
18
30
  * Компонент для отображения изображения с возможность показа загрузки и ошибки
@@ -1,10 +1,23 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { c as classNames } from "../../index-CweZ_OcN.js";
2
3
  import { memo, useState, useLayoutEffect } from "react";
4
+ import { EMediaQuery, EMinMediaQuery } from "../../hooks/useMediaQuery/constants.js";
5
+ import '../../assets/Image.css';const picture = "_picture_9zemz_2";
6
+ const image = "_image_9zemz_3";
7
+ const loading = "_loading_9zemz_9";
8
+ const cls = {
9
+ picture,
10
+ image,
11
+ loading
12
+ };
3
13
  const AppImage = memo((props) => {
4
14
  const {
5
15
  className,
6
16
  src,
7
17
  alt = "image",
18
+ desktopImage,
19
+ mobileImage,
20
+ pictureClassName,
8
21
  errorFallback,
9
22
  fallback,
10
23
  ...otherProps
@@ -13,7 +26,7 @@ const AppImage = memo((props) => {
13
26
  const [hasError, setHasError] = useState(false);
14
27
  useLayoutEffect(() => {
15
28
  const img = new Image();
16
- img.src = src ?? "";
29
+ img.src = src ?? desktopImage ?? mobileImage ?? "";
17
30
  img.onload = () => {
18
31
  setIsLoading(false);
19
32
  };
@@ -21,26 +34,40 @@ const AppImage = memo((props) => {
21
34
  setIsLoading(false);
22
35
  setHasError(true);
23
36
  };
24
- }, [src]);
37
+ }, [src, desktopImage, mobileImage]);
25
38
  if (isLoading && fallback) {
26
39
  return fallback;
27
40
  }
28
41
  if (hasError && errorFallback) {
29
42
  return errorFallback;
30
43
  }
31
- return /* @__PURE__ */ jsx(
32
- "img",
44
+ return /* @__PURE__ */ jsxs(
45
+ "picture",
33
46
  {
34
- ...otherProps,
35
- style: {
36
- display: "block",
37
- filter: `${isLoading ? "blur(20px)" : ""}`,
38
- transition: ".3s filter ease"
39
- },
40
- className,
41
- loading: "lazy",
42
- src,
43
- alt
47
+ className: classNames(cls.picture, pictureClassName, {
48
+ [cls.loading]: isLoading
49
+ }),
50
+ children: [
51
+ mobileImage && /* @__PURE__ */ jsx("source", { srcSet: mobileImage, media: EMediaQuery.S }),
52
+ desktopImage && /* @__PURE__ */ jsx("source", { srcSet: desktopImage, media: EMinMediaQuery.S }),
53
+ /* @__PURE__ */ jsx(
54
+ "img",
55
+ {
56
+ ...otherProps,
57
+ style: {
58
+ display: "block",
59
+ filter: `${isLoading ? "blur(20px)" : ""}`,
60
+ transition: ".3s filter ease"
61
+ },
62
+ className: classNames(cls.image, className, {
63
+ [cls.loading]: isLoading
64
+ }),
65
+ loading: "lazy",
66
+ src,
67
+ alt
68
+ }
69
+ )
70
+ ]
44
71
  }
45
72
  );
46
73
  });
@@ -106,7 +106,7 @@ const Input = memo(
106
106
  onFocus: handleFocus,
107
107
  onBlur: handleBlur,
108
108
  readOnly: readonly,
109
- value,
109
+ value: value || "",
110
110
  ...otherProps
111
111
  }
112
112
  )
@@ -1,15 +1,10 @@
1
- import { ESelectSearchSize } from './constants';
1
+ import { FixedSizeListProps } from 'react-window';
2
+ import { TSelectSearchProps } from './types';
3
+ import { SelectSearchOptionProps } from '../SelectSearchOption';
2
4
 
3
- export type TSelectSearchItem = {
4
- id: number;
5
- name: string;
6
- };
7
- export type TSelectSearchProps = {
8
- items: TSelectSearchItem[];
9
- value?: TSelectSearchItem | null;
10
- onChange?: (value: TSelectSearchItem | null) => void;
11
- placeholder?: string;
12
- size?: ESelectSearchSize;
13
- full?: boolean;
5
+ export type SelectSearchFilterOption = SelectSearchOptionProps & {
6
+ key: React.Key | null;
7
+ children: React.ReactNode;
14
8
  };
9
+ export type VirtualizedFixedSizeListProps = Omit<FixedSizeListProps, 'children' | 'itemCount'>;
15
10
  export declare const SelectSearch: import('react').ForwardRefExoticComponent<TSelectSearchProps & import('react').RefAttributes<HTMLElement>>;