@scania/tegel 1.0.0 → 1.0.3

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 (558) hide show
  1. package/README.md +178 -178
  2. package/dist/cjs/dfs-babd18a6.js +29 -0
  3. package/dist/cjs/generateUniqueId-56da4810.js +28 -0
  4. package/dist/cjs/hasSlot-1c90e9ba.js +11 -0
  5. package/dist/cjs/{index-2a60e106.js → index-862c9693.js} +5 -5
  6. package/dist/cjs/inheritAriaAttributes-640b1abb.js +78 -0
  7. package/dist/cjs/inheritAttributes-845f5217.js +27 -0
  8. package/dist/cjs/isHeadingElement-d31dde38.js +71 -0
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/tds-accordion-item.cjs.entry.js +6 -6
  11. package/dist/cjs/tds-accordion.cjs.entry.js +1 -1
  12. package/dist/cjs/tds-badge.cjs.entry.js +1 -1
  13. package/dist/cjs/tds-banner.cjs.entry.js +7 -15
  14. package/dist/cjs/tds-block.cjs.entry.js +5 -3
  15. package/dist/cjs/tds-body-cell.cjs.entry.js +1 -1
  16. package/dist/cjs/tds-breadcrumb.cjs.entry.js +1 -1
  17. package/dist/cjs/tds-breadcrumbs.cjs.entry.js +1 -1
  18. package/dist/cjs/tds-button.cjs.entry.js +4 -4
  19. package/dist/cjs/tds-card.cjs.entry.js +11 -10
  20. package/dist/cjs/tds-checkbox.cjs.entry.js +4 -4
  21. package/dist/cjs/tds-chip.cjs.entry.js +7 -6
  22. package/dist/cjs/tds-core-header-item_2.cjs.entry.js +3 -3
  23. package/dist/cjs/tds-datetime.cjs.entry.js +10 -10
  24. package/dist/cjs/tds-divider.cjs.entry.js +1 -1
  25. package/dist/cjs/tds-dropdown-option.cjs.entry.js +9 -8
  26. package/dist/cjs/tds-dropdown.cjs.entry.js +195 -69
  27. package/dist/cjs/tds-folder-tab.cjs.entry.js +2 -2
  28. package/dist/cjs/tds-folder-tabs.cjs.entry.js +1 -1
  29. package/dist/cjs/tds-footer-group.cjs.entry.js +3 -3
  30. package/dist/cjs/tds-footer-item.cjs.entry.js +1 -1
  31. package/dist/cjs/tds-footer.cjs.entry.js +5 -5
  32. package/dist/cjs/tds-header-brand-symbol.cjs.entry.js +1 -1
  33. package/dist/cjs/tds-header-cell.cjs.entry.js +1 -1
  34. package/dist/cjs/tds-header-dropdown-list-item.cjs.entry.js +1 -1
  35. package/dist/cjs/tds-header-dropdown-list-user.cjs.entry.js +1 -1
  36. package/dist/cjs/tds-header-dropdown-list.cjs.entry.js +4 -3
  37. package/dist/cjs/tds-header-dropdown.cjs.entry.js +3 -3
  38. package/dist/cjs/tds-header-hamburger.cjs.entry.js +4 -3
  39. package/dist/cjs/tds-header-launcher-button.cjs.entry.js +4 -3
  40. package/dist/cjs/tds-header-launcher-grid-item.cjs.entry.js +1 -1
  41. package/dist/cjs/tds-header-launcher-grid-title.cjs.entry.js +3 -3
  42. package/dist/cjs/tds-header-launcher-grid.cjs.entry.js +5 -4
  43. package/dist/cjs/tds-header-launcher-list-item.cjs.entry.js +1 -1
  44. package/dist/cjs/tds-header-launcher-list-title.cjs.entry.js +3 -3
  45. package/dist/cjs/tds-header-launcher-list.cjs.entry.js +3 -3
  46. package/dist/cjs/tds-header-launcher.cjs.entry.js +6 -4
  47. package/dist/cjs/tds-header-title.cjs.entry.js +1 -1
  48. package/dist/cjs/tds-header.cjs.entry.js +21 -5
  49. package/dist/cjs/tds-icon.cjs.entry.js +5 -3
  50. package/dist/cjs/tds-inline-tab.cjs.entry.js +2 -2
  51. package/dist/cjs/tds-inline-tabs.cjs.entry.js +1 -7
  52. package/dist/cjs/tds-link.cjs.entry.js +4 -4
  53. package/dist/cjs/tds-message.cjs.entry.js +4 -4
  54. package/dist/cjs/tds-modal.cjs.entry.js +5 -5
  55. package/dist/cjs/tds-navigation-tab.cjs.entry.js +2 -2
  56. package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -4
  57. package/dist/cjs/tds-popover-canvas.cjs.entry.js +3 -3
  58. package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
  59. package/dist/cjs/tds-popover-menu-item.cjs.entry.js +1 -1
  60. package/dist/cjs/tds-popover-menu.cjs.entry.js +3 -3
  61. package/dist/cjs/tds-radio-button.cjs.entry.js +3 -3
  62. package/dist/cjs/tds-side-menu-close-button.cjs.entry.js +4 -3
  63. package/dist/cjs/tds-side-menu-collapse-button.cjs.entry.js +1 -1
  64. package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +1 -1
  65. package/dist/cjs/tds-side-menu-dropdown-list.cjs.entry.js +1 -1
  66. package/dist/cjs/tds-side-menu-dropdown.cjs.entry.js +1 -1
  67. package/dist/cjs/tds-side-menu-item.cjs.entry.js +3 -3
  68. package/dist/cjs/tds-side-menu-overlay.cjs.entry.js +1 -1
  69. package/dist/cjs/tds-side-menu-user-image_2.cjs.entry.js +1 -1
  70. package/dist/cjs/tds-side-menu-user.cjs.entry.js +1 -1
  71. package/dist/cjs/tds-side-menu.cjs.entry.js +1 -1
  72. package/dist/cjs/tds-slider.cjs.entry.js +15 -9
  73. package/dist/cjs/tds-spinner.cjs.entry.js +1 -1
  74. package/dist/cjs/tds-step.cjs.entry.js +1 -1
  75. package/dist/cjs/tds-stepper.cjs.entry.js +3 -3
  76. package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +1 -1
  77. package/dist/cjs/tds-table-body-row.cjs.entry.js +1 -1
  78. package/dist/cjs/tds-table-body.cjs.entry.js +1 -1
  79. package/dist/cjs/tds-table-footer.cjs.entry.js +2 -2
  80. package/dist/cjs/tds-table-header.cjs.entry.js +1 -1
  81. package/dist/cjs/tds-table-toolbar.cjs.entry.js +1 -1
  82. package/dist/cjs/tds-table.cjs.entry.js +3 -3
  83. package/dist/cjs/tds-text-field.cjs.entry.js +16 -16
  84. package/dist/cjs/tds-textarea.cjs.entry.js +11 -11
  85. package/dist/cjs/tds-toast.cjs.entry.js +9 -8
  86. package/dist/cjs/tds-toggle.cjs.entry.js +3 -3
  87. package/dist/cjs/tds-tooltip.cjs.entry.js +3 -3
  88. package/dist/cjs/tegel.cjs.js +3 -3
  89. package/dist/collection/collection-manifest.json +2 -2
  90. package/dist/collection/components/accordion/accordion-item/accordion-item.js +6 -6
  91. package/dist/collection/components/accordion/accordion.stories.js +22 -22
  92. package/dist/collection/components/badge/badge.stories.js +31 -31
  93. package/dist/collection/components/banner/banner.js +4 -26
  94. package/dist/collection/components/banner/banner.stories.js +17 -20
  95. package/dist/collection/components/block/block.js +4 -2
  96. package/dist/collection/components/block/block.stories.js +10 -10
  97. package/dist/collection/components/breadcrumbs/breadcrumbs.stories.js +13 -13
  98. package/dist/collection/components/button/button.js +1 -1
  99. package/dist/collection/components/button/button.stories.js +27 -27
  100. package/dist/collection/components/card/card.css +1 -0
  101. package/dist/collection/components/card/card.js +4 -3
  102. package/dist/collection/components/card/card.stories.js +32 -32
  103. package/dist/collection/components/checkbox/checkbox.css +14 -0
  104. package/dist/collection/components/checkbox/checkbox.js +2 -2
  105. package/dist/collection/components/checkbox/checkbox.stories.js +23 -23
  106. package/dist/collection/components/chip/chip.js +7 -6
  107. package/dist/collection/components/chip/chip.stories.js +94 -94
  108. package/dist/collection/components/datetime/datetime.js +9 -9
  109. package/dist/collection/components/datetime/datetime.stories.js +41 -41
  110. package/dist/collection/components/divider/divider.stories.js +5 -5
  111. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.css +4 -4
  112. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +8 -7
  113. package/dist/collection/components/dropdown/dropdown.css +7 -2
  114. package/dist/collection/components/dropdown/dropdown.js +165 -75
  115. package/dist/collection/components/dropdown/dropdown.stories.js +54 -58
  116. package/dist/collection/components/footer/footer-group/footer-group.js +2 -2
  117. package/dist/collection/components/footer/footer.js +1 -1
  118. package/dist/collection/components/footer/footer.stories.js +94 -94
  119. package/dist/collection/components/header/header-dropdown/header-dropdown.js +2 -2
  120. package/dist/collection/components/header/header-dropdown-list/header-dropdown-list.js +2 -1
  121. package/dist/collection/components/header/header-hamburger/header-hamburger.js +1 -1
  122. package/dist/collection/components/header/header-item/header-item.js +2 -2
  123. package/dist/collection/components/header/header-launcher/header-launcher.js +2 -1
  124. package/dist/collection/components/header/header-launcher-button/header-launcher-button.js +2 -2
  125. package/dist/collection/components/header/header-launcher-grid/header-launcher-grid.js +2 -1
  126. package/dist/collection/components/header/header-launcher-grid-title/header-launcher-grid-title.js +1 -1
  127. package/dist/collection/components/header/header-launcher-list/header-launcher-list.js +1 -1
  128. package/dist/collection/components/header/header-launcher-list-title/header-launcher-list-title.js +1 -1
  129. package/dist/collection/components/header/header.js +2 -1
  130. package/dist/collection/components/header/header.stories.js +32 -32
  131. package/dist/collection/components/icon/icon.js +20 -1
  132. package/dist/collection/components/icon/icon.stories.js +3 -3
  133. package/dist/collection/components/icon/iconsArray.js +115 -115
  134. package/dist/collection/components/link/link.js +3 -3
  135. package/dist/collection/components/link/link.stories.js +10 -10
  136. package/dist/collection/components/message/message.js +3 -3
  137. package/dist/collection/components/message/message.stories.js +19 -19
  138. package/dist/collection/components/modal/modal.js +2 -2
  139. package/dist/collection/components/modal/modal.stories.js +28 -28
  140. package/dist/collection/components/popover-canvas/popover-canvas.js +2 -2
  141. package/dist/collection/components/popover-canvas/popover-canvas.stories.js +34 -34
  142. package/dist/collection/components/popover-core/popover-core.js +1 -1
  143. package/dist/collection/components/popover-menu/popover-menu.js +2 -2
  144. package/dist/collection/components/popover-menu/popover-menu.stories.js +59 -61
  145. package/dist/collection/components/radio-button/radio-button.js +3 -3
  146. package/dist/collection/components/radio-button/radio-button.stories.js +45 -45
  147. package/dist/collection/components/side-menu/side-menu-close-button/side-menu-close-button.js +1 -1
  148. package/dist/collection/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.js +1 -1
  149. package/dist/collection/components/side-menu/side-menu-dropdown/side-menu-dropdown.js +1 -1
  150. package/dist/collection/components/side-menu/side-menu-item/side-menu-item.js +2 -2
  151. package/dist/collection/components/side-menu/side-menu.js +4 -4
  152. package/dist/collection/components/side-menu/side-menu.stories.js +144 -144
  153. package/dist/collection/components/slider/slider.js +17 -8
  154. package/dist/collection/components/slider/slider.stories.js +39 -39
  155. package/dist/collection/components/spinner/spinner.stories.js +6 -6
  156. package/dist/collection/components/stepper/stepper.js +3 -3
  157. package/dist/collection/components/stepper/stepper.stories.js +15 -15
  158. package/dist/collection/components/table/table/table.js +3 -3
  159. package/dist/collection/components/table/table-body-row/table-body-row.js +1 -1
  160. package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.js +1 -1
  161. package/dist/collection/components/table/table-component-basic.stories.js +52 -52
  162. package/dist/collection/components/table/table-component-batch-actions.stories.js +59 -59
  163. package/dist/collection/components/table/table-component-custom-width.stories.js +53 -53
  164. package/dist/collection/components/table/table-component-expandable-rows.stories.js +39 -39
  165. package/dist/collection/components/table/table-component-filtering.stories.js +72 -80
  166. package/dist/collection/components/table/table-component-multiselect.stories.js +74 -75
  167. package/dist/collection/components/table/table-component-pagination.stories.js +73 -73
  168. package/dist/collection/components/table/table-component-sorting.stories.js +75 -75
  169. package/dist/collection/components/table/table-footer/table-footer.css +2 -1
  170. package/dist/collection/components/table/table-footer/table-footer.js +1 -1
  171. package/dist/collection/components/table/table-header/table-header.js +1 -1
  172. package/dist/collection/components/table/table-header-cell/table-header-cell.js +3 -3
  173. package/dist/collection/components/table/table-toolbar/table-toolbar.js +2 -2
  174. package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +1 -1
  175. package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +2 -2
  176. package/dist/collection/components/tabs/folder-tabs/folder-tabs.stories.js +35 -35
  177. package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +1 -1
  178. package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +2 -8
  179. package/dist/collection/components/tabs/inline-tabs/inline-tabs.stories.js +35 -35
  180. package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +1 -1
  181. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +2 -5
  182. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +37 -37
  183. package/dist/collection/components/text-field/text-field.js +14 -14
  184. package/dist/collection/components/text-field/text-field.stories.js +46 -46
  185. package/dist/collection/components/textarea/textarea.js +10 -10
  186. package/dist/collection/components/textarea/textarea.stories.js +41 -41
  187. package/dist/collection/components/toast/toast.js +5 -4
  188. package/dist/collection/components/toast/toast.stories.js +16 -16
  189. package/dist/collection/components/toggle/toggle.js +2 -2
  190. package/dist/collection/components/toggle/toggle.stories.js +18 -18
  191. package/dist/collection/components/tooltip/tooltip.js +1 -1
  192. package/dist/collection/components/tooltip/tooltip.stories.js +24 -34
  193. package/dist/collection/stories/Installation/installation.stories.js +201 -205
  194. package/dist/collection/stories/announcements/announce-tegel.stories.js +248 -248
  195. package/dist/collection/stories/announcements/prefix-change.stories.js +79 -79
  196. package/dist/collection/stories/formatHtmlPreview.js +10 -0
  197. package/dist/collection/stories/foundations/color/color-brand.stories.js +25 -25
  198. package/dist/collection/stories/foundations/color/color-scales.stories.js +19 -19
  199. package/dist/collection/stories/foundations/color/color-semantic.stories.js +28 -28
  200. package/dist/collection/stories/foundations/grid/grid.stories.js +335 -335
  201. package/dist/collection/stories/foundations/spacing/spacing-element.stories.js +91 -91
  202. package/dist/collection/stories/foundations/spacing/spacing-layout.stories.js +85 -85
  203. package/dist/collection/stories/foundations/typography/typography-body.stories.js +8 -8
  204. package/dist/collection/stories/foundations/typography/typography-detail.stories.js +9 -9
  205. package/dist/collection/stories/foundations/typography/typography-headline.stories.js +18 -18
  206. package/dist/collection/stories/foundations/typography/typography-paragraph.stories.js +4 -4
  207. package/dist/collection/stories/patterns/navigation/navigation-basic.stories.js +54 -54
  208. package/dist/collection/stories/patterns/navigation/navigation-fewitems.stories.js +228 -228
  209. package/dist/collection/stories/patterns/navigation/navigation-manyitems.stories.js +203 -203
  210. package/dist/collection/stories/patterns/navigation/navigation-user-menu.stories.js +99 -99
  211. package/dist/collection/stories/tegel.stories.js +270 -279
  212. package/dist/collection/stories/utility/color/background-color.stories.js +14 -14
  213. package/dist/collection/stories/utility/color/text-color.stories.js +12 -12
  214. package/dist/collection/types/Attributes.js +1 -0
  215. package/dist/collection/utils/appendHiddenInput.js +25 -0
  216. package/dist/collection/utils/dfs.js +26 -0
  217. package/dist/collection/utils/findNextFocusableElement.js +16 -0
  218. package/dist/collection/utils/findPreviousFocusableElement.js +17 -0
  219. package/dist/collection/utils/generateUniqueId.js +25 -0
  220. package/dist/collection/utils/getNestedChildOfSiblingsMatching.js +22 -0
  221. package/dist/collection/utils/getNextNestedChildOfSiblingsMatching.js +32 -0
  222. package/dist/collection/utils/getNextSibling.js +2 -0
  223. package/dist/collection/utils/getPreviousNestedChildOfSiblingsMatching.js +32 -0
  224. package/dist/collection/utils/getPreviousSibling.js +2 -0
  225. package/dist/collection/utils/hasSlot.js +8 -0
  226. package/dist/collection/utils/inheritAriaAttributes.js +74 -0
  227. package/dist/collection/utils/inheritAttributes.js +24 -0
  228. package/dist/collection/utils/isHeadingElement.js +12 -0
  229. package/dist/collection/utils/updateListChildrenRoles.js +15 -0
  230. package/dist/components/checkbox.js +3 -2
  231. package/dist/components/core-header-item.js +1 -0
  232. package/dist/components/dfs.js +27 -0
  233. package/dist/components/divider.js +1 -0
  234. package/dist/components/generateUniqueId.js +26 -0
  235. package/dist/components/getPreviousNestedChildOfSiblingsMatching.js +68 -0
  236. package/dist/components/hasSlot.js +9 -0
  237. package/dist/components/header-dropdown-list-item.js +1 -0
  238. package/dist/components/header-dropdown-list.js +2 -1
  239. package/dist/components/header-item.js +2 -1
  240. package/dist/components/header-launcher-button.js +2 -1
  241. package/dist/components/icon.js +6 -2
  242. package/dist/components/inheritAriaAttributes.js +76 -0
  243. package/dist/components/inheritAttributes.js +25 -0
  244. package/dist/components/popover-canvas.js +2 -1
  245. package/dist/components/popover-core.js +1 -0
  246. package/dist/components/side-menu-item.js +2 -1
  247. package/dist/components/side-menu-user-image.js +1 -0
  248. package/dist/components/side-menu-user-label.js +1 -0
  249. package/dist/components/tds-accordion-item.js +6 -5
  250. package/dist/components/tds-accordion.js +1 -0
  251. package/dist/components/tds-badge.js +1 -0
  252. package/dist/components/tds-banner.js +3 -10
  253. package/dist/components/tds-block.js +5 -2
  254. package/dist/components/tds-body-cell.js +1 -0
  255. package/dist/components/tds-breadcrumb.js +1 -0
  256. package/dist/components/tds-breadcrumbs.js +1 -0
  257. package/dist/components/tds-button.js +2 -1
  258. package/dist/components/tds-card.js +4 -2
  259. package/dist/components/tds-chip.js +3 -1
  260. package/dist/components/tds-datetime.js +10 -9
  261. package/dist/components/tds-dropdown-option.js +9 -7
  262. package/dist/components/tds-dropdown.js +197 -69
  263. package/dist/components/tds-folder-tab.js +2 -1
  264. package/dist/components/tds-folder-tabs.js +1 -0
  265. package/dist/components/tds-footer-group.js +3 -2
  266. package/dist/components/tds-footer-item.js +1 -0
  267. package/dist/components/tds-footer.js +2 -1
  268. package/dist/components/tds-header-brand-symbol.js +1 -0
  269. package/dist/components/tds-header-cell.js +1 -0
  270. package/dist/components/tds-header-dropdown-list-user.js +1 -0
  271. package/dist/components/tds-header-dropdown.js +2 -1
  272. package/dist/components/tds-header-hamburger.js +2 -1
  273. package/dist/components/tds-header-launcher-grid-item.js +1 -0
  274. package/dist/components/tds-header-launcher-grid-title.js +2 -1
  275. package/dist/components/tds-header-launcher-grid.js +2 -1
  276. package/dist/components/tds-header-launcher-list-item.js +1 -0
  277. package/dist/components/tds-header-launcher-list-title.js +2 -1
  278. package/dist/components/tds-header-launcher-list.js +2 -1
  279. package/dist/components/tds-header-launcher.js +3 -1
  280. package/dist/components/tds-header-title.js +1 -0
  281. package/dist/components/tds-header.js +17 -1
  282. package/dist/components/tds-inline-tab.js +2 -1
  283. package/dist/components/tds-inline-tabs.js +1 -6
  284. package/dist/components/tds-link.js +4 -3
  285. package/dist/components/tds-message.js +4 -3
  286. package/dist/components/tds-modal.js +2 -1
  287. package/dist/components/tds-navigation-tab.js +2 -1
  288. package/dist/components/tds-navigation-tabs.js +1 -3
  289. package/dist/components/tds-popover-menu-item.js +1 -0
  290. package/dist/components/tds-popover-menu.js +2 -1
  291. package/dist/components/tds-radio-button.js +2 -1
  292. package/dist/components/tds-side-menu-close-button.js +2 -1
  293. package/dist/components/tds-side-menu-collapse-button.js +1 -0
  294. package/dist/components/tds-side-menu-dropdown-list-item.js +1 -0
  295. package/dist/components/tds-side-menu-dropdown-list.js +1 -0
  296. package/dist/components/tds-side-menu-dropdown.js +1 -0
  297. package/dist/components/tds-side-menu-overlay.js +1 -0
  298. package/dist/components/tds-side-menu-user.js +1 -0
  299. package/dist/components/tds-side-menu.js +1 -0
  300. package/dist/components/tds-slider.js +14 -7
  301. package/dist/components/tds-spinner.js +1 -0
  302. package/dist/components/tds-step.js +1 -0
  303. package/dist/components/tds-stepper.js +2 -1
  304. package/dist/components/tds-table-body-row-expandable.js +1 -0
  305. package/dist/components/tds-table-body-row.js +1 -0
  306. package/dist/components/tds-table-body.js +1 -0
  307. package/dist/components/tds-table-footer.js +2 -1
  308. package/dist/components/tds-table-header.js +1 -0
  309. package/dist/components/tds-table-toolbar.js +1 -0
  310. package/dist/components/tds-table.js +2 -1
  311. package/dist/components/tds-text-field.js +14 -13
  312. package/dist/components/tds-textarea.js +11 -10
  313. package/dist/components/tds-toast.js +5 -3
  314. package/dist/components/tds-toggle.js +2 -1
  315. package/dist/components/tds-tooltip.js +2 -1
  316. package/dist/esm/dfs-3f5bd9e8.js +27 -0
  317. package/dist/esm/generateUniqueId-c96c8ee6.js +26 -0
  318. package/dist/esm/hasSlot-d52114d0.js +9 -0
  319. package/dist/esm/{index-7471aeb6.js → index-21543b0f.js} +5 -5
  320. package/dist/esm/inheritAriaAttributes-d4dfca6b.js +76 -0
  321. package/dist/esm/inheritAttributes-8bb09af0.js +25 -0
  322. package/dist/esm/isHeadingElement-2c158fc4.js +68 -0
  323. package/dist/esm/loader.js +3 -3
  324. package/dist/esm/polyfills/core-js.js +0 -0
  325. package/dist/esm/polyfills/dom.js +0 -0
  326. package/dist/esm/polyfills/es5-html-element.js +0 -0
  327. package/dist/esm/polyfills/index.js +0 -0
  328. package/dist/esm/polyfills/system.js +0 -0
  329. package/dist/esm/tds-accordion-item.entry.js +6 -6
  330. package/dist/esm/tds-accordion.entry.js +1 -1
  331. package/dist/esm/tds-badge.entry.js +1 -1
  332. package/dist/esm/tds-banner.entry.js +3 -11
  333. package/dist/esm/tds-block.entry.js +5 -3
  334. package/dist/esm/tds-body-cell.entry.js +1 -1
  335. package/dist/esm/tds-breadcrumb.entry.js +1 -1
  336. package/dist/esm/tds-breadcrumbs.entry.js +1 -1
  337. package/dist/esm/tds-button.entry.js +2 -2
  338. package/dist/esm/tds-card.entry.js +4 -3
  339. package/dist/esm/tds-checkbox.entry.js +3 -3
  340. package/dist/esm/tds-chip.entry.js +3 -2
  341. package/dist/esm/tds-core-header-item_2.entry.js +2 -2
  342. package/dist/esm/tds-datetime.entry.js +10 -10
  343. package/dist/esm/tds-divider.entry.js +1 -1
  344. package/dist/esm/tds-dropdown-option.entry.js +9 -8
  345. package/dist/esm/tds-dropdown.entry.js +195 -69
  346. package/dist/esm/tds-folder-tab.entry.js +2 -2
  347. package/dist/esm/tds-folder-tabs.entry.js +1 -1
  348. package/dist/esm/tds-footer-group.entry.js +3 -3
  349. package/dist/esm/tds-footer-item.entry.js +1 -1
  350. package/dist/esm/tds-footer.entry.js +2 -2
  351. package/dist/esm/tds-header-brand-symbol.entry.js +1 -1
  352. package/dist/esm/tds-header-cell.entry.js +1 -1
  353. package/dist/esm/tds-header-dropdown-list-item.entry.js +1 -1
  354. package/dist/esm/tds-header-dropdown-list-user.entry.js +1 -1
  355. package/dist/esm/tds-header-dropdown-list.entry.js +3 -2
  356. package/dist/esm/tds-header-dropdown.entry.js +2 -2
  357. package/dist/esm/tds-header-hamburger.entry.js +3 -2
  358. package/dist/esm/tds-header-launcher-button.entry.js +3 -2
  359. package/dist/esm/tds-header-launcher-grid-item.entry.js +1 -1
  360. package/dist/esm/tds-header-launcher-grid-title.entry.js +2 -2
  361. package/dist/esm/tds-header-launcher-grid.entry.js +3 -2
  362. package/dist/esm/tds-header-launcher-list-item.entry.js +1 -1
  363. package/dist/esm/tds-header-launcher-list-title.entry.js +2 -2
  364. package/dist/esm/tds-header-launcher-list.entry.js +2 -2
  365. package/dist/esm/tds-header-launcher.entry.js +4 -2
  366. package/dist/esm/tds-header-title.entry.js +1 -1
  367. package/dist/esm/tds-header.entry.js +18 -2
  368. package/dist/esm/tds-icon.entry.js +5 -3
  369. package/dist/esm/tds-inline-tab.entry.js +2 -2
  370. package/dist/esm/tds-inline-tabs.entry.js +1 -7
  371. package/dist/esm/tds-link.entry.js +4 -4
  372. package/dist/esm/tds-message.entry.js +4 -4
  373. package/dist/esm/tds-modal.entry.js +2 -2
  374. package/dist/esm/tds-navigation-tab.entry.js +2 -2
  375. package/dist/esm/tds-navigation-tabs.entry.js +1 -4
  376. package/dist/esm/tds-popover-canvas.entry.js +2 -2
  377. package/dist/esm/tds-popover-core.entry.js +1 -1
  378. package/dist/esm/tds-popover-menu-item.entry.js +1 -1
  379. package/dist/esm/tds-popover-menu.entry.js +2 -2
  380. package/dist/esm/tds-radio-button.entry.js +2 -2
  381. package/dist/esm/tds-side-menu-close-button.entry.js +3 -2
  382. package/dist/esm/tds-side-menu-collapse-button.entry.js +1 -1
  383. package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +1 -1
  384. package/dist/esm/tds-side-menu-dropdown-list.entry.js +1 -1
  385. package/dist/esm/tds-side-menu-dropdown.entry.js +1 -1
  386. package/dist/esm/tds-side-menu-item.entry.js +2 -2
  387. package/dist/esm/tds-side-menu-overlay.entry.js +1 -1
  388. package/dist/esm/tds-side-menu-user-image_2.entry.js +1 -1
  389. package/dist/esm/tds-side-menu-user.entry.js +1 -1
  390. package/dist/esm/tds-side-menu.entry.js +1 -1
  391. package/dist/esm/tds-slider.entry.js +14 -8
  392. package/dist/esm/tds-spinner.entry.js +1 -1
  393. package/dist/esm/tds-step.entry.js +1 -1
  394. package/dist/esm/tds-stepper.entry.js +2 -2
  395. package/dist/esm/tds-table-body-row-expandable.entry.js +1 -1
  396. package/dist/esm/tds-table-body-row.entry.js +1 -1
  397. package/dist/esm/tds-table-body.entry.js +1 -1
  398. package/dist/esm/tds-table-footer.entry.js +2 -2
  399. package/dist/esm/tds-table-header.entry.js +1 -1
  400. package/dist/esm/tds-table-toolbar.entry.js +1 -1
  401. package/dist/esm/tds-table.entry.js +2 -2
  402. package/dist/esm/tds-text-field.entry.js +14 -14
  403. package/dist/esm/tds-textarea.entry.js +11 -11
  404. package/dist/esm/tds-toast.entry.js +5 -4
  405. package/dist/esm/tds-toggle.entry.js +2 -2
  406. package/dist/esm/tds-tooltip.entry.js +2 -2
  407. package/dist/esm/tegel.js +4 -4
  408. package/dist/tegel/p-098a26f3.js +1 -0
  409. package/dist/tegel/{p-bd823881.entry.js → p-0a8ee1f9.entry.js} +1 -1
  410. package/dist/tegel/p-0c4fbe10.entry.js +1 -0
  411. package/dist/tegel/p-0edeccb6.js +1 -0
  412. package/dist/tegel/p-0f8f9398.entry.js +1 -0
  413. package/dist/tegel/p-1168e527.entry.js +1 -0
  414. package/dist/tegel/{p-52edb8b7.entry.js → p-15230250.entry.js} +1 -1
  415. package/dist/tegel/{p-514610b9.entry.js → p-17d0b13e.entry.js} +1 -1
  416. package/dist/tegel/{p-888fec9e.entry.js → p-22f15794.entry.js} +1 -1
  417. package/dist/tegel/{p-37b1329c.entry.js → p-235cda64.entry.js} +1 -1
  418. package/dist/tegel/{p-54ebce22.entry.js → p-23822382.entry.js} +1 -1
  419. package/dist/tegel/p-26e5d00c.entry.js +1 -0
  420. package/dist/tegel/p-2727d592.entry.js +1 -0
  421. package/dist/tegel/{p-9af2e8ab.entry.js → p-289a487d.entry.js} +1 -1
  422. package/dist/tegel/p-2955b397.entry.js +1 -0
  423. package/dist/tegel/{p-f2819741.entry.js → p-2ab8970f.entry.js} +1 -1
  424. package/dist/tegel/{p-5663c320.entry.js → p-30743f62.entry.js} +1 -1
  425. package/dist/tegel/p-3079490b.entry.js +1 -0
  426. package/dist/tegel/{p-446ab609.entry.js → p-30c571d4.entry.js} +1 -1
  427. package/dist/tegel/{p-286691df.entry.js → p-32c133ba.entry.js} +1 -1
  428. package/dist/tegel/p-35265b56.entry.js +1 -0
  429. package/dist/tegel/p-363ee512.entry.js +1 -0
  430. package/dist/tegel/{p-0d573de8.entry.js → p-3ad7d61d.entry.js} +1 -1
  431. package/dist/tegel/{p-d8215514.entry.js → p-3b39140f.entry.js} +1 -1
  432. package/dist/tegel/{p-0eac159c.entry.js → p-3cd5821f.entry.js} +1 -1
  433. package/dist/tegel/{p-073cf6c0.entry.js → p-44a3b63b.entry.js} +1 -1
  434. package/dist/tegel/p-4a02a38f.entry.js +1 -0
  435. package/dist/tegel/{p-824f5dad.entry.js → p-4af50429.entry.js} +1 -1
  436. package/dist/tegel/{p-62732059.entry.js → p-4bca96e5.entry.js} +1 -1
  437. package/dist/tegel/p-4df1ed46.entry.js +1 -0
  438. package/dist/tegel/{p-166d6252.entry.js → p-50ea7ad8.entry.js} +1 -1
  439. package/dist/tegel/{p-0d886890.entry.js → p-52719efc.entry.js} +1 -1
  440. package/dist/tegel/{p-d1be74e7.entry.js → p-555e1263.entry.js} +1 -1
  441. package/dist/tegel/p-57156832.entry.js +1 -0
  442. package/dist/tegel/{p-f6ff8d7e.entry.js → p-595c3a77.entry.js} +1 -1
  443. package/dist/tegel/{p-2782cab8.entry.js → p-5a6efad0.entry.js} +1 -1
  444. package/dist/tegel/{p-fc88f7ba.entry.js → p-5b9115c3.entry.js} +1 -1
  445. package/dist/tegel/{p-8b634b36.entry.js → p-72bbf0af.entry.js} +1 -1
  446. package/dist/tegel/{p-d289a792.entry.js → p-74644ab7.entry.js} +1 -1
  447. package/dist/tegel/{p-94c27eb3.entry.js → p-762357bb.entry.js} +1 -1
  448. package/dist/tegel/{p-cbb227b3.entry.js → p-7b0dabcb.entry.js} +1 -1
  449. package/dist/tegel/p-7e0ec688.entry.js +1 -0
  450. package/dist/tegel/p-81039661.js +1 -0
  451. package/dist/tegel/p-86f542a6.js +1 -0
  452. package/dist/tegel/{p-a72409fc.entry.js → p-8ad9d997.entry.js} +1 -1
  453. package/dist/tegel/{p-f712146b.entry.js → p-90597e3c.entry.js} +1 -1
  454. package/dist/tegel/p-931a6b29.entry.js +1 -0
  455. package/dist/tegel/{p-5b58d6c9.entry.js → p-950ad7d7.entry.js} +1 -1
  456. package/dist/tegel/{p-495d2b37.entry.js → p-970da069.entry.js} +1 -1
  457. package/dist/tegel/{p-26757a32.entry.js → p-9920be66.entry.js} +1 -1
  458. package/dist/tegel/{p-c1ed83c6.entry.js → p-9bc33f53.entry.js} +1 -1
  459. package/dist/tegel/{p-364654b5.entry.js → p-a0a1840f.entry.js} +1 -1
  460. package/dist/tegel/{p-026a3e05.entry.js → p-a3123355.entry.js} +1 -1
  461. package/dist/tegel/{p-d1289eb3.entry.js → p-a3440291.entry.js} +1 -1
  462. package/dist/tegel/{p-ae2c6537.entry.js → p-a7a12627.entry.js} +1 -1
  463. package/dist/tegel/{p-7bbae944.entry.js → p-a9df694d.entry.js} +1 -1
  464. package/dist/tegel/{p-9c6e8abb.entry.js → p-ac253317.entry.js} +1 -1
  465. package/dist/tegel/{p-38c68fac.entry.js → p-ac8585f9.entry.js} +1 -1
  466. package/dist/tegel/{p-301110a1.entry.js → p-adca7314.entry.js} +1 -1
  467. package/dist/tegel/p-adf21f07.entry.js +1 -0
  468. package/dist/tegel/p-ae110fc2.js +1 -0
  469. package/dist/tegel/{p-b0a5cef2.entry.js → p-b1e3feda.entry.js} +1 -1
  470. package/dist/tegel/{p-62154528.entry.js → p-c1b19d10.entry.js} +1 -1
  471. package/dist/tegel/{p-045e99f2.entry.js → p-c46dad72.entry.js} +1 -1
  472. package/dist/tegel/{p-77282750.entry.js → p-cb3ba5d0.entry.js} +1 -1
  473. package/dist/tegel/p-cc0ea750.entry.js +1 -0
  474. package/dist/tegel/p-cc2a998f.entry.js +1 -0
  475. package/dist/tegel/p-cc771b46.entry.js +1 -0
  476. package/dist/tegel/{p-386c3c42.entry.js → p-d98cf434.entry.js} +1 -1
  477. package/dist/tegel/{p-acabb656.entry.js → p-da386849.entry.js} +1 -1
  478. package/dist/tegel/p-df2c8c5b.entry.js +1 -0
  479. package/dist/tegel/{p-dfeaa580.entry.js → p-df7f3773.entry.js} +1 -1
  480. package/dist/tegel/{p-78a367c0.entry.js → p-e122947b.entry.js} +1 -1
  481. package/dist/tegel/p-e179315a.entry.js +1 -0
  482. package/dist/tegel/p-e74f77c4.entry.js +1 -0
  483. package/dist/tegel/{p-34e75630.entry.js → p-edc8b0b0.entry.js} +1 -1
  484. package/dist/tegel/p-effd0764.entry.js +1 -0
  485. package/dist/tegel/{p-c9c5b832.entry.js → p-f375707c.entry.js} +1 -1
  486. package/dist/tegel/{p-ef96df10.entry.js → p-f6ca4367.entry.js} +1 -1
  487. package/dist/tegel/p-f71c9fe3.entry.js +1 -0
  488. package/dist/tegel/p-f7ce52e9.js +1 -0
  489. package/dist/tegel/{p-974ee937.entry.js → p-f84d4394.entry.js} +1 -1
  490. package/dist/tegel/{p-eeedd806.entry.js → p-f9c37154.entry.js} +1 -1
  491. package/dist/tegel/p-ff07dea0.entry.js +1 -0
  492. package/dist/tegel/tegel.css +2 -4
  493. package/dist/tegel/tegel.esm.js +1 -1
  494. package/dist/types/components/banner/banner.d.ts +0 -5
  495. package/dist/types/components/block/block.d.ts +1 -1
  496. package/dist/types/components/dropdown/dropdown.d.ts +29 -11
  497. package/dist/types/components/icon/icon.d.ts +2 -0
  498. package/dist/types/components/popover-canvas/popover-canvas.d.ts +1 -1
  499. package/dist/types/components/popover-menu/popover-menu.d.ts +1 -1
  500. package/dist/types/components/slider/slider.d.ts +1 -1
  501. package/dist/types/components/table/table-component-filtering.stories.d.ts +0 -8
  502. package/dist/types/components/table/table-component-multiselect.stories.d.ts +0 -1
  503. package/dist/types/components/text-field/text-field.d.ts +1 -1
  504. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  505. package/dist/types/components.d.ts +69 -66
  506. package/dist/types/global.d.ts +2 -2
  507. package/dist/types/stencil-public-runtime.d.ts +3 -3
  508. package/dist/types/stories/formatHtmlPreview.d.ts +2 -0
  509. package/dist/types/stories/foundations/color/color-semantic.stories.d.ts +1 -1
  510. package/dist/types/types/Attributes.d.ts +3 -0
  511. package/dist/types/utils/appendHiddenInput.d.ts +15 -0
  512. package/dist/types/utils/dfs.d.ts +10 -0
  513. package/dist/types/utils/findNextFocusableElement.d.ts +7 -0
  514. package/dist/types/utils/findPreviousFocusableElement.d.ts +8 -0
  515. package/dist/types/utils/generateUniqueId.d.ts +15 -0
  516. package/dist/types/utils/getNestedChildOfSiblingsMatching.d.ts +2 -0
  517. package/dist/types/utils/getNextNestedChildOfSiblingsMatching.d.ts +30 -0
  518. package/dist/types/utils/getNextSibling.d.ts +2 -0
  519. package/dist/types/utils/getPreviousNestedChildOfSiblingsMatching.d.ts +30 -0
  520. package/dist/types/utils/getPreviousSibling.d.ts +2 -0
  521. package/dist/types/utils/hasSlot.d.ts +8 -0
  522. package/dist/types/utils/inheritAriaAttributes.d.ts +9 -0
  523. package/dist/types/utils/inheritAttributes.d.ts +13 -0
  524. package/dist/types/utils/isHeadingElement.d.ts +8 -0
  525. package/dist/types/utils/updateListChildrenRoles.d.ts +6 -0
  526. package/package.json +81 -80
  527. package/dist/cjs/utils-23ce2e45.js +0 -501
  528. package/dist/collection/utils/utils.js +0 -369
  529. package/dist/collection/utils/utils.spec.js +0 -15
  530. package/dist/components/utils.js +0 -489
  531. package/dist/esm/utils-4d967376.js +0 -489
  532. package/dist/tegel/p-1af982bc.entry.js +0 -1
  533. package/dist/tegel/p-24fc848d.entry.js +0 -1
  534. package/dist/tegel/p-271d0081.entry.js +0 -1
  535. package/dist/tegel/p-3c5acada.entry.js +0 -1
  536. package/dist/tegel/p-461e81bd.entry.js +0 -1
  537. package/dist/tegel/p-4e676ba1.entry.js +0 -1
  538. package/dist/tegel/p-52b727a7.entry.js +0 -1
  539. package/dist/tegel/p-5e6318d2.entry.js +0 -1
  540. package/dist/tegel/p-6e1c6b71.entry.js +0 -1
  541. package/dist/tegel/p-7125dad7.entry.js +0 -1
  542. package/dist/tegel/p-8a502e4f.entry.js +0 -1
  543. package/dist/tegel/p-8a6dac22.entry.js +0 -1
  544. package/dist/tegel/p-8faaaaf3.entry.js +0 -1
  545. package/dist/tegel/p-8fea52fe.js +0 -43
  546. package/dist/tegel/p-98d31b74.entry.js +0 -1
  547. package/dist/tegel/p-9b560c6d.entry.js +0 -1
  548. package/dist/tegel/p-aeff41d5.entry.js +0 -1
  549. package/dist/tegel/p-c65429b4.entry.js +0 -1
  550. package/dist/tegel/p-ca8b8a16.entry.js +0 -1
  551. package/dist/tegel/p-cf75e7c1.entry.js +0 -1
  552. package/dist/tegel/p-d4aa3315.entry.js +0 -1
  553. package/dist/tegel/p-d852143b.entry.js +0 -1
  554. package/dist/tegel/p-ec6afc7b.entry.js +0 -1
  555. package/dist/tegel/p-f147d270.entry.js +0 -1
  556. package/dist/tegel/p-faaa50c2.entry.js +0 -1
  557. package/dist/types/utils/utils.d.ts +0 -164
  558. /package/dist/tegel/{p-43fe6507.js → p-31561847.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import readme from "./readme.md";
2
- import { formatHtmlPreview } from "../../utils/utils";
2
+ import formatHtmlPreview from "../../stories/formatHtmlPreview";
3
3
  import { ComponentsFolder } from "../../utils/constants";
4
4
  export default {
5
5
  title: `${ComponentsFolder}/Datetime`,
@@ -174,46 +174,46 @@ const datetimeTemplate = ({ modeVariant, state, type, size, defaultValue, minVal
174
174
  else
175
175
  return false;
176
176
  };
177
- return formatHtmlPreview(`
178
- <style>
179
- /* Note: Demo classes used here are just for demo purposes in Storybook */
180
- .demo-wrapper {
181
- width: 180px;
182
- }
183
- </style>
184
-
185
- <div class="demo-wrapper">
186
-
187
- <tds-datetime
188
- id="datetime"
189
- ${defaultValue !== 'None' ? `default-value="${getDefaultValue(defaultValue, type)}"` : ''}
190
- ${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
191
- type="${typeLookup[type]}"
192
- ${minValue ? `min=${minValue}` : ''}
193
- ${maxValue ? `min=${maxValue}` : ''}
194
- size="${sizeLookup[size]}"
195
- state="${stateLookup[state]}"
196
- ${disabled ? 'disabled' : ''}
197
- ${noMinWidth ? 'no-min-width' : ''}
198
- ${label ? `label="${label}" ` : ''}
199
- ${helper ? `helper="${helper}" ` : ''}
200
- >
201
- </tds-datetime>
202
- </div>
203
-
204
- <script>
205
- /* DEMO Code: Used only for Storybook demo purposes */
206
- datetimeElement = document.querySelector('tds-datetime');
207
- datetimeElement.addEventListener('tdsChange', (event) => {
208
- console.log(event);
209
- });
210
- datetimeElement.addEventListener('tdsFocus', (event) => {
211
- console.log(event);
212
- });
213
- datetimeElement.addEventListener('tdsBlur', (event) => {
214
- console.log(event);
215
- });
216
- </script>
177
+ return formatHtmlPreview(`
178
+ <style>
179
+ /* Note: Demo classes used here are just for demo purposes in Storybook */
180
+ .demo-wrapper {
181
+ width: 180px;
182
+ }
183
+ </style>
184
+
185
+ <div class="demo-wrapper">
186
+
187
+ <tds-datetime
188
+ id="datetime"
189
+ ${defaultValue !== 'None' ? `default-value="${getDefaultValue(defaultValue, type)}"` : ''}
190
+ ${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
191
+ type="${typeLookup[type]}"
192
+ ${minValue ? `min=${minValue}` : ''}
193
+ ${maxValue ? `min=${maxValue}` : ''}
194
+ size="${sizeLookup[size]}"
195
+ state="${stateLookup[state]}"
196
+ ${disabled ? 'disabled' : ''}
197
+ ${noMinWidth ? 'no-min-width' : ''}
198
+ ${label ? `label="${label}" ` : ''}
199
+ ${helper ? `helper="${helper}" ` : ''}
200
+ >
201
+ </tds-datetime>
202
+ </div>
203
+
204
+ <script>
205
+ /* DEMO Code: Used only for Storybook demo purposes */
206
+ datetimeElement = document.querySelector('tds-datetime');
207
+ datetimeElement.addEventListener('tdsChange', (event) => {
208
+ console.log(event);
209
+ });
210
+ datetimeElement.addEventListener('tdsFocus', (event) => {
211
+ console.log(event);
212
+ });
213
+ datetimeElement.addEventListener('tdsBlur', (event) => {
214
+ console.log(event);
215
+ });
216
+ </script>
217
217
  `);
218
218
  };
219
219
  export const Default = datetimeTemplate.bind({});
@@ -1,4 +1,4 @@
1
- import { formatHtmlPreview } from "../../utils/utils";
1
+ import formatHtmlPreview from "../../stories/formatHtmlPreview";
2
2
  import readme from "./readme.md";
3
3
  import { ComponentsFolder } from "../../utils/constants";
4
4
  export default {
@@ -54,9 +54,9 @@ export default {
54
54
  height: 150,
55
55
  },
56
56
  };
57
- const Template = ({ orientation, width, height }) => formatHtmlPreview(`
58
- <div style="${orientation === 'Horizontal' ? `width: ${width}px;` : `height: ${height}px;`}">
59
- <tds-divider orientation="${orientation.toLowerCase()}"></tds-divider>
60
- </div>
57
+ const Template = ({ orientation, width, height }) => formatHtmlPreview(`
58
+ <div style="${orientation === 'Horizontal' ? `width: ${width}px;` : `height: ${height}px;`}">
59
+ <tds-divider orientation="${orientation.toLowerCase()}"></tds-divider>
60
+ </div>
61
61
  `);
62
62
  export const Default = Template.bind({});
@@ -41,14 +41,14 @@
41
41
  outline-offset: -2px;
42
42
  }
43
43
  :host .dropdown-option .multiselect {
44
- padding: 0 16px;
45
44
  width: 100%;
45
+ height: 100%;
46
46
  }
47
- :host .dropdown-option .multiselect tds-checkbox,
48
- :host .dropdown-option .multiselect .tds-checkbox-webcomponent,
49
- :host .dropdown-option .multiselect label {
47
+ :host .dropdown-option .multiselect tds-checkbox {
48
+ display: flex;
50
49
  height: 100%;
51
50
  width: 100%;
51
+ padding: 0 16px;
52
52
  }
53
53
  :host .dropdown-option:hover {
54
54
  background-color: var(--tds-dropdown-option-background-hover);
@@ -16,7 +16,7 @@ export class TdsDropdownOption {
16
16
  this.handleSingleSelect = () => {
17
17
  if (!this.disabled) {
18
18
  this.selected = true;
19
- this.parentElement.setValue(this.value, this.label);
19
+ this.parentElement.appendValue(this.value);
20
20
  this.parentElement.close();
21
21
  this.tdsSelect.emit({
22
22
  value: this.value,
@@ -27,7 +27,7 @@ export class TdsDropdownOption {
27
27
  this.handleMultiselect = (event) => {
28
28
  if (!this.disabled) {
29
29
  if (event.detail.checked) {
30
- this.parentElement.setValue(this.value, this.label);
30
+ this.parentElement.appendValue(this.value);
31
31
  this.selected = true;
32
32
  this.tdsSelect.emit({
33
33
  value: this.value,
@@ -42,6 +42,7 @@ export class TdsDropdownOption {
42
42
  selected: this.selected,
43
43
  });
44
44
  }
45
+ event.stopPropagation();
45
46
  }
46
47
  };
47
48
  this.handleFocus = (event) => {
@@ -61,10 +62,10 @@ export class TdsDropdownOption {
61
62
  this.selected = selected;
62
63
  }
63
64
  render() {
64
- return (h(Host, { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected }, h("div", { class: `dropdown-option
65
- ${this.size}
66
- ${this.selected ? 'selected' : ''}
67
- ${this.disabled ? 'disabled' : ''}
65
+ return (h(Host, { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected }, h("div", { class: `dropdown-option
66
+ ${this.size}
67
+ ${this.selected ? 'selected' : ''}
68
+ ${this.disabled ? 'disabled' : ''}
68
69
  ` }, this.multiselect ? (h("div", { class: "multiselect", onKeyDown: (event) => {
69
70
  if (event.key === 'Escape') {
70
71
  this.parentElement.close();
@@ -146,7 +147,7 @@ export class TdsDropdownOption {
146
147
  "text": "Click event for the Dropdown option."
147
148
  },
148
149
  "complexType": {
149
- "original": "{\r\n selected: boolean;\r\n value: string;\r\n }",
150
+ "original": "{\n selected: boolean;\n value: string;\n }",
150
151
  "resolved": "{ selected: boolean; value: string; }",
151
152
  "references": {}
152
153
  }
@@ -20,9 +20,14 @@
20
20
  }
21
21
  :host button.value {
22
22
  color: var(--tds-dropdown-value-color);
23
+ font: var(--tds-detail-02);
24
+ letter-spacing: var(--tds-detail-02-ls);
25
+ /** Needed to not get be affected by overflow:hidden
26
+ The original line-height is 1.14 */
27
+ line-height: 1.3;
23
28
  }
24
29
  :host button:focus {
25
- border-bottom-color: transparent;
30
+ border-bottom-color: var(--tds-dropdown-border-bottom-open);
26
31
  }
27
32
  :host button:focus::before {
28
33
  content: "";
@@ -30,7 +35,7 @@
30
35
  bottom: 0;
31
36
  left: 0;
32
37
  width: 100%;
33
- height: 2px;
38
+ height: 1px;
34
39
  background: var(--tds-dropdown-border-bottom-open);
35
40
  }
36
41
  :host button.error {
@@ -1,28 +1,28 @@
1
1
  import { Host, h } from "@stencil/core";
2
- import { appendHiddenInput, findNextFocusableItem, findPreviousFocusableItem, } from "../../utils/utils";
2
+ import findNextFocusableElement from "../../utils/findNextFocusableElement";
3
+ import findPreviousFocusableElement from "../../utils/findPreviousFocusableElement";
4
+ import appendHiddenInput from "../../utils/appendHiddenInput";
3
5
  /**
4
6
  * @slot <default> - <b>Unnamed slot.</b> For dropdown option elements.
5
7
  */
6
8
  export class TdsDropdown {
7
9
  constructor() {
8
10
  this.setDefaultOption = () => {
9
- this.children = Array.from(this.host.children)
11
+ Array.from(this.host.children)
10
12
  .filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION')
11
- .map((element) => {
13
+ .forEach((element) => {
12
14
  if (this.multiselect) {
13
15
  this.defaultValue.split(',').forEach((value) => {
14
16
  if (value === element.value) {
15
17
  element.setSelected(true);
16
- this.selection = this.selection
17
- ? [...this.selection, { value: element.value, label: element.textContent }]
18
- : [{ value: element.value, label: element.textContent }];
18
+ this.value = this.value ? [...this.value, element.value] : [element.value];
19
19
  }
20
20
  });
21
21
  }
22
22
  else {
23
23
  if (this.defaultValue === element.value) {
24
24
  element.setSelected(true);
25
- this.selection = [{ value: element.value, label: element.textContent }];
25
+ this.value = [element.value];
26
26
  }
27
27
  else {
28
28
  element.setSelected(false);
@@ -46,19 +46,28 @@ export class TdsDropdown {
46
46
  }
47
47
  return this.openDirection;
48
48
  };
49
+ this.getSelectedChildren = () => {
50
+ var _a;
51
+ return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((stringValue) => {
52
+ const matchingElement = this.getChildren().find((element) => element.value === stringValue);
53
+ return matchingElement;
54
+ }).filter(Boolean);
55
+ };
56
+ this.getSelectedChildrenLabels = () => {
57
+ var _a;
58
+ return (_a = this.getSelectedChildren()) === null || _a === void 0 ? void 0 : _a.map((element) => element.textContent.trim());
59
+ };
49
60
  this.getValue = () => {
50
- var _a, _b;
51
- if (this.filter) {
52
- return (_a = this.selection) === null || _a === void 0 ? void 0 : _a.map((item) => item.label).toString();
53
- }
54
- return (_b = this.selection) === null || _b === void 0 ? void 0 : _b.map((item) => item.label).join(', ');
61
+ const labels = this.getSelectedChildrenLabels();
62
+ return this.filter ? labels === null || labels === void 0 ? void 0 : labels.join(', ') : labels === null || labels === void 0 ? void 0 : labels.toString();
55
63
  };
56
64
  this.handleFilter = (event) => {
57
65
  this.tdsInput.emit(event);
58
66
  const query = event.target.value.toLowerCase();
59
67
  /* Check if the query is empty, and if so, show all options */
68
+ const children = this.getChildren();
60
69
  if (query === '') {
61
- this.children = this.children.map((element) => {
70
+ children.forEach((element) => {
62
71
  element.removeAttribute('hidden');
63
72
  return element;
64
73
  });
@@ -66,7 +75,7 @@ export class TdsDropdown {
66
75
  /* Hide the options that do not match the query */
67
76
  }
68
77
  else {
69
- this.filterResult = this.children.filter((element) => {
78
+ this.filterResult = children.filter((element) => {
70
79
  if (!element.textContent.toLowerCase().includes(query.toLowerCase())) {
71
80
  element.setAttribute('hidden', '');
72
81
  }
@@ -87,7 +96,7 @@ export class TdsDropdown {
87
96
  var _a, _b;
88
97
  this.tdsChange.emit({
89
98
  name: this.name,
90
- value: (_b = (_a = this.selection) === null || _a === void 0 ? void 0 : _a.map((item) => item.value).toString()) !== null && _b !== void 0 ? _b : null,
99
+ value: (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString()) !== null && _b !== void 0 ? _b : null,
91
100
  });
92
101
  };
93
102
  this.name = undefined;
@@ -105,46 +114,82 @@ export class TdsDropdown {
105
114
  this.noResultText = 'No result';
106
115
  this.defaultValue = undefined;
107
116
  this.open = false;
108
- this.selection = undefined;
117
+ this.value = undefined;
109
118
  this.filterResult = undefined;
110
119
  this.filterFocus = undefined;
111
120
  }
112
121
  /** Method that resets the Dropdown, marks all children as non-selected and resets the value to null. */
113
122
  async reset() {
114
- this.children = this.getChildren().map((element) => {
115
- element.setSelected(false);
116
- return element;
117
- });
118
- this.selection = null;
119
- this.host.setAttribute('value', null);
123
+ this.internalReset();
120
124
  this.handleChange();
121
125
  }
122
- /** Method for setting the value of the Dropdown. */
123
- async setValue(newValue, newValueLabel) {
124
- if (this.multiselect) {
125
- this.selection = this.selection
126
- ? [...this.selection, { value: newValue, label: newValueLabel }]
127
- : [{ value: newValue, label: newValueLabel }];
126
+ /** Method for setting the value of the Dropdown.
127
+ *
128
+ * Single selection example:
129
+ *
130
+ * <code>
131
+ * dropdown.setValue('option-1', 'Option 1');
132
+ * </code>
133
+ *
134
+ * Multiselect example:
135
+ *
136
+ * <code>
137
+ * dropdown.setValue(['option-1', 'option-2']);
138
+ * </code>
139
+ */
140
+ // The label is optional here ONLY to not break the API. Should be removed for 2.0.
141
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
142
+ async setValue(value, label) {
143
+ var _a;
144
+ let nextValue;
145
+ if (typeof value === 'string')
146
+ nextValue = [value];
147
+ else
148
+ nextValue = value;
149
+ if (!this.multiselect && nextValue.length > 1) {
150
+ console.warn('Tried to select multiple items, but multiselect is not enabled.');
151
+ nextValue = [nextValue[0]];
128
152
  }
129
- else {
130
- this.selection = [{ value: newValue, label: newValueLabel }];
131
- this.children = this.getChildren().map((element) => {
132
- if (element.value !== newValue) {
133
- element.setSelected(false);
134
- }
135
- return element;
136
- });
153
+ this.internalReset();
154
+ for (let i = 0; i < nextValue.length; i++) {
155
+ const optionExist = this.getChildren().some((element) => element.value === nextValue[i]);
156
+ if (!optionExist) {
157
+ nextValue.splice(i, 1);
158
+ }
137
159
  }
160
+ this.value = nextValue;
161
+ this.host.setAttribute('value', (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((val) => val).toString());
162
+ this.selectChildrenAsSelectedBasedOnSelectionProp();
138
163
  this.handleChange();
139
- this.host.setAttribute('value', this.selection.map((selection) => selection.value).toString());
140
- return this.selection;
164
+ /* This returns an array of object with a value and label pair. This is ONLY to not break the API. Should be removed for 2.0. */
165
+ // TODO - Clean up and just return this.value for 2.0
166
+ const selection = this.getSelectedChildren().map((element) => ({
167
+ value: element.value,
168
+ label: element.textContent.trim(),
169
+ }));
170
+ return selection;
171
+ }
172
+ /**
173
+ * @internal
174
+ */
175
+ async appendValue(value) {
176
+ if (this.multiselect && this.value) {
177
+ this.setValue([...this.value, value]);
178
+ }
179
+ else {
180
+ this.setValue(value);
181
+ }
141
182
  }
142
183
  /** Method for removing a selected value in the Dropdown. */
143
184
  async removeValue(oldValue) {
185
+ var _a, _b;
186
+ let label;
144
187
  if (this.multiselect) {
145
- this.children = this.getChildren().map((element) => {
188
+ (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
189
+ var _a;
146
190
  if (element.value === oldValue) {
147
- this.selection = this.selection.filter((item) => item.value !== element.value);
191
+ this.value = (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter((value) => value !== element.value);
192
+ label = element.textContent.trim();
148
193
  element.setSelected(false);
149
194
  }
150
195
  return element;
@@ -154,7 +199,9 @@ export class TdsDropdown {
154
199
  this.reset();
155
200
  }
156
201
  this.handleChange();
157
- return this.selection;
202
+ /* This returns an array of object with a value and label pair. This is ONLY to not break the API. Should be removed for 2.0. */
203
+ // TODO - Clean up and just return this.value for 2.0
204
+ return (_b = this.value) === null || _b === void 0 ? void 0 : _b.map((value) => ({ value, label }));
158
205
  }
159
206
  /** Method for closing the Dropdown. */
160
207
  async close() {
@@ -175,23 +222,24 @@ export class TdsDropdown {
175
222
  if (!activeElement) {
176
223
  return;
177
224
  }
225
+ const children = this.getChildren();
178
226
  if (event.key === 'ArrowDown') {
179
227
  /* Get the index of the current focus index, if there is no
180
228
  nextElementSibling return the index for the first child in our Dropdown. */
181
229
  const startingIndex = activeElement.nextElementSibling
182
- ? this.children.findIndex((element) => element === activeElement.nextElementSibling)
230
+ ? children.findIndex((element) => element === activeElement.nextElementSibling)
183
231
  : 0;
184
- const elementIndex = findNextFocusableItem(this.children, startingIndex);
185
- this.children[elementIndex].focus();
232
+ const elementIndex = findNextFocusableElement(children, startingIndex);
233
+ children[elementIndex].focus();
186
234
  }
187
235
  else if (event.key === 'ArrowUp') {
188
236
  /* Get the index of the current focus index, if there is no
189
237
  previousElementSibling return the index for the first last in our Dropdown. */
190
238
  const startingIndex = activeElement.nextElementSibling
191
- ? this.children.findIndex((element) => element === activeElement.previousElementSibling)
239
+ ? this.getChildren().findIndex((element) => element === activeElement.previousElementSibling)
192
240
  : 0;
193
- const elementIndex = findPreviousFocusableItem(this.children, startingIndex);
194
- this.children[elementIndex].focus();
241
+ const elementIndex = findPreviousFocusableElement(children, startingIndex);
242
+ children[elementIndex].focus();
195
243
  }
196
244
  else if (event.key === 'Escape') {
197
245
  this.open = false;
@@ -200,10 +248,9 @@ export class TdsDropdown {
200
248
  // If the Dropdown gets closed,
201
249
  // this sets the value of the dropdown to the current selection labels or null if no selection is made.
202
250
  handleOpenState() {
203
- var _a, _b;
204
251
  if (this.filter && this.multiselect) {
205
252
  if (!this.open) {
206
- this.inputElement.value = (_b = (_a = this.selection) === null || _a === void 0 ? void 0 : _a.map((item) => item.label).toString()) !== null && _b !== void 0 ? _b : null;
253
+ this.inputElement.value = this.getValue();
207
254
  }
208
255
  }
209
256
  }
@@ -212,14 +259,38 @@ export class TdsDropdown {
212
259
  this.setDefaultOption();
213
260
  }
214
261
  }
262
+ /** Method that resets the dropdown without emitting an event. */
263
+ internalReset() {
264
+ this.getChildren().forEach((element) => {
265
+ element.setSelected(false);
266
+ return element;
267
+ });
268
+ this.value = null;
269
+ this.host.setAttribute('value', null);
270
+ }
271
+ selectChildrenAsSelectedBasedOnSelectionProp() {
272
+ this.getChildren().forEach((element) => {
273
+ this.value.forEach((selection) => {
274
+ if (element.value !== selection) {
275
+ // If not multiselect, we need to unselect all other options.
276
+ if (!this.multiselect) {
277
+ element.setSelected(false);
278
+ }
279
+ }
280
+ else {
281
+ element.setSelected(true);
282
+ }
283
+ });
284
+ });
285
+ }
215
286
  render() {
216
287
  var _a, _b, _c, _d;
217
- appendHiddenInput(this.host, this.name, (_a = this.selection) === null || _a === void 0 ? void 0 : _a.map((item) => item.value).toString(), this.disabled);
218
- return (h(Host, { role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: `filter ${this.filterFocus ? 'focus' : ''}
219
- ${this.disabled ? 'disabled' : ''}` }, h("div", { class: "value-wrapper" }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
220
- label-inside-as-placeholder
221
- ${this.size}
222
- ${((_b = this.selection) === null || _b === void 0 ? void 0 : _b.length) ? 'selected' : ''}
288
+ appendHiddenInput(this.host, this.name, (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString(), this.disabled);
289
+ return (h(Host, { role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: `filter ${this.filterFocus ? 'focus' : ''}
290
+ ${this.disabled ? 'disabled' : ''}` }, h("div", { class: "value-wrapper" }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
291
+ label-inside-as-placeholder
292
+ ${this.size}
293
+ ${((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) ? 'selected' : ''}
223
294
  ` }, this.label)), h("input", {
224
295
  // eslint-disable-next-line no-return-assign
225
296
  ref: (element) => (this.inputElement = element), class: `${this.labelPosition === 'inside' ? 'placeholder' : ''}`, type: "text", placeholder: this.placeholder, value: this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onBlur: (event) => {
@@ -242,18 +313,18 @@ export class TdsDropdown {
242
313
  if (event.key === 'Escape') {
243
314
  this.open = false;
244
315
  }
245
- }, class: `
246
- ${this.selection ? 'value' : 'placeholder'}
247
- ${this.open ? 'open' : 'closed'}
248
- ${this.error ? 'error' : ''}
249
- `, disabled: this.disabled }, h("div", { class: `value-wrapper ${this.size}` }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
250
- label-inside-as-placeholder
251
- ${this.size}
252
- ${((_c = this.selection) === null || _c === void 0 ? void 0 : _c.length) ? 'selected' : ''}
253
- ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_d = this.selection) === null || _d === void 0 ? void 0 : _d.length) ? this.getValue() : this.placeholder), h("tds-icon", { class: `${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { ref: (element) => (this.dropdownList = element), class: `dropdown-list
254
- ${this.size}
255
- ${this.open ? 'open' : 'closed'}
256
- ${this.getOpenDirection()}
316
+ }, class: `
317
+ ${this.value ? 'value' : 'placeholder'}
318
+ ${this.open ? 'open' : 'closed'}
319
+ ${this.error ? 'error' : ''}
320
+ `, disabled: this.disabled }, h("div", { class: `value-wrapper ${this.size}` }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
321
+ label-inside-as-placeholder
322
+ ${this.size}
323
+ ${((_c = this.value) === null || _c === void 0 ? void 0 : _c.length) ? 'selected' : ''}
324
+ ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_d = this.value) === null || _d === void 0 ? void 0 : _d.length) ? this.getValue() : this.placeholder), h("tds-icon", { class: `${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { ref: (element) => (this.dropdownList = element), class: `dropdown-list
325
+ ${this.size}
326
+ ${this.open ? 'open' : 'closed'}
327
+ ${this.getOpenDirection()}
257
328
  ${this.label && this.labelPosition === 'outside' ? 'label-outside' : ''}` }, h("slot", null), this.filterResult === 0 && (h("div", { class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { name: "error", size: "16px" }), this.helper))));
258
329
  }
259
330
  static get is() { return "tds-dropdown"; }
@@ -521,7 +592,7 @@ export class TdsDropdown {
521
592
  static get states() {
522
593
  return {
523
594
  "open": {},
524
- "selection": {},
595
+ "value": {},
525
596
  "filterResult": {},
526
597
  "filterFocus": {}
527
598
  };
@@ -538,7 +609,7 @@ export class TdsDropdown {
538
609
  "text": "Change event for the Dropdown."
539
610
  },
540
611
  "complexType": {
541
- "original": "{\r\n name: string;\r\n value: string;\r\n }",
612
+ "original": "{\n name: string;\n value: string;\n }",
542
613
  "resolved": "{ name: string; value: string; }",
543
614
  "references": {}
544
615
  }
@@ -614,10 +685,6 @@ export class TdsDropdown {
614
685
  "Promise": {
615
686
  "location": "global",
616
687
  "id": "global::Promise"
617
- },
618
- "HTMLTdsDropdownOptionElement": {
619
- "location": "global",
620
- "id": "global::HTMLTdsDropdownOptionElement"
621
688
  }
622
689
  },
623
690
  "return": "Promise<void>"
@@ -629,7 +696,7 @@ export class TdsDropdown {
629
696
  },
630
697
  "setValue": {
631
698
  "complexType": {
632
- "signature": "(newValue: string, newValueLabel: string) => Promise<{ value: string; label: string; }[]>",
699
+ "signature": "(value: string | string[], label?: string) => Promise<{ value: string; label: string; }[]>",
633
700
  "parameters": [{
634
701
  "tags": [],
635
702
  "text": ""
@@ -650,10 +717,33 @@ export class TdsDropdown {
650
717
  "return": "Promise<{ value: string; label: string; }[]>"
651
718
  },
652
719
  "docs": {
653
- "text": "Method for setting the value of the Dropdown.",
720
+ "text": "Method for setting the value of the Dropdown.\n\nSingle selection example:\n\n<code>\ndropdown.setValue('option-1', 'Option 1');\n</code>\n\nMultiselect example:\n\n<code>\ndropdown.setValue(['option-1', 'option-2']);\n</code>",
654
721
  "tags": []
655
722
  }
656
723
  },
724
+ "appendValue": {
725
+ "complexType": {
726
+ "signature": "(value: string) => Promise<void>",
727
+ "parameters": [{
728
+ "tags": [],
729
+ "text": ""
730
+ }],
731
+ "references": {
732
+ "Promise": {
733
+ "location": "global",
734
+ "id": "global::Promise"
735
+ }
736
+ },
737
+ "return": "Promise<void>"
738
+ },
739
+ "docs": {
740
+ "text": "",
741
+ "tags": [{
742
+ "name": "internal",
743
+ "text": undefined
744
+ }]
745
+ }
746
+ },
657
747
  "removeValue": {
658
748
  "complexType": {
659
749
  "signature": "(oldValue: string) => Promise<{ value: string; label: string; }[]>",