-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #494 from rstudio/dotnomad/config-card
Create and style DeploymentCard component
- Loading branch information
Showing
4 changed files
with
137 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
.max-width-md { | ||
max-width: 800px; | ||
} | ||
|
||
.body--light { | ||
--focus-shadow-color: 0, 0, 0; | ||
--focus-shadow-color-opacity: 0.14; | ||
--focus-shadow-border-color: 0, 0, 0; | ||
--focus-shadow-border-color-opacity: 0.2; | ||
} | ||
|
||
.body--dark { | ||
--focus-shadow-color: 255, 255, 255; | ||
--focus-shadow-color-opacity: 0.18; | ||
--focus-shadow-border-color: 255, 255, 255; | ||
--focus-shadow-border-color-opacity: 0.25; | ||
} | ||
|
||
.focus-shadow:focus, | ||
.focus-shadow:focus-within { | ||
--focus-shadow: 0 0 0 4px rgba(var(--focus-shadow-color), var(--focus-shadow-color-opacity)); | ||
--border-shadow: 0 0 1px 1px rgba(var(--focus-shadow-border-color), var(--focus-shadow-border-color-opacity)); | ||
box-shadow: var(--focus-shadow), var(--border-shadow); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<!-- Copyright (C) 2023 by Posit Software, PBC. --> | ||
|
||
<template> | ||
<div class="deployment-card focus-shadow"> | ||
<RouterLink :to="`/deployments/${deployment.id}`"> | ||
<span | ||
class="link-fill" | ||
aria-hidden="true" | ||
/> | ||
|
||
<p class="card-title"> | ||
{{ deployment.saveName }} | ||
</p> | ||
<div class="card-details"> | ||
<p>{{ deployment.serverUrl }}</p> | ||
<p>{{ deployment.id }}</p> | ||
<p>Last Published on {{ formatDateString(deployment.deployedAt) }}</p> | ||
</div> | ||
</RouterLink> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { PropType } from 'vue'; | ||
import { RouterLink } from 'vue-router'; | ||
|
||
import { Deployment } from 'src/api'; | ||
import { formatDateString } from 'src/utils/date'; | ||
|
||
defineProps({ | ||
deployment: { | ||
type: Object as PropType<Deployment>, | ||
required: true, | ||
}, | ||
}); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.deployment-card { | ||
position: relative; | ||
border-radius: 8px; | ||
border: 1px solid; | ||
padding: 24px; | ||
|
||
a { | ||
color: inherit; | ||
text-decoration: none; | ||
|
||
&:focus { | ||
outline: 2px solid transparent; | ||
outline-offset: 2px; | ||
} | ||
|
||
.link-fill { | ||
position: absolute; | ||
inset: 0px; | ||
} | ||
} | ||
|
||
.card-title { | ||
font-size: 16px; | ||
font-weight: 500; | ||
} | ||
|
||
.card-details { | ||
margin-top: 12px; | ||
|
||
& > :not([hidden]) ~ :not([hidden]) { | ||
margin-top: 8px; | ||
} | ||
} | ||
|
||
p { | ||
margin: unset; | ||
padding: unset; | ||
} | ||
} | ||
|
||
.body--light { | ||
.deployment-card { | ||
background-color: white; | ||
border-color: $grey-4; | ||
|
||
&:hover { | ||
border-color: $grey-6; | ||
} | ||
} | ||
} | ||
|
||
.body--dark { | ||
.deployment-card { | ||
border-color: $grey-8; | ||
|
||
&:hover { | ||
border-color: $grey-6; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters