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: prepare for removal of legacy styles from stream-chat-react #296

Merged
merged 93 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
2cfe41a
fix(react-sdk): prevent blank message list on fast scroll in iOS brow…
MartinCupela Nov 9, 2023
1c0cd6f
fix: prevent glitch text from overflowing elements (#250)
MartinCupela Nov 16, 2023
01e5200
fix: lift the React notification banner above the modal overlay (#249)
MartinCupela Nov 16, 2023
e9f0bbb
chore(release): 3.14.2 [skip ci]
semantic-release-bot Nov 16, 2023
f2079c8
fix: remove emoji-mart & emoji-replacement from final builds (#246)
arnautov-anton Nov 27, 2023
65efd74
chore(release): 4.0.0 [skip ci]
semantic-release-bot Nov 27, 2023
a161621
fix: file attachment preview error overlay (#252)
szuperaz Nov 29, 2023
b47d325
chore(release): 4.0.1 [skip ci]
semantic-release-bot Nov 29, 2023
f123874
feat: add image fallback styles (#251)
MartinCupela Dec 1, 2023
6017708
chore(release): 4.1.0 [skip ci]
semantic-release-bot Dec 1, 2023
ce0d338
feat(stream-chat-react): add styles for BaseImage to react-image-gall…
MartinCupela Dec 13, 2023
6fb68de
fix(stream-chat-react): center image gallery content fullscreen (#254)
MartinCupela Dec 13, 2023
b4a5c07
fix: position image download icon relative to the image fallback butt…
MartinCupela Dec 13, 2023
6d6496c
chore(release): 4.2.0 [skip ci]
semantic-release-bot Dec 13, 2023
7ac9fe0
feat(angular): display all reacting users for message reactions (#258)
szuperaz Jan 11, 2024
247bc1b
fix: double click is required for opening reaction details (#259)
szuperaz Jan 12, 2024
9ea8ac7
feat: add styles for unread messages separator and notification (#257)
MartinCupela Jan 12, 2024
0afa88d
chore(release): 4.3.0 [skip ci]
semantic-release-bot Jan 12, 2024
e92eae3
feat: update styles for reactions modal (#261)
myandrienko Jan 24, 2024
18bbbef
chore(release): 4.4.0 [skip ci]
semantic-release-bot Jan 24, 2024
db092e6
feat(angular): custom metadata inside message (#262)
szuperaz Jan 30, 2024
98a8298
chore(release): 4.5.0 [skip ci]
semantic-release-bot Jan 30, 2024
2f44cc8
fix(angular): popper styles (#263)
szuperaz Jan 31, 2024
87617c9
fix: use popper to properly position message actions box (#260)
myandrienko Jan 31, 2024
048aae5
feat: add message bounce options styles (#264)
myandrienko Jan 31, 2024
9641f40
chore(release): 4.6.0 [skip ci]
semantic-release-bot Feb 1, 2024
de3ba43
fix: reaction list is now scrollable (#265)
szuperaz Feb 1, 2024
e786174
chore(release): 4.6.1 [skip ci]
semantic-release-bot Feb 1, 2024
2218812
fix(angular): Mention autocomplete can overflow (#266)
szuperaz Feb 6, 2024
3272394
chore(release): 4.6.2 [skip ci]
semantic-release-bot Feb 6, 2024
64e8935
fix: avatar alignment (#267)
myandrienko Feb 7, 2024
97eb814
chore(release): 4.6.3 [skip ci]
semantic-release-bot Feb 7, 2024
330b6c4
feat: rename MessageBounceOptions ➡️ MessageBouncePrompt (#269)
myandrienko Feb 8, 2024
1f34b27
chore(release): 4.7.0 [skip ci]
semantic-release-bot Feb 8, 2024
e172ce1
fix: prevent layout shifts in reactions modal (#270)
myandrienko Feb 13, 2024
6f1424e
fix: stylelint violatiom (#271)
myandrienko Feb 13, 2024
4eb94ca
chore(release): 4.7.1 [skip ci]
semantic-release-bot Feb 13, 2024
0a5443d
fix(angular): message actions menu arrow sometimes appears (#268)
szuperaz Feb 14, 2024
e742b4f
chore(release): 4.7.2 [skip ci]
semantic-release-bot Feb 14, 2024
d30ee50
fix: make message actions keyboard accessible (#272)
myandrienko Feb 21, 2024
5eec5f3
fix(angular): move inline style attributes to CSS files (#273)
szuperaz Feb 22, 2024
6e8d673
chore(release): 4.7.3 [skip ci]
semantic-release-bot Feb 22, 2024
b9573b1
Message bounce angular (#274)
szuperaz Feb 26, 2024
7347511
fix: empty commit to trigger release
szuperaz Feb 26, 2024
fbf0682
chore(release): 4.7.4 [skip ci]
semantic-release-bot Feb 26, 2024
d61a371
feat: add message edited timestamp (#275)
myandrienko Mar 5, 2024
8e2ed2a
chore(release): 4.8.0 [skip ci]
semantic-release-bot Mar 5, 2024
e951a1f
feat: add voice recording attachment styles (#224)
MartinCupela Mar 7, 2024
df0d4be
style: fix stylelint issue
MartinCupela Mar 7, 2024
790996d
chore(release): 4.9.0 [skip ci]
semantic-release-bot Mar 7, 2024
61e740d
fix: typo in timestamp class name (#276)
myandrienko Mar 19, 2024
0ac1ecd
chore(release): 4.9.1 [skip ci]
semantic-release-bot Mar 19, 2024
e4d2e65
fix: syntax for $min_amplitude_height (#278)
szuperaz Mar 21, 2024
8a0abd1
fix(angular): make images bigger in image modal (#277)
szuperaz Mar 21, 2024
fd0fd41
chore: fix linter
szuperaz Mar 21, 2024
036bea7
chore(release): 4.9.2 [skip ci]
semantic-release-bot Mar 21, 2024
796dc89
fix: make wavebar data responsive (#279)
szuperaz Mar 25, 2024
d01270f
feat: add error message and download icon to voice recordings (#280)
szuperaz Mar 25, 2024
8bd821a
chore(release): 4.10.0 [skip ci]
semantic-release-bot Mar 25, 2024
ebdf244
Voice message error message (#281)
szuperaz Mar 25, 2024
48f4c5f
fix: empty commit to trigger release
szuperaz Mar 25, 2024
87e609e
chore(release): 4.10.1 [skip ci]
semantic-release-bot Mar 25, 2024
948dd70
fix: some letter are cut-off (#284)
szuperaz Apr 4, 2024
e543c67
chore(release): 4.10.2 [skip ci]
semantic-release-bot Apr 4, 2024
d7baea8
fix: new message indicator (#286)
szuperaz Apr 9, 2024
fd5dd16
feat(angular): add message status and time to channel preview (#285)
szuperaz Apr 9, 2024
b469c82
chore(release): 4.11.0 [skip ci]
semantic-release-bot Apr 9, 2024
b12b99c
feat(angular): add styles for ngx-floax-ui (#288)
szuperaz Apr 11, 2024
54efa9c
chore(release): 4.12.0 [skip ci]
semantic-release-bot Apr 11, 2024
f442ae8
fix: use flex-start instead of start (#287)
szuperaz Apr 11, 2024
20e8993
chore(release): 4.12.1 [skip ci]
semantic-release-bot Apr 11, 2024
c0f3349
feat(angular): remove theme-v1 from Angular SDK (#289)
szuperaz Apr 12, 2024
6325223
chore(release): 4.13.0 [skip ci]
semantic-release-bot Apr 12, 2024
0adc7ea
fix: remove play button z-index (#282)
MartinCupela Apr 17, 2024
e3b35ae
feat: add audio recording styles (#290)
MartinCupela Apr 18, 2024
c322fb7
chore(release): 4.14.0 [skip ci]
semantic-release-bot Apr 18, 2024
04e110d
fix: remove unnecessary selector specificity from font-family setting…
szuperaz Apr 25, 2024
b4d1658
feat(angular): allow customizing avatar, icon and loading indicator f…
szuperaz Apr 25, 2024
584542d
Fix ci (#293)
szuperaz Apr 25, 2024
f67dca7
chore(release): 4.15.0 [skip ci]
semantic-release-bot Apr 25, 2024
0e59ba5
feat: add styles for unsupported message attachment (#294)
MartinCupela May 9, 2024
89c48eb
chore(release): 4.16.0 [skip ci]
semantic-release-bot May 9, 2024
cdd927f
fix: allow configuring asset path for icons (#295)
szuperaz May 9, 2024
227cf8c
chore(release): 4.16.1 [skip ci]
semantic-release-bot May 9, 2024
2a13c18
feat: add avatar classes prefixed with str-chat and missing avatar st…
MartinCupela May 21, 2024
74c0e41
refactor: remove styles for React SDK dropped component ChatDown
MartinCupela May 21, 2024
45039e0
fix: add ellipsis to channel search results names
MartinCupela May 21, 2024
7991a21
feat: support textarea class str-chat__message-textarea for emoji rep…
MartinCupela May 21, 2024
e7086f4
docs: remove theme v2 references from React SDK docs
MartinCupela May 21, 2024
c28fff3
style: remove unnecessary nested selector
MartinCupela May 21, 2024
3ac5168
refactor: remove specific avatar fallback font-size rules
MartinCupela May 22, 2024
0a7dcfa
docs: keep v2 in import paths for stream-chat-react
MartinCupela May 24, 2024
ae1a74a
Merge branch 'rc' into refactor/react-remove-legacy-style-deps
MartinCupela Jun 21, 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
20 changes: 20 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test
on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Build
run: >
yarn run build:ci
- name: Generate docs
run: >
yarn run generate-docs
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,15 @@ We've recently closed a [$38 million Series B funding round](https://techcrunch.
Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.

Check out our current openings and apply via [Stream's website](https://getstream.io/team/#jobs).

## Icons - for Stream Developers

- The icons for the UI components can be exported from [Figma](https://www.figma.com/files/project/42134328/SDK-Teams-support-files?fuid=1038443988589634784)
- Icons are used as fonts, the font files are located in `src/assets/icons`
- If you need to change icons you have to regenerate the icon fonts:

1. Go to [https://fontello.com/](https://fontello.com/)
2. Upload the `svg` font from `src/assets/icons`
3. Edit the font
4. Set the font name to `stream-chat-icons` and the CSS prefix to `str-chat__icon--`
5. Download the font, and copy the content of the `font` folder to `src/assets/icons`, and copy the mapping from `css/stream-chat-icons.css` to `src/v2/Icon/Icon-layout.scss`
15 changes: 0 additions & 15 deletions doc-templates/component-variables.template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@ title: Component variables
keywords: [v2, theme-v2, theming-v2, theming, component variables]
---

import SDKSpecific from './SDKSpecific';
import V2Warning from './V2Warning';

:::info

<SDKSpecific name='angular'>
<V2Warning themingAndCSSPath='../../concepts/themeing' />
</SDKSpecific>

<SDKSpecific name='react'>
<V2Warning themingAndCSSPath='../../customization/css_and_theming' />
</SDKSpecific>

:::

CSS variables are the easiest way to customize the theme. The variables are organized into two layers:

- Global
Expand Down
13 changes: 0 additions & 13 deletions doc-templates/global-variables.template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ title: Global variables
keywords: [v2, theme-v2, theming-v2, theming, global variables]
---

import SDKSpecific from './SDKSpecific';
import V2Warning from './V2Warning';

:::info

<SDKSpecific name='angular'>
<V2Warning themingAndCSSPath='../../concepts/themeing' />
</SDKSpecific>

<SDKSpecific name='react'>
<V2Warning themingAndCSSPath='../../customization/css_and_theming' />
</SDKSpecific>
:::

CSS variables are the easiest way to customize the theme. The variables are organized into two layers:

Expand Down
17 changes: 1 addition & 16 deletions doc-templates/palette-variables.template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,8 @@ title: Palette variables
keywords: [v2, theme-v2, theming-v2, theming, palette variables]
---

import SDKSpecific from './SDKSpecific';
import V2Warning from './V2Warning';

:::info

<SDKSpecific name='angular'>
<V2Warning themingAndCSSPath='../../concepts/themeing' />
</SDKSpecific>

<SDKSpecific name='react'>
<V2Warning themingAndCSSPath='../../customization/css_and_theming' />
</SDKSpecific>

:::

A color palette is defined inside the library that used to define default values for the [global theme variables](./global-variables.mdx). If you want to work with the default theme but want to adjust the shades (for example, change `blue500` to a lighter color), you can update the palette variables. However, if you want to change the color scheme of the theme (for example, change the primary color from blue to green), you should take a look at [global theme variables](./global-variables.mdx).

[//]: # '#SLOT-autogenerated-palette-variables'

Palette variables are defined in: [https://github.com/GetStream/stream-chat-css/blob/main/src-v2/styles/\_palette-variables.scss](https://github.com/GetStream/stream-chat-css/blob/main/src-v2/styles/_palette-variables.scss)
Palette variables are defined in: [https://github.com/GetStream/stream-chat-css/blob/main/src/v2/styles/\_palette-variables.scss](https://github.com/GetStream/stream-chat-css/blob/main/src/v2/styles/_palette-variables.scss)
171 changes: 103 additions & 68 deletions docs/theming/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: themingv2
sidebar_position: 1
title: Introduction
keywords: [v2, theme-v2, theming-v2, theming, introduction]
keywords: [v2, theme-v2, theming-v2, theme, theming, introduction]
---

import SDKSpecific from './SDKSpecific';
Expand All @@ -18,46 +18,21 @@ import MessageCustomColor2Screenshot from '../assets/stream-chat-css-message-col
import ChatUiSquareThemeScreenshot from '../assets/stream-chat-css-square-theme-screenshot.png';
import ChatUiRtlScreenshot from '../assets/stream-chat-css-rtl-layout-screenshot.png';

The SDK has a new theming and customization system. This page contains information about the new version (refered to as version 2 or v2). The most significant improvements of the new version:
The SDK provides default CSS, which can be overridden by the integrators.

- Refreshed design
- Better customization through CSS variables
- Support for RTL layout

<SDKSpecific name="angular">

The [old theme](../concepts/theming-and-css.mdx) (also refered to as version 1 or v1) can still be used with the latest SDK versions, but it's now deprecated, won't be receiving further updates and will be removed in a future major release.

</SDKSpecific>

<SDKSpecific name="react">

The [old theme](../customization/css-and-theming.mdx) (also refered to as version 1 or v1) can still be used with the latest SDK versions, but it's now deprecated, won't be receiving further updates and will be removed in a future major release.

</SDKSpecific>

New theming system (v2) utilises updated markup and new class names in certain components which are being rendered based on which of the two systems you use. Most of the new components (and/or markup) aren't available in the old version (v1) due to compatibility reasons.

<SDKSpecific name="angular">

To use the new theme, please upgrade [`stream-chat-angular`](https://www.npmjs.com/package/stream-chat-angular) to version 4 and follow the instructions below.

</SDKSpecific>

<SDKSpecific name="react">

To use the new theme, please upgrade [`stream-chat-react`](https://www.npmjs.com/package/stream-chat-react) to version `10.0.2` and follow the instructions below.

</SDKSpecific>

## Using theme-v2
## Importing the stylesheet

If you're using SCSS:

<SDKSpecific name="angular">

```scss
@import '~stream-chat-angular/src/assets/styles/v2/scss/index.scss';
// stream-chat-angular@5
@import 'stream-chat-angular/src/assets/styles/scss/index.scss';

// stream-chat-angular@4
@import 'stream-chat-angular/src/assets/styles/v2/scss/index.scss';
```

</SDKSpecific>
Expand All @@ -75,7 +50,11 @@ If you're using CSS:
<SDKSpecific name="angular">

```css
@import '~stream-chat-angular/src/assets/styles/v2/css/index.css';
// stream-chat-angular@5
@import 'stream-chat-angular/src/assets/styles/css/index.css';

// stream-chat-angular@4
@import 'stream-chat-angular/src/assets/styles/v2/css/index.css';
```

</SDKSpecific>
Expand Down Expand Up @@ -111,14 +90,6 @@ Here is the default chat UI:

Here is how you can customize global variables:

<SDKSpecific name="angular">

```scss
@import '~stream-chat-angular/src/assets/styles/v2/scss/index.scss';
```

</SDKSpecific>

<SDKSpecific name="react">

```scss
Expand Down Expand Up @@ -227,18 +198,82 @@ To solve this we also have to set the text color for the link attachment compone

<img src={MessageCustomColor2Screenshot} width='500' />

### CSS overrides

If you'd like to add customizations that are not supported by CSS variables, you can override parts of the default CSS:

<SDKSpecific name="angular">
### Custom icons

#### From CSS

Starting from stream-chat-angular@5 it's possible to customize icons from CSS.

Here is an example using the [Google Material Icon library](https://fonts.google.com/icons) to override the send icon:

```scss
@import '~stream-chat-angular/src/assets/styles/v2/scss/index.scss';
// Import the icon library you want to use
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

// Override the send icon
.str-chat__icon--send::before {
font-family: 'Material Symbols Outlined';
content: '\e163';
}
```

It's also possible to use image files for icons:

```scss
.str-chat__icon--send {
&::before {
display: none;
}
// Link to your image file, or encode the image inline
content: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik0xMjAtMTYwdi02NDBsNzYwIDMyMC03NjAgMzIwWm04MC0xMjAgNDc0LTIwMC00NzQtMjAwdjE0MGwyNDAgNjAtMjQwIDYwdjE0MFptMCAwdi00MDAgNDAwWiIvPjwvc3ZnPg==');
}
```

The full list of icons used by the SDK can be found [here](https://github.com/GetStream/stream-chat-css/blob/main/src/v2/styles/Icon/Icon-layout.scss).

You can also change the size and color of the icons:

```scss
.str-chat__icon--attach {
--str-chat-icon-color: green; // Only works for font icons
--str-chat-icon-height: 60px;
}
```

#### From HTML template

If you're using stream-chat-angular@4 or an older version, or CSS customizations are not enough, you can completely replace the built-in icon component with your own using the [`CustomTemplatesService`](../../services/CustomTemplatesService/#icontemplate).

You can find a working example in the [customization sample app](https://github.com/GetStream/stream-chat-angular/blob/master/projects/customizations-example/src/app/icon/icon.component.ts).

If the default rules set by the stream-chat-angular stylesheets not enough to set the size and color of your custom icons, you can rely on the `--str-chat-icon-color`, `--str-chat-icon-height` and `--str-chat-icon-width` variables:

```
.my-custom-send-icon {
svg {
height: var(--str-chat-icon-height);
width: var(--str-chat-icon-width);

path {
fill: var(--str-chat-icon-color);
}
}
}
```

</SDKSpecific>

<SDKSpecific name="todo-react">
### Custom icons

</SDKSpecific>

### CSS overrides

If you'd like to add customizations that are not supported by CSS variables, you can override parts of the default CSS:

<SDKSpecific name="react">

```scss
Expand All @@ -261,11 +296,19 @@ If you're using SCSS it's also possible to import component stylesheets separate
<SDKSpecific name="angular">

```scss
// stream-chat-angular@5
// Use default theme for channel list and channel preview components
@import '~stream-chat-angular/src/assets/styles/v2/scss/ChannelList/ChannelList-layout.scss';
@import '~stream-chat-angular/src/assets/styles/v2/scss/ChannelList/ChannelList-theme.scss';
@import '~stream-chat-angular/src/assets/styles/v2/scss/ChannelPreview/ChannelPreview-layout.scss';
@import '~stream-chat-angular/src/assets/styles/v2/scss/ChannelPreview/ChannelPreview-theme.scss';
@import 'stream-chat-angular/src/assets/styles/scss/ChannelList/ChannelList-layout.scss';
@import 'stream-chat-angular/src/assets/styles/scss/ChannelList/ChannelList-theme.scss';
@import 'stream-chat-angular/src/assets/styles/scss/ChannelPreview/ChannelPreview-layout.scss';
@import 'stream-chat-angular/src/assets/styles/scss/ChannelPreview/ChannelPreview-theme.scss';

// stream-chat-angular@4
// Use default theme for channel list and channel preview components
@import 'stream-chat-angular/src/assets/styles/v2/scss/ChannelList/ChannelList-layout.scss';
@import 'stream-chat-angular/src/assets/styles/v2/scss/ChannelList/ChannelList-theme.scss';
@import 'stream-chat-angular/src/assets/styles/v2/scss/ChannelPreview/ChannelPreview-layout.scss';
@import 'stream-chat-angular/src/assets/styles/v2/scss/ChannelPreview/ChannelPreview-theme.scss';
```

</SDKSpecific>
Expand Down Expand Up @@ -297,7 +340,11 @@ Here is how you can import the layout stylesheet:
<SDKSpecific name="angular">

```scss
@import '~stream-chat-angular/src/assets/styles/v2/scss/index.layout.scss';
// stream-chat-angular@5
@import 'stream-chat-angular/src/assets/styles/scss/index.layout.scss';

// stream-chat-angular@4
@import 'stream-chat-angular/src/assets/styles/v2/scss/index.layout.scss';
```

</SDKSpecific>
Expand All @@ -315,7 +362,11 @@ or if you're using CSS:
<SDKSpecific name="angular">

```css
@import '~stream-chat-angular/src/assets/styles/v2/css/index.layout.css';
// stream-chat-angular@5
@import 'stream-chat-angular/src/assets/styles/css/index.layout.css';

// stream-chat-angular@4
@import 'stream-chat-angular/src/assets/styles/v2/css/index.layout.css';
```

</SDKSpecific>
Expand Down Expand Up @@ -407,14 +458,6 @@ The `str-chat__theme-dark`/`str-chat__theme-light` class is applied to the [Chan

Here is how you can provide different color configurations for the dark and light themes:

<SDKSpecific name="angular">

```scss
@import '~stream-chat-angular/src/assets/styles/v2/scss/index.scss';
```

</SDKSpecific>

<SDKSpecific name="react">

```scss
Expand Down Expand Up @@ -459,14 +502,6 @@ It's possible to extend the existing themes with your own themes.

Here is an example creating 'round' and 'square' themes:

<SDKSpecific name="angular">

```scss
@import '~stream-chat-angular/src/assets/styles/v2/scss/index.scss';
```

</SDKSpecific>

<SDKSpecific name="react">

```scss
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stream-io/stream-chat-css",
"version": "4.0.0-rc.5",
"version": "5.0.0-rc.1",
"main": "dist/css/index.css",
"description": "Bundled CSS for Stream Chat web SDKs",
"repository": "git@github.com:GetStream/stream-chat-css.git",
Expand Down
Loading
Loading