@cloud-ru/uikit-product-mobile-drawer 0.9.15 → 0.9.17

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 (100) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/components/MobileDrawer/MobileDrawer.d.ts +40 -0
  3. package/dist/cjs/components/MobileDrawer/MobileDrawer.js +29 -0
  4. package/dist/cjs/components/MobileDrawer/index.d.ts +1 -0
  5. package/dist/cjs/components/MobileDrawer/index.js +17 -0
  6. package/dist/cjs/components/MobileDrawer/styles.module.css +4 -0
  7. package/dist/cjs/components/MobileDrawerCustom/MobileDrawerCustom.d.ts +50 -0
  8. package/dist/cjs/components/MobileDrawerCustom/MobileDrawerCustom.js +72 -0
  9. package/dist/cjs/components/MobileDrawerCustom/constants.d.ts +10 -0
  10. package/dist/cjs/components/MobileDrawerCustom/constants.js +25 -0
  11. package/dist/cjs/components/MobileDrawerCustom/hooks.d.ts +22 -0
  12. package/dist/cjs/components/MobileDrawerCustom/hooks.js +164 -0
  13. package/dist/cjs/components/MobileDrawerCustom/index.d.ts +1 -0
  14. package/dist/cjs/components/MobileDrawerCustom/index.js +17 -0
  15. package/dist/cjs/components/MobileDrawerCustom/motion.css +117 -0
  16. package/dist/cjs/components/MobileDrawerCustom/styles.module.css +182 -0
  17. package/dist/cjs/components/index.d.ts +2 -0
  18. package/dist/cjs/components/index.js +18 -0
  19. package/dist/cjs/constants.d.ts +36 -0
  20. package/dist/cjs/constants.js +39 -0
  21. package/dist/cjs/helperComponents/Body/Body.d.ts +10 -0
  22. package/dist/cjs/helperComponents/Body/Body.js +27 -0
  23. package/dist/cjs/helperComponents/Body/index.d.ts +1 -0
  24. package/dist/cjs/helperComponents/Body/index.js +17 -0
  25. package/dist/cjs/helperComponents/Body/styles.module.css +9 -0
  26. package/dist/cjs/helperComponents/ButtonClose/ButtonClose.d.ts +5 -0
  27. package/dist/cjs/helperComponents/ButtonClose/ButtonClose.js +13 -0
  28. package/dist/cjs/helperComponents/ButtonClose/index.d.ts +1 -0
  29. package/dist/cjs/helperComponents/ButtonClose/index.js +17 -0
  30. package/dist/cjs/helperComponents/ButtonClose/styles.module.css +35 -0
  31. package/dist/cjs/helperComponents/Footer/Footer.d.ts +10 -0
  32. package/dist/cjs/helperComponents/Footer/Footer.js +27 -0
  33. package/dist/cjs/helperComponents/Footer/index.d.ts +1 -0
  34. package/dist/cjs/helperComponents/Footer/index.js +17 -0
  35. package/dist/cjs/helperComponents/Footer/styles.module.css +14 -0
  36. package/dist/cjs/helperComponents/Header/Header.d.ts +20 -0
  37. package/dist/cjs/helperComponents/Header/Header.js +29 -0
  38. package/dist/cjs/helperComponents/Header/index.d.ts +1 -0
  39. package/dist/cjs/helperComponents/Header/index.js +17 -0
  40. package/dist/cjs/helperComponents/Header/styles.module.css +32 -0
  41. package/dist/cjs/helperComponents/WithTooltip/WithTooltip.d.ts +8 -0
  42. package/dist/cjs/helperComponents/WithTooltip/WithTooltip.js +11 -0
  43. package/dist/cjs/helperComponents/WithTooltip/index.d.ts +1 -0
  44. package/dist/cjs/helperComponents/WithTooltip/index.js +17 -0
  45. package/dist/cjs/helperComponents/index.d.ts +4 -0
  46. package/dist/cjs/helperComponents/index.js +20 -0
  47. package/dist/cjs/index.d.ts +1 -0
  48. package/dist/cjs/index.js +17 -0
  49. package/dist/cjs/types.d.ts +6 -0
  50. package/dist/cjs/types.js +2 -0
  51. package/dist/esm/components/MobileDrawer/MobileDrawer.d.ts +40 -0
  52. package/dist/esm/components/MobileDrawer/MobileDrawer.js +23 -0
  53. package/dist/esm/components/MobileDrawer/index.d.ts +1 -0
  54. package/dist/esm/components/MobileDrawer/index.js +1 -0
  55. package/dist/esm/components/MobileDrawer/styles.module.css +4 -0
  56. package/dist/esm/components/MobileDrawerCustom/MobileDrawerCustom.d.ts +50 -0
  57. package/dist/esm/components/MobileDrawerCustom/MobileDrawerCustom.js +66 -0
  58. package/dist/esm/components/MobileDrawerCustom/constants.d.ts +10 -0
  59. package/dist/esm/components/MobileDrawerCustom/constants.js +21 -0
  60. package/dist/esm/components/MobileDrawerCustom/hooks.d.ts +22 -0
  61. package/dist/esm/components/MobileDrawerCustom/hooks.js +158 -0
  62. package/dist/esm/components/MobileDrawerCustom/index.d.ts +1 -0
  63. package/dist/esm/components/MobileDrawerCustom/index.js +1 -0
  64. package/dist/esm/components/MobileDrawerCustom/motion.css +117 -0
  65. package/dist/esm/components/MobileDrawerCustom/styles.module.css +182 -0
  66. package/dist/esm/components/index.d.ts +2 -0
  67. package/dist/esm/components/index.js +2 -0
  68. package/dist/esm/constants.d.ts +36 -0
  69. package/dist/esm/constants.js +36 -0
  70. package/dist/esm/helperComponents/Body/Body.d.ts +10 -0
  71. package/dist/esm/helperComponents/Body/Body.js +21 -0
  72. package/dist/esm/helperComponents/Body/index.d.ts +1 -0
  73. package/dist/esm/helperComponents/Body/index.js +1 -0
  74. package/dist/esm/helperComponents/Body/styles.module.css +9 -0
  75. package/dist/esm/helperComponents/ButtonClose/ButtonClose.d.ts +5 -0
  76. package/dist/esm/helperComponents/ButtonClose/ButtonClose.js +7 -0
  77. package/dist/esm/helperComponents/ButtonClose/index.d.ts +1 -0
  78. package/dist/esm/helperComponents/ButtonClose/index.js +1 -0
  79. package/dist/esm/helperComponents/ButtonClose/styles.module.css +35 -0
  80. package/dist/esm/helperComponents/Footer/Footer.d.ts +10 -0
  81. package/dist/esm/helperComponents/Footer/Footer.js +21 -0
  82. package/dist/esm/helperComponents/Footer/index.d.ts +1 -0
  83. package/dist/esm/helperComponents/Footer/index.js +1 -0
  84. package/dist/esm/helperComponents/Footer/styles.module.css +14 -0
  85. package/dist/esm/helperComponents/Header/Header.d.ts +20 -0
  86. package/dist/esm/helperComponents/Header/Header.js +23 -0
  87. package/dist/esm/helperComponents/Header/index.d.ts +1 -0
  88. package/dist/esm/helperComponents/Header/index.js +1 -0
  89. package/dist/esm/helperComponents/Header/styles.module.css +32 -0
  90. package/dist/esm/helperComponents/WithTooltip/WithTooltip.d.ts +8 -0
  91. package/dist/esm/helperComponents/WithTooltip/WithTooltip.js +8 -0
  92. package/dist/esm/helperComponents/WithTooltip/index.d.ts +1 -0
  93. package/dist/esm/helperComponents/WithTooltip/index.js +1 -0
  94. package/dist/esm/helperComponents/index.d.ts +4 -0
  95. package/dist/esm/helperComponents/index.js +4 -0
  96. package/dist/esm/index.d.ts +1 -0
  97. package/dist/esm/index.js +1 -0
  98. package/dist/esm/types.d.ts +6 -0
  99. package/dist/esm/types.js +1 -0
  100. package/package.json +5 -4
@@ -0,0 +1,182 @@
1
+ .content{
2
+ flex-grow:1;
3
+ min-width:var(--dimension-5m, 40px);
4
+ min-height:var(--dimension-5m, 40px);
5
+ display:flex;
6
+ flex-direction:column;
7
+ }
8
+ .content[data-swipe]{
9
+ cursor:grab;
10
+ }
11
+ .content[data-swipe][data-pointers]{
12
+ cursor:grabbing;
13
+ -webkit-user-select:none;
14
+ -moz-user-select:none;
15
+ user-select:none;
16
+ -webkit-user-drag:none;
17
+ }
18
+
19
+ .drawerRoot{
20
+ z-index:initial !important;
21
+ }
22
+ .drawerRoot, .drawerRoot *{
23
+ overscroll-behavior-y:contain;
24
+ }
25
+ .drawerRoot div[data-content-wrapper=true]{
26
+ will-change:transform;
27
+ z-index:initial;
28
+ overflow:hidden;
29
+ touch-action:none;
30
+ }
31
+ .drawerRoot div[data-content-wrapper=true][data-position=left], .drawerRoot div[data-content-wrapper=true][data-position=right]{
32
+ height:100%;
33
+ max-height:100%;
34
+ max-width:calc(100% - var(--space-drawer-outside-gap, 24px));
35
+ top:0;
36
+ bottom:0;
37
+ }
38
+ .drawerRoot div[data-content-wrapper=true][data-position=left] .content, .drawerRoot div[data-content-wrapper=true][data-position=right] .content{
39
+ max-height:100dvh;
40
+ }
41
+ .drawerRoot div[data-content-wrapper=true][data-position=left][data-size=s], .drawerRoot div[data-content-wrapper=true][data-position=right][data-size=s]{
42
+ min-width:var(--size-drawer-min-width-s, 304px);
43
+ width:var(--size-drawer-width-s, 464px);
44
+ }
45
+ .drawerRoot div[data-content-wrapper=true][data-position=left][data-size=m], .drawerRoot div[data-content-wrapper=true][data-position=right][data-size=m]{
46
+ min-width:var(--size-drawer-min-width-m, 304px);
47
+ width:var(--size-drawer-width-m, 864px);
48
+ }
49
+ .drawerRoot div[data-content-wrapper=true][data-position=left][data-size=l], .drawerRoot div[data-content-wrapper=true][data-position=right][data-size=l]{
50
+ min-width:var(--size-drawer-min-width-l, 304px);
51
+ width:var(--size-drawer-width-l, 1872px);
52
+ }
53
+ .drawerRoot div[data-content-wrapper=true][data-position=left]{
54
+ left:0;
55
+ }
56
+ .drawerRoot div[data-content-wrapper=true][data-position=left][data-border-radius]{
57
+ border-bottom-right-radius:12px;
58
+ border-top-right-radius:12px;
59
+ }
60
+ .drawerRoot div[data-content-wrapper=true][data-position=left][data-outline]{
61
+ border-right:1px solid var(--sys-neutral-decor-default, #dde0ea);
62
+ }
63
+ .drawerRoot div[data-content-wrapper=true][data-position=right]{
64
+ right:0;
65
+ }
66
+ .drawerRoot div[data-content-wrapper=true][data-position=right][data-border-radius]{
67
+ border-bottom-left-radius:12px;
68
+ border-top-left-radius:12px;
69
+ }
70
+ .drawerRoot div[data-content-wrapper=true][data-position=right][data-outline]{
71
+ border-left:1px solid var(--sys-neutral-decor-default, #dde0ea);
72
+ }
73
+ .drawerRoot div[data-content-wrapper=true][data-position=bottom], .drawerRoot div[data-content-wrapper=true][data-position=top]{
74
+ width:100%;
75
+ max-width:100%;
76
+ max-height:calc(100% - var(--space-drawer-outside-gap, 24px));
77
+ left:0;
78
+ right:0;
79
+ }
80
+ .drawerRoot div[data-content-wrapper=true][data-position=bottom] .content, .drawerRoot div[data-content-wrapper=true][data-position=top] .content{
81
+ max-height:calc(100dvh - var(--space-drawer-outside-gap, 24px));
82
+ }
83
+ .drawerRoot div[data-content-wrapper=true][data-position=bottom][data-size=s], .drawerRoot div[data-content-wrapper=true][data-position=top][data-size=s]{
84
+ height:var(--size-drawer-width-s, 464px);
85
+ min-height:var(--size-drawer-min-width-s, 304px);
86
+ }
87
+ .drawerRoot div[data-content-wrapper=true][data-position=bottom][data-size=m], .drawerRoot div[data-content-wrapper=true][data-position=top][data-size=m]{
88
+ height:var(--size-drawer-width-m, 864px);
89
+ min-height:var(--size-drawer-min-width-m, 304px);
90
+ }
91
+ .drawerRoot div[data-content-wrapper=true][data-position=bottom][data-size=l], .drawerRoot div[data-content-wrapper=true][data-position=top][data-size=l]{
92
+ height:var(--size-drawer-width-l, 1872px);
93
+ min-height:var(--size-drawer-min-width-l, 304px);
94
+ }
95
+ .drawerRoot div[data-content-wrapper=true][data-position=bottom]{
96
+ bottom:0;
97
+ }
98
+ .drawerRoot div[data-content-wrapper=true][data-position=bottom][data-border-radius]{
99
+ border-top-left-radius:12px;
100
+ border-top-right-radius:12px;
101
+ }
102
+ .drawerRoot div[data-content-wrapper=true][data-position=bottom][data-outline]{
103
+ border-top:1px solid var(--sys-neutral-decor-default, #dde0ea);
104
+ }
105
+ .drawerRoot div[data-content-wrapper=true][data-position=top]{
106
+ top:0;
107
+ }
108
+ .drawerRoot div[data-content-wrapper=true][data-position=top][data-border-radius]{
109
+ border-bottom-left-radius:12px;
110
+ border-bottom-right-radius:12px;
111
+ }
112
+ .drawerRoot div[data-content-wrapper=true][data-position=top][data-outline]{
113
+ border-bottom:1px solid var(--sys-neutral-decor-default, #dde0ea);
114
+ }
115
+ .drawerRoot div[data-content-wrapper=true][data-mode=regular] .drawer{
116
+ background-color:var(--sys-neutral-background1-level, #fdfdfd);
117
+ }
118
+ .drawerRoot div[data-content-wrapper=true][data-mode=soft] .drawer{
119
+ background-color:var(--sys-neutral-background2-level, #ffffff);
120
+ }
121
+
122
+ .drawer{
123
+ overflow:unset;
124
+ display:flex;
125
+ flex-direction:column;
126
+ box-sizing:border-box;
127
+ box-shadow:var(--box-shadow-elevation-level5, 0px 0px 16px 0px rgba(0, 0, 0, 0.0784313725), 0px 24px 16px 0px rgba(0, 0, 0, 0.0784313725));
128
+ }
129
+
130
+ .mask{
131
+ z-index:initial !important;
132
+ background-color:var(--sys-blackout, rgba(0, 0, 0, 0.3215686275));
133
+ }
134
+
135
+ .maskBlur{
136
+ backdrop-filter:blur(var(--background-blur-background-blur, 16px));
137
+ }
138
+
139
+ .drawerBlur{
140
+ outline:none;
141
+ }
142
+
143
+ .swiper{
144
+ position:absolute;
145
+ background-color:var(--sys-neutral-decor-default, #dde0ea);
146
+ border-radius:var(--dimension-050m, 4px);
147
+ }
148
+ .swiper[data-position=left], .swiper[data-position=right]{
149
+ width:var(--dimension-050m, 4px);
150
+ height:var(--dimension-10m, 80px);
151
+ }
152
+ .swiper[data-position=left]{
153
+ right:var(--dimension-050m, 4px);
154
+ top:calc(50% - var(--dimension-10m, 80px) / 2);
155
+ }
156
+ .swiper[data-position=right]{
157
+ left:var(--dimension-050m, 4px);
158
+ top:calc(50% - var(--dimension-10m, 80px) / 2);
159
+ }
160
+ .swiper[data-position=bottom], .swiper[data-position=top]{
161
+ width:var(--dimension-10m, 80px);
162
+ height:var(--dimension-050m, 4px);
163
+ }
164
+ .swiper[data-position=bottom]{
165
+ top:var(--dimension-050m, 4px);
166
+ left:calc(50% - var(--dimension-10m, 80px) / 2);
167
+ }
168
+ .swiper[data-position=top]{
169
+ bottom:var(--dimension-050m, 4px);
170
+ left:calc(50% - var(--dimension-10m, 80px) / 2);
171
+ }
172
+
173
+ .headerElements{
174
+ padding-top:var(--space-drawer-header-elements-top, 16px);
175
+ padding-right:var(--space-drawer-header-elements-side, 16px);
176
+ gap:var(--space-drawer-headline-layout-badge-elements-layout-gap, 16px);
177
+ position:absolute;
178
+ top:0;
179
+ right:0;
180
+ display:flex;
181
+ align-items:center;
182
+ }
@@ -0,0 +1,2 @@
1
+ export * from './MobileDrawer';
2
+ export * from './MobileDrawerCustom';
@@ -0,0 +1,2 @@
1
+ export * from './MobileDrawer';
2
+ export * from './MobileDrawerCustom';
@@ -0,0 +1,36 @@
1
+ export declare const SIZE: {
2
+ readonly S: "s";
3
+ readonly M: "m";
4
+ readonly L: "l";
5
+ };
6
+ export declare const SIZE_AS_VALUES: string[];
7
+ export declare const MODE: {
8
+ readonly Regular: "regular";
9
+ readonly Soft: "soft";
10
+ };
11
+ export declare const MODAL_MODE: {
12
+ readonly Regular: "regular";
13
+ readonly Aggressive: "aggressive";
14
+ readonly Forced: "forced";
15
+ };
16
+ export declare const POSITION: {
17
+ readonly Right: "right";
18
+ readonly Left: "left";
19
+ readonly Bottom: "bottom";
20
+ readonly Top: "top";
21
+ };
22
+ export declare const NESTED_DRAWER_PUSH_DISTANCE = 24;
23
+ export declare const TEST_IDS: {
24
+ closeButton: string;
25
+ header: string;
26
+ title: string;
27
+ tooltip: string;
28
+ subtitle: string;
29
+ image: string;
30
+ content: string;
31
+ footer: string;
32
+ footerActions: string;
33
+ approveButton: string;
34
+ cancelButton: string;
35
+ additionalButton: string;
36
+ };
@@ -0,0 +1,36 @@
1
+ export const SIZE = {
2
+ S: 's',
3
+ M: 'm',
4
+ L: 'l',
5
+ };
6
+ export const SIZE_AS_VALUES = Object.values(SIZE);
7
+ export const MODE = {
8
+ Regular: 'regular',
9
+ Soft: 'soft',
10
+ };
11
+ export const MODAL_MODE = {
12
+ Regular: 'regular',
13
+ Aggressive: 'aggressive',
14
+ Forced: 'forced',
15
+ };
16
+ export const POSITION = {
17
+ Right: 'right',
18
+ Left: 'left',
19
+ Bottom: 'bottom',
20
+ Top: 'top',
21
+ };
22
+ export const NESTED_DRAWER_PUSH_DISTANCE = 24;
23
+ export const TEST_IDS = {
24
+ closeButton: 'drawer__close-button',
25
+ header: 'drawer__header',
26
+ title: 'drawer__title',
27
+ tooltip: 'drawer__title-tooltip',
28
+ subtitle: 'drawer__subtitle',
29
+ image: 'drawer__image',
30
+ content: 'drawer__body',
31
+ footer: 'drawer__footer',
32
+ footerActions: 'drawer__footer-actions',
33
+ approveButton: 'drawer__approve-button',
34
+ cancelButton: 'drawer__cancel-button',
35
+ additionalButton: 'drawer__additional-button',
36
+ };
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ import { WithSupportProps } from '@snack-uikit/utils';
3
+ export type DrawerBodyProps = WithSupportProps<{
4
+ /** Контент */
5
+ content: ReactNode;
6
+ /** CSS-класс */
7
+ className?: string;
8
+ }>;
9
+ /** Вспомогательный компонент для добавления "тела" в DrawerCustom */
10
+ export declare function DrawerBody({ content, className, ...rest }: DrawerBodyProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import cn from 'classnames';
14
+ import { Scroll } from '@snack-uikit/scroll';
15
+ import { extractSupportProps } from '@snack-uikit/utils';
16
+ import styles from './styles.module.css';
17
+ /** Вспомогательный компонент для добавления "тела" в DrawerCustom */
18
+ export function DrawerBody(_a) {
19
+ var { content, className } = _a, rest = __rest(_a, ["content", "className"]);
20
+ return (_jsx(Scroll, Object.assign({ size: 'm', barHideStrategy: 'never', className: cn(styles.drawerBody, className) }, extractSupportProps(rest), { children: content })));
21
+ }
@@ -0,0 +1 @@
1
+ export * from './Body';
@@ -0,0 +1 @@
1
+ export * from './Body';
@@ -0,0 +1,9 @@
1
+ .drawerBody{
2
+ padding-left:var(--space-drawer-body-side, 32px);
3
+ padding-right:var(--space-drawer-body-side, 32px);
4
+ padding:0 var(--dimension-2m, 16px);
5
+ flex:1 1 auto;
6
+ box-sizing:border-box;
7
+ min-height:var(--dimension-2m, 16px);
8
+ color:var(--sys-neutral-text-main, #41424e);
9
+ }
@@ -0,0 +1,5 @@
1
+ type ButtonCloseProps = {
2
+ onClick(): void;
3
+ };
4
+ export declare function ButtonClose({ onClick }: ButtonCloseProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CrossSVG } from '@sbercloud/uikit-product-icons';
3
+ import { TEST_IDS } from '../../constants';
4
+ import styles from './styles.module.css';
5
+ export function ButtonClose({ onClick }) {
6
+ return (_jsx("button", { type: 'button', className: styles.buttonClose, onClick: onClick, "aria-label": 'close drawer', "data-test-id": TEST_IDS.closeButton, children: _jsx(CrossSVG, {}) }));
7
+ }
@@ -0,0 +1 @@
1
+ export * from './ButtonClose';
@@ -0,0 +1 @@
1
+ export * from './ButtonClose';
@@ -0,0 +1,35 @@
1
+ .buttonClose{
2
+ width:var(--size-drawer-button-close, 32px);
3
+ height:var(--size-drawer-button-close, 32px);
4
+ border-radius:var(--radius-drawer-button-close, 16px);
5
+ cursor:pointer;
6
+ display:flex;
7
+ align-items:center;
8
+ justify-content:center;
9
+ box-sizing:border-box;
10
+ margin:0;
11
+ padding:0;
12
+ color:var(--sys-neutral-text-support, #6d707f);
13
+ background-color:var(--sys-neutral-decor-default, #dde0ea);
14
+ border:0 solid transparent;
15
+ outline:0;
16
+ outline-offset:var(--spacing-state-focus-offset, 2px);
17
+ }
18
+ .buttonClose:hover, .buttonClose:focus-visible{
19
+ color:var(--sys-neutral-text-main, #41424e);
20
+ background-color:var(--sys-neutral-decor-hovered, #cfd2dc);
21
+ }
22
+ .buttonClose:focus-visible{
23
+ outline-width:var(--border-state-focus-s-border-width, 2px);
24
+ outline-style:var(--border-state-focus-s-border-style, solid);
25
+ outline-color:var(--border-state-focus-s-border-color, );
26
+ outline-color:var(--sys-available-complementary, #1c1c24);
27
+ }
28
+ .buttonClose:active{
29
+ color:var(--sys-neutral-text-main, #41424e);
30
+ background-color:var(--sys-neutral-decor-activated, #b6bac7);
31
+ }
32
+ .buttonClose svg{
33
+ width:var(--size-icon-container-s, 24px) !important;
34
+ height:var(--size-icon-container-s, 24px) !important;
35
+ }
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ import { WithSupportProps } from '@snack-uikit/utils';
3
+ export type DrawerFooterProps = WithSupportProps<{
4
+ /** Слот для добавления кнопок-действий */
5
+ actions: ReactNode;
6
+ /** CSS-класс */
7
+ className?: string;
8
+ }>;
9
+ /** Вспомогательный компонент для добавления "футера" в DrawerCustom */
10
+ export declare function DrawerFooter({ actions, className, ...rest }: DrawerFooterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import cn from 'classnames';
14
+ import { extractSupportProps } from '@snack-uikit/utils';
15
+ import { TEST_IDS } from '../../constants';
16
+ import styles from './styles.module.css';
17
+ /** Вспомогательный компонент для добавления "футера" в DrawerCustom */
18
+ export function DrawerFooter(_a) {
19
+ var { actions, className } = _a, rest = __rest(_a, ["actions", "className"]);
20
+ return (_jsx("div", Object.assign({ className: cn(styles.footer, className) }, extractSupportProps(rest), { children: _jsx("div", { className: styles.footerActions, "data-test-id": TEST_IDS.footerActions, children: actions }) })));
21
+ }
@@ -0,0 +1 @@
1
+ export * from './Footer';
@@ -0,0 +1 @@
1
+ export * from './Footer';
@@ -0,0 +1,14 @@
1
+ .footer{
2
+ padding:var(--dimension-2m, 16px);
3
+ gap:var(--dimension-1m, 8px);
4
+ display:flex;
5
+ flex-direction:column;
6
+ }
7
+
8
+ .footerActions{
9
+ gap:var(--space-drawer-footer-action-row-gap, 8px);
10
+ display:flex;
11
+ flex-direction:row-reverse;
12
+ flex-wrap:wrap-reverse;
13
+ align-items:center;
14
+ }
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ import { MobileQuestionTooltipProps } from '@sbercloud/uikit-product-mobile-tooltip';
3
+ import { WithSupportProps } from '@snack-uikit/utils';
4
+ export type DrawerHeaderProps = WithSupportProps<{
5
+ /** Изображение */
6
+ image?: {
7
+ src: string;
8
+ alt: string;
9
+ };
10
+ /** Заголовок */
11
+ title: ReactNode;
12
+ /** Тултип для заголовка */
13
+ titleTooltip?: MobileQuestionTooltipProps['tip'];
14
+ /** Подзаголовок */
15
+ subtitle?: ReactNode;
16
+ /** CSS-класс */
17
+ className?: string;
18
+ }>;
19
+ /** Вспомогательный компонент для добавления "шапки" в DrawerCustom */
20
+ export declare function DrawerHeader({ title, titleTooltip, subtitle, image, className, ...rest }: DrawerHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import cn from 'classnames';
14
+ import { MobileQuestionTooltip } from '@sbercloud/uikit-product-mobile-tooltip';
15
+ import { Typography } from '@snack-uikit/typography';
16
+ import { extractSupportProps } from '@snack-uikit/utils';
17
+ import { TEST_IDS } from '../../constants';
18
+ import styles from './styles.module.css';
19
+ /** Вспомогательный компонент для добавления "шапки" в DrawerCustom */
20
+ export function DrawerHeader(_a) {
21
+ var { title, titleTooltip, subtitle, image, className } = _a, rest = __rest(_a, ["title", "titleTooltip", "subtitle", "image", "className"]);
22
+ return (_jsxs("div", Object.assign({ className: cn(styles.drawerHeader, className) }, extractSupportProps(rest), { children: [image && _jsx("img", { src: image.src, alt: image.alt, className: styles.image, "data-test-id": TEST_IDS.image }), _jsxs("div", { className: styles.headlineLayout, children: [_jsxs("div", { className: styles.headline, children: [_jsx(Typography.SansHeadlineS, { className: styles.title, "data-test-id": TEST_IDS.title, children: title }), titleTooltip && _jsx(MobileQuestionTooltip, { tip: titleTooltip, size: 's', "data-test-id": TEST_IDS.tooltip })] }), subtitle && (_jsx(Typography.SansBodyM, { className: styles.subtitle, "data-test-id": TEST_IDS.subtitle, children: subtitle }))] })] })));
23
+ }
@@ -0,0 +1 @@
1
+ export * from './Header';
@@ -0,0 +1 @@
1
+ export * from './Header';
@@ -0,0 +1,32 @@
1
+ .drawerHeader{
2
+ }
3
+
4
+ .image{
5
+ height:var(--size-drawer-image, 184px);
6
+ display:block;
7
+ width:100%;
8
+ -o-object-fit:cover;
9
+ object-fit:cover;
10
+ }
11
+
12
+ .headlineLayout{
13
+ padding:var(--dimension-2m, 16px);
14
+ gap:var(--dimension-1m, 8px);
15
+ display:flex;
16
+ flex-direction:column;
17
+ }
18
+
19
+ .headline{
20
+ gap:var(--space-drawer-headline-layout-headline, 4px);
21
+ display:flex;
22
+ align-items:center;
23
+ }
24
+
25
+ .title{
26
+ display:grid;
27
+ color:var(--sys-neutral-text-main, #41424e);
28
+ }
29
+
30
+ .subtitle{
31
+ color:var(--sys-neutral-text-support, #6d707f);
32
+ }
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { MobileTooltipProps } from '@sbercloud/uikit-product-mobile-tooltip';
3
+ type WithTooltipProps = PropsWithChildren<{
4
+ /** Тултип над кнопкой */
5
+ tooltip?: MobileTooltipProps;
6
+ }>;
7
+ export declare function WithTooltip({ tooltip, children }: WithTooltipProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { MobileTooltip } from '@sbercloud/uikit-product-mobile-tooltip';
3
+ export function WithTooltip({ tooltip, children }) {
4
+ if (!tooltip) {
5
+ return _jsx(_Fragment, { children: children });
6
+ }
7
+ return _jsx(MobileTooltip, Object.assign({}, tooltip, { children: children }));
8
+ }
@@ -0,0 +1 @@
1
+ export * from './WithTooltip';
@@ -0,0 +1 @@
1
+ export * from './WithTooltip';
@@ -0,0 +1,4 @@
1
+ export * from './Body';
2
+ export * from './ButtonClose';
3
+ export * from './Footer';
4
+ export * from './Header';
@@ -0,0 +1,4 @@
1
+ export * from './Body';
2
+ export * from './ButtonClose';
3
+ export * from './Footer';
4
+ export * from './Header';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,6 @@
1
+ import { ValueOf } from '@snack-uikit/utils';
2
+ import { MODAL_MODE, MODE, POSITION, SIZE } from './constants';
3
+ export type Size = ValueOf<typeof SIZE>;
4
+ export type Mode = ValueOf<typeof MODE>;
5
+ export type ModalMode = ValueOf<typeof MODAL_MODE>;
6
+ export type Position = ValueOf<typeof POSITION>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-mobile-drawer",
3
3
  "title": "Mobile Drawer",
4
- "version": "0.9.15",
4
+ "version": "0.9.17",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -30,14 +30,15 @@
30
30
  "name": "Akhremenko Grigorii",
31
31
  "url": "https://github.com/AGrigorii"
32
32
  },
33
+ "contributors": [],
33
34
  "license": "Apache-2.0",
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
38
  "scripts": {},
38
39
  "dependencies": {
39
- "@cloud-ru/uikit-product-icons": "15.1.1",
40
- "@cloud-ru/uikit-product-mobile-tooltip": "0.4.65",
40
+ "@cloud-ru/uikit-product-icons": "15.1.3",
41
+ "@cloud-ru/uikit-product-mobile-tooltip": "0.4.67",
41
42
  "@snack-uikit/button": "0.19.15",
42
43
  "@snack-uikit/scroll": "0.10.4",
43
44
  "@snack-uikit/typography": "0.8.10",
@@ -50,5 +51,5 @@
50
51
  "devDependencies": {
51
52
  "@types/merge-refs": "1.0.3"
52
53
  },
53
- "gitHead": "e8bd79bc92b26a8f52611972eec98a867536ccd3"
54
+ "gitHead": "bf479ecf7238ef20b78f20acaef439efa535d1a1"
54
55
  }