Files
2026-09-27 17:10:46 +02:00

294 lines
6.0 KiB
SCSS

/* ==================================
# Chat
================================== */
// SETTINGS
@import "@appuniversum/ember-appuniversum/styles/a-settings";
// TOOLS
@import "@appuniversum/ember-appuniversum/styles/a-tools";
// GENERIC
@import "@appuniversum/ember-appuniversum/styles/a-generic";
// ELEMENTS
@import "@appuniversum/ember-appuniversum/styles/a-elements";
// OBJECTS
@import "@appuniversum/ember-appuniversum/styles/a-objects";
// COMPONENTS
@import "@appuniversum/ember-appuniversum/styles/a-components";
// PLUGINS
@import "@appuniversum/ember-appuniversum/styles/a-plugins";
// UTILITIES
@import "@appuniversum/ember-appuniversum/styles/a-utilities";
// CHAT
/* ==================================
#CHAT LAYOUT
Sidebar with the conversation overview (1/5 of the screen) next to a
content area that fills the rest of the screen under the main header.
================================== */
.chat-sidebar {
@include mq(medium) {
flex-basis: 20%;
flex-grow: 0;
flex-shrink: 0;
}
}
/* The conversations are listed as navigation: title on top, date + time in
subscript. Titles are truncated when they do not fit. */
.chat-sidebar__list {
display: block;
}
/* The trash bin of a conversation, on the right of its row. The link gets
extra room so a truncated title does not run under the button. */
.chat-sidebar__item {
position: relative;
}
.chat-sidebar__link {
flex-direction: column;
align-items: flex-start;
gap: 0.1rem;
padding-right: $au-unit;
}
.chat-sidebar__delete {
position: absolute;
top: 50%;
right: $au-unit-tiny;
transform: translateY(-50%);
display: inline-flex;
align-items: center;
justify-content: center;
width: $au-unit * 1.2;
height: $au-unit * 1.2;
padding: 0;
border: none;
border-radius: 0.2rem;
background: none;
color: var(--au-gray-600);
cursor: pointer;
transition:
color var(--au-transition),
background-color var(--au-transition);
&:hover,
&:focus {
color: var(--au-red-600);
background-color: var(--au-gray-200);
}
&:focus {
outline: var(--au-outline);
}
}
.chat-sidebar__title {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chat-sidebar__meta {
font-size: var(--au-tiny);
color: var(--au-gray-600);
text-decoration: none;
}
.chat-sidebar__empty {
margin: 0;
padding: $au-unit-tiny * 1.5 $au-unit-small;
@include mq(medium) {
padding: $au-unit-small $au-unit-small + $au-unit-tiny;
}
}
.chat-content {
display: flex;
flex-direction: column;
min-width: 0;
}
/* Bar above the chat: the conversation title, truncated, and a button to
start a new conversation. */
.chat-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.6rem 1rem;
border-bottom: 1px solid var(--au-gray-200);
flex-shrink: 0;
}
.chat-toolbar__title {
margin: 0;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* The conversations overview: a big button to start a conversation. */
.chat-start {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
min-height: calc(100vh - 8rem);
@include mq(medium) {
min-height: 0;
}
}
.chat-window {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
height: calc(100vh - 8rem);
@include mq(medium) {
height: auto;
}
}
.chat-window__messages {
flex: 1;
overflow-y: auto;
padding: 1rem;
}
.chat-message {
max-width: 48rem;
margin: 0 auto 1rem;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
white-space: pre-wrap;
}
.chat-message--user {
background: var(--au-blue-100);
margin-left: 8rem;
}
.chat-message--assistant {
background: var(--au-gray-100);
margin-right: 8rem;
}
.chat-composer {
border-top: 1px solid var(--au-gray-200);
padding: 1rem;
}
/* Rendered markdown (assistant messages) */
.chat-md > :first-child {
margin-top: 0;
}
.chat-md > :last-child {
margin-bottom: 0;
}
.chat-md p,
.chat-md ul,
.chat-md ol,
.chat-md blockquote,
.chat-md table {
margin: 0 0 0.5rem;
}
.chat-md ul,
.chat-md ol {
padding-left: 1.5rem;
}
.chat-md code {
background: var(--au-gray-200);
border-radius: 0.25rem;
padding: 0.1rem 0.3rem;
font-size: 0.9em;
}
.chat-md pre {
margin: 0 0 0.5rem;
padding: 0.5rem 0.75rem;
background: var(--au-gray-200);
border-radius: 0.25rem;
overflow-x: auto;
}
.chat-md pre code {
background: none;
padding: 0;
}
.chat-md table {
border-collapse: collapse;
}
.chat-md th,
.chat-md td {
border: 1px solid var(--au-gray-300);
padding: 0.25rem 0.5rem;
text-align: left;
}
.chat-md blockquote {
border-left: 3px solid var(--au-gray-300);
padding-left: 0.75rem;
color: var(--au-gray-500);
}
/* The turtle spec, hidden behind a disclosure */
.chat-md__spec {
margin: 0 0 0.5rem;
}
.chat-md__spec summary {
cursor: pointer;
color: var(--au-gray-700);
font-size: 0.9em;
}
.chat-md__spec summary:hover {
color: var(--au-gray-600);
}
/* the SPARQL translation, inside the same disclosure */
.chat-md__spec-queries {
margin-top: 0.5rem;
padding-top: 0.5rem;
border-top: 1px solid var(--au-gray-300, #ccc);
}
.chat-md__spec-queries .chat-md__queries-label {
margin: 0 0 0.25rem;
color: var(--au-gray-700);
font-size: 0.9em;
}
/* The attachment tab inside an assistant message */
.chat-bijlagen-tabs {
display: flex;
gap: 0.25rem;
margin-bottom: 0.5rem;
}
.chat-bijlagen-tab {
border: 1px solid var(--au-gray-300);
background: transparent;
border-radius: 0.25rem 0.25rem 0 0;
padding: 0.15rem 0.6rem;
font-size: 0.85em;
cursor: pointer;
color: var(--au-gray-700);
}
.chat-bijlagen-tab--active {
background: var(--au-gray-100);
font-weight: 600;
}
.chat-attachment--row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 0.75rem;
padding: 0.375rem 0;
border-top: 1px solid var(--au-gray-300);
}
.chat-attachment__info {
display: flex;
flex-direction: column;
gap: 0.125rem;
}
.chat-attachment__what,
.chat-attachment__pending {
color: var(--au-gray-500);
font-size: 0.85em;
}