Skip to content

Commit d31b7f8

Browse files
committed
fix: focus outlines
1 parent 505852c commit d31b7f8

3 files changed

Lines changed: 30 additions & 29 deletions

File tree

packages/component/src/Middleware/ActivityGrouping/ui/PartGrouping/CollapsibleGrouping.module.css

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
font-weight: 400;
99
max-width: var(--webchat__max-width--message-bubble);
1010
min-width: var(--webchat__min-width--message-bubble);
11-
overflow: clip;
1211
position: relative;
1312
}
1413

@@ -39,16 +38,14 @@
3938
flex-direction: column;
4039
height: 0;
4140
interpolate-size: allow-keywords;
41+
margin: calc(var(--webchat__padding--regular) / -2);
42+
overflow: clip;
43+
padding: calc(var(--webchat__padding--regular) / 2);
4244
transition: visibility 0s, height 0.2s ease;
4345
visibility: hidden;
4446
}
4547

4648
:global(.webchat) .collapsible-grouping__content--open {
4749
visibility: unset;
4850
height: auto;
49-
50-
.collapsible-grouping__header {
51-
border-block-end: var(--webchat__border-width--bubble) var(--webchat__border-style--bubble)
52-
var(--webchat__border-color--bubble);
53-
}
5451
}

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,14 @@
9292
}
9393
}
9494

95-
:global(.stacked-layout .collapsible-grouping__content) {
96-
padding-inline: var(--webchat-spacingHorizontalNone);
97-
}
98-
9995
:global(.stacked-layout .collapsible-grouping__content .part-grouping-activity__activities) {
10096
gap: var(--webchat-spacingVerticalS);
10197
padding: var(--webchat-spacingVerticalL) var(--webchat-spacingHorizontalL);
10298
}
10399

104100
:global(.stacked-layout .collapsible-grouping) {
105101
display: grid;
102+
106103
&:global(.collapsible-grouping--open) {
107104
gap: var(--webchat-spacingVerticalM);
108105
}
@@ -409,11 +406,6 @@
409406
anchor-name: --webchat-flair;
410407
background: var(--webchat-colorNeutralBackground1);
411408
border-radius: var(--webchat-borderRadius2XLarge);
412-
margin: calc(var(--webchat-spacingVerticalMNudge) * -1) var(--webchat-spacingHorizontalNone);
413-
414-
&:global(.collapsible-grouping__content--open) {
415-
margin: var(--webchat-spacingVerticalNone) var(--webchat-spacingHorizontalNone);
416-
}
417409
}
418410

419411
:global(.stacked-layout .stacked-layout__message-status) {
@@ -443,16 +435,19 @@
443435
width: var(--webchat__bubble--max-width);
444436
}
445437

446-
&:not(.part-grouping-decorator--group) :global(.webchat__bubble__content) {
447-
display: flex;
448-
flex-direction: column;
449-
gap: var(--webchat-spacingVerticalS);
438+
:global(.webchat__bubble__content) {
450439
margin-block: calc(var(--webchat-spacingVerticalXS) * -1);
451440
margin-inline: calc(var(--webchat-spacingHorizontalS) * -1);
452441
padding-block: var(--webchat-spacingVerticalXS);
453442
padding-inline: var(--webchat-spacingHorizontalS);
454443
}
455444

445+
&:not(.part-grouping-decorator--group) :global(.webchat__bubble__content) {
446+
display: flex;
447+
flex-direction: column;
448+
gap: var(--webchat-spacingVerticalS);
449+
}
450+
456451
:global(.webchat__bubble .collapsible-content .collapsible-content__content .stacked-layout__attachment-list) {
457452
margin-block-start: var(--webchat-spacingVerticalS);
458453
}

packages/fluent-theme/src/components/theme/Theme.module.css

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
}
317317

318318
/* Transcript activity focused directly */
319-
> :global(.webchat__focus-trap .webchat__bubble) {
319+
> :global(.webchat__focus-trap > .webchat__basic-transcript__activity-body .webchat__bubble) {
320320
display: grid;
321321
grid-template-areas: 'focused-content';
322322
position: static;
@@ -334,17 +334,19 @@
334334
}
335335
}
336336

337-
&:has(:global(.collapsible-grouping)) > :global(.transcript-focus-area__indicator) {
338-
border-radius: var(--webchat-borderRadiusXLarge);
337+
&:has(:global(.collapsible-grouping)) > :global(.transcript-focus-area__content-overlay .transcript-focus-area__indicator) {
338+
display: none;
339+
}
340+
341+
:global(.collapsible-grouping)::after {
342+
border-radius: var(--webchat__bubble--border-radius);
343+
content: '';
339344
border: none;
340-
box-sizing: content-box;
341-
display: block;
342-
height: calc(100% - var(--webchat-spacingVerticalXS));
343-
margin: 0;
344-
margin: var(--webchat-spacingVerticalXXS) calc(var(--webchat-spacingHorizontalSNudge) * -1);
345345
outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
346-
padding: var(--webchat-spacingVerticalNone) var(--webchat-spacingHorizontalSNudge);
347-
width: 100%;
346+
position: absolute;
347+
pointer-events: none;
348+
inset: 0;
349+
isolation: isolate;
348350
}
349351

350352
:global(.activity-decorator .webchat__bubble .webchat__bubble__nub-pad) {
@@ -373,6 +375,13 @@
373375
}
374376
}
375377

378+
/* Transcript focused content copilot variant */
379+
:global(.webchat-fluent).theme.variant-copilot :global(.transcript-focus-area:focus-visible .transcript-focus-area__content--focused) {
380+
:global(.collapsible-grouping)::after {
381+
inset: -2px -4px;
382+
}
383+
}
384+
376385
/* Transcript filer in copilot variant */
377386
:global(.webchat-fluent).theme.variant-copilot :global(.webchat__basic-transcript .webchat__basic-transcript__filler) {
378387
/* No filler unless pre-chat activity, see next rule */

0 commit comments

Comments
 (0)