@rankingcoach/vanguard 1.8.0 → 1.10.0
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/index-Accordion2.js +1 -1
- package/dist/index-AccordionDetails.js +1 -1
- package/dist/index-AccordionSummary.js +1 -1
- package/dist/index-AppBar2.js +1 -1
- package/dist/index-Autocomplete2.js +1 -1
- package/dist/index-Backdrop.js +1 -1
- package/dist/index-BasePopper.js +1 -1
- package/dist/index-Box.js +1 -1
- package/dist/index-Bullets.js +12 -10
- package/dist/index-Bullets.module.scss.js +6 -4
- package/dist/index-Button2.js +1 -1
- package/dist/index-ButtonBase.js +1 -1
- package/dist/index-CSSTransition.js +1 -1
- package/dist/index-CalendarPicker.js +1 -1
- package/dist/index-CardMotion.config.js +159 -0
- package/dist/index-CardMotion.constants.js +23 -0
- package/dist/index-CardMotion.js +93 -0
- package/dist/index-CardMotion.module.scss.js +9 -0
- package/dist/index-Chip.js +1 -1
- package/dist/index-ClickAwayListener.js +1 -1
- package/dist/index-ClockPicker.js +1 -1
- package/dist/index-Collapse2.js +1 -1
- package/dist/index-DateInput.js +4 -4
- package/dist/index-DatePicker2.js +1 -1
- package/dist/index-DayCell.js +2 -2
- package/dist/index-DefaultPropsProvider.js +1 -1
- package/dist/index-DefaultPropsProvider2.js +1 -1
- package/dist/index-DesktopDatePicker.js +1 -1
- package/dist/index-Dialog.js +1 -1
- package/dist/index-DialogActions.js +1 -1
- package/dist/index-DialogContent.js +1 -1
- package/dist/index-Drawer2.js +1 -1
- package/dist/index-Fade.js +1 -1
- package/dist/index-FilledInput.js +1 -1
- package/dist/index-FocusTrap.js +1 -1
- package/dist/index-FormControl2.js +1 -1
- package/dist/index-FormHelperText.js +1 -1
- package/dist/index-FormLabel.js +1 -1
- package/dist/index-GlobalStyles.js +1 -1
- package/dist/index-GlobalStyles2.js +1 -1
- package/dist/index-GlobalStyles3.js +1 -1
- package/dist/index-Grid.js +1 -1
- package/dist/index-Grow.js +1 -1
- package/dist/index-IconButton2.js +1 -1
- package/dist/index-Input2.js +1 -1
- package/dist/index-InputAdornment.js +1 -1
- package/dist/index-InputBase2.js +1 -1
- package/dist/index-InputLabel.js +1 -1
- package/dist/index-InputRangeField.js +1 -1
- package/dist/index-LinearProgress.js +1 -1
- package/dist/index-List2.js +1 -1
- package/dist/index-ListSubheader.js +1 -1
- package/dist/index-LocalizationProvider.js +1 -1
- package/dist/index-Menu2.js +1 -1
- package/dist/index-MenuItem2.js +1 -1
- package/dist/index-MenuList.js +1 -1
- package/dist/index-MobileDatePicker.js +1 -1
- package/dist/index-Modal2.js +1 -1
- package/dist/index-ModalContext.js +37 -36
- package/dist/index-ModalTransition.js +9 -7
- package/dist/index-Month.js +3 -3
- package/dist/index-MonthPicker.js +1 -1
- package/dist/index-NativeSelectInput.js +1 -1
- package/dist/index-NotchedOutline.js +1 -1
- package/dist/index-OutlinedInput.js +1 -1
- package/dist/index-Paper.js +1 -1
- package/dist/index-PhotoCarouselModal.js +26 -25
- package/dist/index-PhotoCarouselModal.module.scss.js +6 -4
- package/dist/index-PickersDay.js +1 -1
- package/dist/index-Popover2.js +1 -1
- package/dist/index-Popper.js +1 -1
- package/dist/index-Portal.js +1 -1
- package/dist/index-PropTypes.js +1 -1
- package/dist/index-Ripple.js +1 -1
- package/dist/index-RtlProvider.js +1 -1
- package/dist/index-ScrollbarSize.js +1 -1
- package/dist/index-Select2.js +1 -1
- package/dist/index-SelectInput2.js +1 -1
- package/dist/index-Skeleton2.js +1 -1
- package/dist/index-Slide.js +1 -1
- package/dist/index-SlideCarousel.js +117 -138
- package/dist/index-SlideCarousel.module.scss.js +22 -14
- package/dist/index-Slider2.js +1 -1
- package/dist/index-SliderValueLabel.js +1 -1
- package/dist/index-Snackbar2.js +1 -1
- package/dist/index-SnackbarContent.js +1 -1
- package/dist/index-StyledEngineProvider.js +1 -1
- package/dist/index-SvgIcon.js +1 -1
- package/dist/index-Tab2.js +1 -1
- package/dist/index-TabScrollButton.js +1 -1
- package/dist/index-Tabs2.js +1 -1
- package/dist/index-Text.js +158 -131
- package/dist/index-TextField.js +1 -1
- package/dist/index-TextHighlighted.js +11 -136
- package/dist/index-TextareaAutosize.js +1 -1
- package/dist/index-ToggleButton2.js +1 -1
- package/dist/index-ToggleButtonGroup2.js +1 -1
- package/dist/index-Toolbar2.js +1 -1
- package/dist/index-Tooltip.js +1 -1
- package/dist/index-TouchRipple.js +1 -1
- package/dist/index-Transition.js +1 -1
- package/dist/index-TransitionGroup.js +1 -1
- package/dist/index-Typography.js +1 -1
- package/dist/index-YearPicker.js +1 -1
- package/dist/index-_virtual16.js +3 -5
- package/dist/index-_virtual17.js +5 -3
- package/dist/index-_virtual66.js +2 -2
- package/dist/index-_virtual67.js +4 -2
- package/dist/index-_virtual68.js +2 -4
- package/dist/index-_virtual69.js +4 -2
- package/dist/index-_virtual70.js +2 -2
- package/dist/index-_virtual71.js +1 -1
- package/dist/index-_virtual72.js +4 -2
- package/dist/index-_virtual73.js +1 -1
- package/dist/index-_virtual74.js +2 -4
- package/dist/index-_virtual75.js +2 -4
- package/dist/index-_virtual76.js +2 -2
- package/dist/index-accessibility.js +1 -1
- package/dist/index-elementAcceptingRef.js +1 -1
- package/dist/index-elementTypeAcceptingRef.js +1 -1
- package/dist/index-helpers3.js +1 -1
- package/dist/index-lib5.js +1 -1
- package/dist/index-react-spring_animated.modern.js +6 -6
- package/dist/index-react-spring_core.modern.js +56 -54
- package/dist/index-react-spring_web.modern.js +9 -8
- package/dist/index-refType.js +1 -1
- package/dist/index-regex.js +1 -1
- package/dist/index-responsivePropType.js +1 -1
- package/dist/index-use-carousel-movement.js +138 -0
- package/dist/index.js +300 -296
- package/dist/types/core/CardMotion/CardMotion.config.d.ts +855 -0
- package/dist/types/core/CardMotion/CardMotion.constants.d.ts +20 -0
- package/dist/types/core/CardMotion/CardMotion.d.ts +3 -0
- package/dist/types/core/CardMotion/CardMotion.types.d.ts +60 -0
- package/dist/types/core/CardMotion/index.d.ts +2 -0
- package/dist/types/core/CardMotion/stories/CustomMotion.story.d.ts +2 -0
- package/dist/types/core/CardMotion/stories/Default.story.d.ts +2 -0
- package/dist/types/core/CardMotion/stories/GlowIn.story.d.ts +2 -0
- package/dist/types/core/CardMotion/stories/GlowPreset.story.d.ts +2 -0
- package/dist/types/core/CardMotion/stories/Hoverable.story.d.ts +2 -0
- package/dist/types/core/CardMotion/stories/StaggeredGlowGroup.story.d.ts +2 -0
- package/dist/types/core/CardMotion/stories/VisibilityToggle.story.d.ts +2 -0
- package/dist/types/core/CardMotion/stories/_CardMotion.default.d.ts +3 -0
- package/dist/types/core/Modal/ModalContext.d.ts +1 -0
- package/dist/types/core/Modal/stories/StackingPermutations.story.d.ts +71 -0
- package/dist/types/core/Modal/stories/TwoModalsOverlapping.story.d.ts +2 -0
- package/dist/types/core/Modal/stories/TwoModalsOverlappingDifferentAnimations.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/Bullets/Bullets.d.ts +2 -0
- package/dist/types/core/SlideCarousel/SlideCarousel.d.ts +6 -0
- package/dist/types/core/SlideCarousel/hooks/use-carousel-movement.d.ts +27 -0
- package/dist/types/core/SlideCarousel/index.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselAutoPlay.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselBasic.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselBulletsBelow.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselControlled.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselCustomArrows.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselCustomBullets.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselMultipleSlidesAtOnce.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselOutsideArrows.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselWithArrows.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselWithArrowsAndBullets.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/SlideCarouselWithBullets.story.d.ts +2 -0
- package/dist/types/core/SlideCarousel/stories/_SlideCarousel.default.d.ts +13 -0
- package/dist/types/core/Text/Text.types.d.ts +4 -0
- package/dist/types/core/Text/stories/stories/HighlightCaseInsensitive.story.d.ts +3 -0
- package/dist/types/core/Text/stories/stories/HighlightDefault.story.d.ts +2 -0
- package/dist/types/core/Text/stories/stories/HighlightModeBackground.story.d.ts +2 -0
- package/dist/types/core/Text/stories/stories/HighlightModeBold.story.d.ts +2 -0
- package/dist/types/core/Text/stories/stories/HighlightModeText.story.d.ts +2 -0
- package/dist/types/core/Text/stories/stories/HighlightWithEmphasis.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/TextHighlighted.d.ts +4 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/vanguard-asset-analysis.json +1 -1
- package/dist/vanguard.css +1 -1
- package/dist-wordpress/index.js +17776 -17742
- package/dist-wordpress/types/core/PageSection/GradientPrimaryMeshBackground.d.ts +1 -0
- package/dist-wordpress/types/core/PageSection/PageSection.d.ts +43 -0
- package/dist-wordpress/types/core/PageSection/index.d.ts +2 -0
- package/dist-wordpress/types/core/TextHighlighted/TextHighlighted.d.ts +4 -1
- package/dist-wordpress/types/index.d.ts +2 -0
- package/dist-wordpress/vanguard.css +1 -1
- package/package.json +1 -1
- package/dist/types/core/TextHighlighted/stories/TextHighlightedWithXSSAttackStory.story.d.ts +0 -2
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { useGesture as K } from "./index-use-gesture-react.esm.js";
|
|
2
|
+
import { useState as N, useEffect as g, useMemo as O, useRef as P } from "react";
|
|
3
|
+
import "./index-react-spring_web.modern.js";
|
|
4
|
+
import { useSpring as Q } from "./index-react-spring_core.modern.js";
|
|
5
|
+
const I = (s, n, p) => Math.min(Math.max(s, n), p), U = (s, n) => Math.max(0, s - n), L = (s) => {
|
|
6
|
+
const n = P(s);
|
|
7
|
+
return n.current = s, n;
|
|
8
|
+
}, tt = ({
|
|
9
|
+
activeIndex: s,
|
|
10
|
+
auto: n,
|
|
11
|
+
initialIndex: p,
|
|
12
|
+
length: c,
|
|
13
|
+
onSlideChange: w,
|
|
14
|
+
setSlideCustom: M,
|
|
15
|
+
slideGap: h,
|
|
16
|
+
slidesAtOnce: u,
|
|
17
|
+
slidesToSlide: l,
|
|
18
|
+
viewportRef: x
|
|
19
|
+
}) => {
|
|
20
|
+
const o = U(c, u), k = () => {
|
|
21
|
+
var a;
|
|
22
|
+
const t = ((a = x.current) == null ? void 0 : a.getBoundingClientRect().width) ?? 0, r = h * Math.max(u - 1, 0);
|
|
23
|
+
return (t - r) / u;
|
|
24
|
+
}, v = (t) => {
|
|
25
|
+
const r = M ? M(t) : t;
|
|
26
|
+
return I(r, 0, o);
|
|
27
|
+
}, [e, B] = N(() => v(p)), f = L(e), E = L(w), [T, W] = Q(() => ({
|
|
28
|
+
x: 0,
|
|
29
|
+
config: {
|
|
30
|
+
tension: 280,
|
|
31
|
+
friction: 30,
|
|
32
|
+
mass: 1
|
|
33
|
+
}
|
|
34
|
+
})), i = (t) => {
|
|
35
|
+
B(v(t));
|
|
36
|
+
}, S = (t, r = !1) => {
|
|
37
|
+
const a = k(), d = a + h;
|
|
38
|
+
a <= 0 || W.start({
|
|
39
|
+
x: -t * d,
|
|
40
|
+
immediate: r
|
|
41
|
+
});
|
|
42
|
+
}, F = (t) => {
|
|
43
|
+
W.start({
|
|
44
|
+
x: t,
|
|
45
|
+
immediate: !0
|
|
46
|
+
});
|
|
47
|
+
}, X = (t, r) => I(t + (r > 0 ? -1 : 1), 0, o), $ = K({
|
|
48
|
+
onDrag: ({
|
|
49
|
+
down: t,
|
|
50
|
+
movement: [r],
|
|
51
|
+
direction: [a],
|
|
52
|
+
cancel: d,
|
|
53
|
+
active: y,
|
|
54
|
+
last: H
|
|
55
|
+
}) => {
|
|
56
|
+
const D = k(), z = D + h;
|
|
57
|
+
if (D <= 0) return;
|
|
58
|
+
const m = f.current, J = -m * z;
|
|
59
|
+
if (t && Math.abs(r) > z / 2) {
|
|
60
|
+
const C = X(m, a);
|
|
61
|
+
d == null || d(), y && (C === m ? S(m) : i(C));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (y && t) {
|
|
65
|
+
F(J + r);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
(H || !t) && S(m);
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
drag: {
|
|
72
|
+
delay: 200,
|
|
73
|
+
filterTaps: !0
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
g(() => {
|
|
77
|
+
S(e), E.current(e);
|
|
78
|
+
}, [e, u]), g(() => {
|
|
79
|
+
let t;
|
|
80
|
+
return n > 0 && c > 0 && (t = window.setInterval(() => {
|
|
81
|
+
const r = f.current >= o ? 0 : f.current + 1;
|
|
82
|
+
i(r);
|
|
83
|
+
}, n)), () => {
|
|
84
|
+
t && clearInterval(t);
|
|
85
|
+
};
|
|
86
|
+
}, [n, c, o]), g(() => {
|
|
87
|
+
const t = c > 0 ? v(s % c) : 0;
|
|
88
|
+
t !== f.current && i(t);
|
|
89
|
+
}, [s, c, o]), g(() => {
|
|
90
|
+
if (!x.current || typeof ResizeObserver > "u") return;
|
|
91
|
+
const t = new ResizeObserver(() => {
|
|
92
|
+
S(f.current, !0);
|
|
93
|
+
});
|
|
94
|
+
return t.observe(x.current), () => t.disconnect();
|
|
95
|
+
}, [u]);
|
|
96
|
+
const b = () => {
|
|
97
|
+
i(0);
|
|
98
|
+
}, R = () => {
|
|
99
|
+
i(o);
|
|
100
|
+
}, j = () => {
|
|
101
|
+
const t = e >= o, r = e + u - 1 + l < c - 1;
|
|
102
|
+
if (t) {
|
|
103
|
+
b();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (!r) {
|
|
107
|
+
R();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
i(e + l);
|
|
111
|
+
}, q = () => {
|
|
112
|
+
if (e === 0) {
|
|
113
|
+
R();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (e - l <= 0) {
|
|
117
|
+
b();
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
i(e - l);
|
|
121
|
+
}, G = O(() => ({
|
|
122
|
+
transform: T.x.to((t) => `translate3d(${t}px, 0, 0)`),
|
|
123
|
+
willChange: "transform",
|
|
124
|
+
touchAction: "pan-y"
|
|
125
|
+
}), [T.x]);
|
|
126
|
+
return {
|
|
127
|
+
gestureBinds: $,
|
|
128
|
+
maxSlide: o,
|
|
129
|
+
nextSlide: j,
|
|
130
|
+
previousSlide: q,
|
|
131
|
+
slide: e,
|
|
132
|
+
trackStyle: G,
|
|
133
|
+
updateSlide: i
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export {
|
|
137
|
+
tt as useCarouselMovement
|
|
138
|
+
};
|