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
+10
View File
@@ -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;
}
+33
View File
@@ -0,0 +1,33 @@
import { __assign, __extends } from "tslib";
import * as React from 'react';
import { classNamesFunction, getNativeProps, divProperties, enableBodyScroll, disableBodyScroll, initializeComponentRef, } from '../../Utilities';
var getClassNames = classNamesFunction();
var OverlayBase = /** @class */ (function (_super) {
__extends(OverlayBase, _super);
function OverlayBase(props) {
var _this = _super.call(this, props) || this;
initializeComponentRef(_this);
var _a = _this.props.allowTouchBodyScroll, allowTouchBodyScroll = _a === void 0 ? false : _a;
_this._allowTouchBodyScroll = allowTouchBodyScroll;
return _this;
}
OverlayBase.prototype.componentDidMount = function () {
!this._allowTouchBodyScroll && disableBodyScroll();
};
OverlayBase.prototype.componentWillUnmount = function () {
!this._allowTouchBodyScroll && enableBodyScroll();
};
OverlayBase.prototype.render = function () {
var _a = this.props, isDark = _a.isDarkThemed, className = _a.className, theme = _a.theme, styles = _a.styles;
var divProps = getNativeProps(this.props, divProperties);
var classNames = getClassNames(styles, {
theme: theme,
className: className,
isDark: isDark,
});
return React.createElement("div", __assign({}, divProps, { className: classNames.root }));
};
return OverlayBase;
}(React.Component));
export { 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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAKzB,IAAM,aAAa,GAAG,kBAAkB,EAAsC,CAAC;AAE/E;IAAiC,+BAAkC;IAGjE,qBAAY,KAAoB;QAC9B,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAEb,sBAAsB,CAAC,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,iBAAiB,EAAE,CAAC;IACrD,CAAC;IAEM,0CAAoB,GAA3B;QACE,CAAC,IAAI,CAAC,qBAAqB,IAAI,gBAAgB,EAAE,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,cAAc,CAAuC,IAAI,CAAC,KAAK,EAAE,aAAa,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,wCAAS,QAAQ,IAAE,SAAS,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC;IAC3D,CAAC;IACH,kBAAC;AAAD,CAAC,AAhCD,CAAiC,KAAK,CAAC,SAAS,GAgC/C","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>;
+7
View File
@@ -0,0 +1,7 @@
import { styled } from '../../Utilities';
import { OverlayBase } from './Overlay.base';
import { getStyles } from './Overlay.styles';
export var Overlay = styled(OverlayBase, getStyles, undefined, {
scope: 'Overlay',
});
//# sourceMappingURL=Overlay.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"Overlay.js","sourceRoot":"../src/","sources":["components/Overlay/Overlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,MAAM,CAAC,IAAM,OAAO,GAA2C,MAAM,CAInE,WAAW,EAAE,SAAS,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;
+42
View File
@@ -0,0 +1,42 @@
import { HighContrastSelector, getGlobalClassNames } from '../../Styling';
var GlobalClassNames = {
root: 'ms-Overlay',
rootDark: 'ms-Overlay--dark',
};
export 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 = 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[HighContrastSelector] = {
border: '1px solid WindowText',
opacity: 0,
},
_a),
},
isNone && {
visibility: 'hidden',
},
isDark && [
classNames.rootDark,
{
backgroundColor: palette.blackTranslucent40,
},
],
className,
],
};
};
//# 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,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAG1E,IAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,kBAAkB;CAC7B,CAAC;AAEF,MAAM,CAAC,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,mBAAmB,CAAC,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,oBAAoB,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","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"]}
+70
View File
@@ -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;
}
+2
View File
@@ -0,0 +1,2 @@
export {};
//# 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';
+4
View File
@@ -0,0 +1,4 @@
export * from './Overlay';
export * from './Overlay.base';
export * from './Overlay.types';
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Overlay/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './Overlay';\nexport * from './Overlay.base';\nexport * from './Overlay.types';\n"]}