@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.
Files changed (183) hide show
  1. package/dist/index-Accordion2.js +1 -1
  2. package/dist/index-AccordionDetails.js +1 -1
  3. package/dist/index-AccordionSummary.js +1 -1
  4. package/dist/index-AppBar2.js +1 -1
  5. package/dist/index-Autocomplete2.js +1 -1
  6. package/dist/index-Backdrop.js +1 -1
  7. package/dist/index-BasePopper.js +1 -1
  8. package/dist/index-Box.js +1 -1
  9. package/dist/index-Bullets.js +12 -10
  10. package/dist/index-Bullets.module.scss.js +6 -4
  11. package/dist/index-Button2.js +1 -1
  12. package/dist/index-ButtonBase.js +1 -1
  13. package/dist/index-CSSTransition.js +1 -1
  14. package/dist/index-CalendarPicker.js +1 -1
  15. package/dist/index-CardMotion.config.js +159 -0
  16. package/dist/index-CardMotion.constants.js +23 -0
  17. package/dist/index-CardMotion.js +93 -0
  18. package/dist/index-CardMotion.module.scss.js +9 -0
  19. package/dist/index-Chip.js +1 -1
  20. package/dist/index-ClickAwayListener.js +1 -1
  21. package/dist/index-ClockPicker.js +1 -1
  22. package/dist/index-Collapse2.js +1 -1
  23. package/dist/index-DateInput.js +4 -4
  24. package/dist/index-DatePicker2.js +1 -1
  25. package/dist/index-DayCell.js +2 -2
  26. package/dist/index-DefaultPropsProvider.js +1 -1
  27. package/dist/index-DefaultPropsProvider2.js +1 -1
  28. package/dist/index-DesktopDatePicker.js +1 -1
  29. package/dist/index-Dialog.js +1 -1
  30. package/dist/index-DialogActions.js +1 -1
  31. package/dist/index-DialogContent.js +1 -1
  32. package/dist/index-Drawer2.js +1 -1
  33. package/dist/index-Fade.js +1 -1
  34. package/dist/index-FilledInput.js +1 -1
  35. package/dist/index-FocusTrap.js +1 -1
  36. package/dist/index-FormControl2.js +1 -1
  37. package/dist/index-FormHelperText.js +1 -1
  38. package/dist/index-FormLabel.js +1 -1
  39. package/dist/index-GlobalStyles.js +1 -1
  40. package/dist/index-GlobalStyles2.js +1 -1
  41. package/dist/index-GlobalStyles3.js +1 -1
  42. package/dist/index-Grid.js +1 -1
  43. package/dist/index-Grow.js +1 -1
  44. package/dist/index-IconButton2.js +1 -1
  45. package/dist/index-Input2.js +1 -1
  46. package/dist/index-InputAdornment.js +1 -1
  47. package/dist/index-InputBase2.js +1 -1
  48. package/dist/index-InputLabel.js +1 -1
  49. package/dist/index-InputRangeField.js +1 -1
  50. package/dist/index-LinearProgress.js +1 -1
  51. package/dist/index-List2.js +1 -1
  52. package/dist/index-ListSubheader.js +1 -1
  53. package/dist/index-LocalizationProvider.js +1 -1
  54. package/dist/index-Menu2.js +1 -1
  55. package/dist/index-MenuItem2.js +1 -1
  56. package/dist/index-MenuList.js +1 -1
  57. package/dist/index-MobileDatePicker.js +1 -1
  58. package/dist/index-Modal2.js +1 -1
  59. package/dist/index-ModalContext.js +37 -36
  60. package/dist/index-ModalTransition.js +9 -7
  61. package/dist/index-Month.js +3 -3
  62. package/dist/index-MonthPicker.js +1 -1
  63. package/dist/index-NativeSelectInput.js +1 -1
  64. package/dist/index-NotchedOutline.js +1 -1
  65. package/dist/index-OutlinedInput.js +1 -1
  66. package/dist/index-Paper.js +1 -1
  67. package/dist/index-PhotoCarouselModal.js +26 -25
  68. package/dist/index-PhotoCarouselModal.module.scss.js +6 -4
  69. package/dist/index-PickersDay.js +1 -1
  70. package/dist/index-Popover2.js +1 -1
  71. package/dist/index-Popper.js +1 -1
  72. package/dist/index-Portal.js +1 -1
  73. package/dist/index-PropTypes.js +1 -1
  74. package/dist/index-Ripple.js +1 -1
  75. package/dist/index-RtlProvider.js +1 -1
  76. package/dist/index-ScrollbarSize.js +1 -1
  77. package/dist/index-Select2.js +1 -1
  78. package/dist/index-SelectInput2.js +1 -1
  79. package/dist/index-Skeleton2.js +1 -1
  80. package/dist/index-Slide.js +1 -1
  81. package/dist/index-SlideCarousel.js +117 -138
  82. package/dist/index-SlideCarousel.module.scss.js +22 -14
  83. package/dist/index-Slider2.js +1 -1
  84. package/dist/index-SliderValueLabel.js +1 -1
  85. package/dist/index-Snackbar2.js +1 -1
  86. package/dist/index-SnackbarContent.js +1 -1
  87. package/dist/index-StyledEngineProvider.js +1 -1
  88. package/dist/index-SvgIcon.js +1 -1
  89. package/dist/index-Tab2.js +1 -1
  90. package/dist/index-TabScrollButton.js +1 -1
  91. package/dist/index-Tabs2.js +1 -1
  92. package/dist/index-Text.js +158 -131
  93. package/dist/index-TextField.js +1 -1
  94. package/dist/index-TextHighlighted.js +11 -136
  95. package/dist/index-TextareaAutosize.js +1 -1
  96. package/dist/index-ToggleButton2.js +1 -1
  97. package/dist/index-ToggleButtonGroup2.js +1 -1
  98. package/dist/index-Toolbar2.js +1 -1
  99. package/dist/index-Tooltip.js +1 -1
  100. package/dist/index-TouchRipple.js +1 -1
  101. package/dist/index-Transition.js +1 -1
  102. package/dist/index-TransitionGroup.js +1 -1
  103. package/dist/index-Typography.js +1 -1
  104. package/dist/index-YearPicker.js +1 -1
  105. package/dist/index-_virtual16.js +3 -5
  106. package/dist/index-_virtual17.js +5 -3
  107. package/dist/index-_virtual66.js +2 -2
  108. package/dist/index-_virtual67.js +4 -2
  109. package/dist/index-_virtual68.js +2 -4
  110. package/dist/index-_virtual69.js +4 -2
  111. package/dist/index-_virtual70.js +2 -2
  112. package/dist/index-_virtual71.js +1 -1
  113. package/dist/index-_virtual72.js +4 -2
  114. package/dist/index-_virtual73.js +1 -1
  115. package/dist/index-_virtual74.js +2 -4
  116. package/dist/index-_virtual75.js +2 -4
  117. package/dist/index-_virtual76.js +2 -2
  118. package/dist/index-accessibility.js +1 -1
  119. package/dist/index-elementAcceptingRef.js +1 -1
  120. package/dist/index-elementTypeAcceptingRef.js +1 -1
  121. package/dist/index-helpers3.js +1 -1
  122. package/dist/index-lib5.js +1 -1
  123. package/dist/index-react-spring_animated.modern.js +6 -6
  124. package/dist/index-react-spring_core.modern.js +56 -54
  125. package/dist/index-react-spring_web.modern.js +9 -8
  126. package/dist/index-refType.js +1 -1
  127. package/dist/index-regex.js +1 -1
  128. package/dist/index-responsivePropType.js +1 -1
  129. package/dist/index-use-carousel-movement.js +138 -0
  130. package/dist/index.js +300 -296
  131. package/dist/types/core/CardMotion/CardMotion.config.d.ts +855 -0
  132. package/dist/types/core/CardMotion/CardMotion.constants.d.ts +20 -0
  133. package/dist/types/core/CardMotion/CardMotion.d.ts +3 -0
  134. package/dist/types/core/CardMotion/CardMotion.types.d.ts +60 -0
  135. package/dist/types/core/CardMotion/index.d.ts +2 -0
  136. package/dist/types/core/CardMotion/stories/CustomMotion.story.d.ts +2 -0
  137. package/dist/types/core/CardMotion/stories/Default.story.d.ts +2 -0
  138. package/dist/types/core/CardMotion/stories/GlowIn.story.d.ts +2 -0
  139. package/dist/types/core/CardMotion/stories/GlowPreset.story.d.ts +2 -0
  140. package/dist/types/core/CardMotion/stories/Hoverable.story.d.ts +2 -0
  141. package/dist/types/core/CardMotion/stories/StaggeredGlowGroup.story.d.ts +2 -0
  142. package/dist/types/core/CardMotion/stories/VisibilityToggle.story.d.ts +2 -0
  143. package/dist/types/core/CardMotion/stories/_CardMotion.default.d.ts +3 -0
  144. package/dist/types/core/Modal/ModalContext.d.ts +1 -0
  145. package/dist/types/core/Modal/stories/StackingPermutations.story.d.ts +71 -0
  146. package/dist/types/core/Modal/stories/TwoModalsOverlapping.story.d.ts +2 -0
  147. package/dist/types/core/Modal/stories/TwoModalsOverlappingDifferentAnimations.story.d.ts +2 -0
  148. package/dist/types/core/SlideCarousel/Bullets/Bullets.d.ts +2 -0
  149. package/dist/types/core/SlideCarousel/SlideCarousel.d.ts +6 -0
  150. package/dist/types/core/SlideCarousel/hooks/use-carousel-movement.d.ts +27 -0
  151. package/dist/types/core/SlideCarousel/index.d.ts +2 -0
  152. package/dist/types/core/SlideCarousel/stories/SlideCarouselAutoPlay.story.d.ts +2 -0
  153. package/dist/types/core/SlideCarousel/stories/SlideCarouselBasic.story.d.ts +2 -0
  154. package/dist/types/core/SlideCarousel/stories/SlideCarouselBulletsBelow.story.d.ts +2 -0
  155. package/dist/types/core/SlideCarousel/stories/SlideCarouselControlled.story.d.ts +2 -0
  156. package/dist/types/core/SlideCarousel/stories/SlideCarouselCustomArrows.story.d.ts +2 -0
  157. package/dist/types/core/SlideCarousel/stories/SlideCarouselCustomBullets.story.d.ts +2 -0
  158. package/dist/types/core/SlideCarousel/stories/SlideCarouselMultipleSlidesAtOnce.story.d.ts +2 -0
  159. package/dist/types/core/SlideCarousel/stories/SlideCarouselOutsideArrows.story.d.ts +2 -0
  160. package/dist/types/core/SlideCarousel/stories/SlideCarouselWithArrows.story.d.ts +2 -0
  161. package/dist/types/core/SlideCarousel/stories/SlideCarouselWithArrowsAndBullets.story.d.ts +2 -0
  162. package/dist/types/core/SlideCarousel/stories/SlideCarouselWithBullets.story.d.ts +2 -0
  163. package/dist/types/core/SlideCarousel/stories/_SlideCarousel.default.d.ts +13 -0
  164. package/dist/types/core/Text/Text.types.d.ts +4 -0
  165. package/dist/types/core/Text/stories/stories/HighlightCaseInsensitive.story.d.ts +3 -0
  166. package/dist/types/core/Text/stories/stories/HighlightDefault.story.d.ts +2 -0
  167. package/dist/types/core/Text/stories/stories/HighlightModeBackground.story.d.ts +2 -0
  168. package/dist/types/core/Text/stories/stories/HighlightModeBold.story.d.ts +2 -0
  169. package/dist/types/core/Text/stories/stories/HighlightModeText.story.d.ts +2 -0
  170. package/dist/types/core/Text/stories/stories/HighlightWithEmphasis.story.d.ts +2 -0
  171. package/dist/types/core/TextHighlighted/TextHighlighted.d.ts +4 -1
  172. package/dist/types/index.d.ts +4 -0
  173. package/dist/vanguard-asset-analysis.json +1 -1
  174. package/dist/vanguard.css +1 -1
  175. package/dist-wordpress/index.js +17776 -17742
  176. package/dist-wordpress/types/core/PageSection/GradientPrimaryMeshBackground.d.ts +1 -0
  177. package/dist-wordpress/types/core/PageSection/PageSection.d.ts +43 -0
  178. package/dist-wordpress/types/core/PageSection/index.d.ts +2 -0
  179. package/dist-wordpress/types/core/TextHighlighted/TextHighlighted.d.ts +4 -1
  180. package/dist-wordpress/types/index.d.ts +2 -0
  181. package/dist-wordpress/vanguard.css +1 -1
  182. package/package.json +1 -1
  183. 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
+ };