@sero-ai/ui 0.4.0 → 0.4.2
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-build.log +628 -628
- package/.turbo/turbo-test.log +18 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +22 -2
- package/LICENSE +201 -0
- package/dist/components/ai-elements/agent.cjs +6 -6
- package/dist/components/ai-elements/agent.js +6 -6
- package/dist/components/ai-elements/artifact.cjs +2 -2
- package/dist/components/ai-elements/artifact.js +2 -2
- package/dist/components/ai-elements/attachments.cjs +2 -2
- package/dist/components/ai-elements/attachments.js +2 -2
- package/dist/components/ai-elements/chain-of-thought.cjs +2 -2
- package/dist/components/ai-elements/chain-of-thought.js +2 -2
- package/dist/components/ai-elements/code-block.cjs +7 -5
- package/dist/components/ai-elements/code-block.d.cts +2 -1
- package/dist/components/ai-elements/code-block.d.ts +2 -1
- package/dist/components/ai-elements/code-block.js +7 -5
- package/dist/components/ai-elements/commit.cjs +2 -2
- package/dist/components/ai-elements/commit.js +2 -2
- package/dist/components/ai-elements/confirmation.cjs +1 -1
- package/dist/components/ai-elements/confirmation.js +1 -1
- package/dist/components/ai-elements/conversation.cjs +2 -2
- package/dist/components/ai-elements/conversation.js +2 -2
- package/dist/components/ai-elements/environment-variables.cjs +3 -3
- package/dist/components/ai-elements/environment-variables.js +3 -3
- package/dist/components/ai-elements/file-tree.cjs +1 -1
- package/dist/components/ai-elements/file-tree.js +1 -1
- package/dist/components/ai-elements/inline-citation.cjs +3 -3
- package/dist/components/ai-elements/inline-citation.js +3 -3
- package/dist/components/ai-elements/jsx-preview.cjs +1 -1
- package/dist/components/ai-elements/jsx-preview.js +1 -1
- package/dist/components/ai-elements/message.cjs +1 -1
- package/dist/components/ai-elements/message.js +1 -1
- package/dist/components/ai-elements/package-info.cjs +4 -4
- package/dist/components/ai-elements/package-info.js +4 -4
- package/dist/components/ai-elements/prompt-input-context.cjs +2 -3
- package/dist/components/ai-elements/prompt-input-context.js +2 -3
- package/dist/components/ai-elements/queue.cjs +2 -2
- package/dist/components/ai-elements/queue.js +2 -2
- package/dist/components/ai-elements/reasoning.cjs +2 -2
- package/dist/components/ai-elements/reasoning.js +2 -2
- package/dist/components/ai-elements/sandbox.cjs +3 -3
- package/dist/components/ai-elements/sandbox.js +3 -3
- package/dist/components/ai-elements/schema-display.cjs +12 -12
- package/dist/components/ai-elements/schema-display.js +12 -12
- package/dist/components/ai-elements/speech-input.cjs +18 -2
- package/dist/components/ai-elements/speech-input.js +16 -0
- package/dist/components/ai-elements/stack-trace.cjs +1 -1
- package/dist/components/ai-elements/stack-trace.js +1 -1
- package/dist/components/ai-elements/task.cjs +3 -3
- package/dist/components/ai-elements/task.js +3 -3
- package/dist/components/ai-elements/terminal.cjs +2 -2
- package/dist/components/ai-elements/terminal.js +2 -2
- package/dist/components/ai-elements/test-results.cjs +4 -4
- package/dist/components/ai-elements/test-results.js +4 -4
- package/dist/components/ai-elements/tool.cjs +4 -4
- package/dist/components/ai-elements/tool.js +4 -4
- package/dist/components/ai-elements/transcription.cjs +1 -1
- package/dist/components/ai-elements/transcription.js +1 -1
- package/dist/components/ai-elements/web-preview.cjs +2 -2
- package/dist/components/ai-elements/web-preview.js +2 -2
- package/dist/components/context-editor/CapabilitySection.cjs +2 -2
- package/dist/components/context-editor/CapabilitySection.js +2 -2
- package/dist/components/context-editor/ContextEditor.cjs +2 -2
- package/dist/components/context-editor/ContextEditor.js +2 -2
- package/dist/components/context-editor/PresetBar.cjs +3 -3
- package/dist/components/context-editor/PresetBar.js +3 -3
- package/dist/components/context-editor/SystemPromptSection.cjs +4 -4
- package/dist/components/context-editor/SystemPromptSection.js +4 -4
- package/dist/components/context-editor/parts.cjs +6 -6
- package/dist/components/context-editor/parts.js +6 -6
- package/dist/components/dashboard/activity-list.cjs +2 -2
- package/dist/components/dashboard/activity-list.js +2 -2
- package/dist/components/dashboard/catalog.cjs +1 -322
- package/dist/components/dashboard/catalog.d.cts +1 -2
- package/dist/components/dashboard/catalog.d.ts +1 -2
- package/dist/components/dashboard/catalog.js +0 -322
- package/dist/components/dashboard/catalog.json +312 -0
- package/dist/components/dashboard/empty-state.cjs +1 -1
- package/dist/components/dashboard/empty-state.js +1 -1
- package/dist/components/dashboard/index.d.cts +1 -1
- package/dist/components/dashboard/index.d.ts +1 -1
- package/dist/components/dashboard/item-list.cjs +2 -2
- package/dist/components/dashboard/item-list.js +2 -2
- package/dist/components/dashboard/layout.cjs +1 -1
- package/dist/components/dashboard/layout.js +1 -1
- package/dist/components/dashboard/metric.cjs +1 -1
- package/dist/components/dashboard/metric.js +1 -1
- package/dist/components/dashboard/stale-indicator.cjs +1 -1
- package/dist/components/dashboard/stale-indicator.js +1 -1
- package/dist/components/dashboard/status.cjs +6 -2
- package/dist/components/dashboard/status.js +7 -3
- package/dist/components/dashboard/tone.cjs +9 -1
- package/dist/components/dashboard/tone.d.cts +7 -1
- package/dist/components/dashboard/tone.d.ts +7 -1
- package/dist/components/dashboard/tone.js +8 -0
- package/dist/components/dashboard/typography.cjs +4 -4
- package/dist/components/dashboard/typography.d.cts +1 -1
- package/dist/components/dashboard/typography.d.ts +1 -1
- package/dist/components/dashboard/typography.js +4 -4
- package/dist/components/model-selection/available-model-picker.cjs +6 -6
- package/dist/components/model-selection/available-model-picker.js +6 -6
- package/dist/components/model-selection/thinking-level-picker.cjs +1 -1
- package/dist/components/model-selection/thinking-level-picker.js +1 -1
- package/dist/components/model-selection/thinking-picker.cjs +70 -0
- package/dist/components/model-selection/thinking-picker.d.cts +12 -0
- package/dist/components/model-selection/thinking-picker.d.ts +12 -0
- package/dist/components/model-selection/thinking-picker.js +70 -0
- package/dist/components/ui/accordion.cjs +2 -2
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui/alert-dialog.cjs +4 -2
- package/dist/components/ui/alert-dialog.js +4 -2
- package/dist/components/ui/alert.cjs +2 -2
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/avatar.cjs +2 -2
- package/dist/components/ui/avatar.js +2 -2
- package/dist/components/ui/breadcrumb.cjs +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/button-group.cjs +1 -1
- package/dist/components/ui/button-group.js +1 -1
- package/dist/components/ui/button.cjs +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.cjs +2 -2
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/card.cjs +1 -1
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.cjs +3 -2
- package/dist/components/ui/carousel.js +2 -1
- package/dist/components/ui/chart.cjs +36 -27
- package/dist/components/ui/chart.d.cts +21 -17
- package/dist/components/ui/chart.d.ts +21 -17
- package/dist/components/ui/chart.js +30 -21
- package/dist/components/ui/combobox.cjs +7 -5
- package/dist/components/ui/combobox.js +7 -5
- package/dist/components/ui/command.cjs +3 -3
- package/dist/components/ui/command.js +3 -3
- package/dist/components/ui/context-menu.cjs +10 -7
- package/dist/components/ui/context-menu.js +10 -7
- package/dist/components/ui/dialog.cjs +4 -2
- package/dist/components/ui/dialog.js +4 -2
- package/dist/components/ui/drawer.cjs +4 -2
- package/dist/components/ui/drawer.js +4 -2
- package/dist/components/ui/dropdown-menu.cjs +10 -7
- package/dist/components/ui/dropdown-menu.js +10 -7
- package/dist/components/ui/empty.cjs +2 -2
- package/dist/components/ui/empty.js +2 -2
- package/dist/components/ui/field.cjs +5 -5
- package/dist/components/ui/field.js +5 -5
- package/dist/components/ui/form.cjs +2 -2
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/hover-card.cjs +3 -1
- package/dist/components/ui/hover-card.js +3 -1
- package/dist/components/ui/input-group.cjs +3 -3
- package/dist/components/ui/input-group.js +3 -3
- package/dist/components/ui/input-otp.cjs +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/input.cjs +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/item.cjs +3 -3
- package/dist/components/ui/item.js +3 -3
- package/dist/components/ui/label.cjs +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/menubar.cjs +9 -7
- package/dist/components/ui/menubar.js +9 -7
- package/dist/components/ui/native-select.cjs +1 -1
- package/dist/components/ui/native-select.js +1 -1
- package/dist/components/ui/navigation-menu.cjs +2 -2
- package/dist/components/ui/navigation-menu.js +2 -2
- package/dist/components/ui/plugin-safety-disclaimer.cjs +1 -1
- package/dist/components/ui/plugin-safety-disclaimer.js +1 -1
- package/dist/components/ui/popover.cjs +4 -2
- package/dist/components/ui/popover.js +4 -2
- package/dist/components/ui/select.cjs +5 -3
- package/dist/components/ui/select.js +5 -3
- package/dist/components/ui/sheet.cjs +4 -2
- package/dist/components/ui/sheet.js +4 -2
- package/dist/components/ui/sidebar.cjs +5 -5
- package/dist/components/ui/sidebar.js +5 -5
- package/dist/components/ui/table.cjs +2 -2
- package/dist/components/ui/table.js +2 -2
- package/dist/components/ui/tabs.cjs +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/textarea.cjs +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/toggle.cjs +1 -1
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/tooltip.cjs +3 -1
- package/dist/components/ui/tooltip.js +3 -1
- package/dist/index.cjs +5 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +5 -1
- package/dist/plugin-style-scope-context.cjs +10 -0
- package/dist/plugin-style-scope-context.d.cts +13 -0
- package/dist/plugin-style-scope-context.d.ts +13 -0
- package/dist/plugin-style-scope-context.js +10 -0
- package/dist/plugin-style-scope.cjs +25 -0
- package/dist/plugin-style-scope.d.cts +11 -0
- package/dist/plugin-style-scope.d.ts +11 -0
- package/dist/plugin-style-scope.js +25 -0
- package/dist/reference.cjs +1251 -3
- package/dist/reference.d.cts +11 -5
- package/dist/reference.d.ts +11 -5
- package/dist/reference.js +1224 -6
- package/dist/styles/globals.css +22 -3
- package/dist/styles/plugin-theme.css +80 -0
- package/dist/styles/plugin.css +14 -2
- package/package.json +53 -70
- package/scripts/ensure-pnpm-publish.mjs +23 -0
- package/scripts/smoke-dist.mjs +68 -0
- package/src/components/ai-elements/agent.tsx +6 -6
- package/src/components/ai-elements/artifact.tsx +2 -2
- package/src/components/ai-elements/attachments.tsx +2 -2
- package/src/components/ai-elements/chain-of-thought.tsx +2 -2
- package/src/components/ai-elements/code-block.tsx +6 -3
- package/src/components/ai-elements/commit.tsx +2 -2
- package/src/components/ai-elements/confirmation.tsx +1 -1
- package/src/components/ai-elements/conversation.tsx +2 -2
- package/src/components/ai-elements/environment-variables.tsx +3 -3
- package/src/components/ai-elements/file-tree.tsx +1 -1
- package/src/components/ai-elements/inline-citation.tsx +3 -3
- package/src/components/ai-elements/jsx-preview.tsx +1 -1
- package/src/components/ai-elements/message.tsx +1 -1
- package/src/components/ai-elements/package-info.tsx +4 -4
- package/src/components/ai-elements/prompt-input-context.tsx +3 -2
- package/src/components/ai-elements/queue.tsx +2 -2
- package/src/components/ai-elements/reasoning.tsx +2 -2
- package/src/components/ai-elements/sandbox.tsx +3 -3
- package/src/components/ai-elements/schema-display.tsx +12 -12
- package/src/components/ai-elements/speech-input.tsx +17 -0
- package/src/components/ai-elements/stack-trace.tsx +1 -1
- package/src/components/ai-elements/task.tsx +3 -3
- package/src/components/ai-elements/terminal.tsx +2 -2
- package/src/components/ai-elements/test-results.tsx +4 -4
- package/src/components/ai-elements/tool.tsx +4 -4
- package/src/components/ai-elements/transcription.tsx +1 -1
- package/src/components/ai-elements/web-preview.tsx +2 -2
- package/src/components/context-editor/CapabilitySection.tsx +2 -2
- package/src/components/context-editor/ContextEditor.tsx +2 -2
- package/src/components/context-editor/PresetBar.tsx +3 -3
- package/src/components/context-editor/SystemPromptSection.tsx +4 -4
- package/src/components/context-editor/parts.tsx +6 -6
- package/src/components/dashboard/__tests__/catalog.test.ts +7 -2
- package/src/components/dashboard/__tests__/state.test.tsx +19 -2
- package/src/components/dashboard/activity-list.tsx +2 -2
- package/src/components/dashboard/catalog.json +312 -0
- package/src/components/dashboard/catalog.ts +6 -328
- package/src/components/dashboard/empty-state.tsx +1 -1
- package/src/components/dashboard/index.ts +2 -2
- package/src/components/dashboard/item-list.tsx +2 -2
- package/src/components/dashboard/layout.tsx +1 -1
- package/src/components/dashboard/metric.tsx +1 -1
- package/src/components/dashboard/stale-indicator.tsx +1 -1
- package/src/components/dashboard/status.tsx +15 -2
- package/src/components/dashboard/tone.ts +13 -0
- package/src/components/dashboard/typography.tsx +5 -5
- package/src/components/model-selection/available-model-picker.tsx +7 -7
- package/src/components/model-selection/thinking-level-picker.tsx +1 -1
- package/src/components/model-selection/thinking-picker.tsx +90 -0
- package/src/components/ui/accordion.tsx +2 -2
- package/src/components/ui/alert-dialog.tsx +4 -2
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +2 -2
- package/src/components/ui/breadcrumb.tsx +1 -1
- package/src/components/ui/button-group.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/calendar.tsx +3 -3
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/carousel.tsx +2 -1
- package/src/components/ui/chart.tsx +54 -36
- package/src/components/ui/combobox.tsx +7 -5
- package/src/components/ui/command.tsx +3 -3
- package/src/components/ui/context-menu.tsx +10 -7
- package/src/components/ui/dialog.tsx +4 -2
- package/src/components/ui/drawer.tsx +4 -2
- package/src/components/ui/dropdown-menu.tsx +10 -7
- package/src/components/ui/empty.tsx +2 -2
- package/src/components/ui/field.tsx +5 -5
- package/src/components/ui/form.tsx +2 -2
- package/src/components/ui/hover-card.tsx +3 -1
- package/src/components/ui/input-group.tsx +3 -3
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +3 -3
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/menubar.tsx +9 -7
- package/src/components/ui/native-select.tsx +1 -1
- package/src/components/ui/navigation-menu.tsx +2 -2
- package/src/components/ui/plugin-safety-disclaimer.tsx +1 -1
- package/src/components/ui/popover.tsx +4 -2
- package/src/components/ui/select.tsx +5 -3
- package/src/components/ui/sheet.tsx +4 -2
- package/src/components/ui/sidebar.tsx +5 -5
- package/src/components/ui/table.tsx +2 -2
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/tooltip.tsx +3 -1
- package/src/index.ts +5 -1
- package/src/plugin-style-scope-context.ts +21 -0
- package/src/plugin-style-scope.test.tsx +38 -0
- package/src/plugin-style-scope.tsx +35 -0
- package/src/styles/globals.css +22 -3
- package/src/styles/plugin-theme.css +80 -0
- package/src/styles/plugin.css +14 -2
- package/tsup.config.ts +13 -3
- package/tsup.reference.config.ts +15 -0
- package/dist/components/reference/ActivityExample.cjs +0 -47
- package/dist/components/reference/ActivityExample.d.cts +0 -5
- package/dist/components/reference/ActivityExample.d.ts +0 -5
- package/dist/components/reference/ActivityExample.js +0 -47
- package/dist/components/reference/ResourceExample.cjs +0 -54
- package/dist/components/reference/ResourceExample.d.cts +0 -5
- package/dist/components/reference/ResourceExample.d.ts +0 -5
- package/dist/components/reference/ResourceExample.js +0 -54
- package/dist/components/reference/SchedulerExample.cjs +0 -68
- package/dist/components/reference/SchedulerExample.d.cts +0 -5
- package/dist/components/reference/SchedulerExample.d.ts +0 -5
- package/dist/components/reference/SchedulerExample.js +0 -68
- package/dist/components/reference/StarterExample.cjs +0 -34
- package/dist/components/reference/StarterExample.d.cts +0 -5
- package/dist/components/reference/StarterExample.d.ts +0 -5
- package/dist/components/reference/StarterExample.js +0 -34
- package/dist/components/reference/index.cjs +0 -10
- package/dist/components/reference/index.d.cts +0 -5
- package/dist/components/reference/index.d.ts +0 -5
- package/dist/components/reference/index.js +0 -10
- package/dist/dashboard-catalog.cjs +0 -8
- package/dist/dashboard-catalog.d.cts +0 -1
- package/dist/dashboard-catalog.d.ts +0 -1
- package/dist/dashboard-catalog.js +0 -8
- package/src/dashboard-catalog.ts +0 -13
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Brain } from 'lucide-react';
|
|
2
|
+
import { motion } from 'motion/react';
|
|
3
|
+
import { THINKING_LABELS, THINKING_LEVELS, type ThinkingLevel } from '@sero-ai/common';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
// Compact labels so all seven segments stay on a single line and share the same
|
|
7
|
+
// height — "Extra High" is the only label that would otherwise wrap.
|
|
8
|
+
const COMPACT_LABELS: Record<ThinkingLevel, string> = {
|
|
9
|
+
...THINKING_LABELS,
|
|
10
|
+
xhigh: 'X-High',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
interface ThinkingPickerProps {
|
|
14
|
+
available: readonly string[];
|
|
15
|
+
current: string;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
onSelect: (level: string) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function ThinkingPicker({
|
|
22
|
+
available,
|
|
23
|
+
current,
|
|
24
|
+
disabled,
|
|
25
|
+
onSelect,
|
|
26
|
+
className
|
|
27
|
+
}: ThinkingPickerProps) {
|
|
28
|
+
const levels = disabled
|
|
29
|
+
? THINKING_LEVELS
|
|
30
|
+
: THINKING_LEVELS.filter((level) => level === 'off' || available.includes(level));
|
|
31
|
+
const activeIndex = Math.max(
|
|
32
|
+
0,
|
|
33
|
+
levels.indexOf((disabled ? 'off' : current) as ThinkingLevel),
|
|
34
|
+
);
|
|
35
|
+
const isOff = disabled || current === 'off';
|
|
36
|
+
const isMax = !disabled && current === 'max';
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={cn(`flex flex-col gap-2 border-[var(--border-subtle)] px-3 py-3 transition-opacity duration-150 ${
|
|
41
|
+
disabled ? 'pointer-events-none opacity-40' : ''
|
|
42
|
+
}`, className)}
|
|
43
|
+
>
|
|
44
|
+
<div className="flex items-center gap-1.5">
|
|
45
|
+
<Brain className="size-3 text-[var(--text-muted)]" />
|
|
46
|
+
<span className="text-sm font-semibold uppercase tracking-wider text-[var(--text-muted)]">
|
|
47
|
+
Thinking
|
|
48
|
+
</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div className="relative flex rounded-lg border border-[var(--border-subtle)] bg-[var(--bg-base)] p-0.5">
|
|
51
|
+
<motion.div
|
|
52
|
+
className="absolute inset-y-0.5 rounded-md shadow-sm ring-1 ring-inset ring-white/5"
|
|
53
|
+
initial={false}
|
|
54
|
+
animate={{
|
|
55
|
+
x: `${activeIndex * 100}%`,
|
|
56
|
+
width: `${100 / levels.length}%`,
|
|
57
|
+
}}
|
|
58
|
+
transition={{ type: 'spring', stiffness: 500, damping: 38 }}
|
|
59
|
+
style={{
|
|
60
|
+
background: isOff
|
|
61
|
+
? 'var(--bg-elevated)'
|
|
62
|
+
: isMax
|
|
63
|
+
? 'linear-gradient(135deg, #f59e0b40, #ef444440)'
|
|
64
|
+
: 'linear-gradient(135deg, #6366f140, #8b5cf640)',
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
{levels.map((level) => {
|
|
68
|
+
const isActive = current === level && !disabled;
|
|
69
|
+
const textClass = isActive
|
|
70
|
+
? level === 'max'
|
|
71
|
+
? 'text-status-warning'
|
|
72
|
+
: level === 'off'
|
|
73
|
+
? 'text-[var(--text-primary)]'
|
|
74
|
+
: 'text-[var(--banner-primary)]'
|
|
75
|
+
: 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]';
|
|
76
|
+
return (
|
|
77
|
+
<button
|
|
78
|
+
type="button"
|
|
79
|
+
key={level}
|
|
80
|
+
onClick={() => onSelect(level)}
|
|
81
|
+
className={`relative z-10 flex flex-1 items-center justify-center whitespace-nowrap rounded-md py-1.5 text-sm font-medium leading-none transition-colors duration-150 ${textClass}`}
|
|
82
|
+
>
|
|
83
|
+
{COMPACT_LABELS[level]}
|
|
84
|
+
</button>
|
|
85
|
+
);
|
|
86
|
+
})}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
@@ -33,7 +33,7 @@ function AccordionTrigger({
|
|
|
33
33
|
<AccordionPrimitive.Trigger
|
|
34
34
|
data-slot="accordion-trigger"
|
|
35
35
|
className={cn(
|
|
36
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-
|
|
36
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-base font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
37
37
|
className
|
|
38
38
|
)}
|
|
39
39
|
{...props}
|
|
@@ -53,7 +53,7 @@ function AccordionContent({
|
|
|
53
53
|
return (
|
|
54
54
|
<AccordionPrimitive.Content
|
|
55
55
|
data-slot="accordion-content"
|
|
56
|
-
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-
|
|
56
|
+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-base"
|
|
57
57
|
{...props}
|
|
58
58
|
>
|
|
59
59
|
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|
|
@@ -4,6 +4,7 @@ import * as React from "react"
|
|
|
4
4
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui"
|
|
5
5
|
|
|
6
6
|
import { cn } from "../../lib/utils"
|
|
7
|
+
import { usePluginPortalContainer } from "../../plugin-style-scope-context"
|
|
7
8
|
import { Button } from "./button"
|
|
8
9
|
|
|
9
10
|
function AlertDialog({
|
|
@@ -23,8 +24,9 @@ function AlertDialogTrigger({
|
|
|
23
24
|
function AlertDialogPortal({
|
|
24
25
|
...props
|
|
25
26
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
27
|
+
const container = usePluginPortalContainer()
|
|
26
28
|
return (
|
|
27
|
-
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
29
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" container={container} {...props} />
|
|
28
30
|
)
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -122,7 +124,7 @@ function AlertDialogDescription({
|
|
|
122
124
|
return (
|
|
123
125
|
<AlertDialogPrimitive.Description
|
|
124
126
|
data-slot="alert-dialog-description"
|
|
125
|
-
className={cn("text-muted-foreground text-
|
|
127
|
+
className={cn("text-muted-foreground text-base", className)}
|
|
126
128
|
{...props}
|
|
127
129
|
/>
|
|
128
130
|
)
|
|
@@ -4,7 +4,7 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
4
4
|
import { cn } from "../../lib/utils"
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
|
-
"relative w-full rounded-lg border px-4 py-3 text-
|
|
7
|
+
"relative w-full rounded-lg border px-4 py-3 text-base grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
@@ -55,7 +55,7 @@ function AlertDescription({
|
|
|
55
55
|
<div
|
|
56
56
|
data-slot="alert-description"
|
|
57
57
|
className={cn(
|
|
58
|
-
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-
|
|
58
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-base [&_p]:leading-relaxed",
|
|
59
59
|
className
|
|
60
60
|
)}
|
|
61
61
|
{...props}
|
|
@@ -44,7 +44,7 @@ function AvatarFallback({
|
|
|
44
44
|
<AvatarPrimitive.Fallback
|
|
45
45
|
data-slot="avatar-fallback"
|
|
46
46
|
className={cn(
|
|
47
|
-
"bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-
|
|
47
|
+
"bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-base group-data-[size=sm]/avatar:text-xs",
|
|
48
48
|
className
|
|
49
49
|
)}
|
|
50
50
|
{...props}
|
|
@@ -89,7 +89,7 @@ function AvatarGroupCount({
|
|
|
89
89
|
<div
|
|
90
90
|
data-slot="avatar-group-count"
|
|
91
91
|
className={cn(
|
|
92
|
-
"bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-
|
|
92
|
+
"bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-base ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
93
93
|
className
|
|
94
94
|
)}
|
|
95
95
|
{...props}
|
|
@@ -13,7 +13,7 @@ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
|
13
13
|
<ol
|
|
14
14
|
data-slot="breadcrumb-list"
|
|
15
15
|
className={cn(
|
|
16
|
-
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-
|
|
16
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-base break-words sm:gap-2.5",
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|
|
@@ -49,7 +49,7 @@ function ButtonGroupText({
|
|
|
49
49
|
return (
|
|
50
50
|
<Comp
|
|
51
51
|
className={cn(
|
|
52
|
-
"bg-muted flex items-center gap-2 rounded-md border px-4 text-
|
|
52
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-base font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
53
53
|
className
|
|
54
54
|
)}
|
|
55
55
|
{...props}
|
|
@@ -5,7 +5,7 @@ import { Slot } from "radix-ui"
|
|
|
5
5
|
import { cn } from "../../lib/utils"
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-base font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
@@ -68,7 +68,7 @@ function Calendar({
|
|
|
68
68
|
defaultClassNames.month_caption
|
|
69
69
|
),
|
|
70
70
|
dropdowns: cn(
|
|
71
|
-
"w-full flex items-center text-
|
|
71
|
+
"w-full flex items-center text-base font-medium justify-center h-(--cell-size) gap-1.5",
|
|
72
72
|
defaultClassNames.dropdowns
|
|
73
73
|
),
|
|
74
74
|
dropdown_root: cn(
|
|
@@ -82,8 +82,8 @@ function Calendar({
|
|
|
82
82
|
caption_label: cn(
|
|
83
83
|
"select-none font-medium",
|
|
84
84
|
captionLayout === "label"
|
|
85
|
-
? "text-
|
|
86
|
-
: "rounded-md pl-2 pr-1 flex items-center gap-1 text-
|
|
85
|
+
? "text-base"
|
|
86
|
+
: "rounded-md pl-2 pr-1 flex items-center gap-1 text-base h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
87
87
|
defaultClassNames.caption_label
|
|
88
88
|
),
|
|
89
89
|
table: "w-full border-collapse",
|
|
@@ -42,7 +42,7 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
42
42
|
return (
|
|
43
43
|
<div
|
|
44
44
|
data-slot="card-description"
|
|
45
|
-
className={cn("text-muted-foreground text-
|
|
45
|
+
className={cn("text-muted-foreground text-base", className)}
|
|
46
46
|
{...props}
|
|
47
47
|
/>
|
|
48
48
|
)
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
4
|
import * as RechartsPrimitive from "recharts"
|
|
5
|
+
import type { TooltipValueType } from "recharts"
|
|
3
6
|
|
|
4
7
|
import { cn } from "../../lib/utils"
|
|
5
8
|
|
|
6
9
|
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
10
|
const THEMES = { light: "", dark: ".dark" } as const
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
|
|
13
|
+
type TooltipNameType = number | string
|
|
14
|
+
|
|
15
|
+
export type ChartConfig = Record<
|
|
16
|
+
string,
|
|
17
|
+
{
|
|
11
18
|
label?: React.ReactNode
|
|
12
19
|
icon?: React.ComponentType
|
|
13
20
|
} & (
|
|
14
21
|
| { color?: string; theme?: never }
|
|
15
22
|
| { color?: never; theme: Record<keyof typeof THEMES, string> }
|
|
16
23
|
)
|
|
17
|
-
|
|
24
|
+
>
|
|
18
25
|
|
|
19
26
|
type ChartContextProps = {
|
|
20
27
|
config: ChartConfig
|
|
@@ -23,7 +30,7 @@ type ChartContextProps = {
|
|
|
23
30
|
const ChartContext = React.createContext<ChartContextProps | null>(null)
|
|
24
31
|
|
|
25
32
|
function useChart() {
|
|
26
|
-
const context = React.
|
|
33
|
+
const context = React.useContext(ChartContext)
|
|
27
34
|
|
|
28
35
|
if (!context) {
|
|
29
36
|
throw new Error("useChart must be used within a <ChartContainer />")
|
|
@@ -37,15 +44,20 @@ function ChartContainer({
|
|
|
37
44
|
className,
|
|
38
45
|
children,
|
|
39
46
|
config,
|
|
47
|
+
initialDimension = INITIAL_DIMENSION,
|
|
40
48
|
...props
|
|
41
49
|
}: React.ComponentProps<"div"> & {
|
|
42
50
|
config: ChartConfig
|
|
43
51
|
children: React.ComponentProps<
|
|
44
52
|
typeof RechartsPrimitive.ResponsiveContainer
|
|
45
53
|
>["children"]
|
|
54
|
+
initialDimension?: {
|
|
55
|
+
width: number
|
|
56
|
+
height: number
|
|
57
|
+
}
|
|
46
58
|
}) {
|
|
47
59
|
const uniqueId = React.useId()
|
|
48
|
-
const chartId = `chart-${id
|
|
60
|
+
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`
|
|
49
61
|
|
|
50
62
|
return (
|
|
51
63
|
<ChartContext.Provider value={{ config }}>
|
|
@@ -53,13 +65,15 @@ function ChartContainer({
|
|
|
53
65
|
data-slot="chart"
|
|
54
66
|
data-chart={chartId}
|
|
55
67
|
className={cn(
|
|
56
|
-
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border
|
|
68
|
+
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
57
69
|
className
|
|
58
70
|
)}
|
|
59
71
|
{...props}
|
|
60
72
|
>
|
|
61
73
|
<ChartStyle id={chartId} config={config} />
|
|
62
|
-
<RechartsPrimitive.ResponsiveContainer
|
|
74
|
+
<RechartsPrimitive.ResponsiveContainer
|
|
75
|
+
initialDimension={initialDimension}
|
|
76
|
+
>
|
|
63
77
|
{children}
|
|
64
78
|
</RechartsPrimitive.ResponsiveContainer>
|
|
65
79
|
</div>
|
|
@@ -69,7 +83,7 @@ function ChartContainer({
|
|
|
69
83
|
|
|
70
84
|
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
71
85
|
const colorConfig = Object.entries(config).filter(
|
|
72
|
-
([, config]) => config.theme
|
|
86
|
+
([, config]) => config.theme ?? config.color
|
|
73
87
|
)
|
|
74
88
|
|
|
75
89
|
if (!colorConfig.length) {
|
|
@@ -86,7 +100,7 @@ ${prefix} [data-chart=${id}] {
|
|
|
86
100
|
${colorConfig
|
|
87
101
|
.map(([key, itemConfig]) => {
|
|
88
102
|
const color =
|
|
89
|
-
itemConfig.theme?.[theme as keyof typeof itemConfig.theme]
|
|
103
|
+
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ??
|
|
90
104
|
itemConfig.color
|
|
91
105
|
return color ? ` --color-${key}: ${color};` : null
|
|
92
106
|
})
|
|
@@ -123,7 +137,13 @@ function ChartTooltipContent({
|
|
|
123
137
|
indicator?: "line" | "dot" | "dashed"
|
|
124
138
|
nameKey?: string
|
|
125
139
|
labelKey?: string
|
|
126
|
-
}
|
|
140
|
+
} & Omit<
|
|
141
|
+
RechartsPrimitive.DefaultTooltipContentProps<
|
|
142
|
+
TooltipValueType,
|
|
143
|
+
TooltipNameType
|
|
144
|
+
>,
|
|
145
|
+
"accessibilityLayer"
|
|
146
|
+
>) {
|
|
127
147
|
const { config } = useChart()
|
|
128
148
|
|
|
129
149
|
const tooltipLabel = React.useMemo(() => {
|
|
@@ -132,11 +152,11 @@ function ChartTooltipContent({
|
|
|
132
152
|
}
|
|
133
153
|
|
|
134
154
|
const [item] = payload
|
|
135
|
-
const key = `${labelKey
|
|
155
|
+
const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`
|
|
136
156
|
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
137
157
|
const value =
|
|
138
158
|
!labelKey && typeof label === "string"
|
|
139
|
-
? config[label
|
|
159
|
+
? (config[label]?.label ?? label)
|
|
140
160
|
: itemConfig?.label
|
|
141
161
|
|
|
142
162
|
if (labelFormatter) {
|
|
@@ -171,7 +191,7 @@ function ChartTooltipContent({
|
|
|
171
191
|
return (
|
|
172
192
|
<div
|
|
173
193
|
className={cn(
|
|
174
|
-
"
|
|
194
|
+
"grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
|
|
175
195
|
className
|
|
176
196
|
)}
|
|
177
197
|
>
|
|
@@ -180,15 +200,15 @@ function ChartTooltipContent({
|
|
|
180
200
|
{payload
|
|
181
201
|
.filter((item) => item.type !== "none")
|
|
182
202
|
.map((item, index) => {
|
|
183
|
-
const key = `${nameKey
|
|
203
|
+
const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`
|
|
184
204
|
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
185
|
-
const indicatorColor = color
|
|
205
|
+
const indicatorColor = color ?? item.payload?.fill ?? item.color
|
|
186
206
|
|
|
187
207
|
return (
|
|
188
208
|
<div
|
|
189
|
-
key={
|
|
209
|
+
key={index}
|
|
190
210
|
className={cn(
|
|
191
|
-
"
|
|
211
|
+
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
192
212
|
indicator === "dot" && "items-center"
|
|
193
213
|
)}
|
|
194
214
|
>
|
|
@@ -204,7 +224,7 @@ function ChartTooltipContent({
|
|
|
204
224
|
className={cn(
|
|
205
225
|
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
206
226
|
{
|
|
207
|
-
"
|
|
227
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
208
228
|
"w-1": indicator === "line",
|
|
209
229
|
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
210
230
|
indicator === "dashed",
|
|
@@ -229,12 +249,14 @@ function ChartTooltipContent({
|
|
|
229
249
|
<div className="grid gap-1.5">
|
|
230
250
|
{nestLabel ? tooltipLabel : null}
|
|
231
251
|
<span className="text-muted-foreground">
|
|
232
|
-
{itemConfig?.label
|
|
252
|
+
{itemConfig?.label ?? item.name}
|
|
233
253
|
</span>
|
|
234
254
|
</div>
|
|
235
|
-
{item.value && (
|
|
236
|
-
<span className="
|
|
237
|
-
{item.value
|
|
255
|
+
{item.value != null && (
|
|
256
|
+
<span className="font-mono font-medium text-foreground tabular-nums">
|
|
257
|
+
{typeof item.value === "number"
|
|
258
|
+
? item.value.toLocaleString()
|
|
259
|
+
: String(item.value)}
|
|
238
260
|
</span>
|
|
239
261
|
)}
|
|
240
262
|
</div>
|
|
@@ -256,11 +278,10 @@ function ChartLegendContent({
|
|
|
256
278
|
payload,
|
|
257
279
|
verticalAlign = "bottom",
|
|
258
280
|
nameKey,
|
|
259
|
-
}: React.ComponentProps<"div"> &
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}) {
|
|
281
|
+
}: React.ComponentProps<"div"> & {
|
|
282
|
+
hideIcon?: boolean
|
|
283
|
+
nameKey?: string
|
|
284
|
+
} & RechartsPrimitive.DefaultLegendContentProps) {
|
|
264
285
|
const { config } = useChart()
|
|
265
286
|
|
|
266
287
|
if (!payload?.length) {
|
|
@@ -277,22 +298,22 @@ function ChartLegendContent({
|
|
|
277
298
|
>
|
|
278
299
|
{payload
|
|
279
300
|
.filter((item) => item.type !== "none")
|
|
280
|
-
.map((item) => {
|
|
281
|
-
const key = `${nameKey
|
|
301
|
+
.map((item, index) => {
|
|
302
|
+
const key = `${nameKey ?? item.dataKey ?? "value"}`
|
|
282
303
|
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
283
304
|
|
|
284
305
|
return (
|
|
285
306
|
<div
|
|
286
|
-
key={
|
|
307
|
+
key={index}
|
|
287
308
|
className={cn(
|
|
288
|
-
"
|
|
309
|
+
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
|
|
289
310
|
)}
|
|
290
311
|
>
|
|
291
312
|
{itemConfig?.icon && !hideIcon ? (
|
|
292
313
|
<itemConfig.icon />
|
|
293
314
|
) : (
|
|
294
315
|
<div
|
|
295
|
-
className="
|
|
316
|
+
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
296
317
|
style={{
|
|
297
318
|
backgroundColor: item.color,
|
|
298
319
|
}}
|
|
@@ -306,7 +327,6 @@ function ChartLegendContent({
|
|
|
306
327
|
)
|
|
307
328
|
}
|
|
308
329
|
|
|
309
|
-
// Helper to extract item config from a payload.
|
|
310
330
|
function getPayloadConfigFromPayload(
|
|
311
331
|
config: ChartConfig,
|
|
312
332
|
payload: unknown,
|
|
@@ -340,9 +360,7 @@ function getPayloadConfigFromPayload(
|
|
|
340
360
|
] as string
|
|
341
361
|
}
|
|
342
362
|
|
|
343
|
-
return configLabelKey in config
|
|
344
|
-
? config[configLabelKey]
|
|
345
|
-
: config[key as keyof typeof config]
|
|
363
|
+
return configLabelKey in config ? config[configLabelKey] : config[key]
|
|
346
364
|
}
|
|
347
365
|
|
|
348
366
|
export {
|
|
@@ -5,6 +5,7 @@ import { Combobox as ComboboxPrimitive } from "@base-ui/react"
|
|
|
5
5
|
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react"
|
|
6
6
|
|
|
7
7
|
import { cn } from "../../lib/utils"
|
|
8
|
+
import { usePluginPortalContainer } from "../../plugin-style-scope-context"
|
|
8
9
|
import { Button } from "./button"
|
|
9
10
|
import {
|
|
10
11
|
InputGroup,
|
|
@@ -102,8 +103,9 @@ function ComboboxContent({
|
|
|
102
103
|
ComboboxPrimitive.Positioner.Props,
|
|
103
104
|
"side" | "align" | "sideOffset" | "alignOffset" | "anchor"
|
|
104
105
|
>) {
|
|
106
|
+
const container = usePluginPortalContainer()
|
|
105
107
|
return (
|
|
106
|
-
<ComboboxPrimitive.Portal>
|
|
108
|
+
<ComboboxPrimitive.Portal container={container}>
|
|
107
109
|
<ComboboxPrimitive.Positioner
|
|
108
110
|
side={side}
|
|
109
111
|
sideOffset={sideOffset}
|
|
@@ -148,7 +150,7 @@ function ComboboxItem({
|
|
|
148
150
|
<ComboboxPrimitive.Item
|
|
149
151
|
data-slot="combobox-item"
|
|
150
152
|
className={cn(
|
|
151
|
-
"data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-
|
|
153
|
+
"data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-base outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
152
154
|
className
|
|
153
155
|
)}
|
|
154
156
|
{...props}
|
|
@@ -184,7 +186,7 @@ function ComboboxLabel({
|
|
|
184
186
|
<ComboboxPrimitive.GroupLabel
|
|
185
187
|
data-slot="combobox-label"
|
|
186
188
|
className={cn(
|
|
187
|
-
"text-muted-foreground px-2 py-1.5 text-xs pointer-coarse:px-3 pointer-coarse:py-2 pointer-coarse:text-
|
|
189
|
+
"text-muted-foreground px-2 py-1.5 text-xs pointer-coarse:px-3 pointer-coarse:py-2 pointer-coarse:text-base",
|
|
188
190
|
className
|
|
189
191
|
)}
|
|
190
192
|
{...props}
|
|
@@ -203,7 +205,7 @@ function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
|
203
205
|
<ComboboxPrimitive.Empty
|
|
204
206
|
data-slot="combobox-empty"
|
|
205
207
|
className={cn(
|
|
206
|
-
"text-muted-foreground hidden w-full justify-center py-2 text-center text-
|
|
208
|
+
"text-muted-foreground hidden w-full justify-center py-2 text-center text-base group-data-empty/combobox-content:flex",
|
|
207
209
|
className
|
|
208
210
|
)}
|
|
209
211
|
{...props}
|
|
@@ -233,7 +235,7 @@ function ComboboxChips({
|
|
|
233
235
|
<ComboboxPrimitive.Chips
|
|
234
236
|
data-slot="combobox-chips"
|
|
235
237
|
className={cn(
|
|
236
|
-
"dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border bg-transparent bg-clip-padding px-2.5 py-1.5 text-
|
|
238
|
+
"dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border bg-transparent bg-clip-padding px-2.5 py-1.5 text-base shadow-xs transition-[color,box-shadow] focus-within:ring-[3px] has-aria-invalid:ring-[3px] has-data-[slot=combobox-chip]:px-1.5",
|
|
237
239
|
className
|
|
238
240
|
)}
|
|
239
241
|
{...props}
|
|
@@ -73,7 +73,7 @@ function CommandInput({
|
|
|
73
73
|
<CommandPrimitive.Input
|
|
74
74
|
data-slot="command-input"
|
|
75
75
|
className={cn(
|
|
76
|
-
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent pl-1.5 py-3 text-
|
|
76
|
+
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent pl-1.5 py-3 text-base outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
77
77
|
className
|
|
78
78
|
)}
|
|
79
79
|
{...props}
|
|
@@ -104,7 +104,7 @@ function CommandEmpty({
|
|
|
104
104
|
return (
|
|
105
105
|
<CommandPrimitive.Empty
|
|
106
106
|
data-slot="command-empty"
|
|
107
|
-
className="py-6 text-center text-
|
|
107
|
+
className="py-6 text-center text-base"
|
|
108
108
|
{...props}
|
|
109
109
|
/>
|
|
110
110
|
)
|
|
@@ -147,7 +147,7 @@ function CommandItem({
|
|
|
147
147
|
<CommandPrimitive.Item
|
|
148
148
|
data-slot="command-item"
|
|
149
149
|
className={cn(
|
|
150
|
-
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-
|
|
150
|
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-base outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
151
151
|
className
|
|
152
152
|
)}
|
|
153
153
|
{...props}
|
|
@@ -5,6 +5,7 @@ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
|
5
5
|
import { ContextMenu as ContextMenuPrimitive } from "radix-ui"
|
|
6
6
|
|
|
7
7
|
import { cn } from "../../lib/utils"
|
|
8
|
+
import { usePluginPortalContainer } from "../../plugin-style-scope-context"
|
|
8
9
|
|
|
9
10
|
function ContextMenu({
|
|
10
11
|
...props
|
|
@@ -31,8 +32,9 @@ function ContextMenuGroup({
|
|
|
31
32
|
function ContextMenuPortal({
|
|
32
33
|
...props
|
|
33
34
|
}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
|
35
|
+
const container = usePluginPortalContainer()
|
|
34
36
|
return (
|
|
35
|
-
<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
|
|
37
|
+
<ContextMenuPrimitive.Portal data-slot="context-menu-portal" container={container} {...props} />
|
|
36
38
|
)
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -66,7 +68,7 @@ function ContextMenuSubTrigger({
|
|
|
66
68
|
data-slot="context-menu-sub-trigger"
|
|
67
69
|
data-inset={inset}
|
|
68
70
|
className={cn(
|
|
69
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-
|
|
71
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-base outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
70
72
|
className
|
|
71
73
|
)}
|
|
72
74
|
{...props}
|
|
@@ -97,8 +99,9 @@ function ContextMenuContent({
|
|
|
97
99
|
className,
|
|
98
100
|
...props
|
|
99
101
|
}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
102
|
+
const container = usePluginPortalContainer()
|
|
100
103
|
return (
|
|
101
|
-
<ContextMenuPrimitive.Portal>
|
|
104
|
+
<ContextMenuPrimitive.Portal container={container}>
|
|
102
105
|
<ContextMenuPrimitive.Content
|
|
103
106
|
data-slot="context-menu-content"
|
|
104
107
|
className={cn(
|
|
@@ -126,7 +129,7 @@ function ContextMenuItem({
|
|
|
126
129
|
data-inset={inset}
|
|
127
130
|
data-variant={variant}
|
|
128
131
|
className={cn(
|
|
129
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-3 py-2 text-
|
|
132
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-3 py-2 text-base outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
130
133
|
className
|
|
131
134
|
)}
|
|
132
135
|
{...props}
|
|
@@ -144,7 +147,7 @@ function ContextMenuCheckboxItem({
|
|
|
144
147
|
<ContextMenuPrimitive.CheckboxItem
|
|
145
148
|
data-slot="context-menu-checkbox-item"
|
|
146
149
|
className={cn(
|
|
147
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-
|
|
150
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-base outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
148
151
|
className
|
|
149
152
|
)}
|
|
150
153
|
checked={checked}
|
|
@@ -169,7 +172,7 @@ function ContextMenuRadioItem({
|
|
|
169
172
|
<ContextMenuPrimitive.RadioItem
|
|
170
173
|
data-slot="context-menu-radio-item"
|
|
171
174
|
className={cn(
|
|
172
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-
|
|
175
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-base outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
173
176
|
className
|
|
174
177
|
)}
|
|
175
178
|
{...props}
|
|
@@ -196,7 +199,7 @@ function ContextMenuLabel({
|
|
|
196
199
|
data-slot="context-menu-label"
|
|
197
200
|
data-inset={inset}
|
|
198
201
|
className={cn(
|
|
199
|
-
"text-foreground px-2 py-1.5 text-
|
|
202
|
+
"text-foreground px-2 py-1.5 text-base font-medium data-[inset]:pl-8",
|
|
200
203
|
className
|
|
201
204
|
)}
|
|
202
205
|
{...props}
|