Skip to content

Commit 6d3254d

Browse files
Mnickiigavinbarronmusale
authored
fix: fix person-card to use fluent-card (#2487)
updates person card to use a fluent card revert agenda event card background color change closes #2512 fix playground background color and padding closes: #2505 set dev test page to use --fill-color for background updates theming stories with correct background color token --------- Co-authored-by: Gavin Barron <[email protected]> Co-authored-by: Musale Martin <[email protected]>
1 parent 0bbb487 commit 6d3254d

File tree

10 files changed

+28
-19
lines changed

10 files changed

+28
-19
lines changed

.storybook/addons/codeEditorAddon/codeAddon.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export const withCodeEditor = makeDecorator({
165165
? ''
166166
: `
167167
body {
168-
background-color: var(--neutral-fill-rest);
168+
background-color: var(--fill-color);
169169
color: var(--neutral-foreground-rest);
170170
font-family: var(--body-font);
171171
padding: 0 12px;
@@ -232,9 +232,6 @@ export const withCodeEditor = makeDecorator({
232232
${providerInitCode}
233233
</script>
234234
<style>
235-
html, body {
236-
height: 100%;
237-
}
238235
${themeToggleCss}
239236
${css}
240237
</style>

.storybook/preview-body.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
width: 100%;
77
font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto,
88
'Helvetica Neue', sans-serif;
9+
padding: 0!important;
910
}
1011

1112
.docs-img-centered {
@@ -24,6 +25,7 @@
2425
width: 100%;
2526
position: relative;
2627
display: flex;
28+
overflow: hidden;
2729
}
2830

2931
.story-mgt-preview {
@@ -98,6 +100,7 @@
98100
@media (max-width: 768px) {
99101
.story-mgt-root {
100102
flex-direction: column;
103+
overflow-y: auto;
101104
}
102105

103106
.story-mgt-preview-wrapper {

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
justify-content: flex-end;
2222
}
2323
body {
24-
background-color: var(--neutral-fill-rest);
24+
background-color: var(--fill-color);
2525
color: var(--neutral-foreground-rest);
2626
font-family: var(--body-font);
2727
padding: 24px 12px;
@@ -76,7 +76,7 @@ <h2>mgt-teams-channel-picker</h2>
7676
<!-- <h2>mgt-search-box</h2>
7777
<mgt-search-box search-term="contoso"></mgt-search-box>
7878
<h2>mgt-search-results</h2>
79-
<mgt-search-results query-string="contoso"></mgt-search-results> -->
79+
<mgt-search-results query-string="contoso"></mgt-search-results>
8080
</main>
8181
</body>
8282
</html>

packages/mgt-components/src/components/mgt-agenda/mgt-agenda.theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ $agenda-background-color: var(--agenda-background-color, transparent);
1515
$agenda-header-background-color: var(--agenda-header-background-color, var(--neutral-layer-floating));
1616
$agenda-header-border-color: var(--agenda-header-border-color, var(--neutral-foreground-rest));
1717
$agenda-event-border-color: var(--agenda-event-border-color, var(--neutral-layer-floating));
18-
$agenda-event-background-color: var(--agenda-event-background-color, transparent);
18+
$agenda-event-background-color: var(--agenda-event-background-color, var(--fill-color));

packages/mgt-components/src/components/mgt-person-card/mgt-person-card.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ $person-card-base-icons-left-spacing: var(--person-card-base-icons-left-spacing,
4343
--file-list-background-color: transparent;
4444
--file-list-box-shadow: none;
4545
--file-item-background-color: transparent;
46+
--card-height: auto;
4647

4748
.small {
4849
max-height: 100vh;
@@ -445,7 +446,8 @@ $person-card-base-icons-left-spacing: var(--person-card-base-icons-left-spacing,
445446

446447
:host fluent-button {
447448
&.section__show-more.lightweight::part(control),
448-
&.close-button.lightweight::part(control) {
449+
&.close-button.lightweight::part(control),
450+
&.expanded-details-button::part(control) {
449451
background: $person-card-fluent-background-color;
450452
}
451453

packages/mgt-components/src/components/mgt-person-card/mgt-person-card.theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@import '../../components/mgt-messages/mgt-messages.theme';
2020
@import '../../components/mgt-file-list/mgt-file-list.theme';
2121

22-
$person-card-background-color: var(--person-card-background-color, var(--neutral-layer-floating));
22+
$person-card-background-color: var(--person-card-background-color, transparent);
2323
$person-card-expanded-background-color-hover: var(
2424
--person-card-expanded-background-color-hover,
2525
var(--neutral-fill-hover)

packages/mgt-components/src/components/mgt-person-card/mgt-person-card.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ import '../sub-components/mgt-spinner/mgt-spinner';
4141

4242
export * from './mgt-person-card.types';
4343

44-
import { fluentTabs, fluentTab, fluentTabPanel, fluentButton, fluentTextField } from '@fluentui/web-components';
44+
import {
45+
fluentTabs,
46+
fluentTab,
47+
fluentTabPanel,
48+
fluentButton,
49+
fluentTextField,
50+
fluentCard
51+
} from '@fluentui/web-components';
4552
import { registerFluentComponents } from '../../utils/FluentComponents';
4653
import { BasePersonCardSection, CardSection } from '../BasePersonCardSection';
4754

48-
registerFluentComponents(fluentTabs, fluentTab, fluentTabPanel, fluentButton, fluentTextField);
55+
registerFluentComponents(fluentCard, fluentTabs, fluentTab, fluentTabPanel, fluentButton, fluentTextField);
4956

5057
interface MgtPersonCardStateHistory {
5158
state: MgtPersonCardState;
@@ -557,15 +564,15 @@ export class MgtPersonCard extends MgtTemplatedComponent {
557564
? html`<div @keydown=${this.handleEndOfCard} aria-label=${this.strings.endOfCard} tabindex="0" id="end-of-container"></div>`
558565
: html``;
559566
return html`
560-
<div class="root" dir=${this.direction}>
567+
<fluent-card class="root" dir=${this.direction}>
561568
<div class=${classMap({ small: this._smallView })}>
562569
${navigationTemplate}
563570
${closeCardTemplate}
564571
<div class="person-details-container">${personDetailsTemplate}</div>
565572
<div class="expanded-details-container">${expandedDetailsTemplate}</div>
566573
${tabLocker}
567574
</div>
568-
</div>
575+
</fluent-card>
569576
`;
570577
}
571578

stories/components/person/person.style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const customCSSProperties = () => html`
2828
2929
--person-line1-font-size: 20px;
3030
--person-line1-font-weight: 600;
31-
--person-line1-text-color: #f9b1b1;
31+
--person-line1-text-color: #ffd5d5;
3232
--person-line1-text-transform: capitalize;
3333
--person-line1-text-line-height: 22px;
3434

stories/components/theme-toggle/themeToggle.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const userPreferenceDriven = () => html`
3232
</p>
3333
<style>
3434
body {
35-
background-color: var(--neutral-fill-rest);
35+
background-color: var(--fill-color);
3636
color: var(--neutral-foreground-rest);
3737
font-family: var(--body-font);
3838
}
@@ -43,7 +43,7 @@ export const darkModeOn = () => html`
4343
<mgt-theme-toggle mode="dark"></mgt-theme-toggle>
4444
<style>
4545
body {
46-
background-color: var(--neutral-fill-rest);
46+
background-color: var(--fill-color);
4747
}
4848
</style>
4949
`;
@@ -52,7 +52,7 @@ export const lightModeOn = () => html`
5252
<mgt-theme-toggle mode="light"></mgt-theme-toggle>
5353
<style>
5454
body {
55-
background-color: var(--neutral-fill-rest);
55+
background-color: var(--fill-color);
5656
}
5757
</style>
5858
`;
@@ -81,7 +81,7 @@ export const localization = () => html`
8181
<mgt-theme-toggle></mgt-theme-toggle>
8282
<style>
8383
body {
84-
background-color: var(--neutral-fill-rest);
84+
background-color: var(--fill-color);
8585
}
8686
</style>
8787
<script>

stories/samples/general.stories.b.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if(body) applyTheme('dark', body);
4343
</script>
4444
<style>
4545
body {
46-
background-color: var(--neutral-fill-rest);
46+
background-color: var(--fill-color);
4747
color: var(--neutral-foreground-rest);
4848
font-family: var(--body-font);
4949
}

0 commit comments

Comments
 (0)