@mantine-vue/hooks 3.0.0 → 3.1.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/esm/index.mjs CHANGED
@@ -3041,6 +3041,8 @@ function getCssSize(size) {
3041
3041
  }
3042
3042
  function createCollapse({ dimension, getElementSize, expanded, transitionDuration, transitionTimingFunction = "ease", onTransitionEnd, onTransitionStart, keepMounted }) {
3043
3043
  const isExpanded = () => toValue(expanded);
3044
+ const getTransitionDuration = () => toValue(transitionDuration);
3045
+ const getTransitionTimingFunction = () => toValue(transitionTimingFunction) ?? "ease";
3044
3046
  const collapsedStyles = {
3045
3047
  [dimension]: 0,
3046
3048
  overflow: "hidden",
@@ -3069,12 +3071,12 @@ function createCollapse({ dimension, getElementSize, expanded, transitionDuratio
3069
3071
  });
3070
3072
  };
3071
3073
  const getTransitionStyles = (size) => {
3072
- const duration = transitionDuration ?? getAutoSizeDuration(size);
3073
- return { transition: `${dimension} ${duration}ms ${transitionTimingFunction}, opacity ${duration}ms ${transitionTimingFunction}` };
3074
+ const duration = getTransitionDuration() ?? getAutoSizeDuration(size);
3075
+ return { transition: `${dimension} ${duration}ms ${getTransitionTimingFunction()}, opacity ${duration}ms ${getTransitionTimingFunction()}` };
3074
3076
  };
3075
3077
  watch(() => isExpanded(), (value, oldValue) => {
3076
3078
  if (value === oldValue) return;
3077
- if (transitionDuration !== 0) onTransitionStart?.();
3079
+ if (getTransitionDuration() !== 0) onTransitionStart?.();
3078
3080
  if (value) raf(() => {
3079
3081
  state.value = "entering";
3080
3082
  mergeStyles({