refactor: remove absolute classes

This commit is contained in:
liyasthomas
2021-08-17 12:56:36 +05:30
parent 3534e133af
commit 956ca44ef0
55 changed files with 269 additions and 404 deletions

View File

@@ -183,19 +183,21 @@ hr {
@apply w-full; @apply w-full;
@apply px-4 py-2; @apply px-4 py-2;
@apply bg-primary; @apply bg-primary;
@apply truncate;
@apply rounded; @apply rounded;
@apply text-secondaryDark; @apply text-secondaryDark;
@apply border border-divider; @apply border border-divider;
@apply transition; @apply focus-visible:border-accent;
@apply focus:(outline-none border-accent);
@apply disabled:cursor-not-allowed;
} }
input, input,
select, select,
textarea, textarea,
button { button {
@apply focus:outline-none;
@apply truncate;
@apply transition;
@apply disabled:cursor-not-allowed;
font-size: var(--body-font-size); font-size: var(--body-font-size);
line-height: var(--body-line-height); line-height: var(--body-line-height);
} }
@@ -358,6 +360,7 @@ input[type="checkbox"] {
@apply ml-auto; @apply ml-auto;
@apply sm:ml-8; @apply sm:ml-8;
@apply transition; @apply transition;
@apply rounded;
@apply text-current; @apply text-current;
@apply normal-case; @apply normal-case;
@apply hover:(bg-opacity-20 no-underline); @apply hover:(bg-opacity-20 no-underline);

View File

@@ -16,7 +16,8 @@
} ${$t('layout.zen_mode')}`" } ${$t('layout.zen_mode')}`"
:icon="ZEN_MODE ? 'fullscreen_exit' : 'fullscreen'" :icon="ZEN_MODE ? 'fullscreen_exit' : 'fullscreen'"
:class="{ :class="{
'!text-accent focus:text-accent hover:text-accent': ZEN_MODE, '!text-accent !focus-visible:text-accentDark !hover:text-accentDark':
ZEN_MODE,
}" }"
@click.native="ZEN_MODE = !ZEN_MODE" @click.native="ZEN_MODE = !ZEN_MODE"
/> />

View File

@@ -16,8 +16,6 @@
px-4 px-4
pt-2 pt-2
pb-6 pb-6
truncate
focus:outline-none
" "
/> />
<div <div

View File

@@ -104,11 +104,11 @@ export default {
@apply rounded; @apply rounded;
@apply flex-col flex; @apply flex-col flex;
@apply p-4; @apply p-4;
@apply transition;
@apply items-center; @apply items-center;
@apply justify-center; @apply justify-center;
@apply hover:(bg-primaryLight text-secondaryDark); @apply hover:(bg-primaryLight text-secondaryDark);
@apply focus:(border-divider outline-none); @apply focus:outline-none;
@apply focus-visible:border-divider;
svg { svg {
@apply opacity-80; @apply opacity-80;

View File

@@ -36,10 +36,7 @@
py-2 py-2
pr-2 pr-2
pl-8 pl-8
transition focus-visible:border-divider
truncate
focus:(border-divider
outline-none)
" "
:placeholder="$t('search')" :placeholder="$t('search')"
/> />

View File

@@ -123,9 +123,8 @@ export default defineComponent({
@apply flex flex-col flex-1; @apply flex flex-col flex-1;
@apply items-center; @apply items-center;
@apply justify-center; @apply justify-center;
@apply transition;
@apply hover:(bg-primaryDark text-secondaryDark); @apply hover:(bg-primaryDark text-secondaryDark);
@apply focus:text-secondaryDark; @apply focus-visible:text-secondaryDark;
&::after { &::after {
@apply absolute; @apply absolute;

View File

@@ -6,7 +6,6 @@
class=" class="
font-bold font-bold
py-2 py-2
transition
inline-flex inline-flex
items-center items-center
justify-center justify-center
@@ -15,8 +14,8 @@
" "
:class="[ :class="[
color color
? `text-${color}-800 bg-${color}-200 hover:(text-${color}-900 bg-${color}-300) focus:(text-${color}-900 bg-${color}-300)` ? `text-${color}-800 bg-${color}-200 hover:(text-${color}-900 bg-${color}-300) focus-visible:(text-${color}-900 bg-${color}-300)`
: `text-accentContrast bg-accent hover:bg-accentDark focus:bg-accentDark`, : `text-accentContrast bg-accent hover:bg-accentDark focus-visible:bg-accentDark`,
label ? 'px-4' : 'px-2', label ? 'px-4' : 'px-2',
rounded ? 'rounded-full' : 'rounded', rounded ? 'rounded-full' : 'rounded',
{ 'opacity-75 cursor-not-allowed': disabled }, { 'opacity-75 cursor-not-allowed': disabled },
@@ -28,7 +27,7 @@
gradient, gradient,
}, },
{ {
'border border-accent hover:border-accentDark focus:border-accentDark': 'border border-accent hover:border-accentDark focus-visible:border-accentDark':
outline, outline,
}, },
]" ]"

View File

@@ -6,7 +6,6 @@
class=" class="
font-medium font-medium
py-2 py-2
transition
inline-flex inline-flex
items-center items-center
justify-center justify-center
@@ -18,14 +17,14 @@
:class="[ :class="[
color color
? `text-${color}-500 hover:(text-${color}-600 text-${color}-600)` ? `text-${color}-500 hover:(text-${color}-600 text-${color}-600)`
: 'text-secondary hover:text-secondaryDark focus:text-secondaryDark', : 'text-secondary hover:text-secondaryDark focus-visible:text-secondaryDark',
label ? 'rounded px-4' : 'px-2', label ? 'rounded px-4' : 'px-2',
{ 'rounded-full': rounded }, { 'rounded-full': rounded },
{ 'opacity-75 cursor-not-allowed': disabled }, { 'opacity-75 cursor-not-allowed': disabled },
{ 'flex-row-reverse': reverse }, { 'flex-row-reverse': reverse },
{ 'px-6 py-4 text-lg': large }, { 'px-6 py-4 text-lg': large },
{ {
'border border-divider hover:border-dividerDark focus:border-dividerDark': 'border border-divider hover:border-dividerDark focus-visible:border-dividerDark':
outline, outline,
}, },
]" ]"

View File

@@ -25,7 +25,6 @@
py-2 py-2
px-4 px-4
appearance-none appearance-none
focus:outline-none
" "
@change="updateSelectedTeam(myTeams[$event.target.value])" @change="updateSelectedTeam(myTeams[$event.target.value])"
> >

View File

@@ -77,7 +77,7 @@
" "
/> />
<SmartItem <SmartItem
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="
@@ -186,7 +186,7 @@ export default Vue.extend({
) )
}, },
getCollectionIcon() { getCollectionIcon() {
if (this.isSelected) return "check_circle" if (this.isSelected) return "check_circle_outline"
else if (!this.showChildren && !this.isFiltered) return "arrow_right" else if (!this.showChildren && !this.isFiltered) return "arrow_right"
else if (this.showChildren || this.isFiltered) return "arrow_drop_down" else if (this.showChildren || this.isFiltered) return "arrow_drop_down"
else return "folder" else return "folder"

View File

@@ -73,7 +73,7 @@
" "
/> />
<SmartItem <SmartItem
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="
@@ -184,7 +184,7 @@ export default Vue.extend({
) )
}, },
getCollectionIcon() { getCollectionIcon() {
if (this.isSelected) return "check_circle" if (this.isSelected) return "check_circle_outline"
else if (!this.showChildren && !this.isFiltered) return "arrow_right" else if (!this.showChildren && !this.isFiltered) return "arrow_right"
else if (this.showChildren || this.isFiltered) return "arrow_drop_down" else if (this.showChildren || this.isFiltered) return "arrow_drop_down"
else return "folder" else return "folder"

View File

@@ -21,7 +21,7 @@
@click="!doc ? selectRequest() : {}" @click="!doc ? selectRequest() : {}"
> >
<i class="material-icons" :class="{ 'text-green-500': isSelected }"> <i class="material-icons" :class="{ 'text-green-500': isSelected }">
{{ isSelected ? "check_circle" : "description" }} {{ isSelected ? "check_circle_outline" : "description" }}
</i> </i>
</span> </span>
<span <span
@@ -75,7 +75,7 @@
" "
/> />
<SmartItem <SmartItem
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="

View File

@@ -20,8 +20,6 @@
py-2 py-2
pr-2 pr-2
pl-9 pl-9
truncate
focus:outline-none
" "
/> />
</div> </div>

View File

@@ -20,8 +20,6 @@
py-2 py-2
pr-2 pr-2
pl-9 pl-9
truncate
focus:outline-none
" "
/> />
</div> </div>

View File

@@ -36,7 +36,7 @@
v-if="doc && !selected" v-if="doc && !selected"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('import.title')" :title="$t('import.title')"
icon="check_box_outline_blank" icon="radio_button_unchecked"
color="green" color="green"
@click.native="$emit('select-collection')" @click.native="$emit('select-collection')"
/> />
@@ -44,7 +44,7 @@
v-if="doc && selected" v-if="doc && selected"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="check_box" icon="check_circle_outline"
color="green" color="green"
@click.native="$emit('unselect-collection')" @click.native="$emit('unselect-collection')"
/> />
@@ -96,7 +96,7 @@
" "
/> />
<SmartItem <SmartItem
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="
@@ -211,7 +211,7 @@ export default {
) )
}, },
getCollectionIcon() { getCollectionIcon() {
if (this.isSelected) return "check_circle" if (this.isSelected) return "check_circle_outline"
else if (!this.showChildren && !this.isFiltered) return "arrow_right" else if (!this.showChildren && !this.isFiltered) return "arrow_right"
else if (this.showChildren || this.isFiltered) return "arrow_drop_down" else if (this.showChildren || this.isFiltered) return "arrow_drop_down"
else return "folder" else return "folder"

View File

@@ -78,7 +78,7 @@
" "
/> />
<SmartItem <SmartItem
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="
@@ -198,7 +198,7 @@ export default {
) )
}, },
getCollectionIcon() { getCollectionIcon() {
if (this.isSelected) return "check_circle" if (this.isSelected) return "check_circle_outline"
else if (!this.showChildren && !this.isFiltered) return "arrow_right" else if (!this.showChildren && !this.isFiltered) return "arrow_right"
else if (this.showChildren || this.isFiltered) return "arrow_drop_down" else if (this.showChildren || this.isFiltered) return "arrow_drop_down"
else return "folder" else return "folder"

View File

@@ -26,7 +26,7 @@
class="material-icons" class="material-icons"
:class="{ 'text-green-500': isSelected }" :class="{ 'text-green-500': isSelected }"
> >
check_circle check_circle_outline
</i> </i>
<span v-else> <span v-else>
{{ request.method }} {{ request.method }}
@@ -86,7 +86,7 @@
" "
/> />
<SmartItem <SmartItem
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="

View File

@@ -28,7 +28,7 @@
v-if="doc && !selected" v-if="doc && !selected"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('import.title')" :title="$t('import.title')"
icon="check_box_outline_blank" icon="radio_button_unchecked"
color="green" color="green"
@click.native="$emit('select-collection')" @click.native="$emit('select-collection')"
/> />
@@ -36,7 +36,7 @@
v-if="doc && selected" v-if="doc && selected"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="check_box" icon="check_circle_outline"
color="green" color="green"
@click.native="$emit('unselect-collection')" @click.native="$emit('unselect-collection')"
/> />
@@ -92,7 +92,7 @@
/> />
<SmartItem <SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'" v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="
@@ -204,7 +204,7 @@ export default {
) )
}, },
getCollectionIcon() { getCollectionIcon() {
if (this.isSelected) return "check_circle" if (this.isSelected) return "check_circle_outline"
else if (!this.showChildren && !this.isFiltered) return "arrow_right" else if (!this.showChildren && !this.isFiltered) return "arrow_right"
else if (this.showChildren || this.isFiltered) return "arrow_drop_down" else if (this.showChildren || this.isFiltered) return "arrow_drop_down"
else return "folder" else return "folder"

View File

@@ -75,7 +75,7 @@
/> />
<SmartItem <SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'" v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="
@@ -188,7 +188,7 @@ export default {
) )
}, },
getCollectionIcon() { getCollectionIcon() {
if (this.isSelected) return "check_circle" if (this.isSelected) return "check_circle_outline"
else if (!this.showChildren && !this.isFiltered) return "arrow_right" else if (!this.showChildren && !this.isFiltered) return "arrow_right"
else if (this.showChildren || this.isFiltered) return "arrow_drop_down" else if (this.showChildren || this.isFiltered) return "arrow_drop_down"
else return "folder" else return "folder"

View File

@@ -19,7 +19,7 @@
class="material-icons" class="material-icons"
:class="{ 'text-green-500': isSelected }" :class="{ 'text-green-500': isSelected }"
> >
check_circle check_circle_outline
</i> </i>
<span v-else> <span v-else>
{{ request.method }} {{ request.method }}
@@ -79,7 +79,7 @@
" "
/> />
<SmartItem <SmartItem
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="

View File

@@ -45,27 +45,13 @@
> >
<input <input
v-model="variable.key" v-model="variable.key"
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.variable', { count: index + 1 })" :placeholder="$t('count.variable', { count: index + 1 })"
:name="'param' + index" :name="'param' + index"
/> />
<input <input
v-model="variable.value" v-model="variable.value"
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="$t('count.value', { count: index + 1 })"
:name="'value' + index" :name="'value' + index"
/> />
@@ -74,7 +60,7 @@
id="variable" id="variable"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="removeEnvironmentVariable(index)" @click.native="removeEnvironmentVariable(index)"
/> />

View File

@@ -40,7 +40,7 @@
" "
/> />
<SmartItem <SmartItem
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="

View File

@@ -22,7 +22,6 @@
py-2 py-2
px-4 px-4
appearance-none appearance-none
focus:outline-none
" "
> >
<option :value="-1">{{ $t("environment.no_environment") }}</option> <option :value="-1">{{ $t("environment.no_environment") }}</option>

View File

@@ -15,10 +15,7 @@
w-full w-full
py-2 py-2
px-4 px-4
transition focus-visible:border-accent
truncate
focus:(border-accent
outline-none)
" "
:placeholder="$t('url')" :placeholder="$t('url')"
@keyup.enter="onConnectClick" @keyup.enter="onConnectClick"

View File

@@ -177,14 +177,7 @@
" "
/> />
<input <input
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="$t('count.value', { count: index + 1 })"
:name="`value ${index}`" :name="`value ${index}`"
:value="header.value" :value="header.value"
@@ -210,9 +203,9 @@
:icon=" :icon="
header.hasOwnProperty('active') header.hasOwnProperty('active')
? header.active ? header.active
? 'check_box' ? 'check_circle_outline'
: 'check_box_outline_blank' : 'radio_button_unchecked'
: 'check_box' : 'check_circle_outline'
" "
color="green" color="green"
@click.native=" @click.native="
@@ -228,7 +221,7 @@
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="removeRequestHeader(index)" @click.native="removeRequestHeader(index)"
/> />

View File

@@ -17,16 +17,7 @@
v-model="graphqlFieldsFilterText" v-model="graphqlFieldsFilterText"
type="search" type="search"
:placeholder="$t('search')" :placeholder="$t('search')"
class=" class="bg-primaryLight flex w-full py-2 pr-2 pl-9"
bg-primaryLight
flex
w-full
py-2
pr-2
pl-9
truncate
focus:outline-none
"
/> />
</div> </div>
<div class="flex"> <div class="flex">

View File

@@ -21,7 +21,7 @@
</span> </span>
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:title="$t('delete')" :title="$t('delete')"
class="hidden group-hover:inline-flex" class="hidden group-hover:inline-flex"

View File

@@ -14,16 +14,7 @@
<input <input
v-model="filterText" v-model="filterText"
type="search" type="search"
class=" class="bg-primaryLight flex w-full py-2 pr-2 pl-9"
bg-primaryLight
flex
w-full
py-2
pr-2
pl-9
truncate
focus:outline-none
"
:placeholder="$t('search')" :placeholder="$t('search')"
/> />
</div> </div>

View File

@@ -29,7 +29,7 @@
</span> </span>
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:title="$t('delete')" :title="$t('delete')"
class="group-hover:inline-flex hidden" class="group-hover:inline-flex hidden"

View File

@@ -25,14 +25,12 @@
arrow arrow
> >
<template #trigger> <template #trigger>
<div class="flex">
<span class="select-wrapper"> <span class="select-wrapper">
<ButtonSecondary <ButtonSecondary
class="rounded-none ml-2 pr-8" class="rounded-none ml-2 pr-8"
:label="authName" :label="authName"
/> />
</span> </span>
</div>
</template> </template>
<SmartItem <SmartItem
label="None" label="None"

View File

@@ -22,14 +22,12 @@
arrow arrow
> >
<template #trigger> <template #trigger>
<div class="flex">
<span class="select-wrapper"> <span class="select-wrapper">
<ButtonSecondary <ButtonSecondary
:label="contentType" :label="contentType"
class="rounded-none ml-2 pr-8" class="rounded-none ml-2 pr-8"
/> />
</span> </span>
</div>
</template> </template>
<SmartItem <SmartItem
v-for="(contentTypeItem, index) in validContentTypes" v-for="(contentTypeItem, index) in validContentTypes"

View File

@@ -53,7 +53,6 @@
flex-1 flex-1
py-1 py-1
px-4 px-4
focus:outline-none
" "
@change=" @change="
updateBodyParam(index, { updateBodyParam(index, {
@@ -66,14 +65,7 @@
/> />
<input <input
v-else v-else
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.parameter', { count: index + 1 })" :placeholder="$t('count.parameter', { count: index + 1 })"
:name="'param' + index" :name="'param' + index"
:value="param.key" :value="param.key"
@@ -109,7 +101,6 @@
flex-1 flex-1
py-1 py-1
px-4 px-4
focus:outline-none
" "
@change=" @change="
updateBodyParam(index, { updateBodyParam(index, {
@@ -122,14 +113,7 @@
/> />
<input <input
v-else v-else
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="$t('count.value', { count: index + 1 })"
:name="'value' + index" :name="'value' + index"
:value="param.value" :value="param.value"
@@ -173,9 +157,9 @@
:icon=" :icon="
param.hasOwnProperty('active') param.hasOwnProperty('active')
? param.active ? param.active
? 'check_box' ? 'check_circle_outline'
: 'check_box_outline_blank' : 'radio_button_unchecked'
: 'check_box' : 'check_circle_outline'
" "
color="green" color="green"
@click.native=" @click.native="
@@ -192,7 +176,7 @@
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="deleteBodyParam(index)" @click.native="deleteBodyParam(index)"
/> />

View File

@@ -56,7 +56,6 @@
py-1 py-1
px-4 px-4
truncate truncate
focus:outline-none
" "
:class="{ '!flex flex-1': EXPERIMENTAL_URL_BAR_ENABLED }" :class="{ '!flex flex-1': EXPERIMENTAL_URL_BAR_ENABLED }"
@input=" @input="
@@ -77,7 +76,6 @@
flex-1 flex-1
py-1 py-1
px-4 px-4
focus:outline-none
" "
@change=" @change="
updateHeader(index, { updateHeader(index, {
@@ -89,14 +87,7 @@
/> />
<input <input
v-else v-else
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="$t('count.value', { count: index + 1 })"
:name="'value' + index" :name="'value' + index"
:value="header.value" :value="header.value"
@@ -121,9 +112,9 @@
:icon=" :icon="
header.hasOwnProperty('active') header.hasOwnProperty('active')
? header.active ? header.active
? 'check_box' ? 'check_circle_outline'
: 'check_box_outline_blank' : 'radio_button_unchecked'
: 'check_box' : 'check_circle_outline'
" "
color="green" color="green"
@click.native=" @click.native="
@@ -139,7 +130,7 @@
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="deleteHeader(index)" @click.native="deleteHeader(index)"
/> />

View File

@@ -53,7 +53,6 @@
flex-1 flex-1
py-1 py-1
px-4 px-4
focus:outline-none
" "
@change=" @change="
updateParam(index, { updateParam(index, {
@@ -65,14 +64,7 @@
/> />
<input <input
v-else v-else
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.parameter', { count: index + 1 })" :placeholder="$t('count.parameter', { count: index + 1 })"
:name="'param' + index" :name="'param' + index"
:value="param.key" :value="param.key"
@@ -95,7 +87,6 @@
flex-1 flex-1
py-1 py-1
px-4 px-4
focus:outline-none
" "
@change=" @change="
updateParam(index, { updateParam(index, {
@@ -107,14 +98,7 @@
/> />
<input <input
v-else v-else
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="$t('count.value', { count: index + 1 })"
:name="'value' + index" :name="'value' + index"
:value="param.value" :value="param.value"
@@ -139,9 +123,9 @@
:icon=" :icon="
param.hasOwnProperty('active') param.hasOwnProperty('active')
? param.active ? param.active
? 'check_box' ? 'check_circle_outline'
: 'check_box_outline_blank' : 'radio_button_unchecked'
: 'check_box' : 'check_circle_outline'
" "
color="green" color="green"
@click.native=" @click.native="
@@ -157,7 +141,7 @@
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="deleteParam(index)" @click.native="deleteParam(index)"
/> />

View File

@@ -16,6 +16,7 @@
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("javascript_code") }} {{ $t("javascript_code") }}
</label> </label>
<div class="flex">
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
to="https://github.com/hoppscotch/hoppscotch/wiki/Pre-Request-Scripts" to="https://github.com/hoppscotch/hoppscotch/wiki/Pre-Request-Scripts"
@@ -23,6 +24,13 @@
:title="$t('wiki')" :title="$t('wiki')"
icon="help_outline" icon="help_outline"
/> />
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('clear')"
icon="clear_all"
@click.native="clearContent"
/>
</div>
</div> </div>
<div class="border-b border-dividerLight flex"> <div class="border-b border-dividerLight flex">
<div class="border-r border-dividerLight w-2/3"> <div class="border-r border-dividerLight w-2/3">
@@ -63,10 +71,11 @@
{{ $t("preRequest.snippets") }} {{ $t("preRequest.snippets") }}
</h4> </h4>
<div class="flex flex-col pt-4"> <div class="flex flex-col pt-4">
<SmartItem <TabSecondary
v-for="(snippet, index) in snippets" v-for="(snippet, index) in snippets"
:key="`snippet-${index}`" :key="`snippet-${index}`"
:label="snippet.name" :label="snippet.name"
active
@click.native="useSnippet(snippet.script)" @click.native="useSnippet(snippet.script)"
/> />
</div> </div>
@@ -82,19 +91,22 @@ import preRequestScriptSnippets from "~/helpers/preRequestScriptSnippets"
export default defineComponent({ export default defineComponent({
setup() { setup() {
return { const preRequestScript = usePreRequestScript()
preRequestScript: usePreRequestScript(),
const useSnippet = (script: string) => {
preRequestScript.value += script
} }
},
data() { const clearContent = () => {
preRequestScript.value = ""
}
return { return {
preRequestScript,
snippets: preRequestScriptSnippets, snippets: preRequestScriptSnippets,
useSnippet,
clearContent,
} }
}, },
methods: {
useSnippet(script: string) {
this.preRequestScript += script
},
},
}) })
</script> </script>

View File

@@ -1,7 +1,6 @@
<template> <template>
<div class="bg-primary flex p-4 top-0 z-10 sticky"> <div class="bg-primary flex p-4 top-0 z-10 sticky">
<div class="relative inline-flex"> <div class="relative inline-flex">
<span class="select-wrapper">
<tippy <tippy
ref="methodOptions" ref="methodOptions"
interactive interactive
@@ -10,6 +9,7 @@
arrow arrow
> >
<template #trigger> <template #trigger>
<span class="select-wrapper">
<input <input
id="method" id="method"
class=" class="
@@ -22,16 +22,15 @@
text-secondaryDark text-secondaryDark
py-2 py-2
px-4 px-4
transition
w-28 w-28
truncate
hover:border-dividerDark hover:border-dividerDark
focus:border-accent focus:outline-none focus-visible:border-accent
" "
:value="newMethod" :value="newMethod"
:readonly="!isCustomMethod" :readonly="!isCustomMethod"
@input="onSelectMethod($event.target.value)" @input="onSelectMethod($event.target.value)"
/> />
</span>
</template> </template>
<SmartItem <SmartItem
v-for="(method, index) in methods" v-for="(method, index) in methods"
@@ -40,7 +39,6 @@
@click.native="onSelectMethod(method)" @click.native="onSelectMethod(method)"
/> />
</tippy> </tippy>
</span>
</div> </div>
<div class="flex-1 inline-flex"> <div class="flex-1 inline-flex">
<SmartEnvInput <SmartEnvInput
@@ -55,10 +53,8 @@
text-secondaryDark text-secondaryDark
py-1 py-1
px-4 px-4
transition
truncate
hover:border-dividerDark hover:border-dividerDark
focus:outline-none focus:border-accent focus-visible:border-accent
" "
@enter="newSendRequest()" @enter="newSendRequest()"
/> />
@@ -74,9 +70,7 @@
text-secondaryDark text-secondaryDark
py-2 py-2
px-4 px-4
transition focus-visible:border-accent
truncate
focus:border-accent focus:outline-none
" "
name="url" name="url"
type="text" type="text"

View File

@@ -16,6 +16,7 @@
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("javascript_code") }} {{ $t("javascript_code") }}
</label> </label>
<div class="flex">
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
to="https://github.com/hoppscotch/hoppscotch/wiki/Post-Request-Tests" to="https://github.com/hoppscotch/hoppscotch/wiki/Post-Request-Tests"
@@ -23,6 +24,13 @@
:title="$t('wiki')" :title="$t('wiki')"
icon="help_outline" icon="help_outline"
/> />
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('clear')"
icon="clear_all"
@click.native="clearContent"
/>
</div>
</div> </div>
<div class="border-b border-dividerLight flex"> <div class="border-b border-dividerLight flex">
<div class="border-r border-dividerLight w-2/3"> <div class="border-r border-dividerLight w-2/3">
@@ -63,10 +71,11 @@
{{ $t("test.snippets") }} {{ $t("test.snippets") }}
</h4> </h4>
<div class="flex flex-col pt-4"> <div class="flex flex-col pt-4">
<SmartItem <TabSecondary
v-for="(snippet, index) in snippets" v-for="(snippet, index) in snippets"
:key="`snippet-${index}`" :key="`snippet-${index}`"
:label="snippet.name" :label="snippet.name"
active
@click.native="useSnippet(snippet.script)" @click.native="useSnippet(snippet.script)"
/> />
</div> </div>
@@ -82,19 +91,22 @@ import testSnippets from "~/helpers/testSnippets"
export default defineComponent({ export default defineComponent({
setup() { setup() {
return { const testScript = useTestScript()
testScript: useTestScript(),
const useSnippet = (script: string) => {
testScript.value += script
} }
},
data() { const clearContent = () => {
testScript.value = ""
}
return { return {
testScript,
snippets: testSnippets, snippets: testSnippets,
useSnippet,
clearContent,
} }
}, },
methods: {
useSnippet(script: string) {
this.testScript += script
},
},
}) })
</script> </script>

View File

@@ -42,7 +42,7 @@
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="removeOAuthToken(index)" @click.native="removeOAuthToken(index)"
/> />

View File

@@ -159,6 +159,6 @@ export default {
@apply px-2 py-1; @apply px-2 py-1;
@apply -mx-2 -my-1; @apply -mx-2 -my-1;
@apply hover:text-secondaryDark; @apply hover:text-secondaryDark;
@apply focus:text-secondaryDark; @apply focus-visible:text-secondaryDark;
} }
</style> </style>

View File

@@ -20,10 +20,7 @@
w-full w-full
py-2 py-2
px-4 px-4
transition focus-visible:border-accent
truncate
focus:(border-accent
outline-none)
" "
:placeholder="$t('url')" :placeholder="$t('url')"
/> />

View File

@@ -22,10 +22,7 @@
w-full w-full
py-2 py-2
px-4 px-4
transition focus-visible:border-accent
truncate
focus:(border-accent
outline-none)
" "
:placeholder="$t('url')" :placeholder="$t('url')"
@keyup.enter="urlValid ? toggleConnection() : null" @keyup.enter="urlValid ? toggleConnection() : null"
@@ -41,10 +38,7 @@
w-full w-full
py-2 py-2
px-4 px-4
transition focus-visible:border-accent
truncate
focus:(border-accent
outline-none)
" "
spellcheck="false" spellcheck="false"
/> />
@@ -124,7 +118,7 @@
v-if="index + 1 !== communication.inputs.length" v-if="index + 1 !== communication.inputs.length"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
class="rounded-l-none" class="rounded-l-none"
color="red" color="red"
outline outline

View File

@@ -18,10 +18,7 @@
w-full w-full
py-2 py-2
px-4 px-4
transition focus-visible:border-accent
truncate
focus:(border-accent
outline-none)
" "
:placeholder="$t('url')" :placeholder="$t('url')"
@keyup.enter="serverValid ? toggleSSEConnection() : null" @keyup.enter="serverValid ? toggleSSEConnection() : null"
@@ -51,10 +48,7 @@
w-full w-full
py-2 py-2
px-4 px-4
transition focus-visible:border-accent
truncate
focus:(border-accent
outline-none)
" "
spellcheck="false" spellcheck="false"
/> />

View File

@@ -18,10 +18,7 @@
w-full w-full
py-2 py-2
px-4 px-4
transition focus-visible:border-accent
truncate
focus:(border-accent
outline-none)
" "
type="url" type="url"
spellcheck="false" spellcheck="false"
@@ -82,14 +79,7 @@
> >
<input <input
v-model="protocol.value" v-model="protocol.value"
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('count.protocol', { count: index + 1 })" :placeholder="$t('count.protocol', { count: index + 1 })"
name="message" name="message"
type="text" type="text"
@@ -107,9 +97,9 @@
:icon=" :icon="
protocol.hasOwnProperty('active') protocol.hasOwnProperty('active')
? protocol.active ? protocol.active
? 'check_box' ? 'check_circle_outline'
: 'check_box_outline_blank' : 'radio_button_unchecked'
: 'check_box' : 'check_circle_outline'
" "
color="green" color="green"
@click.native=" @click.native="
@@ -123,7 +113,7 @@
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="deleteProtocol({ index })" @click.native="deleteProtocol({ index })"
/> />

View File

@@ -6,8 +6,8 @@
class="inline-flex items-center justify-center focus:outline-none" class="inline-flex items-center justify-center focus:outline-none"
:class="[ :class="[
color color
? `text-${color}-500 hover:text-${color}-600 focus:text-${color}-600` ? `text-${color}-500 hover:text-${color}-600 focus-visible:text-${color}-600`
: 'hover:text-secondaryDark focus:text-secondaryDark', : 'hover:text-secondaryDark focus-visible:text-secondaryDark',
{ 'opacity-75 cursor-not-allowed': disabled }, { 'opacity-75 cursor-not-allowed': disabled },
{ 'flex-row-reverse': reverse }, { 'flex-row-reverse': reverse },
]" ]"

View File

@@ -1,8 +1,8 @@
<template> <template>
<span class="inline-flex"> <span class="inline-flex">
<span class="select-wrapper">
<tippy ref="language" interactive trigger="click" theme="popover" arrow> <tippy ref="language" interactive trigger="click" theme="popover" arrow>
<template #trigger> <template #trigger>
<span class="select-wrapper">
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('settings.choose_language')" :title="$t('settings.choose_language')"
@@ -13,6 +13,7 @@
$i18n.locales.find(({ code }) => code == $i18n.locale).name $i18n.locales.find(({ code }) => code == $i18n.locale).name
}`" }`"
/> />
</span>
</template> </template>
<NuxtLink <NuxtLink
v-for="(locale, index) in $i18n.locales.filter( v-for="(locale, index) in $i18n.locales.filter(
@@ -26,5 +27,4 @@
</NuxtLink> </NuxtLink>
</tippy> </tippy>
</span> </span>
</span>
</template> </template>

View File

@@ -496,6 +496,8 @@ export default defineComponent({
@apply overflow-x-auto; @apply overflow-x-auto;
@apply overflow-y-hidden; @apply overflow-y-hidden;
@apply resize-none; @apply resize-none;
@apply focus:outline-none;
@apply transition;
} }
.env-input::-webkit-scrollbar { .env-input::-webkit-scrollbar {

View File

@@ -1,8 +1,8 @@
<template> <template>
<span class="inline-flex"> <span class="inline-flex">
<span class="select-wrapper">
<tippy ref="fontSize" interactive trigger="click" theme="popover" arrow> <tippy ref="fontSize" interactive trigger="click" theme="popover" arrow>
<template #trigger> <template #trigger>
<span class="select-wrapper">
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('settings.change_font_size')" :title="$t('settings.change_font_size')"
@@ -11,6 +11,7 @@
outline outline
:label="getFontSizeName(fontSizes.find((size) => size == active))" :label="getFontSizeName(fontSizes.find((size) => size == active))"
/> />
</span>
</template> </template>
<SmartItem <SmartItem
v-for="(size, index) in fontSizes" v-for="(size, index) in fontSizes"
@@ -25,7 +26,6 @@
/> />
</tippy> </tippy>
</span> </span>
</span>
</template> </template>
<script lang="ts"> <script lang="ts">

View File

@@ -6,16 +6,14 @@
class=" class="
rounded rounded
font-medium font-medium
flex-shrink-0
py-2 py-2
px-4 px-4
transition
inline-flex inline-flex
items-center items-center
hover:(bg-primaryDark hover:bg-primaryDark hover:text-secondaryDark
text-secondaryDark) focus:outline-none
focus:(bg-primaryDark focus-visible:bg-primaryDark focus-visible:text-secondaryDark
outline-none
text-secondaryDark)
" "
:class="[ :class="[
{ 'opacity-75 cursor-not-allowed': disabled }, { 'opacity-75 cursor-not-allowed': disabled },
@@ -23,7 +21,7 @@
{ 'flex-1': label }, { 'flex-1': label },
{ 'flex-row-reverse justify-end': reverse }, { 'flex-row-reverse justify-end': reverse },
{ {
'border border-divider hover:border-dividerDark focus:border-dividerDark': 'border border-divider hover:border-dividerDark focus-visible:border-dividerDark':
outline, outline,
}, },
]" ]"

View File

@@ -84,9 +84,9 @@ export default {
@apply text-secondary; @apply text-secondary;
@apply font-semibold; @apply font-semibold;
@apply cursor-pointer; @apply cursor-pointer;
@apply transition;
@apply hover:text-secondaryDark; @apply hover:text-secondaryDark;
@apply focus:(text-secondaryDark outline-none); @apply focus:outline-none;
@apply focus-visible:text-secondaryDark;
.tab-info { .tab-info {
@apply inline-flex; @apply inline-flex;

View File

@@ -7,7 +7,6 @@
rounded rounded
py-2 py-2
px-4 px-4
transition
inline-flex inline-flex
items-center items-center
truncate truncate
@@ -15,8 +14,8 @@
" "
:class="[ :class="[
color color
? `text-${color}-500 hover:text-${color}-600 focus:text-${color}-600` ? `text-${color}-500 hover:text-${color}-600 focus-visible:text-${color}-600`
: 'hover:text-secondaryDark focus:text-accent', : 'hover:text-secondaryDark focus-visible:text-accent',
{ 'opacity-75 cursor-not-allowed': disabled }, { 'opacity-75 cursor-not-allowed': disabled },
{ 'flex-row-reverse': reverse }, { 'flex-row-reverse': reverse },
]" ]"

View File

@@ -4,27 +4,27 @@
:exact="exact" :exact="exact"
:blank="blank" :blank="blank"
class=" class="
font-medium
flex-1 flex-1
py-2 py-2
transform transform
transition
inline-flex inline-flex
items-center items-center
truncate
hover:translate-x-2 hover:translate-x-2
focus:(outline-none focus:outline-none
translate-x-2) focus-visible:translate-x-2
" "
:class="[ :class="[
label ? 'px-3' : 'px-2', label ? 'px-3' : 'px-2',
active active
? color ? color
? `text-${color}-500 hover:text-${color}-600 focus:text-${color}-600` ? `text-${color}-500 hover:text-${color}-600 focus-visible:text-${color}-600`
: 'text-accent' : 'text-accent hover:text-accentDark focus-visible:text-accentDark'
: 'hover:text-secondaryDark focus:text-secondaryDark', : 'hover:text-secondaryDark focus-visible:text-secondaryDark',
color color
? `text-${color}-500 hover:text-${color}-600 focus:text-${color}-600` ? `text-${color}-500 hover:text-${color}-600 focus-visible:text-${color}-600`
: '', : '',
{ 'translate-x-2': active },
{ 'opacity-75 cursor-not-allowed': disabled }, { 'opacity-75 cursor-not-allowed': disabled },
]" ]"
:disabled="disabled" :disabled="disabled"

View File

@@ -35,20 +35,13 @@
class="divide-x divide-dividerLight flex" class="divide-x divide-dividerLight flex"
> >
<input <input
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('team.email')" :placeholder="$t('team.email')"
:name="'param' + index" :name="'param' + index"
:value="member.user.email" :value="member.user.email"
readonly readonly
/> />
<span class="select-wrapper"> <span>
<tippy <tippy
:ref="`memberOptions-${index}`" :ref="`memberOptions-${index}`"
interactive interactive
@@ -57,15 +50,9 @@
arrow arrow
> >
<template #trigger> <template #trigger>
<span class="select-wrapper">
<input <input
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('team.permissions')" :placeholder="$t('team.permissions')"
:name="'value' + index" :name="'value' + index"
:value=" :value="
@@ -75,6 +62,7 @@
" "
readonly readonly
/> />
</span>
</template> </template>
<SmartItem <SmartItem
label="OWNER" label="OWNER"
@@ -95,7 +83,7 @@
id="member" id="member"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="removeExistingTeamMember(member.user.uid)" @click.native="removeExistingTeamMember(member.user.uid)"
/> />
@@ -108,19 +96,12 @@
> >
<input <input
v-model="member.key" v-model="member.key"
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('team.email')" :placeholder="$t('team.email')"
:name="'member' + index" :name="'member' + index"
autofocus autofocus
/> />
<span class="select-wrapper"> <span>
<tippy <tippy
:ref="`newMemberOptions-${index}`" :ref="`newMemberOptions-${index}`"
interactive interactive
@@ -129,15 +110,9 @@
arrow arrow
> >
<template #trigger> <template #trigger>
<span class="select-wrapper">
<input <input
class=" class="bg-primaryLight flex flex-1 py-2 px-4"
bg-primaryLight
flex flex-1
py-2
px-4
truncate
focus:outline-none
"
:placeholder="$t('team.permissions')" :placeholder="$t('team.permissions')"
:name="'value' + index" :name="'value' + index"
:value=" :value="
@@ -147,6 +122,7 @@
" "
readonly readonly
/> />
</span>
</template> </template>
<SmartItem <SmartItem
label="OWNER" label="OWNER"
@@ -167,7 +143,7 @@
id="member" id="member"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')" :title="$t('delete')"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
@click.native="removeTeamMember(index)" @click.native="removeTeamMember(index)"
/> />

View File

@@ -39,7 +39,7 @@
/> />
<SmartItem <SmartItem
v-if="team.myRole === 'OWNER'" v-if="team.myRole === 'OWNER'"
icon="delete" icon="remove_circle_outline"
color="red" color="red"
:label="$t('delete')" :label="$t('delete')"
@click.native=" @click.native="

View File

@@ -33,8 +33,8 @@ const defaultRESTRequest: HoppRESTRequest = {
authName: "None", authName: "None",
authActive: true, authActive: true,
}, },
preRequestScript: "// pw.env.set('variable', 'value');", preRequestScript: "",
testScript: "// pw.expect('variable').toBe('value');", testScript: "",
body: { body: {
contentType: "application/json", contentType: "application/json",
body: "", body: "",

View File

@@ -306,19 +306,13 @@ export default defineComponent({
return this.httpUser && this.httpPassword return this.httpUser && this.httpPassword
}, },
isRawParams() { isRawParams() {
return this.rawParams && this.rawParams !== "{}" return this.rawParams && this.rawParams !== ""
}, },
isPreRequestScript() { isPreRequestScript() {
return ( return this.preRequestScript && this.preRequestScript !== ""
this.preRequestScript &&
this.preRequestScript !== `// pw.env.set('variable', 'value');`
)
}, },
isTestScript() { isTestScript() {
return ( return this.testScript && this.testScript !== ""
this.testScript &&
this.testScript !== `// pw.expect('variable').toBe('value');`
)
}, },
}, },
{ {