@superrb/react-addons 3.0.0-4 → 3.0.0-41
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/actions.d.ts +6 -0
- package/actions.d.ts.map +1 -0
- package/actions.js +18 -0
- package/components/accordion.d.ts +9 -0
- package/components/accordion.d.ts.map +1 -0
- package/components/accordion.js +44 -0
- package/components/back-to-top.d.ts +1 -2
- package/components/back-to-top.d.ts.map +1 -1
- package/components/back-to-top.js +2 -3
- package/components/button.d.ts +1 -1
- package/components/button.d.ts.map +1 -1
- package/components/button.js +3 -3
- package/components/context-wrapper.d.ts +1 -2
- package/components/context-wrapper.d.ts.map +1 -1
- package/components/context-wrapper.js +3 -2
- package/components/cookie-banner.d.ts +23 -18
- package/components/cookie-banner.d.ts.map +1 -1
- package/components/cookie-banner.js +11 -12
- package/components/form/error-message.d.ts +1 -2
- package/components/form/error-message.d.ts.map +1 -1
- package/components/form/error-message.js +2 -3
- package/components/form/field.d.ts +10 -3
- package/components/form/field.d.ts.map +1 -1
- package/components/form/field.js +17 -6
- package/components/form/file-field.d.ts +15 -0
- package/components/form/file-field.d.ts.map +1 -0
- package/components/form/file-field.js +23 -0
- package/components/form/submit-button.d.ts +3 -4
- package/components/form/submit-button.d.ts.map +1 -1
- package/components/form/submit-button.js +2 -3
- package/components/form/success-message.d.ts +3 -2
- package/components/form/success-message.d.ts.map +1 -1
- package/components/form/success-message.js +9 -2
- package/components/form.d.ts +17 -4
- package/components/form.d.ts.map +1 -1
- package/components/form.js +71 -53
- package/components/menu-toggle.d.ts +4 -4
- package/components/menu-toggle.d.ts.map +1 -1
- package/components/menu-toggle.js +4 -13
- package/components/modal.d.ts +3 -2
- package/components/modal.d.ts.map +1 -1
- package/components/modal.js +10 -6
- package/components/skip-to.d.ts +1 -2
- package/components/skip-to.d.ts.map +1 -1
- package/components/skip-to.js +2 -3
- package/components/slideshow-buttons.d.ts +8 -0
- package/components/slideshow-buttons.d.ts.map +1 -0
- package/components/slideshow-buttons.js +5 -0
- package/components/slideshow-pagination.d.ts +5 -0
- package/components/slideshow-pagination.d.ts.map +1 -0
- package/components/slideshow-pagination.js +4 -0
- package/components.d.ts +4 -1
- package/components.d.ts.map +1 -1
- package/components.js +4 -1
- package/context/cookies-context-provider.d.ts +13 -0
- package/context/cookies-context-provider.d.ts.map +1 -0
- package/context/cookies-context-provider.js +54 -0
- package/context/modal-context-provider.d.ts +13 -0
- package/context/modal-context-provider.d.ts.map +1 -0
- package/context/modal-context-provider.js +31 -0
- package/context/nav-context-provider.d.ts +1 -1
- package/context/nav-context-provider.d.ts.map +1 -1
- package/context/nav-context-provider.js +26 -0
- package/context.d.ts +2 -1
- package/context.d.ts.map +1 -1
- package/context.js +2 -1
- package/hooks/use-async.d.ts +3 -2
- package/hooks/use-async.d.ts.map +1 -1
- package/hooks/use-async.js +3 -4
- package/hooks/use-draggable-scroll.d.ts +3 -3
- package/hooks/use-draggable-scroll.d.ts.map +1 -1
- package/hooks/use-draggable-scroll.js +2 -3
- package/hooks/use-escape.d.ts +3 -0
- package/hooks/use-escape.d.ts.map +1 -0
- package/hooks/use-escape.js +11 -0
- package/hooks/use-event-listener.d.ts +2 -2
- package/hooks/use-event-listener.d.ts.map +1 -1
- package/hooks/use-event-listener.js +4 -12
- package/hooks/use-hide-on-scroll.d.ts +1 -2
- package/hooks/use-hide-on-scroll.d.ts.map +1 -1
- package/hooks/use-hide-on-scroll.js +2 -3
- package/hooks/use-id.d.ts +1 -2
- package/hooks/use-id.d.ts.map +1 -1
- package/hooks/use-id.js +2 -3
- package/hooks/use-is-in-viewport.d.ts +2 -3
- package/hooks/use-is-in-viewport.d.ts.map +1 -1
- package/hooks/use-is-in-viewport.js +17 -15
- package/hooks/use-is-mobile.d.ts +1 -2
- package/hooks/use-is-mobile.d.ts.map +1 -1
- package/hooks/use-is-mobile.js +2 -3
- package/hooks/use-is-overflowing.d.ts +1 -2
- package/hooks/use-is-overflowing.d.ts.map +1 -1
- package/hooks/use-is-overflowing.js +5 -4
- package/hooks/use-lock-body-scroll.d.ts +1 -2
- package/hooks/use-lock-body-scroll.d.ts.map +1 -1
- package/hooks/use-lock-body-scroll.js +1 -2
- package/hooks/use-modal.d.ts +1 -2
- package/hooks/use-modal.d.ts.map +1 -1
- package/hooks/use-modal.js +2 -3
- package/hooks/use-motion-allowed.d.ts +1 -2
- package/hooks/use-motion-allowed.d.ts.map +1 -1
- package/hooks/use-motion-allowed.js +2 -3
- package/hooks/use-parallax.d.ts +1 -2
- package/hooks/use-parallax.d.ts.map +1 -1
- package/hooks/use-parallax.js +2 -3
- package/hooks/use-slideshow.d.ts +18 -0
- package/hooks/use-slideshow.d.ts.map +1 -0
- package/hooks/use-slideshow.js +133 -0
- package/hooks.d.ts +3 -1
- package/hooks.d.ts.map +1 -1
- package/hooks.js +3 -1
- package/package.json +3 -3
- package/store/cookies.d.ts +3 -0
- package/store/cookies.d.ts.map +1 -1
- package/store/cookies.js +29 -22
- package/store/modal.d.ts.map +1 -1
- package/store/modal.js +4 -0
- package/store/nav.d.ts.map +1 -1
- package/store/nav.js +4 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/animate.d.ts +1 -2
- package/utils/animate.d.ts.map +1 -1
- package/utils/animate.js +24 -23
- package/utils/extend-class.d.ts +1 -2
- package/utils/extend-class.d.ts.map +1 -1
- package/utils/extend-class.js +8 -7
- package/utils/get-y-pos.d.ts +1 -2
- package/utils/get-y-pos.d.ts.map +1 -1
- package/utils/get-y-pos.js +2 -3
- package/utils/get.d.ts +2 -2
- package/utils/get.d.ts.map +1 -1
- package/utils/get.js +1 -2
- package/utils/is-external-link.d.ts +1 -2
- package/utils/is-external-link.d.ts.map +1 -1
- package/utils/is-external-link.js +6 -7
- package/utils/scroll-to-hash.d.ts +1 -2
- package/utils/scroll-to-hash.d.ts.map +1 -1
- package/utils/scroll-to-hash.js +2 -3
- package/utils.d.ts +2 -1
- package/utils.d.ts.map +1 -1
- package/utils.js +2 -1
|
@@ -2,10 +2,10 @@ import { MouseEventHandler, MutableRefObject } from 'react';
|
|
|
2
2
|
interface Events {
|
|
3
3
|
onMouseDown: MouseEventHandler<HTMLElement>;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
export default function useDraggableScroll(ref: MutableRefObject<HTMLElement>, { className, ...opts }: {
|
|
6
6
|
className: string;
|
|
7
|
-
})
|
|
7
|
+
}): {
|
|
8
8
|
events: Events;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export {};
|
|
11
11
|
//# sourceMappingURL=use-draggable-scroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-draggable-scroll.d.ts","sourceRoot":"","sources":["../src/hooks/use-draggable-scroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,gBAAgB,EAIjB,MAAM,OAAO,CAAA;AAId,UAAU,MAAM;IACd,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAA;CAC5C;AAED,
|
|
1
|
+
{"version":3,"file":"use-draggable-scroll.d.ts","sourceRoot":"","sources":["../src/hooks/use-draggable-scroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,gBAAgB,EAIjB,MAAM,OAAO,CAAA;AAId,UAAU,MAAM;IACd,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAA;CAC5C;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,GAAG,EAAE,gBAAgB,CAAC,WAAW,CAAC,EAClC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE;;EA8E9C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useRef, useState, } from 'react';
|
|
2
2
|
import { useDraggable } from 'react-use-draggable-scroll';
|
|
3
3
|
import { useEventListener, useIsInViewport } from '../hooks';
|
|
4
|
-
|
|
4
|
+
export default function useDraggableScroll(ref, { className, ...opts }) {
|
|
5
5
|
const { isInViewport, setRef } = useIsInViewport(false);
|
|
6
6
|
const { events } = useDraggable(ref, {
|
|
7
7
|
...opts,
|
|
@@ -52,5 +52,4 @@ const useDraggableScroll = (ref, { className, ...opts }) => {
|
|
|
52
52
|
});
|
|
53
53
|
}, [ref, ref.current, setModifiedEvents, shouldScroll]);
|
|
54
54
|
return { events: modifiedEvents };
|
|
55
|
-
}
|
|
56
|
-
export default useDraggableScroll;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-escape.d.ts","sourceRoot":"","sources":["../src/hooks/use-escape.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,QAAS,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,MAAM,IAAI,SAgBzE,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useEventListener } from '../hooks';
|
|
2
|
+
const useEscape = (ref, callback) => {
|
|
3
|
+
useEventListener('keydown', (event) => {
|
|
4
|
+
if (ref.current?.contains(document.activeElement) &&
|
|
5
|
+
event.key === 'Escape') {
|
|
6
|
+
event.preventDefault();
|
|
7
|
+
callback();
|
|
8
|
+
}
|
|
9
|
+
}, {}, typeof document !== 'undefined' ? document : undefined, ref.current !== undefined && document !== undefined);
|
|
10
|
+
};
|
|
11
|
+
export default useEscape;
|
|
@@ -2,6 +2,6 @@ type Target = Document | Window | Element;
|
|
|
2
2
|
type EventMap<T extends Target> = T extends Window ? WindowEventHandlersEventMap & GlobalEventHandlersEventMap : T extends Document ? DocumentEventMap : GlobalEventHandlersEventMap;
|
|
3
3
|
type EventName<T extends Target> = keyof EventMap<T>;
|
|
4
4
|
type EventListener<T extends Target, E extends EventName<T>> = (event: EventMap<T>[E]) => void | boolean;
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
export default function useEventListener<T extends Target, E extends EventName<T>>(eventName: E, handler: EventListener<T, E>, options?: boolean | AddEventListenerOptions, element?: T, flag?: boolean): void;
|
|
6
|
+
export {};
|
|
7
7
|
//# sourceMappingURL=use-event-listener.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-event-listener.d.ts","sourceRoot":"","sources":["../src/hooks/use-event-listener.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAEzC,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,MAAM,GAC9C,2BAA2B,GAAG,2BAA2B,GACzD,CAAC,SAAS,QAAQ,
|
|
1
|
+
{"version":3,"file":"use-event-listener.d.ts","sourceRoot":"","sources":["../src/hooks/use-event-listener.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAEzC,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,MAAM,GAC9C,2BAA2B,GAAG,2BAA2B,GACzD,CAAC,SAAS,QAAQ,GAChB,gBAAgB,GAChB,2BAA2B,CAAA;AAEjC,KAAK,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAA;AAEpD,KAAK,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,IAAI,CAC7D,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAClB,IAAI,GAAG,OAAO,CAAA;AAGnB,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EAEtB,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAC5B,OAAO,GAAE,OAAO,GAAG,uBAA4B,EAC/C,OAAO,CAAC,EAAE,CAAC,EACX,IAAI,GAAE,OAAc,QAqDrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
// Hook
|
|
3
|
-
|
|
3
|
+
export default function useEventListener(eventName, handler, options = {}, element, flag = true) {
|
|
4
4
|
// Create a ref that stores handler
|
|
5
5
|
const savedHandler = useRef();
|
|
6
6
|
const elementRef = useRef();
|
|
@@ -13,7 +13,7 @@ const useEventListener = (eventName, handler, options = {}, element, flag = true
|
|
|
13
13
|
// ... and potentially cause effect to re-run every render.
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
savedHandler.current = handler;
|
|
16
|
-
}, [handler
|
|
16
|
+
}, [handler]);
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
// Make sure element supports addEventListener
|
|
19
19
|
// On
|
|
@@ -33,13 +33,5 @@ const useEventListener = (eventName, handler, options = {}, element, flag = true
|
|
|
33
33
|
return () => {
|
|
34
34
|
elementRef.current.removeEventListener(eventName, eventListener);
|
|
35
35
|
};
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
handler,
|
|
39
|
-
savedHandler.current,
|
|
40
|
-
element,
|
|
41
|
-
elementRef.current,
|
|
42
|
-
flag,
|
|
43
|
-
]);
|
|
44
|
-
};
|
|
45
|
-
export default useEventListener;
|
|
36
|
+
}, [eventName, handler, options, element, flag]);
|
|
37
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-hide-on-scroll.d.ts","sourceRoot":"","sources":["../src/hooks/use-hide-on-scroll.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"use-hide-on-scroll.d.ts","sourceRoot":"","sources":["../src/hooks/use-hide-on-scroll.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,YAAY,GAAE,OAAe,GAC5B,OAAO,CA+DT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEventListener } from '../hooks';
|
|
2
2
|
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
-
|
|
3
|
+
export default function useHideOnScroll(hiddenOnLoad = false) {
|
|
4
4
|
const [hidden, setHidden] = useState(hiddenOnLoad);
|
|
5
5
|
const handleScroll = useCallback(() => {
|
|
6
6
|
const previousY = window.scrollY;
|
|
@@ -31,5 +31,4 @@ const useHideOnScroll = (hiddenOnLoad = false) => {
|
|
|
31
31
|
useEventListener('popstate', handleLoad, { passive: true }, typeof window !== 'undefined' ? window : undefined);
|
|
32
32
|
useEventListener('pageshow', handleLoad, { passive: true }, typeof window !== 'undefined' ? window : undefined);
|
|
33
33
|
return hidden;
|
|
34
|
-
}
|
|
35
|
-
export default useHideOnScroll;
|
|
34
|
+
}
|
package/hooks/use-id.d.ts
CHANGED
package/hooks/use-id.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-id.d.ts","sourceRoot":"","sources":["../src/hooks/use-id.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"use-id.d.ts","sourceRoot":"","sources":["../src/hooks/use-id.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,MAAM,EAAE,MAAM,UAU3C"}
|
package/hooks/use-id.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
2
|
+
export default function useId(prefix) {
|
|
3
3
|
const [id, setId] = useState(`${prefix}-${Math.random().toString(36).substring(2, 9)}`);
|
|
4
4
|
useEffect(() => {
|
|
5
5
|
setId(`${prefix}-${Math.random().toString(36).substring(2, 9)}`);
|
|
6
6
|
}, [prefix]);
|
|
7
7
|
return id;
|
|
8
|
-
}
|
|
9
|
-
export default useId;
|
|
8
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export default function useIsInViewport(initial?: boolean, rootMargin?: string, threshold?: number[]): {
|
|
2
2
|
isInViewport: boolean;
|
|
3
|
-
setRef: (ref: HTMLElement | null) =>
|
|
3
|
+
setRef: (ref: HTMLElement | null) => void;
|
|
4
4
|
};
|
|
5
|
-
export default useIsInViewport;
|
|
6
5
|
//# sourceMappingURL=use-is-in-viewport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-is-in-viewport.d.ts","sourceRoot":"","sources":["../src/hooks/use-is-in-viewport.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"use-is-in-viewport.d.ts","sourceRoot":"","sources":["../src/hooks/use-is-in-viewport.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,OAAO,UAAQ,EACf,UAAU,SAAY,EACtB,SAAS,WAA0B;;kBA6Dd,WAAW,GAAG,IAAI;EAiBxC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
|
|
2
|
+
export default function useIsInViewport(initial = false, rootMargin = '0px 0px', threshold = [0, 0.25, 0.5, 0.75, 1]) {
|
|
3
3
|
const [isInViewport, setIsInViewport] = useState(initial);
|
|
4
4
|
const element = useRef();
|
|
5
5
|
const observer = useRef();
|
|
@@ -45,20 +45,22 @@ const useIsInViewport = (initial = false, rootMargin = '0px 0px', threshold = [0
|
|
|
45
45
|
wait();
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
-
const setRef =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
const setRef = (ref) => {
|
|
49
|
+
;
|
|
50
|
+
(async () => {
|
|
51
|
+
element.current = ref;
|
|
52
|
+
if (ref) {
|
|
53
|
+
try {
|
|
54
|
+
const observer = await waitForObserver();
|
|
55
|
+
observer.observe(ref);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
// If IntersectionObserver fails, just set isInViewport to true
|
|
59
|
+
console.error(error);
|
|
60
|
+
setIsInViewport(true);
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
|
-
}
|
|
63
|
+
})();
|
|
61
64
|
};
|
|
62
65
|
return { isInViewport, setRef };
|
|
63
|
-
}
|
|
64
|
-
export default useIsInViewport;
|
|
66
|
+
}
|
package/hooks/use-is-mobile.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-is-mobile.d.ts","sourceRoot":"","sources":["../src/hooks/use-is-mobile.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"use-is-mobile.d.ts","sourceRoot":"","sources":["../src/hooks/use-is-mobile.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAO,UAAO,EAAE,IAAI,SAAY,WAiBnE"}
|
package/hooks/use-is-mobile.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
|
|
2
|
+
export default function useIsMobile(initial = true, size = '63.75em') {
|
|
3
3
|
const [isMobile, setIsMobile] = useState(initial);
|
|
4
4
|
const setScreenSize = useCallback(() => {
|
|
5
5
|
setIsMobile(!window.matchMedia(`(min-width: ${size})`).matches);
|
|
@@ -12,5 +12,4 @@ const useIsMobile = (initial = true, size = '63.75em') => {
|
|
|
12
12
|
};
|
|
13
13
|
}, [setScreenSize]);
|
|
14
14
|
return isMobile;
|
|
15
|
-
}
|
|
16
|
-
export default useIsMobile;
|
|
15
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
-
|
|
3
|
-
export default useIsOverflowing;
|
|
2
|
+
export default function useIsOverflowing({ current, }: MutableRefObject<HTMLElement>): boolean;
|
|
4
3
|
//# sourceMappingURL=use-is-overflowing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-is-overflowing.d.ts","sourceRoot":"","sources":["../src/hooks/use-is-overflowing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAExC,
|
|
1
|
+
{"version":3,"file":"use-is-overflowing.d.ts","sourceRoot":"","sources":["../src/hooks/use-is-overflowing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAExC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,GACR,EAAE,gBAAgB,CAAC,WAAW,CAAC,WAM/B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
(current
|
|
3
|
-
current.
|
|
4
|
-
|
|
1
|
+
export default function useIsOverflowing({ current, }) {
|
|
2
|
+
return (current &&
|
|
3
|
+
(current.scrollWidth > current.clientWidth ||
|
|
4
|
+
current.scrollHeight > current.clientHeight));
|
|
5
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-lock-body-scroll.d.ts","sourceRoot":"","sources":["../src/hooks/use-lock-body-scroll.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"use-lock-body-scroll.d.ts","sourceRoot":"","sources":["../src/hooks/use-lock-body-scroll.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAO/D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
function useLockBodyScroll(toggle) {
|
|
2
|
+
export default function useLockBodyScroll(toggle) {
|
|
3
3
|
useEffect(() => {
|
|
4
4
|
document.body.style.overflow = toggle ? 'hidden' : 'unset';
|
|
5
5
|
return () => {
|
|
@@ -7,4 +7,3 @@ function useLockBodyScroll(toggle) {
|
|
|
7
7
|
};
|
|
8
8
|
}, [toggle]);
|
|
9
9
|
}
|
|
10
|
-
export default useLockBodyScroll;
|
package/hooks/use-modal.d.ts
CHANGED
package/hooks/use-modal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-modal.d.ts","sourceRoot":"","sources":["../src/hooks/use-modal.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"use-modal.d.ts","sourceRoot":"","sources":["../src/hooks/use-modal.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,IAAI,EAAE,MAAM;;;;EAU5C"}
|
package/hooks/use-modal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import useModalStore from '../store/modal';
|
|
2
|
-
|
|
2
|
+
export default function useModal(name) {
|
|
3
3
|
const isOpen = useModalStore((state) => state.openState[name]);
|
|
4
4
|
const openModal = useModalStore((state) => state.openModal);
|
|
5
5
|
const closeModal = useModalStore((state) => state.closeModal);
|
|
@@ -8,5 +8,4 @@ const useModal = (name) => {
|
|
|
8
8
|
openModal: () => openModal(name),
|
|
9
9
|
closeModal: () => closeModal(name),
|
|
10
10
|
};
|
|
11
|
-
}
|
|
12
|
-
export default useModal;
|
|
11
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-motion-allowed.d.ts","sourceRoot":"","sources":["../src/hooks/use-motion-allowed.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"use-motion-allowed.d.ts","sourceRoot":"","sources":["../src/hooks/use-motion-allowed.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,gBAAgB,YAUvC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
2
|
+
export default function useMotionAllowed() {
|
|
3
3
|
const [motionAllowed, setMotionAllowed] = useState(true);
|
|
4
4
|
useEffect(() => {
|
|
5
5
|
setMotionAllowed(!window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
6
6
|
}, [setMotionAllowed]);
|
|
7
7
|
return motionAllowed;
|
|
8
|
-
}
|
|
9
|
-
export default useMotionAllowed;
|
|
8
|
+
}
|
package/hooks/use-parallax.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-parallax.d.ts","sourceRoot":"","sources":["../src/hooks/use-parallax.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"use-parallax.d.ts","sourceRoot":"","sources":["../src/hooks/use-parallax.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,KAAK,EAAE,WAAW,EAAE,EACpB,IAAI,GAAE,OAAc,QA4BrB"}
|
package/hooks/use-parallax.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEventListener, useMotionAllowed } from '../hooks';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
|
-
|
|
3
|
+
export default function useParallax(items, flag = true) {
|
|
4
4
|
const isMotionAllowed = useMotionAllowed();
|
|
5
5
|
const onScroll = useCallback((event) => {
|
|
6
6
|
items.forEach((item, index) => {
|
|
@@ -14,5 +14,4 @@ const useParallax = (items, flag = true) => {
|
|
|
14
14
|
});
|
|
15
15
|
}, [items]);
|
|
16
16
|
useEventListener('scroll', onScroll, { passive: true }, undefined, flag && isMotionAllowed);
|
|
17
|
-
}
|
|
18
|
-
export default useParallax;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
export type SlideshowElement = HTMLElement & {
|
|
3
|
+
previousScroll?: number;
|
|
4
|
+
};
|
|
5
|
+
export type Slideshow = {
|
|
6
|
+
slideshowRef: MutableRefObject<SlideshowElement>;
|
|
7
|
+
currentSlide: number;
|
|
8
|
+
slideCount: number;
|
|
9
|
+
goTo: (index: number) => void;
|
|
10
|
+
atStart: boolean;
|
|
11
|
+
atEnd: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function isHorizontal(element: SlideshowElement): boolean;
|
|
14
|
+
export declare function isCentered(element: SlideshowElement): boolean;
|
|
15
|
+
export declare function getScrollProgress(target: SlideshowElement): number;
|
|
16
|
+
export declare function getCurrentSlideIndex(element: SlideshowElement, currentIndex: number): number;
|
|
17
|
+
export default function useSlideshow(slideshow: MutableRefObject<SlideshowElement>): Slideshow;
|
|
18
|
+
//# sourceMappingURL=use-slideshow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-slideshow.d.ts","sourceRoot":"","sources":["../src/hooks/use-slideshow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,OAAO,CAAA;AAG7D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;IAChD,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAE/D;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAK7D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,UAMzD;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,MAAM,GACnB,MAAM,CAkER;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,SAAS,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,GAC5C,SAAS,CAqGX"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import useEventListener from './use-event-listener';
|
|
3
|
+
export function isHorizontal(element) {
|
|
4
|
+
return window.getComputedStyle(element).scrollSnapType.startsWith('x');
|
|
5
|
+
}
|
|
6
|
+
export function isCentered(element) {
|
|
7
|
+
return (window.getComputedStyle(element.firstElementChild)
|
|
8
|
+
?.scrollSnapAlign === 'center');
|
|
9
|
+
}
|
|
10
|
+
export function getScrollProgress(target) {
|
|
11
|
+
if (!target || target.scrollWidth === target.clientWidth) {
|
|
12
|
+
return -1;
|
|
13
|
+
}
|
|
14
|
+
return target.scrollLeft / (target.scrollWidth - target.clientWidth);
|
|
15
|
+
}
|
|
16
|
+
export function getCurrentSlideIndex(element, currentIndex) {
|
|
17
|
+
if (!element) {
|
|
18
|
+
return currentIndex;
|
|
19
|
+
}
|
|
20
|
+
if (!element.previousScroll) {
|
|
21
|
+
element.previousScroll = element.scrollLeft;
|
|
22
|
+
return currentIndex;
|
|
23
|
+
}
|
|
24
|
+
const centered = isCentered(element);
|
|
25
|
+
const horizontal = isHorizontal(element);
|
|
26
|
+
const direction = element.scrollLeft > (element.previousScroll || 0) ? 'right' : 'left';
|
|
27
|
+
const offset = 25;
|
|
28
|
+
let gap = parseFloat(window.getComputedStyle(element).gap) || 0;
|
|
29
|
+
if (isNaN(gap)) {
|
|
30
|
+
gap = 0;
|
|
31
|
+
}
|
|
32
|
+
let padding = parseFloat(window.getComputedStyle(element)[horizontal ? 'paddingLeft' : 'paddingTop']) || 0;
|
|
33
|
+
if (isNaN(padding)) {
|
|
34
|
+
padding = 0;
|
|
35
|
+
}
|
|
36
|
+
const containerEdge = element.getBoundingClientRect()[horizontal ? 'left' : 'top'] + padding;
|
|
37
|
+
let newIndex = currentIndex;
|
|
38
|
+
let i = 0;
|
|
39
|
+
for (const child of element.children) {
|
|
40
|
+
const edge = child.getBoundingClientRect()[horizontal ? 'left' : 'top'] - containerEdge;
|
|
41
|
+
if (centered) {
|
|
42
|
+
const centeredEdge = edge - child.clientWidth / 2;
|
|
43
|
+
const threshold = horizontal
|
|
44
|
+
? element.clientWidth / 2
|
|
45
|
+
: element.clientHeight / 2;
|
|
46
|
+
if (centeredEdge >= 0 && centeredEdge < threshold) {
|
|
47
|
+
newIndex = i;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const threshold = direction === 'right'
|
|
53
|
+
? (horizontal ? child.clientWidth : child.clientHeight) - gap - offset
|
|
54
|
+
: 0 + gap + offset;
|
|
55
|
+
if (edge >= 0 - threshold) {
|
|
56
|
+
newIndex = i;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
i++;
|
|
61
|
+
}
|
|
62
|
+
element.previousScroll = element.scrollLeft;
|
|
63
|
+
return newIndex;
|
|
64
|
+
}
|
|
65
|
+
export default function useSlideshow(slideshow) {
|
|
66
|
+
const [currentSlide, setCurrentSlide] = useState(0);
|
|
67
|
+
const [progress, setProgress] = useState(-1);
|
|
68
|
+
const [ready, setReady] = useState(false);
|
|
69
|
+
const update = () => {
|
|
70
|
+
if (!slideshow.current) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
setCurrentSlide((current) => getCurrentSlideIndex(slideshow.current, current));
|
|
74
|
+
setProgress(getScrollProgress(slideshow.current));
|
|
75
|
+
};
|
|
76
|
+
useEventListener('scroll', update, { passive: true }, slideshow.current, !!slideshow.current && ready);
|
|
77
|
+
useEventListener('resize', update, { passive: true }, slideshow.current, !!slideshow.current && ready);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
setReady(true);
|
|
80
|
+
if (slideshow.current) {
|
|
81
|
+
update();
|
|
82
|
+
slideshow.current.setAttribute('role', 'region');
|
|
83
|
+
slideshow.current.setAttribute('aria-label', 'carousel');
|
|
84
|
+
slideshow.current.setAttribute('aria-live', 'polite');
|
|
85
|
+
}
|
|
86
|
+
}, [slideshow]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
;
|
|
89
|
+
[...slideshow.current?.children].forEach((child) => child.setAttribute('aria-hidden', 'true'));
|
|
90
|
+
slideshow.current?.children[currentSlide].setAttribute('aria-hidden', 'false');
|
|
91
|
+
}, [currentSlide, slideshow]);
|
|
92
|
+
return {
|
|
93
|
+
slideshowRef: slideshow,
|
|
94
|
+
currentSlide,
|
|
95
|
+
slideCount: slideshow.current?.children.length || 0,
|
|
96
|
+
goTo(index) {
|
|
97
|
+
index = Math.min(slideshow.current?.children.length - 1, Math.max(0, index));
|
|
98
|
+
const newElement = slideshow.current?.children[index];
|
|
99
|
+
newElement.scrollIntoView({
|
|
100
|
+
behavior: 'smooth',
|
|
101
|
+
block: isHorizontal(slideshow.current)
|
|
102
|
+
? 'nearest'
|
|
103
|
+
: isCentered(slideshow.current)
|
|
104
|
+
? 'center'
|
|
105
|
+
: 'start',
|
|
106
|
+
inline: isHorizontal(slideshow.current)
|
|
107
|
+
? isCentered(slideshow.current)
|
|
108
|
+
? 'center'
|
|
109
|
+
: 'start'
|
|
110
|
+
: 'nearest',
|
|
111
|
+
});
|
|
112
|
+
// const scrollOpts: ScrollToOptions = {
|
|
113
|
+
// behavior: 'smooth',
|
|
114
|
+
// }
|
|
115
|
+
// if (isHorizontal(slideshow.current)) {
|
|
116
|
+
// if (isCentered(slideshow.current)) {
|
|
117
|
+
// scrollOpts.left = newElement?.offsetLeft + newElement?.clientWidth / 2
|
|
118
|
+
// } else {
|
|
119
|
+
// scrollOpts.left = newElement?.offsetLeft
|
|
120
|
+
// }
|
|
121
|
+
// } else {
|
|
122
|
+
// if (isCentered(slideshow.current)) {
|
|
123
|
+
// scrollOpts.top = newElement?.offsetTop + newElement?.clientHeight / 2
|
|
124
|
+
// } else {
|
|
125
|
+
// scrollOpts.top = newElement?.offsetTop
|
|
126
|
+
// }
|
|
127
|
+
// }
|
|
128
|
+
// slideshow.current?.scrollTo(scrollOpts)
|
|
129
|
+
},
|
|
130
|
+
atStart: progress <= 0 || progress === -1,
|
|
131
|
+
atEnd: progress >= 1 || progress === -1,
|
|
132
|
+
};
|
|
133
|
+
}
|
package/hooks.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import useAsync from './hooks/use-async';
|
|
5
5
|
import useDraggableScroll from './hooks/use-draggable-scroll';
|
|
6
|
+
import useEscape from './hooks/use-escape';
|
|
6
7
|
import useEventListener from './hooks/use-event-listener';
|
|
7
8
|
import useHideOnScroll from './hooks/use-hide-on-scroll';
|
|
8
9
|
import useId from './hooks/use-id';
|
|
@@ -13,5 +14,6 @@ import useLockBodyScroll from './hooks/use-lock-body-scroll';
|
|
|
13
14
|
import useModal from './hooks/use-modal';
|
|
14
15
|
import useMotionAllowed from './hooks/use-motion-allowed';
|
|
15
16
|
import useParallax from './hooks/use-parallax';
|
|
16
|
-
|
|
17
|
+
import useSlideshow from './hooks/use-slideshow';
|
|
18
|
+
export { useAsync, useDraggableScroll, useEscape, useEventListener, useHideOnScroll, useId, useIsOverflowing, useIsInViewport, useIsMobile, useLockBodyScroll, useModal, useMotionAllowed, useParallax, useSlideshow, };
|
|
17
19
|
//# sourceMappingURL=hooks.d.ts.map
|
package/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["src/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,kBAAkB,MAAM,8BAA8B,CAAA;AAC7D,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,eAAe,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,eAAe,MAAM,4BAA4B,CAAA;AACxD,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,WAAW,MAAM,uBAAuB,CAAA;AAC/C,OAAO,iBAAiB,MAAM,8BAA8B,CAAA;AAC5D,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,WAAW,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["src/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,kBAAkB,MAAM,8BAA8B,CAAA;AAC7D,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAC1C,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,eAAe,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,eAAe,MAAM,4BAA4B,CAAA;AACxD,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,WAAW,MAAM,uBAAuB,CAAA;AAC/C,OAAO,iBAAiB,MAAM,8BAA8B,CAAA;AAC5D,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAC9C,OAAO,YAAY,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,KAAK,EACL,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,CAAA"}
|
package/hooks.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import useAsync from './hooks/use-async';
|
|
5
5
|
import useDraggableScroll from './hooks/use-draggable-scroll';
|
|
6
|
+
import useEscape from './hooks/use-escape';
|
|
6
7
|
import useEventListener from './hooks/use-event-listener';
|
|
7
8
|
import useHideOnScroll from './hooks/use-hide-on-scroll';
|
|
8
9
|
import useId from './hooks/use-id';
|
|
@@ -13,4 +14,5 @@ import useLockBodyScroll from './hooks/use-lock-body-scroll';
|
|
|
13
14
|
import useModal from './hooks/use-modal';
|
|
14
15
|
import useMotionAllowed from './hooks/use-motion-allowed';
|
|
15
16
|
import useParallax from './hooks/use-parallax';
|
|
16
|
-
|
|
17
|
+
import useSlideshow from './hooks/use-slideshow';
|
|
18
|
+
export { useAsync, useDraggableScroll, useEscape, useEventListener, useHideOnScroll, useId, useIsOverflowing, useIsInViewport, useIsMobile, useLockBodyScroll, useModal, useMotionAllowed, useParallax, useSlideshow, };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superrb/react-addons",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-
|
|
4
|
+
"version": "3.0.0-41",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "https://github.com/superrbstudio/react-addons",
|
|
7
7
|
"author": "@molovo",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"react-google-recaptcha-v3": "^1.10.1",
|
|
16
16
|
"react-hook-form": "^7.46.1",
|
|
17
17
|
"react-use-draggable-scroll": "^0.4.7",
|
|
18
|
-
"
|
|
18
|
+
"simple-zustand-devtools": "^1.1.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@superrb/react-addons": "^1.0.0",
|
|
22
21
|
"react": "^18.2.0",
|
|
23
22
|
"typescript": "^5.2.2",
|
|
23
|
+
"yup": "^1.2.0",
|
|
24
24
|
"zustand": "^4.4.7"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
package/store/cookies.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export interface CookieState {
|
|
|
3
3
|
trackingCookiesAccepted: boolean;
|
|
4
4
|
setCookiesAccepted: (accepted: boolean) => void;
|
|
5
5
|
setTrackingCookiesAccepted: (accepted: boolean) => void;
|
|
6
|
+
popupOpen: boolean;
|
|
7
|
+
openPopup: () => void;
|
|
8
|
+
closePopup: () => void;
|
|
6
9
|
}
|
|
7
10
|
declare const useCookieStore: import("zustand").UseBoundStore<import("zustand").StoreApi<CookieState>>;
|
|
8
11
|
export default useCookieStore;
|
package/store/cookies.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../src/store/cookies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../src/store/cookies.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,OAAO,CAAA;IACxB,uBAAuB,EAAE,OAAO,CAAA;IAChC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/C,0BAA0B,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IACvD,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,QAAA,MAAM,cAAc,0EAyBlB,CAAA;AAMF,eAAe,cAAc,CAAA"}
|