@sero-ai/ui 0.4.1 → 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 -615
- package/.turbo/turbo-test.log +18 -0
- package/.turbo/turbo-typecheck.log +1 -1
- 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/empty-state.cjs +1 -1
- package/dist/components/dashboard/empty-state.js +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/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 +2 -0
- package/dist/index.d.ts +2 -0
- 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 +15 -15
- package/dist/reference.js +15 -15
- 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 +2 -2
- 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/activity-list.tsx +2 -2
- package/src/components/dashboard/empty-state.tsx +1 -1
- 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/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 +2 -0
- 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
|
@@ -443,7 +443,7 @@ function SidebarGroupContent({
|
|
|
443
443
|
<div
|
|
444
444
|
data-slot="sidebar-group-content"
|
|
445
445
|
data-sidebar="group-content"
|
|
446
|
-
className={cn("w-full text-
|
|
446
|
+
className={cn("w-full text-base", className)}
|
|
447
447
|
{...props}
|
|
448
448
|
/>
|
|
449
449
|
)
|
|
@@ -472,7 +472,7 @@ function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
|
472
472
|
}
|
|
473
473
|
|
|
474
474
|
const sidebarMenuButtonVariants = cva(
|
|
475
|
-
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-
|
|
475
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-base outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
476
476
|
{
|
|
477
477
|
variants: {
|
|
478
478
|
variant: {
|
|
@@ -481,9 +481,9 @@ const sidebarMenuButtonVariants = cva(
|
|
|
481
481
|
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
|
|
482
482
|
},
|
|
483
483
|
size: {
|
|
484
|
-
default: "h-8 text-
|
|
484
|
+
default: "h-8 text-base",
|
|
485
485
|
sm: "h-7 text-xs",
|
|
486
|
-
lg: "h-12 text-
|
|
486
|
+
lg: "h-12 text-base group-data-[collapsible=icon]:p-0!",
|
|
487
487
|
},
|
|
488
488
|
},
|
|
489
489
|
defaultVariants: {
|
|
@@ -687,7 +687,7 @@ function SidebarMenuSubButton({
|
|
|
687
687
|
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
688
688
|
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
689
689
|
size === "sm" && "text-xs",
|
|
690
|
-
size === "md" && "text-
|
|
690
|
+
size === "md" && "text-base",
|
|
691
691
|
"group-data-[collapsible=icon]:hidden",
|
|
692
692
|
className
|
|
693
693
|
)}
|
|
@@ -12,7 +12,7 @@ function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
|
12
12
|
>
|
|
13
13
|
<table
|
|
14
14
|
data-slot="table"
|
|
15
|
-
className={cn("w-full caption-bottom text-
|
|
15
|
+
className={cn("w-full caption-bottom text-base", className)}
|
|
16
16
|
{...props}
|
|
17
17
|
/>
|
|
18
18
|
</div>
|
|
@@ -98,7 +98,7 @@ function TableCaption({
|
|
|
98
98
|
return (
|
|
99
99
|
<caption
|
|
100
100
|
data-slot="table-caption"
|
|
101
|
-
className={cn("text-muted-foreground mt-4 text-
|
|
101
|
+
className={cn("text-muted-foreground mt-4 text-base", className)}
|
|
102
102
|
{...props}
|
|
103
103
|
/>
|
|
104
104
|
)
|
|
@@ -64,7 +64,7 @@ function TabsTrigger({
|
|
|
64
64
|
<TabsPrimitive.Trigger
|
|
65
65
|
data-slot="tabs-trigger"
|
|
66
66
|
className={cn(
|
|
67
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-
|
|
67
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-base font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
68
68
|
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
|
|
69
69
|
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground",
|
|
70
70
|
"after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
|
|
@@ -9,7 +9,7 @@ function Textarea({ className, placeholder, "aria-label": ariaLabel, ...props }:
|
|
|
9
9
|
placeholder={placeholder}
|
|
10
10
|
data-slot="textarea"
|
|
11
11
|
className={cn(
|
|
12
|
-
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-
|
|
12
|
+
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-base",
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
@@ -7,7 +7,7 @@ import { Toggle as TogglePrimitive } from "radix-ui"
|
|
|
7
7
|
import { cn } from "../../lib/utils"
|
|
8
8
|
|
|
9
9
|
const toggleVariants = cva(
|
|
10
|
-
"inline-flex items-center justify-center gap-2 rounded-md text-
|
|
10
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-base font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
@@ -4,6 +4,7 @@ import * as React from "react"
|
|
|
4
4
|
import { Tooltip as TooltipPrimitive } from "radix-ui"
|
|
5
5
|
|
|
6
6
|
import { cn } from "../../lib/utils"
|
|
7
|
+
import { usePluginPortalContainer } from "../../plugin-style-scope-context"
|
|
7
8
|
|
|
8
9
|
function TooltipProvider({
|
|
9
10
|
delayDuration = 0,
|
|
@@ -36,8 +37,9 @@ function TooltipContent({
|
|
|
36
37
|
children,
|
|
37
38
|
...props
|
|
38
39
|
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
40
|
+
const container = usePluginPortalContainer()
|
|
39
41
|
return (
|
|
40
|
-
<TooltipPrimitive.Portal>
|
|
42
|
+
<TooltipPrimitive.Portal container={container}>
|
|
41
43
|
<TooltipPrimitive.Content
|
|
42
44
|
data-slot="tooltip-content"
|
|
43
45
|
sideOffset={sideOffset}
|
package/src/index.ts
CHANGED
|
@@ -142,3 +142,5 @@ export type { DashboardComponentCatalogEntry } from "./components/dashboard/cata
|
|
|
142
142
|
export * from "./components/model-selection/available-model-picker";
|
|
143
143
|
export * from "./components/model-selection/model-warning-list";
|
|
144
144
|
export * from "./components/model-selection/thinking-level-picker";
|
|
145
|
+
export { PluginStyleScope, type PluginStyleScopeProps } from './plugin-style-scope';
|
|
146
|
+
export { usePluginPortalContainer } from './plugin-style-scope-context';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createContext, useContext, type Context } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface PluginStyleScopeValue {
|
|
4
|
+
pluginId: string;
|
|
5
|
+
portalContainer: HTMLDivElement | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
var __sero_plugin_style_scope_context__: Context<PluginStyleScopeValue | null> | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// A single shared context instance across every federated copy of @sero-ai/ui,
|
|
13
|
+
// so a plugin's portal primitives read the container the host provider set.
|
|
14
|
+
export const PluginStyleScopeContext = globalThis.__sero_plugin_style_scope_context__
|
|
15
|
+
?? createContext<PluginStyleScopeValue | null>(null);
|
|
16
|
+
|
|
17
|
+
globalThis.__sero_plugin_style_scope_context__ = PluginStyleScopeContext;
|
|
18
|
+
|
|
19
|
+
export function usePluginPortalContainer(): HTMLElement | undefined {
|
|
20
|
+
return useContext(PluginStyleScopeContext)?.portalContainer ?? undefined;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { act } from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { afterEach, describe, expect, it } from 'vitest';
|
|
4
|
+
import { PluginStyleScope } from './plugin-style-scope';
|
|
5
|
+
import { usePluginPortalContainer } from './plugin-style-scope-context';
|
|
6
|
+
|
|
7
|
+
(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean })
|
|
8
|
+
.IS_REACT_ACT_ENVIRONMENT = true;
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
document.body.replaceChildren();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
describe('PluginStyleScope', () => {
|
|
15
|
+
it('owns and removes an independent body portal container', () => {
|
|
16
|
+
const mount = document.createElement('div');
|
|
17
|
+
document.body.append(mount);
|
|
18
|
+
const root = createRoot(mount);
|
|
19
|
+
|
|
20
|
+
function Probe() {
|
|
21
|
+
const container = usePluginPortalContainer();
|
|
22
|
+
return <span data-container={container?.dataset.seroPluginPortals} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
act(() => root.render(
|
|
26
|
+
<PluginStyleScope pluginId="admin" surfaceId="surface-1">
|
|
27
|
+
<Probe />
|
|
28
|
+
</PluginStyleScope>,
|
|
29
|
+
));
|
|
30
|
+
|
|
31
|
+
const portal = document.body.querySelector('[data-sero-plugin-portals="surface-1"]');
|
|
32
|
+
expect(portal?.getAttribute('data-sero-plugin')).toBe('admin');
|
|
33
|
+
expect(mount.querySelector('span')?.getAttribute('data-container')).toBe('surface-1');
|
|
34
|
+
|
|
35
|
+
act(() => root.unmount());
|
|
36
|
+
expect(portal?.isConnected).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useInsertionEffect, useMemo, type ReactNode } from 'react';
|
|
2
|
+
import { PluginStyleScopeContext } from './plugin-style-scope-context';
|
|
3
|
+
|
|
4
|
+
export interface PluginStyleScopeProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
pluginId: string;
|
|
7
|
+
surfaceId: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function PluginStyleScope({ children, pluginId, surfaceId }: PluginStyleScopeProps) {
|
|
11
|
+
const portalContainer = useMemo(() => {
|
|
12
|
+
if (typeof document === 'undefined') return null;
|
|
13
|
+
const container = document.createElement('div');
|
|
14
|
+
container.dataset.seroPlugin = pluginId;
|
|
15
|
+
container.dataset.seroPluginPortals = surfaceId;
|
|
16
|
+
return container;
|
|
17
|
+
}, [pluginId, surfaceId]);
|
|
18
|
+
|
|
19
|
+
useInsertionEffect(() => {
|
|
20
|
+
if (!portalContainer) return undefined;
|
|
21
|
+
document.body.append(portalContainer);
|
|
22
|
+
return () => portalContainer.remove();
|
|
23
|
+
}, [portalContainer]);
|
|
24
|
+
|
|
25
|
+
const value = useMemo(
|
|
26
|
+
() => ({ pluginId, portalContainer }),
|
|
27
|
+
[pluginId, portalContainer],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<PluginStyleScopeContext.Provider value={value}>
|
|
32
|
+
{children}
|
|
33
|
+
</PluginStyleScopeContext.Provider>
|
|
34
|
+
);
|
|
35
|
+
}
|
package/src/styles/globals.css
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
/* Typography (themeable) */
|
|
117
117
|
--font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
118
118
|
--font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
|
|
119
|
-
--font-size-base:
|
|
119
|
+
--font-size-base: 13px;
|
|
120
120
|
|
|
121
121
|
/* Spacing */
|
|
122
122
|
--space-xs: 4px;
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
|
|
133
133
|
/* Sero font sizes (legacy — use Tailwind text-* for new components) */
|
|
134
134
|
--sero-text-xs: 12px;
|
|
135
|
-
--sero-text-
|
|
135
|
+
--sero-text-base: 13px;
|
|
136
136
|
--sero-text-base: 14px;
|
|
137
137
|
--sero-text-lg: 15px;
|
|
138
138
|
--sero-text-xl: 16px;
|
|
@@ -236,6 +236,14 @@
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
@theme inline {
|
|
239
|
+
--text-xs: 0.8rem;
|
|
240
|
+
--text-xs--line-height: 1rem;
|
|
241
|
+
|
|
242
|
+
--text-sm: 0.9rem;
|
|
243
|
+
--text-sm--line-height: 1.2rem;
|
|
244
|
+
|
|
245
|
+
--text-base--line-height: 1.4rem;
|
|
246
|
+
|
|
239
247
|
--radius-sm: calc(var(--radius) - 4px);
|
|
240
248
|
--radius-md: calc(var(--radius) - 2px);
|
|
241
249
|
--radius-lg: var(--radius);
|
|
@@ -483,7 +491,7 @@
|
|
|
483
491
|
}
|
|
484
492
|
|
|
485
493
|
html {
|
|
486
|
-
font-size: var(--font-size-base,
|
|
494
|
+
font-size: var(--font-size-base, 13px);
|
|
487
495
|
font-family: var(--font-sans);
|
|
488
496
|
}
|
|
489
497
|
|
|
@@ -495,3 +503,14 @@ html {
|
|
|
495
503
|
@apply bg-background text-foreground;
|
|
496
504
|
}
|
|
497
505
|
}
|
|
506
|
+
|
|
507
|
+
@media (prefers-reduced-motion: reduce) {
|
|
508
|
+
*,
|
|
509
|
+
*::before,
|
|
510
|
+
*::after {
|
|
511
|
+
animation-duration: 0.01ms !important;
|
|
512
|
+
animation-iteration-count: 1 !important;
|
|
513
|
+
scroll-behavior: auto !important;
|
|
514
|
+
transition-duration: 0.01ms !important;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@theme inline {
|
|
2
|
+
--text-xs: 0.8rem;
|
|
3
|
+
--text-xs--line-height: 1rem;
|
|
4
|
+
|
|
5
|
+
--text-sm: 0.9rem;
|
|
6
|
+
--text-sm--line-height: 1.2rem;
|
|
7
|
+
|
|
8
|
+
--text-base--line-height: 1.4rem;
|
|
9
|
+
|
|
10
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
11
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
12
|
+
--radius-lg: var(--radius);
|
|
13
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
14
|
+
--radius-2xl: calc(var(--radius) + 8px);
|
|
15
|
+
--radius-3xl: calc(var(--radius) + 12px);
|
|
16
|
+
--radius-4xl: calc(var(--radius) + 16px);
|
|
17
|
+
--color-background: var(--background);
|
|
18
|
+
--color-foreground: var(--foreground);
|
|
19
|
+
--color-brand-primary: var(--brand-primary);
|
|
20
|
+
--color-brand-primary-foreground: var(--brand-primary-foreground);
|
|
21
|
+
--color-brand-primary-muted: var(--brand-primary-muted);
|
|
22
|
+
--color-brand-primary-subtle: var(--brand-primary-subtle);
|
|
23
|
+
--color-brand-primary-faint: var(--brand-primary-faint);
|
|
24
|
+
--color-brand-primary-border: var(--brand-primary-border);
|
|
25
|
+
--color-brand-secondary: var(--brand-secondary);
|
|
26
|
+
--color-brand-secondary-foreground: var(--brand-secondary-foreground);
|
|
27
|
+
--color-brand-secondary-muted: var(--brand-secondary-muted);
|
|
28
|
+
--color-brand-secondary-subtle: var(--brand-secondary-subtle);
|
|
29
|
+
--color-brand-secondary-faint: var(--brand-secondary-faint);
|
|
30
|
+
--color-brand-secondary-border: var(--brand-secondary-border);
|
|
31
|
+
--color-status-success: var(--status-success);
|
|
32
|
+
--color-status-success-muted: var(--status-success-muted);
|
|
33
|
+
--color-status-success-subtle: var(--status-success-subtle);
|
|
34
|
+
--color-status-success-faint: var(--status-success-faint);
|
|
35
|
+
--color-status-success-border: var(--status-success-border);
|
|
36
|
+
--color-status-warning: var(--status-warning);
|
|
37
|
+
--color-status-warning-muted: var(--status-warning-muted);
|
|
38
|
+
--color-status-warning-subtle: var(--status-warning-subtle);
|
|
39
|
+
--color-status-warning-faint: var(--status-warning-faint);
|
|
40
|
+
--color-status-warning-border: var(--status-warning-border);
|
|
41
|
+
--color-status-error: var(--status-error);
|
|
42
|
+
--color-status-error-muted: var(--status-error-muted);
|
|
43
|
+
--color-status-error-subtle: var(--status-error-subtle);
|
|
44
|
+
--color-status-error-faint: var(--status-error-faint);
|
|
45
|
+
--color-status-error-border: var(--status-error-border);
|
|
46
|
+
--color-status-info: var(--status-info);
|
|
47
|
+
--color-status-info-muted: var(--status-info-muted);
|
|
48
|
+
--color-status-info-subtle: var(--status-info-subtle);
|
|
49
|
+
--color-status-info-faint: var(--status-info-faint);
|
|
50
|
+
--color-status-info-border: var(--status-info-border);
|
|
51
|
+
--color-card: var(--card);
|
|
52
|
+
--color-card-foreground: var(--card-foreground);
|
|
53
|
+
--color-popover: var(--popover);
|
|
54
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
55
|
+
--color-primary: var(--primary);
|
|
56
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
57
|
+
--color-secondary: var(--secondary);
|
|
58
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
59
|
+
--color-muted: var(--muted);
|
|
60
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
61
|
+
--color-accent: var(--accent);
|
|
62
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
63
|
+
--color-destructive: var(--destructive);
|
|
64
|
+
--color-border: var(--border);
|
|
65
|
+
--color-input: var(--input);
|
|
66
|
+
--color-ring: var(--ring);
|
|
67
|
+
--color-chart-1: var(--chart-1);
|
|
68
|
+
--color-chart-2: var(--chart-2);
|
|
69
|
+
--color-chart-3: var(--chart-3);
|
|
70
|
+
--color-chart-4: var(--chart-4);
|
|
71
|
+
--color-chart-5: var(--chart-5);
|
|
72
|
+
--color-sidebar: var(--sidebar);
|
|
73
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
74
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
75
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
76
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
77
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
78
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
79
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
80
|
+
}
|
package/src/styles/plugin.css
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
@import "shadcn/tailwind.css";
|
|
4
|
+
@import "./plugin-theme.css";
|
|
5
|
+
|
|
6
|
+
@source "../components";
|
|
7
|
+
|
|
8
|
+
@custom-variant dark (&:is(.dark *));
|
|
2
9
|
|
|
3
10
|
/* Federated Sero plugins should import this file, then add plugin-local
|
|
4
|
-
@source directives.
|
|
11
|
+
@source directives. The seroPluginCssScope Vite helper rewrites this file's
|
|
12
|
+
document-level selectors (:root/:host theme blocks, html/body preflight) to
|
|
13
|
+
:scope, so a plugin's default Tailwind theme and resets are self-contained on
|
|
14
|
+
its own scope root. Sero design tokens (--background, --brand-*, …) are still
|
|
15
|
+
owned by the host: plugin-theme.css references them via @theme inline, so
|
|
16
|
+
they inherit from the host document root. */
|