Skip to content

Commit 51deba8

Browse files
authored
feat: multi-select component (#5486)
* start multiselect component * update styles * small fix * fix padding and styles * add border bottom on sticky items * add border bottom to search as well * fix select all showing line * use multi-select component for languages field * add no options story for empty state * fix height
1 parent b2d40af commit 51deba8

6 files changed

Lines changed: 817 additions & 11 deletions

File tree

apps/frontend/src/pages/[type]/[id]/settings/server.vue

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@
2626
>Languages <span class="font-normal text-secondary">(optional)</span></span
2727
>
2828
</label>
29-
<Multiselect
29+
<MultiSelect
3030
id="server-language"
3131
v-model="languages"
32-
:options="languageOptions.map((l) => l.value)"
33-
:custom-label="(code) => languageOptions.find((l) => l.value === code)?.label ?? code"
34-
:multiple="true"
35-
:searchable="true"
36-
:show-labels="false"
37-
:close-on-select="false"
32+
:options="languageOptions"
33+
searchable
34+
include-select-all-option
35+
:maxTagRows="2"
3836
placeholder="Select languages"
3937
:disabled="!hasPermission"
4038
/>
@@ -166,12 +164,12 @@ import {
166164
injectModrinthClient,
167165
injectNotificationManager,
168166
injectProjectPageContext,
167+
MultiSelect,
169168
SERVER_LANGUAGES,
170169
SERVER_REGIONS,
171170
StyledInput,
172171
UnsavedChangesPopup,
173172
} from '@modrinth/ui'
174-
import { Multiselect } from 'vue-multiselect'
175173
176174
import CompatibilityCard from '~/components/ui/project-settings/CompatibilityCard.vue'
177175

packages/assets/styles/defaults.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ h3 {
158158
}
159159

160160
::-webkit-scrollbar-thumb {
161-
background: var(--color-button-bg);
161+
background: var(--color-scrollbar);
162162
}
163163

164164
// Firefox scrollbar
165165
* {
166166
scrollbar-width: thin;
167-
scrollbar-color: var(--color-button-bg) transparent;
167+
scrollbar-color: var(--color-scrollbar) transparent;
168168
}

packages/assets/styles/variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ html {
320320

321321
--color-button-bg: var(--surface-4);
322322
--color-button-border: rgba(193, 190, 209, 0.12);
323-
--color-scrollbar: var(--color-button-bg);
323+
--color-scrollbar: var(--surface-5);
324324

325325
--color-divider: var(--color-button-bg);
326326
--color-divider-dark: #646c75;

0 commit comments

Comments
 (0)