@fluentui/react-menu 9.13.7 → 9.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/dist/index.d.ts +39 -0
  3. package/lib/MenuItemSwitch.js +1 -0
  4. package/lib/MenuItemSwitch.js.map +1 -0
  5. package/lib/components/MenuItemSwitch/MenuItemSwitch.js +12 -0
  6. package/lib/components/MenuItemSwitch/MenuItemSwitch.js.map +1 -0
  7. package/lib/components/MenuItemSwitch/MenuItemSwitch.types.js +1 -0
  8. package/lib/components/MenuItemSwitch/MenuItemSwitch.types.js.map +1 -0
  9. package/lib/components/MenuItemSwitch/index.js +5 -0
  10. package/lib/components/MenuItemSwitch/index.js.map +1 -0
  11. package/lib/components/MenuItemSwitch/renderMenuItemSwitch.js +15 -0
  12. package/lib/components/MenuItemSwitch/renderMenuItemSwitch.js.map +1 -0
  13. package/lib/components/MenuItemSwitch/useMenuItemSwitch.js +32 -0
  14. package/lib/components/MenuItemSwitch/useMenuItemSwitch.js.map +1 -0
  15. package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js +83 -0
  16. package/lib/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js.map +1 -0
  17. package/lib/index.js +1 -0
  18. package/lib/index.js.map +1 -1
  19. package/lib-commonjs/MenuItemSwitch.js +6 -0
  20. package/lib-commonjs/MenuItemSwitch.js.map +1 -0
  21. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.js +23 -0
  22. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.js.map +1 -0
  23. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.types.js +4 -0
  24. package/lib-commonjs/components/MenuItemSwitch/MenuItemSwitch.types.js.map +1 -0
  25. package/lib-commonjs/components/MenuItemSwitch/index.js +10 -0
  26. package/lib-commonjs/components/MenuItemSwitch/index.js.map +1 -0
  27. package/lib-commonjs/components/MenuItemSwitch/renderMenuItemSwitch.js +23 -0
  28. package/lib-commonjs/components/MenuItemSwitch/renderMenuItemSwitch.js.map +1 -0
  29. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitch.js +35 -0
  30. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitch.js.map +1 -0
  31. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js +154 -0
  32. package/lib-commonjs/components/MenuItemSwitch/useMenuItemSwitchStyles.styles.js.map +1 -0
  33. package/lib-commonjs/index.js +16 -0
  34. package/lib-commonjs/index.js.map +1 -1
  35. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,12 +1,29 @@
1
1
  # Change Log - @fluentui/react-menu
2
2
 
3
- This log was last generated on Wed, 17 Apr 2024 21:47:23 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 23 Apr 2024 08:12:10 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.14.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v9.14.0)
8
+
9
+ Tue, 23 Apr 2024 08:12:10 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.13.7..@fluentui/react-menu_v9.14.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: Implement MenuItemSwitch component ([PR #31099](https://github.com/microsoft/fluentui/pull/31099) by lingfangao@hotmail.com)
15
+ - Bump @fluentui/react-aria to v9.10.5 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
16
+ - Bump @fluentui/react-context-selector to v9.1.58 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
17
+ - Bump @fluentui/react-portal to v9.4.21 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
18
+ - Bump @fluentui/react-positioning to v9.14.4 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
19
+ - Bump @fluentui/react-shared-contexts to v9.17.0 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
20
+ - Bump @fluentui/react-tabster to v9.20.1 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
21
+ - Bump @fluentui/react-utilities to v9.18.7 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
22
+ - Bump @fluentui/react-jsx-runtime to v9.0.36 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
23
+
7
24
  ## [9.13.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v9.13.7)
8
25
 
9
- Wed, 17 Apr 2024 21:47:23 GMT
26
+ Wed, 17 Apr 2024 21:53:54 GMT
10
27
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.13.6..@fluentui/react-menu_v9.13.7)
11
28
 
12
29
  ### Patches
package/dist/index.d.ts CHANGED
@@ -257,6 +257,24 @@ export declare type MenuItemSlots = {
257
257
 
258
258
  export declare type MenuItemState = ComponentState<MenuItemSlots> & Required<Pick<MenuItemProps, 'disabled' | 'hasSubmenu' | 'persistOnClick'>>;
259
259
 
260
+ export declare const MenuItemSwitch: ForwardRefComponent<MenuItemSwitchProps>;
261
+
262
+ export declare const menuItemSwitchClassNames: SlotClassNames<MenuItemSwitchSlots>;
263
+
264
+ /**
265
+ * MenuItemSwitch Props
266
+ */
267
+ export declare type MenuItemSwitchProps = ComponentProps<MenuItemSwitchSlots> & Pick<MenuItemCheckboxProps, 'disabled' | 'persistOnClick' | 'name' | 'value'>;
268
+
269
+ export declare type MenuItemSwitchSlots = Pick<MenuItemSlots, 'root' | 'content' | 'secondaryContent' | 'icon'> & {
270
+ switchIndicator?: Slot<'span'>;
271
+ };
272
+
273
+ /**
274
+ * State used in rendering MenuItemSwitch
275
+ */
276
+ export declare type MenuItemSwitchState = ComponentState<MenuItemSwitchSlots> & MenuItemSelectableState & Required<Pick<MenuItemSwitchProps, 'disabled'>>;
277
+
260
278
  /**
261
279
  * Define a styled MenuList, using the `useMenuList_unstable` hook.
262
280
  */
@@ -646,6 +664,11 @@ export declare const renderMenuItemLink_unstable: (state: MenuItemLinkState) =>
646
664
  */
647
665
  export declare const renderMenuItemRadio_unstable: (state: MenuItemRadioState) => JSX.Element;
648
666
 
667
+ /**
668
+ * Function that renders the final JSX of the component
669
+ */
670
+ export declare const renderMenuItemSwitch_unstable: (state: MenuItemSwitchState) => JSX.Element;
671
+
649
672
  /**
650
673
  * Function that renders the final JSX of the component
651
674
  */
@@ -757,6 +780,22 @@ export declare const useMenuItemRadioStyles_unstable: (state: MenuItemRadioState
757
780
  /** Applies style classnames to slots */
758
781
  export declare const useMenuItemStyles_unstable: (state: MenuItemState) => MenuItemState;
759
782
 
783
+ /**
784
+ * Create the state required to render MenuItemSwitch.
785
+ *
786
+ * The returned state can be modified with hooks such as useMenuItemSwitchStyles_unstable,
787
+ * before being passed to renderMenuItemSwitch_unstable.
788
+ *
789
+ * @param props - props from this instance of MenuItemSwitch
790
+ * @param ref - reference to root HTMLDivElement of MenuItemSwitch
791
+ */
792
+ export declare const useMenuItemSwitch_unstable: (props: MenuItemSwitchProps, ref: React_2.Ref<HTMLDivElement>) => MenuItemSwitchState;
793
+
794
+ /**
795
+ * Apply styling to the MenuItemSwitch slots based on the state
796
+ */
797
+ export declare const useMenuItemSwitchStyles_unstable: (state: MenuItemSwitchState) => MenuItemSwitchState;
798
+
760
799
  /**
761
800
  * Returns the props and state required to render the component
762
801
  */
@@ -0,0 +1 @@
1
+ export * from './components/MenuItemSwitch/index';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["MenuItemSwitch.ts"],"sourcesContent":["export * from './components/MenuItemSwitch/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
3
+ import { useMenuItemSwitch_unstable } from './useMenuItemSwitch';
4
+ import { renderMenuItemSwitch_unstable } from './renderMenuItemSwitch';
5
+ import { useMenuItemSwitchStyles_unstable } from './useMenuItemSwitchStyles.styles';
6
+ export const MenuItemSwitch = /*#__PURE__*/ React.forwardRef((props, ref)=>{
7
+ const state = useMenuItemSwitch_unstable(props, ref);
8
+ useMenuItemSwitchStyles_unstable(state);
9
+ useCustomStyleHook_unstable('useMenuItemSwitchStyles_unstable')(state);
10
+ return renderMenuItemSwitch_unstable(state);
11
+ });
12
+ MenuItemSwitch.displayName = 'MenuItemSwitch';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["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":["React","useCustomStyleHook_unstable","useMenuItemSwitch_unstable","renderMenuItemSwitch_unstable","useMenuItemSwitchStyles_unstable","MenuItemSwitch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAGpF,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IACjCR,4BAA4B,oCAAoCQ;IAChE,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["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'> & {\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":[],"mappings":"AAAA,WAoBkD"}
@@ -0,0 +1,5 @@
1
+ export * from './MenuItemSwitch';
2
+ export * from './MenuItemSwitch.types';
3
+ export * from './renderMenuItemSwitch';
4
+ export * from './useMenuItemSwitch';
5
+ export * from './useMenuItemSwitchStyles.styles';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './MenuItemSwitch';\nexport * from './MenuItemSwitch.types';\nexport * from './renderMenuItemSwitch';\nexport * from './useMenuItemSwitch';\nexport * from './useMenuItemSwitchStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,mCAAmC"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * Function that renders the final JSX of the component
5
+ */ export const renderMenuItemSwitch_unstable = (state)=>{
6
+ assertSlots(state);
7
+ return /*#__PURE__*/ _jsxs(state.root, {
8
+ children: [
9
+ state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
10
+ state.content && /*#__PURE__*/ _jsx(state.content, {}),
11
+ state.secondaryContent && /*#__PURE__*/ _jsx(state.secondaryContent, {}),
12
+ state.switchIndicator && /*#__PURE__*/ _jsx(state.switchIndicator, {})
13
+ ]
14
+ });
15
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["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 && <state.content />}\n {state.secondaryContent && <state.secondaryContent />}\n {state.switchIndicator && <state.switchIndicator />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderMenuItemSwitch_unstable","state","root","icon","content","secondaryContent","switchIndicator"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CF,YAAiCE;IAEjC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,IAAI,kBAAI,KAACF,MAAME,IAAI;YACzBF,MAAMG,OAAO,kBAAI,KAACH,MAAMG,OAAO;YAC/BH,MAAMI,gBAAgB,kBAAI,KAACJ,MAAMI,gBAAgB;YACjDJ,MAAMK,eAAe,kBAAI,KAACL,MAAMK,eAAe;;;AAGtD,EAAE"}
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ import { slot } from '@fluentui/react-utilities';
3
+ import { useMenuItemCheckbox_unstable } from '../MenuItemCheckbox/useMenuItemCheckbox';
4
+ import { CircleFilled } from '@fluentui/react-icons';
5
+ import { circleFilledClassName } from './useMenuItemSwitchStyles.styles';
6
+ /**
7
+ * Create the state required to render MenuItemSwitch.
8
+ *
9
+ * The returned state can be modified with hooks such as useMenuItemSwitchStyles_unstable,
10
+ * before being passed to renderMenuItemSwitch_unstable.
11
+ *
12
+ * @param props - props from this instance of MenuItemSwitch
13
+ * @param ref - reference to root HTMLDivElement of MenuItemSwitch
14
+ */ export const useMenuItemSwitch_unstable = (props, ref)=>{
15
+ const baseState = useMenuItemCheckbox_unstable(props, ref);
16
+ return {
17
+ ...baseState,
18
+ switchIndicator: slot.optional(props.switchIndicator, {
19
+ renderByDefault: true,
20
+ elementType: 'span',
21
+ defaultProps: {
22
+ children: /*#__PURE__*/ React.createElement(CircleFilled, {
23
+ className: circleFilledClassName
24
+ })
25
+ }
26
+ }),
27
+ components: {
28
+ ...baseState.components,
29
+ switchIndicator: 'span'
30
+ }
31
+ };
32
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["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":["React","slot","useMenuItemCheckbox_unstable","CircleFilled","circleFilledClassName","useMenuItemSwitch_unstable","props","ref","baseState","switchIndicator","optional","renderByDefault","elementType","defaultProps","children","className","components"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,QAAQ,4BAA4B;AAEjD,SAASC,4BAA4B,QAAQ,0CAA0C;AACvF,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,qBAAqB,QAAQ,mCAAmC;AAEzE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,YAAYN,6BAA6BI,OAAOC;IACtD,OAAO;QACL,GAAGC,SAAS;QACZC,iBAAiBR,KAAKS,QAAQ,CAACJ,MAAMG,eAAe,EAAE;YACpDE,iBAAiB;YACjBC,aAAa;YACbC,cAAc;gBACZC,wBAAU,oBAACX;oBAAaY,WAAWX;;YACrC;QACF;QACAY,YAAY;YACV,GAAGR,UAAUQ,UAAU;YACvBP,iBAAiB;QACnB;IACF;AACF,EAAE"}
@@ -0,0 +1,83 @@
1
+ import { __styles, __resetStyles, mergeClasses, shorthands } from '@griffel/react';
2
+ import { tokens } from '@fluentui/react-theme';
3
+ import { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';
4
+ export const menuItemSwitchClassNames = {
5
+ root: 'fui-MenuItemSwitch',
6
+ icon: 'fui-MenuItemSwitch__icon',
7
+ content: 'fui-MenuItemSwitch__content',
8
+ secondaryContent: 'fui-MenuItemSwitch__secondaryContent',
9
+ switchIndicator: 'fui-MenuItemSwitch__switchIndicator'
10
+ };
11
+ export const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';
12
+ // Thumb and track sizes used by the component.
13
+ const spaceBetweenThumbAndTrack = 2;
14
+ const trackHeight = 20;
15
+ const trackWidth = 40;
16
+ const thumbSize = trackHeight - spaceBetweenThumbAndTrack;
17
+ const useSwitchIndicatorBaseClassName = /*#__PURE__*/__resetStyles("r1x31n8g", "rsmcm5v", {
18
+ 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;}"],
19
+ 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;}}"]
20
+ });
21
+ const useSwitchIndicatorStyles = /*#__PURE__*/__styles({
22
+ checked: {
23
+ G4r02d: ["fdca5i2", "fk0rr1z"],
24
+ De3pzq: "ftywsgz",
25
+ sj55zd: "fqpbvvt",
26
+ g2u3we: "fghlq4f",
27
+ h3c5rm: ["f1gn591s", "fjscplz"],
28
+ B9xav0g: "fb073pr",
29
+ zhjwy3: ["fjscplz", "f1gn591s"],
30
+ Bi91k9c: "fz46y8r",
31
+ Jwef8y: "f1kjrvvj",
32
+ Bgoe8wy: "fpa59ij",
33
+ Bwzppfd: ["f1rhln42", "f1l1ogpg"],
34
+ oetu4i: "fz67qlh",
35
+ gg5e9n: ["f1l1ogpg", "f1rhln42"],
36
+ B2d53fq: "frlnr8d",
37
+ iro3zm: "fle2s0s",
38
+ b661bw: "f1j8ziw4",
39
+ Bk6r4ia: ["f1xzu9i0", "f1jlpvxk"],
40
+ B9zn80p: "f1i1ccxp",
41
+ Bpld233: ["f1jlpvxk", "f1xzu9i0"]
42
+ }
43
+ }, {
44
+ 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);}"],
45
+ 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);}"]
46
+ });
47
+ /**
48
+ * Apply styling to the MenuItemSwitch slots based on the state
49
+ */
50
+ export const useMenuItemSwitchStyles_unstable = state => {
51
+ const {
52
+ checked
53
+ } = state;
54
+ const switchIndicatorStyles = useSwitchIndicatorStyles();
55
+ const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();
56
+ state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);
57
+ if (state.content) {
58
+ state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);
59
+ }
60
+ if (state.secondaryContent) {
61
+ state.secondaryContent.className = mergeClasses(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);
62
+ }
63
+ if (state.icon) {
64
+ state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);
65
+ }
66
+ if (state.switchIndicator) {
67
+ state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, state.switchIndicator.className);
68
+ }
69
+ useMenuItemStyles_unstable({
70
+ ...state,
71
+ components: {
72
+ ...state.components,
73
+ checkmark: 'span',
74
+ submenuIndicator: 'span'
75
+ },
76
+ checkmark: undefined,
77
+ submenuIndicator: undefined,
78
+ hasSubmenu: false,
79
+ persistOnClick: true
80
+ });
81
+ return state;
82
+ };
83
+ //# sourceMappingURL=useMenuItemSwitchStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__styles","__resetStyles","mergeClasses","shorthands","tokens","useMenuItemStyles_unstable","menuItemSwitchClassNames","root","icon","content","secondaryContent","switchIndicator","circleFilledClassName","spaceBetweenThumbAndTrack","trackHeight","trackWidth","thumbSize","useSwitchIndicatorBaseClassName","r","s","useSwitchIndicatorStyles","checked","G4r02d","De3pzq","sj55zd","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bi91k9c","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","B2d53fq","iro3zm","b661bw","Bk6r4ia","B9zn80p","Bpld233","d","h","useMenuItemSwitchStyles_unstable","state","switchIndicatorStyles","switchIndicatorBaseStyles","className","components","checkmark","submenuIndicator","undefined","hasSubmenu","persistOnClick"],"sources":["useMenuItemSwitchStyles.styles.js"],"sourcesContent":["import { makeStyles, makeResetStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';\nexport const menuItemSwitchClassNames = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator'\n};\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n// Thumb and track sizes used by the component.\nconst spaceBetweenThumbAndTrack = 2;\nconst trackHeight = 20;\nconst trackWidth = 40;\nconst thumbSize = trackHeight - spaceBetweenThumbAndTrack;\nconst useSwitchIndicatorBaseClassName = makeResetStyles({\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeAccessible}`,\n lineHeight: 0,\n boxSizing: 'border-box',\n fill: 'currentColor',\n flexShrink: 0,\n fontSize: `${thumbSize}px`,\n height: `${trackHeight}px`,\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'background, border, color',\n width: `${trackWidth}px`,\n marginRight: tokens.spacingHorizontalXS,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n },\n color: tokens.colorNeutralStrokeAccessible,\n ':hover': {\n color: tokens.colorNeutralStrokeAccessibleHover,\n borderColor: tokens.colorNeutralStrokeAccessibleHover\n },\n ':hover:active': {\n color: tokens.colorNeutralStrokeAccessiblePressed,\n borderColor: tokens.colorNeutralStrokeAccessiblePressed\n },\n [`& .${circleFilledClassName}`]: {\n transitionDuration: tokens.durationNormal,\n transitionTimingFunction: tokens.curveEasyEase,\n transitionProperty: 'transform',\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n }\n }\n});\nconst useSwitchIndicatorStyles = makeStyles({\n checked: {\n [`& .${circleFilledClassName}`]: {\n transform: `translateX(${trackWidth - thumbSize - spaceBetweenThumbAndTrack}px)`\n },\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundInverted,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n ':hover': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n },\n ':hover:active': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n }\n }\n});\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */ export const useMenuItemSwitchStyles_unstable = (state)=>{\n const { checked } = state;\n const switchIndicatorStyles = useSwitchIndicatorStyles();\n const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();\n state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);\n if (state.content) {\n state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);\n }\n if (state.switchIndicator) {\n state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, state.switchIndicator.className);\n }\n useMenuItemStyles_unstable({\n ...state,\n components: {\n ...state.components,\n checkmark: 'span',\n submenuIndicator: 'span'\n },\n checkmark: undefined,\n submenuIndicator: undefined,\n hasSubmenu: false,\n persistOnClick: true\n });\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAAC,aAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACtF,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,0BAA0B,QAAQ,sCAAsC;AACjF,OAAO,MAAMC,wBAAwB,GAAG;EACpCC,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE,0BAA0B;EAChCC,OAAO,EAAE,6BAA6B;EACtCC,gBAAgB,EAAE,sCAAsC;EACxDC,eAAe,EAAE;AACrB,CAAC;AACD,OAAO,MAAMC,qBAAqB,GAAG,mDAAmD;AACxF;AACA,MAAMC,yBAAyB,GAAG,CAAC;AACnC,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,UAAU,GAAG,EAAE;AACrB,MAAMC,SAAS,GAAGF,WAAW,GAAGD,yBAAyB;AACzD,MAAMI,+BAA+B,gBAAGhB,aAAA;EAAAiB,CAAA;EAAAC,CAAA;AAAA,CAkCvC,CAAC;AACF,MAAMC,wBAAwB,gBAAGpB,QAA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ACvBiC,KAAK,CAACjC,eAAe,CAACoC,SAAS,GAAG7C,YAAY,CAACI,wBAAwB,CAACK,eAAe,EAAEmC,yBAAyB,EAAEzB,OAAO,IAAIwB,qBAAqB,CAACxB,OAAO,EAAEuB,KAAK,CAACjC,eAAe,CAACoC,SAAS,CAAC;EAClM;EACA1C,0BAA0B,CAAC;IACvB,GAAGuC,KAAK;IACRI,UAAU,EAAE;MACR,GAAGJ,KAAK,CAACI,UAAU;MACnBC,SAAS,EAAE,MAAM;MACjBC,gBAAgB,EAAE;IACtB,CAAC;IACDD,SAAS,EAAEE,SAAS;IACpBD,gBAAgB,EAAEC,SAAS;IAC3BC,UAAU,EAAE,KAAK;IACjBC,cAAc,EAAE;EACpB,CAAC,CAAC;EACF,OAAOT,KAAK;AAChB,CAAC"}
package/lib/index.js CHANGED
@@ -16,3 +16,4 @@ export { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from
16
16
  export { useCheckmarkStyles_unstable } from './selectable/index';
17
17
  export { MenuItemLink, menuItemLinkClassNames, renderMenuItemLink_unstable, useMenuItemLinkStyles_unstable, useMenuItemLink_unstable } from './MenuItemLink';
18
18
  export { MENU_ENTER_EVENT, dispatchMenuEnterEvent, useOnMenuMouseEnter } from './utils';
19
+ export { MenuItemSwitch, useMenuItemSwitch_unstable, useMenuItemSwitchStyles_unstable, renderMenuItemSwitch_unstable, menuItemSwitchClassNames } from './MenuItemSwitch';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { MenuProvider, useMenuContext_unstable } from './contexts/menuContext';\nexport type { MenuContextValue } from './contexts/menuContext';\nexport { MenuTriggerContextProvider, useMenuTriggerContext_unstable } from './contexts/menuTriggerContext';\nexport { MenuGroupContextProvider, useMenuGroupContext_unstable } from './contexts/menuGroupContext';\nexport type { MenuGroupContextValue } from './contexts/menuGroupContext';\nexport { MenuListProvider, useMenuListContext_unstable } from './contexts/menuListContext';\nexport type { MenuListContextValue } from './contexts/menuListContext';\n\nexport { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenu_unstable } from './Menu';\nexport type {\n MenuContextValues,\n MenuOpenChangeData,\n MenuOpenEvent,\n // MenuOpenEvents is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n MenuOpenEvents,\n MenuProps,\n MenuSlots,\n MenuState,\n} from './Menu';\nexport {\n MenuDivider,\n menuDividerClassNames,\n renderMenuDivider_unstable,\n useMenuDividerStyles_unstable,\n useMenuDivider_unstable,\n} from './MenuDivider';\nexport type { MenuDividerProps, MenuDividerSlots, MenuDividerState } from './MenuDivider';\nexport {\n MenuGroup,\n menuGroupClassNames,\n renderMenuGroup_unstable,\n useMenuGroupContextValues_unstable,\n useMenuGroupStyles_unstable,\n useMenuGroup_unstable,\n} from './MenuGroup';\nexport type { MenuGroupContextValues, MenuGroupProps, MenuGroupSlots, MenuGroupState } from './MenuGroup';\nexport {\n MenuGroupHeader,\n menuGroupHeaderClassNames,\n renderMenuGroupHeader_unstable,\n useMenuGroupHeaderStyles_unstable,\n useMenuGroupHeader_unstable,\n} from './MenuGroupHeader';\nexport type { MenuGroupHeaderProps, MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader';\nexport {\n MenuItem,\n menuItemClassNames,\n renderMenuItem_unstable,\n useMenuItemStyles_unstable,\n useMenuItem_unstable,\n} from './MenuItem';\nexport type { MenuItemProps, MenuItemSlots, MenuItemState } from './MenuItem';\nexport {\n MenuItemCheckbox,\n menuItemCheckboxClassNames,\n renderMenuItemCheckbox_unstable,\n useMenuItemCheckboxStyles_unstable,\n useMenuItemCheckbox_unstable,\n} from './MenuItemCheckbox';\nexport type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox';\nexport {\n MenuItemRadio,\n menuItemRadioClassNames,\n renderMenuItemRadio_unstable,\n useMenuItemRadioStyles_unstable,\n useMenuItemRadio_unstable,\n} from './MenuItemRadio';\nexport type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio';\nexport {\n MenuList,\n menuListClassNames,\n renderMenuList_unstable,\n useMenuListContextValues_unstable,\n useMenuListStyles_unstable,\n useMenuList_unstable,\n} from './MenuList';\nexport type {\n MenuCheckedValueChangeData,\n MenuCheckedValueChangeEvent,\n MenuListContextValues,\n MenuListProps,\n MenuListSlots,\n MenuListState,\n // UninitializedMenuListState is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n UninitializedMenuListState,\n} from './MenuList';\nexport {\n MenuPopover,\n menuPopoverClassNames,\n renderMenuPopover_unstable,\n useMenuPopoverStyles_unstable,\n useMenuPopover_unstable,\n} from './MenuPopover';\nexport type { MenuPopoverProps, MenuPopoverSlots, MenuPopoverState } from './MenuPopover';\nexport {\n MenuSplitGroup,\n menuSplitGroupClassNames,\n renderMenuSplitGroup_unstable,\n useMenuSplitGroupStyles_unstable,\n useMenuSplitGroup_unstable,\n} from './MenuSplitGroup';\nexport type { MenuSplitGroupProps, MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup';\nexport { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from './MenuTrigger';\nexport type { MenuTriggerChildProps, MenuTriggerProps, MenuTriggerState } from './MenuTrigger';\n\nexport { useCheckmarkStyles_unstable } from './selectable/index';\nexport type { MenuItemSelectableProps, MenuItemSelectableState, SelectableHandler } from './selectable/index';\n\nexport {\n MenuItemLink,\n menuItemLinkClassNames,\n renderMenuItemLink_unstable,\n useMenuItemLinkStyles_unstable,\n useMenuItemLink_unstable,\n} from './MenuItemLink';\nexport type { MenuItemLinkProps, MenuItemLinkSlots, MenuItemLinkState } from './MenuItemLink';\n\nexport { MENU_ENTER_EVENT, dispatchMenuEnterEvent, useOnMenuMouseEnter } from './utils';\n"],"names":["MenuProvider","useMenuContext_unstable","MenuTriggerContextProvider","useMenuTriggerContext_unstable","MenuGroupContextProvider","useMenuGroupContext_unstable","MenuListProvider","useMenuListContext_unstable","Menu","renderMenu_unstable","useMenuContextValues_unstable","useMenu_unstable","MenuDivider","menuDividerClassNames","renderMenuDivider_unstable","useMenuDividerStyles_unstable","useMenuDivider_unstable","MenuGroup","menuGroupClassNames","renderMenuGroup_unstable","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","useMenuGroup_unstable","MenuGroupHeader","menuGroupHeaderClassNames","renderMenuGroupHeader_unstable","useMenuGroupHeaderStyles_unstable","useMenuGroupHeader_unstable","MenuItem","menuItemClassNames","renderMenuItem_unstable","useMenuItemStyles_unstable","useMenuItem_unstable","MenuItemCheckbox","menuItemCheckboxClassNames","renderMenuItemCheckbox_unstable","useMenuItemCheckboxStyles_unstable","useMenuItemCheckbox_unstable","MenuItemRadio","menuItemRadioClassNames","renderMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","useMenuItemRadio_unstable","MenuList","menuListClassNames","renderMenuList_unstable","useMenuListContextValues_unstable","useMenuListStyles_unstable","useMenuList_unstable","MenuPopover","menuPopoverClassNames","renderMenuPopover_unstable","useMenuPopoverStyles_unstable","useMenuPopover_unstable","MenuSplitGroup","menuSplitGroupClassNames","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useMenuSplitGroup_unstable","MenuTrigger","renderMenuTrigger_unstable","useMenuTrigger_unstable","useCheckmarkStyles_unstable","MenuItemLink","menuItemLinkClassNames","renderMenuItemLink_unstable","useMenuItemLinkStyles_unstable","useMenuItemLink_unstable","MENU_ENTER_EVENT","dispatchMenuEnterEvent","useOnMenuMouseEnter"],"mappings":"AAAA,SAASA,YAAY,EAAEC,uBAAuB,QAAQ,yBAAyB;AAE/E,SAASC,0BAA0B,EAAEC,8BAA8B,QAAQ,gCAAgC;AAC3G,SAASC,wBAAwB,EAAEC,4BAA4B,QAAQ,8BAA8B;AAErG,SAASC,gBAAgB,EAAEC,2BAA2B,QAAQ,6BAA6B;AAG3F,SAASC,IAAI,EAAEC,mBAAmB,EAAEC,6BAA6B,EAAEC,gBAAgB,QAAQ,SAAS;AAYpG,SACEC,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,gBAAgB;AAEvB,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,kCAAkC,EAClCC,2BAA2B,EAC3BC,qBAAqB,QAChB,cAAc;AAErB,SACEC,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,QACtB,oBAAoB;AAE3B,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,oBAAoB,QACf,aAAa;AAEpB,SACEC,gBAAgB,EAChBC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,kCAAkC,EAClCC,4BAA4B,QACvB,qBAAqB;AAE5B,SACEC,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAEzB,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,uBAAuB,EACvBC,iCAAiC,EACjCC,0BAA0B,EAC1BC,oBAAoB,QACf,aAAa;AAYpB,SACEC,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,gBAAgB;AAEvB,SACEC,cAAc,EACdC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,mBAAmB;AAE1B,SAASC,WAAW,EAAEC,0BAA0B,EAAEC,uBAAuB,QAAQ,gBAAgB;AAGjG,SAASC,2BAA2B,QAAQ,qBAAqB;AAGjE,SACEC,YAAY,EACZC,sBAAsB,EACtBC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,wBAAwB,QACnB,iBAAiB;AAGxB,SAASC,gBAAgB,EAAEC,sBAAsB,EAAEC,mBAAmB,QAAQ,UAAU"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { MenuProvider, useMenuContext_unstable } from './contexts/menuContext';\nexport type { MenuContextValue } from './contexts/menuContext';\nexport { MenuTriggerContextProvider, useMenuTriggerContext_unstable } from './contexts/menuTriggerContext';\nexport { MenuGroupContextProvider, useMenuGroupContext_unstable } from './contexts/menuGroupContext';\nexport type { MenuGroupContextValue } from './contexts/menuGroupContext';\nexport { MenuListProvider, useMenuListContext_unstable } from './contexts/menuListContext';\nexport type { MenuListContextValue } from './contexts/menuListContext';\n\nexport { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenu_unstable } from './Menu';\nexport type {\n MenuContextValues,\n MenuOpenChangeData,\n MenuOpenEvent,\n // MenuOpenEvents is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n MenuOpenEvents,\n MenuProps,\n MenuSlots,\n MenuState,\n} from './Menu';\nexport {\n MenuDivider,\n menuDividerClassNames,\n renderMenuDivider_unstable,\n useMenuDividerStyles_unstable,\n useMenuDivider_unstable,\n} from './MenuDivider';\nexport type { MenuDividerProps, MenuDividerSlots, MenuDividerState } from './MenuDivider';\nexport {\n MenuGroup,\n menuGroupClassNames,\n renderMenuGroup_unstable,\n useMenuGroupContextValues_unstable,\n useMenuGroupStyles_unstable,\n useMenuGroup_unstable,\n} from './MenuGroup';\nexport type { MenuGroupContextValues, MenuGroupProps, MenuGroupSlots, MenuGroupState } from './MenuGroup';\nexport {\n MenuGroupHeader,\n menuGroupHeaderClassNames,\n renderMenuGroupHeader_unstable,\n useMenuGroupHeaderStyles_unstable,\n useMenuGroupHeader_unstable,\n} from './MenuGroupHeader';\nexport type { MenuGroupHeaderProps, MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader';\nexport {\n MenuItem,\n menuItemClassNames,\n renderMenuItem_unstable,\n useMenuItemStyles_unstable,\n useMenuItem_unstable,\n} from './MenuItem';\nexport type { MenuItemProps, MenuItemSlots, MenuItemState } from './MenuItem';\nexport {\n MenuItemCheckbox,\n menuItemCheckboxClassNames,\n renderMenuItemCheckbox_unstable,\n useMenuItemCheckboxStyles_unstable,\n useMenuItemCheckbox_unstable,\n} from './MenuItemCheckbox';\nexport type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox';\nexport {\n MenuItemRadio,\n menuItemRadioClassNames,\n renderMenuItemRadio_unstable,\n useMenuItemRadioStyles_unstable,\n useMenuItemRadio_unstable,\n} from './MenuItemRadio';\nexport type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio';\nexport {\n MenuList,\n menuListClassNames,\n renderMenuList_unstable,\n useMenuListContextValues_unstable,\n useMenuListStyles_unstable,\n useMenuList_unstable,\n} from './MenuList';\nexport type {\n MenuCheckedValueChangeData,\n MenuCheckedValueChangeEvent,\n MenuListContextValues,\n MenuListProps,\n MenuListSlots,\n MenuListState,\n // UninitializedMenuListState is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n UninitializedMenuListState,\n} from './MenuList';\nexport {\n MenuPopover,\n menuPopoverClassNames,\n renderMenuPopover_unstable,\n useMenuPopoverStyles_unstable,\n useMenuPopover_unstable,\n} from './MenuPopover';\nexport type { MenuPopoverProps, MenuPopoverSlots, MenuPopoverState } from './MenuPopover';\nexport {\n MenuSplitGroup,\n menuSplitGroupClassNames,\n renderMenuSplitGroup_unstable,\n useMenuSplitGroupStyles_unstable,\n useMenuSplitGroup_unstable,\n} from './MenuSplitGroup';\nexport type { MenuSplitGroupProps, MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup';\nexport { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from './MenuTrigger';\nexport type { MenuTriggerChildProps, MenuTriggerProps, MenuTriggerState } from './MenuTrigger';\n\nexport { useCheckmarkStyles_unstable } from './selectable/index';\nexport type { MenuItemSelectableProps, MenuItemSelectableState, SelectableHandler } from './selectable/index';\n\nexport {\n MenuItemLink,\n menuItemLinkClassNames,\n renderMenuItemLink_unstable,\n useMenuItemLinkStyles_unstable,\n useMenuItemLink_unstable,\n} from './MenuItemLink';\nexport type { MenuItemLinkProps, MenuItemLinkSlots, MenuItemLinkState } from './MenuItemLink';\n\nexport { MENU_ENTER_EVENT, dispatchMenuEnterEvent, useOnMenuMouseEnter } from './utils';\nexport {\n MenuItemSwitch,\n useMenuItemSwitch_unstable,\n useMenuItemSwitchStyles_unstable,\n renderMenuItemSwitch_unstable,\n menuItemSwitchClassNames,\n} from './MenuItemSwitch';\n\nexport type { MenuItemSwitchProps, MenuItemSwitchState, MenuItemSwitchSlots } from './MenuItemSwitch';\n"],"names":["MenuProvider","useMenuContext_unstable","MenuTriggerContextProvider","useMenuTriggerContext_unstable","MenuGroupContextProvider","useMenuGroupContext_unstable","MenuListProvider","useMenuListContext_unstable","Menu","renderMenu_unstable","useMenuContextValues_unstable","useMenu_unstable","MenuDivider","menuDividerClassNames","renderMenuDivider_unstable","useMenuDividerStyles_unstable","useMenuDivider_unstable","MenuGroup","menuGroupClassNames","renderMenuGroup_unstable","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","useMenuGroup_unstable","MenuGroupHeader","menuGroupHeaderClassNames","renderMenuGroupHeader_unstable","useMenuGroupHeaderStyles_unstable","useMenuGroupHeader_unstable","MenuItem","menuItemClassNames","renderMenuItem_unstable","useMenuItemStyles_unstable","useMenuItem_unstable","MenuItemCheckbox","menuItemCheckboxClassNames","renderMenuItemCheckbox_unstable","useMenuItemCheckboxStyles_unstable","useMenuItemCheckbox_unstable","MenuItemRadio","menuItemRadioClassNames","renderMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","useMenuItemRadio_unstable","MenuList","menuListClassNames","renderMenuList_unstable","useMenuListContextValues_unstable","useMenuListStyles_unstable","useMenuList_unstable","MenuPopover","menuPopoverClassNames","renderMenuPopover_unstable","useMenuPopoverStyles_unstable","useMenuPopover_unstable","MenuSplitGroup","menuSplitGroupClassNames","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useMenuSplitGroup_unstable","MenuTrigger","renderMenuTrigger_unstable","useMenuTrigger_unstable","useCheckmarkStyles_unstable","MenuItemLink","menuItemLinkClassNames","renderMenuItemLink_unstable","useMenuItemLinkStyles_unstable","useMenuItemLink_unstable","MENU_ENTER_EVENT","dispatchMenuEnterEvent","useOnMenuMouseEnter","MenuItemSwitch","useMenuItemSwitch_unstable","useMenuItemSwitchStyles_unstable","renderMenuItemSwitch_unstable","menuItemSwitchClassNames"],"mappings":"AAAA,SAASA,YAAY,EAAEC,uBAAuB,QAAQ,yBAAyB;AAE/E,SAASC,0BAA0B,EAAEC,8BAA8B,QAAQ,gCAAgC;AAC3G,SAASC,wBAAwB,EAAEC,4BAA4B,QAAQ,8BAA8B;AAErG,SAASC,gBAAgB,EAAEC,2BAA2B,QAAQ,6BAA6B;AAG3F,SAASC,IAAI,EAAEC,mBAAmB,EAAEC,6BAA6B,EAAEC,gBAAgB,QAAQ,SAAS;AAYpG,SACEC,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,gBAAgB;AAEvB,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,kCAAkC,EAClCC,2BAA2B,EAC3BC,qBAAqB,QAChB,cAAc;AAErB,SACEC,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,QACtB,oBAAoB;AAE3B,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,oBAAoB,QACf,aAAa;AAEpB,SACEC,gBAAgB,EAChBC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,kCAAkC,EAClCC,4BAA4B,QACvB,qBAAqB;AAE5B,SACEC,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAEzB,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,uBAAuB,EACvBC,iCAAiC,EACjCC,0BAA0B,EAC1BC,oBAAoB,QACf,aAAa;AAYpB,SACEC,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,gBAAgB;AAEvB,SACEC,cAAc,EACdC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,mBAAmB;AAE1B,SAASC,WAAW,EAAEC,0BAA0B,EAAEC,uBAAuB,QAAQ,gBAAgB;AAGjG,SAASC,2BAA2B,QAAQ,qBAAqB;AAGjE,SACEC,YAAY,EACZC,sBAAsB,EACtBC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,wBAAwB,QACnB,iBAAiB;AAGxB,SAASC,gBAAgB,EAAEC,sBAAsB,EAAEC,mBAAmB,QAAQ,UAAU;AACxF,SACEC,cAAc,EACdC,0BAA0B,EAC1BC,gCAAgC,EAChCC,6BAA6B,EAC7BC,wBAAwB,QACnB,mBAAmB"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./components/MenuItemSwitch/index"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["MenuItemSwitch.js"],"sourcesContent":["export * from './components/MenuItemSwitch/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "MenuItemSwitch", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return MenuItemSwitch;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
14
+ const _useMenuItemSwitch = require("./useMenuItemSwitch");
15
+ const _renderMenuItemSwitch = require("./renderMenuItemSwitch");
16
+ const _useMenuItemSwitchStylesstyles = require("./useMenuItemSwitchStyles.styles");
17
+ const MenuItemSwitch = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
+ const state = (0, _useMenuItemSwitch.useMenuItemSwitch_unstable)(props, ref);
19
+ (0, _useMenuItemSwitchStylesstyles.useMenuItemSwitchStyles_unstable)(state);
20
+ (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useMenuItemSwitchStyles_unstable')(state);
21
+ return (0, _renderMenuItemSwitch.renderMenuItemSwitch_unstable)(state);
22
+ });
23
+ MenuItemSwitch.displayName = 'MenuItemSwitch';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["MenuItemSwitch.js"],"sourcesContent":["import * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useMenuItemSwitch_unstable } from './useMenuItemSwitch';\nimport { renderMenuItemSwitch_unstable } from './renderMenuItemSwitch';\nimport { useMenuItemSwitchStyles_unstable } from './useMenuItemSwitchStyles.styles';\nexport const MenuItemSwitch = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useMenuItemSwitch_unstable(props, ref);\n useMenuItemSwitchStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuItemSwitchStyles_unstable')(state);\n return renderMenuItemSwitch_unstable(state);\n});\nMenuItemSwitch.displayName = 'MenuItemSwitch';\n"],"names":["MenuItemSwitch","React","forwardRef","props","ref","state","useMenuItemSwitch_unstable","useMenuItemSwitchStyles_unstable","useCustomStyleHook_unstable","renderMenuItemSwitch_unstable","displayName"],"mappings":";;;;+BAKaA;;;eAAAA;;;;iEALU;qCACqB;mCACD;sCACG;+CACG;AAC1C,MAAMA,iBAAiB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACjE,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,+DAAgC,EAACF;IACjCG,IAAAA,gDAA2B,EAAC,oCAAoCH;IAChE,OAAOI,IAAAA,mDAA6B,EAACJ;AACzC;AACAL,eAAeU,WAAW,GAAG"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./MenuItemSwitch"), exports);
7
+ _export_star._(require("./MenuItemSwitch.types"), exports);
8
+ _export_star._(require("./renderMenuItemSwitch"), exports);
9
+ _export_star._(require("./useMenuItemSwitch"), exports);
10
+ _export_star._(require("./useMenuItemSwitchStyles.styles"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuItemSwitch';\nexport * from './MenuItemSwitch.types';\nexport * from './renderMenuItemSwitch';\nexport * from './useMenuItemSwitch';\nexport * from './useMenuItemSwitchStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderMenuItemSwitch_unstable", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return renderMenuItemSwitch_unstable;
9
+ }
10
+ });
11
+ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
+ const _reactutilities = require("@fluentui/react-utilities");
13
+ const renderMenuItemSwitch_unstable = (state)=>{
14
+ (0, _reactutilities.assertSlots)(state);
15
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
16
+ children: [
17
+ state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
18
+ state.content && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.content, {}),
19
+ state.secondaryContent && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.secondaryContent, {}),
20
+ state.switchIndicator && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.switchIndicator, {})
21
+ ]
22
+ });
23
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["renderMenuItemSwitch.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Function that renders the final JSX of the component\n */ export const renderMenuItemSwitch_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.icon && /*#__PURE__*/ _jsx(state.icon, {}),\n state.content && /*#__PURE__*/ _jsx(state.content, {}),\n state.secondaryContent && /*#__PURE__*/ _jsx(state.secondaryContent, {}),\n state.switchIndicator && /*#__PURE__*/ _jsx(state.switchIndicator, {})\n ]\n });\n};\n"],"names":["renderMenuItemSwitch_unstable","state","assertSlots","_jsxs","root","children","icon","_jsx","content","secondaryContent","switchIndicator"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJ4B;gCACjB;AAGjB,MAAMA,gCAAgC,CAACC;IAC9CC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,gBAAK,EAACF,MAAMG,IAAI,EAAE;QACnCC,UAAU;YACNJ,MAAMK,IAAI,IAAI,WAAW,GAAGC,IAAAA,eAAI,EAACN,MAAMK,IAAI,EAAE,CAAC;YAC9CL,MAAMO,OAAO,IAAI,WAAW,GAAGD,IAAAA,eAAI,EAACN,MAAMO,OAAO,EAAE,CAAC;YACpDP,MAAMQ,gBAAgB,IAAI,WAAW,GAAGF,IAAAA,eAAI,EAACN,MAAMQ,gBAAgB,EAAE,CAAC;YACtER,MAAMS,eAAe,IAAI,WAAW,GAAGH,IAAAA,eAAI,EAACN,MAAMS,eAAe,EAAE,CAAC;SACvE;IACL;AACJ"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useMenuItemSwitch_unstable", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useMenuItemSwitch_unstable;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reactutilities = require("@fluentui/react-utilities");
14
+ const _useMenuItemCheckbox = require("../MenuItemCheckbox/useMenuItemCheckbox");
15
+ const _reacticons = require("@fluentui/react-icons");
16
+ const _useMenuItemSwitchStylesstyles = require("./useMenuItemSwitchStyles.styles");
17
+ const useMenuItemSwitch_unstable = (props, ref)=>{
18
+ const baseState = (0, _useMenuItemCheckbox.useMenuItemCheckbox_unstable)(props, ref);
19
+ return {
20
+ ...baseState,
21
+ switchIndicator: _reactutilities.slot.optional(props.switchIndicator, {
22
+ renderByDefault: true,
23
+ elementType: 'span',
24
+ defaultProps: {
25
+ children: /*#__PURE__*/ _react.createElement(_reacticons.CircleFilled, {
26
+ className: _useMenuItemSwitchStylesstyles.circleFilledClassName
27
+ })
28
+ }
29
+ }),
30
+ components: {
31
+ ...baseState.components,
32
+ switchIndicator: 'span'
33
+ }
34
+ };
35
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useMenuItemSwitch.js"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { useMenuItemCheckbox_unstable } from '../MenuItemCheckbox/useMenuItemCheckbox';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { circleFilledClassName } from './useMenuItemSwitchStyles.styles';\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 */ export const useMenuItemSwitch_unstable = (props, ref)=>{\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: /*#__PURE__*/ React.createElement(CircleFilled, {\n className: circleFilledClassName\n })\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"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;gCACF;qCACwB;4BAChB;+CACS;AAS3B,MAAMA,6BAA6B,CAACC,OAAOC;IAClD,MAAMC,YAAYC,IAAAA,iDAA4B,EAACH,OAAOC;IACtD,OAAO;QACH,GAAGC,SAAS;QACZE,iBAAiBC,oBAAI,CAACC,QAAQ,CAACN,MAAMI,eAAe,EAAE;YAClDG,iBAAiB;YACjBC,aAAa;YACbC,cAAc;gBACVC,UAAU,WAAW,GAAGC,OAAMC,aAAa,CAACC,wBAAY,EAAE;oBACtDC,WAAWC,oDAAqB;gBACpC;YACJ;QACJ;QACAC,YAAY;YACR,GAAGd,UAAUc,UAAU;YACvBZ,iBAAiB;QACrB;IACJ;AACJ"}
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ menuItemSwitchClassNames: function() {
13
+ return menuItemSwitchClassNames;
14
+ },
15
+ circleFilledClassName: function() {
16
+ return circleFilledClassName;
17
+ },
18
+ useMenuItemSwitchStyles_unstable: function() {
19
+ return useMenuItemSwitchStyles_unstable;
20
+ }
21
+ });
22
+ const _react = require("@griffel/react");
23
+ const _useMenuItemStylesstyles = require("../MenuItem/useMenuItemStyles.styles");
24
+ const menuItemSwitchClassNames = {
25
+ root: 'fui-MenuItemSwitch',
26
+ icon: 'fui-MenuItemSwitch__icon',
27
+ content: 'fui-MenuItemSwitch__content',
28
+ secondaryContent: 'fui-MenuItemSwitch__secondaryContent',
29
+ switchIndicator: 'fui-MenuItemSwitch__switchIndicator'
30
+ };
31
+ const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';
32
+ // Thumb and track sizes used by the component.
33
+ const spaceBetweenThumbAndTrack = 2;
34
+ const trackHeight = 20;
35
+ const trackWidth = 40;
36
+ const thumbSize = trackHeight - spaceBetweenThumbAndTrack;
37
+ const useSwitchIndicatorBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1x31n8g", "rsmcm5v", {
38
+ r: [
39
+ ".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);}",
40
+ ".r1x31n8g:hover{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}",
41
+ ".r1x31n8g:hover:active{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}",
42
+ ".r1x31n8g .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:transform;}",
43
+ ".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);}",
44
+ ".rsmcm5v:hover{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}",
45
+ ".rsmcm5v:hover:active{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}",
46
+ ".rsmcm5v .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:transform;}"
47
+ ],
48
+ s: [
49
+ "@media screen and (prefers-reduced-motion: reduce){.r1x31n8g{transition-duration:0.01ms;}}",
50
+ "@media screen and (prefers-reduced-motion: reduce){.r1x31n8g .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:0.01ms;}}",
51
+ "@media screen and (prefers-reduced-motion: reduce){.rsmcm5v{transition-duration:0.01ms;}}",
52
+ "@media screen and (prefers-reduced-motion: reduce){.rsmcm5v .fui-MenuItemSwitch__switchIndicator__circleFilled{transition-duration:0.01ms;}}"
53
+ ]
54
+ });
55
+ const useSwitchIndicatorStyles = /*#__PURE__*/ (0, _react.__styles)({
56
+ checked: {
57
+ G4r02d: [
58
+ "fdca5i2",
59
+ "fk0rr1z"
60
+ ],
61
+ De3pzq: "ftywsgz",
62
+ sj55zd: "fqpbvvt",
63
+ g2u3we: "fghlq4f",
64
+ h3c5rm: [
65
+ "f1gn591s",
66
+ "fjscplz"
67
+ ],
68
+ B9xav0g: "fb073pr",
69
+ zhjwy3: [
70
+ "fjscplz",
71
+ "f1gn591s"
72
+ ],
73
+ Bi91k9c: "fz46y8r",
74
+ Jwef8y: "f1kjrvvj",
75
+ Bgoe8wy: "fpa59ij",
76
+ Bwzppfd: [
77
+ "f1rhln42",
78
+ "f1l1ogpg"
79
+ ],
80
+ oetu4i: "fz67qlh",
81
+ gg5e9n: [
82
+ "f1l1ogpg",
83
+ "f1rhln42"
84
+ ],
85
+ B2d53fq: "frlnr8d",
86
+ iro3zm: "fle2s0s",
87
+ b661bw: "f1j8ziw4",
88
+ Bk6r4ia: [
89
+ "f1xzu9i0",
90
+ "f1jlpvxk"
91
+ ],
92
+ B9zn80p: "f1i1ccxp",
93
+ Bpld233: [
94
+ "f1jlpvxk",
95
+ "f1xzu9i0"
96
+ ]
97
+ }
98
+ }, {
99
+ d: [
100
+ ".fdca5i2 .fui-MenuItemSwitch__switchIndicator__circleFilled{transform:translateX(20px);}",
101
+ ".fk0rr1z .fui-MenuItemSwitch__switchIndicator__circleFilled{transform:translateX(-20px);}",
102
+ ".ftywsgz{background-color:var(--colorCompoundBrandBackground);}",
103
+ ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}",
104
+ ".fghlq4f{border-top-color:var(--colorTransparentStroke);}",
105
+ ".f1gn591s{border-right-color:var(--colorTransparentStroke);}",
106
+ ".fjscplz{border-left-color:var(--colorTransparentStroke);}",
107
+ ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}"
108
+ ],
109
+ h: [
110
+ ".fz46y8r:hover{color:var(--colorNeutralForegroundInverted);}",
111
+ ".f1kjrvvj:hover{background-color:var(--colorCompoundBrandBackgroundHover);}",
112
+ ".fpa59ij:hover{border-top-color:var(--colorTransparentStrokeInteractive);}",
113
+ ".f1rhln42:hover{border-right-color:var(--colorTransparentStrokeInteractive);}",
114
+ ".f1l1ogpg:hover{border-left-color:var(--colorTransparentStrokeInteractive);}",
115
+ ".fz67qlh:hover{border-bottom-color:var(--colorTransparentStrokeInteractive);}",
116
+ ".frlnr8d:hover:active{color:var(--colorNeutralForegroundInverted);}",
117
+ ".fle2s0s:hover:active{background-color:var(--colorCompoundBrandBackgroundPressed);}",
118
+ ".f1j8ziw4:hover:active{border-top-color:var(--colorTransparentStrokeInteractive);}",
119
+ ".f1xzu9i0:hover:active{border-right-color:var(--colorTransparentStrokeInteractive);}",
120
+ ".f1jlpvxk:hover:active{border-left-color:var(--colorTransparentStrokeInteractive);}",
121
+ ".f1i1ccxp:hover:active{border-bottom-color:var(--colorTransparentStrokeInteractive);}"
122
+ ]
123
+ });
124
+ const useMenuItemSwitchStyles_unstable = (state)=>{
125
+ const { checked } = state;
126
+ const switchIndicatorStyles = useSwitchIndicatorStyles();
127
+ const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();
128
+ state.root.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.root, state.root.className);
129
+ if (state.content) {
130
+ state.content.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.content, state.content.className);
131
+ }
132
+ if (state.secondaryContent) {
133
+ state.secondaryContent.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);
134
+ }
135
+ if (state.icon) {
136
+ state.icon.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.icon, state.icon.className);
137
+ }
138
+ if (state.switchIndicator) {
139
+ state.switchIndicator.className = (0, _react.mergeClasses)(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, state.switchIndicator.className);
140
+ }
141
+ (0, _useMenuItemStylesstyles.useMenuItemStyles_unstable)({
142
+ ...state,
143
+ components: {
144
+ ...state.components,
145
+ checkmark: 'span',
146
+ submenuIndicator: 'span'
147
+ },
148
+ checkmark: undefined,
149
+ submenuIndicator: undefined,
150
+ hasSubmenu: false,
151
+ persistOnClick: true
152
+ });
153
+ return state;
154
+ }; //# sourceMappingURL=useMenuItemSwitchStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useMenuItemSwitchStyles.styles.js"],"sourcesContent":["import { __styles, __resetStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles.styles';\nexport const menuItemSwitchClassNames = {\n root: 'fui-MenuItemSwitch',\n icon: 'fui-MenuItemSwitch__icon',\n content: 'fui-MenuItemSwitch__content',\n secondaryContent: 'fui-MenuItemSwitch__secondaryContent',\n switchIndicator: 'fui-MenuItemSwitch__switchIndicator'\n};\nexport const circleFilledClassName = 'fui-MenuItemSwitch__switchIndicator__circleFilled';\n// Thumb and track sizes used by the component.\nconst spaceBetweenThumbAndTrack = 2;\nconst trackHeight = 20;\nconst trackWidth = 40;\nconst thumbSize = trackHeight - spaceBetweenThumbAndTrack;\nconst useSwitchIndicatorBaseClassName = /*#__PURE__*/__resetStyles(\"r1x31n8g\", \"rsmcm5v\", {\n 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;}\"],\n 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;}}\"]\n});\nconst useSwitchIndicatorStyles = /*#__PURE__*/__styles({\n checked: {\n G4r02d: [\"fdca5i2\", \"fk0rr1z\"],\n De3pzq: \"ftywsgz\",\n sj55zd: \"fqpbvvt\",\n g2u3we: \"fghlq4f\",\n h3c5rm: [\"f1gn591s\", \"fjscplz\"],\n B9xav0g: \"fb073pr\",\n zhjwy3: [\"fjscplz\", \"f1gn591s\"],\n Bi91k9c: \"fz46y8r\",\n Jwef8y: \"f1kjrvvj\",\n Bgoe8wy: \"fpa59ij\",\n Bwzppfd: [\"f1rhln42\", \"f1l1ogpg\"],\n oetu4i: \"fz67qlh\",\n gg5e9n: [\"f1l1ogpg\", \"f1rhln42\"],\n B2d53fq: \"frlnr8d\",\n iro3zm: \"fle2s0s\",\n b661bw: \"f1j8ziw4\",\n Bk6r4ia: [\"f1xzu9i0\", \"f1jlpvxk\"],\n B9zn80p: \"f1i1ccxp\",\n Bpld233: [\"f1jlpvxk\", \"f1xzu9i0\"]\n }\n}, {\n 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);}\"],\n 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);}\"]\n});\n/**\n * Apply styling to the MenuItemSwitch slots based on the state\n */\nexport const useMenuItemSwitchStyles_unstable = state => {\n const {\n checked\n } = state;\n const switchIndicatorStyles = useSwitchIndicatorStyles();\n const switchIndicatorBaseStyles = useSwitchIndicatorBaseClassName();\n state.root.className = mergeClasses(menuItemSwitchClassNames.root, state.root.className);\n if (state.content) {\n state.content.className = mergeClasses(menuItemSwitchClassNames.content, state.content.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(menuItemSwitchClassNames.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemSwitchClassNames.icon, state.icon.className);\n }\n if (state.switchIndicator) {\n state.switchIndicator.className = mergeClasses(menuItemSwitchClassNames.switchIndicator, switchIndicatorBaseStyles, checked && switchIndicatorStyles.checked, state.switchIndicator.className);\n }\n useMenuItemStyles_unstable({\n ...state,\n components: {\n ...state.components,\n checkmark: 'span',\n submenuIndicator: 'span'\n },\n checkmark: undefined,\n submenuIndicator: undefined,\n hasSubmenu: false,\n persistOnClick: true\n });\n return state;\n};\n//# sourceMappingURL=useMenuItemSwitchStyles.styles.js.map"],"names":["menuItemSwitchClassNames","circleFilledClassName","useMenuItemSwitchStyles_unstable","root","icon","content","secondaryContent","switchIndicator","spaceBetweenThumbAndTrack","trackHeight","trackWidth","thumbSize","useSwitchIndicatorBaseClassName","__resetStyles","r","s","useSwitchIndicatorStyles","__styles","checked","G4r02d","De3pzq","sj55zd","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bi91k9c","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","B2d53fq","iro3zm","b661bw","Bk6r4ia","B9zn80p","Bpld233","d","h","state","switchIndicatorStyles","switchIndicatorBaseStyles","className","mergeClasses","useMenuItemStyles_unstable","components","checkmark","submenuIndicator","undefined","hasSubmenu","persistOnClick"],"mappings":";;;;;;;;;;;IAGaA,wBAAwB;eAAxBA;;IAOAC,qBAAqB;eAArBA;;IAuCAC,gCAAgC;eAAhCA;;;uBAjDqD;yCAEvB;AACpC,MAAMF,2BAA2B;IACtCG,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,kBAAkB;IAClBC,iBAAiB;AACnB;AACO,MAAMN,wBAAwB;AACrC,+CAA+C;AAC/C,MAAMO,4BAA4B;AAClC,MAAMC,cAAc;AACpB,MAAMC,aAAa;AACnB,MAAMC,YAAYF,cAAcD;AAChC,MAAMI,kCAAkC,WAAW,GAAEC,IAAAA,oBAAa,EAAC,YAAY,WAAW;IACxFC,GAAG;QAAC;QAAmc;QAA0H;QAAqI;QAA0L;QAAic;QAAyH;QAAoI;KAAwL;IACtvDC,GAAG;QAAC;QAA8F;QAAiJ;QAA6F;KAA+I;AACje;AACA,MAAMC,2BAA2B,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACrDC,SAAS;QACPC,QAAQ;YAAC;YAAW;SAAU;QAC9BC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAU;QAC/BC,SAAS;QACTC,QAAQ;YAAC;YAAW;SAAW;QAC/BC,SAAS;QACTC,QAAQ;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AyBO,eAAe,EAAEmC,2BAA2BxB,WAAWuB,sBAAsBvB,OAAO,EAAEsB,MAAMjC,eAAe,CAACoC,SAAS;IAC/L;IACAE,IAAAA,mDAA0B,EAAC;QACzB,GAAGL,KAAK;QACRM,YAAY;YACV,GAAGN,MAAMM,UAAU;YACnBC,WAAW;YACXC,kBAAkB;QACpB;QACAD,WAAWE;QACXD,kBAAkBC;QAClBC,YAAY;QACZC,gBAAgB;IAClB;IACA,OAAOX;AACT,GACA,0DAA0D"}
@@ -221,6 +221,21 @@ _export(exports, {
221
221
  },
222
222
  useOnMenuMouseEnter: function() {
223
223
  return _utils.useOnMenuMouseEnter;
224
+ },
225
+ MenuItemSwitch: function() {
226
+ return _MenuItemSwitch.MenuItemSwitch;
227
+ },
228
+ useMenuItemSwitch_unstable: function() {
229
+ return _MenuItemSwitch.useMenuItemSwitch_unstable;
230
+ },
231
+ useMenuItemSwitchStyles_unstable: function() {
232
+ return _MenuItemSwitch.useMenuItemSwitchStyles_unstable;
233
+ },
234
+ renderMenuItemSwitch_unstable: function() {
235
+ return _MenuItemSwitch.renderMenuItemSwitch_unstable;
236
+ },
237
+ menuItemSwitchClassNames: function() {
238
+ return _MenuItemSwitch.menuItemSwitchClassNames;
224
239
  }
225
240
  });
226
241
  const _menuContext = require("./contexts/menuContext");
@@ -241,3 +256,4 @@ const _MenuTrigger = require("./MenuTrigger");
241
256
  const _index = require("./selectable/index");
242
257
  const _MenuItemLink = require("./MenuItemLink");
243
258
  const _utils = require("./utils");
259
+ const _MenuItemSwitch = require("./MenuItemSwitch");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export { MenuProvider, useMenuContext_unstable } from './contexts/menuContext';\nexport { MenuTriggerContextProvider, useMenuTriggerContext_unstable } from './contexts/menuTriggerContext';\nexport { MenuGroupContextProvider, useMenuGroupContext_unstable } from './contexts/menuGroupContext';\nexport { MenuListProvider, useMenuListContext_unstable } from './contexts/menuListContext';\nexport { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenu_unstable } from './Menu';\nexport { MenuDivider, menuDividerClassNames, renderMenuDivider_unstable, useMenuDividerStyles_unstable, useMenuDivider_unstable } from './MenuDivider';\nexport { MenuGroup, menuGroupClassNames, renderMenuGroup_unstable, useMenuGroupContextValues_unstable, useMenuGroupStyles_unstable, useMenuGroup_unstable } from './MenuGroup';\nexport { MenuGroupHeader, menuGroupHeaderClassNames, renderMenuGroupHeader_unstable, useMenuGroupHeaderStyles_unstable, useMenuGroupHeader_unstable } from './MenuGroupHeader';\nexport { MenuItem, menuItemClassNames, renderMenuItem_unstable, useMenuItemStyles_unstable, useMenuItem_unstable } from './MenuItem';\nexport { MenuItemCheckbox, menuItemCheckboxClassNames, renderMenuItemCheckbox_unstable, useMenuItemCheckboxStyles_unstable, useMenuItemCheckbox_unstable } from './MenuItemCheckbox';\nexport { MenuItemRadio, menuItemRadioClassNames, renderMenuItemRadio_unstable, useMenuItemRadioStyles_unstable, useMenuItemRadio_unstable } from './MenuItemRadio';\nexport { MenuList, menuListClassNames, renderMenuList_unstable, useMenuListContextValues_unstable, useMenuListStyles_unstable, useMenuList_unstable } from './MenuList';\nexport { MenuPopover, menuPopoverClassNames, renderMenuPopover_unstable, useMenuPopoverStyles_unstable, useMenuPopover_unstable } from './MenuPopover';\nexport { MenuSplitGroup, menuSplitGroupClassNames, renderMenuSplitGroup_unstable, useMenuSplitGroupStyles_unstable, useMenuSplitGroup_unstable } from './MenuSplitGroup';\nexport { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from './MenuTrigger';\nexport { useCheckmarkStyles_unstable } from './selectable/index';\nexport { MenuItemLink, menuItemLinkClassNames, renderMenuItemLink_unstable, useMenuItemLinkStyles_unstable, useMenuItemLink_unstable } from './MenuItemLink';\nexport { MENU_ENTER_EVENT, dispatchMenuEnterEvent, useOnMenuMouseEnter } from './utils';\n"],"names":["MenuProvider","useMenuContext_unstable","MenuTriggerContextProvider","useMenuTriggerContext_unstable","MenuGroupContextProvider","useMenuGroupContext_unstable","MenuListProvider","useMenuListContext_unstable","Menu","renderMenu_unstable","useMenuContextValues_unstable","useMenu_unstable","MenuDivider","menuDividerClassNames","renderMenuDivider_unstable","useMenuDividerStyles_unstable","useMenuDivider_unstable","MenuGroup","menuGroupClassNames","renderMenuGroup_unstable","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","useMenuGroup_unstable","MenuGroupHeader","menuGroupHeaderClassNames","renderMenuGroupHeader_unstable","useMenuGroupHeaderStyles_unstable","useMenuGroupHeader_unstable","MenuItem","menuItemClassNames","renderMenuItem_unstable","useMenuItemStyles_unstable","useMenuItem_unstable","MenuItemCheckbox","menuItemCheckboxClassNames","renderMenuItemCheckbox_unstable","useMenuItemCheckboxStyles_unstable","useMenuItemCheckbox_unstable","MenuItemRadio","menuItemRadioClassNames","renderMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","useMenuItemRadio_unstable","MenuList","menuListClassNames","renderMenuList_unstable","useMenuListContextValues_unstable","useMenuListStyles_unstable","useMenuList_unstable","MenuPopover","menuPopoverClassNames","renderMenuPopover_unstable","useMenuPopoverStyles_unstable","useMenuPopover_unstable","MenuSplitGroup","menuSplitGroupClassNames","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useMenuSplitGroup_unstable","MenuTrigger","renderMenuTrigger_unstable","useMenuTrigger_unstable","useCheckmarkStyles_unstable","MenuItemLink","menuItemLinkClassNames","renderMenuItemLink_unstable","useMenuItemLinkStyles_unstable","useMenuItemLink_unstable","MENU_ENTER_EVENT","dispatchMenuEnterEvent","useOnMenuMouseEnter"],"mappings":";;;;;;;;;;;IAASA,YAAY;eAAZA,yBAAY;;IAAEC,uBAAuB;eAAvBA,oCAAuB;;IACrCC,0BAA0B;eAA1BA,8CAA0B;;IAAEC,8BAA8B;eAA9BA,kDAA8B;;IAC1DC,wBAAwB;eAAxBA,0CAAwB;;IAAEC,4BAA4B;eAA5BA,8CAA4B;;IACtDC,gBAAgB;eAAhBA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kBAAkB;eAAlBA,4BAAkB;;IAAEC,uBAAuB;eAAvBA,iCAAuB;;IAAEC,iCAAiC;eAAjCA,2CAAiC;;IAAEC,0BAA0B;eAA1BA,oCAA0B;;IAAEC,oBAAoB;eAApBA,8BAAoB;;IAC1IC,WAAW;eAAXA,wBAAW;;IAAEC,qBAAqB;eAArBA,kCAAqB;;IAAEC,0BAA0B;eAA1BA,uCAA0B;;IAAEC,6BAA6B;eAA7BA,0CAA6B;;IAAEC,uBAAuB;eAAvBA,oCAAuB;;IACtHC,cAAc;eAAdA,8BAAc;;IAAEC,wBAAwB;eAAxBA,wCAAwB;;IAAEC,6BAA6B;eAA7BA,6CAA6B;;IAAEC,gCAAgC;eAAhCA,gDAAgC;;IAAEC,0BAA0B;eAA1BA,0CAA0B;;IACrIC,WAAW;eAAXA,wBAAW;;IAAEC,0BAA0B;eAA1BA,uCAA0B;;IAAEC,uBAAuB;eAAvBA,oCAAuB;;IAChEC,2BAA2B;eAA3BA,kCAA2B;;IAC3BC,YAAY;eAAZA,0BAAY;;IAAEC,sBAAsB;eAAtBA,oCAAsB;;IAAEC,2BAA2B;eAA3BA,yCAA2B;;IAAEC,8BAA8B;eAA9BA,4CAA8B;;IAAEC,wBAAwB;eAAxBA,sCAAwB;;IAC3HC,gBAAgB;eAAhBA,uBAAgB;;IAAEC,sBAAsB;eAAtBA,6BAAsB;;IAAEC,mBAAmB;eAAnBA,0BAAmB;;;6BAjBhB;oCACqB;kCACJ;iCACT;sBAC6B;6BAC4C;2BAC0B;iCACN;0BACnC;kCACwC;+BACf;0BACU;6BACpB;gCACe;6BACrE;uBACrC;8BACgG;uBAC9D"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export { MenuProvider, useMenuContext_unstable } from './contexts/menuContext';\nexport { MenuTriggerContextProvider, useMenuTriggerContext_unstable } from './contexts/menuTriggerContext';\nexport { MenuGroupContextProvider, useMenuGroupContext_unstable } from './contexts/menuGroupContext';\nexport { MenuListProvider, useMenuListContext_unstable } from './contexts/menuListContext';\nexport { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenu_unstable } from './Menu';\nexport { MenuDivider, menuDividerClassNames, renderMenuDivider_unstable, useMenuDividerStyles_unstable, useMenuDivider_unstable } from './MenuDivider';\nexport { MenuGroup, menuGroupClassNames, renderMenuGroup_unstable, useMenuGroupContextValues_unstable, useMenuGroupStyles_unstable, useMenuGroup_unstable } from './MenuGroup';\nexport { MenuGroupHeader, menuGroupHeaderClassNames, renderMenuGroupHeader_unstable, useMenuGroupHeaderStyles_unstable, useMenuGroupHeader_unstable } from './MenuGroupHeader';\nexport { MenuItem, menuItemClassNames, renderMenuItem_unstable, useMenuItemStyles_unstable, useMenuItem_unstable } from './MenuItem';\nexport { MenuItemCheckbox, menuItemCheckboxClassNames, renderMenuItemCheckbox_unstable, useMenuItemCheckboxStyles_unstable, useMenuItemCheckbox_unstable } from './MenuItemCheckbox';\nexport { MenuItemRadio, menuItemRadioClassNames, renderMenuItemRadio_unstable, useMenuItemRadioStyles_unstable, useMenuItemRadio_unstable } from './MenuItemRadio';\nexport { MenuList, menuListClassNames, renderMenuList_unstable, useMenuListContextValues_unstable, useMenuListStyles_unstable, useMenuList_unstable } from './MenuList';\nexport { MenuPopover, menuPopoverClassNames, renderMenuPopover_unstable, useMenuPopoverStyles_unstable, useMenuPopover_unstable } from './MenuPopover';\nexport { MenuSplitGroup, menuSplitGroupClassNames, renderMenuSplitGroup_unstable, useMenuSplitGroupStyles_unstable, useMenuSplitGroup_unstable } from './MenuSplitGroup';\nexport { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from './MenuTrigger';\nexport { useCheckmarkStyles_unstable } from './selectable/index';\nexport { MenuItemLink, menuItemLinkClassNames, renderMenuItemLink_unstable, useMenuItemLinkStyles_unstable, useMenuItemLink_unstable } from './MenuItemLink';\nexport { MENU_ENTER_EVENT, dispatchMenuEnterEvent, useOnMenuMouseEnter } from './utils';\nexport { MenuItemSwitch, useMenuItemSwitch_unstable, useMenuItemSwitchStyles_unstable, renderMenuItemSwitch_unstable, menuItemSwitchClassNames } from './MenuItemSwitch';\n"],"names":["MenuProvider","useMenuContext_unstable","MenuTriggerContextProvider","useMenuTriggerContext_unstable","MenuGroupContextProvider","useMenuGroupContext_unstable","MenuListProvider","useMenuListContext_unstable","Menu","renderMenu_unstable","useMenuContextValues_unstable","useMenu_unstable","MenuDivider","menuDividerClassNames","renderMenuDivider_unstable","useMenuDividerStyles_unstable","useMenuDivider_unstable","MenuGroup","menuGroupClassNames","renderMenuGroup_unstable","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","useMenuGroup_unstable","MenuGroupHeader","menuGroupHeaderClassNames","renderMenuGroupHeader_unstable","useMenuGroupHeaderStyles_unstable","useMenuGroupHeader_unstable","MenuItem","menuItemClassNames","renderMenuItem_unstable","useMenuItemStyles_unstable","useMenuItem_unstable","MenuItemCheckbox","menuItemCheckboxClassNames","renderMenuItemCheckbox_unstable","useMenuItemCheckboxStyles_unstable","useMenuItemCheckbox_unstable","MenuItemRadio","menuItemRadioClassNames","renderMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","useMenuItemRadio_unstable","MenuList","menuListClassNames","renderMenuList_unstable","useMenuListContextValues_unstable","useMenuListStyles_unstable","useMenuList_unstable","MenuPopover","menuPopoverClassNames","renderMenuPopover_unstable","useMenuPopoverStyles_unstable","useMenuPopover_unstable","MenuSplitGroup","menuSplitGroupClassNames","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useMenuSplitGroup_unstable","MenuTrigger","renderMenuTrigger_unstable","useMenuTrigger_unstable","useCheckmarkStyles_unstable","MenuItemLink","menuItemLinkClassNames","renderMenuItemLink_unstable","useMenuItemLinkStyles_unstable","useMenuItemLink_unstable","MENU_ENTER_EVENT","dispatchMenuEnterEvent","useOnMenuMouseEnter","MenuItemSwitch","useMenuItemSwitch_unstable","useMenuItemSwitchStyles_unstable","renderMenuItemSwitch_unstable","menuItemSwitchClassNames"],"mappings":";;;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BA,6CAA6B;;IAAEC,wBAAwB;eAAxBA,wCAAwB;;;6BAlBxF;oCACqB;kCACJ;iCACT;sBAC6B;6BAC4C;2BAC0B;iCACN;0BACnC;kCACwC;+BACf;0BACU;6BACpB;gCACe;6BACrE;uBACrC;8BACgG;uBAC9D;gCACwE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-menu",
3
- "version": "9.13.7",
3
+ "version": "9.14.0",
4
4
  "description": "Fluent UI menu component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -37,16 +37,16 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@fluentui/keyboard-keys": "^9.0.7",
40
- "@fluentui/react-aria": "^9.10.4",
41
- "@fluentui/react-context-selector": "^9.1.57",
40
+ "@fluentui/react-aria": "^9.10.5",
41
+ "@fluentui/react-context-selector": "^9.1.58",
42
42
  "@fluentui/react-icons": "^2.0.235",
43
- "@fluentui/react-portal": "^9.4.20",
44
- "@fluentui/react-positioning": "^9.14.3",
45
- "@fluentui/react-shared-contexts": "^9.16.0",
46
- "@fluentui/react-tabster": "^9.20.0",
43
+ "@fluentui/react-portal": "^9.4.21",
44
+ "@fluentui/react-positioning": "^9.14.4",
45
+ "@fluentui/react-shared-contexts": "^9.17.0",
46
+ "@fluentui/react-tabster": "^9.20.1",
47
47
  "@fluentui/react-theme": "^9.1.19",
48
- "@fluentui/react-utilities": "^9.18.6",
49
- "@fluentui/react-jsx-runtime": "^9.0.35",
48
+ "@fluentui/react-utilities": "^9.18.7",
49
+ "@fluentui/react-jsx-runtime": "^9.0.36",
50
50
  "@griffel/react": "^1.5.14",
51
51
  "@swc/helpers": "^0.5.1"
52
52
  },