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
+4
View File
@@ -0,0 +1,4 @@
import * as React from 'react';
import type { ITextProps } from './Text.types';
export declare const Text: React.FunctionComponent<ITextProps>;
export default Text;
+11
View File
@@ -0,0 +1,11 @@
define(["require", "exports", "@fluentui/foundation-legacy", "./Text.view", "./Text.styles"], function (require, exports, foundation_legacy_1, Text_view_1, Text_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Text = void 0;
exports.Text = (0, foundation_legacy_1.createComponent)(Text_view_1.TextView, {
displayName: 'Text',
styles: Text_styles_1.TextStyles,
});
exports.default = exports.Text;
});
//# sourceMappingURL=Text.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"Text.js","sourceRoot":"../src/","sources":["components/Text/Text.ts"],"names":[],"mappings":";;;;IAMa,QAAA,IAAI,GAAwC,IAAA,mCAAe,EAAC,oBAAQ,EAAE;QACjF,WAAW,EAAE,MAAM;QACnB,MAAM,0BAAA;KACP,CAAC,CAAC;IAEH,kBAAe,YAAI,CAAC","sourcesContent":["import * as React from 'react';\nimport { createComponent } from '@fluentui/foundation-legacy';\nimport { TextView } from './Text.view';\nimport { TextStyles as styles } from './Text.styles';\nimport type { ITextProps } from './Text.types';\n\nexport const Text: React.FunctionComponent<ITextProps> = createComponent(TextView, {\n displayName: 'Text',\n styles,\n});\n\nexport default Text;\n"]}
@@ -0,0 +1,2 @@
import type { ITextComponent } from './Text.types';
export declare const TextStyles: ITextComponent['styles'];
+29
View File
@@ -0,0 +1,29 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextStyles = void 0;
var TextStyles = function (props, theme) {
var as = props.as, className = props.className, block = props.block, nowrap = props.nowrap, variant = props.variant;
var fonts = theme.fonts, semanticColors = theme.semanticColors;
var variantObject = fonts[variant || 'medium'];
return {
root: [
variantObject,
{
color: variantObject.color || semanticColors.bodyText,
display: block ? (as === 'td' ? 'table-cell' : 'block') : 'inline',
mozOsxFontSmoothing: variantObject.MozOsxFontSmoothing,
webkitFontSmoothing: variantObject.WebkitFontSmoothing,
},
nowrap && {
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
},
className,
],
};
};
exports.TextStyles = TextStyles;
});
//# sourceMappingURL=Text.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Text.styles.js","sourceRoot":"../src/","sources":["components/Text/Text.styles.ts"],"names":[],"mappings":";;;;IAGO,IAAM,UAAU,GAA6B,UAAC,KAAiB,EAAE,KAAa;QAC3E,IAAA,EAAE,GAAwC,KAAK,GAA7C,EAAE,SAAS,GAA6B,KAAK,UAAlC,EAAE,KAAK,GAAsB,KAAK,MAA3B,EAAE,MAAM,GAAc,KAAK,OAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;QAChD,IAAA,KAAK,GAAqB,KAAK,MAA1B,EAAE,cAAc,GAAK,KAAK,eAAV,CAAW;QACxC,IAAM,aAAa,GAAG,KAAK,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC;QAEjD,OAAO;YACL,IAAI,EAAE;gBACJ,aAAa;gBACb;oBACE,KAAK,EAAE,aAAa,CAAC,KAAK,IAAI,cAAc,CAAC,QAAQ;oBACrD,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ;oBAClE,mBAAmB,EAAE,aAAa,CAAC,mBAAmB;oBACtD,mBAAmB,EAAE,aAAa,CAAC,mBAAmB;iBACvD;gBACD,MAAM,IAAI;oBACR,UAAU,EAAE,QAAQ;oBACpB,QAAQ,EAAE,QAAQ;oBAClB,YAAY,EAAE,UAAU;iBACzB;gBACD,SAAS;aACV;SACa,CAAC;IACnB,CAAC,CAAC;IAtBW,QAAA,UAAU,cAsBrB","sourcesContent":["import type { ITextComponent, ITextStyles, ITextStylesReturnType, ITextProps } from './Text.types';\nimport type { ITheme } from '../../Styling';\n\nexport const TextStyles: ITextComponent['styles'] = (props: ITextProps, theme: ITheme): ITextStylesReturnType => {\n const { as, className, block, nowrap, variant } = props;\n const { fonts, semanticColors } = theme;\n const variantObject = fonts[variant || 'medium'];\n\n return {\n root: [\n variantObject,\n {\n color: variantObject.color || semanticColors.bodyText,\n display: block ? (as === 'td' ? 'table-cell' : 'block') : 'inline',\n mozOsxFontSmoothing: variantObject.MozOsxFontSmoothing,\n webkitFontSmoothing: variantObject.WebkitFontSmoothing,\n },\n nowrap && {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n className,\n ],\n } as ITextStyles;\n};\n"]}
+62
View File
@@ -0,0 +1,62 @@
import * as React from 'react';
import type { IComponentStyles, IHTMLSlot, ISlotProp, IComponent, IStyleableComponentProps, ISlottableProps } from '@fluentui/foundation-legacy';
import type { IFontStyles } from '../../Styling';
/**
* {@docCategory Text}
*/
export type ITextComponent = IComponent<ITextProps, ITextTokens, ITextStyles>;
/**
* {@docCategory Text}
*/
export type ITextTokenReturnType = ReturnType<Extract<ITextComponent['tokens'], Function>>;
/**
* {@docCategory Text}
*/
export type ITextStylesReturnType = ReturnType<Extract<ITextComponent['styles'], Function>>;
/**
* {@docCategory Text}
*/
export type ITextSlot = ISlotProp<ITextProps, string>;
/**
* {@docCategory Text}
*/
export interface ITextSlots {
root?: IHTMLSlot;
}
/**
* Inputs to the component
* {@docCategory Text}
*/
export interface ITextProps extends ISlottableProps<ITextSlots>, IStyleableComponentProps<ITextProps, ITextTokens, ITextStyles>, React.HTMLAttributes<HTMLElement> {
/**
* Optionally render the component as another component type or primitive.
*/
as?: React.ElementType<React.HTMLAttributes<HTMLElement>>;
/**
* Optional font type for Text.
*/
variant?: keyof IFontStyles;
/**
* Whether the text is displayed as a block element.
*
* Note that in order for ellipsis on overflow to work properly,
* `block` and `nowrap` should be set to true.
*/
block?: boolean;
/**
* Whether the text is not wrapped.
*
* Note that in order for ellipsis on overflow to work properly,
* `block` and `nowrap` should be set to true.
*/
nowrap?: boolean;
}
/**
* {@docCategory Text}
*/
export interface ITextTokens {
}
/**
* {@docCategory Text}
*/
export type ITextStyles = IComponentStyles<ITextSlots>;
+5
View File
@@ -0,0 +1,5 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=Text.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Text.types.js","sourceRoot":"../src/","sources":["components/Text/Text.types.tsx"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type {\n IComponentStyles,\n IHTMLSlot,\n ISlotProp,\n IComponent,\n IStyleableComponentProps,\n ISlottableProps,\n} from '@fluentui/foundation-legacy';\nimport type { IFontStyles } from '../../Styling';\n\n/**\n * {@docCategory Text}\n */\nexport type ITextComponent = IComponent<ITextProps, ITextTokens, ITextStyles>;\n\n// The following two types are redundant with ITextComponent but are needed until TS function return widening issue\n// is resolved: https://github.com/Microsoft/TypeScript/issues/241\n// For now, these helper types can be used to provide return type safety when specifying tokens and styles functions.\n\n/**\n * {@docCategory Text}\n */\nexport type ITextTokenReturnType = ReturnType<Extract<ITextComponent['tokens'], Function>>;\n\n/**\n * {@docCategory Text}\n */\nexport type ITextStylesReturnType = ReturnType<Extract<ITextComponent['styles'], Function>>;\n\n/**\n * {@docCategory Text}\n */\nexport type ITextSlot = ISlotProp<ITextProps, string>;\n\n/**\n * {@docCategory Text}\n */\nexport interface ITextSlots {\n root?: IHTMLSlot;\n}\n\n/**\n * Inputs to the component\n * {@docCategory Text}\n */\nexport interface ITextProps\n extends ISlottableProps<ITextSlots>,\n IStyleableComponentProps<ITextProps, ITextTokens, ITextStyles>,\n React.HTMLAttributes<HTMLElement> {\n /**\n * Optionally render the component as another component type or primitive.\n */\n as?: React.ElementType<React.HTMLAttributes<HTMLElement>>;\n\n /**\n * Optional font type for Text.\n */\n variant?: keyof IFontStyles;\n\n /**\n * Whether the text is displayed as a block element.\n *\n * Note that in order for ellipsis on overflow to work properly,\n * `block` and `nowrap` should be set to true.\n */\n block?: boolean;\n\n /**\n * Whether the text is not wrapped.\n *\n * Note that in order for ellipsis on overflow to work properly,\n * `block` and `nowrap` should be set to true.\n */\n nowrap?: boolean;\n}\n\n/**\n * {@docCategory Text}\n */\nexport interface ITextTokens {}\n\n/**\n * {@docCategory Text}\n */\nexport type ITextStyles = IComponentStyles<ITextSlots>;\n"]}
+2
View File
@@ -0,0 +1,2 @@
import type { ITextComponent } from './Text.types';
export declare const TextView: ITextComponent['view'];
+18
View File
@@ -0,0 +1,18 @@
define(["require", "exports", "tslib", "@fluentui/foundation-legacy", "../../Utilities"], function (require, exports, tslib_1, foundation_legacy_1, Utilities_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextView = void 0;
var TextView = function (props) {
// eslint-disable-next-line eqeqeq
if (props.children == null) {
return null;
}
var block = props.block, className = props.className, _a = props.as, RootType = _a === void 0 ? 'span' : _a, variant = props.variant, nowrap = props.nowrap, rest = tslib_1.__rest(props, ["block", "className", "as", "variant", "nowrap"]);
var Slots = (0, foundation_legacy_1.getSlots)(props, {
root: RootType,
});
return (0, foundation_legacy_1.withSlots)(Slots.root, tslib_1.__assign({}, (0, Utilities_1.getNativeProps)(rest, Utilities_1.htmlElementProperties)));
};
exports.TextView = TextView;
});
//# sourceMappingURL=Text.view.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Text.view.js","sourceRoot":"../src/","sources":["components/Text/Text.view.tsx"],"names":[],"mappings":";;;;IAMO,IAAM,QAAQ,GAA2B,UAAA,KAAK;QACnD,kCAAkC;QAClC,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;QAEO,IAAA,KAAK,GAAiE,KAAK,MAAtE,EAAE,SAAS,GAAsD,KAAK,UAA3D,EAAE,KAAoD,KAAK,GAApC,EAAjB,QAAQ,mBAAG,MAAM,KAAA,EAAE,OAAO,GAAsB,KAAK,QAA3B,EAAE,MAAM,GAAc,KAAK,OAAnB,EAAK,IAAI,kBAAK,KAAK,EAA7E,iDAAqE,CAAF,CAAW;QAEpF,IAAM,KAAK,GAAG,IAAA,4BAAQ,EAAyB,KAAK,EAAE;YACpD,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;QAEH,OAAO,mCAAC,KAAK,CAAC,IAAI,uBAAK,IAAA,0BAAc,EAAC,IAAI,EAAE,iCAAqB,CAAC,EAAI,CAAC;IACzE,CAAC,CAAC;IAbW,QAAA,QAAQ,YAanB","sourcesContent":["/** @jsxRuntime classic */\n/** @jsx withSlots */\nimport { withSlots, getSlots } from '@fluentui/foundation-legacy';\nimport { getNativeProps, htmlElementProperties } from '../../Utilities';\nimport type { ITextComponent, ITextProps, ITextSlots } from './Text.types';\n\nexport const TextView: ITextComponent['view'] = props => {\n // eslint-disable-next-line eqeqeq\n if (props.children == null) {\n return null;\n }\n\n const { block, className, as: RootType = 'span', variant, nowrap, ...rest } = props;\n\n const Slots = getSlots<ITextProps, ITextSlots>(props, {\n root: RootType,\n });\n\n return <Slots.root {...getNativeProps(rest, htmlElementProperties)} />;\n};\n"]}
+4
View File
@@ -0,0 +1,4 @@
export * from './Text';
export * from './Text.types';
export * from './Text.view';
export * from './Text.styles';
+9
View File
@@ -0,0 +1,9 @@
define(["require", "exports", "tslib", "./Text", "./Text.types", "./Text.view", "./Text.styles"], function (require, exports, tslib_1, Text_1, Text_types_1, Text_view_1, Text_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
tslib_1.__exportStar(Text_1, exports);
tslib_1.__exportStar(Text_types_1, exports);
tslib_1.__exportStar(Text_view_1, exports);
tslib_1.__exportStar(Text_styles_1, exports);
});
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Text/index.ts"],"names":[],"mappings":";;;IAAA,sCAAuB;IACvB,4CAA6B;IAC7B,2CAA4B;IAC5B,6CAA8B","sourcesContent":["export * from './Text';\nexport * from './Text.types';\nexport * from './Text.view';\nexport * from './Text.styles';\n"]}