From 249dc53371a9900fe70433428f69c598383e6218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9C=D0=B0?= =?UTF-8?q?=D0=BB=D1=8E=D0=B3=D0=B8=D0=BD?= Date: Tue, 17 Sep 2024 16:24:15 +0500 Subject: [PATCH 1/9] add slider and refactor ui-library --- src/app/components.d.ts | 1 + src/app/helpers/index.ts | 39 +++++++ src/components/CreateEntityMenu.vue | 2 +- .../settings/EntityPositionSettings.vue | 4 +- src/modules/PageHeader.vue | 2 +- src/modules/entities/EntitiesList.vue | 2 +- src/output.css | 4 + src/shared/ui/MenuDial.vue | 12 +- src/shared/ui/Slider.vue | 83 ++++++++++++++ src/shared/ui/ToggleSwitch.vue | 103 ++++++++---------- 10 files changed, 184 insertions(+), 68 deletions(-) create mode 100644 src/shared/ui/Slider.vue diff --git a/src/app/components.d.ts b/src/app/components.d.ts index 4b32cae..7e47a2d 100644 --- a/src/app/components.d.ts +++ b/src/app/components.d.ts @@ -55,6 +55,7 @@ declare module 'vue' { SidebarMenuHeader: typeof import('./../modules/SidebarMenuHeader.vue')['default'] SignIn: typeof import('./../pages/authorization/signIn.vue')['default'] SignUp: typeof import('./../pages/authorization/signUp.vue')['default'] + Slider: typeof import('./../shared/ui/Slider.vue')['default'] SolidIcon: typeof import('./../shared/icons/SolidIcon.vue')['default'] TableIcon: typeof import('./../shared/icons/TableIcon.vue')['default'] TelegramSection: typeof import('./../modules/TelegramSection.vue')['default'] diff --git a/src/app/helpers/index.ts b/src/app/helpers/index.ts index e626cbb..4c49b39 100644 --- a/src/app/helpers/index.ts +++ b/src/app/helpers/index.ts @@ -119,3 +119,42 @@ export const convertThemeToColorWhiteDefault = (theme: string | undefined) => { } return '#ffffff'; }; + +export const convertThemeToColorBlackDefault = (theme: string | undefined) => { + if (!theme) return '#000000'; + switch (theme) { + case 'white': + return '#ffffff'; + case 'slate': + return '#64748b'; + case 'blue': + return '#3b82f6'; + case 'sky': + return '#0ea5e9'; + case 'teal': + return '#14b8a6'; + case 'lime': + return '#84cc16'; + case 'green': + return '#22c55e'; + case 'yellow': + return '#eab308'; + case 'orange': + return '#f97316'; + case 'pink': + return '#ec4899'; + case 'fuchsia': + return '#d946ef'; + case 'purple': + return '#a855f7'; + case 'indigo': + return '#6366f1'; + case 'rose': + return '#f43f5e'; + case 'red': + return '#ef4444'; + case 'black': + return '#000000'; + } + return '#000000'; +}; diff --git a/src/components/CreateEntityMenu.vue b/src/components/CreateEntityMenu.vue index a96c3f6..b8293ec 100644 --- a/src/components/CreateEntityMenu.vue +++ b/src/components/CreateEntityMenu.vue @@ -123,7 +123,7 @@ const speedDialItems = ref([