@superrb/react-addons 3.0.0-8 → 3.0.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/.pnp.cjs +11252 -0
- package/.pnp.loader.mjs +2126 -0
- package/.yarn/install-state.gz +0 -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 +8 -3
- 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 +11 -3
- package/components/form/field.d.ts.map +1 -1
- package/components/form/field.js +18 -7
- 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 +24 -0
- package/components/form/submit-button.d.ts +3 -3
- package/components/form/submit-button.d.ts.map +1 -1
- package/components/form/submit-button.js +3 -4
- 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 +22 -6
- package/components/form.d.ts.map +1 -1
- package/components/form.js +72 -55
- 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 +2 -3
- package/components/slideshow-buttons.d.ts.map +1 -1
- package/components/slideshow-buttons.js +2 -3
- 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 +3 -1
- package/components.d.ts.map +1 -1
- package/components.js +3 -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 +1 -1
- package/context/modal-context-provider.d.ts.map +1 -1
- package/context/modal-context-provider.js +2 -2
- 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 +2 -2
- 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 +5 -4
- package/hooks/use-slideshow.d.ts.map +1 -1
- package/hooks/use-slideshow.js +86 -41
- package/hooks.d.ts +2 -1
- package/hooks.d.ts.map +1 -1
- package/hooks.js +2 -1
- package/package.json +5 -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/get.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
function get(path, data, defaultValue) {
|
|
1
|
+
export default function get(path, data, defaultValue) {
|
|
2
2
|
const value = path
|
|
3
3
|
.split(/[.[\]]/)
|
|
4
4
|
.filter(Boolean)
|
|
5
5
|
.reduce((value, key) => value?.[key], data);
|
|
6
6
|
return value !== undefined ? value : defaultValue;
|
|
7
7
|
}
|
|
8
|
-
export default get;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-external-link.d.ts","sourceRoot":"","sources":["../src/utils/is-external-link.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"is-external-link.d.ts","sourceRoot":"","sources":["../src/utils/is-external-link.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,UAAQ,WAuBxE"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
export default function isExternalLink(url, forceExternal = false) {
|
|
2
2
|
if (forceExternal) {
|
|
3
3
|
return true;
|
|
4
4
|
}
|
|
5
|
-
// In SSR mode, treat everything as an external link
|
|
6
|
-
if (!url || typeof window === 'undefined') {
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
5
|
// Override is needed for relative or hash URLs, as they cannot be parsed
|
|
10
6
|
if (url.startsWith('/') || url.startsWith('#')) {
|
|
11
7
|
return false;
|
|
12
8
|
}
|
|
9
|
+
// In SSR mode, treat everything as an external link
|
|
10
|
+
if (!url || typeof window === 'undefined') {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
13
|
let tmp;
|
|
14
14
|
try {
|
|
15
15
|
tmp = new URL(url);
|
|
@@ -18,5 +18,4 @@ const isExternalLink = (url, forceExternal = false) => {
|
|
|
18
18
|
return true;
|
|
19
19
|
}
|
|
20
20
|
return tmp?.host !== window.location.host;
|
|
21
|
-
}
|
|
22
|
-
export default isExternalLink;
|
|
21
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-to-hash.d.ts","sourceRoot":"","sources":["../src/utils/scroll-to-hash.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scroll-to-hash.d.ts","sourceRoot":"","sources":["../src/utils/scroll-to-hash.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,IAAI,EAAE,MAAM,qBAUhD"}
|
package/utils/scroll-to-hash.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export default function scrollToHash(hash) {
|
|
2
2
|
const element = document.getElementById(hash);
|
|
3
3
|
if (!element) {
|
|
4
4
|
return false;
|
|
@@ -6,5 +6,4 @@ const scrollToHash = (hash) => {
|
|
|
6
6
|
let top = window.scrollY + element.getBoundingClientRect().top - 85;
|
|
7
7
|
window.scrollTo({ top, behavior: 'auto' });
|
|
8
8
|
history.pushState({}, '', `#${hash}`);
|
|
9
|
-
}
|
|
10
|
-
export default scrollToHash;
|
|
9
|
+
}
|