@cerebriline/ui 0.0.0-stage → 4.100.313
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/ADOPTION.md +833 -0
- package/LICENSE +201 -0
- package/RADIX-COLORS-LICENSE +21 -0
- package/README.md +427 -2
- package/components/agent-approval-card.css +70 -0
- package/components/agent-approval-card.tsx +109 -0
- package/components/agent-ask-question.css +103 -0
- package/components/agent-ask-question.tsx +276 -0
- package/components/agent-aurora.css +228 -0
- package/components/agent-aurora.tsx +96 -0
- package/components/agent-changes.css +13 -0
- package/components/agent-changes.tsx +167 -0
- package/components/agent-chat/agent-chat.css +556 -0
- package/components/agent-chat/index.tsx +1037 -0
- package/components/agent-chat/tool-diff.tsx +165 -0
- package/components/agent-chat/tool-summary/agents.ts +114 -0
- package/components/agent-chat/tool-summary/diff.ts +152 -0
- package/components/agent-chat/tool-summary/index.ts +928 -0
- package/components/agent-chat/tool-summary/parsers.ts +611 -0
- package/components/agent-chat/tool-summary/paths.ts +84 -0
- package/components/agent-chat/tool-summary/team.ts +401 -0
- package/components/agent-command-output.tsx +63 -0
- package/components/agent-composer.tsx +263 -0
- package/components/agent-context-usage.tsx +181 -0
- package/components/agent-conversation-layout.tsx +139 -0
- package/components/agent-hero-heading.css +53 -0
- package/components/agent-hero-heading.tsx +45 -0
- package/components/agent-image-lightbox.tsx +48 -0
- package/components/agent-prompt-queue.css +20 -0
- package/components/agent-prompt-queue.tsx +350 -0
- package/components/agent-pull-request-bar.css +13 -0
- package/components/agent-pull-request-bar.tsx +346 -0
- package/components/agent-quick-actions.css +19 -0
- package/components/agent-quick-actions.tsx +70 -0
- package/components/agent-session-row.tsx +183 -0
- package/components/agent-welcome-hero-pointer.ts +199 -0
- package/components/agent-welcome-hero.css +205 -0
- package/components/agent-welcome-hero.tsx +68 -0
- package/components/attachment-drop-zone.tsx +154 -0
- package/components/badge.tsx +21 -0
- package/components/button.tsx +324 -0
- package/components/generated-media.tsx +173 -0
- package/components/github-icon.tsx +19 -0
- package/components/index.ts +133 -0
- package/components/markdown.css +490 -0
- package/components/markdown.ts +365 -0
- package/components/mermaid-block.tsx +722 -0
- package/components/mermaid-diagram.ts +1260 -0
- package/components/mermaid-dom.ts +301 -0
- package/components/message-scroller.css +118 -0
- package/components/message-scroller.tsx +114 -0
- package/components/search-combobox.css +67 -0
- package/components/search-combobox.tsx +433 -0
- package/components/session-status.css +19 -0
- package/components/session-status.tsx +39 -0
- package/components/switch.css +221 -0
- package/components/switch.tsx +48 -0
- package/components.css +16 -0
- package/dist/components/agent-approval-card.d.ts +14 -0
- package/dist/components/agent-approval-card.d.ts.map +1 -0
- package/dist/components/agent-approval-card.js +12 -0
- package/dist/components/agent-approval-card.js.map +1 -0
- package/dist/components/agent-ask-question.d.ts +18 -0
- package/dist/components/agent-ask-question.d.ts.map +1 -0
- package/dist/components/agent-ask-question.js +101 -0
- package/dist/components/agent-ask-question.js.map +1 -0
- package/dist/components/agent-aurora.d.ts +3 -0
- package/dist/components/agent-aurora.d.ts.map +1 -0
- package/dist/components/agent-aurora.js +60 -0
- package/dist/components/agent-aurora.js.map +1 -0
- package/dist/components/agent-changes.d.ts +26 -0
- package/dist/components/agent-changes.d.ts.map +1 -0
- package/dist/components/agent-changes.js +19 -0
- package/dist/components/agent-changes.js.map +1 -0
- package/dist/components/agent-chat/disclosure.d.ts +25 -0
- package/dist/components/agent-chat/disclosure.d.ts.map +1 -0
- package/dist/components/agent-chat/disclosure.js +39 -0
- package/dist/components/agent-chat/disclosure.js.map +1 -0
- package/dist/components/agent-chat/index.d.ts +140 -0
- package/dist/components/agent-chat/index.d.ts.map +1 -0
- package/dist/components/agent-chat/index.js +379 -0
- package/dist/components/agent-chat/index.js.map +1 -0
- package/dist/components/agent-chat/tool-diff.d.ts +32 -0
- package/dist/components/agent-chat/tool-diff.d.ts.map +1 -0
- package/dist/components/agent-chat/tool-diff.js +97 -0
- package/dist/components/agent-chat/tool-diff.js.map +1 -0
- package/dist/components/agent-chat/tool-summary/agents.d.ts +10 -0
- package/dist/components/agent-chat/tool-summary/agents.d.ts.map +1 -0
- package/dist/components/agent-chat/tool-summary/agents.js +100 -0
- package/dist/components/agent-chat/tool-summary/agents.js.map +1 -0
- package/dist/components/agent-chat/tool-summary/diff.d.ts +22 -0
- package/dist/components/agent-chat/tool-summary/diff.d.ts.map +1 -0
- package/dist/components/agent-chat/tool-summary/diff.js +127 -0
- package/dist/components/agent-chat/tool-summary/diff.js.map +1 -0
- package/dist/components/agent-chat/tool-summary/index.d.ts +145 -0
- package/dist/components/agent-chat/tool-summary/index.d.ts.map +1 -0
- package/dist/components/agent-chat/tool-summary/index.js +663 -0
- package/dist/components/agent-chat/tool-summary/index.js.map +1 -0
- package/dist/components/agent-chat/tool-summary/parsers.d.ts +114 -0
- package/dist/components/agent-chat/tool-summary/parsers.d.ts.map +1 -0
- package/dist/components/agent-chat/tool-summary/parsers.js +502 -0
- package/dist/components/agent-chat/tool-summary/parsers.js.map +1 -0
- package/dist/components/agent-chat/tool-summary/paths.d.ts +10 -0
- package/dist/components/agent-chat/tool-summary/paths.d.ts.map +1 -0
- package/dist/components/agent-chat/tool-summary/paths.js +88 -0
- package/dist/components/agent-chat/tool-summary/paths.js.map +1 -0
- package/dist/components/agent-chat/tool-summary/team.d.ts +16 -0
- package/dist/components/agent-chat/tool-summary/team.d.ts.map +1 -0
- package/dist/components/agent-chat/tool-summary/team.js +283 -0
- package/dist/components/agent-chat/tool-summary/team.js.map +1 -0
- package/dist/components/agent-command-output.d.ts +14 -0
- package/dist/components/agent-command-output.d.ts.map +1 -0
- package/dist/components/agent-command-output.js +22 -0
- package/dist/components/agent-command-output.js.map +1 -0
- package/dist/components/agent-composer.d.ts +34 -0
- package/dist/components/agent-composer.d.ts.map +1 -0
- package/dist/components/agent-composer.js +65 -0
- package/dist/components/agent-composer.js.map +1 -0
- package/dist/components/agent-context-usage.d.ts +28 -0
- package/dist/components/agent-context-usage.d.ts.map +1 -0
- package/dist/components/agent-context-usage.js +51 -0
- package/dist/components/agent-context-usage.js.map +1 -0
- package/dist/components/agent-conversation-layout.d.ts +30 -0
- package/dist/components/agent-conversation-layout.d.ts.map +1 -0
- package/dist/components/agent-conversation-layout.js +24 -0
- package/dist/components/agent-conversation-layout.js.map +1 -0
- package/dist/components/agent-hero-heading.d.ts +2 -0
- package/dist/components/agent-hero-heading.d.ts.map +1 -0
- package/dist/components/agent-hero-heading.js +20 -0
- package/dist/components/agent-hero-heading.js.map +1 -0
- package/dist/components/agent-image-lightbox.d.ts +11 -0
- package/dist/components/agent-image-lightbox.d.ts.map +1 -0
- package/dist/components/agent-image-lightbox.js +8 -0
- package/dist/components/agent-image-lightbox.js.map +1 -0
- package/dist/components/agent-prompt-queue.d.ts +14 -0
- package/dist/components/agent-prompt-queue.d.ts.map +1 -0
- package/dist/components/agent-prompt-queue.js +114 -0
- package/dist/components/agent-prompt-queue.js.map +1 -0
- package/dist/components/agent-pull-request-bar.d.ts +72 -0
- package/dist/components/agent-pull-request-bar.d.ts.map +1 -0
- package/dist/components/agent-pull-request-bar.js +90 -0
- package/dist/components/agent-pull-request-bar.js.map +1 -0
- package/dist/components/agent-quick-actions.d.ts +14 -0
- package/dist/components/agent-quick-actions.d.ts.map +1 -0
- package/dist/components/agent-quick-actions.js +12 -0
- package/dist/components/agent-quick-actions.js.map +1 -0
- package/dist/components/agent-session-row.d.ts +45 -0
- package/dist/components/agent-session-row.d.ts.map +1 -0
- package/dist/components/agent-session-row.js +34 -0
- package/dist/components/agent-session-row.js.map +1 -0
- package/dist/components/agent-welcome-hero-pointer.d.ts +3 -0
- package/dist/components/agent-welcome-hero-pointer.d.ts.map +1 -0
- package/dist/components/agent-welcome-hero-pointer.js +169 -0
- package/dist/components/agent-welcome-hero-pointer.js.map +1 -0
- package/dist/components/agent-welcome-hero.d.ts +9 -0
- package/dist/components/agent-welcome-hero.d.ts.map +1 -0
- package/dist/components/agent-welcome-hero.js +14 -0
- package/dist/components/agent-welcome-hero.js.map +1 -0
- package/dist/components/attachment-drop-zone.d.ts +15 -0
- package/dist/components/attachment-drop-zone.d.ts.map +1 -0
- package/dist/components/attachment-drop-zone.js +64 -0
- package/dist/components/attachment-drop-zone.js.map +1 -0
- package/dist/components/badge.d.ts +5 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +7 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +27 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +209 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/generated-media.d.ts +12 -0
- package/dist/components/generated-media.d.ts.map +1 -0
- package/dist/components/generated-media.js +105 -0
- package/dist/components/generated-media.js.map +1 -0
- package/dist/components/github-icon.d.ts +3 -0
- package/dist/components/github-icon.d.ts.map +1 -0
- package/dist/components/github-icon.js +6 -0
- package/dist/components/github-icon.js.map +1 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +25 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/markdown.d.ts +48 -0
- package/dist/components/markdown.d.ts.map +1 -0
- package/dist/components/markdown.js +264 -0
- package/dist/components/markdown.js.map +1 -0
- package/dist/components/mermaid-block.d.ts +14 -0
- package/dist/components/mermaid-block.d.ts.map +1 -0
- package/dist/components/mermaid-block.js +339 -0
- package/dist/components/mermaid-block.js.map +1 -0
- package/dist/components/mermaid-diagram.d.ts +264 -0
- package/dist/components/mermaid-diagram.d.ts.map +1 -0
- package/dist/components/mermaid-diagram.js +999 -0
- package/dist/components/mermaid-diagram.js.map +1 -0
- package/dist/components/mermaid-dom.d.ts +51 -0
- package/dist/components/mermaid-dom.d.ts.map +1 -0
- package/dist/components/mermaid-dom.js +246 -0
- package/dist/components/mermaid-dom.js.map +1 -0
- package/dist/components/message-scroller.d.ts +23 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +31 -0
- package/dist/components/message-scroller.js.map +1 -0
- package/dist/components/search-combobox.d.ts +44 -0
- package/dist/components/search-combobox.d.ts.map +1 -0
- package/dist/components/search-combobox.js +191 -0
- package/dist/components/search-combobox.js.map +1 -0
- package/dist/components/session-status.d.ts +9 -0
- package/dist/components/session-status.d.ts.map +1 -0
- package/dist/components/session-status.js +11 -0
- package/dist/components/session-status.js.map +1 -0
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +14 -0
- package/dist/components/switch.js.map +1 -0
- package/package.json +177 -5
- package/theme/base.css +83 -0
- package/theme/component-theme.css +126 -0
- package/theme/index.css +3 -0
- package/theme/palette.css +347 -0
- package/theme/scoped-tokens.css +503 -0
- package/theme/theme.css +90 -0
- package/theme/tokens.css +165 -0
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type ReactNode,
|
|
5
|
+
useCallback,
|
|
6
|
+
useEffect,
|
|
7
|
+
useId,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
} from "react";
|
|
12
|
+
|
|
13
|
+
export interface SearchComboboxOption {
|
|
14
|
+
/** Small pill rendered after the label (e.g. "NEW", "Free"). */
|
|
15
|
+
badge?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
label: string;
|
|
19
|
+
/** Id of the section this option belongs to (see `sections`). */
|
|
20
|
+
section?: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface SearchComboboxSection {
|
|
25
|
+
description?: string;
|
|
26
|
+
id: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SearchComboboxProps {
|
|
31
|
+
align?: "start" | "end";
|
|
32
|
+
ariaLabel: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
emptyText?: string;
|
|
36
|
+
loading?: boolean;
|
|
37
|
+
loadingText?: string;
|
|
38
|
+
/** Called when the panel opens, so callers can refresh stale options. */
|
|
39
|
+
onOpen?: () => void;
|
|
40
|
+
onValueChange: (value: string) => void;
|
|
41
|
+
options: SearchComboboxOption[];
|
|
42
|
+
/** Panel width as a CSS length (default "16rem"). */
|
|
43
|
+
panelWidth?: string;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
placement?: "top" | "bottom";
|
|
46
|
+
searchPlaceholder?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Section headers, rendered whenever a run of consecutive options carries
|
|
49
|
+
* that section id. They stay visible while searching so same-named options
|
|
50
|
+
* from different sections (e.g. a Subscribed and a Free row for one model)
|
|
51
|
+
* remain distinguishable.
|
|
52
|
+
*/
|
|
53
|
+
sections?: SearchComboboxSection[];
|
|
54
|
+
value?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function optionMatches(option: SearchComboboxOption, query: string): boolean {
|
|
58
|
+
return `${option.label} ${option.description ?? ""} ${option.value}`
|
|
59
|
+
.toLowerCase()
|
|
60
|
+
.includes(query);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function highlightMatch(label: string, query: string): ReactNode {
|
|
64
|
+
const normalized = query.trim().toLowerCase();
|
|
65
|
+
if (!normalized) {
|
|
66
|
+
return label;
|
|
67
|
+
}
|
|
68
|
+
const index = label.toLowerCase().indexOf(normalized);
|
|
69
|
+
if (index === -1) {
|
|
70
|
+
return label;
|
|
71
|
+
}
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
{label.slice(0, index)}
|
|
75
|
+
<span className="cline-ui-search-combobox__match font-cline-ui-semibold text-cline-ui-foreground">
|
|
76
|
+
{label.slice(index, index + normalized.length)}
|
|
77
|
+
</span>
|
|
78
|
+
{label.slice(index + normalized.length)}
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function SearchCombobox({
|
|
84
|
+
align = "start",
|
|
85
|
+
ariaLabel,
|
|
86
|
+
className,
|
|
87
|
+
disabled = false,
|
|
88
|
+
emptyText = "No results",
|
|
89
|
+
loading = false,
|
|
90
|
+
loadingText = "Loading…",
|
|
91
|
+
onOpen,
|
|
92
|
+
onValueChange,
|
|
93
|
+
options,
|
|
94
|
+
panelWidth = "16rem",
|
|
95
|
+
placeholder = "Select",
|
|
96
|
+
placement = "bottom",
|
|
97
|
+
searchPlaceholder = "Search…",
|
|
98
|
+
sections,
|
|
99
|
+
value,
|
|
100
|
+
}: SearchComboboxProps) {
|
|
101
|
+
const [open, setOpen] = useState(false);
|
|
102
|
+
const [search, setSearch] = useState("");
|
|
103
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
104
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
105
|
+
const triggerRef = useRef<HTMLButtonElement>(null);
|
|
106
|
+
// How to follow the active row: center it when the panel opens, keep it
|
|
107
|
+
// just in view for keyboard navigation, and never scroll for mouse hover —
|
|
108
|
+
// scrolling under the cursor re-triggers hover and makes the list jump.
|
|
109
|
+
const scrollModeRef = useRef<"center" | "nearest" | "none">("center");
|
|
110
|
+
const listboxId = useId();
|
|
111
|
+
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (!open) {
|
|
114
|
+
setSearch("");
|
|
115
|
+
scrollModeRef.current = "center";
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const handlePointerDown = (event: PointerEvent) => {
|
|
119
|
+
if (!containerRef.current?.contains(event.target as Node)) setOpen(false);
|
|
120
|
+
};
|
|
121
|
+
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
122
|
+
return () =>
|
|
123
|
+
document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
124
|
+
}, [open]);
|
|
125
|
+
|
|
126
|
+
const selected = options.find((option) => option.value === value);
|
|
127
|
+
const displayedValue = loading
|
|
128
|
+
? loadingText
|
|
129
|
+
: (selected?.label ?? value) || placeholder;
|
|
130
|
+
const query = search.trim().toLowerCase();
|
|
131
|
+
const filtered = useMemo(
|
|
132
|
+
() =>
|
|
133
|
+
query
|
|
134
|
+
? options.filter((option) => optionMatches(option, query))
|
|
135
|
+
: options,
|
|
136
|
+
[options, query],
|
|
137
|
+
);
|
|
138
|
+
const sectionById = useMemo(() => {
|
|
139
|
+
const map = new Map<string, SearchComboboxSection>();
|
|
140
|
+
for (const section of sections ?? []) map.set(section.id, section);
|
|
141
|
+
return map;
|
|
142
|
+
}, [sections]);
|
|
143
|
+
|
|
144
|
+
const optionId = useCallback(
|
|
145
|
+
(index: number) => `${listboxId}-option-${index}`,
|
|
146
|
+
[listboxId],
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
// Reset the active row when the option set changes: to the selected option
|
|
150
|
+
// on open, to the top match while searching.
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
if (!open) return;
|
|
153
|
+
if (query) {
|
|
154
|
+
setActiveIndex(0);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const selectedIndex = filtered.findIndex(
|
|
158
|
+
(option) => option.value === value,
|
|
159
|
+
);
|
|
160
|
+
setActiveIndex(selectedIndex >= 0 ? selectedIndex : 0);
|
|
161
|
+
}, [filtered, open, query, value]);
|
|
162
|
+
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (!open || scrollModeRef.current === "none") return;
|
|
165
|
+
const activeElement = document.getElementById(optionId(activeIndex));
|
|
166
|
+
if (typeof activeElement?.scrollIntoView === "function") {
|
|
167
|
+
activeElement.scrollIntoView({ block: scrollModeRef.current });
|
|
168
|
+
}
|
|
169
|
+
}, [activeIndex, open, optionId]);
|
|
170
|
+
|
|
171
|
+
const handleSelect = useCallback(
|
|
172
|
+
(option: SearchComboboxOption) => {
|
|
173
|
+
if (disabled) return;
|
|
174
|
+
if (option.value !== value) onValueChange(option.value);
|
|
175
|
+
setOpen(false);
|
|
176
|
+
// Selecting unmounts the focused search input; without an explicit
|
|
177
|
+
// focus target, focus falls back to <body> and keyboard users lose
|
|
178
|
+
// their place.
|
|
179
|
+
triggerRef.current?.focus();
|
|
180
|
+
},
|
|
181
|
+
[disabled, onValueChange, value],
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
const closeAndRestoreFocus = () => {
|
|
185
|
+
setOpen(false);
|
|
186
|
+
triggerRef.current?.focus();
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const handleSearchKeyDown = (
|
|
190
|
+
event: React.KeyboardEvent<HTMLInputElement>,
|
|
191
|
+
) => {
|
|
192
|
+
if (event.key === "Escape") {
|
|
193
|
+
event.preventDefault();
|
|
194
|
+
event.stopPropagation();
|
|
195
|
+
closeAndRestoreFocus();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (event.key === "Tab") {
|
|
199
|
+
// The search input is the only tabbable element in the panel, so
|
|
200
|
+
// Tab always moves focus outside the component; close the popup
|
|
201
|
+
// instead of leaving it open behind the new focus target.
|
|
202
|
+
setOpen(false);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (filtered.length === 0) return;
|
|
206
|
+
scrollModeRef.current = "nearest";
|
|
207
|
+
if (event.key === "ArrowDown") {
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
setActiveIndex((current) => Math.min(current + 1, filtered.length - 1));
|
|
210
|
+
} else if (event.key === "ArrowUp") {
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
setActiveIndex((current) => Math.max(current - 1, 0));
|
|
213
|
+
} else if (event.key === "Home") {
|
|
214
|
+
event.preventDefault();
|
|
215
|
+
setActiveIndex(0);
|
|
216
|
+
} else if (event.key === "End") {
|
|
217
|
+
event.preventDefault();
|
|
218
|
+
setActiveIndex(filtered.length - 1);
|
|
219
|
+
} else if (event.key === "Enter") {
|
|
220
|
+
event.preventDefault();
|
|
221
|
+
const option = filtered[activeIndex];
|
|
222
|
+
if (option) handleSelect(option);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const renderOption = (option: SearchComboboxOption, index: number) => {
|
|
227
|
+
const isSelected = option.value === value;
|
|
228
|
+
const isActive = index === activeIndex;
|
|
229
|
+
return (
|
|
230
|
+
<button
|
|
231
|
+
aria-selected={isSelected}
|
|
232
|
+
className={[
|
|
233
|
+
"cline-ui-search-combobox__option flex w-full cursor-pointer items-center gap-2 rounded-cline-ui-md border-0 px-2 py-1.5 text-left text-cline-ui-foreground",
|
|
234
|
+
isSelected
|
|
235
|
+
? "bg-cline-ui-accent"
|
|
236
|
+
: isActive
|
|
237
|
+
? "bg-cline-ui-surface-hover"
|
|
238
|
+
: "bg-transparent",
|
|
239
|
+
].join(" ")}
|
|
240
|
+
data-active={isActive || undefined}
|
|
241
|
+
disabled={disabled}
|
|
242
|
+
id={optionId(index)}
|
|
243
|
+
key={option.value}
|
|
244
|
+
onClick={() => handleSelect(option)}
|
|
245
|
+
onMouseMove={() => {
|
|
246
|
+
if (!isActive) {
|
|
247
|
+
scrollModeRef.current = "none";
|
|
248
|
+
setActiveIndex(index);
|
|
249
|
+
}
|
|
250
|
+
}}
|
|
251
|
+
role="option"
|
|
252
|
+
tabIndex={-1}
|
|
253
|
+
type="button"
|
|
254
|
+
>
|
|
255
|
+
{option.icon}
|
|
256
|
+
<span className="cline-ui-search-combobox__option-copy flex min-w-0 flex-1 flex-col text-cline-ui-sm">
|
|
257
|
+
<span className="flex min-w-0 items-center gap-1.5">
|
|
258
|
+
<span className="truncate">
|
|
259
|
+
{highlightMatch(option.label, search)}
|
|
260
|
+
</span>
|
|
261
|
+
{option.badge ? (
|
|
262
|
+
<span className="cline-ui-search-combobox__badge inline-flex shrink-0 items-center rounded-cline-ui-sm bg-cline-ui-surface-hover px-1 py-px font-cline-ui-medium text-[0.625rem] text-cline-ui-muted-foreground uppercase tracking-wide">
|
|
263
|
+
{option.badge}
|
|
264
|
+
</span>
|
|
265
|
+
) : null}
|
|
266
|
+
</span>
|
|
267
|
+
{option.description ? (
|
|
268
|
+
<small className="truncate text-[0.625rem] text-cline-ui-muted-foreground">
|
|
269
|
+
{option.description}
|
|
270
|
+
</small>
|
|
271
|
+
) : null}
|
|
272
|
+
</span>
|
|
273
|
+
{isSelected ? (
|
|
274
|
+
<svg
|
|
275
|
+
aria-hidden="true"
|
|
276
|
+
className="cline-ui-search-combobox__check size-3 shrink-0"
|
|
277
|
+
fill="none"
|
|
278
|
+
stroke="currentColor"
|
|
279
|
+
strokeLinecap="round"
|
|
280
|
+
strokeLinejoin="round"
|
|
281
|
+
strokeWidth="2"
|
|
282
|
+
viewBox="0 0 24 24"
|
|
283
|
+
>
|
|
284
|
+
<path d="M20 6 9 17l-5-5" />
|
|
285
|
+
</svg>
|
|
286
|
+
) : null}
|
|
287
|
+
</button>
|
|
288
|
+
);
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
const renderOptions = () => {
|
|
292
|
+
const rows: ReactNode[] = [];
|
|
293
|
+
let previousSection: string | undefined;
|
|
294
|
+
filtered.forEach((option, index) => {
|
|
295
|
+
if (option.section && option.section !== previousSection) {
|
|
296
|
+
const section = sectionById.get(option.section);
|
|
297
|
+
if (section) {
|
|
298
|
+
rows.push(
|
|
299
|
+
<div
|
|
300
|
+
className={[
|
|
301
|
+
"cline-ui-search-combobox__section px-2 pb-1 text-cline-ui-muted-foreground",
|
|
302
|
+
index === 0 ? "pt-1" : "pt-2.5",
|
|
303
|
+
].join(" ")}
|
|
304
|
+
key={`section-${option.section}`}
|
|
305
|
+
>
|
|
306
|
+
<div className="font-cline-ui-medium text-[0.625rem] uppercase tracking-wider">
|
|
307
|
+
{section.label}
|
|
308
|
+
</div>
|
|
309
|
+
{section.description ? (
|
|
310
|
+
<div className="text-[0.625rem]">{section.description}</div>
|
|
311
|
+
) : null}
|
|
312
|
+
</div>,
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
previousSection = option.section;
|
|
317
|
+
rows.push(renderOption(option, index));
|
|
318
|
+
});
|
|
319
|
+
return rows;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
return (
|
|
323
|
+
<div
|
|
324
|
+
className="cline-ui-search-combobox relative min-w-0"
|
|
325
|
+
ref={containerRef}
|
|
326
|
+
>
|
|
327
|
+
<button
|
|
328
|
+
aria-busy={loading || undefined}
|
|
329
|
+
aria-expanded={open}
|
|
330
|
+
aria-haspopup="dialog"
|
|
331
|
+
aria-label={`${ariaLabel}: ${displayedValue}`}
|
|
332
|
+
className={[
|
|
333
|
+
"cline-ui-search-combobox__trigger inline-flex min-w-0 cursor-pointer items-center gap-1 rounded-cline-ui-md border-0 bg-transparent px-2 py-1 text-cline-ui-sm font-cline-ui-medium text-cline-ui-foreground ease-[ease] [&:hover:not(:disabled)]:bg-cline-ui-surface-hover focus-visible:outline-2 focus-visible:outline-cline-ui-ring focus-visible:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none",
|
|
334
|
+
className,
|
|
335
|
+
]
|
|
336
|
+
.filter(Boolean)
|
|
337
|
+
.join(" ")}
|
|
338
|
+
disabled={disabled}
|
|
339
|
+
onClick={() => {
|
|
340
|
+
if (!open) onOpen?.();
|
|
341
|
+
setOpen(!open);
|
|
342
|
+
}}
|
|
343
|
+
ref={triggerRef}
|
|
344
|
+
title={displayedValue}
|
|
345
|
+
type="button"
|
|
346
|
+
>
|
|
347
|
+
{selected?.icon}
|
|
348
|
+
<span className="cline-ui-search-combobox__value min-w-0 truncate">
|
|
349
|
+
{displayedValue}
|
|
350
|
+
</span>
|
|
351
|
+
<svg
|
|
352
|
+
aria-hidden="true"
|
|
353
|
+
className="cline-ui-search-combobox__chevron size-2.5 shrink-0 text-cline-ui-muted-foreground"
|
|
354
|
+
fill="none"
|
|
355
|
+
stroke="currentColor"
|
|
356
|
+
strokeLinecap="round"
|
|
357
|
+
strokeLinejoin="round"
|
|
358
|
+
strokeWidth="2"
|
|
359
|
+
viewBox="0 0 24 24"
|
|
360
|
+
>
|
|
361
|
+
<path d="m6 9 6 6 6-6" />
|
|
362
|
+
</svg>
|
|
363
|
+
</button>
|
|
364
|
+
|
|
365
|
+
{open ? (
|
|
366
|
+
<div
|
|
367
|
+
aria-label={`Search ${ariaLabel.toLowerCase()}`}
|
|
368
|
+
className={[
|
|
369
|
+
"cline-ui-search-combobox__panel absolute z-50 overflow-hidden rounded-cline-ui-lg border border-cline-ui-border bg-cline-ui-popover shadow-xl",
|
|
370
|
+
`cline-ui-search-combobox__panel--${align}`,
|
|
371
|
+
`cline-ui-search-combobox__panel--${placement}`,
|
|
372
|
+
align === "start" ? "left-0" : "right-0",
|
|
373
|
+
placement === "top" ? "bottom-full mb-2" : "top-full mt-2",
|
|
374
|
+
].join(" ")}
|
|
375
|
+
role="dialog"
|
|
376
|
+
style={{ width: panelWidth, maxWidth: "calc(100vw - 1.5rem)" }}
|
|
377
|
+
>
|
|
378
|
+
<div className="cline-ui-search-combobox__search-row flex items-center gap-2 border-cline-ui-border border-b px-3">
|
|
379
|
+
<svg
|
|
380
|
+
aria-hidden="true"
|
|
381
|
+
className="cline-ui-search-combobox__search-icon size-3 shrink-0 text-cline-ui-muted-foreground"
|
|
382
|
+
fill="none"
|
|
383
|
+
stroke="currentColor"
|
|
384
|
+
strokeLinecap="round"
|
|
385
|
+
strokeLinejoin="round"
|
|
386
|
+
strokeWidth="2"
|
|
387
|
+
viewBox="0 0 24 24"
|
|
388
|
+
>
|
|
389
|
+
<path d="m21 21-4.34-4.34" />
|
|
390
|
+
<circle cx="11" cy="11" r="8" />
|
|
391
|
+
</svg>
|
|
392
|
+
<input
|
|
393
|
+
aria-activedescendant={
|
|
394
|
+
filtered.length > 0 ? optionId(activeIndex) : undefined
|
|
395
|
+
}
|
|
396
|
+
aria-controls={listboxId}
|
|
397
|
+
aria-expanded="true"
|
|
398
|
+
aria-label={searchPlaceholder}
|
|
399
|
+
// biome-ignore lint/a11y/noAutofocus: opening the picker focuses search
|
|
400
|
+
autoFocus
|
|
401
|
+
className="cline-ui-search-combobox__search h-8 w-full border-0 bg-transparent p-0 text-cline-ui-sm text-cline-ui-foreground outline-0 placeholder:text-cline-ui-muted-foreground"
|
|
402
|
+
onChange={(event) => {
|
|
403
|
+
scrollModeRef.current = "nearest";
|
|
404
|
+
setSearch(event.target.value);
|
|
405
|
+
}}
|
|
406
|
+
onKeyDown={handleSearchKeyDown}
|
|
407
|
+
placeholder={searchPlaceholder}
|
|
408
|
+
role="combobox"
|
|
409
|
+
value={search}
|
|
410
|
+
/>
|
|
411
|
+
</div>
|
|
412
|
+
<div
|
|
413
|
+
className="cline-ui-search-combobox__options flex max-h-64 flex-col overflow-y-auto overscroll-contain p-1.5"
|
|
414
|
+
id={listboxId}
|
|
415
|
+
role="listbox"
|
|
416
|
+
>
|
|
417
|
+
{loading ? (
|
|
418
|
+
<div className="cline-ui-search-combobox__empty p-2 text-cline-ui-sm text-cline-ui-muted-foreground">
|
|
419
|
+
{loadingText}
|
|
420
|
+
</div>
|
|
421
|
+
) : filtered.length === 0 ? (
|
|
422
|
+
<div className="cline-ui-search-combobox__empty p-2 text-cline-ui-sm text-cline-ui-muted-foreground">
|
|
423
|
+
{emptyText}
|
|
424
|
+
</div>
|
|
425
|
+
) : (
|
|
426
|
+
renderOptions()
|
|
427
|
+
)}
|
|
428
|
+
</div>
|
|
429
|
+
</div>
|
|
430
|
+
) : null}
|
|
431
|
+
</div>
|
|
432
|
+
);
|
|
433
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.cline-ui-session-status {
|
|
2
|
+
--cline-ui-session-status-color: var(--neutral-a4);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.cline-ui-session-status__dot {
|
|
6
|
+
background: var(--cline-ui-session-status-color);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.cline-ui-session-status--neutral .cline-ui-session-status__dot {
|
|
10
|
+
visibility: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.cline-ui-session-status--running {
|
|
14
|
+
--cline-ui-session-status-color: var(--primary);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cline-ui-session-status--error {
|
|
18
|
+
--cline-ui-session-status-color: var(--error-text);
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { OutputHTMLAttributes } from "react";
|
|
2
|
+
|
|
3
|
+
export type SessionStatusTone = "neutral" | "running" | "error";
|
|
4
|
+
|
|
5
|
+
export interface SessionStatusProps
|
|
6
|
+
extends OutputHTMLAttributes<HTMLOutputElement> {
|
|
7
|
+
label: string;
|
|
8
|
+
showLabel?: boolean;
|
|
9
|
+
tone?: SessionStatusTone;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function SessionStatus({
|
|
13
|
+
className,
|
|
14
|
+
label,
|
|
15
|
+
showLabel = true,
|
|
16
|
+
tone = "neutral",
|
|
17
|
+
...props
|
|
18
|
+
}: SessionStatusProps) {
|
|
19
|
+
return (
|
|
20
|
+
<output
|
|
21
|
+
className={[
|
|
22
|
+
"cline-ui-session-status inline-flex items-center gap-1.5 text-cline-ui-xs leading-none text-cline-ui-muted-foreground",
|
|
23
|
+
`cline-ui-session-status--${tone}`,
|
|
24
|
+
className,
|
|
25
|
+
]
|
|
26
|
+
.filter(Boolean)
|
|
27
|
+
.join(" ")}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
<span
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
className="cline-ui-session-status__dot size-1.5 shrink-0 rounded-full"
|
|
33
|
+
/>
|
|
34
|
+
<span className={showLabel ? undefined : "cline-ui-sr-only sr-only"}>
|
|
35
|
+
{label}
|
|
36
|
+
</span>
|
|
37
|
+
</output>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
.cline-ui-switch {
|
|
2
|
+
--cline-ui-switch-leading-ease: cubic-bezier(0.2, 1.4, 0.3, 1);
|
|
3
|
+
--cline-ui-switch-trailing-ease: cubic-bezier(0.24, 1.4, 0.4, 1);
|
|
4
|
+
--cline-ui-switch-off-background: var(--neutral-8);
|
|
5
|
+
--cline-ui-switch-off-hover-background: color-mix(
|
|
6
|
+
in srgb,
|
|
7
|
+
var(--neutral-9) 50%,
|
|
8
|
+
var(--neutral-8) 50%
|
|
9
|
+
);
|
|
10
|
+
--cline-ui-switch-off-active-background: var(--neutral-9);
|
|
11
|
+
--cline-ui-switch-off-border: var(--neutral-a4);
|
|
12
|
+
--cline-ui-switch-disabled-thumb-background: var(--surface-1);
|
|
13
|
+
/* Preserve the geometry at Cline's default 15px root while allowing UI scaling. */
|
|
14
|
+
--cline-ui-switch-width: 2.2rem;
|
|
15
|
+
--cline-ui-switch-height: 1.2rem;
|
|
16
|
+
--cline-ui-switch-padding: 0.16rem;
|
|
17
|
+
/* Fit inside the padding and both 1px track borders on each axis. */
|
|
18
|
+
--cline-ui-switch-thumb-size: calc(
|
|
19
|
+
var(--cline-ui-switch-height) -
|
|
20
|
+
var(--cline-ui-switch-padding) *
|
|
21
|
+
2 -
|
|
22
|
+
2px
|
|
23
|
+
);
|
|
24
|
+
/* Subtract both fixed 1px track borders to keep either end aligned. */
|
|
25
|
+
--cline-ui-switch-travel: calc(
|
|
26
|
+
var(--cline-ui-switch-width) -
|
|
27
|
+
var(--cline-ui-switch-thumb-size) -
|
|
28
|
+
2 *
|
|
29
|
+
var(--cline-ui-switch-padding) -
|
|
30
|
+
2px
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Let host utilities override wrapper layout without changing track geometry. */
|
|
35
|
+
@layer components {
|
|
36
|
+
.cline-ui-switch {
|
|
37
|
+
position: relative;
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
/* Reserve the hit area in layout so neighboring controls cannot overlap it. */
|
|
43
|
+
min-width: 24px;
|
|
44
|
+
min-height: 24px;
|
|
45
|
+
width: var(--cline-ui-switch-width);
|
|
46
|
+
height: var(--cline-ui-switch-height);
|
|
47
|
+
vertical-align: middle;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.cline-ui-switch[hidden]:not([hidden="until-found"]) {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.dark .cline-ui-switch,
|
|
56
|
+
.cline-ui-switch.dark {
|
|
57
|
+
/* Lift the off track slightly without changing the shared neutral palette. */
|
|
58
|
+
--cline-ui-switch-off-background: var(--neutral-7);
|
|
59
|
+
--cline-ui-switch-off-hover-background: var(--neutral-6);
|
|
60
|
+
--cline-ui-switch-off-active-background: var(--neutral-7);
|
|
61
|
+
/* Keep the off-state boundary distinct from dark page and card surfaces. */
|
|
62
|
+
--cline-ui-switch-off-border: var(--neutral-8);
|
|
63
|
+
--cline-ui-switch-disabled-thumb-background: var(--neutral-9);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Keep the native control focusable and clickable over the full wrapper hit area. */
|
|
67
|
+
.cline-ui-switch__input {
|
|
68
|
+
position: absolute;
|
|
69
|
+
inset: 0;
|
|
70
|
+
z-index: 1;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
margin: 0;
|
|
75
|
+
padding: 0;
|
|
76
|
+
border: 0;
|
|
77
|
+
opacity: 0;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.cline-ui-switch__track {
|
|
82
|
+
position: relative;
|
|
83
|
+
display: block;
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
width: var(--cline-ui-switch-width);
|
|
87
|
+
height: var(--cline-ui-switch-height);
|
|
88
|
+
border: 1px solid var(--cline-ui-switch-off-border);
|
|
89
|
+
border-radius: calc(4rem / 15);
|
|
90
|
+
background: var(--cline-ui-switch-off-background);
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
box-shadow:
|
|
93
|
+
0 0 0.1rem 0 var(--neutral-a2) inset,
|
|
94
|
+
0 0.03rem 0.1rem 0 var(--neutral-a2) inset;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cline-ui-switch__thumb {
|
|
98
|
+
position: absolute;
|
|
99
|
+
inset-inline-start: var(--cline-ui-switch-padding);
|
|
100
|
+
inset-inline-end: calc(
|
|
101
|
+
var(--cline-ui-switch-padding) +
|
|
102
|
+
var(--cline-ui-switch-travel)
|
|
103
|
+
);
|
|
104
|
+
inset-block-start: var(--cline-ui-switch-padding);
|
|
105
|
+
height: var(--cline-ui-switch-thumb-size);
|
|
106
|
+
border-radius: calc(2.2rem / 15);
|
|
107
|
+
/* Host accent palettes may tint --primary-foreground; the thumb stays neutral. */
|
|
108
|
+
background: #fff;
|
|
109
|
+
box-shadow:
|
|
110
|
+
0 0 0 1px var(--neutral-a3),
|
|
111
|
+
0 0.03rem 0.3rem 0 var(--neutral-a2),
|
|
112
|
+
0 0.05rem 0.5rem 0 var(--neutral-a4);
|
|
113
|
+
/* The leading edge stretches the thumb; both edges overshoot slightly, then settle. */
|
|
114
|
+
transition:
|
|
115
|
+
inset-inline-start 120ms var(--cline-ui-switch-leading-ease),
|
|
116
|
+
inset-inline-end 120ms var(--cline-ui-switch-trailing-ease);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.cline-ui-switch__input:checked
|
|
120
|
+
+ .cline-ui-switch__track
|
|
121
|
+
.cline-ui-switch__thumb {
|
|
122
|
+
inset-inline-start: calc(
|
|
123
|
+
var(--cline-ui-switch-padding) +
|
|
124
|
+
var(--cline-ui-switch-travel)
|
|
125
|
+
);
|
|
126
|
+
inset-inline-end: var(--cline-ui-switch-padding);
|
|
127
|
+
transition-timing-function:
|
|
128
|
+
var(--cline-ui-switch-trailing-ease), var(--cline-ui-switch-leading-ease);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.cline-ui-switch__input:disabled {
|
|
132
|
+
cursor: not-allowed;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (forced-colors: none) {
|
|
136
|
+
.cline-ui-switch__input:checked + .cline-ui-switch__track {
|
|
137
|
+
border-color: var(--neutral-a5);
|
|
138
|
+
background: color-mix(in srgb, var(--primary) 80%, var(--accent-8) 20%);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.cline-ui-switch__input:enabled:hover + .cline-ui-switch__track {
|
|
142
|
+
background: var(--cline-ui-switch-off-hover-background);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.cline-ui-switch__input:enabled:checked:hover + .cline-ui-switch__track {
|
|
146
|
+
background: var(--primary-emphasis);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.cline-ui-switch__input:enabled:active + .cline-ui-switch__track {
|
|
150
|
+
background: var(--cline-ui-switch-off-active-background);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.cline-ui-switch__input:enabled:checked:active + .cline-ui-switch__track {
|
|
154
|
+
background: var(--primary);
|
|
155
|
+
opacity: 0.92;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.cline-ui-switch__input:focus-visible + .cline-ui-switch__track {
|
|
159
|
+
outline: 2px solid var(--ring);
|
|
160
|
+
outline-offset: 2px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.cline-ui-switch__input:disabled + .cline-ui-switch__track {
|
|
164
|
+
border-color: transparent;
|
|
165
|
+
background: var(--surface-hover-darker);
|
|
166
|
+
box-shadow: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.cline-ui-switch__input:disabled
|
|
170
|
+
+ .cline-ui-switch__track
|
|
171
|
+
.cline-ui-switch__thumb {
|
|
172
|
+
background: var(--cline-ui-switch-disabled-thumb-background);
|
|
173
|
+
box-shadow: none;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@media (prefers-reduced-motion: reduce) {
|
|
178
|
+
.cline-ui-switch__thumb {
|
|
179
|
+
transition: none;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@media (forced-colors: active) {
|
|
184
|
+
.cline-ui-switch__track {
|
|
185
|
+
forced-color-adjust: none;
|
|
186
|
+
border-color: ButtonText;
|
|
187
|
+
background: Canvas;
|
|
188
|
+
box-shadow: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.cline-ui-switch__input + .cline-ui-switch__track .cline-ui-switch__thumb {
|
|
192
|
+
background: ButtonText;
|
|
193
|
+
box-shadow: none;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.cline-ui-switch__input:checked + .cline-ui-switch__track {
|
|
197
|
+
background: Highlight;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.cline-ui-switch__input:checked
|
|
201
|
+
+ .cline-ui-switch__track
|
|
202
|
+
.cline-ui-switch__thumb {
|
|
203
|
+
background: HighlightText;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.cline-ui-switch__input:focus-visible + .cline-ui-switch__track {
|
|
207
|
+
outline: 2px solid Highlight;
|
|
208
|
+
outline-offset: 2px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.cline-ui-switch__input:disabled + .cline-ui-switch__track {
|
|
212
|
+
border-color: GrayText;
|
|
213
|
+
background: Canvas;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.cline-ui-switch__input:disabled
|
|
217
|
+
+ .cline-ui-switch__track
|
|
218
|
+
.cline-ui-switch__thumb {
|
|
219
|
+
background: GrayText;
|
|
220
|
+
}
|
|
221
|
+
}
|