@nldd/design-system 0.19.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/custom-elements.json +521 -57
  2. package/dist/cdn/autoloader.js +181 -0
  3. package/dist/cdn/chunks/activity-indicator-JglZJ8dh.js +356 -0
  4. package/dist/cdn/chunks/activity-indicator.i18n-D7mCy6d2.js +3 -0
  5. package/dist/cdn/chunks/avatar-ASqePVhU.js +308 -0
  6. package/dist/cdn/chunks/avatar-group-rknt4FBO.js +338 -0
  7. package/dist/cdn/chunks/avatar-group.i18n-BYw_9wt_.js +7 -0
  8. package/dist/cdn/chunks/avatar.i18n-CMwQjBkS.js +7 -0
  9. package/dist/cdn/chunks/badge-Cc2Nufoc.js +323 -0
  10. package/dist/cdn/chunks/badge.i18n-DqW7hLQj.js +3 -0
  11. package/dist/cdn/chunks/banner-BLVKM07M.js +325 -0
  12. package/dist/cdn/chunks/banner.i18n-BOCM9rGN.js +3 -0
  13. package/dist/cdn/chunks/bar-split-view-Clbg-p9H.js +259 -0
  14. package/dist/cdn/chunks/base-CfuoYRhN.js +3 -0
  15. package/dist/cdn/chunks/blockquote-BoOqbGdm.js +189 -0
  16. package/dist/cdn/chunks/box-WkhyjQVy.js +88 -0
  17. package/dist/cdn/chunks/breadcrumbs-D9YxZzRj.js +162 -0
  18. package/dist/cdn/chunks/breadcrumbs.i18n-zmO8jaTO.js +3 -0
  19. package/dist/cdn/chunks/breakpoints-Cwor8TRP.js +15 -0
  20. package/dist/cdn/chunks/button-DO90Lo6q.js +863 -0
  21. package/dist/cdn/chunks/button-bar-Bxgdbyh3.js +225 -0
  22. package/dist/cdn/chunks/button-group-BYGPPLmZ.js +205 -0
  23. package/dist/{components/button.i18n-DiDGynnq.js → cdn/chunks/button.i18n-BGFt7Z9u.js} +2 -2
  24. package/dist/cdn/chunks/card-BP0jfOkS.js +262 -0
  25. package/dist/cdn/chunks/card.i18n-CpafLm3i.js +8 -0
  26. package/dist/cdn/chunks/carried-context-DlMSujiJ.js +37 -0
  27. package/dist/cdn/chunks/cell-BRD2ilQh.js +144 -0
  28. package/dist/cdn/chunks/checkbox-Cazx8CQn.js +296 -0
  29. package/dist/cdn/chunks/checkbox-field-DDZ-B6vH.js +157 -0
  30. package/dist/cdn/chunks/class-map-CXSdNjt8.js +26 -0
  31. package/dist/cdn/chunks/code-editor-D6Q55oaY.js +286 -0
  32. package/dist/cdn/chunks/code-viewer-DspLH2T1.js +766 -0
  33. package/dist/cdn/chunks/code-viewer.i18n-BHfSDRbK.js +13 -0
  34. package/dist/cdn/chunks/codemirror-input-Db65x22n.js +1232 -0
  35. package/dist/cdn/chunks/collection-NVtkvDls.js +396 -0
  36. package/dist/cdn/chunks/collection.i18n-DqWPGnZO.js +8 -0
  37. package/dist/cdn/chunks/combo-box-DyBQSaQl.js +512 -0
  38. package/dist/cdn/chunks/combo-box.i18n-BorzYnJ2.js +6 -0
  39. package/dist/cdn/chunks/container-rrbwk0z4.js +602 -0
  40. package/dist/cdn/chunks/custom-element-BW8Ua4c7.js +7 -0
  41. package/dist/cdn/chunks/custom-element-q6NzoL5b.js +301 -0
  42. package/dist/cdn/chunks/custom-font-size-D7KNr84p.js +57 -0
  43. package/dist/cdn/chunks/date-field-Clti_wKN.js +654 -0
  44. package/dist/cdn/chunks/date-field.i18n-BTzc0E9a.js +15 -0
  45. package/dist/cdn/chunks/date-picker-2TCQLd5D.js +993 -0
  46. package/dist/cdn/chunks/date-picker.i18n-Dsc_M5QK.js +82 -0
  47. package/dist/cdn/chunks/decorate-TduJMFD_.js +280 -0
  48. package/dist/cdn/chunks/defer-focus-F73ud2D9.js +9 -0
  49. package/dist/cdn/chunks/described-by-mixin-daRE7orX.js +32 -0
  50. package/dist/cdn/chunks/description-cell-CQwOj_rN.js +166 -0
  51. package/dist/cdn/chunks/dev-checks-zW_W-hnh.js +2695 -0
  52. package/dist/cdn/chunks/directive-CwRgozUW.js +27 -0
  53. package/dist/cdn/chunks/dismiss-from-title-bar-C6mP7sWP.js +5 -0
  54. package/dist/cdn/chunks/dist-3C80SZN9.js +849 -0
  55. package/dist/cdn/chunks/dist-A7_1pHX0.js +379 -0
  56. package/dist/cdn/chunks/dist-BEfLdOvy.js +1346 -0
  57. package/dist/cdn/chunks/dist-BTUxFM2V.js +268 -0
  58. package/dist/cdn/chunks/dist-CP3G1pSK.js +1037 -0
  59. package/dist/cdn/chunks/dist-C_dGY6zR.js +468 -0
  60. package/dist/{components/dist-B9YBOGFW.js → cdn/chunks/dist-ChmCRv39.js} +109 -153
  61. package/dist/{components/dist-CJm4tkNC.js → cdn/chunks/dist-D2qap2OY.js} +23 -31
  62. package/dist/cdn/chunks/dist-DPUBF0MZ.js +1593 -0
  63. package/dist/{components/dist-4g23YHP0.js → cdn/chunks/dist-DrTzvgE7.js} +291 -404
  64. package/dist/cdn/chunks/dist-EM4MWLQq.js +385 -0
  65. package/dist/cdn/chunks/dist-EgIBI-FG.js +293 -0
  66. package/dist/{components/dist-Bf823YyL.js → cdn/chunks/dist-Rm6FvrSR.js} +272 -551
  67. package/dist/cdn/chunks/divider-CCNbnplA.js +53 -0
  68. package/dist/cdn/chunks/document-tab-bar-CUc4WWY3.js +973 -0
  69. package/dist/cdn/chunks/document-tab-bar.i18n-DKrA9TnB.js +9 -0
  70. package/dist/cdn/chunks/drag-handle-cell-CbzDYebG.js +206 -0
  71. package/dist/cdn/chunks/drag-handle-cell.i18n-CKUrbm2q.js +3 -0
  72. package/dist/cdn/chunks/dropdown-DZTZtkm5.js +350 -0
  73. package/dist/cdn/chunks/element-state-B-44fVqq.js +20 -0
  74. package/dist/cdn/chunks/file-field-Bff6_1pp.js +1484 -0
  75. package/dist/cdn/chunks/file-field.i18n-pDM7Utud.js +40 -0
  76. package/dist/cdn/chunks/floating-ui.dom-B8J1rV2c.js +753 -0
  77. package/dist/cdn/chunks/focus-target-DSLGcCWq.js +24 -0
  78. package/dist/cdn/chunks/form-actions-C_7hINq-.js +90 -0
  79. package/dist/cdn/chunks/form-associated-mixin--GIbl98p.js +62 -0
  80. package/dist/cdn/chunks/form-field--4nWJ_DK.js +364 -0
  81. package/dist/cdn/chunks/form-hXLgy_tY.js +84 -0
  82. package/dist/cdn/chunks/form-section-By-D4un0.js +64 -0
  83. package/dist/cdn/chunks/full-bleed-section-Dg4sIJG1.js +161 -0
  84. package/dist/cdn/chunks/gherkin-eseYvsxh.js +29 -0
  85. package/dist/cdn/chunks/hero-CQQMNCT_.js +761 -0
  86. package/dist/{components/icon-CrBk3W-t.js → cdn/chunks/icon-BORlalt0.js} +298 -309
  87. package/dist/cdn/chunks/icon-button-rKiIHs7A.js +632 -0
  88. package/dist/{components/icon-button.i18n-1_N-wN6x.js → cdn/chunks/icon-button.i18n-DpZOfIS4.js} +2 -4
  89. package/dist/cdn/chunks/icon-cell-rk4NQid2.js +156 -0
  90. package/dist/cdn/chunks/identity-Cg1l0HhB.js +187 -0
  91. package/dist/cdn/chunks/if-defined-CaKKERku.js +4 -0
  92. package/dist/cdn/chunks/image-DZMW6JgL.js +659 -0
  93. package/dist/cdn/chunks/image.i18n-ONcm1h7o.js +3 -0
  94. package/dist/cdn/chunks/implicit-submission-Csbcor_E.js +27 -0
  95. package/dist/cdn/chunks/inline-dialog-WlqtPBPJ.js +259 -0
  96. package/dist/cdn/chunks/input-modality-XE0B7yCn.js +42 -0
  97. package/dist/cdn/chunks/just-in-time-education-DRcb5g7x.js +611 -0
  98. package/dist/cdn/chunks/just-in-time-education.i18n-CW_dsaxf.js +6 -0
  99. package/dist/cdn/chunks/kanban-Ca_mfqsA.js +400 -0
  100. package/dist/cdn/chunks/kanban-column-fgIMc7pw.js +375 -0
  101. package/dist/cdn/chunks/kanban.i18n-CWqc3e0B.js +11 -0
  102. package/dist/cdn/chunks/keyboard-shortcut-EknnW7Ub.js +267 -0
  103. package/dist/cdn/chunks/languages-yKikVFv_.js +8893 -0
  104. package/dist/cdn/chunks/link-FBSAJ3UC.js +229 -0
  105. package/dist/cdn/chunks/link-group-90qVfKa0.js +111 -0
  106. package/dist/cdn/chunks/link-hint-KFhgr5Ng.js +24 -0
  107. package/dist/cdn/chunks/link-rel-DvrTEfVT.js +8 -0
  108. package/dist/cdn/chunks/link.i18n-DJPobGmu.js +8 -0
  109. package/dist/cdn/chunks/list-CaWl3q0Z.js +880 -0
  110. package/dist/cdn/chunks/list-item-Cagnf6eG.js +802 -0
  111. package/dist/cdn/chunks/list-item-segment-BRzBF1y_.js +315 -0
  112. package/dist/cdn/chunks/list-item-segment.i18n-DHnrQL4V.js +8 -0
  113. package/dist/{components/list-item.i18n-89uqlBMK.js → cdn/chunks/list-item.i18n-Br6J5Ev9.js} +2 -2
  114. package/dist/cdn/chunks/list-items-Du0RCWsY.js +6 -0
  115. package/dist/{components/list.i18n-CKqbhFQ_.js → cdn/chunks/list.i18n-C40ltgdI.js} +2 -2
  116. package/dist/cdn/chunks/loading-tags-DtUr-DR7.js +3 -0
  117. package/dist/cdn/chunks/menu-BOu_pD1Q.js +719 -0
  118. package/dist/cdn/chunks/menu-bar-0NFXvq-v.js +253 -0
  119. package/dist/cdn/chunks/menu-bar-item-DGSC_ETi.js +365 -0
  120. package/dist/cdn/chunks/menu-bar.i18n-BoMu4Eoz.js +3 -0
  121. package/dist/cdn/chunks/menu-divider-CLLRgMll.js +15 -0
  122. package/dist/cdn/chunks/menu-group-BL24ChpR.js +23 -0
  123. package/dist/cdn/chunks/menu-item-CooKfrFa.js +140 -0
  124. package/dist/cdn/chunks/menu.i18n-C6uYJsG3.js +10 -0
  125. package/dist/cdn/chunks/menu.template-C6rbfI-u.js +642 -0
  126. package/dist/cdn/chunks/modal-dialog-BrUMP4Jm.js +240 -0
  127. package/dist/cdn/chunks/multi-line-text-field-D7hXhyOn.js +318 -0
  128. package/dist/cdn/chunks/navigation-split-view-B2ZQhxEb.js +621 -0
  129. package/dist/cdn/chunks/nl.generated-D6T41jG3.js +112 -0
  130. package/dist/cdn/chunks/notification-DSGP14d1.js +492 -0
  131. package/dist/cdn/chunks/notification.i18n-BKUSLN5c.js +6 -0
  132. package/dist/cdn/chunks/number-field-B8op14Y_.js +301 -0
  133. package/dist/cdn/chunks/number-field.i18n-BS0bINWY.js +7 -0
  134. package/dist/cdn/chunks/one-half-one-half-section-ZYmHYf4Q.js +213 -0
  135. package/dist/cdn/chunks/one-third-two-thirds-section-Ds10K6AS.js +213 -0
  136. package/dist/cdn/chunks/one-time-code-field-Cgy_tTS4.js +693 -0
  137. package/dist/cdn/chunks/open-when-rendered-CW_2_WUZ.js +20 -0
  138. package/dist/cdn/chunks/owned-attribute-x9OCTy_4.js +6 -0
  139. package/dist/cdn/chunks/owner-form-Cq8tT7ac.js +7 -0
  140. package/dist/cdn/chunks/page-CBf_Decp.js +431 -0
  141. package/dist/cdn/chunks/page-footer-CSv1dU7M.js +396 -0
  142. package/dist/cdn/chunks/page-footer.i18n-pbdr4lN3.js +3 -0
  143. package/dist/cdn/chunks/page-section-mixin-Dp6X8GKd.js +132 -0
  144. package/dist/cdn/chunks/pagination-CMUcFB53.js +485 -0
  145. package/dist/cdn/chunks/pagination.i18n-QQMx14CQ.js +9 -0
  146. package/dist/cdn/chunks/password-field-C76Vm3rm.js +368 -0
  147. package/dist/cdn/chunks/password-field.i18n-CzdBn-1b.js +8 -0
  148. package/dist/cdn/chunks/popover-C-CVVtfl.js +334 -0
  149. package/dist/cdn/chunks/popover-target-B25dxnmt.js +10 -0
  150. package/dist/cdn/chunks/popover.i18n-DmFBHUvB.js +3 -0
  151. package/dist/cdn/chunks/popup-anchor-controller-VZw0bXf2.js +30 -0
  152. package/dist/cdn/chunks/progress-bar-BLiHaRUS.js +674 -0
  153. package/dist/cdn/chunks/progress-bar.i18n-Cr5miGTx.js +8 -0
  154. package/dist/cdn/chunks/progress-circle-CjkovRbL.js +667 -0
  155. package/dist/cdn/chunks/progress-circle.i18n-CRrXuY4V.js +8 -0
  156. package/dist/cdn/chunks/query-ChDzi9FQ.js +28 -0
  157. package/dist/cdn/chunks/radio-button-GHyO-GQB.js +338 -0
  158. package/dist/cdn/chunks/radio-button-field-C-Z6Lnd4.js +192 -0
  159. package/dist/cdn/chunks/radio-button-group-ChTqBCnQ.js +118 -0
  160. package/dist/cdn/chunks/radio-position-CXWYAjaz.js +10 -0
  161. package/dist/cdn/chunks/reflect-non-default-Bu3rpCvg.js +9 -0
  162. package/dist/cdn/chunks/render-marked-DX_5ISZE.js +37 -0
  163. package/dist/cdn/chunks/repeat-Ch_5OsXE.js +76 -0
  164. package/dist/cdn/chunks/return-focus-Xmagtk6r.js +52 -0
  165. package/dist/cdn/chunks/rich-text-CQ2uwMSp.js +47 -0
  166. package/dist/cdn/chunks/rich-text.i18n-BlJ68YuU.js +3 -0
  167. package/dist/cdn/chunks/row-header-mixin-CgqvREoV.js +16 -0
  168. package/dist/cdn/chunks/sanitize-url-CBuGmY0W.js +7 -0
  169. package/dist/cdn/chunks/scroll-mode-controller-COUD1-3P.js +42 -0
  170. package/dist/cdn/chunks/search-field-BGNfERhn.js +396 -0
  171. package/dist/cdn/chunks/search-field.i18n-B_Oc7hc-.js +6 -0
  172. package/dist/cdn/chunks/segmented-control-BYAG4VRp.js +671 -0
  173. package/dist/cdn/chunks/shadow-resets-6SToDsPu.js +12 -0
  174. package/dist/cdn/chunks/sheet-BdVCqm2H.js +340 -0
  175. package/dist/cdn/chunks/shell-C9rds_D9.js +146 -0
  176. package/dist/cdn/chunks/shell-DmJOYhyF.js +108 -0
  177. package/dist/cdn/chunks/side-by-side-split-view-C5oX4c6Z.js +166 -0
  178. package/dist/cdn/chunks/sidebar-section-DP4jnS7g.js +353 -0
  179. package/dist/cdn/chunks/sidebar-section.i18n-BuGfRMpD.js +6 -0
  180. package/dist/cdn/chunks/simple-section-qrCqXeBa.js +192 -0
  181. package/dist/cdn/chunks/skip-link-DWh4W6-J.js +161 -0
  182. package/dist/cdn/chunks/skip-link.i18n--PbEdAmJ.js +3 -0
  183. package/dist/cdn/chunks/slider--hODfOwh.js +772 -0
  184. package/dist/cdn/chunks/slider.i18n-DVw0c8AG.js +6 -0
  185. package/dist/cdn/chunks/slot-content-BLuPqVXw.js +13 -0
  186. package/dist/cdn/chunks/spacer-CFzq_JCh.js +237 -0
  187. package/dist/cdn/chunks/spacer-cell-DuVOgIj8.js +68 -0
  188. package/dist/cdn/chunks/spacing-scale-SufIjHeN.js +28 -0
  189. package/dist/cdn/chunks/split-button-BeXnOUTt.js +268 -0
  190. package/dist/cdn/chunks/split-button.i18n-DtClSMga.js +3 -0
  191. package/dist/cdn/chunks/split-view-divider-jzcPmnMh.js +100 -0
  192. package/dist/cdn/chunks/split-view-pane-BLsZz263.js +128 -0
  193. package/dist/cdn/chunks/stacked-split-view-CcOR8LrJ.js +157 -0
  194. package/dist/cdn/chunks/static-html-Cf4ccUIg.js +26 -0
  195. package/dist/cdn/chunks/status-bar-CINbOihq.js +284 -0
  196. package/dist/cdn/chunks/status-bar-change-CR9l0Gyk.js +3 -0
  197. package/dist/cdn/chunks/step-bar-6FvZL1Ti.js +474 -0
  198. package/dist/cdn/chunks/step-bar.i18n-DocExlD7.js +9 -0
  199. package/dist/cdn/chunks/step-cell-CejRisgS.js +287 -0
  200. package/dist/cdn/chunks/stepper-CY2rJWOJ.js +223 -0
  201. package/dist/cdn/chunks/stepper.i18n-COOAkaBl.js +7 -0
  202. package/dist/cdn/chunks/style-map-DsIw6lkq.js +29 -0
  203. package/dist/cdn/chunks/style-mod-DGMhzWuk.js +1583 -0
  204. package/dist/cdn/chunks/swatch-picker-BY3DBIl6.js +430 -0
  205. package/dist/cdn/chunks/swatch-picker.i18n-_G0nmnGe.js +22 -0
  206. package/dist/cdn/chunks/switch-DDSsZFwK.js +275 -0
  207. package/dist/cdn/chunks/switch-field-CMoM9I38.js +137 -0
  208. package/dist/cdn/chunks/tab-bar-DmslEoPD.js +697 -0
  209. package/dist/cdn/chunks/tab-bar.i18n-Crsc7ShA.js +3 -0
  210. package/dist/cdn/chunks/table-DwXjCSD5.js +308 -0
  211. package/dist/cdn/chunks/table.i18n-Bmb_uw_w.js +3 -0
  212. package/dist/cdn/chunks/tag-DM3APy3B.js +306 -0
  213. package/dist/cdn/chunks/text-B1CatNR1.js +421 -0
  214. package/dist/cdn/chunks/text-cell-BkEsGI3g.js +299 -0
  215. package/dist/cdn/chunks/text-editor-BvTiMeNV.js +3743 -0
  216. package/dist/cdn/chunks/text-editor.i18n-sJKiRQ4i.js +17 -0
  217. package/dist/cdn/chunks/text-field-CUyh1-V8.js +398 -0
  218. package/dist/cdn/chunks/time-field-Cj5WojfO.js +597 -0
  219. package/dist/cdn/chunks/time-field.i18n-CLH5vmS7.js +11 -0
  220. package/dist/cdn/chunks/time-picker-W0xYXLy8.js +508 -0
  221. package/dist/cdn/chunks/time-picker.i18n-BilOCXlS.js +7 -0
  222. package/dist/cdn/chunks/title-BuT7tWqN.js +437 -0
  223. package/dist/cdn/chunks/title-bar-label-controller-DSxdKZOg.js +24 -0
  224. package/dist/cdn/chunks/title-cell-8d8psUBX.js +327 -0
  225. package/dist/cdn/chunks/toggle-button-DNXWXZpE.js +528 -0
  226. package/dist/cdn/chunks/toggle-button-group-ByowJYgs.js +156 -0
  227. package/dist/cdn/chunks/token-CnkEB3hB.js +266 -0
  228. package/dist/cdn/chunks/token-field-hvDB3l6O.js +664 -0
  229. package/dist/cdn/chunks/token-field.i18n-BclzoR8F.js +9 -0
  230. package/dist/cdn/chunks/token.i18n-RGD5zAtl.js +7 -0
  231. package/dist/cdn/chunks/toml-w97zZfFO.js +27 -0
  232. package/dist/cdn/chunks/toolbar-iNd1VmuG.js +408 -0
  233. package/dist/cdn/chunks/toolbar-item-DpPfPxCi.js +50 -0
  234. package/dist/cdn/chunks/toolbar-title-KBMpfL9d.js +84 -0
  235. package/dist/cdn/chunks/toolbar.i18n-QwS37CBC.js +8 -0
  236. package/dist/cdn/chunks/toolbar.styles-BQkG4gVc.js +383 -0
  237. package/dist/cdn/chunks/tooltip-BsAHJjci.js +325 -0
  238. package/dist/cdn/chunks/top-navigation-bar-D1hjWIF3.js +925 -0
  239. package/dist/cdn/chunks/top-navigation-bar.i18n-C-lcH1nB.js +10 -0
  240. package/dist/cdn/chunks/top-title-bar-iNFB2zQL.js +344 -0
  241. package/dist/cdn/chunks/translations-wxBSz213.js +8 -0
  242. package/dist/cdn/chunks/two-thirds-one-third-section-D-UANbHC.js +213 -0
  243. package/dist/cdn/chunks/validation-list-C5BhHZIG.js +202 -0
  244. package/dist/cdn/chunks/validation-list.i18n-CM6In8zD.js +12 -0
  245. package/dist/cdn/chunks/visibility-mixin-COAZ9pON.js +74 -0
  246. package/dist/cdn/chunks/visually-hidden-BPgATaH0.js +43 -0
  247. package/dist/cdn/chunks/window-t5iFkMLY.js +227 -0
  248. package/dist/cdn/chunks/window.i18n-CsEnUPAk.js +3 -0
  249. package/dist/cdn/chunks/with-translations-XX14GKFh.js +16 -0
  250. package/dist/components/actions/button/button.d.ts +5 -5
  251. package/dist/components/actions/button/button.d.ts.map +1 -1
  252. package/dist/components/actions/button/button.js +6 -6
  253. package/dist/components/actions/button/button.js.map +1 -1
  254. package/dist/components/actions/button/button.template.d.ts.map +1 -1
  255. package/dist/components/actions/button/button.template.js +6 -8
  256. package/dist/components/actions/button/button.template.js.map +1 -1
  257. package/dist/components/actions/button-bar/button-bar.d.ts.map +1 -1
  258. package/dist/components/actions/button-bar/button-bar.js +15 -4
  259. package/dist/components/actions/button-bar/button-bar.js.map +1 -1
  260. package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
  261. package/dist/components/actions/button-group/button-group.js +7 -1
  262. package/dist/components/actions/button-group/button-group.js.map +1 -1
  263. package/dist/components/actions/button-group/button-group.styles.js +2 -2
  264. package/dist/components/actions/icon-button/icon-button.d.ts +3 -3
  265. package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
  266. package/dist/components/actions/icon-button/icon-button.js +4 -4
  267. package/dist/components/actions/icon-button/icon-button.js.map +1 -1
  268. package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
  269. package/dist/components/actions/icon-button/icon-button.template.js +2 -4
  270. package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
  271. package/dist/components/actions/menu/menu-item.d.ts +12 -3
  272. package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
  273. package/dist/components/actions/menu/menu-item.js +27 -6
  274. package/dist/components/actions/menu/menu-item.js.map +1 -1
  275. package/dist/components/actions/menu/menu.d.ts +31 -8
  276. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  277. package/dist/components/actions/menu/menu.js +108 -32
  278. package/dist/components/actions/menu/menu.js.map +1 -1
  279. package/dist/components/actions/menu/menu.pointer.d.ts +7 -0
  280. package/dist/components/actions/menu/menu.pointer.d.ts.map +1 -1
  281. package/dist/components/actions/menu/menu.pointer.js +17 -0
  282. package/dist/components/actions/menu/menu.pointer.js.map +1 -1
  283. package/dist/components/actions/menu/menu.safe-triangle.d.ts +6 -5
  284. package/dist/components/actions/menu/menu.safe-triangle.d.ts.map +1 -1
  285. package/dist/components/actions/menu/menu.safe-triangle.js +3 -3
  286. package/dist/components/actions/menu/menu.safe-triangle.js.map +1 -1
  287. package/dist/components/actions/menu/menu.styles.d.ts.map +1 -1
  288. package/dist/components/actions/menu/menu.styles.js +6 -0
  289. package/dist/components/actions/menu/menu.styles.js.map +1 -1
  290. package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
  291. package/dist/components/actions/menu/menu.template.js +17 -9
  292. package/dist/components/actions/menu/menu.template.js.map +1 -1
  293. package/dist/components/actions/toolbar/toolbar-title.js +2 -2
  294. package/dist/components/actions/toolbar/toolbar-title.js.map +1 -1
  295. package/dist/components/content/avatar/avatar.js +1 -1
  296. package/dist/components/content/avatar/avatar.js.map +1 -1
  297. package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
  298. package/dist/components/content/avatar-group/avatar-group.js +2 -1
  299. package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
  300. package/dist/components/content/image/image.js +1 -1
  301. package/dist/components/content/image/image.js.map +1 -1
  302. package/dist/components/content/tag/tag.d.ts +3 -3
  303. package/dist/components/content/tag/tag.js +3 -3
  304. package/dist/components/content/tag/tag.template.js +3 -3
  305. package/dist/components/content/tag/tag.template.js.map +1 -1
  306. package/dist/components/content/title/title.js +1 -1
  307. package/dist/components/content/title/title.js.map +1 -1
  308. package/dist/components/content/token/token.d.ts +6 -4
  309. package/dist/components/content/token/token.d.ts.map +1 -1
  310. package/dist/components/content/token/token.js +6 -4
  311. package/dist/components/content/token/token.js.map +1 -1
  312. package/dist/components/content/token/token.template.js +1 -1
  313. package/dist/components/content/token/token.template.js.map +1 -1
  314. package/dist/components/inputs/dropdown/dropdown.d.ts +22 -2
  315. package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
  316. package/dist/components/inputs/dropdown/dropdown.js +67 -11
  317. package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
  318. package/dist/components/inputs/file-field/file-field.js +1 -1
  319. package/dist/components/inputs/file-field/file-field.js.map +1 -1
  320. package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.d.ts.map +1 -1
  321. package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.js +4 -2
  322. package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.js.map +1 -1
  323. package/dist/components/inputs/one-time-code-field/one-time-code-field.template.js +2 -2
  324. package/dist/components/inputs/one-time-code-field/one-time-code-field.template.js.map +1 -1
  325. package/dist/components/inputs/segmented-control/segmented-control.d.ts +2 -2
  326. package/dist/components/inputs/segmented-control/segmented-control.js +4 -4
  327. package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
  328. package/dist/components/inputs/segmented-control/segmented-control.template.js +2 -2
  329. package/dist/components/inputs/segmented-control/segmented-control.template.js.map +1 -1
  330. package/dist/components/inputs/swatch-picker/swatch-picker.js +1 -1
  331. package/dist/components/inputs/swatch-picker/swatch-picker.js.map +1 -1
  332. package/dist/components/inputs/time-picker/time-picker.js +1 -1
  333. package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
  334. package/dist/components/inputs/toggle-button/toggle-button.d.ts +2 -2
  335. package/dist/components/inputs/toggle-button/toggle-button.js +3 -3
  336. package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
  337. package/dist/components/inputs/toggle-button/toggle-button.template.d.ts.map +1 -1
  338. package/dist/components/inputs/toggle-button/toggle-button.template.js +7 -10
  339. package/dist/components/inputs/toggle-button/toggle-button.template.js.map +1 -1
  340. package/dist/components/inputs/toggle-button-group/toggle-button-group.js +1 -1
  341. package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
  342. package/dist/components/inputs/toggle-button-group/toggle-button-group.styles.js +3 -3
  343. package/dist/components/layout/card/card.js +1 -1
  344. package/dist/components/layout/card/card.js.map +1 -1
  345. package/dist/components/layout/card/card.styles.d.ts.map +1 -1
  346. package/dist/components/layout/card/card.styles.js +3 -1
  347. package/dist/components/layout/card/card.styles.js.map +1 -1
  348. package/dist/components/layout/container/container.d.ts +15 -2
  349. package/dist/components/layout/container/container.d.ts.map +1 -1
  350. package/dist/components/layout/container/container.js +38 -3
  351. package/dist/components/layout/container/container.js.map +1 -1
  352. package/dist/components/layout/container/container.styles.js +1 -1
  353. package/dist/components/layout/container/container.template.js +1 -1
  354. package/dist/components/layout/container/container.template.js.map +1 -1
  355. package/dist/components/layout/kanban/kanban.d.ts.map +1 -1
  356. package/dist/components/layout/kanban/kanban.js +2 -1
  357. package/dist/components/layout/kanban/kanban.js.map +1 -1
  358. package/dist/components/layout/page/page.d.ts.map +1 -1
  359. package/dist/components/layout/page/page.js +3 -2
  360. package/dist/components/layout/page/page.js.map +1 -1
  361. package/dist/components/layout/page/page.styles.d.ts.map +1 -1
  362. package/dist/components/layout/page/page.styles.js +3 -2
  363. package/dist/components/layout/page/page.styles.js.map +1 -1
  364. package/dist/components/layout/page-footer/page-footer.d.ts +5 -2
  365. package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
  366. package/dist/components/layout/page-footer/page-footer.js +5 -2
  367. package/dist/components/layout/page-footer/page-footer.js.map +1 -1
  368. package/dist/components/layout/page-footer/page-footer.template.d.ts.map +1 -1
  369. package/dist/components/layout/page-footer/page-footer.template.js +2 -4
  370. package/dist/components/layout/page-footer/page-footer.template.js.map +1 -1
  371. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +1 -1
  372. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
  373. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +2 -2
  374. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
  375. package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
  376. package/dist/components/layout/page-sections/hero/hero.js +2 -2
  377. package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
  378. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +1 -1
  379. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
  380. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +2 -2
  381. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
  382. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +1 -1
  383. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
  384. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +2 -2
  385. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
  386. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +1 -1
  387. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
  388. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +4 -4
  389. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
  390. package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +1 -1
  391. package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
  392. package/dist/components/layout/page-sections/simple-section/simple-section.js +2 -2
  393. package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
  394. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +1 -1
  395. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
  396. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +2 -2
  397. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
  398. package/dist/components/layout/popover/popover.d.ts +1 -2
  399. package/dist/components/layout/popover/popover.d.ts.map +1 -1
  400. package/dist/components/layout/popover/popover.js +10 -12
  401. package/dist/components/layout/popover/popover.js.map +1 -1
  402. package/dist/components/layout/sheet/sheet.d.ts +1 -0
  403. package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
  404. package/dist/components/layout/sheet/sheet.js +6 -1
  405. package/dist/components/layout/sheet/sheet.js.map +1 -1
  406. package/dist/components/layout/spacer/spacer.js +1 -1
  407. package/dist/components/layout/spacer/spacer.js.map +1 -1
  408. package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
  409. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +2 -1
  410. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
  411. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts.map +1 -1
  412. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +3 -2
  413. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js.map +1 -1
  414. package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts.map +1 -1
  415. package/dist/components/layout/split-views/split-view-pane/split-view-pane.js +2 -1
  416. package/dist/components/layout/split-views/split-view-pane/split-view-pane.js.map +1 -1
  417. package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts.map +1 -1
  418. package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js +3 -2
  419. package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js.map +1 -1
  420. package/dist/components/layout/window/window.d.ts +1 -0
  421. package/dist/components/layout/window/window.d.ts.map +1 -1
  422. package/dist/components/layout/window/window.js +7 -1
  423. package/dist/components/layout/window/window.js.map +1 -1
  424. package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts +5 -2
  425. package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts.map +1 -1
  426. package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js +7 -4
  427. package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js.map +1 -1
  428. package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.template.js +3 -3
  429. package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.template.js.map +1 -1
  430. package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.d.ts.map +1 -1
  431. package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.js +2 -1
  432. package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.js.map +1 -1
  433. package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +2 -2
  434. package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +2 -2
  435. package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +2 -2
  436. package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +2 -2
  437. package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
  438. package/dist/components/lists-and-tables/list/list.js +4 -1
  439. package/dist/components/lists-and-tables/list/list.js.map +1 -1
  440. package/dist/components/lists-and-tables/list-item/list-item.d.ts +19 -9
  441. package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
  442. package/dist/components/lists-and-tables/list-item/list-item.js +30 -14
  443. package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
  444. package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
  445. package/dist/components/lists-and-tables/list-item/list-item.styles.js +20 -0
  446. package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
  447. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +11 -1
  448. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
  449. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +19 -3
  450. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
  451. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.d.ts.map +1 -1
  452. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js +6 -0
  453. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js.map +1 -1
  454. package/dist/components/lists-and-tables/table/table.js +5 -5
  455. package/dist/components/lists-and-tables/table/table.js.map +1 -1
  456. package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +5 -2
  457. package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
  458. package/dist/components/navigation/breadcrumbs/breadcrumbs.js +5 -2
  459. package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  460. package/dist/components/navigation/breadcrumbs/breadcrumbs.template.d.ts.map +1 -1
  461. package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js +2 -4
  462. package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js.map +1 -1
  463. package/dist/components/navigation/link/link.d.ts +7 -4
  464. package/dist/components/navigation/link/link.d.ts.map +1 -1
  465. package/dist/components/navigation/link/link.js +7 -4
  466. package/dist/components/navigation/link/link.js.map +1 -1
  467. package/dist/components/navigation/link/link.template.js +5 -5
  468. package/dist/components/navigation/link/link.template.js.map +1 -1
  469. package/dist/components/navigation/menu-bar-item/menu-bar-item.js +1 -1
  470. package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
  471. package/dist/components/navigation/pagination/pagination.d.ts.map +1 -1
  472. package/dist/components/navigation/pagination/pagination.js +3 -2
  473. package/dist/components/navigation/pagination/pagination.js.map +1 -1
  474. package/dist/components/navigation/tab-bar/tab-bar.d.ts +18 -2
  475. package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
  476. package/dist/components/navigation/tab-bar/tab-bar.js +51 -3
  477. package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
  478. package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
  479. package/dist/components/navigation/tab-bar/tab-bar.template.js +5 -3
  480. package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
  481. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +2 -2
  482. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
  483. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.menu-sheet.d.ts +4 -0
  484. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.menu-sheet.d.ts.map +1 -1
  485. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.menu-sheet.js +26 -2
  486. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.menu-sheet.js.map +1 -1
  487. package/dist/components/status-and-feedback/banner/banner.js +1 -1
  488. package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
  489. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +2 -2
  490. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js.map +1 -1
  491. package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +1 -1
  492. package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js.map +1 -1
  493. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +1 -1
  494. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
  495. package/dist/components/status-and-feedback/notification/notification.js +2 -2
  496. package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
  497. package/dist/components/status-and-feedback/progress-bar/progress-bar.js +4 -4
  498. package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
  499. package/dist/components/status-and-feedback/progress-circle/progress-circle.js +4 -4
  500. package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
  501. package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +5 -2
  502. package/dist/components/status-and-feedback/step-bar/step-bar.d.ts.map +1 -1
  503. package/dist/components/status-and-feedback/step-bar/step-bar.js +6 -3
  504. package/dist/components/status-and-feedback/step-bar/step-bar.js.map +1 -1
  505. package/dist/components/status-and-feedback/step-bar/step-bar.template.js +1 -1
  506. package/dist/components/status-and-feedback/step-bar/step-bar.template.js.map +1 -1
  507. package/dist/css/variables.css +6 -0
  508. package/dist/nldd.min.js +784 -728
  509. package/dist/types/react.d.ts +3323 -0
  510. package/dist/types/vue.d.ts +26 -14
  511. package/dist/utilities/autoloader.d.ts +33 -0
  512. package/dist/utilities/autoloader.d.ts.map +1 -0
  513. package/dist/utilities/autoloader.generated.d.ts +3 -0
  514. package/dist/utilities/autoloader.generated.d.ts.map +1 -0
  515. package/dist/utilities/autoloader.generated.js +141 -0
  516. package/dist/utilities/autoloader.generated.js.map +1 -0
  517. package/dist/utilities/autoloader.js +94 -0
  518. package/dist/utilities/autoloader.js.map +1 -0
  519. package/dist/utilities/dev-checks.d.ts +9 -0
  520. package/dist/utilities/dev-checks.d.ts.map +1 -1
  521. package/dist/utilities/dev-checks.js +45 -3
  522. package/dist/utilities/dev-checks.js.map +1 -1
  523. package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
  524. package/dist/utilities/dev-rules.generated.js +17 -2
  525. package/dist/utilities/dev-rules.generated.js.map +1 -1
  526. package/dist/utilities/input-modality.d.ts.map +1 -1
  527. package/dist/utilities/input-modality.js +4 -2
  528. package/dist/utilities/input-modality.js.map +1 -1
  529. package/dist/utilities/loading-tags.d.ts +7 -0
  530. package/dist/utilities/loading-tags.d.ts.map +1 -0
  531. package/dist/utilities/loading-tags.js +7 -0
  532. package/dist/utilities/loading-tags.js.map +1 -0
  533. package/dist/utilities/owner-form.d.ts +3 -3
  534. package/dist/utilities/owner-form.d.ts.map +1 -1
  535. package/dist/utilities/owner-form.js +6 -3
  536. package/dist/utilities/owner-form.js.map +1 -1
  537. package/dist/utilities/page-section-mixin.d.ts +10 -4
  538. package/dist/utilities/page-section-mixin.d.ts.map +1 -1
  539. package/dist/utilities/page-section-mixin.js +29 -23
  540. package/dist/utilities/page-section-mixin.js.map +1 -1
  541. package/dist/utilities/return-focus.d.ts +44 -0
  542. package/dist/utilities/return-focus.d.ts.map +1 -0
  543. package/dist/utilities/return-focus.js +99 -0
  544. package/dist/utilities/return-focus.js.map +1 -0
  545. package/dist/utilities/slot-content.d.ts +30 -0
  546. package/dist/utilities/slot-content.d.ts.map +1 -0
  547. package/dist/utilities/slot-content.js +38 -0
  548. package/dist/utilities/slot-content.js.map +1 -0
  549. package/lint/data.generated.json +1 -1
  550. package/package.json +50 -11
  551. package/dist/components/breakpoints-DtL62nLI.js +0 -45
  552. package/dist/components/components.js +0 -67895
  553. package/dist/components/decorate-C7khEuc7.js +0 -16
  554. package/dist/components/defer-focus-BQ3c4mzj.js +0 -176
  555. package/dist/components/dev-checks-lQ-gHUjV.js +0 -2706
  556. package/dist/components/dist-245LaK9m.js +0 -1479
  557. package/dist/components/dist-BFZM0YsR.js +0 -15772
  558. package/dist/components/dist-BNkeFjc3.js +0 -1180
  559. package/dist/components/dist-CSC1dG3L.js +0 -365
  560. package/dist/components/dist-CeMOOqgP.js +0 -1509
  561. package/dist/components/dist-DFjwTlJV.js +0 -624
  562. package/dist/components/dist-DHhnz3Gv.js +0 -381
  563. package/dist/components/dist-PeUX4vPq.js +0 -2857
  564. package/dist/components/dist-m70B83qb.js +0 -463
  565. package/dist/components/element-state-BnarBv0M.js +0 -42
  566. package/dist/components/gherkin-DzYbEwDO.js +0 -107
  567. package/dist/components/icon-button-CfpnGzYQ.js +0 -2308
  568. package/dist/components/input-modality-CiPLYYMN.js +0 -42
  569. package/dist/components/just-in-time-education.i18n-BqU1ImP4.js +0 -423
  570. package/dist/components/nl.generated-DzZkOgnP.js +0 -64
  571. package/dist/components/reflect-non-default-B9wQcnne.js +0 -36
  572. package/dist/components/rolldown-runtime-D8jQpDG7.js +0 -12
  573. package/dist/components/shadow-resets-BwOyyZFH.js +0 -60
  574. package/dist/components/shell-Dh5IwHd-.js +0 -222
  575. package/dist/components/toml-D0Pix_8Q.js +0 -58
  576. package/dist/components/visibility-mixin-BMtETgjk.js +0 -153
@@ -1,2308 +0,0 @@
1
- import { n as customElement, t as __decorate } from "./decorate-C7khEuc7.js";
2
- import { t as inheritedTextReset } from "./shadow-resets-BwOyyZFH.js";
3
- import { a as downloadLinkHintKey, c as linkRel, i as translate, n as withTranslations, s as markDownloadTarget, t as deferFocus } from "./defer-focus-BQ3c4mzj.js";
4
- import { n as internalsOf } from "./element-state-BnarBv0M.js";
5
- import { t as reflectNonDefault } from "./reflect-non-default-B9wQcnne.js";
6
- import "./icon-CrBk3W-t.js";
7
- import { n as nlddActivityIndicatorTranslations, t as nlddIconButtonTranslations } from "./icon-button.i18n-1_N-wN6x.js";
8
- import { r as isTouchMode } from "./input-modality-CiPLYYMN.js";
9
- import { LitElement, css, html, nothing } from "lit";
10
- import { property, state } from "lit/decorators.js";
11
- import { classMap } from "lit/directives/class-map.js";
12
- import { computePosition, flip, offset, shift } from "@floating-ui/dom";
13
- // src/utilities/os.ts
14
- var cached = null;
15
- var override = null;
16
- function classify(platform) {
17
- const p = platform.toLowerCase();
18
- if (/mac|iphone|ipad|ipod|ios/.test(p)) return "mac";
19
- if (/win/.test(p)) return "windows";
20
- if (/android/.test(p)) return "other";
21
- if (/linux|cros/.test(p)) return "linux";
22
- return "other";
23
- }
24
- function detectOS() {
25
- if (override !== null) return override;
26
- if (cached !== null) return cached;
27
- if (typeof navigator === "undefined") {
28
- cached = "other";
29
- return cached;
30
- }
31
- const nav = navigator;
32
- cached = classify(nav.userAgentData?.platform || nav.platform || "");
33
- return cached;
34
- }
35
- // src/utilities/shortcut.ts
36
- function hasShortcut(hint) {
37
- return Boolean(hint.shortcut || hint.shortcutMac || hint.shortcutWindows || hint.shortcutLinux);
38
- }
39
- /** The key spec for this OS, with `keys` as the fallback. */
40
- function resolveKeys(spec, os) {
41
- if (os === "mac" && spec.macKeys) return spec.macKeys;
42
- if (os === "windows" && spec.windowsKeys) return spec.windowsKeys;
43
- if (os === "linux" && spec.linuxKeys) return spec.linuxKeys;
44
- return spec.keys;
45
- }
46
- /** Splits 'Ctrl+Shift+P' into keys; a trailing '++' ('Ctrl++') or '+++' is a literal '+' key. */
47
- function parseKeys(spec) {
48
- if (!spec) return [];
49
- const compact = spec.trim().replace(/\s*\+\s*/g, "+");
50
- if (compact === "+") return ["+"];
51
- const MARKER = "\0";
52
- return compact.replace(/\+\+\+/g, `+${MARKER}+`).replace(/\+\+$/, `+${MARKER}`).split("+").map((k) => k.trim().split(MARKER).join("+")).filter(Boolean);
53
- }
54
- var NO_SHORTCUTS_QUERY = "(any-hover: none)";
55
- /** Whether a keyboard shortcut can be used on this device, so a hint for it is worth showing. */
56
- function shortcutsAvailable() {
57
- return typeof matchMedia !== "function" || !matchMedia(NO_SHORTCUTS_QUERY).matches;
58
- }
59
- /**
60
- * Renders the host again when shortcuts become available or unavailable, such
61
- * as when a pointer is attached or removed, so a shortcut in its accessible
62
- * name follows the visible hint. Pass `onChange` for work that a render does
63
- * not redo.
64
- */
65
- var ShortcutAvailabilityController = class {
66
- constructor(host, onChange) {
67
- this._query = typeof matchMedia === "function" ? matchMedia(NO_SHORTCUTS_QUERY) : null;
68
- this._handleChange = () => this._onChange();
69
- this._onChange = onChange ?? (() => host.requestUpdate());
70
- host.addController(this);
71
- }
72
- hostConnected() {
73
- this._query?.addEventListener("change", this._handleChange);
74
- }
75
- hostDisconnected() {
76
- this._query?.removeEventListener("change", this._handleChange);
77
- }
78
- };
79
- /**
80
- * The shortcut as words for an accessible name ("Ctrl Z"), matching how
81
- * nldd-menu-item is announced. Empty without a shortcut, and where
82
- * shortcutsAvailable() says the key cannot be pressed, as the hint is hidden
83
- * there too. Read when the component renders; ShortcutAvailabilityController
84
- * renders it again when that changes.
85
- */
86
- function shortcutLabel(hint) {
87
- if (!hasShortcut(hint) || !shortcutsAvailable()) return "";
88
- return parseKeys(resolveKeys({
89
- keys: hint.shortcut,
90
- macKeys: hint.shortcutMac,
91
- windowsKeys: hint.shortcutWindows,
92
- linuxKeys: hint.shortcutLinux
93
- }, detectOS())).join(" ");
94
- }
95
- // src/components/content/keyboard-shortcut/keyboard-shortcut.styles.ts
96
- var keyboardShortcutStyles = css`
97
- :host {
98
- box-sizing: border-box;
99
- }
100
-
101
-
102
- /* # Host */
103
-
104
- :host {
105
- --_keyboard-shortcut-size: var(--primitives-space-24);
106
- --_keyboard-shortcut-inline-padding: var(--primitives-space-4);
107
- --_keyboard-shortcut-font-family: var(--primitives-font-family-monospace);
108
- --_keyboard-shortcut-font-size: var(--primitives-font-size-80);
109
- --_keyboard-shortcut-font-weight: var(--primitives-font-weight-body-regular);
110
- --_keyboard-shortcut-line-height: var(--primitives-line-height-flat);
111
- --_keyboard-shortcut-content-color: var(--semantics-content-color);
112
- --_keyboard-shortcut-separator-color: var(--semantics-content-secondary-color);
113
- --_keyboard-shortcut-highlight-border-color: light-dark(var(--primitives-color-neutral-150), var(--primitives-color-neutral-250));
114
- --_keyboard-shortcut-background-color: var(--semantics-surfaces-tinted-background-color);
115
- --_keyboard-shortcut-border-width: var(--primitives-border-width-thin);
116
- --_keyboard-shortcut-corner-radius: var(--primitives-corner-radius-xs);
117
-
118
- ${inheritedTextReset}
119
- display: inline-flex;
120
- vertical-align: middle;
121
- }
122
-
123
- :host([color="inherit"]) {
124
- --_keyboard-shortcut-content-color: currentColor;
125
- --_keyboard-shortcut-separator-color: currentColor;
126
- --_keyboard-shortcut-highlight-border-color: color-mix(in oklab, var(--semantics-content-contrast-color) 10%, transparent);
127
- --_keyboard-shortcut-background-color: color-mix(in oklab, var(--semantics-content-contrast-color) 20%, transparent);
128
- }
129
-
130
- :host([size="sm"]) {
131
- --_keyboard-shortcut-size: var(--primitives-space-20);
132
- --_keyboard-shortcut-font-size: var(--primitives-font-size-70);
133
- }
134
-
135
- :host([size="inherit"]) {
136
- --_keyboard-shortcut-size: 1.5em;
137
- --_keyboard-shortcut-inline-padding: 0.35em;
138
- --_keyboard-shortcut-font-size: 0.75em;
139
- }
140
-
141
- :host([appearance="simple"]) {
142
- --_keyboard-shortcut-font-family: var(--primitives-font-family-body);
143
- --_keyboard-shortcut-font-size: var(--primitives-font-size-100);
144
-
145
- vertical-align: baseline;
146
- }
147
-
148
- :host([appearance="simple"][size="sm"]) {
149
- --_keyboard-shortcut-font-size: var(--primitives-font-size-90);
150
- }
151
-
152
- :host([appearance="simple"][size="inherit"]) {
153
- --_keyboard-shortcut-font-size: inherit;
154
- }
155
-
156
- :host([hidden]) {
157
- display: none;
158
- }
159
-
160
- /* Same query as shortcutsAvailable() in utilities/shortcut.ts. */
161
- @media (any-hover: none) {
162
- :host(:not([always-visible])) {
163
- display: none;
164
- }
165
- }
166
-
167
-
168
- /* # Block */
169
-
170
- .keyboard-shortcut {
171
- display: inline-flex;
172
- gap: var(--primitives-space-2);
173
- align-items: center;
174
- }
175
-
176
- :host([size="inherit"]) .keyboard-shortcut {
177
- position: relative;
178
- top: -0.05em;
179
- }
180
-
181
- :host([size="inherit"][appearance="simple"]) .keyboard-shortcut {
182
- position: static;
183
- }
184
-
185
-
186
- /* # Elements */
187
-
188
- .keyboard-shortcut__key {
189
- box-sizing: border-box;
190
- display: inline-flex;
191
- box-shadow: inset 0 0 0 var(--_keyboard-shortcut-border-width) var(--_keyboard-shortcut-highlight-border-color);
192
- border-radius: var(--_keyboard-shortcut-corner-radius);
193
- background-color: var(--_keyboard-shortcut-background-color);
194
- min-width: var(--_keyboard-shortcut-size);
195
- height: var(--_keyboard-shortcut-size);
196
- padding: 0 var(--_keyboard-shortcut-inline-padding);
197
- align-items: center;
198
- justify-content: center;
199
- color: var(--_keyboard-shortcut-content-color);
200
- font-family: var(--_keyboard-shortcut-font-family);
201
- font-size: var(--_keyboard-shortcut-font-size);
202
- font-weight: var(--_keyboard-shortcut-font-weight);
203
- line-height: var(--_keyboard-shortcut-line-height);
204
- white-space: nowrap;
205
- }
206
-
207
- :host([appearance="simple"]) .keyboard-shortcut {
208
- gap: 0;
209
- }
210
-
211
- :host([appearance="simple"]) .keyboard-shortcut__key {
212
- box-shadow: none;
213
- background-color: transparent;
214
- border-radius: 0;
215
- min-width: 0;
216
- height: auto;
217
- padding: 0;
218
- }
219
-
220
- @media (forced-colors: active) {
221
- .keyboard-shortcut__key {
222
- color: CanvasText;
223
- }
224
-
225
- :host(:not([appearance="simple"])) .keyboard-shortcut__key {
226
- border: var(--_keyboard-shortcut-border-width) solid CanvasText;
227
- background-color: Canvas;
228
- }
229
- }
230
-
231
- .keyboard-shortcut__separator {
232
- color: var(--_keyboard-shortcut-separator-color);
233
- font-family: var(--_keyboard-shortcut-font-family);
234
- font-size: var(--_keyboard-shortcut-font-size);
235
- font-weight: var(--_keyboard-shortcut-font-weight);
236
- line-height: var(--_keyboard-shortcut-line-height);
237
- }
238
- `;
239
- // src/components/content/keyboard-shortcut/keyboard-shortcut.template.ts
240
- function template$1(component) {
241
- const keys = component._parsedKeys;
242
- if (keys.length === 0) return html`
243
- <kbd class="keyboard-shortcut">
244
- <slot></slot>
245
- </kbd>
246
- `;
247
- return html`
248
- <kbd class="keyboard-shortcut">
249
- ${keys.map((key, index) => html`
250
- ${index > 0 ? html`<span class="keyboard-shortcut__separator"
251
- aria-hidden="true"
252
- >+</span>` : ""}
253
- <kbd class="keyboard-shortcut__key">${key}</kbd>
254
- `)}
255
- </kbd>
256
- `;
257
- }
258
- // src/components/content/keyboard-shortcut/keyboard-shortcut.ts
259
- /**
260
- * Nederlandse Digitale Dienst Keyboard Shortcut Component (Lit + TypeScript)
261
- *
262
- * Shows a key combination (such as Cmd+K or Ctrl+Shift+P) in one combined
263
- * container with a semantic <kbd> element per key.
264
- *
265
- * On touch-only devices (no hover-capable input) the shortcut is hidden by
266
- * default, because it cannot be invoked there. Use the `always-visible`
267
- * attribute when the shortcut is purely informative and should stay visible.
268
- *
269
- * For cross-platform shortcuts you can set `mac-keys`, `windows-keys` and
270
- * `linux-keys`. The component picks the right one from the detected OS, with
271
- * `keys` as the fallback for unknown platforms.
272
- *
273
- * @element nldd-keyboard-shortcut
274
- * @attr {string} keys - Keys separated by '+' (e.g. 'Cmd+K' or 'Ctrl+Shift+P').
275
- * End with '++' for a literal '+' key: 'Ctrl++' becomes 'Ctrl' + '+' ('Ctrl+++'
276
- * works too). For more complex cases, such as a combo with several '+' keys,
277
- * use the default slot with your own <kbd> elements instead of the keys attribute.
278
- * @attr {string} mac-keys - Optional override for macOS (iPhone/iPad/iPod included).
279
- * @attr {string} windows-keys - Optional override for Windows.
280
- * @attr {string} linux-keys - Optional override for Linux/ChromeOS.
281
- * @attr {string} size - Size: 'sm' | 'md' | 'inherit' (default: 'md'). 'inherit' takes the
282
- * font-size from the container; in the box variant the keycaps then scale along in em.
283
- * @attr {string} appearance - 'box' (default) shows each key as a keycap with a fill and a
284
- * highlight edge. 'simple' shows the keys as plain text with separators: lighter, for
285
- * inline use such as in a menu item.
286
- * @attr {boolean} always-visible - Show on touch-only devices too, where shortcuts cannot be invoked.
287
- * @attr {string} color - 'neutral' (default) uses the component colors of its own. 'inherit'
288
- * lets the keys and separators follow the surrounding text color (currentColor), with a
289
- * translucent contrast fill and highlight edge. Useful on a filled surface color or a
290
- * highlighted row.
291
- * @attr {'mac'|'windows'|'linux'|'other'} debug-os - Development aid: overrides the OS
292
- * detection for this instance, so you can show several platform variants side by side in
293
- * Storybook or documentation. Not meant for production use; leave it empty (default) so
294
- * the real OS detection applies.
295
- *
296
- * @slot - Optional custom <kbd> elements. Ignored when keys is set.
297
- */
298
- var _NLDDKeyboardShortcut = class NLDDKeyboardShortcut extends LitElement {
299
- constructor(..._args) {
300
- super(..._args);
301
- this.keys = "";
302
- this.macKeys = "";
303
- this.windowsKeys = "";
304
- this.linuxKeys = "";
305
- this.size = "md";
306
- this.appearance = "box";
307
- this.color = "neutral";
308
- this.alwaysVisible = false;
309
- this.debugOS = "";
310
- }
311
- /** @internal Resolved OS — the debug override when set, else detection. */
312
- get _resolvedOS() {
313
- return this.debugOS || detectOS();
314
- }
315
- get _resolvedKeys() {
316
- return resolveKeys(this, this._resolvedOS);
317
- }
318
- get _parsedKeys() {
319
- return parseKeys(this._resolvedKeys);
320
- }
321
- render() {
322
- return template$1(this);
323
- }
324
- };
325
- var NLDDKeyboardShortcut = (_NLDDKeyboardShortcut.styles = keyboardShortcutStyles, _NLDDKeyboardShortcut);
326
- __decorate([property({
327
- reflect: true,
328
- converter: reflectNonDefault("")
329
- })], NLDDKeyboardShortcut.prototype, "keys", void 0);
330
- __decorate([property({
331
- reflect: true,
332
- attribute: "mac-keys",
333
- converter: reflectNonDefault("")
334
- })], NLDDKeyboardShortcut.prototype, "macKeys", void 0);
335
- __decorate([property({
336
- reflect: true,
337
- attribute: "windows-keys",
338
- converter: reflectNonDefault("")
339
- })], NLDDKeyboardShortcut.prototype, "windowsKeys", void 0);
340
- __decorate([property({
341
- reflect: true,
342
- attribute: "linux-keys",
343
- converter: reflectNonDefault("")
344
- })], NLDDKeyboardShortcut.prototype, "linuxKeys", void 0);
345
- __decorate([property({
346
- reflect: true,
347
- converter: reflectNonDefault("md")
348
- })], NLDDKeyboardShortcut.prototype, "size", void 0);
349
- __decorate([property({
350
- reflect: true,
351
- converter: reflectNonDefault("box")
352
- })], NLDDKeyboardShortcut.prototype, "appearance", void 0);
353
- __decorate([property({
354
- reflect: true,
355
- converter: reflectNonDefault("neutral")
356
- })], NLDDKeyboardShortcut.prototype, "color", void 0);
357
- __decorate([property({
358
- type: Boolean,
359
- reflect: true,
360
- attribute: "always-visible"
361
- })], NLDDKeyboardShortcut.prototype, "alwaysVisible", void 0);
362
- __decorate([property({
363
- type: String,
364
- attribute: "debug-os"
365
- })], NLDDKeyboardShortcut.prototype, "debugOS", void 0);
366
- NLDDKeyboardShortcut = __decorate([customElement("nldd-keyboard-shortcut")], NLDDKeyboardShortcut);
367
- // src/utilities/popover-target.ts
368
- /**
369
- * The popover a component's inner button invokes, from `popovertarget` or
370
- * `popoverTargetElement` on the host.
371
- *
372
- * An id written on the inner button is looked up in the component's own
373
- * shadow root, where the popover never is, so the button opened nothing. The
374
- * id is looked up here in the tree of the host instead, and the inner button
375
- * gets the element. The element wins when both are set.
376
- *
377
- * Look it up again on click: a popover rendered after the button is not there
378
- * yet on the button's first render.
379
- */
380
- function popoverTargetOf(host, id, element) {
381
- if (element) return element;
382
- if (!id) return null;
383
- return host.getRootNode().getElementById?.(id) ?? null;
384
- }
385
- /** The overlay each host anchored, so it can let go again. */
386
- var anchoredBy = /* @__PURE__ */ new WeakMap();
387
- /**
388
- * Positions an `nldd-menu` or `nldd-popover` that `popovertarget` points at
389
- * against the control that opens it, so the overlay needs no `anchor` of its
390
- * own. The browser already opens and closes it; this adds where it stands and
391
- * the ARIA link back to the control, as a slotted overlay gets.
392
- *
393
- * An overlay with an `anchor` id, or anchored to another element, is
394
- * left alone: someone chose where it goes. Pass `null` to let go, as on
395
- * disconnect or when `popovertarget` changes.
396
- */
397
- function anchorPopoverTarget(host, target) {
398
- const previous = anchoredBy.get(host);
399
- const next = target?.matches("nldd-menu, nldd-popover") && !target.getAttribute("anchor") ? target : null;
400
- if (previous && previous !== next && previous.anchorElement === host) previous.anchorElement = null;
401
- if (next && (next.anchorElement === null || next.anchorElement === host)) {
402
- next.anchorElement = host;
403
- anchoredBy.set(host, next);
404
- } else anchoredBy.delete(host);
405
- }
406
- // src/utilities/popup-anchor-controller.ts
407
- var OVERLAY_SELECTOR = "nldd-menu, nldd-popover";
408
- var PopupAnchorController = class {
409
- constructor(host, options = {}) {
410
- this._overlay = null;
411
- this._wasOpenOnPointerdown = false;
412
- this.handleSlotChange = (event) => {
413
- const overlay = event.target.assignedElements({ flatten: true }).find((el) => el.matches(OVERLAY_SELECTOR)) ?? null;
414
- this.setOverlay(overlay);
415
- };
416
- this.handlePointerdown = () => {
417
- const overlay = this._overlay;
418
- if (!overlay) {
419
- this._wasOpenOnPointerdown = false;
420
- return;
421
- }
422
- this._wasOpenOnPointerdown = "_shownForInvoker" in overlay ? overlay._shownForInvoker() : overlay.matches(":popover-open");
423
- };
424
- this._anchorFor = options.anchorFor ?? (() => host);
425
- this._onChange = options.onChange;
426
- }
427
- /** The slotted overlay, or null when none is slotted. */
428
- get overlay() {
429
- return this._overlay;
430
- }
431
- /** Adopt an overlay (or none). Releases the previous one first: left
432
- * anchored, a removed overlay keeps positioning against this control and
433
- * syncing `expanded` onto it, and the pair can never be collected. */
434
- setOverlay(overlay) {
435
- if (overlay === this._overlay) return;
436
- const previous = this._overlay;
437
- if (previous) previous.anchorElement = null;
438
- this._overlay = overlay;
439
- this.anchor();
440
- this._onChange?.(overlay, previous);
441
- }
442
- /** (Re-)anchor the current overlay. Call once the anchor target exists when
443
- * it resolves later than the first `slotchange`. */
444
- anchor() {
445
- const target = this._anchorFor();
446
- if (this._overlay && target) this._overlay.anchorElement = target;
447
- }
448
- /** Call from the control's click handler. Returns true when the click was
449
- * consumed (an overlay is slotted, so the control is its invoker and
450
- * neither submits a form nor navigates); false to fall through. */
451
- handleClick(event) {
452
- if (!this._overlay) return false;
453
- const wasOpen = event.detail > 0 && this._wasOpenOnPointerdown;
454
- this._wasOpenOnPointerdown = false;
455
- if ("_endInvokerGesture" in this._overlay) this._overlay._endInvokerGesture();
456
- if (!wasOpen && !this._overlay.matches(":popover-open")) this._overlay.showPopover();
457
- return true;
458
- }
459
- };
460
- // src/components/status-and-feedback/activity-indicator/activity-indicator.styles.ts
461
- var activityIndicatorStyles = css`
462
- :host {
463
- box-sizing: border-box;
464
- }
465
-
466
-
467
- /* # Host */
468
-
469
- :host {
470
- --_activity-indicator-circle-size: var(--primitives-space-32);
471
- --_activity-indicator-color: var(--context-content-color, currentColor);
472
- --_activity-indicator-track-opacity: 0.25;
473
- --_activity-indicator-stroke-width: 2;
474
- --_activity-indicator-rotation-duration: 0.8s;
475
- --_activity-indicator-fade-duration: var(--primitives-transition-duration-slow);
476
- --_activity-indicator-fade-easing: ease-out;
477
- --_activity-indicator-pulse-duration: 2s;
478
- --_activity-indicator-pulse-easing: ease-in-out;
479
- --_activity-indicator-max-width: var(--primitives-area-240);
480
- --_activity-indicator-gap: var(--primitives-space-4);
481
- --_activity-indicator-text-font: var(--primitives-font-body-md-regular-flat);
482
- --_activity-indicator-backdrop-blur: 3px;
483
- --_activity-indicator-overlay-panel-padding: var(--primitives-space-12);
484
- --_activity-indicator-overlay-panel-corner-radius: var(--primitives-corner-radius-md);
485
-
486
- ${inheritedTextReset}
487
- box-sizing: border-box;
488
- display: flex;
489
- flex-grow: 1;
490
- flex-shrink: 1;
491
- flex-basis: auto;
492
- width: 100%;
493
- height: 100%;
494
- align-items: center;
495
- justify-content: center;
496
- }
497
-
498
- /* Overlay mode (content in the default slot): the host wraps the content and
499
- is the containing block for the absolutely-positioned indicator + backdrop,
500
- so it sizes to the content instead of filling its parent. */
501
- :host([has-content]) {
502
- display: block;
503
- position: relative;
504
- height: auto;
505
- }
506
-
507
- :host([hidden]) {
508
- display: none;
509
- }
510
-
511
-
512
- /* ## Sizes (icon scale) */
513
-
514
- :host([size="16"]) { --_activity-indicator-circle-size: var(--primitives-space-16); }
515
- :host([size="20"]) { --_activity-indicator-circle-size: var(--primitives-space-20); }
516
- :host([size="24"]) { --_activity-indicator-circle-size: var(--primitives-space-24); }
517
- :host([size="28"]) { --_activity-indicator-circle-size: var(--primitives-space-28); }
518
- :host([size="40"]) { --_activity-indicator-circle-size: var(--primitives-space-40); }
519
- :host([size="44"]) { --_activity-indicator-circle-size: var(--primitives-space-44); }
520
- :host([size="48"]) { --_activity-indicator-circle-size: var(--primitives-space-48); }
521
- :host([size="56"]) { --_activity-indicator-circle-size: var(--primitives-space-56); }
522
- :host([size="64"]) { --_activity-indicator-circle-size: var(--primitives-space-64); }
523
- :host([size="80"]) { --_activity-indicator-circle-size: var(--primitives-space-80); }
524
- :host([size="96"]) { --_activity-indicator-circle-size: var(--primitives-space-96); }
525
-
526
- :host([size="16"]),
527
- :host([size="20"]) {
528
- --_activity-indicator-text-font: var(--primitives-font-body-xs-regular-flat);
529
- }
530
-
531
- :host([size="24"]),
532
- :host([size="28"]) {
533
- --_activity-indicator-text-font: var(--primitives-font-body-sm-regular-flat);
534
- }
535
-
536
-
537
- /* # Block
538
- Stacks the circle + label as a centered column; max-width wraps a long
539
- label. */
540
-
541
- .activity-indicator {
542
- /* position:relative so it paints above the absolutely-positioned backdrop
543
- (both are z-index:auto; the backdrop comes first in the DOM). Laid out
544
- but invisible during the delay, so the host holds its size until complete. */
545
- position: relative;
546
- display: flex;
547
- visibility: hidden;
548
- opacity: 0;
549
- pointer-events: none;
550
- width: 100%;
551
- max-width: var(--_activity-indicator-max-width);
552
- flex-direction: column;
553
- align-items: center;
554
- gap: var(--_activity-indicator-gap);
555
- transition-property: opacity, visibility, display;
556
- transition-duration: var(--_activity-indicator-fade-duration);
557
- transition-timing-function: var(--_activity-indicator-fade-easing);
558
- transition-behavior: allow-discrete;
559
- }
560
-
561
- :host([loading]) .activity-indicator {
562
- visibility: visible;
563
- opacity: 1;
564
- }
565
-
566
- :host([complete]) .activity-indicator {
567
- display: none;
568
- }
569
-
570
- @starting-style {
571
- :host([loading]) .activity-indicator {
572
- opacity: 0;
573
- }
574
- }
575
-
576
- /* Overlay mode: the wrapped content flows normally; the indicator + backdrop
577
- sit on top as absolute layers that fill the host. */
578
- .activity-indicator__content {
579
- display: block;
580
- }
581
-
582
- /* Overlay mode: the indicator + label sit on a small rounded base-surface
583
- panel that hugs them with padding (not the full component width) so they
584
- keep contrast over the dimmed content, and read in the content color
585
- instead of inheriting currentColor. */
586
- :host([has-content]) .activity-indicator {
587
- box-sizing: border-box;
588
- position: absolute;
589
- top: 50%;
590
- left: 50%;
591
- border-radius: var(--_activity-indicator-overlay-panel-corner-radius);
592
- background-color: var(--semantics-surfaces-base-background-color);
593
- width: max-content;
594
- max-width: calc(100% - var(--primitives-space-32));
595
- padding: var(--_activity-indicator-overlay-panel-padding);
596
- color: var(--semantics-content-color);
597
- transform: translate(-50%, -50%);
598
- }
599
-
600
- /* Dimming layer (overlay mode, on by default; opt out with no-backdrop): the
601
- context parent background color — fallback the base surface — at one minus
602
- the disabled opacity, so the content underneath reads as inactive while
603
- loading. Fades in and out with the indicator via the loading attribute. */
604
- .activity-indicator__backdrop {
605
- position: absolute;
606
- inset: 0;
607
- display: none;
608
- opacity: 0;
609
- /* Frosted dim: the parent surface — fallback base surface — as a
610
- translucent fill at one minus the disabled opacity (a translucent
611
- color, not element opacity, which would hide the blur), plus a blur so
612
- the content behind reads as inactive. backdrop-filter degrades
613
- gracefully where unsupported, leaving just the translucent fill. */
614
- background-color: color-mix(in oklab, var(--context-parent-background-color, var(--semantics-surfaces-base-background-color)) calc((1 - var(--primitives-opacity-disabled)) * 100%), transparent);
615
- -webkit-backdrop-filter: blur(var(--_activity-indicator-backdrop-blur));
616
- backdrop-filter: blur(var(--_activity-indicator-backdrop-blur));
617
- pointer-events: none;
618
- transition-property: opacity, display;
619
- transition-duration: var(--_activity-indicator-fade-duration);
620
- transition-timing-function: var(--_activity-indicator-fade-easing);
621
- transition-behavior: allow-discrete;
622
- }
623
-
624
- :host([loading]) .activity-indicator__backdrop {
625
- display: block;
626
- opacity: 1;
627
- }
628
-
629
- @starting-style {
630
- :host([loading]) .activity-indicator__backdrop {
631
- opacity: 0;
632
- }
633
- }
634
-
635
- /* # Elements */
636
-
637
- /* The whole SVG (stroke included) scales with the size, like an icon. */
638
- .activity-indicator__circle {
639
- display: block;
640
- width: var(--_activity-indicator-circle-size);
641
- height: var(--_activity-indicator-circle-size);
642
- }
643
-
644
- .activity-indicator__track {
645
- opacity: var(--_activity-indicator-track-opacity);
646
- stroke: var(--_activity-indicator-color);
647
- stroke-width: var(--_activity-indicator-stroke-width);
648
- }
649
-
650
- /* Rotate only the arc inside the SVG (around the view-box center via
651
- transform-origin) rather than the whole <svg> element — rotating the
652
- element visibly wobbles when it sits at a sub-pixel position (next to a
653
- label, or overlaid on a button). Mirrors nldd-progress-circle. */
654
- .activity-indicator__indicator {
655
- stroke: var(--_activity-indicator-color);
656
- stroke-width: var(--_activity-indicator-stroke-width);
657
- stroke-linecap: round;
658
- stroke-dasharray: 25 100;
659
- transform-origin: 50% 50%;
660
- animation: activity-indicator-rotate var(--_activity-indicator-rotation-duration) linear infinite;
661
- }
662
-
663
- @keyframes activity-indicator-rotate {
664
- to { transform: rotate(360deg); }
665
- }
666
-
667
- .activity-indicator__text {
668
- color: currentColor;
669
- font: var(--_activity-indicator-text-font);
670
- text-align: center;
671
- text-wrap: balance;
672
- }
673
-
674
- /* show-text off (default): the label still renders as the announced
675
- content of the role="status" host, but is visually hidden.
676
- Standard visually-hidden recipe. */
677
- .activity-indicator__text--visually-hidden {
678
- position: absolute;
679
- width: 1px;
680
- height: 1px;
681
- overflow: hidden;
682
- clip-path: inset(50%);
683
- white-space: nowrap;
684
- }
685
-
686
-
687
- /* # Reduced Motion */
688
-
689
- @media (prefers-reduced-motion: reduce) {
690
- .activity-indicator,
691
- .activity-indicator__backdrop {
692
- transition: none;
693
- }
694
-
695
- .activity-indicator__indicator {
696
- /* Drop the rotation (vestibular safety); keep the 25 / 100 arc and
697
- pulse its opacity instead, mirroring nldd-progress-circle. */
698
- animation: activity-indicator-pulse var(--_activity-indicator-pulse-duration) var(--_activity-indicator-pulse-easing) infinite;
699
- }
700
-
701
- @keyframes activity-indicator-pulse {
702
- 0%, 100% { opacity: 0.3; }
703
- 50% { opacity: 0.7; }
704
- }
705
- }
706
- `;
707
- // src/components/status-and-feedback/activity-indicator/activity-indicator.template.ts
708
- function activityIndicatorTemplate(component) {
709
- const disableContent = component._visible && !component.complete && component._hasContent;
710
- const renderBackdrop = component._hasContent && !component.noBackdrop;
711
- const text = component._accessibleName;
712
- return html`
713
- <div class="activity-indicator__content"
714
- ?inert=${disableContent}
715
- aria-busy=${disableContent ? "true" : "false"}
716
- >
717
- <slot @slotchange=${component._onContentSlotChange}></slot>
718
- </div>
719
- ${renderBackdrop ? html`<div class="activity-indicator__backdrop" aria-hidden="true"></div>` : nothing}
720
- <div class="activity-indicator">
721
- <svg class="activity-indicator__circle"
722
- viewBox="0 0 24 24"
723
- fill="none"
724
- aria-hidden="true"
725
- focusable="false"
726
- >
727
- <circle class="activity-indicator__track"
728
- cx="12"
729
- cy="12"
730
- r="9"
731
- ></circle>
732
- <circle class="activity-indicator__indicator"
733
- cx="12"
734
- cy="12"
735
- r="9"
736
- pathLength="100"
737
- ></circle>
738
- </svg>
739
- <span class=${classMap({
740
- "activity-indicator__text": true,
741
- "activity-indicator__text--visually-hidden": !component.showText
742
- })}>${text}</span>
743
- </div>
744
- `;
745
- }
746
- // src/components/status-and-feedback/activity-indicator/activity-indicator.ts
747
- /**
748
- * Nederlandse Digitale Dienst Activity Indicator Component (Lit + TypeScript)
749
- *
750
- * Layout placeholder that fills its parent and centers an indeterminate
751
- * activity indicator. By default the indicator is held back for 1000ms so
752
- * brief loading states don't flash; once the delay passes it fades in. Set
753
- * `timing="instant"` to skip the delay (the fade-in still plays) — this is
754
- * what embedding components such as `nldd-button` use for their loading state.
755
- *
756
- * Sizing: fills its parent where the parent lets it (a flex column such as
757
- * `nldd-container`, a grid, or a fixed height) and centers itself there. Where
758
- * the parent has no height of its own, give it one: a `min-height` matching
759
- * the content you expect, such as `<nldd-container min-height="240px">`. As a
760
- * safety net the host already takes the indicator's size (circle, plus the
761
- * label with `show-text`) during the delay, so nothing shifts when it fades
762
- * in; once `complete` is set it gives that space up.
763
- *
764
- * Label size follows `size`, not the surrounding text, so the circle and its
765
- * label keep the same proportion everywhere: body-xs at 16 and 20, body-sm at
766
- * 24 and 28, body-md from 32. Keep the label short; a longer explanation
767
- * belongs in the area as regular text.
768
- *
769
- * The default indicator is a simple icon-sized circle that follows the shared
770
- * `--context-content-color` channel (set by list-item / table / menu on their
771
- * content), falling back to `currentColor` wherever that channel is unset
772
- * (buttons, rich-text, standalone) — so a spinner inside a cell tracks the
773
- * row's state-aware content color, while embedders relying on currentColor are
774
- * unaffected. An optional label sits below (hidden unless `show-text` is set).
775
- * The indicator is always indeterminate; when you know the progress, show
776
- * `nldd-progress-bar` or `nldd-progress-circle` instead.
777
- *
778
- * Icon alignment: the visible ring already sits at 5/6 of its box (the SVG's
779
- * r=9 plus a 2-unit stroke in a 24 view-box, the same optical inset a filled
780
- * icon glyph has), so a standalone spinner lines up with an icon or an
781
- * `icon-aligned` `nldd-avatar` on the same grid — no extra option needed
782
- * (unlike `nldd-avatar`, which fills edge-to-edge and opts in via
783
- * `icon-aligned`).
784
- *
785
- * Overlay mode: put content in the default slot and the indicator wraps it — it
786
- * becomes a `position: relative` container, renders the spinner over a dimming
787
- * backdrop (opt out with `no-backdrop`), and makes the content `inert` so its
788
- * controls can't be focused or clicked. Toggle loading with `complete`
789
- * (`?complete=${!isLoading}`). With no slotted content it stays the standalone
790
- * placeholder described above.
791
- *
792
- * Reconnect behavior: every `connectedCallback` resets the timer and hides
793
- * the indicator again. If a consumer toggles the element via a conditional
794
- * render (remove + re-insert) the indicator disappears and re-fades after
795
- * another delay. Keep the element mounted and toggle visibility / `hidden`
796
- * instead if you want the timer to run only once.
797
- *
798
- * Accessibility: while connected and not `complete` the host is a polite live
799
- * region (`role="status"`). The label (`text`, or the translated "Laden"
800
- * fallback) always renders as the region's content — visually hidden when
801
- * `show-text` is off (the default) — so assistive tech announces the loading
802
- * state when the indicator appears. Set `complete` (or unmount) to clear it.
803
- *
804
- * @element nldd-activity-indicator
805
- *
806
- * @attr {string} size - Circle diameter on the icon scale: 16,20,24,28,32,40,44,48,56,64,80,96 (default '32')
807
- * @attr {boolean} show-text - Show the label under the indicator (default false; the label still feeds the accessible name)
808
- * @attr {string} text - Label text. Falls back to the translated "Laden" when unset.
809
- * @attr {'delay'|'instant'} timing - 'delay' (the default) waits 1000ms before showing (anti-flash); 'instant' shows immediately (the fade-in still plays).
810
- * @attr {boolean} complete - Mark the loader as finished while keeping the element mounted; clears aria-busy and hides the indicator.
811
- * @attr {boolean} no-backdrop - Overlay mode dims and blurs the wrapped content with a frosted backdrop by default; set this to show only the indicator panel without dimming. No effect in standalone mode.
812
- * @attr {object} translations - Override translation keys; unset keys fall back to Dutch
813
- *
814
- * @slot - Content to wrap (overlay mode); made inert while loading. Leave empty
815
- * for the standalone placeholder.
816
- *
817
- * @migration The `indicator` slot has been removed. Show a known progress with `nldd-progress-bar` or `nldd-progress-circle` directly, without the activity indicator around it.
818
- */
819
- var _NLDDActivityIndicator;
820
- /** Delay before the indicator fades in. Brief loading states finish within
821
- * this window and the indicator is never shown — avoids a jarring flash. */
822
- var SHOW_DELAY_MS = 1e3;
823
- var NLDDActivityIndicator = (_NLDDActivityIndicator = class NLDDActivityIndicator extends LitElement {
824
- constructor(..._args) {
825
- super(..._args);
826
- this.size = "32";
827
- this.showText = false;
828
- this.text = "";
829
- this.timing = "delay";
830
- this.complete = false;
831
- this.noBackdrop = false;
832
- this.translations = {};
833
- this._visible = false;
834
- this._hasContent = false;
835
- this._onContentSlotChange = (e) => {
836
- const slot = e.target;
837
- this._hasContent = slot.assignedElements().length > 0;
838
- };
839
- }
840
- _t(key) {
841
- return translate(this.translations, nlddActivityIndicatorTranslations, key);
842
- }
843
- /** Accessible name announced while loading. */
844
- get _accessibleName() {
845
- return this.text || this._t("components.activity-indicator.loading-label");
846
- }
847
- connectedCallback() {
848
- super.connectedCallback();
849
- this._syncAria();
850
- this._visible = this.timing === "instant";
851
- if (!this._visible && !this.complete) this._scheduleDelay();
852
- }
853
- willUpdate(changed) {
854
- if (changed.has("complete")) this._syncAria();
855
- if (changed.has("timing")) {
856
- this._clearDelay();
857
- if (this.timing === "instant") this._visible = true;
858
- else if (!this._visible && !this.complete) this._scheduleDelay();
859
- }
860
- }
861
- disconnectedCallback() {
862
- super.disconnectedCallback();
863
- this._clearDelay();
864
- }
865
- _clearDelay() {
866
- if (this._delayTimeout) {
867
- clearTimeout(this._delayTimeout);
868
- this._delayTimeout = void 0;
869
- }
870
- }
871
- _scheduleDelay() {
872
- this._delayTimeout = setTimeout(() => {
873
- this._visible = true;
874
- this._delayTimeout = void 0;
875
- }, SHOW_DELAY_MS);
876
- }
877
- /** A polite live region (role="status") while loading; cleared when
878
- * complete. The announced text is the visually-hidden label rendered by
879
- * the template — not an aria-label, and without aria-busy, since a busy
880
- * live region would defer the very announcement we want. */
881
- _syncAria() {
882
- if (this.complete) this.removeAttribute("role");
883
- else this.setAttribute("role", "status");
884
- }
885
- updated() {
886
- this.toggleAttribute("loading", this._visible && !this.complete);
887
- this.toggleAttribute("has-content", this._hasContent);
888
- }
889
- render() {
890
- return activityIndicatorTemplate(this);
891
- }
892
- }, _NLDDActivityIndicator.styles = activityIndicatorStyles, _NLDDActivityIndicator);
893
- __decorate([property({
894
- reflect: true,
895
- converter: reflectNonDefault("32")
896
- })], NLDDActivityIndicator.prototype, "size", void 0);
897
- __decorate([property({
898
- type: Boolean,
899
- reflect: true,
900
- attribute: "show-text"
901
- })], NLDDActivityIndicator.prototype, "showText", void 0);
902
- __decorate([property({
903
- reflect: true,
904
- converter: reflectNonDefault("")
905
- })], NLDDActivityIndicator.prototype, "text", void 0);
906
- __decorate([property({
907
- reflect: true,
908
- converter: reflectNonDefault("delay")
909
- })], NLDDActivityIndicator.prototype, "timing", void 0);
910
- __decorate([property({
911
- type: Boolean,
912
- reflect: true
913
- })], NLDDActivityIndicator.prototype, "complete", void 0);
914
- __decorate([property({
915
- type: Boolean,
916
- reflect: true,
917
- attribute: "no-backdrop"
918
- })], NLDDActivityIndicator.prototype, "noBackdrop", void 0);
919
- __decorate([property({ type: Object })], NLDDActivityIndicator.prototype, "translations", void 0);
920
- __decorate([state()], NLDDActivityIndicator.prototype, "_visible", void 0);
921
- __decorate([state()], NLDDActivityIndicator.prototype, "_hasContent", void 0);
922
- NLDDActivityIndicator = __decorate([customElement("nldd-activity-indicator")], NLDDActivityIndicator);
923
- // src/components/actions/icon-button/icon-button.styles.ts
924
- var iconButtonStyles = css`
925
- :host {
926
- box-sizing: border-box;
927
- }
928
-
929
-
930
- /* # Host */
931
-
932
- :host {
933
- --_icon-button-corner-radius: var(--semantics-controls-md-corner-radius);
934
- --_icon-button-width: auto;
935
- --_icon-button-min-size: var(--semantics-controls-md-min-size);
936
- --_icon-button-block-padding: var(--semantics-buttons-md-is-icon-only-inline-padding);
937
- --_icon-button-inline-padding: var(--semantics-buttons-md-is-icon-only-inline-padding);
938
- --_icon-button-size: var(--semantics-buttons-md-is-icon-only-icon-size);
939
- --_icon-button-disclosure-icon-margin-right: calc(var(--primitives-space-2) * -1);
940
- --_icon-button-disclosure-icon-size: var(--primitives-space-20);
941
- --_icon-button-text-display: none;
942
- --_icon-button-text-font: var(--primitives-font-body-xxs-medium-flat);
943
- --_icon-button-background-color: var(--semantics-buttons-neutral-tinted-background-color);
944
- --_icon-button-primary-content-color: var(--semantics-buttons-neutral-tinted-content-color);
945
- --_icon-button-highlight-border-color: var(--semantics-buttons-neutral-tinted-highlight-border-color);
946
- --_icon-button-is-hovered-background-color: var(--semantics-buttons-neutral-tinted-is-hovered-background-color);
947
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-neutral-tinted-is-hovered-content-color);
948
- --_icon-button-is-hovered-highlight-border-color: var(--semantics-buttons-neutral-tinted-is-hovered-highlight-border-color);
949
- --_icon-button-is-active-background-color: var(--semantics-buttons-neutral-tinted-is-active-background-color);
950
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-neutral-tinted-is-active-content-color);
951
- --_icon-button-is-active-highlight-border-color: var(--semantics-buttons-neutral-tinted-is-active-highlight-border-color);
952
-
953
- ${inheritedTextReset}
954
- /* inline-flex, not inline-block: a block container puts the control on a
955
- line, and the strut's descender then grows the host with the inherited
956
- line-height, so the same button is taller in body text than in a form. */
957
- display: inline-flex;
958
- position: relative;
959
- max-width: 100%;
960
- -webkit-user-select: none;
961
- user-select: none;
962
- -webkit-tap-highlight-color: transparent;
963
- }
964
-
965
- :host([size="xs"]) {
966
- --_icon-button-corner-radius: var(--semantics-controls-xs-corner-radius);
967
- --_icon-button-min-size: var(--semantics-controls-xs-min-size);
968
- --_icon-button-block-padding: var(--semantics-buttons-xs-is-icon-only-inline-padding);
969
- --_icon-button-inline-padding: var(--semantics-buttons-xs-is-icon-only-inline-padding);
970
- --_icon-button-size: var(--semantics-buttons-xs-is-icon-only-icon-size);
971
- --_icon-button-disclosure-icon-margin-right: 0;
972
- --_icon-button-disclosure-icon-size: var(--primitives-space-16);
973
- }
974
-
975
- :host([size="sm"]) {
976
- --_icon-button-corner-radius: var(--semantics-controls-sm-corner-radius);
977
- --_icon-button-min-size: var(--semantics-controls-sm-min-size);
978
- --_icon-button-block-padding: var(--semantics-buttons-sm-is-icon-only-inline-padding);
979
- --_icon-button-inline-padding: var(--semantics-buttons-sm-is-icon-only-inline-padding);
980
- --_icon-button-size: var(--semantics-buttons-sm-is-icon-only-icon-size);
981
- }
982
-
983
- :host([size="lg"]) {
984
- --_icon-button-corner-radius: var(--semantics-controls-lg-corner-radius);
985
- --_icon-button-min-size: var(--semantics-controls-lg-min-size);
986
- --_icon-button-block-padding: var(--primitives-space-8);
987
- --_icon-button-inline-padding: var(--primitives-space-8);
988
- --_icon-button-text-display: block;
989
- }
990
-
991
- :host([size="lg"][hide-lg-text]) {
992
- --_icon-button-block-padding: var(--semantics-buttons-lg-is-icon-only-inline-padding);
993
- --_icon-button-inline-padding: var(--semantics-buttons-lg-is-icon-only-inline-padding);
994
- --_icon-button-size: var(--semantics-buttons-lg-is-icon-only-icon-size);
995
- --_icon-button-text-display: none;
996
- }
997
-
998
- :host([appearance="neutral-base"]) {
999
- --_icon-button-background-color: var(--semantics-buttons-neutral-base-background-color);
1000
- --_icon-button-primary-content-color: var(--semantics-buttons-neutral-base-content-color);
1001
- --_icon-button-highlight-border-color: var(--semantics-buttons-neutral-base-highlight-border-color);
1002
- --_icon-button-is-hovered-background-color: var(--semantics-buttons-neutral-base-is-hovered-background-color);
1003
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-neutral-base-is-hovered-content-color);
1004
- --_icon-button-is-hovered-highlight-border-color: var(--semantics-buttons-neutral-base-is-hovered-highlight-border-color);
1005
- --_icon-button-is-active-background-color: var(--semantics-buttons-neutral-base-is-active-background-color);
1006
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-neutral-base-is-active-content-color);
1007
- --_icon-button-is-active-highlight-border-color: var(--semantics-buttons-neutral-base-is-active-highlight-border-color);
1008
- }
1009
-
1010
- :host([appearance="neutral-transparent"]) {
1011
- --_icon-button-background-color: transparent;
1012
- --_icon-button-primary-content-color: var(--semantics-buttons-neutral-transparent-content-color);
1013
- --_icon-button-highlight-border-color: transparent;
1014
- --_icon-button-is-hovered-background-color: transparent;
1015
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-neutral-transparent-is-hovered-content-color);
1016
- --_icon-button-is-hovered-highlight-border-color: transparent;
1017
- --_icon-button-is-active-background-color: transparent;
1018
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-neutral-transparent-is-active-content-color);
1019
- --_icon-button-is-active-highlight-border-color: transparent;
1020
- }
1021
-
1022
- :host([appearance="accent-filled"]),
1023
- :host([appearance="primary"]) {
1024
- --_icon-button-background-color: var(--semantics-buttons-accent-filled-background-color);
1025
- --_icon-button-primary-content-color: var(--semantics-buttons-accent-filled-content-color);
1026
- --_icon-button-highlight-border-color: var(--semantics-buttons-accent-filled-highlight-border-color);
1027
- --_icon-button-is-hovered-background-color: var(--semantics-buttons-accent-filled-is-hovered-background-color);
1028
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-accent-filled-is-hovered-content-color);
1029
- --_icon-button-is-hovered-highlight-border-color: var(--semantics-buttons-accent-filled-is-hovered-highlight-border-color);
1030
- --_icon-button-is-active-background-color: var(--semantics-buttons-accent-filled-is-active-background-color);
1031
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-accent-filled-is-active-content-color);
1032
- --_icon-button-is-active-highlight-border-color: var(--semantics-buttons-accent-filled-is-active-highlight-border-color);
1033
- }
1034
-
1035
- :host([appearance="accent-transparent"]) {
1036
- --_icon-button-background-color: transparent;
1037
- --_icon-button-primary-content-color: var(--semantics-buttons-accent-transparent-content-color);
1038
- --_icon-button-highlight-border-color: transparent;
1039
- --_icon-button-is-hovered-background-color: transparent;
1040
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-accent-transparent-is-hovered-content-color);
1041
- --_icon-button-is-hovered-highlight-border-color: transparent;
1042
- --_icon-button-is-active-background-color: transparent;
1043
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-accent-transparent-is-active-content-color);
1044
- --_icon-button-is-active-highlight-border-color: transparent;
1045
- }
1046
-
1047
- :host([appearance="critical-tinted"]),
1048
- :host([appearance="destructive"]) {
1049
- --_icon-button-background-color: var(--semantics-buttons-critical-tinted-background-color);
1050
- --_icon-button-primary-content-color: var(--semantics-buttons-critical-tinted-content-color);
1051
- --_icon-button-highlight-border-color: var(--semantics-buttons-critical-tinted-highlight-border-color);
1052
- --_icon-button-is-hovered-background-color: var(--semantics-buttons-critical-tinted-is-hovered-background-color);
1053
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-critical-tinted-is-hovered-content-color);
1054
- --_icon-button-is-hovered-highlight-border-color: var(--semantics-buttons-critical-tinted-is-hovered-highlight-border-color);
1055
- --_icon-button-is-active-background-color: var(--semantics-buttons-critical-tinted-is-active-background-color);
1056
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-critical-tinted-is-active-content-color);
1057
- --_icon-button-is-active-highlight-border-color: var(--semantics-buttons-critical-tinted-is-active-highlight-border-color);
1058
- }
1059
-
1060
- :host([appearance="critical-transparent"]) {
1061
- --_icon-button-background-color: transparent;
1062
- --_icon-button-primary-content-color: var(--semantics-buttons-critical-transparent-content-color);
1063
- --_icon-button-highlight-border-color: transparent;
1064
- --_icon-button-is-hovered-background-color: transparent;
1065
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-critical-transparent-is-hovered-content-color);
1066
- --_icon-button-is-hovered-highlight-border-color: transparent;
1067
- --_icon-button-is-active-background-color: transparent;
1068
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-critical-transparent-is-active-content-color);
1069
- --_icon-button-is-active-highlight-border-color: transparent;
1070
- }
1071
-
1072
- /* The on-color variants derive from currentColor; see nldd-button for
1073
- the full rationale. The filled label resolves the context var here on
1074
- the host, with the tokens' white/black contrast flip as fallback. */
1075
-
1076
- :host([appearance="inherit-tinted"]),
1077
- :host([expanded][appearance="inherit-tinted"]) {
1078
- --_icon-button-background-color: var(--context-button-background-color, var(--semantics-buttons-inherit-tinted-background-color));
1079
- --_icon-button-primary-content-color: var(--semantics-buttons-inherit-tinted-content-color);
1080
- --_icon-button-highlight-border-color: var(--semantics-buttons-inherit-tinted-highlight-border-color);
1081
- --_icon-button-is-hovered-background-color: var(--_icon-button-background-color);
1082
- --_icon-button-is-hovered-primary-content-color: var(--_icon-button-primary-content-color);
1083
- --_icon-button-is-hovered-highlight-border-color: var(--_icon-button-highlight-border-color);
1084
- --_icon-button-is-active-background-color: var(--_icon-button-background-color);
1085
- --_icon-button-is-active-primary-content-color: var(--_icon-button-primary-content-color);
1086
- --_icon-button-is-active-highlight-border-color: var(--_icon-button-highlight-border-color);
1087
- }
1088
-
1089
- :host([appearance="inherit-filled"]),
1090
- :host([expanded][appearance="inherit-filled"]) {
1091
- --_icon-button-background-color: var(--semantics-buttons-inherit-filled-background-color);
1092
- --_icon-button-primary-content-color: var(--context-parent-background-color, var(--semantics-buttons-inherit-filled-content-color));
1093
- --_icon-button-highlight-border-color: var(--semantics-buttons-inherit-filled-highlight-border-color);
1094
- --_icon-button-is-hovered-background-color: var(--_icon-button-background-color);
1095
- --_icon-button-is-hovered-primary-content-color: var(--_icon-button-primary-content-color);
1096
- --_icon-button-is-hovered-highlight-border-color: var(--_icon-button-highlight-border-color);
1097
- --_icon-button-is-active-background-color: var(--_icon-button-background-color);
1098
- --_icon-button-is-active-primary-content-color: var(--_icon-button-primary-content-color);
1099
- --_icon-button-is-active-highlight-border-color: var(--_icon-button-highlight-border-color);
1100
- }
1101
-
1102
- /* For inherit-filled the inner button keeps the inherited on-color:
1103
- its currentColor background and the label's contrast flip resolve
1104
- against it, and would otherwise self-reference the label. The label
1105
- color moves to the content layer instead; see nldd-button. */
1106
- :host([appearance="inherit-filled"]) .icon-button {
1107
- color: inherit;
1108
- }
1109
-
1110
- :host([appearance="inherit-filled"]) .icon-button > * {
1111
- color: var(--_icon-button-primary-content-color);
1112
- }
1113
-
1114
- /* ## Expanded — default (incl. unknown variant) */
1115
-
1116
- :host([expanded]) {
1117
- --_icon-button-background-color: var(--semantics-buttons-neutral-tinted-is-expanded-background-color);
1118
- --_icon-button-primary-content-color: var(--semantics-buttons-neutral-tinted-is-expanded-content-color);
1119
- --_icon-button-highlight-border-color: var(--semantics-buttons-neutral-tinted-is-expanded-highlight-border-color);
1120
- --_icon-button-is-hovered-background-color: var(--semantics-buttons-neutral-tinted-is-expanded-is-hovered-background-color);
1121
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-neutral-tinted-is-expanded-is-hovered-content-color);
1122
- --_icon-button-is-hovered-highlight-border-color: var(--semantics-buttons-neutral-tinted-is-expanded-is-hovered-highlight-border-color);
1123
- --_icon-button-is-active-background-color: var(--semantics-buttons-neutral-tinted-is-expanded-is-active-background-color);
1124
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-neutral-tinted-is-expanded-is-active-content-color);
1125
- --_icon-button-is-active-highlight-border-color: var(--semantics-buttons-neutral-tinted-is-expanded-is-active-highlight-border-color);
1126
- }
1127
-
1128
- :host([expanded][appearance="neutral-base"]) {
1129
- --_icon-button-background-color: var(--semantics-buttons-neutral-base-is-expanded-background-color);
1130
- --_icon-button-primary-content-color: var(--semantics-buttons-neutral-base-is-expanded-content-color);
1131
- --_icon-button-highlight-border-color: var(--semantics-buttons-neutral-base-is-expanded-highlight-border-color);
1132
- --_icon-button-is-hovered-background-color: var(--semantics-buttons-neutral-base-is-expanded-is-hovered-background-color);
1133
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-neutral-base-is-expanded-is-hovered-content-color);
1134
- --_icon-button-is-hovered-highlight-border-color: var(--semantics-buttons-neutral-base-is-expanded-is-hovered-highlight-border-color);
1135
- --_icon-button-is-active-background-color: var(--semantics-buttons-neutral-base-is-expanded-is-active-background-color);
1136
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-neutral-base-is-expanded-is-active-content-color);
1137
- --_icon-button-is-active-highlight-border-color: var(--semantics-buttons-neutral-base-is-expanded-is-active-highlight-border-color);
1138
- }
1139
-
1140
- :host([expanded][appearance="neutral-transparent"]) {
1141
- --_icon-button-background-color: transparent;
1142
- --_icon-button-primary-content-color: var(--semantics-buttons-neutral-transparent-content-color);
1143
- --_icon-button-highlight-border-color: transparent;
1144
- --_icon-button-is-hovered-background-color: transparent;
1145
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-neutral-transparent-is-hovered-content-color);
1146
- --_icon-button-is-hovered-highlight-border-color: transparent;
1147
- --_icon-button-is-active-background-color: transparent;
1148
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-neutral-transparent-is-active-content-color);
1149
- --_icon-button-is-active-highlight-border-color: transparent;
1150
- }
1151
-
1152
- :host([expanded][appearance="accent-filled"]),
1153
- :host([expanded][appearance="primary"]) {
1154
- --_icon-button-background-color: var(--semantics-buttons-accent-filled-is-expanded-background-color);
1155
- --_icon-button-primary-content-color: var(--semantics-buttons-accent-filled-is-expanded-content-color);
1156
- --_icon-button-highlight-border-color: var(--semantics-buttons-accent-filled-is-expanded-highlight-border-color);
1157
- --_icon-button-is-hovered-background-color: var(--semantics-buttons-accent-filled-is-expanded-is-hovered-background-color);
1158
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-accent-filled-is-expanded-is-hovered-content-color);
1159
- --_icon-button-is-hovered-highlight-border-color: var(--semantics-buttons-accent-filled-is-expanded-is-hovered-highlight-border-color);
1160
- --_icon-button-is-active-background-color: var(--semantics-buttons-accent-filled-is-expanded-is-active-background-color);
1161
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-accent-filled-is-expanded-is-active-content-color);
1162
- --_icon-button-is-active-highlight-border-color: var(--semantics-buttons-accent-filled-is-expanded-is-active-highlight-border-color);
1163
- }
1164
-
1165
- :host([expanded][appearance="accent-transparent"]) {
1166
- --_icon-button-background-color: transparent;
1167
- --_icon-button-primary-content-color: var(--semantics-buttons-accent-transparent-content-color);
1168
- --_icon-button-highlight-border-color: transparent;
1169
- --_icon-button-is-hovered-background-color: transparent;
1170
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-accent-transparent-is-hovered-content-color);
1171
- --_icon-button-is-hovered-highlight-border-color: transparent;
1172
- --_icon-button-is-active-background-color: transparent;
1173
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-accent-transparent-is-active-content-color);
1174
- --_icon-button-is-active-highlight-border-color: transparent;
1175
- }
1176
-
1177
- :host([expanded][appearance="critical-tinted"]),
1178
- :host([expanded][appearance="destructive"]) {
1179
- --_icon-button-background-color: var(--semantics-buttons-critical-tinted-is-expanded-background-color);
1180
- --_icon-button-primary-content-color: var(--semantics-buttons-critical-tinted-is-expanded-content-color);
1181
- --_icon-button-highlight-border-color: var(--semantics-buttons-critical-tinted-is-expanded-highlight-border-color);
1182
- --_icon-button-is-hovered-background-color: var(--semantics-buttons-critical-tinted-is-expanded-is-hovered-background-color);
1183
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-critical-tinted-is-expanded-is-hovered-content-color);
1184
- --_icon-button-is-hovered-highlight-border-color: var(--semantics-buttons-critical-tinted-is-expanded-is-hovered-highlight-border-color);
1185
- --_icon-button-is-active-background-color: var(--semantics-buttons-critical-tinted-is-expanded-is-active-background-color);
1186
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-critical-tinted-is-expanded-is-active-content-color);
1187
- --_icon-button-is-active-highlight-border-color: var(--semantics-buttons-critical-tinted-is-expanded-is-active-highlight-border-color);
1188
- }
1189
-
1190
- :host([expanded][appearance="critical-transparent"]) {
1191
- --_icon-button-background-color: transparent;
1192
- --_icon-button-primary-content-color: var(--semantics-buttons-critical-transparent-content-color);
1193
- --_icon-button-highlight-border-color: transparent;
1194
- --_icon-button-is-hovered-background-color: transparent;
1195
- --_icon-button-is-hovered-primary-content-color: var(--semantics-buttons-critical-transparent-is-hovered-content-color);
1196
- --_icon-button-is-hovered-highlight-border-color: transparent;
1197
- --_icon-button-is-active-background-color: transparent;
1198
- --_icon-button-is-active-primary-content-color: var(--semantics-buttons-critical-transparent-is-active-content-color);
1199
- --_icon-button-is-active-highlight-border-color: transparent;
1200
- }
1201
-
1202
- :host([width="full"]) {
1203
- display: block;
1204
- width: 100%;
1205
- flex-grow: 1;
1206
- }
1207
-
1208
- :host([hidden]) {
1209
- display: none;
1210
- }
1211
-
1212
- :host([disabled]) {
1213
- opacity: var(--primitives-opacity-disabled);
1214
- pointer-events: none;
1215
- }
1216
-
1217
- :host([no-highlight-border]),
1218
- :host([no-highlight-border][expanded]) {
1219
- --_icon-button-highlight-border-color: transparent;
1220
- --_icon-button-is-hovered-highlight-border-color: transparent;
1221
- --_icon-button-is-active-highlight-border-color: transparent;
1222
- }
1223
-
1224
-
1225
- /* # Block */
1226
-
1227
- .icon-button {
1228
- box-sizing: border-box;
1229
- display: inline-flex;
1230
- margin: 0;
1231
- border: none;
1232
- border-radius: var(--_icon-button-corner-radius);
1233
- background: none;
1234
- background-color: var(--_icon-button-background-color);
1235
- box-shadow: inset 0 0 0 var(--primitives-border-width-thin) var(--_icon-button-highlight-border-color);
1236
- width: var(--_icon-button-width);
1237
- min-width: var(--_icon-button-min-size);
1238
- height: var(--_icon-button-min-size);
1239
- min-height: var(--_icon-button-min-size);
1240
- padding: var(--_icon-button-block-padding) var(--_icon-button-inline-padding);
1241
- flex-direction: column;
1242
- align-items: center;
1243
- justify-content: center;
1244
- color: var(--_icon-button-primary-content-color);
1245
- font: inherit;
1246
- text-decoration: none;
1247
- transition:
1248
- background-color var(--primitives-transition-duration-fast) var(--primitives-transition-easing-default),
1249
- color var(--primitives-transition-duration-fast) var(--primitives-transition-easing-default)
1250
- ;
1251
- appearance: none;
1252
- }
1253
-
1254
- a.icon-button {
1255
- cursor: var(--semantics-controls-link-cursor);
1256
- }
1257
-
1258
- @media (prefers-reduced-motion: reduce) {
1259
- .icon-button,
1260
- .icon-button__icon-area,
1261
- .icon-button__text {
1262
- transition: none;
1263
- }
1264
- }
1265
-
1266
- .icon-button:focus-visible {
1267
- outline: var(--semantics-focus-ring-outline);
1268
- outline-offset: var(--semantics-focus-ring-outline-offset);
1269
- box-shadow: var(--semantics-focus-ring-box-shadow), inset 0 0 0 var(--primitives-border-width-thin) var(--_icon-button-highlight-border-color);
1270
- }
1271
-
1272
- .icon-button:focus:not(:focus-visible) {
1273
- outline: none;
1274
- }
1275
-
1276
- @media (hover: hover) {
1277
- .icon-button:hover {
1278
- background-color: var(--_icon-button-is-hovered-background-color);
1279
- color: var(--_icon-button-is-hovered-primary-content-color);
1280
- --_icon-button-highlight-border-color: var(--_icon-button-is-hovered-highlight-border-color);
1281
- }
1282
- }
1283
-
1284
- .icon-button:active {
1285
- background-color: var(--_icon-button-is-active-background-color);
1286
- color: var(--_icon-button-is-active-primary-content-color);
1287
- --_icon-button-highlight-border-color: var(--_icon-button-is-active-highlight-border-color);
1288
- }
1289
-
1290
- /* Loading keeps the control focusable (not disabled); activation is blocked in JS. */
1291
- :host([loading]) .icon-button {
1292
- cursor: default;
1293
- }
1294
-
1295
-
1296
- /* # Elements */
1297
-
1298
- .icon-button__icon-area {
1299
- display: inline-flex;
1300
- flex-direction: row;
1301
- align-items: center;
1302
- justify-content: center;
1303
- transition: opacity var(--primitives-transition-duration-slow) var(--primitives-transition-easing-default);
1304
- }
1305
-
1306
- /* Loading crossfades the content out (opacity, not visibility, so the control
1307
- keeps its accessible name) while the indicator fades in. The content stays
1308
- laid out, so the control keeps its size. */
1309
- :host([loading]) .icon-button__icon-area {
1310
- opacity: 0;
1311
- }
1312
-
1313
- .icon-button__icon {
1314
- display: flex;
1315
- width: var(--_icon-button-size);
1316
- height: var(--_icon-button-size);
1317
- flex-shrink: 0;
1318
- align-items: center;
1319
- justify-content: center;
1320
- }
1321
-
1322
- .icon-button__disclosure-icon {
1323
- display: flex;
1324
- margin-right: var(--_icon-button-disclosure-icon-margin-right);
1325
- width: var(--_icon-button-disclosure-icon-size);
1326
- height: var(--_icon-button-disclosure-icon-size);
1327
- flex-shrink: 0;
1328
- }
1329
-
1330
- .icon-button__text {
1331
- display: var(--_icon-button-text-display);
1332
- text-align: center;
1333
- color: inherit;
1334
- font: var(--_icon-button-text-font);
1335
- white-space: nowrap;
1336
- transition: opacity var(--primitives-transition-duration-slow) var(--primitives-transition-easing-default);
1337
- }
1338
-
1339
- :host([loading]) .icon-button__text {
1340
- opacity: 0;
1341
- }
1342
-
1343
- /* Wrapper overlaid on the control, positioned against the host (which is
1344
- position:relative). It lives outside the <button>/<a> and the tooltip
1345
- wrapper so the indicator's role="status" live region works reliably. The
1346
- activity-indicator inside fills it and centers its circle, which inherits
1347
- the content color via currentColor. */
1348
- .icon-button__activity-indicator {
1349
- position: absolute;
1350
- inset: 0;
1351
- color: var(--_icon-button-primary-content-color);
1352
- }
1353
- `;
1354
- // src/components/content/tooltip/tooltip.styles.ts
1355
- var tooltipStyles = css`
1356
- :host {
1357
- box-sizing: border-box;
1358
- }
1359
-
1360
-
1361
- /* # Host */
1362
-
1363
- :host {
1364
- --_tooltip-hide-duration: var(--primitives-transition-duration-fast);
1365
- --_tooltip-show-duration: var(--primitives-transition-duration-fast);
1366
- --_tooltip-max-width: var(--primitives-area-280);
1367
- --_tooltip-z-index: 10000;
1368
- --_tooltip-show-delay: 700ms;
1369
- --_tooltip-box-shadow: var(--semantics-tooltips-box-shadow);
1370
- --_tooltip-background-color: var(--semantics-tooltips-background-color);
1371
- --_tooltip-content-color: var(--semantics-tooltips-content-color);
1372
- --_tooltip-shortcut-gap: var(--primitives-space-8);
1373
- --_tooltip-hide-delay: 50; /* unitless ms, read by JavaScript */
1374
- --_tooltip-offset: 4; /* px, unitless — read by JS */
1375
- --_tooltip-shift-padding: 8; /* px, unitless — read by JS */
1376
-
1377
- ${inheritedTextReset}
1378
- display: contents;
1379
- }
1380
-
1381
- :host([timing="instant"]) {
1382
- --_tooltip-hide-duration: 0s;
1383
- --_tooltip-show-duration: 0s;
1384
- }
1385
-
1386
- :host([hidden]) {
1387
- display: none;
1388
- }
1389
-
1390
-
1391
- /* # Block */
1392
-
1393
- /* A parent whose triggers sit close together sets
1394
- --context-tooltip-pointer-events to none, so a click on the tooltip
1395
- reaches the control underneath. Unset, the tooltip inherits as before. */
1396
- .tooltip {
1397
- pointer-events: var(--context-tooltip-pointer-events);
1398
- position: fixed;
1399
- opacity: 0;
1400
- margin: 0;
1401
- border: none;
1402
- background: none;
1403
- padding: 0;
1404
- transition:
1405
- opacity var(--_tooltip-hide-duration) ease,
1406
- display var(--_tooltip-hide-duration) allow-discrete,
1407
- overlay var(--_tooltip-hide-duration) allow-discrete;
1408
- }
1409
-
1410
- .tooltip:popover-open {
1411
- opacity: 1;
1412
- transition:
1413
- opacity var(--_tooltip-show-duration) ease,
1414
- display var(--_tooltip-show-duration) allow-discrete,
1415
- overlay var(--_tooltip-show-duration) allow-discrete;
1416
- }
1417
-
1418
- /* Stay invisible (no fade) until Floating UI has placed it, so the fade-in plays at
1419
- the final position rather than flashing at the popover's default spot. The
1420
- positioned attribute is set once _updatePosition writes the coordinates. */
1421
- .tooltip:popover-open:not([positioned]) {
1422
- /* visibility (like nldd-menu/nldd-popover) keeps the not-yet-placed tooltip out
1423
- of hit-testing at its stale default spot; opacity still drives the fade. */
1424
- visibility: hidden;
1425
- opacity: 0;
1426
- transition: none;
1427
- }
1428
-
1429
- @starting-style {
1430
- .tooltip:popover-open {
1431
- opacity: 0;
1432
- }
1433
- }
1434
-
1435
- @media (prefers-reduced-motion: reduce) {
1436
- .tooltip,
1437
- .tooltip.is-visible,
1438
- .tooltip.is-focus-visible {
1439
- transition: none;
1440
- }
1441
- }
1442
-
1443
-
1444
- /* ## Tooltip body */
1445
-
1446
- .tooltip__body {
1447
- display: flex;
1448
- border-radius: var(--semantics-tooltips-corner-radius);
1449
- box-shadow: var(--_tooltip-box-shadow);
1450
- background-color: var(--_tooltip-background-color);
1451
- width: max-content;
1452
- max-width: var(--_tooltip-max-width);
1453
- padding-block: var(--semantics-tooltips-padding-block);
1454
- padding-inline: var(--semantics-tooltips-padding-inline);
1455
- flex-wrap: wrap;
1456
- column-gap: var(--_tooltip-shortcut-gap);
1457
- align-items: baseline;
1458
- color: var(--_tooltip-content-color);
1459
- font: var(--semantics-tooltips-font);
1460
- overflow-wrap: break-word;
1461
- }
1462
-
1463
- .tooltip__text {
1464
- min-width: 0;
1465
- text-wrap: pretty;
1466
- }
1467
-
1468
- .tooltip__shortcut {
1469
- white-space: nowrap;
1470
- }
1471
-
1472
- @media (forced-colors: active) {
1473
- .tooltip__body {
1474
- border: 1px solid CanvasText;
1475
- }
1476
- }
1477
- `;
1478
- // src/components/content/tooltip/tooltip.template.ts
1479
- function tooltipTemplate(component) {
1480
- return html`
1481
- <slot
1482
- @mouseenter=${component._handleTriggerEnter}
1483
- @mouseleave=${component._handleTriggerLeave}
1484
- @focusin=${component._handleFocusIn}
1485
- @focusout=${component._handleFocusOut}
1486
- @click=${component._handleTriggerActivate}
1487
- ></slot>
1488
- <div class="tooltip"
1489
- popover="manual"
1490
- aria-hidden="true"
1491
- @mouseenter=${component._handleTooltipEnter}
1492
- @mouseleave=${component._handleTooltipLeave}
1493
- >
1494
- <div class="tooltip__body">
1495
- ${component.text ? html`<span class="tooltip__text">${component.text}</span>` : nothing}
1496
- ${hasShortcut(component) ? html`
1497
- <span class="tooltip__shortcut">
1498
- <nldd-keyboard-shortcut
1499
- size="inherit"
1500
- appearance="simple"
1501
- color="inherit"
1502
- keys=${component.shortcut || nothing}
1503
- mac-keys=${component.shortcutMac || nothing}
1504
- windows-keys=${component.shortcutWindows || nothing}
1505
- linux-keys=${component.shortcutLinux || nothing}
1506
- ></nldd-keyboard-shortcut>
1507
- </span>
1508
- ` : nothing}
1509
- </div>
1510
- </div>
1511
- `;
1512
- }
1513
- // src/utilities/carried-context.ts
1514
- /**
1515
- * The color scheme and language an element had in its place on the page,
1516
- * carried along when a component moves it somewhere else: a submenu into
1517
- * `<body>` for a drill-in, an overflow menu or sheet that lives in `<body>`, a
1518
- * notification into the shared area.
1519
- *
1520
- * Both inherit, so a moved element takes those of its new parent. A submenu
1521
- * from a dark section of the page turns light, and a screen reader reads an
1522
- * English menu with Dutch pronunciation. A theme needs nothing: it sits on
1523
- * `:root`, which is the same everywhere.
1524
- *
1525
- * Only what this helper wrote itself is ever overwritten or taken back: a
1526
- * `lang` or `color-scheme` set on the element by its author stays.
1527
- */
1528
- var carried = /* @__PURE__ */ new WeakMap();
1529
- /** The language of an element, looking past shadow roots to their hosts. */
1530
- function langOf(el) {
1531
- let node = el;
1532
- while (node) {
1533
- const owner = node.closest("[lang]");
1534
- if (owner) return owner.getAttribute("lang");
1535
- const root = node.getRootNode();
1536
- node = root instanceof ShadowRoot ? root.host : null;
1537
- }
1538
- return null;
1539
- }
1540
- /**
1541
- * Gives `element` the color scheme and language of `origin`. Call it each time
1542
- * the element shows, since the page around the origin may have changed.
1543
- *
1544
- * Reading the color scheme takes `getComputedStyle`, which recalculates the
1545
- * styles of the page when they are dirty. An element nobody sees, such as the
1546
- * hidden description of a tooltip, only needs the language: pass
1547
- * `{ scheme: false }` and nothing is recalculated.
1548
- */
1549
- function carryContext(element, origin, { scheme: withScheme = true } = {}) {
1550
- if (!origin?.isConnected) return;
1551
- const previous = carried.get(element) ?? {
1552
- scheme: null,
1553
- lang: null
1554
- };
1555
- const next = {
1556
- scheme: previous.scheme,
1557
- lang: previous.lang
1558
- };
1559
- const ownScheme = element.style.colorScheme;
1560
- if (withScheme && (!ownScheme || ownScheme === previous.scheme)) {
1561
- const scheme = getComputedStyle(origin).colorScheme;
1562
- if (scheme && scheme !== "normal") {
1563
- element.style.colorScheme = scheme;
1564
- next.scheme = element.style.colorScheme;
1565
- } else {
1566
- if (previous.scheme) element.style.removeProperty("color-scheme");
1567
- next.scheme = null;
1568
- }
1569
- }
1570
- const ownLang = element.getAttribute("lang");
1571
- if (ownLang === null || ownLang === previous.lang) {
1572
- const lang = langOf(origin);
1573
- if (lang) {
1574
- element.setAttribute("lang", lang);
1575
- next.lang = lang;
1576
- } else {
1577
- if (previous.lang) element.removeAttribute("lang");
1578
- next.lang = null;
1579
- }
1580
- }
1581
- carried.set(element, next);
1582
- }
1583
- /** Takes back what `carryContext` wrote, for an element returned to its place. */
1584
- function releaseContext(element) {
1585
- const previous = carried.get(element);
1586
- if (!previous) return;
1587
- if (previous.scheme && element.style.colorScheme === previous.scheme) element.style.removeProperty("color-scheme");
1588
- if (previous.lang && element.getAttribute("lang") === previous.lang) element.removeAttribute("lang");
1589
- carried.delete(element);
1590
- }
1591
- // src/components/content/tooltip/tooltip.ts
1592
- /**
1593
- * Nederlandse Digitale Dienst Tooltip Component (Lit + TypeScript)
1594
- *
1595
- * A wrapper that shows a tooltip on hover or focus of its child element. It
1596
- * uses `display: contents`, so it does not affect the child's layout.
1597
- *
1598
- * @element nldd-tooltip
1599
- * @attr {string} text - Tooltip text
1600
- * @attr {string} shortcut - Keyboard shortcut hint shown after the text, e.g. 'Cmd+P'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key. Joins the description of a light-DOM trigger. Hidden on touch-only devices, where it isn't invokable.
1601
- * @attr {string} shortcut-mac - Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`).
1602
- * @attr {string} shortcut-windows - Override of `shortcut` on Windows (falls back to `shortcut`).
1603
- * @attr {string} shortcut-linux - Override of `shortcut` on Linux (falls back to `shortcut`).
1604
- * @attr {boolean} open - Forces the tooltip visible, whatever hover or focus does. Use it for programmatic feedback ("Copied", for instance). Reset it to false to restore the hover behavior.
1605
- * @attr {string} placement - Position: 'top' | 'bottom' | 'left' | 'right' (default: 'bottom'; automatically 'top' on touch devices)
1606
- * @attr {string} timing - When the tooltip appears on hover: 'instant' — right away, without a show delay or a fade, also on the way out. 'delay' (the default) — after the standard show delay (700ms). 'never' — the tooltip is never shown; hover and focus events are ignored, aria-describedby is suppressed, and a tooltip that is already visible disappears. The hide delay and the touch suppression stay in force under every value. A focus trigger is always instant.
1607
- *
1608
- * Escape closes a tooltip that hover or focus opened, wherever focus is: the
1609
- * pointer can rest on a button while focus sits somewhere else (WCAG 1.4.13).
1610
- * That press closes the tooltip only. A dialog, sheet or menu around it stays
1611
- * open and takes the next one. The tooltip takes the key in the capture phase
1612
- * on `document` and stops it there, so a handler of your own for Escape does
1613
- * not hear that press either.
1614
- *
1615
- * @slot - The element the tooltip is shown for
1616
- *
1617
- * @fires nldd-tooltip-dismiss - When a user presses Escape while `open=true`.
1618
- * The consumer owns the open lifecycle from there (we cannot clear `open`
1619
- * on our own), so this event is the consumer's chance to set `open` back to
1620
- * `false`. WCAG 1.4.13: a persistent hover or focus overlay has to be
1621
- * dismissible without moving focus.
1622
- *
1623
- * @note A parent whose triggers sit close together, such as nldd-swatch-picker,
1624
- * can set `--context-tooltip-pointer-events: none` on the trigger. A click on
1625
- * the tooltip then reaches the control underneath instead of selecting the
1626
- * trigger, and the pointer cannot rest on the tooltip itself.
1627
- *
1628
- * @note It renders through the native Popover API (`popover="manual"`) in the
1629
- * top layer. That escapes every ancestor stacking context and `overflow:
1630
- * hidden` clipping, so no more z-index fights with overlay containers, panes
1631
- * or transform containers. Positioning still goes through Floating UI with
1632
- * `strategy: 'fixed'`.
1633
- *
1634
- * @note aria-describedby only works when the trigger element is in the light
1635
- * DOM. With a web component as the trigger (with a shadow DOM of its own) the
1636
- * link is a known shadow DOM plus ARIA limitation. For nldd-icon-button that
1637
- * does not matter, because aria-label already sits on the inner button. Tooltip
1638
- * text on an icon-button must therefore hold nothing that aria-label does not
1639
- * already say.
1640
- *
1641
- * @note With a disabled trigger (a disabled nldd-icon-button, for instance) the
1642
- * tooltip is not shown, because disabled buttons fire no mouseenter or focusin
1643
- * and `display: contents` has no layout box of its own to catch events on.
1644
- */
1645
- var _NLDDTooltip;
1646
- var tooltipCounter = 0;
1647
- var coarsePointerQuery = matchMedia("(pointer: coarse)");
1648
- var DEFAULT_SHOW_DELAY_MS = 700;
1649
- var DEFAULT_HIDE_DELAY_MS = 50;
1650
- var NLDDTooltip = (_NLDDTooltip = class NLDDTooltip extends LitElement {
1651
- constructor(..._args) {
1652
- super(..._args);
1653
- this.text = "";
1654
- this.shortcut = "";
1655
- this.shortcutMac = "";
1656
- this.shortcutWindows = "";
1657
- this.shortcutLinux = "";
1658
- this.open = false;
1659
- this.placement = "bottom";
1660
- this.timing = "delay";
1661
- this._visible = false;
1662
- this._tooltipId = `nldd-tooltip-${++tooltipCounter}`;
1663
- this._hideTimeout = null;
1664
- this._showTimeout = null;
1665
- this._descriptionEl = null;
1666
- this._currentTrigger = null;
1667
- this._boundSlotChange = () => this._syncAriaDescribedBy();
1668
- this._shortcutAvailability = new ShortcutAvailabilityController(this, () => this._syncAriaDescribedBy());
1669
- this._positionVersion = 0;
1670
- this._shownByHover = false;
1671
- this._handleScroll = () => {
1672
- if (this.open || !this._shownByHover) {
1673
- this._updatePosition();
1674
- return;
1675
- }
1676
- if (this._hideTimeout) {
1677
- clearTimeout(this._hideTimeout);
1678
- this._hideTimeout = null;
1679
- }
1680
- this._visible = false;
1681
- };
1682
- this._handleKeyDown = (e) => {
1683
- if (e.key !== "Escape" || !this._visible) return;
1684
- if (this.open) {
1685
- if (!e.composedPath().includes(this)) return;
1686
- this.dispatchEvent(new CustomEvent("nldd-tooltip-dismiss", {
1687
- bubbles: true,
1688
- composed: true
1689
- }));
1690
- e.preventDefault();
1691
- e.stopPropagation();
1692
- return;
1693
- }
1694
- this._visible = false;
1695
- e.preventDefault();
1696
- e.stopPropagation();
1697
- };
1698
- }
1699
- get _effectivePlacement() {
1700
- return this.placement;
1701
- }
1702
- connectedCallback() {
1703
- super.connectedCallback();
1704
- if (this._visible) {
1705
- document.addEventListener("keydown", this._handleKeyDown, true);
1706
- document.addEventListener("scroll", this._handleScroll, {
1707
- capture: true,
1708
- passive: true
1709
- });
1710
- }
1711
- if (this.hasUpdated) this.shadowRoot?.querySelector("slot")?.addEventListener("slotchange", this._boundSlotChange);
1712
- }
1713
- firstUpdated() {
1714
- this.shadowRoot?.querySelector("slot")?.addEventListener("slotchange", this._boundSlotChange);
1715
- }
1716
- updated(changed) {
1717
- if (changed.has("open")) {
1718
- if (this.open) {
1719
- if (this._hideTimeout) {
1720
- clearTimeout(this._hideTimeout);
1721
- this._hideTimeout = null;
1722
- }
1723
- if (this._showTimeout) {
1724
- clearTimeout(this._showTimeout);
1725
- this._showTimeout = null;
1726
- }
1727
- this._shownByHover = false;
1728
- this._visible = true;
1729
- } else if (this._visible) this._visible = false;
1730
- }
1731
- if (changed.has("_visible")) {
1732
- if (this._visible) {
1733
- document.addEventListener("keydown", this._handleKeyDown, true);
1734
- document.addEventListener("scroll", this._handleScroll, {
1735
- capture: true,
1736
- passive: true
1737
- });
1738
- } else {
1739
- document.removeEventListener("keydown", this._handleKeyDown, true);
1740
- document.removeEventListener("scroll", this._handleScroll, { capture: true });
1741
- }
1742
- const tooltip = this._getTooltipElement();
1743
- if (tooltip) {
1744
- if (this._visible) {
1745
- if (!tooltip.matches(":popover-open")) {
1746
- tooltip.removeAttribute("positioned");
1747
- tooltip.showPopover();
1748
- }
1749
- this._updatePosition();
1750
- } else if (tooltip.matches(":popover-open")) tooltip.hidePopover();
1751
- }
1752
- }
1753
- if (changed.has("text") || changed.has("timing") || changed.has("shortcut") || changed.has("shortcutMac") || changed.has("shortcutWindows") || changed.has("shortcutLinux")) this._syncAriaDescribedBy();
1754
- if (changed.has("text") && this._visible) this._updatePosition();
1755
- if (changed.has("timing") && this.timing === "never") {
1756
- if (this._showTimeout) {
1757
- clearTimeout(this._showTimeout);
1758
- this._showTimeout = null;
1759
- }
1760
- if (this._visible) this._visible = false;
1761
- }
1762
- }
1763
- _syncAriaDescribedBy() {
1764
- const trigger = this._getTriggerElement();
1765
- if (this._currentTrigger && this._currentTrigger !== trigger) this._currentTrigger.removeAttribute("aria-describedby");
1766
- this._currentTrigger = trigger;
1767
- if (!trigger) return;
1768
- if (trigger.getRootNode() !== document) return;
1769
- const description = [this.text, shortcutLabel(this)].filter(Boolean).join(" ");
1770
- if (description && this.timing !== "never") {
1771
- if (!this._descriptionEl) {
1772
- this._descriptionEl = document.createElement("span");
1773
- this._descriptionEl.id = this._tooltipId;
1774
- Object.assign(this._descriptionEl.style, {
1775
- position: "absolute",
1776
- top: "0",
1777
- left: "0",
1778
- width: "1px",
1779
- height: "1px",
1780
- overflow: "hidden",
1781
- clipPath: "inset(50%)",
1782
- whiteSpace: "nowrap"
1783
- });
1784
- document.body.appendChild(this._descriptionEl);
1785
- }
1786
- carryContext(this._descriptionEl, this, { scheme: false });
1787
- if (this._descriptionEl.textContent !== description) this._descriptionEl.textContent = description;
1788
- if (trigger.getAttribute("aria-describedby") !== this._tooltipId) trigger.setAttribute("aria-describedby", this._tooltipId);
1789
- } else {
1790
- trigger.removeAttribute("aria-describedby");
1791
- this._descriptionEl?.remove();
1792
- this._descriptionEl = null;
1793
- }
1794
- }
1795
- _getTriggerElement() {
1796
- return ((this.shadowRoot?.querySelector("slot"))?.assignedElements({ flatten: true }))?.[0] ?? null;
1797
- }
1798
- _getTooltipElement() {
1799
- return this.shadowRoot?.querySelector(".tooltip") ?? null;
1800
- }
1801
- /** Whether there is anything to show: the text, or a shortcut on a device
1802
- * that shows one. */
1803
- get _hasContent() {
1804
- return Boolean(this.text || shortcutLabel(this));
1805
- }
1806
- _handleTriggerEnter() {
1807
- if (this.timing === "never") return;
1808
- this._syncAriaDescribedBy();
1809
- if (!this._hasContent) return;
1810
- if (coarsePointerQuery.matches) return;
1811
- if (this._hideTimeout) {
1812
- clearTimeout(this._hideTimeout);
1813
- this._hideTimeout = null;
1814
- }
1815
- if (this._showTimeout) clearTimeout(this._showTimeout);
1816
- if (this.timing === "instant") {
1817
- this._showTimeout = null;
1818
- this._shownByHover = !this._visible || this._shownByHover;
1819
- this._visible = true;
1820
- return;
1821
- }
1822
- const parsedShow = parseInt(getComputedStyle(this).getPropertyValue("--_tooltip-show-delay"), 10);
1823
- const showDelay = Number.isFinite(parsedShow) ? parsedShow : DEFAULT_SHOW_DELAY_MS;
1824
- this._showTimeout = setTimeout(() => {
1825
- this._showTimeout = null;
1826
- this._shownByHover = !this._visible || this._shownByHover;
1827
- this._visible = true;
1828
- }, showDelay);
1829
- }
1830
- _handleFocusIn() {
1831
- if (this.timing === "never") return;
1832
- this._syncAriaDescribedBy();
1833
- if (!this._hasContent) return;
1834
- if (isTouchMode()) return;
1835
- if (this._hideTimeout) {
1836
- clearTimeout(this._hideTimeout);
1837
- this._hideTimeout = null;
1838
- }
1839
- if (this._showTimeout) {
1840
- clearTimeout(this._showTimeout);
1841
- this._showTimeout = null;
1842
- }
1843
- this._shownByHover = false;
1844
- this._visible = true;
1845
- }
1846
- _handleTriggerLeave() {
1847
- if (this._showTimeout) {
1848
- clearTimeout(this._showTimeout);
1849
- this._showTimeout = null;
1850
- }
1851
- if (this.open) return;
1852
- if (this._hideTimeout) clearTimeout(this._hideTimeout);
1853
- const parsedHide = parseInt(getComputedStyle(this).getPropertyValue("--_tooltip-hide-delay"), 10);
1854
- const hideDelay = Number.isFinite(parsedHide) ? parsedHide : DEFAULT_HIDE_DELAY_MS;
1855
- this._hideTimeout = setTimeout(() => {
1856
- this._visible = false;
1857
- this._hideTimeout = null;
1858
- }, hideDelay);
1859
- }
1860
- /** Focus guard checks one shadow root level deep for composite triggers. */
1861
- _handleFocusOut(e) {
1862
- const assigned = (this.shadowRoot?.querySelector("slot"))?.assignedElements({ flatten: true }) ?? [];
1863
- const related = e.relatedTarget;
1864
- if (!(related && assigned.some((el) => el.contains(related) || el.shadowRoot?.contains(related)))) this._handleTriggerLeave();
1865
- }
1866
- _handleTriggerActivate() {
1867
- if (this.open) return;
1868
- if (this._showTimeout) {
1869
- clearTimeout(this._showTimeout);
1870
- this._showTimeout = null;
1871
- }
1872
- if (this._hideTimeout) {
1873
- clearTimeout(this._hideTimeout);
1874
- this._hideTimeout = null;
1875
- }
1876
- this._visible = false;
1877
- }
1878
- _handleTooltipEnter() {
1879
- if (this._hideTimeout) {
1880
- clearTimeout(this._hideTimeout);
1881
- this._hideTimeout = null;
1882
- }
1883
- }
1884
- _handleTooltipLeave() {
1885
- this._handleTriggerLeave();
1886
- }
1887
- async _updatePosition() {
1888
- const version = ++this._positionVersion;
1889
- const trigger = this._getTriggerElement();
1890
- const tooltip = this._getTooltipElement();
1891
- if (!trigger || !tooltip) {
1892
- tooltip?.setAttribute("positioned", "");
1893
- return;
1894
- }
1895
- if (document.fonts?.status !== "loaded") {
1896
- await document.fonts?.ready;
1897
- if (version !== this._positionVersion) return;
1898
- }
1899
- const styles = getComputedStyle(this);
1900
- const gap = parseInt(styles.getPropertyValue("--_tooltip-offset"), 10);
1901
- const fingertip = parseFloat(styles.getPropertyValue("--context-tooltip-fingertip-size"));
1902
- const distance = coarsePointerQuery.matches && Number.isFinite(fingertip) ? ({ placement, rects }) => {
1903
- const across = /^(top|bottom)/.test(placement) ? rects.reference.height : rects.reference.width;
1904
- return Math.max(gap, (fingertip - across) / 2);
1905
- } : gap;
1906
- const { x, y } = await computePosition(trigger, tooltip, {
1907
- placement: this._effectivePlacement,
1908
- strategy: "fixed",
1909
- middleware: [
1910
- offset(distance),
1911
- flip(),
1912
- shift({ padding: parseInt(styles.getPropertyValue("--_tooltip-shift-padding"), 10) })
1913
- ]
1914
- });
1915
- if (version !== this._positionVersion) return;
1916
- tooltip.style.left = `${x}px`;
1917
- tooltip.style.top = `${y}px`;
1918
- tooltip.setAttribute("positioned", "");
1919
- }
1920
- disconnectedCallback() {
1921
- super.disconnectedCallback();
1922
- document.removeEventListener("keydown", this._handleKeyDown, true);
1923
- document.removeEventListener("scroll", this._handleScroll, { capture: true });
1924
- this.shadowRoot?.querySelector("slot")?.removeEventListener("slotchange", this._boundSlotChange);
1925
- if (this._hideTimeout) {
1926
- clearTimeout(this._hideTimeout);
1927
- this._hideTimeout = null;
1928
- }
1929
- if (this._showTimeout) {
1930
- clearTimeout(this._showTimeout);
1931
- this._showTimeout = null;
1932
- }
1933
- this._currentTrigger?.removeAttribute("aria-describedby");
1934
- this._currentTrigger = null;
1935
- this._descriptionEl?.remove();
1936
- this._descriptionEl = null;
1937
- }
1938
- render() {
1939
- return tooltipTemplate(this);
1940
- }
1941
- }, _NLDDTooltip.styles = tooltipStyles, _NLDDTooltip);
1942
- __decorate([property({
1943
- reflect: true,
1944
- converter: reflectNonDefault("")
1945
- })], NLDDTooltip.prototype, "text", void 0);
1946
- __decorate([property({
1947
- reflect: true,
1948
- converter: reflectNonDefault("")
1949
- })], NLDDTooltip.prototype, "shortcut", void 0);
1950
- __decorate([property({
1951
- reflect: true,
1952
- attribute: "shortcut-mac",
1953
- converter: reflectNonDefault("")
1954
- })], NLDDTooltip.prototype, "shortcutMac", void 0);
1955
- __decorate([property({
1956
- reflect: true,
1957
- attribute: "shortcut-windows",
1958
- converter: reflectNonDefault("")
1959
- })], NLDDTooltip.prototype, "shortcutWindows", void 0);
1960
- __decorate([property({
1961
- reflect: true,
1962
- attribute: "shortcut-linux",
1963
- converter: reflectNonDefault("")
1964
- })], NLDDTooltip.prototype, "shortcutLinux", void 0);
1965
- __decorate([property({
1966
- type: Boolean,
1967
- reflect: true
1968
- })], NLDDTooltip.prototype, "open", void 0);
1969
- __decorate([property({
1970
- reflect: true,
1971
- converter: reflectNonDefault("bottom")
1972
- })], NLDDTooltip.prototype, "placement", void 0);
1973
- __decorate([property({
1974
- reflect: true,
1975
- converter: reflectNonDefault("delay")
1976
- })], NLDDTooltip.prototype, "timing", void 0);
1977
- __decorate([state()], NLDDTooltip.prototype, "_visible", void 0);
1978
- NLDDTooltip = __decorate([customElement("nldd-tooltip")], NLDDTooltip);
1979
- // src/components/actions/icon-button/icon-button.template.ts
1980
- function renderContent(component) {
1981
- return html`
1982
- <span class="icon-button__icon-area">
1983
- <span class="icon-button__icon">
1984
- ${component.icon ? html`<nldd-icon icon=${component.icon}></nldd-icon>` : html`<slot name="icon" @slotchange=${component._onIconSlotChange}>
1985
- <nldd-icon icon="icon-placeholder"></nldd-icon>
1986
- </slot>`}
1987
- </span>
1988
- ${component.expandable ? html`
1989
- <span class="icon-button__disclosure-icon">
1990
- <nldd-icon icon="chevron-down-small"></nldd-icon>
1991
- </span>
1992
- ` : nothing}
1993
- </span>
1994
- ${component.text ? html`
1995
- <span class="icon-button__text">${component.text}</span>
1996
- ` : ""}
1997
- `;
1998
- }
1999
- function template() {
2000
- const hintKey = downloadLinkHintKey(this.href, this.target, this.download);
2001
- if (this.href) markDownloadTarget(this, this.download, this.target);
2002
- const linkHint = hintKey ? this._t(`components.icon-button.${hintKey}`) : "";
2003
- const label = [[this.accessibleLabel || this.text, shortcutLabel(this)].filter(Boolean).join(" "), linkHint].filter(Boolean).join(", ") || nothing;
2004
- const content = renderContent(this);
2005
- const tooltipText = this.accessibleLabel || (this.size !== "lg" || this.hideLgText ? this.text : "");
2006
- const ariaExpanded = this.expandable || !!this.popupType ? String(this.expanded) : this.expanded ? "true" : nothing;
2007
- const ariaBusy = this.loading ? "true" : nothing;
2008
- const loadingSize = this.size === "xs" ? "16" : this.size === "sm" ? "20" : this.size === "lg" ? "28" : "24";
2009
- const loadingIndicator = this.loading ? html`
2010
- <div class="icon-button__activity-indicator">
2011
- <nldd-activity-indicator
2012
- timing="instant"
2013
- size=${loadingSize}
2014
- text=${this.loadingText || nothing}
2015
- ></nldd-activity-indicator>
2016
- </div>
2017
- ` : nothing;
2018
- const renderButton = () => {
2019
- if (this.href) {
2020
- const resolvedRel = linkRel(this.rel, this.target);
2021
- return html`
2022
- <a class="icon-button"
2023
- href=${this.href}
2024
- target=${this.target || nothing}
2025
- rel=${resolvedRel || nothing}
2026
- download=${this.download ?? nothing}
2027
- aria-disabled=${this.disabled ? "true" : nothing}
2028
- aria-label=${label}
2029
- aria-haspopup=${this.popupType || nothing}
2030
- aria-expanded=${ariaExpanded}
2031
- aria-busy=${ariaBusy}
2032
- tabindex=${this.noTab ? "-1" : nothing}
2033
- @pointerdown=${this._popup.handlePointerdown}
2034
- @click=${this._handleClick}
2035
- >
2036
- ${content}
2037
- </a>
2038
- `;
2039
- }
2040
- return html`
2041
- <button class="icon-button"
2042
- type=${this.type}
2043
- ?disabled=${this.disabled}
2044
- aria-disabled=${this.disabled ? "true" : nothing}
2045
- aria-label=${label}
2046
- aria-haspopup=${this.popupType || nothing}
2047
- aria-expanded=${ariaExpanded}
2048
- aria-busy=${ariaBusy}
2049
- tabindex=${this.noTab ? "-1" : nothing}
2050
- .popoverTargetElement=${popoverTargetOf(this, this.popovertarget, this.popoverTargetElement)}
2051
- .popoverTargetAction=${this.popoverTargetAction}
2052
- @pointerdown=${this._popup.handlePointerdown}
2053
- @click=${this._handleClick}
2054
- >
2055
- ${content}
2056
- </button>
2057
- `;
2058
- };
2059
- const control = (tooltipText || hasShortcut(this)) && this.tooltipTiming !== "never" ? html`
2060
- <nldd-tooltip
2061
- text=${tooltipText || nothing}
2062
- timing=${this.tooltipTiming}
2063
- shortcut=${this.shortcut || nothing}
2064
- shortcut-mac=${this.shortcutMac || nothing}
2065
- shortcut-windows=${this.shortcutWindows || nothing}
2066
- shortcut-linux=${this.shortcutLinux || nothing}
2067
- >
2068
- ${renderButton()}
2069
- </nldd-tooltip>
2070
- ` : renderButton();
2071
- const popupSlot = html`<slot name="popup" @slotchange=${this._popup.handleSlotChange}></slot>`;
2072
- return html`${control}${loadingIndicator}${popupSlot}`;
2073
- }
2074
- // src/components/actions/icon-button/icon-button.ts
2075
- /**
2076
- * Nederlandse Digitale Dienst Icon Button Component (Lit + TypeScript)
2077
- *
2078
- * @element nldd-icon-button
2079
- * @attr {string} appearance - Visual style, color included: 'accent-filled' | 'accent-transparent' | 'neutral-tinted' | 'neutral-transparent' | 'critical-tinted' | 'critical-transparent' | 'inherit-filled' | 'inherit-tinted' | 'primary' | 'secondary' | 'destructive'. The inherit appearances derive their colors from currentColor, for buttons on colored surfaces.
2080
- * @attr {string} size - Button size: 'xs' | 'sm' | 'md' | 'lg' (default: 'md')
2081
- * @attr {boolean} hide-lg-text - In lg size, hides the text label and enlarges the icon by one step (28px)
2082
- * @attr {boolean} no-highlight-border - Removes the per-appearance highlight border (e.g. when a control group draws a single border instead).
2083
- * @attr {boolean} loading - Loading state (default: false). Shows an activity indicator over the visually hidden icon, sets aria-busy on the inner control and blocks activation, without dropping the button from the tab order (unlike disabled). Meant for an action that has to wait for the server, such as sending an application. For most actions, show the result right away and confirm in the background, as the design guidelines describe.
2084
- * @attr {string} loading-text - What the screen reader announces while `loading` is on, for a button that does more than load: "Aan het bewaren". Leave it out and the activity indicator says its translated "Laden".
2085
- * @attr {boolean} disabled - Disabled state. Avoid it: let the action run and say afterwards what is missing; the design guidelines say why.
2086
- * @attr {boolean} no-tab - Takes the button out of the tab order (tabindex="-1"), for a control owned by a roving container (an nldd-token in nldd-token-field, a button in a row of an nldd-list) that manages focus itself. Still mouse- and script-focusable.
2087
- * @attr {string} type - Button type for form submission: 'button' | 'submit' | 'reset' (ignored when href is set)
2088
- * @attr {boolean} expandable - Whether the button opens a menu or popover and shows chevron next to the icon
2089
- * @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
2090
- * @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
2091
- * @attr {string} width - Width mode: 'full' (stretches to container) or any CSS length (e.g. '240px')
2092
- * @attr {string} text - Button text, used as aria-label and shown below the icon in lg size
2093
- * @attr {string} icon - Icon name for the nldd-icon element. Defaults to a placeholder icon when neither this attribute nor the icon slot is set.
2094
- * @attr {string} accessible-label - Accessible label for screen readers. Overrides text as aria-label and title tooltip. Use when the visible text alone lacks context for screen readers (e.g. text "Toon", accessible-label "Toon wachtwoord"). The text is still shown visually in lg size regardless.
2095
- * @attr {string} tooltip-timing - Forwarded to the inner nldd-tooltip's `timing`: 'delay' (the default, a 700 ms show-delay), 'instant', or 'never' (suppress the visual tooltip; screen readers still get the aria-label). Use 'never' when the surrounding context already explains the button (e.g. spin buttons in nldd-number-field, the chevron in nldd-split-button).
2096
- * @attr {string} shortcut - Keyboard shortcut hint shown in the tooltip after the text, e.g. 'Alt+P'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key, wire up the handling in your app. Part of the accessible name ("Presentatiemodus Alt P"), as in nldd-menu-item. Hidden on touch-only devices, where it isn't invokable.
2097
- * @attr {string} shortcut-mac - Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`).
2098
- * @attr {string} shortcut-windows - Override of `shortcut` on Windows (falls back to `shortcut`).
2099
- * @attr {string} shortcut-linux - Override of `shortcut` on Linux (falls back to `shortcut`).
2100
- * @attr {string} href - When set, renders an <a> element instead of <button>
2101
- * @attr {string} target - Link target (e.g. '_blank'); only used when href is set. With '_blank' the "opens in new tab" announcement is folded into the aria-label for screen readers (WCAG 2.1 SC 3.2.2). An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off.
2102
- * @attr {string} download - Saves the file the link points at instead of opening it; only used with href. Without a value the browser takes the name from the URL, with one that is the file name. A browser ignores it for a URL on another origin and opens the file there. Adds a visually hidden "downloadt bestand" for screen readers. Leave `target` off: a download opens no tab.
2103
- * @attr {string} rel - Link rel attribute, used with href; with target '_blank', 'noopener noreferrer' is added to whatever you set
2104
- * @attr {object} translations - Override translation keys (e.g. the "opens in new tab" announcement); unset keys fall back to Dutch.
2105
- * @attr {string} popovertarget - ID of a popover element to toggle, looked up in the tree of this button; the inner <button> gets the element. An nldd-menu or nldd-popover it points at is also positioned against this control, so it needs no `anchor`.
2106
- *
2107
- * @slot icon - Slot for a custom icon (e.g. custom SVG). Only used when icon attribute is not set; falls back to a placeholder icon when the slot is empty.
2108
- * @slot popup - A single `nldd-menu` or `nldd-popover` this button invokes. Slotting it auto-anchors the overlay to the button and toggles it on click (no id/anchor wiring). The overlay syncs `expanded` and `aria-haspopup` back onto the button. Add `expandable` for the disclosure chevron. Mirrors nldd-split-button; manual `popovertarget` wiring keeps working without a slotted overlay.
2109
- *
2110
- * @example
2111
- * ```html
2112
- * <nldd-icon-button
2113
- * href="/aanvraag-a-1042.pdf"
2114
- * download
2115
- * text="Download"
2116
- * icon="download"
2117
- * ></nldd-icon-button>
2118
- * ```
2119
- *
2120
- * @fires click - When button is clicked (not fired when disabled)
2121
- */
2122
- var _NLDDIconButton = class NLDDIconButton extends withTranslations(LitElement, nlddIconButtonTranslations) {
2123
- constructor(..._args) {
2124
- super(..._args);
2125
- this._internals = internalsOf(this);
2126
- this.appearance = "neutral-tinted";
2127
- this.size = "md";
2128
- this.hideLgText = false;
2129
- this.loading = false;
2130
- this.loadingText = "";
2131
- this.disabled = false;
2132
- this.noHighlightBorder = false;
2133
- this.type = "button";
2134
- this.expandable = false;
2135
- this.expanded = false;
2136
- this.noTab = false;
2137
- this.width = "";
2138
- this.popovertarget = void 0;
2139
- this.popoverTargetElement = null;
2140
- this.popoverTargetAction = "toggle";
2141
- this.text = "";
2142
- this.icon = "";
2143
- this.accessibleLabel = "";
2144
- this.tooltipTiming = "delay";
2145
- this.shortcut = "";
2146
- this.shortcutMac = "";
2147
- this.shortcutWindows = "";
2148
- this.shortcutLinux = "";
2149
- this.href = void 0;
2150
- this.target = void 0;
2151
- this.download = void 0;
2152
- this.rel = void 0;
2153
- this._popup = new PopupAnchorController(this);
2154
- this._shortcutAvailability = new ShortcutAvailabilityController(this);
2155
- }
2156
- /** Whether an icon is present via attribute or slot. */
2157
- get _hasIcon() {
2158
- if (this.icon) return true;
2159
- return ((this.shadowRoot?.querySelector("slot[name=\"icon\"]"))?.assignedElements().length ?? 0) > 0;
2160
- }
2161
- disconnectedCallback() {
2162
- super.disconnectedCallback();
2163
- anchorPopoverTarget(this, null);
2164
- }
2165
- updated(changedProperties) {
2166
- anchorPopoverTarget(this, popoverTargetOf(this, this.popovertarget, this.popoverTargetElement));
2167
- if (changedProperties.has("width")) {
2168
- const w = this.width;
2169
- const isFull = w === "full";
2170
- const isValidLength = !!w && !isFull && CSS.supports("width", w);
2171
- this.style.width = isValidLength ? w : "";
2172
- if (isFull || isValidLength) this.style.setProperty("--_icon-button-width", "100%");
2173
- else this.style.removeProperty("--_icon-button-width");
2174
- }
2175
- }
2176
- _handleClick(e) {
2177
- if (this.disabled || this.loading) {
2178
- e.preventDefault();
2179
- e.stopPropagation();
2180
- return;
2181
- }
2182
- if (e.currentTarget instanceof HTMLButtonElement) {
2183
- e.currentTarget.popoverTargetElement = popoverTargetOf(this, this.popovertarget, this.popoverTargetElement);
2184
- anchorPopoverTarget(this, e.currentTarget.popoverTargetElement);
2185
- }
2186
- if (this._popup.handleClick(e)) {
2187
- e.preventDefault();
2188
- return;
2189
- }
2190
- if (this.href) return;
2191
- if (this.type === "submit") this._internals.form?.requestSubmit();
2192
- else if (this.type === "reset") this._internals.form?.reset();
2193
- }
2194
- /**
2195
- * Delegates focus to the inner `<button>` (or `<a>` when `href` is set), so
2196
- * consumers can call `iconButtonEl.focus()` without reaching into shadow DOM.
2197
- */
2198
- focus(options) {
2199
- if (deferFocus(this, options)) return;
2200
- this.shadowRoot?.querySelector(".icon-button")?.focus(options);
2201
- }
2202
- _onIconSlotChange() {
2203
- this.requestUpdate();
2204
- }
2205
- render() {
2206
- return template.call(this);
2207
- }
2208
- };
2209
- var NLDDIconButton = (_NLDDIconButton.styles = iconButtonStyles, _NLDDIconButton.formAssociated = true, _NLDDIconButton);
2210
- __decorate([property({
2211
- reflect: true,
2212
- converter: reflectNonDefault("neutral-tinted")
2213
- })], NLDDIconButton.prototype, "appearance", void 0);
2214
- __decorate([property({
2215
- reflect: true,
2216
- converter: reflectNonDefault("md")
2217
- })], NLDDIconButton.prototype, "size", void 0);
2218
- __decorate([property({
2219
- type: Boolean,
2220
- reflect: true,
2221
- attribute: "hide-lg-text"
2222
- })], NLDDIconButton.prototype, "hideLgText", void 0);
2223
- __decorate([property({
2224
- type: Boolean,
2225
- reflect: true
2226
- })], NLDDIconButton.prototype, "loading", void 0);
2227
- __decorate([property({ attribute: "loading-text" })], NLDDIconButton.prototype, "loadingText", void 0);
2228
- __decorate([property({
2229
- type: Boolean,
2230
- reflect: true
2231
- })], NLDDIconButton.prototype, "disabled", void 0);
2232
- __decorate([property({
2233
- type: Boolean,
2234
- reflect: true,
2235
- attribute: "no-highlight-border"
2236
- })], NLDDIconButton.prototype, "noHighlightBorder", void 0);
2237
- __decorate([property({
2238
- type: String,
2239
- reflect: true
2240
- })], NLDDIconButton.prototype, "type", void 0);
2241
- __decorate([property({
2242
- type: Boolean,
2243
- reflect: true,
2244
- attribute: "expandable"
2245
- })], NLDDIconButton.prototype, "expandable", void 0);
2246
- __decorate([property({
2247
- type: Boolean,
2248
- reflect: true
2249
- })], NLDDIconButton.prototype, "expanded", void 0);
2250
- __decorate([property({
2251
- type: Boolean,
2252
- reflect: true,
2253
- attribute: "no-tab"
2254
- })], NLDDIconButton.prototype, "noTab", void 0);
2255
- __decorate([property({
2256
- type: String,
2257
- reflect: true,
2258
- attribute: "popup-type"
2259
- })], NLDDIconButton.prototype, "popupType", void 0);
2260
- __decorate([property({
2261
- reflect: true,
2262
- converter: reflectNonDefault("")
2263
- })], NLDDIconButton.prototype, "width", void 0);
2264
- __decorate([property({ type: String })], NLDDIconButton.prototype, "popovertarget", void 0);
2265
- __decorate([property({ attribute: false })], NLDDIconButton.prototype, "popoverTargetElement", void 0);
2266
- __decorate([property({ attribute: false })], NLDDIconButton.prototype, "popoverTargetAction", void 0);
2267
- __decorate([property({
2268
- reflect: true,
2269
- converter: reflectNonDefault("")
2270
- })], NLDDIconButton.prototype, "text", void 0);
2271
- __decorate([property({ type: String })], NLDDIconButton.prototype, "icon", void 0);
2272
- __decorate([property({
2273
- type: String,
2274
- attribute: "accessible-label"
2275
- })], NLDDIconButton.prototype, "accessibleLabel", void 0);
2276
- __decorate([property({
2277
- reflect: true,
2278
- attribute: "tooltip-timing",
2279
- converter: reflectNonDefault("delay")
2280
- })], NLDDIconButton.prototype, "tooltipTiming", void 0);
2281
- __decorate([property({
2282
- reflect: true,
2283
- converter: reflectNonDefault("")
2284
- })], NLDDIconButton.prototype, "shortcut", void 0);
2285
- __decorate([property({
2286
- reflect: true,
2287
- attribute: "shortcut-mac",
2288
- converter: reflectNonDefault("")
2289
- })], NLDDIconButton.prototype, "shortcutMac", void 0);
2290
- __decorate([property({
2291
- reflect: true,
2292
- attribute: "shortcut-windows",
2293
- converter: reflectNonDefault("")
2294
- })], NLDDIconButton.prototype, "shortcutWindows", void 0);
2295
- __decorate([property({
2296
- reflect: true,
2297
- attribute: "shortcut-linux",
2298
- converter: reflectNonDefault("")
2299
- })], NLDDIconButton.prototype, "shortcutLinux", void 0);
2300
- __decorate([property({
2301
- type: String,
2302
- reflect: true
2303
- })], NLDDIconButton.prototype, "href", void 0);
2304
- __decorate([property({ type: String })], NLDDIconButton.prototype, "target", void 0);
2305
- __decorate([property({ type: String })], NLDDIconButton.prototype, "download", void 0);
2306
- __decorate([property({ type: String })], NLDDIconButton.prototype, "rel", void 0);
2307
- NLDDIconButton = __decorate([customElement("nldd-icon-button")], NLDDIconButton);
2308
- export { releaseContext as a, anchorPopoverTarget as c, ShortcutAvailabilityController as d, hasShortcut as f, langOf as i, popoverTargetOf as l, shortcutsAvailable as m, NLDDTooltip as n, NLDDActivityIndicator as o, shortcutLabel as p, carryContext as r, PopupAnchorController as s, NLDDIconButton as t, NLDDKeyboardShortcut as u };