@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.
Files changed (138) hide show
  1. package/.pnp.cjs +11252 -0
  2. package/.pnp.loader.mjs +2126 -0
  3. package/.yarn/install-state.gz +0 -0
  4. package/components/accordion.d.ts +9 -0
  5. package/components/accordion.d.ts.map +1 -0
  6. package/components/accordion.js +44 -0
  7. package/components/back-to-top.d.ts +1 -2
  8. package/components/back-to-top.d.ts.map +1 -1
  9. package/components/back-to-top.js +2 -3
  10. package/components/button.d.ts +1 -1
  11. package/components/button.d.ts.map +1 -1
  12. package/components/button.js +3 -3
  13. package/components/context-wrapper.d.ts +1 -2
  14. package/components/context-wrapper.d.ts.map +1 -1
  15. package/components/context-wrapper.js +3 -2
  16. package/components/cookie-banner.d.ts +8 -3
  17. package/components/cookie-banner.d.ts.map +1 -1
  18. package/components/cookie-banner.js +11 -12
  19. package/components/form/error-message.d.ts +1 -2
  20. package/components/form/error-message.d.ts.map +1 -1
  21. package/components/form/error-message.js +2 -3
  22. package/components/form/field.d.ts +11 -3
  23. package/components/form/field.d.ts.map +1 -1
  24. package/components/form/field.js +18 -7
  25. package/components/form/file-field.d.ts +15 -0
  26. package/components/form/file-field.d.ts.map +1 -0
  27. package/components/form/file-field.js +24 -0
  28. package/components/form/submit-button.d.ts +3 -3
  29. package/components/form/submit-button.d.ts.map +1 -1
  30. package/components/form/submit-button.js +3 -4
  31. package/components/form/success-message.d.ts +3 -2
  32. package/components/form/success-message.d.ts.map +1 -1
  33. package/components/form/success-message.js +9 -2
  34. package/components/form.d.ts +22 -6
  35. package/components/form.d.ts.map +1 -1
  36. package/components/form.js +72 -55
  37. package/components/menu-toggle.d.ts +4 -4
  38. package/components/menu-toggle.d.ts.map +1 -1
  39. package/components/menu-toggle.js +4 -13
  40. package/components/modal.d.ts +3 -2
  41. package/components/modal.d.ts.map +1 -1
  42. package/components/modal.js +10 -6
  43. package/components/skip-to.d.ts +1 -2
  44. package/components/skip-to.d.ts.map +1 -1
  45. package/components/skip-to.js +2 -3
  46. package/components/slideshow-buttons.d.ts +2 -3
  47. package/components/slideshow-buttons.d.ts.map +1 -1
  48. package/components/slideshow-buttons.js +2 -3
  49. package/components/slideshow-pagination.d.ts +5 -0
  50. package/components/slideshow-pagination.d.ts.map +1 -0
  51. package/components/slideshow-pagination.js +4 -0
  52. package/components.d.ts +3 -1
  53. package/components.d.ts.map +1 -1
  54. package/components.js +3 -1
  55. package/context/cookies-context-provider.d.ts +13 -0
  56. package/context/cookies-context-provider.d.ts.map +1 -0
  57. package/context/cookies-context-provider.js +54 -0
  58. package/context/modal-context-provider.d.ts +1 -1
  59. package/context/modal-context-provider.d.ts.map +1 -1
  60. package/context/modal-context-provider.js +2 -2
  61. package/context/nav-context-provider.d.ts +1 -1
  62. package/context/nav-context-provider.d.ts.map +1 -1
  63. package/context/nav-context-provider.js +2 -2
  64. package/context.d.ts +2 -1
  65. package/context.d.ts.map +1 -1
  66. package/context.js +2 -1
  67. package/hooks/use-async.d.ts +3 -2
  68. package/hooks/use-async.d.ts.map +1 -1
  69. package/hooks/use-async.js +3 -4
  70. package/hooks/use-draggable-scroll.d.ts +3 -3
  71. package/hooks/use-draggable-scroll.d.ts.map +1 -1
  72. package/hooks/use-draggable-scroll.js +2 -3
  73. package/hooks/use-escape.d.ts +3 -0
  74. package/hooks/use-escape.d.ts.map +1 -0
  75. package/hooks/use-escape.js +11 -0
  76. package/hooks/use-event-listener.d.ts +2 -2
  77. package/hooks/use-event-listener.d.ts.map +1 -1
  78. package/hooks/use-event-listener.js +4 -12
  79. package/hooks/use-hide-on-scroll.d.ts +1 -2
  80. package/hooks/use-hide-on-scroll.d.ts.map +1 -1
  81. package/hooks/use-hide-on-scroll.js +2 -3
  82. package/hooks/use-id.d.ts +1 -2
  83. package/hooks/use-id.d.ts.map +1 -1
  84. package/hooks/use-id.js +2 -3
  85. package/hooks/use-is-in-viewport.d.ts +2 -3
  86. package/hooks/use-is-in-viewport.d.ts.map +1 -1
  87. package/hooks/use-is-in-viewport.js +17 -15
  88. package/hooks/use-is-mobile.d.ts +1 -2
  89. package/hooks/use-is-mobile.d.ts.map +1 -1
  90. package/hooks/use-is-mobile.js +2 -3
  91. package/hooks/use-is-overflowing.d.ts +1 -2
  92. package/hooks/use-is-overflowing.d.ts.map +1 -1
  93. package/hooks/use-is-overflowing.js +5 -4
  94. package/hooks/use-lock-body-scroll.d.ts +1 -2
  95. package/hooks/use-lock-body-scroll.d.ts.map +1 -1
  96. package/hooks/use-lock-body-scroll.js +1 -2
  97. package/hooks/use-modal.d.ts +1 -2
  98. package/hooks/use-modal.d.ts.map +1 -1
  99. package/hooks/use-modal.js +2 -3
  100. package/hooks/use-motion-allowed.d.ts +1 -2
  101. package/hooks/use-motion-allowed.d.ts.map +1 -1
  102. package/hooks/use-motion-allowed.js +2 -3
  103. package/hooks/use-parallax.d.ts +1 -2
  104. package/hooks/use-parallax.d.ts.map +1 -1
  105. package/hooks/use-parallax.js +2 -3
  106. package/hooks/use-slideshow.d.ts +5 -4
  107. package/hooks/use-slideshow.d.ts.map +1 -1
  108. package/hooks/use-slideshow.js +86 -41
  109. package/hooks.d.ts +2 -1
  110. package/hooks.d.ts.map +1 -1
  111. package/hooks.js +2 -1
  112. package/package.json +5 -3
  113. package/store/cookies.d.ts +3 -0
  114. package/store/cookies.d.ts.map +1 -1
  115. package/store/cookies.js +29 -22
  116. package/store/modal.d.ts.map +1 -1
  117. package/store/modal.js +4 -0
  118. package/store/nav.d.ts.map +1 -1
  119. package/store/nav.js +4 -0
  120. package/tsconfig.tsbuildinfo +1 -1
  121. package/utils/animate.d.ts +1 -2
  122. package/utils/animate.d.ts.map +1 -1
  123. package/utils/animate.js +24 -23
  124. package/utils/extend-class.d.ts +1 -2
  125. package/utils/extend-class.d.ts.map +1 -1
  126. package/utils/extend-class.js +8 -7
  127. package/utils/get-y-pos.d.ts +1 -2
  128. package/utils/get-y-pos.d.ts.map +1 -1
  129. package/utils/get-y-pos.js +2 -3
  130. package/utils/get.d.ts +2 -2
  131. package/utils/get.d.ts.map +1 -1
  132. package/utils/get.js +1 -2
  133. package/utils/is-external-link.d.ts +1 -2
  134. package/utils/is-external-link.d.ts.map +1 -1
  135. package/utils/is-external-link.js +6 -7
  136. package/utils/scroll-to-hash.d.ts +1 -2
  137. package/utils/scroll-to-hash.d.ts.map +1 -1
  138. 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,3 +1,2 @@
1
- declare const isExternalLink: (url: string, forceExternal?: boolean) => boolean;
2
- export default isExternalLink;
1
+ export default function isExternalLink(url: string, forceExternal?: boolean): boolean;
3
2
  //# sourceMappingURL=is-external-link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-external-link.d.ts","sourceRoot":"","sources":["../src/utils/is-external-link.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,cAAc,QAAS,MAAM,qCAuBlC,CAAA;AAED,eAAe,cAAc,CAAA"}
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
- const isExternalLink = (url, forceExternal = false) => {
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,3 +1,2 @@
1
- declare const scrollToHash: (hash: string) => false | undefined;
2
- export default scrollToHash;
1
+ export default function scrollToHash(hash: string): false | undefined;
3
2
  //# sourceMappingURL=scroll-to-hash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-to-hash.d.ts","sourceRoot":"","sources":["../src/utils/scroll-to-hash.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,SAAU,MAAM,sBAUjC,CAAA;AAED,eAAe,YAAY,CAAA"}
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"}
@@ -1,4 +1,4 @@
1
- const scrollToHash = (hash) => {
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
+ }