@tarsis/toolkit 0.5.4 → 0.5.6

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.
@@ -1,4 +1,4 @@
1
- import { c as commonjsGlobal, a as getAugmentedNamespace, g as getDefaultExportFromCjs, W as WebGLRenderer, P as PerspectiveCamera, S as Scene, T as THREE$1, C as Clock, b as TextureLoader, R as RawShaderMaterial, D as DoubleSide, d as WebGLRenderTarget, e as Color, M as Mesh, f as TorusKnotGeometry, h as ShaderMaterial } from './index-edxXsuj9.js';
1
+ import { c as commonjsGlobal, a as getAugmentedNamespace, g as getDefaultExportFromCjs, W as WebGLRenderer, P as PerspectiveCamera, S as Scene, T as THREE$1, C as Clock, b as TextureLoader, R as RawShaderMaterial, D as DoubleSide, d as WebGLRenderTarget, e as Color, M as Mesh, f as TorusKnotGeometry, h as ShaderMaterial } from './index-DTHY_OnB.js';
2
2
 
3
3
  /*
4
4
  object-assign
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const index = require('./index-6NDqwIhT.cjs');
5
+ const index = require('./index-0YeYjJYT.cjs');
6
6
 
7
7
  /*
8
8
  object-assign
@@ -52090,28 +52090,35 @@ const styles$4H = {
52090
52090
  animate: animate$1};
52091
52091
 
52092
52092
  const BubblyParticlesButton = () => {
52093
- return /* @__PURE__ */ jsxRuntime.jsx(
52094
- "button",
52095
- {
52096
- className: styles$4H.root,
52097
- onClick: (e) => {
52098
- const button = e.currentTarget;
52093
+ const animationRef = React.useRef(null);
52094
+ const handleClick = (e) => {
52095
+ const button = e.currentTarget;
52096
+ if (animationRef.current) {
52097
+ animationRef.current.cancel();
52098
+ animationRef.current = null;
52099
+ }
52100
+ button.classList.remove(styles$4H.animate);
52101
+ requestAnimationFrame(() => {
52102
+ button.classList.add(styles$4H.animate);
52103
+ animationRef.current = button.animate([{ opacity: 1 }, { opacity: 1 }], {
52104
+ duration: 750,
52105
+ fill: "forwards",
52106
+ easing: "ease-in-out"
52107
+ });
52108
+ animationRef.current.addEventListener("finish", () => {
52099
52109
  button.classList.remove(styles$4H.animate);
52100
- button.classList.add(styles$4H.animate);
52101
- setTimeout(() => {
52102
- button.classList.remove(styles$4H.animate);
52103
- }, 700);
52104
- },
52105
- children: "Click me!"
52106
- }
52107
- );
52110
+ animationRef.current = null;
52111
+ });
52112
+ });
52113
+ };
52114
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { className: styles$4H.root, onClick: handleClick, children: "Click me!" });
52108
52115
  };
52109
52116
 
52110
- const root$4i = "_root_fbkx4_1";
52111
- const button$o = "_button_fbkx4_13";
52112
- const p$1 = "_p_fbkx4_26";
52113
- const text$z = "_text_fbkx4_26";
52114
- const effects = "_effects_fbkx4_240";
52117
+ const root$4i = "_root_1pxow_1";
52118
+ const button$o = "_button_1pxow_13";
52119
+ const p$1 = "_p_1pxow_26";
52120
+ const text$z = "_text_1pxow_26";
52121
+ const effects = "_effects_1pxow_240";
52115
52122
  const styles$4G = {
52116
52123
  root: root$4i,
52117
52124
  button: button$o,
@@ -68120,9 +68127,9 @@ const NeonButton = ({ className = "", ...rest }) => {
68120
68127
  return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", ...rest, className: clsx(styles$48.root, className), children: "Neon" });
68121
68128
  };
68122
68129
 
68123
- const root$3P = "_root_1asaw_2";
68124
- const i$6 = "_i_1asaw_22";
68125
- const text$s = "_text_1asaw_482";
68130
+ const root$3P = "_root_1u78n_2";
68131
+ const i$6 = "_i_1u78n_22";
68132
+ const text$s = "_text_1u78n_482";
68126
68133
  const styles$47 = {
68127
68134
  root: root$3P,
68128
68135
  i: i$6,
@@ -71322,7 +71329,7 @@ const styles$3j = {
71322
71329
  };
71323
71330
 
71324
71331
  const THROTTLE_DURATION = 500;
71325
- const ITEMS$2 = [
71332
+ const ITEMS$1 = [
71326
71333
  {
71327
71334
  title: "Lossless Youths",
71328
71335
  image: "https://cdn.mos.cms.futurecdn.net/dP3N4qnEZ4tCTCLq59iysd.jpg",
@@ -71356,7 +71363,7 @@ const ITEMS$2 = [
71356
71363
  ].map((item) => ({ ...item, renderKey: 0 }));
71357
71364
  const FullScreenImageCarousel = () => {
71358
71365
  const sliderRef = React.useRef(null);
71359
- const [items, setItems] = React.useState(ITEMS$2);
71366
+ const [items, setItems] = React.useState(ITEMS$1);
71360
71367
  const handlePrevClick = useWindowReady.useThrottle(() => {
71361
71368
  setItems((prev) => {
71362
71369
  const newItems = items.slice();
@@ -78141,9 +78148,9 @@ const Tooltip = ({
78141
78148
  opacity: 1,
78142
78149
  transition: {
78143
78150
  type: "spring",
78144
- stiffness: 150,
78145
- damping: 20,
78146
- mass: 1.2
78151
+ stiffness: 280,
78152
+ damping: 22,
78153
+ mass: 0.9
78147
78154
  }
78148
78155
  },
78149
78156
  exit: {
@@ -78372,16 +78379,17 @@ const widthOutput = [
78372
78379
  ];
78373
78380
  const DockMotionItem = ({
78374
78381
  children,
78375
- itemKey,
78376
78382
  mouseX,
78377
78383
  bounce = true,
78378
78384
  tooltip = null,
78385
+ tooltipOptions,
78379
78386
  mute = false,
78380
78387
  type = "button",
78381
78388
  className,
78382
78389
  onMouseEnter,
78383
78390
  ...rest
78384
78391
  }) => {
78392
+ const itemId = React.useId();
78385
78393
  const ref = React.useRef(null);
78386
78394
  const distance = useWindowReady.useMotionValue(distanceLimit);
78387
78395
  const transform = useTransform(distance, distanceInput, widthOutput);
@@ -78391,6 +78399,7 @@ const DockMotionItem = ({
78391
78399
  });
78392
78400
  const audioRef = React.useRef(null);
78393
78401
  const hover = useWindowReady.useMatchMedia("(pointer: fine)");
78402
+ const isMobile = hover === false;
78394
78403
  const [scope, animate] = useAnimate();
78395
78404
  const dynamicWidth = useTransform(
78396
78405
  size,
@@ -78458,7 +78467,7 @@ const DockMotionItem = ({
78458
78467
  }),
78459
78468
  [dynamicWidth, size]
78460
78469
  );
78461
- const resolvedKey = itemKey + type;
78470
+ const resolvedKey = itemId + type;
78462
78471
  const isInteractive = rest.use !== "div";
78463
78472
  const ContentElement = React.useMemo(() => {
78464
78473
  if (rest.use && typeof rest.use !== "string") {
@@ -78487,7 +78496,7 @@ const DockMotionItem = ({
78487
78496
  ContentElement,
78488
78497
  {
78489
78498
  ref: scope,
78490
- layoutId: itemKey,
78499
+ layoutId: itemId,
78491
78500
  className: clsx(styles$2S.item, className),
78492
78501
  onMouseEnter,
78493
78502
  style: contentStyle,
@@ -78511,11 +78520,14 @@ const DockMotionItem = ({
78511
78520
  if (audio) {
78512
78521
  audio.pause();
78513
78522
  audio.currentTime = 0;
78514
- audio.play().catch(() => {
78515
- });
78523
+ const playPromise = audio.play();
78524
+ if (playPromise && typeof playPromise.catch === "function") {
78525
+ playPromise.catch(() => {
78526
+ });
78527
+ }
78516
78528
  }
78517
78529
  }
78518
- if (isInteractive && bounce) {
78530
+ if (isInteractive && bounce && !isMobile) {
78519
78531
  animate([
78520
78532
  [scope.current, { top: -24 }, { duration: 0.3 }],
78521
78533
  [
@@ -78543,7 +78555,17 @@ const DockMotionItem = ({
78543
78555
  )
78544
78556
  }
78545
78557
  );
78546
- return tooltip ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: tooltip, placement: "top", offset: 6, children: container }) : container;
78558
+ return tooltip ? /* @__PURE__ */ jsxRuntime.jsx(
78559
+ Tooltip,
78560
+ {
78561
+ label: tooltip,
78562
+ placement: "top",
78563
+ offset: 8,
78564
+ delay: tooltipOptions?.delay ?? 0,
78565
+ animate: tooltipOptions?.animate ?? false,
78566
+ children: container
78567
+ }
78568
+ ) : container;
78547
78569
  };
78548
78570
 
78549
78571
  const originX = { originX: "center" };
@@ -78592,7 +78614,6 @@ const DockMotion$1 = ({
78592
78614
  const hasDataExternal = "data-external" in props && props["data-external"] === true;
78593
78615
  return React.cloneElement(element, {
78594
78616
  ...props,
78595
- itemKey: props.itemKey,
78596
78617
  onClick: (e) => {
78597
78618
  if (hasDataExternal) {
78598
78619
  mouseX.set(null);
@@ -80621,7 +80642,7 @@ const EndlessLoader = ({ container }) => {
80621
80642
  return;
80622
80643
  }
80623
80644
  try {
80624
- const GLModule = await Promise.resolve().then(() => require('./gl-BMhxJtUR.cjs'));
80645
+ const GLModule = await Promise.resolve().then(() => require('./gl-Bb5NStwh.cjs'));
80625
80646
  if (!isActiveRef.current) {
80626
80647
  return;
80627
80648
  }
@@ -82478,7 +82499,7 @@ const styles$1P = {
82478
82499
  icon: icon$6
82479
82500
  };
82480
82501
 
82481
- const ITEMS$1 = [
82502
+ const ITEMS = [
82482
82503
  {
82483
82504
  title: "Home",
82484
82505
  url: "https://images.unsplash.com/photo-1666091863721-54331a5db52d"
@@ -82504,7 +82525,7 @@ const CurtainRevealMenu = () => {
82504
82525
  const [toggle, setToggle] = React.useState(false);
82505
82526
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1P.root, "data-nav": toggle, children: [
82506
82527
  /* @__PURE__ */ jsxRuntime.jsx("main", { className: styles$1P.main }),
82507
- /* @__PURE__ */ jsxRuntime.jsx("nav", { className: styles$1P.nav, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1P.navLinks, children: ITEMS$1.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs("a", { className: styles$1P.navLink, href: "#", children: [
82528
+ /* @__PURE__ */ jsxRuntime.jsx("nav", { className: styles$1P.nav, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1P.navLinks, children: ITEMS.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs("a", { className: styles$1P.navLink, href: "#", children: [
82508
82529
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: styles$1P.navLinkLabel, children: item.title }),
82509
82530
  /* @__PURE__ */ jsxRuntime.jsx("img", { className: styles$1P.navLinkImage, src: item.url, alt: "" })
82510
82531
  ] }, i)) }) }),
@@ -82577,41 +82598,7 @@ const styles$1N = {
82577
82598
  };
82578
82599
 
82579
82600
  const ICON_SIZE = 32;
82580
- const ICONS = {
82581
- linkedin: "M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854V1.146zm4.943 12.248V6.169H2.542v7.225h2.401zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248-.822 0-1.359.54-1.359 1.248 0 .694.521 1.248 1.327 1.248h.016zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a5.54 5.54 0 0 1 .016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225h2.4z",
82582
- instagram: "M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z",
82583
- facebook: "M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951z",
82584
- twitter: "M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z",
82585
- youtube: "M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z"
82586
- };
82587
- const ITEMS = [
82588
- {
82589
- id: "li",
82590
- title: "LinkedIn",
82591
- icon: ICONS["linkedin"]
82592
- },
82593
- {
82594
- id: "ig",
82595
- title: "Instagram",
82596
- icon: ICONS["instagram"]
82597
- },
82598
- {
82599
- id: "fb",
82600
- title: "Facebook",
82601
- icon: ICONS["facebook"]
82602
- },
82603
- {
82604
- id: "tw",
82605
- title: "Twitter",
82606
- icon: ICONS["twitter"]
82607
- },
82608
- {
82609
- id: "yt",
82610
- title: "YouTube",
82611
- icon: ICONS["youtube"]
82612
- }
82613
- ];
82614
- const DropdownMenu = ({ value, items = ITEMS }) => {
82601
+ const DropdownMenu = ({ value, items }) => {
82615
82602
  const [iconLeft, setIconLeft] = React.useState(0);
82616
82603
  const [iconTop, setIconTop] = React.useState(0);
82617
82604
  const [rotateArrow, setRotateArrow] = React.useState(0);
@@ -82654,7 +82641,7 @@ const DropdownMenu = ({ value, items = ITEMS }) => {
82654
82641
  className: clsx(styles$1N.mainButton, styles$1N.dropdownButton),
82655
82642
  onClick: () => {
82656
82643
  const listWrapperSizes = 3.5;
82657
- const dropdownOpenHeight = 4.6 * ITEMS.length + listWrapperSizes;
82644
+ const dropdownOpenHeight = 4.6 * items.length + listWrapperSizes;
82658
82645
  dropdownHeight === 0 ? setDropdownProps(180, dropdownOpenHeight, 1) : setDropdownProps(0, 0, 0);
82659
82646
  },
82660
82647
  children: [
@@ -82694,12 +82681,12 @@ const DropdownMenu = ({ value, items = ITEMS }) => {
82694
82681
  onMouseLeave: () => {
82695
82682
  setFloatingIcon(null);
82696
82683
  },
82697
- children: ITEMS.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
82684
+ children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
82698
82685
  "li",
82699
82686
  {
82700
82687
  className: styles$1N.dropdownListItem,
82701
82688
  onMouseMove: () => {
82702
- setFloatingIcon(item.icon);
82689
+ setFloatingIcon(item.icon ?? null);
82703
82690
  },
82704
82691
  onClick: () => {
82705
82692
  setActive(item);
@@ -83231,7 +83218,7 @@ const MagnifiedNavItems = () => {
83231
83218
  return () => {
83232
83219
  window.removeEventListener("resize", debouncedUpdateGlassPos);
83233
83220
  };
83234
- }, []);
83221
+ }, [debouncedUpdateGlassPos]);
83235
83222
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1I.root, children: [
83236
83223
  /* @__PURE__ */ jsxRuntime.jsxs("svg", { display: "none", children: [
83237
83224
  /* @__PURE__ */ jsxRuntime.jsx("symbol", { id: "home", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: "12 0,24 8,24 24,16 24,16 14,8 14,8 24,0 24,0 8" }) }) }),
@@ -84669,6 +84656,7 @@ const TabBarAnimation = () => {
84669
84656
  });
84670
84657
  },
84671
84658
  onComplete: () => {
84659
+ navElement.classList.remove(styles$1z.before, styles$1z.after);
84672
84660
  gsapWithCSS.set(activeElement, {
84673
84661
  x: getOffsetLeft(buttonElement),
84674
84662
  "--active-element-show": "1"
@@ -86562,11 +86550,11 @@ const ScrambledText = ({ children, reveal = false }) => {
86562
86550
  );
86563
86551
  };
86564
86552
 
86565
- const root$Y = "_root_jg827_1";
86566
- const line = "_line_jg827_9";
86567
- const word$1 = "_word_jg827_14";
86568
- const link = "_link_jg827_18";
86569
- const letter = "_letter_jg827_22";
86553
+ const root$Y = "_root_1d8jp_1";
86554
+ const line = "_line_1d8jp_9";
86555
+ const word$1 = "_word_1d8jp_14";
86556
+ const link = "_link_1d8jp_18";
86557
+ const letter = "_letter_1d8jp_22";
86570
86558
  const styles$11 = {
86571
86559
  root: root$Y,
86572
86560
  line: line,
@@ -96520,7 +96508,7 @@ const Lock = () => {
96520
96508
  }
96521
96509
  };
96522
96510
  const asynchronously = async () => {
96523
- const Flickity = await Promise.resolve().then(() => require('./index-DoJenARH.cjs')).then(n => n.index).then((m) => m.default);
96511
+ const Flickity = await Promise.resolve().then(() => require('./index-BoOtR9fl.cjs')).then(n => n.index).then((m) => m.default);
96524
96512
  if (!rowsRef.current || !window) return;
96525
96513
  const rows = rowsRef.current.children;
96526
96514
  for (let i = 0, len = rows.length; i < len; i++) {
@@ -114392,7 +114380,7 @@ exports.HoldSubmitButton = HoldSubmitButton;
114392
114380
  exports.HoverGlowButton = HoverGlowButton;
114393
114381
  exports.HoverTile = HoverTile;
114394
114382
  exports.Hoverable3DCard = Hoverable3DCard;
114395
- exports.ITEMS = ITEMS$1;
114383
+ exports.ITEMS = ITEMS;
114396
114384
  exports.Illumination = Illumination;
114397
114385
  exports.ImageCard = ImageCard;
114398
114386
  exports.ImageClipping = ImageClipping;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index$2 = require('./index-6NDqwIhT.cjs');
3
+ const index$2 = require('./index-0YeYjJYT.cjs');
4
4
 
5
5
  function _mergeNamespaces(n, m) {
6
6
  for (var i = 0; i < m.length; i++) {