Skip to content

Commit

Permalink
chore(web-components): identify type-only imports and exports (#33160)
Browse files Browse the repository at this point in the history
  • Loading branch information
radium-v authored Oct 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 22ae5df commit 8614d04
Showing 74 changed files with 109 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "identify type-only imports and exports",
"packageName": "@fluentui/web-components",
"email": "[email protected]",
"dependentChangeType": "none"
}
2 changes: 1 addition & 1 deletion packages/web-components/docs/api-report.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ import type { HostBehavior } from '@microsoft/fast-element';
import type { HostController } from '@microsoft/fast-element';
import { HTMLDirective } from '@microsoft/fast-element';
import { Orientation } from '@microsoft/fast-web-utilities';
import type { SyntheticViewTemplate } from '@microsoft/fast-element';
import { SyntheticViewTemplate } from '@microsoft/fast-element';
import { ViewTemplate } from '@microsoft/fast-element';

// @public
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ElementViewTemplate, html, ref } from '@microsoft/fast-element';
import { endSlotTemplate, startSlotTemplate } from '../patterns/index.js';
import { type ElementViewTemplate, html, ref } from '@microsoft/fast-element';
import { startSlotTemplate } from '../patterns/index.js';
import { staticallyCompose } from '../utils/index.js';
import type { AccordionItem, AccordionItemOptions } from './accordion-item.js';

Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import { StartEnd } from '../patterns/index.js';
import type { StartEndOptions } from '../patterns/index.js';
import { applyMixins } from '../utils/apply-mixins.js';
import { toggleState } from '../utils/element-internals.js';
import { AccordionItemMarkerPosition, AccordionItemSize } from './accordion-item.options.js';
import type { AccordionItemMarkerPosition, AccordionItemSize } from './accordion-item.options.js';

/**
* Accordion Item configuration options
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { elements, ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import { elements, type ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import type { Accordion } from './accordion.js';

/**
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ export const AnchorButtonSize = ButtonSize;
*/
export type AnchorButtonSize = ValuesOf<typeof AnchorButtonSize>;

export { AnchorOptions as AnchorButtonOptions };
export type { AnchorOptions as AnchorButtonOptions };

/**
* Anchor target values.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html, ViewTemplate } from '@microsoft/fast-element';
import { type ElementViewTemplate, html, type ViewTemplate } from '@microsoft/fast-element';
import { endSlotTemplate, startSlotTemplate } from '../patterns/index.js';
import type { AnchorButton, AnchorOptions } from './anchor-button.js';

2 changes: 1 addition & 1 deletion packages/web-components/src/avatar/avatar.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '@playwright/test';
import { expect, fixtureURL } from '../helpers.tests.js';
import type { Avatar } from './avatar.js';
import { AvatarAppearance, AvatarColor, AvatarSize } from './avatar.options.js';
import type { AvatarAppearance, AvatarColor, AvatarSize } from './avatar.options.js';

test.describe('Avatar Component', () => {
test.beforeEach(async ({ page }) => {
2 changes: 1 addition & 1 deletion packages/web-components/src/avatar/avatar.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import type { Avatar } from './avatar.js';

const defaultIconTemplate = html`<svg
10 changes: 5 additions & 5 deletions packages/web-components/src/avatar/avatar.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { attr, FASTElement, nullableNumberConverter, observable, Observable, Updates } from '@microsoft/fast-element';
import { attr, FASTElement, nullableNumberConverter, Observable } from '@microsoft/fast-element';
import { getInitials } from '../utils/get-initials.js';
import { toggleState } from '../utils/element-internals.js';
import {
AvatarActive,
AvatarAppearance,
type AvatarActive,
type AvatarAppearance,
AvatarColor,
AvatarNamedColor,
AvatarShape,
AvatarSize,
type AvatarShape,
type AvatarSize,
} from './avatar.options.js';

/**
2 changes: 1 addition & 1 deletion packages/web-components/src/badge/badge.options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StartEndOptions } from '../patterns/index.js';
import type { StartEndOptions } from '../patterns/index.js';
import type { StaticallyComposableHTML, ValuesOf } from '../utils/index.js';
import type { Badge } from './badge.js';

2 changes: 1 addition & 1 deletion packages/web-components/src/badge/badge.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import { endSlotTemplate, startSlotTemplate } from '../patterns/index.js';
import { staticallyCompose } from '../utils/template-helpers.js';
import type { Badge } from './badge.js';
2 changes: 1 addition & 1 deletion packages/web-components/src/badge/badge.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { attr, FASTElement } from '@microsoft/fast-element';
import { applyMixins } from '../utils/apply-mixins.js';
import { StartEnd } from '../patterns/index.js';
import { toggleState } from '../utils/element-internals.js';
import { BadgeAppearance, BadgeColor, BadgeShape, BadgeSize } from './badge.options.js';
import { BadgeAppearance, BadgeColor, type BadgeShape, type BadgeSize } from './badge.options.js';

/**
* The base class used for constructing a fluent-badge custom element
2 changes: 1 addition & 1 deletion packages/web-components/src/button/button.options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StartEndOptions } from '../patterns/index.js';
import type { StartEndOptions } from '../patterns/index.js';
import type { ValuesOf } from '../utils/index.js';
import type { Button } from './button.js';

4 changes: 2 additions & 2 deletions packages/web-components/src/button/button.template.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import { type ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import { endSlotTemplate, startSlotTemplate } from '../patterns/index.js';
import type { Button } from './button.js';
import { ButtonOptions } from './button.options.js';
import type { ButtonOptions } from './button.options.js';

/**
* Generates a template for the Button component.
2 changes: 1 addition & 1 deletion packages/web-components/src/checkbox/checkbox.stories.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { html, repeat } from '@microsoft/fast-element';
import { uniqueId } from '@microsoft/fast-web-utilities';
import { LabelPosition, ValidationFlags } from '../field/field.options.js';
import { type Meta, renderComponent, type StoryArgs, type StoryObj } from '../helpers.stories.js';
import { Checkbox as FluentCheckbox } from './checkbox.js';
import type { Checkbox as FluentCheckbox } from './checkbox.js';
import { CheckboxShape, CheckboxSize } from './checkbox.options.js';

type Story = StoryObj<FluentCheckbox>;
2 changes: 1 addition & 1 deletion packages/web-components/src/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { attr, FASTElement, Observable, observable } from '@microsoft/fast-element';
import { toggleState } from '../utils/element-internals.js';
import { CheckboxShape, CheckboxSize } from './checkbox.options.js';
import type { CheckboxShape, CheckboxSize } from './checkbox.options.js';

/**
* The base class for a component with a toggleable checked state.
Original file line number Diff line number Diff line change
@@ -38,4 +38,4 @@ export const CompoundButtonSize = ButtonSize;
*/
export type CompoundButtonSize = ValuesOf<typeof CompoundButtonSize>;

export { ButtonOptions as CompoundButtonOptions };
export type { ButtonOptions as CompoundButtonOptions };
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import { type ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import { endSlotTemplate, startSlotTemplate } from '../patterns/index.js';
import type { CompoundButton } from './compound-button.js';
import type { CompoundButtonOptions } from './compound-button.options.js';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BadgeOptions } from '../badge/badge.options.js';
import type { BadgeOptions } from '../badge/badge.options.js';
import type { ValuesOf } from '../utils/index.js';

/**
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import { badgeTemplate } from '../badge/badge.template.js';
import { Badge } from '../badge/badge.js';
import { CounterBadge } from './counter-badge.js';
import { CounterBadgeOptions } from './counter-badge.options.js';
import type { Badge } from '../badge/badge.js';
import type { CounterBadge } from './counter-badge.js';
import type { CounterBadgeOptions } from './counter-badge.options.js';

function composeTemplate<T extends CounterBadge & Badge>(options: CounterBadgeOptions = {}): ElementViewTemplate<T> {
return badgeTemplate<T>({
2 changes: 1 addition & 1 deletion packages/web-components/src/counter-badge/counter-badge.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { attr, FASTElement, nullableNumberConverter } from '@microsoft/fast-elem
import { applyMixins } from '../utils/apply-mixins.js';
import { StartEnd } from '../patterns/index.js';
import { toggleState } from '../utils/element-internals.js';
import {
import type {
CounterBadgeAppearance,
CounterBadgeColor,
CounterBadgeShape,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html, ref } from '@microsoft/fast-element';
import { type ElementViewTemplate, html, ref } from '@microsoft/fast-element';
import { DialogType } from '../dialog/dialog.options.js';

const dismissed16Regular = html.partial(`
2 changes: 1 addition & 1 deletion packages/web-components/src/dialog/dialog.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test';
import type { Locator } from '@playwright/test';
import { fixtureURL } from '../helpers.tests.js';
import { Dialog } from './dialog.js';
import type { Dialog } from './dialog.js';

async function getPointOutside(element: Locator) {
// Get the bounding box of the element
2 changes: 1 addition & 1 deletion packages/web-components/src/dialog/dialog.stories.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { css, html, ref } from '@microsoft/fast-element';
import type { DialogBody as FluentDialogBody } from '../dialog-body/dialog-body.js';
import { generateImage, Meta, renderComponent, type StoryArgs, type StoryObj } from '../helpers.stories.js';
import { generateImage, type Meta, renderComponent, type StoryArgs, type StoryObj } from '../helpers.stories.js';
import { definition } from './dialog.definition.js';
import type { Dialog as FluentDialog } from './dialog.js';
import { DialogType } from './dialog.options.js';
2 changes: 1 addition & 1 deletion packages/web-components/src/dialog/dialog.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html, ref } from '@microsoft/fast-element';
import { type ElementViewTemplate, html, ref } from '@microsoft/fast-element';
import type { Dialog } from './dialog.js';
import { DialogType } from './dialog.options.js';

2 changes: 1 addition & 1 deletion packages/web-components/src/divider/divider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from '@playwright/test';
import { expect, fixtureURL } from '../helpers.tests.js';
import { Divider } from './divider.js';
import type { Divider } from './divider.js';

test.describe('Divider', () => {
test.beforeEach(async ({ page }) => {
2 changes: 1 addition & 1 deletion packages/web-components/src/divider/divider.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import type { Divider } from './divider.js';

export function dividerTemplate<T extends Divider>(): ElementViewTemplate<T> {
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import type { DrawerBody } from './drawer-body.js';

/**
2 changes: 1 addition & 1 deletion packages/web-components/src/drawer/drawer.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html, ref } from '@microsoft/fast-element';
import { type ElementViewTemplate, html, ref } from '@microsoft/fast-element';
import type { Drawer } from './drawer.js';

/**
2 changes: 1 addition & 1 deletion packages/web-components/src/field/field.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from '@playwright/test';
import { expect, fixtureURL } from '../helpers.tests.js';
import { TextInput } from '../index.js';
import type { TextInput } from '../index.js';
import type { Field } from './field.js';

test.describe('Field', () => {
2 changes: 1 addition & 1 deletion packages/web-components/src/field/field.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { children, elements, ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import { children, elements, type ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import type { Field } from './field.js';

/**
2 changes: 1 addition & 1 deletion packages/web-components/src/field/field.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { attr, FASTElement, observable } from '@microsoft/fast-element';
import { uniqueId } from '@microsoft/fast-web-utilities';
import { toggleState } from '../utils/element-internals.js';
import { LabelPosition, SlottableInput, ValidationFlags } from './field.options.js';
import { LabelPosition, type SlottableInput, ValidationFlags } from './field.options.js';

/**
* A Field Custom HTML Element.
2 changes: 1 addition & 1 deletion packages/web-components/src/image/image.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import type { Image } from './image.js';

/**
2 changes: 1 addition & 1 deletion packages/web-components/src/image/image.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { attr, FASTElement } from '@microsoft/fast-element';
import { toggleState } from '../utils/element-internals.js';
import { ImageFit, ImageShape } from './image.options.js';
import type { ImageFit, ImageShape } from './image.options.js';

/**
* The base class used for constucting a fluent image custom element
4 changes: 2 additions & 2 deletions packages/web-components/src/label/label.template.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { Label } from './label.js';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import type { Label } from './label.js';

/**
* The template for the Fluent label web-component.
2 changes: 1 addition & 1 deletion packages/web-components/src/label/label.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { attr, FASTElement } from '@microsoft/fast-element';
import { toggleState } from '../utils/element-internals.js';
import { LabelSize, LabelWeight } from './label.options.js';
import type { LabelSize, LabelWeight } from './label.options.js';

/**
* The base class used for constructing a fluent-label custom element
2 changes: 1 addition & 1 deletion packages/web-components/src/link/link.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { spinalCase } from '@microsoft/fast-web-utilities';
import { test } from '@playwright/test';
import { expect, fixtureURL } from '../helpers.tests.js';
import { Link } from './link.js';
import type { Link } from './link.js';

const proxyAttributes = {
href: 'href',
2 changes: 1 addition & 1 deletion packages/web-components/src/link/link.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html, ViewTemplate } from '@microsoft/fast-element';
import { type ElementViewTemplate, html, ViewTemplate } from '@microsoft/fast-element';
import type { Link } from './link.js';

/**
2 changes: 1 addition & 1 deletion packages/web-components/src/link/link.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { attr } from '@microsoft/fast-element';
import { BaseAnchor } from '../anchor-button/anchor-button.js';
import { toggleState } from '../utils/element-internals.js';
import { type LinkAppearance } from './link.options.js';
import type { LinkAppearance } from './link.options.js';

/**
* An Anchor Custom HTML Element.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import { buttonTemplate } from '../button/button.template.js';
import type { MenuButton } from './menu-button.js';

4 changes: 2 additions & 2 deletions packages/web-components/src/menu-item/menu-item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { attr, ElementsFilter, FASTElement, observable } from '@microsoft/fast-element';
import { attr, type ElementsFilter, FASTElement, observable } from '@microsoft/fast-element';
import { keyArrowLeft, keyArrowRight, keyEnter, keySpace } from '@microsoft/fast-web-utilities';
import { MenuList } from '../menu-list/menu-list.js';
import type { MenuList } from '../menu-list/menu-list.js';
import type { StartEndOptions } from '../patterns/start-end.js';
import { StartEnd } from '../patterns/start-end.js';
import { applyMixins } from '../utils/apply-mixins.js';
3 changes: 1 addition & 2 deletions packages/web-components/src/menu-list/menu-list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { once } from 'events';
import { test } from '@playwright/test';
import { expect, fixtureURL } from '../helpers.tests.js';
import type { MenuItem } from '../menu-item/menu-item.js';
import { MenuItemRole } from '../menu-item/menu-item.options.js';
import { MenuItem } from '../menu-item/menu-item.js';

test.describe('Menu', () => {
test.beforeEach(async ({ page }) => {
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import { type ElementViewTemplate, html, slotted } from '@microsoft/fast-element';
import type { MenuList } from './menu-list.js';

export function menuTemplate<T extends MenuList>(): ElementViewTemplate<T> {
2 changes: 1 addition & 1 deletion packages/web-components/src/menu/menu.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { elements, ElementViewTemplate, html, ref, slotted } from '@microsoft/fast-element';
import { elements, type ElementViewTemplate, html, ref, slotted } from '@microsoft/fast-element';
import type { Menu } from './menu.js';

export function menuTemplate<T extends Menu>(): ElementViewTemplate<T> {
2 changes: 1 addition & 1 deletion packages/web-components/src/menu/menu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { attr, FASTElement, observable, Updates } from '@microsoft/fast-element';
import { keyEnter, keyEscape, keySpace, keyTab } from '@microsoft/fast-web-utilities';
import { MenuList } from '../menu-list/menu-list.js';
import type { MenuList } from '../menu-list/menu-list.js';
import { MenuItem } from '../menu-item/menu-item.js';
import { MenuItemRole } from '../menu-item/menu-item.options.js';

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { html, repeat } from '@microsoft/fast-element';
import { type Meta, renderComponent, type StoryArgs, type StoryObj } from '../helpers.stories.js';
import { MessageBar as FluentMessageBar } from './message-bar.js';
import type { MessageBar as FluentMessageBar } from './message-bar.js';
import { MessageBarIntent, MessageBarLayout, MessageBarShape } from './message-bar.options.js';
import './define';

type Story = StoryObj<FluentMessageBar>;

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementViewTemplate, html } from '@microsoft/fast-element';
import { type ElementViewTemplate, html } from '@microsoft/fast-element';
import type { MessageBar } from './message-bar.js';

/**
2 changes: 1 addition & 1 deletion packages/web-components/src/message-bar/message-bar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { attr, FASTElement } from '@microsoft/fast-element';
import { toggleState } from '../utils/element-internals.js';
import { MessageBarIntent, MessageBarLayout, MessageBarShape } from './message-bar.options.js';
import type { MessageBarIntent, MessageBarLayout, MessageBarShape } from './message-bar.options.js';

/**
* A Message Bar Custom HTML Element.
2 changes: 1 addition & 1 deletion packages/web-components/src/patterns/start-end.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Copied from @microsoft/fast-foundation

import { CaptureType, html, ref } from '@microsoft/fast-element';
import { type CaptureType, html, ref } from '@microsoft/fast-element';
import type { StaticallyComposableHTML } from '../utils/index.js';
import { staticallyCompose } from '../utils/index.js';

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { StaticallyComposableHTML, ValuesOf } from '../utils/index.js';
import { ProgressBar } from './progress-bar.js';
import type { ValuesOf } from '../utils/index.js';

/**
* ProgressBarThickness Constants
Loading

0 comments on commit 8614d04

Please sign in to comment.