@fluentui/react-overflow 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +27 -9
  2. package/lib/components/Overflow/Overflow.js.map +1 -1
  3. package/lib/components/Overflow/Overflow.module.css +13 -0
  4. package/lib/components/Overflow/Overflow.types.js.map +1 -1
  5. package/lib/components/Overflow/index.js.map +1 -1
  6. package/lib/components/Overflow/renderOverflow.js +1 -1
  7. package/lib/components/Overflow/renderOverflow.js.map +1 -1
  8. package/lib/components/Overflow/useOverflow.js.map +1 -1
  9. package/lib/components/Overflow/useOverflowStyles.styles.css.js +9 -0
  10. package/lib/components/Overflow/useOverflowStyles.styles.css.js.map +1 -0
  11. package/lib/components/Overflow/useOverflowStyles.styles.raw.css.js +9 -0
  12. package/lib/components/Overflow/useOverflowStyles.styles.raw.css.js.map +1 -0
  13. package/lib/components/Overflow/useOverflowStyles.styles.raw.js.map +1 -1
  14. package/lib/components/OverflowDivider/OverflowDivider.js.map +1 -1
  15. package/lib/components/OverflowDivider/OverflowDivider.types.js.map +1 -1
  16. package/lib/components/OverflowItem/OverflowItem.js.map +1 -1
  17. package/lib/components/OverflowItem/OverflowItem.types.js.map +1 -1
  18. package/lib/components/OverflowItem/index.js.map +1 -1
  19. package/lib/components/OverflowReorderObserver/OverflowReorderObserver.js.map +1 -1
  20. package/lib/components/OverflowReorderObserver/index.js.map +1 -1
  21. package/lib/overflowContext.js.map +1 -1
  22. package/lib/useOverflowContainer.js +4 -4
  23. package/lib/useOverflowContainer.js.map +1 -1
  24. package/lib/useOverflowItem.js.map +1 -1
  25. package/lib-commonjs/components/Overflow/Overflow.cjs.map +1 -1
  26. package/lib-commonjs/components/Overflow/Overflow.module.css +13 -0
  27. package/lib-commonjs/components/Overflow/Overflow.types.cjs.map +1 -1
  28. package/lib-commonjs/components/Overflow/index.cjs +5 -5
  29. package/lib-commonjs/components/Overflow/index.cjs.map +1 -1
  30. package/lib-commonjs/components/Overflow/renderOverflow.cjs +1 -1
  31. package/lib-commonjs/components/Overflow/renderOverflow.cjs.map +1 -1
  32. package/lib-commonjs/components/Overflow/useOverflow.cjs.map +1 -1
  33. package/lib-commonjs/components/Overflow/useOverflowStyles.styles.cjs +3 -3
  34. package/lib-commonjs/components/Overflow/useOverflowStyles.styles.cjs.map +1 -1
  35. package/lib-commonjs/components/Overflow/useOverflowStyles.styles.css.cjs +28 -0
  36. package/lib-commonjs/components/Overflow/useOverflowStyles.styles.css.cjs.map +1 -0
  37. package/lib-commonjs/components/Overflow/useOverflowStyles.styles.raw.cjs +3 -3
  38. package/lib-commonjs/components/Overflow/useOverflowStyles.styles.raw.cjs.map +1 -1
  39. package/lib-commonjs/components/Overflow/useOverflowStyles.styles.raw.css.cjs +28 -0
  40. package/lib-commonjs/components/Overflow/useOverflowStyles.styles.raw.css.cjs.map +1 -0
  41. package/lib-commonjs/components/OverflowDivider/OverflowDivider.cjs.map +1 -1
  42. package/lib-commonjs/components/OverflowDivider/OverflowDivider.types.cjs.map +1 -1
  43. package/lib-commonjs/components/OverflowItem/OverflowItem.cjs.map +1 -1
  44. package/lib-commonjs/components/OverflowItem/OverflowItem.types.cjs.map +1 -1
  45. package/lib-commonjs/components/OverflowItem/index.cjs.map +1 -1
  46. package/lib-commonjs/components/OverflowReorderObserver/OverflowReorderObserver.cjs.map +1 -1
  47. package/lib-commonjs/components/OverflowReorderObserver/index.cjs.map +1 -1
  48. package/lib-commonjs/constants.cjs +5 -5
  49. package/lib-commonjs/constants.cjs.map +1 -1
  50. package/lib-commonjs/index.cjs +23 -23
  51. package/lib-commonjs/index.cjs.map +1 -1
  52. package/lib-commonjs/overflowContext.cjs +4 -4
  53. package/lib-commonjs/overflowContext.cjs.map +1 -1
  54. package/lib-commonjs/useOverflowContainer.cjs +7 -7
  55. package/lib-commonjs/useOverflowContainer.cjs.map +1 -1
  56. package/lib-commonjs/useOverflowItem.cjs.map +1 -1
  57. package/package.json +12 -12
  58. package/dist/metadata/api/api-root.json +0 -1
  59. package/dist/metadata/index.json +0 -1
package/CHANGELOG.md CHANGED
@@ -1,21 +1,39 @@
1
1
  # Change Log - @fluentui/react-overflow
2
2
 
3
- <!-- This log was last generated on Tue, 06 Oct 2026 11:40:27 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Sat, 31 Oct 2026 11:08:50 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.74.7-experimental.cli-api.20261006-ccaa611d58.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-overflow_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
7
+ ## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-overflow_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
8
8
 
9
- Tue, 06 Oct 2026 11:40:27 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-overflow_v9.9.3..@fluentui/react-overflow_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
9
+ Sat, 31 Oct 2026 11:08:50 GMT
11
10
 
12
11
  ### Changes
13
12
 
14
- - Release 9.74.7-experimental.cli-api.20261006-ccaa611d58 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
15
- - Bump @fluentui/priority-overflow to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
- - Bump @fluentui/react-shared-contexts to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
- - Bump @fluentui/react-theme to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
- - Bump @fluentui/react-utilities to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
13
+ - Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
14
+ - Bump @fluentui/priority-overflow to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
+ - Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+ - Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
+ - Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
+
19
+ ## [9.9.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-overflow_v9.9.5)
20
+
21
+ Mon, 19 Oct 2026 16:49:01 GMT
22
+
23
+ ### Patches
24
+
25
+ - Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
26
+
27
+ ## [9.9.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-overflow_v9.9.4)
28
+
29
+ Tue, 22 Sep 2026 11:25:39 GMT
30
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-overflow_v9.9.3..@fluentui/react-overflow_v9.9.4)
31
+
32
+ ### Patches
33
+
34
+ - fix: remove unused react-dom and @types/react-dom peer dependencies, mark @types/react as optional ([PR #36559](https://github.com/microsoft/fluentui/pull/36559) by martinhochel@microsoft.com)
35
+ - Bump @fluentui/react-shared-contexts to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
36
+ - Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
37
 
20
38
  ## [9.9.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-overflow_v9.9.3)
21
39
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/Overflow.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { OverflowProps } from './Overflow.types';\nimport { useOverflow_unstable } from './useOverflow';\nimport { useOverflowContextValues_unstable } from '../../useOverflowContextValues';\nimport { useOverflowStyles_unstable } from './useOverflowStyles.styles';\nimport { renderOverflow_unstable } from './renderOverflow';\n\n/**\n * Provides an OverflowContext for OverflowItem descendants.\n */\nexport const Overflow = React.forwardRef((props: OverflowProps, ref) => {\n const state = useOverflow_unstable(props, ref as React.Ref<HTMLElement>);\n const contextValues = useOverflowContextValues_unstable(state);\n\n useOverflowStyles_unstable(state);\n\n return renderOverflow_unstable(state, contextValues);\n});\n"],"names":["React","useOverflow_unstable","useOverflowContextValues_unstable","useOverflowStyles_unstable","renderOverflow_unstable","Overflow","forwardRef","props","ref","state","contextValues"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iCAAiC,QAAQ,oCAAiC;AACnF,SAASC,0BAA0B,QAAQ,gCAA6B;AACxE,SAASC,uBAAuB,QAAQ,sBAAmB;AAE3D;;CAEC,GACD,OAAO,MAAMC,yBAAWL,MAAMM,UAAU,CAAC,CAACC,OAAsBC;IAC9D,MAAMC,QAAQR,qBAAqBM,OAAOC;IAC1C,MAAME,gBAAgBR,kCAAkCO;IAExDN,2BAA2BM;IAE3B,OAAOL,wBAAwBK,OAAOC;AACxC,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/Overflow.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { OverflowProps } from './Overflow.types';\nimport { useOverflow_unstable } from './useOverflow';\nimport { useOverflowContextValues_unstable } from '../../useOverflowContextValues';\nimport { useOverflowStyles_unstable } from './useOverflowStyles.styles';\nimport { renderOverflow_unstable } from './renderOverflow';\n\n/**\n * Provides an OverflowContext for OverflowItem descendants.\n */\nexport const Overflow = React.forwardRef((props: OverflowProps, ref) => {\n const state = useOverflow_unstable(props, ref as React.Ref<HTMLElement>);\n const contextValues = useOverflowContextValues_unstable(state);\n\n useOverflowStyles_unstable(state);\n\n return renderOverflow_unstable(state, contextValues);\n});\n"],"names":["React","useOverflow_unstable","useOverflowContextValues_unstable","useOverflowStyles_unstable","renderOverflow_unstable","Overflow","forwardRef","props","ref","state","contextValues"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iCAAiC,QAAQ,oCAAiC;AACnF,SAASC,0BAA0B,QAAQ,gCAA6B;AACxE,SAASC,uBAAuB,QAAQ,sBAAmB;AAE3D;;CAEC,GACD,OAAO,MAAMC,yBAAWL,MAAMM,UAAU,CAAC,CAACC,OAAsBC;IAC9D,MAAMC,QAAQR,qBAAqBM,OAAOC;IAC1C,MAAME,gBAAgBR,kCAAkCO;IAExDN,2BAA2BM;IAE3B,OAAOL,wBAAwBK,OAAOC;AACxC,GAAG"}
@@ -0,0 +1,13 @@
1
+ @layer fluentui {
2
+ .overflowMenu {
3
+ [data-overflow-menu] {
4
+ flex-shrink: 0;
5
+ }
6
+ }
7
+
8
+ .overflowingItems {
9
+ [data-overflowing] {
10
+ display: none;
11
+ }
12
+ }
13
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/Overflow.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { OverflowOptions, OverflowGroupState } from '@fluentui/priority-overflow';\nimport type { OverflowContextValue } from '../../overflowContext';\nimport type { UseOverflowContainerReturn } from '../../types';\n\nexport interface OverflowState {\n hasOverflow: boolean;\n itemVisibility: Record<string, boolean>;\n groupVisibility: Record<string, OverflowGroupState>;\n}\n\nexport interface OnOverflowChangeData extends OverflowState {}\n\nexport type OverflowProps = Partial<\n Pick<OverflowOptions, 'overflowAxis' | 'overflowDirection' | 'padding' | 'minimumVisible' | 'hasHiddenItems'>\n> & {\n children: React.ReactElement;\n\n // overflow is not caused by DOM event\n // eslint-disable-next-line @nx/workspace-consistent-callback-type\n onOverflowChange?: (ev: null, data: OverflowState) => void;\n};\n\n/**\n * State used in rendering Overflow. Carries the overflow container's registration api so\n * `useOverflowContextValues_unstable` can assemble the context values.\n */\nexport type OverflowComponentState = UseOverflowContainerReturn<HTMLElement> & {\n /**\n * Merged ref applied to the cloned child's root element.\n */\n ref: React.Ref<HTMLElement>;\n /**\n * Class name applied to the cloned child. Set by `useOverflowStyles_unstable`; left `undefined`\n * by headless consumers that apply no styling.\n */\n className?: string;\n /**\n * The single child that overflow behavior is attached to.\n */\n children: React.ReactElement;\n};\n\n/**\n * Context values provided to overflow descendants.\n */\nexport type OverflowContextValues = {\n overflow: OverflowContextValue;\n};\n"],"names":[],"mappings":"AA2CA;;CAEC,GACD,WAEE"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/Overflow.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { OverflowOptions, OverflowGroupState } from '@fluentui/priority-overflow';\nimport type { OverflowContextValue } from '../../overflowContext';\nimport type { UseOverflowContainerReturn } from '../../types';\n\nexport interface OverflowState {\n hasOverflow: boolean;\n itemVisibility: Record<string, boolean>;\n groupVisibility: Record<string, OverflowGroupState>;\n}\n\nexport interface OnOverflowChangeData extends OverflowState {}\n\nexport type OverflowProps = Partial<\n Pick<OverflowOptions, 'overflowAxis' | 'overflowDirection' | 'padding' | 'minimumVisible' | 'hasHiddenItems'>\n> & {\n children: React.ReactElement;\n\n // overflow is not caused by DOM event\n // eslint-disable-next-line @nx/workspace-consistent-callback-type\n onOverflowChange?: (ev: null, data: OverflowState) => void;\n};\n\n/**\n * State used in rendering Overflow. Carries the overflow container's registration api so\n * `useOverflowContextValues_unstable` can assemble the context values.\n */\nexport type OverflowComponentState = UseOverflowContainerReturn<HTMLElement> & {\n /**\n * Merged ref applied to the cloned child's root element.\n */\n ref: React.Ref<HTMLElement>;\n /**\n * Class name applied to the cloned child. Set by `useOverflowStyles_unstable`; left `undefined`\n * by headless consumers that apply no styling.\n */\n className?: string;\n /**\n * The single child that overflow behavior is attached to.\n */\n children: React.ReactElement;\n};\n\n/**\n * Context values provided to overflow descendants.\n */\nexport type OverflowContextValues = {\n overflow: OverflowContextValue;\n};\n"],"names":[],"mappings":"AA2CA;;CAEC,GACD,WAEE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/index.ts"],"sourcesContent":["export { Overflow } from './Overflow';\nexport { useOverflow_unstable } from './useOverflow';\nexport { renderOverflow_unstable } from './renderOverflow';\nexport { useOverflowStyles_unstable } from './useOverflowStyles.styles';\nexport type {\n OverflowProps,\n OnOverflowChangeData,\n OverflowState,\n OverflowComponentState,\n OverflowContextValues,\n} from './Overflow.types';\n"],"names":["Overflow","useOverflow_unstable","renderOverflow_unstable","useOverflowStyles_unstable"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAa;AACtC,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,gCAA6B"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/index.ts"],"sourcesContent":["export { Overflow } from './Overflow';\nexport { useOverflow_unstable } from './useOverflow';\nexport { renderOverflow_unstable } from './renderOverflow';\nexport { useOverflowStyles_unstable } from './useOverflowStyles.styles';\nexport type {\n OverflowProps,\n OnOverflowChangeData,\n OverflowState,\n OverflowComponentState,\n OverflowContextValues,\n} from './Overflow.types';\n"],"names":["Overflow","useOverflow_unstable","renderOverflow_unstable","useOverflowStyles_unstable"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAa;AACtC,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,gCAA6B"}
@@ -7,8 +7,8 @@ import { OverflowContext } from "../../overflowContext.js";
7
7
  * Griffel-free so it can be reused by headless consumers; all class merging happens in
8
8
  * `useOverflowStyles_unstable`.
9
9
  */ export const renderOverflow_unstable = (state, contextValues)=>{
10
- const child = getTriggerChild(state.children);
11
10
  var _state_className;
11
+ const child = getTriggerChild(state.children);
12
12
  const clonedChild = applyTriggerPropsToChildren(state.children, {
13
13
  ref: state.ref,
14
14
  className: (_state_className = state.className) !== null && _state_className !== void 0 ? _state_className : child === null || child === void 0 ? void 0 : child.props.className
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/renderOverflow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild } from '@fluentui/react-utilities';\nimport { OverflowContext } from '../../overflowContext';\nimport type { OverflowComponentState, OverflowContextValues } from './Overflow.types';\n\n/**\n * Render the final JSX of Overflow.\n *\n * Griffel-free so it can be reused by headless consumers; all class merging happens in\n * `useOverflowStyles_unstable`.\n */\nexport const renderOverflow_unstable = (\n state: OverflowComponentState,\n contextValues: OverflowContextValues,\n): React.ReactElement => {\n const child = getTriggerChild<HTMLElement>(state.children);\n\n const clonedChild = applyTriggerPropsToChildren(state.children, {\n ref: state.ref,\n className: state.className ?? child?.props.className,\n });\n\n return <OverflowContext.Provider value={contextValues.overflow}>{clonedChild}</OverflowContext.Provider>;\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","OverflowContext","renderOverflow_unstable","state","contextValues","child","children","clonedChild","ref","className","props","Provider","value","overflow"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,eAAe,QAAQ,4BAA4B;AACzF,SAASC,eAAe,QAAQ,2BAAwB;AAGxD;;;;;CAKC,GACD,OAAO,MAAMC,0BAA0B,CACrCC,OACAC;IAEA,MAAMC,QAAQL,gBAA6BG,MAAMG,QAAQ;QAI5CH;IAFb,MAAMI,cAAcR,4BAA4BI,MAAMG,QAAQ,EAAE;QAC9DE,KAAKL,MAAMK,GAAG;QACdC,WAAWN,CAAAA,mBAAAA,MAAMM,SAAS,cAAfN,8BAAAA,mBAAmBE,kBAAAA,4BAAAA,MAAOK,KAAK,CAACD,SAAS;IACtD;IAEA,qBAAO,oBAACR,gBAAgBU,QAAQ;QAACC,OAAOR,cAAcS,QAAQ;OAAGN;AACnE,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/renderOverflow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild } from '@fluentui/react-utilities';\nimport { OverflowContext } from '../../overflowContext';\nimport type { OverflowComponentState, OverflowContextValues } from './Overflow.types';\n\n/**\n * Render the final JSX of Overflow.\n *\n * Griffel-free so it can be reused by headless consumers; all class merging happens in\n * `useOverflowStyles_unstable`.\n */\nexport const renderOverflow_unstable = (\n state: OverflowComponentState,\n contextValues: OverflowContextValues,\n): React.ReactElement => {\n const child = getTriggerChild<HTMLElement>(state.children);\n\n const clonedChild = applyTriggerPropsToChildren(state.children, {\n ref: state.ref,\n className: state.className ?? child?.props.className,\n });\n\n return <OverflowContext.Provider value={contextValues.overflow}>{clonedChild}</OverflowContext.Provider>;\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","OverflowContext","renderOverflow_unstable","state","contextValues","child","children","clonedChild","ref","className","props","Provider","value","overflow"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,eAAe,QAAQ,4BAA4B;AACzF,SAASC,eAAe,QAAQ,2BAAwB;AAGxD;;;;;CAKC,GACD,OAAO,MAAMC,0BAA0B,CACrCC,OACAC;QAMaD;IAJb,MAAME,QAAQL,gBAA6BG,MAAMG,QAAQ;IAEzD,MAAMC,cAAcR,4BAA4BI,MAAMG,QAAQ,EAAE;QAC9DE,KAAKL,MAAMK,GAAG;QACdC,SAAS,GAAEN,mBAAAA,MAAMM,SAAS,cAAfN,8BAAAA,mBAAmBE,kBAAAA,4BAAAA,MAAOK,KAAK,CAACD,SAAS;IACtD;IAEA,qBAAO,oBAACR,gBAAgBU,QAAQ;QAACC,OAAOR,cAAcS,QAAQ;OAAGN;AACnE,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/useOverflow.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport type { OnUpdateOverflow } from '@fluentui/priority-overflow';\nimport { getTriggerChild, getReactElementRef, useMergedRefs, useEventCallback } from '@fluentui/react-utilities';\n\nimport { updateVisibilityAttribute, useOverflowContainer } from '../../useOverflowContainer';\nimport type { OverflowComponentState, OverflowProps, OverflowState } from './Overflow.types';\n\n/**\n * The state required to render Overflow.\n *\n * @param props - props from this instance of Overflow\n * @param ref - reference forwarded to the single child's root element\n */\nexport const useOverflow_unstable = (props: OverflowProps, ref: React.Ref<HTMLElement>): OverflowComponentState => {\n const {\n children,\n minimumVisible,\n overflowAxis = 'horizontal',\n overflowDirection,\n padding,\n onOverflowChange,\n hasHiddenItems,\n } = props;\n\n const update: OnUpdateOverflow = useEventCallback(() => {\n // eslint-disable-next-line react-hooks/immutability\n const snapshot = getSnapshot();\n const state: OverflowState = {\n hasOverflow: snapshot.invisibleItemCount > 0,\n itemVisibility: snapshot.itemVisibility,\n groupVisibility: snapshot.groupVisibility,\n };\n onOverflowChange?.(null, state);\n });\n\n const {\n containerRef,\n getSnapshot,\n subscribe,\n registerItem,\n updateOverflow,\n forceUpdateOverflow,\n registerOverflowMenu,\n registerDivider,\n } = useOverflowContainer(update, {\n overflowDirection,\n overflowAxis,\n padding,\n minimumVisible,\n hasHiddenItems,\n onUpdateItemVisibility: updateVisibilityAttribute,\n });\n\n const child = getTriggerChild<HTMLElement>(children);\n\n return {\n containerRef,\n getSnapshot,\n subscribe,\n registerItem,\n updateOverflow,\n forceUpdateOverflow,\n registerOverflowMenu,\n registerDivider,\n ref: useMergedRefs(containerRef, ref, getReactElementRef(child)),\n children,\n };\n};\n"],"names":["getTriggerChild","getReactElementRef","useMergedRefs","useEventCallback","updateVisibilityAttribute","useOverflowContainer","useOverflow_unstable","props","ref","children","minimumVisible","overflowAxis","overflowDirection","padding","onOverflowChange","hasHiddenItems","update","snapshot","getSnapshot","state","hasOverflow","invisibleItemCount","itemVisibility","groupVisibility","containerRef","subscribe","registerItem","updateOverflow","forceUpdateOverflow","registerOverflowMenu","registerDivider","onUpdateItemVisibility","child"],"mappings":"AAAA;AAIA,SAASA,eAAe,EAAEC,kBAAkB,EAAEC,aAAa,EAAEC,gBAAgB,QAAQ,4BAA4B;AAEjH,SAASC,yBAAyB,EAAEC,oBAAoB,QAAQ,gCAA6B;AAG7F;;;;;CAKC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAsBC;IACzD,MAAM,EACJC,QAAQ,EACRC,cAAc,EACdC,eAAe,YAAY,EAC3BC,iBAAiB,EACjBC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACf,GAAGR;IAEJ,MAAMS,SAA2Bb,iBAAiB;QAChD,oDAAoD;QACpD,MAAMc,WAAWC;QACjB,MAAMC,QAAuB;YAC3BC,aAAaH,SAASI,kBAAkB,GAAG;YAC3CC,gBAAgBL,SAASK,cAAc;YACvCC,iBAAiBN,SAASM,eAAe;QAC3C;QACAT,6BAAAA,uCAAAA,iBAAmB,MAAMK;IAC3B;IAEA,MAAM,EACJK,YAAY,EACZN,WAAW,EACXO,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,mBAAmB,EACnBC,oBAAoB,EACpBC,eAAe,EAChB,GAAGzB,qBAAqBW,QAAQ;QAC/BJ;QACAD;QACAE;QACAH;QACAK;QACAgB,wBAAwB3B;IAC1B;IAEA,MAAM4B,QAAQhC,gBAA6BS;IAE3C,OAAO;QACLe;QACAN;QACAO;QACAC;QACAC;QACAC;QACAC;QACAC;QACAtB,KAAKN,cAAcsB,cAAchB,KAAKP,mBAAmB+B;QACzDvB;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/useOverflow.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport type { OnUpdateOverflow } from '@fluentui/priority-overflow';\nimport { getTriggerChild, getReactElementRef, useMergedRefs, useEventCallback } from '@fluentui/react-utilities';\n\nimport { updateVisibilityAttribute, useOverflowContainer } from '../../useOverflowContainer';\nimport type { OverflowComponentState, OverflowProps, OverflowState } from './Overflow.types';\n\n/**\n * The state required to render Overflow.\n *\n * @param props - props from this instance of Overflow\n * @param ref - reference forwarded to the single child's root element\n */\nexport const useOverflow_unstable = (props: OverflowProps, ref: React.Ref<HTMLElement>): OverflowComponentState => {\n const {\n children,\n minimumVisible,\n overflowAxis = 'horizontal',\n overflowDirection,\n padding,\n onOverflowChange,\n hasHiddenItems,\n } = props;\n\n const update: OnUpdateOverflow = useEventCallback(() => {\n // eslint-disable-next-line react-hooks/immutability\n const snapshot = getSnapshot();\n const state: OverflowState = {\n hasOverflow: snapshot.invisibleItemCount > 0,\n itemVisibility: snapshot.itemVisibility,\n groupVisibility: snapshot.groupVisibility,\n };\n onOverflowChange?.(null, state);\n });\n\n const {\n containerRef,\n getSnapshot,\n subscribe,\n registerItem,\n updateOverflow,\n forceUpdateOverflow,\n registerOverflowMenu,\n registerDivider,\n } = useOverflowContainer(update, {\n overflowDirection,\n overflowAxis,\n padding,\n minimumVisible,\n hasHiddenItems,\n onUpdateItemVisibility: updateVisibilityAttribute,\n });\n\n const child = getTriggerChild<HTMLElement>(children);\n\n return {\n containerRef,\n getSnapshot,\n subscribe,\n registerItem,\n updateOverflow,\n forceUpdateOverflow,\n registerOverflowMenu,\n registerDivider,\n ref: useMergedRefs(containerRef, ref, getReactElementRef(child)),\n children,\n };\n};\n"],"names":["getTriggerChild","getReactElementRef","useMergedRefs","useEventCallback","updateVisibilityAttribute","useOverflowContainer","useOverflow_unstable","props","ref","children","minimumVisible","overflowAxis","overflowDirection","padding","onOverflowChange","hasHiddenItems","update","snapshot","getSnapshot","state","hasOverflow","invisibleItemCount","itemVisibility","groupVisibility","containerRef","subscribe","registerItem","updateOverflow","forceUpdateOverflow","registerOverflowMenu","registerDivider","onUpdateItemVisibility","child"],"mappings":"AAAA;AAIA,SAASA,eAAe,EAAEC,kBAAkB,EAAEC,aAAa,EAAEC,gBAAgB,QAAQ,4BAA4B;AAEjH,SAASC,yBAAyB,EAAEC,oBAAoB,QAAQ,gCAA6B;AAG7F;;;;;CAKC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAsBC;IACzD,MAAM,EACJC,QAAQ,EACRC,cAAc,EACdC,eAAe,YAAY,EAC3BC,iBAAiB,EACjBC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACf,GAAGR;IAEJ,MAAMS,SAA2Bb,iBAAiB;QAChD,oDAAoD;QACpD,MAAMc,WAAWC;QACjB,MAAMC,QAAuB;YAC3BC,aAAaH,SAASI,kBAAkB,GAAG;YAC3CC,gBAAgBL,SAASK,cAAc;YACvCC,iBAAiBN,SAASM,eAAe;QAC3C;QACAT,6BAAAA,uCAAAA,iBAAmB,MAAMK;IAC3B;IAEA,MAAM,EACJK,YAAY,EACZN,WAAW,EACXO,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,mBAAmB,EACnBC,oBAAoB,EACpBC,eAAe,EAChB,GAAGzB,qBAAqBW,QAAQ;QAC/BJ;QACAD;QACAE;QACAH;QACAK;QACAgB,wBAAwB3B;IAC1B;IAEA,MAAM4B,QAAQhC,gBAA6BS;IAE3C,OAAO;QACLe;QACAN;QACAO;QACAC;QACAC;QACAC;QACAC;QACAC;QACAtB,KAAKN,cAAcsB,cAAchB,KAAKP,mBAAmB+B;QACzDvB;IACF;AACF,EAAE"}
@@ -0,0 +1,9 @@
1
+ import { clsx } from "clsx";
2
+ import { getTriggerChild } from "@fluentui/react-utilities";
3
+ import styles from "./Overflow.module.css";
4
+ export const useOverflowStyles = ()=>styles;
5
+ export const useOverflowStyles_unstable = (state)=>{
6
+ const child = getTriggerChild(state.children);
7
+ state.className = clsx('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child === null || child === void 0 ? void 0 : child.props.className);
8
+ return state;
9
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Overflow/useOverflowStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport { getTriggerChild } from '@fluentui/react-utilities';\nimport styles from './Overflow.module.css';\nimport type { OverflowComponentState } from './Overflow.types';\n\nexport const useOverflowStyles = (): typeof styles => styles;\n\nexport const useOverflowStyles_unstable = (state: OverflowComponentState): OverflowComponentState => {\n const child = getTriggerChild<HTMLElement>(state.children);\n\n state.className = clsx('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child?.props.className);\n\n return state;\n};\n"],"names":["clsx","getTriggerChild","styles","useOverflowStyles","useOverflowStyles_unstable","state","child","children","className","overflowMenu","overflowingItems","props"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,OAAOC,YAAY,wBAAwB;AAG3C,OAAO,MAAMC,oBAAoB,IAAqBD,OAAO;AAE7D,OAAO,MAAME,6BAA6B,CAACC;IACzC,MAAMC,QAAQL,gBAA6BI,MAAME,QAAQ;IAEzDF,MAAMG,SAAS,GAAGR,KAAK,gBAAgBE,OAAOO,YAAY,EAAEP,OAAOQ,gBAAgB,EAAEJ,kBAAAA,4BAAAA,MAAOK,KAAK,CAACH,SAAS;IAE3G,OAAOH;AACT,EAAE"}
@@ -0,0 +1,9 @@
1
+ import { clsx } from "clsx";
2
+ import { getTriggerChild } from "@fluentui/react-utilities";
3
+ import styles from "./Overflow.module.css";
4
+ export const useOverflowStyles = ()=>styles;
5
+ export const useOverflowStyles_unstable = (state)=>{
6
+ const child = getTriggerChild(state.children);
7
+ state.className = clsx('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child === null || child === void 0 ? void 0 : child.props.className);
8
+ return state;
9
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Overflow/useOverflowStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport { getTriggerChild } from '@fluentui/react-utilities';\nimport styles from './Overflow.module.css';\nimport type { OverflowComponentState } from './Overflow.types';\n\nexport const useOverflowStyles = (): typeof styles => styles;\n\nexport const useOverflowStyles_unstable = (state: OverflowComponentState): OverflowComponentState => {\n const child = getTriggerChild<HTMLElement>(state.children);\n\n state.className = clsx('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child?.props.className);\n\n return state;\n};\n"],"names":["clsx","getTriggerChild","styles","useOverflowStyles","useOverflowStyles_unstable","state","child","children","className","overflowMenu","overflowingItems","props"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,OAAOC,YAAY,wBAAwB;AAG3C,OAAO,MAAMC,oBAAoB,IAAqBD,OAAO;AAE7D,OAAO,MAAME,6BAA6B,CAACC;IACzC,MAAMC,QAAQL,gBAA6BI,MAAME,QAAQ;IAEzDF,MAAMG,SAAS,GAAGR,KAAK,gBAAgBE,OAAOO,YAAY,EAAEP,OAAOQ,gBAAgB,EAAEJ,kBAAAA,4BAAAA,MAAOK,KAAK,CAACH,SAAS;IAE3G,OAAOH;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/useOverflowStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { getTriggerChild } from '@fluentui/react-utilities';\nimport { DATA_OVERFLOWING, DATA_OVERFLOW_MENU } from '../../constants';\nimport type { OverflowComponentState } from './Overflow.types';\n\nexport const useOverflowStyles = makeStyles({\n overflowMenu: {\n [`& [${DATA_OVERFLOW_MENU}]`]: {\n flexShrink: 0,\n },\n },\n\n overflowingItems: {\n [`& [${DATA_OVERFLOWING}]`]: {\n display: 'none',\n },\n },\n});\n\nexport const useOverflowStyles_unstable = (state: OverflowComponentState): OverflowComponentState => {\n const styles = useOverflowStyles();\n const child = getTriggerChild<HTMLElement>(state.children);\n\n // eslint-disable-next-line react-hooks/immutability\n state.className = mergeClasses('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child?.props.className);\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","getTriggerChild","DATA_OVERFLOWING","DATA_OVERFLOW_MENU","useOverflowStyles","overflowMenu","flexShrink","overflowingItems","display","useOverflowStyles_unstable","state","styles","child","children","className","props"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,qBAAkB;AAGvE,OAAO,MAAMC,oBAAoBL,WAAW;IAC1CM,cAAc;QACZ,CAAC,CAAC,GAAG,EAAEF,mBAAmB,CAAC,CAAC,CAAC,EAAE;YAC7BG,YAAY;QACd;IACF;IAEAC,kBAAkB;QAChB,CAAC,CAAC,GAAG,EAAEL,iBAAiB,CAAC,CAAC,CAAC,EAAE;YAC3BM,SAAS;QACX;IACF;AACF,GAAG;AAEH,OAAO,MAAMC,6BAA6B,CAACC;IACzC,MAAMC,SAASP;IACf,MAAMQ,QAAQX,gBAA6BS,MAAMG,QAAQ;IAEzD,oDAAoD;IACpDH,MAAMI,SAAS,GAAGd,aAAa,gBAAgBW,OAAON,YAAY,EAAEM,OAAOJ,gBAAgB,EAAEK,kBAAAA,4BAAAA,MAAOG,KAAK,CAACD,SAAS;IAEnH,OAAOJ;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/useOverflowStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { getTriggerChild } from '@fluentui/react-utilities';\nimport { DATA_OVERFLOWING, DATA_OVERFLOW_MENU } from '../../constants';\nimport type { OverflowComponentState } from './Overflow.types';\n\nexport const useOverflowStyles = makeStyles({\n overflowMenu: {\n [`& [${DATA_OVERFLOW_MENU}]`]: {\n flexShrink: 0,\n },\n },\n\n overflowingItems: {\n [`& [${DATA_OVERFLOWING}]`]: {\n display: 'none',\n },\n },\n});\n\nexport const useOverflowStyles_unstable = (state: OverflowComponentState): OverflowComponentState => {\n const styles = useOverflowStyles();\n const child = getTriggerChild<HTMLElement>(state.children);\n\n // eslint-disable-next-line react-hooks/immutability\n state.className = mergeClasses('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child?.props.className);\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","getTriggerChild","DATA_OVERFLOWING","DATA_OVERFLOW_MENU","useOverflowStyles","overflowMenu","flexShrink","overflowingItems","display","useOverflowStyles_unstable","state","styles","child","children","className","props"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,qBAAkB;AAGvE,OAAO,MAAMC,oBAAoBL,WAAW;IAC1CM,cAAc;QACZ,CAAC,CAAC,GAAG,EAAEF,mBAAmB,CAAC,CAAC,CAAC,EAAE;YAC7BG,YAAY;QACd;IACF;IAEAC,kBAAkB;QAChB,CAAC,CAAC,GAAG,EAAEL,iBAAiB,CAAC,CAAC,CAAC,EAAE;YAC3BM,SAAS;QACX;IACF;AACF,GAAG;AAEH,OAAO,MAAMC,6BAA6B,CAACC;IACzC,MAAMC,SAASP;IACf,MAAMQ,QAAQX,gBAA6BS,MAAMG,QAAQ;IAEzD,oDAAoD;IACpDH,MAAMI,SAAS,GAAGd,aAAa,gBAAgBW,OAAON,YAAY,EAAEM,OAAOJ,gBAAgB,EAAEK,kBAAAA,4BAAAA,MAAOG,KAAK,CAACD,SAAS;IAEnH,OAAOJ;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverflowDivider/OverflowDivider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { applyTriggerPropsToChildren, useMergedRefs } from '@fluentui/react-utilities';\nimport { useOverflowDivider } from '../../useOverflowDivider';\nimport type { OverflowDividerProps } from './OverflowDivider.types';\n\n/**\n * Attaches overflow item behavior to its child registered with the OverflowContext.\n * It does not render an element of its own.\n */\nexport const OverflowDivider = React.forwardRef((props: OverflowDividerProps, ref) => {\n const { groupId, children } = props;\n\n const containerRef = useOverflowDivider(groupId);\n return applyTriggerPropsToChildren(children, {\n ref: useMergedRefs(containerRef, ref),\n });\n});\n"],"names":["React","applyTriggerPropsToChildren","useMergedRefs","useOverflowDivider","OverflowDivider","forwardRef","props","ref","groupId","children","containerRef"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,aAAa,QAAQ,4BAA4B;AACvF,SAASC,kBAAkB,QAAQ,8BAA2B;AAG9D;;;CAGC,GACD,OAAO,MAAMC,gCAAkBJ,MAAMK,UAAU,CAAC,CAACC,OAA6BC;IAC5E,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGH;IAE9B,MAAMI,eAAeP,mBAAmBK;IACxC,OAAOP,4BAA4BQ,UAAU;QAC3CF,KAAKL,cAAcQ,cAAcH;IACnC;AACF,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/OverflowDivider/OverflowDivider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { applyTriggerPropsToChildren, useMergedRefs } from '@fluentui/react-utilities';\nimport { useOverflowDivider } from '../../useOverflowDivider';\nimport type { OverflowDividerProps } from './OverflowDivider.types';\n\n/**\n * Attaches overflow item behavior to its child registered with the OverflowContext.\n * It does not render an element of its own.\n */\nexport const OverflowDivider = React.forwardRef((props: OverflowDividerProps, ref) => {\n const { groupId, children } = props;\n\n const containerRef = useOverflowDivider(groupId);\n return applyTriggerPropsToChildren(children, {\n ref: useMergedRefs(containerRef, ref),\n });\n});\n"],"names":["React","applyTriggerPropsToChildren","useMergedRefs","useOverflowDivider","OverflowDivider","forwardRef","props","ref","groupId","children","containerRef"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,aAAa,QAAQ,4BAA4B;AACvF,SAASC,kBAAkB,QAAQ,8BAA2B;AAG9D;;;CAGC,GACD,OAAO,MAAMC,gCAAkBJ,MAAMK,UAAU,CAAC,CAACC,OAA6BC;IAC5E,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGH;IAE9B,MAAMI,eAAeP,mBAAmBK;IACxC,OAAOP,4BAA4BQ,UAAU;QAC3CF,KAAKL,cAAcQ,cAAcH;IACnC;AACF,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverflowDivider/OverflowDivider.types.ts"],"sourcesContent":["import type * as React from 'react';\n\n/**\n * OverflowDividerProps\n */\nexport type OverflowDividerProps = {\n /**\n * Assigns the item to a group, group visibility can be watched.\n */\n groupId: string;\n /**\n * The single child that has overflow item behavior attached.\n */\n children: React.ReactElement;\n};\n"],"names":[],"mappings":"AAEA;;CAEC,GACD,WASE"}
1
+ {"version":3,"sources":["../../../src/components/OverflowDivider/OverflowDivider.types.ts"],"sourcesContent":["import type * as React from 'react';\n\n/**\n * OverflowDividerProps\n */\nexport type OverflowDividerProps = {\n /**\n * Assigns the item to a group, group visibility can be watched.\n */\n groupId: string;\n /**\n * The single child that has overflow item behavior attached.\n */\n children: React.ReactElement;\n};\n"],"names":[],"mappings":"AAEA;;CAEC,GACD,WASE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverflowItem/OverflowItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getReactElementRef,\n type FluentTriggerComponent,\n getTriggerChild,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useOverflowItem } from '../../useOverflowItem';\nimport type { OverflowItemProps } from './OverflowItem.types';\n\n/**\n * Attaches overflow item behavior to its child registered with the OverflowContext.\n * It does not render an element of its own.\n *\n * Behaves similarly to other `*Trigger` components in Fluent UI React.\n */\nexport const OverflowItem = React.forwardRef((props: OverflowItemProps, ref) => {\n const { id, groupId, priority, pinned, children } = props;\n\n const containerRef = useOverflowItem(id, priority, groupId, pinned);\n const child = getTriggerChild(children);\n\n return applyTriggerPropsToChildren(children, {\n ref: useMergedRefs(containerRef, ref, getReactElementRef(child)),\n });\n});\n\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(OverflowItem as FluentTriggerComponent).isFluentTriggerComponent = true;\n"],"names":["React","applyTriggerPropsToChildren","getReactElementRef","getTriggerChild","useMergedRefs","useOverflowItem","OverflowItem","forwardRef","props","ref","id","groupId","priority","pinned","children","containerRef","child","isFluentTriggerComponent"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,2BAA2B,EAC3BC,kBAAkB,EAElBC,eAAe,EACfC,aAAa,QACR,4BAA4B;AACnC,SAASC,eAAe,QAAQ,2BAAwB;AAGxD;;;;;CAKC,GACD,OAAO,MAAMC,6BAAeN,MAAMO,UAAU,CAAC,CAACC,OAA0BC;IACtE,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGN;IAEpD,MAAMO,eAAeV,gBAAgBK,IAAIE,UAAUD,SAASE;IAC5D,MAAMG,QAAQb,gBAAgBW;IAE9B,OAAOb,4BAA4Ba,UAAU;QAC3CL,KAAKL,cAAcW,cAAcN,KAAKP,mBAAmBc;IAC3D;AACF,GAAG;AAEH,6FAA6F;AAC5FV,aAAwCW,wBAAwB,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/OverflowItem/OverflowItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getReactElementRef,\n type FluentTriggerComponent,\n getTriggerChild,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useOverflowItem } from '../../useOverflowItem';\nimport type { OverflowItemProps } from './OverflowItem.types';\n\n/**\n * Attaches overflow item behavior to its child registered with the OverflowContext.\n * It does not render an element of its own.\n *\n * Behaves similarly to other `*Trigger` components in Fluent UI React.\n */\nexport const OverflowItem = React.forwardRef((props: OverflowItemProps, ref) => {\n const { id, groupId, priority, pinned, children } = props;\n\n const containerRef = useOverflowItem(id, priority, groupId, pinned);\n const child = getTriggerChild(children);\n\n return applyTriggerPropsToChildren(children, {\n ref: useMergedRefs(containerRef, ref, getReactElementRef(child)),\n });\n});\n\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(OverflowItem as FluentTriggerComponent).isFluentTriggerComponent = true;\n"],"names":["React","applyTriggerPropsToChildren","getReactElementRef","getTriggerChild","useMergedRefs","useOverflowItem","OverflowItem","forwardRef","props","ref","id","groupId","priority","pinned","children","containerRef","child","isFluentTriggerComponent"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,2BAA2B,EAC3BC,kBAAkB,EAElBC,eAAe,EACfC,aAAa,QACR,4BAA4B;AACnC,SAASC,eAAe,QAAQ,2BAAwB;AAGxD;;;;;CAKC,GACD,OAAO,MAAMC,6BAAeN,MAAMO,UAAU,CAAC,CAACC,OAA0BC;IACtE,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGN;IAEpD,MAAMO,eAAeV,gBAAgBK,IAAIE,UAAUD,SAASE;IAC5D,MAAMG,QAAQb,gBAAgBW;IAE9B,OAAOb,4BAA4Ba,UAAU;QAC3CL,KAAKL,cAAcW,cAAcN,KAAKP,mBAAmBc;IAC3D;AACF,GAAG;AAEH,6FAA6F;AAC5FV,aAAwCW,wBAAwB,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverflowItem/OverflowItem.types.ts"],"sourcesContent":["import type * as React from 'react';\n\n/**\n * OverflowItemProps\n */\nexport type OverflowItemProps = {\n /**\n * The unique identifier for the item used by the overflow manager.\n */\n id: string;\n /**\n * Assigns the item to a group, group visibility can be watched.\n */\n groupId?: string;\n /**\n * The single child that has overflow item behavior attached.\n */\n children: React.ReactElement;\n} & (\n | {\n /**\n * If true, the item will never overflow and will always be visible.\n * Mutually exclusive with `priority`.\n */\n pinned?: boolean;\n priority?: never;\n }\n | {\n pinned?: never;\n /**\n * A higher priority means the item overflows later.\n * Mutually exclusive with `pinned`.\n */\n priority?: number;\n }\n);\n"],"names":[],"mappings":"AAEA;;CAEC,GACD,WA8BE"}
1
+ {"version":3,"sources":["../../../src/components/OverflowItem/OverflowItem.types.ts"],"sourcesContent":["import type * as React from 'react';\n\n/**\n * OverflowItemProps\n */\nexport type OverflowItemProps = {\n /**\n * The unique identifier for the item used by the overflow manager.\n */\n id: string;\n /**\n * Assigns the item to a group, group visibility can be watched.\n */\n groupId?: string;\n /**\n * The single child that has overflow item behavior attached.\n */\n children: React.ReactElement;\n} & (\n | {\n /**\n * If true, the item will never overflow and will always be visible.\n * Mutually exclusive with `priority`.\n */\n pinned?: boolean;\n priority?: never;\n }\n | {\n pinned?: never;\n /**\n * A higher priority means the item overflows later.\n * Mutually exclusive with `pinned`.\n */\n priority?: number;\n }\n);\n"],"names":[],"mappings":"AAEA;;CAEC,GACD,WA8BE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverflowItem/index.ts"],"sourcesContent":["export type { OverflowItemProps } from './OverflowItem.types';\nexport { OverflowItem } from './OverflowItem';\n"],"names":["OverflowItem"],"mappings":"AACA,SAASA,YAAY,QAAQ,oBAAiB"}
1
+ {"version":3,"sources":["../../../src/components/OverflowItem/index.ts"],"sourcesContent":["export type { OverflowItemProps } from './OverflowItem.types';\nexport { OverflowItem } from './OverflowItem';\n"],"names":["OverflowItem"],"mappings":"AACA,SAASA,YAAY,QAAQ,oBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverflowReorderObserver/OverflowReorderObserver.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useOverflowContext } from '../../overflowContext';\n\n/**\n * Renderless opt-in component that observes the `<Overflow>` container for\n * direct-child DOM mutations and triggers an overflow recompute. Drop it\n * inside `<Overflow>` when items can be reordered, added, or removed via\n * React state without a container resize — Fluent's overflow manager only\n * listens to `ResizeObserver` otherwise, so reorders leave visibility flags\n * stale.\n *\n * @example\n * ```tsx\n * <Overflow>\n * <div>\n * <OverflowReorderObserver />\n * {items.map(id => <OverflowItem key={id} id={id} priority={1}>{id}</OverflowItem>)}\n * </div>\n * </Overflow>\n * ```\n */\nexport const OverflowReorderObserver: React.FC = () => {\n const containerRef = useOverflowContext(v => v.containerRef);\n const updateOverflow = useOverflowContext(v => v.updateOverflow);\n const { targetDocument } = useFluent();\n const targetWindow = targetDocument?.defaultView;\n\n React.useEffect(() => {\n const el = containerRef?.current;\n if (!el || !targetWindow?.MutationObserver) {\n return;\n }\n\n const mutationObserver = new targetWindow.MutationObserver(() => updateOverflow());\n mutationObserver.observe(el, { childList: true });\n\n return () => mutationObserver.disconnect();\n }, [containerRef, updateOverflow, targetWindow]);\n\n return null;\n};\n"],"names":["React","useFluent_unstable","useFluent","useOverflowContext","OverflowReorderObserver","containerRef","v","updateOverflow","targetDocument","targetWindow","defaultView","useEffect","el","current","MutationObserver","mutationObserver","observe","childList","disconnect"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,kBAAkB,QAAQ,2BAAwB;AAE3D;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMC,0BAAoC;IAC/C,MAAMC,eAAeF,mBAAmBG,CAAAA,IAAKA,EAAED,YAAY;IAC3D,MAAME,iBAAiBJ,mBAAmBG,CAAAA,IAAKA,EAAEC,cAAc;IAC/D,MAAM,EAAEC,cAAc,EAAE,GAAGN;IAC3B,MAAMO,eAAeD,2BAAAA,qCAAAA,eAAgBE,WAAW;IAEhDV,MAAMW,SAAS,CAAC;QACd,MAAMC,KAAKP,yBAAAA,mCAAAA,aAAcQ,OAAO;QAChC,IAAI,CAACD,MAAM,EAACH,yBAAAA,mCAAAA,aAAcK,gBAAgB,GAAE;YAC1C;QACF;QAEA,MAAMC,mBAAmB,IAAIN,aAAaK,gBAAgB,CAAC,IAAMP;QACjEQ,iBAAiBC,OAAO,CAACJ,IAAI;YAAEK,WAAW;QAAK;QAE/C,OAAO,IAAMF,iBAAiBG,UAAU;IAC1C,GAAG;QAACb;QAAcE;QAAgBE;KAAa;IAE/C,OAAO;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/OverflowReorderObserver/OverflowReorderObserver.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useOverflowContext } from '../../overflowContext';\n\n/**\n * Renderless opt-in component that observes the `<Overflow>` container for\n * direct-child DOM mutations and triggers an overflow recompute. Drop it\n * inside `<Overflow>` when items can be reordered, added, or removed via\n * React state without a container resize — Fluent's overflow manager only\n * listens to `ResizeObserver` otherwise, so reorders leave visibility flags\n * stale.\n *\n * @example\n * ```tsx\n * <Overflow>\n * <div>\n * <OverflowReorderObserver />\n * {items.map(id => <OverflowItem key={id} id={id} priority={1}>{id}</OverflowItem>)}\n * </div>\n * </Overflow>\n * ```\n */\nexport const OverflowReorderObserver: React.FC = () => {\n const containerRef = useOverflowContext(v => v.containerRef);\n const updateOverflow = useOverflowContext(v => v.updateOverflow);\n const { targetDocument } = useFluent();\n const targetWindow = targetDocument?.defaultView;\n\n React.useEffect(() => {\n const el = containerRef?.current;\n if (!el || !targetWindow?.MutationObserver) {\n return;\n }\n\n const mutationObserver = new targetWindow.MutationObserver(() => updateOverflow());\n mutationObserver.observe(el, { childList: true });\n\n return () => mutationObserver.disconnect();\n }, [containerRef, updateOverflow, targetWindow]);\n\n return null;\n};\n"],"names":["React","useFluent_unstable","useFluent","useOverflowContext","OverflowReorderObserver","containerRef","v","updateOverflow","targetDocument","targetWindow","defaultView","useEffect","el","current","MutationObserver","mutationObserver","observe","childList","disconnect"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,kBAAkB,QAAQ,2BAAwB;AAE3D;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMC,0BAAoC;IAC/C,MAAMC,eAAeF,mBAAmBG,CAAAA,IAAKA,EAAED,YAAY;IAC3D,MAAME,iBAAiBJ,mBAAmBG,CAAAA,IAAKA,EAAEC,cAAc;IAC/D,MAAM,EAAEC,cAAc,EAAE,GAAGN;IAC3B,MAAMO,eAAeD,2BAAAA,qCAAAA,eAAgBE,WAAW;IAEhDV,MAAMW,SAAS,CAAC;QACd,MAAMC,KAAKP,yBAAAA,mCAAAA,aAAcQ,OAAO;QAChC,IAAI,CAACD,MAAM,EAACH,yBAAAA,mCAAAA,aAAcK,gBAAgB,GAAE;YAC1C;QACF;QAEA,MAAMC,mBAAmB,IAAIN,aAAaK,gBAAgB,CAAC,IAAMP;QACjEQ,iBAAiBC,OAAO,CAACJ,IAAI;YAAEK,WAAW;QAAK;QAE/C,OAAO,IAAMF,iBAAiBG,UAAU;IAC1C,GAAG;QAACb;QAAcE;QAAgBE;KAAa;IAE/C,OAAO;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverflowReorderObserver/index.ts"],"sourcesContent":["export { OverflowReorderObserver } from './OverflowReorderObserver';\n"],"names":["OverflowReorderObserver"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,+BAA4B"}
1
+ {"version":3,"sources":["../../../src/components/OverflowReorderObserver/index.ts"],"sourcesContent":["export { OverflowReorderObserver } from './OverflowReorderObserver';\n"],"names":["OverflowReorderObserver"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,+BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/overflowContext.ts"],"sourcesContent":["'use client';\n\nimport type {\n OverflowItemEntry,\n OverflowDividerEntry,\n OverflowGroupState,\n OverflowSnapshot,\n} from '@fluentui/priority-overflow';\nimport { EMPTY_SNAPSHOT } from '@fluentui/priority-overflow';\nimport * as React from 'react';\n\n/**\n * @public\n */\nexport interface OverflowContextValue {\n /**\n * @deprecated This value is not guaranteed to be up to date and should not be used directly. Use getSnapshot or the provided hooks instead\n */\n itemVisibility: Record<string, boolean>;\n /**\n * @deprecated This value is not guaranteed to be up to date and should not be used directly. Use getSnapshot or the provided hooks instead\n */\n groupVisibility: Record<string, OverflowGroupState>;\n /**\n * @deprecated This value is not guaranteed to be up to date and should not be used directly. Use getSnapshot or the provided hooks instead\n */\n hasOverflow: boolean;\n registerItem: (item: OverflowItemEntry) => () => void;\n registerOverflowMenu: (el: HTMLElement) => () => void;\n registerDivider: (divider: OverflowDividerEntry) => () => void;\n updateOverflow: (padding?: number) => void;\n forceUpdateOverflow: () => void;\n containerRef?: React.RefObject<HTMLElement | null>;\n getSnapshot: () => OverflowSnapshot;\n subscribe: (listener: () => void) => () => void;\n}\n\nexport const OverflowContext = React.createContext<OverflowContextValue | undefined>(\n undefined,\n) as React.Context<OverflowContextValue>;\n\n/**\n * Provides an {@link OverflowContextValue} to descendant overflow hooks and components.\n * Used by headless consumers that build their own overflow root.\n * @public\n */\nexport const OverflowProvider = OverflowContext.Provider;\n\nconst noop = () => {\n /* noop */\n};\n\nconst overflowContextDefaultValue: OverflowContextValue = {\n hasOverflow: false,\n itemVisibility: {},\n groupVisibility: {},\n registerItem: () => noop,\n updateOverflow: noop,\n forceUpdateOverflow: noop,\n registerOverflowMenu: () => noop,\n registerDivider: () => noop,\n getSnapshot: () => EMPTY_SNAPSHOT,\n subscribe: () => noop,\n};\n\n/**\n * @internal\n */\nexport function useOverflowContext(): OverflowContextValue;\n/**\n * @internal\n */\nexport function useOverflowContext<SelectedValue>(\n selector: (context: OverflowContextValue) => SelectedValue,\n): SelectedValue;\nexport function useOverflowContext<SelectedValue>(\n selector?: (context: OverflowContextValue) => SelectedValue,\n): SelectedValue | OverflowContextValue {\n const context = React.useContext(OverflowContext) ?? overflowContextDefaultValue;\n return selector ? selector(context) : context;\n}\n"],"names":["EMPTY_SNAPSHOT","React","OverflowContext","createContext","undefined","OverflowProvider","Provider","noop","overflowContextDefaultValue","hasOverflow","itemVisibility","groupVisibility","registerItem","updateOverflow","forceUpdateOverflow","registerOverflowMenu","registerDivider","getSnapshot","subscribe","useOverflowContext","selector","context","useContext"],"mappings":"AAAA;AAQA,SAASA,cAAc,QAAQ,8BAA8B;AAC7D,YAAYC,WAAW,QAAQ;AA4B/B,OAAO,MAAMC,kBAAkBD,MAAME,aAAa,CAChDC,WACuC;AAEzC;;;;CAIC,GACD,OAAO,MAAMC,mBAAmBH,gBAAgBI,QAAQ,CAAC;AAEzD,MAAMC,OAAO;AACX,QAAQ,GACV;AAEA,MAAMC,8BAAoD;IACxDC,aAAa;IACbC,gBAAgB,CAAC;IACjBC,iBAAiB,CAAC;IAClBC,cAAc,IAAML;IACpBM,gBAAgBN;IAChBO,qBAAqBP;IACrBQ,sBAAsB,IAAMR;IAC5BS,iBAAiB,IAAMT;IACvBU,aAAa,IAAMjB;IACnBkB,WAAW,IAAMX;AACnB;AAYA,OAAO,SAASY,mBACdC,QAA2D;QAE3CnB;IAAhB,MAAMoB,UAAUpB,CAAAA,oBAAAA,MAAMqB,UAAU,CAACpB,8BAAjBD,+BAAAA,oBAAqCO;IACrD,OAAOY,WAAWA,SAASC,WAAWA;AACxC"}
1
+ {"version":3,"sources":["../src/overflowContext.ts"],"sourcesContent":["'use client';\n\nimport type {\n OverflowItemEntry,\n OverflowDividerEntry,\n OverflowGroupState,\n OverflowSnapshot,\n} from '@fluentui/priority-overflow';\nimport { EMPTY_SNAPSHOT } from '@fluentui/priority-overflow';\nimport * as React from 'react';\n\n/**\n * @public\n */\nexport interface OverflowContextValue {\n /**\n * @deprecated This value is not guaranteed to be up to date and should not be used directly. Use getSnapshot or the provided hooks instead\n */\n itemVisibility: Record<string, boolean>;\n /**\n * @deprecated This value is not guaranteed to be up to date and should not be used directly. Use getSnapshot or the provided hooks instead\n */\n groupVisibility: Record<string, OverflowGroupState>;\n /**\n * @deprecated This value is not guaranteed to be up to date and should not be used directly. Use getSnapshot or the provided hooks instead\n */\n hasOverflow: boolean;\n registerItem: (item: OverflowItemEntry) => () => void;\n registerOverflowMenu: (el: HTMLElement) => () => void;\n registerDivider: (divider: OverflowDividerEntry) => () => void;\n updateOverflow: (padding?: number) => void;\n forceUpdateOverflow: () => void;\n containerRef?: React.RefObject<HTMLElement | null>;\n getSnapshot: () => OverflowSnapshot;\n subscribe: (listener: () => void) => () => void;\n}\n\nexport const OverflowContext = React.createContext<OverflowContextValue | undefined>(\n undefined,\n) as React.Context<OverflowContextValue>;\n\n/**\n * Provides an {@link OverflowContextValue} to descendant overflow hooks and components.\n * Used by headless consumers that build their own overflow root.\n * @public\n */\nexport const OverflowProvider = OverflowContext.Provider;\n\nconst noop = () => {\n /* noop */\n};\n\nconst overflowContextDefaultValue: OverflowContextValue = {\n hasOverflow: false,\n itemVisibility: {},\n groupVisibility: {},\n registerItem: () => noop,\n updateOverflow: noop,\n forceUpdateOverflow: noop,\n registerOverflowMenu: () => noop,\n registerDivider: () => noop,\n getSnapshot: () => EMPTY_SNAPSHOT,\n subscribe: () => noop,\n};\n\n/**\n * @internal\n */\nexport function useOverflowContext(): OverflowContextValue;\n/**\n * @internal\n */\nexport function useOverflowContext<SelectedValue>(\n selector: (context: OverflowContextValue) => SelectedValue,\n): SelectedValue;\nexport function useOverflowContext<SelectedValue>(\n selector?: (context: OverflowContextValue) => SelectedValue,\n): SelectedValue | OverflowContextValue {\n const context = React.useContext(OverflowContext) ?? overflowContextDefaultValue;\n return selector ? selector(context) : context;\n}\n"],"names":["EMPTY_SNAPSHOT","React","OverflowContext","createContext","undefined","OverflowProvider","Provider","noop","overflowContextDefaultValue","hasOverflow","itemVisibility","groupVisibility","registerItem","updateOverflow","forceUpdateOverflow","registerOverflowMenu","registerDivider","getSnapshot","subscribe","useOverflowContext","selector","context","useContext"],"mappings":"AAAA;AAQA,SAASA,cAAc,QAAQ,8BAA8B;AAC7D,YAAYC,WAAW,QAAQ;AA4B/B,OAAO,MAAMC,kBAAkBD,MAAME,aAAa,CAChDC,WACuC;AAEzC;;;;CAIC,GACD,OAAO,MAAMC,mBAAmBH,gBAAgBI,QAAQ,CAAC;AAEzD,MAAMC,OAAO;AACX,QAAQ,GACV;AAEA,MAAMC,8BAAoD;IACxDC,aAAa;IACbC,gBAAgB,CAAC;IACjBC,iBAAiB,CAAC;IAClBC,cAAc,IAAML;IACpBM,gBAAgBN;IAChBO,qBAAqBP;IACrBQ,sBAAsB,IAAMR;IAC5BS,iBAAiB,IAAMT;IACvBU,aAAa,IAAMjB;IACnBkB,WAAW,IAAMX;AACnB;AAYA,OAAO,SAASY,mBACdC,QAA2D;QAE3CnB;IAAhB,MAAMoB,WAAUpB,oBAAAA,MAAMqB,UAAU,CAACpB,8BAAjBD,+BAAAA,oBAAqCO;IACrD,OAAOY,WAAWA,SAASC,WAAWA;AACxC"}
@@ -89,14 +89,14 @@ import { DATA_OVERFLOWING, DATA_OVERFLOW_DIVIDER, DATA_OVERFLOW_ITEM, DATA_OVERF
89
89
  (_managerRef_current = managerRef.current) === null || _managerRef_current === void 0 ? void 0 : _managerRef_current.update();
90
90
  }, []);
91
91
  const getSnapshot = React.useCallback(()=>{
92
+ var _ref;
92
93
  var _managerRef_current;
93
- var _managerRef_current_getSnapshot;
94
- return (_managerRef_current_getSnapshot = (_managerRef_current = managerRef.current) === null || _managerRef_current === void 0 ? void 0 : _managerRef_current.getSnapshot()) !== null && _managerRef_current_getSnapshot !== void 0 ? _managerRef_current_getSnapshot : EMPTY_SNAPSHOT;
94
+ return (_ref = (_managerRef_current = managerRef.current) === null || _managerRef_current === void 0 ? void 0 : _managerRef_current.getSnapshot()) !== null && _ref !== void 0 ? _ref : EMPTY_SNAPSHOT;
95
95
  }, []);
96
96
  const subscribe = React.useCallback((listener)=>{
97
+ var _ref;
97
98
  var _managerRef_current;
98
- var _managerRef_current_subscribe;
99
- return (_managerRef_current_subscribe = (_managerRef_current = managerRef.current) === null || _managerRef_current === void 0 ? void 0 : _managerRef_current.subscribe(listener)) !== null && _managerRef_current_subscribe !== void 0 ? _managerRef_current_subscribe : noop;
99
+ return (_ref = (_managerRef_current = managerRef.current) === null || _managerRef_current === void 0 ? void 0 : _managerRef_current.subscribe(listener)) !== null && _ref !== void 0 ? _ref : noop;
100
100
  }, []);
101
101
  const forceUpdateOverflow = React.useCallback(()=>{
102
102
  var _managerRef_current;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useOverflowContainer.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createOverflowManager, EMPTY_SNAPSHOT } from '@fluentui/priority-overflow';\n\n/**\n * @internal\n */\nimport type {\n OnUpdateItemVisibility,\n OnUpdateOverflow,\n OverflowItemEntry,\n OverflowDividerEntry,\n OverflowManager,\n OverflowOptions,\n} from '@fluentui/priority-overflow';\nimport { canUseDOM, useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport type { UseOverflowContainerReturn } from './types';\nimport { DATA_OVERFLOWING, DATA_OVERFLOW_DIVIDER, DATA_OVERFLOW_ITEM, DATA_OVERFLOW_MENU } from './constants';\n\n/**\n * @internal\n * @param update - Callback when overflow state changes\n * @param options - Options to configure the overflow container\n * @returns - ref to attach to an intrinsic HTML element and imperative functions\n */\nexport const useOverflowContainer = <TElement extends HTMLElement>(\n update: OnUpdateOverflow,\n options: Omit<OverflowOptions, 'onUpdateOverflow'>,\n): UseOverflowContainerReturn<TElement> => {\n const {\n overflowAxis = 'horizontal',\n overflowDirection = 'end',\n padding = 10,\n minimumVisible = 0,\n onUpdateItemVisibility = noop,\n hasHiddenItems = false,\n } = options;\n\n const onUpdateItemVisibilityCallback = useEventCallback(onUpdateItemVisibility);\n\n const observeOptions: Required<OverflowOptions> = React.useMemo(\n () => ({\n overflowAxis,\n overflowDirection,\n padding,\n minimumVisible,\n onUpdateItemVisibility: onUpdateItemVisibilityCallback,\n onUpdateOverflow: update,\n hasHiddenItems,\n }),\n [minimumVisible, onUpdateItemVisibilityCallback, overflowAxis, overflowDirection, padding, update, hasHiddenItems],\n );\n\n const containerRef = React.useRef<TElement>(null);\n\n const managerRef = React.useRef<OverflowManager | null>(null);\n\n if (managerRef.current === null) {\n managerRef.current = canUseDOM() ? createOverflowManager(observeOptions) : null;\n }\n\n useIsomorphicLayoutEffect(() => {\n if (managerRef.current && containerRef.current) {\n // forceUpdate resolves overflow synchronously for a correct first paint; the manager guards it\n // on the container being measured.\n managerRef.current.observe(containerRef.current, { forceUpdate: true });\n return () => managerRef.current?.disconnect();\n }\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n managerRef.current?.setOptions(observeOptions);\n }, [observeOptions]);\n\n const registerItem = React.useCallback((item: OverflowItemEntry) => {\n managerRef.current?.addItem(item);\n item.element.setAttribute(DATA_OVERFLOW_ITEM, '');\n\n return () => {\n item.element.removeAttribute(DATA_OVERFLOWING);\n item.element.removeAttribute(DATA_OVERFLOW_ITEM);\n managerRef.current?.removeItem(item.id);\n };\n }, []);\n\n const registerDivider = React.useCallback((divider: OverflowDividerEntry) => {\n const el = divider.element;\n managerRef.current?.addDivider(divider);\n el.setAttribute(DATA_OVERFLOW_DIVIDER, '');\n\n return () => {\n managerRef.current?.removeDivider(divider.groupId);\n el.removeAttribute(DATA_OVERFLOW_DIVIDER);\n };\n }, []);\n\n const registerOverflowMenu = React.useCallback((el: HTMLElement) => {\n el.setAttribute(DATA_OVERFLOW_MENU, '');\n managerRef.current?.addOverflowMenu(el);\n\n return () => {\n managerRef.current?.removeOverflowMenu();\n el.removeAttribute(DATA_OVERFLOW_MENU);\n };\n }, []);\n\n const updateOverflow = React.useCallback(() => {\n managerRef.current?.update();\n }, []);\n\n const getSnapshot = React.useCallback<OverflowManager['getSnapshot']>(\n () => managerRef.current?.getSnapshot() ?? EMPTY_SNAPSHOT,\n [],\n );\n\n const subscribe = React.useCallback<OverflowManager['subscribe']>(\n listener => managerRef.current?.subscribe(listener) ?? noop,\n [],\n );\n\n const forceUpdateOverflow = React.useCallback(() => {\n managerRef.current?.forceUpdate();\n }, []);\n\n return {\n registerItem,\n registerDivider,\n registerOverflowMenu,\n updateOverflow,\n forceUpdateOverflow,\n containerRef,\n getSnapshot,\n subscribe,\n };\n};\n\nconst noop = () => {\n /* noop */\n};\n\nexport const updateVisibilityAttribute: OnUpdateItemVisibility = ({ item, visible }) => {\n if (visible) {\n item.element.removeAttribute(DATA_OVERFLOWING);\n } else {\n item.element.setAttribute(DATA_OVERFLOWING, '');\n }\n};\n"],"names":["React","createOverflowManager","EMPTY_SNAPSHOT","canUseDOM","useEventCallback","useIsomorphicLayoutEffect","DATA_OVERFLOWING","DATA_OVERFLOW_DIVIDER","DATA_OVERFLOW_ITEM","DATA_OVERFLOW_MENU","useOverflowContainer","update","options","overflowAxis","overflowDirection","padding","minimumVisible","onUpdateItemVisibility","noop","hasHiddenItems","onUpdateItemVisibilityCallback","observeOptions","useMemo","onUpdateOverflow","containerRef","useRef","managerRef","current","observe","forceUpdate","disconnect","setOptions","registerItem","useCallback","item","addItem","element","setAttribute","removeAttribute","removeItem","id","registerDivider","divider","el","addDivider","removeDivider","groupId","registerOverflowMenu","addOverflowMenu","removeOverflowMenu","updateOverflow","getSnapshot","subscribe","listener","forceUpdateOverflow","updateVisibilityAttribute","visible"],"mappings":"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"}
1
+ {"version":3,"sources":["../src/useOverflowContainer.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createOverflowManager, EMPTY_SNAPSHOT } from '@fluentui/priority-overflow';\n\n/**\n * @internal\n */\nimport type {\n OnUpdateItemVisibility,\n OnUpdateOverflow,\n OverflowItemEntry,\n OverflowDividerEntry,\n OverflowManager,\n OverflowOptions,\n} from '@fluentui/priority-overflow';\nimport { canUseDOM, useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport type { UseOverflowContainerReturn } from './types';\nimport { DATA_OVERFLOWING, DATA_OVERFLOW_DIVIDER, DATA_OVERFLOW_ITEM, DATA_OVERFLOW_MENU } from './constants';\n\n/**\n * @internal\n * @param update - Callback when overflow state changes\n * @param options - Options to configure the overflow container\n * @returns - ref to attach to an intrinsic HTML element and imperative functions\n */\nexport const useOverflowContainer = <TElement extends HTMLElement>(\n update: OnUpdateOverflow,\n options: Omit<OverflowOptions, 'onUpdateOverflow'>,\n): UseOverflowContainerReturn<TElement> => {\n const {\n overflowAxis = 'horizontal',\n overflowDirection = 'end',\n padding = 10,\n minimumVisible = 0,\n onUpdateItemVisibility = noop,\n hasHiddenItems = false,\n } = options;\n\n const onUpdateItemVisibilityCallback = useEventCallback(onUpdateItemVisibility);\n\n const observeOptions: Required<OverflowOptions> = React.useMemo(\n () => ({\n overflowAxis,\n overflowDirection,\n padding,\n minimumVisible,\n onUpdateItemVisibility: onUpdateItemVisibilityCallback,\n onUpdateOverflow: update,\n hasHiddenItems,\n }),\n [minimumVisible, onUpdateItemVisibilityCallback, overflowAxis, overflowDirection, padding, update, hasHiddenItems],\n );\n\n const containerRef = React.useRef<TElement>(null);\n\n const managerRef = React.useRef<OverflowManager | null>(null);\n\n if (managerRef.current === null) {\n managerRef.current = canUseDOM() ? createOverflowManager(observeOptions) : null;\n }\n\n useIsomorphicLayoutEffect(() => {\n if (managerRef.current && containerRef.current) {\n // forceUpdate resolves overflow synchronously for a correct first paint; the manager guards it\n // on the container being measured.\n managerRef.current.observe(containerRef.current, { forceUpdate: true });\n return () => managerRef.current?.disconnect();\n }\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n managerRef.current?.setOptions(observeOptions);\n }, [observeOptions]);\n\n const registerItem = React.useCallback((item: OverflowItemEntry) => {\n managerRef.current?.addItem(item);\n item.element.setAttribute(DATA_OVERFLOW_ITEM, '');\n\n return () => {\n item.element.removeAttribute(DATA_OVERFLOWING);\n item.element.removeAttribute(DATA_OVERFLOW_ITEM);\n managerRef.current?.removeItem(item.id);\n };\n }, []);\n\n const registerDivider = React.useCallback((divider: OverflowDividerEntry) => {\n const el = divider.element;\n managerRef.current?.addDivider(divider);\n el.setAttribute(DATA_OVERFLOW_DIVIDER, '');\n\n return () => {\n managerRef.current?.removeDivider(divider.groupId);\n el.removeAttribute(DATA_OVERFLOW_DIVIDER);\n };\n }, []);\n\n const registerOverflowMenu = React.useCallback((el: HTMLElement) => {\n el.setAttribute(DATA_OVERFLOW_MENU, '');\n managerRef.current?.addOverflowMenu(el);\n\n return () => {\n managerRef.current?.removeOverflowMenu();\n el.removeAttribute(DATA_OVERFLOW_MENU);\n };\n }, []);\n\n const updateOverflow = React.useCallback(() => {\n managerRef.current?.update();\n }, []);\n\n const getSnapshot = React.useCallback<OverflowManager['getSnapshot']>(\n () => managerRef.current?.getSnapshot() ?? EMPTY_SNAPSHOT,\n [],\n );\n\n const subscribe = React.useCallback<OverflowManager['subscribe']>(\n listener => managerRef.current?.subscribe(listener) ?? noop,\n [],\n );\n\n const forceUpdateOverflow = React.useCallback(() => {\n managerRef.current?.forceUpdate();\n }, []);\n\n return {\n registerItem,\n registerDivider,\n registerOverflowMenu,\n updateOverflow,\n forceUpdateOverflow,\n containerRef,\n getSnapshot,\n subscribe,\n };\n};\n\nconst noop = () => {\n /* noop */\n};\n\nexport const updateVisibilityAttribute: OnUpdateItemVisibility = ({ item, visible }) => {\n if (visible) {\n item.element.removeAttribute(DATA_OVERFLOWING);\n } else {\n item.element.setAttribute(DATA_OVERFLOWING, '');\n }\n};\n"],"names":["React","createOverflowManager","EMPTY_SNAPSHOT","canUseDOM","useEventCallback","useIsomorphicLayoutEffect","DATA_OVERFLOWING","DATA_OVERFLOW_DIVIDER","DATA_OVERFLOW_ITEM","DATA_OVERFLOW_MENU","useOverflowContainer","update","options","overflowAxis","overflowDirection","padding","minimumVisible","onUpdateItemVisibility","noop","hasHiddenItems","onUpdateItemVisibilityCallback","observeOptions","useMemo","onUpdateOverflow","containerRef","useRef","managerRef","current","observe","forceUpdate","disconnect","setOptions","registerItem","useCallback","item","addItem","element","setAttribute","removeAttribute","removeItem","id","registerDivider","divider","el","addDivider","removeDivider","groupId","registerOverflowMenu","addOverflowMenu","removeOverflowMenu","updateOverflow","getSnapshot","subscribe","listener","forceUpdateOverflow","updateVisibilityAttribute","visible"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useOverflowItem.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useOverflowContext } from './overflowContext';\n\n/**\n * Registers an overflow item\n *\n * @internal\n * @param id - unique identifier for the item used by the overflow manager\n * @param priority - higher priority means the item overflows later\n * @param groupId - assigns the item to a group, group visibility can be watched\n * @param pinned - if true, the item will never overflow and will always be visible\n * @returns ref to assign to an intrinsic HTML element\n */\nexport function useOverflowItem<TElement extends HTMLElement>(\n id: string,\n priority?: number,\n groupId?: string,\n pinned?: boolean,\n): React.RefObject<TElement | null> {\n const ref = React.useRef<TElement | null>(null);\n const registerItem = useOverflowContext(v => v.registerItem);\n\n useIsomorphicLayoutEffect(() => {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof pinned !== 'undefined' && typeof priority !== 'undefined' && pinned) {\n // eslint-disable-next-line no-console\n console.error(\n `useOverflowItem: Overflow item with id \"${id}\" has pinned=true and priority<0. ` +\n `Pinned items are always visible and should not have defined priority.`,\n );\n }\n }\n\n if (ref.current) {\n return registerItem({\n element: ref.current,\n id,\n priority: priority ?? 0,\n groupId,\n pinned,\n });\n }\n }, [id, priority, registerItem, groupId, pinned]);\n\n return ref;\n}\n"],"names":["React","useIsomorphicLayoutEffect","useOverflowContext","useOverflowItem","id","priority","groupId","pinned","ref","useRef","registerItem","v","process","env","NODE_ENV","console","error","current","element"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,4BAA4B;AACtE,SAASC,kBAAkB,QAAQ,uBAAoB;AAEvD;;;;;;;;;CASC,GACD,OAAO,SAASC,gBACdC,EAAU,EACVC,QAAiB,EACjBC,OAAgB,EAChBC,MAAgB;IAEhB,MAAMC,MAAMR,MAAMS,MAAM,CAAkB;IAC1C,MAAMC,eAAeR,mBAAmBS,CAAAA,IAAKA,EAAED,YAAY;IAE3DT,0BAA0B;QACxB,IAAIW,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,IAAI,OAAOP,WAAW,eAAe,OAAOF,aAAa,eAAeE,QAAQ;gBAC9E,sCAAsC;gBACtCQ,QAAQC,KAAK,CACX,CAAC,wCAAwC,EAAEZ,GAAG,kCAAkC,CAAC,GAC/E,CAAC,qEAAqE,CAAC;YAE7E;QACF;QAEA,IAAII,IAAIS,OAAO,EAAE;YACf,OAAOP,aAAa;gBAClBQ,SAASV,IAAIS,OAAO;gBACpBb;gBACAC,UAAUA,qBAAAA,sBAAAA,WAAY;gBACtBC;gBACAC;YACF;QACF;IACF,GAAG;QAACH;QAAIC;QAAUK;QAAcJ;QAASC;KAAO;IAEhD,OAAOC;AACT"}
1
+ {"version":3,"sources":["../src/useOverflowItem.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useOverflowContext } from './overflowContext';\n\n/**\n * Registers an overflow item\n *\n * @internal\n * @param id - unique identifier for the item used by the overflow manager\n * @param priority - higher priority means the item overflows later\n * @param groupId - assigns the item to a group, group visibility can be watched\n * @param pinned - if true, the item will never overflow and will always be visible\n * @returns ref to assign to an intrinsic HTML element\n */\nexport function useOverflowItem<TElement extends HTMLElement>(\n id: string,\n priority?: number,\n groupId?: string,\n pinned?: boolean,\n): React.RefObject<TElement | null> {\n const ref = React.useRef<TElement | null>(null);\n const registerItem = useOverflowContext(v => v.registerItem);\n\n useIsomorphicLayoutEffect(() => {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof pinned !== 'undefined' && typeof priority !== 'undefined' && pinned) {\n // eslint-disable-next-line no-console\n console.error(\n `useOverflowItem: Overflow item with id \"${id}\" has pinned=true and priority<0. ` +\n `Pinned items are always visible and should not have defined priority.`,\n );\n }\n }\n\n if (ref.current) {\n return registerItem({\n element: ref.current,\n id,\n priority: priority ?? 0,\n groupId,\n pinned,\n });\n }\n }, [id, priority, registerItem, groupId, pinned]);\n\n return ref;\n}\n"],"names":["React","useIsomorphicLayoutEffect","useOverflowContext","useOverflowItem","id","priority","groupId","pinned","ref","useRef","registerItem","v","process","env","NODE_ENV","console","error","current","element"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,4BAA4B;AACtE,SAASC,kBAAkB,QAAQ,uBAAoB;AAEvD;;;;;;;;;CASC,GACD,OAAO,SAASC,gBACdC,EAAU,EACVC,QAAiB,EACjBC,OAAgB,EAChBC,MAAgB;IAEhB,MAAMC,MAAMR,MAAMS,MAAM,CAAkB;IAC1C,MAAMC,eAAeR,mBAAmBS,CAAAA,IAAKA,EAAED,YAAY;IAE3DT,0BAA0B;QACxB,IAAIW,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,IAAI,OAAOP,WAAW,eAAe,OAAOF,aAAa,eAAeE,QAAQ;gBAC9E,sCAAsC;gBACtCQ,QAAQC,KAAK,CACX,CAAC,wCAAwC,EAAEZ,GAAG,kCAAkC,CAAC,GAC/E,CAAC,qEAAqE,CAAC;YAE7E;QACF;QAEA,IAAII,IAAIS,OAAO,EAAE;YACf,OAAOP,aAAa;gBAClBQ,SAASV,IAAIS,OAAO;gBACpBb;gBACAC,QAAQ,EAAEA,qBAAAA,sBAAAA,WAAY;gBACtBC;gBACAC;YACF;QACF;IACF,GAAG;QAACH;QAAIC;QAAUK;QAAcJ;QAASC;KAAO;IAEhD,OAAOC;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/Overflow.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { OverflowProps } from './Overflow.types';\nimport { useOverflow_unstable } from './useOverflow';\nimport { useOverflowContextValues_unstable } from '../../useOverflowContextValues';\nimport { useOverflowStyles_unstable } from './useOverflowStyles.styles';\nimport { renderOverflow_unstable } from './renderOverflow';\n\n/**\n * Provides an OverflowContext for OverflowItem descendants.\n */\nexport const Overflow = React.forwardRef((props: OverflowProps, ref) => {\n const state = useOverflow_unstable(props, ref as React.Ref<HTMLElement>);\n const contextValues = useOverflowContextValues_unstable(state);\n\n useOverflowStyles_unstable(state);\n\n return renderOverflow_unstable(state, contextValues);\n});\n"],"names":["React","useOverflow_unstable","useOverflowContextValues_unstable","useOverflowStyles_unstable","renderOverflow_unstable","Overflow","forwardRef","props","ref","state","contextValues"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;6BAEM,mBAAgB;0CACH,oCAAiC;yCACxC,gCAA6B;gCAChC,sBAAmB;AAKpD,MAAMK,WAAAA,WAAAA,GAAWL,OAAMM,UAAU,CAAC,CAACC,OAAsBC;IAC9D,MAAMC,YAAQR,iCAAAA,EAAqBM,OAAOC;IAC1C,MAAME,oBAAgBR,2DAAAA,EAAkCO;QAExDN,mDAAAA,EAA2BM;IAE3B,WAAOL,uCAAAA,EAAwBK,OAAOC;AACxC,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/Overflow.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { OverflowProps } from './Overflow.types';\nimport { useOverflow_unstable } from './useOverflow';\nimport { useOverflowContextValues_unstable } from '../../useOverflowContextValues';\nimport { useOverflowStyles_unstable } from './useOverflowStyles.styles';\nimport { renderOverflow_unstable } from './renderOverflow';\n\n/**\n * Provides an OverflowContext for OverflowItem descendants.\n */\nexport const Overflow = React.forwardRef((props: OverflowProps, ref) => {\n const state = useOverflow_unstable(props, ref as React.Ref<HTMLElement>);\n const contextValues = useOverflowContextValues_unstable(state);\n\n useOverflowStyles_unstable(state);\n\n return renderOverflow_unstable(state, contextValues);\n});\n"],"names":["React","useOverflow_unstable","useOverflowContextValues_unstable","useOverflowStyles_unstable","renderOverflow_unstable","Overflow","forwardRef","props","ref","state","contextValues"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;6BAEM,mBAAgB;0CACH,oCAAiC;yCACxC,gCAA6B;gCAChC,sBAAmB;AAKpD,MAAMK,WAAAA,WAAAA,GAAWL,OAAMM,UAAU,CAAC,CAACC,OAAsBC;IAC9D,MAAMC,YAAQR,iCAAAA,EAAqBM,OAAOC;IAC1C,MAAME,oBAAgBR,2DAAAA,EAAkCO;QAExDN,mDAAAA,EAA2BM;IAE3B,WAAOL,uCAAAA,EAAwBK,OAAOC;AACxC,GAAG"}
@@ -0,0 +1,13 @@
1
+ @layer fluentui {
2
+ .overflowMenu {
3
+ [data-overflow-menu] {
4
+ flex-shrink: 0;
5
+ }
6
+ }
7
+
8
+ .overflowingItems {
9
+ [data-overflowing] {
10
+ display: none;
11
+ }
12
+ }
13
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/Overflow.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { OverflowOptions, OverflowGroupState } from '@fluentui/priority-overflow';\nimport type { OverflowContextValue } from '../../overflowContext';\nimport type { UseOverflowContainerReturn } from '../../types';\n\nexport interface OverflowState {\n hasOverflow: boolean;\n itemVisibility: Record<string, boolean>;\n groupVisibility: Record<string, OverflowGroupState>;\n}\n\nexport interface OnOverflowChangeData extends OverflowState {}\n\nexport type OverflowProps = Partial<\n Pick<OverflowOptions, 'overflowAxis' | 'overflowDirection' | 'padding' | 'minimumVisible' | 'hasHiddenItems'>\n> & {\n children: React.ReactElement;\n\n // overflow is not caused by DOM event\n // eslint-disable-next-line @nx/workspace-consistent-callback-type\n onOverflowChange?: (ev: null, data: OverflowState) => void;\n};\n\n/**\n * State used in rendering Overflow. Carries the overflow container's registration api so\n * `useOverflowContextValues_unstable` can assemble the context values.\n */\nexport type OverflowComponentState = UseOverflowContainerReturn<HTMLElement> & {\n /**\n * Merged ref applied to the cloned child's root element.\n */\n ref: React.Ref<HTMLElement>;\n /**\n * Class name applied to the cloned child. Set by `useOverflowStyles_unstable`; left `undefined`\n * by headless consumers that apply no styling.\n */\n className?: string;\n /**\n * The single child that overflow behavior is attached to.\n */\n children: React.ReactElement;\n};\n\n/**\n * Context values provided to overflow descendants.\n */\nexport type OverflowContextValues = {\n overflow: OverflowContextValue;\n};\n"],"names":[],"mappings":"AA2CA;;CAEC,GACD,WAEE"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/Overflow.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { OverflowOptions, OverflowGroupState } from '@fluentui/priority-overflow';\nimport type { OverflowContextValue } from '../../overflowContext';\nimport type { UseOverflowContainerReturn } from '../../types';\n\nexport interface OverflowState {\n hasOverflow: boolean;\n itemVisibility: Record<string, boolean>;\n groupVisibility: Record<string, OverflowGroupState>;\n}\n\nexport interface OnOverflowChangeData extends OverflowState {}\n\nexport type OverflowProps = Partial<\n Pick<OverflowOptions, 'overflowAxis' | 'overflowDirection' | 'padding' | 'minimumVisible' | 'hasHiddenItems'>\n> & {\n children: React.ReactElement;\n\n // overflow is not caused by DOM event\n // eslint-disable-next-line @nx/workspace-consistent-callback-type\n onOverflowChange?: (ev: null, data: OverflowState) => void;\n};\n\n/**\n * State used in rendering Overflow. Carries the overflow container's registration api so\n * `useOverflowContextValues_unstable` can assemble the context values.\n */\nexport type OverflowComponentState = UseOverflowContainerReturn<HTMLElement> & {\n /**\n * Merged ref applied to the cloned child's root element.\n */\n ref: React.Ref<HTMLElement>;\n /**\n * Class name applied to the cloned child. Set by `useOverflowStyles_unstable`; left `undefined`\n * by headless consumers that apply no styling.\n */\n className?: string;\n /**\n * The single child that overflow behavior is attached to.\n */\n children: React.ReactElement;\n};\n\n/**\n * Context values provided to overflow descendants.\n */\nexport type OverflowContextValues = {\n overflow: OverflowContextValue;\n};\n"],"names":[],"mappings":"AA2CA;;CAEC,GACD,WAEE"}
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- Overflow: function() {
12
+ get Overflow () {
13
13
  return _Overflow.Overflow;
14
14
  },
15
- renderOverflow_unstable: function() {
15
+ get renderOverflow_unstable () {
16
16
  return _renderOverflow.renderOverflow_unstable;
17
17
  },
18
- useOverflowStyles_unstable: function() {
18
+ get useOverflowStyles_unstable () {
19
19
  return _useOverflowStylesstyles.useOverflowStyles_unstable;
20
20
  },
21
- useOverflow_unstable: function() {
21
+ get useOverflow_unstable () {
22
22
  return _useOverflow.useOverflow_unstable;
23
23
  }
24
24
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/index.ts"],"sourcesContent":["export { Overflow } from './Overflow';\nexport { useOverflow_unstable } from './useOverflow';\nexport { renderOverflow_unstable } from './renderOverflow';\nexport { useOverflowStyles_unstable } from './useOverflowStyles.styles';\nexport type {\n OverflowProps,\n OnOverflowChangeData,\n OverflowState,\n OverflowComponentState,\n OverflowContextValues,\n} from './Overflow.types';\n"],"names":["Overflow","useOverflow_unstable","renderOverflow_unstable","useOverflowStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,kBAAQ;;;eAERE,uCAAuB;;;eACvBC,mDAA0B;;;eAF1BF,iCAAoB;;;0BADJ,gBAAa;6BACD,mBAAgB;gCACb,sBAAmB;yCAChB,gCAA6B"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/index.ts"],"sourcesContent":["export { Overflow } from './Overflow';\nexport { useOverflow_unstable } from './useOverflow';\nexport { renderOverflow_unstable } from './renderOverflow';\nexport { useOverflowStyles_unstable } from './useOverflowStyles.styles';\nexport type {\n OverflowProps,\n OnOverflowChangeData,\n OverflowState,\n OverflowComponentState,\n OverflowContextValues,\n} from './Overflow.types';\n"],"names":["Overflow","useOverflow_unstable","renderOverflow_unstable","useOverflowStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,kBAAQ;;;eAERE,uCAAuB;;;eACvBC,mDAA0B;;;eAF1BF,iCAAoB;;;0BADJ,gBAAa;6BACD,mBAAgB;gCACb,sBAAmB;yCAChB,gCAA6B"}
@@ -13,8 +13,8 @@ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactutilities = require("@fluentui/react-utilities");
14
14
  const _overflowContext = require("../../overflowContext.cjs");
15
15
  const renderOverflow_unstable = (state, contextValues)=>{
16
- const child = (0, _reactutilities.getTriggerChild)(state.children);
17
16
  var _state_className;
17
+ const child = (0, _reactutilities.getTriggerChild)(state.children);
18
18
  const clonedChild = (0, _reactutilities.applyTriggerPropsToChildren)(state.children, {
19
19
  ref: state.ref,
20
20
  className: (_state_className = state.className) !== null && _state_className !== void 0 ? _state_className : child === null || child === void 0 ? void 0 : child.props.className
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/renderOverflow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild } from '@fluentui/react-utilities';\nimport { OverflowContext } from '../../overflowContext';\nimport type { OverflowComponentState, OverflowContextValues } from './Overflow.types';\n\n/**\n * Render the final JSX of Overflow.\n *\n * Griffel-free so it can be reused by headless consumers; all class merging happens in\n * `useOverflowStyles_unstable`.\n */\nexport const renderOverflow_unstable = (\n state: OverflowComponentState,\n contextValues: OverflowContextValues,\n): React.ReactElement => {\n const child = getTriggerChild<HTMLElement>(state.children);\n\n const clonedChild = applyTriggerPropsToChildren(state.children, {\n ref: state.ref,\n className: state.className ?? child?.props.className,\n });\n\n return <OverflowContext.Provider value={contextValues.overflow}>{clonedChild}</OverflowContext.Provider>;\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","OverflowContext","renderOverflow_unstable","state","contextValues","child","children","clonedChild","ref","className","props","Provider","value","overflow"],"mappings":";;;;+BAWaI;;;;;;;iEAXU,QAAQ;gCAC8B,4BAA4B;iCACzD,2BAAwB;AASjD,gCAAgC,CACrCC,OACAC;IAEA,MAAMC,YAAQL,+BAAAA,EAA6BG,MAAMG,QAAQ;QAI5CH;IAFb,MAAMI,kBAAcR,2CAAAA,EAA4BI,MAAMG,QAAQ,EAAE;QAC9DE,KAAKL,MAAMK,GAAG;QACdC,WAAWN,CAAAA,mBAAAA,MAAMM,SAAAA,AAAS,MAAA,QAAfN,qBAAAA,KAAAA,IAAAA,mBAAmBE,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOK,KAAK,CAACD,SAAS;IACtD;IAEA,OAAA,WAAA,GAAO,OAAA,aAAA,CAACR,gCAAAA,CAAgBU,QAAQ,EAAA;QAACC,OAAOR,cAAcS,QAAQ;OAAGN;AACnE,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/renderOverflow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild } from '@fluentui/react-utilities';\nimport { OverflowContext } from '../../overflowContext';\nimport type { OverflowComponentState, OverflowContextValues } from './Overflow.types';\n\n/**\n * Render the final JSX of Overflow.\n *\n * Griffel-free so it can be reused by headless consumers; all class merging happens in\n * `useOverflowStyles_unstable`.\n */\nexport const renderOverflow_unstable = (\n state: OverflowComponentState,\n contextValues: OverflowContextValues,\n): React.ReactElement => {\n const child = getTriggerChild<HTMLElement>(state.children);\n\n const clonedChild = applyTriggerPropsToChildren(state.children, {\n ref: state.ref,\n className: state.className ?? child?.props.className,\n });\n\n return <OverflowContext.Provider value={contextValues.overflow}>{clonedChild}</OverflowContext.Provider>;\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","OverflowContext","renderOverflow_unstable","state","contextValues","child","children","clonedChild","ref","className","props","Provider","value","overflow"],"mappings":";;;;+BAWaI;;;;;;;iEAXU,QAAQ;gCAC8B,4BAA4B;iCACzD,2BAAwB;AASjD,gCAAgC,CACrCC,OACAC;QAMaD;IAJb,MAAME,YAAQL,+BAAAA,EAA6BG,MAAMG,QAAQ;IAEzD,MAAMC,kBAAcR,2CAAAA,EAA4BI,MAAMG,QAAQ,EAAE;QAC9DE,KAAKL,MAAMK,GAAG;QACdC,SAAS,EAAA,CAAEN,mBAAAA,MAAMM,SAAAA,AAAS,MAAA,QAAfN,qBAAAA,KAAAA,IAAAA,mBAAmBE,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOK,KAAK,CAACD,SAAS;IACtD;IAEA,OAAA,WAAA,GAAO,OAAA,aAAA,CAACR,gCAAAA,CAAgBU,QAAQ,EAAA;QAACC,OAAOR,cAAcS,QAAQ;OAAGN;AACnE,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Overflow/useOverflow.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport type { OnUpdateOverflow } from '@fluentui/priority-overflow';\nimport { getTriggerChild, getReactElementRef, useMergedRefs, useEventCallback } from '@fluentui/react-utilities';\n\nimport { updateVisibilityAttribute, useOverflowContainer } from '../../useOverflowContainer';\nimport type { OverflowComponentState, OverflowProps, OverflowState } from './Overflow.types';\n\n/**\n * The state required to render Overflow.\n *\n * @param props - props from this instance of Overflow\n * @param ref - reference forwarded to the single child's root element\n */\nexport const useOverflow_unstable = (props: OverflowProps, ref: React.Ref<HTMLElement>): OverflowComponentState => {\n const {\n children,\n minimumVisible,\n overflowAxis = 'horizontal',\n overflowDirection,\n padding,\n onOverflowChange,\n hasHiddenItems,\n } = props;\n\n const update: OnUpdateOverflow = useEventCallback(() => {\n // eslint-disable-next-line react-hooks/immutability\n const snapshot = getSnapshot();\n const state: OverflowState = {\n hasOverflow: snapshot.invisibleItemCount > 0,\n itemVisibility: snapshot.itemVisibility,\n groupVisibility: snapshot.groupVisibility,\n };\n onOverflowChange?.(null, state);\n });\n\n const {\n containerRef,\n getSnapshot,\n subscribe,\n registerItem,\n updateOverflow,\n forceUpdateOverflow,\n registerOverflowMenu,\n registerDivider,\n } = useOverflowContainer(update, {\n overflowDirection,\n overflowAxis,\n padding,\n minimumVisible,\n hasHiddenItems,\n onUpdateItemVisibility: updateVisibilityAttribute,\n });\n\n const child = getTriggerChild<HTMLElement>(children);\n\n return {\n containerRef,\n getSnapshot,\n subscribe,\n registerItem,\n updateOverflow,\n forceUpdateOverflow,\n registerOverflowMenu,\n registerDivider,\n ref: useMergedRefs(containerRef, ref, getReactElementRef(child)),\n children,\n };\n};\n"],"names":["getTriggerChild","getReactElementRef","useMergedRefs","useEventCallback","updateVisibilityAttribute","useOverflowContainer","useOverflow_unstable","props","ref","children","minimumVisible","overflowAxis","overflowDirection","padding","onOverflowChange","hasHiddenItems","update","snapshot","getSnapshot","state","hasOverflow","invisibleItemCount","itemVisibility","groupVisibility","containerRef","subscribe","registerItem","updateOverflow","forceUpdateOverflow","registerOverflowMenu","registerDivider","onUpdateItemVisibility","child"],"mappings":"AAAA;;;;;+BAeaM;;;;;;gCAXwE,4BAA4B;sCAEjD,gCAA6B;AAStF,6BAA6B,CAACC,OAAsBC;IACzD,MAAM,EACJC,QAAQ,EACRC,cAAc,EACdC,eAAe,YAAY,EAC3BC,iBAAiB,EACjBC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACf,GAAGR;IAEJ,MAAMS,aAA2Bb,gCAAAA,EAAiB;QAChD,oDAAoD;QACpD,MAAMc,WAAWC;QACjB,MAAMC,QAAuB;YAC3BC,aAAaH,SAASI,kBAAkB,GAAG;YAC3CC,gBAAgBL,SAASK,cAAc;YACvCC,iBAAiBN,SAASM,eAAe;QAC3C;QACAT,qBAAAA,QAAAA,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,iBAAmB,MAAMK;IAC3B;IAEA,MAAM,EACJK,YAAY,EACZN,WAAW,EACXO,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,mBAAmB,EACnBC,oBAAoB,EACpBC,eAAe,EAChB,OAAGzB,0CAAAA,EAAqBW,QAAQ;QAC/BJ;QACAD;QACAE;QACAH;QACAK;QACAgB,wBAAwB3B,+CAAAA;IAC1B;IAEA,MAAM4B,YAAQhC,+BAAAA,EAA6BS;IAE3C,OAAO;QACLe;QACAN;QACAO;QACAC;QACAC;QACAC;QACAC;QACAC;QACAtB,SAAKN,6BAAAA,EAAcsB,cAAchB,SAAKP,kCAAAA,EAAmB+B;QACzDvB;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Overflow/useOverflow.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport type { OnUpdateOverflow } from '@fluentui/priority-overflow';\nimport { getTriggerChild, getReactElementRef, useMergedRefs, useEventCallback } from '@fluentui/react-utilities';\n\nimport { updateVisibilityAttribute, useOverflowContainer } from '../../useOverflowContainer';\nimport type { OverflowComponentState, OverflowProps, OverflowState } from './Overflow.types';\n\n/**\n * The state required to render Overflow.\n *\n * @param props - props from this instance of Overflow\n * @param ref - reference forwarded to the single child's root element\n */\nexport const useOverflow_unstable = (props: OverflowProps, ref: React.Ref<HTMLElement>): OverflowComponentState => {\n const {\n children,\n minimumVisible,\n overflowAxis = 'horizontal',\n overflowDirection,\n padding,\n onOverflowChange,\n hasHiddenItems,\n } = props;\n\n const update: OnUpdateOverflow = useEventCallback(() => {\n // eslint-disable-next-line react-hooks/immutability\n const snapshot = getSnapshot();\n const state: OverflowState = {\n hasOverflow: snapshot.invisibleItemCount > 0,\n itemVisibility: snapshot.itemVisibility,\n groupVisibility: snapshot.groupVisibility,\n };\n onOverflowChange?.(null, state);\n });\n\n const {\n containerRef,\n getSnapshot,\n subscribe,\n registerItem,\n updateOverflow,\n forceUpdateOverflow,\n registerOverflowMenu,\n registerDivider,\n } = useOverflowContainer(update, {\n overflowDirection,\n overflowAxis,\n padding,\n minimumVisible,\n hasHiddenItems,\n onUpdateItemVisibility: updateVisibilityAttribute,\n });\n\n const child = getTriggerChild<HTMLElement>(children);\n\n return {\n containerRef,\n getSnapshot,\n subscribe,\n registerItem,\n updateOverflow,\n forceUpdateOverflow,\n registerOverflowMenu,\n registerDivider,\n ref: useMergedRefs(containerRef, ref, getReactElementRef(child)),\n children,\n };\n};\n"],"names":["getTriggerChild","getReactElementRef","useMergedRefs","useEventCallback","updateVisibilityAttribute","useOverflowContainer","useOverflow_unstable","props","ref","children","minimumVisible","overflowAxis","overflowDirection","padding","onOverflowChange","hasHiddenItems","update","snapshot","getSnapshot","state","hasOverflow","invisibleItemCount","itemVisibility","groupVisibility","containerRef","subscribe","registerItem","updateOverflow","forceUpdateOverflow","registerOverflowMenu","registerDivider","onUpdateItemVisibility","child"],"mappings":"AAAA;;;;;+BAeaM;;;;;;gCAXwE,4BAA4B;sCAEjD,gCAA6B;AAStF,6BAA6B,CAACC,OAAsBC;IACzD,MAAM,EACJC,QAAQ,EACRC,cAAc,EACdC,eAAe,YAAY,EAC3BC,iBAAiB,EACjBC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACf,GAAGR;IAEJ,MAAMS,aAA2Bb,gCAAAA,EAAiB;QAChD,oDAAoD;QACpD,MAAMc,WAAWC;QACjB,MAAMC,QAAuB;YAC3BC,aAAaH,SAASI,kBAAkB,GAAG;YAC3CC,gBAAgBL,SAASK,cAAc;YACvCC,iBAAiBN,SAASM,eAAe;QAC3C;QACAT,qBAAAA,QAAAA,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,iBAAmB,MAAMK;IAC3B;IAEA,MAAM,EACJK,YAAY,EACZN,WAAW,EACXO,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,mBAAmB,EACnBC,oBAAoB,EACpBC,eAAe,EAChB,OAAGzB,0CAAAA,EAAqBW,QAAQ;QAC/BJ;QACAD;QACAE;QACAH;QACAK;QACAgB,wBAAwB3B,+CAAAA;IAC1B;IAEA,MAAM4B,YAAQhC,+BAAAA,EAA6BS;IAE3C,OAAO;QACLe;QACAN;QACAO;QACAC;QACAC;QACAC;QACAC;QACAC;QACAtB,SAAKN,6BAAAA,EAAcsB,cAAchB,SAAKP,kCAAAA,EAAmB+B;QACzDvB;IACF;AACF,EAAE"}
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  function _export(target, all) {
7
7
  for(var name in all)Object.defineProperty(target, name, {
8
8
  enumerable: true,
9
- get: all[name]
9
+ get: Object.getOwnPropertyDescriptor(all, name).get
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
- useOverflowStyles: function() {
13
+ get useOverflowStyles () {
14
14
  return useOverflowStyles;
15
15
  },
16
- useOverflowStyles_unstable: function() {
16
+ get useOverflowStyles_unstable () {
17
17
  return useOverflowStyles_unstable;
18
18
  }
19
19
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["useOverflowStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from \"@griffel/react\";\nimport { getTriggerChild } from \"@fluentui/react-utilities\";\nimport { DATA_OVERFLOWING, DATA_OVERFLOW_MENU } from \"../../constants.js\";\nexport const useOverflowStyles = makeStyles({\n overflowMenu: {\n [`& [${DATA_OVERFLOW_MENU}]`]: {\n flexShrink: 0\n }\n },\n overflowingItems: {\n [`& [${DATA_OVERFLOWING}]`]: {\n display: 'none'\n }\n }\n});\nexport const useOverflowStyles_unstable = (state)=>{\n const styles = useOverflowStyles();\n const child = getTriggerChild(state.children);\n // eslint-disable-next-line react-hooks/immutability\n state.className = mergeClasses('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child === null || child === void 0 ? void 0 : child.props.className);\n return state;\n};\n"],"names":["__styles","mergeClasses","getTriggerChild","DATA_OVERFLOWING","DATA_OVERFLOW_MENU","useOverflowStyles","overflowMenu","Brvla84","overflowingItems","zb22lx","d","useOverflowStyles_unstable","state","styles","child","children","className","props"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAICK,iBAAiB;;;IAYjBM,0BAA0B;;;;uBAfE,gBAAgB;gCACzB,2BAA2B;AAEpD,0BAAuB,WAAA,OAAGX,eAAA,EAAA;IAAAM,YAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAC,gBAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;KAAA;AAAA,CAWhC,CAAC;AACK,oCAAoCE,KAAK,IAAG;IAC/C,MAAMC,MAAM,GAAGR,iBAAiB,CAAC,CAAC;IAClC,MAAMS,KAAK,OAAGZ,+BAAe,EAACU,KAAK,CAACG,QAAQ,CAAC;IAC7C,oDAAA;IACAH,KAAK,CAACI,SAAS,OAAGf,mBAAY,EAAC,cAAc,EAAEY,MAAM,CAACP,YAAY,EAAEO,MAAM,CAACL,gBAAgB,EAAEM,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,KAAK,CAACG,KAAK,CAACD,SAAS,CAAC;IACjK,OAAOJ,KAAK;AAChB,CAAC"}
1
+ {"version":3,"sources":["useOverflowStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from \"@griffel/react\";\nimport { getTriggerChild } from \"@fluentui/react-utilities\";\nimport { DATA_OVERFLOWING, DATA_OVERFLOW_MENU } from \"../../constants.js\";\nexport const useOverflowStyles = makeStyles({\n overflowMenu: {\n [`& [${DATA_OVERFLOW_MENU}]`]: {\n flexShrink: 0\n }\n },\n overflowingItems: {\n [`& [${DATA_OVERFLOWING}]`]: {\n display: 'none'\n }\n }\n});\nexport const useOverflowStyles_unstable = (state)=>{\n const styles = useOverflowStyles();\n const child = getTriggerChild(state.children);\n // eslint-disable-next-line react-hooks/immutability\n state.className = mergeClasses('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child === null || child === void 0 ? void 0 : child.props.className);\n return state;\n};\n"],"names":["__styles","mergeClasses","getTriggerChild","DATA_OVERFLOWING","DATA_OVERFLOW_MENU","useOverflowStyles","overflowMenu","Brvla84","overflowingItems","zb22lx","d","useOverflowStyles_unstable","state","styles","child","children","className","props"],"mappings":"AAAA,YAAY;;;;;;;;;;;;QAICK,iBAAiB;;;;eAYjBM,0BAA0B;;;uBAfE,gBAAgB;gCACzB,2BAA2B;AAEpD,0BAAuB,WAAA,OAAGX,eAAA,EAAA;IAAAM,YAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAC,gBAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;KAAA;AAAA,CAWhC,CAAC;AACK,oCAAoCE,KAAK,IAAG;IAC/C,MAAMC,MAAM,GAAGR,iBAAiB,CAAC,CAAC;IAClC,MAAMS,KAAK,OAAGZ,+BAAe,EAACU,KAAK,CAACG,QAAQ,CAAC;IAC7C,oDAAA;IACAH,KAAK,CAACI,SAAS,OAAGf,mBAAY,EAAC,cAAc,EAAEY,MAAM,CAACP,YAAY,EAAEO,MAAM,CAACL,gBAAgB,EAAEM,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,KAAK,CAACG,KAAK,CAACD,SAAS,CAAC;IACjK,OAAOJ,KAAK;AAChB,CAAC"}
@@ -0,0 +1,28 @@
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: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get useOverflowStyles () {
13
+ return useOverflowStyles;
14
+ },
15
+ get useOverflowStyles_unstable () {
16
+ return useOverflowStyles_unstable;
17
+ }
18
+ });
19
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
+ const _clsx = require("clsx");
21
+ const _reactutilities = require("@fluentui/react-utilities");
22
+ const _Overflowmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Overflow.module.css"));
23
+ const useOverflowStyles = ()=>_Overflowmodulecss.default;
24
+ const useOverflowStyles_unstable = (state)=>{
25
+ const child = (0, _reactutilities.getTriggerChild)(state.children);
26
+ state.className = (0, _clsx.clsx)('fui-Overflow', _Overflowmodulecss.default.overflowMenu, _Overflowmodulecss.default.overflowingItems, child === null || child === void 0 ? void 0 : child.props.className);
27
+ return state;
28
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Overflow/useOverflowStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport { getTriggerChild } from '@fluentui/react-utilities';\nimport styles from './Overflow.module.css';\nimport type { OverflowComponentState } from './Overflow.types';\n\nexport const useOverflowStyles = (): typeof styles => styles;\n\nexport const useOverflowStyles_unstable = (state: OverflowComponentState): OverflowComponentState => {\n const child = getTriggerChild<HTMLElement>(state.children);\n\n state.className = clsx('fui-Overflow', styles.overflowMenu, styles.overflowingItems, child?.props.className);\n\n return state;\n};\n"],"names":["clsx","getTriggerChild","styles","useOverflowStyles","useOverflowStyles_unstable","state","child","children","className","overflowMenu","overflowingItems","props"],"mappings":";;;;;;;;;;;QAKaG;;;;;;;;sBALQ,OAAO;gCACI,4BAA4B;4EACzC,wBAAwB;AAGpC,0BAA0B,IAAqBD,0BAAAA,CAAO;AAEtD,MAAME,6BAA6B,CAACC;IACzC,MAAMC,YAAQL,+BAAAA,EAA6BI,MAAME,QAAQ;IAEzDF,MAAMG,SAAS,OAAGR,UAAAA,EAAK,gBAAgBE,0BAAAA,CAAOO,YAAY,EAAEP,0BAAAA,CAAOQ,gBAAgB,EAAEJ,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOK,KAAK,CAACH,SAAS;IAE3G,OAAOH;AACT,EAAE"}
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  function _export(target, all) {
7
7
  for(var name in all)Object.defineProperty(target, name, {
8
8
  enumerable: true,
9
- get: all[name]
9
+ get: Object.getOwnPropertyDescriptor(all, name).get
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
- useOverflowStyles: function() {
13
+ get useOverflowStyles () {
14
14
  return useOverflowStyles;
15
15
  },
16
- useOverflowStyles_unstable: function() {
16
+ get useOverflowStyles_unstable () {
17
17
  return useOverflowStyles_unstable;
18
18
  }
19
19
  });