Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add styles for Polls #315

Merged
merged 25 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c0a1ecf
feat: add styles for Poll rendered in a Message
MartinCupela Oct 2, 2024
6e604f4
feat: adapt poll size to small screens
MartinCupela Oct 2, 2024
52b34b8
feat: add styles for quoted poll
MartinCupela Oct 2, 2024
fd5db0f
style: fix lint issues
MartinCupela Oct 2, 2024
c727ab1
fix: prevent message notifications bump above modal dialogs
MartinCupela Oct 22, 2024
dbba75c
feat: add DragAndDropContainer styles
MartinCupela Oct 22, 2024
a59c4cf
feat: add modal header styles
MartinCupela Oct 22, 2024
ec66de5
feat: add prompt dialog and dialog menu styles
MartinCupela Oct 22, 2024
0dab586
fix: export DragAndDropContainer styles
MartinCupela Oct 22, 2024
1d09a3a
feat: add poll relevant icons
MartinCupela Oct 22, 2024
ac6d6c8
fix: remove legacy message actions box positioning
MartinCupela Oct 22, 2024
9fd220d
feat: add attachment selector styles
MartinCupela Oct 22, 2024
7567a4d
fix: add poll UI fixes
MartinCupela Oct 22, 2024
5c37b53
style: fix lint issues
MartinCupela Oct 22, 2024
292eddb
fix: fix dialog listings layouts
MartinCupela Oct 22, 2024
f966dfa
fix: fix drag and drop container borders on drag over
MartinCupela Oct 22, 2024
148dd6c
feat: style form errors
MartinCupela Oct 22, 2024
88d9de2
fix: adjust poll creation from styling
MartinCupela Oct 24, 2024
bc5de03
fix: make drag and drop container item expandable
MartinCupela Oct 24, 2024
bbab953
fix:hide spin buttons form input of type number
MartinCupela Oct 24, 2024
b66dba4
fix: fix options distances in option list
MartinCupela Oct 24, 2024
e1beba3
fix: make poll shrinkable
MartinCupela Oct 24, 2024
514bc40
fix: remove field error height in poll forms
MartinCupela Oct 31, 2024
29a800d
Merge branch 'main' into feat/polls
MartinCupela Oct 31, 2024
7c70e6a
fix: fix selector
MartinCupela Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/v2/styles/Avatar/Avatar-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
.stream-chat__avatar--message-status {
--str-chat__avatar-size: calc(var(--str-chat__spacing-px) * 15);
}

.str-chat__avatar--poll-vote-author {
--str-chat__avatar-size: calc(var(--str-chat__spacing-px) * 20);
}
}

.str-chat__avatar {
Expand Down
54 changes: 54 additions & 0 deletions src/v2/styles/Dialog/Dialog-layout.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,62 @@
@use '../utils';

.str-chat__dialog-overlay {
inset: 0;
overflow: hidden;
position: absolute;
height: var(--str-chat__dialog-overlay-height);
width: 100%;
z-index: 2;
}

.str-chat__dialog {
width: 100%;

.str-chat__dialog__body {
padding: 2rem 1rem;
overflow-y: auto;

.str-chat__dialog__title {
margin-bottom: 1rem;
}

}

.str-chat__dialog__controls {
display: flex;
justify-content: flex-end;
gap: 1.25rem;
padding: 1.25rem;

.str-chat__dialog__controls-button {
@include utils.button-reset;
}
}
}

.str-chat__prompt-dialog {
input[type=text] {
width: 100%;
padding: 0.625rem 1rem;
}
}

.str-chat__dialog-menu {
overflow: hidden;

.str-chat__dialog-menu__button {
display: flex;
align-items: center;
width: 100%;
padding: 0.5rem 0.75rem;

.str-chat__dialog-menu__button-icon {
height: 1rem;
width: 1rem;
}

.str-chat__dialog-menu__button-text {
padding-inline: 0.675rem;
}
}
}
103 changes: 103 additions & 0 deletions src/v2/styles/Dialog/Dialog-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
@use '../utils';

.str-chat {
/* The border radius used for the borders of the component */
--str-chat__dialog-menu-border-radius: var(--str-chat__border-radius-sm);

/* The text/icon color of the component */
--str-chat__dialog-menu-color: var(--str-chat__text-color);

/* The background color of the component */
--str-chat__dialog-menu-background-color: var(--str-chat__secondary-background-color);

/* Top border of the component */
--str-chat__dialog-menu-border-block-start: none;

/* Bottom border of the component */
--str-chat__dialog-menu-border-block-end: none;

/* Left (right in RTL layout) border of the component */
--str-chat__dialog-menu-border-inline-start: none;

/* Right (left in RTL layout) border of the component */
--str-chat__dialog-menu-border-inline-end: none;

/* Box shadow applied to the component */
--str-chat__dialog-menu-box-shadow: 0 0 8px var(--str-chat__box-shadow-color);

/* The border radius used for the borders of an item in the message actions box */
--str-chat__dialog-menu-button-border-radius: 0;

/* The text/icon color of an item in the message actions box */
--str-chat__dialog-menu-button-color: var(--str-chat__text-color);

/* The background color of an item in the message actions box */
--str-chat__dialog-menu-button-background-color: transparent;

/* The background color of an item in the message actions box when hovered */
--str-chat__dialog-menu-button-hover-background-color: var(--str-chat__secondary-surface-color);

/* Top border of an item in the message actions box */
--str-chat__dialog-menu-button-border-block-start: none;

/* Bottom border of an item in the message actions box */
--str-chat__dialog-menu-button-border-block-end: none;

/* Left (right in RTL layout) border of an item in the message actions box */
--str-chat__dialog-menu-button-border-inline-start: none;

/* Right (left in RTL layout) border of an item in the message actions box */
--str-chat__dialog-menu-button-border-inline-end: none;

/* Box shadow applied to an item in the message actions box */
--str-chat__dialog-menu-button-box-shadow: none;
}

.str-chat__dialog {
.str-chat__dialog__title {
font: var(--str-chat__subtitle-medium-text);
}

.str-chat__dialog__prompt {
font: var(--str-chat__subtitle-text);
}

.str-chat__dialog__controls {
.str-chat__dialog__controls-button {
cursor: pointer;
font: var(--str-chat__body-medium-text);
color: var(--str-chat__primary-color);
}

.str-chat__dialog__controls-button--submit {
text-transform: uppercase;

&:disabled {
color: var(--str-chat__disabled-color);
}
}
}
}

.str-chat__prompt-dialog {
input[type=text] {
font: var(--str-chat__subtitle-text);
border-radius: 20px;
border: 1px solid var(--str-chat__primary-color);
}
}


.str-chat__dialog-menu {
@include utils.component-layer-overrides('dialog-menu');

.str-chat__dialog-menu__button {
@include utils.component-layer-overrides('dialog-menu-button');
cursor: pointer;
font: var(--str-chat__subtitle-text);

&:hover, &:focus{
background-color: var(--str-chat__dialog-menu-button-hover-background-color);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.str-chat__drag-and-drop-container__item {
display: flex;
width: 100%;
padding-block: 0.25rem;
}
47 changes: 47 additions & 0 deletions src/v2/styles/DragAndDropContainer/DragAndDropContainer-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.str-chat {
/* Top border of the component */
--str-chat__drag-and-drop-container-border-block-start: 2px solid transparent;

/* Bottom border of the component */
--str-chat__drag-and-drop-container-border-block-end: 2px solid transparent;

/* Top border of the component on dragover */
--str-chat__drag-and-drop-container-on-dragover-border-block-start: 2px solid var(--str-chat__primary-color);

/* Bottom border of the component on dragover */
--str-chat__drag-and-drop-container-on-dragover-border-block-end: 2px solid var(--str-chat__primary-color);

/* Left (right in RTL layout) border of the component on dragover */
--str-chat__drag-and-drop-container-on-dragover-border-inline-start: none;

/* Right (left in RTL layout) border of the component on dragover */
--str-chat__drag-and-drop-container-on-dragover-border-inline-end: none;
}


.str-chat__drag-and-drop-container--dragging {
cursor: grabbing;
}

.str-chat__drag-and-drop-container__item[draggable="true"] {
cursor: grab;

&:active {
background: transparent;
}
}


.str-chat__drag-and-drop-container__item {
border-bottom: var(--str-chat__drag-and-drop-container-border-block-start);
border-top: var(--str-chat__drag-and-drop-container-border-block-start);

&.str-chat__drag-and-drop-container__item--dragged-over-from-top {
border-bottom: var(--str-chat__drag-and-drop-container-on-dragover-border-block-end);
}

&.str-chat__drag-and-drop-container__item--dragged-over-from-bottom {
border-top: var(--str-chat__drag-and-drop-container-on-dragover-border-block-start);
}
}

9 changes: 9 additions & 0 deletions src/v2/styles/Form/Form-layout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.str-chat__dialog__field {
display: flex;
flex-direction: column;
gap: 0.5rem;

.str-chat__form-field-error {
margin-left: 0.5rem;
}
}
17 changes: 17 additions & 0 deletions src/v2/styles/Form/Form-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.str-chat__form-field-error {
font-size: 0.75rem;
color: var(--str-chat__danger-color)
}

// hide spin buttons form input of type number
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.str-chat__infinite-scroll-paginator {
overflow-y: auto;
overflow-x: hidden;
}
9 changes: 0 additions & 9 deletions src/v2/styles/MessageActionsBox/MessageActionsBox-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,3 @@
}
}
}

.str-chat__message-actions-box:not(.str-chat__message-actions-box-angular) {
display: none;
z-index: 1;

&.str-chat__message-actions-box--open {
display: block;
}
}
32 changes: 28 additions & 4 deletions src/v2/styles/MessageInput/MessageInput-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
height: calc(var(--str-chat__spacing-px) * 45);
cursor: pointer;

.str-chat__file-input {
display: none;
}

.str-chat__file-input-label {
@include utils.flex-row-center;
cursor: pointer;
Expand Down Expand Up @@ -217,3 +213,31 @@
transform: scale(-1, 1);
}
}

.str-chat__attachment-selector-actions-menu,
.str-chat__attachment-selector {
button {
@include utils.button-reset;
}
}

.str-chat__attachment-selector {
.str-chat__attachment-selector__menu-button {
padding: 0.25rem 0.5rem;
cursor: pointer;

.str-chat__attachment-selector__menu-button__icon {
height: 26px;
width: 26px;
}
}
}

.str-chat__file-input {
display: none;
}

.str-chat__attachment-selector-actions-menu {
min-width: 300px;
padding-block: 0.5rem;
}
60 changes: 60 additions & 0 deletions src/v2/styles/MessageInput/MessageInput-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@

/* Box shadow applied to the cooldown timer */
--str-chat__cooldown-box-shadow: none;

/* Color applied to an icon in a button that opens attachment selector */
--str-chat__attachment-selector-button-icon-color: var(--str-chat__text-low-emphasis-color);

/* Color applied to an icon in a button that opens attachment selector when hovered over */
--str-chat__attachment-selector-button-icon-color-hover: var(--str-chat__primary-color);

/* Color applied to an attachment selector menu item icon when hovered over */
--str-chat__attachment-selector-actions-menu-button-icon-color: var(--str-chat__primary-color);

/* Color applied to an attachment selector menu item icon when hovered over or focused */
--str-chat__attachment-selector-actions-menu-button-icon-color-active: var(--str-chat__primary-color);
}

.str-chat__message-input {
Expand Down Expand Up @@ -283,3 +295,51 @@
}
}
}

.str-chat__attachment-selector {
.str-chat__attachment-selector__menu-button {
.str-chat__attachment-selector__menu-button__icon {
background-color: var(--str-chat__attachment-selector-button-icon-color);
-webkit-mask: var(--str-chat__add-attachment-icon) no-repeat center / contain;
mask: var(--str-chat__add-attachment-icon) no-repeat center / contain;
}

&:hover {
.str-chat__attachment-selector__menu-button__icon {
background-color: var(--str-chat__attachment-selector-button-icon-color-hover);
}
}
}
}

.str-chat__attachment-selector-actions-menu {
.str-chat__attachment-selector-actions-menu__button {
color: var(--str-chat__text-low-emphasis-color);

.str-chat__dialog-menu__button-icon {
background-color: var(--str-chat__attachment-selector-actions-menu-button-icon-color);
}

&:hover, &:focus {
color: var(--str-chat__text-color);

.str-chat__dialog-menu__button-icon {
background-color: var(--str-chat__attachment-selector-actions-menu-button-icon-color-active);
}
}
}

.str-chat__attachment-selector-actions-menu__upload-file-button {
.str-chat__dialog-menu__button-icon {
-webkit-mask: var(--str-chat__folder-icon) no-repeat center / contain;
mask: var(--str-chat__folder-icon) no-repeat center / contain;
}
}

.str-chat__attachment-selector-actions-menu__create-poll-button {
.str-chat__dialog-menu__button-icon {
-webkit-mask: var(--str-chat__poll-icon) no-repeat center / contain;
mask: var(--str-chat__poll-icon) no-repeat center / contain;
}
}
}
Loading
Loading