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,3 @@
import * as React from 'react';
import type { ICheckProps } from './Check.types';
export declare const CheckBase: React.FunctionComponent<ICheckProps>;
+16
View File
@@ -0,0 +1,16 @@
define(["require", "exports", "react", "../../Icon", "../../Utilities"], function (require, exports, React, Icon_1, Utilities_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckBase = void 0;
var getClassNames = (0, Utilities_1.classNamesFunction)();
exports.CheckBase = React.forwardRef(function (props, ref) {
var _a = props.checked, checked = _a === void 0 ? false : _a, className = props.className, theme = props.theme, styles = props.styles, _b = props.useFastIcons, useFastIcons = _b === void 0 ? true : _b;
var classNames = getClassNames(styles, { theme: theme, className: className, checked: checked });
var IconComponent = useFastIcons ? Icon_1.FontIcon : Icon_1.Icon;
return (React.createElement("div", { className: classNames.root, ref: ref },
React.createElement(IconComponent, { iconName: "CircleRing", className: classNames.circle }),
React.createElement(IconComponent, { iconName: "StatusCircleCheckmark", className: classNames.check })));
});
exports.CheckBase.displayName = 'CheckBase';
});
//# sourceMappingURL=Check.base.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Check.base.js","sourceRoot":"../src/","sources":["components/Check/Check.base.tsx"],"names":[],"mappings":";;;;IAKA,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAkC,CAAC;IAE9D,QAAA,SAAS,GAAyC,KAAK,CAAC,UAAU,CAC7E,UAAC,KAAK,EAAE,GAAG;QACD,IAAA,KAAmE,KAAK,QAAzD,EAAf,OAAO,mBAAG,KAAK,KAAA,EAAE,SAAS,GAAyC,KAAK,UAA9C,EAAE,KAAK,GAAkC,KAAK,MAAvC,EAAE,MAAM,GAA0B,KAAK,OAA/B,EAAE,KAAwB,KAAK,aAAV,EAAnB,YAAY,mBAAG,IAAI,KAAA,CAAW;QAEjF,IAAM,UAAU,GAAG,aAAa,CAAC,MAAO,EAAE,EAAE,KAAK,EAAE,KAAM,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;QACjF,IAAM,aAAa,GAAG,YAAY,CAAC,CAAC,CAAC,eAAQ,CAAC,CAAC,CAAC,WAAI,CAAC;QAErD,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG;YACvC,oBAAC,aAAa,IAAC,QAAQ,EAAC,YAAY,EAAC,SAAS,EAAE,UAAU,CAAC,MAAM,GAAI;YACrE,oBAAC,aAAa,IAAC,QAAQ,EAAC,uBAAuB,EAAC,SAAS,EAAE,UAAU,CAAC,KAAK,GAAI,CAC3E,CACP,CAAC;IACJ,CAAC,CACF,CAAC;IACF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC","sourcesContent":["import * as React from 'react';\nimport { Icon, FontIcon } from '../../Icon';\nimport { classNamesFunction } from '../../Utilities';\nimport type { ICheckProps, ICheckStyleProps, ICheckStyles } from './Check.types';\n\nconst getClassNames = classNamesFunction<ICheckStyleProps, ICheckStyles>();\n\nexport const CheckBase: React.FunctionComponent<ICheckProps> = React.forwardRef<HTMLDivElement, ICheckProps>(\n (props, ref) => {\n const { checked = false, className, theme, styles, useFastIcons = true } = props;\n\n const classNames = getClassNames(styles!, { theme: theme!, className, checked });\n const IconComponent = useFastIcons ? FontIcon : Icon;\n\n return (\n <div className={classNames.root} ref={ref}>\n <IconComponent iconName=\"CircleRing\" className={classNames.circle} />\n <IconComponent iconName=\"StatusCircleCheckmark\" className={classNames.check} />\n </div>\n );\n },\n);\nCheckBase.displayName = 'CheckBase';\n"]}
+3
View File
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { ICheckProps } from './Check.types';
export declare const Check: React.FunctionComponent<ICheckProps>;
+9
View File
@@ -0,0 +1,9 @@
define(["require", "exports", "../../Utilities", "./Check.base", "./Check.styles"], function (require, exports, Utilities_1, Check_base_1, Check_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Check = void 0;
exports.Check = (0, Utilities_1.styled)(Check_base_1.CheckBase, Check_styles_1.getStyles, undefined, {
scope: 'Check',
}, true);
});
//# sourceMappingURL=Check.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"Check.js","sourceRoot":"../src/","sources":["components/Check/Check.tsx"],"names":[],"mappings":";;;;IAMa,QAAA,KAAK,GAAyC,IAAA,kBAAM,EAC/D,sBAAS,EACT,wBAAS,EACT,SAAS,EACT;QACE,KAAK,EAAE,OAAO;KACf,EACD,IAAI,CACL,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { CheckBase } from './Check.base';\nimport { getStyles } from './Check.styles';\nimport type { ICheckProps, ICheckStyleProps, ICheckStyles } from './Check.types';\n\nexport const Check: React.FunctionComponent<ICheckProps> = styled<ICheckProps, ICheckStyleProps, ICheckStyles>(\n CheckBase,\n getStyles,\n undefined,\n {\n scope: 'Check',\n },\n true,\n);\n"]}
@@ -0,0 +1,9 @@
import type { ICheckStyleProps, ICheckStyles } from './Check.types';
export declare const CheckGlobalClassNames: {
root: string;
circle: string;
check: string;
/** Must be manually applied to the parent element of the check. */
checkHost: string;
};
export declare const getStyles: (props: ICheckStyleProps) => ICheckStyles;
+130
View File
@@ -0,0 +1,130 @@
define(["require", "exports", "tslib", "../../Styling", "../../Utilities"], function (require, exports, tslib_1, Styling_1, Utilities_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyles = exports.CheckGlobalClassNames = void 0;
exports.CheckGlobalClassNames = {
root: 'ms-Check',
circle: 'ms-Check-circle',
check: 'ms-Check-check',
/** Must be manually applied to the parent element of the check. */
checkHost: 'ms-Check-checkHost',
};
var getStyles = function (props) {
var _a, _b, _c, _d, _e;
// eslint-disable-next-line @typescript-eslint/no-deprecated
var _f = props.height, height = _f === void 0 ? props.checkBoxHeight || '18px' : _f, checked = props.checked, className = props.className, theme = props.theme;
var palette = theme.palette, semanticColors = theme.semanticColors, fonts = theme.fonts;
var isRTL = (0, Utilities_1.getRTL)(theme);
var classNames = (0, Styling_1.getGlobalClassNames)(exports.CheckGlobalClassNames, theme);
var sharedCircleCheck = {
fontSize: height,
position: 'absolute',
left: 0,
top: 0,
width: height,
height: height,
textAlign: 'center',
// inline-flex prevents the check from shifting with custom line height styles
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
verticalAlign: 'middle',
};
return {
root: [
classNames.root,
fonts.medium,
{
// lineHeight currently needs to be a string to output without 'px'
lineHeight: '1',
width: height,
height: height,
verticalAlign: 'top',
position: 'relative',
userSelect: 'none',
selectors: (_a = {
':before': {
content: '""',
position: 'absolute',
top: '1px',
right: '1px',
bottom: '1px',
left: '1px',
borderRadius: '50%',
opacity: 1,
background: semanticColors.bodyBackground,
}
},
_a[".".concat(classNames.checkHost, ":hover &, .").concat(classNames.checkHost, ":focus &, &:hover, &:focus")] = {
opacity: 1,
},
_a),
},
checked && [
'is-checked',
{
selectors: {
':before': {
background: palette.themePrimary,
opacity: 1,
selectors: (_b = {},
_b[Styling_1.HighContrastSelector] = {
background: 'Window',
},
_b),
},
},
},
],
className,
],
circle: [
classNames.circle,
sharedCircleCheck,
{
color: palette.neutralSecondary,
selectors: (_c = {},
_c[Styling_1.HighContrastSelector] = {
color: 'WindowText',
},
_c),
},
checked && {
color: palette.white,
},
],
check: [
classNames.check,
sharedCircleCheck,
{
opacity: 0,
color: palette.neutralSecondary,
fontSize: Styling_1.IconFontSizes.medium,
left: isRTL ? '-0.5px' : '.5px', // for centering the check icon inside the circle.
top: '-1px', // the check is slightly lower than center compared to the circle.
selectors: (_d = {
':hover': {
opacity: 1,
}
},
_d[Styling_1.HighContrastSelector] = tslib_1.__assign({}, (0, Styling_1.getHighContrastNoAdjustStyle)()),
_d),
},
checked && {
opacity: 1,
color: palette.white,
fontWeight: 900,
selectors: (_e = {},
_e[Styling_1.HighContrastSelector] = {
border: 'none',
color: 'WindowText',
},
_e),
},
],
checkHost: classNames.checkHost,
};
};
exports.getStyles = getStyles;
});
//# sourceMappingURL=Check.styles.js.map
File diff suppressed because one or more lines are too long
+78
View File
@@ -0,0 +1,78 @@
import * as React from 'react';
import type { IStyle, ITheme } from '../../Styling';
import type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';
/**
* {@docCategory Check}
*/
export interface ICheckProps extends React.RefAttributes<HTMLDivElement> {
/**
* Gets the component ref.
*/
componentRef?: IRefObject<ICheckProps>;
/**
* Whether the component is currently checked.
* @defaultvalue false
*/
checked?: boolean;
/**
* Call to provide customized styling that will layer on top of the variant rules
*/
styles?: IStyleFunctionOrObject<ICheckStyleProps, ICheckStyles>;
/**
* @deprecated Not used
*/
alwaysShowCheck?: boolean;
/**
* Theme provided by HOC.
*/
theme?: ITheme;
/**
* Additional css class to apply to the Check
*/
className?: string;
/**
* Whether to use fast icon components. The icons can't be targeted by customization but are
* still customizable via class names.
* @defaultvalue true
*/
useFastIcons?: boolean;
}
/**
* {@docCategory Check}
*/
export type ICheckStyleProps = Required<Pick<ICheckProps, 'theme'>> & Pick<ICheckProps, 'className' | 'checked'> & {
/**
* Custom height/width for the checkbox.
* @defaultvalue '18px'
*/
height?: string;
/**
* Custom height/width for the checkbox.
* @defaultvalue '18px'
* @deprecated Use `height`
*/
checkBoxHeight?: string;
};
/**
* {@docCategory Check}
*/
export interface ICheckStyles {
/**
* Style for the root element.
*/
root: IStyle;
/**
* The 'check' icon styles.
*/
check: IStyle;
/**
* The 'circle' icon styles.
*/
circle: IStyle;
/**
* Check host style
* @deprecated Not used directly within the component. Instead, use `CheckGlobalClassNames.checkHost` from
* `Check.styles.ts` to get the static class name to apply to the parent element of the Check.
*/
checkHost: IStyle;
}
+5
View File
@@ -0,0 +1,5 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=Check.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Check.types.js","sourceRoot":"../src/","sources":["components/Check/Check.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { IStyle, ITheme } from '../../Styling';\nimport type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * {@docCategory Check}\n */\nexport interface ICheckProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * Gets the component ref.\n */\n componentRef?: IRefObject<ICheckProps>;\n\n /**\n * Whether the component is currently checked.\n * @defaultvalue false\n */\n checked?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: IStyleFunctionOrObject<ICheckStyleProps, ICheckStyles>;\n\n /**\n * @deprecated Not used\n */\n alwaysShowCheck?: boolean;\n\n /**\n * Theme provided by HOC.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the Check\n */\n className?: string;\n\n /**\n * Whether to use fast icon components. The icons can't be targeted by customization but are\n * still customizable via class names.\n * @defaultvalue true\n */\n useFastIcons?: boolean;\n}\n\n/**\n * {@docCategory Check}\n */\nexport type ICheckStyleProps = Required<Pick<ICheckProps, 'theme'>> &\n Pick<ICheckProps, 'className' | 'checked'> & {\n /**\n * Custom height/width for the checkbox.\n * @defaultvalue '18px'\n */\n height?: string;\n\n /**\n * Custom height/width for the checkbox.\n * @defaultvalue '18px'\n * @deprecated Use `height`\n */\n checkBoxHeight?: string;\n };\n\n/**\n * {@docCategory Check}\n */\nexport interface ICheckStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n\n /**\n * The 'check' icon styles.\n */\n check: IStyle;\n\n /**\n * The 'circle' icon styles.\n */\n circle: IStyle;\n\n /**\n * Check host style\n * @deprecated Not used directly within the component. Instead, use `CheckGlobalClassNames.checkHost` from\n * `Check.styles.ts` to get the static class name to apply to the parent element of the Check.\n */\n checkHost: IStyle;\n}\n"]}
+3
View File
@@ -0,0 +1,3 @@
export * from './Check';
export * from './Check.base';
export * from './Check.types';
+8
View File
@@ -0,0 +1,8 @@
define(["require", "exports", "tslib", "./Check", "./Check.base", "./Check.types"], function (require, exports, tslib_1, Check_1, Check_base_1, Check_types_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
tslib_1.__exportStar(Check_1, exports);
tslib_1.__exportStar(Check_base_1, exports);
tslib_1.__exportStar(Check_types_1, exports);
});
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Check/index.ts"],"names":[],"mappings":";;;IAAA,uCAAwB;IACxB,4CAA6B;IAC7B,6CAA8B","sourcesContent":["export * from './Check';\nexport * from './Check.base';\nexport * from './Check.types';\n"]}