@hh.ru/magritte-ui-swipe 4.0.15
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/Swipe.d.ts +3 -0
- package/Swipe.js +516 -0
- package/Swipe.js.map +1 -0
- package/index.css +1032 -0
- package/index.d.ts +3 -0
- package/index.js +12 -0
- package/index.js.map +1 -0
- package/package.json +40 -0
- package/types.d.ts +54 -0
- package/types.js +3 -0
- package/types.js.map +1 -0
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
export * from '@hh.ru/magritte-ui-theme-provider';
|
|
3
|
+
export { Swipe } from './Swipe.js';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '@react-spring/web';
|
|
7
|
+
import 'classnames';
|
|
8
|
+
import '@hh.ru/magritte-common-func-utils';
|
|
9
|
+
import '@hh.ru/magritte-common-use-swipe/useSwipe';
|
|
10
|
+
import '@hh.ru/magritte-ui-breakpoint';
|
|
11
|
+
import '@hh.ru/magritte-ui-layer';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hh.ru/magritte-ui-swipe",
|
|
3
|
+
"version": "4.0.15",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"types": "index.d.ts",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"index.css"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "yarn root:build $(pwd)",
|
|
11
|
+
"build-test-branch": "yarn root:build-test-branch $(pwd)",
|
|
12
|
+
"changelog": "yarn root:changelog $(pwd)",
|
|
13
|
+
"prepack": "yarn root:prepack $(pwd)",
|
|
14
|
+
"postpublish": "yarn root:postpublish $(pwd)",
|
|
15
|
+
"stylelint-test": "yarn root:stylelint-test $(pwd)",
|
|
16
|
+
"eslint-test": "yarn root:eslint-test $(pwd)",
|
|
17
|
+
"ts-config": "yarn root:ts-config $(pwd)",
|
|
18
|
+
"ts-check": "yarn root:ts-check $(pwd)",
|
|
19
|
+
"test": "yarn root:test $(pwd)"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@hh.ru/magritte-common-func-utils": "1.3.6",
|
|
23
|
+
"@hh.ru/magritte-common-use-swipe": "3.0.1",
|
|
24
|
+
"@hh.ru/magritte-design-tokens": "18.1.1",
|
|
25
|
+
"@hh.ru/magritte-ui-breakpoint": "4.0.1",
|
|
26
|
+
"@hh.ru/magritte-ui-icon": "7.1.3",
|
|
27
|
+
"@hh.ru/magritte-ui-layer": "2.0.3",
|
|
28
|
+
"@hh.ru/magritte-ui-theme-provider": "1.1.21",
|
|
29
|
+
"@hh.ru/magritte-ui-typography": "3.0.8",
|
|
30
|
+
"@react-spring/web": "9.7.3"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"classnames": ">=2.3.2",
|
|
34
|
+
"react": ">=18.2.0"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "b660dd64fca3eaad5ec44ea9a73f92bb0d9694aa"
|
|
40
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon';
|
|
3
|
+
export type SwipeButtonStyle = 'neutral' | 'accent' | 'positive' | 'negative' | 'special' | 'warning';
|
|
4
|
+
type SwipeDemoTiming = 100 | 200 | 300 | 400 | 500;
|
|
5
|
+
export interface SwipeBaseProps {
|
|
6
|
+
/** Включает/выключает возможность делать длинный свайп */
|
|
7
|
+
useLongSwipe?: boolean;
|
|
8
|
+
/** Вызывается при начале свайпа */
|
|
9
|
+
onStart?: VoidFunction;
|
|
10
|
+
/** Вызывается при окончании свайпа (даже если кнопки не были раскрыты) */
|
|
11
|
+
onFinish?: VoidFunction;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
dataQa?: string;
|
|
14
|
+
/** Флаг для воспроизведения демонстрационной анимации для обучения пользователей. Демонстрацию нельзя прервать во время воспроизведения. */
|
|
15
|
+
demo?: boolean;
|
|
16
|
+
/** Режим демонстрации двустороннего свайпа */
|
|
17
|
+
twoSidedDemoMode?: 'left' | 'right' | 'left-to-right' | 'right-to-left';
|
|
18
|
+
/** Продолжительность всплытия кнопок при демонстрационной анимации */
|
|
19
|
+
demoAppearTime?: SwipeDemoTiming;
|
|
20
|
+
/** Пауза между всплытием и схлопыванием кнопок при демонстрационной анимации */
|
|
21
|
+
demoIdleTime?: SwipeDemoTiming;
|
|
22
|
+
/** Продолжительность схлопывания кнопок при демонстрационной анимации */
|
|
23
|
+
demoDisappearTime?: SwipeDemoTiming;
|
|
24
|
+
/** Вызывается при завершении воспроизведения демонстрационной анимации */
|
|
25
|
+
onFinishDemo?: VoidFunction;
|
|
26
|
+
/** Вызывается в начале воспроизведения демонстрационной анимации */
|
|
27
|
+
onStartDemo?: VoidFunction;
|
|
28
|
+
/** Метод должен устанавливать demo=false */
|
|
29
|
+
onResetDemo?: VoidFunction;
|
|
30
|
+
}
|
|
31
|
+
export interface SwipeButtonProps {
|
|
32
|
+
label: string;
|
|
33
|
+
showLabel: boolean;
|
|
34
|
+
style: SwipeButtonStyle;
|
|
35
|
+
icon: IconWrapperComponentSize24;
|
|
36
|
+
onClick: () => void;
|
|
37
|
+
closeOnAction?: boolean;
|
|
38
|
+
keepStateAfterLong?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type SwipeButtonsArray = [SwipeButtonProps, SwipeButtonProps?, SwipeButtonProps?];
|
|
41
|
+
export interface SwipeLeftProps extends SwipeBaseProps {
|
|
42
|
+
/** Массив кнопок для свайпа направо, должна быть хотя бы одна, если не задан rightButtons*/
|
|
43
|
+
leftButtons: SwipeButtonsArray;
|
|
44
|
+
/** Массив кнопок для свайпа направо, должна быть хотя бы одна, если не задан leftButtons*/
|
|
45
|
+
rightButtons?: SwipeButtonsArray;
|
|
46
|
+
}
|
|
47
|
+
export interface SwipeRightProps extends SwipeBaseProps {
|
|
48
|
+
/** Массив кнопок для свайпа направо, должна быть хотя бы одна, если не задан rightButtons*/
|
|
49
|
+
leftButtons?: SwipeButtonsArray;
|
|
50
|
+
/** Массив кнопок для свайпа направо, должна быть хотя бы одна, если не задан leftButtons*/
|
|
51
|
+
rightButtons: SwipeButtonsArray;
|
|
52
|
+
}
|
|
53
|
+
export type SwipeProps = SwipeLeftProps | SwipeRightProps;
|
|
54
|
+
export {};
|
package/types.js
ADDED
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|