|
1 | 1 | <script lang="ts"> |
2 | 2 | import { languages, themes, type LocalSettingsStore } from '$lib'; |
3 | 3 | import { m } from '$lib/paraglide/messages'; |
4 | | - import { NavigationMenu, Select } from 'bits-ui'; |
| 4 | + import { Dialog, NavigationMenu, Select } from 'bits-ui'; |
5 | 5 | import { getContext } from 'svelte'; |
6 | 6 | import { page } from '$app/state'; |
7 | 7 |
|
|
17 | 17 | {href} |
18 | 18 | {active} |
19 | 19 | class={active |
20 | | - ? 'inline-flex h-full items-center border-b-2 border-indigo-600 px-1 pt-1 text-sm font-medium text-gray-900 dark:border-indigo-500 dark:text-white' |
| 20 | + ? 'inline-flex h-full items-center border-b-2 border-primary-600 px-1 pt-1 text-sm font-medium text-gray-900 dark:border-primary-500 dark:text-white' |
21 | 21 | : 'inline-flex h-full items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:border-white/20 dark:hover:text-white'}>{text}</NavigationMenu.Link |
22 | 22 | > |
23 | 23 | </NavigationMenu.Item> |
|
41 | 41 | <Select.Trigger |
42 | 42 | aria-haspopup="listbox" |
43 | 43 | type="button" |
44 | | - class="grid cursor-default grid-cols-1 rounded-md bg-white py-1.5 pr-2 pl-3 text-left text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-indigo-600 sm:text-sm/6 dark:bg-white/5 dark:text-white dark:outline-white/10 dark:focus-visible:outline-indigo-500" |
| 44 | + class="grid cursor-default grid-cols-1 rounded-md bg-white py-1.5 pr-2 pl-3 text-left text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary-600 sm:text-sm/6 dark:bg-white/5 dark:text-white dark:outline-white/10 dark:focus-visible:outline-primary-500" |
45 | 45 | > |
46 | 46 | <div class="col-start-1 row-start-1 flex items-center gap-3 pr-6"> |
47 | 47 | <currentThemeObject.icon class="size-5 shrink-0 rounded-full" width="20" height="20" /> |
48 | | - <span class="block truncate">{currentThemeObject.name}</span> |
| 48 | + <span class="hidden truncate md:block">{currentThemeObject.name}</span> |
49 | 49 | </div> |
50 | 50 | <svg viewBox="0 0 16 16" fill="currentColor" data-slot="icon" aria-hidden="true" class="col-start-1 row-start-1 size-5 self-center justify-self-end text-gray-500 sm:size-4 dark:text-gray-400"> |
51 | 51 | <path |
|
60 | 60 | {#each Object.values(themes) as theme (theme.id)} |
61 | 61 | <Select.Item |
62 | 62 | value={theme.id} |
63 | | - class="group/option relative block cursor-default py-2 pr-9 pl-3 text-gray-900 select-none focus:bg-indigo-600 focus:text-white focus:outline-hidden dark:text-white dark:focus:bg-indigo-500 dark:focus:text-white" |
| 63 | + class="group/option relative block cursor-default py-2 pr-9 pl-3 text-gray-900 select-none focus:bg-primary-600 focus:text-white focus:outline-hidden dark:text-white dark:focus:bg-primary-500 dark:focus:text-white" |
64 | 64 | > |
65 | 65 | <div class="flex items-center"> |
66 | 66 | <theme.icon class="size-5 shrink-0 rounded-full text-gray-900 dark:text-white" width="20" height="20" /> |
67 | 67 | <span class="ml-3 block truncate font-normal group-aria-selected/option:font-semibold">{theme.name}</span> |
68 | 68 | </div> |
69 | | - <span class="absolute inset-y-0 right-0 flex items-center pr-4 text-indigo-600 group-not-aria-selected/option:hidden group-focus/option:text-white in-[el-selectedcontent]:hidden dark:text-indigo-400"> |
| 69 | + <span class="absolute inset-y-0 right-0 flex items-center pr-4 text-primary-600 group-not-aria-selected/option:hidden group-focus/option:text-white in-[el-selectedcontent]:hidden dark:text-primary-400"> |
70 | 70 | <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5"> |
71 | 71 | <path d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clip-rule="evenodd" fill-rule="evenodd" /> |
72 | 72 | </svg> |
|
81 | 81 | <Select.Trigger |
82 | 82 | aria-haspopup="listbox" |
83 | 83 | type="button" |
84 | | - class="grid cursor-default grid-cols-1 rounded-md bg-white py-1.5 pr-2 pl-3 text-left text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-indigo-600 sm:text-sm/6 dark:bg-white/5 dark:text-white dark:outline-white/10 dark:focus-visible:outline-indigo-500" |
| 84 | + class="grid cursor-default grid-cols-1 rounded-md bg-white py-1.5 pr-2 pl-3 text-left text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary-600 sm:text-sm/6 dark:bg-white/5 dark:text-white dark:outline-white/10 dark:focus-visible:outline-primary-500" |
85 | 85 | > |
86 | 86 | <div class="col-start-1 row-start-1 flex items-center gap-3 pr-6"> |
87 | 87 | <!--temp fix--> |
|
92 | 92 | {:else} |
93 | 93 | <enhanced:img src={languages.en.flag} alt="" class="size-5 shrink-0 rounded-full bg-gray-100 dark:bg-gray-700 dark:-outline-offset-1 dark:outline-white/10" /> |
94 | 94 | {/if} |
95 | | - <span class="block truncate">{currentLanguageObject.name}</span> |
| 95 | + <span class="hidden truncate md:block">{currentLanguageObject.name}</span> |
96 | 96 | </div> |
97 | 97 | <svg viewBox="0 0 16 16" fill="currentColor" data-slot="icon" aria-hidden="true" class="col-start-1 row-start-1 size-5 self-center justify-self-end text-gray-500 sm:size-4 dark:text-gray-400"> |
98 | 98 | <path |
|
107 | 107 | {#each Object.values(languages) as lang (lang.id)} |
108 | 108 | <Select.Item |
109 | 109 | value={lang.id} |
110 | | - class="group/option relative block cursor-default py-2 pr-9 pl-3 text-gray-900 select-none focus:bg-indigo-600 focus:text-white focus:outline-hidden dark:text-white dark:focus:bg-indigo-500 dark:focus:text-white" |
| 110 | + class="group/option relative block cursor-default py-2 pr-9 pl-3 text-gray-900 select-none focus:bg-primary-600 focus:text-white focus:outline-hidden dark:text-white dark:focus:bg-primary-500 dark:focus:text-white" |
111 | 111 | > |
112 | 112 | <div class="flex items-center"> |
113 | 113 | <enhanced:img src={lang.flag} alt="" class="size-5 shrink-0 rounded-full" /> |
114 | 114 | <span class="ml-3 block truncate font-normal group-aria-selected/option:font-semibold">{lang.name}</span> |
115 | 115 | </div> |
116 | | - <span class="absolute inset-y-0 right-0 flex items-center pr-4 text-indigo-600 group-not-aria-selected/option:hidden group-focus/option:text-white in-[el-selectedcontent]:hidden dark:text-indigo-400"> |
| 116 | + <span class="absolute inset-y-0 right-0 flex items-center pr-4 text-primary-600 group-not-aria-selected/option:hidden group-focus/option:text-white in-[el-selectedcontent]:hidden dark:text-primary-400"> |
117 | 117 | <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5"> |
118 | 118 | <path d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clip-rule="evenodd" fill-rule="evenodd" /> |
119 | 119 | </svg> |
|
125 | 125 | </Select.Root> |
126 | 126 | </div> |
127 | 127 | <div class="-mr-2 flex items-center sm:hidden"> |
128 | | - <!-- Mobile menu button --> |
129 | | - <button |
130 | | - type="button" |
131 | | - command="--toggle" |
132 | | - commandfor="mobile-menu" |
133 | | - class="relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-2 focus:-outline-offset-1 focus:outline-indigo-600" |
134 | | - > |
135 | | - <span class="absolute -inset-0.5"></span> |
136 | | - <span class="sr-only">Open main menu</span> |
137 | | - <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" data-slot="icon" aria-hidden="true" class="size-6 in-aria-expanded:hidden"> |
138 | | - <path d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" stroke-linecap="round" stroke-linejoin="round" /> |
139 | | - </svg> |
140 | | - <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" data-slot="icon" aria-hidden="true" class="size-6 not-in-aria-expanded:hidden"> |
141 | | - <path d="M6 18 18 6M6 6l12 12" stroke-linecap="round" stroke-linejoin="round" /> |
142 | | - </svg> |
143 | | - </button> |
| 128 | + <Dialog.Root> |
| 129 | + <Dialog.Trigger |
| 130 | + type="button" |
| 131 | + command="--toggle" |
| 132 | + commandfor="mobile-menu" |
| 133 | + class="relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-2 focus:-outline-offset-1 focus:outline-primary-600" |
| 134 | + > |
| 135 | + <span class="absolute -inset-0.5"></span> |
| 136 | + <span class="sr-only">Open main menu</span> |
| 137 | + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" data-slot="icon" aria-hidden="true" class="size-6"> |
| 138 | + <path d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" stroke-linecap="round" stroke-linejoin="round" /> |
| 139 | + </svg> |
| 140 | + </Dialog.Trigger> |
| 141 | + <Dialog.Portal> |
| 142 | + <Dialog.Overlay class="fixed inset-0 z-50 bg-black/80" /> |
| 143 | + <Dialog.Content class="fixed inset-0 z-50 overflow-auto bg-white p-4 dark:bg-gray-800"> |
| 144 | + <div class="space-y-1 pt-2 pb-3"> |
| 145 | + <!-- Current: "bg-primary-50 border-primary-600 text-primary-700", Default: "border-transparent text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-700" --> |
| 146 | + <a href="#" class="block border-l-4 border-primary-600 bg-primary-50 py-2 pr-4 pl-3 text-base font-medium text-primary-700">Dashboard</a> |
| 147 | + <a href="#" class="block border-l-4 border-transparent py-2 pr-4 pl-3 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-700">Team</a> |
| 148 | + <a href="#" class="block border-l-4 border-transparent py-2 pr-4 pl-3 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-700">Projects</a> |
| 149 | + <a href="#" class="block border-l-4 border-transparent py-2 pr-4 pl-3 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-700">Calendar</a> |
| 150 | + </div> |
| 151 | + </Dialog.Content> |
| 152 | + </Dialog.Portal> |
| 153 | + </Dialog.Root> |
144 | 154 | </div> |
145 | 155 | </div> |
146 | 156 | </div> |
|
0 commit comments