@cntyclub/ui-react 0.11.0 → 0.12.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/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import * as _base_ui_react from '@base-ui/react';
7
7
  import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
8
8
  import { useRender } from '@base-ui/react/use-render';
9
9
  import { OrbState, OrbSize } from 'thinking-orbs';
10
- export { OrbSize, OrbState } from 'thinking-orbs';
10
+ export { OrbSize, OrbState, OrbTheme, ThinkingOrb, ThinkingOrbProps } from 'thinking-orbs';
11
11
  import { Autocomplete as Autocomplete$1 } from '@base-ui/react/autocomplete';
12
12
  import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
13
13
  import { B as Button, a as ButtonProps, b as InputProps, I as Input } from './input-JCZs61MO.js';
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ import { flushSync } from 'react-dom';
11
11
  import { mergeProps } from '@base-ui/react/merge-props';
12
12
  import { useRender } from '@base-ui/react/use-render';
13
13
  import { resolvePreset, MODE_DRAWS } from 'thinking-orbs';
14
+ export { ThinkingOrb } from 'thinking-orbs';
14
15
  import { Autocomplete as Autocomplete$1 } from '@base-ui/react/autocomplete';
15
16
  import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
16
17
  import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
@@ -943,11 +944,11 @@ function AuroraOrb({
943
944
  const { mode, speed: baseSpeed, opts } = resolvePreset(state, size);
944
945
  const draw = MODE_DRAWS[mode];
945
946
  const rate = baseSpeed * speed;
946
- const paint = (t) => {
947
+ const paint = (t, wall) => {
947
948
  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
948
949
  ctx.clearRect(0, 0, size, size);
949
950
  draw(ctx, size, t, false, opts);
950
- const angle = t * 0.5;
951
+ const angle = wall * 1.2;
951
952
  const r = size / 2;
952
953
  const dx = Math.cos(angle) * r;
953
954
  const dy = Math.sin(angle) * r;
@@ -961,13 +962,14 @@ function AuroraOrb({
961
962
  ctx.globalCompositeOperation = "source-over";
962
963
  };
963
964
  if (typeof matchMedia !== "undefined" && matchMedia("(prefers-reduced-motion: reduce)").matches) {
964
- paint(0.6);
965
+ paint(0.6, 0.6);
965
966
  return;
966
967
  }
967
968
  let frame = 0;
968
969
  let running = false;
969
970
  const loop = () => {
970
- paint(performance.now() / 1e3 * rate);
971
+ const now = performance.now() / 1e3;
972
+ paint(now * rate, now);
971
973
  if (running) frame = requestAnimationFrame(loop);
972
974
  };
973
975
  const start = () => {
@@ -979,7 +981,8 @@ function AuroraOrb({
979
981
  running = false;
980
982
  cancelAnimationFrame(frame);
981
983
  };
982
- paint(performance.now() / 1e3 * rate);
984
+ const first = performance.now() / 1e3;
985
+ paint(first * rate, first);
983
986
  let visible = true;
984
987
  const observer = typeof IntersectionObserver !== "undefined" ? new IntersectionObserver((entries) => {
985
988
  const entry = entries[0];