@tarsis/toolkit 0.5.2 → 0.5.3
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/dist/{gl-MYQC24ZU.js → gl-BE-pAc_o.js} +1 -1
- package/dist/{gl-DkwP1ATh.cjs → gl-Cxodbc5S.cjs} +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/{index-CEXzqVuq.cjs → index-BH-WDme3.cjs} +500 -40
- package/dist/{index-CmzNwlcp.cjs → index-C1HOJZOl.cjs} +1 -1
- package/dist/{index-DqgylTr3.js → index-CBTCt41n.js} +492 -32
- package/dist/{index-B6Kl363b.js → index-DI2YEpFt.js} +1 -1
- package/dist/index.cjs +26 -27
- package/dist/index.js +3 -4
- package/dist/styles.css +490 -485
- package/dist/{server.cjs → svg-BT_esDTZ.cjs} +70 -1
- package/dist/{server.js → svg-CQLdTbLk.js} +65 -1
- package/dist/{useWindowReady-CpmawCsz.js → useWindowReady-DVV-s65K.js} +1 -1
- package/dist/{useWindowReady-ow3ZpIjd.cjs → useWindowReady-Il0Ibn7I.cjs} +3 -0
- package/dist/utils.cjs +24 -25
- package/dist/utils.js +1 -2
- package/package.json +2 -11
- package/dist/server.d.ts +0 -70
- package/dist/svg-Bi5ULzxB.cjs +0 -73
- package/dist/svg-CoSCBw2u.js +0 -65
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { p as isBrowser$1, q as isObject$3, r as resolveElements, s as interpolate$2, t as frame$2, v as isMotionValue, J as JSAnimation, w as
|
|
2
|
-
import {
|
|
1
|
+
import { p as isBrowser$1, q as isObject$3, r as resolveElements, s as interpolate$2, t as frame$2, v as isMotionValue, J as JSAnimation, M as MotionConfigContext, w as useConstant, x as featureDefinitions, y as isControllingVariants, z as isVariantLabel, A as isForcedMotionValue, B as buildHTMLStyles, C as buildSVGAttrs, D as isSVGTag, E as isVariantNode, F as isAnimationControls, G as resolveVariantFromProps, H as scrapeMotionValuesFromProps, I as scrapeMotionValuesFromProps$1, K as optimizedAppearDataAttribute, L as warning, N as invariant, O as warnOnce, S as SVGVisualElement, P as HTMLVisualElement, Q as resolveVariant, R as animateTarget, T as variantProps, U as isKeyframesTarget, V as variantPriorityOrder, W as mixNumber, X as frameData, Y as pipe$1, Z as cancelFrame, _ as secondsToMilliseconds, $ as millisecondsToSeconds, a0 as progress$2, a1 as clamp$3, a2 as createBox, a3 as measurePageBox, a4 as convertBoxToBoundingBox, a5 as convertBoundingBoxToBox, a6 as addValueToWillChange, a7 as animateMotionValue, a8 as percent, a9 as noop$4, aa as microtask, ab as addUniqueItem, ac as removeItem, ad as time$1, ae as px$2, af as circOut, ag as scalePoint, ah as SubscriptionManager, ai as isSVGElement$1, aj as isSVGSVGElement, ak as getValueTransition, al as frameSteps, am as hasTransform, an as translateAxis, ao as transformBox, ap as hasScale, aq as applyBoxDelta, ar as has2DTranslate, as as applyTreeDeltas, at as createDelta, au as motionValue, av as animateSingleValue, aw as scaleCorrectors, ax as getOptimisedAppearId, ay as useMotionValue, az as collectMotionValues, aA as hasReducedMotionListener, aB as initPrefersReducedMotion, aC as prefersReducedMotion, aD as createScopedAnimate, f as useLiveRef, m as useThrottle, g as useMatchMedia, l as useRaf, b as useDebounce, i as useOutsideClick, o as useWindowReady, e as useInterval, d as useEffectEvent$1, h as useOklch } from './useWindowReady-DVV-s65K.js';
|
|
2
|
+
import { n as noop$5, D as getPath, z as lerp$1, x as distance$2, y as lineEq, C as wait } from './svg-CQLdTbLk.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import React__default, { useRef, useEffect, useState, useMemo, createContext, useLayoutEffect,
|
|
5
|
+
import React__default, { useRef, useEffect, useState, useMemo, createContext, useLayoutEffect, useId as useId$1, useContext, useInsertionEffect as useInsertionEffect$1, useCallback, Children, isValidElement, Fragment as Fragment$1, createElement as createElement$1, forwardRef, Component, cloneElement } from 'react';
|
|
6
6
|
import * as ReactDOM from 'react-dom';
|
|
7
7
|
import ReactDOM__default, { unstable_batchedUpdates } from 'react-dom';
|
|
8
|
-
import { noop as noop$5 } from './server.js';
|
|
9
8
|
|
|
10
9
|
function r$1(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r$1(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r$1(e))&&(n&&(n+=" "),n+=t);return n}
|
|
11
10
|
|
|
@@ -52088,11 +52087,11 @@ const BubblyParticlesButton = () => {
|
|
|
52088
52087
|
);
|
|
52089
52088
|
};
|
|
52090
52089
|
|
|
52091
|
-
const root$4i = "
|
|
52092
|
-
const button$o = "
|
|
52093
|
-
const p$1 = "
|
|
52094
|
-
const text$z = "
|
|
52095
|
-
const effects = "
|
|
52090
|
+
const root$4i = "_root_yhweb_1";
|
|
52091
|
+
const button$o = "_button_yhweb_13";
|
|
52092
|
+
const p$1 = "_p_yhweb_26";
|
|
52093
|
+
const text$z = "_text_yhweb_26";
|
|
52094
|
+
const effects = "_effects_yhweb_240";
|
|
52096
52095
|
const styles$4G = {
|
|
52097
52096
|
root: root$4i,
|
|
52098
52097
|
button: button$o,
|
|
@@ -59987,6 +59986,205 @@ function asNumber$1(v) {
|
|
|
59987
59986
|
return typeof v === "number" ? v : parseFloat(v);
|
|
59988
59987
|
}
|
|
59989
59988
|
|
|
59989
|
+
/**
|
|
59990
|
+
* Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx
|
|
59991
|
+
*/
|
|
59992
|
+
/**
|
|
59993
|
+
* Set a given ref to a given value
|
|
59994
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
59995
|
+
*/
|
|
59996
|
+
function setRef(ref, value) {
|
|
59997
|
+
if (typeof ref === "function") {
|
|
59998
|
+
return ref(value);
|
|
59999
|
+
}
|
|
60000
|
+
else if (ref !== null && ref !== undefined) {
|
|
60001
|
+
ref.current = value;
|
|
60002
|
+
}
|
|
60003
|
+
}
|
|
60004
|
+
/**
|
|
60005
|
+
* A utility to compose multiple refs together
|
|
60006
|
+
* Accepts callback refs and RefObject(s)
|
|
60007
|
+
*/
|
|
60008
|
+
function composeRefs(...refs) {
|
|
60009
|
+
return (node) => {
|
|
60010
|
+
let hasCleanup = false;
|
|
60011
|
+
const cleanups = refs.map((ref) => {
|
|
60012
|
+
const cleanup = setRef(ref, node);
|
|
60013
|
+
if (!hasCleanup && typeof cleanup === "function") {
|
|
60014
|
+
hasCleanup = true;
|
|
60015
|
+
}
|
|
60016
|
+
return cleanup;
|
|
60017
|
+
});
|
|
60018
|
+
// React <19 will log an error to the console if a callback ref returns a
|
|
60019
|
+
// value. We don't use ref cleanups internally so this will only happen if a
|
|
60020
|
+
// user's ref callback returns a value, which we only expect if they are
|
|
60021
|
+
// using the cleanup functionality added in React 19.
|
|
60022
|
+
if (hasCleanup) {
|
|
60023
|
+
return () => {
|
|
60024
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
60025
|
+
const cleanup = cleanups[i];
|
|
60026
|
+
if (typeof cleanup === "function") {
|
|
60027
|
+
cleanup();
|
|
60028
|
+
}
|
|
60029
|
+
else {
|
|
60030
|
+
setRef(refs[i], null);
|
|
60031
|
+
}
|
|
60032
|
+
}
|
|
60033
|
+
};
|
|
60034
|
+
}
|
|
60035
|
+
};
|
|
60036
|
+
}
|
|
60037
|
+
/**
|
|
60038
|
+
* A custom hook that composes multiple refs
|
|
60039
|
+
* Accepts callback refs and RefObject(s)
|
|
60040
|
+
*/
|
|
60041
|
+
function useComposedRefs(...refs) {
|
|
60042
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60043
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
60044
|
+
}
|
|
60045
|
+
|
|
60046
|
+
/**
|
|
60047
|
+
* Measurement functionality has to be within a separate component
|
|
60048
|
+
* to leverage snapshot lifecycle.
|
|
60049
|
+
*/
|
|
60050
|
+
class PopChildMeasure extends React.Component {
|
|
60051
|
+
getSnapshotBeforeUpdate(prevProps) {
|
|
60052
|
+
const element = this.props.childRef.current;
|
|
60053
|
+
if (element && prevProps.isPresent && !this.props.isPresent) {
|
|
60054
|
+
const parent = element.offsetParent;
|
|
60055
|
+
const parentWidth = isHTMLElement$2(parent)
|
|
60056
|
+
? parent.offsetWidth || 0
|
|
60057
|
+
: 0;
|
|
60058
|
+
const size = this.props.sizeRef.current;
|
|
60059
|
+
size.height = element.offsetHeight || 0;
|
|
60060
|
+
size.width = element.offsetWidth || 0;
|
|
60061
|
+
size.top = element.offsetTop;
|
|
60062
|
+
size.left = element.offsetLeft;
|
|
60063
|
+
size.right = parentWidth - size.width - size.left;
|
|
60064
|
+
}
|
|
60065
|
+
return null;
|
|
60066
|
+
}
|
|
60067
|
+
/**
|
|
60068
|
+
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
60069
|
+
*/
|
|
60070
|
+
componentDidUpdate() { }
|
|
60071
|
+
render() {
|
|
60072
|
+
return this.props.children;
|
|
60073
|
+
}
|
|
60074
|
+
}
|
|
60075
|
+
function PopChild({ children, isPresent, anchorX, root }) {
|
|
60076
|
+
const id = useId$1();
|
|
60077
|
+
const ref = useRef(null);
|
|
60078
|
+
const size = useRef({
|
|
60079
|
+
width: 0,
|
|
60080
|
+
height: 0,
|
|
60081
|
+
top: 0,
|
|
60082
|
+
left: 0,
|
|
60083
|
+
right: 0,
|
|
60084
|
+
});
|
|
60085
|
+
const { nonce } = useContext(MotionConfigContext);
|
|
60086
|
+
/**
|
|
60087
|
+
* In React 19, refs are passed via props.ref instead of element.ref.
|
|
60088
|
+
* We check props.ref first (React 19) and fall back to element.ref (React 18).
|
|
60089
|
+
*/
|
|
60090
|
+
const childRef = children.props?.ref ??
|
|
60091
|
+
children?.ref;
|
|
60092
|
+
const composedRef = useComposedRefs(ref, childRef);
|
|
60093
|
+
/**
|
|
60094
|
+
* We create and inject a style block so we can apply this explicit
|
|
60095
|
+
* sizing in a non-destructive manner by just deleting the style block.
|
|
60096
|
+
*
|
|
60097
|
+
* We can't apply size via render as the measurement happens
|
|
60098
|
+
* in getSnapshotBeforeUpdate (post-render), likewise if we apply the
|
|
60099
|
+
* styles directly on the DOM node, we might be overwriting
|
|
60100
|
+
* styles set via the style prop.
|
|
60101
|
+
*/
|
|
60102
|
+
useInsertionEffect$1(() => {
|
|
60103
|
+
const { width, height, top, left, right } = size.current;
|
|
60104
|
+
if (isPresent || !ref.current || !width || !height)
|
|
60105
|
+
return;
|
|
60106
|
+
const x = anchorX === "left" ? `left: ${left}` : `right: ${right}`;
|
|
60107
|
+
ref.current.dataset.motionPopId = id;
|
|
60108
|
+
const style = document.createElement("style");
|
|
60109
|
+
if (nonce)
|
|
60110
|
+
style.nonce = nonce;
|
|
60111
|
+
const parent = root ?? document.head;
|
|
60112
|
+
parent.appendChild(style);
|
|
60113
|
+
if (style.sheet) {
|
|
60114
|
+
style.sheet.insertRule(`
|
|
60115
|
+
[data-motion-pop-id="${id}"] {
|
|
60116
|
+
position: absolute !important;
|
|
60117
|
+
width: ${width}px !important;
|
|
60118
|
+
height: ${height}px !important;
|
|
60119
|
+
${x}px !important;
|
|
60120
|
+
top: ${top}px !important;
|
|
60121
|
+
}
|
|
60122
|
+
`);
|
|
60123
|
+
}
|
|
60124
|
+
return () => {
|
|
60125
|
+
if (parent.contains(style)) {
|
|
60126
|
+
parent.removeChild(style);
|
|
60127
|
+
}
|
|
60128
|
+
};
|
|
60129
|
+
}, [isPresent]);
|
|
60130
|
+
return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref: composedRef }) }));
|
|
60131
|
+
}
|
|
60132
|
+
|
|
60133
|
+
const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, root }) => {
|
|
60134
|
+
const presenceChildren = useConstant(newChildrenMap);
|
|
60135
|
+
const id = useId$1();
|
|
60136
|
+
let isReusedContext = true;
|
|
60137
|
+
let context = useMemo(() => {
|
|
60138
|
+
isReusedContext = false;
|
|
60139
|
+
return {
|
|
60140
|
+
id,
|
|
60141
|
+
initial,
|
|
60142
|
+
isPresent,
|
|
60143
|
+
custom,
|
|
60144
|
+
onExitComplete: (childId) => {
|
|
60145
|
+
presenceChildren.set(childId, true);
|
|
60146
|
+
for (const isComplete of presenceChildren.values()) {
|
|
60147
|
+
if (!isComplete)
|
|
60148
|
+
return; // can stop searching when any is incomplete
|
|
60149
|
+
}
|
|
60150
|
+
onExitComplete && onExitComplete();
|
|
60151
|
+
},
|
|
60152
|
+
register: (childId) => {
|
|
60153
|
+
presenceChildren.set(childId, false);
|
|
60154
|
+
return () => presenceChildren.delete(childId);
|
|
60155
|
+
},
|
|
60156
|
+
};
|
|
60157
|
+
}, [isPresent, presenceChildren, onExitComplete]);
|
|
60158
|
+
/**
|
|
60159
|
+
* If the presence of a child affects the layout of the components around it,
|
|
60160
|
+
* we want to make a new context value to ensure they get re-rendered
|
|
60161
|
+
* so they can detect that layout change.
|
|
60162
|
+
*/
|
|
60163
|
+
if (presenceAffectsLayout && isReusedContext) {
|
|
60164
|
+
context = { ...context };
|
|
60165
|
+
}
|
|
60166
|
+
useMemo(() => {
|
|
60167
|
+
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
|
|
60168
|
+
}, [isPresent]);
|
|
60169
|
+
/**
|
|
60170
|
+
* If there's no `motion` components to fire exit animations, we want to remove this
|
|
60171
|
+
* component immediately.
|
|
60172
|
+
*/
|
|
60173
|
+
React.useEffect(() => {
|
|
60174
|
+
!isPresent &&
|
|
60175
|
+
!presenceChildren.size &&
|
|
60176
|
+
onExitComplete &&
|
|
60177
|
+
onExitComplete();
|
|
60178
|
+
}, [isPresent]);
|
|
60179
|
+
if (mode === "popLayout") {
|
|
60180
|
+
children = (jsx(PopChild, { isPresent: isPresent, anchorX: anchorX, root: root, children: children }));
|
|
60181
|
+
}
|
|
60182
|
+
return (jsx(PresenceContext.Provider, { value: context, children: children }));
|
|
60183
|
+
};
|
|
60184
|
+
function newChildrenMap() {
|
|
60185
|
+
return new Map();
|
|
60186
|
+
}
|
|
60187
|
+
|
|
59990
60188
|
/**
|
|
59991
60189
|
* When a component is the child of `AnimatePresence`, it can use `usePresence`
|
|
59992
60190
|
* to access information about whether it's still present in the React tree.
|
|
@@ -60027,6 +60225,181 @@ function usePresence(subscribe = true) {
|
|
|
60027
60225
|
return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
|
|
60028
60226
|
}
|
|
60029
60227
|
|
|
60228
|
+
const getChildKey = (child) => child.key || "";
|
|
60229
|
+
function onlyElements(children) {
|
|
60230
|
+
const filtered = [];
|
|
60231
|
+
// We use forEach here instead of map as map mutates the component key by preprending `.$`
|
|
60232
|
+
Children.forEach(children, (child) => {
|
|
60233
|
+
if (isValidElement(child))
|
|
60234
|
+
filtered.push(child);
|
|
60235
|
+
});
|
|
60236
|
+
return filtered;
|
|
60237
|
+
}
|
|
60238
|
+
|
|
60239
|
+
/**
|
|
60240
|
+
* `AnimatePresence` enables the animation of components that have been removed from the tree.
|
|
60241
|
+
*
|
|
60242
|
+
* When adding/removing more than a single child, every child **must** be given a unique `key` prop.
|
|
60243
|
+
*
|
|
60244
|
+
* Any `motion` components that have an `exit` property defined will animate out when removed from
|
|
60245
|
+
* the tree.
|
|
60246
|
+
*
|
|
60247
|
+
* ```jsx
|
|
60248
|
+
* import { motion, AnimatePresence } from 'framer-motion'
|
|
60249
|
+
*
|
|
60250
|
+
* export const Items = ({ items }) => (
|
|
60251
|
+
* <AnimatePresence>
|
|
60252
|
+
* {items.map(item => (
|
|
60253
|
+
* <motion.div
|
|
60254
|
+
* key={item.id}
|
|
60255
|
+
* initial={{ opacity: 0 }}
|
|
60256
|
+
* animate={{ opacity: 1 }}
|
|
60257
|
+
* exit={{ opacity: 0 }}
|
|
60258
|
+
* />
|
|
60259
|
+
* ))}
|
|
60260
|
+
* </AnimatePresence>
|
|
60261
|
+
* )
|
|
60262
|
+
* ```
|
|
60263
|
+
*
|
|
60264
|
+
* You can sequence exit animations throughout a tree using variants.
|
|
60265
|
+
*
|
|
60266
|
+
* If a child contains multiple `motion` components with `exit` props, it will only unmount the child
|
|
60267
|
+
* once all `motion` components have finished animating out. Likewise, any components using
|
|
60268
|
+
* `usePresence` all need to call `safeToRemove`.
|
|
60269
|
+
*
|
|
60270
|
+
* @public
|
|
60271
|
+
*/
|
|
60272
|
+
const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", root }) => {
|
|
60273
|
+
const [isParentPresent, safeToRemove] = usePresence(propagate);
|
|
60274
|
+
/**
|
|
60275
|
+
* Filter any children that aren't ReactElements. We can only track components
|
|
60276
|
+
* between renders with a props.key.
|
|
60277
|
+
*/
|
|
60278
|
+
const presentChildren = useMemo(() => onlyElements(children), [children]);
|
|
60279
|
+
/**
|
|
60280
|
+
* Track the keys of the currently rendered children. This is used to
|
|
60281
|
+
* determine which children are exiting.
|
|
60282
|
+
*/
|
|
60283
|
+
const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);
|
|
60284
|
+
/**
|
|
60285
|
+
* If `initial={false}` we only want to pass this to components in the first render.
|
|
60286
|
+
*/
|
|
60287
|
+
const isInitialRender = useRef(true);
|
|
60288
|
+
/**
|
|
60289
|
+
* A ref containing the currently present children. When all exit animations
|
|
60290
|
+
* are complete, we use this to re-render the component with the latest children
|
|
60291
|
+
* *committed* rather than the latest children *rendered*.
|
|
60292
|
+
*/
|
|
60293
|
+
const pendingPresentChildren = useRef(presentChildren);
|
|
60294
|
+
/**
|
|
60295
|
+
* Track which exiting children have finished animating out.
|
|
60296
|
+
*/
|
|
60297
|
+
const exitComplete = useConstant(() => new Map());
|
|
60298
|
+
/**
|
|
60299
|
+
* Track which components are currently processing exit to prevent duplicate processing.
|
|
60300
|
+
*/
|
|
60301
|
+
const exitingComponents = useRef(new Set());
|
|
60302
|
+
/**
|
|
60303
|
+
* Save children to render as React state. To ensure this component is concurrent-safe,
|
|
60304
|
+
* we check for exiting children via an effect.
|
|
60305
|
+
*/
|
|
60306
|
+
const [diffedChildren, setDiffedChildren] = useState(presentChildren);
|
|
60307
|
+
const [renderedChildren, setRenderedChildren] = useState(presentChildren);
|
|
60308
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
60309
|
+
isInitialRender.current = false;
|
|
60310
|
+
pendingPresentChildren.current = presentChildren;
|
|
60311
|
+
/**
|
|
60312
|
+
* Update complete status of exiting children.
|
|
60313
|
+
*/
|
|
60314
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
60315
|
+
const key = getChildKey(renderedChildren[i]);
|
|
60316
|
+
if (!presentKeys.includes(key)) {
|
|
60317
|
+
if (exitComplete.get(key) !== true) {
|
|
60318
|
+
exitComplete.set(key, false);
|
|
60319
|
+
}
|
|
60320
|
+
}
|
|
60321
|
+
else {
|
|
60322
|
+
exitComplete.delete(key);
|
|
60323
|
+
exitingComponents.current.delete(key);
|
|
60324
|
+
}
|
|
60325
|
+
}
|
|
60326
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
|
|
60327
|
+
const exitingChildren = [];
|
|
60328
|
+
if (presentChildren !== diffedChildren) {
|
|
60329
|
+
let nextChildren = [...presentChildren];
|
|
60330
|
+
/**
|
|
60331
|
+
* Loop through all the currently rendered components and decide which
|
|
60332
|
+
* are exiting.
|
|
60333
|
+
*/
|
|
60334
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
60335
|
+
const child = renderedChildren[i];
|
|
60336
|
+
const key = getChildKey(child);
|
|
60337
|
+
if (!presentKeys.includes(key)) {
|
|
60338
|
+
nextChildren.splice(i, 0, child);
|
|
60339
|
+
exitingChildren.push(child);
|
|
60340
|
+
}
|
|
60341
|
+
}
|
|
60342
|
+
/**
|
|
60343
|
+
* If we're in "wait" mode, and we have exiting children, we want to
|
|
60344
|
+
* only render these until they've all exited.
|
|
60345
|
+
*/
|
|
60346
|
+
if (mode === "wait" && exitingChildren.length) {
|
|
60347
|
+
nextChildren = exitingChildren;
|
|
60348
|
+
}
|
|
60349
|
+
setRenderedChildren(onlyElements(nextChildren));
|
|
60350
|
+
setDiffedChildren(presentChildren);
|
|
60351
|
+
/**
|
|
60352
|
+
* Early return to ensure once we've set state with the latest diffed
|
|
60353
|
+
* children, we can immediately re-render.
|
|
60354
|
+
*/
|
|
60355
|
+
return null;
|
|
60356
|
+
}
|
|
60357
|
+
if (process.env.NODE_ENV !== "production" &&
|
|
60358
|
+
mode === "wait" &&
|
|
60359
|
+
renderedChildren.length > 1) {
|
|
60360
|
+
console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
60361
|
+
}
|
|
60362
|
+
/**
|
|
60363
|
+
* If we've been provided a forceRender function by the LayoutGroupContext,
|
|
60364
|
+
* we can use it to force a re-render amongst all surrounding components once
|
|
60365
|
+
* all components have finished animating out.
|
|
60366
|
+
*/
|
|
60367
|
+
const { forceRender } = useContext(LayoutGroupContext);
|
|
60368
|
+
return (jsx(Fragment, { children: renderedChildren.map((child) => {
|
|
60369
|
+
const key = getChildKey(child);
|
|
60370
|
+
const isPresent = propagate && !isParentPresent
|
|
60371
|
+
? false
|
|
60372
|
+
: presentChildren === renderedChildren ||
|
|
60373
|
+
presentKeys.includes(key);
|
|
60374
|
+
const onExit = () => {
|
|
60375
|
+
if (exitingComponents.current.has(key)) {
|
|
60376
|
+
return;
|
|
60377
|
+
}
|
|
60378
|
+
exitingComponents.current.add(key);
|
|
60379
|
+
if (exitComplete.has(key)) {
|
|
60380
|
+
exitComplete.set(key, true);
|
|
60381
|
+
}
|
|
60382
|
+
else {
|
|
60383
|
+
return;
|
|
60384
|
+
}
|
|
60385
|
+
let isEveryExitComplete = true;
|
|
60386
|
+
exitComplete.forEach((isExitComplete) => {
|
|
60387
|
+
if (!isExitComplete)
|
|
60388
|
+
isEveryExitComplete = false;
|
|
60389
|
+
});
|
|
60390
|
+
if (isEveryExitComplete) {
|
|
60391
|
+
forceRender?.();
|
|
60392
|
+
setRenderedChildren(pendingPresentChildren.current);
|
|
60393
|
+
propagate && safeToRemove?.();
|
|
60394
|
+
onExitComplete && onExitComplete();
|
|
60395
|
+
}
|
|
60396
|
+
};
|
|
60397
|
+
return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial
|
|
60398
|
+
? undefined
|
|
60399
|
+
: false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, children: child }, key));
|
|
60400
|
+
}) }));
|
|
60401
|
+
};
|
|
60402
|
+
|
|
60030
60403
|
const LazyContext = createContext({ strict: false });
|
|
60031
60404
|
|
|
60032
60405
|
function loadFeatures(features) {
|
|
@@ -64688,6 +65061,47 @@ function useSpring$1(source, options = {}) {
|
|
|
64688
65061
|
return value;
|
|
64689
65062
|
}
|
|
64690
65063
|
|
|
65064
|
+
/**
|
|
65065
|
+
* A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.
|
|
65066
|
+
*
|
|
65067
|
+
* This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing
|
|
65068
|
+
* `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.
|
|
65069
|
+
*
|
|
65070
|
+
* It will actively respond to changes and re-render your components with the latest setting.
|
|
65071
|
+
*
|
|
65072
|
+
* ```jsx
|
|
65073
|
+
* export function Sidebar({ isOpen }) {
|
|
65074
|
+
* const shouldReduceMotion = useReducedMotion()
|
|
65075
|
+
* const closedX = shouldReduceMotion ? 0 : "-100%"
|
|
65076
|
+
*
|
|
65077
|
+
* return (
|
|
65078
|
+
* <motion.div animate={{
|
|
65079
|
+
* opacity: isOpen ? 1 : 0,
|
|
65080
|
+
* x: isOpen ? 0 : closedX
|
|
65081
|
+
* }} />
|
|
65082
|
+
* )
|
|
65083
|
+
* }
|
|
65084
|
+
* ```
|
|
65085
|
+
*
|
|
65086
|
+
* @return boolean
|
|
65087
|
+
*
|
|
65088
|
+
* @public
|
|
65089
|
+
*/
|
|
65090
|
+
function useReducedMotion() {
|
|
65091
|
+
/**
|
|
65092
|
+
* Lazy initialisation of prefersReducedMotion
|
|
65093
|
+
*/
|
|
65094
|
+
!hasReducedMotionListener.current && initPrefersReducedMotion();
|
|
65095
|
+
const [shouldReduceMotion] = useState(prefersReducedMotion.current);
|
|
65096
|
+
if (process.env.NODE_ENV !== "production") {
|
|
65097
|
+
warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled");
|
|
65098
|
+
}
|
|
65099
|
+
/**
|
|
65100
|
+
* TODO See if people miss automatically updating shouldReduceMotion setting
|
|
65101
|
+
*/
|
|
65102
|
+
return shouldReduceMotion;
|
|
65103
|
+
}
|
|
65104
|
+
|
|
64691
65105
|
function useAnimate() {
|
|
64692
65106
|
const scope = useConstant(() => ({
|
|
64693
65107
|
current: null, // Will be hydrated by React
|
|
@@ -67686,9 +68100,9 @@ const NeonButton = ({ className = "", ...rest }) => {
|
|
|
67686
68100
|
return /* @__PURE__ */ jsx("button", { type: "button", ...rest, className: clsx(styles$48.root, className), children: "Neon" });
|
|
67687
68101
|
};
|
|
67688
68102
|
|
|
67689
|
-
const root$3P = "
|
|
67690
|
-
const i$6 = "
|
|
67691
|
-
const text$s = "
|
|
68103
|
+
const root$3P = "_root_1ol0v_2";
|
|
68104
|
+
const i$6 = "_i_1ol0v_22";
|
|
68105
|
+
const text$s = "_text_1ol0v_482";
|
|
67692
68106
|
const styles$47 = {
|
|
67693
68107
|
root: root$3P,
|
|
67694
68108
|
i: i$6,
|
|
@@ -77679,9 +78093,11 @@ function useRole(context, props) {
|
|
|
77679
78093
|
} : {}, [enabled, reference, floating, item]);
|
|
77680
78094
|
}
|
|
77681
78095
|
|
|
77682
|
-
const tooltip = "
|
|
78096
|
+
const tooltip = "_tooltip_pli88_1";
|
|
78097
|
+
const tooltipContent = "_tooltipContent_pli88_6";
|
|
77683
78098
|
const styles$2R = {
|
|
77684
|
-
tooltip: tooltip
|
|
78099
|
+
tooltip: tooltip,
|
|
78100
|
+
tooltipContent: tooltipContent
|
|
77685
78101
|
};
|
|
77686
78102
|
|
|
77687
78103
|
const Tooltip = ({
|
|
@@ -77692,7 +78108,29 @@ const Tooltip = ({
|
|
|
77692
78108
|
placement = "top",
|
|
77693
78109
|
offset: offsetValue = 8
|
|
77694
78110
|
}) => {
|
|
77695
|
-
const [isOpen, setIsOpen] = useState(
|
|
78111
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
78112
|
+
const shouldReduceMotion = useReducedMotion();
|
|
78113
|
+
const variants = shouldReduceMotion ? void 0 : {
|
|
78114
|
+
initial: { scale: 0.6, opacity: 0 },
|
|
78115
|
+
animate: {
|
|
78116
|
+
scale: 1,
|
|
78117
|
+
opacity: 1,
|
|
78118
|
+
transition: {
|
|
78119
|
+
type: "spring",
|
|
78120
|
+
stiffness: 150,
|
|
78121
|
+
damping: 20,
|
|
78122
|
+
mass: 1.2
|
|
78123
|
+
}
|
|
78124
|
+
},
|
|
78125
|
+
exit: {
|
|
78126
|
+
scale: 0.4,
|
|
78127
|
+
opacity: 0,
|
|
78128
|
+
transition: {
|
|
78129
|
+
duration: 0.1,
|
|
78130
|
+
ease: "easeIn"
|
|
78131
|
+
}
|
|
78132
|
+
}
|
|
78133
|
+
};
|
|
77696
78134
|
const { refs, floatingStyles, context } = useFloating({
|
|
77697
78135
|
open: isOpen,
|
|
77698
78136
|
onOpenChange: setIsOpen,
|
|
@@ -77748,16 +78186,27 @@ const Tooltip = ({
|
|
|
77748
78186
|
};
|
|
77749
78187
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
77750
78188
|
cloneElement(childElement, mergedProps),
|
|
77751
|
-
|
|
78189
|
+
/* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: isOpen && /* @__PURE__ */ jsx(
|
|
77752
78190
|
"div",
|
|
77753
78191
|
{
|
|
77754
78192
|
ref: refs.setFloating,
|
|
77755
78193
|
style: floatingStyles,
|
|
77756
78194
|
...getFloatingProps(),
|
|
77757
|
-
className:
|
|
77758
|
-
children:
|
|
77759
|
-
|
|
77760
|
-
|
|
78195
|
+
className: styles$2R.tooltip,
|
|
78196
|
+
children: /* @__PURE__ */ jsx(
|
|
78197
|
+
motion.div,
|
|
78198
|
+
{
|
|
78199
|
+
className: clsx(styles$2R.tooltipContent, className),
|
|
78200
|
+
variants,
|
|
78201
|
+
initial: shouldReduceMotion ? void 0 : "initial",
|
|
78202
|
+
animate: shouldReduceMotion ? void 0 : "animate",
|
|
78203
|
+
exit: shouldReduceMotion ? void 0 : "exit",
|
|
78204
|
+
children: label
|
|
78205
|
+
}
|
|
78206
|
+
)
|
|
78207
|
+
},
|
|
78208
|
+
"tooltip"
|
|
78209
|
+
) }) })
|
|
77761
78210
|
] });
|
|
77762
78211
|
}
|
|
77763
78212
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -77770,16 +78219,27 @@ const Tooltip = ({
|
|
|
77770
78219
|
children
|
|
77771
78220
|
}
|
|
77772
78221
|
),
|
|
77773
|
-
|
|
78222
|
+
/* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: isOpen && /* @__PURE__ */ jsx(
|
|
77774
78223
|
"div",
|
|
77775
78224
|
{
|
|
77776
78225
|
ref: refs.setFloating,
|
|
77777
78226
|
style: floatingStyles,
|
|
77778
78227
|
...getFloatingProps(),
|
|
77779
|
-
className:
|
|
77780
|
-
children:
|
|
77781
|
-
|
|
77782
|
-
|
|
78228
|
+
className: styles$2R.tooltip,
|
|
78229
|
+
children: /* @__PURE__ */ jsx(
|
|
78230
|
+
motion.div,
|
|
78231
|
+
{
|
|
78232
|
+
className: clsx(styles$2R.tooltipContent, className),
|
|
78233
|
+
variants,
|
|
78234
|
+
initial: shouldReduceMotion ? void 0 : "initial",
|
|
78235
|
+
animate: shouldReduceMotion ? void 0 : "animate",
|
|
78236
|
+
exit: shouldReduceMotion ? void 0 : "exit",
|
|
78237
|
+
children: label
|
|
78238
|
+
}
|
|
78239
|
+
)
|
|
78240
|
+
},
|
|
78241
|
+
"tooltip"
|
|
78242
|
+
) }) })
|
|
77783
78243
|
] });
|
|
77784
78244
|
};
|
|
77785
78245
|
|
|
@@ -80137,7 +80597,7 @@ const EndlessLoader = ({ container }) => {
|
|
|
80137
80597
|
return;
|
|
80138
80598
|
}
|
|
80139
80599
|
try {
|
|
80140
|
-
const GLModule = await import('./gl-
|
|
80600
|
+
const GLModule = await import('./gl-BE-pAc_o.js');
|
|
80141
80601
|
if (!isActiveRef.current) {
|
|
80142
80602
|
return;
|
|
80143
80603
|
}
|
|
@@ -86078,11 +86538,11 @@ const ScrambledText = ({ children, reveal = false }) => {
|
|
|
86078
86538
|
);
|
|
86079
86539
|
};
|
|
86080
86540
|
|
|
86081
|
-
const root$Y = "
|
|
86082
|
-
const line = "
|
|
86083
|
-
const word$1 = "
|
|
86084
|
-
const link = "
|
|
86085
|
-
const letter = "
|
|
86541
|
+
const root$Y = "_root_19h89_1";
|
|
86542
|
+
const line = "_line_19h89_9";
|
|
86543
|
+
const word$1 = "_word_19h89_14";
|
|
86544
|
+
const link = "_link_19h89_18";
|
|
86545
|
+
const letter = "_letter_19h89_22";
|
|
86086
86546
|
const styles$11 = {
|
|
86087
86547
|
root: root$Y,
|
|
86088
86548
|
line: line,
|
|
@@ -96036,7 +96496,7 @@ const Lock = () => {
|
|
|
96036
96496
|
}
|
|
96037
96497
|
};
|
|
96038
96498
|
const asynchronously = async () => {
|
|
96039
|
-
const Flickity = await import('./index-
|
|
96499
|
+
const Flickity = await import('./index-DI2YEpFt.js').then(n => n.i).then((m) => m.default);
|
|
96040
96500
|
if (!rowsRef.current || !window) return;
|
|
96041
96501
|
const rows = rowsRef.current.children;
|
|
96042
96502
|
for (let i = 0, len = rows.length; i < len; i++) {
|