|
5 | 5 | import { Cog } from "@lucide/svelte"; |
6 | 6 | import { DropdownMenu } from "bits-ui"; |
7 | 7 | import { fly } from "svelte/transition"; |
| 8 | + import UpvoteAction from "./UpvoteAction.svelte"; |
8 | 9 |
|
9 | 10 | const uiStore = getContext<UIStore>("uiStore"); |
10 | 11 | </script> |
|
39 | 40 | <div {...props} transition:fly={{ y: -10, duration: 200 }}> |
40 | 41 | <DropdownMenu.Group |
41 | 42 | class="grid grid-cols-1 gap-y-1" |
42 | | - aria-label="Behaviour" |
| 43 | + aria-label="Feature Voting" |
| 44 | + > |
| 45 | + <DropdownMenu.GroupHeading> |
| 46 | + <h4 class="m-0 ml-1 grid grid-cols-[0px_1fr]"> |
| 47 | + <span></span> |
| 48 | + <span class="flex justify-between gap-3"> |
| 49 | + <Switch |
| 50 | + bind:checked={uiStore |
| 51 | + .toolbar |
| 52 | + .featureVotingVisible} |
| 53 | + labelText="Feature Voting" |
| 54 | + /> |
| 55 | + </span> |
| 56 | + </h4> |
| 57 | + </DropdownMenu.GroupHeading> |
| 58 | + |
| 59 | + {#if uiStore.toolbar |
| 60 | + .featureVotingVisible} |
| 61 | + <DropdownMenu.Separator |
| 62 | + class="-ml-1 -mr-1 block h-px bg-zinc-200" |
| 63 | + /> |
| 64 | + <DropdownMenu.Item |
| 65 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 66 | + closeOnSelect={false} |
| 67 | + > |
| 68 | + <span></span> |
| 69 | + <span |
| 70 | + class="flex justify-between items-center gap-3" |
| 71 | + > |
| 72 | + <UpvoteAction |
| 73 | + key="auto-hide-toolbar" |
| 74 | + label="Auto-Hide Toolbar" |
| 75 | + /> |
| 76 | + </span> |
| 77 | + </DropdownMenu.Item> |
| 78 | + <DropdownMenu.Item |
| 79 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 80 | + closeOnSelect={false} |
| 81 | + > |
| 82 | + <span></span> |
| 83 | + <span |
| 84 | + class="flex justify-between items-center gap-3" |
| 85 | + > |
| 86 | + <UpvoteAction |
| 87 | + key="auto-move-toolbar" |
| 88 | + label="Auto-Move Toolbar" |
| 89 | + /> |
| 90 | + </span> |
| 91 | + </DropdownMenu.Item> |
| 92 | + <DropdownMenu.Item |
| 93 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 94 | + closeOnSelect={false} |
| 95 | + > |
| 96 | + <span></span> |
| 97 | + <span |
| 98 | + class="flex justify-between items-center gap-3" |
| 99 | + > |
| 100 | + <UpvoteAction |
| 101 | + key="auto-move-sidepanel" |
| 102 | + label="Auto-Move Sidepanel" |
| 103 | + /> |
| 104 | + </span> |
| 105 | + </DropdownMenu.Item> |
| 106 | + <DropdownMenu.Item |
| 107 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 108 | + closeOnSelect={false} |
| 109 | + > |
| 110 | + <span></span> |
| 111 | + <span |
| 112 | + class="flex justify-between items-center gap-3" |
| 113 | + > |
| 114 | + <UpvoteAction |
| 115 | + key="multiple-trackers" |
| 116 | + label="Multiple Trackers" |
| 117 | + /> |
| 118 | + </span> |
| 119 | + </DropdownMenu.Item> |
| 120 | + <DropdownMenu.Item |
| 121 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 122 | + closeOnSelect={false} |
| 123 | + > |
| 124 | + <span></span> |
| 125 | + <span |
| 126 | + class="flex justify-between items-center gap-3" |
| 127 | + > |
| 128 | + <UpvoteAction |
| 129 | + key="neighbour-distances" |
| 130 | + label="Neighbour Distances" |
| 131 | + /> |
| 132 | + </span> |
| 133 | + </DropdownMenu.Item> |
| 134 | + <DropdownMenu.Item |
| 135 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 136 | + closeOnSelect={false} |
| 137 | + > |
| 138 | + <span></span> |
| 139 | + <span |
| 140 | + class="flex justify-between items-center gap-3" |
| 141 | + > |
| 142 | + <UpvoteAction |
| 143 | + key="onscreeen-measurement-lines" |
| 144 | + label="Onscreen Measurement Lines" |
| 145 | + /> |
| 146 | + </span> |
| 147 | + </DropdownMenu.Item> |
| 148 | + <DropdownMenu.Item |
| 149 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 150 | + closeOnSelect={false} |
| 151 | + > |
| 152 | + <span></span> |
| 153 | + <span |
| 154 | + class="flex justify-between items-center gap-3" |
| 155 | + > |
| 156 | + <UpvoteAction |
| 157 | + key="parent-traversal" |
| 158 | + label="Parent Traversal" |
| 159 | + /> |
| 160 | + </span> |
| 161 | + </DropdownMenu.Item> |
| 162 | + <DropdownMenu.Item |
| 163 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 164 | + closeOnSelect={false} |
| 165 | + > |
| 166 | + <span></span> |
| 167 | + <span |
| 168 | + class="flex justify-between items-center gap-3" |
| 169 | + > |
| 170 | + <UpvoteAction |
| 171 | + key="sibling-traversal" |
| 172 | + label="Sibling Traversal" |
| 173 | + /> |
| 174 | + </span> |
| 175 | + </DropdownMenu.Item> |
| 176 | + <DropdownMenu.Item |
| 177 | + class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
| 178 | + closeOnSelect={false} |
| 179 | + > |
| 180 | + <span></span> |
| 181 | + <span |
| 182 | + class="flex justify-between items-center gap-3" |
| 183 | + > |
| 184 | + <UpvoteAction |
| 185 | + key="viewport-resizer" |
| 186 | + label="Viewport Resizer" |
| 187 | + /> |
| 188 | + </span> |
| 189 | + </DropdownMenu.Item> |
| 190 | + {/if} |
| 191 | + </DropdownMenu.Group> |
| 192 | + <DropdownMenu.Separator |
| 193 | + class="my-1 -ml-1 -mr-1 block h-px bg-zinc-200" |
| 194 | + /> |
| 195 | + <DropdownMenu.Group |
| 196 | + class="grid grid-cols-1 gap-y-1" |
| 197 | + aria-label="Toolbar Behaviour" |
43 | 198 | > |
44 | 199 | <DropdownMenu.GroupHeading> |
45 | 200 | <h4 class="m-0 ml-1"> |
|
50 | 205 | class="-ml-1 -mr-1 block h-px bg-zinc-200" |
51 | 206 | /> |
52 | 207 | <DropdownMenu.CheckboxItem |
53 | | - class="hover:bg-lime-200 hover:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0" |
| 208 | + class="hover:not-data-[disabled]:bg-lime-200 hover:not-data-[disabled]:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
54 | 209 | bind:checked={uiStore.toolbar.autoMove} |
| 210 | + disabled |
55 | 211 | closeOnSelect={false} |
56 | 212 | > |
57 | 213 | {#snippet children( |
|
60 | 216 | <span></span> |
61 | 217 | <span class="flex justify-between gap-3"> |
62 | 218 | <Switch |
63 | | - labelText="Auto-Move" |
64 | 219 | checked={checked} |
| 220 | + disabled |
| 221 | + labelText="Auto-Move" |
65 | 222 | /> |
66 | 223 | </span> |
67 | 224 | {/snippet} |
68 | 225 | </DropdownMenu.CheckboxItem> |
69 | | - |
70 | 226 | <DropdownMenu.CheckboxItem |
71 | | - class="hover:bg-lime-200 border-1 border-transparent rounded-lg hover:border-lime-900 grid grid-cols-[0px_1fr] pl-1" |
| 227 | + class="hover:not-data-[disabled]:bg-lime-200 hover:not-data-[disabled]:text-lime-500 border-1 border-transparent rounded-lg grid grid-cols-[0px_1fr] pl-1 outline-0 hover:data-[disabled]:cursor-not-allowed" |
72 | 228 | bind:checked={uiStore.toolbar.autoHide} |
73 | 229 | disabled |
74 | 230 | closeOnSelect={false} |
|
0 commit comments