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;
+9
View File
@@ -0,0 +1,9 @@
import { createComponent } from '@fluentui/foundation-legacy';
import { TextView } from './Text.view';
import { TextStyles as styles } from './Text.styles';
export var Text = createComponent(TextView, {
displayName: 'Text',
styles: styles,
});
export default 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":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAGrD,MAAM,CAAC,IAAM,IAAI,GAAwC,eAAe,CAAC,QAAQ,EAAE;IACjF,WAAW,EAAE,MAAM;IACnB,MAAM,QAAA;CACP,CAAC,CAAC;AAEH,eAAe,IAAI,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"]}
+2
View File
@@ -0,0 +1,2 @@
import type { ITextComponent } from './Text.types';
export declare const TextStyles: ITextComponent['styles'];
+23
View File
@@ -0,0 +1,23 @@
export 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,
],
};
};
//# sourceMappingURL=Text.styles.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"Text.styles.js","sourceRoot":"../src/","sources":["components/Text/Text.styles.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,IAAM,UAAU,GAA6B,UAAC,KAAiB,EAAE,KAAa;IAC3E,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;IAChD,IAAA,KAAK,GAAqB,KAAK,MAA1B,EAAE,cAAc,GAAK,KAAK,eAAV,CAAW;IACxC,IAAM,aAAa,GAAG,KAAK,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC;IAEjD,OAAO;QACL,IAAI,EAAE;YACJ,aAAa;YACb;gBACE,KAAK,EAAE,aAAa,CAAC,KAAK,IAAI,cAAc,CAAC,QAAQ;gBACrD,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ;gBAClE,mBAAmB,EAAE,aAAa,CAAC,mBAAmB;gBACtD,mBAAmB,EAAE,aAAa,CAAC,mBAAmB;aACvD;YACD,MAAM,IAAI;gBACR,UAAU,EAAE,QAAQ;gBACpB,QAAQ,EAAE,QAAQ;gBAClB,YAAY,EAAE,UAAU;aACzB;YACD,SAAS;SACV;KACa,CAAC;AACnB,CAAC,CAAC","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>;
+2
View File
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=Text.types.js.map
+1
View File
@@ -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'];
+17
View File
@@ -0,0 +1,17 @@
import { __assign, __rest } from "tslib";
/** @jsxRuntime classic */
/** @jsx withSlots */
import { withSlots, getSlots } from '@fluentui/foundation-legacy';
import { getNativeProps, htmlElementProperties } from '../../Utilities';
export 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 = __rest(props, ["block", "className", "as", "variant", "nowrap"]);
var Slots = getSlots(props, {
root: RootType,
});
return withSlots(Slots.root, __assign({}, getNativeProps(rest, htmlElementProperties)));
};
//# sourceMappingURL=Text.view.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"Text.view.js","sourceRoot":"../src/","sources":["components/Text/Text.view.tsx"],"names":[],"mappings":";AAAA,0BAA0B;AAC1B,qBAAqB;AACrB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxE,MAAM,CAAC,IAAM,QAAQ,GAA2B,UAAA,KAAK;IACnD,kCAAkC;IAClC,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,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,UAAK,KAAK,EAA7E,iDAAqE,CAAF,CAAW;IAEpF,IAAM,KAAK,GAAG,QAAQ,CAAyB,KAAK,EAAE;QACpD,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,OAAO,UAAC,KAAK,CAAC,IAAI,eAAK,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,EAAI,CAAC;AACzE,CAAC,CAAC","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';
+5
View File
@@ -0,0 +1,5 @@
export * from './Text';
export * from './Text.types';
export * from './Text.view';
export * from './Text.styles';
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Text/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC","sourcesContent":["export * from './Text';\nexport * from './Text.types';\nexport * from './Text.view';\nexport * from './Text.styles';\n"]}