@nldd/design-system 0.29.2 → 0.30.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 (452) hide show
  1. package/custom-elements.json +486 -214
  2. package/dist/assets/styles/shadow-resets.d.ts +22 -7
  3. package/dist/assets/styles/shadow-resets.d.ts.map +1 -1
  4. package/dist/assets/styles/shadow-resets.js +30 -1
  5. package/dist/assets/styles/shadow-resets.js.map +1 -1
  6. package/dist/assets/styles/text-wrap.d.ts +20 -4
  7. package/dist/assets/styles/text-wrap.d.ts.map +1 -1
  8. package/dist/assets/styles/text-wrap.js +27 -5
  9. package/dist/assets/styles/text-wrap.js.map +1 -1
  10. package/dist/cdn/autoloader.js +139 -140
  11. package/dist/cdn/chunks/{accordion-BIgPiBgT.js → accordion-DgR70Lf-.js} +4 -4
  12. package/dist/cdn/chunks/{accordion-item-YHiK4fhb.js → accordion-item-BDevWF9t.js} +6 -5
  13. package/dist/cdn/chunks/{activity-indicator-BiuU--e6.js → activity-indicator-B-iqA8XF.js} +6 -9
  14. package/dist/cdn/chunks/{admonition-CpxxWW6f.js → admonition-PKX7ePb3.js} +6 -5
  15. package/dist/cdn/chunks/{avatar-DeeEjbzl.js → avatar-Bm_cbn5X.js} +6 -6
  16. package/dist/cdn/chunks/{avatar-group-Ey17PhOt.js → avatar-group-5XxwtbbC.js} +15 -15
  17. package/dist/cdn/chunks/{badge-B0K1AVec.js → badge-CpxDQfHS.js} +31 -29
  18. package/dist/cdn/chunks/{banner-YQpzU7Yz.js → banner-Ccc9LgDk.js} +8 -8
  19. package/dist/cdn/chunks/{bar-split-view-DNWrGLv3.js → bar-split-view-0yxggCZe.js} +5 -5
  20. package/dist/cdn/chunks/{blockquote-zBgtNbdZ.js → blockquote-CmbDjlPB.js} +32 -31
  21. package/dist/cdn/chunks/{box-CLEd1Y-1.js → box-DQjgR2YI.js} +3 -3
  22. package/dist/cdn/chunks/{breadcrumbs-DCwiSLxQ.js → breadcrumbs-C8yzb9pA.js} +6 -6
  23. package/dist/cdn/chunks/{button-DpSJe6ns.js → button-D_KfPyHS.js} +113 -90
  24. package/dist/cdn/chunks/{button-bar-Bw46AWOo.js → button-bar-f-qcw_zA.js} +3 -3
  25. package/dist/cdn/chunks/{button-group-Bd5CZm4t.js → button-group-Dq3q44jB.js} +2 -2
  26. package/dist/cdn/chunks/{card-xq9jqLek.js → card-CDT7nkKG.js} +4 -4
  27. package/dist/cdn/chunks/{cell-CNGu9Srs.js → cell-B7ksoCyd.js} +6 -6
  28. package/dist/cdn/chunks/{checkbox-DJU2ntYs.js → checkbox-CUReiYVg.js} +5 -5
  29. package/dist/cdn/chunks/{checkbox-field-36mh4uD-.js → checkbox-field-CkQ8WLSq.js} +8 -8
  30. package/dist/cdn/chunks/{checkbox-group-CaoyYQC1.js → checkbox-group-BpDzGuFk.js} +3 -3
  31. package/dist/cdn/chunks/{class-map-07EioFee.js → class-map-BQWXee9F.js} +1 -1
  32. package/dist/cdn/chunks/{code-editor-CqHXUdbC.js → code-editor-CwLcukqn.js} +15 -5
  33. package/dist/cdn/chunks/{code-viewer-ro55V04o.js → code-viewer-CvSF5fyg.js} +37 -10
  34. package/dist/cdn/chunks/{codemirror-input-D4u8naKh.js → codemirror-input-CcaHTu9u.js} +5 -5
  35. package/dist/cdn/chunks/{collection-DVED8Kff.js → collection-DqqkdrVS.js} +8 -8
  36. package/dist/cdn/chunks/{combo-box-CMdGMQ8q.js → combo-box-BQ9jS1fP.js} +19 -10
  37. package/dist/cdn/chunks/{container-BxfHTSXb.js → container-BC5PiMvR.js} +83 -82
  38. package/dist/cdn/chunks/{custom-element-7tLnKgZE.js → custom-element-DGdiDiuN.js} +1 -1
  39. package/dist/cdn/chunks/{date-field-KrAEvvJg.js → date-field-Dmli_GlI.js} +12 -12
  40. package/dist/cdn/chunks/{date-picker-CeyTd4Mj.js → date-picker-BCHBh6vd.js} +15 -17
  41. package/dist/cdn/chunks/{decorate-CIC8fGPN.js → decorate-D2snH_th.js} +1 -1
  42. package/dist/cdn/chunks/described-by-mixin-Doan1yj6.js +106 -0
  43. package/dist/cdn/chunks/{description-cell-DDjPf92m.js → description-cell-QL0CUcxH.js} +7 -7
  44. package/dist/cdn/chunks/{dev-checks-DE09CTk9.js → dev-checks-BQsZ10CZ.js} +41 -11
  45. package/dist/cdn/chunks/{directive-helpers-DUlH8eNt.js → directive-helpers-BtIbEaBv.js} +1 -1
  46. package/dist/cdn/chunks/{dist-DJ_2VKiG.js → dist-0sEOO4c9.js} +3 -3
  47. package/dist/cdn/chunks/{dist-CanlbdZP.js → dist-BX-aE56q.js} +1 -1
  48. package/dist/cdn/chunks/{dist-Cku1NQ9X.js → dist-CJ-hLN4o.js} +2 -2
  49. package/dist/cdn/chunks/{dist-DuaPU_hA.js → dist-CUCs0edm.js} +2 -2
  50. package/dist/cdn/chunks/{dist-BV06hHwA.js → dist-CeovKDYB.js} +3 -3
  51. package/dist/cdn/chunks/{dist-Dpc1YfbE.js → dist-CoM5yDHD.js} +1 -1
  52. package/dist/cdn/chunks/{dist-DtpgX9L8.js → dist-DM49yEzE.js} +2 -2
  53. package/dist/cdn/chunks/{dist-3XSbEdbz.js → dist-DizTxYTi.js} +1 -1
  54. package/dist/cdn/chunks/{dist-lUsXGXhR.js → dist-Dj0pXI2B.js} +1 -1
  55. package/dist/cdn/chunks/{dist-DsE-63gX.js → dist-Dtn2rsM6.js} +1 -1
  56. package/dist/cdn/chunks/{dist-CLyXDlop.js → dist-QheJD595.js} +1 -1
  57. package/dist/cdn/chunks/{divider-BixGehzs.js → divider-D8o0JPE2.js} +2 -2
  58. package/dist/cdn/chunks/{document-tab-bar-BlP7NEb9.js → document-tab-bar-BX6UhFBl.js} +10 -13
  59. package/dist/cdn/chunks/{dropdown-DpCdMFod.js → dropdown-afozwXVW.js} +5 -5
  60. package/dist/cdn/chunks/{file-field-CYjsw4xy.js → file-field-BKhUYcHf.js} +109 -106
  61. package/dist/cdn/chunks/{form-DDB03czp.js → form-DnZIiX9b.js} +1 -1
  62. package/dist/cdn/chunks/{form-actions-DZgcVawx.js → form-actions-Ddg9vIVq.js} +2 -2
  63. package/dist/cdn/chunks/{form-associated-mixin-9cC5HSCG.js → form-associated-mixin-BMQQpMlL.js} +2 -2
  64. package/dist/cdn/chunks/form-field-DDBYuAl_.js +405 -0
  65. package/dist/cdn/chunks/form-field.i18n-D-3yEP-C.js +6 -0
  66. package/dist/cdn/chunks/form-section-Co0TM35-.js +78 -0
  67. package/dist/cdn/chunks/{full-bleed-section-enjghRsm.js → full-bleed-section-DD8ibmsa.js} +3 -3
  68. package/dist/cdn/chunks/{hero-AHBPM3ks.js → hero-BYrY2MZc.js} +7 -7
  69. package/dist/cdn/chunks/{icon-C_xeQP4j.js → icon-BzeHXcdi.js} +26 -9
  70. package/dist/cdn/chunks/{icon-button-CkNgX7Ra.js → icon-button-BErQf42w.js} +65 -62
  71. package/dist/cdn/chunks/{icon-cell-qieQ2vyq.js → icon-cell-DGIMXKxK.js} +5 -5
  72. package/dist/cdn/chunks/{identity-CnYwgyF7.js → identity-Cq-WnU6u.js} +30 -27
  73. package/dist/cdn/chunks/{if-defined-BG5WQE1B.js → if-defined-CuY6t6gH.js} +1 -1
  74. package/dist/cdn/chunks/{image--K2M19ce.js → image-BjjyqV0V.js} +23 -22
  75. package/dist/cdn/chunks/{inline-dialog-CfiC1tbk.js → inline-dialog-Bk2G7f5r.js} +24 -23
  76. package/dist/cdn/chunks/{just-in-time-education-Dxca2LqF.js → just-in-time-education-Dxh5DNCy.js} +5 -5
  77. package/dist/cdn/chunks/{kanban-Dwb93dgS.js → kanban-BvmtB9D9.js} +7 -8
  78. package/dist/cdn/chunks/{kanban-column-Br4GovWU.js → kanban-column-CJ2g7pgA.js} +9 -11
  79. package/dist/cdn/chunks/{keyboard-shortcut-a-CkABX1.js → keyboard-shortcut-BV5DFQtT.js} +3 -3
  80. package/dist/cdn/chunks/{languages-BrBEUYzL.js → languages-DJjHEjGl.js} +1603 -1602
  81. package/dist/cdn/chunks/{link-CROYAF4K.js → link-BcukwT5Y.js} +6 -6
  82. package/dist/cdn/chunks/{link-group-pbOW9KCb.js → link-group-Ci1q3uEd.js} +2 -2
  83. package/dist/cdn/chunks/{list-D_BWUBh4.js → list-CFFHWUSC.js} +9 -9
  84. package/dist/cdn/chunks/{list-item-DeFrncLo.js → list-item-Bg1NyOXd.js} +12 -13
  85. package/dist/cdn/chunks/{list-item-segment-C1X5v2_Z.js → list-item-segment-DJ8pk08-.js} +4 -4
  86. package/dist/cdn/chunks/{menu-CkMJUE0H.js → menu-BEjqhn1-.js} +10 -10
  87. package/dist/cdn/chunks/{menu-bar-B3F-QjLV.js → menu-bar-DkjXy-TE.js} +6 -6
  88. package/dist/cdn/chunks/{menu-bar-item-CyixR7Fi.js → menu-bar-item-3cJS29Ey.js} +6 -6
  89. package/dist/cdn/chunks/{menu-divider-uBPiSPsv.js → menu-divider-CYmEimsb.js} +3 -3
  90. package/dist/cdn/chunks/{menu-group-BXS5r-lc.js → menu-group-ggwAcgis.js} +4 -4
  91. package/dist/cdn/chunks/{menu-item-CORxUt3u.js → menu-item-BzH9H87h.js} +4 -4
  92. package/dist/cdn/chunks/{menu.template-NyA_JtUm.js → menu.template-PG82-P20.js} +6 -6
  93. package/dist/cdn/chunks/{modal-dialog-Dt5uenA0.js → modal-dialog-Bu7ETELf.js} +4 -4
  94. package/dist/cdn/chunks/{multi-line-text-field-CkCvyJov.js → multi-line-text-field-CQTKNBN7.js} +6 -6
  95. package/dist/cdn/chunks/{navigation-split-view-Clp3Camr.js → navigation-split-view-elMoUjHh.js} +13 -15
  96. package/dist/cdn/chunks/{nl.generated-B194RR-y.js → nl.generated-Lu29XEF3.js} +1 -1
  97. package/dist/cdn/chunks/{notification-B36JO2cS.js → notification-DCjXGfbY.js} +7 -7
  98. package/dist/cdn/chunks/{number-field-Cjrwd3G0.js → number-field-BUQUcG--.js} +8 -8
  99. package/dist/cdn/chunks/{one-half-one-half-section-Bc4rFjtM.js → one-half-one-half-section-DiGkeUVr.js} +3 -3
  100. package/dist/cdn/chunks/{one-third-two-thirds-section-DikIdU3X.js → one-third-two-thirds-section-q_AP4qIJ.js} +3 -3
  101. package/dist/cdn/chunks/{one-time-code-field-CqNmLld4.js → one-time-code-field-BybS_l6h.js} +9 -10
  102. package/dist/cdn/chunks/{overflow-menu-6tdlRjhY.js → overflow-menu-Duey_XJs.js} +1 -1
  103. package/dist/cdn/chunks/{page-CpdGz0K6.js → page-BrIeWp1b.js} +112 -46
  104. package/dist/cdn/chunks/{page-footer-_W5dGcQt.js → page-footer-DPQg9Qbw.js} +5 -5
  105. package/dist/cdn/chunks/{page-section-mixin-DSdHIkwR.js → page-section-mixin-B8FbeXaK.js} +3 -3
  106. package/dist/cdn/chunks/{pagination-DJqmp7nt.js → pagination-CfLJwflH.js} +37 -36
  107. package/dist/cdn/chunks/{password-field-JKBHK_MQ.js → password-field-CmoopbNF.js} +36 -35
  108. package/dist/cdn/chunks/{popover-LljgfgHS.js → popover-CPAR4N_a.js} +5 -5
  109. package/dist/cdn/chunks/{progress-bar-fILD82bn.js → progress-bar-vKGXvxfe.js} +10 -11
  110. package/dist/cdn/chunks/{progress-circle-72YbT9v1.js → progress-circle-dweisHzt.js} +8 -8
  111. package/dist/cdn/chunks/{radio-button-B45WY4fZ.js → radio-button-DE1K49_2.js} +4 -4
  112. package/dist/cdn/chunks/{radio-button-field-CG2ljZ-j.js → radio-button-field-DCrWiVoA.js} +7 -7
  113. package/dist/cdn/chunks/{radio-button-group-DgQHIiXR.js → radio-button-group-oLP_1cGy.js} +3 -3
  114. package/dist/cdn/chunks/{render-marked-vXU387IN.js → render-marked-BE3kBc1D.js} +1 -1
  115. package/dist/cdn/chunks/{reorder-handle-cell-Bc0LM08A.js → reorder-handle-cell-COCN6knt.js} +4 -4
  116. package/dist/cdn/chunks/{reorder-handle-mixin-DIkeFpRU.js → reorder-handle-mixin-CG-KhmuT.js} +2 -2
  117. package/dist/cdn/chunks/{repeat-Cy1a-r4p.js → repeat-D69H_dsv.js} +2 -2
  118. package/dist/cdn/chunks/{rich-text-BZ6J0VNi.js → rich-text-jEyIU58i.js} +3 -3
  119. package/dist/cdn/chunks/{row-header-mixin-CnCxMteQ.js → row-header-mixin-BejxhOCs.js} +2 -2
  120. package/dist/cdn/chunks/{scroll-fade-BoXGZJeO.js → scroll-fade-Cae9xqXr.js} +2 -2
  121. package/dist/cdn/chunks/{search-field-BaPPorsw.js → search-field-B8woxFh-.js} +40 -37
  122. package/dist/cdn/chunks/{segmented-control-CY7eFebV.js → segmented-control-DbOi6Wk6.js} +7 -7
  123. package/dist/cdn/chunks/{shadow-resets-kAFcguCG.js → shadow-resets-CNmJbdJw.js} +26 -11
  124. package/dist/cdn/chunks/{sheet-EvUuqzd5.js → sheet-bK663_K4.js} +4 -4
  125. package/dist/cdn/chunks/{shell-ZiZriusi.js → shell-DLu1fHOH.js} +3 -3
  126. package/dist/cdn/chunks/{side-by-side-split-view-qj871uv2.js → side-by-side-split-view-vNhUmTiE.js} +4 -4
  127. package/dist/cdn/chunks/{sidebar-section-C2KLgpwu.js → sidebar-section-CoE5F_h5.js} +8 -8
  128. package/dist/cdn/chunks/{simple-section-CVQRynxS.js → simple-section-1v7a_ZgI.js} +3 -3
  129. package/dist/cdn/chunks/{skip-link-CpxEwJKH.js → skip-link-C6B6mMkA.js} +5 -5
  130. package/dist/cdn/chunks/{slider-DHY89yV6.js → slider-BT-q6SP2.js} +12 -16
  131. package/dist/cdn/chunks/{spacer-BDRDeRQr.js → spacer-DlFn3NtV.js} +2 -2
  132. package/dist/cdn/chunks/{spacer-cell-DvUxqmbS.js → spacer-cell-Dy_twSDQ.js} +4 -4
  133. package/dist/cdn/chunks/{split-button-DGzX2W4w.js → split-button-URHM5eTx.js} +7 -7
  134. package/dist/cdn/chunks/{split-view-divider-BQdN8I8c.js → split-view-divider-DeLyeDBx.js} +2 -2
  135. package/dist/cdn/chunks/{stacked-split-view-CdXyXpzb.js → stacked-split-view-D0kiQJmL.js} +4 -4
  136. package/dist/cdn/chunks/{static-html-ooiG7-by.js → static-html-CAKb1-Ht.js} +1 -1
  137. package/dist/cdn/chunks/{status-bar-S5IvBhAD.js → status-bar-Bov-LrPy.js} +4 -4
  138. package/dist/cdn/chunks/{step-bar-pkYf_gF8.js → step-bar-BLtsl_S_.js} +6 -6
  139. package/dist/cdn/chunks/{step-cell-3yG-UCmv.js → step-cell-cxM7vhtH.js} +5 -5
  140. package/dist/cdn/chunks/{stepper-DIufBp3c.js → stepper-DeIcLT7G.js} +7 -7
  141. package/dist/cdn/chunks/{style-map-DP8rklU9.js → style-map-CQX4CmTz.js} +1 -1
  142. package/dist/cdn/chunks/{swatch-picker-uyMsXHeI.js → swatch-picker-A7AU6Agu.js} +6 -6
  143. package/dist/cdn/chunks/{switch-DQ3UDIy5.js → switch-D0UPsKws.js} +5 -5
  144. package/dist/cdn/chunks/{switch-field-BXH62I0E.js → switch-field-D63lc5C0.js} +7 -7
  145. package/dist/cdn/chunks/{tab-bar-B2m7RGKe.js → tab-bar-CzGSRfKd.js} +8 -8
  146. package/dist/cdn/chunks/{table-Dtg4t_dM.js → table-DfunY2Dn.js} +5 -5
  147. package/dist/cdn/chunks/{tag-BdB8MDQQ.js → tag-DSWjjDBo.js} +5 -5
  148. package/dist/cdn/chunks/{term-DD2K8Qqb.js → term-Bk9cdlCz.js} +12 -12
  149. package/dist/cdn/chunks/{text-C8iP63bA.js → text-CDBiVulh.js} +4 -4
  150. package/dist/cdn/chunks/{text-cell-1pWwBLLI.js → text-cell-DUOJAXZo.js} +40 -37
  151. package/dist/cdn/chunks/{text-editor-DjNky4l-.js → text-editor-BIbYF0AB.js} +22 -12
  152. package/dist/cdn/chunks/{text-field-ClVrHYGz.js → text-field-CAnQNcXB.js} +6 -6
  153. package/dist/cdn/chunks/{text-wrap-DJ9PcwZ4.js → text-wrap-COu7AY91.js} +13 -5
  154. package/dist/cdn/chunks/{time-field-CrwLpzZp.js → time-field-xriXgFMl.js} +14 -14
  155. package/dist/cdn/chunks/{time-picker-BYhEzGJL.js → time-picker-D3_KbYUW.js} +6 -6
  156. package/dist/cdn/chunks/{title-DdqeERnM.js → title-HPn4c-s5.js} +5 -5
  157. package/dist/cdn/chunks/title-bar-label-controller-DHJwXI9W.js +27 -0
  158. package/dist/cdn/chunks/{title-cell-C4U3rN33.js → title-cell-BXMZkbXf.js} +51 -48
  159. package/dist/cdn/chunks/{toggle-button-CknaEM8j.js → toggle-button-DY22KEwY.js} +72 -56
  160. package/dist/cdn/chunks/{toggle-button-group-CxyhERqD.js → toggle-button-group-DsjZofEG.js} +2 -2
  161. package/dist/cdn/chunks/{token-I0vH42iy.js → token-DwT2i71b.js} +5 -5
  162. package/dist/cdn/chunks/{token-field-B1sAqN0B.js → token-field-CQxSARGi.js} +11 -11
  163. package/dist/cdn/chunks/{toolbar-DRIyU8-Z.js → toolbar-CaDvhCqm.js} +69 -68
  164. package/dist/cdn/chunks/{toolbar-item-D1JDaFal.js → toolbar-item-BDl4ys-w.js} +3 -3
  165. package/dist/cdn/chunks/{toolbar-title-D7CCOmDz.js → toolbar-title-yGR8Hzhp.js} +4 -4
  166. package/dist/cdn/chunks/{toolbar.styles-CXjPigMk.js → toolbar.styles-DlyfZkRq.js} +3 -3
  167. package/dist/cdn/chunks/{tooltip-5clp5S3T.js → tooltip-BDiYghAz.js} +5 -5
  168. package/dist/cdn/chunks/{top-navigation-bar-CEuIAOoy.js → top-navigation-bar-ibsjezN_.js} +18 -18
  169. package/dist/cdn/chunks/{top-title-bar-M3NiRgr_.js → top-title-bar-BKdwEZfj.js} +15 -12
  170. package/dist/cdn/chunks/{two-thirds-one-third-section-BJGAw7Mq.js → two-thirds-one-third-section-DmumCsGo.js} +3 -3
  171. package/dist/cdn/chunks/{validation-list-CTb7X_Gq.js → validation-list-CXcJfvOJ.js} +61 -49
  172. package/dist/cdn/chunks/{visibility-mixin-BgnkZDZM.js → visibility-mixin-C7s59UlL.js} +2 -2
  173. package/dist/cdn/chunks/{visually-hidden-B4_jKNA7.js → visually-hidden-CMzKHcSc.js} +2 -2
  174. package/dist/cdn/chunks/{window-BmxrtW9P.js → window-CSNx5wt1.js} +5 -5
  175. package/dist/cdn/chunks/{with-translations-DSfo7eL-.js → with-translations-0oyNXfdD.js} +3 -3
  176. package/dist/components/actions/button/button.styles.d.ts.map +1 -1
  177. package/dist/components/actions/button/button.styles.js +26 -7
  178. package/dist/components/actions/button/button.styles.js.map +1 -1
  179. package/dist/components/actions/button/button.template.d.ts.map +1 -1
  180. package/dist/components/actions/button/button.template.js +7 -5
  181. package/dist/components/actions/button/button.template.js.map +1 -1
  182. package/dist/components/actions/icon-button/icon-button.styles.d.ts.map +1 -1
  183. package/dist/components/actions/icon-button/icon-button.styles.js +4 -2
  184. package/dist/components/actions/icon-button/icon-button.styles.js.map +1 -1
  185. package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
  186. package/dist/components/actions/icon-button/icon-button.template.js +4 -2
  187. package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
  188. package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
  189. package/dist/components/actions/toolbar/toolbar.template.js +2 -1
  190. package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
  191. package/dist/components/content/accordion/accordion-item.styles.d.ts.map +1 -1
  192. package/dist/components/content/accordion/accordion-item.styles.js +1 -0
  193. package/dist/components/content/accordion/accordion-item.styles.js.map +1 -1
  194. package/dist/components/content/admonition/admonition.d.ts +1 -1
  195. package/dist/components/content/admonition/admonition.js +1 -1
  196. package/dist/components/content/admonition/admonition.styles.d.ts.map +1 -1
  197. package/dist/components/content/admonition/admonition.styles.js +1 -0
  198. package/dist/components/content/admonition/admonition.styles.js.map +1 -1
  199. package/dist/components/content/blockquote/blockquote.template.d.ts.map +1 -1
  200. package/dist/components/content/blockquote/blockquote.template.js +2 -1
  201. package/dist/components/content/blockquote/blockquote.template.js.map +1 -1
  202. package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
  203. package/dist/components/content/code-viewer/code-viewer.styles.js +30 -3
  204. package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
  205. package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
  206. package/dist/components/content/icon/icon-aliases.js +10 -2
  207. package/dist/components/content/icon/icon-aliases.js.map +1 -1
  208. package/dist/components/content/icon/icon-categories.d.ts.map +1 -1
  209. package/dist/components/content/icon/icon-categories.js +13 -0
  210. package/dist/components/content/icon/icon-categories.js.map +1 -1
  211. package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
  212. package/dist/components/content/icon/icon-gallery-status.js +25 -52
  213. package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
  214. package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
  215. package/dist/components/content/icon/icon-registry.js +19 -6
  216. package/dist/components/content/icon/icon-registry.js.map +1 -1
  217. package/dist/components/content/identity/identity.d.ts +8 -5
  218. package/dist/components/content/identity/identity.d.ts.map +1 -1
  219. package/dist/components/content/identity/identity.js +8 -5
  220. package/dist/components/content/identity/identity.js.map +1 -1
  221. package/dist/components/content/identity/identity.styles.d.ts.map +1 -1
  222. package/dist/components/content/identity/identity.styles.js +4 -1
  223. package/dist/components/content/identity/identity.styles.js.map +1 -1
  224. package/dist/components/content/image/image.template.d.ts.map +1 -1
  225. package/dist/components/content/image/image.template.js +9 -8
  226. package/dist/components/content/image/image.template.js.map +1 -1
  227. package/dist/components/content/rich-text/rich-text.d.ts +4 -2
  228. package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
  229. package/dist/components/content/rich-text/rich-text.js +4 -2
  230. package/dist/components/content/rich-text/rich-text.js.map +1 -1
  231. package/dist/components/content/text/text.d.ts +2 -0
  232. package/dist/components/content/text/text.d.ts.map +1 -1
  233. package/dist/components/content/text/text.js +2 -0
  234. package/dist/components/content/text/text.js.map +1 -1
  235. package/dist/components/forms/form-field/form-field.d.ts +138 -73
  236. package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
  237. package/dist/components/forms/form-field/form-field.i18n.d.ts +1 -0
  238. package/dist/components/forms/form-field/form-field.i18n.d.ts.map +1 -1
  239. package/dist/components/forms/form-field/form-field.i18n.js +2 -0
  240. package/dist/components/forms/form-field/form-field.i18n.js.map +1 -1
  241. package/dist/components/forms/form-field/form-field.js +317 -149
  242. package/dist/components/forms/form-field/form-field.js.map +1 -1
  243. package/dist/components/forms/form-field/form-field.styles.d.ts +0 -1
  244. package/dist/components/forms/form-field/form-field.styles.d.ts.map +1 -1
  245. package/dist/components/forms/form-field/form-field.styles.js +18 -97
  246. package/dist/components/forms/form-field/form-field.styles.js.map +1 -1
  247. package/dist/components/forms/form-field/form-field.template.d.ts +0 -2
  248. package/dist/components/forms/form-field/form-field.template.d.ts.map +1 -1
  249. package/dist/components/forms/form-field/form-field.template.js +22 -15
  250. package/dist/components/forms/form-field/form-field.template.js.map +1 -1
  251. package/dist/components/forms/form-section/form-section.d.ts +40 -16
  252. package/dist/components/forms/form-section/form-section.d.ts.map +1 -1
  253. package/dist/components/forms/form-section/form-section.js +47 -183
  254. package/dist/components/forms/form-section/form-section.js.map +1 -1
  255. package/dist/components/forms/form-section/form-section.styles.d.ts +2 -0
  256. package/dist/components/forms/form-section/form-section.styles.d.ts.map +1 -0
  257. package/dist/components/forms/form-section/form-section.styles.js +44 -0
  258. package/dist/components/forms/form-section/form-section.styles.js.map +1 -0
  259. package/dist/components/forms/form-section/form-section.template.d.ts +4 -0
  260. package/dist/components/forms/form-section/form-section.template.d.ts.map +1 -0
  261. package/dist/components/forms/form-section/form-section.template.js +19 -0
  262. package/dist/components/forms/form-section/form-section.template.js.map +1 -0
  263. package/dist/components/forms/validation-list/validation-list.d.ts +36 -6
  264. package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
  265. package/dist/components/forms/validation-list/validation-list.js +75 -15
  266. package/dist/components/forms/validation-list/validation-list.js.map +1 -1
  267. package/dist/components/forms/validation-list/validation-list.template.d.ts +1 -1
  268. package/dist/components/forms/validation-list/validation-list.template.d.ts.map +1 -1
  269. package/dist/components/forms/validation-list/validation-list.template.js +2 -2
  270. package/dist/components/forms/validation-list/validation-list.template.js.map +1 -1
  271. package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
  272. package/dist/components/inputs/code-editor/code-editor.styles.js +10 -0
  273. package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
  274. package/dist/components/inputs/combo-box/combo-box.styles.d.ts.map +1 -1
  275. package/dist/components/inputs/combo-box/combo-box.styles.js +10 -1
  276. package/dist/components/inputs/combo-box/combo-box.styles.js.map +1 -1
  277. package/dist/components/inputs/date-picker/date-picker.template.d.ts.map +1 -1
  278. package/dist/components/inputs/date-picker/date-picker.template.js +4 -6
  279. package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
  280. package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
  281. package/dist/components/inputs/file-field/file-field.styles.js +3 -2
  282. package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
  283. package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
  284. package/dist/components/inputs/file-field/file-field.template.js +9 -8
  285. package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
  286. package/dist/components/inputs/file-field/file-field.truncate.d.ts +4 -3
  287. package/dist/components/inputs/file-field/file-field.truncate.d.ts.map +1 -1
  288. package/dist/components/inputs/file-field/file-field.truncate.js +8 -5
  289. package/dist/components/inputs/file-field/file-field.truncate.js.map +1 -1
  290. package/dist/components/inputs/one-time-code-field/one-time-code-field.template.js +1 -1
  291. package/dist/components/inputs/one-time-code-field/one-time-code-field.template.js.map +1 -1
  292. package/dist/components/inputs/password-field/password-field.template.d.ts.map +1 -1
  293. package/dist/components/inputs/password-field/password-field.template.js +2 -1
  294. package/dist/components/inputs/password-field/password-field.template.js.map +1 -1
  295. package/dist/components/inputs/search-field/search-field.d.ts +3 -0
  296. package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
  297. package/dist/components/inputs/search-field/search-field.js +7 -6
  298. package/dist/components/inputs/search-field/search-field.js.map +1 -1
  299. package/dist/components/inputs/slider/slider.template.js +2 -2
  300. package/dist/components/inputs/slider/slider.template.js.map +1 -1
  301. package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
  302. package/dist/components/inputs/text-editor/text-editor.mentions.js +2 -1
  303. package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
  304. package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
  305. package/dist/components/inputs/text-editor/text-editor.styles.js +10 -0
  306. package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
  307. package/dist/components/inputs/toggle-button/toggle-button.styles.d.ts.map +1 -1
  308. package/dist/components/inputs/toggle-button/toggle-button.styles.js +18 -3
  309. package/dist/components/inputs/toggle-button/toggle-button.styles.js.map +1 -1
  310. package/dist/components/inputs/toggle-button/toggle-button.template.d.ts.map +1 -1
  311. package/dist/components/inputs/toggle-button/toggle-button.template.js +7 -3
  312. package/dist/components/inputs/toggle-button/toggle-button.template.js.map +1 -1
  313. package/dist/components/layout/container/container.template.d.ts.map +1 -1
  314. package/dist/components/layout/container/container.template.js +2 -1
  315. package/dist/components/layout/container/container.template.js.map +1 -1
  316. package/dist/components/layout/kanban/kanban-column.template.d.ts.map +1 -1
  317. package/dist/components/layout/kanban/kanban-column.template.js +5 -7
  318. package/dist/components/layout/kanban/kanban-column.template.js.map +1 -1
  319. package/dist/components/layout/kanban/kanban.template.d.ts.map +1 -1
  320. package/dist/components/layout/kanban/kanban.template.js +2 -3
  321. package/dist/components/layout/kanban/kanban.template.js.map +1 -1
  322. package/dist/components/layout/page/page.d.ts +42 -0
  323. package/dist/components/layout/page/page.d.ts.map +1 -1
  324. package/dist/components/layout/page/page.js +108 -3
  325. package/dist/components/layout/page/page.js.map +1 -1
  326. package/dist/components/layout/page/page.styles.d.ts.map +1 -1
  327. package/dist/components/layout/page/page.styles.js +5 -0
  328. package/dist/components/layout/page/page.styles.js.map +1 -1
  329. package/dist/components/layout/page/page.template.d.ts.map +1 -1
  330. package/dist/components/layout/page/page.template.js +3 -2
  331. package/dist/components/layout/page/page.template.js.map +1 -1
  332. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +11 -0
  333. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
  334. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +11 -0
  335. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
  336. package/dist/components/layout/sheet/sheet.d.ts +3 -0
  337. package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
  338. package/dist/components/layout/sheet/sheet.js +3 -0
  339. package/dist/components/layout/sheet/sheet.js.map +1 -1
  340. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +2 -2
  341. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
  342. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js +2 -2
  343. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js.map +1 -1
  344. package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts +3 -2
  345. package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts.map +1 -1
  346. package/dist/components/lists-and-tables/cells/description-cell/description-cell.js +3 -2
  347. package/dist/components/lists-and-tables/cells/description-cell/description-cell.js.map +1 -1
  348. package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts +1 -0
  349. package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts.map +1 -1
  350. package/dist/components/lists-and-tables/cells/step-cell/step-cell.js +1 -0
  351. package/dist/components/lists-and-tables/cells/step-cell/step-cell.js.map +1 -1
  352. package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +13 -13
  353. package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +13 -13
  354. package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.d.ts.map +1 -1
  355. package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +4 -1
  356. package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js.map +1 -1
  357. package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +8 -4
  358. package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts.map +1 -1
  359. package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +8 -4
  360. package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
  361. package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.d.ts.map +1 -1
  362. package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +4 -1
  363. package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js.map +1 -1
  364. package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
  365. package/dist/components/lists-and-tables/list-item/list-item.template.js +7 -8
  366. package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
  367. package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +1 -1
  368. package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
  369. package/dist/components/navigation/pagination/pagination.template.d.ts.map +1 -1
  370. package/dist/components/navigation/pagination/pagination.template.js +3 -2
  371. package/dist/components/navigation/pagination/pagination.template.js.map +1 -1
  372. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +7 -1
  373. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
  374. package/dist/components/navigation/top-title-bar/top-title-bar.js +12 -1
  375. package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
  376. package/dist/components/navigation/top-title-bar/top-title-bar.template.js +4 -4
  377. package/dist/components/navigation/top-title-bar/top-title-bar.template.js.map +1 -1
  378. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.d.ts.map +1 -1
  379. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js +2 -3
  380. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js.map +1 -1
  381. package/dist/components/status-and-feedback/badge/badge.template.d.ts.map +1 -1
  382. package/dist/components/status-and-feedback/badge/badge.template.js +3 -7
  383. package/dist/components/status-and-feedback/badge/badge.template.js.map +1 -1
  384. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.d.ts.map +1 -1
  385. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js +3 -4
  386. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js.map +1 -1
  387. package/dist/components/status-and-feedback/progress-bar/progress-bar.template.d.ts.map +1 -1
  388. package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js +2 -3
  389. package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js.map +1 -1
  390. package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +1 -1
  391. package/dist/components/status-and-feedback/step-bar/step-bar.js +1 -1
  392. package/dist/css/form.css +14 -0
  393. package/dist/css/global-open-font.css +0 -1
  394. package/dist/css/global.css +0 -1
  395. package/dist/css/rich-text.css +16 -4
  396. package/dist/css/text.css +3 -1
  397. package/dist/css/title.css +3 -1
  398. package/dist/css/variables.css +5 -0
  399. package/dist/nldd.min.js +1900 -1766
  400. package/dist/translations/en-US.d.ts.map +1 -1
  401. package/dist/translations/en-US.js +1 -0
  402. package/dist/translations/en-US.js.map +1 -1
  403. package/dist/translations/fy.d.ts.map +1 -1
  404. package/dist/translations/fy.js +1 -0
  405. package/dist/translations/fy.js.map +1 -1
  406. package/dist/translations/nl.generated.d.ts +1 -0
  407. package/dist/translations/nl.generated.d.ts.map +1 -1
  408. package/dist/translations/pap-AW.d.ts.map +1 -1
  409. package/dist/translations/pap-AW.js +1 -0
  410. package/dist/translations/pap-AW.js.map +1 -1
  411. package/dist/translations/pap-CW.d.ts.map +1 -1
  412. package/dist/translations/pap-CW.js +1 -0
  413. package/dist/translations/pap-CW.js.map +1 -1
  414. package/dist/types/react.d.ts +24 -27
  415. package/dist/types/vue.d.ts +84 -87
  416. package/dist/utilities/autoloader.generated.d.ts.map +1 -1
  417. package/dist/utilities/autoloader.generated.js +0 -1
  418. package/dist/utilities/autoloader.generated.js.map +1 -1
  419. package/dist/utilities/codemirror/codemirror-element.d.ts +3 -2
  420. package/dist/utilities/codemirror/codemirror-element.d.ts.map +1 -1
  421. package/dist/utilities/codemirror/codemirror-element.js +6 -2
  422. package/dist/utilities/codemirror/codemirror-element.js.map +1 -1
  423. package/dist/utilities/described-by-mixin.d.ts +36 -1
  424. package/dist/utilities/described-by-mixin.d.ts.map +1 -1
  425. package/dist/utilities/described-by-mixin.js +132 -8
  426. package/dist/utilities/described-by-mixin.js.map +1 -1
  427. package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
  428. package/dist/utilities/dev-rules.generated.js +42 -13
  429. package/dist/utilities/dev-rules.generated.js.map +1 -1
  430. package/dist/utilities/file-name-breaks.d.ts +13 -0
  431. package/dist/utilities/file-name-breaks.d.ts.map +1 -0
  432. package/dist/utilities/file-name-breaks.js +27 -0
  433. package/dist/utilities/file-name-breaks.js.map +1 -0
  434. package/dist/utilities/same-items.d.ts +10 -0
  435. package/dist/utilities/same-items.d.ts.map +1 -0
  436. package/dist/utilities/same-items.js +14 -0
  437. package/dist/utilities/same-items.js.map +1 -0
  438. package/dist/utilities/title-bar-label-controller.d.ts +3 -0
  439. package/dist/utilities/title-bar-label-controller.d.ts.map +1 -1
  440. package/dist/utilities/title-bar-label-controller.js +19 -3
  441. package/dist/utilities/title-bar-label-controller.js.map +1 -1
  442. package/lint/data.generated.json +1 -1
  443. package/lint/fix.js +49 -6
  444. package/lint/rule-compiler.js +7 -3
  445. package/lint/rule.schema.json +12 -0
  446. package/package.json +3 -3
  447. package/dist/cdn/chunks/described-by-mixin-DSeADwWP.js +0 -62
  448. package/dist/cdn/chunks/form-field-CuTa78j4.js +0 -434
  449. package/dist/cdn/chunks/form-field.i18n-B-UZduXL.js +0 -3
  450. package/dist/cdn/chunks/form-section-J2if8kVt.js +0 -64
  451. package/dist/cdn/chunks/title-bar-label-controller-DSxdKZOg.js +0 -24
  452. package/dist/css/form-section.css +0 -104
@@ -5,43 +5,63 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  /**
8
- * Nederlandse Digitale Dienst Form Field Components (Lit + TypeScript)
8
+ * Nederlandse Digitale Dienst Form Field Component (Lit + TypeScript)
9
9
  *
10
10
  * A field around one input: its label, supporting label, optional badge,
11
11
  * validation and help text. It finds the input among its children, hands it
12
12
  * the label as its accessible name and gives it an id, so you write no `for`
13
- * or `id` yourself. The input is the first one it finds, leaving out what sits
14
- * in an nldd-toolbar inside the field: a toolbar works on the field, such as
15
- * the formatting bar above an nldd-text-editor, and is never the field itself.
16
- * A native `for` cannot cross a shadow boundary, so a click on the label
17
- * focuses the input from script.
13
+ * or `id` yourself. An input that is defined later, as the autoloader does,
14
+ * or that appears later inside a wrapper, is found when it arrives. The input
15
+ * is the first one it finds, leaving out what sits in an nldd-toolbar inside
16
+ * the field: a toolbar works on the field, such as the formatting bar above an
17
+ * nldd-text-editor, and is never the field itself. A native `for` cannot cross
18
+ * a shadow boundary, so a click on the label focuses the input from script.
18
19
  *
19
20
  * Mark the optional fields with `optional`, not the required ones; the design
20
21
  * guidelines say why. Put the requirements on a value in an
21
22
  * nldd-validation-list inside the same field. What only your server knows,
22
23
  * such as a password found in a breach, the app names in `unmet` on the input
23
- * itself: see nldd-validation-list. The field hands the list its input and puts
24
- * the list in the input's accessible description, before the help text.
24
+ * itself: see nldd-validation-list. The field hands the list its input, and
25
+ * the list adds its items on screen to the accessible description of that
26
+ * input itself. A list with a `for` of its own describes the control it names
27
+ * instead. The list is a direct child of the field, also when the input sits in
28
+ * a wrapper: a list deeper down is not the field's, and the field does not
29
+ * touch it.
30
+ *
31
+ * Plain help text goes in `help-text`. Help text with more in it, such as a
32
+ * link, goes in an nldd-text in the `help-text` slot. That nldd-text takes the
33
+ * look of help text, as the attribute does, so every help text looks the same:
34
+ * a size, color or weight of its own does nothing there.
35
+ *
36
+ * A field is about one control. A question that takes more than one, such as
37
+ * a date in three fields or a radio group with an "Anders" text field, is a
38
+ * `group`: the field is then the group, named by its label, and describes
39
+ * itself rather than its first control. More than one question are more
40
+ * fields.
41
+ *
42
+ * The accessible name is the label, followed by "optioneel" when the field is
43
+ * `optional`. The accessible description follows the order on screen: the
44
+ * supporting label, then what is wrong, then the help text, from the slot or
45
+ * `help-text`. The supporting label and `help-text` are text in the field
46
+ * itself. A control that carries its own role, such as a radio group or a
47
+ * native input, and a field that is a `group`, can only take text as
48
+ * `aria-description`, which a browser reads only while no element describes
49
+ * it: not while an error shows, and not beside help text in the slot. Put the
50
+ * supporting label in that help text then.
25
51
  *
26
52
  * @element nldd-form-field
27
53
  * @keywords veld, label
28
54
  *
29
55
  * @attr {'top'|'right'|'left'} label-alignment - 'top' (default) | 'right' | 'left'. A value of its own wins over the one of a wrapping nldd-form.
30
56
  * @attr {string} label - Field label text. Omit for no-label layout. Supports **bold** markdown syntax, for the word to type in a confirmation; the accessible name of the control takes the text without the markers.
31
- * @attr {string} supporting-label - Short supporting text below the label. Same typography as optional badge. Supports **bold** markdown syntax.
32
- * @attr {boolean} optional - Shows an optional badge next to the label. Its text is the translation key `components.form-field.optional-label` ("Optioneel").
57
+ * @attr {string} supporting-label - Short supporting text below the label. Same typography as optional badge. Supports **bold** markdown syntax. Read as part of the accessible description of the input, first, before the validation and the help text.
58
+ * @attr {string} help-text - Help text below the input, as plain text. Supports **bold** markdown syntax. Read as part of the accessible description of the input, after the supporting label and the validation. Help text with a link, or text that every screen reader has to read, goes in the `help-text` slot, which takes its place: on a control with a role of its own and on a `group`, `help-text` is an `aria-description`, which not every screen reader reads.
59
+ * @attr {boolean} optional - Shows an optional badge next to the label, and adds it to the accessible name of the input. Its text is the translation key `components.form-field.optional-label` ("Optioneel"); the name is `components.form-field.optional-accessible-label` ("{label}, optioneel").
60
+ * @attr {boolean} group - One question answered with more than one control, such as a postcode and a house number. The field is then a group named by the label, as a fieldset with a legend is, and each control names itself. Without a `label` it takes no role. A radio group or a checkbox group is a group of its own already and needs no `group`.
33
61
  * @attr {object} translations - Override translation keys, such as the text of the optional badge; unset keys fall back to Dutch
34
62
  *
35
- * @slot - The slotted input (e.g. nldd-text-field), its nldd-validation-list and its nldd-form-field-help-text.
36
- *
37
- * ─────────────────────────────────────────────────────────────────────────
38
- *
39
- * @element nldd-form-field-help-text
40
- *
41
- * @slot - Help text content. Inline elements in it look as they do in nldd-text: `<strong>` and `<b>` take the bold weight from the scale, `<em>` and `<i>` are italic, `<a>` is an underlined link, `<code>` sits on a tinted surface in the monospace font and `<mark>` is highlighted. Only direct children get that styling: an element inside another (a `<code>` in an `<a>`) is left as it is.
42
- * @accepts a, strong, b, em, i, code, mark
43
- *
44
- * ─────────────────────────────────────────────────────────────────────────
63
+ * @slot - The slotted input (e.g. nldd-text-field) and its nldd-validation-list.
64
+ * @slot help-text - Help text with more than plain text in it, such as a link: an nldd-text with a `<p>` in it. It takes the look of help text, whatever `size`, `color` or `weight` it has. Takes the place of `help-text`.
45
65
  *
46
66
  * @example
47
67
  * <nldd-form-field label="Password">
@@ -50,24 +70,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
50
70
  * <nldd-validation-item id="password-required" required>This field is required.</nldd-validation-item>
51
71
  * <nldd-validation-item id="password-length" minlength="8">Must be at least 8 characters.</nldd-validation-item>
52
72
  * </nldd-validation-list>
53
- * <nldd-form-field-help-text>
54
- * We only use this to sign you in. <a href="/help">Learn more</a>.
55
- * </nldd-form-field-help-text>
73
+ * <nldd-text slot="help-text">
74
+ * <p>We only use this to sign you in. <a href="/help">Learn more</a>.</p>
75
+ * </nldd-text>
56
76
  * </nldd-form-field>
57
77
  */
58
78
  import { LitElement } from 'lit';
59
79
  import { property } from 'lit/decorators.js';
60
80
  import { customElement } from '../../../utilities/custom-element.js';
81
+ import { sameItems } from '../../../utilities/same-items.js';
61
82
  import { setOwnedAttribute } from '../../../utilities/owned-attribute.js';
62
83
  import { stripBold } from '../../../utilities/render-marked.js';
63
- import { applyDescribedBy } from '../../../utilities/described-by-mixin.js';
64
- import { formFieldStyles, formFieldHelpTextStyles, } from './form-field.styles.js';
65
- import { formFieldTemplate, formFieldHelpTextTemplate, } from './form-field.template.js';
66
- import { setState, styleValueState } from '../../../utilities/element-state.js';
84
+ import { contributeInputDescribedBy, withdrawInputDescribedBy } from '../../../utilities/described-by-mixin.js';
85
+ import { formFieldStyles } from './form-field.styles.js';
86
+ import { formFieldTemplate } from './form-field.template.js';
87
+ import { internalsOf, setState, styleValueState } from '../../../utilities/element-state.js';
67
88
  import { withTranslations } from '../../../utilities/with-translations.js';
68
89
  import { nlddFormFieldTranslations } from './form-field.i18n.js';
69
- // Exclude helper elements so _findInput() never returns them instead of the actual input
70
- const HELPER_TAGS = ['nldd-form-field-help-text'];
90
+ /** Help text in the `help-text` slot, which is never the input. */
91
+ const isHelpText = (el) => el.getAttribute('slot') === 'help-text';
71
92
  /**
72
93
  * Whether this element is the input a field is about.
73
94
  *
@@ -132,9 +153,11 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
132
153
  this.label = '';
133
154
  /**
134
155
  * Short supporting text shown below the label. Same typography as the
135
- * optional badge. Use nldd-form-field-help-text for longer descriptive text.
156
+ * optional badge. Use `help-text` for longer descriptive text.
136
157
  */
137
158
  this.supportingLabel = '';
159
+ /** Plain help text below the input. Help text with a link goes in the `help-text` slot. */
160
+ this.helpText = '';
138
161
  /**
139
162
  * When true an "Optional" badge is shown next to the label.
140
163
  * Required fields are intentionally left unmarked per design spec.
@@ -144,23 +167,49 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
144
167
  * on the slotted input element so screen readers announce it correctly.
145
168
  */
146
169
  this.optional = false;
170
+ /**
171
+ * Makes the field a group around more than one control, named by the label.
172
+ *
173
+ * Through its own role and not a `<fieldset>`: a legend in a shadow root
174
+ * does not name the controls in its slot for NVDA in Firefox, which is why
175
+ * nldd-form-section rendered its fieldset in the light DOM. A role and a
176
+ * name on the host are the same thing to assistive software, and reach.
177
+ */
178
+ this.group = false;
147
179
  this._childObserver = null;
148
- /** Watches the validation lists for items that come or go. */
149
- this._listObserver = null;
150
- /** Handed to each validation list, which calls it when an item shows or hides. */
151
- this._onItemVisibilityChange = () => this._syncDescription();
152
- /** The lists that hold that callback now, to take it back from. */
153
- this._watchedLists = [];
180
+ /** The validation lists this field told what to read and describe, to take that back from one that leaves. */
181
+ this._lists = [];
154
182
  /** The last label this field wrote onto the control, so it only takes back its own. */
155
183
  this._appliedLabel = null;
184
+ /** The control this field is about now, to hand back what it wrote when that changes. */
185
+ this._input = null;
186
+ /** The element this field contributes its supporting label and help text to: its input, or itself as a group. */
187
+ this._describing = null;
188
+ /** Tags of children that are not defined yet, waited for once each. */
189
+ this._pendingTags = new Set();
190
+ /** The inputs found last time, whose own content the observer leaves alone. */
191
+ this._inputs = [];
192
+ /** Whether this field gave itself the role of a group, to take it back. */
193
+ this._grouped = false;
194
+ /** Whether the first update is behind us: Lit reports every property as changed on that one. */
195
+ this._settled = false;
156
196
  }
157
197
  render() {
158
198
  return formFieldTemplate(this);
159
199
  }
160
200
  updated(changed) {
161
- if (changed.has('label')) {
201
+ // `firstUpdated` has looked already, with every property as it is now:
202
+ // Lit calls it in the same update, just before this.
203
+ if (!this._settled) {
204
+ this._settled = true;
205
+ return;
206
+ }
207
+ if (changed.has('label') || changed.has('optional') || changed.has('translations') || changed.has('group')) {
162
208
  this._onSlotChange();
163
209
  }
210
+ else if (changed.has('supportingLabel') || changed.has('helpText')) {
211
+ this._syncDescription();
212
+ }
164
213
  }
165
214
  willUpdate(changed) {
166
215
  super.willUpdate(changed);
@@ -169,10 +218,29 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
169
218
  }
170
219
  connectedCallback() {
171
220
  super.connectedCallback();
172
- this._childObserver = new MutationObserver(() => this._onSlotChange());
173
- this._childObserver.observe(this, { childList: true });
174
- // Moved in the DOM: `firstUpdated` does not come again, and the observer
175
- // on the validation lists only starts from here.
221
+ // The whole subtree: an input that appears later inside a wrapper (a `v-if`
222
+ // in a `div`) is as much the field's input as a direct child. Then a list
223
+ // that names another control with `for`, and help text that is hidden or
224
+ // shown, since a hidden element that is referenced is still read out.
225
+ // Only the attributes of its own children count: a slot or a `for` deeper
226
+ // down, such as in a toolbar of a text editor, is about something else.
227
+ // What changes inside an input it found is the input's own business, such
228
+ // as the options an app slots into a combo box on every keystroke, and a
229
+ // validation list describes its control with its items itself.
230
+ this._childObserver = new MutationObserver((mutations) => {
231
+ const ownChild = (m) => m.target.parentElement === this;
232
+ const inInput = (m) => this._inputs.some(input => input.contains(m.target));
233
+ const inList = (m) => Boolean(m.target.closest?.('nldd-validation-list'));
234
+ const elementsMoved = (m) => [...m.addedNodes, ...m.removedNodes].some(n => n.nodeType === Node.ELEMENT_NODE);
235
+ const moved = mutations.some(m => (ownChild(m) && (m.attributeName === 'slot' || m.attributeName === 'for'))
236
+ || (elementsMoved(m) && !inInput(m) && !inList(m)));
237
+ if (moved)
238
+ this._onSlotChange();
239
+ else if (mutations.some(m => ownChild(m) && m.attributeName === 'hidden' && isHelpText(m.target)))
240
+ this._syncDescription();
241
+ });
242
+ this._childObserver.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ['slot', 'hidden', 'for'] });
243
+ // Moved in the DOM: `firstUpdated` does not come again.
176
244
  if (this.hasUpdated)
177
245
  this._onSlotChange();
178
246
  }
@@ -182,18 +250,59 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
182
250
  disconnectedCallback() {
183
251
  super.disconnectedCallback();
184
252
  this._childObserver?.disconnect();
185
- this._listObserver?.disconnect();
186
- this._watchLists([]);
253
+ // Its input may stay on the page, moved elsewhere: take back what this
254
+ // field said about it, its name and its description. Connecting again
255
+ // says it again.
256
+ if (this._input)
257
+ this._release(this._input);
258
+ this._input = null;
259
+ for (const list of this._lists)
260
+ this._letGo(list);
261
+ this._lists = [];
262
+ // The role and name of a group stay: they are this element's own, and
263
+ // say nothing while it is off the page.
264
+ if (this._describing)
265
+ withdrawInputDescribedBy(this._describing, this);
266
+ this._describing = null;
187
267
  }
188
- /** Hands the visibility callback to these lists, and takes it back from the others. */
189
- _watchLists(lists) {
190
- for (const list of this._watchedLists) {
191
- if (!lists.includes(list) && list.onItemVisibilityChange === this._onItemVisibilityChange)
192
- list.onItemVisibilityChange = null;
268
+ /**
269
+ * Waits for each child that is not defined yet, and looks again once it is.
270
+ *
271
+ * Whether an element is an input is asked of its class, and an element whose
272
+ * class is not registered yet has none to ask. The autoloader defines tags in
273
+ * the order it meets them, so the field is often defined before its input.
274
+ * Upgrading an element fires no mutation and no `slotchange`, so without this
275
+ * the field never looks again (#512).
276
+ */
277
+ _awaitUndefined() {
278
+ for (const el of Array.from(this.querySelectorAll(':not(:defined)'))) {
279
+ const tag = el.localName;
280
+ if (this._pendingTags.has(tag))
281
+ continue;
282
+ // One wait per tag while it is undefined: a field that leaves and comes
283
+ // back before the tag arrives keeps the first wait, which still looks
284
+ // when it does. Once defined, the tag no longer matches :not(:defined).
285
+ this._pendingTags.add(tag);
286
+ // A tag that is never defined, such as one of a framework, leaves the
287
+ // promise waiting for good: it holds on to nothing more than a weak
288
+ // reference, so a field that leaves the page can go.
289
+ const field = new WeakRef(this);
290
+ customElements.whenDefined(tag).then(() => {
291
+ const self = field.deref();
292
+ if (!self)
293
+ return;
294
+ self._pendingTags.delete(tag);
295
+ if (self.isConnected)
296
+ self._onSlotChange();
297
+ });
193
298
  }
194
- for (const list of lists)
195
- list.onItemVisibilityChange = this._onItemVisibilityChange;
196
- this._watchedLists = lists;
299
+ }
300
+ /** Hands back what this field wrote on a control it is no longer about. */
301
+ _release(control) {
302
+ const attribute = this._labelAttribute(control);
303
+ if (attribute)
304
+ setOwnedAttribute(control, attribute, '', this._appliedLabel);
305
+ this._appliedLabel = null;
197
306
  }
198
307
  /**
199
308
  * Called when the label is clicked. Focuses the slotted input.
@@ -211,24 +320,40 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
211
320
  * wrap a control owe consumers that `focus()`.
212
321
  */
213
322
  _focusInput(e) {
214
- const input = this._findInput();
323
+ const input = this._findInputs()[0];
215
324
  if (!input)
216
325
  return;
217
326
  e.preventDefault();
218
327
  input.focus();
219
328
  }
220
329
  _onSlotChange() {
221
- const input = this._findInput();
330
+ this._awaitUndefined();
331
+ const inputs = this._findInputs();
332
+ this._inputs = inputs;
333
+ const input = inputs[0];
222
334
  // A consumer's own element can be an input too, which no selector can know.
223
335
  setState(this, 'has-input', Boolean(input));
336
+ if (import.meta.env?.DEV)
337
+ setState(this, 'multiple-inputs', inputs.length > 1);
338
+ this._applyGroup();
339
+ // A group names and describes itself, and none of its controls.
340
+ const named = this.group ? undefined : input;
341
+ if (this._input && this._input !== named)
342
+ this._release(this._input);
343
+ this._input = named ?? null;
224
344
  if (!input) {
345
+ if (import.meta.env?.DEV)
346
+ setState(this, 'list-reads-first-control', false);
347
+ this._adoptValidationLists(null, inputs);
348
+ this._syncDescription();
225
349
  return;
226
350
  }
227
- // Ensure the inner native input has an id so aria-describedby can reference it.
228
- // `inputId` is a component that hands out the id of the control it renders, which
229
- // is a different question from how it wants to be named, so it is asked separately
230
- // (see _applyAccessibleLabel). For plain <input> elements we set the id directly.
231
- // We never set the host element's id to avoid duplicate IDs.
351
+ // An id on the control, for the app to point at, such as a `for` on a
352
+ // validation list outside the field or a link to the field from an error
353
+ // summary. `inputId` is a component that hands out the id of the control it
354
+ // renders, which is a different question from how it wants to be named, so
355
+ // it is asked separately (see _applyAccessibleLabel). A plain <input> gets
356
+ // the id directly. The host never gets one, to avoid duplicate ids.
232
357
  if ('inputId' in input) {
233
358
  const existingId = input.inputId;
234
359
  const generatedId = existingId || generateId();
@@ -238,10 +363,26 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
238
363
  if (!input.id)
239
364
  input.id = generateId();
240
365
  }
241
- this._applyAccessibleLabel(input);
242
- this._adoptValidationLists(input);
366
+ if (named)
367
+ this._applyAccessibleLabel(named);
368
+ this._adoptValidationLists(input, inputs);
243
369
  this._syncDescription();
244
370
  }
371
+ /**
372
+ * Gives this field the role and the name of a group, or takes them back.
373
+ *
374
+ * No role without a label: a group without a name is announced as just
375
+ * "group", which tells a screen reader user less than no group at all.
376
+ */
377
+ _applyGroup() {
378
+ if (!this.group && !this._grouped)
379
+ return;
380
+ const internals = internalsOf(this);
381
+ const name = this.group ? this._accessibleName() : '';
382
+ internals.role = name ? 'group' : null;
383
+ internals.ariaLabel = name || null;
384
+ this._grouped = this.group;
385
+ }
245
386
  /**
246
387
  * Hands the label to the control as its accessible name, through whichever
247
388
  * channel the control offers.
@@ -264,53 +405,100 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
264
405
  * takes back what it did not write.
265
406
  */
266
407
  _applyAccessibleLabel(input) {
267
- const attribute = 'accessibleLabel' in input
408
+ const attribute = this._labelAttribute(input);
409
+ if (!attribute)
410
+ return;
411
+ this._appliedLabel = setOwnedAttribute(input, attribute, this._accessibleName(), this._appliedLabel);
412
+ }
413
+ /** The attribute through which this control takes a name, or null for one that names itself. */
414
+ _labelAttribute(input) {
415
+ return 'accessibleLabel' in input
268
416
  ? 'accessible-label'
269
417
  : input instanceof HTMLInputElement
270
418
  || input instanceof HTMLSelectElement
271
419
  || input instanceof HTMLTextAreaElement
272
420
  ? 'aria-label'
273
421
  : null;
274
- if (!attribute)
275
- return;
276
- this._appliedLabel = setOwnedAttribute(input, attribute, stripBold(this.label), this._appliedLabel);
277
422
  }
278
423
  /**
279
- * Hands every validation list in this field the control it is about, so it
280
- * does not have to go looking for one.
424
+ * The label as a name: without its markers, and with "optioneel" after it
425
+ * when the field is optional.
426
+ *
427
+ * The badge is on screen beside the label, and a screen reader user needs it
428
+ * as much. In the name and not the description: a description is read later
429
+ * or not at all, depending on the reader's settings, while the name is read
430
+ * every time the field is reached. This field composes the name as a string
431
+ * anyway, so where the badge sits in the layout makes no difference.
432
+ */
433
+ _accessibleName() {
434
+ const label = stripBold(this.label);
435
+ if (!label || !this.optional)
436
+ return label;
437
+ return this._t('components.form-field.optional-accessible-label', { label });
438
+ }
439
+ /**
440
+ * Tells every validation list in this field what it is about, so it does
441
+ * not have to go looking. The list describes that control with its items
442
+ * itself.
281
443
  *
282
444
  * A list with a `for` of its own is left alone: that is how you say it is
283
- * about a different control than the first.
445
+ * about a different control than the first, and it describes that one.
284
446
  *
285
- * More than one control in a field is allowed and sometimes right, a radio
286
- * group with an "Anders" text field beside it being the case this component
287
- * is built for. But a list that reads a value would then quietly read the
288
- * wrong one, and nothing on screen would show it: the rules simply never
289
- * match.
447
+ * In a `group` a list without `for` reads the value of the first control,
448
+ * judges as soon as any control of the group is `invalid`, and describes
449
+ * the group: what it says is about the question as a whole. A list that
450
+ * reads a value then quietly reads the first one, and nothing on screen
451
+ * would show it: the rules simply never match. Such a list needs a `for`.
290
452
  */
291
- _adoptValidationLists(input) {
453
+ _adoptValidationLists(input, inputs) {
292
454
  const lists = Array.from(this.children)
293
455
  .filter((el) => el.tagName.toLowerCase() === 'nldd-validation-list');
456
+ const group = this.group ? (this._accessibleName() ? this : null) : undefined;
294
457
  for (const list of lists) {
295
- if (!list.getAttribute('for'))
458
+ const own = !list.getAttribute('for');
459
+ if (own)
296
460
  list.control = input;
461
+ list.describes = own ? group : undefined;
462
+ // Only a new array when the controls changed: a new one each time
463
+ // would render every list again on each look.
464
+ const judgedBy = own && this.group ? inputs : [];
465
+ // A list that is not defined yet, as with the autoloader, has none: sameItems takes that as empty.
466
+ if (!sameItems(list.judgedBy, judgedBy))
467
+ list.judgedBy = [...judgedBy];
468
+ }
469
+ for (const list of this._lists) {
470
+ if (!lists.includes(list))
471
+ this._letGo(list);
297
472
  }
473
+ this._lists = lists;
298
474
  if (!import.meta.env?.DEV)
299
475
  return;
300
476
  const readsValue = lists.some(list => !list.getAttribute('for') && Array.from(list.children)
301
477
  .some(item => item.hasAttribute('match') || item.hasAttribute('minlength') || item.hasAttribute('maxlength')));
302
- const controls = Array.from(this.children)
303
- .filter(el => !HELPER_TAGS.includes(el.tagName.toLowerCase()) && isFormInput(el));
304
- setState(this, 'list-reads-first-control', readsValue && controls.length > 1);
478
+ setState(this, 'list-reads-first-control', readsValue && inputs.length > 1);
305
479
  }
306
480
  /**
307
- * The input this field is about: the first one in the light DOM, wrapped or
308
- * not.
481
+ * Takes back what this field told a validation list that is no longer its
482
+ * own: a list without `for` is about no control of it any more, one with a
483
+ * `for` describes that control. One that is in another field now is that
484
+ * field's to set.
485
+ */
486
+ _letGo(list) {
487
+ if (list.parentElement?.localName === 'nldd-form-field' && list.parentElement !== this)
488
+ return;
489
+ if (!list.getAttribute('for'))
490
+ list.control = null;
491
+ list.describes = undefined;
492
+ if (list.judgedBy?.length)
493
+ list.judgedBy = [];
494
+ }
495
+ /**
496
+ * The inputs in this field, in document order, wrapped or not. An input in
497
+ * another one, such as a checkbox field in a checkbox group, is part of that
498
+ * one and not counted.
309
499
  *
310
- * A field may hold more than one. A radio group whose last option is
311
- * "Anders" and the text field that appears with it are one question and
312
- * belong in one field. The first input carries the caption, and the ones
313
- * after it name themselves.
500
+ * The first is the one the field is about. A field with more than one is a
501
+ * `group`, and then names none of them.
314
502
  *
315
503
  * Looking inside matters because a `div` or an `nldd-container` around your
316
504
  * input is a normal thing to write. Stopping at that wrapper sent the id,
@@ -321,62 +509,55 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
321
509
  * and says so in DEV, rather than picking whatever came first and quietly
322
510
  * treating a tag or a button as your input.
323
511
  */
324
- _findInput() {
512
+ _findInputs() {
513
+ const found = [];
325
514
  const children = Array.from(this.children)
326
- .filter(el => !HELPER_TAGS.includes(el.tagName.toLowerCase()) && !isToolbar(el));
515
+ .filter(el => !isHelpText(el) && !isToolbar(el));
327
516
  for (const child of children) {
328
- if (isFormInput(child))
329
- return child;
330
- const nested = Array.from(child.querySelectorAll('*')).find(el => isFormInput(el) && !inToolbar(el, child));
331
- if (nested)
332
- return nested;
517
+ if (isFormInput(child)) {
518
+ found.push(child);
519
+ continue;
520
+ }
521
+ for (const el of Array.from(child.querySelectorAll('*'))) {
522
+ if (isFormInput(el) && !inToolbar(el, child) && !found.some(outer => outer.contains(el)))
523
+ found.push(el);
524
+ }
333
525
  }
334
- return undefined;
526
+ return found;
335
527
  }
336
528
  /**
337
- * Hands the control the elements that describe it.
338
- *
339
- * Elements and not ids. An IDREF resolves inside the tree of the element
340
- * that carries it, so an id written here cannot be found from inside a
341
- * component's shadow root: the attribute lands, the id is right, and the
342
- * description comes out empty. A control that renders its own input takes
343
- * `describedByElements` and puts the references where they belong; anything
344
- * that is the control itself, a native input or a host with a role of its
345
- * own, is pointed at directly.
346
- *
347
- * The items of a validation list that are on screen, not the list. Safari
348
- * passes nothing on to VoiceOver for an element whose text sits in a
349
- * `role="list"`, which the list renders, so a reference to the list was an
350
- * empty description there. Only the visible items, because an element
351
- * referenced directly is read even while it is hidden: a met requirement
352
- * would still be read out. The references change when an item shows or
353
- * hides, which is when the description changes anyway.
529
+ * Says the supporting label and the help text of this field to what it is
530
+ * about: its input, or itself as a group. A group without a name has no role
531
+ * to carry a description, so nothing. The validation lists say their own
532
+ * part, and the input puts the parts in their order: the supporting label,
533
+ * what is wrong, the help text (see `contributeInputDescribedBy`).
354
534
  *
355
- * The requirements before the plain help text: what is wrong is why you are
356
- * here.
535
+ * The supporting label and `help-text` sit in this shadow root, where no
536
+ * reference from the control can reach them, so they go over as text. Help
537
+ * text in the slot is in the light DOM and goes over as an element, which
538
+ * every control can point at: a host that carries its own role, such as a
539
+ * radio group, says text only as `aria-description`, and a browser drops
540
+ * that as soon as there is an `aria-describedby`.
357
541
  */
358
542
  _syncDescription() {
359
- const input = this._findInput();
360
- if (!input)
543
+ const target = this.group ? (this._accessibleName() ? this : null) : this._input;
544
+ if (this._describing && this._describing !== target)
545
+ withdrawInputDescribedBy(this._describing, this);
546
+ this._describing = target;
547
+ if (!target)
361
548
  return;
362
- const children = Array.from(this.children);
363
- const tag = (el) => el.tagName.toLowerCase();
364
- const lists = children.filter(el => tag(el) === 'nldd-validation-list');
365
- this._listObserver ?? (this._listObserver = new MutationObserver(() => this._syncDescription()));
366
- this._listObserver.disconnect();
367
- for (const list of lists)
368
- this._listObserver.observe(list, { childList: true, subtree: true });
369
- this._watchLists(lists);
370
- const describedBy = [
371
- ...lists.flatMap(list => Array.from(list.children).filter(el => tag(el) === 'nldd-validation-item' && el.visible)),
372
- ...children.filter(el => tag(el) === 'nldd-form-field-help-text'),
373
- ];
374
- if ('describedByElements' in input) {
375
- input.describedByElements = describedBy;
376
- }
377
- else {
378
- applyDescribedBy(input, describedBy);
379
- }
549
+ // Help text in the slot takes the place of `help-text`, also while it is hidden.
550
+ const slotted = this._helpTexts();
551
+ const supporting = stripBold(this.supportingLabel).trim();
552
+ const helpText = stripBold(this.helpText).trim();
553
+ contributeInputDescribedBy(target, this, 'supporting-label', supporting ? [supporting] : []);
554
+ contributeInputDescribedBy(target, this, 'help-text', slotted.length
555
+ ? slotted.filter(el => !el.hidden)
556
+ : helpText ? [helpText] : []);
557
+ }
558
+ /** The elements in the `help-text` slot. */
559
+ _helpTexts() {
560
+ return Array.from(this.children).filter(isHelpText);
380
561
  }
381
562
  };
382
563
  NLDDFormField.styles = formFieldStyles;
@@ -392,30 +573,17 @@ __decorate([
392
573
  __decorate([
393
574
  property({ type: String, attribute: 'supporting-label' })
394
575
  ], NLDDFormField.prototype, "supportingLabel", void 0);
576
+ __decorate([
577
+ property({ type: String, attribute: 'help-text' })
578
+ ], NLDDFormField.prototype, "helpText", void 0);
395
579
  __decorate([
396
580
  property({ type: Boolean })
397
581
  ], NLDDFormField.prototype, "optional", void 0);
582
+ __decorate([
583
+ property({ type: Boolean, reflect: true })
584
+ ], NLDDFormField.prototype, "group", void 0);
398
585
  NLDDFormField = __decorate([
399
586
  customElement('nldd-form-field')
400
587
  ], NLDDFormField);
401
588
  export { NLDDFormField };
402
- /* ============================================================
403
- nldd-form-field-help-text
404
- ============================================================ */
405
- let NLDDFormFieldHelpText = class NLDDFormFieldHelpText extends LitElement {
406
- connectedCallback() {
407
- super.connectedCallback();
408
- // Assign to the 'help' slot automatically so consumers don't need to set slot="help" manually.
409
- // Note: this will overwrite any explicit slot attribute set by the consumer.
410
- this.slot = 'help';
411
- }
412
- render() {
413
- return formFieldHelpTextTemplate(this);
414
- }
415
- };
416
- NLDDFormFieldHelpText.styles = formFieldHelpTextStyles;
417
- NLDDFormFieldHelpText = __decorate([
418
- customElement('nldd-form-field-help-text')
419
- ], NLDDFormFieldHelpText);
420
- export { NLDDFormFieldHelpText };
421
589
  //# sourceMappingURL=form-field.js.map