@fluentui/web-components 3.0.0-beta.102 → 3.0.0-beta.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,22 @@
1
1
  # Change Log - @fluentui/web-components
2
2
 
3
- This log was last generated on Wed, 21 May 2025 04:07:14 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 22 May 2025 04:06:39 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [3.0.0-beta.103](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.103)
8
+
9
+ Thu, 22 May 2025 04:06:39 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.102..@fluentui/web-components_v3.0.0-beta.103)
11
+
12
+ ### Changes
13
+
14
+ - Fixed compound-button high contrast text colors. ([PR #34490](https://github.com/microsoft/fluentui/pull/34490) by 601470+mlijanto@users.noreply.github.com)
15
+ - Adds click event to close slot of drawer ([PR #34479](https://github.com/microsoft/fluentui/pull/34479) by jes@microsoft.com)
16
+
7
17
  ## [3.0.0-beta.102](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.102)
8
18
 
9
- Wed, 21 May 2025 04:07:14 GMT
19
+ Wed, 21 May 2025 04:07:25 GMT
10
20
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.101..@fluentui/web-components_v3.0.0-beta.102)
11
21
 
12
22
  ### Changes
@@ -14,5 +14,5 @@ export declare class DialogBody extends FASTElement {
14
14
  * @param e - the click event
15
15
  * @internal
16
16
  */
17
- clickHandler(event: MouseEvent): boolean | void;
17
+ clickHandler(event: PointerEvent): boolean | void;
18
18
  }
@@ -20,4 +20,11 @@ import { FASTElement } from '@microsoft/fast-element';
20
20
  * @tag fluent-drawer-body
21
21
  */
22
22
  export declare class DrawerBody extends FASTElement {
23
+ /**
24
+ * Handles click event for the close slot
25
+ *
26
+ * @param e - the click event
27
+ * @internal
28
+ */
29
+ clickHandler(event: PointerEvent): boolean | void;
23
30
  }
@@ -1,6 +1,7 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { styles as ButtonStyles } from '../button/button.styles.js';
3
3
  import { colorNeutralForeground2, colorNeutralForeground2BrandHover, colorNeutralForeground2BrandPressed, colorNeutralForeground2Hover, colorNeutralForeground2Pressed, colorNeutralForegroundDisabled, colorNeutralForegroundOnBrand, fontSizeBase200, fontSizeBase300, fontSizeBase400, fontWeightRegular, lineHeightBase300, lineHeightBase400, spacingHorizontalS, spacingHorizontalSNudge, spacingHorizontalXS, } from '../theme/design-tokens.js';
4
+ import { forcedColorsStylesheetBehavior } from '../utils/index';
4
5
  // Need to support icon hover styles
5
6
  export const styles = css `
6
7
  ${ButtonStyles}
@@ -99,5 +100,10 @@ export const styles = css `
99
100
  :host([size='large']) ::slotted([slot='description']) {
100
101
  font-size: ${fontSizeBase300};
101
102
  }
102
- `;
103
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
104
+ :host([appearance='primary']:not(:hover, :focus-visible, :disabled, [disabled-focusable]))
105
+ ::slotted([slot='description']) {
106
+ color: HighlightText;
107
+ }
108
+ `));
103
109
  //# sourceMappingURL=compound-button.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compound-button.styles.js","sourceRoot":"","sources":["../../../src/compound-button/compound-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,oCAAoC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,YAAY;;;;;;;;;iBASC,eAAe;mBACb,iBAAiB;;;;;;;;;;aAUvB,uBAAuB;;iBAEnB,eAAe;mBACb,iBAAiB;;;;;;;;;;;aAWvB,4BAA4B;;;;aAI5B,8BAA8B;;;;aAI9B,6BAA6B;;;;;aAK7B,uBAAuB;;;;aAIvB,iCAAiC;;;;aAIjC,mCAAmC;;;;;aAKnC,8BAA8B;;;;;;;;;;;eAW5B,uBAAuB;;;;;;eAMvB,mBAAmB;;;;;;eAMnB,kBAAkB;;;;;;;iBAOhB,eAAe;mBACb,iBAAiB;;;iBAGnB,eAAe;;CAE/B,CAAC"}
1
+ {"version":3,"file":"compound-button.styles.js","sourceRoot":"","sources":["../../../src/compound-button/compound-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAEhE,oCAAoC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,YAAY;;;;;;;;;iBASC,eAAe;mBACb,iBAAiB;;;;;;;;;;aAUvB,uBAAuB;;iBAEnB,eAAe;mBACb,iBAAiB;;;;;;;;;;;aAWvB,4BAA4B;;;;aAI5B,8BAA8B;;;;aAI9B,6BAA6B;;;;;aAK7B,uBAAuB;;;;aAIvB,iCAAiC;;;;aAIjC,mCAAmC;;;;;aAKnC,8BAA8B;;;;;;;;;;;eAW5B,uBAAuB;;;;;;eAMvB,mBAAmB;;;;;;eAMnB,kBAAkB;;;;;;;iBAOhB,eAAe;mBACb,iBAAiB;;;iBAGnB,eAAe;;CAE/B,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;;GAKjC,CAAC,CACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-body.js","sourceRoot":"","sources":["../../../src/dialog-body/dialog-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD;;;;;;;GAOG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;OAKG;IACI,YAAY,CAAC,KAAiB;QACnC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;YAElC,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrB,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
1
+ {"version":3,"file":"dialog-body.js","sourceRoot":"","sources":["../../../src/dialog-body/dialog-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD;;;;;;;GAOG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;OAKG;IACI,YAAY,CAAC,KAAmB;QACrC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;YAElC,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrB,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -1,4 +1,5 @@
1
1
  import { FASTElement } from '@microsoft/fast-element';
2
+ import { isDialog } from '../dialog/dialog.options';
2
3
  /**
3
4
  * A DrawerBody component to layout drawer content
4
5
  *
@@ -20,5 +21,20 @@ import { FASTElement } from '@microsoft/fast-element';
20
21
  * @tag fluent-drawer-body
21
22
  */
22
23
  export class DrawerBody extends FASTElement {
24
+ /**
25
+ * Handles click event for the close slot
26
+ *
27
+ * @param e - the click event
28
+ * @internal
29
+ */
30
+ clickHandler(event) {
31
+ if (!event.defaultPrevented) {
32
+ const dialog = this.parentElement;
33
+ if (isDialog(dialog, '-drawer')) {
34
+ dialog.hide();
35
+ }
36
+ }
37
+ return true;
38
+ }
23
39
  }
24
40
  //# sourceMappingURL=drawer-body.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-body.js","sourceRoot":"","sources":["../../../src/drawer-body/drawer-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;CAAG"}
1
+ {"version":3,"file":"drawer-body.js","sourceRoot":"","sources":["../../../src/drawer-body/drawer-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;OAKG;IACI,YAAY,CAAC,KAAmB;QACrC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;YAElC,IAAI,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC;gBAChC,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -7,7 +7,7 @@ export function drawerBodyTemplate() {
7
7
  return html `
8
8
  <div class="header" part="header">
9
9
  <slot name="title"></slot>
10
- <slot name="close"></slot>
10
+ <slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot>
11
11
  </div>
12
12
  <div class="content" part="content">
13
13
  <slot></slot>
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-body.template.js","sourceRoot":"","sources":["../../../src/drawer-body/drawer-body.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGzE;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAG;;;;;;;;;;;GAWb,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAoC,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"drawer-body.template.js","sourceRoot":"","sources":["../../../src/drawer-body/drawer-body.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGzE;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAG;;;mCAGmB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAqB,CAAC;;;;;;;;GAQjF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAoC,kBAAkB,EAAE,CAAC"}
@@ -6228,7 +6228,7 @@ export declare class DialogBody extends FASTElement {
6228
6228
  * @param e - the click event
6229
6229
  * @internal
6230
6230
  */
6231
- clickHandler(event: MouseEvent): boolean | void;
6231
+ clickHandler(event: PointerEvent): boolean | void;
6232
6232
  }
6233
6233
 
6234
6234
  /**
@@ -6527,6 +6527,13 @@ export declare class Drawer extends FASTElement {
6527
6527
  * @tag fluent-drawer-body
6528
6528
  */
6529
6529
  export declare class DrawerBody extends FASTElement {
6530
+ /**
6531
+ * Handles click event for the close slot
6532
+ *
6533
+ * @param e - the click event
6534
+ * @internal
6535
+ */
6536
+ clickHandler(event: PointerEvent): boolean | void;
6530
6537
  }
6531
6538
 
6532
6539
  /**
@@ -6546,7 +6546,9 @@ const styles$z = css`
6546
6546
 
6547
6547
  :host,:host(:is([size])){gap:12px;height:auto;padding-top:14px;padding-inline:12px;padding-bottom:16px;font-size:${fontSizeBase300};line-height:${lineHeightBase300}}.content{display:flex;flex-direction:column;text-align:start}::slotted([slot='description']){color:${colorNeutralForeground2};line-height:100%;font-size:${fontSizeBase200};font-weight:${fontWeightRegular}}::slotted(svg),:host([size='large']) ::slotted(svg){font-size:40px;height:40px;width:40px}:host(:hover) ::slotted([slot='description']){color:${colorNeutralForeground2Hover}}:host(:active) ::slotted([slot='description']){color:${colorNeutralForeground2Pressed}}:host(:is([appearance='primary'],[appearance='primary']:is(:hover,:active))) ::slotted([slot='description']){color:${colorNeutralForegroundOnBrand}}:host(:is([appearance='transparent'],[appearance='subtle'],[appearance='subtle']:is(:hover,:active)))
6548
6548
  ::slotted([slot='description']){color:${colorNeutralForeground2}}:host([appearance='transparent']:hover) ::slotted([slot='description']){color:${colorNeutralForeground2BrandHover}}:host([appearance='transparent']:active) ::slotted([slot='description']){color:${colorNeutralForeground2BrandPressed}}:host(:is(:disabled,:disabled[appearance],[disabled-focusable],[disabled-focusable][appearance]))
6549
- ::slotted([slot='description']){color:${colorNeutralForegroundDisabled}}:host([size='small']){padding:8px;padding-bottom:10px}:host([icon-only]){min-width:52px;max-width:52px;padding:${spacingHorizontalSNudge}}:host([icon-only][size='small']){min-width:48px;max-width:48px;padding:${spacingHorizontalXS}}:host([icon-only][size='large']){min-width:56px;max-width:56px;padding:${spacingHorizontalS}}:host([size='large']){padding-top:18px;padding-inline:16px;padding-bottom:20px;font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted([slot='description']){font-size:${fontSizeBase300}}`;
6549
+ ::slotted([slot='description']){color:${colorNeutralForegroundDisabled}}:host([size='small']){padding:8px;padding-bottom:10px}:host([icon-only]){min-width:52px;max-width:52px;padding:${spacingHorizontalSNudge}}:host([icon-only][size='small']){min-width:48px;max-width:48px;padding:${spacingHorizontalXS}}:host([icon-only][size='large']){min-width:56px;max-width:56px;padding:${spacingHorizontalS}}:host([size='large']){padding-top:18px;padding-inline:16px;padding-bottom:20px;font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted([slot='description']){font-size:${fontSizeBase300}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
6550
+ :host([appearance='primary']:not(:hover,:focus-visible,:disabled,[disabled-focusable]))
6551
+ ::slotted([slot='description']){color:HighlightText}`));
6550
6552
 
6551
6553
  function buttonTemplate(options = {}) {
6552
6554
  return html`<template ?disabled="${x => x.disabled}" tabindex="${x => x.disabled ? null : x.tabIndex ?? 0}">${startSlotTemplate(options)}<span class="content" part="content"><slot ${slotted("defaultSlottedContent")}></slot><slot name="description"></slot></span>${endSlotTemplate(options)}</template>`;
@@ -7012,14 +7014,30 @@ const definition$v = Drawer.compose({
7012
7014
 
7013
7015
  definition$v.define(FluentDesignSystem.registry);
7014
7016
 
7015
- class DrawerBody extends FASTElement {}
7017
+ class DrawerBody extends FASTElement {
7018
+ /**
7019
+ * Handles click event for the close slot
7020
+ *
7021
+ * @param e - the click event
7022
+ * @internal
7023
+ */
7024
+ clickHandler(event) {
7025
+ if (!event.defaultPrevented) {
7026
+ const dialog = this.parentElement;
7027
+ if (isDialog(dialog, "-drawer")) {
7028
+ dialog.hide();
7029
+ }
7030
+ }
7031
+ return true;
7032
+ }
7033
+ }
7016
7034
 
7017
7035
  const styles$t = css`
7018
7036
  ${display("grid")}
7019
7037
  :host{box-sizing:border-box;grid-template-rows:min-content auto min-content;position:relative;height:100%;padding:${spacingHorizontalXL};max-height:100svh}.header{display:flex;justify-content:space-between;align-items:center;${typographySubtitle1Styles}}.footer{display:flex;justify-content:flex-start;gap:${spacingHorizontalM}}::slotted([slot='title']){font:inherit;padding:0;margin:0}`;
7020
7038
 
7021
7039
  function drawerBodyTemplate() {
7022
- return html`<div class="header" part="header"><slot name="title"></slot><slot name="close"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
7040
+ return html`<div class="header" part="header"><slot name="title"></slot><slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
7023
7041
  }
7024
7042
  const template$u = drawerBodyTemplate();
7025
7043