@fluentui/react-utilities 0.0.0-nightly-20221228-0425.1 → 0.0.0-nightly-20221229-0425.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 (126) hide show
  1. package/CHANGELOG.json +5 -5
  2. package/CHANGELOG.md +5 -5
  3. package/lib/compose/getSlots.js +0 -8
  4. package/lib/compose/getSlots.js.map +1 -1
  5. package/lib/compose/isResolvedShorthand.js +0 -1
  6. package/lib/compose/isResolvedShorthand.js.map +1 -1
  7. package/lib/compose/resolveShorthand.js +2 -6
  8. package/lib/compose/resolveShorthand.js.map +1 -1
  9. package/lib/hooks/useControllableState.js +6 -12
  10. package/lib/hooks/useControllableState.js.map +1 -1
  11. package/lib/hooks/useEventCallback.js +0 -1
  12. package/lib/hooks/useEventCallback.js.map +1 -1
  13. package/lib/hooks/useFirstMount.js +0 -3
  14. package/lib/hooks/useFirstMount.js.map +1 -1
  15. package/lib/hooks/useForceUpdate.js +0 -1
  16. package/lib/hooks/useForceUpdate.js.map +1 -1
  17. package/lib/hooks/useId.js +0 -3
  18. package/lib/hooks/useId.js.map +1 -1
  19. package/lib/hooks/useIsomorphicLayoutEffect.js +0 -1
  20. package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  21. package/lib/hooks/useMergedRefs.js +2 -3
  22. package/lib/hooks/useMergedRefs.js.map +1 -1
  23. package/lib/hooks/useOnClickOutside.js +8 -26
  24. package/lib/hooks/useOnClickOutside.js.map +1 -1
  25. package/lib/hooks/useOnScrollOutside.js +0 -4
  26. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  27. package/lib/hooks/usePrevious.js +0 -1
  28. package/lib/hooks/usePrevious.js.map +1 -1
  29. package/lib/hooks/useTimeout.js +2 -3
  30. package/lib/hooks/useTimeout.js.map +1 -1
  31. package/lib/index.js.map +1 -1
  32. package/lib/ssr/SSRContext.js +4 -11
  33. package/lib/ssr/SSRContext.js.map +1 -1
  34. package/lib/ssr/canUseDOM.js +2 -1
  35. package/lib/ssr/canUseDOM.js.map +1 -1
  36. package/lib/trigger/applyTriggerPropsToChildren.js +2 -6
  37. package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
  38. package/lib/trigger/getTriggerChild.js +2 -3
  39. package/lib/trigger/getTriggerChild.js.map +1 -1
  40. package/lib/trigger/isFluentTrigger.js.map +1 -1
  41. package/lib/utils/getNativeElementProps.js +0 -2
  42. package/lib/utils/getNativeElementProps.js.map +1 -1
  43. package/lib/utils/getRTLSafeKey.js +0 -2
  44. package/lib/utils/getRTLSafeKey.js.map +1 -1
  45. package/lib/utils/getReactCallbackName.js +0 -3
  46. package/lib/utils/getReactCallbackName.js.map +1 -1
  47. package/lib/utils/isHTMLElement.js +0 -1
  48. package/lib/utils/isHTMLElement.js.map +1 -1
  49. package/lib/utils/isInteractiveHTMLElement.js +0 -4
  50. package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
  51. package/lib/utils/mergeCallbacks.js.map +1 -1
  52. package/lib/utils/omit.js +0 -2
  53. package/lib/utils/omit.js.map +1 -1
  54. package/lib/utils/properties.js +7 -36
  55. package/lib/utils/properties.js.map +1 -1
  56. package/lib-commonjs/compose/getSlots.js +0 -12
  57. package/lib-commonjs/compose/getSlots.js.map +1 -1
  58. package/lib-commonjs/compose/index.js +0 -5
  59. package/lib-commonjs/compose/index.js.map +1 -1
  60. package/lib-commonjs/compose/isResolvedShorthand.js +0 -4
  61. package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
  62. package/lib-commonjs/compose/resolveShorthand.js +2 -9
  63. package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
  64. package/lib-commonjs/compose/types.js.map +1 -1
  65. package/lib-commonjs/hooks/index.js +0 -12
  66. package/lib-commonjs/hooks/index.js.map +1 -1
  67. package/lib-commonjs/hooks/useControllableState.js +6 -14
  68. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  69. package/lib-commonjs/hooks/useEventCallback.js +0 -5
  70. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  71. package/lib-commonjs/hooks/useFirstMount.js +0 -6
  72. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  73. package/lib-commonjs/hooks/useForceUpdate.js +0 -4
  74. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  75. package/lib-commonjs/hooks/useId.js +0 -8
  76. package/lib-commonjs/hooks/useId.js.map +1 -1
  77. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js +0 -4
  78. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  79. package/lib-commonjs/hooks/useMergedRefs.js +2 -6
  80. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  81. package/lib-commonjs/hooks/useOnClickOutside.js +8 -30
  82. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  83. package/lib-commonjs/hooks/useOnScrollOutside.js +0 -8
  84. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  85. package/lib-commonjs/hooks/usePrevious.js +0 -4
  86. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  87. package/lib-commonjs/hooks/useTimeout.js +2 -6
  88. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  89. package/lib-commonjs/index.js +0 -10
  90. package/lib-commonjs/index.js.map +1 -1
  91. package/lib-commonjs/ssr/SSRContext.js +4 -17
  92. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  93. package/lib-commonjs/ssr/canUseDOM.js +2 -3
  94. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  95. package/lib-commonjs/ssr/index.js +0 -3
  96. package/lib-commonjs/ssr/index.js.map +1 -1
  97. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js +2 -10
  98. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
  99. package/lib-commonjs/trigger/getTriggerChild.js +2 -7
  100. package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
  101. package/lib-commonjs/trigger/index.js +0 -5
  102. package/lib-commonjs/trigger/index.js.map +1 -1
  103. package/lib-commonjs/trigger/isFluentTrigger.js +0 -2
  104. package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
  105. package/lib-commonjs/trigger/types.js.map +1 -1
  106. package/lib-commonjs/utils/clamp.js +0 -2
  107. package/lib-commonjs/utils/clamp.js.map +1 -1
  108. package/lib-commonjs/utils/getNativeElementProps.js +0 -6
  109. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  110. package/lib-commonjs/utils/getRTLSafeKey.js +0 -4
  111. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  112. package/lib-commonjs/utils/getReactCallbackName.js +0 -5
  113. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
  114. package/lib-commonjs/utils/index.js +0 -9
  115. package/lib-commonjs/utils/index.js.map +1 -1
  116. package/lib-commonjs/utils/isHTMLElement.js +0 -3
  117. package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
  118. package/lib-commonjs/utils/isInteractiveHTMLElement.js +0 -7
  119. package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
  120. package/lib-commonjs/utils/mergeCallbacks.js +0 -2
  121. package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
  122. package/lib-commonjs/utils/omit.js +0 -4
  123. package/lib-commonjs/utils/omit.js.map +1 -1
  124. package/lib-commonjs/utils/properties.js +7 -38
  125. package/lib-commonjs/utils/properties.js.map +1 -1
  126. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/hooks/usePrevious.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,WAAW,GAAyB,KAAtB,IAA0C;EACnE,MAAM,GAAG,GAAG,KAAK,CAAC,MAAN,CAA+B,IAA/B,CAAZ;EACA,KAAK,CAAC,SAAN,CAAgB,MAAK;IACnB,GAAG,CAAC,OAAJ,GAAc,KAAd;EACD,CAFD,EAEG,CAAC,KAAD,CAFH;EAGA,OAAO,GAAG,CAAC,OAAX;AACD,CANM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX","sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n */\nexport const usePrevious = <ValueType = unknown>(value: ValueType) => {\n const ref = React.useRef<ValueType | null>(null);\n React.useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n};\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAEA;;;AAGO,MAAMA,WAAW,GAAyBC,KAAgB,IAAI;EACnE,MAAMC,GAAG,GAAGC,KAAK,CAACC,MAAM,CAAmB,IAAI,CAAC;EAChDD,KAAK,CAACE,SAAS,CAAC,MAAK;IACnBH,GAAG,CAACI,OAAO,GAAGL,KAAK;EACrB,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EACX,OAAOC,GAAG,CAACI,OAAO;AACpB,CAAC;AANYC,mBAAW","names":["usePrevious","value","ref","React","useRef","useEffect","current","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/hooks/usePrevious.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n */\nexport const usePrevious = <ValueType = unknown>(value: ValueType) => {\n const ref = React.useRef<ValueType | null>(null);\n React.useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n};\n"]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useTimeout = void 0;
7
-
8
7
  const React = /*#__PURE__*/require("react");
9
8
  /**
10
9
  * @internal
@@ -14,8 +13,6 @@ const React = /*#__PURE__*/require("react");
14
13
  *
15
14
  * @returns A pair of [setTimeout, clearTimeout] that are stable between renders.
16
15
  */
17
-
18
-
19
16
  function useTimeout() {
20
17
  const [timeout] = React.useState(() => ({
21
18
  id: undefined,
@@ -29,11 +26,10 @@ function useTimeout() {
29
26
  timeout.id = undefined;
30
27
  }
31
28
  }
32
- })); // Clean up the timeout when the component is unloaded
33
-
29
+ }));
30
+ // Clean up the timeout when the component is unloaded
34
31
  React.useEffect(() => timeout.clear, [timeout]);
35
32
  return [timeout.set, timeout.clear];
36
33
  }
37
-
38
34
  exports.useTimeout = useTimeout;
39
35
  //# sourceMappingURL=useTimeout.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/hooks/useTimeout.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAEA;;;;;;;AAOG;;;AACH,SAAgB,UAAhB,GAA0B;EACxB,MAAM,CAAC,OAAD,IAAY,KAAK,CAAC,QAAN,CAAe,OAAO;IACtC,EAAE,EAAE,SADkC;IAEtC,GAAG,EAAE,CAAC,EAAD,EAAiB,KAAjB,KAAkC;MACrC,OAAO,CAAC,KAAR;MACA,OAAO,CAAC,EAAR,GAAa,UAAU,CAAC,EAAD,EAAK,KAAL,CAAvB;IACD,CALqC;IAMtC,KAAK,EAAE,MAAK;MACV,IAAI,OAAO,CAAC,EAAR,KAAe,SAAnB,EAA8B;QAC5B,YAAY,CAAC,OAAO,CAAC,EAAT,CAAZ;QACA,OAAO,CAAC,EAAR,GAAa,SAAb;MACD;IACF;EAXqC,CAAP,CAAf,CAAlB,CADwB,CAexB;;EACA,KAAK,CAAC,SAAN,CAAgB,MAAM,OAAO,CAAC,KAA9B,EAAqC,CAAC,OAAD,CAArC;EAEA,OAAO,CAAC,OAAO,CAAC,GAAT,EAAc,OAAO,CAAC,KAAtB,CAAP;AACD;;AAnBD,OAAA,CAAA,UAAA,GAAA,UAAA","sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * Helper to manage a browser timeout.\n * Ensures that the timeout isn't set multiple times at once,\n * and is cleaned up when the component is unloaded.\n *\n * @returns A pair of [setTimeout, clearTimeout] that are stable between renders.\n */\nexport function useTimeout() {\n const [timeout] = React.useState(() => ({\n id: undefined as ReturnType<typeof setTimeout> | undefined,\n set: (fn: () => void, delay: number) => {\n timeout.clear();\n timeout.id = setTimeout(fn, delay);\n },\n clear: () => {\n if (timeout.id !== undefined) {\n clearTimeout(timeout.id);\n timeout.id = undefined;\n }\n },\n }));\n\n // Clean up the timeout when the component is unloaded\n React.useEffect(() => timeout.clear, [timeout]);\n\n return [timeout.set, timeout.clear] as const;\n}\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAEA;;;;;;;;AAQA,SAAgBA,UAAU;EACxB,MAAM,CAACC,OAAO,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,OAAO;IACtCC,EAAE,EAAEC,SAAsD;IAC1DC,GAAG,EAAE,CAACC,EAAc,EAAEC,KAAa,KAAI;MACrCP,OAAO,CAACQ,KAAK,EAAE;MACfR,OAAO,CAACG,EAAE,GAAGM,UAAU,CAACH,EAAE,EAAEC,KAAK,CAAC;IACpC,CAAC;IACDC,KAAK,EAAE,MAAK;MACV,IAAIR,OAAO,CAACG,EAAE,KAAKC,SAAS,EAAE;QAC5BM,YAAY,CAACV,OAAO,CAACG,EAAE,CAAC;QACxBH,OAAO,CAACG,EAAE,GAAGC,SAAS;;IAE1B;GACD,CAAC,CAAC;EAEH;EACAH,KAAK,CAACU,SAAS,CAAC,MAAMX,OAAO,CAACQ,KAAK,EAAE,CAACR,OAAO,CAAC,CAAC;EAE/C,OAAO,CAACA,OAAO,CAACK,GAAG,EAAEL,OAAO,CAACQ,KAAK,CAAU;AAC9C;AAnBAI","names":["useTimeout","timeout","React","useState","id","undefined","set","fn","delay","clear","setTimeout","clearTimeout","useEffect","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/hooks/useTimeout.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * Helper to manage a browser timeout.\n * Ensures that the timeout isn't set multiple times at once,\n * and is cleaned up when the component is unloaded.\n *\n * @returns A pair of [setTimeout, clearTimeout] that are stable between renders.\n */\nexport function useTimeout() {\n const [timeout] = React.useState(() => ({\n id: undefined as ReturnType<typeof setTimeout> | undefined,\n set: (fn: () => void, delay: number) => {\n timeout.clear();\n timeout.id = setTimeout(fn, delay);\n },\n clear: () => {\n if (timeout.id !== undefined) {\n clearTimeout(timeout.id);\n timeout.id = undefined;\n }\n },\n }));\n\n // Clean up the timeout when the component is unloaded\n React.useEffect(() => timeout.clear, [timeout]);\n\n return [timeout.set, timeout.clear] as const;\n}\n"]}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isFluentTrigger = exports.getTriggerChild = exports.applyTriggerPropsToChildren = exports.isInteractiveHTMLElement = exports.isHTMLElement = exports.mergeCallbacks = exports.getRTLSafeKey = exports.getPartitionedNativeProps = exports.getNativeElementProps = exports.clamp = exports.SSRProvider = exports.useIsSSR = exports.canUseDOM = exports.useTimeout = exports.usePrevious = exports.useOnScrollOutside = exports.useOnClickOutside = exports.useMergedRefs = exports.useIsomorphicLayoutEffect = exports.useId = exports.useForceUpdate = exports.useFirstMount = exports.useEventCallback = exports.useControllableState = exports.resetIdsForTests = exports.isResolvedShorthand = exports.resolveShorthand = exports.getSlots = void 0;
7
-
8
7
  var index_1 = /*#__PURE__*/require("./compose/index");
9
-
10
8
  Object.defineProperty(exports, "getSlots", {
11
9
  enumerable: true,
12
10
  get: function () {
@@ -25,9 +23,7 @@ Object.defineProperty(exports, "isResolvedShorthand", {
25
23
  return index_1.isResolvedShorthand;
26
24
  }
27
25
  });
28
-
29
26
  var index_2 = /*#__PURE__*/require("./hooks/index");
30
-
31
27
  Object.defineProperty(exports, "resetIdsForTests", {
32
28
  enumerable: true,
33
29
  get: function () {
@@ -100,9 +96,7 @@ Object.defineProperty(exports, "useTimeout", {
100
96
  return index_2.useTimeout;
101
97
  }
102
98
  });
103
-
104
99
  var index_3 = /*#__PURE__*/require("./ssr/index");
105
-
106
100
  Object.defineProperty(exports, "canUseDOM", {
107
101
  enumerable: true,
108
102
  get: function () {
@@ -121,9 +115,7 @@ Object.defineProperty(exports, "SSRProvider", {
121
115
  return index_3.SSRProvider;
122
116
  }
123
117
  });
124
-
125
118
  var index_4 = /*#__PURE__*/require("./utils/index");
126
-
127
119
  Object.defineProperty(exports, "clamp", {
128
120
  enumerable: true,
129
121
  get: function () {
@@ -166,9 +158,7 @@ Object.defineProperty(exports, "isInteractiveHTMLElement", {
166
158
  return index_4.isInteractiveHTMLElement;
167
159
  }
168
160
  });
169
-
170
161
  var index_5 = /*#__PURE__*/require("./trigger/index");
171
-
172
162
  Object.defineProperty(exports, "applyTriggerPropsToChildren", {
173
163
  enumerable: true,
174
164
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../packages/react-components/react-utilities/src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,UAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,QAAA;EAAQ;AAAR,CAAA;AAAU,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,gBAAA;EAAgB;AAAhB,CAAA;AAAkB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA;;AAgBrC,IAAA,OAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,gBAAA;EAAgB;AAAhB,CAAA;AACA,MAAA,C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A,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,eAAA;EAAe;AAAf,CAAA","sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n ResolveShorthandFunction,\n ResolveShorthandOptions,\n Slot,\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n} from './compose/index';\n\nexport {\n resetIdsForTests,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\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 getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n} from './utils/index';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,uBAAQ;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,kCAAmB;EAAA;AAAA;AAgBxD;AACEF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAChBF;EAAAC;EAAAC;IAAA,mCAAoB;EAAA;AAAA;AACpBF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAChBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,6BAAc;EAAA;AAAA;AACdF;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AACLF;EAAAC;EAAAC;IAAA,wCAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AACjBF;EAAAC;EAAAC;IAAA,iCAAkB;EAAA;AAAA;AAClBF;EAAAC;EAAAC;IAAA,0BAAW;EAAA;AAAA;AACXF;EAAAC;EAAAC;IAAA,yBAAU;EAAA;AAAA;AAIZ;AAASF;EAAAC;EAAAC;IAAA,wBAAS;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,uBAAQ;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,0BAAW;EAAA;AAAA;AAEzC;AACEF;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AACLF;EAAAC;EAAAC;IAAA,oCAAqB;EAAA;AAAA;AACrBF;EAAAC;EAAAC;IAAA,wCAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,6BAAc;EAAA;AAAA;AACdF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,uCAAwB;EAAA;AAAA;AAG1B;AAASF;EAAAC;EAAAC;IAAA,0CAA2B;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"","sources":["../../../../../../../packages/react-components/react-utilities/src/index.ts"],"sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n ResolveShorthandFunction,\n ResolveShorthandOptions,\n Slot,\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n} from './compose/index';\n\nexport {\n resetIdsForTests,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\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 getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n} from './utils/index';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n"]}
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useIsSSR = exports.SSRProvider = exports.useSSRContext = exports.SSRContext = exports.defaultSSRContextValue = void 0;
7
-
8
7
  const React = /*#__PURE__*/require("react");
9
-
10
8
  const canUseDOM_1 = /*#__PURE__*/require("./canUseDOM");
11
9
  /**
12
10
  * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.
13
11
  *
14
12
  * @internal
15
13
  */
16
-
17
-
18
14
  exports.defaultSSRContextValue = {
19
15
  current: 0
20
16
  };
@@ -22,13 +18,10 @@ exports.SSRContext = /*#__PURE__*/React.createContext(undefined);
22
18
  /**
23
19
  * @internal
24
20
  */
25
-
26
21
  function useSSRContext() {
27
22
  var _a;
28
-
29
23
  return (_a = React.useContext(exports.SSRContext)) !== null && _a !== void 0 ? _a : exports.defaultSSRContextValue;
30
24
  }
31
-
32
25
  exports.useSSRContext = useSSRContext;
33
26
  /**
34
27
  * When using SSR with Fluent UI, applications must be wrapped in an SSRProvider. This ensures that auto generated ids
@@ -36,7 +29,6 @@ exports.useSSRContext = useSSRContext;
36
29
  *
37
30
  * @public
38
31
  */
39
-
40
32
  const SSRProvider = props => {
41
33
  const [value] = React.useState(() => ({
42
34
  current: 0
@@ -45,27 +37,24 @@ const SSRProvider = props => {
45
37
  value: value
46
38
  }, props.children);
47
39
  };
48
-
49
40
  exports.SSRProvider = SSRProvider;
50
41
  /**
51
42
  * Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay
52
43
  * browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.
53
44
  */
54
-
55
45
  function useIsSSR() {
56
46
  const isInSSRContext = useSSRContext() !== exports.defaultSSRContextValue;
57
- const [isSSR, setIsSSR] = React.useState(isInSSRContext); // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the
47
+ const [isSSR, setIsSSR] = React.useState(isInSSRContext);
48
+ // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the
58
49
  // developer to add one.
59
-
60
50
  if (process.env.NODE_ENV !== 'production') {
61
51
  if (!isInSSRContext && !canUseDOM_1.canUseDOM()) {
62
52
  // eslint-disable-next-line no-console
63
53
  console.error(['@fluentui/react-components: ', 'When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are ' + 'generated between the client and server.', '\n', '\n', 'Check documentation at https://aka.ms/fluentui-ssr'].join(''));
64
54
  }
65
- } // If on the client, and the component was initially server rendered, then schedule a layout effect to update the
55
+ }
56
+ // If on the client, and the component was initially server rendered, then schedule a layout effect to update the
66
57
  // component after hydration.
67
-
68
-
69
58
  if (canUseDOM_1.canUseDOM() && isInSSRContext) {
70
59
  // This if statement technically breaks the rules of hooks, but is safe because the condition never changes after
71
60
  // mounting.
@@ -74,9 +63,7 @@ function useIsSSR() {
74
63
  setIsSSR(false);
75
64
  }, []);
76
65
  }
77
-
78
66
  return isSSR;
79
67
  }
80
-
81
68
  exports.useIsSSR = useIsSSR;
82
69
  //# sourceMappingURL=SSRContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/ssr/SSRContext.tsx"],"names":[],"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ACE,8BADF,EAEE,4GACE,0CAHJ,EAIE,IAJF,EAKE,IALF,EAME,oDANF,EAOE,IAPF,CAOO,EAPP,CADF;IAUD;EACF,CApBqB,CAsBtB;EACA;;;EACA,IAAI,WAAA,CAAA,SAAA,MAAe,cAAnB,EAAmC;IACjC;IACA;IACA;IACA,KAAK,CAAC,eAAN,CAAsB,MAAK;MACzB,QAAQ,CAAC,KAAD,CAAR;IACD,CAFD,EAEG,EAFH;EAGD;;EAED,OAAO,KAAP;AACD;;AAlCD,OAAA,CAAA,QAAA,GAAA,QAAA","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 = 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(\n [\n '@fluentui/react-components: ',\n 'When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are ' +\n 'generated between the client and server.',\n '\\n',\n '\\n',\n 'Check documentation at https://aka.ms/fluentui-ssr',\n ].join(''),\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"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AAYA;;;;;AAKaA,8BAAsB,GAAoB;EACrDC,OAAO,EAAE;CACV;AAEYD,kBAAU,gBAAGE,KAAK,CAACC,aAAa,CAA8BC,SAAS,CAAmC;AAEvH;;;AAGA,SAAgBC,aAAa;;EAC3B,OAAO,WAAK,CAACC,UAAU,CAACN,kBAAU,CAAC,mCAAIA,8BAAsB;AAC/D;AAFAA;AAIA;;;;;;AAMO,MAAMO,WAAW,GAAaC,KAAK,IAAG;EAC3C,MAAM,CAACC,KAAK,CAAC,GAAGP,KAAK,CAACQ,QAAQ,CAAkB,OAAO;IAAET,OAAO,EAAE;EAAC,CAAE,CAAC,CAAC;EAEvE,OAAOC,oBAACF,kBAAU,CAACW,QAAQ;IAACF,KAAK,EAAEA;EAAK,GAAGD,KAAK,CAACI,QAAQ,CAAuB;AAClF,CAAC;AAJYZ,mBAAW;AAMxB;;;;AAIA,SAAgBa,QAAQ;EACtB,MAAMC,cAAc,GAAGT,aAAa,EAAE,KAAKL,8BAAsB;EACjE,MAAM,CAACe,KAAK,EAAEC,QAAQ,CAAC,GAAGd,KAAK,CAACQ,QAAQ,CAACI,cAAc,CAAC;EAExD;EACA;EACA,IAAIG,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAI,CAACL,cAAc,IAAI,CAACM,qBAAS,EAAE,EAAE;MACnC;MACAC,OAAO,CAACC,KAAK,CACX,CACE,8BAA8B,EAC9B,yGAAyG,GACvG,0CAA0C,EAC5C,IAAI,EACJ,IAAI,EACJ,oDAAoD,CACrD,CAACC,IAAI,CAAC,EAAE,CAAC,CACX;;;EAIL;EACA;EACA,IAAIH,qBAAS,EAAE,IAAIN,cAAc,EAAE;IACjC;IACA;IACA;IACAZ,KAAK,CAACsB,eAAe,CAAC,MAAK;MACzBR,QAAQ,CAAC,KAAK,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC;;EAGR,OAAOD,KAAK;AACd;AAlCAf","names":["exports","current","React","createContext","undefined","useSSRContext","useContext","SSRProvider","props","value","useState","Provider","children","useIsSSR","isInSSRContext","isSSR","setIsSSR","process","env","NODE_ENV","canUseDOM_1","console","error","join","useLayoutEffect"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/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 = 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(\n [\n '@fluentui/react-components: ',\n 'When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are ' +\n 'generated between the client and server.',\n '\\n',\n '\\n',\n 'Check documentation at https://aka.ms/fluentui-ssr',\n ].join(''),\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"]}
@@ -7,11 +7,10 @@ exports.canUseDOM = void 0;
7
7
  /**
8
8
  * Verifies if an application can use DOM.
9
9
  */
10
-
11
10
  function canUseDOM() {
12
- return typeof window !== 'undefined' && !!(window.document && // eslint-disable-next-line deprecation/deprecation
11
+ return typeof window !== 'undefined' && !!(window.document &&
12
+ // eslint-disable-next-line deprecation/deprecation
13
13
  window.document.createElement);
14
14
  }
15
-
16
15
  exports.canUseDOM = canUseDOM;
17
16
  //# sourceMappingURL=canUseDOM.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/ssr/canUseDOM.ts"],"names":[],"mappings":";;;;;;AAAA;;AAEG;;AACH,SAAgB,SAAhB,GAAyB;EACvB,OACE,OAAO,MAAP,KAAkB,WAAlB,IACA,CAAC,EACC,MAAM,CAAC,QAAP,IACA;EACA,MAAM,CAAC,QAAP,CAAgB,aAHjB,CAFH;AAQD;;AATD,OAAA,CAAA,SAAA,GAAA,SAAA","sourcesContent":["/**\n * Verifies if an application can use DOM.\n */\nexport function canUseDOM(): boolean {\n return (\n typeof window !== 'undefined' &&\n !!(\n window.document &&\n // eslint-disable-next-line deprecation/deprecation\n window.document.createElement\n )\n );\n}\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;;;AAGA,SAAgBA,SAAS;EACvB,OACE,OAAOC,MAAM,KAAK,WAAW,IAC7B,CAAC,EACCA,MAAM,CAACC,QAAQ;EACf;EACAD,MAAM,CAACC,QAAQ,CAACC,aAAa,CAC9B;AAEL;AATAC","names":["canUseDOM","window","document","createElement","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/ssr/canUseDOM.ts"],"sourcesContent":["/**\n * Verifies if an application can use DOM.\n */\nexport function canUseDOM(): boolean {\n return (\n typeof window !== 'undefined' &&\n !!(\n window.document &&\n // eslint-disable-next-line deprecation/deprecation\n window.document.createElement\n )\n );\n}\n"]}
@@ -3,10 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  const tslib_1 = /*#__PURE__*/require("tslib");
8
-
9
7
  tslib_1.__exportStar(require("./canUseDOM"), exports);
10
-
11
8
  tslib_1.__exportStar(require("./SSRContext"), exports);
12
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/ssr/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './canUseDOM';\nexport * from './SSRContext';\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAAA;AACAA","names":["tslib_1"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/ssr/index.ts"],"sourcesContent":["export * from './canUseDOM';\nexport * from './SSRContext';\n"]}
@@ -4,40 +4,32 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.applyTriggerPropsToChildren = void 0;
7
-
8
7
  const React = /*#__PURE__*/require("react");
9
-
10
8
  const isFluentTrigger_1 = /*#__PURE__*/require("./isFluentTrigger");
11
9
  /**
12
10
  * @internal
13
11
  * resolve the trigger props to the children, either by calling the render function, or cloning with the new props.
14
12
  */
15
-
16
-
17
13
  function applyTriggerPropsToChildren(children, triggerChildProps) {
18
14
  if (typeof children === 'function') {
19
15
  return children(triggerChildProps);
20
16
  } else if (children) {
21
17
  return cloneTriggerTree(children, triggerChildProps);
22
- } // Components in React should return either JSX elements or "null", otherwise React will throw:
18
+ }
19
+ // Components in React should return either JSX elements or "null", otherwise React will throw:
23
20
  // Nothing was returned from render.
24
21
  // This usually means a return statement is missing. Or, to render nothing, return null.
25
-
26
-
27
22
  return children || null;
28
23
  }
29
-
30
24
  exports.applyTriggerPropsToChildren = applyTriggerPropsToChildren;
31
25
  /**
32
26
  * Clones a React element tree, and applies the given props to the first grandchild that is not
33
27
  * a FluentTriggerComponent or React Fragment (the same element returned by {@link getTriggerChild}).
34
28
  */
35
-
36
29
  function cloneTriggerTree(child, triggerProps) {
37
30
  if (!React.isValidElement(child) || child.type === React.Fragment) {
38
31
  throw new Error('A trigger element must be a single element for this component. ' + "Please ensure that you're not using React Fragments.");
39
32
  }
40
-
41
33
  if (isFluentTrigger_1.isFluentTrigger(child)) {
42
34
  const grandchild = cloneTriggerTree(child.props.children, triggerProps);
43
35
  return React.cloneElement(child, undefined, grandchild);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/applyTriggerPropsToChildren.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;AAGA;;;AAGG;;;AACH,SAAgB,2BAAhB,CACE,QADF,EAEE,iBAFF,EAEsC;EAEpC,IAAI,OAAO,QAAP,KAAoB,UAAxB,EAAoC;IAClC,OAAO,QAAQ,CAAC,iBAAD,CAAf;EACD,CAFD,MAEO,IAAI,QAAJ,EAAc;IACnB,OAAO,gBAAgB,CAAC,QAAD,EAAW,iBAAX,CAAvB;EACD,CANmC,CAQpC;EACA;EACA;;;EACA,OAAO,QAAQ,IAAI,IAAnB;AACD;;AAdD,OAAA,CAAA,2BAAA,GAAA,2BAAA;AAgBA;;;AAGG;;AACH,SAAS,gBAAT,CACE,KADF,EAEE,YAFF,EAEiC;EAE/B,IAAI,CAAC,KAAK,CAAC,cAAN,CAAqB,KAArB,CAAD,IAAgC,KAAK,CAAC,IAAN,KAAe,KAAK,CAAC,QAAzD,EAAmE;IACjE,MAAM,IAAI,KAAJ,CACJ,oEACE,sDAFE,CAAN;EAID;;EAED,IAAI,iBAAA,CAAA,eAAA,CAAgB,KAAhB,CAAJ,EAA4B;IAC1B,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAN,CAAY,QAAb,EAAuB,YAAvB,CAAnC;IACA,OAAO,KAAK,CAAC,YAAN,CAAmB,KAAnB,EAA0B,SAA1B,EAAqC,UAArC,CAAP;EACD,CAHD,MAGO;IACL,OAAO,KAAK,CAAC,YAAN,CAAmB,KAAnB,EAA0B,YAA1B,CAAP;EACD;AACF","sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\nimport type { TriggerProps } from './types';\n\n/**\n * @internal\n * resolve the trigger props to the children, either by calling the render function, or cloning with the new props.\n */\nexport function applyTriggerPropsToChildren<TriggerChildProps>(\n children: TriggerProps<TriggerChildProps>['children'],\n triggerChildProps: TriggerChildProps,\n): React.ReactElement | null {\n if (typeof children === 'function') {\n return children(triggerChildProps);\n } else if (children) {\n return cloneTriggerTree(children, triggerChildProps);\n }\n\n // Components in React should return either JSX elements or \"null\", otherwise React will throw:\n // Nothing was returned from render.\n // This usually means a return statement is missing. Or, to render nothing, return null.\n return children || null;\n}\n\n/**\n * Clones a React element tree, and applies the given props to the first grandchild that is not\n * a FluentTriggerComponent or React Fragment (the same element returned by {@link getTriggerChild}).\n */\nfunction cloneTriggerTree<TriggerChildProps>(\n child: React.ReactNode,\n triggerProps: TriggerChildProps,\n): React.ReactElement {\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error(\n 'A trigger element must be a single element for this component. ' +\n \"Please ensure that you're not using React Fragments.\",\n );\n }\n\n if (isFluentTrigger(child)) {\n const grandchild = cloneTriggerTree(child.props.children, triggerProps);\n return React.cloneElement(child, undefined, grandchild);\n } else {\n return React.cloneElement(child, triggerProps as TriggerChildProps & React.Attributes);\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;;AAIA,SAAgBA,2BAA2B,CACzCC,QAAqD,EACrDC,iBAAoC;EAEpC,IAAI,OAAOD,QAAQ,KAAK,UAAU,EAAE;IAClC,OAAOA,QAAQ,CAACC,iBAAiB,CAAC;GACnC,MAAM,IAAID,QAAQ,EAAE;IACnB,OAAOE,gBAAgB,CAACF,QAAQ,EAAEC,iBAAiB,CAAC;;EAGtD;EACA;EACA;EACA,OAAOD,QAAQ,IAAI,IAAI;AACzB;AAdAG;AAgBA;;;;AAIA,SAASD,gBAAgB,CACvBE,KAAsB,EACtBC,YAA+B;EAE/B,IAAI,CAACC,KAAK,CAACC,cAAc,CAACH,KAAK,CAAC,IAAIA,KAAK,CAACI,IAAI,KAAKF,KAAK,CAACG,QAAQ,EAAE;IACjE,MAAM,IAAIC,KAAK,CACb,iEAAiE,GAC/D,sDAAsD,CACzD;;EAGH,IAAIC,iCAAe,CAACP,KAAK,CAAC,EAAE;IAC1B,MAAMQ,UAAU,GAAGV,gBAAgB,CAACE,KAAK,CAACS,KAAK,CAACb,QAAQ,EAAEK,YAAY,CAAC;IACvE,OAAOC,KAAK,CAACQ,YAAY,CAACV,KAAK,EAAEW,SAAS,EAAEH,UAAU,CAAC;GACxD,MAAM;IACL,OAAON,KAAK,CAACQ,YAAY,CAACV,KAAK,EAAEC,YAAoD,CAAC;;AAE1F","names":["applyTriggerPropsToChildren","children","triggerChildProps","cloneTriggerTree","exports","child","triggerProps","React","isValidElement","type","Fragment","Error","isFluentTrigger_1","grandchild","props","cloneElement","undefined"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/applyTriggerPropsToChildren.ts"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\nimport type { TriggerProps } from './types';\n\n/**\n * @internal\n * resolve the trigger props to the children, either by calling the render function, or cloning with the new props.\n */\nexport function applyTriggerPropsToChildren<TriggerChildProps>(\n children: TriggerProps<TriggerChildProps>['children'],\n triggerChildProps: TriggerChildProps,\n): React.ReactElement | null {\n if (typeof children === 'function') {\n return children(triggerChildProps);\n } else if (children) {\n return cloneTriggerTree(children, triggerChildProps);\n }\n\n // Components in React should return either JSX elements or \"null\", otherwise React will throw:\n // Nothing was returned from render.\n // This usually means a return statement is missing. Or, to render nothing, return null.\n return children || null;\n}\n\n/**\n * Clones a React element tree, and applies the given props to the first grandchild that is not\n * a FluentTriggerComponent or React Fragment (the same element returned by {@link getTriggerChild}).\n */\nfunction cloneTriggerTree<TriggerChildProps>(\n child: React.ReactNode,\n triggerProps: TriggerChildProps,\n): React.ReactElement {\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error(\n 'A trigger element must be a single element for this component. ' +\n \"Please ensure that you're not using React Fragments.\",\n );\n }\n\n if (isFluentTrigger(child)) {\n const grandchild = cloneTriggerTree(child.props.children, triggerProps);\n return React.cloneElement(child, undefined, grandchild);\n } else {\n return React.cloneElement(child, triggerProps as TriggerChildProps & React.Attributes);\n }\n}\n"]}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getTriggerChild = void 0;
7
-
8
7
  const React = /*#__PURE__*/require("react");
9
-
10
8
  const isFluentTrigger_1 = /*#__PURE__*/require("./isFluentTrigger");
11
9
  /**
12
10
  * @internal
@@ -30,17 +28,14 @@ const isFluentTrigger_1 = /*#__PURE__*/require("./isFluentTrigger");
30
28
  * In the case where the immediate child is not a valid element,
31
29
  * null is returned
32
30
  */
33
-
34
-
35
31
  function getTriggerChild(children) {
36
32
  if (!React.isValidElement(children)) {
37
33
  return null;
38
34
  }
39
-
40
- return isFluentTrigger_1.isFluentTrigger(children) ? getTriggerChild( // FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method,
35
+ return isFluentTrigger_1.isFluentTrigger(children) ? getTriggerChild(
36
+ // FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method,
41
37
  // but for some reason it's failing on build
42
38
  children.props.children) : children;
43
39
  }
44
-
45
40
  exports.getTriggerChild = getTriggerChild;
46
41
  //# sourceMappingURL=getTriggerChild.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/getTriggerChild.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;AAGA;;;;;;;;;;;;;;;;;;;;;AAqBG;;;AACH,SAAgB,eAAhB,CACE,QADF,EACuD;EAGrD,IAAI,CAAC,KAAK,CAAC,cAAN,CAAwC,QAAxC,CAAL,EAAwD;IACtD,OAAO,IAAP;EACD;;EACD,OAAO,iBAAA,CAAA,eAAA,CAAgB,QAAhB,IACH,eAAe,EACb;EACA;EACC,QAAQ,CAAC,KAAT,CAAgC,QAHpB,CADZ,GAMH,QANJ;AAOD;;AAdD,OAAA,CAAA,eAAA,GAAA,eAAA","sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\nimport type { TriggerProps } from './types';\n\n/**\n * @internal\n * Gets the trigger element of a FluentTriggerComponent (such as Tooltip or MenuTrigger).\n *\n * In the case where the immediate child is itself a FluentTriggerComponent and/or React Fragment,\n * it returns the first descendant that is _not_ a FluentTriggerComponent or Fragment.\n * This allows multiple triggers to be stacked, and still apply their props to the actual trigger element.\n *\n * For example, the following returns `<div id=\"child\" />`:\n * ```jsx\n * getTriggerChild(\n * <Tooltip>\n * <MenuTrigger>\n * <div id=\"child\" />\n * </MenuTrigger>\n * </Tooltip>\n * );\n * ```\n *\n * In the case where the immediate child is not a valid element,\n * null is returned\n */\nexport function getTriggerChild<TriggerChildProps>(\n children: TriggerProps<TriggerChildProps>['children'],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): (React.ReactElement<Partial<TriggerChildProps>> & { ref?: React.Ref<any> }) | null {\n if (!React.isValidElement<TriggerChildProps>(children)) {\n return null;\n }\n return isFluentTrigger(children)\n ? getTriggerChild(\n // FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method,\n // but for some reason it's failing on build\n (children.props as TriggerProps).children,\n )\n : children;\n}\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgBA,eAAe,CAC7BC,QAAqD;EAGrD,IAAI,CAACC,KAAK,CAACC,cAAc,CAAoBF,QAAQ,CAAC,EAAE;IACtD,OAAO,IAAI;;EAEb,OAAOG,iCAAe,CAACH,QAAQ,CAAC,GAC5BD,eAAe;EACb;EACA;EACCC,QAAQ,CAACI,KAAsB,CAACJ,QAAQ,CAC1C,GACDA,QAAQ;AACd;AAdAK","names":["getTriggerChild","children","React","isValidElement","isFluentTrigger_1","props","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/getTriggerChild.ts"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\nimport type { TriggerProps } from './types';\n\n/**\n * @internal\n * Gets the trigger element of a FluentTriggerComponent (such as Tooltip or MenuTrigger).\n *\n * In the case where the immediate child is itself a FluentTriggerComponent and/or React Fragment,\n * it returns the first descendant that is _not_ a FluentTriggerComponent or Fragment.\n * This allows multiple triggers to be stacked, and still apply their props to the actual trigger element.\n *\n * For example, the following returns `<div id=\"child\" />`:\n * ```jsx\n * getTriggerChild(\n * <Tooltip>\n * <MenuTrigger>\n * <div id=\"child\" />\n * </MenuTrigger>\n * </Tooltip>\n * );\n * ```\n *\n * In the case where the immediate child is not a valid element,\n * null is returned\n */\nexport function getTriggerChild<TriggerChildProps>(\n children: TriggerProps<TriggerChildProps>['children'],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): (React.ReactElement<Partial<TriggerChildProps>> & { ref?: React.Ref<any> }) | null {\n if (!React.isValidElement<TriggerChildProps>(children)) {\n return null;\n }\n return isFluentTrigger(children)\n ? getTriggerChild(\n // FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method,\n // but for some reason it's failing on build\n (children.props as TriggerProps).children,\n )\n : children;\n}\n"]}
@@ -3,14 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  const tslib_1 = /*#__PURE__*/require("tslib");
8
-
9
7
  tslib_1.__exportStar(require("./applyTriggerPropsToChildren"), exports);
10
-
11
8
  tslib_1.__exportStar(require("./getTriggerChild"), exports);
12
-
13
9
  tslib_1.__exportStar(require("./isFluentTrigger"), exports);
14
-
15
10
  tslib_1.__exportStar(require("./types"), exports);
16
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,+BAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './applyTriggerPropsToChildren';\nexport * from './getTriggerChild';\nexport * from './isFluentTrigger';\nexport * from './types';\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/index.ts"],"sourcesContent":["export * from './applyTriggerPropsToChildren';\nexport * from './getTriggerChild';\nexport * from './isFluentTrigger';\nexport * from './types';\n"]}
@@ -9,10 +9,8 @@ exports.isFluentTrigger = void 0;
9
9
  * Checks if a given element is a FluentUI trigger (e.g. `MenuTrigger` or `Tooltip`).
10
10
  * See the {@link FluentTriggerComponent} type for more info.
11
11
  */
12
-
13
12
  function isFluentTrigger(element) {
14
13
  return Boolean(element.type.isFluentTriggerComponent);
15
14
  }
16
-
17
15
  exports.isFluentTrigger = isFluentTrigger;
18
16
  //# sourceMappingURL=isFluentTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/isFluentTrigger.ts"],"names":[],"mappings":";;;;;;AAGA;;;;AAIG;;AACH,SAAgB,eAAhB,CAAgC,OAAhC,EAA2D;EACzD,OAAO,OAAO,CAAE,OAAO,CAAC,IAAR,CAAwC,wBAA1C,CAAd;AACD;;AAFD,OAAA,CAAA,eAAA,GAAA,eAAA","sourcesContent":["import * as React from 'react';\nimport type { FluentTriggerComponent, TriggerProps } from './types';\n\n/**\n * @internal\n * Checks if a given element is a FluentUI trigger (e.g. `MenuTrigger` or `Tooltip`).\n * See the {@link FluentTriggerComponent} type for more info.\n */\nexport function isFluentTrigger(element: React.ReactElement): element is React.ReactElement<TriggerProps> {\n return Boolean((element.type as FluentTriggerComponent).isFluentTriggerComponent);\n}\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAGA;;;;;AAKA,SAAgBA,eAAe,CAACC,OAA2B;EACzD,OAAOC,OAAO,CAAED,OAAO,CAACE,IAA+B,CAACC,wBAAwB,CAAC;AACnF;AAFAC","names":["isFluentTrigger","element","Boolean","type","isFluentTriggerComponent","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/isFluentTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport type { FluentTriggerComponent, TriggerProps } from './types';\n\n/**\n * @internal\n * Checks if a given element is a FluentUI trigger (e.g. `MenuTrigger` or `Tooltip`).\n * See the {@link FluentTriggerComponent} type for more info.\n */\nexport function isFluentTrigger(element: React.ReactElement): element is React.ReactElement<TriggerProps> {\n return Boolean((element.type as FluentTriggerComponent).isFluentTriggerComponent);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"mappings":"","names":[],"sourceRoot":"","sources":[],"sourcesContent":[]}
@@ -12,8 +12,6 @@ exports.clamp = void 0;
12
12
  * @param min - the lowest valid value
13
13
  * @param max - the highest valid value
14
14
  */
15
-
16
15
  const clamp = (value, min, max) => Math.max(min, Math.min(max, value || 0));
17
-
18
16
  exports.clamp = clamp;
19
17
  //# sourceMappingURL=clamp.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/clamp.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;AAOG;;AACI,MAAM,KAAK,GAAG,CAAC,KAAD,EAAgB,GAAhB,EAA6B,GAA7B,KAAqD,IAAI,CAAC,GAAL,CAAS,GAAT,EAAc,IAAI,CAAC,GAAL,CAAS,GAAT,EAAc,KAAK,IAAI,CAAvB,CAAd,CAAnE;;AAAM,OAAA,CAAA,KAAA,GAAK,KAAL","sourcesContent":["/**\n * @internal\n * Clamps `value` to a number between the min and max.\n *\n * @param value - the value to be clamped\n * @param min - the lowest valid value\n * @param max - the highest valid value\n */\nexport const clamp = (value: number, min: number, max: number): number => Math.max(min, Math.min(max, value || 0));\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;;;;;;;;AAQO,MAAMA,KAAK,GAAG,CAACC,KAAa,EAAEC,GAAW,EAAEC,GAAW,KAAaC,IAAI,CAACD,GAAG,CAACD,GAAG,EAAEE,IAAI,CAACF,GAAG,CAACC,GAAG,EAAEF,KAAK,IAAI,CAAC,CAAC,CAAC;AAArGI,aAAK","names":["clamp","value","min","max","Math","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/clamp.ts"],"sourcesContent":["/**\n * @internal\n * Clamps `value` to a number between the min and max.\n *\n * @param value - the value to be clamped\n * @param min - the lowest valid value\n * @param max - the highest valid value\n */\nexport const clamp = (value: number, min: number, max: number): number => Math.max(min, Math.min(max, value || 0));\n"]}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getPartitionedNativeProps = exports.getNativeElementProps = void 0;
7
-
8
7
  const properties_1 = /*#__PURE__*/require("./properties");
9
-
10
8
  const nativeElementMap = {
11
9
  label: properties_1.labelProperties,
12
10
  audio: properties_1.audioProperties,
@@ -40,13 +38,11 @@ const nativeElementMap = {
40
38
  * @param excludedPropNames - List of props to disallow
41
39
  */
42
40
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
-
44
41
  function getNativeElementProps(tagName, props, excludedPropNames) {
45
42
  const allowedPropNames = tagName && nativeElementMap[tagName] || properties_1.htmlElementProperties;
46
43
  allowedPropNames.as = 1;
47
44
  return properties_1.getNativeProps(props, allowedPropNames, excludedPropNames);
48
45
  }
49
-
50
46
  exports.getNativeElementProps = getNativeElementProps;
51
47
  /**
52
48
  * Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot.
@@ -56,7 +52,6 @@ exports.getNativeElementProps = getNativeElementProps;
56
52
  *
57
53
  * @returns An object containing the native props for the `root` and primary slots.
58
54
  */
59
-
60
55
  const getPartitionedNativeProps = ({
61
56
  primarySlotTagName,
62
57
  props,
@@ -70,6 +65,5 @@ const getPartitionedNativeProps = ({
70
65
  primary: getNativeElementProps(primarySlotTagName, props, [...(excludedPropNames || []), 'style', 'className'])
71
66
  };
72
67
  };
73
-
74
68
  exports.getPartitionedNativeProps = getPartitionedNativeProps;
75
69
  //# sourceMappingURL=getNativeElementProps.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/getNativeElementProps.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AA4BA,MAAM,gBAAgB,GAA2C;EAC/D,KAAK,EAAE,YAAA,CAAA,eADwD;EAE/D,KAAK,EAAE,YAAA,CAAA,eAFwD;EAG/D,KAAK,EAAE,YAAA,CAAA,eAHwD;EAI/D,EAAE,EAAE,YAAA,CAAA,YAJ2D;EAK/D,EAAE,EAAE,YAAA,CAAA,YAL2D;EAM/D,CAAC,EAAE,YAAA,CAAA,gBAN4D;EAO/D,MAAM,EAAE,YAAA,CAAA,gBAPuD;EAQ/D,KAAK,EAAE,YAAA,CAAA,eARwD;EAS/D,QAAQ,EAAE,YAAA,CAAA,kBATqD;EAU/D,MAAM,EAAE,YAAA,CAAA,gBAVuD;EAW/D,MAAM,EAAE,YAAA,CAAA,gBAXuD;EAY/D,KAAK,EAAE,YAAA,CAAA,eAZwD;EAa/D,EAAE,EAAE,YAAA,CAAA,YAb2D;EAc/D,EAAE,EAAE,YAAA,CAAA,YAd2D;EAe/D,EAAE,EAAE,YAAA,CAAA,YAf2D;EAgB/D,QAAQ,EAAE,YAAA,CAAA,kBAhBqD;EAiB/D,GAAG,EAAE,YAAA,CAAA,aAjB0D;EAkB/D,QAAQ,EAAE,YAAA,CAAA,kBAlBqD;EAmB/D,IAAI,EAAE,YAAA,CAAA,cAnByD;EAoB/D,MAAM,EAAE,YAAA,CAAA,gBApBuD;EAqB/D,GAAG,EAAE,YAAA,CAAA,aArB0D;EAsB/D,IAAI,EAAE,YAAA,CAAA,cAtByD;EAuB/D,MAAM,EAAE,YAAA,CAAA;AAvBuD,CAAjE;AA0BA;;;;;;AAMG;AACH;;AACA,SAAgB,qBAAhB,CACE,OADF,EAEE,KAFF,EAGE,iBAHF,EAG8B;EAE5B,MAAM,gBAAgB,GAAI,OAAO,IAAI,gBAAgB,CAAC,OAAD,CAA5B,IAA0C,YAAA,CAAA,qBAAnE;EACA,gBAAgB,CAAC,EAAjB,GAAsB,CAAtB;EAEA,OAAO,YAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,gBAAtB,EAAwC,iBAAxC,CAAP;AACD;;AATD,OAAA,CAAA,qBAAA,GAAA,qBAAA;AAWA;;;;;;;AAOG;;AACI,MAAM,yBAAyB,GAAG,CAGvC;EACA,kBADA;EAEA,KAFA;EAGA;AAHA,CAHuC,KAgBpC;EACH,OAAO;IACL,IAAI,EAAE;MAAE,KAAK,EAAE,KAAK,CAAC,KAAf;MAAsB,SAAS,EAAE,KAAK,CAAC;IAAvC,CADD;IAEL,OAAO,EAAE,qBAAqB,CAAgC,kBAAhC,EAAoD,KAApD,EAA2D,CACvF,IAAI,iBAAiB,IAAI,EAAzB,CADuF,EAEvF,OAFuF,EAGvF,WAHuF,CAA3D;EAFzB,CAAP;AAQD,CAzBM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport {\n labelProperties,\n audioProperties,\n videoProperties,\n olProperties,\n liProperties,\n anchorProperties,\n buttonProperties,\n inputProperties,\n textAreaProperties,\n selectProperties,\n optionProperties,\n tableProperties,\n trProperties,\n thProperties,\n tdProperties,\n colGroupProperties,\n colProperties,\n fieldsetProperties,\n formProperties,\n iframeProperties,\n imgProperties,\n htmlElementProperties,\n getNativeProps,\n timeProperties,\n dialogProperties,\n} from './properties';\n\nconst nativeElementMap: Record<string, Record<string, number>> = {\n label: labelProperties,\n audio: audioProperties,\n video: videoProperties,\n ol: olProperties,\n li: liProperties,\n a: anchorProperties,\n button: buttonProperties,\n input: inputProperties,\n textarea: textAreaProperties,\n select: selectProperties,\n option: optionProperties,\n table: tableProperties,\n tr: trProperties,\n th: thProperties,\n td: tdProperties,\n colGroup: colGroupProperties,\n col: colProperties,\n fieldset: fieldsetProperties,\n form: formProperties,\n iframe: iframeProperties,\n img: imgProperties,\n time: timeProperties,\n dialog: dialogProperties,\n};\n\n/**\n * Given an element tagname and user props, filters the props to only allowed props for the given\n * element type.\n * @param tagName - Tag name (e.g. \"div\")\n * @param props - Props object\n * @param excludedPropNames - List of props to disallow\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(\n tagName: string,\n props: {},\n excludedPropNames?: string[],\n): TAttributes {\n const allowedPropNames = (tagName && nativeElementMap[tagName]) || htmlElementProperties;\n allowedPropNames.as = 1;\n\n return getNativeProps(props, allowedPropNames, excludedPropNames);\n}\n\n/**\n * Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot.\n *\n * This function is only for use with components that have a primary slot other than `root`.\n * Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot.\n *\n * @returns An object containing the native props for the `root` and primary slots.\n */\nexport const getPartitionedNativeProps = <\n Props extends Pick<React.HTMLAttributes<HTMLElement>, 'style' | 'className'>,\n ExcludedPropKeys extends Extract<keyof Props, string> = never\n>({\n primarySlotTagName,\n props,\n excludedPropNames,\n}: {\n /** The primary slot's element type (e.g. 'div') */\n primarySlotTagName: keyof JSX.IntrinsicElements;\n\n /** The component's props object */\n props: Props;\n\n /** List of native props to exclude from the returned value */\n excludedPropNames?: ExcludedPropKeys[];\n}) => {\n return {\n root: { style: props.style, className: props.className },\n primary: getNativeElementProps<Omit<Props, ExcludedPropKeys>>(primarySlotTagName, props, [\n ...(excludedPropNames || []),\n 'style',\n 'className',\n ]),\n };\n};\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AACA;AA4BA,MAAMA,gBAAg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B,EAAEN,KAAK,EAAE,CACvF,IAAIC,iBAAiB,IAAI,EAAE,CAAC,EAC5B,OAAO,EACP,WAAW,CACZ;GACF;AACH,CAAC;AAzBYG,iCAAyB","names":["nativeElementMap","label","properties_1","audio","video","ol","li","a","button","input","textarea","select","option","table","tr","th","td","colGroup","col","fieldset","form","iframe","img","time","dialog","getNativeElementProps","tagName","props","excludedPropNames","allowedPropNames","as","exports","getPartitionedNativeProps","primarySlotTagName","root","style","className","primary"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/getNativeElementProps.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n labelProperties,\n audioProperties,\n videoProperties,\n olProperties,\n liProperties,\n anchorProperties,\n buttonProperties,\n inputProperties,\n textAreaProperties,\n selectProperties,\n optionProperties,\n tableProperties,\n trProperties,\n thProperties,\n tdProperties,\n colGroupProperties,\n colProperties,\n fieldsetProperties,\n formProperties,\n iframeProperties,\n imgProperties,\n htmlElementProperties,\n getNativeProps,\n timeProperties,\n dialogProperties,\n} from './properties';\n\nconst nativeElementMap: Record<string, Record<string, number>> = {\n label: labelProperties,\n audio: audioProperties,\n video: videoProperties,\n ol: olProperties,\n li: liProperties,\n a: anchorProperties,\n button: buttonProperties,\n input: inputProperties,\n textarea: textAreaProperties,\n select: selectProperties,\n option: optionProperties,\n table: tableProperties,\n tr: trProperties,\n th: thProperties,\n td: tdProperties,\n colGroup: colGroupProperties,\n col: colProperties,\n fieldset: fieldsetProperties,\n form: formProperties,\n iframe: iframeProperties,\n img: imgProperties,\n time: timeProperties,\n dialog: dialogProperties,\n};\n\n/**\n * Given an element tagname and user props, filters the props to only allowed props for the given\n * element type.\n * @param tagName - Tag name (e.g. \"div\")\n * @param props - Props object\n * @param excludedPropNames - List of props to disallow\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(\n tagName: string,\n props: {},\n excludedPropNames?: string[],\n): TAttributes {\n const allowedPropNames = (tagName && nativeElementMap[tagName]) || htmlElementProperties;\n allowedPropNames.as = 1;\n\n return getNativeProps(props, allowedPropNames, excludedPropNames);\n}\n\n/**\n * Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot.\n *\n * This function is only for use with components that have a primary slot other than `root`.\n * Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot.\n *\n * @returns An object containing the native props for the `root` and primary slots.\n */\nexport const getPartitionedNativeProps = <\n Props extends Pick<React.HTMLAttributes<HTMLElement>, 'style' | 'className'>,\n ExcludedPropKeys extends Extract<keyof Props, string> = never\n>({\n primarySlotTagName,\n props,\n excludedPropNames,\n}: {\n /** The primary slot's element type (e.g. 'div') */\n primarySlotTagName: keyof JSX.IntrinsicElements;\n\n /** The component's props object */\n props: Props;\n\n /** List of native props to exclude from the returned value */\n excludedPropNames?: ExcludedPropKeys[];\n}) => {\n return {\n root: { style: props.style, className: props.className },\n primary: getNativeElementProps<Omit<Props, ExcludedPropKeys>>(primarySlotTagName, props, [\n ...(excludedPropNames || []),\n 'style',\n 'className',\n ]),\n };\n};\n"]}
@@ -8,7 +8,6 @@ exports.getRTLSafeKey = void 0;
8
8
  * @internal
9
9
  * Finds and swaps a provided key for it's right to left format.
10
10
  */
11
-
12
11
  const getRTLSafeKey = (key, dir) => {
13
12
  if (dir === 'rtl') {
14
13
  switch (key) {
@@ -16,16 +15,13 @@ const getRTLSafeKey = (key, dir) => {
16
15
  {
17
16
  return 'ArrowRight';
18
17
  }
19
-
20
18
  case 'ArrowRight':
21
19
  {
22
20
  return 'ArrowLeft';
23
21
  }
24
22
  }
25
23
  }
26
-
27
24
  return key;
28
25
  };
29
-
30
26
  exports.getRTLSafeKey = getRTLSafeKey;
31
27
  //# sourceMappingURL=getRTLSafeKey.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/getRTLSafeKey.ts"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;;AACI,MAAM,aAAa,GAAG,CAAC,GAAD,EAAc,GAAd,KAAoC;EAC/D,IAAI,GAAG,KAAK,KAAZ,EAAmB;IACjB,QAAQ,GAAR;MACE,KAAK,WAAL;QAAkB;UAChB,OAAO,YAAP;QACD;;MAED,KAAK,YAAL;QAAmB;UACjB,OAAO,WAAP;QACD;IAPH;EASD;;EAED,OAAO,GAAP;AACD,CAdM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb","sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */\nexport const getRTLSafeKey = (key: string, dir: 'ltr' | 'rtl') => {\n if (dir === 'rtl') {\n switch (key) {\n case 'ArrowLeft': {\n return 'ArrowRight';\n }\n\n case 'ArrowRight': {\n return 'ArrowLeft';\n }\n }\n }\n\n return key;\n};\n"],"sourceRoot":""}
1
+ {"version":3,"mappings":";;;;;;AAAA;;;;AAIO,MAAMA,aAAa,GAAG,CAACC,GAAW,EAAEC,GAAkB,KAAI;EAC/D,IAAIA,GAAG,KAAK,KAAK,EAAE;IACjB,QAAQD,GAAG;MACT,KAAK,WAAW;QAAE;UAChB,OAAO,YAAY;;MAGrB,KAAK,YAAY;QAAE;UACjB,OAAO,WAAW;;IACnB;;EAIL,OAAOA,GAAG;AACZ,CAAC;AAdYE,qBAAa","names":["getRTLSafeKey","key","dir","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/getRTLSafeKey.ts"],"sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */\nexport const getRTLSafeKey = (key: string, dir: 'ltr' | 'rtl') => {\n if (dir === 'rtl') {\n switch (key) {\n case 'ArrowLeft': {\n return 'ArrowRight';\n }\n\n case 'ArrowRight': {\n return 'ArrowLeft';\n }\n }\n }\n\n return key;\n};\n"]}
@@ -11,25 +11,20 @@ exports.getReactCallbackName = void 0;
11
11
  * ".eventPhase" there has proper value, see https://github.com/facebook/react/pull/19244. In React 16 all events
12
12
  * are handled in bubble phase.
13
13
  */
14
-
15
14
  function getReactCallbackName(event) {
16
15
  if (event._reactName) {
17
16
  return event._reactName;
18
17
  }
19
-
20
18
  if (event.dispatchConfig) {
21
19
  if (event.dispatchConfig.registrationName) {
22
20
  return event.dispatchConfig.registrationName;
23
21
  }
24
-
25
22
  return event.dispatchConfig.phasedRegistrationNames.bubbled;
26
23
  }
27
-
28
24
  if (process.env.NODE_ENV !== 'production') {
29
25
  // eslint-disable-next-line no-console
30
26
  console.error(['Passed React.SyntheticEvent does not contain ".dispatchConfig" or "._reactName".', 'This should not happen, please report it to https://github.com/microsoft/fluentui']);
31
27
  }
32
28
  }
33
-
34
29
  exports.getReactCallbackName = getReactCallbackName;
35
30
  //# sourceMappingURL=getReactCallbackName.js.map