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 @@
/** @jsxRuntime classic */
/** @jsx withSlots */
import * as React from 'react';
import type { IStackItemProps } from './StackItem.types';
export declare const StackItem: React.FunctionComponent<IStackItemProps>;
export default StackItem;
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackItem = void 0;
var tslib_1 = require("tslib");
var foundation_legacy_1 = require("@fluentui/foundation-legacy");
var Utilities_1 = require("../../../Utilities");
var StackItem_styles_1 = require("./StackItem.styles");
var StackItemView = function (props) {
var children = props.children;
var nativeProps = (0, Utilities_1.getNativeProps)(props, Utilities_1.htmlElementProperties);
// eslint-disable-next-line eqeqeq
if (children == null) {
return null;
}
var Slots = (0, foundation_legacy_1.getSlots)(props, {
root: 'div',
});
return (0, foundation_legacy_1.withSlots)(Slots.root, tslib_1.__assign({}, nativeProps), children);
};
exports.StackItem = (0, foundation_legacy_1.createComponent)(StackItemView, {
displayName: 'StackItem',
styles: StackItem_styles_1.StackItemStyles,
});
exports.default = exports.StackItem;
//# sourceMappingURL=StackItem.js.map
@@ -0,0 +1 @@
{"version":3,"file":"StackItem.js","sourceRoot":"../src/","sources":["components/Stack/StackItem/StackItem.tsx"],"names":[],"mappings":";;;;AAGA,iEAAmF;AACnF,gDAA2E;AAC3E,uDAA+D;AAG/D,IAAM,aAAa,GAAgC,UAAA,KAAK;IAC9C,IAAA,QAAQ,GAAK,KAAK,SAAV,CAAW;IAC3B,IAAM,WAAW,GAAG,IAAA,0BAAc,EAAuC,KAAK,EAAE,iCAAqB,CAAC,CAAC;IACvG,kCAAkC;IAClC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAM,KAAK,GAAG,IAAA,4BAAQ,EAAmC,KAAK,EAAE;QAC9D,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;IAEH,OAAO,mCAAC,KAAK,CAAC,IAAI,uBAAK,WAAW,GAAG,QAAQ,CAAc,CAAC;AAC9D,CAAC,CAAC;AAEW,QAAA,SAAS,GAA6C,IAAA,mCAAe,EAAC,aAAa,EAAE;IAChG,WAAW,EAAE,WAAW;IACxB,MAAM,oCAAA;CACP,CAAC,CAAC;AAEH,kBAAe,iBAAS,CAAC","sourcesContent":["/** @jsxRuntime classic */\n/** @jsx withSlots */\nimport * as React from 'react';\nimport { withSlots, createComponent, getSlots } from '@fluentui/foundation-legacy';\nimport { getNativeProps, htmlElementProperties } from '../../../Utilities';\nimport { StackItemStyles as styles } from './StackItem.styles';\nimport type { IStackItemComponent, IStackItemProps, IStackItemSlots } from './StackItem.types';\n\nconst StackItemView: IStackItemComponent['view'] = props => {\n const { children } = props;\n const nativeProps = getNativeProps<React.HTMLAttributes<HTMLDivElement>>(props, htmlElementProperties);\n // eslint-disable-next-line eqeqeq\n if (children == null) {\n return null;\n }\n\n const Slots = getSlots<IStackItemProps, IStackItemSlots>(props, {\n root: 'div',\n });\n\n return <Slots.root {...nativeProps}>{children}</Slots.root>;\n};\n\nexport const StackItem: React.FunctionComponent<IStackItemProps> = createComponent(StackItemView, {\n displayName: 'StackItem',\n styles,\n});\n\nexport default StackItem;\n"]}
@@ -0,0 +1,5 @@
import type { IStackItemComponent } from './StackItem.types';
export declare const GlobalClassNames: {
root: string;
};
export declare const StackItemStyles: IStackItemComponent['styles'];
@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackItemStyles = exports.GlobalClassNames = void 0;
var Styling_1 = require("../../../Styling");
exports.GlobalClassNames = {
root: 'ms-StackItem',
};
var alignMap = {
start: 'flex-start',
end: 'flex-end',
};
var StackItemStyles = function (props, theme, tokens) {
var grow = props.grow, shrink = props.shrink, disableShrink = props.disableShrink, align = props.align, verticalFill = props.verticalFill, order = props.order, className = props.className, _a = props.basis, basis = _a === void 0 ? 'auto' : _a;
var classNames = (0, Styling_1.getGlobalClassNames)(exports.GlobalClassNames, theme);
return {
root: [
theme.fonts.medium,
classNames.root,
{
flexBasis: basis,
margin: tokens.margin,
padding: tokens.padding,
height: verticalFill ? '100%' : 'auto',
width: 'auto',
},
grow && {
flexGrow: grow === true ? 1 : grow,
},
(disableShrink || (!grow && !shrink)) && {
flexShrink: 0,
},
shrink &&
!disableShrink && {
flexShrink: 1,
},
align && {
alignSelf: alignMap[align] || align,
},
order && {
order: order,
},
className,
],
// TODO: this cast may be hiding some potential issues with styling and name
// lookups and should be removed
};
};
exports.StackItemStyles = StackItemStyles;
//# sourceMappingURL=StackItem.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"StackItem.styles.js","sourceRoot":"../src/","sources":["components/Stack/StackItem/StackItem.styles.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAG1C,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,cAAc;CACrB,CAAC;AAEF,IAAM,QAAQ,GAA8B;IAC1C,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,UAAU;CAChB,CAAC;AAEK,IAAM,eAAe,GAAkC,UAAC,KAAK,EAAE,KAAK,EAAE,MAAM;IACzE,IAAA,IAAI,GAAmF,KAAK,KAAxF,EAAE,MAAM,GAA2E,KAAK,OAAhF,EAAE,aAAa,GAA4D,KAAK,cAAjE,EAAE,KAAK,GAAqD,KAAK,MAA1D,EAAE,YAAY,GAAuC,KAAK,aAA5C,EAAE,KAAK,GAAgC,KAAK,MAArC,EAAE,SAAS,GAAqB,KAAK,UAA1B,EAAE,KAAmB,KAAK,MAAV,EAAd,KAAK,mBAAG,MAAM,KAAA,CAAW;IAErG,IAAM,UAAU,GAAG,IAAA,6BAAmB,EAAC,wBAAgB,EAAE,KAAK,CAAC,CAAC;IAEhE,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,CAAC,KAAK,CAAC,MAAM;YAClB,UAAU,CAAC,IAAI;YACf;gBACE,SAAS,EAAE,KAAK;gBAChB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;gBACtC,KAAK,EAAE,MAAM;aACd;YACD,IAAI,IAAI;gBACN,QAAQ,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;aACnC;YACD,CAAC,aAAa,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI;gBACvC,UAAU,EAAE,CAAC;aACd;YACD,MAAM;gBACJ,CAAC,aAAa,IAAI;gBAChB,UAAU,EAAE,CAAC;aACd;YACH,KAAK,IAAI;gBACP,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK;aACpC;YACD,KAAK,IAAI;gBACP,KAAK,OAAA;aACN;YACD,SAAS;SACV;QACD,4EAA4E;QAC5E,uCAAuC;KACpB,CAAC;AACxB,CAAC,CAAC;AArCW,QAAA,eAAe,mBAqC1B","sourcesContent":["import { getGlobalClassNames } from '../../../Styling';\nimport type { IStackItemComponent, IStackItemStyles, IStackItemStylesReturnType } from './StackItem.types';\n\nexport const GlobalClassNames = {\n root: 'ms-StackItem',\n};\n\nconst alignMap: { [key: string]: string } = {\n start: 'flex-start',\n end: 'flex-end',\n};\n\nexport const StackItemStyles: IStackItemComponent['styles'] = (props, theme, tokens): IStackItemStylesReturnType => {\n const { grow, shrink, disableShrink, align, verticalFill, order, className, basis = 'auto' } = props;\n\n const classNames = getGlobalClassNames(GlobalClassNames, theme);\n\n return {\n root: [\n theme.fonts.medium,\n classNames.root,\n {\n flexBasis: basis,\n margin: tokens.margin,\n padding: tokens.padding,\n height: verticalFill ? '100%' : 'auto',\n width: 'auto',\n },\n grow && {\n flexGrow: grow === true ? 1 : grow,\n },\n (disableShrink || (!grow && !shrink)) && {\n flexShrink: 0,\n },\n shrink &&\n !disableShrink && {\n flexShrink: 1,\n },\n align && {\n alignSelf: alignMap[align] || align,\n },\n order && {\n order,\n },\n className,\n ],\n // TODO: this cast may be hiding some potential issues with styling and name\n // lookups and should be removed\n } as IStackItemStyles;\n};\n"]}
@@ -0,0 +1,85 @@
import * as React from 'react';
import type { IComponentStyles, IHTMLSlot, IComponent, ISlotProp, IStyleableComponentProps } from '@fluentui/foundation-legacy';
/**
* {@docCategory Stack}
*/
export type IStackItemComponent = IComponent<IStackItemProps, IStackItemTokens, IStackItemStyles>;
/**
* {@docCategory Stack}
*/
export type IStackItemSlot = ISlotProp<IStackItemProps>;
/**
* {@docCategory Stack}
*/
export interface IStackItemSlots {
root?: IHTMLSlot;
}
/**
* {@docCategory Stack}
*/
export type IStackItemTokenReturnType = ReturnType<Extract<IStackItemComponent['tokens'], Function>>;
/**
* {@docCategory Stack}
*/
export type IStackItemStylesReturnType = ReturnType<Extract<IStackItemComponent['styles'], Function>>;
/**
* {@docCategory Stack}
*/
export interface IStackItemProps extends IStackItemSlots, IStyleableComponentProps<IStackItemProps, IStackItemTokens, IStackItemStyles>, React.HTMLAttributes<HTMLElement> {
children?: React.ReactNode;
/**
* Defines a CSS class name used to style the StackItem.
*/
className?: string;
/**
* Defines how much to grow the StackItem in proportion to its siblings.
*/
grow?: boolean | number | 'inherit' | 'initial' | 'unset';
/**
* Defines at what ratio should the StackItem shrink to fit the available space.
*/
shrink?: boolean | number | 'inherit' | 'initial' | 'unset';
/**
* Defines whether the StackItem should be prevented from shrinking.
* This can be used to prevent a StackItem from shrinking when it is inside of a Stack that has shrinking items.
* @defaultvalue false
*/
disableShrink?: boolean;
/**
* Defines how to align the StackItem along the x-axis (for vertical Stacks) or the y-axis (for horizontal Stacks).
*/
align?: 'auto' | 'stretch' | 'baseline' | 'start' | 'center' | 'end';
/**
* Defines whether the StackItem should take up 100% of the height of its parent.
* @defaultvalue true
*/
verticalFill?: boolean;
/**
* Defines the initial main size of the StackItem, setting the size of the content box unless otherwise set with
* box-sizing.
* @defaultvalue auto
*/
basis?: React.CSSProperties['flexBasis'];
/**
* Defines order of the StackItem.
* @defaultvalue 0
*/
order?: number | string;
}
/**
* {@docCategory Stack}
*/
export interface IStackItemTokens {
/**
* Defines the margin to be applied to the StackItem relative to its container.
*/
margin?: number | string;
/**
* Defines the padding to be applied to the StackItem contents relative to its border.
*/
padding?: number | string;
}
/**
* {@docCategory Stack}
*/
export type IStackItemStyles = IComponentStyles<IStackItemSlots>;
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=StackItem.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"StackItem.types.js","sourceRoot":"../src/","sources":["components/Stack/StackItem/StackItem.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type {\n IComponentStyles,\n IHTMLSlot,\n IComponent,\n ISlotProp,\n IStyleableComponentProps,\n} from '@fluentui/foundation-legacy';\n\n/**\n * {@docCategory Stack}\n */\nexport type IStackItemComponent = IComponent<IStackItemProps, IStackItemTokens, IStackItemStyles>;\n\n/**\n * {@docCategory Stack}\n */\nexport type IStackItemSlot = ISlotProp<IStackItemProps>;\n\n/**\n * {@docCategory Stack}\n */\nexport interface IStackItemSlots {\n root?: IHTMLSlot;\n}\n\n// The following two types are redundant with IStackItemComponent but are needed until TS function return widening\n// issue 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 Stack}\n */\nexport type IStackItemTokenReturnType = ReturnType<Extract<IStackItemComponent['tokens'], Function>>;\n\n/**\n * {@docCategory Stack}\n */\nexport type IStackItemStylesReturnType = ReturnType<Extract<IStackItemComponent['styles'], Function>>;\n\n/**\n * {@docCategory Stack}\n */\nexport interface IStackItemProps\n extends IStackItemSlots,\n IStyleableComponentProps<IStackItemProps, IStackItemTokens, IStackItemStyles>,\n React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n /**\n * Defines a CSS class name used to style the StackItem.\n */\n className?: string;\n\n /**\n * Defines how much to grow the StackItem in proportion to its siblings.\n */\n grow?: boolean | number | 'inherit' | 'initial' | 'unset';\n\n /**\n * Defines at what ratio should the StackItem shrink to fit the available space.\n */\n shrink?: boolean | number | 'inherit' | 'initial' | 'unset';\n\n /**\n * Defines whether the StackItem should be prevented from shrinking.\n * This can be used to prevent a StackItem from shrinking when it is inside of a Stack that has shrinking items.\n * @defaultvalue false\n */\n disableShrink?: boolean;\n\n /**\n * Defines how to align the StackItem along the x-axis (for vertical Stacks) or the y-axis (for horizontal Stacks).\n */\n align?: 'auto' | 'stretch' | 'baseline' | 'start' | 'center' | 'end';\n\n /**\n * Defines whether the StackItem should take up 100% of the height of its parent.\n * @defaultvalue true\n */\n verticalFill?: boolean;\n\n /**\n * Defines the initial main size of the StackItem, setting the size of the content box unless otherwise set with\n * box-sizing.\n * @defaultvalue auto\n */\n basis?: React.CSSProperties['flexBasis'];\n\n /**\n * Defines order of the StackItem.\n * @defaultvalue 0\n */\n order?: number | string;\n}\n\n/**\n * {@docCategory Stack}\n */\nexport interface IStackItemTokens {\n /**\n * Defines the margin to be applied to the StackItem relative to its container.\n */\n margin?: number | string;\n\n /**\n * Defines the padding to be applied to the StackItem contents relative to its border.\n */\n padding?: number | string;\n}\n\n/**\n * {@docCategory Stack}\n */\nexport type IStackItemStyles = IComponentStyles<IStackItemSlots>;\n"]}