@navikt/ds-react 6.7.1 → 6.9.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 (325) hide show
  1. package/cjs/chat/Bubble.d.ts +4 -4
  2. package/cjs/chat/Chat.d.ts +6 -4
  3. package/cjs/chat/Chat.js +1 -1
  4. package/cjs/chat/Chat.js.map +1 -1
  5. package/cjs/collapsible/parts/Collapsible.Trigger.d.ts +4 -0
  6. package/cjs/collapsible/parts/Collapsible.Trigger.js +1 -1
  7. package/cjs/collapsible/parts/Collapsible.Trigger.js.map +1 -1
  8. package/cjs/date/monthpicker/MonthButton.js +2 -2
  9. package/cjs/date/monthpicker/MonthButton.js.map +1 -1
  10. package/cjs/date/utils/check-dates.d.ts +1 -1
  11. package/cjs/date/utils/check-dates.js +1 -1
  12. package/cjs/date/utils/check-dates.js.map +1 -1
  13. package/cjs/date/utils/dates-disabled.js +1 -1
  14. package/cjs/date/utils/dates-disabled.js.map +1 -1
  15. package/cjs/date/utils/navigation.d.ts +1 -1
  16. package/cjs/date/utils/navigation.js +1 -1
  17. package/cjs/date/utils/navigation.js.map +1 -1
  18. package/cjs/date/utils/parse-date.js +7 -11
  19. package/cjs/date/utils/parse-date.js.map +1 -1
  20. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +17 -4
  21. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  22. package/cjs/form/combobox/FilteredOptions/useVirtualFocus.js +1 -3
  23. package/cjs/form/combobox/FilteredOptions/useVirtualFocus.js.map +1 -1
  24. package/cjs/form/combobox/combobox-utils.js +1 -3
  25. package/cjs/form/combobox/combobox-utils.js.map +1 -1
  26. package/cjs/form/file-upload/FileUpload.context.d.ts +1 -1
  27. package/cjs/form/file-upload/FileUpload.d.ts +1 -1
  28. package/cjs/form/file-upload/FileUpload.js.map +1 -1
  29. package/cjs/form/file-upload/parts/dropzone/Dropzone.js +1 -1
  30. package/cjs/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
  31. package/cjs/form/file-upload/parts/dropzone/dropzone.types.d.ts +1 -1
  32. package/cjs/form/file-upload/parts/item/Item.d.ts +1 -1
  33. package/cjs/form/file-upload/parts/item/Item.js +1 -1
  34. package/cjs/form/file-upload/parts/item/Item.js.map +1 -1
  35. package/cjs/form/file-upload/parts/item/ItemIcon.js +1 -1
  36. package/cjs/form/file-upload/parts/item/ItemIcon.js.map +1 -1
  37. package/cjs/form/file-upload/utils/is-accepted-file-type.js +1 -1
  38. package/cjs/form/file-upload/utils/is-accepted-file-type.js.map +1 -1
  39. package/cjs/form/form-progress/FormProgress.d.ts +66 -0
  40. package/cjs/form/form-progress/FormProgress.js +85 -0
  41. package/cjs/form/form-progress/FormProgress.js.map +1 -0
  42. package/cjs/form/form-progress/index.d.ts +1 -0
  43. package/cjs/form/form-progress/index.js +11 -0
  44. package/cjs/form/form-progress/index.js.map +1 -0
  45. package/cjs/index.d.ts +2 -1
  46. package/cjs/index.js +3 -1
  47. package/cjs/index.js.map +1 -1
  48. package/cjs/layout/bleed/Bleed.d.ts +8 -4
  49. package/cjs/layout/bleed/Bleed.js.map +1 -1
  50. package/cjs/layout/box/Box.d.ts +16 -4
  51. package/cjs/layout/box/Box.js.map +1 -1
  52. package/cjs/layout/grid/HGrid.d.ts +7 -3
  53. package/cjs/layout/grid/HGrid.js.map +1 -1
  54. package/cjs/layout/stack/Stack.d.ts +3 -1
  55. package/cjs/layout/stack/Stack.js.map +1 -1
  56. package/cjs/layout/utilities/css.js +1 -1
  57. package/cjs/layout/utilities/css.js.map +1 -1
  58. package/cjs/list/List.d.ts +15 -3
  59. package/cjs/list/List.js +15 -0
  60. package/cjs/list/List.js.map +1 -1
  61. package/cjs/list/ListItem.d.ts +4 -11
  62. package/cjs/list/ListItem.js +3 -0
  63. package/cjs/list/ListItem.js.map +1 -1
  64. package/cjs/list/index.d.ts +2 -2
  65. package/cjs/list/index.js.map +1 -1
  66. package/cjs/list/types.d.ts +19 -5
  67. package/cjs/modal/Modal.js +4 -1
  68. package/cjs/modal/Modal.js.map +1 -1
  69. package/cjs/modal/dialog-polyfill.js +4 -1
  70. package/cjs/modal/dialog-polyfill.js.map +1 -1
  71. package/cjs/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.d.ts +6 -0
  72. package/cjs/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.js +36 -14
  73. package/cjs/overlays/dismissablelayer/DismissableLayer.js.map +1 -0
  74. package/{esm/overlay/dismiss → cjs/overlays/dismissablelayer}/util/dispatchCustomEvent.d.ts +1 -1
  75. package/cjs/overlays/dismissablelayer/util/dispatchCustomEvent.js.map +1 -0
  76. package/cjs/overlays/dismissablelayer/util/useEscapeKeydown.js.map +1 -0
  77. package/cjs/overlays/dismissablelayer/util/useFocusOutside.js.map +1 -0
  78. package/cjs/overlays/dismissablelayer/util/usePointerDownOutside.js.map +1 -0
  79. package/cjs/pagination/Pagination.js +1 -1
  80. package/cjs/pagination/Pagination.js.map +1 -1
  81. package/cjs/popover/Popover.js +1 -1
  82. package/cjs/popover/Popover.js.map +1 -1
  83. package/cjs/stepper/Step.d.ts +0 -5
  84. package/cjs/stepper/Step.js +8 -13
  85. package/cjs/stepper/Step.js.map +1 -1
  86. package/cjs/stepper/Stepper.d.ts +1 -1
  87. package/cjs/stepper/Stepper.js +13 -23
  88. package/cjs/stepper/Stepper.js.map +1 -1
  89. package/cjs/stepper/context.d.ts +6 -3
  90. package/cjs/stepper/context.js +9 -3
  91. package/cjs/stepper/context.js.map +1 -1
  92. package/cjs/table/AnimateHeight.js +1 -1
  93. package/cjs/table/AnimateHeight.js.map +1 -1
  94. package/cjs/tabs/parts/tablist/useScrollButtons.js +1 -1
  95. package/cjs/tabs/parts/tablist/useScrollButtons.js.map +1 -1
  96. package/cjs/timeline/AxisLabels.js +2 -4
  97. package/cjs/timeline/AxisLabels.js.map +1 -1
  98. package/cjs/util/debounce.js.map +1 -1
  99. package/cjs/util/hooks/descendants/utils.js +1 -3
  100. package/cjs/util/hooks/descendants/utils.js.map +1 -1
  101. package/cjs/util/i18n/get.js.map +1 -0
  102. package/cjs/util/i18n/i18n.context.js.map +1 -0
  103. package/cjs/util/i18n/i18n.types.js.map +1 -0
  104. package/{esm/form/file-upload → cjs/util}/i18n/locales/nb.d.ts +5 -0
  105. package/cjs/{form/file-upload → util}/i18n/locales/nb.js +5 -0
  106. package/cjs/util/i18n/locales/nb.js.map +1 -0
  107. package/cjs/util/i18n/merge.js.map +1 -0
  108. package/cjs/util/omit.js +2 -3
  109. package/cjs/util/omit.js.map +1 -1
  110. package/esm/chat/Bubble.d.ts +4 -4
  111. package/esm/chat/Chat.d.ts +6 -4
  112. package/esm/chat/Chat.js +1 -1
  113. package/esm/chat/Chat.js.map +1 -1
  114. package/esm/collapsible/parts/Collapsible.Trigger.d.ts +4 -0
  115. package/esm/collapsible/parts/Collapsible.Trigger.js +1 -1
  116. package/esm/collapsible/parts/Collapsible.Trigger.js.map +1 -1
  117. package/esm/date/monthpicker/MonthButton.js +2 -2
  118. package/esm/date/monthpicker/MonthButton.js.map +1 -1
  119. package/esm/date/utils/check-dates.d.ts +1 -1
  120. package/esm/date/utils/check-dates.js +1 -1
  121. package/esm/date/utils/check-dates.js.map +1 -1
  122. package/esm/date/utils/dates-disabled.js +1 -1
  123. package/esm/date/utils/dates-disabled.js.map +1 -1
  124. package/esm/date/utils/navigation.d.ts +1 -1
  125. package/esm/date/utils/navigation.js +1 -1
  126. package/esm/date/utils/navigation.js.map +1 -1
  127. package/esm/date/utils/parse-date.js +7 -11
  128. package/esm/date/utils/parse-date.js.map +1 -1
  129. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +17 -4
  130. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  131. package/esm/form/combobox/FilteredOptions/useVirtualFocus.js +1 -3
  132. package/esm/form/combobox/FilteredOptions/useVirtualFocus.js.map +1 -1
  133. package/esm/form/combobox/combobox-utils.js +1 -3
  134. package/esm/form/combobox/combobox-utils.js.map +1 -1
  135. package/esm/form/file-upload/FileUpload.context.d.ts +1 -1
  136. package/esm/form/file-upload/FileUpload.d.ts +1 -1
  137. package/esm/form/file-upload/FileUpload.js.map +1 -1
  138. package/esm/form/file-upload/parts/dropzone/Dropzone.js +1 -1
  139. package/esm/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
  140. package/esm/form/file-upload/parts/dropzone/dropzone.types.d.ts +1 -1
  141. package/esm/form/file-upload/parts/item/Item.d.ts +1 -1
  142. package/esm/form/file-upload/parts/item/Item.js +1 -1
  143. package/esm/form/file-upload/parts/item/Item.js.map +1 -1
  144. package/esm/form/file-upload/parts/item/ItemIcon.js +1 -1
  145. package/esm/form/file-upload/parts/item/ItemIcon.js.map +1 -1
  146. package/esm/form/file-upload/utils/is-accepted-file-type.js +1 -1
  147. package/esm/form/file-upload/utils/is-accepted-file-type.js.map +1 -1
  148. package/esm/form/form-progress/FormProgress.d.ts +66 -0
  149. package/esm/form/form-progress/FormProgress.js +56 -0
  150. package/esm/form/form-progress/FormProgress.js.map +1 -0
  151. package/esm/form/form-progress/index.d.ts +1 -0
  152. package/esm/form/form-progress/index.js +3 -0
  153. package/esm/form/form-progress/index.js.map +1 -0
  154. package/esm/index.d.ts +2 -1
  155. package/esm/index.js +1 -0
  156. package/esm/index.js.map +1 -1
  157. package/esm/layout/bleed/Bleed.d.ts +8 -4
  158. package/esm/layout/bleed/Bleed.js.map +1 -1
  159. package/esm/layout/box/Box.d.ts +16 -4
  160. package/esm/layout/box/Box.js.map +1 -1
  161. package/esm/layout/grid/HGrid.d.ts +7 -3
  162. package/esm/layout/grid/HGrid.js.map +1 -1
  163. package/esm/layout/stack/Stack.d.ts +3 -1
  164. package/esm/layout/stack/Stack.js.map +1 -1
  165. package/esm/layout/utilities/css.js +1 -1
  166. package/esm/layout/utilities/css.js.map +1 -1
  167. package/esm/list/List.d.ts +15 -3
  168. package/esm/list/List.js +15 -0
  169. package/esm/list/List.js.map +1 -1
  170. package/esm/list/ListItem.d.ts +4 -11
  171. package/esm/list/ListItem.js +3 -0
  172. package/esm/list/ListItem.js.map +1 -1
  173. package/esm/list/index.d.ts +2 -2
  174. package/esm/list/index.js.map +1 -1
  175. package/esm/list/types.d.ts +19 -5
  176. package/esm/modal/Modal.js +4 -1
  177. package/esm/modal/Modal.js.map +1 -1
  178. package/esm/modal/dialog-polyfill.js +4 -1
  179. package/esm/modal/dialog-polyfill.js.map +1 -1
  180. package/esm/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.d.ts +6 -0
  181. package/esm/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.js +37 -15
  182. package/esm/overlays/dismissablelayer/DismissableLayer.js.map +1 -0
  183. package/{cjs/overlay/dismiss → esm/overlays/dismissablelayer}/util/dispatchCustomEvent.d.ts +1 -1
  184. package/esm/overlays/dismissablelayer/util/dispatchCustomEvent.js.map +1 -0
  185. package/esm/overlays/dismissablelayer/util/useEscapeKeydown.js.map +1 -0
  186. package/esm/overlays/dismissablelayer/util/useFocusOutside.js.map +1 -0
  187. package/esm/overlays/dismissablelayer/util/usePointerDownOutside.js.map +1 -0
  188. package/esm/pagination/Pagination.js +1 -1
  189. package/esm/pagination/Pagination.js.map +1 -1
  190. package/esm/popover/Popover.js +1 -1
  191. package/esm/popover/Popover.js.map +1 -1
  192. package/esm/stepper/Step.d.ts +0 -5
  193. package/esm/stepper/Step.js +10 -15
  194. package/esm/stepper/Step.js.map +1 -1
  195. package/esm/stepper/Stepper.d.ts +1 -1
  196. package/esm/stepper/Stepper.js +14 -24
  197. package/esm/stepper/Stepper.js.map +1 -1
  198. package/esm/stepper/context.d.ts +6 -3
  199. package/esm/stepper/context.js +7 -2
  200. package/esm/stepper/context.js.map +1 -1
  201. package/esm/table/AnimateHeight.js +1 -1
  202. package/esm/table/AnimateHeight.js.map +1 -1
  203. package/esm/tabs/parts/tablist/useScrollButtons.js +1 -1
  204. package/esm/tabs/parts/tablist/useScrollButtons.js.map +1 -1
  205. package/esm/timeline/AxisLabels.js +2 -4
  206. package/esm/timeline/AxisLabels.js.map +1 -1
  207. package/esm/util/debounce.js.map +1 -1
  208. package/esm/util/hooks/descendants/utils.js +1 -3
  209. package/esm/util/hooks/descendants/utils.js.map +1 -1
  210. package/esm/util/i18n/get.js.map +1 -0
  211. package/esm/util/i18n/i18n.context.js.map +1 -0
  212. package/esm/util/i18n/i18n.types.js.map +1 -0
  213. package/{cjs/form/file-upload → esm/util}/i18n/locales/nb.d.ts +5 -0
  214. package/esm/{form/file-upload → util}/i18n/locales/nb.js +5 -0
  215. package/esm/util/i18n/locales/nb.js.map +1 -0
  216. package/esm/util/i18n/merge.js.map +1 -0
  217. package/esm/util/omit.js +2 -3
  218. package/esm/util/omit.js.map +1 -1
  219. package/package.json +13 -3
  220. package/src/chat/Bubble.tsx +4 -4
  221. package/src/chat/Chat.tsx +6 -4
  222. package/src/collapsible/parts/Collapsible.Trigger.tsx +5 -1
  223. package/src/date/monthpicker/MonthButton.tsx +6 -2
  224. package/src/date/utils/check-dates.ts +2 -2
  225. package/src/date/utils/dates-disabled.ts +3 -1
  226. package/src/date/utils/navigation.ts +3 -3
  227. package/src/date/utils/parse-date.ts +21 -15
  228. package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +23 -24
  229. package/src/form/combobox/FilteredOptions/useVirtualFocus.ts +2 -2
  230. package/src/form/combobox/combobox-utils.ts +5 -5
  231. package/src/form/file-upload/FileUpload.context.tsx +1 -1
  232. package/src/form/file-upload/FileUpload.tsx +1 -1
  233. package/src/form/file-upload/parts/dropzone/Dropzone.tsx +1 -1
  234. package/src/form/file-upload/parts/dropzone/dropzone.types.ts +1 -1
  235. package/src/form/file-upload/parts/item/Item.tsx +2 -2
  236. package/src/form/file-upload/parts/item/ItemIcon.tsx +3 -1
  237. package/src/form/file-upload/utils/is-accepted-file-type.ts +4 -1
  238. package/src/form/form-progress/FormProgress.tsx +152 -0
  239. package/src/form/form-progress/index.ts +7 -0
  240. package/src/index.ts +2 -1
  241. package/src/layout/bleed/Bleed.tsx +8 -4
  242. package/src/layout/box/Box.tsx +16 -4
  243. package/src/layout/grid/HGrid.tsx +7 -3
  244. package/src/layout/stack/Stack.tsx +5 -1
  245. package/src/layout/utilities/css.ts +3 -1
  246. package/src/list/List.tsx +15 -3
  247. package/src/list/ListItem.tsx +4 -15
  248. package/src/list/index.ts +2 -2
  249. package/src/list/types.ts +20 -5
  250. package/src/modal/Modal.tsx +6 -1
  251. package/src/modal/dialog-polyfill.ts +8 -2
  252. package/src/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.tsx +40 -19
  253. package/src/{overlay/dismiss → overlays/dismissablelayer}/util/dispatchCustomEvent.ts +1 -1
  254. package/src/pagination/Pagination.tsx +1 -1
  255. package/src/popover/Popover.tsx +1 -1
  256. package/src/stepper/Step.tsx +24 -38
  257. package/src/stepper/Stepper.tsx +30 -36
  258. package/src/stepper/context.ts +11 -4
  259. package/src/table/AnimateHeight.tsx +1 -1
  260. package/src/tabs/parts/tablist/useScrollButtons.ts +2 -2
  261. package/src/timeline/AxisLabels.tsx +5 -3
  262. package/src/util/__tests__/omit.test.ts +36 -0
  263. package/src/util/debounce.ts +1 -1
  264. package/src/util/hooks/descendants/utils.ts +2 -2
  265. package/src/{form/file-upload → util}/i18n/locales/nb.ts +5 -0
  266. package/src/util/omit.ts +5 -9
  267. package/cjs/form/file-upload/i18n/get.js.map +0 -1
  268. package/cjs/form/file-upload/i18n/i18n.context.js.map +0 -1
  269. package/cjs/form/file-upload/i18n/i18n.types.js.map +0 -1
  270. package/cjs/form/file-upload/i18n/locales/nb.js.map +0 -1
  271. package/cjs/form/file-upload/i18n/merge.js.map +0 -1
  272. package/cjs/overlay/dismiss/DismissableLayer.js.map +0 -1
  273. package/cjs/overlay/dismiss/util/dispatchCustomEvent.js.map +0 -1
  274. package/cjs/overlay/dismiss/util/useEscapeKeydown.js.map +0 -1
  275. package/cjs/overlay/dismiss/util/useFocusOutside.js.map +0 -1
  276. package/cjs/overlay/dismiss/util/usePointerDownOutside.js.map +0 -1
  277. package/esm/form/file-upload/i18n/get.js.map +0 -1
  278. package/esm/form/file-upload/i18n/i18n.context.js.map +0 -1
  279. package/esm/form/file-upload/i18n/i18n.types.js.map +0 -1
  280. package/esm/form/file-upload/i18n/locales/nb.js.map +0 -1
  281. package/esm/form/file-upload/i18n/merge.js.map +0 -1
  282. package/esm/overlay/dismiss/DismissableLayer.js.map +0 -1
  283. package/esm/overlay/dismiss/util/dispatchCustomEvent.js.map +0 -1
  284. package/esm/overlay/dismiss/util/useEscapeKeydown.js.map +0 -1
  285. package/esm/overlay/dismiss/util/useFocusOutside.js.map +0 -1
  286. package/esm/overlay/dismiss/util/usePointerDownOutside.js.map +0 -1
  287. /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/dispatchCustomEvent.js +0 -0
  288. /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.d.ts +0 -0
  289. /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.js +0 -0
  290. /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.d.ts +0 -0
  291. /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.js +0 -0
  292. /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.d.ts +0 -0
  293. /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.js +0 -0
  294. /package/cjs/{form/file-upload → util}/i18n/get.d.ts +0 -0
  295. /package/cjs/{form/file-upload → util}/i18n/get.js +0 -0
  296. /package/cjs/{form/file-upload → util}/i18n/i18n.context.d.ts +0 -0
  297. /package/cjs/{form/file-upload → util}/i18n/i18n.context.js +0 -0
  298. /package/cjs/{form/file-upload → util}/i18n/i18n.types.d.ts +0 -0
  299. /package/cjs/{form/file-upload → util}/i18n/i18n.types.js +0 -0
  300. /package/cjs/{form/file-upload → util}/i18n/merge.d.ts +0 -0
  301. /package/cjs/{form/file-upload → util}/i18n/merge.js +0 -0
  302. /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/dispatchCustomEvent.js +0 -0
  303. /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.d.ts +0 -0
  304. /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.js +0 -0
  305. /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.d.ts +0 -0
  306. /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.js +0 -0
  307. /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.d.ts +0 -0
  308. /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.js +0 -0
  309. /package/esm/{form/file-upload → util}/i18n/get.d.ts +0 -0
  310. /package/esm/{form/file-upload → util}/i18n/get.js +0 -0
  311. /package/esm/{form/file-upload → util}/i18n/i18n.context.d.ts +0 -0
  312. /package/esm/{form/file-upload → util}/i18n/i18n.context.js +0 -0
  313. /package/esm/{form/file-upload → util}/i18n/i18n.types.d.ts +0 -0
  314. /package/esm/{form/file-upload → util}/i18n/i18n.types.js +0 -0
  315. /package/esm/{form/file-upload → util}/i18n/merge.d.ts +0 -0
  316. /package/esm/{form/file-upload → util}/i18n/merge.js +0 -0
  317. /package/src/{overlay → overlays/dismissablelayer}/README.md +0 -0
  318. /package/src/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.ts +0 -0
  319. /package/src/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.ts +0 -0
  320. /package/src/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.ts +0 -0
  321. /package/src/{form/file-upload → util}/i18n/get.ts +0 -0
  322. /package/src/{form/file-upload → util}/i18n/i18n.context.test.tsx +0 -0
  323. /package/src/{form/file-upload → util}/i18n/i18n.context.ts +0 -0
  324. /package/src/{form/file-upload → util}/i18n/i18n.types.ts +0 -0
  325. /package/src/{form/file-upload → util}/i18n/merge.ts +0 -0
@@ -68,9 +68,9 @@ const useVirtualFocus = (
68
68
  const _currentIndex = elementsAbleToReceiveFocus.indexOf(activeElement);
69
69
  if (_currentIndex === elementsAbleToReceiveFocus.length - 1) {
70
70
  return;
71
- } else {
72
- _moveFocusAndScrollTo(elementsAbleToReceiveFocus[_currentIndex + 1]);
73
71
  }
72
+
73
+ _moveFocusAndScrollTo(elementsAbleToReceiveFocus[_currentIndex + 1]);
74
74
  };
75
75
 
76
76
  const moveFocusToTop = () => _moveFocusAndScrollTo(undefined);
@@ -10,12 +10,12 @@ const isInList = (option: ComboboxOption | string, list: ComboboxOption[]) => {
10
10
  return list.some(
11
11
  (listItem) => listItem.label === option || listItem.value === option,
12
12
  );
13
- } else {
14
- return list.some(
15
- (listItem) =>
16
- listItem.label === option.label && listItem.value === option.value,
17
- );
18
13
  }
14
+
15
+ return list.some(
16
+ (listItem) =>
17
+ listItem.label === option.label && listItem.value === option.value,
18
+ );
19
19
  };
20
20
 
21
21
  const toComboboxOption = (value: string): ComboboxOption => ({
@@ -1,5 +1,5 @@
1
1
  import { createContext } from "../../util/create-context";
2
- import { ComponentTranslation } from "./i18n/i18n.types";
2
+ import { ComponentTranslation } from "../../util/i18n/i18n.types";
3
3
 
4
4
  export type FileUploadLocaleContextProps = {
5
5
  translations?: ComponentTranslation<"FileUpload">;
@@ -1,7 +1,7 @@
1
1
  import cl from "clsx";
2
2
  import React, { HTMLAttributes, forwardRef } from "react";
3
+ import { ComponentTranslation } from "../../util/i18n/i18n.types";
3
4
  import { FileUploadLocaleContextProvider } from "./FileUpload.context";
4
- import { ComponentTranslation } from "./i18n/i18n.types";
5
5
  import Trigger from "./parts/Trigger";
6
6
  import Dropzone from "./parts/dropzone/Dropzone";
7
7
  import Item from "./parts/item/Item";
@@ -5,10 +5,10 @@ import { Button } from "../../../../button";
5
5
  import { BodyShort, ErrorMessage, Label } from "../../../../typography";
6
6
  import { composeEventHandlers } from "../../../../util/composeEventHandlers";
7
7
  import { useId } from "../../../../util/hooks";
8
+ import { useI18n } from "../../../../util/i18n/i18n.context";
8
9
  import { omit } from "../../../../util/omit";
9
10
  import { useFormField } from "../../../useFormField";
10
11
  import { useFileUploadTranslation } from "../../FileUpload.context";
11
- import { useI18n } from "../../i18n/i18n.context";
12
12
  import { useFileUpload } from "../../useFileUpload";
13
13
  import { FileUploadDropzoneProps } from "./dropzone.types";
14
14
  import { useDropzone } from "./useDropzone";
@@ -1,6 +1,6 @@
1
+ import { ComponentTranslation } from "../../../../util/i18n/i18n.types";
1
2
  import { FormFieldProps } from "../../../useFormField";
2
3
  import { FileUploadBaseProps } from "../../FileUpload.types";
3
- import { ComponentTranslation } from "../../i18n/i18n.types";
4
4
 
5
5
  export interface FileUploadDropzoneProps
6
6
  extends FileUploadBaseProps,
@@ -3,9 +3,9 @@ import React, { MouseEvent, forwardRef } from "react";
3
3
  import { ExclamationmarkTriangleIcon } from "@navikt/aksel-icons";
4
4
  import { BodyShort } from "../../../../typography";
5
5
  import { OverridableComponent } from "../../../../util";
6
+ import { useI18n } from "../../../../util/i18n/i18n.context";
7
+ import { ComponentTranslation } from "../../../../util/i18n/i18n.types";
6
8
  import { useFileUploadTranslation } from "../../FileUpload.context";
7
- import { useI18n } from "../../i18n/i18n.context";
8
- import { ComponentTranslation } from "../../i18n/i18n.types";
9
9
  import { FileItem } from "./Item.types";
10
10
  import ItemButton from "./ItemButton";
11
11
  import ItemIcon from "./ItemIcon";
@@ -30,7 +30,9 @@ function ItemIcon({ isLoading, file, showError }: ItemIconProps) {
30
30
  <Loader size="large" />
31
31
  </div>
32
32
  );
33
- } else if (showError) {
33
+ }
34
+
35
+ if (showError) {
34
36
  return (
35
37
  <div className="navds-file-item__icon">
36
38
  <FileXMarkIcon {...iconProps} />
@@ -15,11 +15,14 @@ export function isAcceptedFileType(
15
15
 
16
16
  if (isExtensionType) {
17
17
  return file.name.toLowerCase().endsWith(validType.toLowerCase());
18
- } else if (isWildcardMimeType) {
18
+ }
19
+
20
+ if (isWildcardMimeType) {
19
21
  const baseMimeType = mimeType.replace(/\/.*$/, "");
20
22
  const baseValidType = validType.replace(/\/.*$/, "");
21
23
  return baseMimeType === baseValidType;
22
24
  }
25
+
23
26
  return mimeType === validType;
24
27
  });
25
28
  }
@@ -0,0 +1,152 @@
1
+ import React, { forwardRef } from "react";
2
+ import { ChevronDownIcon } from "@navikt/aksel-icons";
3
+ import Button from "../../button/Button";
4
+ import Collapsible from "../../collapsible/Collapsible";
5
+ import { HStack } from "../../layout/stack";
6
+ import { ProgressBar } from "../../progress-bar";
7
+ import { Stepper, StepperStepProps } from "../../stepper";
8
+ import { BodyShort } from "../../typography";
9
+ import { useI18n } from "../../util/i18n/i18n.context";
10
+ import { ComponentTranslation } from "../../util/i18n/i18n.types";
11
+
12
+ export interface FormProgressProps
13
+ extends React.HTMLAttributes<HTMLDivElement> {
14
+ /**
15
+ * Total number of steps.
16
+ */
17
+ totalSteps: number;
18
+ /**
19
+ * Current active step.
20
+ *
21
+ * Index starts at 1, not 0.
22
+ */
23
+ activeStep: number;
24
+ /**
25
+ * Shows Stepper if `true`, hides if `false`.
26
+ * Using this prop removes automatic control of open-state.
27
+ */
28
+ open?: boolean;
29
+ /**
30
+ * Callback for current open-state
31
+ */
32
+ onOpenChange?: (open: boolean) => void;
33
+ /**
34
+ * Should contain <FormProgress.Step> elements.
35
+ */
36
+ children: React.ReactNode;
37
+ /**
38
+ * Callback for next `activeStep`.
39
+ *
40
+ * Index starts at 1, not 0.
41
+ */
42
+ onStepChange?: (step: number) => void;
43
+ /**
44
+ * Makes Stepper non-interactive if false.
45
+ * @default true
46
+ */
47
+ interactiveSteps?: boolean;
48
+ /**
49
+ * i18n API for customizing texts and labels.
50
+ */
51
+ translations?: ComponentTranslation<"FormProgress">;
52
+ }
53
+
54
+ export type FormProgressStepProps = StepperStepProps;
55
+
56
+ interface FormProgressComponent
57
+ extends React.ForwardRefExoticComponent<
58
+ FormProgressProps & React.RefAttributes<HTMLDivElement>
59
+ > {
60
+ /**
61
+ * To be used inside `<FormProgress>`.
62
+ */
63
+ Step: typeof Stepper.Step;
64
+ }
65
+
66
+ /**
67
+ * Component for visualizing progression in a form with multiple steps.
68
+ *
69
+ * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/formprogress)
70
+ * @see 🏷️ {@link FormProgressProps}
71
+ *
72
+ * @example
73
+ * <FormProgress activeStep={2} totalSteps={3}>
74
+ * <FormProgress.Step completed href="#">Children</FormProgress.Step>
75
+ * <FormProgress.Step href="#">Personal information</FormProgress.Step>
76
+ * <FormProgress.Step interactive={false}>Summary</FormProgress.Step>
77
+ * </FormProgress>
78
+ */
79
+ export const FormProgress = forwardRef<HTMLDivElement, FormProgressProps>(
80
+ (
81
+ {
82
+ totalSteps,
83
+ activeStep,
84
+ open,
85
+ onOpenChange,
86
+ children,
87
+ onStepChange,
88
+ interactiveSteps,
89
+ translations,
90
+ ...rest
91
+ }: FormProgressProps,
92
+ ref,
93
+ ) => {
94
+ const translate = useI18n("FormProgress", translations);
95
+
96
+ return (
97
+ <div ref={ref} {...rest}>
98
+ <ProgressBar
99
+ aria-hidden
100
+ value={activeStep}
101
+ valueMax={totalSteps}
102
+ className="navds-form-progress__bar"
103
+ />
104
+
105
+ <Collapsible lazy open={open} onOpenChange={onOpenChange}>
106
+ <HStack justify="space-between" align="center">
107
+ <BodyShort as="span">
108
+ {translate("step", {
109
+ replacements: { activeStep, totalSteps },
110
+ })}
111
+ </BodyShort>
112
+ <Collapsible.Trigger asChild aria-expanded={undefined}>
113
+ <Button
114
+ variant="tertiary"
115
+ size="small"
116
+ className="navds-form-progress__button"
117
+ icon={<ChevronDownIcon aria-hidden />}
118
+ >
119
+ <span className="navds-form-progress__btn-txt-hide">
120
+ {translate("hideAllSteps")}
121
+ </span>
122
+ <span className="navds-form-progress__btn-txt-show">
123
+ {translate("showAllSteps")}
124
+ </span>
125
+ </Button>
126
+ </Collapsible.Trigger>
127
+ </HStack>
128
+
129
+ <Collapsible.Content className="navds-form-progress__collapsible">
130
+ <div className="navds-form-progress__collapsible-content">
131
+ <div className="navds-form-progress__stepper">
132
+ <Stepper
133
+ activeStep={activeStep}
134
+ onStepChange={onStepChange}
135
+ interactive={interactiveSteps}
136
+ >
137
+ {children}
138
+ </Stepper>
139
+ </div>
140
+ </div>
141
+ </Collapsible.Content>
142
+ </Collapsible>
143
+ </div>
144
+ );
145
+ },
146
+ ) as FormProgressComponent;
147
+
148
+ FormProgress.Step = Stepper.Step;
149
+
150
+ export const FormProgressStep = Stepper.Step;
151
+
152
+ export default FormProgress;
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ export {
3
+ default as FormProgress,
4
+ type FormProgressProps,
5
+ FormProgressStep,
6
+ type FormProgressStepProps,
7
+ } from "./FormProgress";
package/src/index.ts CHANGED
@@ -53,7 +53,7 @@ export {
53
53
  type VStackProps,
54
54
  } from "./layout/stack";
55
55
  export { Link, type LinkProps } from "./link";
56
- export { List, type ListProps } from "./list";
56
+ export { List, type ListProps, type ListItemProps } from "./list";
57
57
  export { Loader, type LoaderProps } from "./loader";
58
58
  export { Modal, type ModalProps } from "./modal";
59
59
  export { Pagination, type PaginationProps } from "./pagination";
@@ -141,6 +141,7 @@ export {
141
141
  type FilesPartitioned,
142
142
  } from "./form/file-upload";
143
143
  export { FormSummary, type FormSummaryProps } from "./form/form-summary";
144
+ export { FormProgress, type FormProgressProps } from "./form/form-progress";
144
145
  export {
145
146
  Radio,
146
147
  RadioGroup,
@@ -8,8 +8,10 @@ export type BleedSpacingInline = "0" | "full" | "px" | SpacingScale;
8
8
  export type BleedSpacingBlock = "0" | "px" | SpacingScale;
9
9
 
10
10
  export interface BleedProps extends React.HTMLAttributes<HTMLDivElement> {
11
- /** **Negative** horizontal margin around children.
12
- * Accepts a spacing token or an object of spacing tokens for different breakpoints.
11
+ /**
12
+ * **Negative** horizontal margin around children.
13
+ * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
14
+ * or an object of spacing tokens for different breakpoints.
13
15
  *
14
16
  * The `px` value is useful to nudge by just 1px.
15
17
  * The `full` value is used to extend the margin to the full width of the parent.
@@ -22,8 +24,10 @@ export interface BleedProps extends React.HTMLAttributes<HTMLDivElement> {
22
24
  marginInline?: ResponsiveProp<
23
25
  BleedSpacingInline | `${BleedSpacingInline} ${BleedSpacingInline}`
24
26
  >;
25
- /** **Negative** vertical margin around children.
26
- * Accepts a spacing token or an object of spacing tokens for different breakpoints.
27
+ /**
28
+ * **Negative** vertical margin around children.
29
+ * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
30
+ * or an object of spacing tokens for different breakpoints.
27
31
  *
28
32
  * The `px` value is useful to nudge by just 1px.
29
33
  * This prop does **not** accept the `full` value.
@@ -17,7 +17,10 @@ export interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
17
17
  background?: BackgroundToken;
18
18
  /** CSS `border-color` property. Accepts a color token. */
19
19
  borderColor?: BorderColorToken;
20
- /** CSS `border-radius` property. Accepts a radius token, or an object of radius tokens for different breakpoints.
20
+ /**
21
+ * CSS `border-radius` property.
22
+ * Accepts a [radius token](https://aksel.nav.no/grunnleggende/styling/design-tokens#6d79c5605d31)
23
+ * or an object of radius tokens for different breakpoints.
21
24
  * @example
22
25
  * borderRadius='full'
23
26
  * borderRadius='0 full large small'
@@ -31,13 +34,19 @@ export interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
31
34
  * borderWidth='1 2 3 4'
32
35
  */
33
36
  borderWidth?: SpaceDelimitedAttribute<"0" | "1" | "2" | "3" | "4" | "5">;
34
- /** Padding around children. Accepts a spacing token or an object of spacing tokens for different breakpoints.
37
+ /**
38
+ * Padding around children.
39
+ * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
40
+ * or an object of spacing tokens for different breakpoints.
35
41
  * @example
36
42
  * padding='4'
37
43
  * padding={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
38
44
  */
39
45
  padding?: ResponsiveProp<SpacingScale>;
40
- /** Horizontal padding around children. Accepts a spacing token or an object of spacing tokens for different breakpoints.
46
+ /**
47
+ * Horizontal padding around children.
48
+ * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
49
+ * or an object of spacing tokens for different breakpoints.
41
50
  * @example
42
51
  * paddingInline='4'
43
52
  * paddingInline='4 5'
@@ -46,7 +55,10 @@ export interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
46
55
  paddingInline?: ResponsiveProp<
47
56
  SpacingScale | `${SpacingScale} ${SpacingScale}`
48
57
  >;
49
- /** Vertical padding around children. Accepts a spacing token or an object of spacing tokens for different breakpoints.
58
+ /**
59
+ * Vertical padding around children.
60
+ * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
61
+ * or an object of spacing tokens for different breakpoints.
50
62
  * @example
51
63
  * paddingBlock='4'
52
64
  * paddingBlock='4 5'
@@ -6,7 +6,7 @@ import { ResponsiveProp, SpacingScale } from "../utilities/types";
6
6
  export interface HGridProps extends HTMLAttributes<HTMLDivElement> {
7
7
  children: React.ReactNode;
8
8
  /**
9
- * Number of columns to display. Can be a number, a string with a unit, or tokens for specific breakpoints.
9
+ * Number of columns to display. Can be a number, a string, or an object with values for specific breakpoints.
10
10
  * Sets `grid-template-columns`, so `fr`, `minmax` etc. works.
11
11
  * @example
12
12
  * columns={{ sm: 1, md: 1, lg: "1fr auto", xl: "1fr auto"}}
@@ -14,12 +14,16 @@ export interface HGridProps extends HTMLAttributes<HTMLDivElement> {
14
14
  * columns="repeat(3, minmax(0, 1fr))"
15
15
  */
16
16
  columns?: ResponsiveProp<number | string>;
17
- /** Spacing between columns. Based on spacing-tokens.
17
+ /**
18
+ * Spacing between columns.
19
+ * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
20
+ * or an object of spacing tokens for different breakpoints.
18
21
  * @example
19
22
  * gap="6"
23
+ * gap="8 4"
20
24
  * gap={{ sm: "2", md: "2", lg: "6", xl: "6"}}
21
25
  */
22
- gap?: ResponsiveProp<SpacingScale>;
26
+ gap?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
23
27
  /**
24
28
  * Vertical alignment of children. Elements will by default stretch to the height of parent-element.
25
29
  */
@@ -35,6 +35,8 @@ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
35
35
  wrap?: boolean;
36
36
  /**
37
37
  * CSS `gap` property.
38
+ * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
39
+ * or an object of spacing tokens for different breakpoints.
38
40
  *
39
41
  * @example
40
42
  * gap='4'
@@ -49,7 +51,9 @@ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
49
51
  * direction='row'
50
52
  * direction={{xs: 'row', sm: 'column'}}
51
53
  */
52
- direction?: ResponsiveProp<"row" | "column">;
54
+ direction?: ResponsiveProp<
55
+ "row" | "column" | "row-reverse" | "column-reverse"
56
+ >;
53
57
  }
54
58
 
55
59
  export const Stack: OverridableComponent<StackProps, HTMLDivElement> =
@@ -44,7 +44,9 @@ const translateTokenStringToCSS = (
44
44
  if (componentProp === "margin-inline" && x === "full") {
45
45
  const width = 100 / arr.length;
46
46
  return `calc((100vw - ${width}%)/-2)`;
47
- } else if (componentProp === "padding-inline" && x === "full") {
47
+ }
48
+
49
+ if (componentProp === "padding-inline" && x === "full") {
48
50
  const width = 100 / arr.length;
49
51
  return `calc((100vw - ${width}%)/2)`;
50
52
  }
package/src/list/List.tsx CHANGED
@@ -10,12 +10,24 @@ export interface ListComponent
10
10
  extends React.ForwardRefExoticComponent<
11
11
  ListProps & React.RefAttributes<HTMLDivElement>
12
12
  > {
13
- /**
14
- * @see 🏷️ {@link ListItemProps}
15
- */
16
13
  Item: typeof ListItem;
17
14
  }
18
15
 
16
+ /**
17
+ * A list component
18
+ *
19
+ * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/list)
20
+ * @see 🏷️ {@link ListProps | Props}
21
+ *
22
+ * @example
23
+ * ```jsx
24
+ * <List>
25
+ * <List.Item>Coffee</List.Item>
26
+ * <List.Item>Tea</List.Item>
27
+ * <List.Item>Milk</List.Item>
28
+ * </List>
29
+ * ```
30
+ */
19
31
  export const List = forwardRef<HTMLDivElement, ListProps>(
20
32
  (
21
33
  {
@@ -2,22 +2,11 @@ import cl from "clsx";
2
2
  import React, { forwardRef, useContext } from "react";
3
3
  import { BodyShort, Label } from "../typography";
4
4
  import { ListContext } from "./context";
5
+ import { ListItemProps } from "./types";
5
6
 
6
- export interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
7
- /**
8
- * Content for description of the list item
9
- */
10
- children: React.ReactNode;
11
- /**
12
- * Title for the list item
13
- */
14
- title?: string;
15
- /*
16
- * Icon to be used as list marker for unordered lists.
17
- */
18
- icon?: React.ReactNode;
19
- }
20
-
7
+ /**
8
+ * @see 🏷️ {@link ListItemProps}
9
+ */
21
10
  export const ListItem = forwardRef<HTMLLIElement, ListItemProps>(
22
11
  ({ className, children, title, icon, ...rest }, ref) => {
23
12
  const { listType, size } = useContext(ListContext);
package/src/list/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  export { default as List } from "./List";
3
- export type { ListProps } from "./types";
4
- export { default as ListItem, type ListItemProps } from "./ListItem";
3
+ export type { ListProps, ListItemProps } from "./types";
4
+ export { default as ListItem } from "./ListItem";
package/src/list/types.ts CHANGED
@@ -1,26 +1,41 @@
1
1
  export interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
2
2
  children: React.ReactNode;
3
3
  /**
4
- * HTML list element to render
4
+ * HTML list element to render.
5
5
  * @default "ul"
6
6
  */
7
7
  as?: "ul" | "ol";
8
8
  /**
9
- * List heading title
9
+ * List heading title.
10
10
  */
11
11
  title?: string;
12
12
  /**
13
- * List heading description
13
+ * List heading description.
14
14
  */
15
15
  description?: string;
16
16
  /**
17
- * Allows setting a different HTML h-tag
17
+ * Allows setting a different HTML h-tag.
18
18
  * @default "h3"
19
19
  */
20
20
  headingTag?: React.ElementType<any>;
21
21
  /**
22
- * Changes padding, height and font-size
22
+ * Changes padding, height and font-size.
23
23
  * @default "medium"
24
24
  */
25
25
  size?: "medium" | "small";
26
26
  }
27
+
28
+ export interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
29
+ /**
30
+ * List item content.
31
+ */
32
+ children: React.ReactNode;
33
+ /**
34
+ * List item title.
35
+ */
36
+ title?: string;
37
+ /**
38
+ * Icon to be used instead of bullet (unordered lists only).
39
+ */
40
+ icon?: React.ReactNode;
41
+ }
@@ -21,6 +21,8 @@ import {
21
21
  import dialogPolyfill, { needPolyfill } from "./dialog-polyfill";
22
22
  import { ModalProps } from "./types";
23
23
 
24
+ const polyfillClassName = "navds-modal--polyfilled";
25
+
24
26
  interface ModalComponent
25
27
  extends React.ForwardRefExoticComponent<
26
28
  ModalProps & React.RefAttributes<HTMLDialogElement>
@@ -115,6 +117,9 @@ export const Modal = forwardRef<HTMLDialogElement, ModalProps>(
115
117
  // We check both to avoid activating polyfill twice when not using portal.
116
118
  if (needPolyfill && modalRef.current && portalNode) {
117
119
  dialogPolyfill.registerDialog(modalRef.current);
120
+
121
+ // Force-add the "polyfilled" class in case of SSR (needPolyfill will always be false on the server)
122
+ modalRef.current.classList.add(polyfillClassName);
118
123
  }
119
124
  // We set autofocus on the dialog element to prevent the default behavior where first focusable element gets focus when modal is opened.
120
125
  // This is mainly to fix an edge case where having a Tooltip as the first focusable element would make it activate when you open the modal.
@@ -142,7 +147,7 @@ export const Modal = forwardRef<HTMLDialogElement, ModalProps>(
142
147
  typeof width === "string" && ["small", "medium"].includes(width);
143
148
 
144
149
  const mergedClassName = cl("navds-modal", className, {
145
- "navds-modal--polyfilled": needPolyfill,
150
+ polyfillClassName: needPolyfill,
146
151
  "navds-modal--autowidth": !width,
147
152
  [`navds-modal--${width}`]: isWidthPreset,
148
153
  });
@@ -260,7 +260,7 @@ function dialogPolyfillInfo(dialog) {
260
260
  removed ? this.downgradeModal() : this.maybeHideModal();
261
261
  removed = false;
262
262
  }.bind(this);
263
- var timeout;
263
+ var timeout: ReturnType<typeof setTimeout>;
264
264
  var delayModel = function (ev) {
265
265
  if (ev.target !== dialog) {
266
266
  return;
@@ -631,12 +631,16 @@ dialogPolyfill.DialogManager = function () {
631
631
  this.mo_ = new MutationObserver(function (records) {
632
632
  var removed = [];
633
633
  records.forEach(function (rec) {
634
+ // biome-ignore lint/suspicious/noImplicitAnyLet: Reduntant to type c in this scenario
634
635
  for (var i = 0, c; (c = rec.removedNodes[i]); ++i) {
635
636
  if (!(c instanceof Element)) {
636
637
  continue;
637
- } else if (c.localName === "dialog") {
638
+ }
639
+
640
+ if (c.localName === "dialog") {
638
641
  removed.push(c);
639
642
  }
643
+
640
644
  removed = removed.concat(c.querySelectorAll("dialog"));
641
645
  }
642
646
  });
@@ -675,6 +679,7 @@ dialogPolyfill.DialogManager.prototype.unblockDocument = function () {
675
679
  dialogPolyfill.DialogManager.prototype.updateStacking = function () {
676
680
  var zIndex = this.zIndexHigh_;
677
681
 
682
+ // biome-ignore lint/suspicious/noImplicitAnyLet: Reduntant to type dpi in this scenario
678
683
  for (var i = 0, dpi; (dpi = this.pendingDialogStack[i]); ++i) {
679
684
  dpi.updateZIndex(--zIndex, --zIndex);
680
685
  if (i === 0) {
@@ -700,6 +705,7 @@ dialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function (
700
705
  candidate,
701
706
  ) {
702
707
  while ((candidate = findNearestDialog(candidate))) {
708
+ // biome-ignore lint/suspicious/noImplicitAnyLet: Reduntant to type dpi in this scenario
703
709
  for (var i = 0, dpi; (dpi = this.pendingDialogStack[i]); ++i) {
704
710
  if (dpi.dialog === candidate) {
705
711
  return i === 0; // only valid if top-most