From b55439ce44a1c200cf0ea568da7daaf56f241549 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Fri, 2 Jul 2021 16:30:08 +0000 Subject: [PATCH] feat: tooltip and popover components --- assets/scss/styles.scss | 198 +----------------- assets/scss/themes.scss | 12 +- components/app/Extensions.vue | 6 +- components/app/Footer.vue | 53 ----- components/app/Header.vue | 167 ++++++++------- components/app/Sidenav.vue | 2 +- components/collections/ImportExport.vue | 92 ++++---- components/collections/graphql/Collection.vue | 81 ++++--- components/collections/graphql/Folder.vue | 70 +++---- .../collections/graphql/ImportExport.vue | 82 ++++---- components/collections/graphql/Request.vue | 66 +++--- components/collections/index.vue | 5 +- components/collections/my/Collection.vue | 86 ++++---- components/collections/my/Folder.vue | 84 ++++---- components/collections/my/Request.vue | 72 +++---- components/collections/teams/Collection.vue | 100 ++++----- components/collections/teams/Folder.vue | 98 +++++---- components/collections/teams/Request.vue | 75 ++++--- components/environments/Edit.vue | 6 +- components/environments/Environment.vue | 48 ++--- components/environments/ImportExport.vue | 82 ++++---- components/firebase/Login.vue | 6 +- components/firebase/Logout.vue | 2 +- components/history/graphql/Card.vue | 76 +++---- components/history/index.vue | 9 +- components/history/rest/Card.vue | 70 ++++--- components/http/BodyParameters.vue | 9 +- components/http/CodegenModal.vue | 47 ++--- components/http/Headers.vue | 9 +- components/http/Parameters.vue | 9 +- components/http/RawBody.vue | 9 +- components/http/TokenList.vue | 9 +- components/landing/CTA.vue | 77 +++++++ components/landing/Features.vue | 28 +-- components/landing/Footer.vue | 15 +- components/landing/Globe.vue | 46 +++- components/landing/Hero.vue | 16 +- components/landing/Package.vue | 142 ------------- components/landing/Users.vue | 2 +- .../lenses/renderers/HTMLLensRenderer.vue | 12 +- .../lenses/renderers/ImageLensRenderer.vue | 3 +- .../lenses/renderers/JSONLensRenderer.vue | 9 +- .../lenses/renderers/RawLensRenderer.vue | 9 +- .../lenses/renderers/XMLLensRenderer.vue | 9 +- components/realtime/Socketio.vue | 3 +- components/realtime/Websocket.vue | 6 +- components/smart/AccentModePicker.vue | 3 +- components/smart/ChangeLanguage.vue | 5 +- components/smart/ColorModePicker.vue | 7 +- components/smart/HideMenu.vue | 3 +- components/teams/Edit.vue | 152 ++++++-------- components/teams/Team.vue | 79 +++---- layouts/default.vue | 1 + nuxt.config.js | 10 +- package-lock.json | 39 ---- package.json | 1 - pages/api.vue | 144 +++++++------ pages/doc.vue | 9 +- pages/graphql.vue | 36 ++-- pages/index.vue | 4 +- pages/settings.vue | 9 +- plugins/v-tippy.js | 5 +- plugins/v-tooltip.js | 9 - 63 files changed, 1172 insertions(+), 1461 deletions(-) delete mode 100644 components/app/Footer.vue create mode 100644 components/landing/CTA.vue delete mode 100644 components/landing/Package.vue delete mode 100644 plugins/v-tooltip.js diff --git a/assets/scss/styles.scss b/assets/scss/styles.scss index 829e5f117..d86420c4b 100644 --- a/assets/scss/styles.scss +++ b/assets/scss/styles.scss @@ -46,9 +46,6 @@ body { @apply text-secondary; @apply font-medium; @apply select-none; - @apply transition-colors; - @apply ease-in-out; - @apply duration-150; @apply overflow-x-hidden; -webkit-tap-highlight-color: transparent; @@ -63,8 +60,7 @@ body.sticky-footer footer { .page-leave-active, .layout-enter-active, .layout-leave-active { - @apply transition-opacity; - @apply duration-150; + @apply transition; } .page-enter, @@ -139,9 +135,6 @@ h3.heading { p { @apply text-sm; - @apply transition; - @apply ease-in-out; - @apply duration-150; } hr { @@ -168,168 +161,28 @@ hr { } &[x-placement^="top"] .tippy-tooltip .tippy-arrow { - border-top-color: var(--color-primary-light); + border-top-color: var(--primary-light-color); } &[x-placement^="bottom"] .tippy-tooltip .tippy-arrow { - border-bottom-color: var(--color-primary-light); + border-bottom-color: var(--primary-light-color); } &[x-placement^="left"] .tippy-tooltip .tippy-arrow { - border-left-color: var(--color-primary-light); + border-left-color: var(--primary-light-color); } &[x-placement^="right"] .tippy-tooltip .tippy-arrow { - border-right-color: var(--color-primary-light); + border-right-color: var(--primary-light-color); } } -[arrow] > div { +.tippy-content > div { @apply flex; - @apply w-full; -} - -.tooltip { - @apply z-50; - @apply outline-none; - - .tooltip-inner { - @apply rounded-lg; - @apply px-4; - @apply py-2; - @apply text-xs text-secondary; - @apply font-medium; - @apply shadow-lg; - @apply transition; - @apply ease-in-out; - @apply duration-150; - @apply bg-tooltip; - } - - .tooltip-arrow { - @apply h-0; - @apply w-0; - @apply border-solid border-tooltip; - @apply absolute; - @apply m-2; - @apply z-30; - @apply transition; - @apply ease-in-out; - @apply duration-150; - } - - &[x-placement^="top"] { - @apply mb-0; - - .tooltip-arrow { - @apply mt-0 mb-0; - - border-width: 5px 5px 0 5px; - border-left-color: transparent !important; - border-right-color: transparent !important; - border-bottom-color: transparent !important; - bottom: -5px; - left: calc(50% - 5px); - } - } - - &[x-placement^="bottom"] { - @apply mt-0; - - .tooltip-arrow { - @apply mt-0 mb-0; - - border-width: 0 5px 5px 5px; - border-left-color: transparent !important; - border-right-color: transparent !important; - border-top-color: transparent !important; - top: -5px; - left: calc(50% - 5px); - } - } - - &[x-placement^="right"] { - @apply ml-0; - - .tooltip-arrow { - @apply ml-0 mr-0; - - border-width: 5px 5px 5px 0; - border-left-color: transparent !important; - border-top-color: transparent !important; - border-bottom-color: transparent !important; - left: -5px; - top: calc(50% - 5px); - } - } - - &[x-placement^="left"] { - @apply mr-0; - - .tooltip-arrow { - @apply ml-0 mr-0; - - border-width: 5px 0 5px 5px; - border-top-color: transparent !important; - border-right-color: transparent !important; - border-bottom-color: transparent !important; - right: -5px; - top: calc(50% - 5px); - } - } - - &.popover { - .wrapper { - min-height: auto; - } - - .popover-inner { - @apply bg-tooltip; - @apply text-secondary; - @apply text-base; - @apply p-2; - @apply rounded-lg; - @apply overflow-auto; - @apply shadow-lg; - - max-height: 256px; - min-width: 128px; - - button { - @apply flex-1; - @apply m-0; - @apply p-2; - @apply justify-start; - @apply text-left; - } - - div { - @apply flex; - @apply items-stretch; - @apply flex-col; - } - } - - .popover-arrow { - @apply border-tooltip; - } - } - - &[aria-hidden="true"] { - @apply invisible; - @apply opacity-0; - @apply transition-opacity; - @apply ease-in-out; - @apply duration-150; - } - - &[aria-hidden="false"] { - @apply visible; - @apply opacity-100; - @apply transition-opacity; - @apply ease-in-out; - @apply duration-150; - } + @apply flex-col; + @apply max-h-64; + @apply overflow-y-auto; + @apply items-stretch; } .info:not(.toasted) { @@ -350,9 +203,6 @@ hr { @apply bg-accent; @apply text-primary; @apply font-bold; - @apply transition; - @apply ease-in-out; - @apply duration-150; @apply fill-current; @apply outline-none; @apply border-none; @@ -462,9 +312,6 @@ pre { @apply bg-primaryDark; @apply text-secondary; @apply font-mono; - @apply transition; - @apply ease-in-out; - @apply duration-150; @apply select-text; @apply resize-y; @apply outline-none; @@ -563,9 +410,6 @@ input[type="checkbox"] { @apply items-center; @apply justify-center; @apply text-transparent; - @apply transition; - @apply ease-in-out; - @apply duration-150; content: "\2714"; height: 16px; @@ -599,25 +443,6 @@ label { @apply p-4; @apply text-secondaryLight; @apply text-sm; - @apply transition; - @apply ease-in-out; - @apply duration-150; -} - -ul, -ol { - @apply flex; -} - -ul li, -ol li { - @apply inline-flex; - @apply flex-col flex-nowrap flex-1; - @apply justify-center; - - &.shrink { - @apply flex-grow-0; - } } .row-wrapper { @@ -685,9 +510,6 @@ ol li { &.show { @apply flex; @apply fixed; - @apply transition; - @apply ease-in-out; - @apply duration-150; @apply shadow-lg; @apply rounded-lg; diff --git a/assets/scss/themes.scss b/assets/scss/themes.scss index 57e77bdf3..8cbfbd525 100644 --- a/assets/scss/themes.scss +++ b/assets/scss/themes.scss @@ -41,11 +41,11 @@ // Dark Text color --secondary-dark-color: theme("colors.gray.700"); // Border color - --divider-color: rgba(0, 0, 0, 0.1); + --divider-color: theme("colors.gray.200"); // Error color - --error-color: rgba(0, 0, 0, 0.1); + --error-color: theme("colors.gray.700"); // Tooltip color - --tooltip-color: rgba(255, 255, 255, 1); + --tooltip-color: theme("colors.gray.50"); // Editor theme --editor-theme: "iplastic"; } @@ -214,15 +214,15 @@ @include greenTheme; } -:root.light { +:root.light-mode { @include lightTheme; } -:root.dark { +:root.dark-mode { @include darkTheme; } -:root.black { +:root.black-mode { @include blackTheme; } diff --git a/components/app/Extensions.vue b/components/app/Extensions.vue index 102da6fc7..d7904b2fa 100644 --- a/components/app/Extensions.vue +++ b/components/app/Extensions.vue @@ -32,7 +32,8 @@ Firefox done @@ -60,7 +61,8 @@ Chrome done diff --git a/components/app/Footer.vue b/components/app/Footer.vue deleted file mode 100644 index 8f42cb425..000000000 --- a/components/app/Footer.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - - - diff --git a/components/app/Header.vue b/components/app/Header.vue index c6c140d08..5bf7def75 100644 --- a/components/app/Header.vue +++ b/components/app/Header.vue @@ -9,7 +9,8 @@
- - - - + assignment_turned_in + {{ $t("create_secret_gist") }} + +
+ @@ -71,7 +73,8 @@