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 { IChoiceGroupOptionProps } from './ChoiceGroupOption.types';
export declare const ChoiceGroupOptionBase: React.FunctionComponent<IChoiceGroupOptionProps>;
@@ -0,0 +1,68 @@
define(["require", "exports", "tslib", "react", "../../../Image", "../../../Icon", "../../../Utilities"], function (require, exports, tslib_1, React, Image_1, Icon_1, Utilities_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChoiceGroupOptionBase = void 0;
var getClassNames = (0, Utilities_1.classNamesFunction)();
var LARGE_IMAGE_SIZE = 71;
var DEFAULT_PROPS = {
// This ensures default imageSize value doesn't mutate. Mutation can cause style re-calcuation.
imageSize: { width: 32, height: 32 },
};
var ChoiceGroupOptionBase = function (propsWithoutDefaults) {
// Mix the `key` prop back in since custom render functions may be expecting it
// (React uses `key` internally rather than passing it through to the component)
var props = (0, Utilities_1.getPropsWithDefaults)(tslib_1.__assign(tslib_1.__assign({}, DEFAULT_PROPS), { key: propsWithoutDefaults.itemKey }), propsWithoutDefaults);
var ariaLabel = props.ariaLabel, focused = props.focused, required = props.required, theme = props.theme, iconProps = props.iconProps, imageSrc = props.imageSrc, imageSize = props.imageSize, disabled = props.disabled, checked = props.checked, id = props.id, styles = props.styles, name = props.name, rest = tslib_1.__rest(props, ["ariaLabel", "focused", "required", "theme", "iconProps", "imageSrc", "imageSize", "disabled", "checked", "id", "styles", "name"]);
var classNames = getClassNames(styles, {
theme: theme,
hasIcon: !!iconProps,
hasImage: !!imageSrc,
checked: checked,
disabled: disabled,
imageIsLarge: !!imageSrc && (imageSize.width > LARGE_IMAGE_SIZE || imageSize.height > LARGE_IMAGE_SIZE),
imageSize: imageSize,
focused: focused,
});
var _a = (0, Utilities_1.getNativeProps)(rest, Utilities_1.inputProperties), className = _a.className, nativeProps = tslib_1.__rest(_a, ["className"]);
var defaultOnRenderLabel = function () {
return (React.createElement("span", { id: props.labelId, className: "ms-ChoiceFieldLabel" }, props.text));
};
var defaultOnRenderField = function () {
var _a = props.imageAlt, imageAlt = _a === void 0 ? '' : _a, selectedImageSrc = props.selectedImageSrc;
var onRenderLabel = props.onRenderLabel
? (0, Utilities_1.composeRenderFunction)(props.onRenderLabel, defaultOnRenderLabel)
: defaultOnRenderLabel;
var label = onRenderLabel(tslib_1.__assign(tslib_1.__assign({}, props), { key: props.itemKey }));
return (React.createElement("label", { htmlFor: id, className: classNames.field },
imageSrc && (React.createElement("div", { className: classNames.innerField },
React.createElement("div", { className: classNames.imageWrapper },
React.createElement(Image_1.Image, tslib_1.__assign({ src: imageSrc, alt: imageAlt }, imageSize))),
React.createElement("div", { className: classNames.selectedImageWrapper },
React.createElement(Image_1.Image, tslib_1.__assign({ src: selectedImageSrc, alt: imageAlt }, imageSize))))),
iconProps && (React.createElement("div", { className: classNames.innerField },
React.createElement("div", { className: classNames.iconWrapper },
React.createElement(Icon_1.Icon, tslib_1.__assign({}, iconProps))))),
imageSrc || iconProps ? React.createElement("div", { className: classNames.labelWrapper }, label) : label));
};
var _b = props.onRenderField, onRenderField = _b === void 0 ? defaultOnRenderField : _b;
var onChange = function (evt) {
var _a;
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, evt, tslib_1.__assign(tslib_1.__assign({}, props), { key: props.itemKey }));
};
var onBlur = function (evt) {
var _a;
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, evt);
};
var onFocus = function (evt) {
var _a;
(_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, evt, tslib_1.__assign(tslib_1.__assign({}, props), { key: props.itemKey }));
};
return (React.createElement("div", { className: classNames.root },
React.createElement("div", { className: classNames.choiceFieldWrapper },
React.createElement("input", tslib_1.__assign({ "aria-label": ariaLabel, id: id, className: (0, Utilities_1.css)(classNames.input, className), type: "radio", name: name, disabled: disabled, checked: checked, required: required }, nativeProps, { onChange: onChange, onFocus: onFocus, onBlur: onBlur })),
onRenderField(tslib_1.__assign(tslib_1.__assign({}, props), { key: props.itemKey }), defaultOnRenderField))));
};
exports.ChoiceGroupOptionBase = ChoiceGroupOptionBase;
exports.ChoiceGroupOptionBase.displayName = 'ChoiceGroupOption';
});
//# sourceMappingURL=ChoiceGroupOption.base.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { IChoiceGroupOptionProps } from './ChoiceGroupOption.types';
export declare const ChoiceGroupOption: React.FunctionComponent<IChoiceGroupOptionProps>;
@@ -0,0 +1,7 @@
define(["require", "exports", "../../../Utilities", "./ChoiceGroupOption.base", "./ChoiceGroupOption.styles"], function (require, exports, Utilities_1, ChoiceGroupOption_base_1, ChoiceGroupOption_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChoiceGroupOption = void 0;
exports.ChoiceGroupOption = (0, Utilities_1.styled)(ChoiceGroupOption_base_1.ChoiceGroupOptionBase, ChoiceGroupOption_styles_1.getStyles, undefined, { scope: 'ChoiceGroupOption' });
});
//# sourceMappingURL=ChoiceGroupOption.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ChoiceGroupOption.js","sourceRoot":"../src/","sources":["components/ChoiceGroup/ChoiceGroupOption/ChoiceGroupOption.tsx"],"names":[],"mappings":";;;;IAUa,QAAA,iBAAiB,GAAqD,IAAA,kBAAM,EAIvF,8CAAqB,EAAE,oCAAS,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../../Utilities';\nimport { ChoiceGroupOptionBase } from './ChoiceGroupOption.base';\nimport { getStyles } from './ChoiceGroupOption.styles';\nimport type {\n IChoiceGroupOptionProps,\n IChoiceGroupOptionStyleProps,\n IChoiceGroupOptionStyles,\n} from './ChoiceGroupOption.types';\n\nexport const ChoiceGroupOption: React.FunctionComponent<IChoiceGroupOptionProps> = styled<\n IChoiceGroupOptionProps,\n IChoiceGroupOptionStyleProps,\n IChoiceGroupOptionStyles\n>(ChoiceGroupOptionBase, getStyles, undefined, { scope: 'ChoiceGroupOption' });\n"]}
@@ -0,0 +1,2 @@
import type { IChoiceGroupOptionStyleProps, IChoiceGroupOptionStyles } from './ChoiceGroupOption.types';
export declare const getStyles: (props: IChoiceGroupOptionStyleProps) => IChoiceGroupOptionStyles;
@@ -0,0 +1,408 @@
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 = void 0;
var GlobalClassNames = {
root: 'ms-ChoiceField',
choiceFieldWrapper: 'ms-ChoiceField-wrapper',
input: 'ms-ChoiceField-input',
field: 'ms-ChoiceField-field',
innerField: 'ms-ChoiceField-innerField',
imageWrapper: 'ms-ChoiceField-imageWrapper',
iconWrapper: 'ms-ChoiceField-iconWrapper',
labelWrapper: 'ms-ChoiceField-labelWrapper',
checked: 'is-checked',
};
var labelWrapperLineHeight = 15;
var labelWrapperHeight = labelWrapperLineHeight * 2 + 2; // adding 2px height to ensure text doesn't get cutoff
var iconSize = 32;
var choiceFieldSize = 20;
var choiceFieldTransitionDuration = '200ms';
var choiceFieldTransitionTiming = 'cubic-bezier(.4, 0, .23, 1)';
var radioButtonSpacing = 3;
var radioButtonInnerSize = 5;
function getChoiceGroupFocusStyle(focusBorderColor, hasIconOrImage) {
var _a, _b;
return [
'is-inFocus',
{
selectors: (_a = {},
_a[".".concat(Utilities_1.IsFocusVisibleClassName, " &, :host(.").concat(Utilities_1.IsFocusVisibleClassName, ") &")] = {
position: 'relative',
outline: 'transparent',
selectors: {
'::-moz-focus-inner': {
border: 0,
},
':after': {
content: '""',
top: -2,
right: -2,
bottom: -2,
left: -2,
pointerEvents: 'none',
border: "1px solid ".concat(focusBorderColor),
position: 'absolute',
selectors: (_b = {},
_b[Styling_1.HighContrastSelector] = {
borderColor: 'WindowText',
borderWidth: hasIconOrImage ? 1 : 2,
},
_b),
},
},
},
_a),
},
];
}
function getImageWrapperStyle(isSelectedImageWrapper, className, checked) {
return [
className,
{
paddingBottom: 2,
transitionProperty: 'opacity',
transitionDuration: choiceFieldTransitionDuration,
transitionTimingFunction: 'ease',
selectors: {
'.ms-Image': {
display: 'inline-block',
borderStyle: 'none',
},
},
},
(checked ? !isSelectedImageWrapper : isSelectedImageWrapper) && [
'is-hidden',
{
position: 'absolute',
left: 0,
top: 0,
width: '100%',
height: '100%',
overflow: 'hidden',
opacity: 0,
},
],
];
}
var getStyles = function (props) {
var _a, _b, _c, _d, _e;
var theme = props.theme, hasIcon = props.hasIcon, hasImage = props.hasImage, checked = props.checked, disabled = props.disabled, imageIsLarge = props.imageIsLarge, focused = props.focused, imageSize = props.imageSize;
var palette = theme.palette, semanticColors = theme.semanticColors, fonts = theme.fonts;
var classNames = (0, Styling_1.getGlobalClassNames)(GlobalClassNames, theme);
// Tokens
// TODO: after updating the semanticColors slots mapping this needs to be semanticColors.smallInputBorder
var circleBorderColor = palette.neutralPrimary;
var circleHoveredBorderColor = semanticColors.inputBorderHovered;
var circleCheckedBorderColor = semanticColors.inputBackgroundChecked;
// TODO: after updating the semanticColors slots mapping this needs to be semanticColors.inputBackgroundCheckedHovered
var circleCheckedHoveredBorderColor = palette.themeDark;
var circleDisabledBorderColor = semanticColors.disabledBodySubtext;
var circleBackgroundColor = semanticColors.bodyBackground;
var dotUncheckedHoveredColor = palette.neutralSecondary;
var dotCheckedColor = semanticColors.inputBackgroundChecked;
// TODO: after updating the semanticColors slots mapping this needs to be semanticColors.inputBackgroundCheckedHovered
var dotCheckedHoveredColor = palette.themeDark;
var dotDisabledColor = semanticColors.disabledBodySubtext;
// TODO: after updating the semanticColors slots mapping this needs to be semanticColors.bodyTextChecked
var labelHoverFocusColor = palette.neutralDark;
var focusBorderColor = semanticColors.focusBorder;
var iconOrImageChoiceBorderUncheckedHoveredColor = semanticColors.inputBorderHovered;
// TODO: after updating the semanticColors slots mapping this needs to be semanticColors.inputBackgroundCheckedHovered
var iconOrImageChoiceBorderCheckedColor = semanticColors.inputBackgroundChecked;
var iconOrImageChoiceBorderCheckedHoveredColor = palette.themeDark;
var iconOrImageChoiceBackgroundColor = palette.neutralLighter;
var fieldHoverOrFocusProperties = {
selectors: {
'.ms-ChoiceFieldLabel': {
color: labelHoverFocusColor,
},
':before': {
borderColor: checked ? circleCheckedHoveredBorderColor : circleHoveredBorderColor,
},
':after': [
!hasIcon &&
!hasImage &&
!checked && {
content: '""',
transitionProperty: 'background-color',
left: 5,
top: 5,
width: 10,
height: 10,
backgroundColor: dotUncheckedHoveredColor,
},
checked && {
borderColor: dotCheckedHoveredColor,
background: dotCheckedHoveredColor,
},
],
},
};
var enabledFieldWithImageHoverOrFocusProperties = {
borderColor: checked ? iconOrImageChoiceBorderCheckedHoveredColor : iconOrImageChoiceBorderUncheckedHoveredColor,
selectors: {
':before': {
opacity: 1,
borderColor: checked ? circleCheckedHoveredBorderColor : circleHoveredBorderColor,
},
},
};
var circleAreaProperties = [
{
content: '""',
display: 'inline-block',
backgroundColor: circleBackgroundColor,
borderWidth: 1,
borderStyle: 'solid',
borderColor: circleBorderColor,
width: choiceFieldSize,
height: choiceFieldSize,
fontWeight: 'normal',
position: 'absolute',
top: 0,
left: 0,
boxSizing: 'border-box',
transitionProperty: 'border-color',
transitionDuration: choiceFieldTransitionDuration,
transitionTimingFunction: choiceFieldTransitionTiming,
borderRadius: '50%',
},
disabled && {
borderColor: circleDisabledBorderColor,
selectors: (_a = {},
_a[Styling_1.HighContrastSelector] = tslib_1.__assign({ borderColor: 'GrayText', background: 'Window' }, (0, Styling_1.getHighContrastNoAdjustStyle)()),
_a),
},
checked && {
borderColor: disabled ? circleDisabledBorderColor : circleCheckedBorderColor,
selectors: (_b = {},
_b[Styling_1.HighContrastSelector] = {
borderColor: 'Highlight',
background: 'Window',
forcedColorAdjust: 'none',
},
_b),
},
(hasIcon || hasImage) && {
top: radioButtonSpacing,
right: radioButtonSpacing,
left: 'auto', // To reset the value of 'left' to its default value, so that 'right' works
opacity: checked ? 1 : 0,
},
];
var dotAreaProperties = [
{
content: '""',
width: 0,
height: 0,
borderRadius: '50%',
position: 'absolute',
left: choiceFieldSize / 2,
right: 0,
transitionProperty: 'border-width',
transitionDuration: choiceFieldTransitionDuration,
transitionTimingFunction: choiceFieldTransitionTiming,
boxSizing: 'border-box',
},
checked && {
borderWidth: 5,
borderStyle: 'solid',
borderColor: disabled ? dotDisabledColor : dotCheckedColor,
background: dotCheckedColor,
left: 5,
top: 5,
width: 10,
height: 10,
selectors: (_c = {},
_c[Styling_1.HighContrastSelector] = {
borderColor: 'Highlight',
forcedColorAdjust: 'none',
},
_c),
},
checked &&
(hasIcon || hasImage) && {
top: radioButtonSpacing + radioButtonInnerSize,
right: radioButtonSpacing + radioButtonInnerSize,
left: 'auto', // To reset the value of 'left' to its default value, so that 'right' works
},
];
return {
root: [
classNames.root,
theme.fonts.medium,
{
display: 'flex',
alignItems: 'center',
boxSizing: 'border-box',
color: semanticColors.bodyText,
minHeight: 26,
border: 'none',
position: 'relative',
marginTop: 8,
selectors: {
'.ms-ChoiceFieldLabel': {
display: 'inline-block',
},
},
},
!hasIcon &&
!hasImage && {
selectors: {
'.ms-ChoiceFieldLabel': {
paddingLeft: '26px',
},
},
},
hasImage && 'ms-ChoiceField--image',
hasIcon && 'ms-ChoiceField--icon',
(hasIcon || hasImage) && {
display: 'inline-flex',
fontSize: 0,
margin: '0 4px 4px 0',
paddingLeft: 0,
backgroundColor: iconOrImageChoiceBackgroundColor,
height: '100%',
},
],
choiceFieldWrapper: [
classNames.choiceFieldWrapper,
focused && getChoiceGroupFocusStyle(focusBorderColor, hasIcon || hasImage),
],
// The hidden input
input: [
classNames.input,
{
position: 'absolute',
opacity: 0,
top: 0,
right: 0,
width: '100%',
height: '100%',
margin: 0,
},
disabled && 'is-disabled',
],
field: [
classNames.field,
checked && classNames.checked,
{
display: 'inline-block',
cursor: 'pointer',
marginTop: 0,
position: 'relative',
verticalAlign: 'top',
userSelect: 'none',
minHeight: 20,
selectors: {
':hover': !disabled && fieldHoverOrFocusProperties,
':focus': !disabled && fieldHoverOrFocusProperties,
// The circle
':before': circleAreaProperties,
// The dot
':after': dotAreaProperties,
},
},
hasIcon && 'ms-ChoiceField--icon',
hasImage && 'ms-ChoiceField-field--image',
(hasIcon || hasImage) && {
boxSizing: 'content-box',
cursor: 'pointer',
paddingTop: 22,
margin: 0,
textAlign: 'center',
transitionProperty: 'all',
transitionDuration: choiceFieldTransitionDuration,
transitionTimingFunction: 'ease',
border: '1px solid transparent',
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
},
checked && {
borderColor: iconOrImageChoiceBorderCheckedColor,
},
(hasIcon || hasImage) &&
!disabled && {
selectors: {
':hover': enabledFieldWithImageHoverOrFocusProperties,
':focus': enabledFieldWithImageHoverOrFocusProperties,
},
},
disabled && {
cursor: 'default',
selectors: {
'.ms-ChoiceFieldLabel': {
color: semanticColors.disabledBodyText,
selectors: (_d = {},
_d[Styling_1.HighContrastSelector] = tslib_1.__assign({ color: 'GrayText' }, (0, Styling_1.getHighContrastNoAdjustStyle)()),
_d),
},
},
},
checked &&
disabled && {
borderColor: iconOrImageChoiceBackgroundColor,
},
],
innerField: [
classNames.innerField,
hasImage && {
// using non-null assertion because we have a default in `ChoiceGroupOptionBase` class.
height: imageSize.height,
width: imageSize.width,
},
(hasIcon || hasImage) && {
position: 'relative',
display: 'inline-block',
paddingLeft: 30,
paddingRight: 30,
},
(hasIcon || hasImage) &&
imageIsLarge && {
paddingLeft: 24,
paddingRight: 24,
},
(hasIcon || hasImage) &&
disabled && {
opacity: 0.25,
selectors: (_e = {},
_e[Styling_1.HighContrastSelector] = {
color: 'GrayText',
opacity: 1,
},
_e),
},
],
imageWrapper: getImageWrapperStyle(false, classNames.imageWrapper, checked),
selectedImageWrapper: getImageWrapperStyle(true, classNames.imageWrapper, checked),
iconWrapper: [
classNames.iconWrapper,
{
fontSize: iconSize,
lineHeight: iconSize,
height: iconSize,
},
],
labelWrapper: [
classNames.labelWrapper,
fonts.medium,
(hasIcon || hasImage) && {
display: 'block',
position: 'relative',
margin: '4px 8px 2px 8px',
height: labelWrapperHeight,
lineHeight: labelWrapperLineHeight,
// using non-null assertion because we have a default in `ChoiceGroupOptionBase` class.
maxWidth: imageSize.width * 2,
overflow: 'hidden',
whiteSpace: 'pre-wrap',
},
],
};
};
exports.getStyles = getStyles;
});
//# sourceMappingURL=ChoiceGroupOption.styles.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,97 @@
import * as React from 'react';
import type { ITheme, IStyle } from '../../../Styling';
import type { IRefObject } from '../../../Utilities';
import type { IChoiceGroupOption } from '../ChoiceGroup.types';
/**
* {@docCategory ChoiceGroup}
*/
export interface IChoiceGroupOptionProps extends Omit<IChoiceGroupOption, 'key'> {
/**
* @deprecated Not used.
*/
componentRef?: IRefObject<IChoiceGroupOption>;
/**
* Unique key for the option, set based on `IChoiceGroupOption.key`.
*/
itemKey: string;
/**
* The option key. This will always be provided for callbacks (copied from `itemKey`) but is
* optional when manually creating ChoiceGroupOptions.
*/
key?: string;
/**
* Whether or not the option is checked. Set by `ChoiceGroup` based on `selectedKey` or
* `defaultSelectedKey` from `IChoiceGroupProps`.
*/
checked?: boolean;
/**
* Callback for the ChoiceGroup creating the option to be notified when the choice has been changed.
*/
onChange?: (evt?: React.FormEvent<HTMLElement | HTMLInputElement>, props?: IChoiceGroupOption & IChoiceGroupOptionProps) => void;
/**
* Callback for the ChoiceGroup creating the option to be notified when the choice has received focus.
*/
onFocus?: (ev?: React.FocusEvent<HTMLElement | HTMLInputElement>, props?: IChoiceGroupOption & IChoiceGroupOptionProps) => void | undefined;
/**
* Callback for the ChoiceGroup creating the option to be notified when the choice has lost focus.
*/
onBlur?: (ev?: React.FocusEvent<HTMLElement>, props?: IChoiceGroupOption & IChoiceGroupOptionProps) => void;
/**
* Indicates if the ChoiceGroupOption should appear focused, visually
*/
focused?: boolean;
/**
* Theme (provided through customization).
*/
theme?: ITheme;
/**
* If true, an option must be selected in the ChoiceGroup.
*/
required?: boolean;
/**
* This value is used to group each ChoiceGroupOption into the same logical ChoiceGroup
*/
name?: string;
}
/**
* Defines props needed to construct styles.
* {@docCategory ChoiceGroup}
*/
export interface IChoiceGroupOptionStyleProps {
/** Theme provided by High-Order Component. */
theme: ITheme;
/** Whether the option has an icon. */
hasIcon?: boolean;
/** Whether the option icon is an image. */
hasImage?: boolean;
/** Whether the option is checked or not. */
checked?: boolean;
/** Whether the option is disabled or not. */
disabled?: boolean;
/** Whether the image width or height are higher than `71`. */
imageIsLarge?: boolean;
/**
* Image sizes used when `hasImage` or `hasIcon` style props are enabled.
* @defaultvalue `{ height: 32, width: 32 }`
*/
imageSize?: {
height: number;
width: number;
};
/** Whether the option is in focus or not. */
focused?: boolean;
}
/**
* {@docCategory ChoiceGroup}
*/
export interface IChoiceGroupOptionStyles {
root?: IStyle;
choiceFieldWrapper?: IStyle;
input?: IStyle;
field?: IStyle;
innerField?: IStyle;
imageWrapper?: IStyle;
selectedImageWrapper?: IStyle;
iconWrapper?: IStyle;
labelWrapper?: IStyle;
}
@@ -0,0 +1,5 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=ChoiceGroupOption.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ChoiceGroupOption.types.js","sourceRoot":"../src/","sources":["components/ChoiceGroup/ChoiceGroupOption/ChoiceGroupOption.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ITheme, IStyle } from '../../../Styling';\nimport type { IRefObject } from '../../../Utilities';\nimport type { IChoiceGroupOption } from '../ChoiceGroup.types';\n\n/**\n * {@docCategory ChoiceGroup}\n */\nexport interface IChoiceGroupOptionProps extends Omit<IChoiceGroupOption, 'key'> {\n /**\n * @deprecated Not used.\n */\n componentRef?: IRefObject<IChoiceGroupOption>;\n\n /**\n * Unique key for the option, set based on `IChoiceGroupOption.key`.\n */\n itemKey: string;\n\n /**\n * The option key. This will always be provided for callbacks (copied from `itemKey`) but is\n * optional when manually creating ChoiceGroupOptions.\n */\n key?: string;\n\n /**\n * Whether or not the option is checked. Set by `ChoiceGroup` based on `selectedKey` or\n * `defaultSelectedKey` from `IChoiceGroupProps`.\n */\n checked?: boolean;\n\n /**\n * Callback for the ChoiceGroup creating the option to be notified when the choice has been changed.\n */\n onChange?: (\n evt?: React.FormEvent<HTMLElement | HTMLInputElement>,\n props?: IChoiceGroupOption & IChoiceGroupOptionProps,\n ) => void;\n\n /**\n * Callback for the ChoiceGroup creating the option to be notified when the choice has received focus.\n */\n onFocus?: (\n ev?: React.FocusEvent<HTMLElement | HTMLInputElement>,\n props?: IChoiceGroupOption & IChoiceGroupOptionProps,\n ) => void | undefined;\n\n /**\n * Callback for the ChoiceGroup creating the option to be notified when the choice has lost focus.\n */\n onBlur?: (ev?: React.FocusEvent<HTMLElement>, props?: IChoiceGroupOption & IChoiceGroupOptionProps) => void;\n\n /**\n * Indicates if the ChoiceGroupOption should appear focused, visually\n */\n focused?: boolean;\n\n /**\n * Theme (provided through customization).\n */\n theme?: ITheme;\n\n /**\n * If true, an option must be selected in the ChoiceGroup.\n */\n required?: boolean;\n\n /**\n * This value is used to group each ChoiceGroupOption into the same logical ChoiceGroup\n */\n name?: string;\n}\n\n/**\n * Defines props needed to construct styles.\n * {@docCategory ChoiceGroup}\n */\nexport interface IChoiceGroupOptionStyleProps {\n /** Theme provided by High-Order Component. */\n theme: ITheme;\n\n /** Whether the option has an icon. */\n hasIcon?: boolean;\n\n /** Whether the option icon is an image. */\n hasImage?: boolean;\n\n /** Whether the option is checked or not. */\n checked?: boolean;\n\n /** Whether the option is disabled or not. */\n disabled?: boolean;\n\n /** Whether the image width or height are higher than `71`. */\n imageIsLarge?: boolean;\n\n /**\n * Image sizes used when `hasImage` or `hasIcon` style props are enabled.\n * @defaultvalue `{ height: 32, width: 32 }`\n */\n imageSize?: { height: number; width: number };\n\n /** Whether the option is in focus or not. */\n focused?: boolean;\n}\n\n/**\n * {@docCategory ChoiceGroup}\n */\nexport interface IChoiceGroupOptionStyles {\n root?: IStyle;\n choiceFieldWrapper?: IStyle;\n input?: IStyle;\n field?: IStyle;\n innerField?: IStyle;\n imageWrapper?: IStyle;\n selectedImageWrapper?: IStyle;\n iconWrapper?: IStyle;\n labelWrapper?: IStyle;\n}\n"]}
@@ -0,0 +1,2 @@
export * from './ChoiceGroupOption';
export * from './ChoiceGroupOption.types';
@@ -0,0 +1,7 @@
define(["require", "exports", "tslib", "./ChoiceGroupOption", "./ChoiceGroupOption.types"], function (require, exports, tslib_1, ChoiceGroupOption_1, ChoiceGroupOption_types_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
tslib_1.__exportStar(ChoiceGroupOption_1, exports);
tslib_1.__exportStar(ChoiceGroupOption_types_1, exports);
});
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/ChoiceGroup/ChoiceGroupOption/index.ts"],"names":[],"mappings":";;;IAAA,mDAAoC;IACpC,yDAA0C","sourcesContent":["export * from './ChoiceGroupOption';\nexport * from './ChoiceGroupOption.types';\n"]}