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
@@ -0,0 +1,10 @@
import * as React from 'react';
import type { IOverlayProps } from './Overlay.types';
import type { JSXElement } from '@fluentui/utilities';
export declare class OverlayBase extends React.Component<IOverlayProps, {}> {
private _allowTouchBodyScroll;
constructor(props: IOverlayProps);
componentDidMount(): void;
componentWillUnmount(): void;
render(): JSXElement;
}
@@ -0,0 +1,35 @@
define(["require", "exports", "tslib", "react", "../../Utilities"], function (require, exports, tslib_1, React, Utilities_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OverlayBase = void 0;
var getClassNames = (0, Utilities_1.classNamesFunction)();
var OverlayBase = /** @class */ (function (_super) {
tslib_1.__extends(OverlayBase, _super);
function OverlayBase(props) {
var _this = _super.call(this, props) || this;
(0, Utilities_1.initializeComponentRef)(_this);
var _a = _this.props.allowTouchBodyScroll, allowTouchBodyScroll = _a === void 0 ? false : _a;
_this._allowTouchBodyScroll = allowTouchBodyScroll;
return _this;
}
OverlayBase.prototype.componentDidMount = function () {
!this._allowTouchBodyScroll && (0, Utilities_1.disableBodyScroll)();
};
OverlayBase.prototype.componentWillUnmount = function () {
!this._allowTouchBodyScroll && (0, Utilities_1.enableBodyScroll)();
};
OverlayBase.prototype.render = function () {
var _a = this.props, isDark = _a.isDarkThemed, className = _a.className, theme = _a.theme, styles = _a.styles;
var divProps = (0, Utilities_1.getNativeProps)(this.props, Utilities_1.divProperties);
var classNames = getClassNames(styles, {
theme: theme,
className: className,
isDark: isDark,
});
return React.createElement("div", tslib_1.__assign({}, divProps, { className: classNames.root }));
};
return OverlayBase;
}(React.Component));
exports.OverlayBase = OverlayBase;
});
//# sourceMappingURL=Overlay.base.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Overlay.base.js","sourceRoot":"../src/","sources":["components/Overlay/Overlay.base.tsx"],"names":[],"mappings":";;;;IAaA,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAsC,CAAC;IAE/E;QAAiC,uCAAkC;QAGjE,qBAAY,KAAoB;YAC9B,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;YAEb,IAAA,kCAAsB,EAAC,KAAI,CAAC,CAAC;YACrB,IAAA,KAAiC,KAAI,CAAC,KAAK,qBAAf,EAA5B,oBAAoB,mBAAG,KAAK,KAAA,CAAgB;YACpD,KAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;;QACpD,CAAC;QAEM,uCAAiB,GAAxB;YACE,CAAC,IAAI,CAAC,qBAAqB,IAAI,IAAA,6BAAiB,GAAE,CAAC;QACrD,CAAC;QAEM,0CAAoB,GAA3B;YACE,CAAC,IAAI,CAAC,qBAAqB,IAAI,IAAA,4BAAgB,GAAE,CAAC;QACpD,CAAC;QAEM,4BAAM,GAAb;YACQ,IAAA,KAAqD,IAAI,CAAC,KAAK,EAA/C,MAAM,kBAAA,EAAE,SAAS,eAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAe,CAAC;YAEtE,IAAM,QAAQ,GAAG,IAAA,0BAAc,EAAuC,IAAI,CAAC,KAAK,EAAE,yBAAa,CAAC,CAAC;YAEjG,IAAM,UAAU,GAAG,aAAa,CAAC,MAAO,EAAE;gBACxC,KAAK,EAAE,KAAM;gBACb,SAAS,WAAA;gBACT,MAAM,QAAA;aACP,CAAC,CAAC;YAEH,OAAO,gDAAS,QAAQ,IAAE,SAAS,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC;QAC3D,CAAC;QACH,kBAAC;IAAD,CAAC,AAhCD,CAAiC,KAAK,CAAC,SAAS,GAgC/C;IAhCY,kCAAW","sourcesContent":["import * as React from 'react';\nimport {\n classNamesFunction,\n getNativeProps,\n divProperties,\n enableBodyScroll,\n disableBodyScroll,\n initializeComponentRef,\n} from '../../Utilities';\nimport type { IOverlayProps, IOverlayStyleProps, IOverlayStyles } from './Overlay.types';\n\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IOverlayStyleProps, IOverlayStyles>();\n\nexport class OverlayBase extends React.Component<IOverlayProps, {}> {\n private _allowTouchBodyScroll: boolean;\n\n constructor(props: IOverlayProps) {\n super(props);\n\n initializeComponentRef(this);\n const { allowTouchBodyScroll = false } = this.props;\n this._allowTouchBodyScroll = allowTouchBodyScroll;\n }\n\n public componentDidMount(): void {\n !this._allowTouchBodyScroll && disableBodyScroll();\n }\n\n public componentWillUnmount(): void {\n !this._allowTouchBodyScroll && enableBodyScroll();\n }\n\n public render(): JSXElement {\n const { isDarkThemed: isDark, className, theme, styles } = this.props;\n\n const divProps = getNativeProps<React.HTMLAttributes<HTMLDivElement>>(this.props, divProperties);\n\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n isDark,\n });\n\n return <div {...divProps} className={classNames.root} />;\n }\n}\n"]}
+3
View File
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { IOverlayProps } from './Overlay.types';
export declare const Overlay: React.FunctionComponent<IOverlayProps>;
+9
View File
@@ -0,0 +1,9 @@
define(["require", "exports", "../../Utilities", "./Overlay.base", "./Overlay.styles"], function (require, exports, Utilities_1, Overlay_base_1, Overlay_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Overlay = void 0;
exports.Overlay = (0, Utilities_1.styled)(Overlay_base_1.OverlayBase, Overlay_styles_1.getStyles, undefined, {
scope: 'Overlay',
});
});
//# sourceMappingURL=Overlay.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Overlay.js","sourceRoot":"../src/","sources":["components/Overlay/Overlay.tsx"],"names":[],"mappings":";;;;IAMa,QAAA,OAAO,GAA2C,IAAA,kBAAM,EAInE,0BAAW,EAAE,0BAAS,EAAE,SAAS,EAAE;QACnC,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { OverlayBase } from './Overlay.base';\nimport { getStyles } from './Overlay.styles';\nimport type { IOverlayProps, IOverlayStyleProps, IOverlayStyles } from './Overlay.types';\n\nexport const Overlay: React.FunctionComponent<IOverlayProps> = styled<\n IOverlayProps,\n IOverlayStyleProps,\n IOverlayStyles\n>(OverlayBase, getStyles, undefined, {\n scope: 'Overlay',\n});\n"]}
@@ -0,0 +1,2 @@
import type { IOverlayStyleProps, IOverlayStyles } from './Overlay.types';
export declare const getStyles: (props: IOverlayStyleProps) => IOverlayStyles;
@@ -0,0 +1,47 @@
define(["require", "exports", "../../Styling"], function (require, exports, Styling_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyles = void 0;
var GlobalClassNames = {
root: 'ms-Overlay',
rootDark: 'ms-Overlay--dark',
};
var getStyles = function (props) {
var _a;
var className = props.className, theme = props.theme, isNone = props.isNone, isDark = props.isDark;
var palette = theme.palette;
var classNames = (0, Styling_1.getGlobalClassNames)(GlobalClassNames, theme);
return {
root: [
classNames.root,
theme.fonts.medium,
{
backgroundColor: palette.whiteTranslucent40,
top: 0,
right: 0,
bottom: 0,
left: 0,
position: 'absolute',
selectors: (_a = {},
_a[Styling_1.HighContrastSelector] = {
border: '1px solid WindowText',
opacity: 0,
},
_a),
},
isNone && {
visibility: 'hidden',
},
isDark && [
classNames.rootDark,
{
backgroundColor: palette.blackTranslucent40,
},
],
className,
],
};
};
exports.getStyles = getStyles;
});
//# sourceMappingURL=Overlay.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Overlay.styles.js","sourceRoot":"../src/","sources":["components/Overlay/Overlay.styles.ts"],"names":[],"mappings":";;;;IAGA,IAAM,gBAAgB,GAAG;QACvB,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;IAEK,IAAM,SAAS,GAAG,UAAC,KAAyB;;QACzC,IAAA,SAAS,GAA4B,KAAK,UAAjC,EAAE,KAAK,GAAqB,KAAK,MAA1B,EAAE,MAAM,GAAa,KAAK,OAAlB,EAAE,MAAM,GAAK,KAAK,OAAV,CAAW;QAE3C,IAAA,OAAO,GAAK,KAAK,QAAV,CAAW;QAE1B,IAAM,UAAU,GAAG,IAAA,6BAAmB,EAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QAEhE,OAAO;YACL,IAAI,EAAE;gBACJ,UAAU,CAAC,IAAI;gBACf,KAAK,CAAC,KAAK,CAAC,MAAM;gBAClB;oBACE,eAAe,EAAE,OAAO,CAAC,kBAAkB;oBAC3C,GAAG,EAAE,CAAC;oBACN,KAAK,EAAE,CAAC;oBACR,MAAM,EAAE,CAAC;oBACT,IAAI,EAAE,CAAC;oBACP,QAAQ,EAAE,UAAU;oBAEpB,SAAS;wBACP,GAAC,8BAAoB,IAAG;4BACtB,MAAM,EAAE,sBAAsB;4BAC9B,OAAO,EAAE,CAAC;yBACX;2BACF;iBACF;gBAED,MAAM,IAAI;oBACR,UAAU,EAAE,QAAQ;iBACrB;gBAED,MAAM,IAAI;oBACR,UAAU,CAAC,QAAQ;oBACnB;wBACE,eAAe,EAAE,OAAO,CAAC,kBAAkB;qBAC5C;iBACF;gBAED,SAAS;aACV;SACF,CAAC;IACJ,CAAC,CAAC;IAzCW,QAAA,SAAS,aAyCpB","sourcesContent":["import { HighContrastSelector, getGlobalClassNames } from '../../Styling';\nimport type { IOverlayStyleProps, IOverlayStyles } from './Overlay.types';\n\nconst GlobalClassNames = {\n root: 'ms-Overlay',\n rootDark: 'ms-Overlay--dark',\n};\n\nexport const getStyles = (props: IOverlayStyleProps): IOverlayStyles => {\n const { className, theme, isNone, isDark } = props;\n\n const { palette } = theme;\n\n const classNames = getGlobalClassNames(GlobalClassNames, theme);\n\n return {\n root: [\n classNames.root,\n theme.fonts.medium,\n {\n backgroundColor: palette.whiteTranslucent40,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n position: 'absolute',\n\n selectors: {\n [HighContrastSelector]: {\n border: '1px solid WindowText',\n opacity: 0,\n },\n },\n },\n\n isNone && {\n visibility: 'hidden',\n },\n\n isDark && [\n classNames.rootDark,\n {\n backgroundColor: palette.blackTranslucent40,\n },\n ],\n\n className,\n ],\n };\n};\n"]}
@@ -0,0 +1,70 @@
import * as React from 'react';
import type { IStyle, ITheme } from '../../Styling';
import type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';
/**
* {@docCategory Overlay}
*/
export interface IOverlay {
}
/**
* {@docCategory Overlay}
*/
export interface IOverlayProps extends React.HTMLAttributes<HTMLElement> {
/**
* Gets the component ref.
*/
componentRef?: IRefObject<IOverlay>;
/**
* Call to provide customized styling that will layer on top of the variant rules
*/
styles?: IStyleFunctionOrObject<IOverlayStyleProps, IOverlayStyles>;
/**
* Theme provided by HOC.
*/
theme?: ITheme;
/**
* Additional css class to apply to the Overlay
* @defaultvalue undefined
*/
className?: string;
/**
* Whether to use the dark-themed overlay.
* @defaultvalue false
*/
isDarkThemed?: boolean;
/**
* Allow body scroll on touch devices. Changing after mounting has no effect.
* @defaultvalue false
*/
allowTouchBodyScroll?: boolean;
}
/**
* {@docCategory Overlay}
*/
export interface IOverlayStyleProps {
/**
* Accept theme prop.
*/
theme: ITheme;
/**
* Accept custom classNames
*/
className?: string;
/**
* Is overlay visible
*/
isNone?: boolean;
/**
* Is overlay dark themed
*/
isDark?: boolean;
}
/**
* {@docCategory Overlay}
*/
export interface IOverlayStyles {
/**
* Style for the root element.
*/
root: IStyle;
}
@@ -0,0 +1,5 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=Overlay.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Overlay.types.js","sourceRoot":"../src/","sources":["components/Overlay/Overlay.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { IStyle, ITheme } from '../../Styling';\nimport type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * {@docCategory Overlay}\n */\nexport interface IOverlay {}\n\n/**\n * {@docCategory Overlay}\n */\nexport interface IOverlayProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * Gets the component ref.\n */\n componentRef?: IRefObject<IOverlay>;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: IStyleFunctionOrObject<IOverlayStyleProps, IOverlayStyles>;\n\n /**\n * Theme provided by HOC.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the Overlay\n * @defaultvalue undefined\n */\n className?: string;\n\n /**\n * Whether to use the dark-themed overlay.\n * @defaultvalue false\n */\n isDarkThemed?: boolean;\n\n /**\n * Allow body scroll on touch devices. Changing after mounting has no effect.\n * @defaultvalue false\n */\n allowTouchBodyScroll?: boolean;\n}\n\n/**\n * {@docCategory Overlay}\n */\nexport interface IOverlayStyleProps {\n /**\n * Accept theme prop.\n */\n theme: ITheme;\n\n /**\n * Accept custom classNames\n */\n className?: string;\n\n /**\n * Is overlay visible\n */\n isNone?: boolean;\n\n /**\n * Is overlay dark themed\n */\n isDark?: boolean;\n}\n\n/**\n * {@docCategory Overlay}\n */\nexport interface IOverlayStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n}\n"]}
+3
View File
@@ -0,0 +1,3 @@
export * from './Overlay';
export * from './Overlay.base';
export * from './Overlay.types';
+8
View File
@@ -0,0 +1,8 @@
define(["require", "exports", "tslib", "./Overlay", "./Overlay.base", "./Overlay.types"], function (require, exports, tslib_1, Overlay_1, Overlay_base_1, Overlay_types_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
tslib_1.__exportStar(Overlay_1, exports);
tslib_1.__exportStar(Overlay_base_1, exports);
tslib_1.__exportStar(Overlay_types_1, exports);
});
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Overlay/index.ts"],"names":[],"mappings":";;;IAAA,yCAA0B;IAC1B,8CAA+B;IAC/B,+CAAgC","sourcesContent":["export * from './Overlay';\nexport * from './Overlay.base';\nexport * from './Overlay.types';\n"]}