@sero-ai/ui 0.2.0 → 0.2.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/.turbo/turbo-typecheck.log +1 -1
- package/LICENSE +201 -0
- package/package.json +19 -16
- package/src/components/ai-elements/attachments.tsx +4 -4
- package/src/components/ai-elements/audio-player.tsx +1 -1
- package/src/components/ai-elements/chain-of-thought.tsx +2 -2
- package/src/components/ai-elements/confirmation.tsx +2 -2
- package/src/components/ai-elements/context.tsx +2 -2
- package/src/components/ai-elements/environment-variables.tsx +6 -6
- package/src/components/ai-elements/file-tree.tsx +3 -3
- package/src/components/ai-elements/inline-citation.tsx +2 -2
- package/src/components/ai-elements/jsx-preview.tsx +2 -2
- package/src/components/ai-elements/message.tsx +2 -2
- package/src/components/ai-elements/mic-selector.tsx +8 -8
- package/src/components/ai-elements/open-in-chat.tsx +2 -2
- package/src/components/ai-elements/package-info.tsx +4 -4
- package/src/components/ai-elements/plan.tsx +2 -2
- package/src/components/ai-elements/prompt-input-context.tsx +8 -8
- package/src/components/ai-elements/queue.tsx +1 -1
- package/src/components/ai-elements/reasoning.tsx +3 -3
- package/src/components/ai-elements/schema-display.tsx +7 -7
- package/src/components/ai-elements/snippet.tsx +3 -3
- package/src/components/ai-elements/sources.tsx +2 -2
- package/src/components/ai-elements/terminal.tsx +5 -5
- package/src/components/ai-elements/test-results.tsx +8 -8
- package/src/components/ai-elements/transcription.tsx +2 -2
- package/src/components/ai-elements/voice-selector.tsx +2 -2
- package/src/components/ai-elements/web-preview.tsx +5 -6
- package/src/components/model-selection/available-model-picker.tsx +1 -1
- package/src/components/ui/calendar.tsx +1 -1
- package/src/components/ui/carousel.tsx +1 -1
- package/src/components/ui/chart.tsx +3 -3
- package/src/components/ui/command.tsx +1 -1
- package/src/components/ui/field.tsx +2 -2
- package/src/components/ui/form.tsx +2 -2
- package/src/components/ui/input-otp.tsx +2 -2
- package/src/components/ui/input.tsx +3 -1
- package/src/components/ui/menubar.tsx +1 -1
- package/src/components/ui/native-select.tsx +2 -0
- package/src/components/ui/navigation-menu.tsx +1 -1
- package/src/components/ui/plugin-safety-disclaimer.tsx +3 -3
- package/src/components/ui/progress.tsx +1 -1
- package/src/components/ui/resizable.tsx +1 -1
- package/src/components/ui/search-input.tsx +26 -27
- package/src/components/ui/slider.tsx +7 -2
- package/src/components/ui/textarea.tsx +3 -1
- package/src/components/ui/toggle-group.tsx +1 -1
- package/src/components/ui/tree.tsx +3 -3
- package/src/index.ts +3 -0
- package/src/styles/globals.css +91 -26
- package/src/styles/plugin.css +4 -0
- package/src/theme/apply-theme.ts +250 -0
- package/src/theme/index.ts +2 -0
- package/src/theme/types.ts +253 -0
|
@@ -14,7 +14,7 @@ import { nanoid } from "nanoid";
|
|
|
14
14
|
import {
|
|
15
15
|
createContext,
|
|
16
16
|
useCallback,
|
|
17
|
-
|
|
17
|
+
use,
|
|
18
18
|
useEffect,
|
|
19
19
|
useMemo,
|
|
20
20
|
useRef,
|
|
@@ -71,7 +71,7 @@ export const LocalReferencedSourcesContext = createContext<ReferencedSourcesCont
|
|
|
71
71
|
// ============================================================================
|
|
72
72
|
|
|
73
73
|
export const usePromptInputController = () => {
|
|
74
|
-
const ctx =
|
|
74
|
+
const ctx = use(PromptInputController);
|
|
75
75
|
if (!ctx) {
|
|
76
76
|
throw new Error(
|
|
77
77
|
"Wrap your component inside <PromptInputProvider> to use usePromptInputController()."
|
|
@@ -80,12 +80,12 @@ export const usePromptInputController = () => {
|
|
|
80
80
|
return ctx;
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
/** Optional variant
|
|
83
|
+
/** Optional variant, does NOT throw. Useful for dual-mode components. */
|
|
84
84
|
export const useOptionalPromptInputController = () =>
|
|
85
|
-
|
|
85
|
+
use(PromptInputController);
|
|
86
86
|
|
|
87
87
|
export const useProviderAttachments = () => {
|
|
88
|
-
const ctx =
|
|
88
|
+
const ctx = use(ProviderAttachmentsContext);
|
|
89
89
|
if (!ctx) {
|
|
90
90
|
throw new Error(
|
|
91
91
|
"Wrap your component inside <PromptInputProvider> to use useProviderAttachments()."
|
|
@@ -95,12 +95,12 @@ export const useProviderAttachments = () => {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
const useOptionalProviderAttachments = () =>
|
|
98
|
-
|
|
98
|
+
use(ProviderAttachmentsContext);
|
|
99
99
|
|
|
100
100
|
export const usePromptInputAttachments = () => {
|
|
101
101
|
// Prefer local context (inside PromptInput) as it has validation, fall back to provider
|
|
102
102
|
const provider = useOptionalProviderAttachments();
|
|
103
|
-
const local =
|
|
103
|
+
const local = use(LocalAttachmentsContext);
|
|
104
104
|
const context = local ?? provider;
|
|
105
105
|
if (!context) {
|
|
106
106
|
throw new Error(
|
|
@@ -111,7 +111,7 @@ export const usePromptInputAttachments = () => {
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
export const usePromptInputReferencedSources = () => {
|
|
114
|
-
const ctx =
|
|
114
|
+
const ctx = use(LocalReferencedSourcesContext);
|
|
115
115
|
if (!ctx) {
|
|
116
116
|
throw new Error(
|
|
117
117
|
"usePromptInputReferencedSources must be used within a LocalReferencedSourcesContext.Provider"
|
|
@@ -154,7 +154,7 @@ export const QueueItemImage = ({
|
|
|
154
154
|
}: QueueItemImageProps) => (
|
|
155
155
|
<img
|
|
156
156
|
alt=""
|
|
157
|
-
className={cn("
|
|
157
|
+
className={cn("size-8 rounded border object-cover", className)}
|
|
158
158
|
height={32}
|
|
159
159
|
width={32}
|
|
160
160
|
{...props}
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
createContext,
|
|
19
19
|
memo,
|
|
20
20
|
useCallback,
|
|
21
|
-
|
|
21
|
+
use,
|
|
22
22
|
useEffect,
|
|
23
23
|
useMemo,
|
|
24
24
|
useRef,
|
|
@@ -38,7 +38,7 @@ interface ReasoningContextValue {
|
|
|
38
38
|
const ReasoningContext = createContext<ReasoningContextValue | null>(null);
|
|
39
39
|
|
|
40
40
|
export const useReasoning = () => {
|
|
41
|
-
const context =
|
|
41
|
+
const context = use(ReasoningContext);
|
|
42
42
|
if (!context) {
|
|
43
43
|
throw new Error("Reasoning components must be used within Reasoning");
|
|
44
44
|
}
|
|
@@ -157,7 +157,7 @@ export type ReasoningTriggerProps = ComponentProps<
|
|
|
157
157
|
|
|
158
158
|
const defaultGetThinkingMessage = (isStreaming: boolean, duration?: number) => {
|
|
159
159
|
if (isStreaming || duration === 0) {
|
|
160
|
-
return <Shimmer duration={1}>Thinking
|
|
160
|
+
return <Shimmer duration={1}>Thinking…</Shimmer>;
|
|
161
161
|
}
|
|
162
162
|
if (duration === undefined) {
|
|
163
163
|
return <p>Thought for a few seconds</p>;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../ui/collapsible";
|
|
11
11
|
import { cn } from "../../lib/utils";
|
|
12
12
|
import { ChevronRightIcon } from "lucide-react";
|
|
13
|
-
import { createContext,
|
|
13
|
+
import { createContext, use, useMemo } from "react";
|
|
14
14
|
|
|
15
15
|
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
16
16
|
|
|
@@ -144,7 +144,7 @@ export const SchemaDisplayMethod = ({
|
|
|
144
144
|
children,
|
|
145
145
|
...props
|
|
146
146
|
}: SchemaDisplayMethodProps) => {
|
|
147
|
-
const { method } =
|
|
147
|
+
const { method } = use(SchemaDisplayContext);
|
|
148
148
|
|
|
149
149
|
return (
|
|
150
150
|
<Badge
|
|
@@ -164,7 +164,7 @@ export const SchemaDisplayPath = ({
|
|
|
164
164
|
children,
|
|
165
165
|
...props
|
|
166
166
|
}: SchemaDisplayPathProps) => {
|
|
167
|
-
const { path } =
|
|
167
|
+
const { path } = use(SchemaDisplayContext);
|
|
168
168
|
|
|
169
169
|
// Highlight path parameters
|
|
170
170
|
const highlightedPath = path.replaceAll(
|
|
@@ -191,7 +191,7 @@ export const SchemaDisplayDescription = ({
|
|
|
191
191
|
children,
|
|
192
192
|
...props
|
|
193
193
|
}: SchemaDisplayDescriptionProps) => {
|
|
194
|
-
const { description } =
|
|
194
|
+
const { description } = use(SchemaDisplayContext);
|
|
195
195
|
|
|
196
196
|
return (
|
|
197
197
|
<p
|
|
@@ -225,7 +225,7 @@ export const SchemaDisplayParameters = ({
|
|
|
225
225
|
children,
|
|
226
226
|
...props
|
|
227
227
|
}: SchemaDisplayParametersProps) => {
|
|
228
|
-
const { parameters } =
|
|
228
|
+
const { parameters } = use(SchemaDisplayContext);
|
|
229
229
|
|
|
230
230
|
return (
|
|
231
231
|
<Collapsible className={cn(className)} defaultOpen {...props}>
|
|
@@ -293,7 +293,7 @@ export const SchemaDisplayRequest = ({
|
|
|
293
293
|
children,
|
|
294
294
|
...props
|
|
295
295
|
}: SchemaDisplayRequestProps) => {
|
|
296
|
-
const { requestBody } =
|
|
296
|
+
const { requestBody } = use(SchemaDisplayContext);
|
|
297
297
|
|
|
298
298
|
return (
|
|
299
299
|
<Collapsible className={cn(className)} defaultOpen {...props}>
|
|
@@ -320,7 +320,7 @@ export const SchemaDisplayResponse = ({
|
|
|
320
320
|
children,
|
|
321
321
|
...props
|
|
322
322
|
}: SchemaDisplayResponseProps) => {
|
|
323
|
-
const { responseBody } =
|
|
323
|
+
const { responseBody } = use(SchemaDisplayContext);
|
|
324
324
|
|
|
325
325
|
return (
|
|
326
326
|
<Collapsible className={cn(className)} defaultOpen {...props}>
|
|
@@ -14,7 +14,7 @@ import { CheckIcon, CopyIcon } from "lucide-react";
|
|
|
14
14
|
import {
|
|
15
15
|
createContext,
|
|
16
16
|
useCallback,
|
|
17
|
-
|
|
17
|
+
use,
|
|
18
18
|
useEffect,
|
|
19
19
|
useRef,
|
|
20
20
|
useState,
|
|
@@ -66,7 +66,7 @@ export type SnippetInputProps = Omit<
|
|
|
66
66
|
>;
|
|
67
67
|
|
|
68
68
|
export const SnippetInput = ({ className, ...props }: SnippetInputProps) => {
|
|
69
|
-
const { code } =
|
|
69
|
+
const { code } = use(SnippetContext);
|
|
70
70
|
|
|
71
71
|
return (
|
|
72
72
|
<InputGroupInput
|
|
@@ -94,7 +94,7 @@ export const SnippetCopyButton = ({
|
|
|
94
94
|
}: SnippetCopyButtonProps) => {
|
|
95
95
|
const [isCopied, setIsCopied] = useState(false);
|
|
96
96
|
const timeoutRef = useRef<number>(0);
|
|
97
|
-
const { code } =
|
|
97
|
+
const { code } = use(SnippetContext);
|
|
98
98
|
|
|
99
99
|
const copyToClipboard = useCallback(async () => {
|
|
100
100
|
if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
|
|
@@ -36,7 +36,7 @@ export const SourcesTrigger = ({
|
|
|
36
36
|
{children ?? (
|
|
37
37
|
<>
|
|
38
38
|
<p className="font-medium">Used {count} sources</p>
|
|
39
|
-
<ChevronDownIcon className="
|
|
39
|
+
<ChevronDownIcon className="size-4" />
|
|
40
40
|
</>
|
|
41
41
|
)}
|
|
42
42
|
</CollapsibleTrigger>
|
|
@@ -70,7 +70,7 @@ export const Source = ({ href, title, children, ...props }: SourceProps) => (
|
|
|
70
70
|
>
|
|
71
71
|
{children ?? (
|
|
72
72
|
<>
|
|
73
|
-
<BookIcon className="
|
|
73
|
+
<BookIcon className="size-4" />
|
|
74
74
|
<span className="block font-medium">{title}</span>
|
|
75
75
|
</>
|
|
76
76
|
)}
|
|
@@ -9,7 +9,7 @@ import { CheckIcon, CopyIcon, TerminalIcon, Trash2Icon } from "lucide-react";
|
|
|
9
9
|
import {
|
|
10
10
|
createContext,
|
|
11
11
|
useCallback,
|
|
12
|
-
|
|
12
|
+
use,
|
|
13
13
|
useEffect,
|
|
14
14
|
useMemo,
|
|
15
15
|
useRef,
|
|
@@ -122,7 +122,7 @@ export const TerminalStatus = ({
|
|
|
122
122
|
children,
|
|
123
123
|
...props
|
|
124
124
|
}: TerminalStatusProps) => {
|
|
125
|
-
const { isStreaming } =
|
|
125
|
+
const { isStreaming } = use(TerminalContext);
|
|
126
126
|
|
|
127
127
|
if (!isStreaming) {
|
|
128
128
|
return null;
|
|
@@ -166,7 +166,7 @@ export const TerminalCopyButton = ({
|
|
|
166
166
|
}: TerminalCopyButtonProps) => {
|
|
167
167
|
const [isCopied, setIsCopied] = useState(false);
|
|
168
168
|
const timeoutRef = useRef<number>(0);
|
|
169
|
-
const { output } =
|
|
169
|
+
const { output } = use(TerminalContext);
|
|
170
170
|
|
|
171
171
|
const copyToClipboard = useCallback(async () => {
|
|
172
172
|
if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
|
|
@@ -216,7 +216,7 @@ export const TerminalClearButton = ({
|
|
|
216
216
|
className,
|
|
217
217
|
...props
|
|
218
218
|
}: TerminalClearButtonProps) => {
|
|
219
|
-
const { onClear } =
|
|
219
|
+
const { onClear } = use(TerminalContext);
|
|
220
220
|
|
|
221
221
|
if (!onClear) {
|
|
222
222
|
return null;
|
|
@@ -245,7 +245,7 @@ export const TerminalContent = ({
|
|
|
245
245
|
children,
|
|
246
246
|
...props
|
|
247
247
|
}: TerminalContentProps) => {
|
|
248
|
-
const { output, isStreaming, autoScroll } =
|
|
248
|
+
const { output, isStreaming, autoScroll } = use(TerminalContext);
|
|
249
249
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
250
250
|
|
|
251
251
|
// biome-ignore lint/correctness/useExhaustiveDependencies: output triggers auto-scroll when new content arrives
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
CircleIcon,
|
|
17
17
|
XCircleIcon,
|
|
18
18
|
} from "lucide-react";
|
|
19
|
-
import { createContext,
|
|
19
|
+
import { createContext, use, useMemo } from "react";
|
|
20
20
|
|
|
21
21
|
type TestStatus = "passed" | "failed" | "skipped" | "running";
|
|
22
22
|
|
|
@@ -96,7 +96,7 @@ export const TestResultsSummary = ({
|
|
|
96
96
|
children,
|
|
97
97
|
...props
|
|
98
98
|
}: TestResultsSummaryProps) => {
|
|
99
|
-
const { summary } =
|
|
99
|
+
const { summary } = use(TestResultsContext);
|
|
100
100
|
|
|
101
101
|
if (!summary) {
|
|
102
102
|
return null;
|
|
@@ -144,7 +144,7 @@ export const TestResultsDuration = ({
|
|
|
144
144
|
children,
|
|
145
145
|
...props
|
|
146
146
|
}: TestResultsDurationProps) => {
|
|
147
|
-
const { summary } =
|
|
147
|
+
const { summary } = use(TestResultsContext);
|
|
148
148
|
|
|
149
149
|
if (!summary?.duration) {
|
|
150
150
|
return null;
|
|
@@ -164,7 +164,7 @@ export const TestResultsProgress = ({
|
|
|
164
164
|
children,
|
|
165
165
|
...props
|
|
166
166
|
}: TestResultsProgressProps) => {
|
|
167
|
-
const { summary } =
|
|
167
|
+
const { summary } = use(TestResultsContext);
|
|
168
168
|
|
|
169
169
|
if (!summary) {
|
|
170
170
|
return null;
|
|
@@ -251,7 +251,7 @@ export const TestSuiteName = ({
|
|
|
251
251
|
children,
|
|
252
252
|
...props
|
|
253
253
|
}: TestSuiteNameProps) => {
|
|
254
|
-
const { name, status } =
|
|
254
|
+
const { name, status } = use(TestSuiteContext);
|
|
255
255
|
|
|
256
256
|
return (
|
|
257
257
|
<CollapsibleTrigger
|
|
@@ -395,7 +395,7 @@ export const TestStatus = ({
|
|
|
395
395
|
children,
|
|
396
396
|
...props
|
|
397
397
|
}: TestStatusProps) => {
|
|
398
|
-
const { status } =
|
|
398
|
+
const { status } = use(TestContext);
|
|
399
399
|
|
|
400
400
|
return (
|
|
401
401
|
<span
|
|
@@ -410,7 +410,7 @@ export const TestStatus = ({
|
|
|
410
410
|
export type TestNameProps = HTMLAttributes<HTMLSpanElement>;
|
|
411
411
|
|
|
412
412
|
export const TestName = ({ className, children, ...props }: TestNameProps) => {
|
|
413
|
-
const { name } =
|
|
413
|
+
const { name } = use(TestContext);
|
|
414
414
|
|
|
415
415
|
return (
|
|
416
416
|
<span className={cn("flex-1", className)} {...props}>
|
|
@@ -426,7 +426,7 @@ export const TestDuration = ({
|
|
|
426
426
|
children,
|
|
427
427
|
...props
|
|
428
428
|
}: TestDurationProps) => {
|
|
429
|
-
const { duration } =
|
|
429
|
+
const { duration } = use(TestContext);
|
|
430
430
|
|
|
431
431
|
if (duration === undefined) {
|
|
432
432
|
return null;
|
|
@@ -5,7 +5,7 @@ import type { ComponentProps, ReactNode } from "react";
|
|
|
5
5
|
|
|
6
6
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
7
7
|
import { cn } from "../../lib/utils";
|
|
8
|
-
import { createContext, useCallback,
|
|
8
|
+
import { createContext, useCallback, use, useMemo } from "react";
|
|
9
9
|
|
|
10
10
|
type TranscriptionSegment = TranscriptionResult["segments"][number];
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ const TranscriptionContext = createContext<TranscriptionContextValue | null>(
|
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
const useTranscription = () => {
|
|
24
|
-
const context =
|
|
24
|
+
const context = use(TranscriptionContext);
|
|
25
25
|
if (!context) {
|
|
26
26
|
throw new Error(
|
|
27
27
|
"Transcription components must be used within Transcription"
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
VenusAndMarsIcon,
|
|
39
39
|
VenusIcon,
|
|
40
40
|
} from "lucide-react";
|
|
41
|
-
import { createContext, useCallback,
|
|
41
|
+
import { createContext, useCallback, use, useMemo } from "react";
|
|
42
42
|
|
|
43
43
|
interface VoiceSelectorContextValue {
|
|
44
44
|
value: string | undefined;
|
|
@@ -52,7 +52,7 @@ const VoiceSelectorContext = createContext<VoiceSelectorContextValue | null>(
|
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
export const useVoiceSelector = () => {
|
|
55
|
-
const context =
|
|
55
|
+
const context = use(VoiceSelectorContext);
|
|
56
56
|
if (!context) {
|
|
57
57
|
throw new Error(
|
|
58
58
|
"VoiceSelector components must be used within VoiceSelector"
|
|
@@ -20,7 +20,7 @@ import { ChevronDownIcon } from "lucide-react";
|
|
|
20
20
|
import {
|
|
21
21
|
createContext,
|
|
22
22
|
useCallback,
|
|
23
|
-
|
|
23
|
+
use,
|
|
24
24
|
useMemo,
|
|
25
25
|
useState,
|
|
26
26
|
} from "react";
|
|
@@ -35,7 +35,7 @@ export interface WebPreviewContextValue {
|
|
|
35
35
|
const WebPreviewContext = createContext<WebPreviewContextValue | null>(null);
|
|
36
36
|
|
|
37
37
|
const useWebPreview = () => {
|
|
38
|
-
const context =
|
|
38
|
+
const context = use(WebPreviewContext);
|
|
39
39
|
if (!context) {
|
|
40
40
|
throw new Error("WebPreview components must be used within a WebPreview");
|
|
41
41
|
}
|
|
@@ -120,7 +120,7 @@ export const WebPreviewNavigationButton = ({
|
|
|
120
120
|
<Tooltip>
|
|
121
121
|
<TooltipTrigger asChild>
|
|
122
122
|
<Button
|
|
123
|
-
className="
|
|
123
|
+
className="size-8 p-0 hover:text-foreground"
|
|
124
124
|
disabled={disabled}
|
|
125
125
|
onClick={onClick}
|
|
126
126
|
size="sm"
|
|
@@ -199,7 +199,6 @@ export const WebPreviewBody = ({
|
|
|
199
199
|
<div className="flex-1">
|
|
200
200
|
<iframe
|
|
201
201
|
className={cn("size-full", className)}
|
|
202
|
-
// oxlint-disable-next-line eslint-plugin-react(iframe-missing-sandbox)
|
|
203
202
|
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-presentation"
|
|
204
203
|
src={(src ?? url) || undefined}
|
|
205
204
|
title="Preview"
|
|
@@ -241,7 +240,7 @@ export const WebPreviewConsole = ({
|
|
|
241
240
|
Console
|
|
242
241
|
<ChevronDownIcon
|
|
243
242
|
className={cn(
|
|
244
|
-
"
|
|
243
|
+
"size-4 transition-transform duration-200",
|
|
245
244
|
consoleOpen && "rotate-180"
|
|
246
245
|
)}
|
|
247
246
|
/>
|
|
@@ -265,7 +264,7 @@ export const WebPreviewConsole = ({
|
|
|
265
264
|
log.level === "warn" && "text-yellow-600",
|
|
266
265
|
log.level === "log" && "text-foreground"
|
|
267
266
|
)}
|
|
268
|
-
key={`${log.timestamp.getTime()}-${
|
|
267
|
+
key={`${log.timestamp.getTime()}-${log.level}-${log.message}`}
|
|
269
268
|
>
|
|
270
269
|
<span className="text-muted-foreground">
|
|
271
270
|
{log.timestamp.toLocaleTimeString()}
|
|
@@ -37,7 +37,7 @@ export function AvailableModelPicker<
|
|
|
37
37
|
value,
|
|
38
38
|
onChange,
|
|
39
39
|
placeholder = 'Choose a model',
|
|
40
|
-
searchPlaceholder = 'Search models
|
|
40
|
+
searchPlaceholder = 'Search models...',
|
|
41
41
|
emptyLabel = 'No matching models',
|
|
42
42
|
noModelsLabel = 'No models available',
|
|
43
43
|
allowClear = false,
|
|
@@ -102,7 +102,7 @@ function Calendar({
|
|
|
102
102
|
defaultClassNames.week_number
|
|
103
103
|
),
|
|
104
104
|
day: cn(
|
|
105
|
-
"relative
|
|
105
|
+
"relative size-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
106
106
|
props.showWeekNumber
|
|
107
107
|
? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md"
|
|
108
108
|
: "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
@@ -31,7 +31,7 @@ type CarouselContextProps = {
|
|
|
31
31
|
const CarouselContext = React.createContext<CarouselContextProps | null>(null)
|
|
32
32
|
|
|
33
33
|
function useCarousel() {
|
|
34
|
-
const context = React.
|
|
34
|
+
const context = React.use(CarouselContext)
|
|
35
35
|
|
|
36
36
|
if (!context) {
|
|
37
37
|
throw new Error("useCarousel must be used within a <Carousel />")
|
|
@@ -23,7 +23,7 @@ type ChartContextProps = {
|
|
|
23
23
|
const ChartContext = React.createContext<ChartContextProps | null>(null)
|
|
24
24
|
|
|
25
25
|
function useChart() {
|
|
26
|
-
const context = React.
|
|
26
|
+
const context = React.use(ChartContext)
|
|
27
27
|
|
|
28
28
|
if (!context) {
|
|
29
29
|
throw new Error("useChart must be used within a <ChartContainer />")
|
|
@@ -204,7 +204,7 @@ function ChartTooltipContent({
|
|
|
204
204
|
className={cn(
|
|
205
205
|
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
206
206
|
{
|
|
207
|
-
"
|
|
207
|
+
"size-2.5": indicator === "dot",
|
|
208
208
|
"w-1": indicator === "line",
|
|
209
209
|
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
210
210
|
indicator === "dashed",
|
|
@@ -292,7 +292,7 @@ function ChartLegendContent({
|
|
|
292
292
|
<itemConfig.icon />
|
|
293
293
|
) : (
|
|
294
294
|
<div
|
|
295
|
-
className="
|
|
295
|
+
className="size-2 shrink-0 rounded-[2px]"
|
|
296
296
|
style={{
|
|
297
297
|
backgroundColor: item.color,
|
|
298
298
|
}}
|
|
@@ -21,7 +21,7 @@ function Command({
|
|
|
21
21
|
<CommandPrimitive
|
|
22
22
|
data-slot="command"
|
|
23
23
|
className={cn(
|
|
24
|
-
"bg-popover text-popover-foreground flex
|
|
24
|
+
"bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-md",
|
|
25
25
|
className
|
|
26
26
|
)}
|
|
27
27
|
{...props}
|
|
@@ -211,8 +211,8 @@ function FieldError({
|
|
|
211
211
|
return (
|
|
212
212
|
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
213
213
|
{uniqueErrors.map(
|
|
214
|
-
(error
|
|
215
|
-
error?.message && <li key={
|
|
214
|
+
(error) =>
|
|
215
|
+
error?.message && <li key={error.message}>{error.message}</li>
|
|
216
216
|
)}
|
|
217
217
|
</ul>
|
|
218
218
|
)
|
|
@@ -41,8 +41,8 @@ const FormField = <
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const useFormField = () => {
|
|
44
|
-
const fieldContext = React.
|
|
45
|
-
const itemContext = React.
|
|
44
|
+
const fieldContext = React.use(FormFieldContext)
|
|
45
|
+
const itemContext = React.use(FormItemContext)
|
|
46
46
|
const { getFieldState } = useFormContext()
|
|
47
47
|
const formState = useFormState({ name: fieldContext.name })
|
|
48
48
|
const fieldState = getFieldState(fieldContext.name, formState)
|
|
@@ -43,7 +43,7 @@ function InputOTPSlot({
|
|
|
43
43
|
}: React.ComponentProps<"div"> & {
|
|
44
44
|
index: number
|
|
45
45
|
}) {
|
|
46
|
-
const inputOTPContext = React.
|
|
46
|
+
const inputOTPContext = React.use(OTPInputContext)
|
|
47
47
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
|
|
48
48
|
|
|
49
49
|
return (
|
|
@@ -51,7 +51,7 @@ function InputOTPSlot({
|
|
|
51
51
|
data-slot="input-otp-slot"
|
|
52
52
|
data-active={isActive}
|
|
53
53
|
className={cn(
|
|
54
|
-
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex
|
|
54
|
+
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex size-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
|
55
55
|
className
|
|
56
56
|
)}
|
|
57
57
|
{...props}
|
|
@@ -2,9 +2,11 @@ import * as React from "react"
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../lib/utils"
|
|
4
4
|
|
|
5
|
-
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
5
|
+
function Input({ className, type, placeholder, "aria-label": ariaLabel, ...props }: React.ComponentProps<"input">) {
|
|
6
6
|
return (
|
|
7
7
|
<input
|
|
8
|
+
aria-label={ariaLabel ?? (typeof placeholder === "string" ? placeholder : undefined)}
|
|
9
|
+
placeholder={placeholder}
|
|
8
10
|
type={type}
|
|
9
11
|
data-slot="input"
|
|
10
12
|
className={cn(
|
|
@@ -6,6 +6,7 @@ import { cn } from "../../lib/utils"
|
|
|
6
6
|
function NativeSelect({
|
|
7
7
|
className,
|
|
8
8
|
size = "default",
|
|
9
|
+
"aria-label": ariaLabel,
|
|
9
10
|
...props
|
|
10
11
|
}: Omit<React.ComponentProps<"select">, "size"> & { size?: "sm" | "default" }) {
|
|
11
12
|
return (
|
|
@@ -14,6 +15,7 @@ function NativeSelect({
|
|
|
14
15
|
data-slot="native-select-wrapper"
|
|
15
16
|
>
|
|
16
17
|
<select
|
|
18
|
+
aria-label={ariaLabel}
|
|
17
19
|
data-slot="native-select"
|
|
18
20
|
data-size={size}
|
|
19
21
|
className={cn(
|
|
@@ -150,7 +150,7 @@ function NavigationMenuIndicator({
|
|
|
150
150
|
)}
|
|
151
151
|
{...props}
|
|
152
152
|
>
|
|
153
|
-
<div className="bg-border relative top-[60%]
|
|
153
|
+
<div className="bg-border relative top-[60%] size-2 rotate-45 rounded-tl-sm shadow-md" />
|
|
154
154
|
</NavigationMenuPrimitive.Indicator>
|
|
155
155
|
)
|
|
156
156
|
}
|
|
@@ -10,13 +10,13 @@ export function PluginSafetyDisclaimer({ className }: PluginSafetyDisclaimerProp
|
|
|
10
10
|
<div
|
|
11
11
|
role="note"
|
|
12
12
|
className={cn(
|
|
13
|
-
'flex shrink-0 items-start gap-2 border-t border-
|
|
13
|
+
'flex shrink-0 items-start gap-2 border-t border-status-warning-border bg-status-warning-faint px-4 py-2.5 text-[11px] leading-5 text-[var(--text-secondary)]',
|
|
14
14
|
className,
|
|
15
15
|
)}
|
|
16
16
|
>
|
|
17
|
-
<ShieldAlert className="mt-0.5 size-3.5 shrink-0 text-
|
|
17
|
+
<ShieldAlert className="mt-0.5 size-3.5 shrink-0 text-status-warning" />
|
|
18
18
|
<p>
|
|
19
|
-
<span className="font-medium text-
|
|
19
|
+
<span className="font-medium text-status-warning">Heads up:</span>{' '}
|
|
20
20
|
Plugins run with full access to this workspace and can execute code on your device.
|
|
21
21
|
Only install plugins from sources you trust.
|
|
22
22
|
</p>
|
|
@@ -21,7 +21,7 @@ function Progress({
|
|
|
21
21
|
>
|
|
22
22
|
<ProgressPrimitive.Indicator
|
|
23
23
|
data-slot="progress-indicator"
|
|
24
|
-
className="bg-primary
|
|
24
|
+
className="bg-primary size-full flex-1 transition-all"
|
|
25
25
|
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
26
26
|
/>
|
|
27
27
|
</ProgressPrimitive.Root>
|
|
@@ -13,7 +13,7 @@ function ResizablePanelGroup({
|
|
|
13
13
|
<ResizablePrimitive.Group
|
|
14
14
|
data-slot="resizable-panel-group"
|
|
15
15
|
className={cn(
|
|
16
|
-
"flex
|
|
16
|
+
"flex size-full aria-[orientation=vertical]:flex-col",
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|