diff --git a/src/components/Attachment/styling/Attachment.scss b/src/components/Attachment/styling/Attachment.scss index 7c4731d685..fdf762c308 100644 --- a/src/components/Attachment/styling/Attachment.scss +++ b/src/components/Attachment/styling/Attachment.scss @@ -2,10 +2,9 @@ .str-chat { /* The margin applied to every attachment in the attachment list */ - --str-chat__attachment-margin: var(--str-chat__spacing-0_5); - - /* The border radius used for the borders of the component */ - --str-chat__attachment-list-border-radius: 0; + --str-chat__attachment-margin: var(--space-2) + /* The border radius used for the borders of the component */ + --str-chat__attachment-list-border-radius: 0; /* The text/icon color of the component */ --str-chat__attachment-list-color: var(--str-chat__text-color); @@ -328,7 +327,7 @@ .str-chat__gallery .str-chat__message-attachment--svg-image, .str-chat__message-attachment--image.str-chat__message-attachment--svg-image { - $padding: var(--str-chat__spacing-6); + $padding: var(--space-24); padding: $padding; img { @@ -344,8 +343,8 @@ display: flex; align-items: center; justify-content: center; - padding: var(--str-chat__spacing-2); - column-gap: var(--str-chat__spacing-4); + padding: var(--space-8); + column-gap: var(--space-16); //margin: var(--str-chat__attachment-margin); .str-chat__file-icon { @@ -380,7 +379,7 @@ flex-direction: column; align-items: flex-start; justify-content: center; - row-gap: var(--str-chat__spacing-0_5); + row-gap: var(--space-2); min-width: 0; line-height: var(--typography-line-height-tight); @@ -390,7 +389,7 @@ display: flex; align-items: center; justify-content: space-between; - column-gap: var(--str-chat__spacing-2); + column-gap: var(--space-8); font-weight: var(--typography-font-weight-semi-bold); font-size: var(--typography-font-size-sm); @@ -435,29 +434,12 @@ color: var(--str-chat__voice-recording-attachment-widget-color); } - .str-chat__message-attachment-voice-recording-widget--first-row { - @include utils.ellipsis-text-parent; - - width: 100%; - display: flex; - align-items: center; - justify-content: space-between; - gap: var(--str-chat__spacing-1); - } - .str-chat__message-attachment-download-icon { svg { width: calc(var(--str-chat__spacing-px) * 24); height: calc(var(--str-chat__spacing-px) * 16); } } - - .str-chat__message-attachment__voice-recording-widget__error-message { - display: flex; - align-items: center; - justify-content: flex-start; - gap: var(--str-chat__spacing-1); - } } .str-chat__message-attachment__voice-recording-widget__right-section { @@ -476,10 +458,6 @@ .str-chat__message-attachment-download-icon { --str-chat-icon-height: calc(var(--str-chat__spacing-px) * 16); } - - .str-chat__attachment-type-icon { - --str-chat-icon-height: calc(var(--str-chat__spacing-px) * 37); - } } .str-chat__message.str-chat__message--has-single-attachment.str-chat__message--has-no-text { diff --git a/src/components/Attachment/styling/CardAudio.scss b/src/components/Attachment/styling/CardAudio.scss index a0d06c1a8a..4ddfd8593e 100644 --- a/src/components/Attachment/styling/CardAudio.scss +++ b/src/components/Attachment/styling/CardAudio.scss @@ -1,5 +1,3 @@ -@use '../../../styling/utils'; - .str-chat__message-attachment-card--audio { .str-chat__message-attachment-card--content { padding: 0; diff --git a/src/components/Attachment/styling/Geolocation.scss b/src/components/Attachment/styling/Geolocation.scss index bd19975f5d..d94ce34913 100644 --- a/src/components/Attachment/styling/Geolocation.scss +++ b/src/components/Attachment/styling/Geolocation.scss @@ -93,7 +93,7 @@ .str-chat__message-attachment-geolocation__status--active-until { text-transform: lowercase; - font: var(--str-chat__caption-text); + font: var(--str-chat__metadata-emphasis-text); } } } diff --git a/src/components/Attachment/styling/Giphy.scss b/src/components/Attachment/styling/Giphy.scss index cb65b3044e..5e9356a523 100644 --- a/src/components/Attachment/styling/Giphy.scss +++ b/src/components/Attachment/styling/Giphy.scss @@ -1,4 +1,4 @@ -@use '../../../styling/utils'; +@use '../../../styling/utils' as utils; .str-chat { /* The height of GIFs */ diff --git a/src/components/Attachment/styling/ModalGallery.scss b/src/components/Attachment/styling/ModalGallery.scss index ac73e281ed..40fd53b48c 100644 --- a/src/components/Attachment/styling/ModalGallery.scss +++ b/src/components/Attachment/styling/ModalGallery.scss @@ -23,7 +23,7 @@ grid-template-rows: 50% 50%; overflow: hidden; border-radius: var(--radius-lg); - gap: var(--str-chat__spacing-0_5); + gap: var(--space-2); width: $max-width; max-width: $max-width; // CDN resize requires height/max-height to be present on the img element, this rule ensures that diff --git a/src/components/Avatar/styling/Avatar.scss b/src/components/Avatar/styling/Avatar.scss index cf206fcc85..999af4be2c 100644 --- a/src/components/Avatar/styling/Avatar.scss +++ b/src/components/Avatar/styling/Avatar.scss @@ -27,7 +27,8 @@ height: 100%; } - .str-chat__icon--person { + // people icon for avatars without images and initials + .str-chat__icon { width: var(--avatar-icon-size); height: var(--avatar-icon-size); stroke-width: var(--avatar-icon-stroke-width); diff --git a/src/components/Channel/styling/Channel.scss b/src/components/Channel/styling/Channel.scss index 445d48cb13..c8a5f9b4b9 100644 --- a/src/components/Channel/styling/Channel.scss +++ b/src/components/Channel/styling/Channel.scss @@ -204,9 +204,6 @@ /* Right (left in RTL layout) border of the component */ --str-chat__channel-border-inline-end: none; - /* The icon color used when no channel is selected */ - --str-chat__channel-empty-indicator-color: var(--str-chat__disabled-color); - /* The base surface color behind the loading shimmer */ --str-chat__channel-loading-state-color: var(--background-core-surface); } diff --git a/src/components/ChannelList/styling/ChannelList.scss b/src/components/ChannelList/styling/ChannelList.scss index 0a233d09d9..daa566489a 100644 --- a/src/components/ChannelList/styling/ChannelList.scss +++ b/src/components/ChannelList/styling/ChannelList.scss @@ -127,7 +127,7 @@ .str-chat__channel-list-inner { height: 100%; overflow: hidden; - padding-bottom: var(--str-chat__spacing-2_5); + padding-bottom: calc(var(--space-8) + var(--space-2)); .str-chat__channel-list-inner__main { height: 100%; @@ -139,7 +139,7 @@ flex-direction: column; align-items: center; justify-content: center; - padding: var(--str-chat__spacing-3); + padding: calc(var(--space-8) + var(--space-4)); p { color: var(--text-secondary); @@ -152,17 +152,13 @@ .str-chat__load-more-button { display: flex; justify-content: center; - margin: var(--str-chat__spacing-2) 0; + margin: var(--space-8) 0; .str-chat__load-more-button__button { @include utils.flex-row-center; } } - .stream-chat__paginated-list { - gap: 0; - } - .str-chat__load-more-button__button { @include utils.component-layer-overrides('channel-list-load-more'); width: 80%; diff --git a/src/components/Dialog/styling/Alert.scss b/src/components/Dialog/styling/Alert.scss index 9d9a474663..95d38dd086 100644 --- a/src/components/Dialog/styling/Alert.scss +++ b/src/components/Dialog/styling/Alert.scss @@ -33,7 +33,7 @@ } .str-chat__alert-header__description { - font: var(--str-chat__caption-default-tex); + font: var(--str-chat__caption-default-text); } } } diff --git a/src/components/Dialog/styling/Prompt.scss b/src/components/Dialog/styling/Prompt.scss index 36962e8e62..33b0a9c9f8 100644 --- a/src/components/Dialog/styling/Prompt.scss +++ b/src/components/Dialog/styling/Prompt.scss @@ -25,7 +25,7 @@ } .str-chat__prompt__header__description { - font: var(--str-chat__body-text); + font: var(--str-chat__caption-default-text); color: var(--text-secondary); } @@ -39,10 +39,6 @@ /* Vertical padding so focus rings (e.g. TextInput wrapper box-shadow) are not clipped by scrollable-y */ padding: var(--spacing-xxs) var(--spacing-xl); @include utils.scrollable-y; - - .str-chat__prompt__title { - margin-bottom: 1rem; - } } .str-chat__prompt__footer { diff --git a/src/components/Dialog/styling/Viewer.scss b/src/components/Dialog/styling/Viewer.scss index c9b421664f..d619a47ade 100644 --- a/src/components/Dialog/styling/Viewer.scss +++ b/src/components/Dialog/styling/Viewer.scss @@ -30,7 +30,7 @@ } .str-chat__viewer__header__description { - font: var(--str-chat__body-text); + font: var(--str-chat__caption-default-text); color: var(--text-secondary); } @@ -52,10 +52,6 @@ padding: 0 var(--spacing-xl); flex: 1; min-height: 0; - - .str-chat__viewer__title { - margin-bottom: 1rem; - } } .str-chat__viewer__footer { diff --git a/src/components/EmptyStateIndicator/styling/EmptyStateIndicator.scss b/src/components/EmptyStateIndicator/styling/EmptyStateIndicator.scss index 51cd4ee68a..b02a71c3be 100644 --- a/src/components/EmptyStateIndicator/styling/EmptyStateIndicator.scss +++ b/src/components/EmptyStateIndicator/styling/EmptyStateIndicator.scss @@ -1,10 +1,5 @@ @use '../../../styling/utils'; -.str-chat { - /* The text color used when no channel is selected */ - --str-chat__channel-empty-color: var(--text-secondary); -} - .str-chat__empty-channel { --str-chat-icon-color: var(--text-tertiary); display: flex; @@ -26,11 +21,6 @@ color: var(--str-chat-icon-color); } - .str-chat__empty-channel-notifications { - position: absolute; - inset-block-end: var(--str-chat__spacing-2); - } - .str-chat__empty-channel-text { margin: 0; max-width: 230px; diff --git a/src/components/Form/styling/SwitchField.scss b/src/components/Form/styling/SwitchField.scss index f2617a8171..de4727bf2f 100644 --- a/src/components/Form/styling/SwitchField.scss +++ b/src/components/Form/styling/SwitchField.scss @@ -8,16 +8,6 @@ var(--background-core-surface-subtle) ); --str-chat__switch-field-border-radius: var(--radius-md); - --str-chat__switch-field-title-font-size: var(--typography-font-size-sm, 14px); - --str-chat__switch-field-title-font-weight: var(--typography-font-weight-medium, 500); - --str-chat__switch-field-title-line-height: var(--typography-line-height-tight, 16px); - --str-chat__switch-field-title-color: var(--text-primary, #1a1b25); - --str-chat__switch-field-description-font-size: var(--typography-font-size-xs, 12px); - --str-chat__switch-field-description-font-weight: var( - --typography-font-weight-regular, - 400 - ); - --str-chat__switch-field-description-color: var(--text-tertiary, #687385); --str-chat__switch-field__track-off-bg: var( --control-toggle-switch-bg, var(--border-core-on-surface, #a3acba) @@ -66,33 +56,6 @@ cursor: pointer; } - &__content { - display: flex; - flex-direction: column; - gap: var(--spacing-xxs, 4px); - min-width: 0; - } - - &__title { - font-size: var(--str-chat__switch-field-title-font-size); - font-weight: var(--str-chat__switch-field-title-font-weight); - line-height: var(--str-chat__switch-field-title-line-height); - color: var(--str-chat__switch-field-title-color); - } - - &__description { - font-size: var(--str-chat__switch-field-description-font-size); - font-weight: var(--str-chat__switch-field-description-font-weight); - line-height: var(--str-chat__switch-field-title-line-height); - color: var(--str-chat__switch-field-description-color); - } - - &__expanded-content { - flex-shrink: 0; - display: flex; - align-items: center; - } - &__switch { display: flex; align-items: center; diff --git a/src/components/Message/styling/Message.scss b/src/components/Message/styling/Message.scss index 18dfca69c2..d6ce0ce40d 100644 --- a/src/components/Message/styling/Message.scss +++ b/src/components/Message/styling/Message.scss @@ -6,11 +6,8 @@ --str-chat__message-border-radius: 0; --str-chat__message-color: var(--str-chat__text-color); - --str-chat__message-error-message-color: var(--str-chat__danger-color); - --str-chat__message-secondary-color: var(--str-chat__text-low-emphasis-color); --str-chat__message-link-color: var(--chat-text-link); --str-chat__message-mention-color: var(--str-chat__primary-color); - --str-chat__message-replies-count-color: var(--str-chat__primary-color); --str-chat__message-background-color: transparent; --str-chat__message-highlighted-background-color: var( --str-chat__message-highlight-color @@ -40,7 +37,7 @@ --str-chat__message-bubble-border-inline-end: none; --str-chat__message-bubble-box-shadow: none; - --str-chat__blocked-message-border-radius: var(--str-chat__border-radius-md); + --str-chat__blocked-message-border-radius: var(--radius-md); --str-chat__blocked-message-color: var(--str-chat__text-low-emphasis-color); --str-chat__blocked-message-background-color: var(--str-chat__secondary-surface-color); --str-chat__blocked-message-border-block-start: none; @@ -49,11 +46,6 @@ --str-chat__blocked-message-border-inline-end: none; --str-chat__blocked-message-box-shadow: none; - --str-chat__translation-notice-color: var(--str-chat__text-low-emphasis-color); - --str-chat__translation-notice-active-background-color: var( - --str-chat__tertiary-surface-color - ); - --str-chat__message-reactions-host-offset-x: calc(var(--spacing-xs) * -1); /* Background color for pinned messages (Figma: background/core/highlight) */ @@ -89,12 +81,6 @@ --str-chat-message-options-size: calc(3 * var(--str-chat__message-options-button-size)); padding-inline: var(--str-chat__message-composer-padding); - &.str-chat__message-without-touch-support { - --str-chat-message-options-size: calc( - 1 * var(--str-chat__message-options-button-size) - ); - } - .str-chat__message-bubble { max-width: var(--str-chat__message-max-width); display: flex; @@ -180,7 +166,7 @@ .str-chat__message-mention { color: var(--str-chat__message-mention-color); - font: var(--str-chat__body2-medium-text); + font: var(--str-chat__body-emphasis-text); } .str-chat__message { @@ -268,7 +254,7 @@ } &.str-chat__message--other { - column-gap: var(--str-chat__spacing-2); + column-gap: var(--space-8); justify-items: flex-start; &.str-chat__message--with-avatar { @@ -315,7 +301,7 @@ } &.str-chat__message--me { - column-gap: var(--str-chat__spacing-2); + column-gap: var(--space-8); justify-items: flex-end; &.str-chat__message--with-avatar { @@ -379,7 +365,7 @@ 'message-bubble options' 'replies replies'; grid-template-columns: auto 1fr; - column-gap: var(--str-chat__spacing-2); + column-gap: var(--space-8); position: relative; .str-chat__message-reactions-host { @@ -395,10 +381,6 @@ } } - &:has(.str-chat__message-reactions--top) { - // maybe remove later - } - &:has(.str-chat__message-reactions--bottom) { grid-template-areas: 'message-bubble options' @@ -452,32 +434,6 @@ } } - .str-chat__translation-notice { - grid-area: translation-notice; - - button { - cursor: pointer; - padding: 0.25rem 0; - margin: 0; - font: var(--str-chat__body2-text); - color: var(--str-chat__translation-notice-color); - border: none; - background: none; - - &:active, - &:hover { - background: var(--str-chat__translation-notice-active-background-color); - } - } - } - - .str-chat__custom-message-metadata { - grid-area: custom-metadata; - height: var(--size-24); - margin-block-start: var(--spacing-xxs); - color: var(--str-chat__message-secondary-color); - } - .str-chat__message-metadata { grid-area: metadata; display: flex; @@ -495,10 +451,6 @@ margin-inline-end: var(--spacing-xxs); } - .str-chat__message-sender-name { - font: var(--str-chat__caption-medium-text); - } - .str-chat__message-edited-indicator { margin-left: var(--spacing-xs); } @@ -509,24 +461,11 @@ text-align: right; } - .str-chat__message-is-thread-reply-button-wrapper { - grid-area: replies; - - // TODO: "Thread reply" button styling - } - .str-chat__message--blocked-inner { @include chat-bubble-spacing; @include utils.component-layer-overrides('blocked-message'); // todo: once blocked message designs are ready remove this padding? padding-block: var(--spacing-xs); - font: var(--str-chat__body2-text); - } - - // Fixes emoji display in Chrome on non-retina display (only detected in Angular SDK) https://bugs.chromium.org/p/chromium/issues/detail?id=596223 - .str-chat__emoji-display-fix { - display: inline-block; - width: 1.25em; } .str-chat__message-error-indicator { @@ -584,14 +523,8 @@ } // Message options display - default mode: they appear when .str-chat__li is hovered -.str-chat__ul:not( - .str-chat__message-options-in-bubble, - .str-chat__message-with-touch-support - ), -.str-chat__virtual-list:not( - .str-chat__message-options-in-bubble, - .str-chat__message-with-touch-support - ) { +.str-chat__ul, +.str-chat__virtual-list { /* This rule won't be applied in browsers that don't support :has() */ .str-chat__li:hover:not(:has(.str-chat__modal--open)), .str-chat__li:focus-within:not(:has(.str-chat__modal--open)), @@ -608,44 +541,6 @@ margin-inline-start: 0; } } - - /* Fallback for when :has() is unsupported */ - @supports not selector(:has(a, b)) { - .str-chat__li:hover, - .str-chat__li:focus-within { - .str-chat__message-options { - display: flex; - } - - .str-chat__message--other .str-chat__message-inner { - margin-inline-end: 0; - } - - .str-chat__message--me .str-chat__message-inner { - margin-inline-start: 0; - } - } - } -} - -// Message options display - second mode: they appear when .str-chat__message-inner is hovered -.str-chat__ul.str-chat__message-options-in-bubble, -.str-chat__virtual-list.str-chat__message-options-in-bubble { - .str-chat__message-inner { - &:hover { - .str-chat__message-options { - display: flex; - } - } - } - - .str-chat__message--other .str-chat__message-inner:hover { - margin-inline-end: 0; - } - - .str-chat__message--me .str-chat__message-inner:hover { - margin-inline-start: 0; - } } // Message options display - third mode: they appear, when explicitly marked as active @@ -659,10 +554,6 @@ .str-chat__message-options { display: none; } - - .str-chat__message-actions-open.str-chat__message-options { - display: flex; - } } .str-chat__message-inner:focus-within { @@ -719,13 +610,13 @@ .str-chat__message-with-thread-link { &.str-chat__message--other { .str-chat__message-bubble { - border-end-start-radius: calc(var(--str-chat__border-radius-md) / 6); + border-end-start-radius: calc(var(--radius-md) / 6); } } &.str-chat__message--me { .str-chat__message-bubble { - border-end-end-radius: calc(var(--str-chat__border-radius-md) / 6); + border-end-end-radius: calc(var(--radius-md) / 6); } } } @@ -738,27 +629,3 @@ pointer-events: none; } } - -// todo: not implemented in stream-chat-react -.str-chat__message-with-touch-support { - .str-chat__message-bubble { - -webkit-touch-callout: none; - -webkit-user-select: none; - user-select: none; - } - - &.str-chat__message-menu-opened { - .str-chat__attachments-container, - .str-chat__message-text-inner { - pointer-events: none; - } - } - - .str-chat__message-inner { - margin-inline: 0; - } - - .str-chat__message-options { - display: none; - } -} diff --git a/src/components/Message/styling/MessageIsThreadReplyInChannelButtonIndicator.scss b/src/components/Message/styling/MessageIsThreadReplyInChannelButtonIndicator.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/components/Message/styling/MessageStatus.scss b/src/components/Message/styling/MessageStatus.scss index c8397a5720..7c232082d4 100644 --- a/src/components/Message/styling/MessageStatus.scss +++ b/src/components/Message/styling/MessageStatus.scss @@ -3,7 +3,7 @@ display: flex; align-items: center; justify-content: center; - column-gap: var(--str-chat__spacing-0_5); + column-gap: var(--space-2); position: relative; color: var(--chat-text-timestamp); svg { diff --git a/src/components/Message/styling/MessageSystem.scss b/src/components/Message/styling/MessageSystem.scss index df7d6efa9f..767ca82334 100644 --- a/src/components/Message/styling/MessageSystem.scss +++ b/src/components/Message/styling/MessageSystem.scss @@ -1,5 +1,3 @@ -@use '../../../styling/utils'; - .str-chat__message--system { display: flex; padding-block: var(--spacing-xs); diff --git a/src/components/Message/styling/index.scss b/src/components/Message/styling/index.scss index 9b83d6a795..d49ffe6ad3 100644 --- a/src/components/Message/styling/index.scss +++ b/src/components/Message/styling/index.scss @@ -1,6 +1,5 @@ @use 'Message'; @use 'MessageAlsoSentInChannelIndicator'; -@use 'MessageIsThreadReplyInChannelButtonIndicator'; @use 'MessageStatus'; @use 'MessageSystem'; @use 'MessageTranslationIndicator'; diff --git a/src/components/MessageActions/styling/MessageActions.scss b/src/components/MessageActions/styling/MessageActions.scss index e1a6591c8d..77104af4c4 100644 --- a/src/components/MessageActions/styling/MessageActions.scss +++ b/src/components/MessageActions/styling/MessageActions.scss @@ -37,8 +37,7 @@ color: var(--str-chat__message-options-active-color); } - .str-chat__message-actions-box-button, - .str-chat__message-actions-container { + .str-chat__message-actions-box-button { position: relative; } } diff --git a/src/components/MessageBounce/styling/MessageBouncePrompt.scss b/src/components/MessageBounce/styling/MessageBouncePrompt.scss index f6b5a3cf42..d8ce696cc3 100644 --- a/src/components/MessageBounce/styling/MessageBouncePrompt.scss +++ b/src/components/MessageBounce/styling/MessageBouncePrompt.scss @@ -1,5 +1,3 @@ -@use '../../../styling/utils'; - .str-chat__message-bounce-alert { max-width: 300px; diff --git a/src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx b/src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx index def24a1a7b..8336ab399b 100644 --- a/src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx +++ b/src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx @@ -14,11 +14,11 @@ import React, { useState, } from 'react'; import clsx from 'clsx'; -import { LoadingIndicatorIcon } from '../icons'; import { IconExclamationMark, IconRetry, IconVideoFill } from '../../Icons'; import { RemoveAttachmentPreviewButton } from '../RemoveAttachmentPreviewButton'; import { Button } from '../../Button'; import { AttachmentPreviewRoot } from './utils/AttachmentPreviewRoot'; +import { LoadingIndicator as DefaultLoadingIndicator } from '../../Loading'; export type MediaAttachmentPreviewProps> = UploadAttachmentPreviewProps< @@ -34,7 +34,7 @@ export const MediaAttachmentPreview = ({ removeAttachments, }: MediaAttachmentPreviewProps) => { const { t } = useTranslationContext(); - const { BaseImage = DefaultBaseImage, LoadingIndicator = LoadingIndicatorIcon } = + const { BaseImage = DefaultBaseImage, LoadingIndicator = DefaultLoadingIndicator } = useComponentContext(); const [thumbnailPreviewError, setThumbnailPreviewError] = useState(false); @@ -94,7 +94,7 @@ export const MediaAttachmentPreview = ({ )}
- {isUploading && } + {isUploading && } {isVideoAttachment(attachment) && !hasUploadError && diff --git a/src/components/MessageComposer/__tests__/__snapshots__/AttachmentPreviewList.test.tsx.snap b/src/components/MessageComposer/__tests__/__snapshots__/AttachmentPreviewList.test.tsx.snap index 35a005ca97..c23c44348f 100644 --- a/src/components/MessageComposer/__tests__/__snapshots__/AttachmentPreviewList.test.tsx.snap +++ b/src/components/MessageComposer/__tests__/__snapshots__/AttachmentPreviewList.test.tsx.snap @@ -31,41 +31,27 @@ exports[`AttachmentPreviewList > should render custom BaseImage component 1`] =
-
- - - - - - - - - -
+ + +