@vvedantb/ui 0.43.0 → 0.44.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/README.md +15 -2
- package/dist/src/client.js +1 -0
- package/dist/src/composer/input-area/InputAreaEditor.js +1 -2
- package/dist/src/index.js +1 -0
- package/dist/src/marketing/ProductHeroOrbit.js +114 -0
- package/package.json +1 -1
- package/src/client.ts +2 -0
- package/src/index.ts +2 -0
- package/src/marketing/ProductHeroOrbit.tsx +48 -0
package/README.md
CHANGED
|
@@ -967,7 +967,7 @@ Actions are pill `Button`s. The only motion `ProductHero` adds is the `userCount
|
|
|
967
967
|
tagline="Each bot has its own ongoing chat and its own memory. vibot is your default bot. It sends each message to the bot that should answer."
|
|
968
968
|
primaryCta={{ label: "Try vibot free", href: "/sign-up" }}
|
|
969
969
|
signIn={{ href: "/sign-in" }}
|
|
970
|
-
visual={<
|
|
970
|
+
visual={<ProductHeroOrbit />}
|
|
971
971
|
visualLabel="Rings orbiting a bot"
|
|
972
972
|
userCount={userCount} // undefined while loading
|
|
973
973
|
/>
|
|
@@ -983,10 +983,23 @@ const V_STORE_DOWNLOAD_URL = "https://projectv.uk/download/v-store";
|
|
|
983
983
|
tagline="..."
|
|
984
984
|
primaryCta={{ label: "Try the demo", href: "#demo" }}
|
|
985
985
|
secondaryCta={{ label: "Download on V Store", href: V_STORE_DOWNLOAD_URL, rel: "nofollow" }}
|
|
986
|
-
visual={<
|
|
986
|
+
visual={<ProductHeroOrbit accent="oklch(0.75 0.15 165)" />}
|
|
987
987
|
/>
|
|
988
988
|
```
|
|
989
989
|
|
|
990
|
+
#### `ProductHeroOrbit`
|
|
991
|
+
|
|
992
|
+
The default `visual`: a glowing core with three orbit rings. Use it so a product sets a colour and does not draw its own visual.
|
|
993
|
+
Motion is CSS only and stops under `prefers-reduced-motion: reduce`.
|
|
994
|
+
|
|
995
|
+
| Prop | |
|
|
996
|
+
| --- | --- |
|
|
997
|
+
| `accent` | Any CSS colour. It tints the glow, rings and dots. Default: the foreground colour. |
|
|
998
|
+
| `children` | Optional mark in the core, for example the product logo. |
|
|
999
|
+
| `className` | Default size is `w-full max-w-sm`, square. |
|
|
1000
|
+
|
|
1001
|
+
`showProductOf` is `true` by default. Products that are not part of Project V set `showProductOf={false}`.
|
|
1002
|
+
|
|
990
1003
|
#### Feeding `userCount`
|
|
991
1004
|
|
|
992
1005
|
The package does no fetching. The app calls a Convex action that wraps the Clerk backend SDK `clerk.users.getCount()` (it needs `CLERK_SECRET_KEY` on the server), once on mount or cached server-side. Pass `undefined` while loading and the positive number when it resolves. The row stays hidden for `undefined`, `null` and values of 0 or less, so a loading `0` never flashes "0+ people".
|
package/dist/src/client.js
CHANGED
|
@@ -190,6 +190,7 @@ export { landingFooterButtonClass, landingFooterLinkClass, landingPanelClass, la
|
|
|
190
190
|
export { SITE_HEADER_WORDMARK_SIZE, SiteHeader } from "./marketing/SiteHeader.js";
|
|
191
191
|
export { PROJECT_V_LEGAL_LINKS, PROJECT_V_SOCIALS, SITE_FOOTER_WORDMARK_SIZE, SiteFooter } from "./marketing/SiteFooter.js";
|
|
192
192
|
export { ProductHero } from "./marketing/ProductHero.js";
|
|
193
|
+
export { ProductHeroOrbit } from "./marketing/ProductHeroOrbit.js";
|
|
193
194
|
export { PROJECT_V_HOME_URL } from "./marketing/projectV.js";
|
|
194
195
|
export { PricingModal, V_PRO_APP_BENEFITS } from "./marketing/PricingModal.js";
|
|
195
196
|
// App helpers: confirm skip, update watcher, settings chrome, theme, page title,
|
|
@@ -367,8 +367,7 @@ export function InputAreaEditor({
|
|
|
367
367
|
className: CHIPS_HOST_CLASS,
|
|
368
368
|
children: chips
|
|
369
369
|
})
|
|
370
|
-
}), suggestion && suggestionClassName ?
|
|
371
|
-
/*#__PURE__*/
|
|
370
|
+
}), suggestion && suggestionClassName ? /*#__PURE__*/
|
|
372
371
|
// Outside the editor, so reconciliation and the text value never see it.
|
|
373
372
|
// Zero-size, not `display: none`, so the computed colour is real.
|
|
374
373
|
_jsx("span", {
|
package/dist/src/index.js
CHANGED
|
@@ -190,6 +190,7 @@ export { landingFooterButtonClass, landingFooterLinkClass, landingPanelClass, la
|
|
|
190
190
|
export { SITE_HEADER_WORDMARK_SIZE, SiteHeader } from "./marketing/SiteHeader.js";
|
|
191
191
|
export { PROJECT_V_LEGAL_LINKS, PROJECT_V_SOCIALS, SITE_FOOTER_WORDMARK_SIZE, SiteFooter } from "./marketing/SiteFooter.js";
|
|
192
192
|
export { ProductHero } from "./marketing/ProductHero.js";
|
|
193
|
+
export { ProductHeroOrbit } from "./marketing/ProductHeroOrbit.js";
|
|
193
194
|
export { PROJECT_V_HOME_URL } from "./marketing/projectV.js";
|
|
194
195
|
export { PricingModal, V_PRO_APP_BENEFITS } from "./marketing/PricingModal.js";
|
|
195
196
|
// App helpers: confirm skip, update watcher, settings chrome, stable auth, Convex provider, VITE env and ensure-user.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { cn } from "../utils/cn.js";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
const ringClass = "absolute rounded-full border border-current/25 animate-spin motion-reduce:animate-none";
|
|
5
|
+
const dotClass = "absolute left-1/2 top-0 -translate-x-1/2 -translate-y-1/2 rounded-full bg-current";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The default concept visual for `ProductHero`: a glowing core with three orbit rings, in the
|
|
9
|
+
* style of https://projectv.uk. Pass it as `visual`. A product sets `accent` instead of drawing
|
|
10
|
+
* its own visual.
|
|
11
|
+
*
|
|
12
|
+
* All motion is CSS (`animate-spin`, `animate-pulse`) and stops under `prefers-reduced-motion: reduce`.
|
|
13
|
+
* Each ring has a fixed start angle, so the still version does not stack the dots.
|
|
14
|
+
*/
|
|
15
|
+
export function ProductHeroOrbit(t0) {
|
|
16
|
+
const $ = _c(16);
|
|
17
|
+
const {
|
|
18
|
+
accent,
|
|
19
|
+
children,
|
|
20
|
+
className
|
|
21
|
+
} = t0;
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[0] !== className) {
|
|
24
|
+
t1 = cn("relative aspect-square w-full max-w-sm text-foreground", className);
|
|
25
|
+
$[0] = className;
|
|
26
|
+
$[1] = t1;
|
|
27
|
+
} else {
|
|
28
|
+
t1 = $[1];
|
|
29
|
+
}
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[2] !== accent) {
|
|
32
|
+
t2 = accent === undefined ? undefined : {
|
|
33
|
+
color: accent
|
|
34
|
+
};
|
|
35
|
+
$[2] = accent;
|
|
36
|
+
$[3] = t2;
|
|
37
|
+
} else {
|
|
38
|
+
t2 = $[3];
|
|
39
|
+
}
|
|
40
|
+
let t3;
|
|
41
|
+
let t4;
|
|
42
|
+
let t5;
|
|
43
|
+
let t6;
|
|
44
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
45
|
+
t3 = /*#__PURE__*/_jsx("span", {
|
|
46
|
+
className: "absolute inset-[24%] rounded-full bg-current/30 blur-2xl animate-pulse [animation-duration:5s] motion-reduce:animate-none"
|
|
47
|
+
});
|
|
48
|
+
t4 = /*#__PURE__*/_jsx("span", {
|
|
49
|
+
className: cn(ringClass, "inset-[2%] border-dashed rotate-[130deg] [animation-duration:48s]"),
|
|
50
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
51
|
+
className: cn(dotClass, "size-2 opacity-60")
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
t5 = /*#__PURE__*/_jsx("span", {
|
|
55
|
+
className: cn(ringClass, "inset-[15%] rotate-[250deg] [animation-direction:reverse] [animation-duration:30s]"),
|
|
56
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
57
|
+
className: cn(dotClass, "size-2.5 opacity-80")
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
t6 = /*#__PURE__*/_jsx("span", {
|
|
61
|
+
className: cn(ringClass, "inset-[29%] border-current/40 rotate-[40deg] [animation-duration:16s]"),
|
|
62
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
63
|
+
className: cn(dotClass, "size-3")
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
$[4] = t3;
|
|
67
|
+
$[5] = t4;
|
|
68
|
+
$[6] = t5;
|
|
69
|
+
$[7] = t6;
|
|
70
|
+
} else {
|
|
71
|
+
t3 = $[4];
|
|
72
|
+
t4 = $[5];
|
|
73
|
+
t5 = $[6];
|
|
74
|
+
t6 = $[7];
|
|
75
|
+
}
|
|
76
|
+
let t7;
|
|
77
|
+
if ($[8] !== children) {
|
|
78
|
+
t7 = children ? /*#__PURE__*/_jsx("span", {
|
|
79
|
+
className: "flex items-center justify-center text-foreground",
|
|
80
|
+
children: children
|
|
81
|
+
}) : null;
|
|
82
|
+
$[8] = children;
|
|
83
|
+
$[9] = t7;
|
|
84
|
+
} else {
|
|
85
|
+
t7 = $[9];
|
|
86
|
+
}
|
|
87
|
+
let t8;
|
|
88
|
+
if ($[10] !== t7) {
|
|
89
|
+
t8 = /*#__PURE__*/_jsx("span", {
|
|
90
|
+
className: "absolute inset-[40%] flex items-center justify-center rounded-full bg-current/15 ring-1 ring-current/40 shadow-[0_0_48px_8px] shadow-current/30",
|
|
91
|
+
children: t7
|
|
92
|
+
});
|
|
93
|
+
$[10] = t7;
|
|
94
|
+
$[11] = t8;
|
|
95
|
+
} else {
|
|
96
|
+
t8 = $[11];
|
|
97
|
+
}
|
|
98
|
+
let t9;
|
|
99
|
+
if ($[12] !== t1 || $[13] !== t2 || $[14] !== t8) {
|
|
100
|
+
t9 = /*#__PURE__*/_jsxs("div", {
|
|
101
|
+
"data-testid": "product-hero-orbit",
|
|
102
|
+
className: t1,
|
|
103
|
+
style: t2,
|
|
104
|
+
children: [t3, t4, t5, t6, t8]
|
|
105
|
+
});
|
|
106
|
+
$[12] = t1;
|
|
107
|
+
$[13] = t2;
|
|
108
|
+
$[14] = t8;
|
|
109
|
+
$[15] = t9;
|
|
110
|
+
} else {
|
|
111
|
+
t9 = $[15];
|
|
112
|
+
}
|
|
113
|
+
return t9;
|
|
114
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvedantb/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared React 19 UI for web apps: one main JavaScript entry (primitives, shell pieces, app helpers including the Convex and Clerk provider, VITE env parsing and ensure-user, artifact viewers over the @vvedantb/server artifacts core, native tokens), third-party brand logos (also @vvedantb/ui/logos), motion-driven animated SVG icons (@vvedantb/ui/icons/animated), a client entry without @vvedantb/server, convex or Clerk for Chrome extensions, design-token CSS, shared Tailwind v4 CSS, a Tailwind preset and packaged Instrument Sans fonts.",
|
|
6
6
|
"type": "module",
|
package/src/client.ts
CHANGED
|
@@ -335,6 +335,8 @@ export type {
|
|
|
335
335
|
} from "./marketing/SiteFooter";
|
|
336
336
|
export { ProductHero } from "./marketing/ProductHero";
|
|
337
337
|
export type { ProductHeroAction, ProductHeroProps } from "./marketing/ProductHero";
|
|
338
|
+
export { ProductHeroOrbit } from "./marketing/ProductHeroOrbit";
|
|
339
|
+
export type { ProductHeroOrbitProps } from "./marketing/ProductHeroOrbit";
|
|
338
340
|
export { PROJECT_V_HOME_URL } from "./marketing/projectV";
|
|
339
341
|
export { PricingModal, V_PRO_APP_BENEFITS } from "./marketing/PricingModal";
|
|
340
342
|
export type {
|
package/src/index.ts
CHANGED
|
@@ -335,6 +335,8 @@ export type {
|
|
|
335
335
|
} from "./marketing/SiteFooter";
|
|
336
336
|
export { ProductHero } from "./marketing/ProductHero";
|
|
337
337
|
export type { ProductHeroAction, ProductHeroProps } from "./marketing/ProductHero";
|
|
338
|
+
export { ProductHeroOrbit } from "./marketing/ProductHeroOrbit";
|
|
339
|
+
export type { ProductHeroOrbitProps } from "./marketing/ProductHeroOrbit";
|
|
338
340
|
export { PROJECT_V_HOME_URL } from "./marketing/projectV";
|
|
339
341
|
export { PricingModal, V_PRO_APP_BENEFITS } from "./marketing/PricingModal";
|
|
340
342
|
export type {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
export type ProductHeroOrbitProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Any CSS colour. It tints the glow, the rings and the dots, so each product gets its own
|
|
7
|
+
* hue from one drawing. Default: the foreground colour.
|
|
8
|
+
*/
|
|
9
|
+
accent?: string;
|
|
10
|
+
/** Optional mark in the core, for example the product logo. It is centred and keeps the foreground colour. */
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const ringClass = "absolute rounded-full border border-current/25 animate-spin motion-reduce:animate-none";
|
|
16
|
+
const dotClass = "absolute left-1/2 top-0 -translate-x-1/2 -translate-y-1/2 rounded-full bg-current";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The default concept visual for `ProductHero`: a glowing core with three orbit rings, in the
|
|
20
|
+
* style of https://projectv.uk. Pass it as `visual`. A product sets `accent` instead of drawing
|
|
21
|
+
* its own visual.
|
|
22
|
+
*
|
|
23
|
+
* All motion is CSS (`animate-spin`, `animate-pulse`) and stops under `prefers-reduced-motion: reduce`.
|
|
24
|
+
* Each ring has a fixed start angle, so the still version does not stack the dots.
|
|
25
|
+
*/
|
|
26
|
+
export function ProductHeroOrbit({ accent, children, className }: ProductHeroOrbitProps) {
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
data-testid="product-hero-orbit"
|
|
30
|
+
className={cn("relative aspect-square w-full max-w-sm text-foreground", className)}
|
|
31
|
+
style={accent === undefined ? undefined : { color: accent }}
|
|
32
|
+
>
|
|
33
|
+
<span className="absolute inset-[24%] rounded-full bg-current/30 blur-2xl animate-pulse [animation-duration:5s] motion-reduce:animate-none" />
|
|
34
|
+
<span className={cn(ringClass, "inset-[2%] border-dashed rotate-[130deg] [animation-duration:48s]")}>
|
|
35
|
+
<span className={cn(dotClass, "size-2 opacity-60")} />
|
|
36
|
+
</span>
|
|
37
|
+
<span className={cn(ringClass, "inset-[15%] rotate-[250deg] [animation-direction:reverse] [animation-duration:30s]")}>
|
|
38
|
+
<span className={cn(dotClass, "size-2.5 opacity-80")} />
|
|
39
|
+
</span>
|
|
40
|
+
<span className={cn(ringClass, "inset-[29%] border-current/40 rotate-[40deg] [animation-duration:16s]")}>
|
|
41
|
+
<span className={cn(dotClass, "size-3")} />
|
|
42
|
+
</span>
|
|
43
|
+
<span className="absolute inset-[40%] flex items-center justify-center rounded-full bg-current/15 ring-1 ring-current/40 shadow-[0_0_48px_8px] shadow-current/30">
|
|
44
|
+
{children ? <span className="flex items-center justify-center text-foreground">{children}</span> : null}
|
|
45
|
+
</span>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|