Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "MenuItemSwitch", {
enumerable: true,
get: function() {
return MenuItemSwitch;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _useMenuItemSwitch = require("./useMenuItemSwitch");
const _renderMenuItemSwitch = require("./renderMenuItemSwitch");
const _useMenuItemSwitchStylesstyles = require("./useMenuItemSwitchStyles.styles");
const MenuItemSwitch = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useMenuItemSwitch.useMenuItemSwitch_unstable)(props, ref);
(0, _useMenuItemSwitchStylesstyles.useMenuItemSwitchStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useMenuItemSwitchStyles_unstable')(state);
return (0, _renderMenuItemSwitch.renderMenuItemSwitch_unstable)(state);
});
MenuItemSwitch.displayName = 'MenuItemSwitch';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/MenuItemSwitch/MenuItemSwitch.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useMenuItemSwitch_unstable } from './useMenuItemSwitch';\nimport { renderMenuItemSwitch_unstable } from './renderMenuItemSwitch';\nimport { useMenuItemSwitchStyles_unstable } from './useMenuItemSwitchStyles.styles';\nimport type { MenuItemSwitchProps } from './MenuItemSwitch.types';\n\nexport const MenuItemSwitch: ForwardRefComponent<MenuItemSwitchProps> = React.forwardRef((props, ref) => {\n const state = useMenuItemSwitch_unstable(props, ref);\n\n useMenuItemSwitchStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuItemSwitchStyles_unstable')(state);\n return renderMenuItemSwitch_unstable(state);\n});\n\nMenuItemSwitch.displayName = 'MenuItemSwitch';\n"],"names":["MenuItemSwitch","React","forwardRef","props","ref","state","useMenuItemSwitch_unstable","useMenuItemSwitchStyles_unstable","useCustomStyleHook_unstable","renderMenuItemSwitch_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEqB;mCACD;sCACG;+CACG;AAG1C,MAAMA,iBAAAA,WAAAA,GAA2DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQC,IAAAA,6CAAAA,EAA2BH,OAAOC;IAEhDG,IAAAA,+DAAAA,EAAiCF;IACjCG,IAAAA,gDAAAA,EAA4B,oCAAoCH;IAChE,OAAOI,IAAAA,mDAAAA,EAA8BJ;AACvC;AAEAL,eAAeU,WAAW,GAAG"}
@@ -0,0 +1,6 @@
/**
* State used in rendering MenuItemSwitch
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/MenuItemSwitch/MenuItemSwitch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { MenuItemSlots } from '../MenuItem/MenuItem.types';\nimport { MenuItemSelectableState } from '../../selectable/types';\nimport { MenuItemCheckboxProps } from '../MenuItemCheckbox/MenuItemCheckbox.types';\n\nexport type MenuItemSwitchSlots = Pick<MenuItemSlots, 'root' | 'content' | 'secondaryContent' | 'icon' | 'subText'> & {\n switchIndicator?: Slot<'span'>;\n};\n\n/**\n * MenuItemSwitch Props\n */\nexport type MenuItemSwitchProps = ComponentProps<MenuItemSwitchSlots> &\n Pick<MenuItemCheckboxProps, 'disabled' | 'persistOnClick' | 'name' | 'value'>;\n\n/**\n * State used in rendering MenuItemSwitch\n */\nexport type MenuItemSwitchState = ComponentState<MenuItemSwitchSlots> &\n MenuItemSelectableState &\n Required<Pick<MenuItemSwitchProps, 'disabled'>>;\n"],"names":[],"rangeMappings":";;","mappings":"AAeA;;CAEC"}
@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
MenuItemSwitch: function() {
return _MenuItemSwitch.MenuItemSwitch;
},
circleFilledClassName: function() {
return _useMenuItemSwitchStylesstyles.circleFilledClassName;
},
menuItemSwitchClassNames: function() {
return _useMenuItemSwitchStylesstyles.menuItemSwitchClassNames;
},
renderMenuItemSwitch_unstable: function() {
return _renderMenuItemSwitch.renderMenuItemSwitch_unstable;
},
useMenuItemSwitchStyles_unstable: function() {
return _useMenuItemSwitchStylesstyles.useMenuItemSwitchStyles_unstable;
},
useMenuItemSwitch_unstable: function() {
return _useMenuItemSwitch.useMenuItemSwitch_unstable;
}
});
const _MenuItemSwitch = require("./MenuItemSwitch");
const _renderMenuItemSwitch = require("./renderMenuItemSwitch");
const _useMenuItemSwitch = require("./useMenuItemSwitch");
const _useMenuItemSwitchStylesstyles = require("./useMenuItemSwitchStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/MenuItemSwitch/index.ts"],"sourcesContent":["export { MenuItemSwitch } from './MenuItemSwitch';\nexport type { MenuItemSwitchProps, MenuItemSwitchSlots, MenuItemSwitchState } from './MenuItemSwitch.types';\nexport { renderMenuItemSwitch_unstable } from './renderMenuItemSwitch';\nexport { useMenuItemSwitch_unstable } from './useMenuItemSwitch';\nexport {\n circleFilledClassName,\n menuItemSwitchClassNames,\n useMenuItemSwitchStyles_unstable,\n} from './useMenuItemSwitchStyles.styles';\n"],"names":["MenuItemSwitch","circleFilledClassName","menuItemSwitchClassNames","renderMenuItemSwitch_unstable","useMenuItemSwitchStyles_unstable","useMenuItemSwitch_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,cAAc;eAAdA,8BAAc;;IAKrBC,qBAAqB;eAArBA,oDAAqB;;IACrBC,wBAAwB;eAAxBA,uDAAwB;;IAJjBC,6BAA6B;eAA7BA,mDAA6B;;IAKpCC,gCAAgC;eAAhCA,+DAAgC;;IAJzBC,0BAA0B;eAA1BA,6CAA0B;;;gCAHJ;sCAEe;mCACH;+CAKpC"}
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderMenuItemSwitch_unstable", {
enumerable: true,
get: function() {
return renderMenuItemSwitch_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderMenuItemSwitch_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
state.content && /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.content, {
children: [
state.content.children,
state.subText && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.subText, {})
]
}),
state.secondaryContent && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.secondaryContent, {}),
state.switchIndicator && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.switchIndicator, {})
]
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/MenuItemSwitch/renderMenuItemSwitch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchSlots, MenuItemSwitchState } from './MenuItemSwitch.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuItemSwitch_unstable = (state: MenuItemSwitchState) => {\n assertSlots<MenuItemSwitchSlots>(state);\n\n return (\n <state.root>\n {state.icon && <state.icon />}\n {state.content && (\n <state.content>\n {state.content.children}\n {state.subText && <state.subText />}\n </state.content>\n )}\n {state.secondaryContent && <state.secondaryContent />}\n {state.switchIndicator && <state.switchIndicator />}\n </state.root>\n );\n};\n"],"names":["renderMenuItemSwitch_unstable","state","assertSlots","_jsxs","root","icon","_jsx","content","children","subText","secondaryContent","switchIndicator"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;4BAPb;gCAC4B;AAMrB,MAAMA,gCAAgC,CAACC;IAC5CC,IAAAA,2BAAAA,EAAiCD;IAEjC,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMI,IAAI,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACL,MAAMI,IAAI,EAAA,CAAA;YACzBJ,MAAMM,OAAO,IAAA,WAAA,GACZJ,IAAAA,gBAAA,EAACF,MAAMM,OAAO,EAAA;;oBACXN,MAAMM,OAAO,CAACC,QAAQ;oBACtBP,MAAMQ,OAAO,IAAA,WAAA,GAAIH,IAAAA,eAAA,EAACL,MAAMQ,OAAO,EAAA,CAAA;;;YAGnCR,MAAMS,gBAAgB,IAAA,WAAA,GAAIJ,IAAAA,eAAA,EAACL,MAAMS,gBAAgB,EAAA,CAAA;YACjDT,MAAMU,eAAe,IAAA,WAAA,GAAIL,IAAAA,eAAA,EAACL,MAAMU,eAAe,EAAA,CAAA;;;AAGtD"}
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useMenuItemSwitch_unstable", {
enumerable: true,
get: function() {
return useMenuItemSwitch_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _useMenuItemCheckbox = require("../MenuItemCheckbox/useMenuItemCheckbox");
const _reacticons = require("@fluentui/react-icons");
const _useMenuItemSwitchStylesstyles = require("./useMenuItemSwitchStyles.styles");
const useMenuItemSwitch_unstable = (props, ref)=>{
const baseState = (0, _useMenuItemCheckbox.useMenuItemCheckbox_unstable)(props, ref);
return {
...baseState,
switchIndicator: _reactutilities.slot.optional(props.switchIndicator, {
renderByDefault: true,
elementType: 'span',
defaultProps: {
children: /*#__PURE__*/ _react.createElement(_reacticons.CircleFilled, {
className: _useMenuItemSwitchStylesstyles.circleFilledClassName
})
}
}),
components: {
...baseState.components,
switchIndicator: 'span'
}
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/MenuItemSwitch/useMenuItemSwitch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport type { MenuItemSwitchProps, MenuItemSwitchState } from './MenuItemSwitch.types';\nimport { useMenuItemCheckbox_unstable } from '../MenuItemCheckbox/useMenuItemCheckbox';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { circleFilledClassName } from './useMenuItemSwitchStyles.styles';\n\n/**\n * Create the state required to render MenuItemSwitch.\n *\n * The returned state can be modified with hooks such as useMenuItemSwitchStyles_unstable,\n * before being passed to renderMenuItemSwitch_unstable.\n *\n * @param props - props from this instance of MenuItemSwitch\n * @param ref - reference to root HTMLDivElement of MenuItemSwitch\n */\nexport const useMenuItemSwitch_unstable = (\n props: MenuItemSwitchProps,\n ref: React.Ref<HTMLDivElement>,\n): MenuItemSwitchState => {\n const baseState = useMenuItemCheckbox_unstable(props, ref);\n return {\n ...baseState,\n switchIndicator: slot.optional(props.switchIndicator, {\n renderByDefault: true,\n elementType: 'span',\n defaultProps: {\n children: <CircleFilled className={circleFilledClassName} />,\n },\n }),\n components: {\n ...baseState.components,\n switchIndicator: 'span',\n },\n };\n};\n"],"names":["useMenuItemSwitch_unstable","props","ref","baseState","useMenuItemCheckbox_unstable","switchIndicator","slot","optional","renderByDefault","elementType","defaultProps","children","React","createElement","CircleFilled","className","circleFilledClassName","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;gCACF;qCAEwB;4BAChB;+CACS;AAW/B,MAAMA,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,YAAYC,IAAAA,iDAAAA,EAA6BH,OAAOC;IACtD,OAAO;QACL,GAAGC,SAAS;QACZE,iBAAiBC,oBAAAA,CAAKC,QAAQ,CAACN,MAAMI,eAAe,EAAE;YACpDG,iBAAiB;YACjBC,aAAa;YACbC,cAAc;gBACZC,UAAAA,WAAAA,GAAUC,OAAAC,aAAA,CAACC,wBAAAA,EAAAA;oBAAaC,WAAWC,oDAAAA;;YACrC;QACF;QACAC,YAAY;YACV,GAAGd,UAAUc,UAAU;YACvBZ,iBAAiB;QACnB;IACF;AACF"}
@@ -0,0 +1,170 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
circleFilledClassName: function() {
return circleFilledClassName;
},
menuItemSwitchClassNames: function() {
return menuItemSwitchClassNames;
},
useMenuItemSwitchStyles_unstable: function() {
return useMenuItemSwitchStyles_unstable;
}
});
const _react = require("@griffel/react");
const _useMenuItemStylesstyles = require("../MenuItem/useMenuItemStyles.styles");
const menuItemSwitchClassNames = {
root: 'fui-MenuItemSwitch',
icon: 'fui-MenuItemSwitch__icon',
content: 'fui-MenuItemSwitch__content',
secondaryContent: 'fui-MenuItemSwitch__secondaryContent',
switchIndicator: 'fui-MenuItemSwitch__switchIndicator',
subText: 'fui-MenuItemSwitch__subText'
};
const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';
// Thumb and track sizes used by the component.
const spaceBetweenThumbAndTrack = 2;
const trackHeight = 20;
const trackWidth = 40;
const thumbSize = trackHeight - spaceBetweenThumbAndTrack;
const useSwitchIndicatorBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1x31n8g", "rsmcm5v", {
r: [
".r1x31n8g{border-radius:var(--borderRadiusCircular);border:var(--strokeWidthThin) solid var(--colorNeutralStrokeAccessible);line-height:0;box-sizing:border-box;fill:currentColor;flex-shrink:0;font-size:18px;height:20px;transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:background,border,color;width:40px;margin-right:var(--spacingHorizontalXS);color:var(--colorNeutralStrokeAccessible);}",
".r1x31n8g:hover{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}",
".r1x31n8g:hover:active{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}",
".r1x31n8g .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:transform;}",
".rsmcm5v{border-radius:var(--borderRadiusCircular);border:var(--strokeWidthThin) solid var(--colorNeutralStrokeAccessible);line-height:0;box-sizing:border-box;fill:currentColor;flex-shrink:0;font-size:18px;height:20px;transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:background,border,color;width:40px;margin-left:var(--spacingHorizontalXS);color:var(--colorNeutralStrokeAccessible);}",
".rsmcm5v:hover{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}",
".rsmcm5v:hover:active{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}",
".rsmcm5v .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:transform;}"
],
s: [
"@media screen and (prefers-reduced-motion: reduce){.r1x31n8g{transition-duration:0.01ms;}}",
"@media screen and (prefers-reduced-motion: reduce){.r1x31n8g .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:0.01ms;}}",
"@media screen and (prefers-reduced-motion: reduce){.rsmcm5v{transition-duration:0.01ms;}}",
"@media screen and (prefers-reduced-motion: reduce){.rsmcm5v .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:0.01ms;}}"
]
});
const useSwitchIndicatorStyles = /*#__PURE__*/ (0, _react.__styles)({
checked: {
G4r02d: [
"fdca5i2",
"fk0rr1z"
],
De3pzq: "ftywsgz",
sj55zd: "fqpbvvt",
g2u3we: "fghlq4f",
h3c5rm: [
"f1gn591s",
"fjscplz"
],
B9xav0g: "fb073pr",
zhjwy3: [
"fjscplz",
"f1gn591s"
],
Bi91k9c: "fz46y8r",
Jwef8y: "f1kjrvvj",
Bgoe8wy: "fpa59ij",
Bwzppfd: [
"f1rhln42",
"f1l1ogpg"
],
oetu4i: "fz67qlh",
gg5e9n: [
"f1l1ogpg",
"f1rhln42"
],
B2d53fq: "frlnr8d",
iro3zm: "fle2s0s",
b661bw: "f1j8ziw4",
Bk6r4ia: [
"f1xzu9i0",
"f1jlpvxk"
],
B9zn80p: "f1i1ccxp",
Bpld233: [
"f1jlpvxk",
"f1xzu9i0"
]
}
}, {
d: [
".fdca5i2 .fui-MenuItemSwitch__switchIndicator__circleFilled{transform:translateX(20px);}",
".fk0rr1z .fui-MenuItemSwitch__switchIndicator__circleFilled{transform:translateX(-20px);}",
".ftywsgz{background-color:var(--colorCompoundBrandBackground);}",
".fqpbvvt{color:var(--colorNeutralForegroundInverted);}",
".fghlq4f{border-top-color:var(--colorTransparentStroke);}",
".f1gn591s{border-right-color:var(--colorTransparentStroke);}",
".fjscplz{border-left-color:var(--colorTransparentStroke);}",
".fb073pr{border-bottom-color:var(--colorTransparentStroke);}"
],
h: [
".fz46y8r:hover{color:var(--colorNeutralForegroundInverted);}",
".f1kjrvvj:hover{background-color:var(--colorCompoundBrandBackgroundHover);}",
".fpa59ij:hover{border-top-color:var(--colorTransparentStrokeInteractive);}",
".f1rhln42:hover{border-right-color:var(--colorTransparentStrokeInteractive);}",
".f1l1ogpg:hover{border-left-color:var(--colorTransparentStrokeInteractive);}",
".fz67qlh:hover{border-bottom-color:var(--colorTransparentStrokeInteractive);}",
".frlnr8d:hover:active{color:var(--colorNeutralForegroundInverted);}",
".fle2s0s:hover:active{background-color:var(--colorCompoundBrandBackgroundPressed);}",
".f1j8ziw4:hover:active{border-top-color:var(--colorTransparentStrokeInteractive);}",
".f1xzu9i0:hover:active{border-right-color:var(--colorTransparentStrokeInteractive);}",
".f1jlpvxk:hover:active{border-left-color:var(--colorTransparentStrokeInteractive);}",
".f1i1ccxp:hover:active{border-bottom-color:var(--colorTransparentStrokeInteractive);}"
]
});
const useMultilineStyles = /*#__PURE__*/ (0, _react.__styles)({
"switch": {
qb2dma: "f7nlbp4"
}
}, {
d: [
".f7nlbp4{align-self:center;}"
]
});
const useMenuItemSwitchStyles_unstable = (state)=>{
'use no memo';
const { checked, subText } = state;
const multiline = !!subText;
const switchIndicatorStyles = useSwitchIndicatorStyles();
const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();
const multilineStyles = useMultilineStyles();
state.root.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.root, state.root.className);
if (state.content) {
state.content.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.content, state.content.className);
}
if (state.secondaryContent) {
state.secondaryContent.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);
}
if (state.icon) {
state.icon.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.icon, state.icon.className);
}
if (state.subText) {
state.subText.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.subText, state.subText.className);
}
if (state.switchIndicator) {
state.switchIndicator.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, state.switchIndicator.className, multiline && multilineStyles.switch);
}
(0, _useMenuItemStylesstyles.useMenuItemStyles_unstable)({
...state,
components: {
...state.components,
checkmark: 'span',
submenuIndicator: 'span'
},
checkmark: undefined,
submenuIndicator: undefined,
hasSubmenu: false,
persistOnClick: true
});
return state;
};
File diff suppressed because one or more lines are too long