Skip to content

Commit 979b005

Browse files
OEvgenycompulim
andauthored
Fluent: align suggested actions and attachments fonts (#5275)
* Fix: suggested actions and attachments fonts * Snapshots * Changelog * Sort Co-authored-by: William Wong <[email protected]> --------- Co-authored-by: William Wong <[email protected]>
1 parent af6a205 commit 979b005

File tree

55 files changed

+88
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+88
-12
lines changed

CHANGELOG.md

+1

__tests__/html/fluentTheme/side-by-side.wide.dark.html

+31-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
body {
1414
/* The background is a decorative "Endless Clouds" pattern from https://www.heropatterns.com/ under CC BY 4.0. */
1515
background: #070707 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 28' width='56' height='28'%3E%3Cpath fill='%23111111' fill-opacity='0.4' d='M56 26v2h-7.75c2.3-1.27 4.94-2 7.75-2zm-26 2a2 2 0 1 0-4 0h-4.09A25.98 25.98 0 0 0 0 16v-2c.67 0 1.34.02 2 .07V14a2 2 0 0 0-2-2v-2a4 4 0 0 1 3.98 3.6 28.09 28.09 0 0 1 2.8-3.86A8 8 0 0 0 0 6V4a9.99 9.99 0 0 1 8.17 4.23c.94-.95 1.96-1.83 3.03-2.63A13.98 13.98 0 0 0 0 0h7.75c2 1.1 3.73 2.63 5.1 4.45 1.12-.72 2.3-1.37 3.53-1.93A20.1 20.1 0 0 0 14.28 0h2.7c.45.56.88 1.14 1.29 1.74 1.3-.48 2.63-.87 4-1.15-.11-.2-.23-.4-.36-.59H26v.07a28.4 28.4 0 0 1 4 0V0h4.09l-.37.59c1.38.28 2.72.67 4.01 1.15.4-.6.84-1.18 1.3-1.74h2.69a20.1 20.1 0 0 0-2.1 2.52c1.23.56 2.41 1.2 3.54 1.93A16.08 16.08 0 0 1 48.25 0H56c-4.58 0-8.65 2.2-11.2 5.6 1.07.8 2.09 1.68 3.03 2.63A9.99 9.99 0 0 1 56 4v2a8 8 0 0 0-6.77 3.74c1.03 1.2 1.97 2.5 2.79 3.86A4 4 0 0 1 56 10v2a2 2 0 0 0-2 2.07 28.4 28.4 0 0 1 2-.07v2c-9.2 0-17.3 4.78-21.91 12H30zM7.75 28H0v-2c2.81 0 5.46.73 7.75 2zM56 20v2c-5.6 0-10.65 2.3-14.28 6h-2.7c4.04-4.89 10.15-8 16.98-8zm-39.03 8h-2.69C10.65 24.3 5.6 22 0 22v-2c6.83 0 12.94 3.11 16.97 8zm15.01-.4a28.09 28.09 0 0 1 2.8-3.86 8 8 0 0 0-13.55 0c1.03 1.2 1.97 2.5 2.79 3.86a4 4 0 0 1 7.96 0zm14.29-11.86c1.3-.48 2.63-.87 4-1.15a25.99 25.99 0 0 0-44.55 0c1.38.28 2.72.67 4.01 1.15a21.98 21.98 0 0 1 36.54 0zm-5.43 2.71c1.13-.72 2.3-1.37 3.54-1.93a19.98 19.98 0 0 0-32.76 0c1.23.56 2.41 1.2 3.54 1.93a15.98 15.98 0 0 1 25.68 0zm-4.67 3.78c.94-.95 1.96-1.83 3.03-2.63a13.98 13.98 0 0 0-22.4 0c1.07.8 2.09 1.68 3.03 2.63a9.99 9.99 0 0 1 16.34 0z'%3E%3C/path%3E%3C/svg%3E");
16-
1716
}
1817

1918
#webchat {
@@ -116,15 +115,34 @@
116115
},
117116
{
118117
timestamp: timestamp(),
119-
channelData: { state: 'sent' },
120118
from: { role: 'user' },
121119
id: '4.0',
122-
text: 'Onboarding Checklist.doc',
120+
text: '',
121+
channelData: {
122+
state: 'sent',
123+
attachmentSizes: [65 * 1024]
124+
},
125+
attachments: [
126+
{
127+
contentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
128+
name: 'Onboarding Checklist.doc'
129+
}
130+
],
123131
type: 'message'
124132
},
125133
{
126134
timestamp: timestamp(),
127135
from: { role: 'bot' },
136+
suggestedActions: {
137+
actions: [
138+
{
139+
displayText: 'What else should I say?',
140+
text: 'What else should I say?',
141+
title: 'What else should I say?',
142+
type: 'messageBack'
143+
},
144+
]
145+
},
128146
"entities": [
129147
{
130148
"@context": "https://schema.org",
@@ -367,6 +385,16 @@
367385
}
368386
],
369387
from: { name: 'Onboarding Buddy', role: 'bot' },
388+
suggestedActions: {
389+
actions: [
390+
{
391+
displayText: 'Tell me more about onboarding process',
392+
text: 'Tell me more about onboarding process',
393+
title: 'Tell me more about onboarding process',
394+
type: 'messageBack'
395+
}
396+
]
397+
},
370398
"id": "7.1",
371399
"text": `I'm glad I could help! For your first day, here are some tips[1]:
372400

__tests__/html/fluentTheme/side-by-side.wide.html

+32-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
--colorBrandForeground2Pressed: hsl(237, 26%, 27%);
2626
--colorBrandStroke2Pressed: hsl(237, 49%, 57%);
2727
--colorBrandBackground2Pressed: hsl(237, 87%, 85%);
28+
--colorBrandStroke2: hsl(237, 53%, 68%);
2829
--shadow2: 0 0 2px rgba(0, 0, 0, 12%), 0 1px 2px rgba(0, 0, 0, 14%);
2930
}
3031

@@ -123,15 +124,34 @@
123124
},
124125
{
125126
timestamp: timestamp(),
126-
channelData: { state: 'sent' },
127127
from: { role: 'user' },
128128
id: '4.0',
129-
text: 'Onboarding Checklist.doc',
129+
text: '',
130+
channelData: {
131+
state: 'sent',
132+
attachmentSizes: [65 * 1024]
133+
},
134+
attachments: [
135+
{
136+
contentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
137+
name: 'Onboarding Checklist.doc'
138+
}
139+
],
130140
type: 'message'
131141
},
132142
{
133143
timestamp: timestamp(),
134144
from: { role: 'bot' },
145+
suggestedActions: {
146+
actions: [
147+
{
148+
displayText: 'What else should I say?',
149+
text: 'What else should I say?',
150+
title: 'What else should I say?',
151+
type: 'messageBack'
152+
},
153+
]
154+
},
135155
"entities": [
136156
{
137157
"@context": "https://schema.org",
@@ -374,6 +394,16 @@
374394
}
375395
],
376396
from: { name: 'Onboarding Buddy', role: 'bot' },
397+
suggestedActions: {
398+
actions: [
399+
{
400+
displayText: 'Tell me more about onboarding process',
401+
text: 'Tell me more about onboarding process',
402+
title: 'Tell me more about onboarding process',
403+
type: 'messageBack'
404+
}
405+
]
406+
},
377407
"id": "7.1",
378408
"text": `I'm glad I could help! For your first day, here are some tips[1]:
379409

packages/fluent-theme/src/components/activity/ActivityDecorator.module.css

+16
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,22 @@
118118
position: absolute;
119119
}
120120

121+
/* Message bubble attachment content */
122+
:global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout .webchat__bubble .webchat__fileContent__badge) {
123+
cursor: default;
124+
font-size: var(--webchat-fontSizeBase300);
125+
line-height: var(--webchat-lineHeightBase300);
126+
127+
:global(.webchat__fileContent__fileName) {
128+
color: var(--webchat-colorBrandForegroundLink);
129+
font-family: inherit;
130+
}
131+
:global(.webchat__fileContent__size) {
132+
color: var(--webchat-colorNeutralForeground2);
133+
font-family: inherit;
134+
}
135+
}
136+
121137
/* Markdown links and citation links */
122138
:global(.webchat-fluent) .activity-decorator :global(.webchat__render-markdown) a[href]:not(:global(.webchat__render-markdown__pure-identifier)) {
123139
color: var(--webchat-colorBrandForegroundLink);

packages/fluent-theme/src/components/suggestedActions/SuggestedAction.module.css

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
:global(.webchat-fluent) .suggested-action {
22
align-items: center;
33
background: transparent;
4-
border-radius: 8px;
5-
border: 1px solid var(--webchat-colorBrandStroke2);
4+
border-radius: var(--webchat-borderRadiusXLarge);
5+
border: var(--webchat-strokeWidthThin) solid var(--webchat-colorBrandStroke2);
66
color: currentColor;
77
cursor: pointer;
88
display: flex;
9-
font-size: 12px;
10-
gap: 4px;
11-
padding: 4px 8px 4px;
9+
font-family: var(--webchat__font--primary);
10+
font-size: var(--webchat-fontSizeBase200);
11+
gap: var(--webchat-spacingHorizontalXS);
12+
padding: var(--webchat-spacingVerticalXS) var(--webchat-spacingHorizontalS);
1213
text-align: start;
13-
transition: all .15s ease-out;
14+
transition: all var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
1415

1516
@media (hover: hover) {
1617
&:not([aria-disabled="true"]):hover {
@@ -29,7 +30,7 @@
2930
}
3031

3132
:global(.webchat-fluent) .suggested-action__image {
32-
font-size: 12px;
33+
font-size: var(--webchat-fontSizeBase200);
3334
height: 1em;
3435
width: 1em;
3536
}

0 commit comments

Comments
 (0)