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,6 @@
import * as React from 'react';
import type { ILabelProps } from './Label.types';
import type { JSXElement } from '@fluentui/utilities';
export declare class LabelBase extends React.Component<ILabelProps, {}> {
render(): JSXElement;
}
+30
View File
@@ -0,0 +1,30 @@
define(["require", "exports", "tslib", "react", "../../Utilities", "../../Utilities"], function (require, exports, tslib_1, React, Utilities_1, Utilities_2) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LabelBase = void 0;
var getClassNames = (0, Utilities_2.classNamesFunction)({
// Label is used a lot by other components.
// It's likely to see expected cases which pass different className to the Label.
// Therefore setting a larger cache size.
cacheSize: 100,
});
var LabelBase = /** @class */ (function (_super) {
tslib_1.__extends(LabelBase, _super);
function LabelBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
LabelBase.prototype.render = function () {
var _a = this.props, _b = _a.as, RootType = _b === void 0 ? 'label' : _b, children = _a.children, className = _a.className, disabled = _a.disabled, styles = _a.styles, required = _a.required, theme = _a.theme;
var classNames = getClassNames(styles, {
className: className,
disabled: disabled,
required: required,
theme: theme,
});
return (React.createElement(RootType, tslib_1.__assign({}, (0, Utilities_1.getNativeProps)(this.props, Utilities_1.divProperties), { className: classNames.root }), children));
};
return LabelBase;
}(React.Component));
exports.LabelBase = LabelBase;
});
//# sourceMappingURL=Label.base.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Label.base.js","sourceRoot":"../src/","sources":["components/Label/Label.base.tsx"],"names":[],"mappings":";;;;IAOA,IAAM,aAAa,GAAG,IAAA,8BAAkB,EAAiC;QACvE,2CAA2C;QAC3C,iFAAiF;QACjF,yCAAyC;QACzC,SAAS,EAAE,GAAG;KACf,CAAC,CAAC;IAEH;QAA+B,qCAAgC;QAA/D;;QAeA,CAAC;QAdQ,0BAAM,GAAb;YACQ,IAAA,KAAqF,IAAI,CAAC,KAAK,EAA7F,UAAsB,EAAlB,QAAQ,mBAAG,OAAO,KAAA,EAAE,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAE,MAAM,YAAA,EAAE,QAAQ,cAAA,EAAE,KAAK,WAAe,CAAC;YACtG,IAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE;gBACvC,SAAS,WAAA;gBACT,QAAQ,UAAA;gBACR,QAAQ,UAAA;gBACR,KAAK,EAAE,KAAM;aACd,CAAC,CAAC;YACH,OAAO,CACL,oBAAC,QAAQ,uBAAK,IAAA,0BAAc,EAAC,IAAI,CAAC,KAAK,EAAE,yBAAa,CAAC,IAAE,SAAS,EAAE,UAAU,CAAC,IAAI,KAChF,QAAQ,CACA,CACZ,CAAC;QACJ,CAAC;QACH,gBAAC;IAAD,CAAC,AAfD,CAA+B,KAAK,CAAC,SAAS,GAe7C;IAfY,8BAAS","sourcesContent":["import * as React from 'react';\nimport { divProperties, getNativeProps } from '../../Utilities';\nimport { classNamesFunction } from '../../Utilities';\nimport type { ILabelProps, ILabelStyleProps, ILabelStyles } from './Label.types';\n\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<ILabelStyleProps, ILabelStyles>({\n // Label is used a lot by other components.\n // It's likely to see expected cases which pass different className to the Label.\n // Therefore setting a larger cache size.\n cacheSize: 100,\n});\n\nexport class LabelBase extends React.Component<ILabelProps, {}> {\n public render(): JSXElement {\n const { as: RootType = 'label', children, className, disabled, styles, required, theme } = this.props;\n const classNames = getClassNames(styles, {\n className,\n disabled,\n required,\n theme: theme!,\n });\n return (\n <RootType {...getNativeProps(this.props, divProperties)} className={classNames.root}>\n {children}\n </RootType>\n );\n }\n}\n"]}
+3
View File
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { ILabelProps } from './Label.types';
export declare const Label: React.FunctionComponent<ILabelProps>;
+9
View File
@@ -0,0 +1,9 @@
define(["require", "exports", "../../Utilities", "./Label.base", "./Label.styles"], function (require, exports, Utilities_1, Label_base_1, Label_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Label = void 0;
exports.Label = (0, Utilities_1.styled)(Label_base_1.LabelBase, Label_styles_1.getStyles, undefined, {
scope: 'Label',
});
});
//# sourceMappingURL=Label.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"Label.js","sourceRoot":"../src/","sources":["components/Label/Label.tsx"],"names":[],"mappings":";;;;IAMa,QAAA,KAAK,GAAyC,IAAA,kBAAM,EAC/D,sBAAS,EACT,wBAAS,EACT,SAAS,EACT;QACE,KAAK,EAAE,OAAO;KACf,CACF,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { LabelBase } from './Label.base';\nimport { getStyles } from './Label.styles';\nimport type { ILabelProps, ILabelStyleProps, ILabelStyles } from './Label.types';\n\nexport const Label: React.FunctionComponent<ILabelProps> = styled<ILabelProps, ILabelStyleProps, ILabelStyles>(\n LabelBase,\n getStyles,\n undefined,\n {\n scope: 'Label',\n },\n);\n"]}
@@ -0,0 +1,2 @@
import type { ILabelStyleProps, ILabelStyles } from './Label.types';
export declare const getStyles: (props: ILabelStyleProps) => ILabelStyles;
+50
View File
@@ -0,0 +1,50 @@
define(["require", "exports", "tslib", "../../Styling"], function (require, exports, tslib_1, Styling_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyles = void 0;
var getStyles = function (props) {
var _a;
var theme = props.theme, className = props.className, disabled = props.disabled, required = props.required;
var semanticColors = theme.semanticColors;
// Tokens
var labelFontWeight = Styling_1.FontWeights.semibold;
var labelColor = semanticColors.bodyText;
var labelDisabledColor = semanticColors.disabledBodyText;
var labelRequiredStarColor = semanticColors.errorText;
return {
root: [
'ms-Label',
theme.fonts.medium,
{
fontWeight: labelFontWeight,
color: labelColor,
boxSizing: 'border-box',
boxShadow: 'none',
margin: 0,
display: 'block',
padding: '5px 0',
wordWrap: 'break-word',
overflowWrap: 'break-word',
},
disabled && {
color: labelDisabledColor,
selectors: (_a = {},
_a[Styling_1.HighContrastSelector] = tslib_1.__assign({ color: 'GrayText' }, (0, Styling_1.getHighContrastNoAdjustStyle)()),
_a),
},
required && {
selectors: {
'::after': {
content: "' *'",
color: labelRequiredStarColor,
paddingRight: 12,
},
},
},
className,
],
};
};
exports.getStyles = getStyles;
});
//# sourceMappingURL=Label.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Label.styles.js","sourceRoot":"../src/","sources":["components/Label/Label.styles.ts"],"names":[],"mappings":";;;;IAGO,IAAM,SAAS,GAAG,UAAC,KAAuB;;QACvC,IAAA,KAAK,GAAoC,KAAK,MAAzC,EAAE,SAAS,GAAyB,KAAK,UAA9B,EAAE,QAAQ,GAAe,KAAK,SAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAC/C,IAAA,cAAc,GAAK,KAAK,eAAV,CAAW;QAEjC,SAAS;QACT,IAAM,eAAe,GAAG,qBAAW,CAAC,QAAQ,CAAC;QAC7C,IAAM,UAAU,GAAG,cAAc,CAAC,QAAQ,CAAC;QAC3C,IAAM,kBAAkB,GAAG,cAAc,CAAC,gBAAgB,CAAC;QAC3D,IAAM,sBAAsB,GAAG,cAAc,CAAC,SAAS,CAAC;QAExD,OAAO;YACL,IAAI,EAAE;gBACJ,UAAU;gBACV,KAAK,CAAC,KAAK,CAAC,MAAM;gBAClB;oBACE,UAAU,EAAE,eAAe;oBAC3B,KAAK,EAAE,UAAU;oBACjB,SAAS,EAAE,YAAY;oBACvB,SAAS,EAAE,MAAM;oBACjB,MAAM,EAAE,CAAC;oBACT,OAAO,EAAE,OAAO;oBAChB,OAAO,EAAE,OAAO;oBAChB,QAAQ,EAAE,YAAY;oBACtB,YAAY,EAAE,YAAY;iBAC3B;gBACD,QAAQ,IAAI;oBACV,KAAK,EAAE,kBAAkB;oBACzB,SAAS;wBACP,GAAC,8BAAoB,uBACnB,KAAK,EAAE,UAAU,IACd,IAAA,sCAA4B,GAAE,CAClC;2BACF;iBACF;gBACD,QAAQ,IAAI;oBACV,SAAS,EAAE;wBACT,SAAS,EAAE;4BACT,OAAO,EAAE,MAAM;4BACf,KAAK,EAAE,sBAAsB;4BAC7B,YAAY,EAAE,EAAE;yBACjB;qBACF;iBACF;gBACD,SAAS;aACV;SACF,CAAC;IACJ,CAAC,CAAC;IA9CW,QAAA,SAAS,aA8CpB","sourcesContent":["import { HighContrastSelector, FontWeights, getHighContrastNoAdjustStyle } from '../../Styling';\nimport type { ILabelStyleProps, ILabelStyles } from './Label.types';\n\nexport const getStyles = (props: ILabelStyleProps): ILabelStyles => {\n const { theme, className, disabled, required } = props;\n const { semanticColors } = theme;\n\n // Tokens\n const labelFontWeight = FontWeights.semibold;\n const labelColor = semanticColors.bodyText;\n const labelDisabledColor = semanticColors.disabledBodyText;\n const labelRequiredStarColor = semanticColors.errorText;\n\n return {\n root: [\n 'ms-Label',\n theme.fonts.medium,\n {\n fontWeight: labelFontWeight,\n color: labelColor,\n boxSizing: 'border-box',\n boxShadow: 'none',\n margin: 0,\n display: 'block',\n padding: '5px 0',\n wordWrap: 'break-word',\n overflowWrap: 'break-word',\n },\n disabled && {\n color: labelDisabledColor,\n selectors: {\n [HighContrastSelector]: {\n color: 'GrayText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n },\n required && {\n selectors: {\n '::after': {\n content: `' *'`,\n color: labelRequiredStarColor,\n paddingRight: 12,\n },\n },\n },\n className,\n ],\n };\n};\n"]}
+60
View File
@@ -0,0 +1,60 @@
import * as React from 'react';
import type { ITheme, IStyle } from '../../Styling';
import type { IRefObject, IComponentAs, IStyleFunctionOrObject } from '../../Utilities';
/**
* {@docCategory Label}
*/
export interface ILabel {
}
/**
* {@docCategory Label}
*/
export interface ILabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
/**
* Render the root element as another type.
*/
as?: IComponentAs<React.AllHTMLAttributes<HTMLElement>>;
/**
* Optional callback to access the ILabel interface. Use this instead of ref for accessing
* the public methods and properties of the component.
*/
componentRef?: IRefObject<ILabel>;
/**
* Whether the associated form field is required or not
* @defaultvalue false
*/
required?: boolean;
/**
* Renders the label as disabled.
*/
disabled?: boolean;
/**
* Theme provided by HOC.
*/
theme?: ITheme;
/**
* Styles for the label.
*/
styles?: IStyleFunctionOrObject<ILabelStyleProps, ILabelStyles>;
}
/**
* {@docCategory Label}
*/
export interface ILabelStyles {
/**
* Styles for the root element.
*/
root: IStyle;
}
/**
* {@docCategory Label}
*/
export interface ILabelStyleProps {
/**
*
*/
theme: ITheme;
className?: string;
disabled?: boolean;
required?: boolean;
}
+5
View File
@@ -0,0 +1,5 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=Label.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Label.types.js","sourceRoot":"../src/","sources":["components/Label/Label.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ITheme, IStyle } from '../../Styling';\nimport type { IRefObject, IComponentAs, IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * {@docCategory Label}\n */\nexport interface ILabel {}\n\n/**\n * {@docCategory Label}\n */\nexport interface ILabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n /**\n * Render the root element as another type.\n */\n as?: IComponentAs<React.AllHTMLAttributes<HTMLElement>>;\n\n /**\n * Optional callback to access the ILabel interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<ILabel>;\n\n /**\n * Whether the associated form field is required or not\n * @defaultvalue false\n */\n required?: boolean;\n\n /**\n * Renders the label as disabled.\n */\n disabled?: boolean;\n\n /**\n * Theme provided by HOC.\n */\n theme?: ITheme;\n\n /**\n * Styles for the label.\n */\n styles?: IStyleFunctionOrObject<ILabelStyleProps, ILabelStyles>;\n}\n\n/**\n * {@docCategory Label}\n */\nexport interface ILabelStyles {\n /**\n * Styles for the root element.\n */\n root: IStyle;\n}\n\n/**\n * {@docCategory Label}\n */\nexport interface ILabelStyleProps {\n /**\n *\n */\n theme: ITheme;\n className?: string;\n disabled?: boolean;\n required?: boolean;\n}\n"]}
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,6 @@
define(["require", "exports", "@microsoft/load-themed-styles"], function (require, exports, load_themed_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
(0, load_themed_styles_1.loadStyles)([]);
});
//# sourceMappingURL=LabelMixins.scss.js.map
@@ -0,0 +1 @@
{"version":3,"file":"LabelMixins.scss.js","sourceRoot":"../src/","sources":["components/Label/LabelMixins.scss.ts"],"names":[],"mappings":";;;IAEA,IAAA,+BAAU,EAAC,EAAE,CAAC,CAAC","sourcesContent":["/* eslint-disable */\nimport { loadStyles } from '@microsoft/load-themed-styles';\nloadStyles([]);"]}
+3
View File
@@ -0,0 +1,3 @@
export * from './Label.base';
export * from './Label.types';
export * from './Label';
+8
View File
@@ -0,0 +1,8 @@
define(["require", "exports", "tslib", "./Label.base", "./Label.types", "./Label"], function (require, exports, tslib_1, Label_base_1, Label_types_1, Label_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
tslib_1.__exportStar(Label_base_1, exports);
tslib_1.__exportStar(Label_types_1, exports);
tslib_1.__exportStar(Label_1, exports);
});
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Label/index.ts"],"names":[],"mappings":";;;IAAA,4CAA6B;IAC7B,6CAA8B;IAC9B,uCAAwB","sourcesContent":["export * from './Label.base';\nexport * from './Label.types';\nexport * from './Label';\n"]}