@navikt/ds-react 5.12.5 → 5.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (726) hide show
  1. package/_docs.json +285 -138
  2. package/cjs/accordion/Accordion.js +2 -2
  3. package/cjs/accordion/AccordionHeader.js +3 -5
  4. package/cjs/accordion/AccordionItem.js +11 -14
  5. package/cjs/alert/Alert.js +2 -2
  6. package/cjs/button/Button.js +11 -12
  7. package/cjs/chat/Bubble.js +1 -1
  8. package/cjs/chat/Chat.js +2 -2
  9. package/cjs/chips/Chips.js +1 -1
  10. package/cjs/chips/Removable.js +4 -7
  11. package/cjs/copybutton/CopyButton.js +6 -7
  12. package/cjs/date/datepicker/DatePicker.js +4 -2
  13. package/cjs/date/datepicker/parts/Caption.js +2 -2
  14. package/cjs/date/datepicker/parts/DropdownCaption.js +1 -1
  15. package/cjs/date/datepicker/parts/HeadRow.js +1 -1
  16. package/cjs/date/datepicker/parts/Row.js +2 -2
  17. package/cjs/date/datepicker/parts/WeekRow.js +2 -2
  18. package/cjs/date/monthpicker/MonthCaption.js +1 -1
  19. package/cjs/date/monthpicker/MonthPicker.js +4 -3
  20. package/cjs/date/parts/DateInput.js +1 -1
  21. package/cjs/date/parts/DateWrapper.js +2 -2
  22. package/cjs/date/utils/check-dates.js +1 -1
  23. package/cjs/date/utils/is-match.js +2 -2
  24. package/cjs/date/utils/parse-date.js +1 -1
  25. package/cjs/dropdown/Dropdown.js +10 -12
  26. package/cjs/dropdown/Menu/Divider.js +1 -1
  27. package/cjs/dropdown/Menu/GroupedList/GroupedHeading.js +1 -1
  28. package/cjs/dropdown/Menu/GroupedList/GroupedItem.js +3 -6
  29. package/cjs/dropdown/Menu/List/Item.js +3 -6
  30. package/cjs/dropdown/Toggle.js +6 -5
  31. package/cjs/expansion-card/ExpansionCardHeader.js +1 -1
  32. package/cjs/form/ConfirmationPanel.js +2 -2
  33. package/cjs/form/ReadOnlyIcon.js +1 -1
  34. package/cjs/form/Select.js +1 -1
  35. package/cjs/form/Textarea.js +2 -1
  36. package/cjs/form/checkbox/Checkbox.js +3 -2
  37. package/cjs/form/combobox/Combobox.js +7 -7
  38. package/cjs/form/combobox/ComboboxProvider.js +2 -2
  39. package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +4 -4
  40. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +5 -6
  41. package/cjs/form/combobox/Input/inputContext.js +2 -2
  42. package/cjs/form/combobox/SelectedOptions/SelectedOptions.js +1 -1
  43. package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +2 -5
  44. package/cjs/form/error-summary/ErrorSummary.js +3 -3
  45. package/cjs/form/error-summary/ErrorSummaryItem.js +1 -1
  46. package/cjs/form/radio/Radio.js +3 -2
  47. package/cjs/form/radio/RadioGroup.js +2 -2
  48. package/cjs/form/search/Search.js +3 -2
  49. package/cjs/form/search/SearchButton.js +3 -5
  50. package/cjs/form/useFormField.js +2 -2
  51. package/cjs/grid/Cell.js +1 -1
  52. package/cjs/grid/Grid.js +1 -1
  53. package/cjs/guide-panel/GuidePanel.js +1 -1
  54. package/cjs/guide-panel/Illustration.js +2 -2
  55. package/cjs/help-text/HelpText.js +5 -7
  56. package/cjs/help-text/HelpTextIcon.js +2 -2
  57. package/cjs/internal-header/InternalHeaderButton.js +1 -1
  58. package/cjs/internal-header/InternalHeaderTitle.js +1 -1
  59. package/cjs/internal-header/InternalHeaderUser.js +1 -1
  60. package/cjs/internal-header/InternalHeaderUserButton.js +1 -1
  61. package/cjs/layout/bleed/Bleed.js +1 -1
  62. package/cjs/layout/content-container/ContentContainer.js +1 -1
  63. package/cjs/layout/grid/HGrid.js +1 -1
  64. package/cjs/layout/page/parts/PageBlock.js +1 -1
  65. package/cjs/layout/sidemal-test/AvatarPanel.js +1 -1
  66. package/cjs/layout/sidemal-test/Content.js +3 -3
  67. package/cjs/layout/sidemal-test/Filter.js +1 -1
  68. package/cjs/layout/sidemal-test/Intro.js +1 -1
  69. package/cjs/link-panel/LinkPanel.js +3 -3
  70. package/cjs/link-panel/LinkPanelDescription.js +1 -1
  71. package/cjs/link-panel/LinkPanelTitle.js +1 -1
  72. package/cjs/list/List.js +2 -2
  73. package/cjs/loader/Loader.js +2 -1
  74. package/cjs/modal/Modal.js +21 -18
  75. package/cjs/modal/ModalBody.js +1 -1
  76. package/cjs/modal/ModalFooter.js +1 -1
  77. package/cjs/modal/ModalHeader.js +1 -1
  78. package/cjs/pagination/PaginationItem.js +1 -1
  79. package/cjs/panel/Panel.js +1 -1
  80. package/cjs/popover/Popover.js +6 -5
  81. package/cjs/popover/PopoverContent.js +1 -1
  82. package/cjs/read-more/ReadMore.js +12 -12
  83. package/cjs/skeleton/Skeleton.js +1 -1
  84. package/cjs/stepper/Step.js +6 -6
  85. package/cjs/table/Body.js +1 -1
  86. package/cjs/table/ColumnHeader.js +1 -1
  87. package/cjs/table/DataCell.js +3 -3
  88. package/cjs/table/ExpandableRow.js +23 -22
  89. package/cjs/table/Header.js +1 -1
  90. package/cjs/table/HeaderCell.js +2 -1
  91. package/cjs/table/Row.js +1 -1
  92. package/cjs/tabs/TabList.js +3 -2
  93. package/cjs/tabs/Tabs.js +1 -1
  94. package/cjs/tag/Tag.js +5 -3
  95. package/cjs/timeline/AxisLabels.js +1 -1
  96. package/cjs/timeline/Pin.js +2 -2
  97. package/cjs/timeline/TimelineRow.js +2 -2
  98. package/cjs/timeline/hooks/useTimelineRows.js +5 -3
  99. package/cjs/timeline/period/ClickablePeriod.js +2 -2
  100. package/cjs/timeline/utils/timeline.js +1 -1
  101. package/cjs/timeline/zoom/ZoomButton.js +1 -1
  102. package/cjs/toggle-group/ToggleGroup.js +3 -3
  103. package/cjs/tooltip/Tooltip.js +18 -12
  104. package/cjs/typography/BodyLong.js +1 -1
  105. package/cjs/typography/ErrorMessage.js +1 -1
  106. package/cjs/typography/Ingress.js +1 -1
  107. package/cjs/util/Slot.js +2 -5
  108. package/cjs/util/TextareaAutoSize.js +7 -5
  109. package/cjs/util/composeEventHandlers.js +17 -0
  110. package/cjs/util/hooks/index.js +19 -0
  111. package/cjs/util/hooks/package.json +6 -0
  112. package/cjs/util/hooks/useCallbackRef.js +18 -0
  113. package/cjs/util/hooks/useClientLayoutEffect.js +7 -0
  114. package/cjs/util/hooks/useControllableState.js +25 -0
  115. package/cjs/util/hooks/useMergeRefs.js +37 -0
  116. package/cjs/util/{usePrevious.js → hooks/usePrevious.js} +2 -1
  117. package/cjs/util/index.js +7 -7
  118. package/cjs/util/types/index.js +2 -0
  119. package/cjs/util/types/package.json +6 -0
  120. package/esm/accordion/Accordion.d.ts +1 -1
  121. package/esm/accordion/Accordion.js +2 -2
  122. package/esm/accordion/Accordion.js.map +1 -1
  123. package/esm/accordion/AccordionHeader.js +3 -5
  124. package/esm/accordion/AccordionHeader.js.map +1 -1
  125. package/esm/accordion/AccordionItem.d.ts +4 -0
  126. package/esm/accordion/AccordionItem.js +12 -15
  127. package/esm/accordion/AccordionItem.js.map +1 -1
  128. package/esm/alert/Alert.js +2 -2
  129. package/esm/alert/Alert.js.map +1 -1
  130. package/esm/button/Button.d.ts +1 -1
  131. package/esm/button/Button.js +12 -13
  132. package/esm/button/Button.js.map +1 -1
  133. package/esm/chat/Bubble.js +1 -1
  134. package/esm/chat/Bubble.js.map +1 -1
  135. package/esm/chat/Chat.js +2 -2
  136. package/esm/chat/Chat.js.map +1 -1
  137. package/esm/chips/Chips.d.ts +2 -2
  138. package/esm/chips/Chips.js +1 -1
  139. package/esm/chips/Chips.js.map +1 -1
  140. package/esm/chips/Removable.js +4 -7
  141. package/esm/chips/Removable.js.map +1 -1
  142. package/esm/chips/Toggle.d.ts +1 -1
  143. package/esm/copybutton/CopyButton.js +6 -7
  144. package/esm/copybutton/CopyButton.js.map +1 -1
  145. package/esm/date/context/useSharedMonthContext.js.map +1 -1
  146. package/esm/date/datepicker/DatePicker.js +5 -3
  147. package/esm/date/datepicker/DatePicker.js.map +1 -1
  148. package/esm/date/datepicker/parts/Caption.js +2 -2
  149. package/esm/date/datepicker/parts/Caption.js.map +1 -1
  150. package/esm/date/datepicker/parts/DropdownCaption.js +1 -1
  151. package/esm/date/datepicker/parts/DropdownCaption.js.map +1 -1
  152. package/esm/date/datepicker/parts/HeadRow.js +1 -1
  153. package/esm/date/datepicker/parts/HeadRow.js.map +1 -1
  154. package/esm/date/datepicker/parts/Row.js +3 -3
  155. package/esm/date/datepicker/parts/Row.js.map +1 -1
  156. package/esm/date/datepicker/parts/WeekRow.js +1 -1
  157. package/esm/date/datepicker/parts/WeekRow.js.map +1 -1
  158. package/esm/date/monthpicker/MonthCaption.js +1 -1
  159. package/esm/date/monthpicker/MonthCaption.js.map +1 -1
  160. package/esm/date/monthpicker/MonthPicker.js +4 -3
  161. package/esm/date/monthpicker/MonthPicker.js.map +1 -1
  162. package/esm/date/parts/DateInput.js +1 -1
  163. package/esm/date/parts/DateInput.js.map +1 -1
  164. package/esm/date/parts/DateWrapper.js +1 -1
  165. package/esm/date/parts/DateWrapper.js.map +1 -1
  166. package/esm/date/utils/check-dates.js +1 -1
  167. package/esm/date/utils/check-dates.js.map +1 -1
  168. package/esm/date/utils/get-month-weeks.js.map +1 -1
  169. package/esm/date/utils/is-match.js +2 -2
  170. package/esm/date/utils/is-match.js.map +1 -1
  171. package/esm/date/utils/navigation.js.map +1 -1
  172. package/esm/date/utils/parse-date.js +1 -1
  173. package/esm/date/utils/parse-date.js.map +1 -1
  174. package/esm/dropdown/Dropdown.d.ts +4 -0
  175. package/esm/dropdown/Dropdown.js +10 -12
  176. package/esm/dropdown/Dropdown.js.map +1 -1
  177. package/esm/dropdown/Menu/Divider.js +1 -1
  178. package/esm/dropdown/Menu/Divider.js.map +1 -1
  179. package/esm/dropdown/Menu/GroupedList/GroupedHeading.js +1 -1
  180. package/esm/dropdown/Menu/GroupedList/GroupedHeading.js.map +1 -1
  181. package/esm/dropdown/Menu/GroupedList/GroupedItem.d.ts +1 -1
  182. package/esm/dropdown/Menu/GroupedList/GroupedItem.js +3 -6
  183. package/esm/dropdown/Menu/GroupedList/GroupedItem.js.map +1 -1
  184. package/esm/dropdown/Menu/GroupedList/index.d.ts +1 -1
  185. package/esm/dropdown/Menu/List/Item.d.ts +1 -1
  186. package/esm/dropdown/Menu/List/Item.js +3 -6
  187. package/esm/dropdown/Menu/List/Item.js.map +1 -1
  188. package/esm/dropdown/Menu/List/index.d.ts +1 -1
  189. package/esm/dropdown/Toggle.js +6 -5
  190. package/esm/dropdown/Toggle.js.map +1 -1
  191. package/esm/expansion-card/ExpansionCard.d.ts +1 -1
  192. package/esm/expansion-card/ExpansionCardHeader.js +1 -1
  193. package/esm/expansion-card/ExpansionCardHeader.js.map +1 -1
  194. package/esm/expansion-card/ExpansionCardTitle.d.ts +1 -1
  195. package/esm/form/ConfirmationPanel.js +1 -1
  196. package/esm/form/ConfirmationPanel.js.map +1 -1
  197. package/esm/form/Fieldset/useFieldset.d.ts +1 -1
  198. package/esm/form/ReadOnlyIcon.js +1 -1
  199. package/esm/form/ReadOnlyIcon.js.map +1 -1
  200. package/esm/form/Select.js +1 -1
  201. package/esm/form/Select.js.map +1 -1
  202. package/esm/form/Switch.js.map +1 -1
  203. package/esm/form/TextField.js.map +1 -1
  204. package/esm/form/Textarea.js +2 -1
  205. package/esm/form/Textarea.js.map +1 -1
  206. package/esm/form/checkbox/Checkbox.js +2 -1
  207. package/esm/form/checkbox/Checkbox.js.map +1 -1
  208. package/esm/form/checkbox/useCheckbox.d.ts +1 -1
  209. package/esm/form/combobox/Combobox.d.ts +1 -1
  210. package/esm/form/combobox/Combobox.js +8 -8
  211. package/esm/form/combobox/Combobox.js.map +1 -1
  212. package/esm/form/combobox/ComboboxProvider.js +2 -2
  213. package/esm/form/combobox/ComboboxProvider.js.map +1 -1
  214. package/esm/form/combobox/FilteredOptions/FilteredOptions.js +4 -4
  215. package/esm/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
  216. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.d.ts +1 -1
  217. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +3 -4
  218. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  219. package/esm/form/combobox/Input/inputContext.js +1 -1
  220. package/esm/form/combobox/Input/inputContext.js.map +1 -1
  221. package/esm/form/combobox/SelectedOptions/SelectedOptions.js +1 -1
  222. package/esm/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
  223. package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js +1 -1
  224. package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
  225. package/esm/form/combobox/ToggleListButton.js +1 -1
  226. package/esm/form/combobox/ToggleListButton.js.map +1 -1
  227. package/esm/form/combobox/customOptionsContext.js +1 -1
  228. package/esm/form/combobox/customOptionsContext.js.map +1 -1
  229. package/esm/form/error-summary/ErrorSummary.js +3 -3
  230. package/esm/form/error-summary/ErrorSummary.js.map +1 -1
  231. package/esm/form/error-summary/ErrorSummaryItem.d.ts +1 -1
  232. package/esm/form/error-summary/ErrorSummaryItem.js +1 -1
  233. package/esm/form/error-summary/ErrorSummaryItem.js.map +1 -1
  234. package/esm/form/radio/Radio.js +2 -1
  235. package/esm/form/radio/Radio.js.map +1 -1
  236. package/esm/form/radio/RadioGroup.js +1 -1
  237. package/esm/form/radio/RadioGroup.js.map +1 -1
  238. package/esm/form/radio/useRadio.d.ts +1 -1
  239. package/esm/form/search/Search.js +5 -4
  240. package/esm/form/search/Search.js.map +1 -1
  241. package/esm/form/search/SearchButton.js +3 -5
  242. package/esm/form/search/SearchButton.js.map +1 -1
  243. package/esm/form/useFormField.js +1 -1
  244. package/esm/form/useFormField.js.map +1 -1
  245. package/esm/grid/Cell.js +1 -1
  246. package/esm/grid/Cell.js.map +1 -1
  247. package/esm/grid/Grid.js +1 -1
  248. package/esm/grid/Grid.js.map +1 -1
  249. package/esm/guide-panel/GuidePanel.js +1 -1
  250. package/esm/guide-panel/GuidePanel.js.map +1 -1
  251. package/esm/guide-panel/Illustration.js +1 -1
  252. package/esm/guide-panel/Illustration.js.map +1 -1
  253. package/esm/help-text/HelpText.d.ts +0 -5
  254. package/esm/help-text/HelpText.js +6 -8
  255. package/esm/help-text/HelpText.js.map +1 -1
  256. package/esm/help-text/HelpTextIcon.js +1 -1
  257. package/esm/internal-header/InternalHeader.d.ts +1 -1
  258. package/esm/internal-header/InternalHeader.js.map +1 -1
  259. package/esm/internal-header/InternalHeaderButton.d.ts +1 -1
  260. package/esm/internal-header/InternalHeaderButton.js +1 -1
  261. package/esm/internal-header/InternalHeaderButton.js.map +1 -1
  262. package/esm/internal-header/InternalHeaderTitle.d.ts +1 -1
  263. package/esm/internal-header/InternalHeaderTitle.js +1 -1
  264. package/esm/internal-header/InternalHeaderTitle.js.map +1 -1
  265. package/esm/internal-header/InternalHeaderUser.js +1 -1
  266. package/esm/internal-header/InternalHeaderUser.js.map +1 -1
  267. package/esm/internal-header/InternalHeaderUserButton.d.ts +1 -1
  268. package/esm/internal-header/InternalHeaderUserButton.js +1 -1
  269. package/esm/internal-header/InternalHeaderUserButton.js.map +1 -1
  270. package/esm/layout/bleed/Bleed.js +1 -1
  271. package/esm/layout/bleed/Bleed.js.map +1 -1
  272. package/esm/layout/box/Box.d.ts +2 -2
  273. package/esm/layout/content-container/ContentContainer.js +1 -1
  274. package/esm/layout/content-container/ContentContainer.js.map +1 -1
  275. package/esm/layout/grid/HGrid.js +1 -1
  276. package/esm/layout/grid/HGrid.js.map +1 -1
  277. package/esm/layout/page/Page.d.ts +2 -2
  278. package/esm/layout/page/Page.js.map +1 -1
  279. package/esm/layout/page/parts/PageBlock.d.ts +7 -6
  280. package/esm/layout/page/parts/PageBlock.js +1 -1
  281. package/esm/layout/page/parts/PageBlock.js.map +1 -1
  282. package/esm/layout/responsive/Responsive.js.map +1 -1
  283. package/esm/layout/sidemal-test/AvatarPanel.js +1 -1
  284. package/esm/layout/sidemal-test/AvatarPanel.js.map +1 -1
  285. package/esm/layout/sidemal-test/Content.js +4 -4
  286. package/esm/layout/sidemal-test/Content.js.map +1 -1
  287. package/esm/layout/sidemal-test/Filter.js +1 -1
  288. package/esm/layout/sidemal-test/Filter.js.map +1 -1
  289. package/esm/layout/sidemal-test/Header.js +1 -1
  290. package/esm/layout/sidemal-test/Header.js.map +1 -1
  291. package/esm/layout/sidemal-test/Intro.js +2 -2
  292. package/esm/layout/sidemal-test/Intro.js.map +1 -1
  293. package/esm/layout/sidemal-test/content-box/ContentBox.js.map +1 -1
  294. package/esm/layout/stack/HStack.d.ts +1 -1
  295. package/esm/layout/stack/HStack.js.map +1 -1
  296. package/esm/layout/stack/Stack.d.ts +1 -1
  297. package/esm/layout/stack/Stack.js.map +1 -1
  298. package/esm/layout/stack/VStack.d.ts +1 -1
  299. package/esm/layout/stack/VStack.js.map +1 -1
  300. package/esm/layout/utilities/types.d.ts +2 -2
  301. package/esm/link/Link.d.ts +1 -1
  302. package/esm/link-panel/LinkPanel.d.ts +2 -2
  303. package/esm/link-panel/LinkPanel.js +3 -3
  304. package/esm/link-panel/LinkPanel.js.map +1 -1
  305. package/esm/link-panel/LinkPanelDescription.js +1 -1
  306. package/esm/link-panel/LinkPanelDescription.js.map +1 -1
  307. package/esm/link-panel/LinkPanelTitle.d.ts +1 -1
  308. package/esm/link-panel/LinkPanelTitle.js +1 -1
  309. package/esm/link-panel/LinkPanelTitle.js.map +1 -1
  310. package/esm/list/List.js +1 -1
  311. package/esm/loader/Loader.js +2 -1
  312. package/esm/loader/Loader.js.map +1 -1
  313. package/esm/modal/Modal.js +21 -18
  314. package/esm/modal/Modal.js.map +1 -1
  315. package/esm/modal/ModalBody.js +1 -1
  316. package/esm/modal/ModalBody.js.map +1 -1
  317. package/esm/modal/ModalFooter.js +1 -1
  318. package/esm/modal/ModalFooter.js.map +1 -1
  319. package/esm/modal/ModalHeader.js +1 -1
  320. package/esm/modal/ModalHeader.js.map +1 -1
  321. package/esm/modal/types.d.ts +1 -1
  322. package/esm/pagination/Pagination.js.map +1 -1
  323. package/esm/pagination/PaginationItem.d.ts +1 -1
  324. package/esm/pagination/PaginationItem.js +1 -1
  325. package/esm/pagination/PaginationItem.js.map +1 -1
  326. package/esm/panel/Panel.d.ts +1 -1
  327. package/esm/panel/Panel.js +1 -1
  328. package/esm/panel/Panel.js.map +1 -1
  329. package/esm/popover/Popover.d.ts +1 -1
  330. package/esm/popover/Popover.js +4 -3
  331. package/esm/popover/Popover.js.map +1 -1
  332. package/esm/popover/PopoverContent.js +1 -1
  333. package/esm/popover/PopoverContent.js.map +1 -1
  334. package/esm/read-more/ReadMore.d.ts +4 -0
  335. package/esm/read-more/ReadMore.js +13 -13
  336. package/esm/read-more/ReadMore.js.map +1 -1
  337. package/esm/skeleton/Skeleton.js +1 -1
  338. package/esm/skeleton/Skeleton.js.map +1 -1
  339. package/esm/stepper/Step.d.ts +1 -1
  340. package/esm/stepper/Step.js +6 -6
  341. package/esm/stepper/Step.js.map +1 -1
  342. package/esm/table/AnimateHeight.js.map +1 -0
  343. package/esm/table/Body.js +1 -1
  344. package/esm/table/Body.js.map +1 -1
  345. package/esm/table/ColumnHeader.js +1 -1
  346. package/esm/table/ColumnHeader.js.map +1 -1
  347. package/esm/table/DataCell.d.ts +4 -0
  348. package/esm/table/DataCell.js +3 -3
  349. package/esm/table/DataCell.js.map +1 -1
  350. package/esm/table/ExpandableRow.js +23 -22
  351. package/esm/table/ExpandableRow.js.map +1 -1
  352. package/esm/table/Header.js +1 -1
  353. package/esm/table/Header.js.map +1 -1
  354. package/esm/table/HeaderCell.d.ts +4 -0
  355. package/esm/table/HeaderCell.js +2 -1
  356. package/esm/table/HeaderCell.js.map +1 -1
  357. package/esm/table/Row.js +1 -1
  358. package/esm/table/Row.js.map +1 -1
  359. package/esm/tabs/Tab.d.ts +1 -1
  360. package/esm/tabs/TabList.js +4 -3
  361. package/esm/tabs/TabList.js.map +1 -1
  362. package/esm/tabs/Tabs.d.ts +1 -1
  363. package/esm/tabs/Tabs.js +1 -1
  364. package/esm/tabs/Tabs.js.map +1 -1
  365. package/esm/tag/Tag.d.ts +4 -0
  366. package/esm/tag/Tag.js +5 -3
  367. package/esm/tag/Tag.js.map +1 -1
  368. package/esm/timeline/AxisLabels.js +1 -1
  369. package/esm/timeline/AxisLabels.js.map +1 -1
  370. package/esm/timeline/Pin.js +3 -3
  371. package/esm/timeline/Pin.js.map +1 -1
  372. package/esm/timeline/TimelineRow.js +2 -2
  373. package/esm/timeline/TimelineRow.js.map +1 -1
  374. package/esm/timeline/hooks/useTimelineRows.js +5 -3
  375. package/esm/timeline/hooks/useTimelineRows.js.map +1 -1
  376. package/esm/timeline/period/ClickablePeriod.js +3 -3
  377. package/esm/timeline/period/ClickablePeriod.js.map +1 -1
  378. package/esm/timeline/utils/timeline.js +1 -1
  379. package/esm/timeline/utils/timeline.js.map +1 -1
  380. package/esm/timeline/zoom/ZoomButton.js +1 -1
  381. package/esm/timeline/zoom/ZoomButton.js.map +1 -1
  382. package/esm/toggle-group/ToggleGroup.js +2 -2
  383. package/esm/toggle-group/ToggleGroup.js.map +1 -1
  384. package/esm/tooltip/Tooltip.d.ts +4 -0
  385. package/esm/tooltip/Tooltip.js +18 -12
  386. package/esm/tooltip/Tooltip.js.map +1 -1
  387. package/esm/typography/BodyLong.d.ts +1 -1
  388. package/esm/typography/BodyLong.js +1 -1
  389. package/esm/typography/BodyLong.js.map +1 -1
  390. package/esm/typography/BodyShort.d.ts +1 -1
  391. package/esm/typography/Detail.d.ts +1 -1
  392. package/esm/typography/ErrorMessage.d.ts +1 -1
  393. package/esm/typography/ErrorMessage.js +1 -1
  394. package/esm/typography/ErrorMessage.js.map +1 -1
  395. package/esm/typography/Heading.d.ts +1 -1
  396. package/esm/typography/Ingress.d.ts +1 -1
  397. package/esm/typography/Ingress.js +1 -1
  398. package/esm/typography/Ingress.js.map +1 -1
  399. package/esm/typography/Label.d.ts +1 -1
  400. package/esm/util/Slot.js +1 -1
  401. package/esm/util/Slot.js.map +1 -1
  402. package/esm/util/TextareaAutoSize.js +5 -3
  403. package/esm/util/TextareaAutoSize.js.map +1 -1
  404. package/esm/util/composeEventHandlers.d.ts +8 -0
  405. package/esm/util/composeEventHandlers.js +14 -0
  406. package/esm/util/composeEventHandlers.js.map +1 -0
  407. package/esm/util/hooks/index.d.ts +8 -0
  408. package/esm/util/hooks/index.js +9 -0
  409. package/esm/util/hooks/index.js.map +1 -0
  410. package/esm/util/hooks/useCallbackRef.d.ts +7 -0
  411. package/esm/util/hooks/useCallbackRef.js +15 -0
  412. package/esm/util/hooks/useCallbackRef.js.map +1 -0
  413. package/esm/util/hooks/useClientLayoutEffect.js +5 -0
  414. package/esm/util/hooks/useClientLayoutEffect.js.map +1 -0
  415. package/esm/util/hooks/useControllableState.d.ts +9 -0
  416. package/esm/util/hooks/useControllableState.js +22 -0
  417. package/esm/util/hooks/useControllableState.js.map +1 -0
  418. package/esm/util/{useEventListener.d.ts → hooks/useEventListener.d.ts} +1 -1
  419. package/esm/util/hooks/useEventListener.js.map +1 -0
  420. package/esm/util/hooks/useId.js.map +1 -0
  421. package/esm/util/hooks/useMedia.js.map +1 -0
  422. package/esm/util/hooks/useMergeRefs.d.ts +15 -0
  423. package/esm/util/hooks/useMergeRefs.js +30 -0
  424. package/esm/util/hooks/useMergeRefs.js.map +1 -0
  425. package/esm/util/hooks/usePrevious.d.ts +1 -0
  426. package/esm/util/{usePrevious.js → hooks/usePrevious.js} +1 -2
  427. package/esm/util/hooks/usePrevious.js.map +1 -0
  428. package/esm/util/index.d.ts +4 -5
  429. package/esm/util/index.js +3 -5
  430. package/esm/util/index.js.map +1 -1
  431. package/esm/util/types/OverridableComponent.js.map +1 -0
  432. package/esm/util/types/index.d.ts +1 -0
  433. package/esm/util/types/index.js +2 -0
  434. package/esm/util/types/index.js.map +1 -0
  435. package/package.json +3 -3
  436. package/src/accordion/Accordion.tsx +5 -5
  437. package/src/accordion/AccordionContent.tsx +3 -3
  438. package/src/accordion/AccordionHeader.tsx +5 -7
  439. package/src/accordion/AccordionItem.tsx +22 -22
  440. package/src/accordion/accordion.stories.tsx +8 -5
  441. package/src/alert/Alert.tsx +8 -8
  442. package/src/alert/alert.stories.tsx +6 -7
  443. package/src/button/Button.tsx +18 -23
  444. package/src/button/button.stories.tsx +1 -1
  445. package/src/chat/Bubble.tsx +4 -4
  446. package/src/chat/Chat.tsx +5 -5
  447. package/src/chat/chat.stories.tsx +1 -1
  448. package/src/chips/Chips.tsx +4 -4
  449. package/src/chips/Removable.tsx +7 -8
  450. package/src/chips/Toggle.tsx +4 -4
  451. package/src/chips/chips.stories.tsx +5 -5
  452. package/src/copybutton/CopyButton.tsx +9 -10
  453. package/src/copybutton/copy-button.stories.tsx +3 -3
  454. package/src/date/context/useSharedMonthContext.tsx +1 -1
  455. package/src/date/datepicker/DatePicker.tsx +7 -5
  456. package/src/date/datepicker/DatePickerStandalone.tsx +2 -2
  457. package/src/date/datepicker/datepicker.stories.tsx +2 -2
  458. package/src/date/datepicker/parts/Caption.tsx +2 -3
  459. package/src/date/datepicker/parts/DropdownCaption.tsx +2 -2
  460. package/src/date/datepicker/parts/HeadRow.tsx +1 -1
  461. package/src/date/datepicker/parts/Row.tsx +3 -3
  462. package/src/date/datepicker/parts/WeekRow.tsx +1 -1
  463. package/src/date/hooks/useDatepicker.tsx +7 -7
  464. package/src/date/hooks/useMonthPicker.tsx +7 -7
  465. package/src/date/hooks/useRangeDatepicker.test.tsx +2 -2
  466. package/src/date/hooks/useRangeDatepicker.tsx +28 -28
  467. package/src/date/monthpicker/MonthButton.tsx +1 -1
  468. package/src/date/monthpicker/MonthCaption.tsx +1 -1
  469. package/src/date/monthpicker/MonthPicker.tsx +7 -6
  470. package/src/date/monthpicker/MonthPickerStandalone.tsx +3 -3
  471. package/src/date/monthpicker/MonthSelector.tsx +1 -1
  472. package/src/date/parts/DateInput.tsx +6 -6
  473. package/src/date/parts/DateWrapper.tsx +1 -1
  474. package/src/date/utils/__tests__/check-dates.test.ts +3 -3
  475. package/src/date/utils/__tests__/format-dates.test.ts +7 -7
  476. package/src/date/utils/__tests__/get-initial-year.test.ts +14 -14
  477. package/src/date/utils/__tests__/get-month-weeks.test.ts +0 -1
  478. package/src/date/utils/__tests__/is-match.test.ts +4 -4
  479. package/src/date/utils/__tests__/parse-dates.test.ts +2 -2
  480. package/src/date/utils/check-dates.ts +2 -2
  481. package/src/date/utils/dates-disabled.ts +1 -1
  482. package/src/date/utils/format-date.ts +1 -1
  483. package/src/date/utils/get-dates.ts +1 -1
  484. package/src/date/utils/get-month-weeks.ts +6 -6
  485. package/src/date/utils/is-match.ts +2 -3
  486. package/src/date/utils/labels.ts +1 -1
  487. package/src/date/utils/navigation.ts +18 -18
  488. package/src/date/utils/parse-date.ts +8 -8
  489. package/src/dropdown/Dropdown.tsx +14 -11
  490. package/src/dropdown/Menu/Divider.tsx +1 -1
  491. package/src/dropdown/Menu/GroupedList/GroupedHeading.tsx +2 -2
  492. package/src/dropdown/Menu/GroupedList/GroupedItem.tsx +23 -23
  493. package/src/dropdown/Menu/GroupedList/index.tsx +2 -2
  494. package/src/dropdown/Menu/List/Item.tsx +23 -23
  495. package/src/dropdown/Menu/List/index.tsx +1 -1
  496. package/src/dropdown/Menu/index.tsx +1 -1
  497. package/src/dropdown/Toggle.tsx +10 -6
  498. package/src/dropdown/dropdown.stories.tsx +1 -1
  499. package/src/expansion-card/ExpansionCard.tsx +4 -4
  500. package/src/expansion-card/ExpansionCardContent.tsx +1 -1
  501. package/src/expansion-card/ExpansionCardDescription.tsx +1 -1
  502. package/src/expansion-card/ExpansionCardHeader.tsx +2 -2
  503. package/src/expansion-card/ExpansionCardTitle.tsx +3 -3
  504. package/src/expansion-card/expansion-card.stories.tsx +1 -1
  505. package/src/form/ConfirmationPanel.test.tsx +1 -1
  506. package/src/form/ConfirmationPanel.tsx +3 -3
  507. package/src/form/Fieldset/Fieldset.tsx +2 -2
  508. package/src/form/ReadOnlyIcon.tsx +1 -1
  509. package/src/form/Select.tsx +6 -6
  510. package/src/form/Switch.tsx +4 -4
  511. package/src/form/TextField.tsx +4 -4
  512. package/src/form/Textarea.tsx +6 -5
  513. package/src/form/checkbox/Checkbox.test.tsx +8 -8
  514. package/src/form/checkbox/Checkbox.tsx +5 -4
  515. package/src/form/checkbox/CheckboxGroup.tsx +4 -4
  516. package/src/form/checkbox/useCheckbox.ts +3 -3
  517. package/src/form/combobox/Combobox.tsx +9 -12
  518. package/src/form/combobox/ComboboxProvider.tsx +3 -3
  519. package/src/form/combobox/ComboboxWrapper.tsx +1 -1
  520. package/src/form/combobox/FilteredOptions/FilteredOptions.tsx +6 -6
  521. package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +17 -18
  522. package/src/form/combobox/FilteredOptions/useVirtualFocus.ts +5 -5
  523. package/src/form/combobox/Input/Input.tsx +6 -6
  524. package/src/form/combobox/Input/inputContext.tsx +7 -7
  525. package/src/form/combobox/SelectedOptions/SelectedOptions.tsx +1 -1
  526. package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +10 -10
  527. package/src/form/combobox/ToggleListButton.tsx +1 -2
  528. package/src/form/combobox/combobox.stories.tsx +17 -18
  529. package/src/form/combobox/combobox.test.tsx +14 -12
  530. package/src/form/combobox/customOptionsContext.tsx +6 -6
  531. package/src/form/combobox/types.ts +2 -2
  532. package/src/form/error-summary/ErrorSummary.tsx +6 -6
  533. package/src/form/error-summary/ErrorSummaryItem.tsx +3 -3
  534. package/src/form/error-summary/error-summary.stories.tsx +2 -1
  535. package/src/form/radio/Radio.test.tsx +1 -1
  536. package/src/form/radio/Radio.tsx +3 -2
  537. package/src/form/radio/RadioGroup.tsx +4 -4
  538. package/src/form/radio/useRadio.ts +1 -1
  539. package/src/form/search/Search.tsx +9 -9
  540. package/src/form/search/SearchButton.tsx +4 -6
  541. package/src/form/search/search.stories.tsx +1 -1
  542. package/src/form/stories/fieldset.stories.tsx +3 -2
  543. package/src/form/stories/select.stories.tsx +2 -1
  544. package/src/form/stories/text-field.stories.tsx +2 -1
  545. package/src/form/useFormField.ts +4 -4
  546. package/src/grid/Cell.tsx +3 -3
  547. package/src/grid/Grid.tsx +2 -2
  548. package/src/grid/grid.stories.tsx +1 -1
  549. package/src/guide-panel/GuidePanel.tsx +2 -2
  550. package/src/guide-panel/Illustration.tsx +1 -1
  551. package/src/guide-panel/guidepanel.stories.tsx +1 -1
  552. package/src/help-text/HelpText.tsx +9 -27
  553. package/src/help-text/HelpTextIcon.tsx +1 -1
  554. package/src/help-text/help-text.stories.tsx +58 -68
  555. package/src/internal-header/InternalHeader.tsx +2 -2
  556. package/src/internal-header/InternalHeaderButton.tsx +2 -2
  557. package/src/internal-header/InternalHeaderTitle.tsx +2 -2
  558. package/src/internal-header/InternalHeaderUser.tsx +1 -1
  559. package/src/internal-header/InternalHeaderUserButton.tsx +2 -2
  560. package/src/internal-header/header.stories.tsx +3 -3
  561. package/src/layout/bleed/Bleed.tsx +7 -7
  562. package/src/layout/box/Box.stories.tsx +4 -4
  563. package/src/layout/box/Box.tsx +8 -8
  564. package/src/layout/content-container/ContentContainer.tsx +1 -1
  565. package/src/layout/grid/HGrid.tsx +4 -4
  566. package/src/layout/page/Page.stories.tsx +1 -1
  567. package/src/layout/page/Page.tsx +4 -4
  568. package/src/layout/page/parts/PageBlock.tsx +9 -8
  569. package/src/layout/responsive/Responsive.tsx +6 -6
  570. package/src/layout/responsive/hide.stories.tsx +1 -1
  571. package/src/layout/responsive/show.stories.tsx +1 -1
  572. package/src/layout/sidemal-test/AvatarPanel.tsx +1 -1
  573. package/src/layout/sidemal-test/Content.tsx +4 -4
  574. package/src/layout/sidemal-test/Filter.tsx +1 -1
  575. package/src/layout/sidemal-test/Header.tsx +1 -1
  576. package/src/layout/sidemal-test/Intro.tsx +2 -2
  577. package/src/layout/sidemal-test/content-box/ContentBox.tsx +6 -6
  578. package/src/layout/sidemal-test/navno-sidemal.stories.tsx +1 -1
  579. package/src/layout/stack/HStack.tsx +2 -2
  580. package/src/layout/stack/Stack.tsx +4 -4
  581. package/src/layout/stack/VStack.tsx +2 -2
  582. package/src/layout/stack/stack.stories.tsx +2 -2
  583. package/src/layout/utilities/css.ts +6 -6
  584. package/src/layout/utilities/types.ts +2 -2
  585. package/src/link/Link.tsx +3 -3
  586. package/src/link/{link.stories.tsx → stories/link.stories.tsx} +3 -3
  587. package/src/link-panel/LinkPanel.tsx +6 -7
  588. package/src/link-panel/LinkPanelDescription.tsx +1 -1
  589. package/src/link-panel/LinkPanelTitle.tsx +3 -3
  590. package/src/list/List.tsx +3 -3
  591. package/src/list/ListItem.tsx +2 -2
  592. package/src/list/list.stories.tsx +2 -2
  593. package/src/loader/Loader.tsx +6 -5
  594. package/src/loader/loader.stories.tsx +1 -0
  595. package/src/modal/Modal.test.tsx +4 -4
  596. package/src/modal/Modal.tsx +32 -32
  597. package/src/modal/ModalBody.tsx +2 -2
  598. package/src/modal/ModalFooter.tsx +2 -2
  599. package/src/modal/ModalHeader.tsx +2 -2
  600. package/src/modal/ModalUtils.ts +2 -2
  601. package/src/modal/dialog-polyfill.ts +16 -16
  602. package/src/modal/types.ts +1 -1
  603. package/src/pagination/Pagination.tsx +5 -6
  604. package/src/pagination/PaginationItem.tsx +4 -4
  605. package/src/pagination/steps.test.ts +8 -8
  606. package/src/panel/Panel.tsx +4 -4
  607. package/src/panel/panel.stories.tsx +2 -1
  608. package/src/popover/Popover.test.tsx +7 -7
  609. package/src/popover/Popover.tsx +11 -14
  610. package/src/popover/PopoverContent.tsx +2 -2
  611. package/src/provider/Provider.tsx +1 -1
  612. package/src/read-more/ReadMore.tsx +20 -16
  613. package/src/read-more/readmore.stories.tsx +4 -0
  614. package/src/skeleton/Skeleton.tsx +4 -4
  615. package/src/stepper/Step.tsx +10 -7
  616. package/src/stepper/Stepper.tsx +3 -3
  617. package/src/{util → table}/AnimateHeight.tsx +1 -1
  618. package/src/table/Body.tsx +1 -1
  619. package/src/table/ColumnHeader.tsx +2 -2
  620. package/src/table/DataCell.tsx +8 -3
  621. package/src/table/ExpandableRow.tsx +30 -23
  622. package/src/table/Header.tsx +1 -1
  623. package/src/table/HeaderCell.tsx +7 -2
  624. package/src/table/Row.tsx +2 -2
  625. package/src/table/Table.tsx +2 -2
  626. package/src/table/stories/table-async.stories.tsx +4 -4
  627. package/src/table/stories/table.stories.tsx +44 -30
  628. package/src/table/stories/tests/table.stories.tsx +2 -3
  629. package/src/tabs/Tab.tsx +4 -4
  630. package/src/tabs/TabList.tsx +8 -6
  631. package/src/tabs/TabPanel.tsx +1 -1
  632. package/src/tabs/Tabs.stories.tsx +1 -1
  633. package/src/tabs/Tabs.tsx +5 -5
  634. package/src/tag/Tag.tsx +12 -5
  635. package/src/tag/tag.stories.tsx +28 -2
  636. package/src/timeline/AxisLabels.tsx +9 -9
  637. package/src/timeline/Pin.tsx +4 -7
  638. package/src/timeline/Timeline.tsx +7 -7
  639. package/src/timeline/TimelineRow.tsx +5 -5
  640. package/src/timeline/hooks/useTimelineContext.tsx +1 -1
  641. package/src/timeline/hooks/useTimelineRows.ts +18 -19
  642. package/src/timeline/period/ClickablePeriod.tsx +6 -9
  643. package/src/timeline/period/NonClickablePeriod.tsx +1 -1
  644. package/src/timeline/period/index.tsx +1 -1
  645. package/src/timeline/timeline.stories.tsx +2 -2
  646. package/src/timeline/utils/calc.ts +2 -2
  647. package/src/timeline/utils/filter.ts +2 -2
  648. package/src/timeline/utils/period.ts +2 -2
  649. package/src/timeline/utils/timeline.ts +1 -1
  650. package/src/timeline/zoom/ZoomButton.tsx +3 -3
  651. package/src/timeline/zoom/index.tsx +1 -1
  652. package/src/toggle-group/ToggleGroup.stories.tsx +2 -2
  653. package/src/toggle-group/ToggleGroup.tsx +6 -6
  654. package/src/toggle-group/ToggleItem.tsx +1 -1
  655. package/src/toggle-group/context.ts +1 -1
  656. package/src/tooltip/Tooltip.test.tsx +10 -10
  657. package/src/tooltip/Tooltip.tsx +31 -33
  658. package/src/tooltip/tooltip.stories.tsx +1 -1
  659. package/src/typography/BodyLong.tsx +5 -5
  660. package/src/typography/BodyShort.tsx +4 -4
  661. package/src/typography/Detail.tsx +4 -4
  662. package/src/typography/ErrorMessage.tsx +4 -4
  663. package/src/typography/Heading.tsx +4 -4
  664. package/src/typography/Ingress.tsx +2 -2
  665. package/src/typography/Label.tsx +4 -4
  666. package/src/typography/stories/bodylong.stories.tsx +1 -2
  667. package/src/typography/stories/bodyshort.stories.tsx +1 -2
  668. package/src/typography/stories/detail.stories.tsx +1 -2
  669. package/src/typography/stories/error-message.stories.tsx +1 -2
  670. package/src/typography/stories/heading.stories.tsx +1 -3
  671. package/src/typography/stories/ingress.stories.tsx +1 -2
  672. package/src/typography/stories/label.stories.tsx +1 -2
  673. package/src/util/Slot.tsx +4 -4
  674. package/src/util/TextareaAutoSize.tsx +11 -7
  675. package/src/util/__tests__/Slot.test.tsx +11 -11
  676. package/src/util/__tests__/useMedia.test.tsx +1 -1
  677. package/src/util/composeEventHandlers.ts +19 -0
  678. package/src/util/hooks/index.ts +8 -0
  679. package/src/util/hooks/useCallbackRef.ts +20 -0
  680. package/src/util/hooks/useClientLayoutEffect.ts +5 -0
  681. package/src/util/hooks/useControllableState.ts +40 -0
  682. package/src/util/{useEventListener.ts → hooks/useEventListener.ts} +1 -1
  683. package/src/util/{useMedia.ts → hooks/useMedia.ts} +1 -1
  684. package/src/util/hooks/useMergeRefs.ts +32 -0
  685. package/src/util/{usePrevious.ts → hooks/usePrevious.ts} +1 -4
  686. package/src/util/index.ts +4 -5
  687. package/src/util/omit.ts +1 -1
  688. package/src/util/{OverridableComponent.ts → types/OverridableComponent.ts} +1 -1
  689. package/src/util/types/index.ts +1 -0
  690. package/cjs/util/RandomIcon.js +0 -38
  691. package/cjs/util/mergeRefs.js +0 -16
  692. package/cjs/util/useClientLayoutEffect.js +0 -10
  693. package/esm/util/AnimateHeight.js.map +0 -1
  694. package/esm/util/OverridableComponent.js.map +0 -1
  695. package/esm/util/RandomIcon.d.ts +0 -2
  696. package/esm/util/RandomIcon.js +0 -9
  697. package/esm/util/RandomIcon.js.map +0 -1
  698. package/esm/util/mergeRefs.d.ts +0 -2
  699. package/esm/util/mergeRefs.js +0 -14
  700. package/esm/util/mergeRefs.js.map +0 -1
  701. package/esm/util/useClientLayoutEffect.js +0 -8
  702. package/esm/util/useClientLayoutEffect.js.map +0 -1
  703. package/esm/util/useEventListener.js.map +0 -1
  704. package/esm/util/useId.js.map +0 -1
  705. package/esm/util/useMedia.js.map +0 -1
  706. package/esm/util/usePrevious.d.ts +0 -2
  707. package/esm/util/usePrevious.js.map +0 -1
  708. package/src/util/mergeRefs.tsx +0 -15
  709. package/src/util/useClientLayoutEffect.ts +0 -11
  710. package/cjs/{util → table}/AnimateHeight.js +0 -0
  711. package/cjs/util/{useEventListener.js → hooks/useEventListener.js} +0 -0
  712. package/cjs/util/{useId.js → hooks/useId.js} +0 -0
  713. package/cjs/util/{useMedia.js → hooks/useMedia.js} +0 -0
  714. package/cjs/util/{OverridableComponent.js → types/OverridableComponent.js} +0 -0
  715. package/esm/{util → table}/AnimateHeight.d.ts +0 -0
  716. package/esm/{util → table}/AnimateHeight.js +0 -0
  717. package/esm/util/{useClientLayoutEffect.d.ts → hooks/useClientLayoutEffect.d.ts} +0 -0
  718. package/esm/util/{useEventListener.js → hooks/useEventListener.js} +0 -0
  719. package/esm/util/{useId.d.ts → hooks/useId.d.ts} +0 -0
  720. package/esm/util/{useId.js → hooks/useId.js} +0 -0
  721. package/esm/util/{useMedia.d.ts → hooks/useMedia.d.ts} +0 -0
  722. package/esm/util/{useMedia.js → hooks/useMedia.js} +0 -0
  723. package/esm/util/{OverridableComponent.d.ts → types/OverridableComponent.d.ts} +0 -0
  724. package/esm/util/{OverridableComponent.js → types/OverridableComponent.js} +0 -0
  725. package/src/{util → link/stories}/RandomIcon.tsx +1 -1
  726. /package/src/util/{useId.ts → hooks/useId.ts} +0 -0
@@ -18,14 +18,14 @@ import React, {
18
18
  cloneElement,
19
19
  forwardRef,
20
20
  useContext,
21
- useMemo,
22
21
  useRef,
23
- useState,
24
22
  } from "react";
25
23
  import { ModalContext } from "../modal/ModalContext";
26
24
  import { useProvider } from "../provider";
27
25
  import { Detail } from "../typography";
28
- import { mergeRefs, useId } from "../util";
26
+ import { useId } from "../util/hooks";
27
+ import { useControllableState } from "../util/hooks/useControllableState";
28
+ import { useMergeRefs } from "../util/hooks/useMergeRefs";
29
29
 
30
30
  export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
31
31
  /**
@@ -43,6 +43,10 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
43
43
  * @note "open"-prop overwrites this
44
44
  */
45
45
  defaultOpen?: boolean;
46
+ /**
47
+ * Change handler for open
48
+ */
49
+ onOpenChange?: (open: boolean) => void;
46
50
  /**
47
51
  * Orientation for tooltip
48
52
  * @default "top"
@@ -98,8 +102,9 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
98
102
  className,
99
103
  arrow: _arrow = true,
100
104
  placement: _placement = "top",
101
- open: userOpen,
105
+ open,
102
106
  defaultOpen = false,
107
+ onOpenChange,
103
108
  offset: _offset,
104
109
  content,
105
110
  delay = 150,
@@ -108,9 +113,14 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
108
113
  maxChar = 80,
109
114
  ...rest
110
115
  },
111
- ref
116
+ ref,
112
117
  ) => {
113
- const [open, setOpen] = useState(defaultOpen);
118
+ const [_open, _setOpen] = useControllableState({
119
+ defaultValue: defaultOpen,
120
+ value: open,
121
+ onChange: onOpenChange,
122
+ });
123
+
114
124
  const arrowRef = useRef<HTMLDivElement | null>(null);
115
125
  const modalContext = useContext(ModalContext);
116
126
  const providerRootElement = useProvider()?.rootElement;
@@ -131,8 +141,8 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
131
141
  refs,
132
142
  } = useFloating({
133
143
  placement: _placement,
134
- open: userOpen ?? open,
135
- onOpenChange: (_open) => setOpen(_open),
144
+ open: _open,
145
+ onOpenChange: (newState) => _setOpen(newState),
136
146
  middleware: [
137
147
  offset(_offset ? _offset : _arrow ? 10 : 2),
138
148
  shift(),
@@ -156,14 +166,8 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
156
166
 
157
167
  const ariaId = useId(id);
158
168
 
159
- const mergedRef = useMemo(
160
- () => mergeRefs([ref, refs.setFloating]),
161
- [refs.setFloating, ref]
162
- );
163
- const childMergedRef = useMemo(
164
- () => mergeRefs([(children as any).ref, refs.setReference]),
165
- [children, refs.setReference]
166
- );
169
+ const mergedRef = useMergeRefs(ref, refs.setFloating);
170
+ const childMergedRef = useMergeRefs(children.ref, refs.setReference);
167
171
 
168
172
  if (
169
173
  !children ||
@@ -171,15 +175,15 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
171
175
  (children as any) === React.Fragment
172
176
  ) {
173
177
  console.error(
174
- "<Tooltip> children needs to be a single ReactElement and not: <React.Fragment/> | <></>"
178
+ "<Tooltip> children needs to be a single ReactElement and not: <React.Fragment/> | <></>",
175
179
  );
176
180
  return null;
177
181
  }
178
182
 
179
183
  if (content?.length > maxChar) {
180
- (userOpen ?? open) &&
184
+ _open &&
181
185
  console.warn(
182
- `Because of strict accessibility concers we encourage all Tooltips to have less than 80 characters. Can be overwritten with the maxChar-prop\n\nLength:${content.length}\nTooltip-content: ${content}`
186
+ `Because of strict accessibility concers we encourage all Tooltips to have less than 80 characters. Can be overwritten with the maxChar-prop\n\nLength:${content.length}\nTooltip-content: ${content}`,
183
187
  );
184
188
  }
185
189
 
@@ -190,14 +194,13 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
190
194
  getReferenceProps({
191
195
  ...children.props,
192
196
  ref: childMergedRef,
193
- "aria-describedby":
194
- userOpen ?? open
195
- ? cl(ariaId, children?.props["aria-describedby"])
196
- : children?.props["aria-describedby"],
197
- })
197
+ "aria-describedby": _open
198
+ ? cl(ariaId, children?.props["aria-describedby"])
199
+ : children?.props["aria-describedby"],
200
+ }),
198
201
  )}
199
202
  <FloatingPortal root={rootElement}>
200
- {(userOpen ?? open) && (
203
+ {_open && (
201
204
  <div
202
205
  {...getFloatingProps({
203
206
  ...rest,
@@ -213,7 +216,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
213
216
  className: cl(
214
217
  "navds-tooltip",
215
218
  "navds-detail navds-detail--small",
216
- className
219
+ className,
217
220
  ),
218
221
  })}
219
222
  data-side={placement}
@@ -222,12 +225,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
222
225
  {keys && (
223
226
  <span className="navds-tooltip__keys">
224
227
  {keys.map((key) => (
225
- <Detail
226
- size="small"
227
- as="kbd"
228
- key={key}
229
- className="navds-tooltip__key"
230
- >
228
+ <Detail as="kbd" key={key} className="navds-tooltip__key">
231
229
  {key}
232
230
  </Detail>
233
231
  ))}
@@ -258,7 +256,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
258
256
  </FloatingPortal>
259
257
  </>
260
258
  );
261
- }
259
+ },
262
260
  );
263
261
 
264
262
  export default Tooltip;
@@ -1,6 +1,6 @@
1
1
  import { Meta } from "@storybook/react";
2
2
  import React from "react";
3
- import { Tooltip, Alert, Button, Search } from "..";
3
+ import { Alert, Button, Search, Tooltip } from "..";
4
4
 
5
5
  export default {
6
6
  title: "ds-react/Tooltip",
@@ -1,6 +1,6 @@
1
- import React, { forwardRef } from "react";
2
1
  import cl from "clsx";
3
- import { OverridableComponent } from "../util/OverridableComponent";
2
+ import React, { forwardRef } from "react";
3
+ import { OverridableComponent } from "../util/types";
4
4
  import { TypoProps } from "./types";
5
5
  import { typoClassNames } from "./util";
6
6
 
@@ -51,7 +51,7 @@ export const BodyLong: OverridableComponent<
51
51
  textColor,
52
52
  ...rest
53
53
  },
54
- ref
54
+ ref,
55
55
  ) => (
56
56
  <Component
57
57
  {...rest}
@@ -67,10 +67,10 @@ export const BodyLong: OverridableComponent<
67
67
  align,
68
68
  visuallyHidden,
69
69
  textColor,
70
- })
70
+ }),
71
71
  )}
72
72
  />
73
- )
73
+ ),
74
74
  );
75
75
 
76
76
  export default BodyLong;
@@ -1,6 +1,6 @@
1
1
  import cl from "clsx";
2
2
  import React, { forwardRef } from "react";
3
- import { OverridableComponent } from "../util/OverridableComponent";
3
+ import { OverridableComponent } from "../util/types";
4
4
  import { TypoProps } from "./types";
5
5
  import { typoClassNames } from "./util";
6
6
 
@@ -49,7 +49,7 @@ export const BodyShort: OverridableComponent<
49
49
  textColor,
50
50
  ...rest
51
51
  },
52
- ref
52
+ ref,
53
53
  ) => (
54
54
  <Component
55
55
  {...rest}
@@ -65,10 +65,10 @@ export const BodyShort: OverridableComponent<
65
65
  align,
66
66
  visuallyHidden,
67
67
  textColor,
68
- })
68
+ }),
69
69
  )}
70
70
  />
71
- )
71
+ ),
72
72
  );
73
73
 
74
74
  export default BodyShort;
@@ -1,6 +1,6 @@
1
1
  import cl from "clsx";
2
2
  import React, { forwardRef } from "react";
3
- import { OverridableComponent } from "../util/OverridableComponent";
3
+ import { OverridableComponent } from "../util/types";
4
4
  import { TypoProps } from "./types";
5
5
  import { typoClassNames } from "./util";
6
6
 
@@ -51,7 +51,7 @@ export const Detail: OverridableComponent<DetailProps, HTMLParagraphElement> =
51
51
  textColor,
52
52
  ...rest
53
53
  },
54
- ref
54
+ ref,
55
55
  ) => (
56
56
  <Component
57
57
  {...rest}
@@ -70,10 +70,10 @@ export const Detail: OverridableComponent<DetailProps, HTMLParagraphElement> =
70
70
  }),
71
71
  {
72
72
  "navds-detail--small": size === "small",
73
- }
73
+ },
74
74
  )}
75
75
  />
76
- )
76
+ ),
77
77
  );
78
78
 
79
79
  export default Detail;
@@ -1,6 +1,6 @@
1
- import React, { forwardRef } from "react";
2
1
  import cl from "clsx";
3
- import { OverridableComponent } from "../util/OverridableComponent";
2
+ import React, { forwardRef } from "react";
3
+ import { OverridableComponent } from "../util/types";
4
4
  import { TypoProps } from "./types";
5
5
  import { typoClassNames } from "./util";
6
6
 
@@ -49,10 +49,10 @@ export const ErrorMessage: OverridableComponent<
49
49
  }),
50
50
  {
51
51
  "navds-label--small": size === "small",
52
- }
52
+ },
53
53
  )}
54
54
  />
55
- )
55
+ ),
56
56
  );
57
57
 
58
58
  export default ErrorMessage;
@@ -1,6 +1,6 @@
1
1
  import cl from "clsx";
2
2
  import React, { forwardRef } from "react";
3
- import { OverridableComponent } from "../util/OverridableComponent";
3
+ import { OverridableComponent } from "../util/types";
4
4
  import { TypoProps } from "./types";
5
5
  import { typoClassNames } from "./util";
6
6
 
@@ -50,7 +50,7 @@ export const Heading: OverridableComponent<HeadingProps, HTMLHeadingElement> =
50
50
  textColor,
51
51
  ...rest
52
52
  },
53
- ref
53
+ ref,
54
54
  ) => {
55
55
  const HeadingTag = as ?? (`h${level}` as React.ElementType);
56
56
 
@@ -67,11 +67,11 @@ export const Heading: OverridableComponent<HeadingProps, HTMLHeadingElement> =
67
67
  align,
68
68
  visuallyHidden,
69
69
  textColor,
70
- })
70
+ }),
71
71
  )}
72
72
  />
73
73
  );
74
- }
74
+ },
75
75
  );
76
76
 
77
77
  export default Heading;
@@ -1,6 +1,6 @@
1
- import React, { forwardRef } from "react";
2
1
  import cl from "clsx";
3
- import { OverridableComponent } from "../util/OverridableComponent";
2
+ import React, { forwardRef } from "react";
3
+ import { OverridableComponent } from "../util/types";
4
4
 
5
5
  export interface IngressProps
6
6
  extends React.HTMLAttributes<HTMLParagraphElement> {
@@ -1,6 +1,6 @@
1
1
  import cl from "clsx";
2
2
  import React, { forwardRef } from "react";
3
- import { OverridableComponent } from "../util/OverridableComponent";
3
+ import { OverridableComponent } from "../util/types";
4
4
  import { TypoProps } from "./types";
5
5
  import { typoClassNames } from "./util";
6
6
 
@@ -44,7 +44,7 @@ export const Label: OverridableComponent<LabelProps, HTMLLabelElement> =
44
44
  textColor,
45
45
  ...rest
46
46
  },
47
- ref
47
+ ref,
48
48
  ) => (
49
49
  <Component
50
50
  {...rest}
@@ -59,10 +59,10 @@ export const Label: OverridableComponent<LabelProps, HTMLLabelElement> =
59
59
  }),
60
60
  {
61
61
  "navds-label--small": size === "small",
62
- }
62
+ },
63
63
  )}
64
64
  />
65
- )
65
+ ),
66
66
  );
67
67
 
68
68
  export default Label;
@@ -1,6 +1,5 @@
1
- import { expect } from "@storybook/jest";
2
1
  import type { Meta, StoryObj } from "@storybook/react";
3
- import { within } from "@storybook/testing-library";
2
+ import { expect, within } from "@storybook/test";
4
3
  import React from "react";
5
4
  import { BodyLong } from "..";
6
5
  import { VStack } from "../..";
@@ -1,6 +1,5 @@
1
- import { expect } from "@storybook/jest";
2
1
  import type { Meta, StoryObj } from "@storybook/react";
3
- import { within } from "@storybook/testing-library";
2
+ import { expect, within } from "@storybook/test";
4
3
  import React from "react";
5
4
  import { BodyShort } from "..";
6
5
  import { VStack } from "../..";
@@ -1,6 +1,5 @@
1
- import { expect } from "@storybook/jest";
2
1
  import type { Meta, StoryObj } from "@storybook/react";
3
- import { within } from "@storybook/testing-library";
2
+ import { expect, within } from "@storybook/test";
4
3
  import React from "react";
5
4
  import { Detail } from "..";
6
5
  import { VStack } from "../..";
@@ -1,6 +1,5 @@
1
- import { expect } from "@storybook/jest";
2
1
  import type { Meta, StoryObj } from "@storybook/react";
3
- import { within } from "@storybook/testing-library";
2
+ import { expect, within } from "@storybook/test";
4
3
  import React from "react";
5
4
  import { ErrorMessage } from "..";
6
5
  import { VStack } from "../..";
@@ -1,7 +1,5 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react";
2
-
3
- import { expect } from "@storybook/jest";
4
- import { within } from "@storybook/testing-library";
2
+ import { expect, within } from "@storybook/test";
5
3
  import { default as React } from "react";
6
4
  import { Heading } from "..";
7
5
  import { VStack } from "../..";
@@ -1,6 +1,5 @@
1
- import { expect } from "@storybook/jest";
2
1
  import type { Meta, StoryObj } from "@storybook/react";
3
- import { within } from "@storybook/testing-library";
2
+ import { expect, within } from "@storybook/test";
4
3
  import React from "react";
5
4
  import { Ingress } from "..";
6
5
 
@@ -1,6 +1,5 @@
1
- import { expect } from "@storybook/jest";
2
1
  import type { Meta, StoryObj } from "@storybook/react";
3
- import { within } from "@storybook/testing-library";
2
+ import { expect, within } from "@storybook/test";
4
3
  import React from "react";
5
4
  import { Label } from "..";
6
5
  import { VStack } from "../..";
package/src/util/Slot.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  // https://github.com/radix-ui/primitives/blob/main/packages/react/slot/src/Slot.tsx
2
2
  import * as React from "react";
3
- import mergeRefs from "./mergeRefs";
3
+ import { mergeRefs } from "./hooks/useMergeRefs";
4
4
 
5
5
  interface SlotProps extends React.HTMLAttributes<HTMLElement> {
6
6
  children?: React.ReactNode;
@@ -21,18 +21,18 @@ export const Slot = React.forwardRef<HTMLElement, SlotProps>(
21
21
 
22
22
  if (React.Children.count(children) > 1) {
23
23
  console.error(
24
- "Aksel: Components using 'asChild' expects to recieve a single React element child."
24
+ "Aksel: Components using 'asChild' expects to recieve a single React element child.",
25
25
  );
26
26
  return React.Children.only(null);
27
27
  }
28
28
 
29
29
  return null;
30
- }
30
+ },
31
31
  );
32
32
 
33
33
  function mergeProps(
34
34
  slotProps: Record<string, any>,
35
- childProps: Record<string, any>
35
+ childProps: Record<string, any>,
36
36
  ) {
37
37
  // all child props should override
38
38
  const overrideProps = { ...childProps };
@@ -1,7 +1,9 @@
1
1
  /* https://github.com/mui/material-ui/blob/master/packages/mui-base/src/TextareaAutosize/TextareaAutosize.tsx */
2
- import React, { forwardRef, useEffect, useMemo, useRef, useState } from "react";
2
+ import React, { forwardRef, useEffect, useRef, useState } from "react";
3
3
  import ReactDOM from "react-dom";
4
- import { debounce, mergeRefs, useClientLayoutEffect } from "../util";
4
+ import { useClientLayoutEffect } from "../util/hooks";
5
+ import debounce from "./debounce";
6
+ import { useMergeRefs } from "./hooks/useMergeRefs";
5
7
 
6
8
  type State = {
7
9
  outerHeightStyle: number;
@@ -11,7 +13,7 @@ type State = {
11
13
  const updateState = (
12
14
  prevState: State,
13
15
  newState: State,
14
- renders: React.MutableRefObject<number>
16
+ renders: React.MutableRefObject<number>,
15
17
  ) => {
16
18
  const { outerHeightStyle, overflow } = newState;
17
19
  // Need a large enough difference to update the height.
@@ -34,7 +36,7 @@ const updateState = (
34
36
  [
35
37
  "Textarea: Too many re-renders. The layout is unstable.",
36
38
  "TextareaAutosize limits the number of renders to prevent an infinite loop.",
37
- ].join("\n")
39
+ ].join("\n"),
38
40
  );
39
41
  }
40
42
  }
@@ -86,11 +88,13 @@ const TextareaAutosize = forwardRef<HTMLTextAreaElement, TextareaAutosizeProps>(
86
88
  value,
87
89
  ...other
88
90
  }: TextareaAutosizeProps,
89
- ref
91
+ ref,
90
92
  ) => {
91
93
  const { current: isControlled } = useRef(value != null);
92
94
  const inputRef = useRef<HTMLTextAreaElement>(null);
93
- const handleRef = useMemo(() => mergeRefs([inputRef, ref]), [ref]);
95
+
96
+ const handleRef = useMergeRefs(inputRef, ref);
97
+
94
98
  const shadowRef = useRef<HTMLTextAreaElement>(null);
95
99
  const renders = useRef(0);
96
100
  const [state, setState] = useState<State>({ outerHeightStyle: 0 });
@@ -281,7 +285,7 @@ const TextareaAutosize = forwardRef<HTMLTextAreaElement, TextareaAutosizeProps>(
281
285
  />
282
286
  </>
283
287
  );
284
- }
288
+ },
285
289
  );
286
290
 
287
291
  function isEmpty(obj: State) {
@@ -1,4 +1,4 @@
1
- import { render, screen, fireEvent } from "@testing-library/react";
1
+ import { fireEvent, render, screen } from "@testing-library/react";
2
2
  import React from "react";
3
3
  import { Button } from "../../button";
4
4
  import { Slot } from "../Slot";
@@ -10,7 +10,7 @@ describe("Slot", () => {
10
10
  render(
11
11
  <Slot onClick={handleClick}>
12
12
  <Button>Button</Button>
13
- </Slot>
13
+ </Slot>,
14
14
  );
15
15
  fireEvent.click(screen.getByRole("button"));
16
16
  expect(handleClick).toHaveBeenCalledTimes(1);
@@ -21,7 +21,7 @@ describe("Slot", () => {
21
21
  render(
22
22
  <Slot>
23
23
  <Button onClick={handleClick}>Button</Button>
24
- </Slot>
24
+ </Slot>,
25
25
  );
26
26
  fireEvent.click(screen.getByRole("button"));
27
27
  expect(handleClick).toHaveBeenCalledTimes(1);
@@ -33,7 +33,7 @@ describe("Slot", () => {
33
33
  render(
34
34
  <Slot onClick={handleClickSlot}>
35
35
  <Button onClick={handleClick}>Button</Button>
36
- </Slot>
36
+ </Slot>,
37
37
  );
38
38
  fireEvent.click(screen.getByRole("button"));
39
39
  expect(handleClickSlot).toHaveBeenCalledTimes(1);
@@ -45,7 +45,7 @@ describe("Slot", () => {
45
45
  render(
46
46
  <Slot onClick={undefined}>
47
47
  <Button onClick={handleClick}>Button</Button>
48
- </Slot>
48
+ </Slot>,
49
49
  );
50
50
  fireEvent.click(screen.getByRole("button"));
51
51
  expect(handleClick).toHaveBeenCalledTimes(1);
@@ -56,7 +56,7 @@ describe("Slot", () => {
56
56
  render(
57
57
  <Slot onClick={handleClick}>
58
58
  <Button onClick={undefined}>Button</Button>
59
- </Slot>
59
+ </Slot>,
60
60
  );
61
61
  fireEvent.click(screen.getByRole("button"));
62
62
  expect(handleClick).toHaveBeenCalledTimes(1);
@@ -68,10 +68,10 @@ describe("Slot", () => {
68
68
  render(
69
69
  <Slot className="class1">
70
70
  <button className="class2 class2--inline">Button</button>
71
- </Slot>
71
+ </Slot>,
72
72
  );
73
73
  expect(screen.getByRole("button").className).toEqual(
74
- "class1 class2 class2--inline"
74
+ "class1 class2 class2--inline",
75
75
  );
76
76
  });
77
77
 
@@ -79,10 +79,10 @@ describe("Slot", () => {
79
79
  render(
80
80
  <Slot className={undefined}>
81
81
  <button className="class2 class2--inline">Button</button>
82
- </Slot>
82
+ </Slot>,
83
83
  );
84
84
  expect(screen.getByRole("button").className).toEqual(
85
- "class2 class2--inline"
85
+ "class2 class2--inline",
86
86
  );
87
87
  });
88
88
 
@@ -90,7 +90,7 @@ describe("Slot", () => {
90
90
  render(
91
91
  <Slot className="class1">
92
92
  <button className={undefined}>Button</button>
93
- </Slot>
93
+ </Slot>,
94
94
  );
95
95
  expect(screen.getByRole("button").className).toEqual("class1");
96
96
  });
@@ -1,6 +1,6 @@
1
1
  import { render, screen } from "@testing-library/react";
2
2
  import React from "react";
3
- import { useMedia } from "../useMedia";
3
+ import { useMedia } from "../hooks";
4
4
 
5
5
  function TestComponent({ fallback }: { fallback?: boolean }) {
6
6
  const media = useMedia("screen and (min-width: 1024px)", fallback);
@@ -0,0 +1,19 @@
1
+ /* https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx#L1 */
2
+
3
+ /**
4
+ * Utility to consistently call original eventhandler, often from props and internal eventhandler
5
+ * @internal
6
+ */
7
+ export function composeEventHandlers<T extends React.SyntheticEvent>(
8
+ originalEventHandler?: (event: T) => void,
9
+ ourEventHandler?: (event: T) => void,
10
+ { checkForDefaultPrevented = true } = {},
11
+ ) {
12
+ return function handleEvent(event: T) {
13
+ originalEventHandler?.(event);
14
+
15
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
16
+ return ourEventHandler?.(event);
17
+ }
18
+ };
19
+ }
@@ -0,0 +1,8 @@
1
+ export { useCallbackRef } from "./useCallbackRef";
2
+ export { useClientLayoutEffect } from "./useClientLayoutEffect";
3
+ export { useControllableState } from "./useControllableState";
4
+ export { useMergeRefs } from "./useMergeRefs";
5
+ export { useEventListener } from "./useEventListener";
6
+ export { useId } from "./useId";
7
+ export { useMedia } from "./useMedia";
8
+ export { usePrevious } from "./usePrevious";
@@ -0,0 +1,20 @@
1
+ import { useCallback, useEffect, useRef } from "react";
2
+
3
+ /**
4
+ * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
5
+ * prop or avoid re-executing effects when passed as a dependency
6
+ * https://github.com/radix-ui/primitives/blob/main/packages/react/use-callback-ref/src/useCallbackRef.tsx
7
+ */
8
+ export function useCallbackRef<T extends (...args: any[]) => any>(
9
+ callback: T | undefined,
10
+ deps: React.DependencyList = [],
11
+ ) {
12
+ const callbackRef = useRef(callback);
13
+
14
+ useEffect(() => {
15
+ callbackRef.current = callback;
16
+ });
17
+
18
+ // eslint-disable-next-line react-hooks/exhaustive-deps
19
+ return useCallback(((...args) => callbackRef.current?.(...args)) as T, deps);
20
+ }
@@ -0,0 +1,5 @@
1
+ import { useLayoutEffect } from "react";
2
+
3
+ export const useClientLayoutEffect = globalThis?.document
4
+ ? useLayoutEffect
5
+ : () => {};