first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
export declare const DirectionalHint: {
/**
* Appear above the target element, with the left edges of the callout and target aligning.
*/
topLeftEdge: 0;
/**
* Appear above the target element, with the centers of the callout and target aligning.
*/
topCenter: 1;
/**
* Appear above the target element, with the right edges of the callout and target aligning.
*/
topRightEdge: 2;
/**
* Appear above the target element, aligning with the target element such that the callout tends toward
* the center of the screen.
*/
topAutoEdge: 3;
/**
* Appear below the target element, with the left edges of the callout and target aligning.
*/
bottomLeftEdge: 4;
/**
* Appear below the target element, with the centers of the callout and target aligning.
*/
bottomCenter: 5;
/**
* Appear below the target element, with the right edges of the callout and target aligning.
*/
bottomRightEdge: 6;
/**
* Appear below the target element, aligning with the target element such that the callout tends toward
* the center of the screen.
*/
bottomAutoEdge: 7;
/**
* Appear to the left of the target element, with the top edges of the callout and target aligning.
*/
leftTopEdge: 8;
/**
* Appear to the left of the target element, with the centers of the callout and target aligning.
*/
leftCenter: 9;
/**
* Appear to the left of the target element, with the bottom edges of the callout and target aligning.
*/
leftBottomEdge: 10;
/**
* Appear to the right of the target element, with the top edges of the callout and target aligning.
*/
rightTopEdge: 11;
/**
* Appear to the right of the target element, with the centers of the callout and target aligning.
*/
rightCenter: 12;
/**
* Appear to the right of the target element, with the bottom edges of the callout and target aligning.
*/
rightBottomEdge: 13;
};
export type DirectionalHint = (typeof DirectionalHint)[keyof typeof DirectionalHint];
+66
View File
@@ -0,0 +1,66 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DirectionalHint = void 0;
exports.DirectionalHint = {
/**
* Appear above the target element, with the left edges of the callout and target aligning.
*/
topLeftEdge: 0,
/**
* Appear above the target element, with the centers of the callout and target aligning.
*/
topCenter: 1,
/**
* Appear above the target element, with the right edges of the callout and target aligning.
*/
topRightEdge: 2,
/**
* Appear above the target element, aligning with the target element such that the callout tends toward
* the center of the screen.
*/
topAutoEdge: 3,
/**
* Appear below the target element, with the left edges of the callout and target aligning.
*/
bottomLeftEdge: 4,
/**
* Appear below the target element, with the centers of the callout and target aligning.
*/
bottomCenter: 5,
/**
* Appear below the target element, with the right edges of the callout and target aligning.
*/
bottomRightEdge: 6,
/**
* Appear below the target element, aligning with the target element such that the callout tends toward
* the center of the screen.
*/
bottomAutoEdge: 7,
/**
* Appear to the left of the target element, with the top edges of the callout and target aligning.
*/
leftTopEdge: 8,
/**
* Appear to the left of the target element, with the centers of the callout and target aligning.
*/
leftCenter: 9,
/**
* Appear to the left of the target element, with the bottom edges of the callout and target aligning.
*/
leftBottomEdge: 10,
/**
* Appear to the right of the target element, with the top edges of the callout and target aligning.
*/
rightTopEdge: 11,
/**
* Appear to the right of the target element, with the centers of the callout and target aligning.
*/
rightCenter: 12,
/**
* Appear to the right of the target element, with the bottom edges of the callout and target aligning.
*/
rightBottomEdge: 13,
};
});
//# sourceMappingURL=DirectionalHint.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"DirectionalHint.js","sourceRoot":"../src/","sources":["common/DirectionalHint.ts"],"names":[],"mappings":";;;;IAAa,QAAA,eAAe,GAAG;QAC7B;;WAEG;QACH,WAAW,EAAE,CAAM;QAEnB;;WAEG;QACH,SAAS,EAAE,CAAM;QAEjB;;WAEG;QACH,YAAY,EAAE,CAAM;QAEpB;;;WAGG;QACH,WAAW,EAAE,CAAM;QAEnB;;WAEG;QACH,cAAc,EAAE,CAAM;QAEtB;;WAEG;QACH,YAAY,EAAE,CAAM;QAEpB;;WAEG;QACH,eAAe,EAAE,CAAM;QAEvB;;;WAGG;QACH,cAAc,EAAE,CAAM;QAEtB;;WAEG;QACH,WAAW,EAAE,CAAM;QAEnB;;WAEG;QACH,UAAU,EAAE,CAAM;QAElB;;WAEG;QACH,cAAc,EAAE,EAAQ;QAExB;;WAEG;QACH,YAAY,EAAE,EAAQ;QAEtB;;WAEG;QACH,WAAW,EAAE,EAAQ;QAErB;;WAEG;QACH,eAAe,EAAE,EAAQ;KAC1B,CAAC","sourcesContent":["export const DirectionalHint = {\n /**\n * Appear above the target element, with the left edges of the callout and target aligning.\n */\n topLeftEdge: 0 as 0,\n\n /**\n * Appear above the target element, with the centers of the callout and target aligning.\n */\n topCenter: 1 as 1,\n\n /**\n * Appear above the target element, with the right edges of the callout and target aligning.\n */\n topRightEdge: 2 as 2,\n\n /**\n * Appear above the target element, aligning with the target element such that the callout tends toward\n * the center of the screen.\n */\n topAutoEdge: 3 as 3,\n\n /**\n * Appear below the target element, with the left edges of the callout and target aligning.\n */\n bottomLeftEdge: 4 as 4,\n\n /**\n * Appear below the target element, with the centers of the callout and target aligning.\n */\n bottomCenter: 5 as 5,\n\n /**\n * Appear below the target element, with the right edges of the callout and target aligning.\n */\n bottomRightEdge: 6 as 6,\n\n /**\n * Appear below the target element, aligning with the target element such that the callout tends toward\n * the center of the screen.\n */\n bottomAutoEdge: 7 as 7,\n\n /**\n * Appear to the left of the target element, with the top edges of the callout and target aligning.\n */\n leftTopEdge: 8 as 8,\n\n /**\n * Appear to the left of the target element, with the centers of the callout and target aligning.\n */\n leftCenter: 9 as 9,\n\n /**\n * Appear to the left of the target element, with the bottom edges of the callout and target aligning.\n */\n leftBottomEdge: 10 as 10,\n\n /**\n * Appear to the right of the target element, with the top edges of the callout and target aligning.\n */\n rightTopEdge: 11 as 11,\n\n /**\n * Appear to the right of the target element, with the centers of the callout and target aligning.\n */\n rightCenter: 12 as 12,\n\n /**\n * Appear to the right of the target element, with the bottom edges of the callout and target aligning.\n */\n rightBottomEdge: 13 as 13,\n};\n\nexport type DirectionalHint = (typeof DirectionalHint)[keyof typeof DirectionalHint];\n"]}
+136
View File
@@ -0,0 +1,136 @@
import type { IStyleFunctionOrObject } from '../Utilities';
import type { ITheme, IStyle } from '../Styling';
import type { JSXElement } from '@fluentui/utilities';
export interface IExample {
/** Title of the example */
title: string;
/** Raw source code of the example */
code: string;
/** Working example of the example */
view: JSXElement;
isScrollable?: boolean;
/** JS String for codepen of the example */
codepenJS?: string;
/** Custom styles. Partial version of `IExampleCardProps['styles']`. */
styles?: IStyleFunctionOrObject<{
theme?: ITheme;
}, {
root: IStyle;
}>;
}
export interface IDocPageProps {
/** Title that goes into the header */
title: string;
/** Name of the component being documented */
componentName: string;
/** URL of the checked in component, should be somewhere on github.com */
componentUrl: string;
/** Knobs that applies to all the examples */
exampleKnobs?: JSXElement;
/** Array of examples, displayed in the order defined */
examples?: IExample[];
/** Properties table(s) as markdown string */
propertiesTablesSources?: string[];
/** Overview of the component as markdown string */
overview?: string;
/** Accessibility of the component as markdown string */
accessibility?: string;
/** DO's blurb as markdown string */
dos?: string;
/** DON'Ts blurb as markdown string */
donts?: string;
/** Best practice as markdown string */
bestPractices?: string;
/** Feedback section includes link to new issue page and displays Github issues */
isFeedbackVisible?: boolean;
/** Passed through header visibility flag from the demo component page component */
isHeaderVisible: boolean;
/** If true, the component accepts all native props from elements specified in `nativePropsElement` */
allowNativeProps?: boolean;
/** Override component name to use in the native props message */
allowNativePropsForComponentName?: string;
/**
* Element(s) whose native props this component accepts (default div).
* Only relevant if `allowNativeProps` is true.
*/
nativePropsElement?: string | string[];
/**
* Related link
* @deprecated No longer shown on ComponentPage
*/
related?: JSXElement;
/** Pass through other sections for ComponentPage */
otherSections?: {
title: string;
section: JSXElement;
}[];
/**
* JSON to populate the api reference tables
*/
jsonDocs?: IPageJson;
}
/**
* Used to keep track of where an API reference page will live on the site.
*/
export type PageKind = 'References' | 'Components';
/**
* Text excerpt token that is part of a type definition or extends block and may have a link
* to another doc page. For API reference tables.
*/
export interface ILinkToken {
text: string;
/** If this token is a link, name of the doc page it points to */
linkedPage?: string;
/** If this token is a link, group/category of the doc page it points to */
linkedPageGroup?: string;
}
/**
* Generic row for API reference tables.
* It can represent a member (property or method) of an interface or class.
*/
export interface ITableRowJson {
name: string;
kind?: 'method' | 'property';
/**
* The row's type translated to an array of text elements and links to other types.
* For example, `Readonly<IFoo>` would translate to:
* `[{ text: 'Readonly<' }, { text: 'IFoo', hyperlinkedPage: '(page name)', pageKind: '(kind)' }, { text: '>' }]`
*/
typeTokens: ILinkToken[];
defaultValue?: string;
description: string;
deprecated: boolean;
deprecatedMessage?: string;
required?: boolean;
}
/**
* Enum member row for API reference tables.
*/
export type IEnumTableRowJson = Omit<ITableRowJson, 'kind' | 'typeTokens' | 'defaultValue' | 'required'> & {
value: string;
};
export type ApiKind = 'interface' | 'enum' | 'class' | 'typeAlias';
/**
* Info for a table representing a top-level API item: interface, enum, class, or type alias.
*/
export interface ITableJson {
kind: ApiKind;
name: string;
/**
* Any types the item extends, translated to an array of text elements and links to other types.
* For classes and interfaces only.
*/
extendsTokens: ILinkToken[];
description: string;
members?: ITableRowJson[] | IEnumTableRowJson[];
deprecated?: boolean;
deprecatedMessage?: string;
}
/**
* Structure of the page.json files
*/
export interface IPageJson {
tables: ITableJson[];
name: string;
group?: string;
}
+5
View File
@@ -0,0 +1,5 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=DocPage.types.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"DocPage.types.js","sourceRoot":"../src/","sources":["common/DocPage.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { IStyleFunctionOrObject } from '../Utilities';\nimport type { ITheme, IStyle } from '../Styling';\n\nimport type { JSXElement } from '@fluentui/utilities';\n\nexport interface IExample {\n /** Title of the example */\n title: string;\n\n /** Raw source code of the example */\n code: string;\n\n /** Working example of the example */\n\n view: JSXElement;\n\n isScrollable?: boolean;\n\n /** JS String for codepen of the example */\n codepenJS?: string;\n\n /** Custom styles. Partial version of `IExampleCardProps['styles']`. */\n styles?: IStyleFunctionOrObject<{ theme?: ITheme }, { root: IStyle }>;\n}\n\nexport interface IDocPageProps {\n /** Title that goes into the header */\n title: string;\n\n /** Name of the component being documented */\n componentName: string;\n\n /** URL of the checked in component, should be somewhere on github.com */\n componentUrl: string;\n\n /** Knobs that applies to all the examples */\n\n exampleKnobs?: JSXElement;\n\n /** Array of examples, displayed in the order defined */\n examples?: IExample[];\n\n /** Properties table(s) as markdown string */\n propertiesTablesSources?: string[];\n\n /** Overview of the component as markdown string */\n overview?: string;\n\n /** Accessibility of the component as markdown string */\n accessibility?: string;\n\n /** DO's blurb as markdown string */\n dos?: string;\n\n /** DON'Ts blurb as markdown string */\n donts?: string;\n\n /** Best practice as markdown string */\n bestPractices?: string;\n\n /** Feedback section includes link to new issue page and displays Github issues */\n isFeedbackVisible?: boolean;\n\n /** Passed through header visibility flag from the demo component page component */\n isHeaderVisible: boolean;\n\n /** If true, the component accepts all native props from elements specified in `nativePropsElement` */\n allowNativeProps?: boolean;\n\n /** Override component name to use in the native props message */\n allowNativePropsForComponentName?: string;\n\n /**\n * Element(s) whose native props this component accepts (default div).\n * Only relevant if `allowNativeProps` is true.\n */\n nativePropsElement?: string | string[];\n\n /**\n * Related link\n * @deprecated No longer shown on ComponentPage\n */\n\n related?: JSXElement;\n\n /** Pass through other sections for ComponentPage */\n otherSections?: {\n title: string;\n\n section: JSXElement;\n }[];\n\n /**\n * JSON to populate the api reference tables\n */\n jsonDocs?: IPageJson;\n}\n\n/**\n * Used to keep track of where an API reference page will live on the site.\n */\nexport type PageKind = 'References' | 'Components';\n\n/**\n * Text excerpt token that is part of a type definition or extends block and may have a link\n * to another doc page. For API reference tables.\n */\nexport interface ILinkToken {\n text: string;\n /** If this token is a link, name of the doc page it points to */\n linkedPage?: string;\n /** If this token is a link, group/category of the doc page it points to */\n linkedPageGroup?: string;\n}\n\n/**\n * Generic row for API reference tables.\n * It can represent a member (property or method) of an interface or class.\n */\nexport interface ITableRowJson {\n name: string;\n kind?: 'method' | 'property';\n /**\n * The row's type translated to an array of text elements and links to other types.\n * For example, `Readonly<IFoo>` would translate to:\n * `[{ text: 'Readonly<' }, { text: 'IFoo', hyperlinkedPage: '(page name)', pageKind: '(kind)' }, { text: '>' }]`\n */\n typeTokens: ILinkToken[];\n defaultValue?: string;\n description: string;\n deprecated: boolean;\n deprecatedMessage?: string;\n required?: boolean;\n}\n\n/**\n * Enum member row for API reference tables.\n */\nexport type IEnumTableRowJson = Omit<ITableRowJson, 'kind' | 'typeTokens' | 'defaultValue' | 'required'> & {\n value: string;\n};\n\nexport type ApiKind = 'interface' | 'enum' | 'class' | 'typeAlias';\n\n/**\n * Info for a table representing a top-level API item: interface, enum, class, or type alias.\n */\nexport interface ITableJson {\n kind: ApiKind;\n name: string;\n /**\n * Any types the item extends, translated to an array of text elements and links to other types.\n * For classes and interfaces only.\n */\n extendsTokens: ILinkToken[];\n description: string;\n members?: ITableRowJson[] | IEnumTableRowJson[];\n deprecated?: boolean;\n deprecatedMessage?: string;\n}\n\n/**\n * Structure of the page.json files\n */\nexport interface IPageJson {\n tables: ITableJson[];\n name: string;\n group?: string;\n}\n"]}
+38
View File
@@ -0,0 +1,38 @@
/**
* {@docCategory IAccessiblePopupProps}
*/
export interface IAccessiblePopupProps {
/**
* Sets the element to focus on when exiting the control's FocusTrapZone.
* @defaultvalue The `element.target` that triggered the control opening.
*/
elementToFocusOnDismiss?: HTMLElement;
/**
* If false (the default), the control's FocusTrapZone will restore focus to the element which activated it
* once the trap zone is unmounted or disabled. Set to true to disable this behavior.
* @defaultvalue false
*/
disableRestoreFocus?: boolean;
/**
* @deprecated Use `disableRestoreFocus` (it has the same behavior and a clearer name).
*/
ignoreExternalFocusing?: boolean;
/**
* Whether control should force focus inside its focus trap zone.
* @defaultvalue true
*/
forceFocusInsideTrap?: boolean;
/**
* Class name (not actual selector) for first focusable item. Do not append a dot.
*/
firstFocusableSelector?: string | (() => string);
/**
* Aria label on close button.
*/
closeButtonAriaLabel?: string;
/**
* Whether this control will allow clicks outside its FocusTrapZone.
* @defaultvalue false
*/
isClickableOutsideFocusTrap?: boolean;
}
+5
View File
@@ -0,0 +1,5 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=IAccessiblePopupProps.js.map
@@ -0,0 +1 @@
{"version":3,"file":"IAccessiblePopupProps.js","sourceRoot":"../src/","sources":["common/IAccessiblePopupProps.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * {@docCategory IAccessiblePopupProps}\n */\nexport interface IAccessiblePopupProps {\n /**\n * Sets the element to focus on when exiting the control's FocusTrapZone.\n * @defaultvalue The `element.target` that triggered the control opening.\n */\n elementToFocusOnDismiss?: HTMLElement;\n\n /**\n * If false (the default), the control's FocusTrapZone will restore focus to the element which activated it\n * once the trap zone is unmounted or disabled. Set to true to disable this behavior.\n * @defaultvalue false\n */\n disableRestoreFocus?: boolean;\n\n /**\n * @deprecated Use `disableRestoreFocus` (it has the same behavior and a clearer name).\n */\n ignoreExternalFocusing?: boolean;\n\n /**\n * Whether control should force focus inside its focus trap zone.\n * @defaultvalue true\n */\n forceFocusInsideTrap?: boolean;\n\n /**\n * Class name (not actual selector) for first focusable item. Do not append a dot.\n */\n firstFocusableSelector?: string | (() => string);\n\n /**\n * Aria label on close button.\n */\n closeButtonAriaLabel?: string;\n\n /**\n * Whether this control will allow clicks outside its FocusTrapZone.\n * @defaultvalue false\n */\n isClickableOutsideFocusTrap?: boolean;\n}\n"]}
+14
View File
@@ -0,0 +1,14 @@
/** @deprecated Use the version from `@fluentui/example-data` instead. */
export declare const TestImages: {
choiceGroupBarUnselected: string;
choiceGroupBarSelected: string;
choiceGroupPieUnselected: string;
choiceGroupPieSelected: string;
documentPreview: string;
documentPreviewTwo: string;
documentPreviewThree: string;
iconOne: string;
iconPpt: string;
personaFemale: string;
personaMale: string;
};
+22
View File
@@ -0,0 +1,22 @@
// If this file is moved or split, the scripts for building codepen examples will likely need to be updated.
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestImages = void 0;
var baseProductionCdnUrl = 'https://res-1.cdn.office.net/files/fabric-cdn-prod_20230815.002/';
/** @deprecated Use the version from `@fluentui/example-data` instead. */
exports.TestImages = {
choiceGroupBarUnselected: baseProductionCdnUrl + 'office-ui-fabric-react-assets/choicegroup-bar-unselected.png',
choiceGroupBarSelected: baseProductionCdnUrl + 'office-ui-fabric-react-assets/choicegroup-bar-selected.png',
choiceGroupPieUnselected: baseProductionCdnUrl + 'office-ui-fabric-react-assets/choicegroup-pie-unselected.png',
choiceGroupPieSelected: baseProductionCdnUrl + 'office-ui-fabric-react-assets/choicegroup-pie-selected.png',
documentPreview: baseProductionCdnUrl + 'office-ui-fabric-react-assets/document-preview.png',
documentPreviewTwo: baseProductionCdnUrl + 'office-ui-fabric-react-assets/document-preview2.png',
documentPreviewThree: baseProductionCdnUrl + 'office-ui-fabric-react-assets/document-preview3.png',
iconOne: baseProductionCdnUrl + 'office-ui-fabric-react-assets/icon-one.png',
iconPpt: baseProductionCdnUrl + 'assets/item-types/32/pptx.png',
personaFemale: baseProductionCdnUrl + 'office-ui-fabric-react-assets/persona-female.png',
personaMale: baseProductionCdnUrl + 'office-ui-fabric-react-assets/persona-male.png',
};
});
//# sourceMappingURL=TestImages.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"TestImages.js","sourceRoot":"../src/","sources":["common/TestImages.ts"],"names":[],"mappings":"AAAA,4GAA4G;;;;;IAE5G,IAAM,oBAAoB,GAAG,kEAAkE,CAAC;IAEhG,yEAAyE;IAC5D,QAAA,UAAU,GAAG;QACxB,wBAAwB,EAAE,oBAAoB,GAAG,8DAA8D;QAC/G,sBAAsB,EAAE,oBAAoB,GAAG,4DAA4D;QAC3G,wBAAwB,EAAE,oBAAoB,GAAG,8DAA8D;QAC/G,sBAAsB,EAAE,oBAAoB,GAAG,4DAA4D;QAC3G,eAAe,EAAE,oBAAoB,GAAG,oDAAoD;QAC5F,kBAAkB,EAAE,oBAAoB,GAAG,qDAAqD;QAChG,oBAAoB,EAAE,oBAAoB,GAAG,qDAAqD;QAClG,OAAO,EAAE,oBAAoB,GAAG,4CAA4C;QAC5E,OAAO,EAAE,oBAAoB,GAAG,+BAA+B;QAC/D,aAAa,EAAE,oBAAoB,GAAG,kDAAkD;QACxF,WAAW,EAAE,oBAAoB,GAAG,gDAAgD;KACrF,CAAC","sourcesContent":["// If this file is moved or split, the scripts for building codepen examples will likely need to be updated.\n\nconst baseProductionCdnUrl = 'https://res-1.cdn.office.net/files/fabric-cdn-prod_20230815.002/';\n\n/** @deprecated Use the version from `@fluentui/example-data` instead. */\nexport const TestImages = {\n choiceGroupBarUnselected: baseProductionCdnUrl + 'office-ui-fabric-react-assets/choicegroup-bar-unselected.png',\n choiceGroupBarSelected: baseProductionCdnUrl + 'office-ui-fabric-react-assets/choicegroup-bar-selected.png',\n choiceGroupPieUnselected: baseProductionCdnUrl + 'office-ui-fabric-react-assets/choicegroup-pie-unselected.png',\n choiceGroupPieSelected: baseProductionCdnUrl + 'office-ui-fabric-react-assets/choicegroup-pie-selected.png',\n documentPreview: baseProductionCdnUrl + 'office-ui-fabric-react-assets/document-preview.png',\n documentPreviewTwo: baseProductionCdnUrl + 'office-ui-fabric-react-assets/document-preview2.png',\n documentPreviewThree: baseProductionCdnUrl + 'office-ui-fabric-react-assets/document-preview3.png',\n iconOne: baseProductionCdnUrl + 'office-ui-fabric-react-assets/icon-one.png',\n iconPpt: baseProductionCdnUrl + 'assets/item-types/32/pptx.png',\n personaFemale: baseProductionCdnUrl + 'office-ui-fabric-react-assets/persona-female.png',\n personaMale: baseProductionCdnUrl + 'office-ui-fabric-react-assets/persona-male.png',\n};\n"]}
+4
View File
@@ -0,0 +1,4 @@
import type { IsConformantOptions } from '@fluentui/react-conformance';
export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
componentPath?: string;
}): void;
+25
View File
@@ -0,0 +1,25 @@
define(["require", "exports", "@fluentui/react-conformance"], function (require, exports, react_conformance_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isConformant = isConformant;
function isConformant(testInfo) {
var _a;
var defaultOptions = {
disabledTests: [
'kebab-aria-attributes',
// v8 has a different prefix, and there's a setting for that now,
// but a lot of components don't set a consistent/expected classname
'component-has-static-classname',
// v8 doesn't export classnames
'component-has-static-classname-exported',
// Will enable with appropriate overrides separately
'consistent-callback-names',
'consistent-callback-args',
'component-has-static-classnames-object',
],
componentPath: (_a = require.main) === null || _a === void 0 ? void 0 : _a.filename.replace('.test', ''),
};
(0, react_conformance_1.isConformant)(defaultOptions, testInfo);
}
});
//# sourceMappingURL=isConformant.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":";;;IAGA,oCAoBC;IApBD,SAAgB,YAAY,CAC1B,QAAyF;;QAEzF,IAAM,cAAc,GAAyC;YAC3D,aAAa,EAAE;gBACb,uBAAuB;gBACvB,iEAAiE;gBACjE,oEAAoE;gBACpE,gCAAgC;gBAChC,+BAA+B;gBAC/B,yCAAyC;gBACzC,oDAAoD;gBACpD,2BAA2B;gBAC3B,0BAA0B;gBAC1B,wCAAwC;aACzC;YACD,aAAa,EAAE,MAAA,OAAO,CAAC,IAAI,0CAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;SAC3D,CAAC;QAEF,IAAA,gCAAgB,EAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC","sourcesContent":["import { isConformant as baseIsConformant } from '@fluentui/react-conformance';\nimport type { IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n): void {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n disabledTests: [\n 'kebab-aria-attributes',\n // v8 has a different prefix, and there's a setting for that now,\n // but a lot of components don't set a consistent/expected classname\n 'component-has-static-classname',\n // v8 doesn't export classnames\n 'component-has-static-classname-exported',\n // Will enable with appropriate overrides separately\n 'consistent-callback-names',\n 'consistent-callback-args',\n 'component-has-static-classnames-object',\n ],\n componentPath: require.main?.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
+21
View File
@@ -0,0 +1,21 @@
import * as React from 'react';
export declare function getBySelector(container: HTMLElement | Element, selector: string): Element | null;
export declare function getByAllSelector(container: HTMLElement | Element, selector: string): NodeListOf<Element>;
export declare function findNodesV2(container: HTMLElement, selector: string): HTMLElement[];
export declare function expectNodesV2(container: HTMLElement, className: string, n: number): void;
export declare function expectOneV2(container: HTMLElement, selector: string): void;
/** @deprecated Use fake timers and `jest.runAllTimers()` instead */
export declare function delay(millisecond: number): Promise<void>;
export declare function renderIntoDocument(element: React.ReactElement<any>): HTMLElement;
export declare function mockEvent(targetValue?: string): {
target: EventTarget;
};
/**
* Hack for forcing Jest to run pending promises
* https://github.com/facebook/jest/issues/2157#issuecomment-897935688
*/
export declare function flushPromises(): Promise<void>;
/**
* Verify that the given element and its parents do NOT have `aria-hidden` set.
*/
export declare function expectNoHiddenParents(element: HTMLElement): void;
+63
View File
@@ -0,0 +1,63 @@
define(["require", "exports", "@testing-library/react"], function (require, exports, react_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBySelector = getBySelector;
exports.getByAllSelector = getByAllSelector;
exports.findNodesV2 = findNodesV2;
exports.expectNodesV2 = expectNodesV2;
exports.expectOneV2 = expectOneV2;
exports.delay = delay;
exports.renderIntoDocument = renderIntoDocument;
exports.mockEvent = mockEvent;
exports.flushPromises = flushPromises;
exports.expectNoHiddenParents = expectNoHiddenParents;
// v2 - avoiding usage of enzyme
// Helper function to find all elements with a specific class name that are not React components
function getBySelector(container, selector) {
return container.querySelector(selector);
}
function getByAllSelector(container, selector) {
return container.querySelectorAll(selector);
}
function findNodesV2(container, selector) {
return Array.from(container.querySelectorAll(selector)).filter(function (node) { return node.nodeType === Node.ELEMENT_NODE; });
}
function expectNodesV2(container, className, n) {
expect(findNodesV2(container, className).length).toEqual(n);
}
function expectOneV2(container, selector) {
expectNodesV2(container, selector, 1);
}
/** @deprecated Use fake timers and `jest.runAllTimers()` instead */
function delay(millisecond) {
return new Promise(function (resolve) { return setTimeout(resolve, millisecond); });
}
function renderIntoDocument(element) {
var component = (0, react_1.render)(element);
var renderedDOM = component.container.firstChild;
return renderedDOM;
}
function mockEvent(targetValue) {
if (targetValue === void 0) { targetValue = ''; }
var target = { value: targetValue };
return { target: target };
}
/**
* Hack for forcing Jest to run pending promises
* https://github.com/facebook/jest/issues/2157#issuecomment-897935688
*/
function flushPromises() {
return new Promise(jest.requireActual('timers').setImmediate);
}
/**
* Verify that the given element and its parents do NOT have `aria-hidden` set.
*/
function expectNoHiddenParents(element) {
var el = element;
while (el) {
expect(el.getAttribute('aria-hidden')).not.toBe('true');
el = el.parentElement;
}
}
});
//# sourceMappingURL=testUtilities.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"testUtilities.js","sourceRoot":"../src/","sources":["common/testUtilities.ts"],"names":[],"mappings":";;;IAOA,sCAEC;IACD,4CAEC;IACD,kCAIC;IAED,sCAEC;IAED,kCAEC;IAGD,sBAEC;IAED,gDAIC;IAED,8BAGC;IAMD,sCAEC;IAKD,sDAMC;IAzDD,gCAAgC;IAEhC,gGAAgG;IAEhG,SAAgB,aAAa,CAAC,SAAgC,EAAE,QAAgB;QAC9E,OAAO,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IACD,SAAgB,gBAAgB,CAAC,SAAgC,EAAE,QAAgB;QACjF,OAAO,SAAS,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IACD,SAAgB,WAAW,CAAC,SAAsB,EAAE,QAAgB;QAClE,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAC5D,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAnC,CAAmC,CAC3B,CAAC;IACrB,CAAC;IAED,SAAgB,aAAa,CAAC,SAAsB,EAAE,SAAiB,EAAE,CAAS;QAChF,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,SAAgB,WAAW,CAAC,SAAsB,EAAE,QAAgB;QAClE,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,oEAAoE;IACpE,SAAgB,KAAK,CAAC,WAAmB;QACvC,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO,IAAI,OAAA,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,EAAhC,CAAgC,CAAC,CAAC;IACxE,CAAC;IAED,SAAgB,kBAAkB,CAAC,OAAgC;QACjE,IAAM,SAAS,GAAG,IAAA,cAAM,EAAC,OAAO,CAAC,CAAC;QAClC,IAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC;QACnD,OAAO,WAA0B,CAAC;IACpC,CAAC;IAED,SAAgB,SAAS,CAAC,WAAwB;QAAxB,4BAAA,EAAA,gBAAwB;QAChD,IAAM,MAAM,GAAgB,EAAE,KAAK,EAAE,WAAW,EAAsB,CAAC;QACvE,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,SAAgB,aAAa;QAC3B,OAAO,IAAI,OAAO,CAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,SAAgB,qBAAqB,CAAC,OAAoB;QACxD,IAAI,EAAE,GAAuB,OAAO,CAAC;QACrC,OAAO,EAAE,EAAE,CAAC;YACV,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxD,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC;QACxB,CAAC;IACH,CAAC","sourcesContent":["import * as React from 'react';\nimport { render } from '@testing-library/react';\n\n// v2 - avoiding usage of enzyme\n\n// Helper function to find all elements with a specific class name that are not React components\n\nexport function getBySelector(container: HTMLElement | Element, selector: string): Element | null {\n return container.querySelector(selector);\n}\nexport function getByAllSelector(container: HTMLElement | Element, selector: string): NodeListOf<Element> {\n return container.querySelectorAll(selector);\n}\nexport function findNodesV2(container: HTMLElement, selector: string): HTMLElement[] {\n return Array.from(container.querySelectorAll(selector)).filter(\n node => node.nodeType === Node.ELEMENT_NODE,\n ) as HTMLElement[];\n}\n\nexport function expectNodesV2(container: HTMLElement, className: string, n: number): void {\n expect(findNodesV2(container, className).length).toEqual(n);\n}\n\nexport function expectOneV2(container: HTMLElement, selector: string): void {\n expectNodesV2(container, selector, 1);\n}\n\n/** @deprecated Use fake timers and `jest.runAllTimers()` instead */\nexport function delay(millisecond: number): Promise<void> {\n return new Promise<void>(resolve => setTimeout(resolve, millisecond));\n}\n\nexport function renderIntoDocument(element: React.ReactElement<any>): HTMLElement {\n const component = render(element);\n const renderedDOM = component.container.firstChild;\n return renderedDOM as HTMLElement;\n}\n\nexport function mockEvent(targetValue: string = '') {\n const target: EventTarget = { value: targetValue } as HTMLInputElement;\n return { target };\n}\n\n/**\n * Hack for forcing Jest to run pending promises\n * https://github.com/facebook/jest/issues/2157#issuecomment-897935688\n */\nexport function flushPromises(): Promise<void> {\n return new Promise<void>(jest.requireActual('timers').setImmediate);\n}\n\n/**\n * Verify that the given element and its parents do NOT have `aria-hidden` set.\n */\nexport function expectNoHiddenParents(element: HTMLElement): void {\n let el: HTMLElement | null = element;\n while (el) {\n expect(el.getAttribute('aria-hidden')).not.toBe('true');\n el = el.parentElement;\n }\n}\n"]}