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,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OverlayBase = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
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":";;;;AAAA,6BAA+B;AAC/B,6CAOyB;AAKzB,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAsC,CAAC;AAE/E;IAAiC,uCAAkC;IAGjE,qBAAY,KAAoB;QAC9B,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAEb,IAAA,kCAAsB,EAAC,KAAI,CAAC,CAAC;QACrB,IAAA,KAAiC,KAAI,CAAC,KAAK,qBAAf,EAA5B,oBAAoB,mBAAG,KAAK,KAAA,CAAgB;QACpD,KAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;;IACpD,CAAC;IAEM,uCAAiB,GAAxB;QACE,CAAC,IAAI,CAAC,qBAAqB,IAAI,IAAA,6BAAiB,GAAE,CAAC;IACrD,CAAC;IAEM,0CAAoB,GAA3B;QACE,CAAC,IAAI,CAAC,qBAAqB,IAAI,IAAA,4BAAgB,GAAE,CAAC;IACpD,CAAC;IAEM,4BAAM,GAAb;QACQ,IAAA,KAAqD,IAAI,CAAC,KAAK,EAA/C,MAAM,kBAAA,EAAE,SAAS,eAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAe,CAAC;QAEtE,IAAM,QAAQ,GAAG,IAAA,0BAAc,EAAuC,IAAI,CAAC,KAAK,EAAE,yBAAa,CAAC,CAAC;QAEjG,IAAM,UAAU,GAAG,aAAa,CAAC,MAAO,EAAE;YACxC,KAAK,EAAE,KAAM;YACb,SAAS,WAAA;YACT,MAAM,QAAA;SACP,CAAC,CAAC;QAEH,OAAO,gDAAS,QAAQ,IAAE,SAAS,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC;IAC3D,CAAC;IACH,kBAAC;AAAD,CAAC,AAhCD,CAAiC,KAAK,CAAC,SAAS,GAgC/C;AAhCY,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"]}
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { IOverlayProps } from './Overlay.types';
export declare const Overlay: React.FunctionComponent<IOverlayProps>;
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Overlay = void 0;
var Utilities_1 = require("../../Utilities");
var Overlay_base_1 = require("./Overlay.base");
var Overlay_styles_1 = require("./Overlay.styles");
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":";;;AACA,6CAAyC;AACzC,+CAA6C;AAC7C,mDAA6C;AAGhC,QAAA,OAAO,GAA2C,IAAA,kBAAM,EAInE,0BAAW,EAAE,0BAAS,EAAE,SAAS,EAAE;IACnC,KAAK,EAAE,SAAS;CACjB,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,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyles = void 0;
var Styling_1 = require("../../Styling");
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":";;;AAAA,yCAA0E;AAG1E,IAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,kBAAkB;CAC7B,CAAC;AAEK,IAAM,SAAS,GAAG,UAAC,KAAyB;;IACzC,IAAA,SAAS,GAA4B,KAAK,UAAjC,EAAE,KAAK,GAAqB,KAAK,MAA1B,EAAE,MAAM,GAAa,KAAK,OAAlB,EAAE,MAAM,GAAK,KAAK,OAAV,CAAW;IAE3C,IAAA,OAAO,GAAK,KAAK,QAAV,CAAW;IAE1B,IAAM,UAAU,GAAG,IAAA,6BAAmB,EAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IAEhE,OAAO;QACL,IAAI,EAAE;YACJ,UAAU,CAAC,IAAI;YACf,KAAK,CAAC,KAAK,CAAC,MAAM;YAClB;gBACE,eAAe,EAAE,OAAO,CAAC,kBAAkB;gBAC3C,GAAG,EAAE,CAAC;gBACN,KAAK,EAAE,CAAC;gBACR,MAAM,EAAE,CAAC;gBACT,IAAI,EAAE,CAAC;gBACP,QAAQ,EAAE,UAAU;gBAEpB,SAAS;oBACP,GAAC,8BAAoB,IAAG;wBACtB,MAAM,EAAE,sBAAsB;wBAC9B,OAAO,EAAE,CAAC;qBACX;uBACF;aACF;YAED,MAAM,IAAI;gBACR,UAAU,EAAE,QAAQ;aACrB;YAED,MAAM,IAAI;gBACR,UAAU,CAAC,QAAQ;gBACnB;oBACE,eAAe,EAAE,OAAO,CAAC,kBAAkB;iBAC5C;aACF;YAED,SAAS;SACV;KACF,CAAC;AACJ,CAAC,CAAC;AAzCW,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,3 @@
"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"]}
@@ -0,0 +1,3 @@
export * from './Overlay';
export * from './Overlay.base';
export * from './Overlay.types';
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./Overlay"), exports);
tslib_1.__exportStar(require("./Overlay.base"), exports);
tslib_1.__exportStar(require("./Overlay.types"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Overlay/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,yDAA+B;AAC/B,0DAAgC","sourcesContent":["export * from './Overlay';\nexport * from './Overlay.base';\nexport * from './Overlay.types';\n"]}