search.ts

 1import Theme from "../themes/theme";
 2import { backgroundColor, border, player, text } from "./components";
 3
 4export default function search(theme: Theme) {
 5  const optionButton = {
 6    ...text(theme, "mono", "secondary"),
 7    background: backgroundColor(theme, 300),
 8    cornerRadius: 6,
 9    border: border(theme, "primary"),
10    margin: {
11      left: 1,
12      right: 1,
13    },
14    padding: {
15      bottom: 1,
16      left: 6,
17      right: 6,
18      top: 1,
19    },
20  };
21
22  const editor = {
23    background: backgroundColor(theme, 500),
24    cornerRadius: 6,
25    minWidth: 200,
26    maxWidth: 500,
27    placeholderText: text(theme, "mono", "placeholder"),
28    selection: player(theme, 1).selection,
29    text: text(theme, "mono", "primary"),
30    border: border(theme, "secondary"),
31    margin: {
32      right: 5,
33    },
34    padding: {
35      top: 3,
36      bottom: 3,
37      left: 14,
38      right: 14,
39    },
40  };
41
42  return {
43    matchBackground: theme.editor.highlight.match.value,
44    tabIconSpacing: 4,
45    tabIconWidth: 14,
46    activeHoveredOptionButton: {
47      ...optionButton,
48      background: backgroundColor(theme, 100),
49    },
50    activeOptionButton: {
51      ...optionButton,
52      background: backgroundColor(theme, 100),
53    },
54    editor,
55    hoveredOptionButton: {
56      ...optionButton,
57      background: backgroundColor(theme, 100),
58    },
59    invalidEditor: {
60      ...editor,
61      border: border(theme, "error"),
62    },
63    matchIndex: {
64      ...text(theme, "mono", "muted"),
65      padding: 6,
66    },
67    optionButton,
68    optionButtonGroup: {
69      padding: {
70        left: 2,
71        right: 2,
72      },
73    },
74    resultsStatus: {
75      ...text(theme, "mono", "primary"),
76      size: 18,
77    },
78  };
79}