Skip to content

Commit

Permalink
chore(web-components): add missing export for textarea (#32450)
Browse files Browse the repository at this point in the history
  • Loading branch information
davatron5000 authored Sep 4, 2024
1 parent 185bb89 commit 416d7dd
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: add missing export for textarea",
"packageName": "@fluentui/web-components",
"email": "rupertdavid@microsoft.com",
"dependentChangeType": "patch"
}
72 changes: 70 additions & 2 deletions packages/web-components/docs/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2277,7 +2277,6 @@ export const DividerAppearance: {
readonly strong: "strong";
readonly brand: "brand";
readonly subtle: "subtle";
readonly default: "default";
};

// @public
Expand Down Expand Up @@ -2544,7 +2543,6 @@ export const ImageFit: {
readonly center: "center";
readonly contain: "contain";
readonly cover: "cover";
readonly default: "default";
};

// @public
Expand Down Expand Up @@ -2667,6 +2665,11 @@ export type LinkAppearance = ValuesOf<typeof LinkAppearance>;
// @public (undocumented)
export const LinkDefinition: FASTElementDefinition<typeof Link>;

// Warning: (ae-missing-release-tag) "styles" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const LinkStyles: ElementStyles;

// @public
export const LinkTarget: {
readonly _self: "_self";
Expand Down Expand Up @@ -2892,6 +2895,66 @@ export const MenuStyles: ElementStyles;
// @public (undocumented)
export const MenuTemplate: ElementViewTemplate<Menu>;

// @public
export class MessageBar extends FASTElement {
constructor();
dismissMessageBar: () => void;
// @internal
elementInternals: ElementInternals;
intent?: MessageBarIntent;
intentChanged(prev: MessageBarIntent | undefined, next: MessageBarIntent | undefined): void;
layout?: MessageBarLayout;
layoutChanged(prev: MessageBarLayout | undefined, next: MessageBarLayout | undefined): void;
shape?: MessageBarShape;
shapeChanged(prev: MessageBarShape | undefined, next: MessageBarShape | undefined): void;
}

// @public
export const MessageBarDefinition: FASTElementDefinition<typeof MessageBar>;

// Warning: (ae-missing-release-tag) "MessageBarIntent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export const MessageBarIntent: {
readonly success: "success";
readonly warning: "warning";
readonly error: "error";
readonly info: "info";
};

// @public (undocumented)
export type MessageBarIntent = ValuesOf<typeof MessageBarIntent>;

// Warning: (ae-missing-release-tag) "MessageBarLayout" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export const MessageBarLayout: {
readonly multiline: "multiline";
readonly singleline: "singleline";
};

// @public (undocumented)
export type MessageBarLayout = ValuesOf<typeof MessageBarLayout>;

// Warning: (ae-missing-release-tag) "MessageBarShape" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export const MessageBarShape: {
readonly rounded: "rounded";
readonly square: "square";
};

// @public (undocumented)
export type MessageBarShape = ValuesOf<typeof MessageBarShape>;

// @public
export const MessageBarStyles: ElementStyles;

// Warning: (ae-missing-release-tag) "template" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export const MessageBarTemplate: ElementViewTemplate<MessageBar>;

// @public
class ProgressBar_2 extends BaseProgressBar {
shape?: ProgressBarShape;
Expand Down Expand Up @@ -3739,6 +3802,11 @@ export const TextAreaAppearance: {
// @public (undocumented)
export type TextAreaAppearance = ValuesOf<typeof TextAreaAppearance>;

// Warning: (ae-missing-release-tag) "TextAreaAppearancesForDisplayShadow" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const TextAreaAppearancesForDisplayShadow: Partial<TextAreaAppearance[]>;

// Warning: (ae-missing-release-tag) "TextAreaAutocomplete" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
Expand Down
1 change: 1 addition & 0 deletions packages/web-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export {
BaseTextArea,
TextArea,
TextAreaAppearance,
TextAreaAppearancesForDisplayShadow,
TextAreaAutocomplete,
TextAreaDefinition,
TextAreaResize,
Expand Down
3 changes: 0 additions & 3 deletions packages/web-components/src/textarea/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ export {
TextAreaAppearance,
TextAreaAppearancesForDisplayShadow,
TextAreaAutocomplete,
TextAreaResizableResize,
TextAreaHorizontallyResizableResize,
TextAreaVerticallyResizableResize,
TextAreaResize,
TextAreaSize,
} from './textarea.options.js';
Expand Down
21 changes: 5 additions & 16 deletions packages/web-components/src/textarea/textarea.options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export const TextAreaAppearance = {

export type TextAreaAppearance = ValuesOf<typeof TextAreaAppearance>;

/**
* Allowed values for `appearance` when `display-shadow` is set to true.
*
* @public
*/
export const TextAreaAppearancesForDisplayShadow: Partial<TextAreaAppearance[]> = [
TextAreaAppearance.filledLighter,
TextAreaAppearance.filledDarker,
Expand Down Expand Up @@ -54,19 +59,3 @@ export const TextAreaResize = {
} as const;

export type TextAreaResize = ValuesOf<typeof TextAreaResize>;

export const TextAreaResizableResize: Partial<TextAreaResize[]> = [
TextAreaResize.both,
TextAreaResize.horizontal,
TextAreaResize.vertical,
];

export const TextAreaVerticallyResizableResize: Partial<TextAreaResize[]> = [
TextAreaResize.both,
TextAreaResize.vertical,
];

export const TextAreaHorizontallyResizableResize: Partial<TextAreaResize[]> = [
TextAreaResize.both,
TextAreaResize.horizontal,
];
9 changes: 7 additions & 2 deletions packages/web-components/src/textarea/textarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
TextAreaAppearance,
TextAreaAppearancesForDisplayShadow,
TextAreaAutocomplete,
TextAreaResizableResize,
TextAreaResize,
TextAreaSize,
} from './textarea.options.js';
Expand Down Expand Up @@ -275,7 +274,13 @@ export class BaseTextArea extends FASTElement {
toggleState(this.elementInternals, `resize-${next}`, true);
}

toggleState(this.elementInternals, `resize`, TextAreaResizableResize.includes(this.resize));
toggleState(
this.elementInternals,
`resize`,
([TextAreaResize.both, TextAreaResize.horizontal, TextAreaResize.vertical] as Partial<TextAreaResize[]>).includes(
this.resize,
),
);
}

/**
Expand Down

0 comments on commit 416d7dd

Please sign in to comment.