@fluentui/react-utilities 9.24.1 → 9.25.1

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 (93) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/dist/index.d.ts +47 -20
  3. package/lib/hooks/index.js +1 -0
  4. package/lib/hooks/index.js.map +1 -1
  5. package/lib/hooks/useAnimationFrame.js +1 -0
  6. package/lib/hooks/useAnimationFrame.js.map +1 -1
  7. package/lib/hooks/useApplyScrollbarWidth.js +40 -0
  8. package/lib/hooks/useApplyScrollbarWidth.js.map +1 -0
  9. package/lib/hooks/useBrowserTimer.js +1 -0
  10. package/lib/hooks/useBrowserTimer.js.map +1 -1
  11. package/lib/hooks/useControllableState.js +1 -0
  12. package/lib/hooks/useControllableState.js.map +1 -1
  13. package/lib/hooks/useEventCallback.js +1 -0
  14. package/lib/hooks/useEventCallback.js.map +1 -1
  15. package/lib/hooks/useFirstMount.js +1 -0
  16. package/lib/hooks/useFirstMount.js.map +1 -1
  17. package/lib/hooks/useForceUpdate.js +1 -0
  18. package/lib/hooks/useForceUpdate.js.map +1 -1
  19. package/lib/hooks/useId.js +1 -0
  20. package/lib/hooks/useId.js.map +1 -1
  21. package/lib/hooks/useMergedRefs.js +1 -0
  22. package/lib/hooks/useMergedRefs.js.map +1 -1
  23. package/lib/hooks/useOnClickOutside.js +1 -0
  24. package/lib/hooks/useOnClickOutside.js.map +1 -1
  25. package/lib/hooks/useOnScrollOutside.js +1 -0
  26. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  27. package/lib/hooks/usePrevious.js +1 -0
  28. package/lib/hooks/usePrevious.js.map +1 -1
  29. package/lib/hooks/useScrollbarWidth.js +4 -8
  30. package/lib/hooks/useScrollbarWidth.js.map +1 -1
  31. package/lib/hooks/useTimeout.js +1 -0
  32. package/lib/hooks/useTimeout.js.map +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/selection/useSelection.js +1 -0
  36. package/lib/selection/useSelection.js.map +1 -1
  37. package/lib/ssr/SSRContext.js +1 -0
  38. package/lib/ssr/SSRContext.js.map +1 -1
  39. package/lib/ssr/canUseDOM.js +2 -1
  40. package/lib/ssr/canUseDOM.js.map +1 -1
  41. package/lib/utils/index.js +1 -0
  42. package/lib/utils/index.js.map +1 -1
  43. package/lib/utils/measureScrollBarWidth.js +16 -0
  44. package/lib/utils/measureScrollBarWidth.js.map +1 -0
  45. package/lib/utils/types.js.map +1 -1
  46. package/lib-commonjs/hooks/index.js +4 -0
  47. package/lib-commonjs/hooks/index.js.map +1 -1
  48. package/lib-commonjs/hooks/useAnimationFrame.js +1 -0
  49. package/lib-commonjs/hooks/useAnimationFrame.js.map +1 -1
  50. package/lib-commonjs/hooks/useApplyScrollbarWidth.js +39 -0
  51. package/lib-commonjs/hooks/useApplyScrollbarWidth.js.map +1 -0
  52. package/lib-commonjs/hooks/useBrowserTimer.js +1 -0
  53. package/lib-commonjs/hooks/useBrowserTimer.js.map +1 -1
  54. package/lib-commonjs/hooks/useControllableState.js +1 -0
  55. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  56. package/lib-commonjs/hooks/useEventCallback.js +1 -0
  57. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  58. package/lib-commonjs/hooks/useFirstMount.js +1 -0
  59. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  60. package/lib-commonjs/hooks/useForceUpdate.js +1 -0
  61. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  62. package/lib-commonjs/hooks/useId.js +1 -0
  63. package/lib-commonjs/hooks/useId.js.map +1 -1
  64. package/lib-commonjs/hooks/useMergedRefs.js +1 -0
  65. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  66. package/lib-commonjs/hooks/useOnClickOutside.js +1 -0
  67. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  68. package/lib-commonjs/hooks/useOnScrollOutside.js +1 -0
  69. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  70. package/lib-commonjs/hooks/usePrevious.js +1 -0
  71. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  72. package/lib-commonjs/hooks/useScrollbarWidth.js +3 -8
  73. package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
  74. package/lib-commonjs/hooks/useTimeout.js +1 -0
  75. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  76. package/lib-commonjs/index.js +3 -0
  77. package/lib-commonjs/index.js.map +1 -1
  78. package/lib-commonjs/selection/useSelection.js +1 -0
  79. package/lib-commonjs/selection/useSelection.js.map +1 -1
  80. package/lib-commonjs/ssr/SSRContext.js +1 -0
  81. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  82. package/lib-commonjs/ssr/canUseDOM.js +2 -1
  83. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  84. package/lib-commonjs/utils/index.js +4 -0
  85. package/lib-commonjs/utils/index.js.map +1 -1
  86. package/lib-commonjs/utils/measureScrollBarWidth.js +26 -0
  87. package/lib-commonjs/utils/measureScrollBarWidth.js.map +1 -0
  88. package/lib-commonjs/utils/types.js.map +1 -1
  89. package/package.json +2 -2
  90. package/lib/utils/generated-types.js +0 -11
  91. package/lib/utils/generated-types.js.map +0 -1
  92. package/lib-commonjs/utils/generated-types.js +0 -12
  93. package/lib-commonjs/utils/generated-types.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useScrollbarWidth.ts"],"sourcesContent":["import * as React from 'react';\n\nconst cache = new WeakMap<Document, number>();\n\ninterface UseScrollbarWidthOptions {\n /**\n * Reference document to measure the scrollbar width\n */\n targetDocument: Document | null | undefined;\n\n /**\n * Does not use the cache and recalculates the scrollbar width\n */\n force?: boolean;\n}\n\n/**\n * @returns The width in pixels of the scrollbar in the user agent\n */\nexport function useScrollbarWidth(options: UseScrollbarWidthOptions): number | undefined {\n const { targetDocument, force } = options;\n return React.useMemo(() => {\n if (!targetDocument) {\n return 0;\n }\n\n if (!force && cache.has(targetDocument)) {\n return cache.get(targetDocument);\n }\n\n const outer = targetDocument.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n\n const inner = targetDocument.createElement('div');\n outer.appendChild(inner);\n\n targetDocument.body.appendChild(outer);\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.remove();\n cache.set(targetDocument, scrollbarWidth);\n return scrollbarWidth;\n }, [targetDocument, force]);\n}\n"],"names":["useScrollbarWidth","cache","WeakMap","options","targetDocument","force","React","useMemo","has","get","outer","createElement","style","visibility","overflow","inner","appendChild","body","scrollbarWidth","offsetWidth","remove","set"],"mappings":";;;;+BAmBgBA;;;eAAAA;;;;iEAnBO;AAEvB,MAAMC,QAAQ,IAAIC;AAiBX,SAASF,kBAAkBG,OAAiC;IACjE,MAAM,EAAEC,cAAc,EAAEC,KAAK,EAAE,GAAGF;IAClC,OAAOG,OAAMC,OAAO,CAAC;QACnB,IAAI,CAACH,gBAAgB;YACnB,OAAO;QACT;QAEA,IAAI,CAACC,SAASJ,MAAMO,GAAG,CAACJ,iBAAiB;YACvC,OAAOH,MAAMQ,GAAG,CAACL;QACnB;QAEA,MAAMM,QAAQN,eAAeO,aAAa,CAAC;QAC3CD,MAAME,KAAK,CAACC,UAAU,GAAG;QACzBH,MAAME,KAAK,CAACE,QAAQ,GAAG;QAEvB,MAAMC,QAAQX,eAAeO,aAAa,CAAC;QAC3CD,MAAMM,WAAW,CAACD;QAElBX,eAAea,IAAI,CAACD,WAAW,CAACN;QAChC,MAAMQ,iBAAiBR,MAAMS,WAAW,GAAGJ,MAAMI,WAAW;QAC5DT,MAAMU,MAAM;QACZnB,MAAMoB,GAAG,CAACjB,gBAAgBc;QAC1B,OAAOA;IACT,GAAG;QAACd;QAAgBC;KAAM;AAC5B"}
1
+ {"version":3,"sources":["../src/hooks/useScrollbarWidth.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { measureScrollbarWidth } from '../utils/measureScrollBarWidth';\n\nconst cache = new WeakMap<Document, number>();\n\ninterface UseScrollbarWidthOptions {\n /**\n * Reference document to measure the scrollbar width\n */\n targetDocument: Document | null | undefined;\n\n /**\n * Does not use the cache and recalculates the scrollbar width\n */\n force?: boolean;\n}\n\n/**\n * @returns The width in pixels of the scrollbar in the user agent\n * @remarks This hook is not SSR-safe. For SSR-safe scrollbar width application, use the `useApplyScrollbarWidth` from {@link file://./useApplyScrollbarWidth.ts} instead.\n */\nexport function useScrollbarWidth(options: UseScrollbarWidthOptions): number | undefined {\n const { targetDocument, force } = options;\n\n return React.useMemo(() => {\n if (!targetDocument) {\n return 0;\n }\n\n if (!force && cache.has(targetDocument)) {\n return cache.get(targetDocument);\n }\n\n const scrollbarWidth = measureScrollbarWidth(targetDocument);\n cache.set(targetDocument, scrollbarWidth);\n\n return scrollbarWidth;\n }, [targetDocument, force]);\n}\n"],"names":["useScrollbarWidth","cache","WeakMap","options","targetDocument","force","React","useMemo","has","get","scrollbarWidth","measureScrollbarWidth","set"],"mappings":"AAAA;;;;;+BAuBgBA;;;eAAAA;;;;iEArBO;uCACe;AAEtC,MAAMC,QAAQ,IAAIC;AAkBX,SAASF,kBAAkBG,OAAiC;IACjE,MAAM,EAAEC,cAAc,EAAEC,KAAK,EAAE,GAAGF;IAElC,OAAOG,OAAMC,OAAO,CAAC;QACnB,IAAI,CAACH,gBAAgB;YACnB,OAAO;QACT;QAEA,IAAI,CAACC,SAASJ,MAAMO,GAAG,CAACJ,iBAAiB;YACvC,OAAOH,MAAMQ,GAAG,CAACL;QACnB;QAEA,MAAMM,iBAAiBC,IAAAA,4CAAqB,EAACP;QAC7CH,MAAMW,GAAG,CAACR,gBAAgBM;QAE1B,OAAOA;IACT,GAAG;QAACN;QAAgBC;KAAM;AAC5B"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useTimeout.ts"],"sourcesContent":["import { useBrowserTimer } from './useBrowserTimer';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nconst setTimeoutNoop = (_callback: Function) => -1;\nconst clearTimeoutNoop = (_handle: number) => undefined;\n\n/**\n * @internal\n * Helper to manage a browser timeout.\n * Ensures that the timeout isn't set multiple times at once and is cleaned up\n * when the component is unloaded.\n *\n * @returns A pair of [setTimeout, clearTimeout] that are stable between renders.\n */\nexport function useTimeout(): readonly [(fn: () => void, delay?: number) => number, () => void] {\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n const setTimerFn = win ? win.setTimeout : setTimeoutNoop;\n const clearTimerFn = win ? win.clearTimeout : clearTimeoutNoop;\n\n return useBrowserTimer(setTimerFn, clearTimerFn);\n}\n"],"names":["useTimeout","setTimeoutNoop","_callback","clearTimeoutNoop","_handle","undefined","targetDocument","useFluent","win","defaultView","setTimerFn","setTimeout","clearTimerFn","clearTimeout","useBrowserTimer"],"mappings":";;;;+BAcgBA;;;eAAAA;;;iCAdgB;qCACgB;AAEhD,MAAMC,iBAAiB,CAACC,YAAwB,CAAC;AACjD,MAAMC,mBAAmB,CAACC,UAAoBC;AAUvC,SAASL;IACd,MAAM,EAAEM,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,MAAMF,2BAAAA,qCAAAA,eAAgBG,WAAW;IAEvC,MAAMC,aAAaF,MAAMA,IAAIG,UAAU,GAAGV;IAC1C,MAAMW,eAAeJ,MAAMA,IAAIK,YAAY,GAAGV;IAE9C,OAAOW,IAAAA,gCAAe,EAACJ,YAAYE;AACrC"}
1
+ {"version":3,"sources":["../src/hooks/useTimeout.ts"],"sourcesContent":["'use client';\n\nimport { useBrowserTimer } from './useBrowserTimer';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nconst setTimeoutNoop = (_callback: Function) => -1;\nconst clearTimeoutNoop = (_handle: number) => undefined;\n\n/**\n * @internal\n * Helper to manage a browser timeout.\n * Ensures that the timeout isn't set multiple times at once and is cleaned up\n * when the component is unloaded.\n *\n * @returns A pair of [setTimeout, clearTimeout] that are stable between renders.\n */\nexport function useTimeout(): readonly [(fn: () => void, delay?: number) => number, () => void] {\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n const setTimerFn = win ? win.setTimeout : setTimeoutNoop;\n const clearTimerFn = win ? win.clearTimeout : clearTimeoutNoop;\n\n return useBrowserTimer(setTimerFn, clearTimerFn);\n}\n"],"names":["useTimeout","setTimeoutNoop","_callback","clearTimeoutNoop","_handle","undefined","targetDocument","useFluent","win","defaultView","setTimerFn","setTimeout","clearTimerFn","clearTimeout","useBrowserTimer"],"mappings":"AAAA;;;;;+BAgBgBA;;;eAAAA;;;iCAdgB;qCACgB;AAEhD,MAAMC,iBAAiB,CAACC,YAAwB,CAAC;AACjD,MAAMC,mBAAmB,CAACC,UAAoBC;AAUvC,SAASL;IACd,MAAM,EAAEM,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,MAAMF,2BAAAA,qCAAAA,eAAgBG,WAAW;IAEvC,MAAMC,aAAaF,MAAMA,IAAIG,UAAU,GAAGV;IAC1C,MAAMW,eAAeJ,MAAMA,IAAIK,YAAY,GAAGV;IAE9C,OAAOW,IAAAA,gCAAe,EAACJ,YAAYE;AACrC"}
@@ -121,6 +121,9 @@ _export(exports, {
121
121
  useAnimationFrame: function() {
122
122
  return _index1.useAnimationFrame;
123
123
  },
124
+ useApplyScrollbarWidth: function() {
125
+ return _index1.useApplyScrollbarWidth;
126
+ },
124
127
  useControllableState: function() {
125
128
  return _index1.useControllableState;
126
129
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n slot,\n isSlot,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getSlots,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getSlotsNext,\n assertSlots,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n resolveShorthand,\n isResolvedShorthand,\n getIntrinsicElementProps,\n getSlotClassNameProp_unstable,\n SLOT_CLASS_NAME_PROP_SYMBOL,\n SLOT_ELEMENT_TYPE_SYMBOL,\n SLOT_RENDER_FUNCTION_SYMBOL,\n} from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n RefAttributes,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ResolveShorthandFunction,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ResolveShorthandOptions,\n Slot,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n UnknownSlotProps,\n SlotComponentType,\n SlotOptions,\n InferredElementRefType,\n EventData,\n EventHandler,\n} from './compose/index';\n\nexport {\n IdPrefixProvider,\n resetIdsForTests,\n useAnimationFrame,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useScrollbarWidth,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getNativeElementProps,\n getPartitionedNativeProps,\n getReactElementRef,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n omit,\n createPriorityQueue,\n} from './utils/index';\n\nexport type {\n DistributiveOmit,\n UnionToIntersection,\n JSXElement,\n JSXIntrinsicElement,\n JSXIntrinsicElementKeys,\n} from './utils/types';\n\nexport type { PriorityQueue } from './utils/priorityQueue';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n\n/**\n * Event utils\n */\nexport type { NativeTouchOrMouseEvent, ReactTouchOrMouseEvent, TouchOrMouseEvent } from './events/index';\nexport { isTouchEvent, isMouseEvent, getEventClientCoords } from './events/index';\n\nexport type {\n SelectionMode,\n OnSelectionChangeCallback,\n OnSelectionChangeData,\n SelectionItemId,\n SelectionHookParams,\n SelectionMethods,\n} from './selection/index';\nexport { useSelection } from './selection/index';\n\nexport { elementContains, setVirtualParent, getParent } from './virtualParent/index';\n"],"names":["IdPrefixProvider","SLOT_CLASS_NAME_PROP_SYMBOL","SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","SSRProvider","applyTriggerPropsToChildren","assertSlots","canUseDOM","clamp","createPriorityQueue","elementContains","getEventClientCoords","getIntrinsicElementProps","getNativeElementProps","getParent","getPartitionedNativeProps","getRTLSafeKey","getReactElementRef","getSlotClassNameProp_unstable","getSlots","getSlotsNext","getTriggerChild","isFluentTrigger","isHTMLElement","isInteractiveHTMLElement","isMouseEvent","isResolvedShorthand","isSlot","isTouchEvent","mergeCallbacks","omit","resetIdsForTests","resolveShorthand","setVirtualParent","slot","useAnimationFrame","useControllableState","useEventCallback","useFirstMount","useForceUpdate","useId","useIsSSR","useIsomorphicLayoutEffect","useMergedRefs","useOnClickOutside","useOnScrollOutside","usePrevious","useScrollbarWidth","useSelection","useTimeout"],"mappings":";;;;;;;;;;;IA2CEA,gBAAgB;eAAhBA,wBAAgB;;IA9BhBC,2BAA2B;eAA3BA,kCAA2B;;IAC3BC,wBAAwB;eAAxBA,+BAAwB;;IACxBC,2BAA2B;eAA3BA,kCAA2B;;IA8CCC,WAAW;eAAXA,mBAAW;;IA0BhCC,2BAA2B;eAA3BA,mCAA2B;;IAhFlCC,WAAW;eAAXA,kBAAW;;IAsDJC,SAAS;eAATA,iBAAS;;IAGhBC,KAAK;eAALA,aAAK;;IAULC,mBAAmB;eAAnBA,2BAAmB;;IAiCZC,eAAe;eAAfA,uBAAe;;IAZaC,oBAA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eAAZA,oBAAY;;IAhDnBC,UAAU;eAAVA,kBAAU;;;uBAzCL;wBA0CA;wBAG0C;wBAc1C;wBAYuE;wBAQb;wBAUpC;wBAEgC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n slot,\n isSlot,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getSlots,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getSlotsNext,\n assertSlots,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n resolveShorthand,\n isResolvedShorthand,\n getIntrinsicElementProps,\n getSlotClassNameProp_unstable,\n SLOT_CLASS_NAME_PROP_SYMBOL,\n SLOT_ELEMENT_TYPE_SYMBOL,\n SLOT_RENDER_FUNCTION_SYMBOL,\n} from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n RefAttributes,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ResolveShorthandFunction,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ResolveShorthandOptions,\n Slot,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n UnknownSlotProps,\n SlotComponentType,\n SlotOptions,\n InferredElementRefType,\n EventData,\n EventHandler,\n} from './compose/index';\n\nexport {\n IdPrefixProvider,\n resetIdsForTests,\n useAnimationFrame,\n useApplyScrollbarWidth,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useScrollbarWidth,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getNativeElementProps,\n getPartitionedNativeProps,\n getReactElementRef,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n omit,\n createPriorityQueue,\n} from './utils/index';\n\nexport type {\n DistributiveOmit,\n UnionToIntersection,\n JSXElement,\n JSXIntrinsicElement,\n JSXIntrinsicElementKeys,\n} from './utils/types';\n\nexport type { PriorityQueue } from './utils/priorityQueue';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n\n/**\n * Event utils\n */\nexport type { NativeTouchOrMouseEvent, ReactTouchOrMouseEvent, TouchOrMouseEvent } from './events/index';\nexport { isTouchEvent, isMouseEvent, getEventClientCoords } from './events/index';\n\nexport type {\n SelectionMode,\n OnSelectionChangeCallback,\n OnSelectionChangeData,\n SelectionItemId,\n SelectionHookParams,\n SelectionMethods,\n} from './selection/index';\nexport { useSelection } from './selection/index';\n\nexport { elementContains, setVirtualParent, getParent } from './virtualParent/index';\n"],"names":["IdPrefixProvider","SLOT_CLASS_NAME_PROP_SYMBOL","SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","SSRProvider","applyTriggerPropsToChildren","assertSlots","canUseDOM","clamp","createPriorityQueue","elementContains","getEventClientCoords","getIntrinsicElementProps","getNativeElementProps","getParent","getPartitionedNativeProps","getRTLSafeKey","getReactElementRef","getSlotClassNameProp_unstable","getSlots","getSlotsNext","getTriggerChild","isFluentTrigger","isHTMLElement","isInteractiveHTMLElement","isMouseEvent","isResolvedShorthand","isSlot","isTouchEvent","mergeCallbacks","omit","resetIdsForTests","resolveShorthand","setVirtualParent","slot","useAnimationFrame","useApplyScrollbarWidth","useControllableState","useEventCallback","useFirstMount","useForceUpdate","useId","useIsSSR","useIsomorphicLayoutEffect","useMergedRefs","useOnClickOutside","useOnScrollOutside","usePrevious","useScrollbarWidth","useSelection","useTimeout"],"mappings":";;;;;;;;;;;IA2CEA,gBAAgB;eA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IACtBC,oBAAoB;eAApBA,4BAAoB;;IACpBC,gBAAgB;eAAhBA,wBAAgB;;IAChBC,aAAa;eAAbA,qBAAa;;IACbC,cAAc;eAAdA,sBAAc;;IACdC,KAAK;eAALA,aAAK;;IAWaC,QAAQ;eAARA,gBAAQ;;IAV1BC,yBAAyB;eAAzBA,iCAAyB;;IACzBC,aAAa;eAAbA,qBAAa;;IACbC,iBAAiB;eAAjBA,yBAAiB;;IACjBC,kBAAkB;eAAlBA,0BAAkB;;IAClBC,WAAW;eAAXA,mBAAW;;IACXC,iBAAiB;eAAjBA,yBAAiB;;IAiDVC,YAAY;eAAZA,oBAAY;;IAhDnBC,UAAU;eAAVA,kBAAU;;;uBA1CL;wBA2CA;wBAG0C;wBAc1C;wBAYuE;wBAQb;wBAUpC;wBAEgC"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/selection/useSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionHookParams, SelectionItemId, SelectionMethods } from './types';\nimport { useControllableState } from '../hooks/useControllableState';\nimport { createSetFromIterable } from '../utils/createSetFromIterable';\n\nfunction useSelectionState(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, setSelected] = useControllableState<Set<SelectionItemId>>({\n initialState: new Set(),\n defaultState: React.useMemo(\n () => params.defaultSelectedItems && createSetFromIterable(params.defaultSelectedItems),\n [params.defaultSelectedItems],\n ),\n state: React.useMemo(\n () => params.selectedItems && createSetFromIterable(params.selectedItems),\n [params.selectedItems],\n ),\n });\n const changeSelection = (event: React.SyntheticEvent, nextSelectedItems: Set<SelectionItemId>) => {\n params.onSelectionChange?.(event, { selectedItems: nextSelectedItems });\n setSelected(nextSelectedItems);\n };\n return [selected, changeSelection] as const;\n}\n\nfunction useSingleSelection(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, changeSelection] = useSelectionState(params);\n const methods: SelectionMethods = {\n deselectItem: event => changeSelection(event, new Set()),\n selectItem: (event, itemId) => changeSelection(event, new Set([itemId])),\n toggleAllItems: () => {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('[react-utilities]: `toggleAllItems` should not be used in single selection mode');\n }\n },\n toggleItem: (event, itemId) => changeSelection(event, new Set([itemId])),\n clearItems: event => changeSelection(event, new Set()),\n isSelected: itemId => selected.has(itemId) ?? false,\n };\n return [selected, methods] as const;\n}\n\nfunction useMultipleSelection(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, changeSelection] = useSelectionState(params);\n const methods: SelectionMethods = {\n toggleItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n if (selected.has(itemId)) {\n nextSelectedItems.delete(itemId);\n } else {\n nextSelectedItems.add(itemId);\n }\n changeSelection(event, nextSelectedItems);\n },\n selectItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n nextSelectedItems.add(itemId);\n changeSelection(event, nextSelectedItems);\n },\n deselectItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n nextSelectedItems.delete(itemId);\n changeSelection(event, nextSelectedItems);\n },\n clearItems: event => {\n changeSelection(event, new Set());\n },\n isSelected: itemId => selected.has(itemId),\n toggleAllItems: (event, itemIds) => {\n const allItemsSelected = itemIds.every(itemId => selected.has(itemId));\n const nextSelectedItems = new Set(selected);\n if (allItemsSelected) {\n nextSelectedItems.clear();\n } else {\n itemIds.forEach(itemId => nextSelectedItems.add(itemId));\n }\n changeSelection(event, nextSelectedItems);\n },\n };\n return [selected, methods] as const;\n}\n\nexport function useSelection(params: SelectionHookParams): readonly [Set<SelectionItemId>, SelectionMethods] {\n 'use no memo';\n\n if (params.selectionMode === 'multiselect') {\n // selectionMode is a static value, so we can safely ignore rules-of-hooks\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useMultipleSelection(params);\n }\n // selectionMode is a static value, so we can safely ignore rules-of-hooks\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useSingleSelection(params);\n}\n"],"names":["useSelection","useSelectionState","params","selected","setSelected","useControllableState","initialState","Set","defaultState","React","useMemo","defaultSelectedItems","createSetFromIterable","state","selectedItems","changeSelection","event","nextSelectedItems","onSelectionChange","useSingleSelection","methods","deselectItem","selectItem","itemId","toggleAllItems","process","env","NODE_ENV","Error","toggleItem","clearItems","isSelected","has","useMultipleSelection","delete","add","itemIds","allItemsSelected","every","clear","forEach","selectionMode"],"mappings":";;;;+BAiFgBA;;;eAAAA;;;;iEAjFO;sCAEc;uCACC;AAEtC,SAASC,kBAAkBC,MAAkD;IAC3E,MAAM,CAACC,UAAUC,YAAY,GAAGC,IAAAA,0CAAoB,EAAuB;QACzEC,cAAc,IAAIC;QAClBC,cAAcC,OAAMC,OAAO,CACzB,IAAMR,OAAOS,oBAAoB,IAAIC,IAAAA,4CAAqB,EAACV,OAAOS,oBAAoB,GACtF;YAACT,OAAOS,oBAAoB;SAAC;QAE/BE,OAAOJ,OAAMC,OAAO,CAClB,IAAMR,OAAOY,aAAa,IAAIF,IAAAA,4CAAqB,EAACV,OAAOY,aAAa,GACxE;YAACZ,OAAOY,aAAa;SAAC;IAE1B;IACA,MAAMC,kBAAkB,CAACC,OAA6BC;YACpDf;SAAAA,4BAAAA,OAAOgB,iBAAiB,cAAxBhB,gDAAAA,+BAAAA,QAA2Bc,OAAO;YAAEF,eAAeG;QAAkB;QACrEb,YAAYa;IACd;IACA,OAAO;QAACd;QAAUY;KAAgB;AACpC;AAEA,SAASI,mBAAmBjB,MAAkD;IAC5E,MAAM,CAACC,UAAUY,gBAAgB,GAAGd,kBAAkBC;IACtD,MAAMkB,UAA4B;QAChCC,cAAcL,CAAAA,QAASD,gBAAgBC,OAAO,IAAIT;QAClDe,YAAY,CAACN,OAAOO,SAAWR,gBAAgBC,OAAO,IAAIT,IAAI;gBAACgB;aAAO;QACtEC,gBAAgB;YACd,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,MAAM,IAAI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G,CAACZ;YAClD;YACAR,gBAAgBC,OAAOC;QACzB;IACF;IACA,OAAO;QAACd;QAAUiB;KAAQ;AAC5B;AAEO,SAASpB,aAAaE,MAA2B;IACtD;IAEA,IAAIA,OAAOuC,aAAa,KAAK,eAAe;QAC1C,0EAA0E;QAC1E,sDAAsD;QACtD,OAAOR,qBAAqB/B;IAC9B;IACA,0EAA0E;IAC1E,sDAAsD;IACtD,OAAOiB,mBAAmBjB;AAC5B"}
1
+ {"version":3,"sources":["../src/selection/useSelection.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { SelectionHookParams, SelectionItemId, SelectionMethods } from './types';\nimport { useControllableState } from '../hooks/useControllableState';\nimport { createSetFromIterable } from '../utils/createSetFromIterable';\n\nfunction useSelectionState(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, setSelected] = useControllableState<Set<SelectionItemId>>({\n initialState: new Set(),\n defaultState: React.useMemo(\n () => params.defaultSelectedItems && createSetFromIterable(params.defaultSelectedItems),\n [params.defaultSelectedItems],\n ),\n state: React.useMemo(\n () => params.selectedItems && createSetFromIterable(params.selectedItems),\n [params.selectedItems],\n ),\n });\n const changeSelection = (event: React.SyntheticEvent, nextSelectedItems: Set<SelectionItemId>) => {\n params.onSelectionChange?.(event, { selectedItems: nextSelectedItems });\n setSelected(nextSelectedItems);\n };\n return [selected, changeSelection] as const;\n}\n\nfunction useSingleSelection(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, changeSelection] = useSelectionState(params);\n const methods: SelectionMethods = {\n deselectItem: event => changeSelection(event, new Set()),\n selectItem: (event, itemId) => changeSelection(event, new Set([itemId])),\n toggleAllItems: () => {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('[react-utilities]: `toggleAllItems` should not be used in single selection mode');\n }\n },\n toggleItem: (event, itemId) => changeSelection(event, new Set([itemId])),\n clearItems: event => changeSelection(event, new Set()),\n isSelected: itemId => selected.has(itemId) ?? false,\n };\n return [selected, methods] as const;\n}\n\nfunction useMultipleSelection(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, changeSelection] = useSelectionState(params);\n const methods: SelectionMethods = {\n toggleItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n if (selected.has(itemId)) {\n nextSelectedItems.delete(itemId);\n } else {\n nextSelectedItems.add(itemId);\n }\n changeSelection(event, nextSelectedItems);\n },\n selectItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n nextSelectedItems.add(itemId);\n changeSelection(event, nextSelectedItems);\n },\n deselectItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n nextSelectedItems.delete(itemId);\n changeSelection(event, nextSelectedItems);\n },\n clearItems: event => {\n changeSelection(event, new Set());\n },\n isSelected: itemId => selected.has(itemId),\n toggleAllItems: (event, itemIds) => {\n const allItemsSelected = itemIds.every(itemId => selected.has(itemId));\n const nextSelectedItems = new Set(selected);\n if (allItemsSelected) {\n nextSelectedItems.clear();\n } else {\n itemIds.forEach(itemId => nextSelectedItems.add(itemId));\n }\n changeSelection(event, nextSelectedItems);\n },\n };\n return [selected, methods] as const;\n}\n\nexport function useSelection(params: SelectionHookParams): readonly [Set<SelectionItemId>, SelectionMethods] {\n 'use no memo';\n\n if (params.selectionMode === 'multiselect') {\n // selectionMode is a static value, so we can safely ignore rules-of-hooks\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useMultipleSelection(params);\n }\n // selectionMode is a static value, so we can safely ignore rules-of-hooks\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useSingleSelection(params);\n}\n"],"names":["useSelection","useSelectionState","params","selected","setSelected","useControllableState","initialState","Set","defaultState","React","useMemo","defaultSelectedItems","createSetFromIterable","state","selectedItems","changeSelection","event","nextSelectedItems","onSelectionChange","useSingleSelection","methods","deselectItem","selectItem","itemId","toggleAllItems","process","env","NODE_ENV","Error","toggleItem","clearItems","isSelected","has","useMultipleSelection","delete","add","itemIds","allItemsSelected","every","clear","forEach","selectionMode"],"mappings":"AAAA;;;;;+B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-1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ssr/SSRContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from './canUseDOM';\n\n/**\n * To support SSR, the auto incrementing id counter is stored in a context. This allows it to be reset on every request\n * to ensure the client and server are consistent.\n *\n * @internal\n */\nexport type SSRContextValue = {\n current: number;\n};\n\n/**\n * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.\n *\n * @internal\n */\nexport const defaultSSRContextValue: SSRContextValue = {\n current: 0,\n};\n\nexport const SSRContext = React.createContext<SSRContextValue | undefined>(undefined) as React.Context<SSRContextValue>;\n\n/**\n * @internal\n */\nexport function useSSRContext(): SSRContextValue {\n return React.useContext(SSRContext) ?? defaultSSRContextValue;\n}\n\n/**\n * When using SSR with Fluent UI, applications must be wrapped in an SSRProvider. This ensures that auto generated ids\n * are consistent between the client and server.\n *\n * @public\n */\nexport const SSRProvider: React.FC<{ children: React.ReactNode }> = props => {\n const [value] = React.useState<SSRContextValue>(() => ({ current: 0 }));\n\n return <SSRContext.Provider value={value}>{props.children}</SSRContext.Provider>;\n};\n\n/**\n * Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay\n * browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.\n */\nexport function useIsSSR(): boolean {\n const isInSSRContext = useSSRContext() !== defaultSSRContextValue;\n const [isSSR, setIsSSR] = React.useState(isInSSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the\n // developer to add one.\n if (process.env.NODE_ENV !== 'production') {\n if (!isInSSRContext && !canUseDOM()) {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-components [${useIsSSR.name}]:\n When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.\n\n\n Check documentation at https://aka.ms/fluentui-ssr.\n `);\n }\n }\n\n // If on the client, and the component was initially server rendered, then schedule a layout effect to update the\n // component after hydration.\n if (canUseDOM() && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe because the condition never changes after\n // mounting.\n // eslint-disable-next-line\n React.useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return isSSR;\n}\n"],"names":["SSRContext","SSRProvider","defaultSSRContextValue","useIsSSR","useSSRContext","current","React","createContext","undefined","useContext","props","value","useState","Provider","children","isInSSRContext","isSSR","setIsSSR","process","env","NODE_ENV","canUseDOM","console","error","name","useLayoutEffect"],"mappings":";;;;;;;;;;;IAsBaA,UAAU;eAAVA;;IAeAC,WAAW;eAAXA;;IAnBAC,sBAAsB;eAAtBA;;IA6BGC,QAAQ;eAARA;;IApBAC,aAAa;eAAbA;;;;iEA3BO;2BACG;AAiBnB,MAAMF,yBAA0C;IACrDG,SAAS;AACX;AAEO,MAAML,2BAAaM,OAAMC,aAAa,CAA8BC;AAKpE,SAASJ;QACPE;IAAP,OAAOA,CAAAA,oBAAAA,OAAMG,UAAU,CAACT,yBAAjBM,+BAAAA,oBAAgCJ;AACzC;AAQO,MAAMD,cAAuDS,CAAAA;IAClE,MAAM,CAACC,MAAM,GAAGL,OAAMM,QAAQ,CAAkB,IAAO,CAAA;YAAEP,SAAS;QAAE,CAAA;IAEpE,qBAAO,qBAACL,WAAWa,QAAQ;QAACF,OAAOA;OAAQD,MAAMI,QAAQ;AAC3D;AAMO,SAASX;IACd,MAAMY,iBAAiBX,oBAAoBF;IAC3C,MAAM,CAACc,OAAOC,SAAS,GAAGX,OAAMM,QAAQ,CAACG;IAEzC,6GAA6G;IAC7G,wBAAwB;IACxB,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAI,CAACL,kBAAkB,CAACM,IAAAA,oBAAS,KAAI;YACnC,sCAAsC;YACtCC,QAAQC,KAAK,CAAuB,CAAC,4BACP,EAAEpB,SAASqB,IAAI,CAAC;;;;mDAK9C,CAAC;QACH;IACF;IAEA,iHAAiH;IACjH,6BAA6B;IAC7B,IAAIH,IAAAA,oBAAS,OAAMN,gBAAgB;QACjC,iHAAiH;QACjH,YAAY;QACZ,2BAA2B;QAC3BT,OAAMmB,eAAe,CAAC;YACpBR,SAAS;QACX,GAAG,EAAE;IACP;IAEA,OAAOD;AACT"}
1
+ {"version":3,"sources":["../src/ssr/SSRContext.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { canUseDOM } from './canUseDOM';\n\n/**\n * To support SSR, the auto incrementing id counter is stored in a context. This allows it to be reset on every request\n * to ensure the client and server are consistent.\n *\n * @internal\n */\nexport type SSRContextValue = {\n current: number;\n};\n\n/**\n * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.\n *\n * @internal\n */\nexport const defaultSSRContextValue: SSRContextValue = {\n current: 0,\n};\n\nexport const SSRContext = React.createContext<SSRContextValue | undefined>(undefined) as React.Context<SSRContextValue>;\n\n/**\n * @internal\n */\nexport function useSSRContext(): SSRContextValue {\n return React.useContext(SSRContext) ?? defaultSSRContextValue;\n}\n\n/**\n * When using SSR with Fluent UI, applications must be wrapped in an SSRProvider. This ensures that auto generated ids\n * are consistent between the client and server.\n *\n * @public\n */\nexport const SSRProvider: React.FC<{ children: React.ReactNode }> = props => {\n const [value] = React.useState<SSRContextValue>(() => ({ current: 0 }));\n\n return <SSRContext.Provider value={value}>{props.children}</SSRContext.Provider>;\n};\n\n/**\n * Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay\n * browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.\n */\nexport function useIsSSR(): boolean {\n const isInSSRContext = useSSRContext() !== defaultSSRContextValue;\n const [isSSR, setIsSSR] = React.useState(isInSSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the\n // developer to add one.\n if (process.env.NODE_ENV !== 'production') {\n if (!isInSSRContext && !canUseDOM()) {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-components [${useIsSSR.name}]:\n When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.\n\n\n Check documentation at https://aka.ms/fluentui-ssr.\n `);\n }\n }\n\n // If on the client, and the component was initially server rendered, then schedule a layout effect to update the\n // component after hydration.\n if (canUseDOM() && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe because the condition never changes after\n // mounting.\n // eslint-disable-next-line\n React.useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return isSSR;\n}\n"],"names":["SSRContext","SSRProvider","defaultSSRContextValue","useIsSSR","useSSRContext","current","React","createContext","undefined","useContext","props","value","useState","Provider","children","isInSSRContext","isSSR","setIsSSR","process","env","NODE_ENV","canUseDOM","console","error","name","useLayoutEffect"],"mappings":"AAAA;;;;;;;;;;;;IAwBaA,UAAU;eAAVA;;IAeAC,WAAW;eAAXA;;IAnBAC,sBAAsB;eAAtBA;;IA6BGC,QAAQ;eAARA;;IApBAC,aAAa;eAAbA;;;;iEA3BO;2BACG;AAiBnB,MAAMF,yBAA0C;IACrDG,SAAS;AACX;AAEO,MAAML,2BAAaM,OAAMC,aAAa,CAA8BC;AAKpE,SAASJ;QACPE;IAAP,OAAOA,CAAAA,oBAAAA,OAAMG,UAAU,CAACT,yBAAjBM,+BAAAA,oBAAgCJ;AACzC;AAQO,MAAMD,cAAuDS,CAAAA;IAClE,MAAM,CAACC,MAAM,GAAGL,OAAMM,QAAQ,CAAkB,IAAO,CAAA;YAAEP,SAAS;QAAE,CAAA;IAEpE,qBAAO,qBAACL,WAAWa,QAAQ;QAACF,OAAOA;OAAQD,MAAMI,QAAQ;AAC3D;AAMO,SAASX;IACd,MAAMY,iBAAiBX,oBAAoBF;IAC3C,MAAM,CAACc,OAAOC,SAAS,GAAGX,OAAMM,QAAQ,CAACG;IAEzC,6GAA6G;IAC7G,wBAAwB;IACxB,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAI,CAACL,kBAAkB,CAACM,IAAAA,oBAAS,KAAI;YACnC,sCAAsC;YACtCC,QAAQC,KAAK,CAAuB,CAAC,4BACP,EAAEpB,SAASqB,IAAI,CAAC;;;;mDAK9C,CAAC;QACH;IACF;IAEA,iHAAiH;IACjH,6BAA6B;IAC7B,IAAIH,IAAAA,oBAAS,OAAMN,gBAAgB;QACjC,iHAAiH;QACjH,YAAY;QACZ,2BAA2B;QAC3BT,OAAMmB,eAAe,CAAC;YACpBR,SAAS;QACX,GAAG,EAAE;IACP;IAEA,OAAOD;AACT"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Verifies if an application can use DOM.
3
- */ "use strict";
3
+ */ 'use client';
4
+ "use strict";
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ssr/canUseDOM.ts"],"sourcesContent":["/**\n * Verifies if an application can use DOM.\n */\nexport function canUseDOM(): boolean {\n return (\n /* eslint-disable @nx/workspace-no-restricted-globals -- expected ignore ( SSR friendly acquisition of globals )*/\n typeof window !== 'undefined' &&\n !!(\n window.document &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n window.document.createElement\n )\n /* eslint-enable @nx/workspace-no-restricted-globals */\n );\n}\n"],"names":["canUseDOM","window","document","createElement"],"mappings":"AAAA;;CAEC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA;IACd,OACE,gHAAgH,GAChH,OAAOC,WAAW,eAClB,CAAC,CACCA,CAAAA,OAAOC,QAAQ,IACf,4DAA4D;IAC5DD,OAAOC,QAAQ,CAACC,aAAa,AAAD;AAIlC"}
1
+ {"version":3,"sources":["../src/ssr/canUseDOM.ts"],"sourcesContent":["/**\n * Verifies if an application can use DOM.\n */\n\n'use client';\n\nexport function canUseDOM(): boolean {\n return (\n /* eslint-disable @nx/workspace-no-restricted-globals -- expected ignore ( SSR friendly acquisition of globals )*/\n typeof window !== 'undefined' &&\n !!(\n window.document &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n window.document.createElement\n )\n /* eslint-enable @nx/workspace-no-restricted-globals */\n );\n}\n"],"names":["canUseDOM","window","document","createElement"],"mappings":"AAAA;;CAEC,GAED;;;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA;IACd,OACE,gHAAgH,GAChH,OAAOC,WAAW,eAClB,CAAC,CACCA,CAAAA,OAAOC,QAAQ,IACf,4DAA4D;IAC5DD,OAAOC,QAAQ,CAACC,aAAa,AAAD;AAIlC"}
@@ -88,6 +88,9 @@ _export(exports, {
88
88
  liProperties: function() {
89
89
  return _properties.liProperties;
90
90
  },
91
+ measureScrollbarWidth: function() {
92
+ return _measureScrollBarWidth.measureScrollbarWidth;
93
+ },
91
94
  mergeCallbacks: function() {
92
95
  return _mergeCallbacks.mergeCallbacks;
93
96
  },
@@ -138,3 +141,4 @@ const _properties = require("./properties");
138
141
  const _isHTMLElement = require("./isHTMLElement");
139
142
  const _isInteractiveHTMLElement = require("./isInteractiveHTMLElement");
140
143
  const _priorityQueue = require("./priorityQueue");
144
+ const _measureScrollBarWidth = require("./measureScrollBarWidth");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { clamp } from './clamp';\nexport {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getNativeElementProps,\n getPartitionedNativeProps,\n} from './getNativeElementProps';\nexport { getReactElementRef } from './getReactElementRef';\nexport { getRTLSafeKey } from './getRTLSafeKey';\nexport { mergeCallbacks } from './mergeCallbacks';\nexport { omit } from './omit';\nexport {\n anchorProperties,\n audioProperties,\n baseElementEvents,\n baseElementProperties,\n buttonProperties,\n colGroupProperties,\n colProperties,\n dialogProperties,\n divProperties,\n fieldsetProperties,\n formProperties,\n getNativeProps,\n htmlElementProperties,\n iframeProperties,\n imgProperties,\n inputProperties,\n labelProperties,\n liProperties,\n microdataProperties,\n olProperties,\n optionProperties,\n selectProperties,\n tableProperties,\n tdProperties,\n textAreaProperties,\n thProperties,\n timeProperties,\n trProperties,\n videoProperties,\n} from './properties';\nexport { isHTMLElement } from './isHTMLElement';\nexport { isInteractiveHTMLElement } from './isInteractiveHTMLElement';\nexport type { PriorityQueue, PriorityQueueCompareFn } from './priorityQueue';\nexport { createPriorityQueue } from './priorityQueue';\n"],"names":["anchorProperties","audioProperties","baseElementEvents","baseElementProperties","buttonProperties","clamp","colGroupProperties","colProperties","createPriorityQueue","dialogProperties","divProperties","fieldsetProperties","formProperties","getNativeElementProps","getNativeProps","getPartitionedNativeProps","getRTLSafeKey","getReactElementRef","htmlElementProperties","iframeProperties","imgProperties","inputProperties","isHTMLElement","isInteractiveHTMLElement","labelProperties","liProperties","mergeCallbacks","microdataProperties","olProperties","omit","optionProperties","selectProperties","tableProperties","tdProperties","textAreaProperties","thProperties","timeProperties","trProperties","videoProperties"],"mappings":";;;;;;;;;;;IAWEA,gBAAgB;eAAhBA,4BAAgB;;IAChBC,eAAe;eAAfA,2BAAe;;IACfC,iBAAiB;eAAjBA,6BAAiB;;IACjBC,qBAAqB;eAArBA,iCAAqB;;IACrBC,gBAAgB;eAAhBA,4BAAgB;;IAfTC,KAAK;eAALA,YAAK;;IAgBZC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,aAAa;eAAbA,yBAAa;;IA2BNC,mBAAmB;eAAnBA,kCAAmB;;IA1B1BC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,aAAa;eAAbA,yBAAa;;IACbC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,cAAc;eAAdA,0BAAc;;IAnBd,4DAA4D;IAC5DC,qBAAqB;eAArBA,4CAAqB;;IAmBrBC,cAAc;eAAdA,0BAAc;;IAlBdC,yBAAyB;eAAzBA,gDAAyB;;IAGlBC,aAAa;eAAbA,4BAAa;;IADbC,kBAAkB;eAAlBA,sCAAkB;;IAiBzBC,qBAAqB;eAArBA,iCAAqB;;IACrBC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,aAAa;eAAbA,yBAAa;;IACbC,eAAe;eAAfA,2BAAe;;IAeRC,aAAa;eAAbA,4BAAa;;IACbC,wBAAwB;eAAxBA,kDAAwB;;IAf/BC,eAAe;eAAfA,2BAAe;;IACfC,YAAY;eAAZA,wBAAY;;IApBLC,cAAc;eAAdA,8BAAc;;IAqBrBC,mBAAmB;eAAnBA,+BAAmB;;IACnBC,YAAY;eAAZA,wBAAY;;IArBLC,IAAI;eAAJA,UAAI;;IAsBXC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,eAAe;eAAfA,2BAAe;;IACfC,YAAY;eAAZA,wBAAY;;IACZC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,YAAY;eAAZA,wBAAY;;IACZC,cAAc;eAAdA,0BAAc;;IACdC,YAAY;eAAZA,wBAAY;;IACZC,eAAe;eAAfA,2BAAe;;;uBAvCK;uCAKf;oCAC4B;+BACL;gCACC;sBACV;4BA+Bd;+BACuB;0CACW;+BAEL"}
1
+ {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { clamp } from './clamp';\nexport {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getNativeElementProps,\n getPartitionedNativeProps,\n} from './getNativeElementProps';\nexport { getReactElementRef } from './getReactElementRef';\nexport { getRTLSafeKey } from './getRTLSafeKey';\nexport { mergeCallbacks } from './mergeCallbacks';\nexport { omit } from './omit';\nexport {\n anchorProperties,\n audioProperties,\n baseElementEvents,\n baseElementProperties,\n buttonProperties,\n colGroupProperties,\n colProperties,\n dialogProperties,\n divProperties,\n fieldsetProperties,\n formProperties,\n getNativeProps,\n htmlElementProperties,\n iframeProperties,\n imgProperties,\n inputProperties,\n labelProperties,\n liProperties,\n microdataProperties,\n olProperties,\n optionProperties,\n selectProperties,\n tableProperties,\n tdProperties,\n textAreaProperties,\n thProperties,\n timeProperties,\n trProperties,\n videoProperties,\n} from './properties';\nexport { isHTMLElement } from './isHTMLElement';\nexport { isInteractiveHTMLElement } from './isInteractiveHTMLElement';\nexport type { PriorityQueue, PriorityQueueCompareFn } from './priorityQueue';\nexport { createPriorityQueue } from './priorityQueue';\nexport { measureScrollbarWidth } from './measureScrollBarWidth';\n"],"names":["anchorProperties","audioProperties","baseElementEvents","baseElementProperties","buttonProperties","clamp","colGroupProperties","colProperties","createPriorityQueue","dialogProperties","divProperties","fieldsetProperties","formProperties","getNativeElementProps","getNativeProps","getPartitionedNativeProps","getRTLSafeKey","getReactElementRef","htmlElementProperties","iframeProperties","imgProperties","inputProperties","isHTMLElement","isInteractiveHTMLElement","labelProperties","liProperties","measureScrollbarWidth","mergeCallbacks","microdataProperties","olProperties","omit","optionProperties","selectProperties","tableProperties","tdProperties","textAreaProperties","thProperties","timeProperties","trProperties","videoProperties"],"mappings":";;;;;;;;;;;IAWEA,gBAAgB;eAAhBA,4BAAgB;;IAChBC,eAAe;eAAfA,2BAAe;;IACfC,iBAAiB;eAAjBA,6BAAiB;;IACjBC,qBAAqB;eAArBA,iCAAqB;;IACrBC,gBAAgB;eAAhBA,4BAAgB;;IAfTC,KAAK;eAALA,YAAK;;IAgBZC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,aAAa;eAAbA,yBAAa;;IA2BNC,mBAAmB;eAAnBA,kCAAmB;;IA1B1BC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,aAAa;eAAbA,yBAAa;;IACbC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,cAAc;eAAdA,0BAAc;;IAnBd,4DAA4D;IAC5DC,qBAAqB;eAArBA,4CAAqB;;IAmBrBC,cAAc;eAAdA,0BAAc;;IAlBdC,yBAAyB;eAAzBA,gDAAyB;;IAGlBC,aAAa;eAAbA,4BAAa;;IADbC,kBAAkB;eAAlBA,sCAAkB;;IAiBzBC,qBAAqB;eAArBA,iCAAqB;;IACrBC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,aAAa;eAAbA,yBAAa;;IACbC,eAAe;eAAfA,2BAAe;;IAeRC,aAAa;eAAbA,4BAAa;;IACbC,wBAAwB;eAAxBA,kDAAwB;;IAf/BC,eAAe;eAAfA,2BAAe;;IACfC,YAAY;eAAZA,wBAAY;;IAiBLC,qBAAqB;eAArBA,4CAAqB;;IArCrBC,cAAc;eAAdA,8BAAc;;IAqBrBC,mBAAmB;eAAnBA,+BAAmB;;IACnBC,YAAY;eAAZA,wBAAY;;IArBLC,IAAI;eAAJA,UAAI;;IAsBXC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,eAAe;eAAfA,2BAAe;;IACfC,YAAY;eAAZA,wBAAY;;IACZC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,YAAY;eAAZA,wBAAY;;IACZC,cAAc;eAAdA,0BAAc;;IACdC,YAAY;eAAZA,wBAAY;;IACZC,eAAe;eAAfA,2BAAe;;;uBAvCK;uCAKf;oCAC4B;+BACL;gCACC;sBACV;4BA+Bd;+BACuB;0CACW;+BAEL;uCACE"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Measures the width of the scrollbar for the given document.
3
+ *
4
+ * @param targetDocument - Document to measure the scrollbar width
5
+ * @returns The width of the scrollbar in pixels
6
+ */ "use strict";
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ Object.defineProperty(exports, "measureScrollbarWidth", {
11
+ enumerable: true,
12
+ get: function() {
13
+ return measureScrollbarWidth;
14
+ }
15
+ });
16
+ function measureScrollbarWidth(targetDocument) {
17
+ const outer = targetDocument.createElement('div');
18
+ outer.style.visibility = 'hidden';
19
+ outer.style.overflow = 'scroll';
20
+ const inner = targetDocument.createElement('div');
21
+ outer.appendChild(inner);
22
+ targetDocument.body.appendChild(outer);
23
+ const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
24
+ outer.remove();
25
+ return scrollbarWidth;
26
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/measureScrollBarWidth.ts"],"sourcesContent":["/**\n * Measures the width of the scrollbar for the given document.\n *\n * @param targetDocument - Document to measure the scrollbar width\n * @returns The width of the scrollbar in pixels\n */\nexport function measureScrollbarWidth(targetDocument: Document): number {\n const outer = targetDocument.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n\n const inner = targetDocument.createElement('div');\n outer.appendChild(inner);\n\n targetDocument.body.appendChild(outer);\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.remove();\n\n return scrollbarWidth;\n}\n"],"names":["measureScrollbarWidth","targetDocument","outer","createElement","style","visibility","overflow","inner","appendChild","body","scrollbarWidth","offsetWidth","remove"],"mappings":"AAAA;;;;;CAKC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,sBAAsBC,cAAwB;IAC5D,MAAMC,QAAQD,eAAeE,aAAa,CAAC;IAC3CD,MAAME,KAAK,CAACC,UAAU,GAAG;IACzBH,MAAME,KAAK,CAACE,QAAQ,GAAG;IAEvB,MAAMC,QAAQN,eAAeE,aAAa,CAAC;IAC3CD,MAAMM,WAAW,CAACD;IAElBN,eAAeQ,IAAI,CAACD,WAAW,CAACN;IAChC,MAAMQ,iBAAiBR,MAAMS,WAAW,GAAGJ,MAAMI,WAAW;IAC5DT,MAAMU,MAAM;IAEZ,OAAOF;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { JSXIntrinsicElementKeysCompat, JSXIntrinsicElementKeysLatest } from './generated-types';\n\n/**\n * Helper type that works similar to Omit,\n * but when modifying an union type it will distribute the omission to all the union members.\n *\n * See [distributive conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types) for more information\n */\n// Traditional Omit is basically equivalent to => Pick<T, Exclude<keyof T, K>>\n//\n// let's say we have Omit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Pick<{ a: string } | { b: string }, Exclude<keyof ({ a: string } | { b: string }), 'a'>>\n// The expected result would be {} | { b: string }, the omission of 'a' from all the union members,\n// but keyof ({ a: string } | { b: string }) is never as they don't share common keys\n// so Exclude<never, 'a'> is never,\n// and Pick<{ a: string } | { b: string }, never> is {}.\n//\n// With DistributiveOmit on the other hand it becomes like this:\n// DistributiveOmit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Omit<{ a: string }, 'a'> | Omit<{ b: string }, 'a'>\n// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },\n// so the result is {} | { b: string }, as expected.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : T;\n\n/**\n * @public\n *\n * Helper type that works similar to Pick,\n * but when modifying an union type it will distribute the picking to all the union members.\n *\n * See {@link https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types} for more information\n */\nexport type DistributivePick<T, K> = T extends unknown ? Pick<T, K & keyof T> : never;\n\n/**\n * Converts a union type (`A | B | C`) to an intersection type (`A & B & C`)\n */\nexport type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends (x: infer I) => U ? I : never;\n\n/**\n * @internal\n * If type T includes `null`, remove it and add `undefined` instead.\n */\nexport type ReplaceNullWithUndefined<T> = T extends null ? Exclude<T, null> | undefined : T;\n\n/**\n * @internal\n * With react 18, our `children` type starts leaking everywhere and that causes conflicts on component declaration, specially in the `propTypes` property of\n * both `ComponentClass` and `FunctionComponent`.\n *\n * This type substitutes `React.ComponentType` only keeping the function signature, it omits `propTypes`, `displayName` and other properties that are not\n * required for the inference.\n */\nexport type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;\n\n/**\n * @internal\n *\n * On types/react 18 there are two types being delivered,\n * they rely on the typescript version to decide which will be consumed {@link https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b59dc3ac1e2770fbd6cdbb90ba52abe04c168196/types/react/package.json#L10}\n *\n * If TS is higher than 5.0 then the `FunctionComponent` will be returning ReactNode (which we don't support)\n * If TS is below or equal to 5.0 then the `FunctionComponent` will be returning ReactElement | null (which we support)\n *\n * Since it's not possible to have a single type that works for both cases\n * (as ReactNode is more specific, and this will break while evaluating functions),\n * we need to create our own `FunctionComponent` type\n * that will work for both cases.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport interface FunctionComponent<P> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (props: P): any;\n displayName?: string;\n}\n\nexport type FC<P> = FunctionComponent<P>;\n\nexport interface ExoticComponent<P> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (props: P): any;\n $$typeof: symbol;\n}\n\nexport interface NamedExoticComponent<P> extends ExoticComponent<P> {\n displayName?: string;\n}\n\n/**\n * @internal\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport interface ComponentClass<P = {}, S = React.ComponentState> extends React.StaticLifecycle<P, S> {\n new (props: P): React.Component<P, S>;\n}\n\n/**\n * @internal\n *\n * on types/react 18 ReactNode becomes a more strict type, which is not compatible with our current implementation. to avoid any issues we are creating our own ReactNode type which allows anything.\n *\n * This type should only be used for inference purposes, and should never be exposed.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n *\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ReactNode = any;\n\n/**\n * Removes the 'ref' prop from the given Props type, leaving unions intact (such as the discriminated union created by\n * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.\n */\nexport type PropsWithoutRef<P> = 'ref' extends keyof P ? DistributiveOmit<P, 'ref'> : P;\n\n/**\n * Removes the 'children' prop from the given Props type, leaving unions intact (such as the discriminated union created by\n * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.\n */\nexport type PropsWithoutChildren<P> = 'children' extends keyof P ? DistributiveOmit<P, 'children'> : P;\n\n/**\n * @internal\n *\n * This type is used to determine if the current version of React is 18+ or not.\n *\n * It checks if the `React.ReactNode` has `{}` it its type.\n * If it is, then it means that the current version of React is lower than 18.\n * If it is not, then it means that the current version of React is 18 or higher.\n * This is useful for ensuring compatibility with different versions of React.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport type ReactVersionDependent<Modern, Legacy> = {} extends React.ReactNode ? Legacy : Modern;\n\n/**\n * Our own alias for `JSX.Element` type that is compatible with both React 17 and React 18+.\n * Use this type when annotating JSX markup in all our code in order to avoid issues between different React versions.\n *\n * Example usage:\n *\n * BAD:\n * ```tsx\n * const renderFoo = (state: FooState) = <div {...props}>Hello World</div>;\n * // infers\n * // R17: declare const renderFoo: (state: FooState) => JSX.Element;\n * // R18+: declare const renderFoo: (state: FooState) => React.JSX.Element;\n * ```\n *\n * GOOD:\n * ```tsx\n * import type { JSXElement } from '@fluentui/react-utilities';\n * const renderFoo = (state: FooState): JSXElement = <div {...props}>Hello World</div>;\n * ```\n */\nexport type JSXElement = React.ReactElement<\n /* eslint-disable @typescript-eslint/no-explicit-any */\n any,\n any\n /* eslint-enable @typescript-eslint/no-explicit-any */\n>;\n\n/**\n * Union of all intrinsic element keys in React.\n * Based on the React version, it will either be the latest set of intrinsic elements or the legacy set.\n */\nexport type JSXIntrinsicElementKeys = ReactVersionDependent<\n JSXIntrinsicElementKeysLatest,\n JSXIntrinsicElementKeysCompat\n>;\n\n/**\n * Our own alias for `JSX.IntrinsicElements` type that is compatible with both React 17 and React 18+.\n * Use this type to get the intrinsic elements from React types in order to avoid issues between different React versions.\n */\nexport type JSXIntrinsicElement<Element extends JSXIntrinsicElementKeys> = React.ComponentProps<Element>;\n"],"names":[],"mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["../src/utils/types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Helper type that works similar to Omit,\n * but when modifying an union type it will distribute the omission to all the union members.\n *\n * See [distributive conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types) for more information\n */\n// Traditional Omit is basically equivalent to => Pick<T, Exclude<keyof T, K>>\n//\n// let's say we have Omit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Pick<{ a: string } | { b: string }, Exclude<keyof ({ a: string } | { b: string }), 'a'>>\n// The expected result would be {} | { b: string }, the omission of 'a' from all the union members,\n// but keyof ({ a: string } | { b: string }) is never as they don't share common keys\n// so Exclude<never, 'a'> is never,\n// and Pick<{ a: string } | { b: string }, never> is {}.\n//\n// With DistributiveOmit on the other hand it becomes like this:\n// DistributiveOmit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Omit<{ a: string }, 'a'> | Omit<{ b: string }, 'a'>\n// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },\n// so the result is {} | { b: string }, as expected.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : T;\n\n/**\n * @public\n *\n * Helper type that works similar to Pick,\n * but when modifying an union type it will distribute the picking to all the union members.\n *\n * See {@link https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types} for more information\n */\nexport type DistributivePick<T, K> = T extends unknown ? Pick<T, K & keyof T> : never;\n\n/**\n * Converts a union type (`A | B | C`) to an intersection type (`A & B & C`)\n */\nexport type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends (x: infer I) => U ? I : never;\n\n/**\n * @internal\n * If type T includes `null`, remove it and add `undefined` instead.\n */\nexport type ReplaceNullWithUndefined<T> = T extends null ? Exclude<T, null> | undefined : T;\n\n/**\n * @internal\n * With react 18, our `children` type starts leaking everywhere and that causes conflicts on component declaration, specially in the `propTypes` property of\n * both `ComponentClass` and `FunctionComponent`.\n *\n * This type substitutes `React.ComponentType` only keeping the function signature, it omits `propTypes`, `displayName` and other properties that are not\n * required for the inference.\n */\nexport type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;\n\n/**\n * @internal\n *\n * On types/react 18 there are two types being delivered,\n * they rely on the typescript version to decide which will be consumed {@link https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b59dc3ac1e2770fbd6cdbb90ba52abe04c168196/types/react/package.json#L10}\n *\n * If TS is higher than 5.0 then the `FunctionComponent` will be returning ReactNode (which we don't support)\n * If TS is below or equal to 5.0 then the `FunctionComponent` will be returning ReactElement | null (which we support)\n *\n * Since it's not possible to have a single type that works for both cases\n * (as ReactNode is more specific, and this will break while evaluating functions),\n * we need to create our own `FunctionComponent` type\n * that will work for both cases.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport interface FunctionComponent<P> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (props: P): any;\n displayName?: string;\n}\n\nexport type FC<P> = FunctionComponent<P>;\n\nexport interface ExoticComponent<P> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (props: P): any;\n $$typeof: symbol;\n}\n\nexport interface NamedExoticComponent<P> extends ExoticComponent<P> {\n displayName?: string;\n}\n\n/**\n * @internal\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport interface ComponentClass<P = {}, S = React.ComponentState> extends React.StaticLifecycle<P, S> {\n new (props: P): React.Component<P, S>;\n}\n\n/**\n * @internal\n *\n * on types/react 18 ReactNode becomes a more strict type, which is not compatible with our current implementation. to avoid any issues we are creating our own ReactNode type which allows anything.\n *\n * This type should only be used for inference purposes, and should never be exposed.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n *\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ReactNode = any;\n\n/**\n * Removes the 'ref' prop from the given Props type, leaving unions intact (such as the discriminated union created by\n * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.\n */\nexport type PropsWithoutRef<P> = 'ref' extends keyof P ? DistributiveOmit<P, 'ref'> : P;\n\n/**\n * Removes the 'children' prop from the given Props type, leaving unions intact (such as the discriminated union created by\n * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.\n */\nexport type PropsWithoutChildren<P> = 'children' extends keyof P ? DistributiveOmit<P, 'children'> : P;\n\n/**\n * @internal\n *\n * This type is used to determine if the current version of React is 18+ or not.\n *\n * It checks if the `React.ReactNode` has `{}` it its type.\n * If it is, then it means that the current version of React is lower than 18.\n * If it is not, then it means that the current version of React is 18 or higher.\n * This is useful for ensuring compatibility with different versions of React.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport type ReactVersionDependent<Modern, Legacy> = {} extends React.ReactNode ? Legacy : Modern;\n\n/**\n * Our own alias for `JSX.Element` type that is compatible with both React 17 and React 18+.\n * Use this type when annotating JSX markup in all our code in order to avoid issues between different React versions.\n *\n * Example usage:\n *\n * BAD:\n * ```tsx\n * const renderFoo = (state: FooState) = <div {...props}>Hello World</div>;\n * // infers\n * // R17: declare const renderFoo: (state: FooState) => JSX.Element;\n * // R18+: declare const renderFoo: (state: FooState) => React.JSX.Element;\n * ```\n *\n * GOOD:\n * ```tsx\n * import type { JSXElement } from '@fluentui/react-utilities';\n * const renderFoo = (state: FooState): JSXElement = <div {...props}>Hello World</div>;\n * ```\n */\nexport type JSXElement = React.ReactElement<\n /* eslint-disable @typescript-eslint/no-explicit-any */\n any,\n any\n /* eslint-enable @typescript-eslint/no-explicit-any */\n>;\n\n/**\n * Type representing all valid JSX intrinsic element names (e.g., 'div', 'button', 'input').\n * It's derived from `React.ElementType` by excluding all custom component types (`React.ComponentType`), ensuring it only includes standard HTML and SVG elements.\n *\n * Use this type when you need to restrict a type to only valid intrinsic element names.\n *\n * @example\n * ```tsx\n * import * as React from 'react';\n * import type { JSXIntrinsicElementKeys } from '@fluentui/react-utilities';\n *\n * const createElement = (tag: JSXIntrinsicElementKeys) => React.createElement(tag, {});\n *\n * createElement('div'); // Valid\n * createElement('span'); // Valid\n * createElement('unknown'); // Error: Argument of type '\"unknown\"' is not assignable to parameter of type 'JSXIntrinsicElementKeys'.\n * ```\n *\n * This type helps ensure that only valid intrinsic elements are used in scenarios where custom components are not allowed.\n */\nexport type JSXIntrinsicElementKeys = Exclude<React.ElementType, React.ComponentType>;\n\n/**\n * Our own alias for `JSX.IntrinsicElements` type that is compatible with both React 17 and React 18+.\n * Use this type to get the intrinsic elements from React types in order to avoid issues between different React versions.\n */\nexport type JSXIntrinsicElement<Element extends JSXIntrinsicElementKeys> = React.ComponentProps<Element>;\n"],"names":[],"mappings":";;;;;iEAAuB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-utilities",
3
- "version": "9.24.1",
3
+ "version": "9.25.1",
4
4
  "description": "A set of general React-specific utilities.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@fluentui/keyboard-keys": "^9.0.8",
21
- "@fluentui/react-shared-contexts": "^9.25.1",
21
+ "@fluentui/react-shared-contexts": "^9.25.2",
22
22
  "@swc/helpers": "^0.5.1"
23
23
  },
24
24
  "peerDependencies": {
@@ -1,11 +0,0 @@
1
- /**
2
- * ============================================
3
- * 💡 DO NOT EDIT THIS FILE.
4
- * - This file is automatically generated and should not be edited manually.
5
- * - To regenerate run `yarn nx run react-utilities:build`.
6
- * ============================================
7
- */ /**
8
- * Unwrapped type for 'keyof JSX.IntrinsicElement'. (Backwards compatible with older versions of '\@types/react')
9
- */ /**
10
- * Unwrapped type for 'keyof JSX.IntrinsicElement'
11
- */ export { };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/generated-types.ts"],"sourcesContent":["/**\n * ============================================\n * 💡 DO NOT EDIT THIS FILE.\n * - This file is automatically generated and should not be edited manually.\n * - To regenerate run `yarn nx run react-utilities:build`.\n * ============================================\n */\n\n/**\n * Unwrapped type for 'keyof JSX.IntrinsicElement'. (Backwards compatible with older versions of '\\@types/react')\n */\nexport type JSXIntrinsicElementKeysCompat =\n | 'a'\n | 'abbr'\n | 'address'\n | 'animate'\n | 'animateMotion'\n | 'animateTransform'\n | 'area'\n | 'article'\n | 'aside'\n | 'audio'\n | 'b'\n | 'base'\n | 'bdi'\n | 'bdo'\n | 'big'\n | 'blockquote'\n | 'body'\n | 'br'\n | 'button'\n | 'canvas'\n | 'caption'\n | 'circle'\n | 'cite'\n | 'clipPath'\n | 'code'\n | 'col'\n | 'colgroup'\n | 'data'\n | 'datalist'\n | 'dd'\n | 'defs'\n | 'del'\n | 'desc'\n | 'details'\n | 'dfn'\n | 'dialog'\n | 'div'\n | 'dl'\n | 'dt'\n | 'ellipse'\n | 'em'\n | 'embed'\n | 'feBlend'\n | 'feColorMatrix'\n | 'feComponentTransfer'\n | 'feComposite'\n | 'feConvolveMatrix'\n | 'feDiffuseLighting'\n | 'feDisplacementMap'\n | 'feDistantLight'\n | 'feDropShadow'\n | 'feFlood'\n | 'feFuncA'\n | 'feFuncB'\n | 'feFuncG'\n | 'feFuncR'\n | 'feGaussianBlur'\n | 'feImage'\n | 'feMerge'\n | 'feMergeNode'\n | 'feMorphology'\n | 'feOffset'\n | 'fePointLight'\n | 'feSpecularLighting'\n | 'feSpotLight'\n | 'feTile'\n | 'feTurbulence'\n | 'fieldset'\n | 'figcaption'\n | 'figure'\n | 'filter'\n | 'footer'\n | 'foreignObject'\n | 'form'\n | 'g'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'head'\n | 'header'\n | 'hgroup'\n | 'hr'\n | 'html'\n | 'i'\n | 'iframe'\n | 'image'\n | 'img'\n | 'input'\n | 'ins'\n | 'kbd'\n | 'keygen'\n | 'label'\n | 'legend'\n | 'li'\n | 'line'\n | 'linearGradient'\n | 'link'\n | 'main'\n | 'map'\n | 'mark'\n | 'marker'\n | 'mask'\n | 'menu'\n | 'menuitem'\n | 'meta'\n | 'metadata'\n | 'meter'\n | 'mpath'\n | 'nav'\n | 'noindex'\n | 'noscript'\n | 'object'\n | 'ol'\n | 'optgroup'\n | 'option'\n | 'output'\n | 'p'\n | 'param'\n | 'path'\n | 'pattern'\n | 'picture'\n | 'polygon'\n | 'polyline'\n | 'pre'\n | 'progress'\n | 'q'\n | 'radialGradient'\n | 'rect'\n | 'rp'\n | 'rt'\n | 'ruby'\n | 's'\n | 'samp'\n | 'script'\n | 'section'\n | 'select'\n | 'slot'\n | 'small'\n | 'source'\n | 'span'\n | 'stop'\n | 'strong'\n | 'style'\n | 'sub'\n | 'summary'\n | 'sup'\n | 'svg'\n | 'switch'\n | 'symbol'\n | 'table'\n | 'tbody'\n | 'td'\n | 'template'\n | 'text'\n | 'textPath'\n | 'textarea'\n | 'tfoot'\n | 'th'\n | 'thead'\n | 'time'\n | 'title'\n | 'tr'\n | 'track'\n | 'tspan'\n | 'u'\n | 'ul'\n | 'use'\n | 'var'\n | 'video'\n | 'view'\n | 'wbr'\n | 'webview';\n/**\n * Unwrapped type for 'keyof JSX.IntrinsicElement'\n */\nexport type JSXIntrinsicElementKeysLatest = 'set' | 'center' | 'search' | JSXIntrinsicElementKeysCompat;\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED;;CAEC,GAiLD;;CAEC,GACD,WAAwG"}
@@ -1,12 +0,0 @@
1
- /**
2
- * ============================================
3
- * 💡 DO NOT EDIT THIS FILE.
4
- * - This file is automatically generated and should not be edited manually.
5
- * - To regenerate run `yarn nx run react-utilities:build`.
6
- * ============================================
7
- */ /**
8
- * Unwrapped type for 'keyof JSX.IntrinsicElement'. (Backwards compatible with older versions of '\@types/react')
9
- */ "use strict";
10
- Object.defineProperty(exports, "__esModule", {
11
- value: true
12
- });
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/generated-types.ts"],"sourcesContent":["/**\n * ============================================\n * 💡 DO NOT EDIT THIS FILE.\n * - This file is automatically generated and should not be edited manually.\n * - To regenerate run `yarn nx run react-utilities:build`.\n * ============================================\n */\n\n/**\n * Unwrapped type for 'keyof JSX.IntrinsicElement'. (Backwards compatible with older versions of '\\@types/react')\n */\nexport type JSXIntrinsicElementKeysCompat =\n | 'a'\n | 'abbr'\n | 'address'\n | 'animate'\n | 'animateMotion'\n | 'animateTransform'\n | 'area'\n | 'article'\n | 'aside'\n | 'audio'\n | 'b'\n | 'base'\n | 'bdi'\n | 'bdo'\n | 'big'\n | 'blockquote'\n | 'body'\n | 'br'\n | 'button'\n | 'canvas'\n | 'caption'\n | 'circle'\n | 'cite'\n | 'clipPath'\n | 'code'\n | 'col'\n | 'colgroup'\n | 'data'\n | 'datalist'\n | 'dd'\n | 'defs'\n | 'del'\n | 'desc'\n | 'details'\n | 'dfn'\n | 'dialog'\n | 'div'\n | 'dl'\n | 'dt'\n | 'ellipse'\n | 'em'\n | 'embed'\n | 'feBlend'\n | 'feColorMatrix'\n | 'feComponentTransfer'\n | 'feComposite'\n | 'feConvolveMatrix'\n | 'feDiffuseLighting'\n | 'feDisplacementMap'\n | 'feDistantLight'\n | 'feDropShadow'\n | 'feFlood'\n | 'feFuncA'\n | 'feFuncB'\n | 'feFuncG'\n | 'feFuncR'\n | 'feGaussianBlur'\n | 'feImage'\n | 'feMerge'\n | 'feMergeNode'\n | 'feMorphology'\n | 'feOffset'\n | 'fePointLight'\n | 'feSpecularLighting'\n | 'feSpotLight'\n | 'feTile'\n | 'feTurbulence'\n | 'fieldset'\n | 'figcaption'\n | 'figure'\n | 'filter'\n | 'footer'\n | 'foreignObject'\n | 'form'\n | 'g'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'head'\n | 'header'\n | 'hgroup'\n | 'hr'\n | 'html'\n | 'i'\n | 'iframe'\n | 'image'\n | 'img'\n | 'input'\n | 'ins'\n | 'kbd'\n | 'keygen'\n | 'label'\n | 'legend'\n | 'li'\n | 'line'\n | 'linearGradient'\n | 'link'\n | 'main'\n | 'map'\n | 'mark'\n | 'marker'\n | 'mask'\n | 'menu'\n | 'menuitem'\n | 'meta'\n | 'metadata'\n | 'meter'\n | 'mpath'\n | 'nav'\n | 'noindex'\n | 'noscript'\n | 'object'\n | 'ol'\n | 'optgroup'\n | 'option'\n | 'output'\n | 'p'\n | 'param'\n | 'path'\n | 'pattern'\n | 'picture'\n | 'polygon'\n | 'polyline'\n | 'pre'\n | 'progress'\n | 'q'\n | 'radialGradient'\n | 'rect'\n | 'rp'\n | 'rt'\n | 'ruby'\n | 's'\n | 'samp'\n | 'script'\n | 'section'\n | 'select'\n | 'slot'\n | 'small'\n | 'source'\n | 'span'\n | 'stop'\n | 'strong'\n | 'style'\n | 'sub'\n | 'summary'\n | 'sup'\n | 'svg'\n | 'switch'\n | 'symbol'\n | 'table'\n | 'tbody'\n | 'td'\n | 'template'\n | 'text'\n | 'textPath'\n | 'textarea'\n | 'tfoot'\n | 'th'\n | 'thead'\n | 'time'\n | 'title'\n | 'tr'\n | 'track'\n | 'tspan'\n | 'u'\n | 'ul'\n | 'use'\n | 'var'\n | 'video'\n | 'view'\n | 'wbr'\n | 'webview';\n/**\n * Unwrapped type for 'keyof JSX.IntrinsicElement'\n */\nexport type JSXIntrinsicElementKeysLatest = 'set' | 'center' | 'search' | JSXIntrinsicElementKeysCompat;\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED;;CAEC"}