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
+6
View File
@@ -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;
}
+29
View File
@@ -0,0 +1,29 @@
import { __assign, __extends } from "tslib";
import * as React from 'react';
import { divProperties, getNativeProps } from '../../Utilities';
import { classNamesFunction } from '../../Utilities';
var getClassNames = 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) {
__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, __assign({}, getNativeProps(this.props, divProperties), { className: classNames.root }), children));
};
return LabelBase;
}(React.Component));
export { LabelBase };
//# sourceMappingURL=Label.base.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"Label.base.js","sourceRoot":"../src/","sources":["components/Label/Label.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAKrD,IAAM,aAAa,GAAG,kBAAkB,CAAiC;IACvE,2CAA2C;IAC3C,iFAAiF;IACjF,yCAAyC;IACzC,SAAS,EAAE,GAAG;CACf,CAAC,CAAC;AAEH;IAA+B,6BAAgC;IAA/D;;IAeA,CAAC;IAdQ,0BAAM,GAAb;QACQ,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;QACtG,IAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE;YACvC,SAAS,WAAA;YACT,QAAQ,UAAA;YACR,QAAQ,UAAA;YACR,KAAK,EAAE,KAAM;SACd,CAAC,CAAC;QACH,OAAO,CACL,oBAAC,QAAQ,eAAK,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,IAAE,SAAS,EAAE,UAAU,CAAC,IAAI,KAChF,QAAQ,CACA,CACZ,CAAC;IACJ,CAAC;IACH,gBAAC;AAAD,CAAC,AAfD,CAA+B,KAAK,CAAC,SAAS,GAe7C","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>;
+7
View File
@@ -0,0 +1,7 @@
import { styled } from '../../Utilities';
import { LabelBase } from './Label.base';
import { getStyles } from './Label.styles';
export var Label = styled(LabelBase, 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":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,CAAC,IAAM,KAAK,GAAyC,MAAM,CAC/D,SAAS,EACT,SAAS,EACT,SAAS,EACT;IACE,KAAK,EAAE,OAAO;CACf,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"]}
+2
View File
@@ -0,0 +1,2 @@
import type { ILabelStyleProps, ILabelStyles } from './Label.types';
export declare const getStyles: (props: ILabelStyleProps) => ILabelStyles;
+46
View File
@@ -0,0 +1,46 @@
import { __assign } from "tslib";
import { HighContrastSelector, FontWeights, getHighContrastNoAdjustStyle } from '../../Styling';
export 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 = 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[HighContrastSelector] = __assign({ color: 'GrayText' }, getHighContrastNoAdjustStyle()),
_a),
},
required && {
selectors: {
'::after': {
content: "' *'",
color: labelRequiredStarColor,
paddingRight: 12,
},
},
},
className,
],
};
};
//# sourceMappingURL=Label.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Label.styles.js","sourceRoot":"../src/","sources":["components/Label/Label.styles.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAGhG,MAAM,CAAC,IAAM,SAAS,GAAG,UAAC,KAAuB;;IACvC,IAAA,KAAK,GAAoC,KAAK,MAAzC,EAAE,SAAS,GAAyB,KAAK,UAA9B,EAAE,QAAQ,GAAe,KAAK,SAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;IAC/C,IAAA,cAAc,GAAK,KAAK,eAAV,CAAW;IAEjC,SAAS;IACT,IAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC;IAC7C,IAAM,UAAU,GAAG,cAAc,CAAC,QAAQ,CAAC;IAC3C,IAAM,kBAAkB,GAAG,cAAc,CAAC,gBAAgB,CAAC;IAC3D,IAAM,sBAAsB,GAAG,cAAc,CAAC,SAAS,CAAC;IAExD,OAAO;QACL,IAAI,EAAE;YACJ,UAAU;YACV,KAAK,CAAC,KAAK,CAAC,MAAM;YAClB;gBACE,UAAU,EAAE,eAAe;gBAC3B,KAAK,EAAE,UAAU;gBACjB,SAAS,EAAE,YAAY;gBACvB,SAAS,EAAE,MAAM;gBACjB,MAAM,EAAE,CAAC;gBACT,OAAO,EAAE,OAAO;gBAChB,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,YAAY;aAC3B;YACD,QAAQ,IAAI;gBACV,KAAK,EAAE,kBAAkB;gBACzB,SAAS;oBACP,GAAC,oBAAoB,eACnB,KAAK,EAAE,UAAU,IACd,4BAA4B,EAAE,CAClC;uBACF;aACF;YACD,QAAQ,IAAI;gBACV,SAAS,EAAE;oBACT,SAAS,EAAE;wBACT,OAAO,EAAE,MAAM;wBACf,KAAK,EAAE,sBAAsB;wBAC7B,YAAY,EAAE,EAAE;qBACjB;iBACF;aACF;YACD,SAAS;SACV;KACF,CAAC;AACJ,CAAC,CAAC","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;
}
+2
View File
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=Label.types.js.map
+1
View File
@@ -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,4 @@
/* eslint-disable */
import { loadStyles } from '@microsoft/load-themed-styles';
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":"AAAA,oBAAoB;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,UAAU,CAAC,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';
+4
View File
@@ -0,0 +1,4 @@
export * from './Label.base';
export * from './Label.types';
export * from './Label';
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Label/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC","sourcesContent":["export * from './Label.base';\nexport * from './Label.types';\nexport * from './Label';\n"]}