@fluentui/react-utilities 0.0.0-nightly4e6470c86320220127.1 → 0.0.0-nightly50ae56ec3420220218.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 (134) hide show
  1. package/CHANGELOG.json +76 -19
  2. package/CHANGELOG.md +23 -7
  3. package/dist/react-utilities.d.ts +191 -110
  4. package/lib/compose/getSlots.d.ts +7 -7
  5. package/lib/compose/getSlots.js +1 -2
  6. package/lib/compose/getSlots.js.map +1 -1
  7. package/lib/compose/index.d.ts +0 -1
  8. package/lib/compose/index.js +0 -1
  9. package/lib/compose/index.js.map +1 -1
  10. package/lib/compose/resolveShorthand.d.ts +10 -6
  11. package/lib/compose/resolveShorthand.js +5 -5
  12. package/lib/compose/resolveShorthand.js.map +1 -1
  13. package/lib/compose/types.d.ts +82 -45
  14. package/lib/compose/types.js.map +1 -1
  15. package/lib/hooks/index.d.ts +1 -1
  16. package/lib/hooks/index.js +1 -1
  17. package/lib/hooks/index.js.map +1 -1
  18. package/lib/hooks/useBoolean.js.map +1 -1
  19. package/lib/hooks/useConst.js.map +1 -1
  20. package/lib/hooks/useControllableState.js.map +1 -1
  21. package/lib/hooks/useEventCallback.js.map +1 -1
  22. package/lib/hooks/useFirstMount.js.map +1 -1
  23. package/lib/hooks/useForceUpdate.js.map +1 -1
  24. package/lib/hooks/useId.js.map +1 -1
  25. package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  26. package/lib/hooks/useMergedEventCallbacks.d.ts +18 -0
  27. package/lib/hooks/useMergedEventCallbacks.js +26 -0
  28. package/lib/hooks/useMergedEventCallbacks.js.map +1 -0
  29. package/lib/hooks/useMergedRefs.js.map +1 -1
  30. package/lib/hooks/useMount.js.map +1 -1
  31. package/lib/hooks/useOnClickOutside.js.map +1 -1
  32. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  33. package/lib/hooks/usePrevious.js.map +1 -1
  34. package/lib/hooks/useTimeout.js.map +1 -1
  35. package/lib/hooks/useUnmount.js.map +1 -1
  36. package/lib/index.js.map +1 -1
  37. package/lib/ssr/SSRContext.js.map +1 -1
  38. package/lib/ssr/canUseDOM.js.map +1 -1
  39. package/lib/ssr/index.js.map +1 -1
  40. package/lib/utils/applyTriggerPropsToChildren.d.ts +1 -1
  41. package/lib/utils/applyTriggerPropsToChildren.js +23 -3
  42. package/lib/utils/applyTriggerPropsToChildren.js.map +1 -1
  43. package/lib/utils/clamp.js.map +1 -1
  44. package/lib/utils/getNativeElementProps.d.ts +4 -4
  45. package/lib/utils/getNativeElementProps.js.map +1 -1
  46. package/lib/utils/getRTLSafeKey.js.map +1 -1
  47. package/lib/utils/getReactCallbackName.js.map +1 -1
  48. package/lib/utils/getTriggerChild.d.ts +22 -0
  49. package/lib/utils/getTriggerChild.js +26 -0
  50. package/lib/utils/getTriggerChild.js.map +1 -0
  51. package/lib/utils/index.d.ts +2 -1
  52. package/lib/utils/index.js +2 -1
  53. package/lib/utils/index.js.map +1 -1
  54. package/lib/utils/isFluentTrigger.d.ts +22 -0
  55. package/lib/utils/isFluentTrigger.js +8 -0
  56. package/lib/utils/isFluentTrigger.js.map +1 -0
  57. package/lib/utils/omit.js.map +1 -1
  58. package/lib/utils/properties.js.map +1 -1
  59. package/lib/utils/shouldPreventDefaultOnKeyDown.js.map +1 -1
  60. package/lib-commonjs/compose/getSlots.d.ts +7 -7
  61. package/lib-commonjs/compose/getSlots.js +1 -3
  62. package/lib-commonjs/compose/getSlots.js.map +1 -1
  63. package/lib-commonjs/compose/index.d.ts +0 -1
  64. package/lib-commonjs/compose/index.js +0 -2
  65. package/lib-commonjs/compose/index.js.map +1 -1
  66. package/lib-commonjs/compose/resolveShorthand.d.ts +10 -6
  67. package/lib-commonjs/compose/resolveShorthand.js +5 -5
  68. package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
  69. package/lib-commonjs/compose/types.d.ts +82 -45
  70. package/lib-commonjs/compose/types.js.map +1 -1
  71. package/lib-commonjs/hooks/index.d.ts +1 -1
  72. package/lib-commonjs/hooks/index.js +2 -2
  73. package/lib-commonjs/hooks/index.js.map +1 -1
  74. package/lib-commonjs/hooks/useBoolean.js.map +1 -1
  75. package/lib-commonjs/hooks/useConst.js.map +1 -1
  76. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  77. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  78. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  79. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  80. package/lib-commonjs/hooks/useId.js.map +1 -1
  81. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  82. package/lib-commonjs/hooks/useMergedEventCallbacks.d.ts +18 -0
  83. package/lib-commonjs/hooks/useMergedEventCallbacks.js +36 -0
  84. package/lib-commonjs/hooks/useMergedEventCallbacks.js.map +1 -0
  85. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  86. package/lib-commonjs/hooks/useMount.js.map +1 -1
  87. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  88. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  89. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  90. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  91. package/lib-commonjs/hooks/useUnmount.js.map +1 -1
  92. package/lib-commonjs/index.js.map +1 -1
  93. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  94. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  95. package/lib-commonjs/ssr/index.js.map +1 -1
  96. package/lib-commonjs/utils/applyTriggerPropsToChildren.d.ts +1 -1
  97. package/lib-commonjs/utils/applyTriggerPropsToChildren.js +24 -4
  98. package/lib-commonjs/utils/applyTriggerPropsToChildren.js.map +1 -1
  99. package/lib-commonjs/utils/clamp.js.map +1 -1
  100. package/lib-commonjs/utils/getNativeElementProps.d.ts +4 -4
  101. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  102. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  103. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
  104. package/lib-commonjs/utils/getTriggerChild.d.ts +22 -0
  105. package/lib-commonjs/utils/getTriggerChild.js +37 -0
  106. package/lib-commonjs/utils/getTriggerChild.js.map +1 -0
  107. package/lib-commonjs/utils/index.d.ts +2 -1
  108. package/lib-commonjs/utils/index.js +4 -2
  109. package/lib-commonjs/utils/index.js.map +1 -1
  110. package/lib-commonjs/utils/isFluentTrigger.d.ts +22 -0
  111. package/lib-commonjs/utils/isFluentTrigger.js +17 -0
  112. package/lib-commonjs/utils/isFluentTrigger.js.map +1 -0
  113. package/lib-commonjs/utils/omit.js.map +1 -1
  114. package/lib-commonjs/utils/properties.js.map +1 -1
  115. package/lib-commonjs/utils/shouldPreventDefaultOnKeyDown.js.map +1 -1
  116. package/package.json +2 -2
  117. package/lib/compose/nullRender.d.ts +0 -4
  118. package/lib/compose/nullRender.js +0 -5
  119. package/lib/compose/nullRender.js.map +0 -1
  120. package/lib/hooks/useTriggerElement.d.ts +0 -18
  121. package/lib/hooks/useTriggerElement.js +0 -90
  122. package/lib/hooks/useTriggerElement.js.map +0 -1
  123. package/lib/utils/onlyChild.d.ts +0 -5
  124. package/lib/utils/onlyChild.js +0 -13
  125. package/lib/utils/onlyChild.js.map +0 -1
  126. package/lib-commonjs/compose/nullRender.d.ts +0 -4
  127. package/lib-commonjs/compose/nullRender.js +0 -14
  128. package/lib-commonjs/compose/nullRender.js.map +0 -1
  129. package/lib-commonjs/hooks/useTriggerElement.d.ts +0 -18
  130. package/lib-commonjs/hooks/useTriggerElement.js +0 -105
  131. package/lib-commonjs/hooks/useTriggerElement.js.map +0 -1
  132. package/lib-commonjs/utils/onlyChild.d.ts +0 -5
  133. package/lib-commonjs/utils/onlyChild.js +0 -23
  134. package/lib-commonjs/utils/onlyChild.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,23 +2,38 @@
2
2
  "name": "@fluentui/react-utilities",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 27 Jan 2022 04:17:45 GMT",
6
- "tag": "@fluentui/react-utilities_v0.0.0-nightly4e6470c86320220127.1",
7
- "version": "0.0.0-nightly4e6470c86320220127.1",
5
+ "date": "Fri, 18 Feb 2022 04:14:57 GMT",
6
+ "tag": "@fluentui/react-utilities_v0.0.0-nightly50ae56ec3420220218.1",
7
+ "version": "0.0.0-nightly50ae56ec3420220218.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
11
11
  "author": "email not defined",
12
12
  "package": "@fluentui/react-utilities",
13
- "commit": "4288e9baaf65cf1338bb7b5682aca694d6e32e0d",
13
+ "commit": "0459873d472d7ad2a20c9bbb2facf6af8ef20995",
14
14
  "comment": "Release nightly v9"
15
15
  },
16
16
  {
17
- "author": "elcraig@microsoft.com",
17
+ "author": "lingfangao@hotmail.com",
18
18
  "package": "@fluentui/react-utilities",
19
- "commit": "39ce3cbcf15ce2619649e1eddccf932736ceac07",
20
- "comment": "[breaking] Remove useControllableValue hook (use useControllableState instead)"
19
+ "commit": "1aa9e691fcccd9a64168cea7941c0f1e71fa1d14",
20
+ "comment": "fix: Source maps contain original source code"
21
21
  },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-utilities",
25
+ "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly50ae56ec3420220218.1",
26
+ "commit": "0459873d472d7ad2a20c9bbb2facf6af8ef20995"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "date": "Thu, 10 Feb 2022 08:50:32 GMT",
33
+ "tag": "@fluentui/react-utilities_v9.0.0-rc.1",
34
+ "version": "9.0.0-rc.1",
35
+ "comments": {
36
+ "prerelease": [
22
37
  {
23
38
  "author": "behowell@microsoft.com",
24
39
  "package": "@fluentui/react-utilities",
@@ -37,6 +52,24 @@
37
52
  "commit": "d2eb57808a403b70845a732a62b55aa64d66b2a0",
38
53
  "comment": "add useTriggerElement() hook"
39
54
  },
55
+ {
56
+ "author": "bsunderhus@microsoft.com",
57
+ "package": "@fluentui/react-utilities",
58
+ "commit": "c0d4e63ee58e60e2c6674efbacc0783cd520984e",
59
+ "comment": "Removes nullRender from react-utilities"
60
+ },
61
+ {
62
+ "author": "olfedias@microsoft.com",
63
+ "package": "@fluentui/react-utilities",
64
+ "commit": "aa6cfd8ac825b5a280206808101de549a91094fc",
65
+ "comment": "update applyTriggerPropsToChildren() to return React.ReactElement or null"
66
+ },
67
+ {
68
+ "author": "behowell@microsoft.com",
69
+ "package": "@fluentui/react-utilities",
70
+ "commit": "53b01d71e335715fda91b33e3d7bbd9d471d5ed3",
71
+ "comment": "Refactor component Slot typings"
72
+ },
40
73
  {
41
74
  "author": "Humberto.Morimoto@microsoft.com",
42
75
  "package": "@fluentui/react-utilities",
@@ -44,25 +77,37 @@
44
77
  "comment": "Adding ComponentSlotProps to allow ref to be passed in composite components."
45
78
  },
46
79
  {
47
- "author": "beachball",
80
+ "author": "Humberto.Morimoto@microsoft.com",
48
81
  "package": "@fluentui/react-utilities",
49
- "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly4e6470c86320220127.1",
50
- "commit": "4288e9baaf65cf1338bb7b5682aca694d6e32e0d"
51
- }
52
- ],
53
- "none": [
82
+ "commit": "e0b8e1fa6980077e7b311fd1c72c28d3e4305db0",
83
+ "comment": "Renaming most *Shorthand* composition types to *SlotProps* so they better reflect what the types do."
84
+ },
54
85
  {
55
- "author": "seanmonahan@microsoft.com",
86
+ "author": "lingfangao@hotmail.com",
56
87
  "package": "@fluentui/react-utilities",
57
- "commit": "6404bef16cebf1f67b9b80a9f6d5f605f9873df1",
58
- "comment": "Update getSlots() docs."
88
+ "commit": "c00913d50e2dd15bbfbb0757cefe43b192ff1d7f",
89
+ "comment": "Bump Fluent UI packages to 9.0.0-rc"
59
90
  },
60
91
  {
61
- "author": "lingfangao@hotmail.com",
92
+ "author": "behowell@microsoft.com",
62
93
  "package": "@fluentui/react-utilities",
63
- "commit": "a4e048a0e03ddd676670da516e3a6612b26ea500",
64
- "comment": "chore: Remove enzyme from react-utilities tests"
94
+ "commit": "f30e7585a8d2abd9db06c4076f39a779008b0eca",
95
+ "comment": "Update trigger utilities to handle nested triggers"
65
96
  },
97
+ {
98
+ "author": "elcraig@microsoft.com",
99
+ "package": "@fluentui/react-utilities",
100
+ "commit": "39ce3cbcf15ce2619649e1eddccf932736ceac07",
101
+ "comment": "[breaking] Remove useControllableValue hook (use useControllableState instead)"
102
+ },
103
+ {
104
+ "author": "beachball",
105
+ "package": "@fluentui/react-utilities",
106
+ "comment": "Bump @fluentui/keyboard-keys to v9.0.0-rc.1",
107
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
108
+ }
109
+ ],
110
+ "none": [
66
111
  {
67
112
  "author": "elcraig@microsoft.com",
68
113
  "package": "@fluentui/react-utilities",
@@ -80,6 +125,18 @@
80
125
  "package": "@fluentui/react-utilities",
81
126
  "commit": "8dfa712156b70414205b87b5b6d099367b0c297d",
82
127
  "comment": "chore: use storybook runner for all vNext packages"
128
+ },
129
+ {
130
+ "author": "seanmonahan@microsoft.com",
131
+ "package": "@fluentui/react-utilities",
132
+ "commit": "6404bef16cebf1f67b9b80a9f6d5f605f9873df1",
133
+ "comment": "Update getSlots() docs."
134
+ },
135
+ {
136
+ "author": "lingfangao@hotmail.com",
137
+ "package": "@fluentui/react-utilities",
138
+ "commit": "a4e048a0e03ddd676670da516e3a6612b26ea500",
139
+ "comment": "chore: Remove enzyme from react-utilities tests"
83
140
  }
84
141
  ]
85
142
  }
package/CHANGELOG.md CHANGED
@@ -1,23 +1,39 @@
1
1
  # Change Log - @fluentui/react-utilities
2
2
 
3
- This log was last generated on Thu, 27 Jan 2022 04:17:45 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 18 Feb 2022 04:14:57 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly4e6470c86320220127.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v0.0.0-nightly4e6470c86320220127.1)
7
+ ## [0.0.0-nightly50ae56ec3420220218.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v0.0.0-nightly50ae56ec3420220218.1)
8
8
 
9
- Thu, 27 Jan 2022 04:17:45 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-beta.4..@fluentui/react-utilities_v0.0.0-nightly4e6470c86320220127.1)
9
+ Fri, 18 Feb 2022 04:14:57 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-rc.1..@fluentui/react-utilities_v0.0.0-nightly50ae56ec3420220218.1)
11
+
12
+ ### Changes
13
+
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/0459873d472d7ad2a20c9bbb2facf6af8ef20995) by email not defined)
15
+ - fix: Source maps contain original source code ([PR #21690](https://github.com/microsoft/fluentui/pull/21690) by lingfangao@hotmail.com)
16
+ - Bump @fluentui/keyboard-keys to v0.0.0-nightly50ae56ec3420220218.1 ([commit](https://github.com/microsoft/fluentui/commit/0459873d472d7ad2a20c9bbb2facf6af8ef20995) by beachball)
17
+
18
+ ## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-rc.1)
19
+
20
+ Thu, 10 Feb 2022 08:50:32 GMT
21
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-beta.4..@fluentui/react-utilities_v9.0.0-rc.1)
11
22
 
12
23
  ### Changes
13
24
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/4288e9baaf65cf1338bb7b5682aca694d6e32e0d) by email not defined)
15
- - [breaking] Remove useControllableValue hook (use useControllableState instead) ([PR #20865](https://github.com/microsoft/fluentui/pull/20865) by elcraig@microsoft.com)
16
25
  - Rename component hooks add the suffix _unstable, as their API has not been finalized yet ([PR #21365](https://github.com/microsoft/fluentui/pull/21365) by behowell@microsoft.com)
17
26
  - getSlots: remove slotNames param, and infer from state.components instead ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com)
18
27
  - add useTriggerElement() hook ([PR #21225](https://github.com/microsoft/fluentui/pull/21225) by olfedias@microsoft.com)
28
+ - Removes nullRender from react-utilities ([PR #21576](https://github.com/microsoft/fluentui/pull/21576) by bsunderhus@microsoft.com)
29
+ - update applyTriggerPropsToChildren() to return React.ReactElement or null ([PR #21609](https://github.com/microsoft/fluentui/pull/21609) by olfedias@microsoft.com)
30
+ - Refactor component Slot typings ([PR #21518](https://github.com/microsoft/fluentui/pull/21518) by behowell@microsoft.com)
19
31
  - Adding ComponentSlotProps to allow ref to be passed in composite components. ([PR #20890](https://github.com/microsoft/fluentui/pull/20890) by Humberto.Morimoto@microsoft.com)
20
- - Bump @fluentui/keyboard-keys to v0.0.0-nightly4e6470c86320220127.1 ([commit](https://github.com/microsoft/fluentui/commit/4288e9baaf65cf1338bb7b5682aca694d6e32e0d) by beachball)
32
+ - Renaming most *Shorthand* composition types to *SlotProps* so they better reflect what the types do. ([PR #20891](https://github.com/microsoft/fluentui/pull/20891) by Humberto.Morimoto@microsoft.com)
33
+ - Bump Fluent UI packages to 9.0.0-rc ([PR #21623](https://github.com/microsoft/fluentui/pull/21623) by lingfangao@hotmail.com)
34
+ - Update trigger utilities to handle nested triggers ([PR #21495](https://github.com/microsoft/fluentui/pull/21495) by behowell@microsoft.com)
35
+ - [breaking] Remove useControllableValue hook (use useControllableState instead) ([PR #20865](https://github.com/microsoft/fluentui/pull/20865) by elcraig@microsoft.com)
36
+ - Bump @fluentui/keyboard-keys to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
21
37
 
22
38
  ## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-beta.4)
23
39
 
@@ -11,7 +11,7 @@ export declare const anchorProperties: Record<string, number>;
11
11
  /**
12
12
  * Apply the trigger props to the children, either by calling the render function, or cloning with the new props.
13
13
  */
14
- export declare const applyTriggerPropsToChildren: <TTriggerProps>(children: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | ((props: TTriggerProps) => React_2.ReactNode) | null | undefined, triggerProps: TTriggerProps) => React_2.ReactNode;
14
+ export declare const applyTriggerPropsToChildren: <TTriggerProps>(children: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | ((props: TTriggerProps) => React_2.ReactElement | null) | null | undefined, triggerProps: TTriggerProps) => React_2.ReactElement | null;
15
15
 
16
16
  /**
17
17
  * Helper type for inferring the type of the as prop from a Props type.
@@ -71,42 +71,22 @@ export declare const colGroupProperties: Record<string, number>;
71
71
 
72
72
  export declare const colProperties: Record<string, number>;
73
73
 
74
- export declare type ComponentProps<Shorthands extends ObjectShorthandPropsRecord, Primary extends keyof Shorthands = 'root'> = Omit<{
75
- [Key in keyof Shorthands]?: ShorthandProps<NonNullable<Shorthands[Key]>>;
76
- }, Primary & 'root'> & PropsWithoutRef<Shorthands[Primary]>;
77
-
78
74
  /**
79
- * Defines the slot props for a slot that supports a Component type.
80
- *
81
- * For intrinsic/native elements like 'div', use {@link IntrinsicShorthandProps} instead.
82
- *
83
- * The generic param is the type of a control, i.e. a React component. For example:
84
- *
85
- * @example
86
- * ```
87
- * type Props = {...}
88
- * const Button: React.FC<Props> = () => {...}
89
- * // $ExpectType ...
90
- * type SlotProps = ComponentSlotProps<typeof Button>
91
- * ```
75
+ * Defines the Props type for a component given its slots and the definition of which one is the primary slot,
76
+ * defaulting to root if one is not provided.
92
77
  */
93
- export declare type ComponentSlotProps<Component extends React_2.ComponentType> = Component extends React_2.ComponentType<infer Props> ? ObjectShorthandProps<Props> : never;
94
-
95
- export declare type ComponentState<Shorthands extends ObjectShorthandPropsRecord> = {
96
- components: {
97
- [Key in keyof Shorthands]-?: React_2.ComponentType<NonNullable<Shorthands[Key]> extends ObjectShorthandProps<infer P> ? P : NonNullable<Shorthands[Key]>> | (NonNullable<Shorthands[Key]> extends AsIntrinsicElement<infer As> ? As : keyof JSX.IntrinsicElements);
98
- };
99
- } & Shorthands;
78
+ export declare type ComponentProps<Slots extends SlotPropsRecord, Primary extends keyof Slots = 'root'> = Omit<Slots, Primary & 'root'> & PropsWithoutRef<ExtractSlotProps<Slots[Primary]>>;
100
79
 
101
80
  /**
102
- * Matches any shorthand props type.
103
- *
104
- * This should ONLY be used in type templates as in `extends DefaultObjectShorthandProps`;
105
- * it shouldn't be used as the type of a slot.
81
+ * Defines the State object of a component given its slots.
106
82
  */
107
- export declare type DefaultObjectShorthandProps = ObjectShorthandProps<Pick<React_2.HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'> & {
108
- as?: keyof JSX.IntrinsicElements;
109
- }>;
83
+ export declare type ComponentState<Slots extends SlotPropsRecord> = {
84
+ components: {
85
+ [Key in keyof Slots]-?: React_2.ComponentType<ExtractSlotProps<Slots[Key]>> | (ExtractSlotProps<Slots[Key]> extends AsIntrinsicElement<infer As> ? As : keyof JSX.IntrinsicElements);
86
+ };
87
+ } & {
88
+ [Key in keyof Slots]: ReplaceNullWithUndefined<Exclude<Slots[Key], SlotShorthandValue | (Key extends 'root' ? null : never)>>;
89
+ };
110
90
 
111
91
  /**
112
92
  * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.
@@ -122,6 +102,35 @@ export declare const defaultSSRContextValue: SSRContextValue;
122
102
  */
123
103
  export declare const divProperties: Record<string, number>;
124
104
 
105
+ /**
106
+ * HTML element types that are not allowed to have children.
107
+ *
108
+ * Reference: https://developer.mozilla.org/en-US/docs/Glossary/Empty_element
109
+ */
110
+ declare type EmptyIntrisicElements = 'area' | 'base' | 'br' | 'col' | 'embed' | 'hr' | 'img' | 'input' | 'link' | 'meta' | 'param' | 'source' | 'track' | 'wbr';
111
+
112
+ /**
113
+ * Removes SlotShorthandValue and null from the slot type, extracting just the slot's Props object.
114
+ */
115
+ export declare type ExtractSlotProps<S> = Exclude<S, SlotShorthandValue | null | undefined>;
116
+
117
+ /**
118
+ * Allows a component to be tagged as a FluentUI trigger component.
119
+ *
120
+ * Triggers are special-case components: they attach event listeners and other props on their child,
121
+ * and use them to trigger another component to show. Examples include `MenuTrigger` and `Tooltip`.
122
+ *
123
+ * A component can be tagged as a trigger as follows:
124
+ * ```ts
125
+ * const MyComponent: React.FC<MyComponentProps> & FluentTriggerComponent = ...;
126
+ *
127
+ * MyComponent.isFluentTriggerComponent = true; // MUST also set this to true
128
+ * ```
129
+ */
130
+ export declare type FluentTriggerComponent = {
131
+ isFluentTriggerComponent?: boolean;
132
+ };
133
+
125
134
  /**
126
135
  * An array of FORM tag properties and events.
127
136
  *
@@ -167,19 +176,19 @@ export declare function getNativeProps<T extends Record<string, any>>(props: Rec
167
176
  *
168
177
  * @returns An object containing the native props for the `root` and primary slots.
169
178
  */
170
- export declare const getPartitionedNativeProps: ({ primarySlotTagName, props, excludedPropNames, }: {
179
+ export declare const getPartitionedNativeProps: <Props extends Pick<React_2.HTMLAttributes<HTMLElement>, "style" | "className">, ExcludedPropKeys extends Extract<keyof Props, string> = never>({ primarySlotTagName, props, excludedPropNames, }: {
171
180
  /** The primary slot's element type (e.g. 'div') */
172
181
  primarySlotTagName: keyof JSX.IntrinsicElements;
173
182
  /** The component's props object */
174
- props: Pick<React_2.HTMLAttributes<HTMLElement>, 'style' | 'className'>;
183
+ props: Props;
175
184
  /** List of native props to exclude from the returned value */
176
- excludedPropNames?: string[] | undefined;
185
+ excludedPropNames?: ExcludedPropKeys[] | undefined;
177
186
  }) => {
178
187
  root: {
179
188
  style: React_2.CSSProperties | undefined;
180
189
  className: string | undefined;
181
190
  };
182
- primary: React_2.HTMLAttributes<any>;
191
+ primary: Omit<Props, ExcludedPropKeys>;
183
192
  };
184
193
 
185
194
  /**
@@ -204,9 +213,31 @@ export declare const getRTLSafeKey: (key: string, dir: 'ltr' | 'rtl') => string;
204
213
  * @param state - State including slot definitions
205
214
  * @returns An object containing the `slots` map and `slotProps` map.
206
215
  */
207
- export declare function getSlots<R extends ObjectShorthandPropsRecord>(state: ComponentState<R>): {
216
+ export declare function getSlots<R extends SlotPropsRecord>(state: ComponentState<R>): {
208
217
  slots: Slots<R>;
209
- slotProps: SlotProps<R>;
218
+ slotProps: ObjectSlotProps<R>;
219
+ };
220
+
221
+ /**
222
+ * Gets the trigger element of a FluentTriggerComponent (such as Tooltip or MenuTrigger).
223
+ *
224
+ * In the case where the immediate child is itself a FluentTriggerComponent and/or React Fragment,
225
+ * it returns the first descendant that is _not_ a FluentTriggerComponent or Fragment.
226
+ * This allows multiple triggers to be stacked, and still apply their props to the actual trigger element.
227
+ *
228
+ * For example, the following returns `<div id="child" />`:
229
+ * ```jsx
230
+ * getTriggerChild(
231
+ * <Tooltip>
232
+ * <MenuTrigger>
233
+ * <div id="child" />
234
+ * </MenuTrigger>
235
+ * </Tooltip>
236
+ * );
237
+ * ```
238
+ */
239
+ export declare const getTriggerChild: (children: React_2.ReactNode) => React_2.ReactElement & {
240
+ ref?: React_2.Ref<unknown>;
210
241
  };
211
242
 
212
243
  /**
@@ -243,25 +274,19 @@ export declare const imgProperties: Record<string, number>;
243
274
  export declare const inputProperties: Record<string, number>;
244
275
 
245
276
  /**
246
- * Define the slot arguments for a slot that supports one or more intrinsic element types, such as 'div'.
247
- * For slots that support custom components, use {@link ComponentSlotProps} instead.
248
- *
249
- * The first param is the slot's default type if no `as` prop is specified.
250
- * The second param is an optional union of alternative types that can be specified for the `as` prop.
251
- *
252
- * ```
253
- * IntrinsicShorthandProps<'div'> // Slot is always div
254
- * IntrinsicShorthandProps<'button', 'a'> // Defaults to button, but allows as="a" with anchor-specific props
255
- * IntrinsicShorthandProps<'label', 'span' | 'div'>; // Defaults to label, but allows as="span" or as="div"
256
- * ```
277
+ * Helper type for {@link Slot}. Modifies `JSX.IntrinsicElements[Type]`:
278
+ * * Removes legacy string ref.
279
+ * * Disallows children for empty tags like 'img'.
257
280
  */
258
- export declare type IntrinsicShorthandProps<DefaultAs extends keyof JSX.IntrinsicElements, AlternateAs extends keyof JSX.IntrinsicElements = never> = IsSingleton<DefaultAs> extends false ? 'Error: first parameter to IntrinsicShorthandProps must be a single element type, not a union of types' : ({
259
- as?: DefaultAs;
260
- } & ObjectShorthandProps<React_2.PropsWithRef<JSX.IntrinsicElements[DefaultAs]>>) | {
261
- [As in AlternateAs]: {
262
- as: As;
263
- } & ObjectShorthandProps<React_2.PropsWithRef<JSX.IntrinsicElements[As]>>;
264
- }[AlternateAs];
281
+ declare type IntrisicElementProps<Type extends keyof JSX.IntrinsicElements> = React_2.PropsWithRef<JSX.IntrinsicElements[Type]> & (Type extends EmptyIntrisicElements ? {
282
+ children?: never;
283
+ } : {});
284
+
285
+ /**
286
+ * Checks if a given element is a FluentUI trigger (e.g. `MenuTrigger` or `Tooltip`).
287
+ * See the {@link FluentTriggerComponent} type for more info.
288
+ */
289
+ export declare const isFluentTrigger: (element: React_2.ReactElement) => boolean | undefined;
265
290
 
266
291
  /**
267
292
  * Evaluates to true if the given type contains exactly one string, or false if it is a union of strings.
@@ -289,23 +314,10 @@ export declare const labelProperties: Record<string, number>;
289
314
  */
290
315
  export declare const liProperties: Record<string, number>;
291
316
 
292
- /**
293
- * Simple constant function for returning null, used to render empty templates in JSX.
294
- */
295
- export declare const nullRender: () => null;
296
-
297
- /**
298
- * Takes the props we want to support for a slot and adds the ability for `children` to be a render function that takes
299
- * those props.
300
- */
301
- export declare type ObjectShorthandProps<Props extends {
302
- children?: React_2.ReactNode;
303
- } = {}> = Props & {
304
- children?: Props['children'] | ShorthandRenderFunction<Props>;
317
+ declare type ObjectSlotProps<S extends SlotPropsRecord> = {
318
+ [K in keyof S]-?: ExtractSlotProps<S[K]> extends AsIntrinsicElement<infer As> ? UnionToIntersection<JSX.IntrinsicElements[As]> : ExtractSlotProps<S[K]> extends React_2.ComponentType<infer P> ? P : never;
305
319
  };
306
320
 
307
- export declare type ObjectShorthandPropsRecord = Record<string, DefaultObjectShorthandProps | undefined>;
308
-
309
321
  /**
310
322
  * This is part of a hack to infer the element type from a native element *props* type.
311
323
  * The only place the original element is found in a native props type (at least that's workable
@@ -342,16 +354,11 @@ export declare const olProperties: Record<string, number>;
342
354
  */
343
355
  export declare function omit<TObj extends Record<string, any>, Exclusions extends (keyof TObj)[]>(obj: TObj, exclusions: Exclusions): Omit<TObj, Exclusions[number]>;
344
356
 
345
- /**
346
- * Similar to React.Children.only, but drills into fragments rather than treating them as a single child
347
- */
348
- export declare const onlyChild: <P>(child: boolean | React_2.ReactText | React_2.ReactFragment | React_2.ReactPortal | React_2.ReactElement<P, string | React_2.JSXElementConstructor<any>> | null | undefined) => React_2.ReactElement<P, string | React_2.JSXElementConstructor<any>>;
349
-
350
357
  export declare const optionProperties: Record<string, number>;
351
358
 
352
359
  /**
353
360
  * Removes the 'ref' prop from the given Props type, leaving unions intact (such as the discriminated union created by
354
- * IntrinsicShorthandProps). This allows IntrinsicShorthandProps to be used with React.forwardRef.
361
+ * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.
355
362
  *
356
363
  * The conditional "extends unknown" (always true) exploits a quirk in the way TypeScript handles conditional
357
364
  * types, to prevent unions from being expanded.
@@ -364,6 +371,11 @@ export declare type PropsWithoutRef<P> = 'ref' extends keyof P ? (P extends unkn
364
371
  */
365
372
  export declare type RefObjectFunction<T> = React_2.RefObject<T> & ((value: T) => void);
366
373
 
374
+ /**
375
+ * If type T includes `null`, remove it and add `undefined` instead.
376
+ */
377
+ export declare type ReplaceNullWithUndefined<T> = T extends null ? Exclude<T, null> | undefined : T;
378
+
367
379
  /**
368
380
  * Resets generated IDs, should be used only in tests.
369
381
  *
@@ -372,14 +384,19 @@ export declare type RefObjectFunction<T> = React_2.RefObject<T> & ((value: T) =>
372
384
  export declare function resetIdsForTests(): void;
373
385
 
374
386
  /**
375
- * Resolves ShorthandProps into ObjectShorthandProps, to ensure normalization of the signature
387
+ * Resolves shorthands into slot props, to ensure normalization of the signature
376
388
  * being passed down to getSlots method
377
- * @param value - the base ShorthandProps
378
- * @param options - options to resolve ShorthandProps
389
+ * @param value - the base shorthand props
390
+ * @param options - options to resolve shorthand props
379
391
  */
380
- export declare function resolveShorthand<Props extends DefaultObjectShorthandProps, Required extends boolean = false>(value: ShorthandProps<Props>, options?: ResolveShorthandOptions<Props, Required>): Required extends false ? Props | undefined : Props;
392
+ export declare const resolveShorthand: ResolveShorthandFunction;
381
393
 
382
- export declare type ResolveShorthandOptions<Props extends Record<string, any>, Required extends boolean = false> = {
394
+ export declare type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {
395
+ <P extends Props | null>(value: P | SlotShorthandValue | undefined, options?: ResolveShorthandOptions<P, true>): ReplaceNullWithUndefined<P>;
396
+ <P extends Props | null>(value: P | SlotShorthandValue | undefined, options?: ResolveShorthandOptions<P, boolean>): ReplaceNullWithUndefined<P> | undefined;
397
+ };
398
+
399
+ export declare type ResolveShorthandOptions<Props, Required extends boolean = false> = {
383
400
  required?: Required;
384
401
  defaultProps?: Props;
385
402
  };
@@ -391,10 +408,6 @@ export declare type ResolveShorthandOptions<Props extends Record<string, any>, R
391
408
  */
392
409
  export declare const selectProperties: Record<string, number>;
393
410
 
394
- export declare type ShorthandProps<Props extends DefaultObjectShorthandProps> = React_2.ReactChild | React_2.ReactNodeArray | React_2.ReactPortal | number | null | undefined | Props;
395
-
396
- export declare type ShorthandRenderFunction<Props> = (Component: React_2.ElementType<Props>, props: Omit<Props, 'children' | 'as'>) => React_2.ReactNode;
397
-
398
411
  /**
399
412
  * Checks if the keyboard event should preventDefault() for Enter and Spacebar keys
400
413
  *
@@ -402,14 +415,55 @@ export declare type ShorthandRenderFunction<Props> = (Component: React_2.Element
402
415
  */
403
416
  export declare function shouldPreventDefaultOnKeyDown(e: KeyboardEvent | React_2.KeyboardEvent): boolean;
404
417
 
405
- declare type SlotProps<S extends ObjectShorthandPropsRecord> = {
406
- [K in keyof S]-?: NonNullable<S[K]> extends AsIntrinsicElement<infer As> ? UnionToIntersection<JSX.IntrinsicElements[As]> : NonNullable<S[K]> extends ObjectShorthandProps<infer P> ? P : never;
407
- };
418
+ /**
419
+ * The props type and shorthand value for a slot. Type is either a single intrinsic element like `'div'`,
420
+ * or a component like `typeof Button`.
421
+ *
422
+ * If a slot needs to support multiple intrinsic element types, use the `AlternateAs` param (see examples below).
423
+ *
424
+ * By default, slots can be set to `null` to prevent them from being rendered. If a slot must always be rendered,
425
+ * wrap with `NonNullable` (see examples below).
426
+ *
427
+ * @example
428
+ * ```
429
+ * // Intrinsic element examples:
430
+ * Slot<'div'> // Slot is always div
431
+ * Slot<'button', 'a'> // Defaults to button, but allows as="a" with anchor-specific props
432
+ * Slot<'span', 'div' | 'pre'> // Defaults to span, but allows as="div" or as="pre"
433
+ * NonNullable<Slot<'div'>> // Slot that will always be rendered (can't be set to null by the user)
434
+ *
435
+ * // Component examples:
436
+ * Slot<typeof Button> // Slot is always a Button, and accepts all of Button's Props
437
+ * NonNullable<Slot<typeof Label>> // Slot is a Label and will always be rendered (can't be set to null by the user)
438
+ * ```
439
+ */
440
+ export declare type Slot<Type extends keyof JSX.IntrinsicElements | React_2.ComponentType | UnknownSlotProps, AlternateAs extends keyof JSX.IntrinsicElements = never> = IsSingleton<Extract<Type, string>> extends true ? WithSlotShorthandValue<Type extends keyof JSX.IntrinsicElements ? {
441
+ as?: Type;
442
+ } & WithSlotRenderFunction<IntrisicElementProps<Type>> : Type extends React_2.ComponentType<infer Props> ? WithSlotRenderFunction<Props> : Type> | {
443
+ [As in AlternateAs]: {
444
+ as: As;
445
+ } & WithSlotRenderFunction<IntrisicElementProps<As>>;
446
+ }[AlternateAs] | null : 'Error: First parameter to Slot must not be not a union of types. See documentation of Slot type.';
447
+
448
+ /**
449
+ * Matches any component's Slots type (such as ButtonSlots).
450
+ *
451
+ * This should ONLY be used in type templates as in `extends SlotPropsRecord`;
452
+ * it shouldn't be used as a component's Slots type.
453
+ */
454
+ export declare type SlotPropsRecord = Record<string, UnknownSlotProps | SlotShorthandValue | null | undefined>;
455
+
456
+ export declare type SlotRenderFunction<Props> = (Component: React_2.ElementType<Props>, props: Omit<Props, 'children' | 'as'>) => React_2.ReactNode;
408
457
 
409
- export declare type Slots<S extends ObjectShorthandPropsRecord> = {
410
- [K in keyof S]-?: NonNullable<S[K]> extends AsIntrinsicElement<infer As> ? As : S[K] extends ObjectShorthandProps<infer P> ? React_2.ElementType<NonNullable<P>> : React_2.ElementType<NonNullable<S[K]>>;
458
+ export declare type Slots<S extends SlotPropsRecord> = {
459
+ [K in keyof S]: ExtractSlotProps<S[K]> extends AsIntrinsicElement<infer As> ? As : ExtractSlotProps<S[K]> extends React_2.ComponentType<infer P> ? React_2.ElementType<NonNullable<P>> : React_2.ElementType<ExtractSlotProps<S[K]>>;
411
460
  };
412
461
 
462
+ /**
463
+ * The shorthand value of a slot allows specifying its child
464
+ */
465
+ export declare type SlotShorthandValue = React_2.ReactChild | React_2.ReactNodeArray | React_2.ReactPortal;
466
+
413
467
  export declare const SSRContext: React_2.Context<SSRContextValue>;
414
468
 
415
469
  /**
@@ -470,6 +524,16 @@ export declare const trProperties: Record<string, number>;
470
524
  */
471
525
  export declare type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends (x: infer I) => U ? I : never;
472
526
 
527
+ /**
528
+ * Matches any slot props type.
529
+ *
530
+ * This should ONLY be used in type templates as in `extends UnknownSlotProps`;
531
+ * it shouldn't be used as the type of a slot.
532
+ */
533
+ export declare type UnknownSlotProps = Pick<React_2.HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'> & {
534
+ as?: keyof JSX.IntrinsicElements;
535
+ };
536
+
473
537
  /**
474
538
  * Hook to store a value and generate callbacks for setting the value to true or false.
475
539
  * The identity of the callbacks will always stay the same.
@@ -592,6 +656,25 @@ export declare const useIsomorphicLayoutEffect: typeof React_2.useEffect;
592
656
  */
593
657
  export declare function useIsSSR(): boolean;
594
658
 
659
+ /**
660
+ * Combine two event callbacks into a single callback function that calls each one in order.
661
+ *
662
+ * This is useful to add an event listener to an existing element without overwriting the current listener, if any.
663
+ *
664
+ * For example:
665
+ * ```ts
666
+ * state.slot.onChange = useMergedCallbacks(state.slot.onChange, ev => {
667
+ * // Handle onChange
668
+ * });
669
+ * ```
670
+ *
671
+ * @param callback1 - The first callback to be called
672
+ * @param callback2 - The second callback to be called
673
+ *
674
+ * @returns An event callback that calls the callbacks in order, and is stable between renders
675
+ */
676
+ export declare function useMergedEventCallbacks<Args extends unknown[]>(callback1: ((...args: Args) => void) | undefined, callback2: ((...args: Args) => void) | undefined): (...args: Args) => void;
677
+
595
678
  /**
596
679
  * React hook to merge multiple React refs (either MutableRefObjects or ref callbacks) into a single ref callback that
597
680
  * updates all provided refs
@@ -658,25 +741,6 @@ export declare function useSSRContext(): SSRContextValue;
658
741
  */
659
742
  export declare function useTimeout(): readonly [(fn: () => void, delay: number) => void, () => void];
660
743
 
661
- /**
662
- * A hook that handles "trigger" pattern.
663
- *
664
- * Clones a passed element or calls render props. Merges props including refs and callbacks, callbacks are kept stable
665
- * by reference.
666
- */
667
- export declare function useTriggerElement<TriggerProps extends React_2.HTMLProps<unknown>>(options: UseTriggerElementOptions<TriggerProps>): React_2.ReactNode;
668
-
669
- export declare type UseTriggerElementOptions<TriggerProps> = {
670
- /** An actual trigger element or render props function. */
671
- children: React_2.ReactElement | ((props: TriggerProps) => React_2.ReactNode) | null | undefined;
672
- /** A ref to trigger element. */
673
- ref: React_2.Ref<unknown> | undefined;
674
- /** Props that are passed to a parent component and should be forwarded down. */
675
- outerProps: React_2.HTMLProps<unknown>;
676
- /** Custom props including callbacks. */
677
- overrideProps: TriggerProps;
678
- };
679
-
680
744
  /**
681
745
  * Hook which synchronously executes a callback when the component is about to unmount.
682
746
  *
@@ -691,4 +755,21 @@ export declare const useUnmount: (callback: () => void) => void;
691
755
  */
692
756
  export declare const videoProperties: Record<string, number>;
693
757
 
758
+ /**
759
+ * Helper type for {@link Slot}. Takes the props we want to support for a slot and adds the ability for `children`
760
+ * to be a render function that takes those props.
761
+ */
762
+ declare type WithSlotRenderFunction<Props extends {
763
+ children?: unknown;
764
+ }> = Props & {
765
+ children?: Props['children'] | SlotRenderFunction<Props>;
766
+ };
767
+
768
+ /**
769
+ * Helper type for {@link Slot}. Adds shorthand types that are assignable to the slot's `children`.
770
+ */
771
+ declare type WithSlotShorthandValue<Props extends {
772
+ children?: unknown;
773
+ }> = Props | Extract<SlotShorthandValue, Props['children']>;
774
+
694
775
  export { }
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import type { AsIntrinsicElement, ComponentState, ObjectShorthandProps, ObjectShorthandPropsRecord, UnionToIntersection } from './types';
3
- export declare type Slots<S extends ObjectShorthandPropsRecord> = {
4
- [K in keyof S]-?: NonNullable<S[K]> extends AsIntrinsicElement<infer As> ? As : S[K] extends ObjectShorthandProps<infer P> ? React.ElementType<NonNullable<P>> : React.ElementType<NonNullable<S[K]>>;
2
+ import type { AsIntrinsicElement, ComponentState, ExtractSlotProps, SlotPropsRecord, UnionToIntersection } from './types';
3
+ export declare type Slots<S extends SlotPropsRecord> = {
4
+ [K in keyof S]: ExtractSlotProps<S[K]> extends AsIntrinsicElement<infer As> ? As : ExtractSlotProps<S[K]> extends React.ComponentType<infer P> ? React.ElementType<NonNullable<P>> : React.ElementType<ExtractSlotProps<S[K]>>;
5
5
  };
6
- declare type SlotProps<S extends ObjectShorthandPropsRecord> = {
7
- [K in keyof S]-?: NonNullable<S[K]> extends AsIntrinsicElement<infer As> ? UnionToIntersection<JSX.IntrinsicElements[As]> : NonNullable<S[K]> extends ObjectShorthandProps<infer P> ? P : never;
6
+ declare type ObjectSlotProps<S extends SlotPropsRecord> = {
7
+ [K in keyof S]-?: ExtractSlotProps<S[K]> extends AsIntrinsicElement<infer As> ? UnionToIntersection<JSX.IntrinsicElements[As]> : ExtractSlotProps<S[K]> extends React.ComponentType<infer P> ? P : never;
8
8
  };
9
9
  /**
10
10
  * Given the state and an array of slot names, will break out `slots` and `slotProps`
@@ -23,8 +23,8 @@ declare type SlotProps<S extends ObjectShorthandPropsRecord> = {
23
23
  * @param state - State including slot definitions
24
24
  * @returns An object containing the `slots` map and `slotProps` map.
25
25
  */
26
- export declare function getSlots<R extends ObjectShorthandPropsRecord>(state: ComponentState<R>): {
26
+ export declare function getSlots<R extends SlotPropsRecord>(state: ComponentState<R>): {
27
27
  slots: Slots<R>;
28
- slotProps: SlotProps<R>;
28
+ slotProps: ObjectSlotProps<R>;
29
29
  };
30
30
  export {};