From 795fcfc97384e227d95d90a87af42b345276a4c7 Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala <60499540+chiragchhatrala@users.noreply.github.com> Date: Thu, 16 May 2024 18:20:40 +0530 Subject: [PATCH] Select Design Changes (#409) * Select Design Changes * update theme file for SelectInput --------- Co-authored-by: Julien Nahum --- client/components/forms/SelectInput.vue | 116 +++++---- .../components/forms/components/VSelect.vue | 244 +++++++++--------- client/lib/forms/form-themes.js | 16 +- client/package.json | 1 + 4 files changed, 197 insertions(+), 180 deletions(-) diff --git a/client/components/forms/SelectInput.vue b/client/components/forms/SelectInput.vue index aab21b3f..ee6b2990 100644 --- a/client/components/forms/SelectInput.vue +++ b/client/components/forms/SelectInput.vue @@ -3,14 +3,17 @@ + diff --git a/client/components/forms/components/VSelect.vue b/client/components/forms/components/VSelect.vue index c7b84371..8278b31b 100644 --- a/client/components/forms/components/VSelect.vue +++ b/client/components/forms/components/VSelect.vue @@ -4,24 +4,18 @@ class="v-select relative" :class="[{ 'w-0': multiple, 'min-w-full': multiple }]" > - +
- + +
    - + type="text" + class="flex-grow pl-3 pr-7 py-3 w-full focus:outline-none dark:text-white" + placeholder="Search" + > +
    + +
    - +

    - {{ - allowCreation - ? "Type something to add an option" - : "No option available" - }}. + {{ (allowCreation ? 'Type something to add an option' : 'No option available') }}.

    -
  • - Create - {{ - searchTerm - }} -
  • +
  • + Create {{ searchTerm + }} +
  • +
diff --git a/client/lib/forms/form-themes.js b/client/lib/forms/form-themes.js index da38cd4f..230982dc 100644 --- a/client/lib/forms/form-themes.js +++ b/client/lib/forms/form-themes.js @@ -32,8 +32,10 @@ export const themes = { }, SelectInput: { label: 'text-gray-700 dark:text-gray-300 font-semibold', - input: 'relative w-full rounded-lg border-gray-300 flex-1 appearance-none border border-gray-300 dark:border-gray-600 w-full px-4 bg-white text-gray-700 placeholder-gray-400 dark:bg-notion-dark-light dark:text-gray-300 dark:placeholder-gray-600 shadow-sm text-base focus:outline-none focus:ring-2 focus:border-transparent', - help: 'text-gray-400 dark:text-gray-500' + input: 'relative w-full rounded-lg border-gray-300 flex-1 appearance-none border border-gray-300 dark:border-gray-600 w-full bg-white text-gray-700 placeholder-gray-400 dark:bg-notion-dark-light dark:text-gray-300 dark:placeholder-gray-600 shadow-sm text-base focus:outline-none focus:ring-2 focus:border-transparent', + help: 'text-gray-400 dark:text-gray-500', + dropdown: 'rounded-lg border border-gray-300 dark:border-gray-600', + option: 'rounded-md' }, ScaleInput: { label: 'text-gray-700 dark:text-gray-300 font-semibold', @@ -76,8 +78,10 @@ export const themes = { }, SelectInput: { label: 'text-gray-700 dark:text-gray-300 font-semibold', - input: 'relative w-full flex-1 appearance-none border border-gray-300 dark:border-gray-600 w-full px-2 bg-white text-gray-700 placeholder-gray-400 dark:bg-notion-dark-light dark:text-gray-300 dark:placeholder-gray-600 text-base focus:outline-none focus:ring-2 focus:border-transparent', - help: 'text-gray-400 dark:text-gray-500' + input: 'relative w-full flex-1 appearance-none border border-gray-300 dark:border-gray-600 w-full bg-white text-gray-700 placeholder-gray-400 dark:bg-notion-dark-light dark:text-gray-300 dark:placeholder-gray-600 text-base focus:outline-none focus:ring-2 focus:border-transparent', + help: 'text-gray-400 dark:text-gray-500', + dropdown: 'border border-gray-300 dark:border-gray-600', + option: '' }, CodeInput: { label: 'text-gray-700 dark:text-gray-300 font-semibold', @@ -131,7 +135,9 @@ export const themes = { SelectInput: { label: 'text-gray-900 dark:text-gray-100 mb-2 block mt-4', input: 'rounded relative w-full border-transparent flex-1 appearance-none bg-notion-input-background shadow-inner-notion w-full px-2 text-gray-900 placeholder-gray-400 dark:bg-notion-dark-light dark:placeholder-gray-500 text-base focus:outline-none focus:ring-0 focus:border-transparent focus:shadow-focus-notion', - help: 'text-notion-input-help dark:text-gray-500' + help: 'text-notion-input-help dark:text-gray-500', + dropdown: 'rounded border border-gray-300 dark:border-gray-600', + option: 'rounded' }, CodeInput: { label: 'text-gray-900 dark:text-gray-100 mb-2 block mt-4', diff --git a/client/package.json b/client/package.json index 47bb8ece..2a2235be 100644 --- a/client/package.json +++ b/client/package.json @@ -46,6 +46,7 @@ "codemirror": "^6.0.1", "crisp-sdk-web": "^1.0.21", "date-fns": "^2.30.0", + "debounce": "^1.2.1", "fuse.js": "^6.4.6", "js-sha256": "^0.10.0", "libphonenumber-js": "^1.10.44",