@navikt/ds-react 6.7.0 → 6.8.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 (318) hide show
  1. package/cjs/chat/Chat.d.ts +2 -1
  2. package/cjs/chat/Chat.js +2 -1
  3. package/cjs/chat/Chat.js.map +1 -1
  4. package/cjs/collapsible/parts/Collapsible.Trigger.d.ts +4 -0
  5. package/cjs/collapsible/parts/Collapsible.Trigger.js +1 -1
  6. package/cjs/collapsible/parts/Collapsible.Trigger.js.map +1 -1
  7. package/cjs/date/datepicker/parts/DropdownCaption.js +1 -1
  8. package/cjs/date/datepicker/parts/DropdownCaption.js.map +1 -1
  9. package/cjs/date/monthpicker/MonthCaption.js +1 -1
  10. package/cjs/date/utils/labels.d.ts +2 -2
  11. package/cjs/form/ReadOnlyIcon.d.ts +2 -2
  12. package/cjs/form/combobox/Combobox.js +7 -22
  13. package/cjs/form/combobox/Combobox.js.map +1 -1
  14. package/cjs/form/combobox/ComboboxProvider.js +2 -2
  15. package/cjs/form/combobox/ComboboxProvider.js.map +1 -1
  16. package/cjs/form/combobox/ComboboxWrapper.d.ts +1 -2
  17. package/cjs/form/combobox/ComboboxWrapper.js +4 -2
  18. package/cjs/form/combobox/ComboboxWrapper.js.map +1 -1
  19. package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +4 -4
  20. package/cjs/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
  21. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.d.ts +4 -4
  22. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +13 -15
  23. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  24. package/cjs/form/combobox/Input/{inputContext.d.ts → Input.context.d.ts} +7 -5
  25. package/cjs/form/combobox/Input/{inputContext.js → Input.context.js} +22 -22
  26. package/cjs/form/combobox/Input/Input.context.js.map +1 -0
  27. package/cjs/form/combobox/Input/Input.js +2 -2
  28. package/cjs/form/combobox/Input/Input.js.map +1 -1
  29. package/cjs/form/combobox/Input/InputController.d.ts +3 -0
  30. package/cjs/form/combobox/Input/InputController.js +70 -0
  31. package/cjs/form/combobox/Input/InputController.js.map +1 -0
  32. package/cjs/form/combobox/{ToggleListButton.js → Input/ToggleListButton.js} +1 -1
  33. package/cjs/form/combobox/Input/ToggleListButton.js.map +1 -0
  34. package/cjs/form/combobox/SelectedOptions/SelectedOptions.js +2 -2
  35. package/cjs/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
  36. package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +4 -4
  37. package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +7 -13
  38. package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
  39. package/cjs/form/combobox/customOptionsContext.d.ts +4 -4
  40. package/cjs/form/combobox/customOptionsContext.js +10 -13
  41. package/cjs/form/combobox/customOptionsContext.js.map +1 -1
  42. package/cjs/form/combobox/types.d.ts +1 -1
  43. package/cjs/form/file-upload/FileUpload.context.d.ts +1 -1
  44. package/cjs/form/file-upload/FileUpload.d.ts +1 -1
  45. package/cjs/form/file-upload/FileUpload.js.map +1 -1
  46. package/cjs/form/file-upload/parts/dropzone/Dropzone.js +1 -1
  47. package/cjs/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
  48. package/cjs/form/file-upload/parts/dropzone/dropzone.types.d.ts +1 -1
  49. package/cjs/form/file-upload/parts/item/Item.d.ts +1 -1
  50. package/cjs/form/file-upload/parts/item/Item.js +1 -1
  51. package/cjs/form/file-upload/parts/item/Item.js.map +1 -1
  52. package/cjs/form/form-progress/FormProgress.d.ts +66 -0
  53. package/cjs/form/form-progress/FormProgress.js +85 -0
  54. package/cjs/form/form-progress/FormProgress.js.map +1 -0
  55. package/cjs/form/form-progress/index.d.ts +1 -0
  56. package/cjs/form/form-progress/index.js +11 -0
  57. package/cjs/form/form-progress/index.js.map +1 -0
  58. package/cjs/help-text/HelpTextIcon.d.ts +1 -1
  59. package/cjs/index.d.ts +1 -0
  60. package/cjs/index.js +3 -1
  61. package/cjs/index.js.map +1 -1
  62. package/cjs/overlay/dismiss/DismissableLayer.d.ts +70 -0
  63. package/cjs/overlay/dismiss/DismissableLayer.js +253 -0
  64. package/cjs/overlay/dismiss/DismissableLayer.js.map +1 -0
  65. package/cjs/overlay/dismiss/util/dispatchCustomEvent.d.ts +50 -0
  66. package/cjs/overlay/dismiss/util/dispatchCustomEvent.js +65 -0
  67. package/cjs/overlay/dismiss/util/dispatchCustomEvent.js.map +1 -0
  68. package/cjs/overlay/dismiss/util/useEscapeKeydown.d.ts +1 -0
  69. package/cjs/overlay/dismiss/util/useEscapeKeydown.js +19 -0
  70. package/cjs/overlay/dismiss/util/useEscapeKeydown.js.map +1 -0
  71. package/cjs/overlay/dismiss/util/useFocusOutside.d.ts +8 -0
  72. package/cjs/overlay/dismiss/util/useFocusOutside.js +42 -0
  73. package/cjs/overlay/dismiss/util/useFocusOutside.js.map +1 -0
  74. package/cjs/overlay/dismiss/util/usePointerDownOutside.d.ts +10 -0
  75. package/cjs/overlay/dismiss/util/usePointerDownOutside.js +84 -0
  76. package/cjs/overlay/dismiss/util/usePointerDownOutside.js.map +1 -0
  77. package/cjs/overlays/floating/Floating.d.ts +53 -0
  78. package/cjs/overlays/floating/Floating.js +215 -0
  79. package/cjs/overlays/floating/Floating.js.map +1 -0
  80. package/cjs/overlays/floating/Floating.utils.d.ts +18 -0
  81. package/cjs/overlays/floating/Floating.utils.js +52 -0
  82. package/cjs/overlays/floating/Floating.utils.js.map +1 -0
  83. package/cjs/popover/Popover.js +13 -28
  84. package/cjs/popover/Popover.js.map +1 -1
  85. package/cjs/progress-bar/ProgressBar.d.ts +20 -8
  86. package/cjs/progress-bar/ProgressBar.js +19 -9
  87. package/cjs/progress-bar/ProgressBar.js.map +1 -1
  88. package/cjs/stepper/Step.js +1 -1
  89. package/cjs/stepper/Step.js.map +1 -1
  90. package/cjs/stepper/Stepper.d.ts +1 -1
  91. package/cjs/stepper/Stepper.js +1 -1
  92. package/cjs/tabs/Tabs.context.d.ts +7 -3
  93. package/cjs/tabs/Tabs.context.js +1 -0
  94. package/cjs/tabs/Tabs.context.js.map +1 -1
  95. package/cjs/timeline/AxisLabels.d.ts +1 -1
  96. package/cjs/toggle-group/ToggleGroup.context.d.ts +7 -3
  97. package/cjs/toggle-group/ToggleGroup.context.js +1 -0
  98. package/cjs/toggle-group/ToggleGroup.context.js.map +1 -1
  99. package/cjs/util/hooks/descendants/useDescendant.d.ts +2 -2
  100. package/cjs/util/hooks/descendants/useDescendant.js +49 -52
  101. package/cjs/util/hooks/descendants/useDescendant.js.map +1 -1
  102. package/cjs/util/i18n/get.js.map +1 -0
  103. package/cjs/util/i18n/i18n.context.js.map +1 -0
  104. package/cjs/util/i18n/i18n.types.js.map +1 -0
  105. package/{esm/form/file-upload → cjs/util}/i18n/locales/nb.d.ts +5 -0
  106. package/cjs/{form/file-upload → util}/i18n/locales/nb.js +5 -0
  107. package/cjs/util/i18n/locales/nb.js.map +1 -0
  108. package/cjs/util/i18n/merge.js.map +1 -0
  109. package/cjs/util/types/AsChild.d.ts +14 -0
  110. package/cjs/util/types/AsChild.js +3 -0
  111. package/cjs/util/types/AsChild.js.map +1 -0
  112. package/esm/chat/Chat.d.ts +2 -1
  113. package/esm/chat/Chat.js +1 -0
  114. package/esm/chat/Chat.js.map +1 -1
  115. package/esm/collapsible/parts/Collapsible.Trigger.d.ts +4 -0
  116. package/esm/collapsible/parts/Collapsible.Trigger.js +1 -1
  117. package/esm/collapsible/parts/Collapsible.Trigger.js.map +1 -1
  118. package/esm/date/datepicker/parts/DropdownCaption.js +1 -1
  119. package/esm/date/datepicker/parts/DropdownCaption.js.map +1 -1
  120. package/esm/date/monthpicker/MonthCaption.js +1 -1
  121. package/esm/date/utils/labels.d.ts +2 -2
  122. package/esm/form/ReadOnlyIcon.d.ts +2 -2
  123. package/esm/form/combobox/Combobox.js +8 -23
  124. package/esm/form/combobox/Combobox.js.map +1 -1
  125. package/esm/form/combobox/ComboboxProvider.js +1 -1
  126. package/esm/form/combobox/ComboboxProvider.js.map +1 -1
  127. package/esm/form/combobox/ComboboxWrapper.d.ts +1 -2
  128. package/esm/form/combobox/ComboboxWrapper.js +4 -2
  129. package/esm/form/combobox/ComboboxWrapper.js.map +1 -1
  130. package/esm/form/combobox/FilteredOptions/FilteredOptions.js +3 -3
  131. package/esm/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
  132. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.d.ts +4 -4
  133. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +15 -16
  134. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  135. package/esm/form/combobox/Input/{inputContext.d.ts → Input.context.d.ts} +7 -5
  136. package/esm/form/combobox/Input/{inputContext.js → Input.context.js} +22 -21
  137. package/esm/form/combobox/Input/Input.context.js.map +1 -0
  138. package/esm/form/combobox/Input/Input.js +1 -1
  139. package/esm/form/combobox/Input/Input.js.map +1 -1
  140. package/esm/form/combobox/Input/InputController.d.ts +3 -0
  141. package/esm/form/combobox/Input/InputController.js +41 -0
  142. package/esm/form/combobox/Input/InputController.js.map +1 -0
  143. package/esm/form/combobox/{ToggleListButton.js → Input/ToggleListButton.js} +1 -1
  144. package/esm/form/combobox/Input/ToggleListButton.js.map +1 -0
  145. package/esm/form/combobox/SelectedOptions/SelectedOptions.js +1 -1
  146. package/esm/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
  147. package/esm/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +4 -4
  148. package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js +9 -14
  149. package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
  150. package/esm/form/combobox/customOptionsContext.d.ts +4 -4
  151. package/esm/form/combobox/customOptionsContext.js +10 -12
  152. package/esm/form/combobox/customOptionsContext.js.map +1 -1
  153. package/esm/form/combobox/types.d.ts +1 -1
  154. package/esm/form/file-upload/FileUpload.context.d.ts +1 -1
  155. package/esm/form/file-upload/FileUpload.d.ts +1 -1
  156. package/esm/form/file-upload/FileUpload.js.map +1 -1
  157. package/esm/form/file-upload/parts/dropzone/Dropzone.js +1 -1
  158. package/esm/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
  159. package/esm/form/file-upload/parts/dropzone/dropzone.types.d.ts +1 -1
  160. package/esm/form/file-upload/parts/item/Item.d.ts +1 -1
  161. package/esm/form/file-upload/parts/item/Item.js +1 -1
  162. package/esm/form/file-upload/parts/item/Item.js.map +1 -1
  163. package/esm/form/form-progress/FormProgress.d.ts +66 -0
  164. package/esm/form/form-progress/FormProgress.js +56 -0
  165. package/esm/form/form-progress/FormProgress.js.map +1 -0
  166. package/esm/form/form-progress/index.d.ts +1 -0
  167. package/esm/form/form-progress/index.js +3 -0
  168. package/esm/form/form-progress/index.js.map +1 -0
  169. package/esm/help-text/HelpTextIcon.d.ts +1 -1
  170. package/esm/index.d.ts +1 -0
  171. package/esm/index.js +1 -0
  172. package/esm/index.js.map +1 -1
  173. package/esm/overlay/dismiss/DismissableLayer.d.ts +70 -0
  174. package/esm/overlay/dismiss/DismissableLayer.js +226 -0
  175. package/esm/overlay/dismiss/DismissableLayer.js.map +1 -0
  176. package/esm/overlay/dismiss/util/dispatchCustomEvent.d.ts +50 -0
  177. package/esm/overlay/dismiss/util/dispatchCustomEvent.js +58 -0
  178. package/esm/overlay/dismiss/util/dispatchCustomEvent.js.map +1 -0
  179. package/esm/overlay/dismiss/util/useEscapeKeydown.d.ts +1 -0
  180. package/esm/overlay/dismiss/util/useEscapeKeydown.js +15 -0
  181. package/esm/overlay/dismiss/util/useEscapeKeydown.js.map +1 -0
  182. package/esm/overlay/dismiss/util/useFocusOutside.d.ts +8 -0
  183. package/esm/overlay/dismiss/util/useFocusOutside.js +38 -0
  184. package/esm/overlay/dismiss/util/useFocusOutside.js.map +1 -0
  185. package/esm/overlay/dismiss/util/usePointerDownOutside.d.ts +10 -0
  186. package/esm/overlay/dismiss/util/usePointerDownOutside.js +80 -0
  187. package/esm/overlay/dismiss/util/usePointerDownOutside.js.map +1 -0
  188. package/esm/overlays/floating/Floating.d.ts +53 -0
  189. package/esm/overlays/floating/Floating.js +188 -0
  190. package/esm/overlays/floating/Floating.js.map +1 -0
  191. package/esm/overlays/floating/Floating.utils.d.ts +18 -0
  192. package/esm/overlays/floating/Floating.utils.js +48 -0
  193. package/esm/overlays/floating/Floating.utils.js.map +1 -0
  194. package/esm/popover/Popover.js +16 -31
  195. package/esm/popover/Popover.js.map +1 -1
  196. package/esm/progress-bar/ProgressBar.d.ts +20 -8
  197. package/esm/progress-bar/ProgressBar.js +20 -10
  198. package/esm/progress-bar/ProgressBar.js.map +1 -1
  199. package/esm/stepper/Step.js +1 -1
  200. package/esm/stepper/Step.js.map +1 -1
  201. package/esm/stepper/Stepper.d.ts +1 -1
  202. package/esm/stepper/Stepper.js +1 -1
  203. package/esm/tabs/Tabs.context.d.ts +7 -3
  204. package/esm/tabs/Tabs.context.js +1 -0
  205. package/esm/tabs/Tabs.context.js.map +1 -1
  206. package/esm/timeline/AxisLabels.d.ts +1 -1
  207. package/esm/toggle-group/ToggleGroup.context.d.ts +7 -3
  208. package/esm/toggle-group/ToggleGroup.context.js +1 -0
  209. package/esm/toggle-group/ToggleGroup.context.js.map +1 -1
  210. package/esm/util/hooks/descendants/useDescendant.d.ts +2 -2
  211. package/esm/util/hooks/descendants/useDescendant.js +49 -52
  212. package/esm/util/hooks/descendants/useDescendant.js.map +1 -1
  213. package/esm/util/i18n/get.js.map +1 -0
  214. package/esm/util/i18n/i18n.context.js.map +1 -0
  215. package/esm/util/i18n/i18n.types.js.map +1 -0
  216. package/{cjs/form/file-upload → esm/util}/i18n/locales/nb.d.ts +5 -0
  217. package/esm/{form/file-upload → util}/i18n/locales/nb.js +5 -0
  218. package/esm/util/i18n/locales/nb.js.map +1 -0
  219. package/esm/util/i18n/merge.js.map +1 -0
  220. package/esm/util/types/AsChild.d.ts +14 -0
  221. package/esm/util/types/AsChild.js +2 -0
  222. package/esm/util/types/AsChild.js.map +1 -0
  223. package/package.json +16 -5
  224. package/src/chat/Chat.tsx +2 -1
  225. package/src/collapsible/parts/Collapsible.Trigger.tsx +5 -1
  226. package/src/date/datepicker/parts/DropdownCaption.tsx +5 -1
  227. package/src/date/monthpicker/MonthCaption.tsx +1 -1
  228. package/src/form/combobox/Combobox.tsx +6 -76
  229. package/src/form/combobox/ComboboxProvider.tsx +1 -1
  230. package/src/form/combobox/ComboboxWrapper.tsx +4 -3
  231. package/src/form/combobox/FilteredOptions/FilteredOptions.tsx +3 -3
  232. package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +19 -29
  233. package/src/form/combobox/Input/{inputContext.tsx → Input.context.tsx} +30 -33
  234. package/src/form/combobox/Input/Input.tsx +1 -1
  235. package/src/form/combobox/Input/InputController.tsx +102 -0
  236. package/src/form/combobox/{ToggleListButton.tsx → Input/ToggleListButton.tsx} +1 -1
  237. package/src/form/combobox/SelectedOptions/SelectedOptions.tsx +1 -1
  238. package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +12 -26
  239. package/src/form/combobox/{combobox-utils.test.ts → __tests__/combobox-utils.test.ts} +1 -1
  240. package/src/form/combobox/{combobox.test.tsx → __tests__/combobox.test.tsx} +2 -3
  241. package/src/form/combobox/customOptionsContext.tsx +14 -18
  242. package/src/form/combobox/types.ts +3 -1
  243. package/src/form/file-upload/FileUpload.context.tsx +1 -1
  244. package/src/form/file-upload/FileUpload.tsx +1 -1
  245. package/src/form/file-upload/parts/dropzone/Dropzone.tsx +1 -1
  246. package/src/form/file-upload/parts/dropzone/dropzone.types.ts +1 -1
  247. package/src/form/file-upload/parts/item/Item.tsx +2 -2
  248. package/src/form/form-progress/FormProgress.tsx +152 -0
  249. package/src/form/form-progress/index.ts +7 -0
  250. package/src/index.ts +1 -0
  251. package/src/overlay/README.md +5 -0
  252. package/src/overlay/dismiss/DismissableLayer.tsx +368 -0
  253. package/src/overlay/dismiss/util/dispatchCustomEvent.ts +77 -0
  254. package/src/overlay/dismiss/util/useEscapeKeydown.ts +21 -0
  255. package/src/overlay/dismiss/util/useFocusOutside.ts +52 -0
  256. package/src/overlay/dismiss/util/usePointerDownOutside.ts +95 -0
  257. package/src/overlays/floating/Floating.tsx +399 -0
  258. package/src/overlays/floating/Floating.utils.ts +63 -0
  259. package/src/popover/Popover.tsx +38 -70
  260. package/src/progress-bar/ProgressBar.tsx +45 -20
  261. package/src/stepper/Step.tsx +1 -1
  262. package/src/stepper/Stepper.tsx +1 -1
  263. package/src/tabs/Tabs.context.ts +2 -0
  264. package/src/toggle-group/ToggleGroup.context.ts +1 -0
  265. package/src/util/hooks/descendants/useDescendant.tsx +55 -68
  266. package/src/{form/file-upload → util}/i18n/locales/nb.ts +5 -0
  267. package/src/util/types/AsChild.ts +15 -0
  268. package/cjs/form/combobox/ClearButton.d.ts +0 -7
  269. package/cjs/form/combobox/ClearButton.js +0 -28
  270. package/cjs/form/combobox/ClearButton.js.map +0 -1
  271. package/cjs/form/combobox/FilteredOptions/CheckIcon.d.ts +0 -3
  272. package/cjs/form/combobox/FilteredOptions/CheckIcon.js +0 -12
  273. package/cjs/form/combobox/FilteredOptions/CheckIcon.js.map +0 -1
  274. package/cjs/form/combobox/Input/inputContext.js.map +0 -1
  275. package/cjs/form/combobox/ToggleListButton.js.map +0 -1
  276. package/cjs/form/file-upload/i18n/get.js.map +0 -1
  277. package/cjs/form/file-upload/i18n/i18n.context.js.map +0 -1
  278. package/cjs/form/file-upload/i18n/i18n.types.js.map +0 -1
  279. package/cjs/form/file-upload/i18n/locales/nb.js.map +0 -1
  280. package/cjs/form/file-upload/i18n/merge.js.map +0 -1
  281. package/esm/form/combobox/ClearButton.d.ts +0 -7
  282. package/esm/form/combobox/ClearButton.js +0 -21
  283. package/esm/form/combobox/ClearButton.js.map +0 -1
  284. package/esm/form/combobox/FilteredOptions/CheckIcon.d.ts +0 -3
  285. package/esm/form/combobox/FilteredOptions/CheckIcon.js +0 -7
  286. package/esm/form/combobox/FilteredOptions/CheckIcon.js.map +0 -1
  287. package/esm/form/combobox/Input/inputContext.js.map +0 -1
  288. package/esm/form/combobox/ToggleListButton.js.map +0 -1
  289. package/esm/form/file-upload/i18n/get.js.map +0 -1
  290. package/esm/form/file-upload/i18n/i18n.context.js.map +0 -1
  291. package/esm/form/file-upload/i18n/i18n.types.js.map +0 -1
  292. package/esm/form/file-upload/i18n/locales/nb.js.map +0 -1
  293. package/esm/form/file-upload/i18n/merge.js.map +0 -1
  294. package/src/form/combobox/ClearButton.tsx +0 -29
  295. package/src/form/combobox/FilteredOptions/CheckIcon.tsx +0 -23
  296. /package/cjs/form/combobox/{ToggleListButton.d.ts → Input/ToggleListButton.d.ts} +0 -0
  297. /package/cjs/{form/file-upload → util}/i18n/get.d.ts +0 -0
  298. /package/cjs/{form/file-upload → util}/i18n/get.js +0 -0
  299. /package/cjs/{form/file-upload → util}/i18n/i18n.context.d.ts +0 -0
  300. /package/cjs/{form/file-upload → util}/i18n/i18n.context.js +0 -0
  301. /package/cjs/{form/file-upload → util}/i18n/i18n.types.d.ts +0 -0
  302. /package/cjs/{form/file-upload → util}/i18n/i18n.types.js +0 -0
  303. /package/cjs/{form/file-upload → util}/i18n/merge.d.ts +0 -0
  304. /package/cjs/{form/file-upload → util}/i18n/merge.js +0 -0
  305. /package/esm/form/combobox/{ToggleListButton.d.ts → Input/ToggleListButton.d.ts} +0 -0
  306. /package/esm/{form/file-upload → util}/i18n/get.d.ts +0 -0
  307. /package/esm/{form/file-upload → util}/i18n/get.js +0 -0
  308. /package/esm/{form/file-upload → util}/i18n/i18n.context.d.ts +0 -0
  309. /package/esm/{form/file-upload → util}/i18n/i18n.context.js +0 -0
  310. /package/esm/{form/file-upload → util}/i18n/i18n.types.d.ts +0 -0
  311. /package/esm/{form/file-upload → util}/i18n/i18n.types.js +0 -0
  312. /package/esm/{form/file-upload → util}/i18n/merge.d.ts +0 -0
  313. /package/esm/{form/file-upload → util}/i18n/merge.js +0 -0
  314. /package/src/{form/file-upload → util}/i18n/get.ts +0 -0
  315. /package/src/{form/file-upload → util}/i18n/i18n.context.test.tsx +0 -0
  316. /package/src/{form/file-upload → util}/i18n/i18n.context.ts +0 -0
  317. /package/src/{form/file-upload → util}/i18n/i18n.types.ts +0 -0
  318. /package/src/{form/file-upload → util}/i18n/merge.ts +0 -0
@@ -7,14 +7,18 @@ interface ToggleContextProps {
7
7
  export declare const ToggleGroupContext: import("react").Context<ToggleContextProps | null>;
8
8
  export declare const ToggleGroupDescendantsProvider: import("react").Provider<import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
9
9
  value: string;
10
- }>>, useToggleGroupDescendantsContext: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
10
+ }>>, useToggleGroupDescendantsContext: <S extends boolean = true>(strict?: S) => S extends true ? import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
11
11
  value: string;
12
- }>, useToggleGroupDescendants: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
12
+ }> : import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
13
+ value: string;
14
+ }> | undefined, useToggleGroupDescendants: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
13
15
  value: string;
14
16
  }>, useToggleGroupDescendant: (options?: import("../util/hooks/descendants/descendant.js").DescendantOptions<{
15
17
  value: string;
16
18
  }> | undefined) => {
17
- descendants: import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLElement, Record<string, any>>;
19
+ descendants: import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
20
+ value: string;
21
+ }>;
18
22
  index: number;
19
23
  enabledIndex: number;
20
24
  register: (instance: HTMLButtonElement | null) => void;
@@ -8,5 +8,6 @@ export const [ToggleGroupProvider, useToggleGroupContext] = createContext({
8
8
  name: "ToggleGroupContext",
9
9
  hookName: "useToggleGroupContext",
10
10
  providerName: "ToggleGroupProvider",
11
+ errorMessage: "<ToggleGroup.Item> needs to be wrapped within <ToggleGroup>",
11
12
  });
12
13
  //# sourceMappingURL=ToggleGroup.context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleGroup.context.js","sourceRoot":"","sources":["../../src/toggle-group/ToggleGroup.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAQlF,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAClD,IAAI,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,CACX,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,EACzB,GAAG,uBAAuB,EAAwC,CAAC;AAKpE,mBAAmB;AACnB,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,GACvD,aAAa,CAA2B;IACtC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,uBAAuB;IACjC,YAAY,EAAE,qBAAqB;CACpC,CAAC,CAAC"}
1
+ {"version":3,"file":"ToggleGroup.context.js","sourceRoot":"","sources":["../../src/toggle-group/ToggleGroup.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAQlF,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAClD,IAAI,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,CACX,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,EACzB,GAAG,uBAAuB,EAAwC,CAAC;AAKpE,mBAAmB;AACnB,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,GACvD,aAAa,CAA2B;IACtC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,uBAAuB;IACjC,YAAY,EAAE,qBAAqB;IACnC,YAAY,EAAE,6DAA6D;CAC5E,CAAC,CAAC"}
@@ -6,8 +6,8 @@ import { DescendantOptions, DescendantsManager } from "./descendant.js";
6
6
  /**
7
7
  * Provides strongly typed versions of the context provider and hooks above.
8
8
  */
9
- export declare function createDescendantContext<T extends HTMLElement = HTMLElement, K extends Record<string, any> = object>(): readonly [React.Provider<DescendantsManager<T, K>>, () => DescendantsManager<T, K>, () => DescendantsManager<T, K>, (options?: DescendantOptions<K>) => {
10
- descendants: DescendantsManager<HTMLElement, Record<string, any>>;
9
+ export declare function createDescendantContext<T extends HTMLElement = HTMLElement, K extends Record<string, any> = object>(): readonly [React.Provider<DescendantsManager<T, K>>, <S extends boolean = true>(strict?: S) => S extends true ? DescendantsManager<T, K> : DescendantsManager<T, K> | undefined, () => DescendantsManager<T, K>, (options?: DescendantOptions<K>) => {
10
+ descendants: DescendantsManager<T, K>;
11
11
  index: number;
12
12
  enabledIndex: number;
13
13
  register: (instance: T | null) => void;
@@ -7,67 +7,64 @@ import { useClientLayoutEffect } from "../useClientLayoutEffect.js";
7
7
  import { mergeRefs } from "../useMergeRefs.js";
8
8
  import { DescendantsManager } from "./descendant.js";
9
9
  import { cast } from "./utils.js";
10
- /**
11
- * @internal
12
- * Initializing DescendantsManager
13
- */
14
- function useDescendants() {
15
- const descendants = useRef(new DescendantsManager()).current;
16
- return descendants;
17
- }
18
- const [DescendantsContextProvider, useDescendantsContext] = createContext({
19
- name: "DescendantsProvider",
20
- errorMessage: "useDescendantsContext must be used within DescendantsProvider",
21
- });
22
- /**
23
- * @internal
24
- * This hook provides information to descendant component:
25
- * - Index compared to other descendants
26
- * - ref callback to register the descendant
27
- * - Its enabled index compared to other enabled descendants
28
- */
29
- function useDescendant(options) {
30
- const descendants = useDescendantsContext();
31
- const [index, setIndex] = useState(-1);
32
- const ref = useRef(null);
33
- useClientLayoutEffect(() => {
34
- return () => {
35
- if (!ref.current)
36
- return;
37
- descendants.unregister(ref.current);
38
- };
39
- }, []);
40
- useClientLayoutEffect(() => {
41
- if (!ref.current)
42
- return;
43
- const dataIndex = Number(ref.current.dataset["index"]);
44
- if (index != dataIndex && !Number.isNaN(dataIndex)) {
45
- setIndex(dataIndex);
46
- }
47
- });
48
- const refCallback = options
49
- ? cast(descendants.register(options))
50
- : cast(descendants.register);
51
- return {
52
- descendants,
53
- index,
54
- enabledIndex: descendants.enabledIndexOf(ref.current),
55
- register: mergeRefs([refCallback, ref]),
56
- };
57
- }
58
10
  /**
59
11
  * Provides strongly typed versions of the context provider and hooks above.
60
12
  */
61
13
  export function createDescendantContext() {
14
+ const [DescendantsContextProvider, useDescendantsContext] = createContext({
15
+ name: "DescendantsProvider",
16
+ errorMessage: "useDescendantsContext must be used within DescendantsProvider",
17
+ });
62
18
  const ContextProvider = cast((props) => (React.createElement(DescendantsContextProvider, Object.assign({}, props.value), props.children)));
63
- const _useDescendantsContext = () => cast(useDescendantsContext());
64
- const _useDescendant = (options) => useDescendant(options);
65
- const _useDescendants = () => useDescendants();
19
+ /**
20
+ * @internal
21
+ * This hook provides information to descendant component:
22
+ * - Index compared to other descendants
23
+ * - ref callback to register the descendant
24
+ * - Its enabled index compared to other enabled descendants
25
+ */
26
+ function _useDescendant(options) {
27
+ const descendants = useDescendantsContext();
28
+ const [index, setIndex] = useState(-1);
29
+ const ref = useRef(null);
30
+ useClientLayoutEffect(() => {
31
+ return () => {
32
+ if (!ref.current)
33
+ return;
34
+ descendants.unregister(ref.current);
35
+ };
36
+ }, []);
37
+ useClientLayoutEffect(() => {
38
+ if (!ref.current)
39
+ return;
40
+ const dataIndex = Number(ref.current.dataset["index"]);
41
+ if (index != dataIndex && !Number.isNaN(dataIndex)) {
42
+ setIndex(dataIndex);
43
+ }
44
+ });
45
+ const refCallback = options
46
+ ? cast(descendants.register(options))
47
+ : cast(descendants.register);
48
+ return {
49
+ descendants,
50
+ index,
51
+ enabledIndex: descendants.enabledIndexOf(ref.current),
52
+ register: mergeRefs([refCallback, ref]),
53
+ };
54
+ }
55
+ /**
56
+ * @internal
57
+ * Initializing DescendantsManager
58
+ */
59
+ function _useDescendants() {
60
+ const descendants = useRef(new DescendantsManager()).current;
61
+ return descendants;
62
+ }
66
63
  return [
67
64
  // context provider
68
65
  ContextProvider,
69
66
  // call this when you need to read from context
70
- _useDescendantsContext,
67
+ useDescendantsContext,
71
68
  // descendants state information, to be called and passed to `ContextProvider`
72
69
  _useDescendants,
73
70
  // descendant index information
@@ -1 +1 @@
1
- {"version":3,"file":"useDescendant.js","sourceRoot":"","sources":["../../../../src/util/hooks/descendants/useDescendant.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAqB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;;;GAGG;AACH,SAAS,cAAc;IAIrB,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,kBAAkB,EAAQ,CAAC,CAAC,OAAO,CAAC;IAEnE,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,GAAG,aAAa,CAEvE;IACA,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,+DAA+D;CAC9E,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAS,aAAa,CAGpB,OAA8B;IA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AAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBAEzD,IAAI,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,SAAS,EAAE,CAAC;oBACpD,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;oBAE7D,MAAM,IAAI,KAAK,CACb,0BAA0B,OAAO,gDAAgD,WAAW,+CAA+C,eAAe,GAAG,CAC9J,CAAC;gBACJ,CAAC;gBAED,OAAO,OAAO,CAAC,YAAY,CAAC,WAAW,CAAW,CAAC,CAAC,+CAA+C;YACrG,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.types.js","sourceRoot":"","sources":["../../../src/util/i18n/i18n.types.ts"],"names":[],"mappings":""}
@@ -17,5 +17,10 @@ declare const _default: {
17
17
  downloading: string;
18
18
  };
19
19
  };
20
+ FormProgress: {
21
+ step: string;
22
+ showAllSteps: string;
23
+ hideAllSteps: string;
24
+ };
20
25
  };
21
26
  export default _default;
@@ -17,5 +17,10 @@ export default {
17
17
  downloading: "Laster ned…",
18
18
  },
19
19
  },
20
+ FormProgress: {
21
+ step: "Steg {activeStep} av {totalSteps}",
22
+ showAllSteps: "Vis alle steg",
23
+ hideAllSteps: "Skjul alle steg",
24
+ },
20
25
  };
21
26
  //# sourceMappingURL=nb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nb.js","sourceRoot":"","sources":["../../../../src/util/i18n/locales/nb.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,MAAM,EAAE,UAAU;YAClB,cAAc,EAAE,YAAY;YAC5B,WAAW,EAAE,wBAAwB;YACrC,mBAAmB,EAAE,wBAAwB;YAC7C,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,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ export type AsChild = {
3
+ children: React.ReactElement;
4
+ /**
5
+ * Renders the children as a child of the component. Merges the props of the component with the props of the child.
6
+ */
7
+ asChild: true;
8
+ } | {
9
+ children: React.ReactNode;
10
+ /**
11
+ * Renders the children as a child of the component. Merges the props of the component with the props of the child.
12
+ */
13
+ asChild?: false;
14
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AsChild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsChild.js","sourceRoot":"","sources":["../../../src/util/types/AsChild.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-react",
3
- "version": "6.7.0",
3
+ "version": "6.8.0",
4
4
  "description": "React components from the Norwegian Labour and Welfare Administration.",
5
5
  "author": "Aksel, a team part of the Norwegian Labour and Welfare Administration.",
6
6
  "license": "MIT",
@@ -570,6 +570,16 @@
570
570
  "default": "./cjs/form/form-summary/index.js"
571
571
  }
572
572
  },
573
+ "./FormProgress": {
574
+ "import": {
575
+ "types": "./esm/form/form-progress/index.d.ts",
576
+ "default": "./esm/form/form-progress/index.js"
577
+ },
578
+ "require": {
579
+ "types": "./cjs/form/form-progress/index.d.ts",
580
+ "default": "./cjs/form/form-progress/index.js"
581
+ }
582
+ },
573
583
  "./package.json": "./package.json"
574
584
  },
575
585
  "scripts": {
@@ -583,16 +593,17 @@
583
593
  },
584
594
  "dependencies": {
585
595
  "@floating-ui/react": "0.25.4",
586
- "@navikt/aksel-icons": "^6.7.0",
587
- "@navikt/ds-tokens": "^6.7.0",
596
+ "@floating-ui/react-dom": "^2.0.9",
597
+ "@navikt/aksel-icons": "^6.8.0",
598
+ "@navikt/ds-tokens": "^6.8.0",
588
599
  "clsx": "^2.1.0",
589
600
  "date-fns": "^3.0.0",
590
601
  "react-day-picker": "8.10.0"
591
602
  },
592
603
  "devDependencies": {
593
- "@testing-library/dom": "8.13.0",
604
+ "@testing-library/dom": "9.3.4",
594
605
  "@testing-library/jest-dom": "^5.16.0",
595
- "@testing-library/react": "^13.3.0",
606
+ "@testing-library/react": "^15.0.7",
596
607
  "@testing-library/user-event": "^14.2.0",
597
608
  "@types/faker": "5.5.8",
598
609
  "concurrently": "7.2.1",
package/src/chat/Chat.tsx CHANGED
@@ -3,6 +3,7 @@ import React, { HTMLAttributes, forwardRef } from "react";
3
3
  import { BodyLong } from "../typography";
4
4
  import Bubble from "./Bubble";
5
5
 
6
+ export const VARIANTS = ["subtle", "info", "neutral"] as const;
6
7
  export const POSITIONS = ["left", "right"] as const;
7
8
  export const SIZES = ["medium", "small"] as const;
8
9
 
@@ -28,7 +29,7 @@ export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
28
29
  * Avoid using the same background as the surface behind Chat.
29
30
  * @default "neutral"
30
31
  */
31
- variant?: "subtle" | "info" | "neutral";
32
+ variant?: (typeof VARIANTS)[number];
32
33
  /**
33
34
  * Positions avatar and bubbles.
34
35
  * @default "left"
@@ -13,6 +13,10 @@ export interface CollapsibleTriggerProps
13
13
  * @default false
14
14
  */
15
15
  asChild?: boolean;
16
+ /**
17
+ * You may disable aria-expanded if the accessable name of the trigger is changed when toggled, e.g. "Show"/"Hide".
18
+ */
19
+ "aria-expanded"?: undefined;
16
20
  }
17
21
 
18
22
  export const CollapsibleTrigger = forwardRef<
@@ -29,10 +33,10 @@ export const CollapsibleTrigger = forwardRef<
29
33
  type="button"
30
34
  data-state={ctx.state}
31
35
  onClick={composeEventHandlers(onClick, ctx.onOpenToggle)}
36
+ aria-expanded={ctx.open}
32
37
  {...rest}
33
38
  id={ctx.triggerId}
34
39
  aria-controls={ctx.open ? ctx.contentId : undefined}
35
- aria-expanded={ctx.open}
36
40
  >
37
41
  {children}
38
42
  </Comp>
@@ -37,7 +37,11 @@ export const DropdownCaption = ({ displayMonth, id }: CaptionProps) => {
37
37
  const handleMonthChange: React.ChangeEventHandler<HTMLSelectElement> = (e) =>
38
38
  goToMonth(setMonth(startOfMonth(displayMonth), Number(e.target.value)));
39
39
 
40
- const years = getYears(fromDate, toDate, displayMonth.getFullYear());
40
+ const years = getYears(
41
+ fromDate,
42
+ toDate,
43
+ displayMonth.getFullYear(),
44
+ ).reverse();
41
45
  const months = getMonths(fromDate, toDate, displayMonth);
42
46
 
43
47
  const previousLabel = labelPrevious(previousMonth, { locale });
@@ -35,7 +35,7 @@ export const MonthCaption = () => {
35
35
  if (!years.map((x) => x.getFullYear()).includes(year.getFullYear())) {
36
36
  years.push(setYear(startOfYear(new Date()), year.getFullYear()));
37
37
  }
38
- years.sort((a, b) => a.getFullYear() - b.getFullYear());
38
+ years.sort((a, b) => b.getFullYear() - a.getFullYear());
39
39
  }
40
40
 
41
41
  const handleYearChange = (e) =>
@@ -1,57 +1,31 @@
1
1
  import cl from "clsx";
2
- import React, { forwardRef, useRef } from "react";
2
+ import React, { forwardRef } from "react";
3
3
  import { BodyShort, ErrorMessage, Label } from "../../typography";
4
- import { useMergeRefs } from "../../util/hooks/useMergeRefs";
5
- import ClearButton from "./ClearButton";
6
4
  import ComboboxWrapper from "./ComboboxWrapper";
7
5
  import FilteredOptions from "./FilteredOptions/FilteredOptions";
8
6
  import { useFilteredOptionsContext } from "./FilteredOptions/filteredOptionsContext";
9
- import Input from "./Input/Input";
10
- import { useInputContext } from "./Input/inputContext";
11
- import SelectedOptions from "./SelectedOptions/SelectedOptions";
12
- import { useSelectedOptionsContext } from "./SelectedOptions/selectedOptionsContext";
13
- import ToggleListButton from "./ToggleListButton";
7
+ import { useInputContext } from "./Input/Input.context";
8
+ import { InputController } from "./Input/InputController";
14
9
  import { ComboboxProps } from "./types";
15
10
 
16
11
  export const Combobox = forwardRef<
17
12
  HTMLInputElement,
18
13
  Omit<ComboboxProps, "onChange" | "options" | "size" | "onClear" | "value">
19
14
  >((props, ref) => {
20
- const {
21
- className,
22
- hideLabel = false,
23
- description,
24
- label,
25
- clearButton = true,
26
- clearButtonLabel,
27
- toggleListButton = true,
28
- toggleListButtonLabel,
29
- inputClassName,
30
- shouldShowSelectedOptions = true,
31
- ...rest
32
- } = props;
33
-
34
- const toggleListButtonRef = useRef<HTMLButtonElement>(null);
15
+ const { className, hideLabel = false, description, label, ...rest } = props;
35
16
 
36
- const { activeDecendantId, toggleIsListOpen } = useFilteredOptionsContext();
37
- const { selectedOptions } = useSelectedOptionsContext();
17
+ const { toggleIsListOpen } = useFilteredOptionsContext();
38
18
 
39
19
  const {
40
- clearInput,
41
20
  error,
42
21
  errorId,
43
- focusInput,
44
22
  hasError,
45
23
  inputDescriptionId,
46
24
  inputProps,
47
- inputRef,
48
- value,
49
25
  showErrorMsg,
50
26
  size = "medium",
51
27
  } = useInputContext();
52
28
 
53
- const mergedInputRef = useMergeRefs(inputRef, ref);
54
-
55
29
  return (
56
30
  <ComboboxWrapper
57
31
  className={className}
@@ -59,7 +33,6 @@ export const Combobox = forwardRef<
59
33
  inputProps={inputProps}
60
34
  inputSize={size}
61
35
  toggleIsListOpen={toggleIsListOpen}
62
- toggleListButtonRef={toggleListButtonRef}
63
36
  >
64
37
  <Label
65
38
  htmlFor={inputProps.id}
@@ -83,50 +56,7 @@ export const Combobox = forwardRef<
83
56
  </BodyShort>
84
57
  )}
85
58
  <div className="navds-combobox__wrapper">
86
- {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
87
- <div
88
- className={cl(
89
- "navds-combobox__wrapper-inner navds-text-field__input",
90
- {
91
- "navds-combobox__wrapper-inner--virtually-unfocused":
92
- activeDecendantId !== undefined,
93
- },
94
- )}
95
- onClick={focusInput}
96
- >
97
- {!shouldShowSelectedOptions ? (
98
- <Input
99
- id={inputProps.id}
100
- ref={mergedInputRef}
101
- inputClassName={inputClassName}
102
- {...rest}
103
- />
104
- ) : (
105
- <SelectedOptions selectedOptions={selectedOptions} size={size}>
106
- <Input
107
- id={inputProps.id}
108
- ref={mergedInputRef}
109
- inputClassName={inputClassName}
110
- {...rest}
111
- />
112
- </SelectedOptions>
113
- )}
114
- <div>
115
- {value && clearButton && (
116
- <ClearButton
117
- handleClear={clearInput}
118
- clearButtonLabel={clearButtonLabel}
119
- tabIndex={-1}
120
- />
121
- )}
122
- {toggleListButton && (
123
- <ToggleListButton
124
- toggleListButtonLabel={toggleListButtonLabel}
125
- ref={toggleListButtonRef}
126
- />
127
- )}
128
- </div>
129
- </div>
59
+ <InputController ref={ref} {...rest} />
130
60
  <FilteredOptions />
131
61
  </div>
132
62
  <div
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from "react";
2
2
  import Combobox from "./Combobox";
3
3
  import { FilteredOptionsProvider } from "./FilteredOptions/filteredOptionsContext";
4
- import { InputContextProvider } from "./Input/inputContext";
4
+ import { InputContextProvider } from "./Input/Input.context";
5
5
  import { SelectedOptionsProvider } from "./SelectedOptions/selectedOptionsContext";
6
6
  import { mapToComboboxOptionArray } from "./combobox-utils";
7
7
  import { CustomOptionsProvider } from "./customOptionsContext";
@@ -1,5 +1,6 @@
1
1
  import cl from "clsx";
2
2
  import React, { useRef, useState } from "react";
3
+ import { useInputContext } from "./Input/Input.context";
3
4
 
4
5
  type ComboboxWrapperProps = {
5
6
  children: any;
@@ -10,7 +11,6 @@ type ComboboxWrapperProps = {
10
11
  };
11
12
  inputSize: string;
12
13
  toggleIsListOpen: (isListOpen: boolean) => void;
13
- toggleListButtonRef: React.RefObject<HTMLButtonElement>;
14
14
  };
15
15
 
16
16
  const ComboboxWrapper = ({
@@ -20,15 +20,16 @@ const ComboboxWrapper = ({
20
20
  inputProps,
21
21
  inputSize,
22
22
  toggleIsListOpen,
23
- toggleListButtonRef,
24
23
  }: ComboboxWrapperProps) => {
24
+ const { toggleOpenButtonRef } = useInputContext();
25
+
25
26
  const wrapperRef = useRef<HTMLDivElement | null>(null);
26
27
  const [hasFocusWithin, setHasFocusWithin] = useState(false);
27
28
 
28
29
  function onFocusInsideWrapper(e) {
29
30
  if (
30
31
  !wrapperRef.current?.contains(e.relatedTarget) &&
31
- toggleListButtonRef?.current !== e.target
32
+ toggleOpenButtonRef?.current !== e.target
32
33
  ) {
33
34
  toggleIsListOpen(true);
34
35
  setHasFocusWithin(true);
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import { CheckmarkIcon, PlusIcon } from "@navikt/aksel-icons";
4
4
  import { Loader } from "../../../loader";
5
5
  import { BodyShort, Label } from "../../../typography";
6
- import { useInputContext } from "../Input/inputContext";
6
+ import { useInputContext } from "../Input/Input.context";
7
7
  import { useSelectedOptionsContext } from "../SelectedOptions/selectedOptionsContext";
8
8
  import { isInList, toComboboxOption } from "../combobox-utils";
9
9
  import { ComboboxOption } from "../types";
@@ -38,7 +38,7 @@ const FilteredOptions = () => {
38
38
  const shouldRenderNonSelectables =
39
39
  maxSelected?.isLimitReached || // Render maxSelected message
40
40
  isLoading || // Render loading message
41
- (!isLoading && filteredOptions.length === 0); // Render no hits message
41
+ (!isLoading && filteredOptions.length === 0 && !allowNewValues); // Render no hits message
42
42
 
43
43
  const shouldRenderFilteredOptionsList =
44
44
  (allowNewValues && isValueNew && !maxSelected?.isLimitReached) || // Render add new option
@@ -72,7 +72,7 @@ const FilteredOptions = () => {
72
72
  <Loader title="Søker..." />
73
73
  </div>
74
74
  )}
75
- {!isLoading && filteredOptions.length === 0 && (
75
+ {!isLoading && filteredOptions.length === 0 && !allowNewValues && (
76
76
  <div
77
77
  className="navds-combobox__list-item--no-options"
78
78
  id={filteredOptionsUtil.getNoHitsId(id)}