@vvedantb/ui 0.62.1 → 0.63.1
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/app/src/settings/SettingsPage.tsx +1 -1
- package/app/src/settings/SettingsSection.tsx +1 -1
- package/app/src/settings/ThemeModePicker.tsx +10 -2
- package/dist/app/src/settings/SettingsPage.js +1 -1
- package/dist/app/src/settings/SettingsSection.js +1 -1
- package/dist/app/src/settings/ThemeModePicker.js +11 -5
- package/dist/shell/src/PageHeaderBar.js +391 -175
- package/dist/shell/src/PageWrapper.js +159 -103
- package/dist/shell/src/SidePanelTabs.js +7 -5
- package/dist/shell/src/SidebarChrome.js +1 -1
- package/dist/shell/src/SidebarPanel.js +1 -1
- package/dist/shell/src/SidebarResize.js +2 -2
- package/dist/shell/src/SidebarUpgradeCard.js +1 -1
- package/dist/shell/src/app-shell-classes.js +1 -1
- package/dist/src/ai-elements/activity-question.js +2 -2
- package/dist/src/ai-elements/message.js +2 -2
- package/dist/src/ai-elements/model-picker-content.js +1 -1
- package/dist/src/ai-elements/model-picker.js +1 -1
- package/dist/src/ai-elements/prompt-input.js +1 -1
- package/dist/src/client.js +1 -1
- package/dist/src/generative-ui/content.js +3 -3
- package/dist/src/generative-ui/layout.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/kibo/kanban.js +1 -1
- package/dist/src/kibo/list.js +1 -1
- package/dist/src/kibo/video-player.js +0 -1
- package/dist/src/marketing/ProductHeroOrbit.js +26 -32
- package/dist/src/marketing/createLandingKit.js +1 -1
- package/dist/src/marketing/landing.js +1 -1
- package/dist/src/motion/dock-motion.js +36 -16
- package/dist/src/ui/_menu-classes.alt.js +1 -1
- package/dist/src/ui/_menu-classes.js +1 -1
- package/dist/src/ui/bulk-action-bar.js +1 -1
- package/dist/src/ui/calendar.js +1 -1
- package/dist/src/ui/card.js +1 -1
- package/dist/src/ui/clear-input.js +33 -46
- package/dist/src/ui/clearInputDissolve.js +2 -57
- package/dist/src/ui/command.js +3 -3
- package/dist/src/ui/count-pop.js +1 -1
- package/dist/src/ui/dialog.js +1 -1
- package/dist/src/ui/media-preview.js +1 -1
- package/dist/src/ui/progress.js +1 -1
- package/dist/src/ui/radix-select.js +1 -1
- package/dist/src/ui/select.js +1 -1
- package/dist/src/ui/table.js +1 -1
- package/dist/tokens/src/css/clear-input.css +4 -19
- package/package.json +1 -1
- package/shell/src/PageHeaderBar.tsx +162 -21
- package/shell/src/PageWrapper.tsx +116 -33
- package/shell/src/SidePanelTabs.tsx +7 -5
- package/shell/src/SidebarChrome.tsx +1 -1
- package/shell/src/SidebarPanel.tsx +1 -1
- package/shell/src/SidebarResize.tsx +2 -2
- package/shell/src/SidebarUpgradeCard.tsx +1 -1
- package/shell/src/app-shell-classes.ts +1 -1
- package/src/ai-elements/activity-question.tsx +2 -2
- package/src/ai-elements/message.tsx +3 -3
- package/src/ai-elements/model-picker-content.tsx +1 -1
- package/src/ai-elements/model-picker.tsx +1 -1
- package/src/ai-elements/prompt-input.tsx +1 -1
- package/src/client.ts +1 -1
- package/src/generative-ui/content.tsx +3 -3
- package/src/generative-ui/layout.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/kibo/kanban.tsx +1 -1
- package/src/kibo/list.tsx +1 -1
- package/src/kibo/video-player.tsx +0 -2
- package/src/marketing/ProductHeroOrbit.tsx +3 -4
- package/src/marketing/createLandingKit.tsx +1 -1
- package/src/marketing/landing.tsx +1 -1
- package/src/motion/dock-motion.ts +30 -13
- package/src/ui/_menu-classes.alt.ts +1 -1
- package/src/ui/_menu-classes.ts +1 -1
- package/src/ui/bulk-action-bar.tsx +1 -1
- package/src/ui/calendar.tsx +1 -1
- package/src/ui/card.tsx +1 -1
- package/src/ui/clear-input.tsx +1 -5
- package/src/ui/clearInputDissolve.ts +2 -85
- package/src/ui/command.tsx +3 -3
- package/src/ui/count-pop.tsx +1 -1
- package/src/ui/dialog.tsx +1 -1
- package/src/ui/media-preview.tsx +1 -1
- package/src/ui/progress.tsx +1 -1
- package/src/ui/radix-select.tsx +1 -1
- package/src/ui/select.tsx +1 -1
- package/src/ui/table.tsx +1 -1
- package/tokens/examples/tokens-moved/Fixture.tsx +1 -1
- package/tokens/src/css/clear-input.css +4 -19
|
@@ -21,7 +21,7 @@ export interface ActivityQuestionCardConfig {
|
|
|
21
21
|
const OPTION_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
22
22
|
|
|
23
23
|
const CHIP_CLASS =
|
|
24
|
-
"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-md text-3xs font-
|
|
24
|
+
"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-md text-3xs font-medium tracking-wide";
|
|
25
25
|
|
|
26
26
|
function OptionRow({
|
|
27
27
|
chip,
|
|
@@ -112,7 +112,7 @@ export function ActivityQuestionCard({
|
|
|
112
112
|
{question.header ? (
|
|
113
113
|
<Badge
|
|
114
114
|
variant="secondary"
|
|
115
|
-
className="shrink-0 text-3xs font-
|
|
115
|
+
className="shrink-0 text-3xs font-medium"
|
|
116
116
|
>
|
|
117
117
|
{question.header}
|
|
118
118
|
</Badge>
|
|
@@ -61,7 +61,7 @@ export type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
61
61
|
actions?: MessageMenuAction[];
|
|
62
62
|
/**
|
|
63
63
|
* The target of a quote click: a soft primary wash and ring. Set it back to
|
|
64
|
-
* `false` about 1.5 seconds later and it fades out (`duration-
|
|
64
|
+
* `false` about 1.5 seconds later and it fades out (`duration-200`). Sets
|
|
65
65
|
* `data-highlighted`.
|
|
66
66
|
*/
|
|
67
67
|
highlighted?: boolean;
|
|
@@ -85,7 +85,7 @@ export const Message = ({
|
|
|
85
85
|
? (classes?.user ?? "is-user ml-auto justify-end")
|
|
86
86
|
: (classes?.assistant ?? "is-assistant"),
|
|
87
87
|
highlighted !== undefined &&
|
|
88
|
-
"rounded-xl transition-[background-color,box-shadow] duration-
|
|
88
|
+
"rounded-xl transition-[background-color,box-shadow] duration-200",
|
|
89
89
|
highlighted && "bg-primary/10 ring-2 ring-primary/30",
|
|
90
90
|
className,
|
|
91
91
|
)}
|
|
@@ -229,7 +229,7 @@ export const MessageQuote = ({
|
|
|
229
229
|
const merge = useCn();
|
|
230
230
|
const body = (
|
|
231
231
|
<>
|
|
232
|
-
<span className="block truncate text-xs font-
|
|
232
|
+
<span className="block truncate text-xs font-medium opacity-70">
|
|
233
233
|
{author}
|
|
234
234
|
</span>
|
|
235
235
|
<span className="line-clamp-2 block text-sm opacity-90">{text}</span>
|
|
@@ -98,7 +98,7 @@ function InstanceIcon({
|
|
|
98
98
|
<ProviderIcon provider={instance.provider} size={size} />
|
|
99
99
|
{showBadge ? (
|
|
100
100
|
<span
|
|
101
|
-
className="pointer-events-none absolute -right-0.5 -bottom-0.5 z-10 flex h-3 min-w-3 items-center justify-center rounded-full bg-surface-secondary px-0.5 text-[7px] font-
|
|
101
|
+
className="pointer-events-none absolute -right-0.5 -bottom-0.5 z-10 flex h-3 min-w-3 items-center justify-center rounded-full bg-surface-secondary px-0.5 text-[7px] font-medium leading-none text-muted-foreground"
|
|
102
102
|
style={{
|
|
103
103
|
boxShadow: `0 0 0 1.5px ${ring}`,
|
|
104
104
|
}}
|
|
@@ -220,7 +220,7 @@ export function ModelPicker<TModel extends string>({
|
|
|
220
220
|
size={14}
|
|
221
221
|
/>
|
|
222
222
|
<span
|
|
223
|
-
className="pointer-events-none absolute -right-0.5 -bottom-0.5 z-10 flex h-3 min-w-3 items-center justify-center rounded-full bg-surface-secondary px-0.5 text-[7px] font-
|
|
223
|
+
className="pointer-events-none absolute -right-0.5 -bottom-0.5 z-10 flex h-3 min-w-3 items-center justify-center rounded-full bg-surface-secondary px-0.5 text-[7px] font-medium leading-none text-muted-foreground"
|
|
224
224
|
style={{
|
|
225
225
|
boxShadow: `0 0 0 1.5px ${config?.badgeRing?.trigger ?? "var(--color-border)"}`,
|
|
226
226
|
}}
|
|
@@ -855,7 +855,7 @@ export const ReplyQuoteChip = ({
|
|
|
855
855
|
className="w-0.5 shrink-0 self-stretch rounded-full bg-primary"
|
|
856
856
|
/>
|
|
857
857
|
<div className="min-w-0 flex-1">
|
|
858
|
-
<span className="block truncate text-xs font-
|
|
858
|
+
<span className="block truncate text-xs font-medium text-muted-foreground">
|
|
859
859
|
{author}
|
|
860
860
|
</span>
|
|
861
861
|
<span className="line-clamp-2 block text-foreground">{text}</span>
|
package/src/client.ts
CHANGED
|
@@ -19,7 +19,7 @@ const TEXT_VARIANT = {
|
|
|
19
19
|
|
|
20
20
|
export function HeadingElement({ element }: ComponentRenderProps<GenerativeUiProps<"Heading">>) {
|
|
21
21
|
const { text, level } = element.props;
|
|
22
|
-
return <p className={cn("font-
|
|
22
|
+
return <p className={cn("font-medium text-foreground", level === "h2" ? "text-base" : "text-sm")}>{text}</p>;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export function TextElement({ element }: ComponentRenderProps<GenerativeUiProps<"Text">>) {
|
|
@@ -31,7 +31,7 @@ export function MetricElement({ element }: ComponentRenderProps<GenerativeUiProp
|
|
|
31
31
|
return (
|
|
32
32
|
<div className="flex min-w-0 flex-col gap-0.5">
|
|
33
33
|
<span className="text-xs text-muted-foreground">{label}</span>
|
|
34
|
-
<span className={cn("text-lg font-
|
|
34
|
+
<span className={cn("text-lg font-medium tabular-nums leading-tight", TONE_TEXT[tone])}>{value}</span>
|
|
35
35
|
{delta ? <span className="text-2xs text-muted-foreground">{delta}</span> : null}
|
|
36
36
|
</div>
|
|
37
37
|
);
|
|
@@ -45,7 +45,7 @@ export function CalloutElement({ element }: ComponentRenderProps<GenerativeUiPro
|
|
|
45
45
|
const { title, text, tone } = element.props;
|
|
46
46
|
return (
|
|
47
47
|
<div className={cn("flex min-w-0 flex-col gap-1 rounded-surface p-3", TONE_SURFACE[tone])}>
|
|
48
|
-
{title ? <span className={cn("text-xs font-
|
|
48
|
+
{title ? <span className={cn("text-xs font-medium", TONE_TEXT[tone])}>{title}</span> : null}
|
|
49
49
|
<span className="wrap-anywhere text-sm text-foreground">{text}</span>
|
|
50
50
|
</div>
|
|
51
51
|
);
|
|
@@ -39,7 +39,7 @@ export function PanelElement({ element, children }: ComponentRenderProps<Generat
|
|
|
39
39
|
const { title, description } = element.props;
|
|
40
40
|
return (
|
|
41
41
|
<Surface density="tight" className="flex min-w-0 flex-col gap-2 bg-surface-secondary">
|
|
42
|
-
{title ? <p className="text-sm font-
|
|
42
|
+
{title ? <p className="text-sm font-medium text-foreground">{title}</p> : null}
|
|
43
43
|
{description ? <p className="text-xs text-muted-foreground">{description}</p> : null}
|
|
44
44
|
{children}
|
|
45
45
|
</Surface>
|
package/src/index.ts
CHANGED
package/src/kibo/kanban.tsx
CHANGED
|
@@ -231,7 +231,7 @@ export type KanbanHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
|
231
231
|
|
|
232
232
|
export const KanbanHeader = ({ className, ...props }: KanbanHeaderProps) => {
|
|
233
233
|
const merge = useCn();
|
|
234
|
-
return <div className={merge("m-0 p-2 font-
|
|
234
|
+
return <div className={merge("m-0 p-2 font-medium text-sm", className)} {...props} />;
|
|
235
235
|
};
|
|
236
236
|
|
|
237
237
|
// --- KanbanProvider: DnD context + Kanban context + a11y ---
|
package/src/kibo/list.tsx
CHANGED
|
@@ -51,7 +51,7 @@ export const SortableListHeader = (props: SortableListHeaderProps) => {
|
|
|
51
51
|
className="h-2 w-2 rounded-full"
|
|
52
52
|
style={{ backgroundColor: props.color }}
|
|
53
53
|
/>
|
|
54
|
-
<p className="m-0 font-
|
|
54
|
+
<p className="m-0 font-medium text-sm">{props.name}</p>
|
|
55
55
|
</div>
|
|
56
56
|
);
|
|
57
57
|
};
|
|
@@ -49,8 +49,6 @@ const variables: Record<string, string> = {
|
|
|
49
49
|
"--media-range-thumb-background": "rgb(255 255 255 / 0.95)",
|
|
50
50
|
"--media-tooltip-background-color": "rgb(24 24 27 / 0.98)",
|
|
51
51
|
"--media-tooltip-arrow-color": "rgb(24 24 27 / 0.98)",
|
|
52
|
-
"--media-tooltip-filter":
|
|
53
|
-
"drop-shadow(0 6px 16px rgb(0 0 0 / 0.55)) drop-shadow(0 1px 2px rgb(0 0 0 / 0.4))",
|
|
54
52
|
"--media-tooltip-distance": "10px",
|
|
55
53
|
"--media-tooltip-border-radius": "6px",
|
|
56
54
|
};
|
|
@@ -3,7 +3,7 @@ import { cn } from "../utils/cn";
|
|
|
3
3
|
|
|
4
4
|
export type ProductHeroOrbitProps = {
|
|
5
5
|
/**
|
|
6
|
-
* Any CSS colour. It tints the
|
|
6
|
+
* Any CSS colour. It tints the rings and the dots, so each product gets its own
|
|
7
7
|
* hue from one drawing. Default: the foreground colour.
|
|
8
8
|
*/
|
|
9
9
|
accent?: string;
|
|
@@ -16,7 +16,7 @@ const ringClass = "absolute rounded-full border border-current/25 animate-spin m
|
|
|
16
16
|
const dotClass = "absolute left-1/2 top-0 -translate-x-1/2 -translate-y-1/2 rounded-full bg-current";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* The default concept visual for `ProductHero`: a
|
|
19
|
+
* The default concept visual for `ProductHero`: a core with three orbit rings, in the
|
|
20
20
|
* style of https://projectv.uk. Pass it as `visual`. A product sets `accent` instead of drawing
|
|
21
21
|
* its own visual.
|
|
22
22
|
*
|
|
@@ -30,7 +30,6 @@ export function ProductHeroOrbit({ accent, children, className }: ProductHeroOrb
|
|
|
30
30
|
className={cn("relative aspect-square w-full max-w-sm text-foreground", className)}
|
|
31
31
|
style={accent === undefined ? undefined : { color: accent }}
|
|
32
32
|
>
|
|
33
|
-
<span className="absolute inset-[24%] rounded-full bg-current/30 blur-2xl animate-pulse [animation-duration:5s] motion-reduce:animate-none" />
|
|
34
33
|
<span className={cn(ringClass, "inset-[2%] border-dashed rotate-[130deg] [animation-duration:48s]")}>
|
|
35
34
|
<span className={cn(dotClass, "size-2 opacity-60")} />
|
|
36
35
|
</span>
|
|
@@ -40,7 +39,7 @@ export function ProductHeroOrbit({ accent, children, className }: ProductHeroOrb
|
|
|
40
39
|
<span className={cn(ringClass, "inset-[29%] border-current/40 rotate-[40deg] [animation-duration:16s]")}>
|
|
41
40
|
<span className={cn(dotClass, "size-3")} />
|
|
42
41
|
</span>
|
|
43
|
-
<span className="absolute inset-[40%] flex items-center justify-center rounded-full bg-current/15 ring-1 ring-current/40
|
|
42
|
+
<span className="absolute inset-[40%] flex items-center justify-center rounded-full bg-current/15 ring-1 ring-current/40">
|
|
44
43
|
{children ? <span className="flex items-center justify-center text-foreground">{children}</span> : null}
|
|
45
44
|
</span>
|
|
46
45
|
</div>
|
|
@@ -131,7 +131,7 @@ export function createLandingKit({ motion }: LandingKitOptions): LandingKit {
|
|
|
131
131
|
<div className="landing-atmosphere landing-grain relative overflow-hidden border-t border-separator">
|
|
132
132
|
<section className={`${landingShellClass} relative z-10 py-20 sm:py-28`}>
|
|
133
133
|
<LandingReveal className="flex flex-col items-center text-center">
|
|
134
|
-
<h2 className="max-w-2xl text-balance font-
|
|
134
|
+
<h2 className="max-w-2xl text-balance font-medium text-3xl leading-[1.1] tracking-[-0.03em] text-foreground sm:text-5xl">
|
|
135
135
|
{title}
|
|
136
136
|
</h2>
|
|
137
137
|
<p className={landingClasses.ctaDescription}>{description}</p>
|
|
@@ -57,7 +57,7 @@ export function LandingSectionHeading({ eyebrow, heading, intro, className }: La
|
|
|
57
57
|
return (
|
|
58
58
|
<div className={cn("max-w-2xl", className)}>
|
|
59
59
|
<p className={landingClasses.eyebrow}>{eyebrow}</p>
|
|
60
|
-
<h2 className="text-balance font-
|
|
60
|
+
<h2 className="text-balance font-medium text-3xl leading-[1.08] tracking-[-0.03em] text-foreground sm:text-5xl">
|
|
61
61
|
{heading}
|
|
62
62
|
</h2>
|
|
63
63
|
{intro ? <p className={landingClasses.sectionIntro}>{intro}</p> : null}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dock motion for a panel that docks into a rail tile: it grows out of the
|
|
3
|
-
* tile when shown, shrinks back into it when hidden, and
|
|
4
|
-
* tile it belongs to changes. The Web Animations API drives it: the motions
|
|
3
|
+
* tile when shown, shrinks back into it when hidden, and its content slides
|
|
4
|
+
* in when the tile it belongs to changes. The Web Animations API drives it: the motions
|
|
5
5
|
* are one-shot and imperative, and a hide has to finish before the caller
|
|
6
6
|
* removes the panel.
|
|
7
7
|
*
|
|
@@ -18,7 +18,9 @@ export type DockEdge = "left" | "right";
|
|
|
18
18
|
const DOCKED_SCALE = 0.12;
|
|
19
19
|
const POP_IN_MS = 380;
|
|
20
20
|
const POP_OUT_MS = 260;
|
|
21
|
-
const SWITCH_MS =
|
|
21
|
+
const SWITCH_MS = 240;
|
|
22
|
+
/* The tab-switch slide: the rail page switch and tab content use 24-32px. */
|
|
23
|
+
const SWITCH_SLIDE_PX = 24;
|
|
22
24
|
/* Out-quint: fast start, long settle. The panel lands rather than stops. */
|
|
23
25
|
const SETTLE_EASE = "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
24
26
|
/* In-cubic: accelerates into the tile, as a minimise does. */
|
|
@@ -91,17 +93,32 @@ export function dockPopIn(panel: HTMLElement, tile: HTMLElement | null, edge: Do
|
|
|
91
93
|
after?.animate([{ opacity: 0 }, { opacity: 0, offset: 0.6 }, { opacity: 1 }], { duration: POP_IN_MS });
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
/**
|
|
97
|
+
* The tile changed with the panel shown: the panel's content slides in from
|
|
98
|
+
* the side of the new tile, as tab content does (`TabsTransition`). A tile
|
|
99
|
+
* below the old one brings the content up from below; on a horizontal strip,
|
|
100
|
+
* a tile to the right brings it in from the right. The panel itself stays put,
|
|
101
|
+
* so its edges and arrow do not move. Enter only: the caller has already
|
|
102
|
+
* hidden the old content.
|
|
103
|
+
*/
|
|
104
|
+
export function dockSwitch(panel: HTMLElement, from: Element | null, to: Element | null) {
|
|
105
|
+
if (!from?.isConnected || !to || dockMotionOff() || typeof panel.animate !== "function") return;
|
|
106
|
+
if (panel.getBoundingClientRect().height === 0) return;
|
|
107
|
+
const a = from.getBoundingClientRect();
|
|
108
|
+
const b = to.getBoundingClientRect();
|
|
109
|
+
const dx = b.left - a.left;
|
|
110
|
+
const dy = b.top - a.top;
|
|
111
|
+
if (dx === 0 && dy === 0) return;
|
|
112
|
+
const vertical = Math.abs(dy) >= Math.abs(dx);
|
|
113
|
+
const sign = (vertical ? dy : dx) > 0 ? 1 : -1;
|
|
114
|
+
const offset = `translate${vertical ? "Y" : "X"}(${sign * SWITCH_SLIDE_PX}px)`;
|
|
97
115
|
panel.dispatchEvent(new DockMotionEvent(SWITCH_MS));
|
|
98
|
-
panel.
|
|
99
|
-
[
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
);
|
|
116
|
+
for (const child of panel.children) {
|
|
117
|
+
child.animate([{ transform: offset, opacity: 0 }, { transform: "none", opacity: 1 }], {
|
|
118
|
+
duration: SWITCH_MS,
|
|
119
|
+
easing: SETTLE_EASE,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
105
122
|
}
|
|
106
123
|
|
|
107
124
|
/**
|
|
@@ -26,7 +26,7 @@ export const menuCheckboxRadioItemClass =
|
|
|
26
26
|
"relative flex cursor-pointer select-none items-center rounded-menu-item py-2 pl-8 pr-2.5 text-sm outline-hidden transition-[background-color,color,transform] duration-150 ease-out active:scale-[0.99] focus:bg-default focus:text-foreground data-highlighted:bg-default data-highlighted:text-foreground data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50";
|
|
27
27
|
|
|
28
28
|
export const menuLabelClass =
|
|
29
|
-
"px-2.5 py-1.5 text-xs font-
|
|
29
|
+
"px-2.5 py-1.5 text-xs font-medium uppercase tracking-widest text-muted-foreground";
|
|
30
30
|
|
|
31
31
|
export const menuSeparatorClass = "-mx-1.5 my-1 h-px bg-separator";
|
|
32
32
|
|
package/src/ui/_menu-classes.ts
CHANGED
|
@@ -40,7 +40,7 @@ export const menuCheckboxRadioItemClass =
|
|
|
40
40
|
"relative flex cursor-pointer select-none items-center rounded-menu-item py-1.5 max-sm:min-h-10 pl-8 pr-2.5 text-sm outline-none transition-[background-color,color] focus:bg-default focus:text-foreground data-[highlighted]:bg-default data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50";
|
|
41
41
|
|
|
42
42
|
export const menuLabelClass =
|
|
43
|
-
"px-2.5 py-1.5 text-xs font-
|
|
43
|
+
"px-2.5 py-1.5 text-xs font-medium uppercase tracking-widest text-muted-foreground";
|
|
44
44
|
|
|
45
45
|
export const menuSeparatorClass = "-mx-1 my-1 h-px bg-separator";
|
|
46
46
|
|
|
@@ -185,7 +185,7 @@ export function BulkActionBar({
|
|
|
185
185
|
<div className="flex shrink-0 items-center gap-2 pl-1 pr-0.5">
|
|
186
186
|
<CountPop
|
|
187
187
|
label={String(selectedCount)}
|
|
188
|
-
className="rounded-md bg-surface-secondary px-2 py-0.5 text-xs font-
|
|
188
|
+
className="rounded-md bg-surface-secondary px-2 py-0.5 text-xs font-medium text-foreground tabular-nums"
|
|
189
189
|
/>
|
|
190
190
|
<span className="hidden text-sm font-medium text-muted-foreground sm:inline">
|
|
191
191
|
selected
|
package/src/ui/calendar.tsx
CHANGED
|
@@ -155,7 +155,7 @@ function Calendar({
|
|
|
155
155
|
// the today dot is `bg-current`: foreground, or primary-foreground
|
|
156
156
|
// when selected
|
|
157
157
|
"not-group-data-selected/day:enabled:hover:bg-surface-tertiary/50",
|
|
158
|
-
"group-data-today/day:font-
|
|
158
|
+
"group-data-today/day:font-medium group-data-today/day:not-group-data-selected/day:text-foreground group-data-today/day:after:absolute group-data-today/day:after:bottom-1 group-data-today/day:after:left-1/2 group-data-today/day:after:size-1 group-data-today/day:after:-translate-x-1/2 group-data-today/day:after:rounded-full group-data-today/day:after:bg-current",
|
|
159
159
|
"group-data-outside/day:not-group-data-selected/day:text-muted-foreground",
|
|
160
160
|
// spelled out (not built from pickerSelectedClass) so Tailwind's
|
|
161
161
|
// scanner sees it
|
package/src/ui/card.tsx
CHANGED
|
@@ -54,7 +54,7 @@ const CardTitle = React.forwardRef<
|
|
|
54
54
|
>(({ className, ...props }, ref) => (
|
|
55
55
|
<div
|
|
56
56
|
ref={ref}
|
|
57
|
-
className={useCardClass("title", "font-
|
|
57
|
+
className={useCardClass("title", "font-medium leading-none tracking-[-0.02em]", className)}
|
|
58
58
|
{...props}
|
|
59
59
|
/>
|
|
60
60
|
));
|
package/src/ui/clear-input.tsx
CHANGED
|
@@ -164,7 +164,6 @@ const DissolveClearInput = React.forwardRef<HTMLInputElement, ClearInputPartsPro
|
|
|
164
164
|
const inputRef = React.useRef<HTMLInputElement | null>(null);
|
|
165
165
|
const mirrorRef = React.useRef<HTMLDivElement>(null);
|
|
166
166
|
const placeholderRef = React.useRef<HTMLDivElement>(null);
|
|
167
|
-
const glowRef = React.useRef<HTMLDivElement>(null);
|
|
168
167
|
const clearingRef = React.useRef(false);
|
|
169
168
|
const [clearing, setClearing] = React.useState(false);
|
|
170
169
|
|
|
@@ -200,13 +199,11 @@ const DissolveClearInput = React.forwardRef<HTMLInputElement, ClearInputPartsPro
|
|
|
200
199
|
const input = inputRef.current;
|
|
201
200
|
const mirror = mirrorRef.current;
|
|
202
201
|
const placeholderLayer = placeholderRef.current;
|
|
203
|
-
const glow = glowRef.current;
|
|
204
202
|
if (
|
|
205
203
|
!wrap ||
|
|
206
204
|
!input ||
|
|
207
205
|
!mirror ||
|
|
208
206
|
!placeholderLayer ||
|
|
209
|
-
!glow ||
|
|
210
207
|
clearingRef.current ||
|
|
211
208
|
value.length === 0
|
|
212
209
|
) {
|
|
@@ -217,7 +214,7 @@ const DissolveClearInput = React.forwardRef<HTMLInputElement, ClearInputPartsPro
|
|
|
217
214
|
setClearing(true);
|
|
218
215
|
|
|
219
216
|
runClearInputDissolve(
|
|
220
|
-
{ wrap, input, mirror, placeholderLayer
|
|
217
|
+
{ wrap, input, mirror, placeholderLayer },
|
|
221
218
|
() => {
|
|
222
219
|
onChange("");
|
|
223
220
|
},
|
|
@@ -273,7 +270,6 @@ const DissolveClearInput = React.forwardRef<HTMLInputElement, ClearInputPartsPro
|
|
|
273
270
|
>
|
|
274
271
|
{placeholder}
|
|
275
272
|
</div>
|
|
276
|
-
<div ref={glowRef} className="t-clear-glow" />
|
|
277
273
|
</div>
|
|
278
274
|
{value.length > 0 && !clearing ? (
|
|
279
275
|
<button
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** transitions.dev input clear with dissolve — see 13-input-clear-dissolve.md */
|
|
2
2
|
|
|
3
|
-
import { readDocumentAppearance } from "../hooks/use-document-appearance";
|
|
4
|
-
|
|
5
3
|
// Times come back in ms. CSS minifiers rewrite `1000ms` as `1s`, so a value
|
|
6
4
|
// in seconds is converted rather than read as 1.
|
|
7
5
|
export function readCssNumber(
|
|
@@ -55,67 +53,11 @@ export function readCssEase(root: HTMLElement, name: string): (t: number) => num
|
|
|
55
53
|
};
|
|
56
54
|
}
|
|
57
55
|
|
|
58
|
-
function measureCanvas(): CanvasRenderingContext2D | null {
|
|
59
|
-
const canvas = document.createElement("canvas");
|
|
60
|
-
return canvas.getContext("2d");
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let sharedMeasureCanvas: CanvasRenderingContext2D | null = null;
|
|
64
|
-
|
|
65
|
-
function getMeasureCanvas(): CanvasRenderingContext2D | null {
|
|
66
|
-
if (sharedMeasureCanvas === null) {
|
|
67
|
-
sharedMeasureCanvas = measureCanvas();
|
|
68
|
-
}
|
|
69
|
-
return sharedMeasureCanvas;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
56
|
export interface ClearDissolveElements {
|
|
73
57
|
wrap: HTMLElement;
|
|
74
58
|
input: HTMLInputElement;
|
|
75
59
|
mirror: HTMLElement;
|
|
76
60
|
placeholderLayer: HTMLElement;
|
|
77
|
-
glow: HTMLElement;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function buildGlowBackground(
|
|
81
|
-
wrap: HTMLElement,
|
|
82
|
-
input: HTMLInputElement,
|
|
83
|
-
text: string,
|
|
84
|
-
root: HTMLElement,
|
|
85
|
-
): string {
|
|
86
|
-
const canvas = getMeasureCanvas();
|
|
87
|
-
if (canvas === null) {
|
|
88
|
-
return "";
|
|
89
|
-
}
|
|
90
|
-
canvas.font = getComputedStyle(input).font;
|
|
91
|
-
const dark = readDocumentAppearance() === "dark";
|
|
92
|
-
const rgb = dark ? "255,255,255" : "0,0,0";
|
|
93
|
-
const width = wrap.clientWidth || 280;
|
|
94
|
-
const padLeft = parseFloat(getComputedStyle(input).paddingLeft) || 12;
|
|
95
|
-
const spread = readCssNumber(root, "--glow-spread", 1.5);
|
|
96
|
-
const layers: string[] = [];
|
|
97
|
-
let x = 0;
|
|
98
|
-
for (const segment of text.split(/(\s+)/)) {
|
|
99
|
-
const segmentWidth = canvas.measureText(segment).width;
|
|
100
|
-
if (segment.trim()) {
|
|
101
|
-
const centerX = padLeft + x + segmentWidth / 2;
|
|
102
|
-
const halfWidth = Math.max(segmentWidth * 0.45, 8) * spread;
|
|
103
|
-
const streaks: Array<[number, number, number, number]> = [
|
|
104
|
-
[0, 0.8, 7, 0.22],
|
|
105
|
-
[halfWidth * 0.45, 0.55, 8, 0.18],
|
|
106
|
-
[-halfWidth * 0.4, 0.65, 6, 0.16],
|
|
107
|
-
[halfWidth * 0.15, 0.9, 5, 0.14],
|
|
108
|
-
];
|
|
109
|
-
for (const [dx, rwm, rh, alpha] of streaks) {
|
|
110
|
-
const leftPercent = (((centerX + dx) / width) * 100).toFixed(2);
|
|
111
|
-
layers.push(
|
|
112
|
-
`radial-gradient(ellipse ${Math.max(halfWidth * rwm, 2).toFixed(1)}px ${rh}px at ${leftPercent}% 100%, rgba(${rgb},${alpha}), transparent)`,
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
x += segmentWidth;
|
|
117
|
-
}
|
|
118
|
-
return layers.join(", ");
|
|
119
61
|
}
|
|
120
62
|
|
|
121
63
|
function resetLayerStyles(
|
|
@@ -131,7 +73,7 @@ export function runClearInputDissolve(
|
|
|
131
73
|
onValueClear: () => void,
|
|
132
74
|
onDone: () => void,
|
|
133
75
|
): void {
|
|
134
|
-
const { wrap, input, mirror, placeholderLayer
|
|
76
|
+
const { wrap, input, mirror, placeholderLayer } = elements;
|
|
135
77
|
const root = document.documentElement;
|
|
136
78
|
const text = input.value;
|
|
137
79
|
if (text.length === 0) {
|
|
@@ -141,27 +83,17 @@ export function runClearInputDissolve(
|
|
|
141
83
|
const keepFocus = document.activeElement === input;
|
|
142
84
|
mirror.textContent = text.replace(/ /g, "\u00a0");
|
|
143
85
|
|
|
144
|
-
const total = readCssNumber(root, "--clear-dur",
|
|
86
|
+
const total = readCssNumber(root, "--clear-dur", 400);
|
|
145
87
|
const outDur = readCssNumber(root, "--clear-out-dur", 400);
|
|
146
88
|
const inDur = readCssNumber(root, "--clear-in-dur", 400);
|
|
147
89
|
const outFly = readCssNumber(root, "--clear-out-fly", 12);
|
|
148
90
|
const inFly = readCssNumber(root, "--clear-in-fly", 12);
|
|
149
|
-
const delay = readCssNumber(root, "--glow-delay", 50);
|
|
150
|
-
const peakAt = readCssNumber(root, "--glow-peak-at", 0.15);
|
|
151
|
-
const glowOpacity = readCssNumber(root, "--glow-opacity", 0.85);
|
|
152
91
|
const easeOut = readCssEase(root, "--clear-out-ease");
|
|
153
92
|
const easeIn = readCssEase(root, "--clear-in-ease");
|
|
154
93
|
|
|
155
94
|
onValueClear();
|
|
156
95
|
wrap.classList.remove("has-value");
|
|
157
96
|
wrap.classList.add("is-clearing");
|
|
158
|
-
glow.style.background = buildGlowBackground(
|
|
159
|
-
wrap,
|
|
160
|
-
input,
|
|
161
|
-
mirror.textContent,
|
|
162
|
-
root,
|
|
163
|
-
);
|
|
164
|
-
glow.style.opacity = "0";
|
|
165
97
|
placeholderLayer.style.transform = `translateY(-${inFly}px)`;
|
|
166
98
|
placeholderLayer.style.opacity = "0.9";
|
|
167
99
|
placeholderLayer.style.filter = "none";
|
|
@@ -179,19 +111,6 @@ export function runClearInputDissolve(
|
|
|
179
111
|
placeholderLayer.style.transform = `translateY(${(-inFly + inProgress * inFly).toFixed(1)}px)`;
|
|
180
112
|
placeholderLayer.style.opacity = (0.9 + inProgress * 0.1).toFixed(3);
|
|
181
113
|
|
|
182
|
-
let glowStrength = 0;
|
|
183
|
-
if (elapsed > delay) {
|
|
184
|
-
const glowProgress = Math.min(
|
|
185
|
-
1,
|
|
186
|
-
(elapsed - delay) / Math.max(1, total - delay),
|
|
187
|
-
);
|
|
188
|
-
glowStrength =
|
|
189
|
-
glowProgress < peakAt
|
|
190
|
-
? glowProgress / peakAt
|
|
191
|
-
: 1 - (glowProgress - peakAt) / (1 - peakAt);
|
|
192
|
-
}
|
|
193
|
-
glow.style.opacity = (glowStrength * glowOpacity).toFixed(3);
|
|
194
|
-
|
|
195
114
|
if (elapsed < total) {
|
|
196
115
|
requestAnimationFrame(tick);
|
|
197
116
|
return;
|
|
@@ -200,8 +119,6 @@ export function runClearInputDissolve(
|
|
|
200
119
|
wrap.classList.remove("is-clearing");
|
|
201
120
|
resetLayerStyles(mirror, placeholderLayer);
|
|
202
121
|
mirror.textContent = "";
|
|
203
|
-
glow.style.opacity = "0";
|
|
204
|
-
glow.style.background = "";
|
|
205
122
|
onDone();
|
|
206
123
|
if (keepFocus) {
|
|
207
124
|
requestAnimationFrame(() => {
|
package/src/ui/command.tsx
CHANGED
|
@@ -60,7 +60,7 @@ Command.displayName = CommandPrimitive.displayName;
|
|
|
60
60
|
// The list is pinned rather than `max-h`: a palette that resizes on every
|
|
61
61
|
// keystroke shifts the whole dialog under the cursor.
|
|
62
62
|
const commandDialogPinnedClass =
|
|
63
|
-
"[&_[cmdk-list]]:h-80 [&_[cmdk-list]]:max-h-[60dvh] [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-
|
|
63
|
+
"[&_[cmdk-list]]:h-80 [&_[cmdk-list]]:max-h-[60dvh] [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-widest [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-1.5 [&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-input]]:h-11 [&_[cmdk-item]]:rounded-menu-item [&_[cmdk-item]]:px-2.5 [&_[cmdk-item]]:py-2 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4";
|
|
64
64
|
|
|
65
65
|
// Keyboard surface: the palette opens and closes in the same frame. Override
|
|
66
66
|
// the `t-modal` timing variables on the content element (do not fork the CSS).
|
|
@@ -77,7 +77,7 @@ const commandOverlayInstantClass = "[animation:none!important]";
|
|
|
77
77
|
|
|
78
78
|
// The list sizes itself and items keep the caller's styling.
|
|
79
79
|
const commandDialogAutoClass =
|
|
80
|
-
"[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-
|
|
80
|
+
"[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-widest [&_[cmdk-group-heading]]:text-muted [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-1.5 [&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-input]]:h-11 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4"; // check-tokens-allow: text-muted
|
|
81
81
|
|
|
82
82
|
interface CommandDialogProps extends React.ComponentProps<typeof Dialog> {
|
|
83
83
|
/** Screen-reader title. With `description`, adds a visually hidden header. */
|
|
@@ -209,7 +209,7 @@ const CommandGroup = React.forwardRef<
|
|
|
209
209
|
ref={ref}
|
|
210
210
|
className={merge(
|
|
211
211
|
group ??
|
|
212
|
-
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-
|
|
212
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-widest [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
213
213
|
className,
|
|
214
214
|
)}
|
|
215
215
|
{...props}
|
package/src/ui/count-pop.tsx
CHANGED
|
@@ -71,7 +71,7 @@ export function UnreadDot({ show, className }: { show: boolean; className?: stri
|
|
|
71
71
|
* Put the tile in a `relative` box; add one tone class (e.g. a live colour).
|
|
72
72
|
*/
|
|
73
73
|
export const CORNER_BADGE_CLASS =
|
|
74
|
-
"absolute -bottom-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-
|
|
74
|
+
"absolute -bottom-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-medium leading-none";
|
|
75
75
|
|
|
76
76
|
/** An unread count on a tile's corner: `CountPop` in the primary tone, "99+" above 99. */
|
|
77
77
|
export function UnreadCornerBadge({ count, className }: { count: number | undefined; className?: string }) {
|
package/src/ui/dialog.tsx
CHANGED
|
@@ -320,7 +320,7 @@ const DialogTitle = React.forwardRef<
|
|
|
320
320
|
<DialogPrimitive.Title
|
|
321
321
|
ref={ref}
|
|
322
322
|
className={merge(
|
|
323
|
-
title ?? "text-lg font-
|
|
323
|
+
title ?? "text-lg font-medium tracking-normal text-foreground text-balance",
|
|
324
324
|
className,
|
|
325
325
|
)}
|
|
326
326
|
{...props}
|
package/src/ui/media-preview.tsx
CHANGED
|
@@ -79,7 +79,7 @@ export function ImageGalleryPreview({ images }: { images: GalleryImage[] }) {
|
|
|
79
79
|
)}
|
|
80
80
|
/>
|
|
81
81
|
{overflow > 0 && index === tiles.length - 1 ? (
|
|
82
|
-
<span className="absolute inset-0 flex items-center justify-center bg-black/60 text-xl font-
|
|
82
|
+
<span className="absolute inset-0 flex items-center justify-center bg-black/60 text-xl font-medium text-white">
|
|
83
83
|
+{overflow}
|
|
84
84
|
</span>
|
|
85
85
|
) : null}
|
package/src/ui/progress.tsx
CHANGED
|
@@ -25,7 +25,7 @@ const Progress = React.forwardRef<
|
|
|
25
25
|
<ProgressPrimitive.Indicator
|
|
26
26
|
className={
|
|
27
27
|
classes?.indicator ??
|
|
28
|
-
"h-full w-full flex-1 rounded-full bg-primary transition-transform duration-
|
|
28
|
+
"h-full w-full flex-1 rounded-full bg-primary transition-transform duration-200 ease-smooth"
|
|
29
29
|
}
|
|
30
30
|
style={{ transform: `translateX(-${100 - (value ?? 0)}%)` }}
|
|
31
31
|
/>
|
package/src/ui/radix-select.tsx
CHANGED
|
@@ -102,7 +102,7 @@ function SelectLabel({
|
|
|
102
102
|
<SelectPrimitive.Label
|
|
103
103
|
data-slot="select-label"
|
|
104
104
|
className={cn(
|
|
105
|
-
"text-muted-foreground px-2.5 py-1.5 text-xs font-
|
|
105
|
+
"text-muted-foreground px-2.5 py-1.5 text-xs font-medium uppercase tracking-widest",
|
|
106
106
|
className,
|
|
107
107
|
)}
|
|
108
108
|
{...props}
|
package/src/ui/select.tsx
CHANGED
|
@@ -170,7 +170,7 @@ const SelectLabel = React.forwardRef<
|
|
|
170
170
|
ref={ref}
|
|
171
171
|
className={merge(
|
|
172
172
|
label ??
|
|
173
|
-
"px-2.5 py-1.5 text-xs font-
|
|
173
|
+
"px-2.5 py-1.5 text-xs font-medium uppercase tracking-widest text-muted-foreground",
|
|
174
174
|
className,
|
|
175
175
|
)}
|
|
176
176
|
{...props}
|
package/src/ui/table.tsx
CHANGED
|
@@ -101,7 +101,7 @@ const TableHead = React.forwardRef<
|
|
|
101
101
|
ref={ref}
|
|
102
102
|
className={useTableClass(
|
|
103
103
|
"head",
|
|
104
|
-
"h-11 px-4 text-left align-middle text-xs font-
|
|
104
|
+
"h-11 px-4 text-left align-middle text-xs font-medium uppercase tracking-widest text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
105
105
|
className,
|
|
106
106
|
)}
|
|
107
107
|
{...props}
|
|
@@ -110,7 +110,7 @@ function Pane({ dark }: { dark: boolean }) {
|
|
|
110
110
|
return (
|
|
111
111
|
<div className={dark ? "dark" : ""}>
|
|
112
112
|
<main className="min-h-screen space-y-8 bg-background p-8 text-foreground">
|
|
113
|
-
<h1 className="text-lg font-
|
|
113
|
+
<h1 className="text-lg font-medium">{dark ? "Dark" : "Light"}</h1>
|
|
114
114
|
|
|
115
115
|
<Section title="Loaders">
|
|
116
116
|
<div className="flex flex-wrap items-center gap-4">
|