@cntyclub/ui-react 0.11.0 → 0.13.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 +1 -1
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/aurora-orb.tsx +11 -7
- package/src/components/ui/aurora-text.tsx +6 -3
- package/src/components/ui/thinking-orb.tsx +6 -0
- package/src/index.ts +1 -0
- package/src/styles.css +18 -0
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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];
|
|
@@ -1028,7 +1031,10 @@ var AuroraText = memo(function AuroraText2({
|
|
|
1028
1031
|
backgroundClip: "text",
|
|
1029
1032
|
WebkitTextFillColor: "transparent",
|
|
1030
1033
|
color: "transparent",
|
|
1031
|
-
|
|
1034
|
+
// Full `animation` inline (not the `animate-aurora` utility): the keyframe
|
|
1035
|
+
// ships in styles.css unconditionally, so the sweep runs even if the
|
|
1036
|
+
// consumer's Tailwind never generates that utility class.
|
|
1037
|
+
animation: `aurora ${10 / speed}s ease infinite`
|
|
1032
1038
|
};
|
|
1033
1039
|
return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-block", className), children: [
|
|
1034
1040
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children }),
|
|
@@ -1036,12 +1042,12 @@ var AuroraText = memo(function AuroraText2({
|
|
|
1036
1042
|
"span",
|
|
1037
1043
|
{
|
|
1038
1044
|
"aria-hidden": "true",
|
|
1039
|
-
className: "
|
|
1045
|
+
className: "pointer-events-none absolute inset-0 select-none blur-[6px] opacity-60",
|
|
1040
1046
|
style: gradientStyle,
|
|
1041
1047
|
children
|
|
1042
1048
|
}
|
|
1043
1049
|
) : null,
|
|
1044
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "
|
|
1050
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "relative", style: gradientStyle, children })
|
|
1045
1051
|
] });
|
|
1046
1052
|
});
|
|
1047
1053
|
AuroraText.displayName = "AuroraText";
|