@helpdice/ui 1.7.8 → 1.7.9
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/dist/breadcrumbs/index.js +10 -7
- package/dist/card/index.js +10 -7
- package/dist/carousal/CSSTranslate.d.ts +2 -0
- package/dist/carousal/component/Arrow.d.ts +9 -0
- package/dist/carousal/component/Indicator.d.ts +9 -0
- package/dist/carousal/component/Thumbs.d.ts +65 -0
- package/dist/carousal/component/animations.d.ts +27 -0
- package/dist/carousal/component/index.d.ts +87 -0
- package/dist/carousal/component/types.d.ts +79 -0
- package/dist/carousal/component/utils.d.ts +15 -0
- package/dist/carousal/cssClasses.d.ts +11 -0
- package/dist/carousal/dimensions.d.ts +1 -0
- package/dist/carousal/index.d.ts +3 -0
- package/dist/carousal/index.js +13166 -0
- package/dist/carousal/shims/document.d.ts +2 -0
- package/dist/carousal/shims/window.d.ts +2 -0
- package/dist/image/index.js +10 -7
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2794 -197
- package/dist/link/index.js +10 -7
- package/dist/link/link.d.ts +2 -1
- package/dist/swipe/index.d.ts +4 -0
- package/dist/swipe/index.js +1314 -0
- package/dist/swipe/react-swipe.d.ts +58 -0
- package/dist/user/index.js +10 -7
- package/esm/carousal/CSSTranslate.d.ts +2 -0
- package/esm/carousal/CSSTranslate.js +7 -0
- package/esm/carousal/component/Arrow.d.ts +9 -0
- package/esm/carousal/component/Arrow.js +21 -0
- package/esm/carousal/component/Indicator.d.ts +9 -0
- package/esm/carousal/component/Indicator.js +23 -0
- package/esm/carousal/component/Thumbs.d.ts +65 -0
- package/esm/carousal/{Thumbs.js → component/Thumbs.js} +41 -12
- package/esm/carousal/component/animations.d.ts +27 -0
- package/esm/carousal/{animations.js → component/animations.js} +1 -1
- package/esm/carousal/component/index.d.ts +87 -0
- package/esm/carousal/component/index.js +698 -0
- package/esm/carousal/component/types.d.ts +79 -0
- package/esm/carousal/component/utils.d.ts +15 -0
- package/esm/carousal/{utils.js → component/utils.js} +1 -1
- package/esm/carousal/cssClasses.d.ts +11 -0
- package/esm/carousal/cssClasses.js +56 -0
- package/esm/carousal/dimensions.d.ts +1 -0
- package/esm/carousal/dimensions.js +6 -0
- package/esm/carousal/index.d.ts +3 -0
- package/esm/carousal/index.js +2 -683
- package/esm/carousal/main.js +59 -0
- package/esm/carousal/shims/document.d.ts +2 -0
- package/esm/carousal/shims/document.js +3 -0
- package/esm/carousal/shims/window.d.ts +2 -0
- package/esm/carousal/shims/window.js +3 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +6 -1
- package/esm/link/link.d.ts +2 -1
- package/esm/link/link.js +10 -7
- package/esm/login-with/index.js +0 -2
- package/esm/swipe/demo.js +57 -0
- package/esm/swipe/index.d.ts +4 -0
- package/esm/swipe/index.js +2 -0
- package/esm/swipe/react-swipe.d.ts +58 -0
- package/esm/swipe/react-swipe.js +246 -0
- package/package.json +4 -3
- package/esm/carousal/Arrow.js +0 -18
- package/esm/carousal/Indicator.js +0 -20
- /package/esm/carousal/{types.js → component/types.js} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export interface AnimationHandlerResponse {
|
|
2
|
+
itemListStyle?: React.CSSProperties;
|
|
3
|
+
slideStyle?: React.CSSProperties;
|
|
4
|
+
selectedStyle?: React.CSSProperties;
|
|
5
|
+
prevStyle?: React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export type AnimationHandler = (props: CarouselProps, state: CarouselState) => AnimationHandlerResponse;
|
|
8
|
+
export type SwipeAnimationHandler = (delta: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}, props: CarouselProps, state: CarouselState, setState: Function) => AnimationHandlerResponse;
|
|
12
|
+
export type StopSwipingHandler = (props: CarouselProps, state: CarouselState) => AnimationHandlerResponse;
|
|
13
|
+
export interface CarouselProps {
|
|
14
|
+
ariaLabel?: string | undefined;
|
|
15
|
+
axis: 'horizontal' | 'vertical';
|
|
16
|
+
autoFocus?: boolean;
|
|
17
|
+
autoPlay?: boolean;
|
|
18
|
+
centerMode?: boolean;
|
|
19
|
+
centerSlidePercentage: number;
|
|
20
|
+
children?: React.ReactChild[];
|
|
21
|
+
className?: string;
|
|
22
|
+
dynamicHeight?: boolean;
|
|
23
|
+
emulateTouch?: boolean;
|
|
24
|
+
infiniteLoop?: boolean;
|
|
25
|
+
interval: number;
|
|
26
|
+
labels: {
|
|
27
|
+
leftArrow: string;
|
|
28
|
+
rightArrow: string;
|
|
29
|
+
item: string;
|
|
30
|
+
};
|
|
31
|
+
onClickItem: (index: number, item: React.ReactNode) => void;
|
|
32
|
+
onClickThumb: (index: number, item: React.ReactNode) => void;
|
|
33
|
+
onChange: (index: number, item: React.ReactNode) => void;
|
|
34
|
+
onSwipeStart: (event: React.TouchEvent) => void;
|
|
35
|
+
onSwipeEnd: (event: React.TouchEvent) => void;
|
|
36
|
+
onSwipeMove: (event: React.TouchEvent) => boolean;
|
|
37
|
+
preventMovementUntilSwipeScrollTolerance: boolean;
|
|
38
|
+
renderArrowPrev: (clickHandler: () => void, hasPrev: boolean, label: string) => React.ReactNode;
|
|
39
|
+
renderArrowNext: (clickHandler: () => void, hasNext: boolean, label: string) => React.ReactNode;
|
|
40
|
+
renderIndicator: (clickHandler: (e: React.MouseEvent | React.KeyboardEvent) => void, isSelected: boolean, index: number, label: string) => React.ReactNode;
|
|
41
|
+
renderItem: (item: React.ReactNode, options?: {
|
|
42
|
+
isSelected: boolean;
|
|
43
|
+
isPrevious: boolean;
|
|
44
|
+
}) => React.ReactNode;
|
|
45
|
+
renderThumbs: (children: React.ReactChild[]) => React.ReactChild[];
|
|
46
|
+
selectedItem: number;
|
|
47
|
+
showArrows: boolean;
|
|
48
|
+
showStatus: boolean;
|
|
49
|
+
showIndicators: boolean;
|
|
50
|
+
showThumbs: boolean;
|
|
51
|
+
statusFormatter: (currentItem: number, total: number) => string;
|
|
52
|
+
stopOnHover: boolean;
|
|
53
|
+
swipeable: boolean;
|
|
54
|
+
swipeScrollTolerance: number;
|
|
55
|
+
thumbWidth?: number;
|
|
56
|
+
transitionTime: number;
|
|
57
|
+
useKeyboardArrows?: boolean;
|
|
58
|
+
verticalSwipe: 'natural' | 'standard';
|
|
59
|
+
width: number | string;
|
|
60
|
+
animationHandler: 'slide' | 'fade' | AnimationHandler;
|
|
61
|
+
swipeAnimationHandler: SwipeAnimationHandler;
|
|
62
|
+
stopSwipingHandler: StopSwipingHandler;
|
|
63
|
+
}
|
|
64
|
+
export interface CarouselState {
|
|
65
|
+
autoPlay?: boolean;
|
|
66
|
+
cancelClick: boolean;
|
|
67
|
+
hasMount: boolean;
|
|
68
|
+
initialized: boolean;
|
|
69
|
+
isMouseEntered: boolean;
|
|
70
|
+
itemSize: number;
|
|
71
|
+
previousItem: number;
|
|
72
|
+
selectedItem: number;
|
|
73
|
+
swiping?: boolean;
|
|
74
|
+
swipeMovementStarted: boolean;
|
|
75
|
+
itemListStyle?: React.CSSProperties;
|
|
76
|
+
slideStyle?: React.CSSProperties;
|
|
77
|
+
selectedStyle?: React.CSSProperties;
|
|
78
|
+
prevStyle?: React.CSSProperties;
|
|
79
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CarouselProps } from './types';
|
|
2
|
+
export declare const noop: () => void;
|
|
3
|
+
export declare const defaultStatusFormatter: (current: number, total: number) => string;
|
|
4
|
+
export declare const isKeyboardEvent: (e?: React.MouseEvent | React.KeyboardEvent) => e is React.KeyboardEvent;
|
|
5
|
+
/**
|
|
6
|
+
* Gets the list 'position' relative to a current index
|
|
7
|
+
* @param index
|
|
8
|
+
*/
|
|
9
|
+
export declare const getPosition: (index: number, props: CarouselProps) => number;
|
|
10
|
+
/**
|
|
11
|
+
* Sets the 'position' transform for sliding animations
|
|
12
|
+
* @param position
|
|
13
|
+
* @param forceReflow
|
|
14
|
+
*/
|
|
15
|
+
export declare const setPosition: (position: number, axis: "horizontal" | "vertical") => React.CSSProperties;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Children } from 'react';
|
|
2
|
-
import CSSTranslate from '
|
|
2
|
+
import CSSTranslate from '../CSSTranslate';
|
|
3
3
|
export var noop = function noop() {};
|
|
4
4
|
export var defaultStatusFormatter = function defaultStatusFormatter(current, total) {
|
|
5
5
|
return "".concat(current, " of ").concat(total);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
ROOT: (customClassName?: string) => string;
|
|
3
|
+
CAROUSEL: (isSlider?: boolean) => string;
|
|
4
|
+
WRAPPER: (isSlider: boolean, axis?: "horizontal" | "vertical") => string;
|
|
5
|
+
SLIDER: (isSlider: boolean, isSwiping?: boolean) => string;
|
|
6
|
+
ITEM: (isSlider: boolean, selected: boolean, previous?: boolean) => string;
|
|
7
|
+
ARROW_PREV: (disabled?: boolean) => string;
|
|
8
|
+
ARROW_NEXT: (disabled?: boolean) => string;
|
|
9
|
+
DOT: (selected?: boolean) => string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
export default {
|
|
4
|
+
ROOT: function ROOT(customClassName) {
|
|
5
|
+
return classNames(_defineProperty({
|
|
6
|
+
'carousel-root': true
|
|
7
|
+
}, customClassName || '', !!customClassName));
|
|
8
|
+
},
|
|
9
|
+
CAROUSEL: function CAROUSEL(isSlider) {
|
|
10
|
+
return classNames({
|
|
11
|
+
carousel: true,
|
|
12
|
+
'carousel-slider': isSlider
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
WRAPPER: function WRAPPER(isSlider, axis) {
|
|
16
|
+
return classNames({
|
|
17
|
+
'thumbs-wrapper': !isSlider,
|
|
18
|
+
'slider-wrapper': isSlider,
|
|
19
|
+
'axis-horizontal': axis === 'horizontal',
|
|
20
|
+
'axis-vertical': axis !== 'horizontal'
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
SLIDER: function SLIDER(isSlider, isSwiping) {
|
|
24
|
+
return classNames({
|
|
25
|
+
thumbs: !isSlider,
|
|
26
|
+
slider: isSlider,
|
|
27
|
+
animated: !isSwiping
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
ITEM: function ITEM(isSlider, selected, previous) {
|
|
31
|
+
return classNames({
|
|
32
|
+
thumb: !isSlider,
|
|
33
|
+
slide: isSlider,
|
|
34
|
+
selected: selected,
|
|
35
|
+
previous: previous
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
ARROW_PREV: function ARROW_PREV(disabled) {
|
|
39
|
+
return classNames({
|
|
40
|
+
'control-arrow control-prev': true,
|
|
41
|
+
'control-disabled': disabled
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
ARROW_NEXT: function ARROW_NEXT(disabled) {
|
|
45
|
+
return classNames({
|
|
46
|
+
'control-arrow control-next': true,
|
|
47
|
+
'control-disabled': disabled
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
DOT: function DOT(selected) {
|
|
51
|
+
return classNames({
|
|
52
|
+
dot: true,
|
|
53
|
+
selected: selected
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const outerWidth: (el: HTMLElement) => number;
|