Skip to content

Commit 3d24f14

Browse files
authored
fix(web-components): remove references to fast-web-utilities (#36106)
1 parent 77aee0e commit 3d24f14

30 files changed

Lines changed: 120 additions & 74 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "fix: remove deprecated fast-web-utilities references",
4+
"packageName": "@fluentui/web-components",
5+
"email": "13071055+chrisdholt@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/web-components/docs/web-components.api.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66

77
import { CaptureType } from '@microsoft/fast-element';
88
import { CSSDirective } from '@microsoft/fast-element';
9-
import { Direction } from '@microsoft/fast-web-utilities';
109
import { ElementStyles } from '@microsoft/fast-element';
1110
import { ElementViewTemplate } from '@microsoft/fast-element';
1211
import { FASTElement } from '@microsoft/fast-element';
1312
import { FASTElementDefinition } from '@microsoft/fast-element';
1413
import { HTMLDirective } from '@microsoft/fast-element';
15-
import { Orientation } from '@microsoft/fast-web-utilities';
1614
import { SyntheticViewTemplate } from '@microsoft/fast-element';
1715
import { ViewTemplate } from '@microsoft/fast-element';
1816

@@ -2566,6 +2564,15 @@ export const DialogType: {
25662564
// @public (undocumented)
25672565
export type DialogType = ValuesOf<typeof DialogType>;
25682566

2567+
// @public
2568+
export const Direction: {
2569+
readonly ltr: "ltr";
2570+
readonly rtl: "rtl";
2571+
};
2572+
2573+
// @public
2574+
export type Direction = (typeof Direction)[keyof typeof Direction];
2575+
25692576
// Warning: (ae-forgotten-export) The symbol "CSSDisplayPropertyValue" needs to be exported by the entry point index.d.ts
25702577
//
25712578
// @public
@@ -3419,6 +3426,15 @@ export const MessageBarStyles: ElementStyles;
34193426
// @public
34203427
export const MessageBarTemplate: ElementViewTemplate<MessageBar>;
34213428

3429+
// @public
3430+
export const Orientation: {
3431+
readonly horizontal: "horizontal";
3432+
readonly vertical: "vertical";
3433+
};
3434+
3435+
// @public
3436+
export type Orientation = (typeof Orientation)[keyof typeof Orientation];
3437+
34223438
// @public
34233439
export class ProgressBar extends BaseProgressBar {
34243440
shape?: ProgressBarShape;

packages/web-components/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@
8888
"chromedriver": "^125.0.0"
8989
},
9090
"dependencies": {
91-
"@microsoft/fast-web-utilities": "^6.0.0",
9291
"@fluentui/tokens": "1.0.0-alpha.23",
93-
"tabbable": "^6.2.0",
9492
"tslib": "^2.1.0"
9593
},
9694
"peerDependencies": {

packages/web-components/src/anchor-button/anchor-button.base.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { attr, FASTElement, Observable } from '@microsoft/fast-element';
2-
import { keyEnter } from '@microsoft/fast-web-utilities';
32
import { AnchorAttributes, type AnchorTarget } from './anchor-button.options.js';
43

54
/**
@@ -193,7 +192,7 @@ export class BaseAnchor extends FASTElement {
193192
*/
194193
public keydownHandler(e: KeyboardEvent): boolean | void {
195194
if (this.href) {
196-
if (e.key === keyEnter) {
195+
if (e.key === 'Enter') {
197196
const newTab = !this.isMac ? e.ctrlKey : e.metaKey || e.ctrlKey;
198197
this.handleNavigation(newTab);
199198
return;

packages/web-components/src/button/button.base.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { attr, FASTElement, observable } from '@microsoft/fast-element';
2-
import { keyEnter, keySpace } from '@microsoft/fast-web-utilities';
32
import { type ButtonFormTarget, ButtonType } from './button.options.js';
43

54
/**
@@ -347,7 +346,7 @@ export class BaseButton extends FASTElement {
347346
return;
348347
}
349348

350-
if (e.key === keyEnter || e.key === keySpace) {
349+
if (e.key === 'Enter' || e.key === ' ') {
351350
this.click();
352351
return;
353352
}

packages/web-components/src/divider/divider.options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Orientation } from '@microsoft/fast-web-utilities';
1+
import { Orientation } from '../utils/orientation.js';
22
import type { ValuesOf } from '../utils/typings.js';
33
import { FluentDesignSystem } from '../fluent-design-system.js';
44

packages/web-components/src/field/field.base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FASTElement, observable } from '@microsoft/fast-element';
2-
import { uniqueId } from '@microsoft/fast-web-utilities';
2+
import { uniqueId } from '../utils/unique-id.js';
33
import { toggleState } from '../utils/element-internals.js';
44
import { type SlottableInput, ValidationFlags } from './field.options.js';
55

packages/web-components/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,5 +331,6 @@ export {
331331
export { BaseTree, Tree, TreeDefinition, TreeTemplate, TreeStyles } from './tree/index.js';
332332
export { TreeItem, TreeItemDefinition, TreeItemTemplate, TreeItemStyles } from './tree-item/index.js';
333333
export type { isTreeItem, TreeItemAppearance, TreeItemSize } from './tree-item/index.js';
334-
export { getDirection } from './utils/direction.js';
334+
export { Direction, getDirection } from './utils/direction.js';
335+
export { Orientation } from './utils/orientation.js';
335336
export { display } from './utils/display.js';

packages/web-components/src/menu-item/menu-item.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { attr, FASTElement, observable } from '@microsoft/fast-element';
2-
import { keyArrowLeft, keyArrowRight, keyEnter, keySpace } from '@microsoft/fast-web-utilities';
32
import type { StartEndOptions } from '../patterns/start-end.js';
43
import { StartEnd } from '../patterns/start-end.js';
54
import { applyMixins } from '../utils/apply-mixins.js';
@@ -172,12 +171,12 @@ export class MenuItem extends FASTElement {
172171
}
173172

174173
switch (e.key) {
175-
case keyEnter:
176-
case keySpace:
174+
case 'Enter':
175+
case ' ':
177176
this.invoke();
178177
return false;
179178

180-
case keyArrowRight:
179+
case 'ArrowRight':
181180
//open/focus on submenu
182181
if (!this.disabled) {
183182
this.submenu?.togglePopover(true);
@@ -186,7 +185,7 @@ export class MenuItem extends FASTElement {
186185

187186
return false;
188187

189-
case keyArrowLeft:
188+
case 'ArrowLeft':
190189
//close submenu
191190
if (this.parentElement?.hasAttribute('popover')) {
192191
this.parentElement.togglePopover(false);

packages/web-components/src/menu-list/menu-list.base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FASTElement, observable, Updates } from '@microsoft/fast-element';
2-
import { isHTMLElement } from '@microsoft/fast-web-utilities';
2+
import { isHTMLElement } from '../utils/typings.js';
33
import type { MenuItemColumnCount } from '../menu-item/menu-item.js';
44
import type { MenuItem } from '../menu-item/menu-item.js';
55
import { isMenuItem, MenuItemRole } from '../menu-item/menu-item.options.js';

0 commit comments

Comments
 (0)