@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cntyclub/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "React component library for the Country Club UI Kit — Base UI primitives styled with the Country Club design system (Tailwind CSS v4)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -76,13 +76,15 @@ export function AuroraOrb({
|
|
|
76
76
|
const draw = MODE_DRAWS[mode];
|
|
77
77
|
const rate = baseSpeed * speed;
|
|
78
78
|
|
|
79
|
-
const paint = (t: number) => {
|
|
79
|
+
const paint = (t: number, wall: number) => {
|
|
80
80
|
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
81
81
|
ctx.clearRect(0, 0, size, size);
|
|
82
82
|
draw(ctx, size, t, false, opts);
|
|
83
|
-
// Recolor the frame: a linear gradient across the orb, rotating
|
|
84
|
-
//
|
|
85
|
-
|
|
83
|
+
// Recolor the frame: a linear gradient across the orb, rotating so the
|
|
84
|
+
// colors drift the way AuroraText's sweep does. Driven by wall-clock
|
|
85
|
+
// (~5s per turn) rather than the preset-scaled t, so the drift stays
|
|
86
|
+
// visible even for slow presets/speeds.
|
|
87
|
+
const angle = wall * 1.2;
|
|
86
88
|
const r = size / 2;
|
|
87
89
|
const dx = Math.cos(angle) * r;
|
|
88
90
|
const dy = Math.sin(angle) * r;
|
|
@@ -98,7 +100,7 @@ export function AuroraOrb({
|
|
|
98
100
|
|
|
99
101
|
// Reduced motion: a single still frame, matching the stock component.
|
|
100
102
|
if (typeof matchMedia !== "undefined" && matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
101
|
-
paint(0.6);
|
|
103
|
+
paint(0.6, 0.6);
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
106
|
|
|
@@ -107,7 +109,8 @@ export function AuroraOrb({
|
|
|
107
109
|
let frame = 0;
|
|
108
110
|
let running = false;
|
|
109
111
|
const loop = () => {
|
|
110
|
-
|
|
112
|
+
const now = performance.now() / 1000;
|
|
113
|
+
paint(now * rate, now);
|
|
111
114
|
if (running) frame = requestAnimationFrame(loop);
|
|
112
115
|
};
|
|
113
116
|
const start = () => {
|
|
@@ -120,7 +123,8 @@ export function AuroraOrb({
|
|
|
120
123
|
cancelAnimationFrame(frame);
|
|
121
124
|
};
|
|
122
125
|
|
|
123
|
-
|
|
126
|
+
const first = performance.now() / 1000;
|
|
127
|
+
paint(first * rate, first);
|
|
124
128
|
let visible = true;
|
|
125
129
|
const observer =
|
|
126
130
|
typeof IntersectionObserver !== "undefined"
|
|
@@ -47,7 +47,10 @@ export const AuroraText = memo(function AuroraText({
|
|
|
47
47
|
backgroundClip: "text",
|
|
48
48
|
WebkitTextFillColor: "transparent",
|
|
49
49
|
color: "transparent",
|
|
50
|
-
|
|
50
|
+
// Full `animation` inline (not the `animate-aurora` utility): the keyframe
|
|
51
|
+
// ships in styles.css unconditionally, so the sweep runs even if the
|
|
52
|
+
// consumer's Tailwind never generates that utility class.
|
|
53
|
+
animation: `aurora ${10 / speed}s ease infinite`,
|
|
51
54
|
};
|
|
52
55
|
|
|
53
56
|
return (
|
|
@@ -57,13 +60,13 @@ export const AuroraText = memo(function AuroraText({
|
|
|
57
60
|
{glow ? (
|
|
58
61
|
<span
|
|
59
62
|
aria-hidden="true"
|
|
60
|
-
className="
|
|
63
|
+
className="pointer-events-none absolute inset-0 select-none blur-[6px] opacity-60"
|
|
61
64
|
style={gradientStyle}
|
|
62
65
|
>
|
|
63
66
|
{children}
|
|
64
67
|
</span>
|
|
65
68
|
) : null}
|
|
66
|
-
<span aria-hidden="true" className="
|
|
69
|
+
<span aria-hidden="true" className="relative" style={gradientStyle}>
|
|
67
70
|
{children}
|
|
68
71
|
</span>
|
|
69
72
|
</span>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Stock monochrome thinking orb — six hand-tuned dotted animations with
|
|
2
|
+
// automatic light/dark ink (data-theme / .dark class / prefers-color-scheme).
|
|
3
|
+
// Re-exported from the thinking-orbs package so kit consumers get it alongside
|
|
4
|
+
// AuroraOrb without depending on thinking-orbs directly. For the
|
|
5
|
+
// aurora-gradient recolored variant see ./aurora-orb.
|
|
6
|
+
export { ThinkingOrb, type OrbTheme, type ThinkingOrbProps } from "thinking-orbs";
|
package/src/index.ts
CHANGED
|
@@ -89,6 +89,7 @@ export * from "./components/ui/table";
|
|
|
89
89
|
export * from "./components/ui/tabs";
|
|
90
90
|
export * from "./components/ui/tag";
|
|
91
91
|
export { default as TargetCountdown } from "./components/ui/target-countdown";
|
|
92
|
+
export * from "./components/ui/thinking-orb";
|
|
92
93
|
export * from "./components/ui/timeline";
|
|
93
94
|
export * from "./components/ui/text-editor";
|
|
94
95
|
export * from "./components/ui/textarea";
|
package/src/styles.css
CHANGED
|
@@ -14,6 +14,24 @@
|
|
|
14
14
|
|
|
15
15
|
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
|
|
16
16
|
|
|
17
|
+
/*
|
|
18
|
+
* Emitted unconditionally (NOT inside @theme) so AuroraText's gradient sweep
|
|
19
|
+
* runs in every consumer — even when their Tailwind build doesn't generate the
|
|
20
|
+
* `animate-aurora` utility from the theme token (keyframes declared inside
|
|
21
|
+
* @theme are dropped unless that utility is scanned/used). AuroraText applies
|
|
22
|
+
* this keyframe via an inline `animation`, so it no longer depends on the
|
|
23
|
+
* utility class existing at all.
|
|
24
|
+
*/
|
|
25
|
+
@keyframes aurora {
|
|
26
|
+
0%,
|
|
27
|
+
100% {
|
|
28
|
+
background-position: 0% 50%;
|
|
29
|
+
}
|
|
30
|
+
50% {
|
|
31
|
+
background-position: 100% 50%;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
17
35
|
@theme inline {
|
|
18
36
|
--animate-skeleton: skeleton 2s -1s infinite linear;
|
|
19
37
|
--animate-qr-scan: qr-scan 2.6s ease-in-out infinite alternate;
|