@fluentui/react-utilities 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

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 (229) hide show
  1. package/CHANGELOG.json +355 -9
  2. package/CHANGELOG.md +185 -70
  3. package/dist/index.d.ts +517 -0
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/compose/getSlots.js +21 -30
  6. package/lib/compose/getSlots.js.map +1 -1
  7. package/lib/compose/index.js +0 -1
  8. package/lib/compose/index.js.map +1 -1
  9. package/lib/compose/resolveShorthand.js +13 -12
  10. package/lib/compose/resolveShorthand.js.map +1 -1
  11. package/lib/compose/types.js +1 -5
  12. package/lib/compose/types.js.map +1 -1
  13. package/lib/hooks/index.js +2 -6
  14. package/lib/hooks/index.js.map +1 -1
  15. package/lib/hooks/useControllableState.js +26 -26
  16. package/lib/hooks/useControllableState.js.map +1 -1
  17. package/lib/hooks/useEventCallback.js +6 -12
  18. package/lib/hooks/useEventCallback.js.map +1 -1
  19. package/lib/hooks/useFirstMount.js +1 -1
  20. package/lib/hooks/useFirstMount.js.map +1 -1
  21. package/lib/hooks/useForceUpdate.js +1 -3
  22. package/lib/hooks/useForceUpdate.js.map +1 -1
  23. package/lib/hooks/useId.js +9 -5
  24. package/lib/hooks/useId.js.map +1 -1
  25. package/lib/hooks/useIsomorphicLayoutEffect.js +1 -1
  26. package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  27. package/lib/hooks/useMergedEventCallbacks.js +26 -0
  28. package/lib/hooks/useMergedEventCallbacks.js.map +1 -0
  29. package/lib/hooks/useMergedRefs.js +5 -13
  30. package/lib/hooks/useMergedRefs.js.map +1 -1
  31. package/lib/hooks/useOnClickOutside.js +30 -36
  32. package/lib/hooks/useOnClickOutside.js.map +1 -1
  33. package/lib/hooks/useOnScrollOutside.js +13 -15
  34. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  35. package/lib/hooks/usePrevious.js +3 -3
  36. package/lib/hooks/usePrevious.js.map +1 -1
  37. package/lib/hooks/useTimeout.js +13 -18
  38. package/lib/hooks/useTimeout.js.map +1 -1
  39. package/lib/index.js +4 -4
  40. package/lib/index.js.map +1 -1
  41. package/lib/ssr/SSRContext.js +9 -15
  42. package/lib/ssr/SSRContext.js.map +1 -1
  43. package/lib/ssr/canUseDOM.js.map +1 -1
  44. package/lib/ssr/index.js.map +1 -1
  45. package/lib/utils/applyTriggerPropsToChildren.js +24 -4
  46. package/lib/utils/applyTriggerPropsToChildren.js.map +1 -1
  47. package/lib/utils/clamp.js +1 -3
  48. package/lib/utils/clamp.js.map +1 -1
  49. package/lib/utils/getNativeElementProps.js +28 -4
  50. package/lib/utils/getNativeElementProps.js.map +1 -1
  51. package/lib/utils/getRTLSafeKey.js +1 -1
  52. package/lib/utils/getRTLSafeKey.js.map +1 -1
  53. package/lib/utils/getReactCallbackName.js +26 -0
  54. package/lib/utils/getReactCallbackName.js.map +1 -0
  55. package/lib/utils/getTriggerChild.js +26 -0
  56. package/lib/utils/getTriggerChild.js.map +1 -0
  57. package/lib/utils/index.js +2 -1
  58. package/lib/utils/index.js.map +1 -1
  59. package/lib/utils/isFluentTrigger.js +8 -0
  60. package/lib/utils/isFluentTrigger.js.map +1 -0
  61. package/lib/utils/omit.js +2 -2
  62. package/lib/utils/omit.js.map +1 -1
  63. package/lib/utils/properties.js +72 -49
  64. package/lib/utils/properties.js.map +1 -1
  65. package/lib/utils/shouldPreventDefaultOnKeyDown.js +8 -4
  66. package/lib/utils/shouldPreventDefaultOnKeyDown.js.map +1 -1
  67. package/lib-commonjs/compose/getSlots.js +23 -34
  68. package/lib-commonjs/compose/getSlots.js.map +1 -1
  69. package/lib-commonjs/compose/index.js +1 -3
  70. package/lib-commonjs/compose/index.js.map +1 -1
  71. package/lib-commonjs/compose/resolveShorthand.js +14 -14
  72. package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
  73. package/lib-commonjs/compose/types.js +1 -5
  74. package/lib-commonjs/compose/types.js.map +1 -1
  75. package/lib-commonjs/hooks/index.js +5 -13
  76. package/lib-commonjs/hooks/index.js.map +1 -1
  77. package/lib-commonjs/hooks/useControllableState.js +27 -28
  78. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  79. package/lib-commonjs/hooks/useEventCallback.js +8 -14
  80. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  81. package/lib-commonjs/hooks/useFirstMount.js +2 -2
  82. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  83. package/lib-commonjs/hooks/useForceUpdate.js +2 -4
  84. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  85. package/lib-commonjs/hooks/useId.js +11 -7
  86. package/lib-commonjs/hooks/useId.js.map +1 -1
  87. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js +2 -2
  88. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  89. package/lib-commonjs/hooks/useMergedEventCallbacks.js +36 -0
  90. package/lib-commonjs/hooks/useMergedEventCallbacks.js.map +1 -0
  91. package/lib-commonjs/hooks/useMergedRefs.js +6 -15
  92. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  93. package/lib-commonjs/hooks/useOnClickOutside.js +32 -38
  94. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  95. package/lib-commonjs/hooks/useOnScrollOutside.js +15 -17
  96. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  97. package/lib-commonjs/hooks/usePrevious.js +4 -4
  98. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  99. package/lib-commonjs/hooks/useTimeout.js +14 -20
  100. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  101. package/lib-commonjs/index.js +158 -5
  102. package/lib-commonjs/index.js.map +1 -1
  103. package/lib-commonjs/ssr/SSRContext.js +9 -15
  104. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  105. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  106. package/lib-commonjs/ssr/index.js +1 -1
  107. package/lib-commonjs/ssr/index.js.map +1 -1
  108. package/lib-commonjs/utils/applyTriggerPropsToChildren.js +26 -6
  109. package/lib-commonjs/utils/applyTriggerPropsToChildren.js.map +1 -1
  110. package/lib-commonjs/utils/clamp.js +1 -3
  111. package/lib-commonjs/utils/clamp.js.map +1 -1
  112. package/lib-commonjs/utils/getNativeElementProps.js +31 -5
  113. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  114. package/lib-commonjs/utils/getRTLSafeKey.js +1 -1
  115. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  116. package/lib-commonjs/utils/getReactCallbackName.js +35 -0
  117. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -0
  118. package/lib-commonjs/utils/getTriggerChild.js +37 -0
  119. package/lib-commonjs/utils/getTriggerChild.js.map +1 -0
  120. package/lib-commonjs/utils/index.js +5 -3
  121. package/lib-commonjs/utils/index.js.map +1 -1
  122. package/lib-commonjs/utils/isFluentTrigger.js +17 -0
  123. package/lib-commonjs/utils/isFluentTrigger.js.map +1 -0
  124. package/lib-commonjs/utils/omit.js +2 -2
  125. package/lib-commonjs/utils/omit.js.map +1 -1
  126. package/lib-commonjs/utils/properties.js +70 -47
  127. package/lib-commonjs/utils/properties.js.map +1 -1
  128. package/lib-commonjs/utils/shouldPreventDefaultOnKeyDown.js +9 -5
  129. package/lib-commonjs/utils/shouldPreventDefaultOnKeyDown.js.map +1 -1
  130. package/package.json +14 -17
  131. package/dist/react-utilities.d.ts +0 -648
  132. package/lib/compose/getSlots.d.ts +0 -29
  133. package/lib/compose/index.d.ts +0 -4
  134. package/lib/compose/nullRender.d.ts +0 -4
  135. package/lib/compose/nullRender.js +0 -7
  136. package/lib/compose/nullRender.js.map +0 -1
  137. package/lib/compose/resolveShorthand.d.ts +0 -12
  138. package/lib/compose/types.d.ts +0 -104
  139. package/lib/hooks/index.d.ts +0 -16
  140. package/lib/hooks/useBoolean.d.ts +0 -17
  141. package/lib/hooks/useBoolean.js +0 -39
  142. package/lib/hooks/useBoolean.js.map +0 -1
  143. package/lib/hooks/useConst.d.ts +0 -12
  144. package/lib/hooks/useConst.js +0 -30
  145. package/lib/hooks/useConst.js.map +0 -1
  146. package/lib/hooks/useControllableState.d.ts +0 -21
  147. package/lib/hooks/useControllableValue.d.ts +0 -20
  148. package/lib/hooks/useControllableValue.js +0 -62
  149. package/lib/hooks/useControllableValue.js.map +0 -1
  150. package/lib/hooks/useEventCallback.d.ts +0 -13
  151. package/lib/hooks/useFirstMount.d.ts +0 -11
  152. package/lib/hooks/useForceUpdate.d.ts +0 -4
  153. package/lib/hooks/useId.d.ts +0 -15
  154. package/lib/hooks/useIsomorphicLayoutEffect.d.ts +0 -11
  155. package/lib/hooks/useMergedRefs.d.ts +0 -13
  156. package/lib/hooks/useMount.d.ts +0 -6
  157. package/lib/hooks/useMount.js +0 -17
  158. package/lib/hooks/useMount.js.map +0 -1
  159. package/lib/hooks/useOnClickOutside.d.ts +0 -29
  160. package/lib/hooks/useOnScrollOutside.d.ts +0 -5
  161. package/lib/hooks/usePrevious.d.ts +0 -1
  162. package/lib/hooks/useTimeout.d.ts +0 -8
  163. package/lib/hooks/useUnmount.d.ts +0 -6
  164. package/lib/hooks/useUnmount.js +0 -19
  165. package/lib/hooks/useUnmount.js.map +0 -1
  166. package/lib/index.d.ts +0 -4
  167. package/lib/ssr/SSRContext.d.ts +0 -33
  168. package/lib/ssr/canUseDOM.d.ts +0 -4
  169. package/lib/ssr/index.d.ts +0 -2
  170. package/lib/utils/applyTriggerPropsToChildren.d.ts +0 -5
  171. package/lib/utils/clamp.d.ts +0 -8
  172. package/lib/utils/getNativeElementProps.d.ts +0 -9
  173. package/lib/utils/getRTLSafeKey.d.ts +0 -4
  174. package/lib/utils/index.d.ts +0 -8
  175. package/lib/utils/omit.d.ts +0 -14
  176. package/lib/utils/onlyChild.d.ts +0 -5
  177. package/lib/utils/onlyChild.js +0 -13
  178. package/lib/utils/onlyChild.js.map +0 -1
  179. package/lib/utils/properties.d.ts +0 -148
  180. package/lib/utils/shouldPreventDefaultOnKeyDown.d.ts +0 -7
  181. package/lib-commonjs/compose/getSlots.d.ts +0 -29
  182. package/lib-commonjs/compose/index.d.ts +0 -4
  183. package/lib-commonjs/compose/nullRender.d.ts +0 -4
  184. package/lib-commonjs/compose/nullRender.js +0 -16
  185. package/lib-commonjs/compose/nullRender.js.map +0 -1
  186. package/lib-commonjs/compose/resolveShorthand.d.ts +0 -12
  187. package/lib-commonjs/compose/types.d.ts +0 -104
  188. package/lib-commonjs/hooks/index.d.ts +0 -16
  189. package/lib-commonjs/hooks/useBoolean.d.ts +0 -17
  190. package/lib-commonjs/hooks/useBoolean.js +0 -50
  191. package/lib-commonjs/hooks/useBoolean.js.map +0 -1
  192. package/lib-commonjs/hooks/useConst.d.ts +0 -12
  193. package/lib-commonjs/hooks/useConst.js +0 -40
  194. package/lib-commonjs/hooks/useConst.js.map +0 -1
  195. package/lib-commonjs/hooks/useControllableState.d.ts +0 -21
  196. package/lib-commonjs/hooks/useControllableValue.d.ts +0 -20
  197. package/lib-commonjs/hooks/useControllableValue.js +0 -73
  198. package/lib-commonjs/hooks/useControllableValue.js.map +0 -1
  199. package/lib-commonjs/hooks/useEventCallback.d.ts +0 -13
  200. package/lib-commonjs/hooks/useFirstMount.d.ts +0 -11
  201. package/lib-commonjs/hooks/useForceUpdate.d.ts +0 -4
  202. package/lib-commonjs/hooks/useId.d.ts +0 -15
  203. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.d.ts +0 -11
  204. package/lib-commonjs/hooks/useMergedRefs.d.ts +0 -13
  205. package/lib-commonjs/hooks/useMount.d.ts +0 -6
  206. package/lib-commonjs/hooks/useMount.js +0 -27
  207. package/lib-commonjs/hooks/useMount.js.map +0 -1
  208. package/lib-commonjs/hooks/useOnClickOutside.d.ts +0 -29
  209. package/lib-commonjs/hooks/useOnScrollOutside.d.ts +0 -5
  210. package/lib-commonjs/hooks/usePrevious.d.ts +0 -1
  211. package/lib-commonjs/hooks/useTimeout.d.ts +0 -8
  212. package/lib-commonjs/hooks/useUnmount.d.ts +0 -6
  213. package/lib-commonjs/hooks/useUnmount.js +0 -29
  214. package/lib-commonjs/hooks/useUnmount.js.map +0 -1
  215. package/lib-commonjs/index.d.ts +0 -4
  216. package/lib-commonjs/ssr/SSRContext.d.ts +0 -33
  217. package/lib-commonjs/ssr/canUseDOM.d.ts +0 -4
  218. package/lib-commonjs/ssr/index.d.ts +0 -2
  219. package/lib-commonjs/utils/applyTriggerPropsToChildren.d.ts +0 -5
  220. package/lib-commonjs/utils/clamp.d.ts +0 -8
  221. package/lib-commonjs/utils/getNativeElementProps.d.ts +0 -9
  222. package/lib-commonjs/utils/getRTLSafeKey.d.ts +0 -4
  223. package/lib-commonjs/utils/index.d.ts +0 -8
  224. package/lib-commonjs/utils/omit.d.ts +0 -14
  225. package/lib-commonjs/utils/onlyChild.d.ts +0 -5
  226. package/lib-commonjs/utils/onlyChild.js +0 -23
  227. package/lib-commonjs/utils/onlyChild.js.map +0 -1
  228. package/lib-commonjs/utils/properties.d.ts +0 -148
  229. package/lib-commonjs/utils/shouldPreventDefaultOnKeyDown.d.ts +0 -7
@@ -1,18 +1,10 @@
1
- var toObjectMap = function () {
2
- var items = [];
1
+ const toObjectMap = (...items) => {
2
+ const result = {};
3
3
 
4
- for (var _i = 0; _i < arguments.length; _i++) {
5
- items[_i] = arguments[_i];
6
- }
7
-
8
- var result = {};
4
+ for (const item of items) {
5
+ const keys = Array.isArray(item) ? item : Object.keys(item);
9
6
 
10
- for (var _a = 0, items_1 = items; _a < items_1.length; _a++) {
11
- var item = items_1[_a];
12
- var keys = Array.isArray(item) ? item : Object.keys(item);
13
-
14
- for (var _b = 0, keys_1 = keys; _b < keys_1.length; _b++) {
15
- var key = keys_1[_b];
7
+ for (const key of keys) {
16
8
  result[key] = 1;
17
9
  }
18
10
  }
@@ -26,155 +18,186 @@ var toObjectMap = function () {
26
18
  */
27
19
 
28
20
 
29
- export var baseElementEvents = /*#__PURE__*/toObjectMap(['onCopy', 'onCut', 'onPaste', 'onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate', 'onFocus', 'onFocusCapture', 'onBlur', 'onBlurCapture', 'onChange', 'onInput', 'onSubmit', 'onLoad', 'onError', 'onKeyDown', 'onKeyDownCapture', 'onKeyPress', 'onKeyUp', 'onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting', 'onClick', 'onClickCapture', 'onContextMenu', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseDownCapture', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onMouseUpCapture', 'onSelect', 'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'onScroll', 'onWheel', 'onPointerCancel', 'onPointerDown', 'onPointerEnter', 'onPointerLeave', 'onPointerMove', 'onPointerOut', 'onPointerOver', 'onPointerUp', 'onGotPointerCapture', 'onLostPointerCapture']);
21
+ export const baseElementEvents = /*#__PURE__*/toObjectMap(['onAuxClick', 'onCopy', 'onCut', 'onPaste', 'onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate', 'onFocus', 'onFocusCapture', 'onBlur', 'onBlurCapture', 'onChange', 'onInput', 'onSubmit', 'onLoad', 'onError', 'onKeyDown', 'onKeyDownCapture', 'onKeyPress', 'onKeyUp', 'onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting', 'onClick', 'onClickCapture', 'onContextMenu', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseDownCapture', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onMouseUpCapture', 'onSelect', 'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'onScroll', 'onWheel', 'onPointerCancel', 'onPointerDown', 'onPointerEnter', 'onPointerLeave', 'onPointerMove', 'onPointerOut', 'onPointerOver', 'onPointerUp', 'onGotPointerCapture', 'onLostPointerCapture']);
30
22
  /**
31
23
  * An array of element attributes which are allowed on every html element type.
32
24
  *
33
25
  * @public
34
26
  */
35
27
 
36
- export var baseElementProperties = /*#__PURE__*/toObjectMap(['accessKey', 'children', 'className', 'contentEditable', 'dir', 'draggable', 'hidden', 'htmlFor', 'id', 'lang', 'ref', 'role', 'style', 'tabIndex', 'title', 'translate', 'spellCheck', 'name']);
28
+ export const baseElementProperties = /*#__PURE__*/toObjectMap(['accessKey', 'children', 'className', 'contentEditable', 'dir', 'draggable', 'hidden', 'htmlFor', 'id', 'lang', 'ref', 'role', 'style', 'tabIndex', 'title', 'translate', 'spellCheck', 'name' // global
29
+ ]);
37
30
  /**
38
31
  * An array of HTML element properties and events.
39
32
  *
40
33
  * @public
41
34
  */
42
35
 
43
- export var htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementProperties, baseElementEvents);
36
+ export const htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementProperties, baseElementEvents);
44
37
  /**
45
38
  * An array of LABEL tag properties and events.
46
39
  *
47
40
  * @public
48
41
  */
49
42
 
50
- export var labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['form']);
43
+ export const labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['form' // button, fieldset, input, label, meter, object, output, select, textarea
44
+ ]);
51
45
  /**
52
46
  * An array of AUDIO tag properties and events.
53
47
 
54
48
  * @public
55
49
  */
56
50
 
57
- export var audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['height', 'loop', 'muted', 'preload', 'src', 'width']);
51
+ export const audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['height', 'loop', 'muted', 'preload', 'src', 'width' // canvas, embed, iframe, img, input, object, video
52
+ ]);
58
53
  /**
59
54
  * An array of VIDEO tag properties and events.
60
55
  *
61
56
  * @public
62
57
  */
63
58
 
64
- export var videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ['poster']);
59
+ export const videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ['poster' // video
60
+ ]);
65
61
  /**
66
62
  * An array of OL tag properties and events.
67
63
  *
68
64
  * @public
69
65
  */
70
66
 
71
- export var olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['start']);
67
+ export const olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['start' // ol
68
+ ]);
72
69
  /**
73
70
  * An array of LI tag properties and events.
74
71
  *
75
72
  * @public
76
73
  */
77
74
 
78
- export var liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['value']);
75
+ export const liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['value' // button, input, li, option, meter, progress, param
76
+ ]);
79
77
  /**
80
78
  * An array of A tag properties and events.
81
79
  *
82
80
  * @public
83
81
  */
84
82
 
85
- export var anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type']);
83
+ export const anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type' // a, button, input, link, menu, object, script, source, style
84
+ ]);
85
+ /**
86
+ * An array of TIME tag properties and events.
87
+ *
88
+ * @public
89
+ */
90
+
91
+ export const timeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['dateTime' // time
92
+ ]);
86
93
  /**
87
94
  * An array of BUTTON tag properties and events.
88
95
  *
89
96
  * @public
90
97
  */
91
98
 
92
- export var buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'type', 'value']);
99
+ export const buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'type', 'value' // button, input, li, option, meter, progress, param,
100
+ ]);
93
101
  /**
94
102
  * An array of INPUT tag properties and events.
95
103
  *
96
104
  * @public
97
105
  */
98
106
 
99
- export var inputProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['accept', 'alt', 'autoCapitalize', 'autoComplete', 'checked', 'dirname', 'form', 'height', 'inputMode', 'list', 'max', 'maxLength', 'min', 'multiple', 'pattern', 'placeholder', 'readOnly', 'required', 'src', 'step', 'size', 'type', 'value', 'width']);
107
+ export const inputProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['accept', 'alt', 'autoCapitalize', 'autoComplete', 'checked', 'dirname', 'form', 'height', 'inputMode', 'list', 'max', 'maxLength', 'min', 'multiple', 'pattern', 'placeholder', 'readOnly', 'required', 'src', 'step', 'size', 'type', 'value', 'width' // canvas, embed, iframe, img, input, object, video
108
+ ]);
100
109
  /**
101
110
  * An array of TEXTAREA tag properties and events.
102
111
  *
103
112
  * @public
104
113
  */
105
114
 
106
- export var textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['autoCapitalize', 'cols', 'dirname', 'form', 'maxLength', 'placeholder', 'readOnly', 'required', 'rows', 'wrap']);
115
+ export const textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['autoCapitalize', 'cols', 'dirname', 'form', 'maxLength', 'placeholder', 'readOnly', 'required', 'rows', 'wrap' // textarea
116
+ ]);
107
117
  /**
108
118
  * An array of SELECT tag properties and events.
109
119
  *
110
120
  * @public
111
121
  */
112
122
 
113
- export var selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['form', 'multiple', 'required']);
114
- export var optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['selected', 'value']);
123
+ export const selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['form', 'multiple', 'required' // input, select, textarea
124
+ ]);
125
+ export const optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['selected', 'value' // button, input, li, option, meter, progress, param
126
+ ]);
115
127
  /**
116
128
  * An array of TABLE tag properties and events.
117
129
  *
118
130
  * @public
119
131
  */
120
132
 
121
- export var tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['cellPadding', 'cellSpacing']);
133
+ export const tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['cellPadding', 'cellSpacing' // table
134
+ ]);
122
135
  /**
123
136
  * An array of TR tag properties and events.
124
137
  *
125
138
  * @public
126
139
  */
127
140
 
128
- export var trProperties = htmlElementProperties;
141
+ export const trProperties = htmlElementProperties;
129
142
  /**
130
143
  * An array of TH tag properties and events.
131
144
  *
132
145
  * @public
133
146
  */
134
147
 
135
- export var thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['rowSpan', 'scope']);
148
+ export const thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['rowSpan', 'scope' // th
149
+ ]);
136
150
  /**
137
151
  * An array of TD tag properties and events.
138
152
  *
139
153
  * @public
140
154
  */
141
155
 
142
- export var tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'headers', 'rowSpan', 'scope']);
143
- export var colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);
144
- export var colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);
156
+ export const tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'headers', 'rowSpan', 'scope' // th
157
+ ]);
158
+ export const colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span' // col, colgroup
159
+ ]);
160
+ export const colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span' // col, colgroup
161
+ ]);
145
162
  /**
146
- * An array of FORM tag properties and events.
163
+ * An array of FIELDSET tag properties and events.
147
164
  *
148
165
  * @public
149
166
  */
150
167
 
151
- export var formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['acceptCharset', 'action', 'encType', 'encType', 'method', 'noValidate', 'target']);
168
+ export const fieldsetProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['disabled', 'form' // button, fieldset, input, label, meter, object, output, select, textarea
169
+ ]);
152
170
  /**
153
- * An array of IFRAME tag properties and events.
171
+ * An array of FORM tag properties and events.
154
172
  *
155
173
  * @public
156
174
  */
157
175
 
158
- export var iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['allow', 'allowFullScreen', 'allowPaymentRequest', 'allowTransparency', 'csp', 'height', 'importance', 'referrerPolicy', 'sandbox', 'src', 'srcDoc', 'width']);
176
+ export const formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['acceptCharset', 'action', 'encType', 'encType', 'method', 'noValidate', 'target' // form
177
+ ]);
159
178
  /**
160
- * An array of IMAGE tag properties and events.
179
+ * An array of IFRAME tag properties and events.
161
180
  *
162
181
  * @public
163
182
  */
164
183
 
165
- export var imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['alt', 'crossOrigin', 'height', 'src', 'srcSet', 'useMap', 'width']);
184
+ export const iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['allow', 'allowFullScreen', 'allowPaymentRequest', 'allowTransparency', 'csp', 'height', 'importance', 'referrerPolicy', 'sandbox', 'src', 'srcDoc', 'width' // canvas, embed, iframe, img, input, object, video,
185
+ ]);
166
186
  /**
167
- * @deprecated Use imgProperties for img elements.
187
+ * An array of IMAGE tag properties and events.
188
+ *
189
+ * @public
168
190
  */
169
191
 
170
- export var imageProperties = imgProperties;
192
+ export const imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['alt', 'crossOrigin', 'height', 'src', 'srcSet', 'useMap', 'width' // canvas, embed, iframe, img, input, object, video
193
+ ]);
171
194
  /**
172
195
  * An array of DIV tag properties and events.
173
196
  *
174
197
  * @public
175
198
  */
176
199
 
177
- export var divProperties = htmlElementProperties;
200
+ export const divProperties = htmlElementProperties;
178
201
  /**
179
202
  * Gets native supported props for an html element provided the allowance set. Use one of the property
180
203
  * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given
@@ -186,7 +209,8 @@ export var divProperties = htmlElementProperties;
186
209
  *
187
210
  * @public
188
211
  * @param props - The unfiltered input props
189
- * @param allowedPropsNames - The array or record of allowed prop names.
212
+ * @param allowedPropNames - The array or record of allowed prop names.
213
+ * @param excludedPropNames
190
214
  * @returns The filtered props
191
215
  */
192
216
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -198,14 +222,13 @@ props, allowedPropNames, excludedPropNames) {
198
222
  // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then
199
223
  // return native props.
200
224
  // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797
201
- var isArray = Array.isArray(allowedPropNames); // eslint-disable-next-line @typescript-eslint/no-explicit-any
225
+ const isArray = Array.isArray(allowedPropNames); // eslint-disable-next-line @typescript-eslint/no-explicit-any
202
226
 
203
- var result = {};
204
- var keys = Object.keys(props);
227
+ const result = {};
228
+ const keys = Object.keys(props);
205
229
 
206
- for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {
207
- var key = keys_2[_i];
208
- var isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;
230
+ for (const key of keys) {
231
+ const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;
209
232
 
210
233
  if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {
211
234
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/properties.ts"],"names":[],"mappings":"AAAA,IAAM,WAAW,GAAG,YAAA;AAAC,MAAA,KAAA,GAAA,EAAA;;OAAA,IAAA,EAAA,GAAA,C,EAAA,EAAA,GAAA,SAAA,CAAA,M,EAAA,EAAA,E,EAA+C;AAA/C,IAAA,KAAA,CAAA,EAAA,CAAA,GAAA,SAAA,CAAA,EAAA,CAAA;;;AACnB,MAAM,MAAM,GAA2B,EAAvC;;AAEA,OAAmB,IAAA,EAAA,GAAA,CAAA,EAAA,OAAA,GAAA,KAAnB,EAAmB,EAAA,GAAA,OAAA,CAAA,MAAnB,EAAmB,EAAA,EAAnB,EAA0B;AAArB,QAAM,IAAI,GAAA,OAAA,CAAA,EAAA,CAAV;AACH,QAAM,IAAI,GAAG,KAAK,CAAC,OAAN,CAAc,IAAd,IAAsB,IAAtB,GAA6B,MAAM,CAAC,IAAP,CAAY,IAAZ,CAA1C;;AAEA,SAAkB,IAAA,EAAA,GAAA,CAAA,EAAA,MAAA,GAAA,IAAlB,EAAkB,EAAA,GAAA,MAAA,CAAA,MAAlB,EAAkB,EAAA,EAAlB,EAAwB;AAAnB,UAAM,GAAG,GAAA,MAAA,CAAA,EAAA,CAAT;AACH,MAAA,MAAM,CAAC,GAAD,CAAN,GAAc,CAAd;AACD;AACF;;AAED,SAAO,MAAP;AACD,CAZD;AAcA;;;;AAIG;;;AACH,OAAO,IAAM,iBAAiB,gBAAG,WAAW,CAAC,CAC3C,QAD2C,EAE3C,OAF2C,EAG3C,SAH2C,EAI3C,kBAJ2C,EAK3C,oBAL2C,EAM3C,qBAN2C,EAO3C,SAP2C,EAQ3C,gBAR2C,EAS3C,QAT2C,EAU3C,eAV2C,EAW3C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AD,CAAzD,IACC,OAAO,IAAK,gBAA6B,CAAC,OAA9B,CAAsC,GAAtC,KAA8C,CAD3D,IAEA,GAAG,CAAC,OAAJ,CAAY,OAAZ,MAAyB,CAFzB,IAGA,GAAG,CAAC,OAAJ,CAAY,OAAZ,MAAyB,CAJ3B;;AAMA,QAAI,YAAY,KAAK,CAAC,iBAAD,IAAsB,CAAA,iBAAiB,KAAA,IAAjB,IAAA,iBAAiB,KAAA,KAAA,CAAjB,GAAiB,KAAA,CAAjB,GAAA,iBAAiB,CAAE,OAAnB,CAA2B,GAA3B,CAAA,MAAoC,CAAC,CAAhE,CAAhB,EAAoF;AAClF;AACA,MAAA,MAAM,CAAC,GAAD,CAAN,GAAc,KAAM,CAAC,GAAD,CAApB;AACD;AACF;;AAED,SAAO,MAAP;AACD","sourcesContent":["const toObjectMap = (...items: (string[] | Record<string, number>)[]) => {\n const result: Record<string, number> = {};\n\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n\n for (const key of keys) {\n result[key] = 1;\n }\n }\n\n return result;\n};\n\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = toObjectMap([\n 'onAuxClick',\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n]);\n\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = toObjectMap([\n 'accessKey', // global\n 'children', // global\n 'className', // global\n 'contentEditable', // global\n 'dir', // global\n 'draggable', // global\n 'hidden', // global\n 'htmlFor', // global\n 'id', // global\n 'lang', // global\n 'ref', // global\n 'role', // global\n 'style', // global\n 'tabIndex', // global\n 'title', // global\n 'translate', // global\n 'spellCheck', // global\n 'name', // global\n]);\n\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents);\n\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = toObjectMap(htmlElementProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = toObjectMap(htmlElementProperties, [\n 'height', // canvas, embed, iframe, img, input, object, video\n 'loop', // audio, video\n 'muted', // audio, video\n 'preload', // audio, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = toObjectMap(audioProperties, [\n 'poster', // video\n]);\n\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = toObjectMap(htmlElementProperties, [\n 'start', // ol\n]);\n\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = toObjectMap(htmlElementProperties, [\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download', // a, area\n 'href', // a, area, base, link\n 'hrefLang', // a, area, link\n 'media', // a, area, link, source, style\n 'rel', // a, area, link\n 'target', // a, area, base, form\n 'type', // a, button, input, link, menu, object, script, source, style\n]);\n\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */\nexport const timeProperties = toObjectMap(htmlElementProperties, [\n 'dateTime', // time\n]);\n\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus', // button, input, select, textarea\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'formAction', // input, button\n 'formEncType', // input, button\n 'formMethod', // input, button\n 'formNoValidate', // input, button\n 'formTarget', // input, button\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param,\n]);\n\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = toObjectMap(buttonProperties, [\n 'accept', // input\n 'alt', // area, img, input\n 'autoCapitalize', // input, textarea\n 'autoComplete', // form, input\n 'checked', // input\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'height', // canvas, embed, iframe, img, input, object, video\n 'inputMode', // input\n 'list', // input\n 'max', // input, meter\n 'maxLength', // input, textarea\n 'min', // input, meter\n 'multiple', // input, select\n 'pattern', // input\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'step', // input\n 'size', // input\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize', // input, textarea\n 'cols', // textarea\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'maxLength', // input, textarea\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'rows', // textarea\n 'wrap', // textarea\n]);\n\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = toObjectMap(buttonProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'multiple', // input, select\n 'required', // input, select, textarea\n]);\n\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected', // option\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding', // table\n 'cellSpacing', // table\n]);\n\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = toObjectMap(htmlElementProperties, [\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td\n 'headers', // td\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */\nexport const fieldsetProperties = toObjectMap(htmlElementProperties, [\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset', // form\n 'action', // form\n 'encType', // form\n 'encType', // form\n 'method', // form\n 'noValidate', // form\n 'target', // form\n]);\n\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow', // iframe\n 'allowFullScreen', // iframe\n 'allowPaymentRequest', // iframe\n 'allowTransparency', // iframe\n 'csp', // iframe\n 'height', // canvas, embed, iframe, img, input, object, video\n 'importance', // iframe\n 'referrerPolicy', // iframe\n 'sandbox', // iframe\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcDoc', // iframe\n 'width', // canvas, embed, iframe, img, input, object, video,\n]);\n\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt', // area, img, input\n 'crossOrigin', // img\n 'height', // canvas, embed, iframe, img, input, object, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcSet', // img, source\n 'useMap', // img, object,\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps<T extends Record<string, any>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: Record<string, any>,\n allowedPropNames: string[] | Record<string, number>,\n excludedPropNames?: string[],\n): T {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n const keys = Object.keys(props);\n\n for (const key of keys) {\n const isNativeProp =\n (!isArray && (allowedPropNames as Record<string, number>)[key]) ||\n (isArray && (allowedPropNames as string[]).indexOf(key) >= 0) ||\n key.indexOf('data-') === 0 ||\n key.indexOf('aria-') === 0;\n\n if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props![key] as any;\n }\n }\n\n return result as T;\n}\n"],"sourceRoot":"../src/"}
@@ -6,15 +6,19 @@ import { Space, Enter } from '@fluentui/keyboard-keys';
6
6
  */
7
7
 
8
8
  export function shouldPreventDefaultOnKeyDown(e) {
9
- var key = e.key;
10
- var target = e.target;
11
- var matchesByKey = key === Space || key === Enter;
9
+ if (e.defaultPrevented) {
10
+ return false;
11
+ }
12
+
13
+ const key = e.key;
14
+ const target = e.target;
15
+ const matchesByKey = key === Space || key === Enter;
12
16
 
13
17
  if ((target === null || target === void 0 ? void 0 : target.tagName) === 'A') {
14
18
  return key === Space;
15
19
  }
16
20
 
17
- var ignoredByTag = (target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT' || (target === null || target === void 0 ? void 0 : target.tagName) === 'TEXTAREA' || (target === null || target === void 0 ? void 0 : target.isContentEditable) === true;
21
+ const ignoredByTag = (target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT' || (target === null || target === void 0 ? void 0 : target.tagName) === 'TEXTAREA' || (target === null || target === void 0 ? void 0 : target.isContentEditable) === true;
18
22
  return matchesByKey && !ignoredByTag;
19
23
  }
20
24
  //# sourceMappingURL=shouldPreventDefaultOnKeyDown.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/shouldPreventDefaultOnKeyDown.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,KAAhB,QAA6B,yBAA7B;AAGA;;;;AAIG;;AACH,OAAM,SAAU,6BAAV,CAAwC,CAAxC,EAA8E;AAClF,MAAM,GAAG,GAAG,CAAC,CAAC,GAAd;AACA,MAAM,MAAM,GAA4B,CAAC,CAAC,MAA1C;AAEA,MAAM,YAAY,GAAG,GAAG,KAAK,KAAR,IAAiB,GAAG,KAAK,KAA9C;;AAEA,MAAI,CAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,OAAR,MAAoB,GAAxB,EAA6B;AAC3B,WAAO,GAAG,KAAK,KAAf;AACD;;AAED,MAAM,YAAY,GAChB,CAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,OAAR,MAAoB,OAApB,IAA+B,CAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,OAAR,MAAoB,UAAnD,IAAiE,CAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,iBAAR,MAA8B,IADjG;AAGA,SAAO,YAAY,IAAI,CAAC,YAAxB;AACD","sourceRoot":""}
1
+ {"version":3,"sources":["utils/shouldPreventDefaultOnKeyDown.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,KAAhB,QAA6B,yBAA7B;AAGA;;;;AAIG;;AACH,OAAM,SAAU,6BAAV,CAAwC,CAAxC,EAA8E;AAClF,MAAI,CAAC,CAAC,gBAAN,EAAwB;AACtB,WAAO,KAAP;AACD;;AAED,QAAM,GAAG,GAAG,CAAC,CAAC,GAAd;AACA,QAAM,MAAM,GAA4B,CAAC,CAAC,MAA1C;AAEA,QAAM,YAAY,GAAG,GAAG,KAAK,KAAR,IAAiB,GAAG,KAAK,KAA9C;;AAEA,MAAI,CAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,OAAR,MAAoB,GAAxB,EAA6B;AAC3B,WAAO,GAAG,KAAK,KAAf;AACD;;AAED,QAAM,YAAY,GAChB,CAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,OAAR,MAAoB,OAApB,IAA+B,CAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,OAAR,MAAoB,UAAnD,IAAiE,CAAA,MAAM,KAAA,IAAN,IAAA,MAAM,KAAA,KAAA,CAAN,GAAM,KAAA,CAAN,GAAA,MAAM,CAAE,iBAAR,MAA8B,IADjG;AAGA,SAAO,YAAY,IAAI,CAAC,YAAxB;AACD","sourcesContent":["import { Space, Enter } from '@fluentui/keyboard-keys';\nimport * as React from 'react';\n\n/**\n * Checks if the keyboard event should preventDefault() for Enter and Spacebar keys\n *\n * Useful for situations where a keydown needs to be transformed to a click event\n */\nexport function shouldPreventDefaultOnKeyDown(e: KeyboardEvent | React.KeyboardEvent) {\n if (e.defaultPrevented) {\n return false;\n }\n\n const key = e.key;\n const target: HTMLElement | undefined = e.target as HTMLElement;\n\n const matchesByKey = key === Space || key === Enter;\n\n if (target?.tagName === 'A') {\n return key === Space;\n }\n\n const ignoredByTag =\n target?.tagName === 'INPUT' || target?.tagName === 'TEXTAREA' || target?.isContentEditable === true;\n\n return matchesByKey && !ignoredByTag;\n}\n"],"sourceRoot":"../src/"}
@@ -5,13 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getSlots = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
11
-
12
- var nullRender_1 = /*#__PURE__*/require("./nullRender");
13
-
14
- var omit_1 = /*#__PURE__*/require("../utils/omit");
10
+ const omit_1 = /*#__PURE__*/require("../utils/omit");
15
11
  /**
16
12
  * Given the state and an array of slot names, will break out `slots` and `slotProps`
17
13
  * collections.
@@ -21,36 +17,29 @@ var omit_1 = /*#__PURE__*/require("../utils/omit");
21
17
  * Slots will render as null if they are rendered as primitives with undefined children.
22
18
  *
23
19
  * The slotProps will always omit the `as` prop within them, and for slots that are string
24
- * primitives, the props will be filtered according the the slot type. For example, if the
25
- * slot is rendered `as: 'a'`, the props will be filtered for acceptable anchor props.
20
+ * primitives, the props will be filtered according to the slot type by the type system.
21
+ * For example, if the slot is rendered `as: 'a'`, the props will be filtered for acceptable
22
+ * anchor props. Note that this is only enforced at build time by Typescript -- there is no
23
+ * runtime code filtering props in this function.
26
24
  *
27
25
  * @param state - State including slot definitions
28
- * @param slotNames - Name of which props are slots
29
26
  * @returns An object containing the `slots` map and `slotProps` map.
30
27
  */
31
28
 
32
29
 
33
- function getSlots(state, slotNames) {
34
- if (slotNames === void 0) {
35
- slotNames = ['root'];
36
- }
37
-
38
- var slots = {};
39
- var slotProps = {};
40
-
41
- for (var _i = 0, slotNames_1 = slotNames; _i < slotNames_1.length; _i++) {
42
- var slotName = slotNames_1[_i];
43
-
44
- var _a = getSlot(state, slotName),
45
- slot = _a[0],
46
- props = _a[1];
30
+ function getSlots(state) {
31
+ const slots = {};
32
+ const slotProps = {};
33
+ const slotNames = Object.keys(state.components);
47
34
 
35
+ for (const slotName of slotNames) {
36
+ const [slot, props] = getSlot(state, slotName);
48
37
  slots[slotName] = slot;
49
38
  slotProps[slotName] = props;
50
39
  }
51
40
 
52
41
  return {
53
- slots: slots,
42
+ slots,
54
43
  slotProps: slotProps
55
44
  };
56
45
  }
@@ -61,25 +50,25 @@ function getSlot(state, slotName) {
61
50
  var _a, _b, _c;
62
51
 
63
52
  if (state[slotName] === undefined) {
64
- return [nullRender_1.nullRender, undefined];
53
+ return [null, undefined];
65
54
  }
66
55
 
67
- var _d = state[slotName],
68
- children = _d.children,
69
- asProp = _d.as,
70
- rest = tslib_1.__rest(_d, ["children", "as"]);
71
-
72
- var slot = ((_a = state.components) === null || _a === void 0 ? void 0 : _a[slotName]) === undefined || typeof state.components[slotName] === 'string' ? asProp || ((_b = state.components) === null || _b === void 0 ? void 0 : _b[slotName]) || 'div' : state.components[slotName];
56
+ const {
57
+ children,
58
+ as: asProp,
59
+ ...rest
60
+ } = state[slotName];
61
+ const slot = ((_a = state.components) === null || _a === void 0 ? void 0 : _a[slotName]) === undefined || typeof state.components[slotName] === 'string' ? asProp || ((_b = state.components) === null || _b === void 0 ? void 0 : _b[slotName]) || 'div' : state.components[slotName];
73
62
 
74
63
  if (typeof children === 'function') {
75
- var render = children;
64
+ const render = children;
76
65
  return [React.Fragment, {
77
66
  children: render(slot, rest)
78
67
  }];
79
68
  }
80
69
 
81
- var shouldOmitAsProp = typeof slot === 'string' && ((_c = state[slotName]) === null || _c === void 0 ? void 0 : _c.as);
82
- var slotProps = shouldOmitAsProp ? omit_1.omit(state[slotName], ['as']) : state[slotName];
70
+ const shouldOmitAsProp = typeof slot === 'string' && ((_c = state[slotName]) === null || _c === void 0 ? void 0 : _c.as);
71
+ const slotProps = shouldOmitAsProp ? omit_1.omit(state[slotName], ['as']) : state[slotName];
83
72
  return [slot, slotProps];
84
73
  }
85
74
  //# sourceMappingURL=getSlots.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src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KAAI,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,MAAgB,IAAhB,IAAgB,EAAA,KAAA,KAAA,CAAhB,GAAgB,KAAA,CAAhB,GAAgB,EAAA,CAAG,QAAH,CAApB,CAAN,IAA0C,KADhC,GAEV,KAAK,CAAC,UAAN,CAAiB,QAAjB,CAFJ;;AAIA,MAAI,OAAO,QAAP,KAAoB,UAAxB,EAAoC;AAClC,UAAM,MAAM,GAAG,QAAf;AACA,WAAO,CACL,KAAK,CAAC,QADD,EAEJ;AACC,MAAA,QAAQ,EAAE,MAAM,CAAC,IAAD,EAAO,IAAP;AADjB,KAFI,CAAP;AAMD;;AAED,QAAM,gBAAgB,GAAG,OAAO,IAAP,KAAgB,QAAhB,KAA4B,CAAA,EAAA,GAAA,KAAK,CAAC,QAAD,CAAL,MAAe,IAAf,IAAe,EAAA,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAe,EAAA,CAAE,EAA7C,CAAzB;AACA,QAAM,SAAS,GAAI,gBAAgB,GAAG,MAAA,CAAA,IAAA,CAAK,KAAK,CAAC,QAAD,CAAV,EAAuB,CAAC,IAAD,CAAvB,CAAH,GAAoC,KAAK,CAAC,QAAD,CAA5E;AAEA,SAAO,CAAC,IAAD,EAAO,SAAP,CAAP;AACD","sourcesContent":["import * as React from 'react';\n\nimport { omit } from '../utils/omit';\nimport type {\n AsIntrinsicElement,\n ComponentState,\n ExtractSlotProps,\n SlotPropsRecord,\n SlotRenderFunction,\n UnionToIntersection,\n} from './types';\n\nexport type Slots<S extends SlotPropsRecord> = {\n [K in keyof S]: ExtractSlotProps<S[K]> extends AsIntrinsicElement<infer As>\n ? // for slots with an `as` prop, the slot will be any one of the possible values of `as`\n As\n : ExtractSlotProps<S[K]> extends React.ComponentType<infer P>\n ? React.ElementType<NonNullable<P>>\n : React.ElementType<ExtractSlotProps<S[K]>>;\n};\n\ntype ObjectSlotProps<S extends SlotPropsRecord> = {\n [K in keyof S]-?: ExtractSlotProps<S[K]> extends AsIntrinsicElement<infer As>\n ? // For intrinsic element types, return the intersection of all possible\n // element's props, to be compatible with the As type returned by Slots<>\n UnionToIntersection<JSX.IntrinsicElements[As]>\n : ExtractSlotProps<S[K]> extends React.ComponentType<infer P>\n ? P\n : never;\n};\n\n/**\n * Given the state and an array of slot names, will break out `slots` and `slotProps`\n * collections.\n *\n * The root is derived from a mix of `components` props and `as` prop.\n *\n * Slots will render as null if they are rendered as primitives with undefined children.\n *\n * The slotProps will always omit the `as` prop within them, and for slots that are string\n * primitives, the props will be filtered according to the slot type by the type system.\n * For example, if the slot is rendered `as: 'a'`, the props will be filtered for acceptable\n * anchor props. Note that this is only enforced at build time by Typescript -- there is no\n * runtime code filtering props in this function.\n *\n * @param state - State including slot definitions\n * @returns An object containing the `slots` map and `slotProps` map.\n */\nexport function getSlots<R extends SlotPropsRecord>(\n state: ComponentState<R>,\n): {\n slots: Slots<R>;\n slotProps: ObjectSlotProps<R>;\n} {\n const slots = {} as Slots<R>;\n const slotProps = {} as R;\n\n const slotNames: (keyof R)[] = Object.keys(state.components);\n for (const slotName of slotNames) {\n const [slot, props] = getSlot(state, slotName);\n slots[slotName] = slot as Slots<R>[typeof slotName];\n slotProps[slotName] = props;\n }\n return { slots, slotProps: (slotProps as unknown) as ObjectSlotProps<R> };\n}\n\nfunction getSlot<R extends SlotPropsRecord, K extends keyof R>(\n state: ComponentState<R>,\n slotName: K,\n): readonly [React.ElementType<R[K]> | null, R[K]] {\n if (state[slotName] === undefined) {\n return [null, undefined as R[K]];\n }\n const { children, as: asProp, ...rest } = state[slotName]!;\n\n const slot = (state.components?.[slotName] === undefined || typeof state.components[slotName] === 'string'\n ? asProp || state.components?.[slotName] || 'div'\n : state.components[slotName]) as React.ElementType<R[K]>;\n\n if (typeof children === 'function') {\n const render = children as SlotRenderFunction<R[K]>;\n return [\n React.Fragment,\n ({\n children: render(slot, rest as Omit<R[K], 'children' | 'as'>),\n } as unknown) as R[K],\n ];\n }\n\n const shouldOmitAsProp = typeof slot === 'string' && state[slotName]?.as;\n const slotProps = (shouldOmitAsProp ? omit(state[slotName]!, ['as']) : state[slotName]) as R[K];\n\n return [slot, slotProps];\n}\n"],"sourceRoot":"../src/"}
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./getSlots"), exports);
10
10
 
11
- tslib_1.__exportStar(require("./nullRender"), exports);
12
-
13
11
  tslib_1.__exportStar(require("./resolveShorthand"), exports);
14
12
 
15
13
  tslib_1.__exportStar(require("./types"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/compose/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["compose/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './getSlots';\nexport * from './resolveShorthand';\nexport * from './types';\n"],"sourceRoot":"../src/"}
@@ -5,28 +5,26 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.resolveShorthand = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
9
-
10
- var react_1 = /*#__PURE__*/require("react");
8
+ const react_1 = /*#__PURE__*/require("react");
11
9
  /**
12
- * Resolves ShorthandProps into ObjectShorthandProps, to ensure normalization of the signature
10
+ * Resolves shorthands into slot props, to ensure normalization of the signature
13
11
  * being passed down to getSlots method
14
- * @param value - the base ShorthandProps
15
- * @param options - options to resolve ShorthandProps
12
+ * @param value - the base shorthand props
13
+ * @param options - options to resolve shorthand props
16
14
  */
17
15
 
18
16
 
19
- function resolveShorthand(value, options) {
20
- var _a = options || {},
21
- _b = _a.required,
22
- required = _b === void 0 ? false : _b,
23
- defaultProps = _a.defaultProps;
17
+ const resolveShorthand = (value, options) => {
18
+ const {
19
+ required = false,
20
+ defaultProps
21
+ } = options || {};
24
22
 
25
23
  if (value === null || value === undefined && !required) {
26
24
  return undefined;
27
25
  }
28
26
 
29
- var resolvedShorthand = {};
27
+ let resolvedShorthand = {};
30
28
 
31
29
  if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || react_1.isValidElement(value)) {
32
30
  resolvedShorthand.children = value;
@@ -34,8 +32,10 @@ function resolveShorthand(value, options) {
34
32
  resolvedShorthand = value;
35
33
  }
36
34
 
37
- return defaultProps ? tslib_1.__assign(tslib_1.__assign({}, defaultProps), resolvedShorthand) : resolvedShorthand;
38
- }
35
+ return defaultProps ? { ...defaultProps,
36
+ ...resolvedShorthand
37
+ } : resolvedShorthand;
38
+ };
39
39
 
40
40
  exports.resolveShorthand = resolveShorthand;
41
41
  //# sourceMappingURL=resolveShorthand.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/compose/resolveShorthand.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AASA;;;;;AAKG;;;AACH,SAAgB,gBAAhB,CACE,KADF,EAEE,OAFF,EAEoD;AAE5C,MAAA,EAAA,GAAqC,OAAO,IAAI,EAAhD;AAAA,MAAE,EAAA,GAAA,EAAA,CAAA,QAAF;AAAA,MAAE,QAAQ,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,IAA0D,KAAK,CAAC,OAAN,CAAc,KAAd,CAA1D,IAAkF,OAAA,CAAA,cAAA,CAAe,KAAf,CAAtF,EAA6G;AAC3G,IAAA,iBAAiB,CAAC,QAAlB,GAA6B,KAA7B;AACD,GAFD,MAEO,IAAI,OAAO,KAAP,KAAiB,QAArB,EAA+B;AACpC,IAAA,iBAAiB,GAAG,KAApB;AACD;;AAED,SAAO,YAAY,GAAG,EAAE,GAAG,YAAL;AAAmB,OAAG;AAAtB,GAAH,GAA+C,iBAAlE;AACD,CAfM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","sourcesContent":["import { isValidElement } from 'react';\nimport type { ReplaceNullWithUndefined, SlotShorthandValue, UnknownSlotProps } from './types';\n\nexport type ResolveShorthandOptions<Props, Required extends boolean = false> = {\n required?: Required;\n defaultProps?: Props;\n};\n\nexport type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {\n <P extends Props | null>(\n value: P | SlotShorthandValue | undefined,\n options?: ResolveShorthandOptions<P, true>,\n ): ReplaceNullWithUndefined<P>;\n <P extends Props | null>(value: P | SlotShorthandValue | undefined, options?: ResolveShorthandOptions<P, boolean>):\n | ReplaceNullWithUndefined<P>\n | undefined;\n};\n\n/**\n * Resolves shorthands into slot props, to ensure normalization of the signature\n * being passed down to getSlots method\n * @param value - the base shorthand props\n * @param options - options to resolve shorthand props\n */\nexport const resolveShorthand: ResolveShorthandFunction = (value, options) => {\n const { required = false, defaultProps } = options || {};\n if (value === null || (value === undefined && !required)) {\n return undefined;\n }\n\n let resolvedShorthand = {} as UnknownSlotProps;\n\n if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || isValidElement(value)) {\n resolvedShorthand.children = value;\n } else if (typeof value === 'object') {\n resolvedShorthand = value;\n }\n\n return defaultProps ? { ...defaultProps, ...resolvedShorthand } : resolvedShorthand;\n};\n"],"sourceRoot":"../src/"}
@@ -2,9 +2,5 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- }); // A definition like this would also work, but typescript is more likely to unnecessarily expand
6
- // the props type with this version (and it's likely much more expensive to evaluate)
7
- // export type ForwardRefComponent<Props> = Props extends React.DOMAttributes<infer Element>
8
- // ? React.ForwardRefExoticComponent<Props> & React.RefAttributes<Element>
9
- // : never;
5
+ });
10
6
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/compose/types.ts"],"names":[],"mappings":";;;;IA2IA;AACA;AACA;AACA;AACA","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}