@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
@@ -49,26 +49,36 @@ const react_1 = __importStar(require("react"));
49
49
  *
50
50
  * @example
51
51
  * // For loading content with an approximate duration in sec.
52
- * <ProgressBar duration={30} />
52
+ * <ProgressBar simulated={{
53
+ * seconds: 30,
54
+ * onTimeout: () => console.log("Oops, this is taking more time than expected!")
55
+ * }}
56
+ * />
53
57
  *
54
58
  * @example
55
59
  * // As a step indicator for forms, questionnaires, etc.
56
60
  * <ProgressBar value={2} valueMax={7} />
57
61
  */
58
62
  exports.ProgressBar = (0, react_1.forwardRef)((_a, ref) => {
59
- var { size = "medium", value = 0, valueMax = 100, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, className } = _a, rest = __rest(_a, ["size", "value", "valueMax", "aria-labelledby", "aria-label", "className"]);
63
+ var { size = "medium", value = 0, valueMax = 100, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, className, simulated } = _a, rest = __rest(_a, ["size", "value", "valueMax", "aria-labelledby", "aria-label", "className", "simulated"]);
60
64
  const translate = 100 - (Math.round(value) / valueMax) * 100;
61
- const duration = undefined;
62
- return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, clsx_1.default)("navds-progress-bar", `navds-progress-bar--${size}`, className), "aria-valuemax": duration ? 0 : Math.round(valueMax), "aria-valuenow": duration ? 0 : Math.round(value), "aria-valuetext": duration
63
- ? "Fremdrift kan ikke beregnes"
65
+ const onTimeoutRef = (0, react_1.useRef)();
66
+ onTimeoutRef.current = simulated === null || simulated === void 0 ? void 0 : simulated.onTimeout;
67
+ react_1.default.useEffect(() => {
68
+ if ((simulated === null || simulated === void 0 ? void 0 : simulated.seconds) && onTimeoutRef.current) {
69
+ const timeout = setTimeout(onTimeoutRef.current, simulated.seconds * 1000);
70
+ return () => clearTimeout(timeout);
71
+ }
72
+ }, [simulated === null || simulated === void 0 ? void 0 : simulated.seconds]);
73
+ return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, clsx_1.default)("navds-progress-bar", `navds-progress-bar--${size}`, className), "aria-valuemax": (simulated === null || simulated === void 0 ? void 0 : simulated.seconds) ? 0 : Math.round(valueMax), "aria-valuenow": (simulated === null || simulated === void 0 ? void 0 : simulated.seconds) ? 0 : Math.round(value), "aria-valuetext": (simulated === null || simulated === void 0 ? void 0 : simulated.seconds)
74
+ ? `Fremdrift kan ikke beregnes, antatt tid er: ${simulated === null || simulated === void 0 ? void 0 : simulated.seconds} sekunder`
64
75
  : `${Math.round(value)} av ${Math.round(valueMax)}`, role: "progressbar", "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel }, rest),
65
76
  react_1.default.createElement("div", { className: (0, clsx_1.default)("navds-progress-bar__foreground", {
66
- "navds-progress-bar__foreground--indeterminate": Number.isInteger(duration),
77
+ "navds-progress-bar__foreground--indeterminate": Number.isInteger(simulated === null || simulated === void 0 ? void 0 : simulated.seconds),
67
78
  }), style: {
68
- "--__ac-progress-bar-duration": Number.isInteger(duration)
69
- ? `${duration}s`
79
+ "--__ac-progress-bar-simulated": Number.isInteger(simulated === null || simulated === void 0 ? void 0 : simulated.seconds)
80
+ ? `${simulated === null || simulated === void 0 ? void 0 : simulated.seconds}s`
70
81
  : undefined,
71
- "--__ac-progress-bar-delay": `${duration === 0 ? 0 : 4}s`,
72
82
  "--__ac-progress-bar-translate": `-${translate}%`,
73
83
  } })));
74
84
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../src/progress-bar/ProgressBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAs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ACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAe,mBAAW,CAAC"}
@@ -58,7 +58,7 @@ exports.Step = (0, react_1.forwardRef)((_a, ref) => {
58
58
  const handleStepClick = () => {
59
59
  isInteractive && context.onStepChange(unsafe_index + 1);
60
60
  };
61
- return (react_1.default.createElement(Comp, Object.assign({}, rest, { "aria-current": activeStep === unsafe_index, ref: ref, className: (0, clsx_1.default)("navds-stepper__step", className, {
61
+ return (react_1.default.createElement(Comp, Object.assign({}, rest, { "aria-current": activeStep === unsafe_index ? "step" : undefined, ref: ref, className: (0, clsx_1.default)("navds-stepper__step", className, {
62
62
  "navds-stepper__step--active": activeStep === unsafe_index,
63
63
  "navds-stepper__step--behind": activeStep > unsafe_index,
64
64
  "navds-stepper__step--non-interactive": !isInteractive,
@@ -1 +1 @@
1
- {"version":3,"file":"Step.js","sourceRoot":"","sources":["../../src/stepper/Step.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAsB;AACtB,+CAAsD;AACtD,8CAAsC;AACtC,uEAAoE;AAEpE,uCAA2C;AAyB3C,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAC1B,uCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAE,KAAK,EAChB,IAAI,EAAC,KAAK,qCAEC,eAAU;IAErB,wCACE,CAAC,EAAC,wWAAwW,EAC1W,IAAI,EAAC,cAAc,GACnB,CACE,CACP,CAAC;AAEW,QAAA,IAAI,GACf,IAAA,kBAAU,EACR,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,SAAS,EACT,QAAQ,EACR,EAAE,EAAE,SAAS,GAAG,GAAG,EACnB,YAAY,GAAG,CAAC,EAChB,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,OAAO,OAER,EADI,I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C,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IAE/C,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,IAAI,oBACC,IAAI,oBACM,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC9D,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,cAAE,EAAC,qBAAqB,EAAE,SAAS,EAAE;YAC9C,6BAA6B,EAAE,UAAU,KAAK,YAAY;YAC1D,6BAA6B,EAAE,UAAU,GAAG,YAAY;YACxD,sCAAsC,EAAE,CAAC,aAAa;YACtD,gCAAgC,EAAE,SAAS;SAC5C,CAAC,EACF,OAAO,EAAE,IAAA,2CAAoB,EAAC,OAAO,EAAE,eAAe,CAAC;QAEtD,SAAS,CAAC,CAAC,CAAC,CACX,wCAAM,SAAS,EAAC,sDAAsD;YACpE,8BAAC,aAAa,OAAG,CACZ,CACR,CAAC,CAAC,CAAC,CACF,8BAAC,kBAAK,IACJ,SAAS,EAAC,uBAAuB,EACjC,EAAE,EAAC,MAAM,iBACG,MAAM,IAEjB,YAAY,GAAG,CAAC,CACX,CACT;QACD,8BAAC,kBAAK,IAAC,EAAE,EAAC,MAAM,EAAC,SAAS,EAAC,wBAAwB,IAChD,QAAQ,CACH,CACH,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ,kBAAe,YAAI,CAAC"}
@@ -50,7 +50,7 @@ interface StepperComponent extends React.ForwardRefExoticComponent<StepperProps
50
50
  * <Stepper
51
51
  * aria-labelledby="stepper-heading"
52
52
  * activeStep={activeStep}
53
- * onStepChange={(x) => setActiveStep(x)}
53
+ * onStepChange={setActiveStep}
54
54
  * >
55
55
  * <Stepper.Step href="#">Start søknad</Stepper.Step>
56
56
  * <Stepper.Step href="#">Saksopplysninger</Stepper.Step>
@@ -57,7 +57,7 @@ const context_1 = require("./context");
57
57
  * <Stepper
58
58
  * aria-labelledby="stepper-heading"
59
59
  * activeStep={activeStep}
60
- * onStepChange={(x) => setActiveStep(x)}
60
+ * onStepChange={setActiveStep}
61
61
  * >
62
62
  * <Stepper.Step href="#">Start søknad</Stepper.Step>
63
63
  * <Stepper.Step href="#">Saksopplysninger</Stepper.Step>
@@ -3,14 +3,18 @@ import { TabsProps } from "./Tabs.types";
3
3
  import { useTabs } from "./useTabs";
4
4
  export declare const TabsDescendantsProvider: import("react").Provider<import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
5
5
  value: string;
6
- }>>, useTabsDescendantsContext: () => import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
6
+ }>>, useTabsDescendantsContext: <S extends boolean = true>(strict?: S) => S extends true ? import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
7
7
  value: string;
8
- }>, useTabsDescendants: () => import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
8
+ }> : import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
9
+ value: string;
10
+ }> | undefined, useTabsDescendants: () => import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
9
11
  value: string;
10
12
  }>, useTabsDescendant: (options?: import("../util/hooks/descendants/descendant").DescendantOptions<{
11
13
  value: string;
12
14
  }> | undefined) => {
13
- descendants: import("../util/hooks/descendants/descendant").DescendantsManager<HTMLElement, Record<string, any>>;
15
+ descendants: import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
16
+ value: string;
17
+ }>;
14
18
  index: number;
15
19
  enabledIndex: number;
16
20
  register: (instance: HTMLButtonElement | null) => void;
@@ -10,5 +10,6 @@ _b = (0, create_context_1.createContext)({
10
10
  name: "TabsContext",
11
11
  hookName: "useTabsContext",
12
12
  providerName: "TabsProvider",
13
+ errorMessage: "Tabs.List, Tabs.Tag and Tabs.Panel needs to be wrapped within <Tabs>",
13
14
  }), exports.TabsProvider = _b[0], exports.useTabsContext = _b[1];
14
15
  //# sourceMappingURL=Tabs.context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.context.js","sourceRoot":"","sources":["../../src/tabs/Tabs.context.ts"],"names":[],"mappings":";;;;AAAA,2DAAuD;AACvD,2EAAkF;AAIrE,KAKT,IAAA,uCAAuB,GAAwC,EAJjE,+BAAuB,UACvB,iCAAyB,UACzB,0BAAkB,UAClB,yBAAiB,SACiD;AAQpE,mBAAmB;AACN,KAAiC,IAAA,8BAAa,EAAoB;IAC7E,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,gBAAgB;IAC1B,YAAY,EAAE,cAAc;CAC7B,CAAC,EAJY,oBAAY,UAAE,sBAAc,SAIvC"}
1
+ {"version":3,"file":"Tabs.context.js","sourceRoot":"","sources":["../../src/tabs/Tabs.context.ts"],"names":[],"mappings":";;;;AAAA,2DAAuD;AACvD,2EAAkF;AAIrE,KAKT,IAAA,uCAAuB,GAAwC,EAJjE,+BAAuB,UACvB,iCAAyB,UACzB,0BAAkB,UAClB,yBAAiB,SACiD;AAQpE,mBAAmB;AACN,KAAiC,IAAA,8BAAa,EAAoB;IAC7E,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,gBAAgB;IAC1B,YAAY,EAAE,cAAc;IAC5B,YAAY,EACV,sEAAsE;CACzE,CAAC,EANY,oBAAY,UAAE,sBAAc,SAMvC"}
@@ -4,5 +4,5 @@ export declare const dayLabels: (start: Date, end: Date, totalDays: number, dire
4
4
  export declare const monthLabels: (start: Date, end: Date, direction: "left" | "right", template?: string) => AxisLabel[];
5
5
  export declare const yearLabels: (start: Date, end: Date, direction: "left" | "right", template?: string) => AxisLabel[];
6
6
  export declare const AxisLabels: ({ templates, }: {
7
- templates?: AxisLabelTemplates | undefined;
7
+ templates?: AxisLabelTemplates;
8
8
  }) => React.JSX.Element;
@@ -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").DescendantsManager<HTMLButtonElement, {
9
9
  value: string;
10
- }>>, useToggleGroupDescendantsContext: () => import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
10
+ }>>, useToggleGroupDescendantsContext: <S extends boolean = true>(strict?: S) => S extends true ? import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
11
11
  value: string;
12
- }>, useToggleGroupDescendants: () => import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
12
+ }> : import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
13
+ value: string;
14
+ }> | undefined, useToggleGroupDescendants: () => import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
13
15
  value: string;
14
16
  }>, useToggleGroupDescendant: (options?: import("../util/hooks/descendants/descendant").DescendantOptions<{
15
17
  value: string;
16
18
  }> | undefined) => {
17
- descendants: import("../util/hooks/descendants/descendant").DescendantsManager<HTMLElement, Record<string, any>>;
19
+ descendants: import("../util/hooks/descendants/descendant").DescendantsManager<HTMLButtonElement, {
20
+ value: string;
21
+ }>;
18
22
  index: number;
19
23
  enabledIndex: number;
20
24
  register: (instance: HTMLButtonElement | null) => void;
@@ -12,5 +12,6 @@ _b = (0, create_context_1.createContext)({
12
12
  name: "ToggleGroupContext",
13
13
  hookName: "useToggleGroupContext",
14
14
  providerName: "ToggleGroupProvider",
15
+ errorMessage: "<ToggleGroup.Item> needs to be wrapped within <ToggleGroup>",
15
16
  }), exports.ToggleGroupProvider = _b[0], exports.useToggleGroupContext = _b[1];
16
17
  //# 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,iCAA4D;AAC5D,2DAAuD;AACvD,2EAAkF;AAQrE,QAAA,kBAAkB,GAAG,IAAA,qBAAkB,EAClD,IAAI,CACL,CAAC;AAEW,KAKT,IAAA,uCAAuB,GAAwC,EAJjE,sCAA8B,UAC9B,wCAAgC,UAChC,iCAAyB,UACzB,gCAAwB,SAC0C;AAKpE,mBAAmB;AACN,KACX,IAAA,8BAAa,EAA2B;IACtC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,uBAAuB;IACjC,YAAY,EAAE,qBAAqB;CACpC,CAAC,EALU,2BAAmB,UAAE,6BAAqB,SAKnD"}
1
+ {"version":3,"file":"ToggleGroup.context.js","sourceRoot":"","sources":["../../src/toggle-group/ToggleGroup.context.ts"],"names":[],"mappings":";;;;AAAA,iCAA4D;AAC5D,2DAAuD;AACvD,2EAAkF;AAQrE,QAAA,kBAAkB,GAAG,IAAA,qBAAkB,EAClD,IAAI,CACL,CAAC;AAEW,KAKT,IAAA,uCAAuB,GAAwC,EAJjE,sCAA8B,UAC9B,wCAAgC,UAChC,iCAAyB,UACzB,gCAAwB,SAC0C;AAKpE,mBAAmB;AACN,KACX,IAAA,8BAAa,EAA2B;IACtC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,uBAAuB;IACjC,YAAY,EAAE,qBAAqB;IACnC,YAAY,EAAE,6DAA6D;CAC5E,CAAC,EANU,2BAAmB,UAAE,6BAAqB,SAMnD"}
@@ -6,8 +6,8 @@ import { DescendantOptions, DescendantsManager } from "./descendant";
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;
@@ -33,67 +33,64 @@ const useClientLayoutEffect_1 = require("../useClientLayoutEffect");
33
33
  const useMergeRefs_1 = require("../useMergeRefs");
34
34
  const descendant_1 = require("./descendant");
35
35
  const utils_1 = require("./utils");
36
- /**
37
- * @internal
38
- * Initializing DescendantsManager
39
- */
40
- function useDescendants() {
41
- const descendants = (0, react_1.useRef)(new descendant_1.DescendantsManager()).current;
42
- return descendants;
43
- }
44
- const [DescendantsContextProvider, useDescendantsContext] = (0, create_context_1.createContext)({
45
- name: "DescendantsProvider",
46
- errorMessage: "useDescendantsContext must be used within DescendantsProvider",
47
- });
48
- /**
49
- * @internal
50
- * This hook provides information to descendant component:
51
- * - Index compared to other descendants
52
- * - ref callback to register the descendant
53
- * - Its enabled index compared to other enabled descendants
54
- */
55
- function useDescendant(options) {
56
- const descendants = useDescendantsContext();
57
- const [index, setIndex] = (0, react_1.useState)(-1);
58
- const ref = (0, react_1.useRef)(null);
59
- (0, useClientLayoutEffect_1.useClientLayoutEffect)(() => {
60
- return () => {
61
- if (!ref.current)
62
- return;
63
- descendants.unregister(ref.current);
64
- };
65
- }, []);
66
- (0, useClientLayoutEffect_1.useClientLayoutEffect)(() => {
67
- if (!ref.current)
68
- return;
69
- const dataIndex = Number(ref.current.dataset["index"]);
70
- if (index != dataIndex && !Number.isNaN(dataIndex)) {
71
- setIndex(dataIndex);
72
- }
73
- });
74
- const refCallback = options
75
- ? (0, utils_1.cast)(descendants.register(options))
76
- : (0, utils_1.cast)(descendants.register);
77
- return {
78
- descendants,
79
- index,
80
- enabledIndex: descendants.enabledIndexOf(ref.current),
81
- register: (0, useMergeRefs_1.mergeRefs)([refCallback, ref]),
82
- };
83
- }
84
36
  /**
85
37
  * Provides strongly typed versions of the context provider and hooks above.
86
38
  */
87
39
  function createDescendantContext() {
40
+ const [DescendantsContextProvider, useDescendantsContext] = (0, create_context_1.createContext)({
41
+ name: "DescendantsProvider",
42
+ errorMessage: "useDescendantsContext must be used within DescendantsProvider",
43
+ });
88
44
  const ContextProvider = (0, utils_1.cast)((props) => (react_1.default.createElement(DescendantsContextProvider, Object.assign({}, props.value), props.children)));
89
- const _useDescendantsContext = () => (0, utils_1.cast)(useDescendantsContext());
90
- const _useDescendant = (options) => useDescendant(options);
91
- const _useDescendants = () => useDescendants();
45
+ /**
46
+ * @internal
47
+ * This hook provides information to descendant component:
48
+ * - Index compared to other descendants
49
+ * - ref callback to register the descendant
50
+ * - Its enabled index compared to other enabled descendants
51
+ */
52
+ function _useDescendant(options) {
53
+ const descendants = useDescendantsContext();
54
+ const [index, setIndex] = (0, react_1.useState)(-1);
55
+ const ref = (0, react_1.useRef)(null);
56
+ (0, useClientLayoutEffect_1.useClientLayoutEffect)(() => {
57
+ return () => {
58
+ if (!ref.current)
59
+ return;
60
+ descendants.unregister(ref.current);
61
+ };
62
+ }, []);
63
+ (0, useClientLayoutEffect_1.useClientLayoutEffect)(() => {
64
+ if (!ref.current)
65
+ return;
66
+ const dataIndex = Number(ref.current.dataset["index"]);
67
+ if (index != dataIndex && !Number.isNaN(dataIndex)) {
68
+ setIndex(dataIndex);
69
+ }
70
+ });
71
+ const refCallback = options
72
+ ? (0, utils_1.cast)(descendants.register(options))
73
+ : (0, utils_1.cast)(descendants.register);
74
+ return {
75
+ descendants,
76
+ index,
77
+ enabledIndex: descendants.enabledIndexOf(ref.current),
78
+ register: (0, useMergeRefs_1.mergeRefs)([refCallback, ref]),
79
+ };
80
+ }
81
+ /**
82
+ * @internal
83
+ * Initializing DescendantsManager
84
+ */
85
+ function _useDescendants() {
86
+ const descendants = (0, react_1.useRef)(new descendant_1.DescendantsManager()).current;
87
+ return descendants;
88
+ }
92
89
  return [
93
90
  // context provider
94
91
  ContextProvider,
95
92
  // call this when you need to read from context
96
- _useDescendantsContext,
93
+ useDescendantsContext,
97
94
  // descendants state information, to be called and passed to `ContextProvider`
98
95
  _useDescendants,
99
96
  // descendant index information
@@ -1 +1 @@
1
- {"version":3,"file":"useDescendant.js","sourceRoot":"","sources":["../../../../src/util/hooks/descendants/useDescendant.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,+CAAgD;AAChD,yDAAqD;AACrD,oEAAiE;AACjE,kDAA4C;AAC5C,6CAAqE;AACrE,mCAA+B;AAE/B;;;GAGG;AACH,SAAS,cAAc;IAIrB,MAAM,WAAW,GAAG,IAAA,cAAM,EAAC,IAAI,+BAAkB,EAAQ,CAAC,CAAC,OAAO,CAAC;IAEnE,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,GAAG,IAAA,8BAAa,EAEvE;IACA,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,+DAA+D;CAC9E,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAS,aAAa,CAGpB,OAA8B;IAC9B,MAAM,WAAW,GAAG,qBAAqB,EAAE,CAAC;IAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,IAAA,cAAM,EAAI,IAAI,CAAC,CAAC;IAE5B,IAAA,6CAAqB,EAAC,GAAG,EAAE;QACzB,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,GAAG,CAAC,OAAO;gBAAE,OAAO;YACzB,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,6CAAqB,EAAC,GAAG,EAAE;QACzB,IAAI,CAAC,GAAG,CAAC,OAAO;YAAE,OAAO;QACzB,MAAM,S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kBAAU,EAAC,mBAAW,CAAC,CAAC;IAErC;;OAEG;IACH,MAAM,SAAS,GAAG,CAChB,OAAoC,EACpC,OAA2D,EAC3D,EAAE;QACF,MAAM,IAAI,GAAG,IAAA,SAAG,EACd,OAAO,EACP,GAAG,KAAK,EACR,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YACrB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAC3B,CAAC;QAEF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC3C,MAAM,WAAW,GAAG,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;AAzCD,0BAyCC"}
@@ -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;
@@ -19,5 +19,10 @@ exports.default = {
19
19
  downloading: "Laster ned…",
20
20
  },
21
21
  },
22
+ FormProgress: {
23
+ step: "Steg {activeStep} av {totalSteps}",
24
+ showAllSteps: "Vis alle steg",
25
+ hideAllSteps: "Skjul alle steg",
26
+ },
22
27
  };
23
28
  //# sourceMappingURL=nb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nb.js","sourceRoot":"","sources":["../../../../src/util/i18n/locales/nb.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,MAAM,EAAE,UAAU;YAClB,cAAc,EAAE,YAAY;YAC5B,WAAW,EAAE,wBAAwB;YACrC,mBAAmB,EAAE,wBAAwB;YAC7C,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,6BAA6B;YACvC,iBAAiB,EAAE,mCAAmC;SACvD;QACD,IAAI,EAAE;YACJ,gBAAgB,EAAE,gCAAgC;YAClD,iBAAiB,EAAE,aAAa;YAChC,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,aAAa;SAC3B;KACF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,mCAAmC;QACzC,YAAY,EAAE,eAAe;QAC7B,YAAY,EAAE,iBAAiB;KAChC;CACF,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../src/util/i18n/merge.ts"],"names":[],"mappings":";;;AAEA,SAAgB,KAAK,CAAC,GAAG,IAA6B;IACpD,IAAI,KAAK,GAA0B,EAAE,CAAC;IAEtC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AARD,sBAQC;AAED,SAAS,gBAAgB,CACvB,IAAO,EACP,IAA+C;IAE/C,MAAM,OAAO,qBAAQ,IAAI,CAAE,CAAC;IAE5B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;YACnB,SAAS;QACX,CAAC;QAED,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;YACxD,OAAO,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AsChild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsChild.js","sourceRoot":"","sources":["../../../src/util/types/AsChild.ts"],"names":[],"mappings":""}
@@ -1,5 +1,6 @@
1
1
  import React, { HTMLAttributes } from "react";
2
2
  import Bubble from "./Bubble.js";
3
+ export declare const VARIANTS: readonly ["subtle", "info", "neutral"];
3
4
  export declare const POSITIONS: readonly ["left", "right"];
4
5
  export declare const SIZES: readonly ["medium", "small"];
5
6
  export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
@@ -24,7 +25,7 @@ export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
24
25
  * Avoid using the same background as the surface behind Chat.
25
26
  * @default "neutral"
26
27
  */
27
- variant?: "subtle" | "info" | "neutral";
28
+ variant?: (typeof VARIANTS)[number];
28
29
  /**
29
30
  * Positions avatar and bubbles.
30
31
  * @default "left"
package/esm/chat/Chat.js CHANGED
@@ -13,6 +13,7 @@ import cl from "clsx";
13
13
  import React, { forwardRef } from "react";
14
14
  import { BodyLong } from "../typography/index.js";
15
15
  import Bubble from "./Bubble.js";
16
+ export const VARIANTS = ["subtle", "info", "neutral"];
16
17
  export const POSITIONS = ["left", "right"];
17
18
  export const SIZES = ["medium", "small"];
18
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../src/chat/Chat.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AACpD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AAoDlD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAC5B,CACE,EAWY,EACZ,GAAG,EACH,EAAE;QAbF,EACE,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,SAAS,EACT,MAAM,EACN,QAAQ,GAAG,MAAM,EACjB,OAAO,GAAG,SAAS,EACnB,eAAe,EACf,IAAI,GAAG,QAAQ,OA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,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACxC,SAAS,EAAE,SAAS,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,IACpD,KAAK,CAAC,KAAK,EACd,CACO,CACZ,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CACC,CACD,CACP,CAAA;CAAA,CACe,CAAC;AAEnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAErB,eAAe,IAAI,CAAC"}
@@ -5,6 +5,10 @@ export interface CollapsibleTriggerProps extends Omit<React.ButtonHTMLAttributes
5
5
  * @default false
6
6
  */
7
7
  asChild?: boolean;
8
+ /**
9
+ * You may disable aria-expanded if the accessable name of the trigger is changed when toggled, e.g. "Show"/"Hide".
10
+ */
11
+ "aria-expanded"?: undefined;
8
12
  }
9
13
  export declare const CollapsibleTrigger: React.ForwardRefExoticComponent<CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>>;
10
14
  export default CollapsibleTrigger;
@@ -17,7 +17,7 @@ export const CollapsibleTrigger = forwardRef((_a, ref) => {
17
17
  var { children, asChild, onClick } = _a, rest = __rest(_a, ["children", "asChild", "onClick"]);
18
18
  const ctx = useCollapsibleContext();
19
19
  const Comp = asChild ? Slot : "button";
20
- return (React.createElement(Comp, Object.assign({ ref: ref, type: "button", "data-state": ctx.state, onClick: composeEventHandlers(onClick, ctx.onOpenToggle) }, rest, { id: ctx.triggerId, "aria-controls": ctx.open ? ctx.contentId : undefined, "aria-expanded": ctx.open }), children));
20
+ return (React.createElement(Comp, Object.assign({ ref: ref, type: "button", "data-state": ctx.state, onClick: composeEventHandlers(onClick, ctx.onOpenToggle), "aria-expanded": ctx.open }, rest, { id: ctx.triggerId, "aria-controls": ctx.open ? ctx.contentId : undefined }), children));
21
21
  });
22
22
  export default CollapsibleTrigger;
23
23
  //# sourceMappingURL=Collapsible.Trigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.Trigger.js","sourceRoot":"","sources":["../../../src/collapsible/parts/Collapsible.Trigger.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAc/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAG1C,CAAC,EAAuC,EAAE,GAAG,EAAE,EAAE;QAAhD,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,OAAW,EAAN,IAAI,cAArC,kCAAuC,CAAF;IACtC,MAAM,GAAG,GAAG,qBAAqB,EAAE,CAAC;IAEpC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEvC,OAAO,CACL,oBAAC,IAAI,kBACH,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,gBACD,GAAG,CAAC,KAAK,EACrB,OAAO,EAAE,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC,YAAY,CAAC,IACpD,IAAI,IACR,EAAE,EAAE,GAAG,CAAC,SAAS,mBACF,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,mBACpC,GAAG,CAAC,IAAI,KAEtB,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"Collapsible.Trigger.js","sourceRoot":"","sources":["../../../src/collapsible/parts/Collapsible.Trigger.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAkB/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAG1C,CAAC,EAAuC,EAAE,GAAG,EAAE,EAAE;QAAhD,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,OAAW,EAAN,IAAI,cAArC,kCAAuC,CAAF;IACtC,MAAM,GAAG,GAAG,qBAAqB,EAAE,CAAC;IAEpC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEvC,OAAO,CACL,oBAAC,IAAI,kBACH,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,gBACD,GAAG,CAAC,KAAK,EACrB,OAAO,EAAE,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC,YAAY,CAAC,mBACzC,GAAG,CAAC,IAAI,IACnB,IAAI,IACR,EAAE,EAAE,GAAG,CAAC,SAAS,mBACF,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,KAElD,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
@@ -22,7 +22,7 @@ export const DropdownCaption = ({ displayMonth, id }) => {
22
22
  goToMonth(startOfMonth(min([max([newMonth, fromDate]), toDate])));
23
23
  };
24
24
  const handleMonthChange = (e) => goToMonth(setMonth(startOfMonth(displayMonth), Number(e.target.value)));
25
- const years = getYears(fromDate, toDate, displayMonth.getFullYear());
25
+ const years = getYears(fromDate, toDate, displayMonth.getFullYear()).reverse();
26
26
  const months = getMonths(fromDate, toDate, displayMonth);
27
27
  const previousLabel = labelPrevious(previousMonth, { locale });
28
28
  const nextLabel = labelNext(nextMonth, { locale });
@@ -1 +1 @@
1
- {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I,EAAC,QAAQ,GACb,CACE;QACN,oBAAC,OAAO,IAAC,YAAY,EAAE,YAAY,GAAI,CACtC,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -19,7 +19,7 @@ export const MonthCaption = () => {
19
19
  if (!years.map((x) => x.getFullYear()).includes(year.getFullYear())) {
20
20
  years.push(setYear(startOfYear(new Date()), year.getFullYear()));
21
21
  }
22
- years.sort((a, b) => a.getFullYear() - b.getFullYear());
22
+ years.sort((a, b) => b.getFullYear() - a.getFullYear());
23
23
  }
24
24
  const handleYearChange = (e) => toYear(setYear(startOfMonth(new Date()), Number(e.target.value)));
25
25
  const handleButtonClick = (val) => {
@@ -6,11 +6,11 @@ export declare const labelNextYear: (localeCode: string | undefined) => "Gå til
6
6
  export declare const labelPrevYear: (localeCode: string | undefined) => string;
7
7
  export declare const labels: Partial<Labels>;
8
8
  export declare const labelWeekNumber: ({ localeCode, week, }: {
9
- localeCode?: string | undefined;
9
+ localeCode?: string;
10
10
  week: number;
11
11
  }) => string;
12
12
  export declare const labelWeekNumberButton: ({ localeCode, week, }: {
13
- localeCode?: string | undefined;
13
+ localeCode?: string;
14
14
  week: number;
15
15
  }) => string;
16
16
  export declare const labelWeek: (localeCode?: string) => string;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  export declare const ReadOnlyIcon: ({ readOnly, nativeReadOnly, }: {
3
- readOnly?: boolean | undefined;
4
- nativeReadOnly?: boolean | undefined;
3
+ readOnly?: boolean;
4
+ nativeReadOnly?: boolean;
5
5
  }) => React.JSX.Element | null;
@@ -10,26 +10,18 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import cl from "clsx";
13
- import React, { forwardRef, useRef } from "react";
13
+ import React, { forwardRef } from "react";
14
14
  import { BodyShort, ErrorMessage, Label } from "../../typography/index.js";
15
- import { useMergeRefs } from "../../util/hooks/useMergeRefs.js";
16
- import ClearButton from "./ClearButton.js";
17
15
  import ComboboxWrapper from "./ComboboxWrapper.js";
18
16
  import FilteredOptions from "./FilteredOptions/FilteredOptions.js";
19
17
  import { useFilteredOptionsContext } from "./FilteredOptions/filteredOptionsContext.js";
20
- import Input from "./Input/Input.js";
21
- import { useInputContext } from "./Input/inputContext.js";
22
- import SelectedOptions from "./SelectedOptions/SelectedOptions.js";
23
- import { useSelectedOptionsContext } from "./SelectedOptions/selectedOptionsContext.js";
24
- import ToggleListButton from "./ToggleListButton.js";
18
+ import { useInputContext } from "./Input/Input.context.js";
19
+ import { InputController } from "./Input/InputController.js";
25
20
  export const Combobox = forwardRef((props, ref) => {
26
- const { className, hideLabel = false, description, label, clearButton = true, clearButtonLabel, toggleListButton = true, toggleListButtonLabel, inputClassName, shouldShowSelectedOptions = true } = props, rest = __rest(props, ["className", "hideLabel", "description", "label", "clearButton", "clearButtonLabel", "toggleListButton", "toggleListButtonLabel", "inputClassName", "shouldShowSelectedOptions"]);
27
- const toggleListButtonRef = useRef(null);
28
- const { activeDecendantId, toggleIsListOpen } = useFilteredOptionsContext();
29
- const { selectedOptions } = useSelectedOptionsContext();
30
- const { clearInput, error, errorId, focusInput, hasError, inputDescriptionId, inputProps, inputRef, value, showErrorMsg, size = "medium", } = useInputContext();
31
- const mergedInputRef = useMergeRefs(inputRef, ref);
32
- return (React.createElement(ComboboxWrapper, { className: className, hasError: hasError, inputProps: inputProps, inputSize: size, toggleIsListOpen: toggleIsListOpen, toggleListButtonRef: toggleListButtonRef },
21
+ const { className, hideLabel = false, description, label } = props, rest = __rest(props, ["className", "hideLabel", "description", "label"]);
22
+ const { toggleIsListOpen } = useFilteredOptionsContext();
23
+ const { error, errorId, hasError, inputDescriptionId, inputProps, showErrorMsg, size = "medium", } = useInputContext();
24
+ return (React.createElement(ComboboxWrapper, { className: className, hasError: hasError, inputProps: inputProps, inputSize: size, toggleIsListOpen: toggleIsListOpen },
33
25
  React.createElement(Label, { htmlFor: inputProps.id, size: size, className: cl("navds-form-field__label", {
34
26
  "navds-sr-only": hideLabel,
35
27
  }) }, label),
@@ -37,14 +29,7 @@ export const Combobox = forwardRef((props, ref) => {
37
29
  "navds-sr-only": hideLabel,
38
30
  }), id: inputDescriptionId, size: size }, description)),
39
31
  React.createElement("div", { className: "navds-combobox__wrapper" },
40
- React.createElement("div", { className: cl("navds-combobox__wrapper-inner navds-text-field__input", {
41
- "navds-combobox__wrapper-inner--virtually-unfocused": activeDecendantId !== undefined,
42
- }), onClick: focusInput },
43
- !shouldShowSelectedOptions ? (React.createElement(Input, Object.assign({ id: inputProps.id, ref: mergedInputRef, inputClassName: inputClassName }, rest))) : (React.createElement(SelectedOptions, { selectedOptions: selectedOptions, size: size },
44
- React.createElement(Input, Object.assign({ id: inputProps.id, ref: mergedInputRef, inputClassName: inputClassName }, rest)))),
45
- React.createElement("div", null,
46
- value && clearButton && (React.createElement(ClearButton, { handleClear: clearInput, clearButtonLabel: clearButtonLabel, tabIndex: -1 })),
47
- toggleListButton && (React.createElement(ToggleListButton, { toggleListButtonLabel: toggleListButtonLabel, ref: toggleListButtonRef })))),
32
+ React.createElement(InputController, Object.assign({ ref: ref }, rest)),
48
33
  React.createElement(FilteredOptions, null)),
49
34
  React.createElement("div", { className: "navds-form-field__error", id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && React.createElement(ErrorMessage, { size: size }, error))));
50
35
  });