@devxcrew/react-ui 0.0.0-stage → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -2
- package/package.json +105 -4
- package/src/blocks/agent-chat-workspace/agent-chat-workspace.tsx +162 -0
- package/src/blocks/agent-chat-workspace/index.ts +2 -0
- package/src/blocks/agent-provider-settings/agent-provider-settings.tsx +183 -0
- package/src/blocks/agent-provider-settings/index.ts +2 -0
- package/src/blocks/agent-task-workspace/agent-task-workspace.tsx +48 -0
- package/src/blocks/agent-task-workspace/index.ts +2 -0
- package/src/blocks/analysis-context/analysis-context.tsx +6 -0
- package/src/blocks/analysis-context/index.ts +1 -0
- package/src/blocks/app-header/app-header.tsx +159 -0
- package/src/blocks/app-header/index.ts +2 -0
- package/src/blocks/archived-chat-workspace/archived-chat-workspace.tsx +29 -0
- package/src/blocks/archived-chat-workspace/index.ts +2 -0
- package/src/blocks/auth/README.md +32 -0
- package/src/blocks/auth/admin-login-page.tsx +15 -0
- package/src/blocks/auth/admin-password-forgot-page.tsx +5 -0
- package/src/blocks/auth/auth-page-layout.tsx +90 -0
- package/src/blocks/auth/client-login-page.tsx +20 -0
- package/src/blocks/auth/client-password-forgot-page.tsx +5 -0
- package/src/blocks/auth/identity-management-desk.tsx +530 -0
- package/src/blocks/auth/index.ts +12 -0
- package/src/blocks/auth/login-page.tsx +206 -0
- package/src/blocks/auth/password-forgot-page.tsx +60 -0
- package/src/blocks/auth/portal-pages.tsx +32 -0
- package/src/blocks/auth/privileged-desk.tsx +55 -0
- package/src/blocks/auth/register-page.tsx +117 -0
- package/src/blocks/auth/session-boundary.tsx +296 -0
- package/src/blocks/auth/super-admin-login-page.tsx +15 -0
- package/src/blocks/auth/super-admin-password-forgot-page.tsx +5 -0
- package/src/blocks/blog/blog-card.tsx +156 -0
- package/src/blocks/blog/blog-reader.tsx +175 -0
- package/src/blocks/blog/blog-types.ts +47 -0
- package/src/blocks/blog/index.ts +3 -0
- package/src/blocks/chat-composer/chat-composer.tsx +140 -0
- package/src/blocks/chat-composer/index.ts +1 -0
- package/src/blocks/chat-history/chat-history.tsx +59 -0
- package/src/blocks/chat-history/index.ts +1 -0
- package/src/blocks/chat-response-progress/chat-response-progress.tsx +34 -0
- package/src/blocks/chat-response-progress/index.ts +2 -0
- package/src/blocks/chat-runtime-controls/chat-runtime-controls.tsx +56 -0
- package/src/blocks/chat-runtime-controls/index.ts +2 -0
- package/src/blocks/chat-runtime-trace/chat-runtime-trace.tsx +71 -0
- package/src/blocks/chat-runtime-trace/index.ts +2 -0
- package/src/blocks/codex-connection-settings/codex-connection-settings.tsx +42 -0
- package/src/blocks/codex-connection-settings/index.ts +1 -0
- package/src/blocks/dropzone/dropzone-file-item.tsx +113 -0
- package/src/blocks/dropzone/dropzone-types.ts +32 -0
- package/src/blocks/dropzone/dropzone.tsx +216 -0
- package/src/blocks/dropzone/index.ts +3 -0
- package/src/blocks/ecommerce/cart/cart-drawer.tsx +228 -0
- package/src/blocks/ecommerce/cart/cart-types.ts +27 -0
- package/src/blocks/ecommerce/cart/index.ts +2 -0
- package/src/blocks/ecommerce/categories/categories-types.ts +23 -0
- package/src/blocks/ecommerce/categories/category-showcase.tsx +125 -0
- package/src/blocks/ecommerce/categories/index.ts +2 -0
- package/src/blocks/ecommerce/checkout/checkout-types.ts +48 -0
- package/src/blocks/ecommerce/checkout/checkout-wizard.tsx +468 -0
- package/src/blocks/ecommerce/checkout/index.ts +2 -0
- package/src/blocks/ecommerce/comparison/comparison-types.ts +28 -0
- package/src/blocks/ecommerce/comparison/index.ts +2 -0
- package/src/blocks/ecommerce/comparison/product-comparison.tsx +174 -0
- package/src/blocks/ecommerce/coupon-wallet/coupon-wallet-types.ts +21 -0
- package/src/blocks/ecommerce/coupon-wallet/coupon-wallet.tsx +154 -0
- package/src/blocks/ecommerce/coupon-wallet/index.ts +2 -0
- package/src/blocks/ecommerce/delivery-tracker/delivery-tracker-types.ts +20 -0
- package/src/blocks/ecommerce/delivery-tracker/delivery-tracker.tsx +169 -0
- package/src/blocks/ecommerce/delivery-tracker/index.ts +2 -0
- package/src/blocks/ecommerce/index.ts +12 -0
- package/src/blocks/ecommerce/payment-methods/index.ts +2 -0
- package/src/blocks/ecommerce/payment-methods/payment-method-selector.tsx +224 -0
- package/src/blocks/ecommerce/payment-methods/payment-methods-types.ts +21 -0
- package/src/blocks/ecommerce/price-history/index.ts +2 -0
- package/src/blocks/ecommerce/price-history/price-history-chart.tsx +217 -0
- package/src/blocks/ecommerce/price-history/price-history-types.ts +16 -0
- package/src/blocks/ecommerce/reviews/index.ts +2 -0
- package/src/blocks/ecommerce/reviews/reviews-section.tsx +309 -0
- package/src/blocks/ecommerce/reviews/reviews-types.ts +26 -0
- package/src/blocks/ecommerce/wishlist/index.ts +2 -0
- package/src/blocks/ecommerce/wishlist/wishlist-grid.tsx +149 -0
- package/src/blocks/ecommerce/wishlist/wishlist-types.ts +19 -0
- package/src/blocks/execution-status/README.md +25 -0
- package/src/blocks/execution-status/execution-status.tsx +135 -0
- package/src/blocks/execution-status/index.ts +2 -0
- package/src/blocks/file-tree/file-icons.tsx +84 -0
- package/src/blocks/file-tree/file-tree-node.tsx +158 -0
- package/src/blocks/file-tree/file-tree-types.ts +33 -0
- package/src/blocks/file-tree/file-tree.tsx +163 -0
- package/src/blocks/file-tree/index.ts +5 -0
- package/src/blocks/filter-builder/filter-builder.tsx +169 -0
- package/src/blocks/filter-builder/filter-row.tsx +164 -0
- package/src/blocks/filter-builder/filter-types.ts +61 -0
- package/src/blocks/filter-builder/index.ts +12 -0
- package/src/blocks/footer/footer-types.ts +35 -0
- package/src/blocks/footer/index.ts +2 -0
- package/src/blocks/footer/site-footer.tsx +212 -0
- package/src/blocks/form/form-block.tsx +113 -0
- package/src/blocks/form/form-lookup-field.tsx +60 -0
- package/src/blocks/form/index.ts +4 -0
- package/src/blocks/handover-stack/handover-stack.tsx +41 -0
- package/src/blocks/handover-stack/index.ts +1 -0
- package/src/blocks/idea-handover/idea-handover-readiness.ts +41 -0
- package/src/blocks/idea-handover/idea-handover-workspace.tsx +150 -0
- package/src/blocks/idea-handover/index.ts +4 -0
- package/src/blocks/kanban/index.ts +11 -0
- package/src/blocks/kanban/kanban-board.tsx +146 -0
- package/src/blocks/kanban/kanban-card.tsx +149 -0
- package/src/blocks/kanban/kanban-column.tsx +102 -0
- package/src/blocks/kanban/kanban-types.ts +38 -0
- package/src/blocks/loader/global-loader.tsx +90 -0
- package/src/blocks/loader/index.ts +1 -0
- package/src/blocks/mascot/README.md +21 -0
- package/src/blocks/mascot/index.ts +2 -0
- package/src/blocks/mascot/mascot.tsx +202 -0
- package/src/blocks/master-list/README.md +21 -0
- package/src/blocks/master-list/index.ts +12 -0
- package/src/blocks/master-list/master-form.tsx +157 -0
- package/src/blocks/master-list/master-list-desk.tsx +370 -0
- package/src/blocks/master-list/master-list.tsx +189 -0
- package/src/blocks/master-list/types.ts +18 -0
- package/src/blocks/mermaid-preview/index.ts +1 -0
- package/src/blocks/mermaid-preview/mermaid-preview.tsx +164 -0
- package/src/blocks/notifications/README.md +7 -0
- package/src/blocks/notifications/index.ts +1 -0
- package/src/blocks/notifications/notification-center-page.tsx +73 -0
- package/src/blocks/pricing/index.ts +7 -0
- package/src/blocks/pricing/pricing-table.tsx +173 -0
- package/src/blocks/pricing/pricing-types.ts +34 -0
- package/src/blocks/product-card/index.ts +2 -0
- package/src/blocks/product-card/product-card-types.ts +35 -0
- package/src/blocks/product-card/product-card.tsx +183 -0
- package/src/blocks/table/data-table-block.tsx +313 -0
- package/src/blocks/table/data-table-filter-menu.tsx +48 -0
- package/src/blocks/table/data-table-icon-menu-trigger.tsx +44 -0
- package/src/blocks/table/data-table-menu-content.tsx +32 -0
- package/src/blocks/table/data-table-pagination.tsx +149 -0
- package/src/blocks/table/data-table-row-actions.tsx +53 -0
- package/src/blocks/table/data-table-status.tsx +42 -0
- package/src/blocks/table/data-table-toolbar.tsx +124 -0
- package/src/blocks/table/data-table-totals.tsx +31 -0
- package/src/blocks/table/index.ts +13 -0
- package/src/blocks/workspace/index.ts +19 -0
- package/src/blocks/workspace/workspace-action-card.tsx +73 -0
- package/src/blocks/workspace/workspace-application-header.tsx +67 -0
- package/src/blocks/workspace/workspace-entity-card.tsx +48 -0
- package/src/blocks/workspace/workspace-health-summary.tsx +15 -0
- package/src/blocks/workspace/workspace-metric-card.tsx +97 -0
- package/src/blocks/workspace/workspace-page-header.tsx +43 -0
- package/src/blocks/workspace/workspace-publish-status.tsx +15 -0
- package/src/blocks/workspace/workspace-route-checklist.tsx +28 -0
- package/src/blocks/workspace/workspace-runtime-status.tsx +48 -0
- package/src/blocks/workspace/workspace-section-card.tsx +42 -0
- package/src/components/accordion.tsx +65 -0
- package/src/components/alert-dialog.tsx +160 -0
- package/src/components/alert.tsx +68 -0
- package/src/components/aspect-ratio.tsx +22 -0
- package/src/components/attachment.tsx +195 -0
- package/src/components/avatar.tsx +90 -0
- package/src/components/badge.tsx +55 -0
- package/src/components/breadcrumb.tsx +100 -0
- package/src/components/bubble.tsx +123 -0
- package/src/components/button-group.tsx +79 -0
- package/src/components/button.tsx +71 -0
- package/src/components/calendar.tsx +185 -0
- package/src/components/card.tsx +100 -0
- package/src/components/carousel.tsx +229 -0
- package/src/components/chart.tsx +338 -0
- package/src/components/checkbox.tsx +27 -0
- package/src/components/collapsible.tsx +15 -0
- package/src/components/combobox.tsx +269 -0
- package/src/components/command.tsx +181 -0
- package/src/components/compact-model-switcher.tsx +128 -0
- package/src/components/context-menu.tsx +244 -0
- package/src/components/dialog.tsx +138 -0
- package/src/components/direction.tsx +1 -0
- package/src/components/drawer.tsx +208 -0
- package/src/components/dropdown-menu.tsx +257 -0
- package/src/components/empty.tsx +93 -0
- package/src/components/field.tsx +232 -0
- package/src/components/hover-card.tsx +45 -0
- package/src/components/input-group.tsx +146 -0
- package/src/components/input-otp.tsx +83 -0
- package/src/components/input.tsx +19 -0
- package/src/components/item.tsx +188 -0
- package/src/components/kbd.tsx +26 -0
- package/src/components/label.tsx +17 -0
- package/src/components/markdown-content.tsx +113 -0
- package/src/components/marker.tsx +67 -0
- package/src/components/menubar.tsx +267 -0
- package/src/components/message-scroller.tsx +91 -0
- package/src/components/message.tsx +84 -0
- package/src/components/native-select.tsx +54 -0
- package/src/components/navigation-menu.tsx +160 -0
- package/src/components/pagination.tsx +118 -0
- package/src/components/popover.tsx +74 -0
- package/src/components/progress.tsx +82 -0
- package/src/components/questionnaire.tsx +150 -0
- package/src/components/radio-group.tsx +35 -0
- package/src/components/resizable.tsx +41 -0
- package/src/components/rich-text-editor.tsx +604 -0
- package/src/components/scroll-area.tsx +47 -0
- package/src/components/select.tsx +189 -0
- package/src/components/separator.tsx +18 -0
- package/src/components/sheet.tsx +125 -0
- package/src/components/sidebar.tsx +693 -0
- package/src/components/skeleton.tsx +13 -0
- package/src/components/slider.tsx +51 -0
- package/src/components/sonner.tsx +45 -0
- package/src/components/sparkline.tsx +231 -0
- package/src/components/spinner.tsx +20 -0
- package/src/components/status-badge.tsx +114 -0
- package/src/components/switch.tsx +31 -0
- package/src/components/table.tsx +91 -0
- package/src/components/tabs.tsx +72 -0
- package/src/components/textarea.tsx +17 -0
- package/src/components/toast.tsx +222 -0
- package/src/components/toggle-group.tsx +85 -0
- package/src/components/toggle.tsx +42 -0
- package/src/components/tooltip.tsx +53 -0
- package/src/design-system/README.md +55 -0
- package/src/design-system/action-intents.ts +21 -0
- package/src/design-system/agent-manifest.ts +83 -0
- package/src/design-system/block-registry.ts +272 -0
- package/src/design-system/component-registry.ts +142 -0
- package/src/design-system/contracts.ts +69 -0
- package/src/design-system/defaults.ts +3 -0
- package/src/design-system/index.ts +29 -0
- package/src/design-system/mcp-server.ts +156 -0
- package/src/design-system/page-registry.ts +74 -0
- package/src/design-system/selection.ts +67 -0
- package/src/design-system/template-registry.ts +33 -0
- package/src/features/interface-topology/index.ts +14 -0
- package/src/features/interface-topology/interface-topology.types.ts +40 -0
- package/src/features/interface-topology/topology-control.tsx +18 -0
- package/src/features/interface-topology/topology-inspector.tsx +228 -0
- package/src/features/interface-topology/topology-marker.tsx +47 -0
- package/src/features/interface-topology/topology-region.tsx +44 -0
- package/src/features/interface-topology/use-interface-topology.ts +178 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-scroll-follow.ts +22 -0
- package/src/index.ts +11 -0
- package/src/layouts/README.md +65 -0
- package/src/layouts/agent-workspace/agent-activity-rail.tsx +101 -0
- package/src/layouts/agent-workspace/agent-workspace.tsx +27 -0
- package/src/layouts/agent-workspace/agent-workspace.types.ts +28 -0
- package/src/layouts/agent-workspace/index.ts +7 -0
- package/src/layouts/blog-header/blog-header-types.ts +25 -0
- package/src/layouts/blog-header/blog-header.tsx +172 -0
- package/src/layouts/blog-header/index.ts +2 -0
- package/src/layouts/documentation-workspace/README.md +8 -0
- package/src/layouts/documentation-workspace/documentation-workspace.tsx +34 -0
- package/src/layouts/documentation-workspace/index.ts +1 -0
- package/src/layouts/ecommerce-header/ecommerce-actions.tsx +89 -0
- package/src/layouts/ecommerce-header/ecommerce-announcement.tsx +43 -0
- package/src/layouts/ecommerce-header/ecommerce-drawer.tsx +97 -0
- package/src/layouts/ecommerce-header/ecommerce-header-types.ts +59 -0
- package/src/layouts/ecommerce-header/ecommerce-header.tsx +47 -0
- package/src/layouts/ecommerce-header/ecommerce-navigation.tsx +98 -0
- package/src/layouts/ecommerce-header/ecommerce-search.tsx +86 -0
- package/src/layouts/ecommerce-header/index.ts +2 -0
- package/src/layouts/main-workspace/index.ts +28 -0
- package/src/layouts/mdi/index.ts +1 -0
- package/src/layouts/mdi/mdi.tsx +20 -0
- package/src/layouts/mdi-main/index.ts +27 -0
- package/src/layouts/mdi-main/mdi-app-catalog.generated.ts +159 -0
- package/src/layouts/mdi-main/mdi-app-catalog.ts +76 -0
- package/src/layouts/mdi-main/mdi-app-switcher.tsx +107 -0
- package/src/layouts/mdi-main/mdi-feature-settings.tsx +135 -0
- package/src/layouts/mdi-main/mdi-global-search.tsx +192 -0
- package/src/layouts/mdi-main/mdi-main.tsx +241 -0
- package/src/layouts/mdi-main/mdi-notifications-menu.tsx +197 -0
- package/src/layouts/mdi-main/mdi-profile-menu.tsx +79 -0
- package/src/layouts/mdi-main/mdi-sidebar-navigation.tsx +226 -0
- package/src/layouts/mdi-main/mdi-sidebar.tsx +110 -0
- package/src/layouts/mdi-main/mdi-status-bar.tsx +26 -0
- package/src/layouts/mdi-main/mdi-top-menu-control.ts +4 -0
- package/src/layouts/mdi-main/mdi-top-menu.tsx +117 -0
- package/src/layouts/mdi-main/mdi-topology.tsx +297 -0
- package/src/layouts/mdi-main/mdi-tweak-panel.tsx +104 -0
- package/src/layouts/mdi-main/mdi-types.ts +131 -0
- package/src/layouts/mdi-main/use-mdi-features.ts +36 -0
- package/src/layouts/mdi-main/use-mdi-sidebar-state.ts +59 -0
- package/src/layouts/site-header/announcement-bar.tsx +55 -0
- package/src/layouts/site-header/category-strip.tsx +41 -0
- package/src/layouts/site-header/index.ts +16 -0
- package/src/layouts/site-header/main-navbar.tsx +179 -0
- package/src/layouts/site-header/mobile-drawer.tsx +140 -0
- package/src/layouts/site-header/site-header-types.ts +63 -0
- package/src/layouts/site-header/site-header.tsx +58 -0
- package/src/lib/random-id.ts +19 -0
- package/src/lib/utils.ts +6 -0
- package/src/providers/pdf-provider.ts +137 -0
- package/src/styles/globals.css +374 -0
- package/src/templates/README.md +12 -0
- package/src/templates/dashboard-01/components/app-sidebar.tsx +177 -0
- package/src/templates/dashboard-01/components/chart-area-interactive.tsx +276 -0
- package/src/templates/dashboard-01/components/data-table-cell-viewer.tsx +213 -0
- package/src/templates/dashboard-01/components/data-table.tsx +577 -0
- package/src/templates/dashboard-01/components/nav-documents.tsx +79 -0
- package/src/templates/dashboard-01/components/nav-main.tsx +55 -0
- package/src/templates/dashboard-01/components/nav-secondary.tsx +39 -0
- package/src/templates/dashboard-01/components/nav-user.tsx +97 -0
- package/src/templates/dashboard-01/components/section-cards.tsx +99 -0
- package/src/templates/dashboard-01/components/site-header.tsx +14 -0
- package/src/templates/dashboard-01/data.json +614 -0
- package/src/templates/dashboard-01/index.ts +7 -0
- package/src/templates/documentation-sidebar/app-sidebar.tsx +95 -0
- package/src/templates/documentation-sidebar/index.ts +2 -0
- package/src/templates/sidebar-07/components/app-sidebar.tsx +175 -0
- package/src/templates/sidebar-07/components/nav-main.tsx +64 -0
- package/src/templates/sidebar-07/components/nav-projects.tsx +79 -0
- package/src/templates/sidebar-07/components/nav-user.tsx +105 -0
- package/src/templates/sidebar-07/components/team-switcher.tsx +94 -0
- package/src/templates/sidebar-07/index.ts +1 -0
- package/src/templates/ui-page/index.ts +7 -0
- package/src/templates/ui-page/ui-browser-frame.tsx +27 -0
- package/src/templates/ui-page/ui-template-code.tsx +48 -0
- package/src/templates/ui-page/ui-template-header.tsx +87 -0
- package/src/templates/ui-page/ui-template-navigation.tsx +60 -0
- package/src/templates/ui-page/ui-template-page.tsx +97 -0
- package/src/theme/index.ts +12 -0
- package/src/theme/theme-config.ts +30 -0
- package/src/theme/theme-provider.tsx +142 -0
- package/src/theme/theme-selector.tsx +75 -0
- package/src/tokens/index.ts +15 -0
- package/src/vite-env.d.ts +3 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Combobox as ComboboxPrimitive } from '@base-ui/react'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
|
|
5
|
+
import { Button } from '@devxcrew/react-ui/components/button'
|
|
6
|
+
import {
|
|
7
|
+
InputGroup,
|
|
8
|
+
InputGroupAddon,
|
|
9
|
+
InputGroupButton,
|
|
10
|
+
InputGroupInput,
|
|
11
|
+
} from '@devxcrew/react-ui/components/input-group'
|
|
12
|
+
import { ChevronDownIcon, XIcon, CheckIcon } from 'lucide-react'
|
|
13
|
+
|
|
14
|
+
const Combobox = ComboboxPrimitive.Root
|
|
15
|
+
|
|
16
|
+
function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
|
|
17
|
+
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props) {
|
|
21
|
+
return (
|
|
22
|
+
<ComboboxPrimitive.Trigger
|
|
23
|
+
data-slot="combobox-trigger"
|
|
24
|
+
className={cn("[&_svg:not([class*='size-'])]:size-4", className)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
29
|
+
</ComboboxPrimitive.Trigger>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
34
|
+
return (
|
|
35
|
+
<ComboboxPrimitive.Clear
|
|
36
|
+
data-slot="combobox-clear"
|
|
37
|
+
render={<InputGroupButton variant="ghost" size="icon-xs" />}
|
|
38
|
+
className={cn(className)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
<XIcon className="pointer-events-none" />
|
|
42
|
+
</ComboboxPrimitive.Clear>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function ComboboxInput({
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
disabled = false,
|
|
50
|
+
showTrigger = true,
|
|
51
|
+
showClear = false,
|
|
52
|
+
...props
|
|
53
|
+
}: ComboboxPrimitive.Input.Props & {
|
|
54
|
+
showTrigger?: boolean
|
|
55
|
+
showClear?: boolean
|
|
56
|
+
}) {
|
|
57
|
+
return (
|
|
58
|
+
<InputGroup className={cn('w-auto', className)}>
|
|
59
|
+
<ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
|
|
60
|
+
<InputGroupAddon align="inline-end">
|
|
61
|
+
{showTrigger && (
|
|
62
|
+
<InputGroupButton
|
|
63
|
+
size="icon-xs"
|
|
64
|
+
variant="ghost"
|
|
65
|
+
render={<ComboboxTrigger />}
|
|
66
|
+
data-slot="input-group-button"
|
|
67
|
+
className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
|
|
68
|
+
disabled={disabled}
|
|
69
|
+
/>
|
|
70
|
+
)}
|
|
71
|
+
{showClear && <ComboboxClear disabled={disabled} />}
|
|
72
|
+
</InputGroupAddon>
|
|
73
|
+
{children}
|
|
74
|
+
</InputGroup>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function ComboboxContent({
|
|
79
|
+
className,
|
|
80
|
+
side = 'bottom',
|
|
81
|
+
sideOffset = 6,
|
|
82
|
+
align = 'start',
|
|
83
|
+
alignOffset = 0,
|
|
84
|
+
anchor,
|
|
85
|
+
...props
|
|
86
|
+
}: ComboboxPrimitive.Popup.Props &
|
|
87
|
+
Pick<
|
|
88
|
+
ComboboxPrimitive.Positioner.Props,
|
|
89
|
+
'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'
|
|
90
|
+
>) {
|
|
91
|
+
return (
|
|
92
|
+
<ComboboxPrimitive.Portal>
|
|
93
|
+
<ComboboxPrimitive.Positioner
|
|
94
|
+
side={side}
|
|
95
|
+
sideOffset={sideOffset}
|
|
96
|
+
align={align}
|
|
97
|
+
alignOffset={alignOffset}
|
|
98
|
+
anchor={anchor}
|
|
99
|
+
className="isolate z-50"
|
|
100
|
+
>
|
|
101
|
+
<ComboboxPrimitive.Popup
|
|
102
|
+
data-slot="combobox-content"
|
|
103
|
+
data-chips={!!anchor}
|
|
104
|
+
className={cn(
|
|
105
|
+
'group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
106
|
+
className,
|
|
107
|
+
)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
</ComboboxPrimitive.Positioner>
|
|
111
|
+
</ComboboxPrimitive.Portal>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
116
|
+
return (
|
|
117
|
+
<ComboboxPrimitive.List
|
|
118
|
+
data-slot="combobox-list"
|
|
119
|
+
className={cn(
|
|
120
|
+
'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',
|
|
121
|
+
className,
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {
|
|
129
|
+
return (
|
|
130
|
+
<ComboboxPrimitive.Item
|
|
131
|
+
data-slot="combobox-item"
|
|
132
|
+
className={cn(
|
|
133
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
134
|
+
className,
|
|
135
|
+
)}
|
|
136
|
+
{...props}
|
|
137
|
+
>
|
|
138
|
+
{children}
|
|
139
|
+
<ComboboxPrimitive.ItemIndicator
|
|
140
|
+
render={
|
|
141
|
+
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
|
|
142
|
+
}
|
|
143
|
+
>
|
|
144
|
+
<CheckIcon className="pointer-events-none" />
|
|
145
|
+
</ComboboxPrimitive.ItemIndicator>
|
|
146
|
+
</ComboboxPrimitive.Item>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
|
|
151
|
+
return <ComboboxPrimitive.Group data-slot="combobox-group" className={cn(className)} {...props} />
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) {
|
|
155
|
+
return (
|
|
156
|
+
<ComboboxPrimitive.GroupLabel
|
|
157
|
+
data-slot="combobox-label"
|
|
158
|
+
className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}
|
|
159
|
+
{...props}
|
|
160
|
+
/>
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
|
|
165
|
+
return <ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
169
|
+
return (
|
|
170
|
+
<ComboboxPrimitive.Empty
|
|
171
|
+
data-slot="combobox-empty"
|
|
172
|
+
className={cn(
|
|
173
|
+
'hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex',
|
|
174
|
+
className,
|
|
175
|
+
)}
|
|
176
|
+
{...props}
|
|
177
|
+
/>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props) {
|
|
182
|
+
return (
|
|
183
|
+
<ComboboxPrimitive.Separator
|
|
184
|
+
data-slot="combobox-separator"
|
|
185
|
+
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
186
|
+
{...props}
|
|
187
|
+
/>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function ComboboxChips({
|
|
192
|
+
className,
|
|
193
|
+
...props
|
|
194
|
+
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props) {
|
|
195
|
+
return (
|
|
196
|
+
<ComboboxPrimitive.Chips
|
|
197
|
+
data-slot="combobox-chips"
|
|
198
|
+
className={cn(
|
|
199
|
+
'flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',
|
|
200
|
+
className,
|
|
201
|
+
)}
|
|
202
|
+
{...props}
|
|
203
|
+
/>
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function ComboboxChip({
|
|
208
|
+
className,
|
|
209
|
+
children,
|
|
210
|
+
showRemove = true,
|
|
211
|
+
...props
|
|
212
|
+
}: ComboboxPrimitive.Chip.Props & {
|
|
213
|
+
showRemove?: boolean
|
|
214
|
+
}) {
|
|
215
|
+
return (
|
|
216
|
+
<ComboboxPrimitive.Chip
|
|
217
|
+
data-slot="combobox-chip"
|
|
218
|
+
className={cn(
|
|
219
|
+
'flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',
|
|
220
|
+
className,
|
|
221
|
+
)}
|
|
222
|
+
{...props}
|
|
223
|
+
>
|
|
224
|
+
{children}
|
|
225
|
+
{showRemove && (
|
|
226
|
+
<ComboboxPrimitive.ChipRemove
|
|
227
|
+
render={<Button variant="ghost" size="icon-xs" />}
|
|
228
|
+
className="-ml-1 opacity-50 hover:opacity-100"
|
|
229
|
+
data-slot="combobox-chip-remove"
|
|
230
|
+
>
|
|
231
|
+
<XIcon className="pointer-events-none" />
|
|
232
|
+
</ComboboxPrimitive.ChipRemove>
|
|
233
|
+
)}
|
|
234
|
+
</ComboboxPrimitive.Chip>
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props) {
|
|
239
|
+
return (
|
|
240
|
+
<ComboboxPrimitive.Input
|
|
241
|
+
data-slot="combobox-chip-input"
|
|
242
|
+
className={cn('min-w-16 flex-1 outline-none', className)}
|
|
243
|
+
{...props}
|
|
244
|
+
/>
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function useComboboxAnchor() {
|
|
249
|
+
return React.useRef<HTMLDivElement | null>(null)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export {
|
|
253
|
+
Combobox,
|
|
254
|
+
ComboboxInput,
|
|
255
|
+
ComboboxContent,
|
|
256
|
+
ComboboxList,
|
|
257
|
+
ComboboxItem,
|
|
258
|
+
ComboboxGroup,
|
|
259
|
+
ComboboxLabel,
|
|
260
|
+
ComboboxCollection,
|
|
261
|
+
ComboboxEmpty,
|
|
262
|
+
ComboboxSeparator,
|
|
263
|
+
ComboboxChips,
|
|
264
|
+
ComboboxChip,
|
|
265
|
+
ComboboxChipsInput,
|
|
266
|
+
ComboboxTrigger,
|
|
267
|
+
ComboboxValue,
|
|
268
|
+
useComboboxAnchor,
|
|
269
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Command as CommandPrimitive } from 'cmdk'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Dialog,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogDescription,
|
|
11
|
+
DialogHeader,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
} from '@devxcrew/react-ui/components/dialog'
|
|
14
|
+
import { InputGroup, InputGroupAddon } from '@devxcrew/react-ui/components/input-group'
|
|
15
|
+
import { SearchIcon, CheckIcon } from 'lucide-react'
|
|
16
|
+
|
|
17
|
+
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
|
18
|
+
return (
|
|
19
|
+
<CommandPrimitive
|
|
20
|
+
data-slot="command"
|
|
21
|
+
className={cn(
|
|
22
|
+
'flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground',
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function CommandDialog({
|
|
31
|
+
title = 'Command Palette',
|
|
32
|
+
description = 'Search for a command to run...',
|
|
33
|
+
children,
|
|
34
|
+
className,
|
|
35
|
+
showCloseButton = false,
|
|
36
|
+
...props
|
|
37
|
+
}: Omit<React.ComponentProps<typeof Dialog>, 'children'> & {
|
|
38
|
+
title?: string
|
|
39
|
+
description?: string
|
|
40
|
+
className?: string
|
|
41
|
+
showCloseButton?: boolean
|
|
42
|
+
children: React.ReactNode
|
|
43
|
+
}) {
|
|
44
|
+
return (
|
|
45
|
+
<Dialog {...props}>
|
|
46
|
+
<DialogHeader className="sr-only">
|
|
47
|
+
<DialogTitle>{title}</DialogTitle>
|
|
48
|
+
<DialogDescription>{description}</DialogDescription>
|
|
49
|
+
</DialogHeader>
|
|
50
|
+
<DialogContent
|
|
51
|
+
className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0', className)}
|
|
52
|
+
showCloseButton={showCloseButton}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</DialogContent>
|
|
56
|
+
</Dialog>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function CommandInput({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
64
|
+
return (
|
|
65
|
+
<div data-slot="command-input-wrapper" className="p-1 pb-0">
|
|
66
|
+
<InputGroup className="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
|
|
67
|
+
<CommandPrimitive.Input
|
|
68
|
+
data-slot="command-input"
|
|
69
|
+
className={cn(
|
|
70
|
+
'w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
|
|
71
|
+
className,
|
|
72
|
+
)}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
<InputGroupAddon>
|
|
76
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
77
|
+
</InputGroupAddon>
|
|
78
|
+
</InputGroup>
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
84
|
+
return (
|
|
85
|
+
<CommandPrimitive.List
|
|
86
|
+
data-slot="command-list"
|
|
87
|
+
className={cn(
|
|
88
|
+
'no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none',
|
|
89
|
+
className,
|
|
90
|
+
)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function CommandEmpty({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
100
|
+
return (
|
|
101
|
+
<CommandPrimitive.Empty
|
|
102
|
+
data-slot="command-empty"
|
|
103
|
+
className={cn('py-6 text-center text-sm', className)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function CommandGroup({
|
|
110
|
+
className,
|
|
111
|
+
...props
|
|
112
|
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
113
|
+
return (
|
|
114
|
+
<CommandPrimitive.Group
|
|
115
|
+
data-slot="command-group"
|
|
116
|
+
className={cn(
|
|
117
|
+
'overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground',
|
|
118
|
+
className,
|
|
119
|
+
)}
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function CommandSeparator({
|
|
126
|
+
className,
|
|
127
|
+
...props
|
|
128
|
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
129
|
+
return (
|
|
130
|
+
<CommandPrimitive.Separator
|
|
131
|
+
data-slot="command-separator"
|
|
132
|
+
className={cn('-mx-1 h-px bg-border', className)}
|
|
133
|
+
{...props}
|
|
134
|
+
/>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function CommandItem({
|
|
139
|
+
className,
|
|
140
|
+
children,
|
|
141
|
+
...props
|
|
142
|
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
143
|
+
return (
|
|
144
|
+
<CommandPrimitive.Item
|
|
145
|
+
data-slot="command-item"
|
|
146
|
+
className={cn(
|
|
147
|
+
"group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
|
|
148
|
+
className,
|
|
149
|
+
)}
|
|
150
|
+
{...props}
|
|
151
|
+
>
|
|
152
|
+
{children}
|
|
153
|
+
<CheckIcon className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
|
|
154
|
+
</CommandPrimitive.Item>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
159
|
+
return (
|
|
160
|
+
<span
|
|
161
|
+
data-slot="command-shortcut"
|
|
162
|
+
className={cn(
|
|
163
|
+
'ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground',
|
|
164
|
+
className,
|
|
165
|
+
)}
|
|
166
|
+
{...props}
|
|
167
|
+
/>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export {
|
|
172
|
+
Command,
|
|
173
|
+
CommandDialog,
|
|
174
|
+
CommandInput,
|
|
175
|
+
CommandList,
|
|
176
|
+
CommandEmpty,
|
|
177
|
+
CommandGroup,
|
|
178
|
+
CommandItem,
|
|
179
|
+
CommandShortcut,
|
|
180
|
+
CommandSeparator,
|
|
181
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { CheckCircle2, CircleX, LoaderCircle, PlugZap } from 'lucide-react'
|
|
2
|
+
import { Button } from './button'
|
|
3
|
+
import { NativeSelect, NativeSelectOption } from './native-select'
|
|
4
|
+
|
|
5
|
+
export type CompactModelSwitcherOption = {
|
|
6
|
+
disabled?: boolean
|
|
7
|
+
id: string
|
|
8
|
+
label: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function CompactModelSwitcher({
|
|
12
|
+
connections,
|
|
13
|
+
disabled,
|
|
14
|
+
models,
|
|
15
|
+
reasoningLevels,
|
|
16
|
+
selectedConnectionId,
|
|
17
|
+
selectedModelId,
|
|
18
|
+
selectedReasoningLevel,
|
|
19
|
+
connecting,
|
|
20
|
+
unavailable,
|
|
21
|
+
unavailableLabel,
|
|
22
|
+
verified,
|
|
23
|
+
onConnect,
|
|
24
|
+
onConnectionChange,
|
|
25
|
+
onModelChange,
|
|
26
|
+
onReasoningChange,
|
|
27
|
+
}: {
|
|
28
|
+
connections: CompactModelSwitcherOption[]
|
|
29
|
+
disabled?: boolean
|
|
30
|
+
connecting?: boolean
|
|
31
|
+
models: CompactModelSwitcherOption[]
|
|
32
|
+
reasoningLevels: CompactModelSwitcherOption[]
|
|
33
|
+
selectedConnectionId: string
|
|
34
|
+
selectedModelId?: string
|
|
35
|
+
selectedReasoningLevel: string
|
|
36
|
+
unavailable?: boolean
|
|
37
|
+
unavailableLabel?: string
|
|
38
|
+
verified?: boolean
|
|
39
|
+
onConnect(): void
|
|
40
|
+
onConnectionChange(id: string): void
|
|
41
|
+
onModelChange(id: string): void
|
|
42
|
+
onReasoningChange(id: string): void
|
|
43
|
+
}) {
|
|
44
|
+
return (
|
|
45
|
+
<div className="ml-auto flex min-w-0 items-center gap-2" aria-label="Model connection">
|
|
46
|
+
<NativeSelect
|
|
47
|
+
aria-label="Provider connection"
|
|
48
|
+
className="max-w-44"
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
size="sm"
|
|
51
|
+
value={selectedConnectionId}
|
|
52
|
+
onChange={(event) => onConnectionChange(event.target.value)}
|
|
53
|
+
>
|
|
54
|
+
{connections.map((option) => (
|
|
55
|
+
<NativeSelectOption disabled={option.disabled} key={option.id} value={option.id}>
|
|
56
|
+
{option.label}
|
|
57
|
+
</NativeSelectOption>
|
|
58
|
+
))}
|
|
59
|
+
</NativeSelect>
|
|
60
|
+
<NativeSelect
|
|
61
|
+
aria-label="Model"
|
|
62
|
+
className="max-w-48"
|
|
63
|
+
disabled={disabled || models.length === 0}
|
|
64
|
+
size="sm"
|
|
65
|
+
value={selectedModelId ?? ''}
|
|
66
|
+
onChange={(event) => onModelChange(event.target.value)}
|
|
67
|
+
>
|
|
68
|
+
{models.map((option) => (
|
|
69
|
+
<NativeSelectOption key={option.id} value={option.id}>
|
|
70
|
+
{option.label}
|
|
71
|
+
</NativeSelectOption>
|
|
72
|
+
))}
|
|
73
|
+
</NativeSelect>
|
|
74
|
+
<NativeSelect
|
|
75
|
+
aria-label="Reasoning"
|
|
76
|
+
className="max-w-28"
|
|
77
|
+
disabled={disabled || reasoningLevels.length === 0}
|
|
78
|
+
size="sm"
|
|
79
|
+
value={selectedReasoningLevel}
|
|
80
|
+
onChange={(event) => onReasoningChange(event.target.value)}
|
|
81
|
+
>
|
|
82
|
+
{reasoningLevels.map((option) => (
|
|
83
|
+
<NativeSelectOption key={option.id} value={option.id}>
|
|
84
|
+
{option.label}
|
|
85
|
+
</NativeSelectOption>
|
|
86
|
+
))}
|
|
87
|
+
</NativeSelect>
|
|
88
|
+
<Button
|
|
89
|
+
aria-label={
|
|
90
|
+
unavailable
|
|
91
|
+
? `${unavailableLabel ?? 'Provider'} unavailable`
|
|
92
|
+
: verified
|
|
93
|
+
? 'Connection verified'
|
|
94
|
+
: 'Connect and verify selection'
|
|
95
|
+
}
|
|
96
|
+
className={
|
|
97
|
+
unavailable
|
|
98
|
+
? 'border-red-200 bg-red-50 text-red-700 shadow-[0_0_0_3px_rgba(239,68,68,0.14)] hover:bg-red-100'
|
|
99
|
+
: verified
|
|
100
|
+
? 'border-emerald-200 bg-emerald-50 text-emerald-700 shadow-[0_0_0_3px_rgba(16,185,129,0.16)] hover:bg-emerald-100'
|
|
101
|
+
: undefined
|
|
102
|
+
}
|
|
103
|
+
disabled={disabled || connecting || !selectedModelId}
|
|
104
|
+
size="icon-sm"
|
|
105
|
+
title={
|
|
106
|
+
unavailable
|
|
107
|
+
? `${unavailableLabel ?? 'Provider'} is unavailable. Start the runtime, then retry.`
|
|
108
|
+
: verified
|
|
109
|
+
? 'Connection verified by live smoke test'
|
|
110
|
+
: 'Connect and run smoke test'
|
|
111
|
+
}
|
|
112
|
+
type="button"
|
|
113
|
+
variant="outline"
|
|
114
|
+
onClick={onConnect}
|
|
115
|
+
>
|
|
116
|
+
{connecting ? (
|
|
117
|
+
<LoaderCircle className="animate-spin" />
|
|
118
|
+
) : unavailable ? (
|
|
119
|
+
<CircleX />
|
|
120
|
+
) : verified ? (
|
|
121
|
+
<CheckCircle2 />
|
|
122
|
+
) : (
|
|
123
|
+
<PlugZap />
|
|
124
|
+
)}
|
|
125
|
+
</Button>
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
|
+
}
|