|
1 | 1 | <script lang="ts"> |
2 | 2 | import { mod } from "../lib/math.ts"; |
3 | 3 |
|
| 4 | + type Entry = { |
| 5 | + name: string; |
| 6 | + icon?: string; |
| 7 | + href?: string; |
| 8 | + description?: string; |
| 9 | + search?: string; |
| 10 | + shortcut?: string; |
| 11 | + dialog?: boolean; |
| 12 | + content?: Array<Entry>; |
| 13 | + }; |
| 14 | +
|
4 | 15 | interface Props { |
5 | 16 | prompt: string; |
6 | 17 | files: Entry[]; |
|
110 | 121 | /> |
111 | 122 |
|
112 | 123 | <div class="w-full"> |
113 | | - <span class="text-grey">{prompt}</span> |
| 124 | + <span class="text-black/70 dark:text-white/70">{prompt}</span> |
114 | 125 | <span>~/{files[activeIndexes[0]].name}</span> |
115 | 126 | </div> |
116 | 127 | <div class="h-full w-full grid grid-cols-[minmax(140px,max-content)_minmax(140px,max-content)_1fr] border"> |
117 | 128 | <div class="p-2 lf-pane-left"> |
118 | 129 | <ul> |
119 | 130 | {#each files as { name, icon, href, content }, index} |
120 | | - <li class={"px-2 leading-snug " + (index === activeIndexes[0] ? "bg-white text-black" : "")}> |
| 131 | + <li class={"px-2 leading-snug " + (index === activeIndexes[0] ? "bg-black text-white dark:bg-white dark:text-black" : "")}> |
121 | 132 | {#if href} |
122 | 133 | <a {href} |
123 | 134 | ><span class="text-sm mr-0.5">{icon || (href && " ") || (content && " ") || " "}</span> |
|
134 | 145 | <div class="p-2 border-x"> |
135 | 146 | <ul> |
136 | 147 | {#if files[activeIndexes[0]].content?.length == 0} |
137 | | - <li class={"px-2 leading-snug text-red"}>EMPTY</li> |
| 148 | + <li class={"px-2 leading-snug text-red-700 dark:text-red-400"}>EMPTY</li> |
138 | 149 | {:else if files[activeIndexes[0]].content?.length} |
139 | 150 | {#each files[activeIndexes[0]].content ?? [] as { name, icon, href, content }, index} |
140 | | - <li class={"px-2 leading-snug " + (index === activeIndexes[1] ? "bg-white text-black" : "")}> |
| 151 | + <li class={"px-2 leading-snug " + (index === activeIndexes[1] ? "bg-black text-white dark:bg-white dark:text-black" : "")}> |
141 | 152 | <span class="text-sm mr-0.5">{icon || (href && " ") || (content && " ") || " "}</span> |
142 | 153 | {name} |
143 | 154 | </li> |
|
177 | 188 | </div> |
178 | 189 | <dialog |
179 | 190 | bind:this={dialog} |
180 | | - class="m-auto bg-black text-white border fixed inset-0" |
| 191 | + class="fixed inset-0 m-auto border border-black/70 bg-white text-black backdrop:bg-black/5 dark:border-white/70 dark:bg-black dark:text-white dark:backdrop:bg-black/60" |
181 | 192 | onclick={onDialogClick} |
182 | 193 | > |
183 | 194 | <form |
|
189 | 200 | <label for="input"> {files[activeIndexes[0]].name}</label> |
190 | 201 | <input |
191 | 202 | id="input" |
192 | | - class="bg-black text-white ml-1 w-96" |
| 203 | + class="ml-1 w-96" |
193 | 204 | bind:value={query} |
194 | 205 | /> |
195 | 206 | <input |
196 | 207 | type="submit" |
197 | 208 | value="" |
198 | | - class="cursor-pointer w-6" |
| 209 | + class="w-6 cursor-pointer" |
199 | 210 | onclick={handleSubmit} |
200 | 211 | /> |
201 | 212 | </p> |
|
0 commit comments