Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b807e74
[Add] Initial state for accessible mode
ghulamghousdev Jun 24, 2021
3a18c84
[New] added toggle switch component
ghulamghousdev Jun 25, 2021
166597f
[New] accessible mode icon
ghulamghousdev Jun 25, 2021
a075ef4
[New] added cofiguration page for accessible mode and handled icons a…
ghulamghousdev Jun 25, 2021
dc41427
[Add] function to set toggle state of icons accompanying text and dar…
ghulamghousdev Jun 25, 2021
60b3d26
[Add] route for accessible mode and passed state functions to props
ghulamghousdev Jun 25, 2021
4aaed79
[Add] icons accompanying text feature
ghulamghousdev Jun 25, 2021
292a8ef
[Add] handled the props of icons accompanying text feature
ghulamghousdev Jun 25, 2021
bdf3e4b
Added icon for accessible page dark mode
ghulamghousdev Aug 18, 2021
1f2a135
Added manual font feature
ghulamghousdev Aug 18, 2021
f2b4eb7
Fixed Lint errors
ghulamghousdev Aug 18, 2021
fc33553
Added Manual fonts and accessibl mode config from server
ghulamghousdev Aug 18, 2021
c7f4aca
Added font sizes for different manual fonts
ghulamghousdev Aug 18, 2021
24b7fff
Added manual fonts, changed dynamictext selection panel, fixed lint e…
ghulamghousdev Aug 18, 2021
4a4365f
Added manual fonts, changed dynamictext selection panel, fixed lint e…
ghulamghousdev Aug 18, 2021
f395cd7
Added variables for dark and light theme
ghulamghousdev Aug 18, 2021
5864c9d
Minor changes
ghulamghousdev Aug 18, 2021
e2d087d
Lint errors fixed
ghulamghousdev Aug 18, 2021
f4081b2
Lint errors fixed
ghulamghousdev Aug 18, 2021
8d558b6
Lint errors fixed
ghulamghousdev Aug 18, 2021
8078bff
Added functions to handle configurations change
ghulamghousdev Aug 18, 2021
25cc7c4
Minor changes
ghulamghousdev Aug 18, 2021
2727614
Added settings to store the configurations
ghulamghousdev Aug 18, 2021
8808eb6
Added manual fonts and dark mode feature
ghulamghousdev Aug 18, 2021
3e221a5
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat.Livechat …
tassoevan Aug 20, 2021
fddab98
Error fixed of manaul fonts
ghulamghousdev Aug 21, 2021
14c5b9d
fixed lint errors
ghulamghousdev Aug 21, 2021
b0fcfe2
Fixed styling of manual font buttons
ghulamghousdev Aug 21, 2021
4266eaf
Merge branch 'develop' into accessible-mode
tiagoevanp Oct 19, 2021
a478ec6
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat.Livechat …
tiagoevanp Apr 10, 2022
fabe1d4
fix old i18n package usage
tiagoevanp Apr 10, 2022
645d814
fix typo
tiagoevanp Apr 10, 2022
9992a0e
fix UI consistence
tiagoevanp Apr 11, 2022
08da0bf
update storyboky and loki references
tiagoevanp Apr 11, 2022
00b4eba
fix stylelint
tiagoevanp Apr 11, 2022
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
Binary file modified .loki/reference/chrome_Components_Alert_custom_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Alert_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Alert_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Alert_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Alert_warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Alert_with_long_text_content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Alert_without_timeout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Footer_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Header_for_user_chat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Header_with_custom_field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Header_with_theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Icons_all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Modal_alert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Modal_animated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Modal_confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Modal_normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Modal_timeout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Screen_Footer_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_Components_Screen_Footer_with_children.png
Binary file modified .loki/reference/chrome_Components_Screen_Footer_with_options.png
Binary file modified .loki/reference/chrome_Components_Screen_expanded.png
Binary file modified .loki/reference/chrome_Components_Screen_normal.png
Binary file modified .loki/reference/chrome_Components_Screen_windowed.png
Binary file modified .loki/reference/chrome_Components_Screen_with_agent.png
Binary file modified .loki/reference/chrome_Components_Screen_with_agent_email.png
Binary file modified .loki/reference/chrome_Components_Screen_with_agent_phone.png
Binary file modified .loki/reference/chrome_Components_Screen_with_hidden_agent.png
Binary file modified .loki/reference/chrome_Messages_FileAttachment_for_doc.png
Binary file modified .loki/reference/chrome_Messages_FileAttachment_for_pdf.png
Binary file modified .loki/reference/chrome_Messages_FileAttachment_for_ppt.png
Binary file modified .loki/reference/chrome_Messages_FileAttachment_for_xls.png
Binary file modified .loki/reference/chrome_Messages_FileAttachment_for_zip.png
Binary file modified .loki/reference/chrome_Messages_MessageList_normal.png
Binary file modified .loki/reference/chrome_Messages_MessageSeparator_default.png
Binary file modified .loki/reference/chrome_Messages_MessageTime_today.png
Binary file modified .loki/reference/chrome_Messages_MessageTime_yesterday.png
Binary file modified .loki/reference/chrome_Messages_Message_default.png
Binary file modified .loki/reference/chrome_Messages_Message_grouping.png
Binary file modified .loki/reference/chrome_Messages_Message_markdown.png
Binary file modified .loki/reference/chrome_Messages_Message_me.png
Binary file modified .loki/reference/chrome_Messages_Message_with_UiKit_blocks.png
Binary file modified .loki/reference/chrome_Messages_Message_with_quotation.png
Binary file modified .loki/reference/chrome_Messages_TypingIndicator_default.png
Binary file modified .loki/reference/chrome_Messages_TypingIndicator_with_avatars.png
Binary file modified .loki/reference/chrome_Routes_ChatFinished_normal.png
Binary file modified .loki/reference/chrome_Routes_Chat_loading.png
Binary file modified .loki/reference/chrome_Routes_Chat_normal.png
Binary file modified .loki/reference/chrome_Routes_Chat_with_trigger_messages.png
Binary file modified .loki/reference/chrome_Routes_Chat_with_typing_user.png
Binary file modified .loki/reference/chrome_Routes_GDPRAgreement_normal.png
Binary file modified .loki/reference/chrome_Routes_Leave_a_message_loading.png
Binary file modified .loki/reference/chrome_Routes_Leave_a_message_normal.png
Binary file modified .loki/reference/chrome_Routes_Leave_a_message_unavailable.png
Binary file modified .loki/reference/chrome_Routes_Register_loading.png
Binary file modified .loki/reference/chrome_Routes_Register_normal.png
Binary file modified .loki/reference/chrome_Routes_Register_with_custom_fields.png
Binary file modified .loki/reference/chrome_Routes_SwitchDepartment_loading.png
Binary file modified .loki/reference/chrome_Routes_SwitchDepartment_normal.png
16 changes: 7 additions & 9 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { addDecorator, addParameters } from '@storybook/react';
import { addParameters } from '@storybook/react';
import 'loki/configure-react';
import 'emoji-mart/css/emoji-mart.css';
import '../src/styles/index.scss';

addParameters({
grid: {
cellSize: 4,
},
options: {
storySort: ([, a], [, b]) => {
return a.kind.localeCompare(b.kind);
},
},
grid: {
cellSize: 4,
},
options: {
storySort: ([, a], [, b]) => a.kind.localeCompare(b.kind),
},
});
21 changes: 16 additions & 5 deletions src/components/Alert/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,27 @@ $alert-error-background-color: $color-red;

letter-spacing: 0;

color: $alert-color;
color: var(--alert-color, $alert-color);
background-color: $alert-background-color;

font-family: $alert-font-family;
font-size: 12px;
font-weight: 600;
line-height: 16px;
align-items: center;
justify-content: space-between;

&__text-font-small {
font-size: 10px;
}

&__text-font-normal {
font-size: 12px;
}

&__text-font-large {
font-size: 16px;
}

&__content {
overflow: hidden;

Expand All @@ -52,14 +63,14 @@ $alert-error-background-color: $color-red;
}

&--success {
background-color: $alert-success-background-color;
background-color: var(--alert-success-bg-color, $alert-success-background-color);
}

&--warning {
background-color: $alert-warning-background-color;
background-color: var(--alert-warning-bg-color, $color-yellow);
}

&--error {
background-color: $alert-error-background-color;
background-color: var(--alert-error-bg-color, $alert-error-background-color);
}
}
39 changes: 38 additions & 1 deletion src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ import history from '../../history';
import Connection from '../../lib/connection';
import CustomFields from '../../lib/customFields';
import Hooks from '../../lib/hooks';
import { setIconsAccompanyingTextState, setDarkModeState,
setSmallDynamicTextState, setNormalDynamicTextState,
setLargeDynamicTextState, accessibleModeFalse, accessibleModeTrue } from '../../lib/main';
import { parentCall } from '../../lib/parentCall';
import Triggers from '../../lib/triggers';
import userPresence from '../../lib/userPresence';
import AccessibleMode from '../../routes/AccessibleMode';
import { ChatConnector } from '../../routes/Chat';
import ChatFinished from '../../routes/ChatFinished';
import GDPRAgreement from '../../routes/GDPRAgreement';
Expand Down Expand Up @@ -157,6 +161,31 @@ export class App extends Component {
i18next.on('languageChanged', this.handleLanguageChange);
}

setDarkMode = async () => {
const { accessible: { darkMode } } = this.props;
const { body } = document;

if (darkMode) {
body.classList.add('dark');
} else {
body.classList.add('light');
}
if (darkMode) {
body.classList.replace('light', 'dark');
} else {
body.classList.replace('dark', 'light');
}
};

getConfigurations = async () => {
const { config: { settings: { allowAccessibleMode } } } = this.props;
if (!allowAccessibleMode) {
accessibleModeFalse();
} else {
accessibleModeTrue();
}
}

checkPoppedOutWindow() {
// Checking if the window is poppedOut and setting parent minimized if yes for the restore purpose
const { dispatch } = this.props;
Expand All @@ -176,7 +205,8 @@ export class App extends Component {
userPresence.init();
this.initWidget();
this.checkPoppedOutWindow();

await this.setDarkMode();
await this.getConfigurations();
this.setState({ initialized: true });
parentCall('ready');
}
Expand All @@ -198,6 +228,7 @@ export class App extends Component {
componentDidUpdate() {
const { i18n } = this.props;
document.dir = isRTL(i18n.t('yes')) ? 'rtl' : 'ltr';
this.setDarkMode();
}

render = ({
Expand All @@ -219,6 +250,11 @@ export class App extends Component {
sound,
alerts,
modal,
setIconsAccompanyingTextState,
setDarkModeState,
setSmallDynamicTextState,
setNormalDynamicTextState,
setLargeDynamicTextState,
onEnableNotifications: this.handleEnableNotifications,
onDisableNotifications: this.handleDisableNotifications,
onMinimize: this.handleMinimize,
Expand All @@ -236,6 +272,7 @@ export class App extends Component {
<LeaveMessage path='/leave-message' {...screenProps} />
<Register path='/register' {...screenProps} />
<SwitchDepartment path='/switch-department' {...screenProps} />
<AccessibleMode path='/accessible-mode' {...screenProps} />
<TriggerMessage path='/trigger-messages' {...screenProps} />
</Router>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AppConnector = () => (
undocked,
minimized = true,
expanded = false,
accessible,
alerts,
modal,
dispatch,
Expand All @@ -31,6 +32,7 @@ const AppConnector = () => (
undocked={undocked}
minimized={minimized}
expanded={expanded}
accessible={accessible}
alerts={alerts}
modal={modal}
dispatch={dispatch}
Expand Down
10 changes: 6 additions & 4 deletions src/components/Button/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ $button-icon-padding: 10px;
text-decoration: none;

color: var(--font-color, $button-color);
border: $button-border-width solid;
border: var(--default-border-width, 2px) solid;
border-radius: $button-border-radius;

font-family: $button-font-family;
Expand All @@ -98,16 +98,16 @@ $button-icon-padding: 10px;
&--secondary {
color: $button-color;

@include state($button-secondary-background-color);
@include state(var(--btn-secondary-bg-color, none));
}

&--outline {
background: none;
background: var(--btn-outline-bg-color, none);
}

&--nude {
border-color: transparent;
background: none;
background: var(--nude-button, none);

&:focus {
box-shadow: none;
Expand All @@ -127,6 +127,8 @@ $button-icon-padding: 10px;

&--stack {
width: 100%;

color: var(--color-text-lighter, #ffffff);
}

&--small {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Composer/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ $composer-input-placeholder-color: $color-text-light;

transition: all $default-time-animation;

border: $composer-border-width solid $composer-border-color;
border: $composer-border-width solid var(--input-field-border, $composer-border-color);
border-radius: $composer-border-radius;
background-color: $composer-background-color;
background-color: var(--composer-bg-color, $composer-background-color);
align-items: flex-end;

&:focus-within {
Expand All @@ -48,7 +48,7 @@ $composer-input-placeholder-color: $color-text-light;
cursor: text;
word-wrap: break-word;

color: $composer-input-color;
color: var(--composer-input-color, $composer-input-color);

border: none;
outline: none;
Expand Down
19 changes: 11 additions & 8 deletions src/components/FilesDropTarget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,17 @@ export class FilesDropTarget extends Component {
className={createClassName(styles, 'drop', { overlayed, dragover: dragLevel > 0 }, [className])}
style={style}
>
<input
ref={this.handleInputRef}
type='file'
accept={accept}
multiple={multiple}
onChange={this.handleInputChange}
className={createClassName(styles, 'drop__input')}
/>
<label>
<input
ref={this.handleInputRef}
type='file'
area-label='This input is for file drop'
accept={accept}
multiple={multiple}
onChange={this.handleInputChange}
className={createClassName(styles, 'drop__input')}
/>
</label>
{children}
</div>
)
Expand Down
2 changes: 2 additions & 0 deletions src/components/FilesDropTarget/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ $drop-overlay-text-font-size: 1.375rem;
flex-direction: column;
flex: 1 1 auto;

color: var(--color-text-dark-gray);

&.drop--overlayed.drop--dragover {
&::before {
position: absolute;
Expand Down
24 changes: 20 additions & 4 deletions src/components/Footer/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
padding: 4px 8px;

color: $color-text-grey;
background-color: var(--background-color, #ffffff);

font-size: 0.625rem;
align-items: stretch;
Expand All @@ -22,6 +23,10 @@
padding: 4px 8px;
}

&__abc {
font-size: 40px;
}

&__options {
padding: 0;

Expand All @@ -35,13 +40,24 @@
border: none;
background: none;

font-size: 0.625rem;
font-weight: bold;
line-height: 1;

&--small {
font-size: 0.5rem;
}

&--normal {
font-size: 0.625rem;
}

&--large {
font-size: 0.75rem;
}

&:hover,
&:focus {
color: black;
color: var(--footer-options-text-color, black);
}

@include pressable-button(2px);
Expand All @@ -68,7 +84,7 @@
user-select: none;
text-align: end;

font-size: 10px;
font-size: 12px;
font-weight: 500;
align-self: flex-end;

Expand All @@ -82,7 +98,7 @@
}

&:hover :global(.text) {
fill: #2f343d;
fill: var(--footer-logo-text-color, #2f343d);
}

:global(.rocket) {
Expand Down
7 changes: 6 additions & 1 deletion src/components/Form/FormField/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ export const FormField = ({
className,
style = {},
children,
dynamicTextState,
}) => (
<div
className={createClassName(styles, 'form-field', { required, error: !!error }, [className])}
style={style}
>
<label className={createClassName(styles, 'form-field__label-wrapper')}>
{label
? <span className={createClassName(styles, 'form-field__label')}>{label}</span>
? <span className={createClassName(styles, 'form-field__label')}>
<span className={createClassName(styles, `form-field__label__font-${ dynamicTextState }`)}>
{label}
</span>
</span>
: null}
<span className={createClassName(styles, 'form-field__input')}>
{error
Expand Down
24 changes: 20 additions & 4 deletions src/components/Form/FormField/styles.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
@import '../../../styles/colors';
@import '../../../styles/variables';

$form-field-label-color: $color-text-dark;
$form-field-label-error-color: $color-red;
$form-field-label-font-size: 0.75rem;
$form-field-label-font-size-small: 0.6rem;
$form-field-label-font-size-normal: 0.75rem;
$form-field-label-font-size-large: 0.9rem;
$form-field-label-font-weight: 600;
$form-field-label-line-height: 1rem;

Expand Down Expand Up @@ -38,18 +39,33 @@ $form-field-error-border-color: $color-red;
flex: 0 0 auto;

transition: color $default-time-animation;

text-align: left;
white-space: nowrap;
letter-spacing: 0;
text-overflow: ellipsis;

color: $form-field-label-color;
color: var(--form-field-label-color, $color-text-dark);

font-size: $form-field-label-font-size-normal;

font-size: $form-field-label-font-size;
font-weight: $form-field-label-font-weight;

line-height: $form-field-label-line-height;
}

.form-field__label__font-small {
font-size: $form-field-label-font-size-small;
}

.form-field__label__font-normal {
font-size: $form-field-label-font-size-normal;
}

.form-field__label__font-large {
font-size: $form-field-label-font-size-large;
}

&__input {
display: flex;
flex: 1 0 auto;
Expand Down
Loading