quickblox-react-ui-kit 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +258 -255
  2. package/dist/App.d.ts +1 -2
  3. package/dist/Presentation/Views/Dialogs/Dialogs.d.ts +3 -0
  4. package/dist/Presentation/Views/Dialogs/useDialogsViewModel.d.ts +3 -1
  5. package/dist/Presentation/{components/UI → assets}/ DefaultThemes/DefaultTheme.d.ts +2 -2
  6. package/dist/Presentation/assets/DarkTheme.d.ts +2 -2
  7. package/dist/Presentation/assets/LightTheme.d.ts +2 -2
  8. package/dist/Presentation/assets/{Theme.d.ts → UiKitTheme.d.ts} +1 -1
  9. package/dist/Presentation/components/Button.d.ts +1 -1
  10. package/dist/Presentation/components/Navbar.d.ts +1 -2
  11. package/dist/Presentation/components/TextInput.d.ts +1 -1
  12. package/dist/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.d.ts +2 -2
  13. package/dist/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.d.ts +2 -0
  14. package/dist/Presentation/components/UI/Dialogs/MessagesView/MessagesView.d.ts +2 -0
  15. package/dist/Presentation/components/UI/Dialogs/MessagesView/{useMessagesViewModelWithMockUseCase.d.ts → useMessagesViewModel.d.ts} +1 -1
  16. package/dist/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.d.ts +2 -2
  17. package/dist/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.d.ts +1 -2
  18. package/dist/Presentation/components/UI/svgs/Icons/Actions/Add/index.d.ts +1 -2
  19. package/dist/Presentation/components/UI/svgs/Icons/Actions/AddContact/index.d.ts +1 -2
  20. package/dist/Presentation/components/UI/svgs/Icons/Actions/Archive/index.d.ts +1 -2
  21. package/dist/Presentation/components/UI/svgs/Icons/Actions/Copy/index.d.ts +1 -2
  22. package/dist/Presentation/components/UI/svgs/Icons/Actions/Delete/index.d.ts +1 -2
  23. package/dist/Presentation/components/UI/svgs/Icons/Actions/Download/index.d.ts +1 -2
  24. package/dist/Presentation/components/UI/svgs/Icons/Actions/Edit/index.d.ts +1 -2
  25. package/dist/Presentation/components/UI/svgs/Icons/Actions/EditDots/index.d.ts +1 -2
  26. package/dist/Presentation/components/UI/svgs/Icons/Actions/Emoji/index.d.ts +1 -2
  27. package/dist/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/index.d.ts +1 -2
  28. package/dist/Presentation/components/UI/svgs/Icons/Actions/Hungup/index.d.ts +1 -2
  29. package/dist/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/index.d.ts +1 -2
  30. package/dist/Presentation/components/UI/svgs/Icons/Actions/Like/index.d.ts +1 -2
  31. package/dist/Presentation/components/UI/svgs/Icons/Actions/NewChat/index.d.ts +1 -2
  32. package/dist/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/index.d.ts +1 -2
  33. package/dist/Presentation/components/UI/svgs/Icons/Actions/Phone/index.d.ts +1 -2
  34. package/dist/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/index.d.ts +1 -2
  35. package/dist/Presentation/components/UI/svgs/Icons/Actions/Remove/index.d.ts +1 -2
  36. package/dist/Presentation/components/UI/svgs/Icons/Actions/Remove2/index.d.ts +1 -2
  37. package/dist/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/index.d.ts +1 -2
  38. package/dist/Presentation/components/UI/svgs/Icons/Actions/Send/index.d.ts +1 -2
  39. package/dist/Presentation/components/UI/svgs/Icons/Actions/Share/index.d.ts +1 -2
  40. package/dist/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/index.d.ts +1 -2
  41. package/dist/Presentation/components/UI/svgs/Icons/Actions/Unarchive/index.d.ts +1 -2
  42. package/dist/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/index.d.ts +1 -2
  43. package/dist/Presentation/components/UI/svgs/Icons/Actions/Voice/index.d.ts +1 -2
  44. package/dist/Presentation/components/UI/svgs/Icons/Contents/Brodcast/index.d.ts +1 -2
  45. package/dist/Presentation/components/UI/svgs/Icons/Contents/Chat/index.d.ts +1 -2
  46. package/dist/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/index.d.ts +1 -2
  47. package/dist/Presentation/components/UI/svgs/Icons/Contents/Conference/index.d.ts +1 -2
  48. package/dist/Presentation/components/UI/svgs/Icons/Contents/Contact/index.d.ts +1 -2
  49. package/dist/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/index.d.ts +1 -2
  50. package/dist/Presentation/components/UI/svgs/Icons/Contents/GroupChat/index.d.ts +1 -2
  51. package/dist/Presentation/components/UI/svgs/Icons/Contents/Notifications/index.d.ts +1 -2
  52. package/dist/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/index.d.ts +1 -2
  53. package/dist/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/index.d.ts +1 -2
  54. package/dist/Presentation/components/UI/svgs/Icons/Contents/Stream/index.d.ts +1 -2
  55. package/dist/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/index.d.ts +1 -2
  56. package/dist/Presentation/components/UI/svgs/Icons/Contents/User/index.d.ts +1 -2
  57. package/dist/Presentation/components/UI/svgs/Icons/Media/Attachment/index.d.ts +1 -2
  58. package/dist/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.d.ts +1 -2
  59. package/dist/Presentation/components/UI/svgs/Icons/Media/BrokenFile/index.d.ts +1 -2
  60. package/dist/Presentation/components/UI/svgs/Icons/Media/Camera/index.d.ts +1 -2
  61. package/dist/Presentation/components/UI/svgs/Icons/Media/GifFile/index.d.ts +1 -2
  62. package/dist/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.d.ts +1 -2
  63. package/dist/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.d.ts +1 -2
  64. package/dist/Presentation/components/UI/svgs/Icons/Media/ImageFilled/index.d.ts +1 -2
  65. package/dist/Presentation/components/UI/svgs/Icons/Media/LinkWeb/index.d.ts +1 -2
  66. package/dist/Presentation/components/UI/svgs/Icons/Media/Location/index.d.ts +1 -2
  67. package/dist/Presentation/components/UI/svgs/Icons/Media/TextDocument/index.d.ts +1 -2
  68. package/dist/Presentation/components/UI/svgs/Icons/Media/VideoFile/index.d.ts +1 -2
  69. package/dist/Presentation/components/UI/svgs/Icons/Moderation/Admin/index.d.ts +1 -2
  70. package/dist/Presentation/components/UI/svgs/Icons/Moderation/Banned/index.d.ts +1 -2
  71. package/dist/Presentation/components/UI/svgs/Icons/Moderation/Freeze/index.d.ts +1 -2
  72. package/dist/Presentation/components/UI/svgs/Icons/Moderation/Moderations/index.d.ts +1 -2
  73. package/dist/Presentation/components/UI/svgs/Icons/Moderation/Muted/index.d.ts +1 -2
  74. package/dist/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/index.d.ts +1 -2
  75. package/dist/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/index.d.ts +1 -2
  76. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Back/index.d.ts +1 -2
  77. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Close/index.d.ts +1 -2
  78. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Down/index.d.ts +1 -2
  79. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Leave/index.d.ts +1 -2
  80. package/dist/Presentation/components/UI/svgs/Icons/Navigation/More/index.d.ts +1 -2
  81. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Next/index.d.ts +1 -2
  82. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Plus/index.d.ts +1 -2
  83. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Refresh/index.d.ts +1 -2
  84. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Search/index.d.ts +1 -2
  85. package/dist/Presentation/components/UI/svgs/Icons/Navigation/Settings/index.d.ts +1 -2
  86. package/dist/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/index.d.ts +1 -2
  87. package/dist/Presentation/components/UI/svgs/Icons/Status/Error/index.d.ts +1 -2
  88. package/dist/Presentation/components/UI/svgs/Icons/Status/Help/index.d.ts +1 -2
  89. package/dist/Presentation/components/UI/svgs/Icons/Status/Information/index.d.ts +1 -2
  90. package/dist/Presentation/components/UI/svgs/Icons/Status/InformationFill/index.d.ts +1 -2
  91. package/dist/Presentation/components/UI/svgs/Icons/Status/Loader/index.d.ts +1 -2
  92. package/dist/Presentation/components/UI/svgs/Icons/Status/Mention/index.d.ts +1 -2
  93. package/dist/Presentation/components/UI/svgs/Icons/Status/Sent/index.d.ts +1 -2
  94. package/dist/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.d.ts +1 -2
  95. package/dist/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/index.d.ts +1 -2
  96. package/dist/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/index.d.ts +1 -2
  97. package/dist/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/index.d.ts +1 -2
  98. package/dist/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/index.d.ts +1 -2
  99. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Favourite/index.d.ts +1 -2
  100. package/dist/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/index.d.ts +1 -2
  101. package/dist/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/inex.d.ts +1 -2
  102. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Hide/index.d.ts +1 -2
  103. package/dist/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.d.ts +1 -2
  104. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Louder/index.d.ts +1 -2
  105. package/dist/Presentation/components/UI/svgs/Icons/Toggle/MicOff/index.d.ts +1 -2
  106. package/dist/Presentation/components/UI/svgs/Icons/Toggle/MicOn/index.d.ts +1 -2
  107. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Minimize/index.d.ts +1 -2
  108. package/dist/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/index.d.ts +1 -2
  109. package/dist/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/index.d.ts +1 -2
  110. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Pause/index.d.ts +1 -2
  111. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Quite/index.d.ts +1 -2
  112. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Record/index.d.ts +1 -2
  113. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/index.d.ts +1 -2
  114. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Show/index.d.ts +1 -2
  115. package/dist/Presentation/components/UI/svgs/Icons/Toggle/Speaker/index.d.ts +1 -2
  116. package/dist/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/index.d.ts +1 -2
  117. package/dist/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/index.d.ts +1 -2
  118. package/dist/Presentation/components/UI/svgs/Icons/Toggle/StopShare/index.d.ts +1 -2
  119. package/dist/Presentation/components/containers/ScrollableContainer/ScrollableContainer.d.ts +1 -1
  120. package/dist/Presentation/components/layouts/Desktop/{DesktopLayoutForMockModels.d.ts → DesktopLayout.d.ts} +2 -2
  121. package/dist/Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout.d.ts +7 -0
  122. package/dist/Presentation/components/layouts/TestStage/TestStageMarkup.d.ts +1 -2
  123. package/dist/Presentation/components/providers/ModalContextProvider/Modal.d.ts +1 -1
  124. package/dist/Presentation/components/providers/ModalContextProvider/ModalContextProvider.d.ts +1 -2
  125. package/dist/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.d.ts +1 -1
  126. package/dist/index-ui.d.ts +4 -5
  127. package/dist/index-ui.js +343 -398
  128. package/package.json +1 -1
  129. package/src/App.tsx +14 -7
  130. package/src/Presentation/Views/Dialogs/Dialogs.tsx +3 -0
  131. package/src/Presentation/Views/Dialogs/useDialogsViewModel.ts +254 -50
  132. package/src/Presentation/{components/UI → assets}/ DefaultThemes/DefaultTheme.ts +2 -2
  133. package/src/Presentation/assets/DarkTheme.ts +2 -2
  134. package/src/Presentation/assets/LightTheme.ts +2 -2
  135. package/src/Presentation/assets/{Theme.ts → UiKitTheme.ts} +2 -2
  136. package/src/Presentation/components/UI/Buttons/MainButton/MainButton.scss +8 -8
  137. package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.tsx +1 -1
  138. package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.tsx +2 -2
  139. package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.tsx +4 -0
  140. package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx +9 -3
  141. package/src/Presentation/components/UI/Dialogs/MessagesView/{useMessagesViewModelWithMockUseCase.ts → useMessagesViewModel.ts} +4 -6
  142. package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.tsx +2 -2
  143. package/src/Presentation/components/layouts/Desktop/{DesktopLayoutForMockModels.tsx → DesktopLayout.tsx} +2 -2
  144. package/src/Presentation/components/layouts/{TestStage/TestStageWithMockData/TestStageWithMockData.tsx → Desktop/QuickBloxUIKitDesktopLayout.tsx} +37 -29
  145. package/src/Presentation/components/layouts/TestStage/TestStageMarkup.tsx +1 -1
  146. package/src/QBconfig.ts +0 -8
  147. package/src/index-ui.ts +6 -8
  148. package/dist/MyButton/MyButton.d.ts +0 -9
  149. package/dist/MyInput/MyInput.d.ts +0 -10
  150. package/dist/Presentation/Views/Dialogs/useDialogsViewModelWithMockUseCase.d.ts +0 -4
  151. package/dist/Presentation/components/layouts/Desktop/Desktop.d.ts +0 -4
  152. package/dist/Presentation/components/layouts/TestStage/TestStageWithMockData/TestStageWithMockData.d.ts +0 -3
  153. package/src/MyButton/MyButton.scss +0 -11
  154. package/src/MyButton/MyButton.tsx +0 -25
  155. package/src/MyInput/MyInput.scss +0 -9
  156. package/src/MyInput/MyInput.tsx +0 -36
  157. package/src/Presentation/Views/Dialogs/useDialogsViewModelWithMockUseCase.ts +0 -345
  158. package/src/Presentation/components/layouts/Desktop/Desktop.tsx +0 -103
  159. /package/dist/Presentation/{components/UI → assets}/ DefaultThemes/CustomTheme.d.ts +0 -0
  160. /package/src/Presentation/{components/UI → assets}/ DefaultThemes/CustomTheme.ts +0 -0
package/README.md CHANGED
@@ -1,255 +1,258 @@
1
- # Overview
2
-
3
- The QuickBlox UIKit for React is a comprehensive user interface kit specifically designed for building chat applications. It provides a collection of pre-built components, modules, and utilities that simplify the process of creating chat applications.
4
-
5
- The main goal of the QuickBlox UIKit for React is to offer developers a streamlined and efficient way to implement chat functionality within their React applications.
6
-
7
- The QuickBlox UIKit for React offers modules that encapsulate complex chat functionalities, such as dialogs and chat management and real-time updates. These modules provide a simplified interface for integrating chat features into applications without the need for extensive knowledge of the underlying protocols or server-side infrastructure.
8
-
9
- ## Features
10
-
11
- QuickBlox UIKit for React provides next functionality:
12
- - List of dialogs
13
- - Create dialog(Private or Group)
14
- - Dialog screen
15
- - Send text, image, video, audio, file messages
16
- - Dialog info screen
17
- - List, invite, remove members
18
-
19
- # Send your first message
20
-
21
- The QuickBlox UIKit for React comprises a collection of pre-assembled UI components that enable effortless creation of an in-app chat equipped with all the necessary messaging functionalities. Our development kit encompasses light and dark themes, colors, and various other features. These components can be personalized to fashion an engaging messaging interface that reflects your brand's distinct identity.
22
-
23
- The QuickBlox UIKit fully supports both private and group dialogs. To initiate the process of sending a message from the ground up using Java or Kotlin, please refer to the instructions provided in the guide below.
24
-
25
- ## Requirements
26
-
27
- The minimum requirements for QuickBlox UIKit for React are:
28
- - JS QuickBlox SDK v2.15.5
29
- - React v.18.0
30
- - TypeScript v.4.9.3
31
-
32
- # Before you begin
33
-
34
- Register a new account following [this link](https://admin.quickblox.com/signup). Type in your email and password to sign in. You can also sign in with your Google or Github accounts.
35
- Create the app clicking New app button.
36
- Configure the app. Type in the information about your organization into corresponding fields and click Add button.
37
- Go to Dashboard => YOUR_APP => Overview section and copy your Application ID, Authorization Key, Authorization Secret, and Account Key .
38
-
39
- ## Install QuickBlox SDK
40
-
41
- ```
42
- npm install quickblox
43
- ```
44
-
45
- ## Install QuickBlox UIKit
46
-
47
- ```
48
- npm install quickblox-react-ui-kit
49
- ```
50
-
51
- ## Init QuickBlox SDK
52
-
53
- To init QuickBlox SDK you need to pass Application ID, Authorization Key, Authorization Secret, and Account Key to the init() method.
54
-
55
- ```
56
- var APPLICATION_ID = 41;
57
- var AUTH_KEY = "lkjdueksu7392kj";
58
- var AUTH_SECRET = "iiohfdija792hj";
59
- var ACCOUNT_KEY = "sdjfnksnlk2bk1k34kb";
60
- var CONFIG = { debug: true };
61
-
62
- QB.init(APPLICATION_ID, AUTH_KEY, AUTH_SECRET, ACCOUNT_KEY, CONFIG);
63
- ```
64
-
65
- ## Authentication
66
-
67
- Before sending your first message you need to authenticate users in the QuickBlox system. You can read more about different ways of authentication by [this link](https://docs.quickblox.com/docs/js-authentication).
68
- In our example we show how to authenticate user with login and password.
69
-
70
- ```
71
- import * as QB from "quickblox/quickblox";
72
- import { QuickBloxUIKitProvider } from 'quickblox-ui-kit-react/dist/index-ui';
73
-
74
- var params = { login: "garry", password: "garry5santos" };
75
-
76
- QB.login(params, function(error, result) {
77
- if(error){
78
- } else {
79
- // Navigate User to the UIKit
80
- });
81
- ```
82
- To order to config quickblox ui kit provider
83
- ```
84
- <QuickBloxUIKitProvider
85
- maxFileSize={100 * 1000000} //set max size for attachments
86
- >
87
- <Desktop> // container for DesktopLayout
88
- </QuickBloxUIKitProvider>
89
- ```
90
-
91
- # Customization
92
-
93
- The QuickBlox UIKit for React allows you to create your own unique view of the UIKit.
94
-
95
- ## Default themes
96
- The QuickBlox UIKit for React has 2 built in themes: Dark and Light.
97
- Default theme for UIKit is Light.
98
- To set theme you need to set value 'dark' to key data-theme in global styles (html[data-theme="dark”]).
99
- For example, you can use pure JavaScript:
100
-
101
- ```
102
- document.documentElement.setAttribute('data-theme', 'dark');
103
- ```
104
-
105
- ## Use your own theme
106
-
107
- There are two options how you can create your own theme:
108
- - Customize current theme using css
109
- - Create your own theme to customize selected components
110
-
111
- To customize the current theme you just need to set the new colors in css variables.
112
-
113
- Or you can create your own theme. To do this you need to create a new class that implements the UiKitTheme interface.
114
-
115
- To use your own theme using css you need to create _theme_colors_scheme.scss and set colors
116
- ```
117
- $background-overlay-light: rgba(19, 29, 40, .80);
118
- $background-overlay-dark: rgba(144, 151, 159, .80);
119
- $primary-50: #E7EFFF;
120
- $primary-100: #C4D7FE;
121
- $primary-200: #9CBCFE;
122
- $primary-300: #74A1FD;
123
- $primary-400: #578CFC;
124
- $primary-500: #3978FC;
125
- $primary-600: #3370FC;
126
- $primary-700: #2C65FB;
127
- $primary-800: #245BFB;
128
- $primary-900: #1748FA;
129
- $primary-a-100: #FFFFFF;
130
- $primary-a-200: #F7F9FF;
131
- $primary-a-400: #C4CFFF;
132
- $primary-a-700: #ABBAFF;
133
- $secondary-50: #E4E6E8;
134
- $secondary-100: #BCC1C5;
135
- $secondary-200: #90979F;
136
- $secondary-300: #636D78;
137
- $secondary-400: #414E5B;
138
- $secondary-500: #202F3E;
139
- $secondary-600: #1C2A38;
140
- $secondary-700: #182330;
141
- $secondary-800: #131D28;
142
- $secondary-900: #0B121B;
143
- $secondary-a-100: #74A1FD;
144
- $secondary-a-200: #3978FC;
145
- $secondary-a-400: #245BFB;
146
- $secondary-a-700: #0050DC;
147
- $system-green-100: #C8F1D6;
148
- $system-green-200: #A4E7BB;
149
- $system-green-300: #80DDA0;
150
- $system-green-400: #64D68B;
151
- $system-green-500: #49CF77;
152
- $error-100: #FFC4C1;
153
- $error-200: #FF9D98;
154
- $error-300: #FF766E;
155
- $error-400: #FF584F;
156
- $error-500: #FF3B30;
157
- $information: #FDB0FF;
158
- $highlight: #FFFDC1;
159
-
160
- ```
161
- To use your own new theme colors create _theme_dark.scss and _theme_light.scss files and set color variable.
162
- ```
163
- // _theme_dark.scss:
164
-
165
- html[data-theme="dark"]{
166
- --color-background-info: #{$primary-500};
167
- --tertiary-elements: #{$background-overlay-dark};
168
- --main-elements: #{$primary-300};
169
- --secondary-elements: #{$primary-a-100};
170
- --input-elements: #{$secondary-200};
171
- --disabled-elements: #{$secondary-300};
172
- --field-border: #{$secondary-200};
173
- --main-text: #{$primary-a-100};
174
- --secondary-text: #{$secondary-200};
175
- --caption: #{$secondary-100};
176
- --main-background: #{$secondary-500};
177
- --secondary-background: #{$secondary-800};
178
- --incoming-background: #{$secondary-400};
179
- --outgoing-background: #{$primary-500};
180
- --dropdown-background: #{$secondary-400};
181
- --chat-input: #{$secondary-800};
182
- --divider: #{$secondary-400};
183
- --error: #{$error-300};
184
- --hightlight: #{$highlight};
185
- }
186
-
187
- // _theme_light.scss:
188
- :root{
189
- --color-background-info:#{$primary-100};
190
- --tertiary-elements: #{$secondary-300};
191
- --main-elements: #{$primary-500};
192
- --secondary-elements: #{$secondary-500};
193
- --input-elements: #{$secondary-500};
194
- --disabled-elements: #{$secondary-100};
195
- --field-border: #{$secondary-200};
196
- --main-text: #{$secondary-900};
197
- --secondary-text: #{$secondary-300};
198
- --caption: #{$secondary-200};
199
- --main-background: #{$primary-a-100};
200
- --secondary-background: #{$primary-a-100};
201
- --secondary-background-modal: #{$background-overlay-light};
202
- --incoming-background: #{$secondary-50};
203
- --outgoing-background: #{$primary-50};
204
- --dropdown-background: #{$primary-a-100};
205
- --chat-input: #{$primary-a-200};
206
- --divider: #{$primary-50};
207
- --error: #{$error-500};
208
- --hightlight: #{$highlight};
209
- }
210
- ```
211
- To create your own theme to customize selected components you need to create a new class that implements the UiKitTheme interface.
212
- ```
213
- //DefaultTheme implements UiKitTheme
214
- export default class CustomTheme extends DefaultTheme {
215
- divider = (): string => 'var(--divider)';
216
- mainText = (): string => '#FFFFFF';
217
- fontFamily = (): string => 'Roboto';
218
- /*
219
- The DefaultTheme contains other theme methods :
220
- caption = (): string => 'var(--caption)';
221
- chatInput = (): string => 'var(--chat-input)';
222
- disabledElements = (): string => 'var(--disabled-elements)';
223
- dropdownBackground = (): string => 'var(--dropdown-background)';
224
- error = (): string => 'var(--error)';
225
- fieldBorder = (): string => 'var(--field-border)';
226
- hightlight = (): string => 'var(--hightlight)';
227
- incomingBackground = (): string => 'var(--incoming-background)';
228
- inputElements = (): string => 'var(--input-elements)';
229
- mainBackground = (): string => 'var(--main-background)';
230
- mainElements = (): string => 'var(--main-elements)';
231
- outgoingBackground = (): string => 'var(--outgoing-background)';
232
- secondaryBackground = (): string => 'var(--secondary-background)';
233
- secondaryElements = (): string => 'var(--secondary-elements)';
234
- secondaryText = (): string => 'var(--secondary-text)';
235
- */
236
- }
237
- ```
238
- and specify selected components:
239
- - desktop layout container
240
- ```
241
- <QuickBloxUIKitDesktopLayout theme={new CustomTheme()}>
242
- ```
243
- - header of dialogs
244
- ```
245
- <HeaderDialogs title="Dialog 2" theme={new CustomTheme()} />
246
- ```
247
- - item of dialogs
248
- ```
249
- <PreviewDialog
250
- theme={{ selected: true, muted: true, colorTheme={new CustomTheme()} }}
251
- title="Dialog with states"
252
- unreadMessageCount={9}
253
- message_date_time_sent="5 min ago"
254
- />
255
- ```
1
+ # Overview
2
+
3
+ The QuickBlox UIKit for React is a comprehensive user interface kit specifically designed for building chat applications. It provides a collection of pre-built components, modules, and utilities that simplify the process of creating chat applications.
4
+
5
+ The main goal of the QuickBlox UIKit for React is to offer developers a streamlined and efficient way to implement chat functionality within their React applications.
6
+
7
+ The QuickBlox UIKit for React offers modules that encapsulate complex chat functionalities, such as dialogs and chat management and real-time updates. These modules provide a simplified interface for integrating chat features into applications without the need for extensive knowledge of the underlying protocols or server-side infrastructure.
8
+
9
+ ## Features
10
+
11
+ QuickBlox UIKit for React provides next functionality:
12
+ - List of dialogs
13
+ - Create dialog(Private or Group)
14
+ - Dialog screen
15
+ - Send text, image, video, audio, file messages
16
+ - Dialog info screen
17
+ - List, invite, remove members
18
+
19
+ # Send your first message
20
+
21
+ The QuickBlox UIKit for React comprises a collection of pre-assembled UI components that enable effortless creation of an in-app chat equipped with all the necessary messaging functionalities. Our development kit encompasses light and dark themes, colors, and various other features. These components can be personalized to fashion an engaging messaging interface that reflects your brand's distinct identity.
22
+
23
+ The QuickBlox UIKit fully supports both private and group dialogs. To initiate the process of sending a message from the ground up using Java or Kotlin, please refer to the instructions provided in the guide below.
24
+
25
+ ## Requirements
26
+
27
+ The minimum requirements for QuickBlox UIKit for React are:
28
+ - JS QuickBlox SDK v2.15.5
29
+ - React v.18.0
30
+ - TypeScript v.4.9.3
31
+
32
+ # Before you begin
33
+
34
+ Register a new account following [this link](https://admin.quickblox.com/signup). Type in your email and password to sign in. You can also sign in with your Google or Github accounts.
35
+ Create the app clicking New app button.
36
+ Configure the app. Type in the information about your organization into corresponding fields and click Add button.
37
+ Go to Dashboard => YOUR_APP => Overview section and copy your Application ID, Authorization Key, Authorization Secret, and Account Key .
38
+
39
+ ## Install QuickBlox SDK
40
+
41
+ ```
42
+ npm install quickblox
43
+ ```
44
+
45
+ ## Install QuickBlox UIKit
46
+
47
+ ```
48
+ npm install quickblox-react-ui-kit
49
+ ```
50
+
51
+ ## Init QuickBlox SDK
52
+
53
+ To init QuickBlox SDK you need to pass Application ID, Authorization Key, Authorization Secret, and Account Key to the init() method.
54
+
55
+ ```
56
+ var APPLICATION_ID = 41;
57
+ var AUTH_KEY = "lkjdueksu7392kj";
58
+ var AUTH_SECRET = "iiohfdija792hj";
59
+ var ACCOUNT_KEY = "sdjfnksnlk2bk1k34kb";
60
+ var CONFIG = { debug: true };
61
+
62
+ QB.init(APPLICATION_ID, AUTH_KEY, AUTH_SECRET, ACCOUNT_KEY, CONFIG);
63
+ ```
64
+
65
+ ## Authentication
66
+
67
+ Before sending your first message you need to authenticate users in the QuickBlox system. You can read more about different ways of authentication by [this link](https://docs.quickblox.com/docs/js-authentication).
68
+ In our example we show how to authenticate user with login and password.
69
+
70
+ ```
71
+ import * as QB from "quickblox/quickblox";
72
+ import { QuickBloxUIKitProvider } from 'quickblox-ui-kit-react/dist/index-ui';
73
+
74
+ var params = { login: "garry", password: "garry5santos" };
75
+
76
+ QB.login(params, function(error, result) {
77
+ if(error){
78
+ } else {
79
+ // Navigate User to the UIKit
80
+ });
81
+ ```
82
+ To order to config quickblox ui kit provider
83
+ ```
84
+ <QuickBloxUIKitProvider
85
+ maxFileSize={100 * 1000000} //set max size for attachments
86
+ >
87
+ <Desktop> // container for DesktopLayout
88
+ </QuickBloxUIKitProvider>
89
+ ```
90
+
91
+ # Customization
92
+
93
+ The QuickBlox UIKit for React allows you to create your own unique view of the UIKit.
94
+
95
+ ## Default themes
96
+ The QuickBlox UIKit for React has 2 built in themes: Dark and Light.
97
+ Default theme for UIKit is Light.
98
+ To set theme you need to set value 'dark' to key data-theme in global styles (html[data-theme="dark”]).
99
+ For example, you can use pure JavaScript:
100
+
101
+ ```
102
+ document.documentElement.setAttribute('data-theme', 'dark');
103
+ ```
104
+
105
+ ## Use your own theme
106
+
107
+ There are two options how you can create your own theme:
108
+ - Customize current theme using css
109
+ - Create your own theme to customize selected components
110
+
111
+ To customize the current theme you just need to set the new colors in css variables.
112
+
113
+ Or you can create your own theme. To do this you need to create a new class that implements the UiKitTheme interface.
114
+
115
+ To use your own theme using css you need to create _theme_colors_scheme.scss and set colors
116
+ ```
117
+ $background-overlay-light: rgba(19, 29, 40, .80);
118
+ $background-overlay-dark: rgba(144, 151, 159, .80);
119
+ $primary-50: #E7EFFF;
120
+ $primary-100: #C4D7FE;
121
+ $primary-200: #9CBCFE;
122
+ $primary-300: #74A1FD;
123
+ $primary-400: #578CFC;
124
+ $primary-500: #3978FC;
125
+ $primary-600: #3370FC;
126
+ $primary-700: #2C65FB;
127
+ $primary-800: #245BFB;
128
+ $primary-900: #1748FA;
129
+ $primary-a-100: #FFFFFF;
130
+ $primary-a-200: #F7F9FF;
131
+ $primary-a-400: #C4CFFF;
132
+ $primary-a-700: #ABBAFF;
133
+ $secondary-50: #E4E6E8;
134
+ $secondary-100: #BCC1C5;
135
+ $secondary-200: #90979F;
136
+ $secondary-300: #636D78;
137
+ $secondary-400: #414E5B;
138
+ $secondary-500: #202F3E;
139
+ $secondary-600: #1C2A38;
140
+ $secondary-700: #182330;
141
+ $secondary-800: #131D28;
142
+ $secondary-900: #0B121B;
143
+ $secondary-a-100: #74A1FD;
144
+ $secondary-a-200: #3978FC;
145
+ $secondary-a-400: #245BFB;
146
+ $secondary-a-700: #0050DC;
147
+ $system-green-100: #C8F1D6;
148
+ $system-green-200: #A4E7BB;
149
+ $system-green-300: #80DDA0;
150
+ $system-green-400: #64D68B;
151
+ $system-green-500: #49CF77;
152
+ $error-100: #FFC4C1;
153
+ $error-200: #FF9D98;
154
+ $error-300: #FF766E;
155
+ $error-400: #FF584F;
156
+ $error-500: #FF3B30;
157
+ $information: #FDB0FF;
158
+ $highlight: #FFFDC1;
159
+
160
+ ```
161
+ To use your own new theme colors create _theme_dark.scss and _theme_light.scss files and set color variable.
162
+ ```
163
+ // _theme_dark.scss:
164
+
165
+ html[data-theme="dark"]{
166
+ --color-background-info: #{$primary-500};
167
+ --tertiary-elements: #{$background-overlay-dark};
168
+ --main-elements: #{$primary-300};
169
+ --secondary-elements: #{$primary-a-100};
170
+ --input-elements: #{$secondary-200};
171
+ --disabled-elements: #{$secondary-300};
172
+ --field-border: #{$secondary-200};
173
+ --main-text: #{$primary-a-100};
174
+ --secondary-text: #{$secondary-200};
175
+ --caption: #{$secondary-100};
176
+ --main-background: #{$secondary-500};
177
+ --secondary-background: #{$secondary-800};
178
+ --incoming-background: #{$secondary-400};
179
+ --outgoing-background: #{$primary-500};
180
+ --dropdown-background: #{$secondary-400};
181
+ --chat-input: #{$secondary-800};
182
+ --divider: #{$secondary-400};
183
+ --error: #{$error-300};
184
+ --hightlight: #{$highlight};
185
+ }
186
+
187
+ // _theme_light.scss:
188
+ :root{
189
+ --color-background-info:#{$primary-100};
190
+ --tertiary-elements: #{$secondary-300};
191
+ --main-elements: #{$primary-500};
192
+ --secondary-elements: #{$secondary-500};
193
+ --input-elements: #{$secondary-500};
194
+ --disabled-elements: #{$secondary-100};
195
+ --field-border: #{$secondary-200};
196
+ --main-text: #{$secondary-900};
197
+ --secondary-text: #{$secondary-300};
198
+ --caption: #{$secondary-200};
199
+ --main-background: #{$primary-a-100};
200
+ --secondary-background: #{$primary-a-100};
201
+ --secondary-background-modal: #{$background-overlay-light};
202
+ --incoming-background: #{$secondary-50};
203
+ --outgoing-background: #{$primary-50};
204
+ --dropdown-background: #{$primary-a-100};
205
+ --chat-input: #{$primary-a-200};
206
+ --divider: #{$primary-50};
207
+ --error: #{$error-500};
208
+ --hightlight: #{$highlight};
209
+ }
210
+ ```
211
+ To create your own theme to customize selected components you need to create a new class that implements the UiKitTheme interface.
212
+ ```
213
+ //DefaultTheme implements UiKitTheme
214
+ export default class CustomTheme extends DefaultTheme {
215
+ divider = (): string => 'var(--divider)';
216
+ mainText = (): string => '#FFFFFF';
217
+ fontFamily = (): string => 'Roboto';
218
+ /*
219
+ The DefaultTheme contains other theme methods :
220
+ caption = (): string => 'var(--caption)';
221
+ chatInput = (): string => 'var(--chat-input)';
222
+ disabledElements = (): string => 'var(--disabled-elements)';
223
+ dropdownBackground = (): string => 'var(--dropdown-background)';
224
+ error = (): string => 'var(--error)';
225
+ fieldBorder = (): string => 'var(--field-border)';
226
+ hightlight = (): string => 'var(--hightlight)';
227
+ incomingBackground = (): string => 'var(--incoming-background)';
228
+ inputElements = (): string => 'var(--input-elements)';
229
+ mainBackground = (): string => 'var(--main-background)';
230
+ mainElements = (): string => 'var(--main-elements)';
231
+ outgoingBackground = (): string => 'var(--outgoing-background)';
232
+ secondaryBackground = (): string => 'var(--secondary-background)';
233
+ secondaryElements = (): string => 'var(--secondary-elements)';
234
+ secondaryText = (): string => 'var(--secondary-text)';
235
+ */
236
+ }
237
+ ```
238
+ and specify selected components:
239
+ - desktop layout container
240
+ ```
241
+ <QuickBloxUIKitDesktopLayout theme={new CustomTheme()}>
242
+ ```
243
+ - header of dialogs
244
+ ```
245
+ <HeaderDialogs title="Dialog 2" theme={new CustomTheme()} />
246
+ ```
247
+ - item of dialogs
248
+ ```
249
+ <PreviewDialog
250
+ theme={{ selected: true, muted: true, colorTheme={new CustomTheme()} }}
251
+ title="Dialog with states"
252
+ unreadMessageCount={9}
253
+ message_date_time_sent="5 min ago"
254
+ />
255
+ ```
256
+ # Sample
257
+
258
+ https://github.com/QuickBlox/quickblox-javascript-sdk/tree/gh-pages/samples/react-chat
package/dist/App.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './App.scss';
3
- declare function App(): JSX.Element;
2
+ declare function App(): import("react/jsx-runtime").JSX.Element;
4
3
  export default App;
@@ -4,10 +4,13 @@ import { FunctionTypeViewModelToVoid } from '../Base/BaseViewModel';
4
4
  import { ThemeNames } from '../../components/UI/Dialogs/PreviewDialog/PreviewDialog';
5
5
  import { DialogsViewModel } from './DialogViewModel';
6
6
  import { DialogEntity } from '../../../Domain/entity/DialogEntity';
7
+ import UiKitTheme from '../../assets/UiKitTheme';
7
8
  type DialogsComponentSettings = {
8
9
  themeName?: ThemeNames;
9
10
  withoutHeader?: boolean;
10
11
  useSubHeader?: boolean;
12
+ themeHeader?: UiKitTheme;
13
+ themePreview?: UiKitTheme;
11
14
  };
12
15
  type DialogsProps = {
13
16
  header?: React.ReactNode;
@@ -1,2 +1,4 @@
1
+ import { QBDataContextType } from '../../components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider';
2
+ import { Pagination } from '../../../Domain/repository/Pagination';
1
3
  import { DialogsViewModel } from './DialogViewModel';
2
- export default function useDialogsViewModel(): DialogsViewModel;
4
+ export default function useDialogsViewModel(currentContext: QBDataContextType, initPagination?: Pagination): DialogsViewModel;
@@ -1,5 +1,5 @@
1
- import Theme from '../../../assets/Theme';
2
- export default class DefaultTheme implements Theme {
1
+ import UiKitTheme from '../UiKitTheme';
2
+ export default class DefaultTheme implements UiKitTheme {
3
3
  divider: () => string;
4
4
  mainText: () => string;
5
5
  fontFamily: () => string;
@@ -1,5 +1,5 @@
1
- import Theme from './Theme';
2
- export default class DarkTheme implements Theme {
1
+ import UiKitTheme from './UiKitTheme';
2
+ export default class DarkTheme implements UiKitTheme {
3
3
  caption: () => string;
4
4
  chatInput: () => string;
5
5
  disabledElements: () => string;
@@ -1,5 +1,5 @@
1
- import Theme from './Theme';
2
- export default class LightTheme implements Theme {
1
+ import UiKitTheme from './UiKitTheme';
2
+ export default class LightTheme implements UiKitTheme {
3
3
  caption: () => string;
4
4
  chatInput: () => string;
5
5
  disabledElements: () => string;
@@ -1,4 +1,4 @@
1
- export default interface Theme {
1
+ export default interface UiKitTheme {
2
2
  mainElements(): string;
3
3
  secondaryElements(): string;
4
4
  inputElements(): string;
@@ -1,4 +1,4 @@
1
1
  export default function List({ onClick, title, }: {
2
2
  onClick: any;
3
3
  title: any;
4
- }): JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
- export default function Navbar(): JSX.Element;
1
+ export default function Navbar(): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export default function TextInput(rest: any): JSX.Element;
1
+ export default function TextInput(rest: any): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
  import './HeaderDialogs.scss';
3
3
  import { FunctionTypeVoidToVoid } from '../../../../Views/Base/BaseViewModel';
4
- import Theme from '../../../../assets/Theme';
4
+ import UiKitTheme from '../../../../assets/UiKitTheme';
5
5
  type HeaderDialogsProps = {
6
6
  title?: string;
7
7
  clickSearchHandler?: FunctionTypeVoidToVoid;
8
8
  touchSearchHandler?: FunctionTypeVoidToVoid;
9
9
  ClickActionHandler?: FunctionTypeVoidToVoid;
10
10
  TouchActionHandler?: FunctionTypeVoidToVoid;
11
- theme?: Theme;
11
+ theme?: UiKitTheme;
12
12
  settings?: any;
13
13
  };
14
14
  declare const HeaderDialogs: React.FC<HeaderDialogsProps>;
@@ -2,11 +2,13 @@ import './HeaderMessages.scss';
2
2
  import React from 'react';
3
3
  import { FunctionTypeVoidToVoid } from '../../../../../Views/Base/BaseViewModel';
4
4
  import { DialogEntity } from '../../../../../../Domain/entity/DialogEntity';
5
+ import UiKitTheme from '../../../../../assets/UiKitTheme';
5
6
  type HeaderMessagesProps = {
6
7
  dialog: DialogEntity;
7
8
  countMembers?: number;
8
9
  InformationHandler?: FunctionTypeVoidToVoid;
9
10
  CallHandler?: FunctionTypeVoidToVoid;
11
+ theme?: UiKitTheme;
10
12
  };
11
13
  declare const HeaderMessages: React.FC<HeaderMessagesProps>;
12
14
  export default HeaderMessages;
@@ -2,10 +2,12 @@ import React from 'react';
2
2
  import './MessagesView.scss';
3
3
  import { DialogEntity } from '../../../../../Domain/entity/DialogEntity';
4
4
  import { FunctionTypeVoidToVoid } from '../../../../Views/Base/BaseViewModel';
5
+ import UiKitTheme from '../../../../assets/UiKitTheme';
5
6
  type HeaderDialogsMessagesProps = {
6
7
  dialog: DialogEntity;
7
8
  InformationHandler?: FunctionTypeVoidToVoid;
8
9
  maxWidthToResize?: string;
10
+ theme?: UiKitTheme;
9
11
  };
10
12
  declare const MessagesView: React.FC<HeaderDialogsMessagesProps>;
11
13
  export default MessagesView;
@@ -1,4 +1,4 @@
1
1
  import { DialogType } from '../../../../../Domain/entity/DialogTypes';
2
2
  import { DialogEntity } from '../../../../../Domain/entity/DialogEntity';
3
3
  import { MessagesViewModel } from './MessagesViewModel';
4
- export default function useMessagesViewModelWithMockUseCase(dialogType: DialogType, dialogEntity: DialogEntity): MessagesViewModel;
4
+ export default function useMessagesViewModel(dialogType: DialogType, dialogEntity: DialogEntity): MessagesViewModel;