@duetds/components 4.34.4 → 4.35.2

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 (256) hide show
  1. package/hydrate/index.js +282 -33
  2. package/lib/cjs/duet-alert.cjs.entry.js +1 -1
  3. package/lib/cjs/duet-badge.cjs.entry.js +1 -1
  4. package/lib/cjs/duet-breadcrumb.cjs.entry.js +1 -1
  5. package/lib/cjs/duet-breadcrumbs.cjs.entry.js +1 -1
  6. package/lib/cjs/duet-button_2.cjs.entry.js +2 -2
  7. package/lib/cjs/duet-caption_4.cjs.entry.js +2 -2
  8. package/lib/cjs/duet-card.cjs.entry.js +2 -2
  9. package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
  10. package/lib/cjs/duet-choice_2.cjs.entry.js +2 -2
  11. package/lib/cjs/duet-collapsible.cjs.entry.js +1 -1
  12. package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
  13. package/lib/cjs/duet-date-picker.cjs.entry.js +2 -2
  14. package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
  15. package/lib/cjs/duet-editable-table-button.cjs.entry.js +1 -1
  16. package/lib/cjs/duet-editable-table_4.cjs.entry.js +3 -3
  17. package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
  18. package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
  19. package/lib/cjs/duet-footer.cjs.entry.js +1 -1
  20. package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
  21. package/lib/cjs/duet-header_2.cjs.entry.js +20 -10
  22. package/lib/cjs/duet-hero.cjs.entry.js +1 -1
  23. package/lib/cjs/duet-icon.cjs.entry.js +1 -1
  24. package/lib/cjs/duet-input_2.cjs.entry.js +1 -1
  25. package/lib/cjs/duet-layout.cjs.entry.js +1 -1
  26. package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
  27. package/lib/cjs/duet-modal.cjs.entry.js +15 -3
  28. package/lib/cjs/duet-notification_2.cjs.entry.js +1 -1
  29. package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
  30. package/lib/cjs/duet-progress.cjs.entry.js +1 -1
  31. package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
  32. package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
  33. package/lib/cjs/duet-scrollable_3.cjs.entry.js +414 -0
  34. package/lib/cjs/duet-select.cjs.entry.js +1 -1
  35. package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
  36. package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
  37. package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
  38. package/lib/cjs/duet-tooltip.cjs.entry.js +1 -1
  39. package/lib/cjs/duet-tray.cjs.entry.js +1 -1
  40. package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
  41. package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
  42. package/lib/cjs/duet.cjs.js +2 -2
  43. package/lib/cjs/{focus-utils-0e3a744a.js → focus-utils-15cc3af9.js} +1 -1
  44. package/lib/cjs/{index-0bcb9cea.js → index-a38f3df3.js} +1 -1
  45. package/lib/cjs/loader.cjs.js +2 -2
  46. package/lib/collection/collection-manifest.json +8 -6
  47. package/lib/collection/components/duet-button/duet-button.js +1 -1
  48. package/lib/collection/components/duet-card/duet-card.js +3 -1
  49. package/lib/collection/components/duet-header/duet-header.css +61 -28
  50. package/lib/collection/components/duet-header/duet-header.js +18 -8
  51. package/lib/collection/components/duet-link/duet-link.js +1 -1
  52. package/lib/collection/components/duet-modal/duet-modal.js +33 -3
  53. package/lib/collection/components/duet-scrollable/duet-scrollable.css +83 -0
  54. package/lib/collection/components/duet-scrollable/duet-scrollable.js +240 -0
  55. package/lib/collection/components/duet-tab/duet-tab.js +63 -1
  56. package/lib/collection/components/duet-tab-group/duet-tab-group.css +12 -13
  57. package/lib/collection/components/duet-tab-group/duet-tab-group.js +101 -16
  58. package/lib/collection/components/duet-upload/duet-upload.js +7 -4
  59. package/lib/custom-elements-bundle/index.d.ts +6 -0
  60. package/lib/custom-elements-bundle/index.js +264 -37
  61. package/lib/duet/duet.esm.js +1 -1
  62. package/lib/duet/duet.js +1 -1
  63. package/lib/duet/{p-86013171.entry.js → p-04e3b06b.entry.js} +1 -1
  64. package/lib/duet/{p-808101d8.entry.js → p-0bc3239b.entry.js} +1 -1
  65. package/lib/duet/{p-6d62cb90.entry.js → p-0d15892b.entry.js} +1 -1
  66. package/lib/duet/{p-29000070.entry.js → p-0d6c3d07.entry.js} +1 -1
  67. package/lib/duet/{p-8ea50bd2.system.entry.js → p-0deee587.system.entry.js} +1 -1
  68. package/lib/duet/{p-d53bbad7.entry.js → p-0ea49de8.entry.js} +1 -1
  69. package/lib/duet/{p-379e8ebb.system.entry.js → p-114a20f1.system.entry.js} +1 -1
  70. package/lib/duet/p-13e81854.entry.js +4 -0
  71. package/lib/duet/p-15a42b87.entry.js +4 -0
  72. package/lib/duet/{p-48ed41e6.system.entry.js → p-18441899.system.entry.js} +1 -1
  73. package/lib/duet/{p-a63537e8.entry.js → p-1b98f91c.entry.js} +1 -1
  74. package/lib/duet/{p-1afec19f.entry.js → p-2056e3eb.entry.js} +1 -1
  75. package/lib/duet/{p-7c5b396c.system.entry.js → p-27b953e4.system.entry.js} +1 -1
  76. package/lib/duet/{p-5ea30033.entry.js → p-29e59e77.entry.js} +1 -1
  77. package/lib/duet/{p-4b7f998d.system.entry.js → p-2c8bd5a2.system.entry.js} +1 -1
  78. package/lib/duet/{p-36eae676.entry.js → p-30783ea4.entry.js} +1 -1
  79. package/lib/duet/{p-5b409624.system.entry.js → p-3081f8a5.system.entry.js} +1 -1
  80. package/lib/duet/p-35ff635e.system.js +4 -0
  81. package/lib/duet/{p-9aa7cb17.entry.js → p-38128fc3.entry.js} +1 -1
  82. package/lib/duet/{p-98fabd8b.entry.js → p-3b244de7.entry.js} +1 -1
  83. package/lib/duet/{p-3953b77a.system.entry.js → p-3baf5b41.system.entry.js} +1 -1
  84. package/lib/duet/{p-35133bc9.entry.js → p-3bd812df.entry.js} +1 -1
  85. package/lib/duet/{p-0aec7e4b.entry.js → p-3dbeddf5.entry.js} +1 -1
  86. package/lib/duet/{p-e90db543.system.entry.js → p-3e578cc5.system.entry.js} +1 -1
  87. package/lib/duet/p-41b4bad1.entry.js +4 -0
  88. package/lib/duet/{p-dc226f92.system.entry.js → p-49820427.system.entry.js} +1 -1
  89. package/lib/duet/{p-fe889838.system.js → p-4accc70c.system.js} +1 -1
  90. package/lib/duet/{p-ea934463.entry.js → p-4c3961a5.entry.js} +1 -1
  91. package/lib/duet/{p-e96fca2b.system.entry.js → p-4d7abe27.system.entry.js} +1 -1
  92. package/lib/duet/{p-aa379dec.system.entry.js → p-54d296d9.system.entry.js} +1 -1
  93. package/lib/duet/{p-0d18269c.entry.js → p-573921ca.entry.js} +1 -1
  94. package/lib/duet/{p-ddf5ecf5.system.entry.js → p-5af271ce.system.entry.js} +1 -1
  95. package/lib/duet/{p-bb1271a8.system.entry.js → p-5f24e161.system.entry.js} +1 -1
  96. package/lib/duet/{p-255bc205.system.entry.js → p-632186a9.system.entry.js} +1 -1
  97. package/lib/duet/{p-8bbdfac5.system.entry.js → p-67b22acc.system.entry.js} +1 -1
  98. package/lib/duet/{p-9c046b9a.entry.js → p-69c4ff6f.entry.js} +1 -1
  99. package/lib/duet/{p-f16213de.entry.js → p-6b3a14c2.entry.js} +1 -1
  100. package/lib/duet/{p-8049159b.system.entry.js → p-70cf255e.system.entry.js} +1 -1
  101. package/lib/duet/{p-ee58a262.entry.js → p-7142b886.entry.js} +1 -1
  102. package/lib/duet/{p-63ac5acd.entry.js → p-7641054f.entry.js} +1 -1
  103. package/lib/duet/{p-ea232a29.entry.js → p-7d019a4d.entry.js} +1 -1
  104. package/lib/duet/{p-f645b369.system.entry.js → p-7e2a2e30.system.entry.js} +1 -1
  105. package/lib/duet/{p-a209e483.entry.js → p-83261c61.entry.js} +1 -1
  106. package/lib/duet/{p-0cb07574.js → p-875bd99c.js} +1 -1
  107. package/lib/duet/{p-927e83d1.entry.js → p-889193e8.entry.js} +1 -1
  108. package/lib/duet/{p-4002454d.system.entry.js → p-8acdabb5.system.entry.js} +1 -1
  109. package/lib/duet/{p-3948a5c4.system.entry.js → p-8edd126b.system.entry.js} +1 -1
  110. package/lib/duet/{p-236cb8b6.entry.js → p-94b4ec76.entry.js} +1 -1
  111. package/lib/duet/{p-ded5548b.system.entry.js → p-97353a7f.system.entry.js} +1 -1
  112. package/lib/duet/{p-6d05eb8c.entry.js → p-9a47c28a.entry.js} +1 -1
  113. package/lib/duet/{p-2f36de45.entry.js → p-9b0c78de.entry.js} +1 -1
  114. package/lib/duet/{p-32488531.system.entry.js → p-9dd65758.system.entry.js} +1 -1
  115. package/lib/duet/{p-cf886223.entry.js → p-a53a8675.entry.js} +1 -1
  116. package/lib/duet/{p-ab6109d6.system.entry.js → p-a73609b4.system.entry.js} +1 -1
  117. package/lib/duet/{p-719e38e3.system.entry.js → p-ac01755b.system.entry.js} +1 -1
  118. package/lib/duet/{p-0a664450.system.entry.js → p-acf24fcd.system.entry.js} +1 -1
  119. package/lib/duet/{p-db1a8956.system.entry.js → p-aed2a35e.system.entry.js} +1 -1
  120. package/lib/duet/{p-fab77260.system.entry.js → p-b1ae4d5b.system.entry.js} +2 -2
  121. package/lib/duet/{p-c6c768b9.system.entry.js → p-b2985c8e.system.entry.js} +1 -1
  122. package/lib/duet/{p-842a43e7.system.entry.js → p-b692b4a4.system.entry.js} +1 -1
  123. package/lib/duet/{p-9f6649ef.system.entry.js → p-b80d80dc.system.entry.js} +1 -1
  124. package/lib/duet/{p-5e15d8f8.js → p-bcf94afd.js} +1 -1
  125. package/lib/duet/p-be872079.entry.js +4 -0
  126. package/lib/duet/{p-67798ed0.entry.js → p-bf859d7b.entry.js} +1 -1
  127. package/lib/duet/{p-09845306.entry.js → p-c0fa8865.entry.js} +1 -1
  128. package/lib/duet/{p-07bec67d.system.entry.js → p-c479f3be.system.entry.js} +1 -1
  129. package/lib/duet/{p-e339cb4f.entry.js → p-c9020872.entry.js} +1 -1
  130. package/lib/duet/{p-0945e0ac.entry.js → p-c99e23d2.entry.js} +1 -1
  131. package/lib/duet/p-ce40057c.entry.js +4 -0
  132. package/lib/duet/{p-51d5b428.system.js → p-d04561dc.system.js} +1 -1
  133. package/lib/duet/{p-addff36a.system.entry.js → p-d158b9ca.system.entry.js} +1 -1
  134. package/lib/duet/{p-a5b9f195.system.entry.js → p-d2edeb9a.system.entry.js} +1 -1
  135. package/lib/duet/{p-1c38354b.system.entry.js → p-d3432b68.system.entry.js} +1 -1
  136. package/lib/duet/{p-5818108d.system.entry.js → p-d6563133.system.entry.js} +1 -1
  137. package/lib/duet/{p-00b102b8.entry.js → p-d9da705b.entry.js} +1 -1
  138. package/lib/duet/p-e3c66ce5.system.entry.js +4 -0
  139. package/lib/duet/{p-c6268af4.entry.js → p-e701e364.entry.js} +1 -1
  140. package/lib/duet/{p-d701bd87.system.entry.js → p-e7056ea5.system.entry.js} +1 -1
  141. package/lib/duet/{p-55ad1bfb.entry.js → p-e9064858.entry.js} +1 -1
  142. package/lib/duet/{p-fedad35b.system.entry.js → p-e9ca4ae1.system.entry.js} +2 -2
  143. package/lib/duet/{p-5a9266c8.system.entry.js → p-ed981e8d.system.entry.js} +1 -1
  144. package/lib/duet/{p-db75f866.entry.js → p-ef7560b6.entry.js} +1 -1
  145. package/lib/duet/{p-1f08d290.system.entry.js → p-f1803ec3.system.entry.js} +1 -1
  146. package/lib/duet/p-f261a666.system.entry.js +4 -0
  147. package/lib/duet/{p-b465ac62.entry.js → p-fa5a028c.entry.js} +1 -1
  148. package/lib/esm/duet-alert.entry.js +1 -1
  149. package/lib/esm/duet-badge.entry.js +1 -1
  150. package/lib/esm/duet-breadcrumb.entry.js +1 -1
  151. package/lib/esm/duet-breadcrumbs.entry.js +1 -1
  152. package/lib/esm/duet-button_2.entry.js +2 -2
  153. package/lib/esm/duet-caption_4.entry.js +2 -2
  154. package/lib/esm/duet-card.entry.js +2 -2
  155. package/lib/esm/duet-checkbox.entry.js +1 -1
  156. package/lib/esm/duet-choice_2.entry.js +2 -2
  157. package/lib/esm/duet-collapsible.entry.js +1 -1
  158. package/lib/esm/duet-cookie-consent.entry.js +1 -1
  159. package/lib/esm/duet-date-picker.entry.js +2 -2
  160. package/lib/esm/duet-divider_2.entry.js +1 -1
  161. package/lib/esm/duet-editable-table-button.entry.js +1 -1
  162. package/lib/esm/duet-editable-table_4.entry.js +3 -3
  163. package/lib/esm/duet-empty-state.entry.js +1 -1
  164. package/lib/esm/duet-fieldset.entry.js +1 -1
  165. package/lib/esm/duet-footer.entry.js +1 -1
  166. package/lib/esm/duet-grid_2.entry.js +1 -1
  167. package/lib/esm/duet-header_2.entry.js +20 -10
  168. package/lib/esm/duet-hero.entry.js +1 -1
  169. package/lib/esm/duet-icon.entry.js +1 -1
  170. package/lib/esm/duet-input_2.entry.js +1 -1
  171. package/lib/esm/duet-layout.entry.js +1 -1
  172. package/lib/esm/duet-list_2.entry.js +1 -1
  173. package/lib/esm/duet-modal.entry.js +15 -3
  174. package/lib/esm/duet-notification_2.entry.js +1 -1
  175. package/lib/esm/duet-number-input.entry.js +1 -1
  176. package/lib/esm/duet-progress.entry.js +1 -1
  177. package/lib/esm/duet-radio_2.entry.js +1 -1
  178. package/lib/esm/duet-range-slider.entry.js +1 -1
  179. package/lib/esm/duet-scrollable_3.entry.js +408 -0
  180. package/lib/esm/duet-select.entry.js +1 -1
  181. package/lib/esm/duet-step_2.entry.js +1 -1
  182. package/lib/esm/duet-textarea.entry.js +1 -1
  183. package/lib/esm/duet-toggle.entry.js +1 -1
  184. package/lib/esm/duet-tooltip.entry.js +1 -1
  185. package/lib/esm/duet-tray.entry.js +1 -1
  186. package/lib/esm/duet-upload-aria-status.entry.js +1 -1
  187. package/lib/esm/duet-visually-hidden.entry.js +1 -1
  188. package/lib/esm/duet.js +2 -2
  189. package/lib/esm/{focus-utils-8d0688ae.js → focus-utils-d3cd655b.js} +1 -1
  190. package/lib/esm/{index-ff4326da.js → index-eb374972.js} +1 -1
  191. package/lib/esm/loader.js +2 -2
  192. package/lib/esm-es5/duet-alert.entry.js +1 -1
  193. package/lib/esm-es5/duet-badge.entry.js +1 -1
  194. package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
  195. package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
  196. package/lib/esm-es5/duet-button_2.entry.js +1 -1
  197. package/lib/esm-es5/duet-caption_4.entry.js +1 -1
  198. package/lib/esm-es5/duet-card.entry.js +1 -1
  199. package/lib/esm-es5/duet-checkbox.entry.js +1 -1
  200. package/lib/esm-es5/duet-choice_2.entry.js +2 -2
  201. package/lib/esm-es5/duet-collapsible.entry.js +1 -1
  202. package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
  203. package/lib/esm-es5/duet-date-picker.entry.js +1 -1
  204. package/lib/esm-es5/duet-divider_2.entry.js +1 -1
  205. package/lib/esm-es5/duet-editable-table-button.entry.js +1 -1
  206. package/lib/esm-es5/duet-editable-table_4.entry.js +1 -1
  207. package/lib/esm-es5/duet-empty-state.entry.js +1 -1
  208. package/lib/esm-es5/duet-fieldset.entry.js +1 -1
  209. package/lib/esm-es5/duet-footer.entry.js +1 -1
  210. package/lib/esm-es5/duet-grid_2.entry.js +1 -1
  211. package/lib/esm-es5/duet-header_2.entry.js +2 -2
  212. package/lib/esm-es5/duet-hero.entry.js +1 -1
  213. package/lib/esm-es5/duet-icon.entry.js +1 -1
  214. package/lib/esm-es5/duet-input_2.entry.js +1 -1
  215. package/lib/esm-es5/duet-layout.entry.js +1 -1
  216. package/lib/esm-es5/duet-list_2.entry.js +1 -1
  217. package/lib/esm-es5/duet-modal.entry.js +1 -1
  218. package/lib/esm-es5/duet-notification_2.entry.js +1 -1
  219. package/lib/esm-es5/duet-number-input.entry.js +1 -1
  220. package/lib/esm-es5/duet-progress.entry.js +1 -1
  221. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  222. package/lib/esm-es5/duet-range-slider.entry.js +1 -1
  223. package/lib/esm-es5/duet-scrollable_3.entry.js +4 -0
  224. package/lib/esm-es5/duet-select.entry.js +1 -1
  225. package/lib/esm-es5/duet-step_2.entry.js +1 -1
  226. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  227. package/lib/esm-es5/duet-toggle.entry.js +1 -1
  228. package/lib/esm-es5/duet-tooltip.entry.js +1 -1
  229. package/lib/esm-es5/duet-tray.entry.js +1 -1
  230. package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
  231. package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
  232. package/lib/esm-es5/duet.js +1 -1
  233. package/lib/esm-es5/focus-utils-d3cd655b.js +4 -0
  234. package/lib/esm-es5/{index-ff4326da.js → index-eb374972.js} +1 -1
  235. package/lib/esm-es5/loader.js +1 -1
  236. package/lib/html.html-data.json +62 -3
  237. package/lib/types/components/duet-card/duet-card.d.ts +1 -0
  238. package/lib/types/components/duet-modal/duet-modal.d.ts +5 -1
  239. package/lib/types/components/duet-scrollable/duet-scrollable.d.ts +51 -0
  240. package/lib/types/components/duet-tab/duet-tab.d.ts +11 -0
  241. package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +15 -0
  242. package/lib/types/components/duet-upload/duet-upload.d.ts +3 -0
  243. package/lib/types/components.d.ts +90 -1
  244. package/package.json +6 -5
  245. package/lib/cjs/duet-tab_2.cjs.entry.js +0 -213
  246. package/lib/duet/p-130476dc.entry.js +0 -4
  247. package/lib/duet/p-30410b67.system.js +0 -4
  248. package/lib/duet/p-4d30eee1.entry.js +0 -4
  249. package/lib/duet/p-56cda85e.system.entry.js +0 -4
  250. package/lib/duet/p-6f7539a6.entry.js +0 -4
  251. package/lib/duet/p-87804904.system.entry.js +0 -4
  252. package/lib/duet/p-b9fe29c7.entry.js +0 -4
  253. package/lib/duet/p-d9f076ed.entry.js +0 -4
  254. package/lib/esm/duet-tab_2.entry.js +0 -208
  255. package/lib/esm-es5/duet-tab_2.entry.js +0 -4
  256. package/lib/esm-es5/focus-utils-8d0688ae.js +0 -4
@@ -64,7 +64,7 @@ export class DuetLink {
64
64
  "duet-link": true,
65
65
  "duet-link-is-external": this.external,
66
66
  "duet-theme-turva": this.theme === "turva",
67
- }, target: this.external ? "_blank" : "_self", "aria-label": this.accessibleLabel, id: this.identifier, ref: el => (this.nativeLink = el), part: "duet-link" },
67
+ }, target: this.external ? "_blank" : "_self", "aria-label": this.accessibleLabel, id: this.identifier, ref: el => (this.nativeLink = el), part: "duet-link", rel: this.external ? "noopener" : undefined },
68
68
  h("slot", null),
69
69
  Build.isBrowser && this.external && (h(Fragment, null,
70
70
  h("duet-visually-hidden", null, this.accessibleLabelExternal),
@@ -103,6 +103,10 @@ export class DuetModal {
103
103
  * Use this property when you need to have the modal dialog initially active.
104
104
  */
105
105
  this.active = false;
106
+ /**
107
+ * Use this property when you want the modal to close when clicked outside of modal.
108
+ */
109
+ this.closeOnBlur = false;
106
110
  }
107
111
  openChanged() {
108
112
  if (this.open) {
@@ -217,8 +221,16 @@ export class DuetModal {
217
221
  h("div", { class: {
218
222
  "duet-modal-inner": true,
219
223
  "duet-modal-large": this.size === "large",
220
- }, role: "document" },
221
- h("div", { class: { "duet-modal": true, [this.size]: true } },
224
+ }, role: "document", onClick: e => {
225
+ if (this.closeOnBlur) {
226
+ this.closeModal(e);
227
+ }
228
+ } },
229
+ h("div", { class: { "duet-modal": true, [this.size]: true }, onClick: e => {
230
+ if (this.closeOnBlur) {
231
+ e.stopPropagation();
232
+ }
233
+ } },
222
234
  h("duet-spacer", null),
223
235
  h("div", { class: "duet-modal-close" },
224
236
  h("duet-button", { ref: button => (this.buttonEl = button), variation: "plain", accessibleLabel: this.accessibleCloseLabel, color: closeColor, iconSize: "large", icon: "navigation-close", iconOnly: true, margin: "none", theme: this.theme, onClick: ev => this.closeModal(ev), fixed: true })),
@@ -493,6 +505,24 @@ export class DuetModal {
493
505
  "attribute": "active",
494
506
  "reflect": true,
495
507
  "defaultValue": "false"
508
+ },
509
+ "closeOnBlur": {
510
+ "type": "boolean",
511
+ "mutable": true,
512
+ "complexType": {
513
+ "original": "boolean",
514
+ "resolved": "boolean",
515
+ "references": {}
516
+ },
517
+ "required": false,
518
+ "optional": false,
519
+ "docs": {
520
+ "tags": [],
521
+ "text": "Use this property when you want the modal to close when clicked outside of modal."
522
+ },
523
+ "attribute": "close-on-blur",
524
+ "reflect": false,
525
+ "defaultValue": "false"
496
526
  }
497
527
  }; }
498
528
  static get states() { return {
@@ -536,7 +566,7 @@ export class DuetModal {
536
566
  "composed": true,
537
567
  "docs": {
538
568
  "tags": [],
539
- "text": "Emitted when the close button or esc is hit, but before the modal is closed. To prevent the modal from actually closing, use ev.detail.originalEvent.preventDefault()."
569
+ "text": "Emitted before the modal is closed. To prevent the modal from actually closing, use ev.detail.originalEvent.preventDefault()."
540
570
  },
541
571
  "complexType": {
542
572
  "original": "DuetModalCloseEvent",
@@ -0,0 +1,83 @@
1
+ *,
2
+ *::after,
3
+ *::before {
4
+ box-sizing: border-box;
5
+ padding: 0;
6
+ margin: 0;
7
+ background: transparent;
8
+ border: 0;
9
+ -moz-appearance: none;
10
+ -webkit-appearance: none;
11
+ appearance: none;
12
+ }
13
+
14
+ :host {
15
+ box-sizing: border-box;
16
+ padding: 0;
17
+ margin: 0;
18
+ background: transparent;
19
+ border: 0;
20
+ -moz-appearance: none;
21
+ -webkit-appearance: none;
22
+ appearance: none;
23
+ -webkit-tap-highlight-color: transparent;
24
+ }
25
+
26
+ :host {
27
+ position: relative !important;
28
+ }
29
+ :host .duet-scrollable-items {
30
+ display: flex;
31
+ }
32
+ :host .duet-scrollable-items .duet-scrollable-button {
33
+ position: relative;
34
+ flex: 0 0 auto;
35
+ flex-basis: 40px;
36
+ padding: 10px;
37
+ cursor: pointer;
38
+ }
39
+ :host .duet-scrollable-items .duet-scrollable-button:active {
40
+ transform: scale(0.8);
41
+ }
42
+ :host .duet-scrollable-items .duet-scrollable-button--left {
43
+ left: -12px;
44
+ }
45
+ :host .duet-scrollable-items .duet-scrollable-button--right {
46
+ right: -12px;
47
+ }
48
+ :host .duet-scrollable-items .duet-scrollable-button--occluded {
49
+ display: none;
50
+ }
51
+ :host .duet-scrollable-items .duet-scrollable-list {
52
+ display: flex;
53
+ flex-wrap: nowrap;
54
+ gap: 20px;
55
+ padding-top: 2px;
56
+ /* Make this scrollable when needed */
57
+ overflow-x: auto;
58
+ /* We don't want vertical scrolling */
59
+ overflow-y: hidden;
60
+ /* We don't want internal inline elements to wrap */
61
+ white-space: nowrap;
62
+ scroll-snap-type: x mandatory;
63
+ scroll-behavior: smooth;
64
+ /* Add margin at ends to make visual appearance better */
65
+ scroll-margin: 0 20px;
66
+ /* Make an auto-hiding scroller for the 3 people using a IE */
67
+ -ms-overflow-style: -ms-autohiding-scrollbar;
68
+ /* For WebKit implementations, provide inertia scrolling */
69
+ -webkit-overflow-scrolling: touch;
70
+ /* Remove the default scrollbar for WebKit implementations */
71
+ }
72
+ :host .duet-scrollable-items .duet-scrollable-list::-webkit-scrollbar {
73
+ display: none;
74
+ }
75
+
76
+ ::slotted(*) {
77
+ scroll-snap-align: center;
78
+ margin-left: 0;
79
+ -webkit-transition: -webkit-transform 0.2s ease-in-out;
80
+ transition: -webkit-transform 0.2s ease-in-out;
81
+ transition: transform 0.2s ease-in-out;
82
+ transition: transform 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
83
+ }
@@ -0,0 +1,240 @@
1
+ /*!
2
+ * Built with Duet Design System
3
+ */
4
+ import { Component, Element, h, Host, Prop, State, Watch } from "@stencil/core";
5
+ import { inheritGlobalTheme } from "../../utils/themeable-component";
6
+ export class DuetScrollable {
7
+ constructor() {
8
+ /**
9
+ * Private variables and constants index
10
+ */
11
+ this.currentIndex = 0;
12
+ this.tabListElement = undefined;
13
+ this.tabListClass = "duet-scrollable-list";
14
+ this.tablistAtStart = true;
15
+ this.isTabContentSmallerThanWrapper = false;
16
+ this.tablistAtEnd = false;
17
+ this.childrenData = {};
18
+ this.resizeObserver = new ResizeObserver(entries => {
19
+ var _a, _b, _c, _d;
20
+ // otherwise, something is wrong, expecting 1 element only
21
+ if ((entries === null || entries === void 0 ? void 0 : entries.length) === 1) {
22
+ const currentWidth = (_b = (_a = entries[0]) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().width;
23
+ const scrollWidth = (_d = (_c = entries[0]) === null || _c === void 0 ? void 0 : _c.target) === null || _d === void 0 ? void 0 : _d.scrollWidth;
24
+ // in order to avoid state "jumping" on the boundary condition we add a few pixels to the comparison
25
+ this.isTabContentSmallerThanWrapper = scrollWidth > currentWidth + 5;
26
+ }
27
+ });
28
+ /**
29
+ * Theme of duet-tab-scrollable. When used this will override the color setting and
30
+ * use "primary" or "primary-turva" as the color depending on which theme
31
+ * is chosen.
32
+ */
33
+ this.theme = "";
34
+ /**
35
+ * Optional identifier to add to buttons in the tab group
36
+ */
37
+ this.identifier = "";
38
+ /**
39
+ * Selected element
40
+ */
41
+ this.selected = 0;
42
+ }
43
+ watchPropHandler(newValue) {
44
+ this.scrollToTab(newValue, "center");
45
+ }
46
+ /**
47
+ * Component lifecycle events.
48
+ */
49
+ componentWillLoad() {
50
+ inheritGlobalTheme(this);
51
+ const slotted = this.host.children;
52
+ this.childrenData = { hasChildren: slotted && slotted.length > 0, numberOfChildren: slotted && slotted.length };
53
+ }
54
+ componentDidLoad() {
55
+ this.resizeObserver.observe(this.tabListElement);
56
+ }
57
+ disconnectedCallback() {
58
+ this.resizeObserver.disconnect();
59
+ }
60
+ /**
61
+ * Private methods.
62
+ */
63
+ getLastVisibleElement() {
64
+ const clientWidth = this.tabListElement.clientWidth;
65
+ const xValues = Array.from(this.host.querySelectorAll("button")).findIndex(element => element.getBoundingClientRect().x > clientWidth);
66
+ return xValues;
67
+ }
68
+ getFirstVisibleElement() {
69
+ const buttonCollection = this.host.querySelectorAll("button");
70
+ // reverse the array because we want the first invisible element form the middle, not the first in the list
71
+ const arrayOfXValues = Array.from(buttonCollection).map(el => el.getBoundingClientRect().x - el.getBoundingClientRect().width);
72
+ const xValues = arrayOfXValues.findIndex(element => {
73
+ return element > 0;
74
+ });
75
+ return xValues;
76
+ }
77
+ updateScrollButtons(container = this.tabListElement) {
78
+ if (container.scrollLeft <= 0) {
79
+ this.tablistAtStart = true;
80
+ }
81
+ else if (container.scrollLeft > 0) {
82
+ this.tablistAtStart = false;
83
+ }
84
+ if (container.clientWidth + container.scrollLeft + 10 >= container.scrollWidth) {
85
+ this.tablistAtEnd = true;
86
+ }
87
+ else if (container.clientWidth + container.scrollLeft + 10 < container.scrollWidth) {
88
+ this.tablistAtEnd = false;
89
+ }
90
+ }
91
+ scrollToTab(index = this.currentIndex, inline) {
92
+ if (!this.childrenData.hasChildren) {
93
+ return;
94
+ }
95
+ if (index + 1 >= this.childrenData.numberOfChildren) {
96
+ index = this.childrenData.numberOfChildren - 1;
97
+ }
98
+ if (index < 0) {
99
+ index = 0;
100
+ }
101
+ const buttons = this.host.querySelectorAll("button");
102
+ // store previous position
103
+ let prevPosition = buttons[0].getBoundingClientRect().x;
104
+ // iterations to run
105
+ let ticksWhereScrollDidNotHappen = 5;
106
+ const getAnimationFrame = () => {
107
+ // if we get the same value enter the logic loop
108
+ if (buttons[0].getBoundingClientRect().x === prevPosition) {
109
+ ticksWhereScrollDidNotHappen--;
110
+ // When iteration is not complete run the calculation again
111
+ if (ticksWhereScrollDidNotHappen !== 0) {
112
+ window.requestAnimationFrame(getAnimationFrame);
113
+ return;
114
+ }
115
+ this.updateScrollButtons();
116
+ }
117
+ else {
118
+ window.requestAnimationFrame(getAnimationFrame);
119
+ prevPosition = buttons[0].getBoundingClientRect().x;
120
+ }
121
+ };
122
+ buttons[index].scrollIntoView({ behavior: "smooth", inline });
123
+ window.requestAnimationFrame(getAnimationFrame);
124
+ }
125
+ scrollLeft() {
126
+ this.tablistAtEnd = false;
127
+ const first = this.getFirstVisibleElement() - 1;
128
+ this.scrollToTab(first, "center");
129
+ }
130
+ scrollRight() {
131
+ this.tablistAtStart = false;
132
+ const last = this.getLastVisibleElement() + 1;
133
+ this.scrollToTab(last, "center");
134
+ }
135
+ /**
136
+ * render() function
137
+ * Always the last one in the class.
138
+ */
139
+ render() {
140
+ return (h(Host, { class: {
141
+ "duet-theme-turva": this.theme === "turva",
142
+ "duet-theme-default": this.theme === "default",
143
+ } },
144
+ h("div", { class: "duet-scrollable-items" },
145
+ h("button", { part: `${this.identifier}-button-left`, "aria-hidden": "true", class: {
146
+ "duet-scrollable-button": true,
147
+ "duet-scrollable-button--left": true,
148
+ "duet-scrollable-button--occluded": !this.isTabContentSmallerThanWrapper,
149
+ }, onClick: () => this.scrollLeft(), disabled: this.tablistAtStart, tabindex: "-1" },
150
+ h("duet-icon", { name: "action-arrow-left-small", size: "small", margin: "none" })),
151
+ h("div", { class: this.tabListClass, onScroll: () => this.updateScrollButtons(), ref: element => (this.tabListElement = element) },
152
+ h("slot", null)),
153
+ h("button", { part: `${this.identifier}-button-right`, "aria-hidden": "true", class: {
154
+ "duet-scrollable-button": true,
155
+ "duet-scrollable-button--right": true,
156
+ "duet-scrollable-button--occluded": !this.isTabContentSmallerThanWrapper,
157
+ }, onClick: () => this.scrollRight(), disabled: this.tablistAtEnd, tabindex: "-1" },
158
+ h("duet-icon", { name: "action-arrow-right-small", size: "small", margin: "none" })))));
159
+ }
160
+ static get is() { return "duet-scrollable"; }
161
+ static get encapsulation() { return "shadow"; }
162
+ static get originalStyleUrls() { return {
163
+ "$": ["duet-scrollable.scss"]
164
+ }; }
165
+ static get styleUrls() { return {
166
+ "$": ["duet-scrollable.css"]
167
+ }; }
168
+ static get properties() { return {
169
+ "theme": {
170
+ "type": "string",
171
+ "mutable": true,
172
+ "complexType": {
173
+ "original": "DuetTheme",
174
+ "resolved": "\"\" | \"default\" | \"turva\"",
175
+ "references": {
176
+ "DuetTheme": {
177
+ "location": "import",
178
+ "path": "../../common-types"
179
+ }
180
+ }
181
+ },
182
+ "required": false,
183
+ "optional": false,
184
+ "docs": {
185
+ "tags": [],
186
+ "text": "Theme of duet-tab-scrollable. When used this will override the color setting and\nuse \"primary\" or \"primary-turva\" as the color depending on which theme\nis chosen."
187
+ },
188
+ "attribute": "theme",
189
+ "reflect": false,
190
+ "defaultValue": "\"\""
191
+ },
192
+ "identifier": {
193
+ "type": "string",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "string",
197
+ "resolved": "string",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "Optional identifier to add to buttons in the tab group"
205
+ },
206
+ "attribute": "identifier",
207
+ "reflect": false,
208
+ "defaultValue": "\"\""
209
+ },
210
+ "selected": {
211
+ "type": "number",
212
+ "mutable": true,
213
+ "complexType": {
214
+ "original": "number",
215
+ "resolved": "number",
216
+ "references": {}
217
+ },
218
+ "required": false,
219
+ "optional": false,
220
+ "docs": {
221
+ "tags": [],
222
+ "text": "Selected element"
223
+ },
224
+ "attribute": "selected",
225
+ "reflect": false,
226
+ "defaultValue": "0"
227
+ }
228
+ }; }
229
+ static get states() { return {
230
+ "tablistAtStart": {},
231
+ "isTabContentSmallerThanWrapper": {},
232
+ "tablistAtEnd": {},
233
+ "childrenData": {}
234
+ }; }
235
+ static get elementRef() { return "host"; }
236
+ static get watchers() { return [{
237
+ "propName": "selected",
238
+ "methodName": "watchPropHandler"
239
+ }]; }
240
+ }
@@ -2,14 +2,29 @@
2
2
  * Built with Duet Design System
3
3
  */
4
4
  import { Build, Component, h, Prop } from "@stencil/core";
5
+ import { getLocaleString } from "../../utils/language-utils";
5
6
  export class DuetTab {
7
+ constructor() {
8
+ /**
9
+ * Defaults for AccessibleLabel
10
+ * @default null
11
+ */
12
+ this.accessibleDescriptionDefault = null;
13
+ /**
14
+ * String for AccessibleLabel
15
+ * @default null
16
+ */
17
+ this.accessibleDescription = this.accessibleDescriptionDefault
18
+ ? getLocaleString(this.accessibleDescriptionDefault)
19
+ : null;
20
+ }
6
21
  /**
7
22
  * render() function
8
23
  * Always the last one in the class.
9
24
  */
10
25
  render() {
11
26
  if (Build.isBrowser) {
12
- return (h("div", { role: "tabpanel", class: { "duet-tab": true, selected: this.selected } },
27
+ return (h("div", { role: "tabpanel", class: { "duet-tab": true, selected: this.selected }, "aria-description": this.accessibleDescription },
13
28
  h("slot", null)));
14
29
  }
15
30
  }
@@ -55,6 +70,53 @@ export class DuetTab {
55
70
  },
56
71
  "attribute": "selected",
57
72
  "reflect": true
73
+ },
74
+ "accessibleDescriptionDefault": {
75
+ "type": "string",
76
+ "mutable": false,
77
+ "complexType": {
78
+ "original": "DuetLangObject | string",
79
+ "resolved": "DuetLangObject | string",
80
+ "references": {
81
+ "DuetLangObject": {
82
+ "location": "import",
83
+ "path": "../../utils/language-utils"
84
+ }
85
+ }
86
+ },
87
+ "required": false,
88
+ "optional": false,
89
+ "docs": {
90
+ "tags": [{
91
+ "name": "default",
92
+ "text": "null"
93
+ }],
94
+ "text": "Defaults for AccessibleLabel"
95
+ },
96
+ "attribute": "accessible-description-defaults",
97
+ "reflect": false,
98
+ "defaultValue": "null"
99
+ },
100
+ "accessibleDescription": {
101
+ "type": "string",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "string",
105
+ "resolved": "string",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [{
112
+ "name": "default",
113
+ "text": "null"
114
+ }],
115
+ "text": "String for AccessibleLabel"
116
+ },
117
+ "attribute": "accessible-description",
118
+ "reflect": false,
119
+ "defaultValue": "this.accessibleDescriptionDefault\n ? getLocaleString(this.accessibleDescriptionDefault)\n : null"
58
120
  }
59
121
  }; }
60
122
  }
@@ -36,11 +36,11 @@
36
36
  .duet-tab-group-tabs.duet-m-0 {
37
37
  margin: 0 !important;
38
38
  }
39
- .duet-tab-group-tabs.duet-tab-group-hidden {
39
+ .duet-tab-group-tabs.duet-tab-group-collapses.duet-tab-group-hidden {
40
40
  display: none;
41
41
  }
42
42
  @media (min-width: 36em) {
43
- .duet-tab-group-tabs.duet-tab-group-hidden {
43
+ .duet-tab-group-tabs.duet-tab-group-collapses.duet-tab-group-hidden {
44
44
  display: block;
45
45
  }
46
46
  }
@@ -48,7 +48,7 @@
48
48
  border-bottom: 1px solid #e1e3e6;
49
49
  }
50
50
  .duet-theme-turva.duet-tab-variation-plain .duet-tab-group-tabs {
51
- border-bottom-color: #e4e4e6 !important;
51
+ border-bottom-color: #e4e4e6;
52
52
  }
53
53
 
54
54
  @media (min-width: 36em) {
@@ -70,13 +70,12 @@
70
70
  font-size: 1rem;
71
71
  font-weight: 600;
72
72
  line-height: 1.1;
73
- color: #00294d !important;
73
+ color: #00294d;
74
74
  text-align: left;
75
75
  text-decoration: none;
76
76
  cursor: pointer;
77
77
  background: white;
78
78
  border: 2px solid #e1e3e6;
79
- border-style: solid;
80
79
  border-radius: 0;
81
80
  transition: 150ms ease;
82
81
  }
@@ -88,7 +87,7 @@
88
87
  }
89
88
  .duet-theme-turva .duet-tab-button {
90
89
  font-family: "turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
91
- color: #171c3a !important;
90
+ color: #171c3a;
92
91
  border-color: #e4e4e6;
93
92
  }
94
93
  .duet-tab-button.duet-p-0 {
@@ -108,7 +107,7 @@
108
107
  border-color: #909599;
109
108
  }
110
109
  .duet-theme-turva .duet-tab-button:hover {
111
- border-color: #747475 !important;
110
+ border-color: #747475;
112
111
  }
113
112
  .duet-tab-button:active {
114
113
  opacity: 0.75;
@@ -116,16 +115,16 @@
116
115
  }
117
116
  .duet-tab-button.selected {
118
117
  z-index: 201;
119
- color: white !important;
118
+ color: white;
120
119
  background: #00294d;
121
120
  border-color: #00294d;
122
121
  outline: 0;
123
122
  box-shadow: none !important;
124
123
  }
125
124
  .duet-theme-turva .duet-tab-button.selected {
126
- color: white !important;
125
+ color: white;
127
126
  background-color: #171c3a;
128
- border-color: #171c3a !important;
127
+ border-color: #171c3a;
129
128
  }
130
129
  .duet-tab-button:focus {
131
130
  z-index: 200;
@@ -171,13 +170,13 @@
171
170
  margin-left: 36px;
172
171
  }
173
172
  .duet-tab-variation-plain .duet-tab-button.selected {
174
- color: #0077b3 !important;
173
+ color: #0077b3;
175
174
  background: white;
176
175
  border-bottom: 3px solid #0077b3;
177
176
  }
178
177
  .duet-theme-turva.duet-tab-variation-plain .duet-tab-button.selected {
179
- color: #c60c30 !important;
180
- border-bottom-color: #c60c30 !important;
178
+ color: #c60c30;
179
+ border-bottom-color: #c60c30;
181
180
  }
182
181
 
183
182
  .duet-tab-group-content {