Skip to content

Commit ce64126

Browse files
committed
initial style changes
1 parent 33d3ae5 commit ce64126

8 files changed

Lines changed: 86 additions & 175 deletions

File tree

packages/api/src/StyleOptions.ts

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ type StyleOptions = {
932932
/**
933933
* (EXPERIMENTAL) Feedback buttons placement
934934
*
935-
* - `'activity-actions'` - place feedback buttons inside activity actions
935+
* - `'activity-actions'` - place feedback buttons inside activity actions - will show feedback form
936936
* - `'activity-status'` - place feedback buttons inside activity status
937937
*
938938
* @default 'activity-status'
@@ -943,31 +943,16 @@ type StyleOptions = {
943943
*/
944944
feedbackActionsPlacement?: 'activity-actions' | 'activity-status';
945945

946-
fontColorPrimary?: string;
947-
fontColorSecondary?: string;
948-
949-
primaryButtonBackgroundColor?: string;
950-
primaryButtonFontColor?: string;
951-
primaryButtonBorderColor?: string;
952-
primaryButtonBackgroundColorOnHover?: string;
953-
primaryButtonBackgroundColorOnActive?: string;
954-
primaryButtonBackgroundColorOnDisabled?: string;
955-
primaryButtonFontColorOnHover?: string;
956-
primaryButtonFontColorOnDisabled?: string;
957-
958-
secondaryButtonBackgroundColor?: string;
959-
secondaryButtonBackgroundColorOnHover?: string;
960-
secondaryButtonBorderColor?: string;
961-
secondaryButtonFontColor?: string;
962-
secondaryButtonFontColorOnHover?: string;
963-
964-
textBoxBackgroundColor?: string;
965-
textBoxBorderColor?: string;
966-
textBoxBorderColorOnFocus?: string;
967-
textBoxBorderColorOnActive?: string;
968-
textBoxTextColor?: string;
969-
textBoxMinHeight?: number;
970-
textBoxMinWidth?: number;
946+
feedbackFormPrimaryColor?: string;
947+
feedbackFormPrimarySubmittedColor?: string;
948+
feedbackFormLightestColor?: string;
949+
feedbackFormNeutralLightColor?: string;
950+
feedbackFormNeutralMediumColor?: string;
951+
feedbackFormNeutralDarkColor?: string;
952+
feedbackTextBoxMinHeight?: number;
953+
feedbackTextBoxMinWidth?: number;
954+
feedbackTextBoxPadding?: string;
955+
971956
/**
972957
* Use continuous mode for speech recognition. Default to `false`.
973958
*

packages/api/src/defaultStyleOptions.ts

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -308,31 +308,15 @@ const DEFAULT_OPTIONS: Required<StyleOptions> = {
308308

309309
feedbackActionsPlacement: 'activity-status' as const,
310310

311-
fontColorPrimary: 'black',
312-
fontColorSecondary: 'black',
313-
314-
primaryButtonBackgroundColor: DEFAULT_ACCENT,
315-
primaryButtonFontColor: 'white',
316-
primaryButtonBorderColor: DEFAULT_ACCENT,
317-
primaryButtonBackgroundColorOnHover: '#004a98',
318-
primaryButtonBackgroundColorOnActive: DEFAULT_ACCENT,
319-
primaryButtonBackgroundColorOnDisabled: DEFAULT_ACCENT,
320-
primaryButtonFontColorOnHover: 'white',
321-
primaryButtonFontColorOnDisabled: 'white',
322-
323-
secondaryButtonFontColor: 'black',
324-
secondaryButtonBackgroundColor: 'White',
325-
secondaryButtonBackgroundColorOnHover: DEFAULT_SUBTLE,
326-
secondaryButtonBorderColor: DEFAULT_SUBTLE,
327-
secondaryButtonFontColorOnHover: 'white',
328-
329-
textBoxBackgroundColor: 'White',
330-
textBoxBorderColor: DEFAULT_SUBTLE,
331-
textBoxBorderColorOnFocus: DEFAULT_SUBTLE,
332-
textBoxBorderColorOnActive: DEFAULT_ACCENT,
333-
textBoxTextColor: 'black',
334-
textBoxMinHeight: 60,
335-
textBoxMinWidth: 280,
311+
feedbackFormPrimaryColor: DEFAULT_ACCENT,
312+
feedbackFormPrimarySubmittedColor: '#004a98',
313+
feedbackFormLightestColor: 'white',
314+
feedbackFormNeutralLightColor: '#E8E8E8',
315+
feedbackFormNeutralMediumColor: DEFAULT_SUBTLE,
316+
feedbackFormNeutralDarkColor: '#373435',
317+
feedbackTextBoxMinHeight: 60,
318+
feedbackTextBoxMinWidth: 280,
319+
feedbackTextBoxPadding: '8px 12px',
336320

337321
// Speech recognition
338322
speechRecognitionContinuous: false

packages/component/src/Activity/ActivityFeedback.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ type ActivityFeedbackProps = Readonly<{
1717
}>;
1818

1919
const ROOT_STYLE = {
20-
'&.webchat__feedback-form__root__container': {
20+
'&.webchat__feedback-form__root-container': {
2121
display: 'flex',
2222
flexDirection: 'column',
2323
gap: '0.5rem'
2424
},
25-
'&.webchat__feedback-form__root__container__child': {
25+
'&.webchat__feedback-form__root-container__child': {
2626
display: 'flex'
2727
}
2828
};
@@ -118,8 +118,8 @@ function ActivityFeedback({ activity }: ActivityFeedbackProps) {
118118

119119
if (feedbackActionsPlacement === 'activity-actions' && isFeedbackLoopSupported) {
120120
return (
121-
<div className={classNames('webchat__feedback-form__root__container', rootClassName)}>
122-
<div className={classNames('webchat__feedback-form__root__container__child', rootClassName)}>
121+
<div className={classNames('webchat__feedback-form__root-container', rootClassName)}>
122+
<div className={classNames('webchat__feedback-form__root-container__child', rootClassName)}>
123123
{FeedbackComponent}
124124
</div>
125125
{showFeedbackForm && feedbackType && FeedbackFormComponent}

packages/component/src/Styles/CustomPropertyNames.ts

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,15 @@ const CustomPropertyNames = Object.freeze({
2020
MinWidthMessageBubble: '--webchat__min-width--message-bubble',
2121
PaddingRegular: '--webchat__padding--regular',
2222
SizeAvatar: '--webchat__size--avatar',
23-
FeedbackFormFont: '--webchat__font--primary',
24-
FeedbackFormTitleColor: '--webchat__font--color-primary',
25-
FeedbackFormDisclaimerColor: '--webchat__font--color-secondary',
26-
FeedbackFormSubmitButtonColor: '--webchat__color--accent',
27-
FeedbackFormSubmitButtonFontColor: '--webchat__button--text--primary',
28-
FeedbackFormSubmitButtonBorderColor: '--webchat__button--primary-border',
29-
FeedbackFormSubmitButtonFontColorOnHover: '--webchat__button--text--primary--hover',
30-
FeedbackFormSubmitButtonFontColorOnDisabled: '--webchat__button--text--primary--disabled',
31-
FeedbackFormSubmitButtonHoverColor: '--webchat__button--primary--hover',
32-
FeedbackFormSubmitButtonActiveColor: '--webchat__button--primary--active',
33-
FeedbackFormSubmitButtonDisabledColor: '--webchat__button--primary--disabled',
34-
FeedbackFormCancelButtonColor: '--webchat__button--secondary',
35-
FeedbackFormCancelButtonFontColor: '--webchat__button--text--secondary',
36-
FeedbackFormCancelButtonBorderColor: '--webchat__button--secondary-border',
37-
FeedbackFormCancelButtonHoverColor: '--webchat__button--secondary--hover',
38-
FeedbackFormCancelButtonFontColorOnHover: '--webchat__button--text--secondary--hover',
39-
FeedbackFormSendBoxBackgroundColor: '--webchat__textbox--background',
40-
FeedbackFormSendBoxBorderColor: '--webchat__textbox--border',
41-
FeedbackFormSendBoxFontColor: '--webchat__button--text--secondary',
42-
FeedbackFormSendBoxFocusBorderColor: '--webchat__textbox--border--focus',
43-
FeedbackFormSendBoxActiveBorderColor: '--webchat__textbox--border--selected',
44-
FeedbackFormSendBoxMinHeight: '--webchat__textbox--min-height',
45-
FeedbackFormSendBoxMinWidth: '--webchat__textbox--min-width',
46-
FeedbackFormSendBoxPadding: '--webchat__textbox--padding'
23+
FeedbackFormPrimary: '--webchat__feedback-form__primary',
24+
FeedbackFormPrimarySubmitted: '--webchat__feedback-form__primary--submitted',
25+
FeedbackFormLightest: '--webchat__feedback-form--lightest',
26+
FeedbackFormNeutralLight: '--webchat__feedback-form--neutral-light',
27+
FeedbackFormNeutralMedium: '--webchat__feedback-form--neutral-medium',
28+
FeedbackFormNeutralDark: '--webchat__feedback-form--neutral-dark',
29+
FeedbackFormTextBoxMinHeight: '--webchat__feedback-form__text-box--min-height',
30+
FeedbackFormTextBoxMinWidth: '--webchat__feedback-form__text-box--min-width',
31+
FeedbackFormTextBoxPadding: '--webchat__feedback-form__text-box--padding'
4732
}) satisfies Readonly<Record<string, `--webchat__${string}`>>;
4833

4934
export default CustomPropertyNames;

packages/component/src/Styles/StyleSet/FeedbackForm.ts

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ export default function createFeedbackFormStyle() {
1515
fontWeight: 400,
1616
fontSize: '14px',
1717
lineHeight: '20px',
18-
color: CSSTokens.FeedbackFormTitleColor
18+
color: CSSTokens.FeedbackFormNeutralDark
1919
},
2020
'&.feedback-form__caption1': {
2121
fontFamily: CSSTokens.FontPrimary,
2222
fontStyle: 'normal',
2323
fontWeight: 400,
2424
fontSize: '10px',
2525
lineHeight: '14px',
26-
color: CSSTokens.FeedbackFormDisclaimerColor
26+
color: CSSTokens.FeedbackFormNeutralMedium
2727
},
2828
'&.feedback-form__container': {
2929
display: 'flex',
@@ -32,43 +32,40 @@ export default function createFeedbackFormStyle() {
3232
paddingTop: '6px'
3333
},
3434
'&.feedback-form__button__submit': {
35-
backgroundColor: CSSTokens.FeedbackFormSubmitButtonColor,
36-
border: `1px solid ${CSSTokens.FeedbackFormSubmitButtonBorderColor}`,
35+
backgroundColor: CSSTokens.FeedbackFormPrimary,
36+
border: `1px solid ${CSSTokens.FeedbackFormPrimary}`,
3737
borderRadius: '4px',
38-
color: CSSTokens.FeedbackFormSubmitButtonFontColor,
38+
color: CSSTokens.FeedbackFormLightest,
3939
cursor: 'pointer',
4040
fontSize: '12px',
4141
fontFamily: CSSTokens.FontPrimary,
4242
height: '24px',
4343
padding: '0 8px'
4444
},
4545
'&.feedback-form__button__submit:hover': {
46-
backgroundColor: CSSTokens.FeedbackFormSubmitButtonHoverColor,
47-
border: `1px solid ${CSSTokens.FeedbackFormSubmitButtonHoverColor}`,
48-
color: CSSTokens.FeedbackFormSubmitButtonFontColorOnHover
46+
backgroundColor: CSSTokens.FeedbackFormPrimarySubmitted,
47+
border: `1px solid ${CSSTokens.FeedbackFormPrimarySubmitted}`,
48+
color: CSSTokens.FeedbackFormLightest
4949
},
5050
'&.feedback-form__button__submit:active': {
51-
backgroundColor: CSSTokens.FeedbackFormSubmitButtonActiveColor
52-
},
53-
'&.feedback-form__button__submit:disabled': {
54-
backgroundColor: CSSTokens.FeedbackFormSubmitButtonDisabledColor,
55-
color: CSSTokens.FeedbackFormSubmitButtonFontColorOnDisabled,
56-
cursor: 'not-allowed'
51+
backgroundColor: CSSTokens.FeedbackFormPrimarySubmitted,
52+
border: `1px solid ${CSSTokens.FeedbackFormPrimarySubmitted}`,
53+
color: CSSTokens.FeedbackFormLightest
5754
},
5855
'&.feedback-form__button__cancel': {
59-
backgroundColor: CSSTokens.FeedbackFormCancelButtonColor,
56+
backgroundColor: CSSTokens.FeedbackFormLightest,
6057
borderRadius: '4px',
6158
cursor: 'pointer',
6259
fontSize: '12px',
63-
border: `1px solid ${CSSTokens.FeedbackFormCancelButtonBorderColor}`,
64-
color: CSSTokens.FeedbackFormCancelButtonFontColor,
60+
border: `1px solid ${CSSTokens.FeedbackFormNeutralLight}`,
61+
color: CSSTokens.FeedbackFormNeutralMedium,
6562
fontFamily: CSSTokens.FontPrimary,
6663
height: '24px',
6764
padding: '0 8px'
6865
},
6966
'&.feedback-form__button__cancel:hover': {
70-
backgroundColor: CSSTokens.FeedbackFormCancelButtonHoverColor,
71-
color: CSSTokens.FeedbackFormCancelButtonFontColorOnHover
67+
backgroundColor: CSSTokens.FeedbackFormNeutralMedium,
68+
color: CSSTokens.FeedbackFormLightest
7269
}
7370
};
7471
}

packages/component/src/Styles/StyleSet/FeedbackTextArea.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ export default function createFeedbackTextAreaStyle() {
77
gridTemplateAreas: `'main'`,
88
maxHeight: '200px',
99
overflow: 'hidden',
10-
backgroundColor: CSSTokens.FeedbackFormSendBoxBackgroundColor,
10+
backgroundColor: CSSTokens.FeedbackFormLightest,
1111
borderRadius: '4px',
12-
border: `1px solid ${CSSTokens.FeedbackFormSendBoxBorderColor}`,
12+
border: `1px solid ${CSSTokens.FeedbackFormNeutralLight}`,
1313
fontFamily: CSSTokens.FontPrimary,
1414
fontSize: '14px',
1515
gap: '6px',
1616
lineHeight: '20px',
17-
padding: CSSTokens.FeedbackFormSendBoxPadding,
17+
padding: CSSTokens.FeedbackFormTextBoxPadding,
1818
position: 'relative',
19-
minHeight: `${CSSTokens.FeedbackFormSendBoxMinHeight}`,
20-
minWidth: `${CSSTokens.FeedbackFormSendBoxMinWidth}`,
19+
minHeight: `${CSSTokens.FeedbackFormTextBoxMinHeight}`,
20+
minWidth: `${CSSTokens.FeedbackFormTextBoxMinWidth}`,
2121
'&::after': {
2222
borderBottomLeftRadius: '4px',
2323
borderBottomRightRadius: '4px',
24-
borderBottom: `3px solid ${CSSTokens.FeedbackFormSendBoxActiveBorderColor}`,
24+
borderBottom: `3px solid ${CSSTokens.FeedbackFormNeutralLight}`,
2525
bottom: '-1px',
2626
clipPath: 'inset(calc(100% - 3px) 50% 0 50%)',
2727
content: '""',
@@ -32,7 +32,7 @@ export default function createFeedbackTextAreaStyle() {
3232
transition: 'clip-path 0 cubic-bezier(1, 0, 1, 1)'
3333
},
3434
'&:focus-within': {
35-
border: `1px solid ${CSSTokens.FeedbackFormSendBoxFocusBorderColor}`
35+
border: `1px solid ${CSSTokens.FeedbackFormPrimary}`
3636
},
3737
'&:focus-within::after': {
3838
clipPath: 'inset(calc(100% - 3px) 0 0 0)',
@@ -66,21 +66,21 @@ export default function createFeedbackTextAreaStyle() {
6666
'&.sendbox__text-area-input--scroll': {
6767
scrollbarColor: 'unset',
6868
scrollbarWidth: 'unset',
69-
MozScrollbarColor: `${CSSTokens.FeedbackFormSubmitButtonDisabledColor} ${CSSTokens.ColorSubtle}`,
69+
MozScrollbarColor: `${CSSTokens.FeedbackFormNeutralDark} ${CSSTokens.ColorSubtle}`,
7070
MozScrollbarWidth: 'thin',
7171
'&::-webkit-scrollbar': {
7272
width: '8px'
7373
},
7474
'&::-webkit-scrollbar-track': {
75-
backgroundColor: CSSTokens.FeedbackFormSubmitButtonDisabledColor,
75+
backgroundColor: CSSTokens.FeedbackFormNeutralDark,
7676
borderRadius: '16px'
7777
},
7878
'&::-webkit-scrollbar-thumb': {
7979
backgroundColor: CSSTokens.ColorSubtle,
8080
borderRadius: '16px'
8181
},
8282
'&::-webkit-scrollbar-corner': {
83-
backgroundColor: CSSTokens.FeedbackFormSubmitButtonDisabledColor
83+
backgroundColor: CSSTokens.FeedbackFormNeutralDark
8484
}
8585
}
8686
};

packages/component/src/Styles/useCustomPropertiesClassName.ts

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,15 @@ export default function useCustomPropertiesClassName() {
2828
bubbleMessageMaxWidth,
2929
bubbleMessageMinWidth,
3030
bubbleMinHeight,
31-
fontColorPrimary,
32-
fontColorSecondary,
33-
primaryButtonBackgroundColor,
34-
primaryButtonFontColor,
35-
primaryButtonBorderColor,
36-
primaryButtonBackgroundColorOnHover,
37-
primaryButtonBackgroundColorOnActive,
38-
primaryButtonBackgroundColorOnDisabled,
39-
primaryButtonFontColorOnDisabled,
40-
primaryButtonFontColorOnHover,
41-
secondaryButtonBackgroundColor,
42-
secondaryButtonFontColor,
43-
secondaryButtonFontColorOnHover,
44-
secondaryButtonBackgroundColorOnHover,
45-
secondaryButtonBorderColor,
46-
textBoxBackgroundColor,
47-
textBoxBorderColor,
48-
textBoxBorderColorOnFocus,
49-
textBoxBorderColorOnActive,
50-
textBoxMinHeight,
51-
textBoxMinWidth,
52-
textBoxTextColor,
31+
feedbackFormPrimaryColor,
32+
feedbackFormPrimarySubmittedColor,
33+
feedbackFormLightestColor,
34+
feedbackFormNeutralLightColor,
35+
feedbackFormNeutralMediumColor,
36+
feedbackFormNeutralDarkColor,
37+
feedbackTextBoxMinHeight,
38+
feedbackTextBoxMinWidth,
39+
feedbackTextBoxPadding,
5340
fontSizeSmall,
5441
markdownExternalLinkIconImage,
5542
paddingRegular,
@@ -82,30 +69,15 @@ export default function useCustomPropertiesClassName() {
8269
${CustomPropertyNames.MinHeightImageBubble}: ${bubbleImageMinHeight}px;
8370
${CustomPropertyNames.PaddingRegular}: ${paddingRegular}px;
8471
${CustomPropertyNames.SizeAvatar}: ${avatarSize}px;
85-
${CustomPropertyNames.FeedbackFormFont}: ${primaryFont};
86-
${CustomPropertyNames.FeedbackFormTitleColor}: ${fontColorPrimary};
87-
${CustomPropertyNames.FeedbackFormDisclaimerColor}: ${fontColorSecondary};
88-
${CustomPropertyNames.FeedbackFormSubmitButtonColor}: ${primaryButtonBackgroundColor};
89-
${CustomPropertyNames.FeedbackFormSubmitButtonFontColor}: ${primaryButtonFontColor};
90-
${CustomPropertyNames.FeedbackFormSubmitButtonBorderColor}: ${primaryButtonBorderColor};
91-
${CustomPropertyNames.FeedbackFormSubmitButtonFontColorOnHover}: ${primaryButtonFontColorOnHover};
92-
${CustomPropertyNames.FeedbackFormSubmitButtonFontColorOnDisabled}: ${primaryButtonFontColorOnDisabled};
93-
${CustomPropertyNames.FeedbackFormSubmitButtonHoverColor}: ${primaryButtonBackgroundColorOnHover};
94-
${CustomPropertyNames.FeedbackFormSubmitButtonActiveColor}: ${primaryButtonBackgroundColorOnActive};
95-
${CustomPropertyNames.FeedbackFormSubmitButtonDisabledColor}: ${primaryButtonBackgroundColorOnDisabled};
96-
${CustomPropertyNames.FeedbackFormCancelButtonColor}: ${secondaryButtonBackgroundColor};
97-
${CustomPropertyNames.FeedbackFormCancelButtonBorderColor}: ${secondaryButtonBorderColor};
98-
${CustomPropertyNames.FeedbackFormCancelButtonFontColor}: ${secondaryButtonFontColor};
99-
${CustomPropertyNames.FeedbackFormCancelButtonFontColorOnHover}: ${secondaryButtonFontColorOnHover};
100-
${CustomPropertyNames.FeedbackFormCancelButtonHoverColor}: ${secondaryButtonBackgroundColorOnHover};
101-
${CustomPropertyNames.FeedbackFormSendBoxBackgroundColor}: ${textBoxBackgroundColor};
102-
${CustomPropertyNames.FeedbackFormSendBoxBorderColor}: ${textBoxBorderColor};
103-
${CustomPropertyNames.FeedbackFormSendBoxFontColor}: ${textBoxTextColor};
104-
${CustomPropertyNames.FeedbackFormSendBoxFocusBorderColor}: ${textBoxBorderColorOnFocus};
105-
${CustomPropertyNames.FeedbackFormSendBoxActiveBorderColor}: ${textBoxBorderColorOnActive};
106-
${CustomPropertyNames.FeedbackFormSendBoxMinHeight}: ${textBoxMinHeight}px;
107-
${CustomPropertyNames.FeedbackFormSendBoxMinWidth}: ${textBoxMinWidth}px;
108-
${CustomPropertyNames.FeedbackFormSendBoxPadding}: ${paddingRegular}px;
72+
${CustomPropertyNames.FeedbackFormPrimary}: ${feedbackFormPrimaryColor};
73+
${CustomPropertyNames.FeedbackFormPrimarySubmitted}: ${feedbackFormPrimarySubmittedColor};
74+
${CustomPropertyNames.FeedbackFormLightest}: ${feedbackFormLightestColor};
75+
${CustomPropertyNames.FeedbackFormNeutralLight}: ${feedbackFormNeutralLightColor};
76+
${CustomPropertyNames.FeedbackFormNeutralMedium}: ${feedbackFormNeutralMediumColor};
77+
${CustomPropertyNames.FeedbackFormNeutralDark}: ${feedbackFormNeutralDarkColor};
78+
${CustomPropertyNames.FeedbackFormTextBoxMinHeight}: ${feedbackTextBoxMinHeight}px;
79+
${CustomPropertyNames.FeedbackFormTextBoxMinWidth}: ${feedbackTextBoxMinWidth}px;
80+
${CustomPropertyNames.FeedbackFormTextBoxPadding}: ${feedbackTextBoxPadding};
10981
}
11082
`;
11183
const [style] = makeCreateStyles(contents)();

0 commit comments

Comments
 (0)