@nldd/design-system 0.13.2 → 0.15.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.
- package/NOTICES.md +1 -1
- package/README.md +4 -2
- package/custom-elements.json +2089 -172
- package/dist/components/actions/button/button.d.ts +1 -3
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +27 -34
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.template.d.ts.map +1 -1
- package/dist/components/actions/button/button.template.js +4 -4
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/button-bar/button-bar.d.ts +0 -2
- package/dist/components/actions/button-bar/button-bar.d.ts.map +1 -1
- package/dist/components/actions/button-bar/button-bar.js +2 -12
- package/dist/components/actions/button-bar/button-bar.js.map +1 -1
- package/dist/components/actions/button-group/button-group.d.ts +8 -3
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +40 -22
- package/dist/components/actions/button-group/button-group.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +1 -2
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +14 -12
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +4 -4
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu-divider.d.ts +1 -0
- package/dist/components/actions/menu/menu-divider.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-divider.js +1 -0
- package/dist/components/actions/menu/menu-divider.js.map +1 -1
- package/dist/components/actions/menu/menu-group.d.ts +1 -0
- package/dist/components/actions/menu/menu-group.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-group.js +1 -0
- package/dist/components/actions/menu/menu-group.js.map +1 -1
- package/dist/components/actions/menu/menu-item.d.ts +1 -0
- package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-item.js +7 -7
- package/dist/components/actions/menu/menu-item.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +26 -4
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.i18n.d.ts +2 -0
- package/dist/components/actions/menu/menu.i18n.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.i18n.js +4 -0
- package/dist/components/actions/menu/menu.i18n.js.map +1 -1
- package/dist/components/actions/menu/menu.js +57 -19
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.js +2 -1
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.d.ts +0 -2
- package/dist/components/actions/toolbar/toolbar-item.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.js +2 -20
- package/dist/components/actions/toolbar/toolbar-item.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar-title.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar-title.js +2 -1
- package/dist/components/actions/toolbar/toolbar-title.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +2 -1
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/button.i18n-DiDGynnq.js +8 -0
- package/dist/components/components.js +2357 -1255
- package/dist/components/content/avatar/avatar.d.ts +0 -2
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +2 -27
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +0 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.js +2 -24
- package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +2 -1
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts +1 -0
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.diff.d.ts +2 -0
- package/dist/components/content/code-viewer/code-viewer.diff.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.diff.js +1 -4
- package/dist/components/content/code-viewer/code-viewer.diff.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +16 -11
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +2 -0
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon.d.ts +3 -0
- package/dist/components/content/icon/icon.d.ts.map +1 -1
- package/dist/components/content/icon/icon.js +19 -15
- package/dist/components/content/icon/icon.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts.map +1 -1
- package/dist/components/content/identity/identity.js +2 -1
- package/dist/components/content/identity/identity.js.map +1 -1
- package/dist/components/content/image/image.d.ts +5 -11
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +14 -31
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/image/lqip-encoder-element.d.ts.map +1 -1
- package/dist/components/content/image/lqip-encoder-element.js +2 -1
- package/dist/components/content/image/lqip-encoder-element.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +2 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +4 -1
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +6 -2
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tag/tag.d.ts.map +1 -1
- package/dist/components/content/tag/tag.js +5 -5
- package/dist/components/content/tag/tag.js.map +1 -1
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +2 -1
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/content/title/title.d.ts +9 -5
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +23 -27
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/content/title/title.styles.d.ts.map +1 -1
- package/dist/components/content/title/title.styles.js +13 -0
- package/dist/components/content/title/title.styles.js.map +1 -1
- package/dist/components/content/token/token.d.ts.map +1 -1
- package/dist/components/content/token/token.js +2 -1
- package/dist/components/content/token/token.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +6 -2
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/content/visually-hidden/visually-hidden.js +1 -1
- package/dist/components/content/visually-hidden/visually-hidden.js.map +1 -1
- package/dist/components/{decorate-Cz9-peTN.js → decorate-CzRe1eif.js} +9 -1
- package/dist/components/{with-translations-DRuOq3QK.js → defer-focus-DIPAUUJa.js} +57 -5
- package/dist/components/dev-checks-tdnaA2UV.js +2518 -0
- package/dist/components/{dist-BaLc58I_.js → dist-245LaK9m.js} +1 -1
- package/dist/components/{dist-DgjvHvsN.js → dist-4g23YHP0.js} +1 -1
- package/dist/components/{dist-YYLChwRq.js → dist-Bf823YyL.js} +1 -1
- package/dist/components/{dist-Bm3708s5.js → dist-CeMOOqgP.js} +13 -1
- package/dist/components/{dist-CJ9uLG0u.js → dist-DFjwTlJV.js} +1 -1
- package/dist/components/element-state-BnarBv0M.js +42 -0
- package/dist/components/forms/form/form.d.ts +1 -96
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +1 -0
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.d.ts.map +1 -1
- package/dist/components/forms/form-actions/form-actions.js +2 -1
- package/dist/components/forms/form-actions/form-actions.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +3 -4
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +14 -29
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/forms/form-field/form-field.template.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.template.js +3 -2
- package/dist/components/forms/form-field/form-field.template.js.map +1 -1
- package/dist/components/forms/form-section/form-section.d.ts +1 -67
- package/dist/components/forms/form-section/form-section.d.ts.map +1 -1
- package/dist/components/forms/form-section/form-section.js +2 -16
- package/dist/components/forms/form-section/form-section.js.map +1 -1
- package/dist/components/forms/validation-list/validation-list.d.ts +26 -0
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.i18n.d.ts +12 -0
- package/dist/components/forms/validation-list/validation-list.i18n.d.ts.map +1 -0
- package/dist/components/forms/validation-list/validation-list.i18n.js +11 -0
- package/dist/components/forms/validation-list/validation-list.i18n.js.map +1 -0
- package/dist/components/forms/validation-list/validation-list.js +81 -8
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/{icon-DRpTWSIg.js → icon-BPNDyhu9.js} +18 -4
- package/dist/components/{icon-button-DUEmWlBD.js → icon-button-Dbo_SGor.js} +51 -29
- package/dist/components/icon-button.i18n-1_N-wN6x.js +10 -0
- package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.js +5 -1
- package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.js +5 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.js +2 -1
- package/dist/components/inputs/code-editor/code-editor.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js +36 -13
- package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts +4 -0
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +16 -5
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.i18n.js +4 -4
- package/dist/components/inputs/date-field/date-field.i18n.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +2 -1
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.d.ts +3 -3
- package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.i18n.d.ts +2 -2
- package/dist/components/inputs/date-picker/date-picker.i18n.js +2 -2
- package/dist/components/inputs/date-picker/date-picker.i18n.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.js +5 -1
- package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js +2 -2
- package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +10 -5
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts +147 -17
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.drop.d.ts +16 -1
- package/dist/components/inputs/file-field/file-field.drop.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.drop.js +33 -0
- package/dist/components/inputs/file-field/file-field.drop.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.i18n.d.ts +11 -1
- package/dist/components/inputs/file-field/file-field.i18n.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.i18n.js +16 -6
- package/dist/components/inputs/file-field/file-field.i18n.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +421 -75
- package/dist/components/inputs/file-field/file-field.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.js +235 -91
- package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.d.ts +2 -1
- package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.js +282 -83
- package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.truncate.d.ts +17 -0
- package/dist/components/inputs/file-field/file-field.truncate.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.truncate.js +26 -3
- package/dist/components/inputs/file-field/file-field.truncate.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js +2 -4
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.js +5 -4
- package/dist/components/inputs/number-field/number-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.js +2 -1
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +2 -1
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.js +2 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.js.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts +0 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.js +5 -6
- package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +5 -1
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +0 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +7 -11
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/slider/slider.d.ts +32 -10
- package/dist/components/inputs/slider/slider.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.js +115 -35
- package/dist/components/inputs/slider/slider.js.map +1 -1
- package/dist/components/inputs/slider/slider.styles.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.styles.js +22 -13
- package/dist/components/inputs/slider/slider.styles.js.map +1 -1
- package/dist/components/inputs/slider/slider.template.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.template.js +12 -4
- package/dist/components/inputs/slider/slider.template.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +5 -1
- package/dist/components/inputs/stepper/stepper.js.map +1 -1
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +5 -4
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.d.ts.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.js +5 -1
- package/dist/components/inputs/switch-field/switch-field.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.code-copy.js +2 -2
- package/dist/components/inputs/text-editor/text-editor.code-copy.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.cursor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.cursor.js +1 -11
- package/dist/components/inputs/text-editor/text-editor.cursor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js +127 -11
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +3 -1
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.i18n.js +5 -1
- package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +14 -8
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts +3 -0
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.js +9 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +9 -2
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +61 -147
- package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.js +187 -2
- package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.d.ts +1 -5
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +9 -23
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.i18n.js +3 -3
- package/dist/components/inputs/time-field/time-field.i18n.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.js +2 -1
- package/dist/components/inputs/time-field/time-field.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.js +5 -1
- package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +0 -2
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +5 -23
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts +0 -2
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js +5 -12
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.d.ts +4 -0
- package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.i18n.d.ts +1 -1
- package/dist/components/inputs/token-field/token-field.i18n.js +1 -1
- package/dist/components/inputs/token-field/token-field.i18n.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.js +14 -1
- package/dist/components/inputs/token-field/token-field.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.template.js +1 -1
- package/dist/components/inputs/token-field/token-field.template.js.map +1 -1
- package/dist/components/just-in-time-education.i18n-BgCd3s-c.js +395 -0
- package/dist/components/layout/box/box.d.ts.map +1 -1
- package/dist/components/layout/box/box.js +2 -1
- package/dist/components/layout/box/box.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +0 -1
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.js +2 -15
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/card/card.template.js +2 -2
- package/dist/components/layout/collection/collection.d.ts +4 -2
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +64 -32
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/collection/collection.template.js +1 -1
- package/dist/components/layout/collection/collection.template.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +6 -3
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +17 -23
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/divider/divider.js +1 -1
- package/dist/components/layout/divider/divider.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +2 -3
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +9 -12
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts +2 -0
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +13 -7
- package/dist/components/layout/page-footer/page-footer.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.styles.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.styles.js +22 -8
- package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.template.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.template.js +2 -0
- package/dist/components/layout/page-footer/page-footer.template.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +2 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts +0 -1
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.js +9 -28
- package/dist/components/layout/page-sections/hero/hero-corner.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +1 -4
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +7 -29
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +2 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +2 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +2 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.js +2 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +2 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +14 -6
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +26 -30
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +0 -2
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +9 -20
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/shell/shell.d.ts.map +1 -1
- package/dist/components/layout/shell/shell.js +2 -1
- package/dist/components/layout/shell/shell.js.map +1 -1
- package/dist/components/layout/spacer/spacer.d.ts.map +1 -1
- package/dist/components/layout/spacer/spacer.js +2 -1
- package/dist/components/layout/spacer/spacer.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +6 -6
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +9 -12
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +2 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +2 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.js +2 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.js.map +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js +2 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js +2 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js.map +1 -1
- package/dist/components/layout/task-board/task-board-column.d.ts.map +1 -1
- package/dist/components/layout/task-board/task-board-column.js +2 -4
- package/dist/components/layout/task-board/task-board-column.js.map +1 -1
- package/dist/components/layout/task-board/task-board.d.ts +1 -1
- package/dist/components/layout/task-board/task-board.d.ts.map +1 -1
- package/dist/components/layout/task-board/task-board.js +12 -7
- package/dist/components/layout/task-board/task-board.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +0 -1
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +4 -6
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/list-item.i18n-89uqlBMK.js +8 -0
- package/dist/components/list.i18n-CKqbhFQ_.js +13 -0
- package/dist/components/lists-and-tables/cells/cell/cell.d.ts +2 -0
- package/dist/components/lists-and-tables/cells/cell/cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.js +4 -2
- package/dist/components/lists-and-tables/cells/cell/cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts +2 -0
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js +4 -2
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js +2 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts +1 -0
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js +3 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.js +2 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts +0 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js +5 -15
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +2 -0
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +4 -2
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +7 -2
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +5 -4
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +5 -23
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.i18n.d.ts +1 -1
- package/dist/components/lists-and-tables/list/list.i18n.js +1 -1
- package/dist/components/lists-and-tables/list/list.js +54 -99
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +18 -16
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +61 -88
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +3 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +17 -13
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +1 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +24 -13
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +58 -45
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +2 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +4 -4
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.d.ts +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.js +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +7 -6
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.js +2 -1
- package/dist/components/navigation/link/link.js.map +1 -1
- package/dist/components/navigation/link/link.styles.d.ts.map +1 -1
- package/dist/components/navigation/link/link.styles.js +0 -4
- package/dist/components/navigation/link/link.styles.js.map +1 -1
- package/dist/components/navigation/link/link.template.js +2 -2
- package/dist/components/navigation/menu-bar/menu-bar.d.ts +4 -0
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +17 -10
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.styles.js +9 -0
- package/dist/components/navigation/menu-bar/menu-bar.styles.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.template.js +25 -19
- package/dist/components/navigation/menu-bar/menu-bar.template.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +12 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.d.ts.map +1 -1
- package/dist/components/navigation/pagination/pagination.i18n.d.ts +3 -3
- package/dist/components/navigation/pagination/pagination.i18n.js +3 -3
- package/dist/components/navigation/pagination/pagination.i18n.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +2 -1
- package/dist/components/navigation/pagination/pagination.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.template.js +3 -3
- package/dist/components/navigation/pagination/pagination.template.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.js +6 -8
- package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +8 -15
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +0 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +6 -6
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +11 -0
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +44 -6
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.template.js +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.template.js.map +1 -1
- package/dist/components/nl.generated-D-8UF1iR.js +62 -0
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +5 -4
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.js +3 -6
- package/dist/components/status-and-feedback/badge/badge.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.js +2 -1
- package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts +2 -2
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +4 -3
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js +9 -2
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +2 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +1 -4
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +3 -15
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js +9 -6
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +3 -7
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +4 -5
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +2 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js +8 -7
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +0 -7
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.js +2 -24
- package/dist/components/status-and-feedback/step-bar/step-bar.js.map +1 -1
- package/dist/components/{visibility-mixin-C-K7ho5Q.js → visibility-mixin-CNCT26tu.js} +1 -7
- package/dist/css/rich-text.css +5 -0
- package/dist/nldd.min.js +1493 -997
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +44 -22
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +44 -22
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +32 -10
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/nl.generated.js +2 -0
- package/dist/translations/nl.generated.js.map +1 -1
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +44 -22
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +44 -22
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/vue.d.ts +123 -35
- package/dist/utilities/carried-context.d.ts +14 -3
- package/dist/utilities/carried-context.d.ts.map +1 -1
- package/dist/utilities/carried-context.js +12 -5
- package/dist/utilities/carried-context.js.map +1 -1
- package/dist/utilities/codemirror/codemirror-input.d.ts +0 -2
- package/dist/utilities/codemirror/codemirror-input.d.ts.map +1 -1
- package/dist/utilities/codemirror/codemirror-input.js +0 -14
- package/dist/utilities/codemirror/codemirror-input.js.map +1 -1
- package/dist/utilities/custom-element.d.ts +7 -0
- package/dist/utilities/custom-element.d.ts.map +1 -0
- package/dist/utilities/custom-element.js +7 -0
- package/dist/utilities/custom-element.js.map +1 -0
- package/dist/utilities/defer-focus.d.ts +24 -0
- package/dist/utilities/defer-focus.d.ts.map +1 -0
- package/dist/utilities/defer-focus.js +33 -0
- package/dist/utilities/defer-focus.js.map +1 -0
- package/dist/utilities/dev-checks-trigger.d.ts +2 -0
- package/dist/utilities/dev-checks-trigger.d.ts.map +1 -0
- package/dist/utilities/dev-checks-trigger.js +10 -0
- package/dist/utilities/dev-checks-trigger.js.map +1 -0
- package/dist/utilities/dev-checks.d.ts +40 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -0
- package/dist/utilities/dev-checks.js +115 -0
- package/dist/utilities/dev-checks.js.map +1 -0
- package/dist/utilities/dev-rules.generated.d.ts +3 -0
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -0
- package/dist/utilities/dev-rules.generated.js +2487 -0
- package/dist/utilities/dev-rules.generated.js.map +1 -0
- package/dist/utilities/element-state.d.ts +19 -0
- package/dist/utilities/element-state.d.ts.map +1 -0
- package/dist/utilities/element-state.js +49 -0
- package/dist/utilities/element-state.js.map +1 -0
- package/dist/utilities/file-drag-and-drop.d.ts +18 -0
- package/dist/utilities/file-drag-and-drop.d.ts.map +1 -0
- package/dist/utilities/file-drag-and-drop.js +31 -0
- package/dist/utilities/file-drag-and-drop.js.map +1 -0
- package/dist/utilities/form-associated-mixin.d.ts.map +1 -1
- package/dist/utilities/form-associated-mixin.js +2 -1
- package/dist/utilities/form-associated-mixin.js.map +1 -1
- package/dist/utilities/link-hint.d.ts +2 -21
- package/dist/utilities/link-hint.d.ts.map +1 -1
- package/dist/utilities/link-hint.js +22 -8
- package/dist/utilities/link-hint.js.map +1 -1
- package/dist/utilities/list-items.d.ts +10 -0
- package/dist/utilities/list-items.d.ts.map +1 -0
- package/dist/utilities/list-items.js +21 -0
- package/dist/utilities/list-items.js.map +1 -0
- package/dist/utilities/popover-target.d.ts +14 -0
- package/dist/utilities/popover-target.d.ts.map +1 -0
- package/dist/utilities/popover-target.js +21 -0
- package/dist/utilities/popover-target.js.map +1 -0
- package/dist/utilities/popup-anchor-controller.d.ts.map +1 -1
- package/dist/utilities/popup-anchor-controller.js +6 -1
- package/dist/utilities/popup-anchor-controller.js.map +1 -1
- package/dist/utilities/render-marked.d.ts +2 -0
- package/dist/utilities/render-marked.d.ts.map +1 -1
- package/dist/utilities/render-marked.js +4 -0
- package/dist/utilities/render-marked.js.map +1 -1
- package/dist/utilities/row-header-mixin.d.ts +31 -0
- package/dist/utilities/row-header-mixin.d.ts.map +1 -0
- package/dist/utilities/row-header-mixin.js +44 -0
- package/dist/utilities/row-header-mixin.js.map +1 -0
- package/dist/utilities/spacing-scale.d.ts +4 -5
- package/dist/utilities/spacing-scale.d.ts.map +1 -1
- package/dist/utilities/spacing-scale.js +4 -23
- package/dist/utilities/spacing-scale.js.map +1 -1
- package/dist/utilities/translations.d.ts.map +1 -1
- package/dist/utilities/translations.js +3 -15
- package/dist/utilities/translations.js.map +1 -1
- package/dist/utilities/visibility-mixin.d.ts +7 -0
- package/dist/utilities/visibility-mixin.d.ts.map +1 -1
- package/dist/utilities/visibility-mixin.js +0 -10
- package/dist/utilities/visibility-mixin.js.map +1 -1
- package/lint/cli.js +18 -0
- package/lint/data.generated.json +1 -0
- package/lint/engine.js +191 -0
- package/lint/fix.js +293 -0
- package/lint/format.js +133 -0
- package/lint/frontends.js +483 -0
- package/lint/linter.js +262 -0
- package/lint/main.js +279 -0
- package/lint/project.js +143 -0
- package/lint/rule-data.js +83 -0
- package/lint/rule-index.js +20 -0
- package/lint/rule.schema.json +65 -0
- package/lint/tree.js +131 -0
- package/package.json +22 -4
package/lint/linter.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lints one source text: parse, built-in checks from the component contract,
|
|
3
|
+
* rules from src/rules/, then the suppressions written in the file.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { createEngine } from './engine.js';
|
|
7
|
+
import { canFix, stuckTags } from './fix.js';
|
|
8
|
+
import { applyWrappers, parseSource } from './frontends.js';
|
|
9
|
+
import { BUILT_IN_RULES, createCanonical, loadData } from './rule-data.js';
|
|
10
|
+
import { BOUND, walk } from './tree.js';
|
|
11
|
+
|
|
12
|
+
export { BUILT_IN_RULES, createCanonical, loadData };
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/** Valid on any element, so the manifest does not list them per component. */
|
|
16
|
+
const GLOBAL_ATTRIBUTE =
|
|
17
|
+
/^(id|class|style|slot|hidden|lang|dir|title|role|tabindex|part|inert|draggable|contenteditable|spellcheck|translate|accesskey|autofocus|enterkeyhint|inputmode|is|nonce|popover|key|ref|exportparts|item(prop|scope|type|id|ref)|i18n(-.*)?|data-.*|aria-.*|hx-.*|x-.*|on(?!ly$)[a-z]+)$/;
|
|
18
|
+
|
|
19
|
+
/** Set as a property on any element: in markup these are bindings, not attributes. */
|
|
20
|
+
const DOM_PROPERTY = /^(textContent|innerHTML|innerText|outerHTML|className|tabIndex|aria[A-Z].*)$/;
|
|
21
|
+
|
|
22
|
+
/** An Angular directive of the app. Angular's own, such as `ngIf` and `routerLink`, take no inputs here. */
|
|
23
|
+
const APP_DIRECTIVE = /^(?!(ng|router|form)[A-Z])[a-z]+[A-Z]/;
|
|
24
|
+
const hasAppDirective = (node) => [...node.attrs.keys()].some((name) => APP_DIRECTIVE.test(name));
|
|
25
|
+
|
|
26
|
+
const ICON_ATTRIBUTES = new Set(['icon', 'start-icon', 'end-icon', 'selected-icon']);
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const toCamelCase = (name) => name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
30
|
+
|
|
31
|
+
/** `[accessibleLabel]` and `:accessibleLabel` set the same thing as `accessible-label`. */
|
|
32
|
+
function readPropertyNames(roots, tags, isPlainHtml) {
|
|
33
|
+
const visit = (node) => {
|
|
34
|
+
const contract = tags[node.name];
|
|
35
|
+
for (const [name, value] of contract ? [...node.attrs] : []) {
|
|
36
|
+
const attribute = name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
37
|
+
// In HTML itself a capital means nothing: the browser lowercases the name.
|
|
38
|
+
if (attribute === name || !contract.attrs[attribute] || (isPlainHtml && value !== BOUND)) continue;
|
|
39
|
+
node.attrs.delete(name);
|
|
40
|
+
node.attrs.set(attribute, value);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
for (const root of roots) walk(root, visit);
|
|
44
|
+
return roots;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function checkAttributes(node, { tags, icons, anyChildAttrs, isPlainHtml }, report) {
|
|
48
|
+
if (node.templated) return;
|
|
49
|
+
const contract = tags[node.name];
|
|
50
|
+
// A parent in another file may be the one reading it, so any child attribute goes.
|
|
51
|
+
const fromParent = node.parent.opaque ? anyChildAttrs : (tags[node.parent.name]?.childAttrs ?? {});
|
|
52
|
+
for (const [name, value] of node.attrs) {
|
|
53
|
+
const attribute = contract.attrs[name] ?? fromParent[name];
|
|
54
|
+
if (ICON_ATTRIBUTES.has(name) && attribute && typeof value === 'string' && value !== '') {
|
|
55
|
+
if (!icons.has(value)) report('unknown-icon', `There is no icon named "${value}".`);
|
|
56
|
+
}
|
|
57
|
+
if (attribute?.deprecated) {
|
|
58
|
+
const detail = attribute.deprecated === true ? '' : ` ${attribute.deprecated}`;
|
|
59
|
+
report('deprecated', `\`${name}\` on ${node.name} is deprecated.${detail}`, name);
|
|
60
|
+
}
|
|
61
|
+
if (attribute) {
|
|
62
|
+
if (attribute.values && typeof value === 'string' && !attribute.values.includes(value)) {
|
|
63
|
+
const allowed = attribute.values.filter(Boolean).join(', ');
|
|
64
|
+
report('invalid-value', `\`${name}="${value}"\` is not valid on ${node.name}: use ${allowed}.`, name);
|
|
65
|
+
}
|
|
66
|
+
} else if (value === BOUND && contract.props.includes(toCamelCase(name))) {
|
|
67
|
+
// A property without an attribute, which only a binding can reach.
|
|
68
|
+
} else if (value === BOUND && DOM_PROPERTY.test(name)) {
|
|
69
|
+
// Every element has this one.
|
|
70
|
+
} else if (isPlainHtml && /[A-Z]/.test(name)) {
|
|
71
|
+
// HTML has no capitals, so in an .html file this is a template directive.
|
|
72
|
+
} else if (contract.attrs[name.toLowerCase()]) {
|
|
73
|
+
// `maxLength`: no such property, so it ends up as the attribute, in lowercase.
|
|
74
|
+
} else if (!GLOBAL_ATTRIBUTE.test(name.toLowerCase()) && !node.wrapped) {
|
|
75
|
+
// `[show]` next to `appSheetSync` may be an input of that directive, or a typo.
|
|
76
|
+
const maybeInput = isPlainHtml && value === BOUND && hasAppDirective(node);
|
|
77
|
+
if (maybeInput) report('unknown-attribute', `${node.name} has no attribute \`${name}\`. That is fine if a directive on this element takes it.`, name, 'hint');
|
|
78
|
+
else report('unknown-attribute', `${node.name} has no attribute \`${name}\`.`, name);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function checkSlot(node, tags, report) {
|
|
84
|
+
const slot = node.attrs.get('slot');
|
|
85
|
+
const parent = node.parent;
|
|
86
|
+
if (typeof slot !== 'string' || !slot || parent.opaque || !parent.name.startsWith('nldd-')) return;
|
|
87
|
+
const contract = tags[parent.name];
|
|
88
|
+
if (contract && !contract.anySlot && !contract.slots.includes(slot)) {
|
|
89
|
+
report('unknown-slot', `${parent.name} has no slot "${slot}".`, 'slot');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function builtInFindings(root, context) {
|
|
94
|
+
const { tags } = context;
|
|
95
|
+
const findings = [];
|
|
96
|
+
walk(root, (node) => {
|
|
97
|
+
if (!node.name.startsWith('nldd-')) return;
|
|
98
|
+
const report = (rule, message, attribute, severity = BUILT_IN_RULES[rule].severity) =>
|
|
99
|
+
findings.push({ rule, severity, message, node, attribute });
|
|
100
|
+
const contract = tags[node.name];
|
|
101
|
+
if (!contract) {
|
|
102
|
+
report('unknown-element', `${node.name} does not exist in this version.`, node.name);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
checkAttributes(node, context, report);
|
|
106
|
+
checkSlot(node, tags, report);
|
|
107
|
+
});
|
|
108
|
+
return findings;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const SUPPRESSION = /nldd-lint-disable-next-line\s+([\w-]+(?:\s*,\s*[\w-]+)*)(?:\s+--(?!-*>)\s*(\S.*?))?\s*(?:-->|\*\/|-?#\}|$)/;
|
|
112
|
+
|
|
113
|
+
function readSuppressions(source, canonical) {
|
|
114
|
+
const suppressed = new Map();
|
|
115
|
+
const missingReason = [];
|
|
116
|
+
source.split('\n').forEach((text, index) => {
|
|
117
|
+
const match = text.trimEnd().match(SUPPRESSION);
|
|
118
|
+
if (!match) return;
|
|
119
|
+
if (!match[2]) missingReason.push(index + 1);
|
|
120
|
+
suppressed.set(index + 2, new Set(match[1].split(',').map((id) => canonical(id.trim()))));
|
|
121
|
+
});
|
|
122
|
+
return { suppressed, missingReason };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function syntaxError({ message, offset }, position) {
|
|
126
|
+
const rule = 'syntax-error';
|
|
127
|
+
const { severity, description } = BUILT_IN_RULES[rule];
|
|
128
|
+
return { rule, severity, message: `${description} ${message}`, tag: '', ...position(offset) };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function createPositions(source) {
|
|
132
|
+
const starts = [0];
|
|
133
|
+
for (let i = 0; i < source.length; i++) if (source[i] === '\n') starts.push(i + 1);
|
|
134
|
+
return (offset) => {
|
|
135
|
+
let low = 0;
|
|
136
|
+
let high = starts.length - 1;
|
|
137
|
+
while (low < high) {
|
|
138
|
+
const middle = Math.ceil((low + high) / 2);
|
|
139
|
+
if (starts[middle] <= offset) low = middle;
|
|
140
|
+
else high = middle - 1;
|
|
141
|
+
}
|
|
142
|
+
return { line: low + 1, column: offset - starts[low] + 1 };
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
export function createLinter(data = loadData(), { wrappers = {}, severities: configured = {} } = {}) {
|
|
148
|
+
const canonical = createCanonical(data);
|
|
149
|
+
const severities = Object.fromEntries(Object.entries(configured).map(([id, level]) => [canonical(id), level]));
|
|
150
|
+
const context = {
|
|
151
|
+
tags: data.tags,
|
|
152
|
+
icons: new Set(data.icons),
|
|
153
|
+
anyChildAttrs: Object.assign({}, ...Object.values(data.tags).map((tag) => tag.childAttrs)),
|
|
154
|
+
};
|
|
155
|
+
const engine = createEngine({ classes: data.classes });
|
|
156
|
+
const rules = data.rules.filter((rule) => !rule.runtime && severities[rule.id] !== 'off');
|
|
157
|
+
const ranInSource = (id) => severities[id] !== 'off' && (rules.some((rule) => rule.id === id) || id in BUILT_IN_RULES);
|
|
158
|
+
const isRule = (id) => id in BUILT_IN_RULES || data.rules.some((rule) => rule.id === id);
|
|
159
|
+
|
|
160
|
+
/** A rule about a name or value that is gone says what to use instead; the generic finding adds nothing. */
|
|
161
|
+
function withoutCovered(findings) {
|
|
162
|
+
return findings.filter(
|
|
163
|
+
({ attribute, node }) =>
|
|
164
|
+
!attribute || !findings.some((other) => other.node === node && other.covers?.includes(attribute)),
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** A wrapper has an API of its own, and a bound name can be the input of a directive. */
|
|
169
|
+
function isOurs(node, rule, isPlainHtml) {
|
|
170
|
+
const maybeInput = isPlainHtml && hasAppDirective(node) && rule.removed?.some((name) => node.attrs.has(name));
|
|
171
|
+
return !node.wrapped && !maybeInput;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function lintRoots(roots, isPlainHtml) {
|
|
175
|
+
const findings = [];
|
|
176
|
+
const counts = { failed: 0, passed: 0, cantTell: 0 };
|
|
177
|
+
for (const root of roots) {
|
|
178
|
+
findings.push(...builtInFindings(root, { ...context, isPlainHtml }));
|
|
179
|
+
for (const rule of rules) {
|
|
180
|
+
for (const { node, outcome } of engine.evaluate(rule, root)) {
|
|
181
|
+
counts[outcome]++;
|
|
182
|
+
// A name that is gone is wrong whatever the binding holds.
|
|
183
|
+
const namesRemoved = rule.removed?.some((name) => node.attrs.get(name) === BOUND);
|
|
184
|
+
if (outcome !== 'failed' && !(outcome === 'cantTell' && namesRemoved)) continue;
|
|
185
|
+
findings.push({
|
|
186
|
+
rule: rule.id,
|
|
187
|
+
severity: rule.severity,
|
|
188
|
+
message: rule.message,
|
|
189
|
+
node,
|
|
190
|
+
covers: [...(rule.removed ?? []), ...Object.keys(rule.fix?.value ?? {})],
|
|
191
|
+
fix: isOurs(node, rule, isPlainHtml) ? rule.fix : undefined,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return { findings: withoutCovered(findings), counts };
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** @returns {Promise<{ findings: object[], counts: object }>} */
|
|
200
|
+
async function lintSource(source, filename) {
|
|
201
|
+
const parsed = applyWrappers(await parseSource(source, filename), wrappers);
|
|
202
|
+
const isPlainHtml = /\.(html?|j2|jinja2?)$/.test(filename);
|
|
203
|
+
const roots = readPropertyNames(parsed, data.tags, isPlainHtml);
|
|
204
|
+
const { findings, counts } = lintRoots(roots, isPlainHtml);
|
|
205
|
+
const { suppressed, missingReason } = readSuppressions(source, canonical);
|
|
206
|
+
const position = createPositions(source);
|
|
207
|
+
const aboutSuppression = (rule, line, detail = BUILT_IN_RULES[rule].description) => ({
|
|
208
|
+
rule,
|
|
209
|
+
severity: BUILT_IN_RULES[rule].severity,
|
|
210
|
+
message: detail,
|
|
211
|
+
tag: '',
|
|
212
|
+
line,
|
|
213
|
+
column: 1,
|
|
214
|
+
});
|
|
215
|
+
const all = findings
|
|
216
|
+
.map(({ node, severity, covers, attribute, ...finding }) => ({
|
|
217
|
+
...finding,
|
|
218
|
+
severity,
|
|
219
|
+
tag: node.name,
|
|
220
|
+
offset: node.offset,
|
|
221
|
+
endOffset: node.endOffset,
|
|
222
|
+
...position(node.offset),
|
|
223
|
+
}));
|
|
224
|
+
const stuck = stuckTags(source, all, /\.[jt]sx$/.test(filename));
|
|
225
|
+
for (const finding of all) {
|
|
226
|
+
if (finding.fix && (!canFix(source, finding) || (finding.fix.tag && stuck.has(finding.tag)))) finding.fix = undefined;
|
|
227
|
+
}
|
|
228
|
+
const fires = (line, id) => all.some((finding) => finding.line === line && finding.rule === id);
|
|
229
|
+
// A rule that did not run here says nothing, and Markdown shows a suppression as an example.
|
|
230
|
+
const unneeded = /\.md$/.test(filename) || parsed.length === 0 || parsed.syntaxError
|
|
231
|
+
? []
|
|
232
|
+
: [...suppressed].flatMap(([line, ids]) =>
|
|
233
|
+
[...ids]
|
|
234
|
+
.filter((id) => !isRule(id) || (ranInSource(id) && !fires(line, id)))
|
|
235
|
+
.map((id) => {
|
|
236
|
+
const detail = isRule(id) ? 'does not fire on the next line, so this suppression can go.' : 'is not a rule, so this suppression does nothing.';
|
|
237
|
+
return aboutSuppression('suppression-not-needed', line - 1, `\`${id}\` ${detail}`);
|
|
238
|
+
}),
|
|
239
|
+
);
|
|
240
|
+
const located = all
|
|
241
|
+
.filter((finding) => !suppressed.get(finding.line)?.has(finding.rule))
|
|
242
|
+
.concat(missingReason.map((line) => aboutSuppression('suppression-needs-reason', line)), unneeded)
|
|
243
|
+
.concat(parsed.syntaxError ? [syntaxError(parsed.syntaxError, position)] : [])
|
|
244
|
+
.map((finding) => ({ ...finding, severity: severities[finding.rule] ?? finding.severity }))
|
|
245
|
+
.filter((finding) => finding.severity !== 'off');
|
|
246
|
+
located.sort((a, b) => a.line - b.line || a.column - b.column);
|
|
247
|
+
return { findings: located, counts };
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/** Evaluates one rule on a snippet, for the examples of that rule. */
|
|
251
|
+
async function outcomesOf(rule, snippet) {
|
|
252
|
+
const isDocument = snippet.startsWith('<html');
|
|
253
|
+
const parsed = isDocument
|
|
254
|
+
? await parseSource(snippet, 'example.html')
|
|
255
|
+
: await parseSource(`<template>${snippet}</template>`, 'example.vue');
|
|
256
|
+
return parsed.flatMap((root) => engine.evaluate(rule, root).map(({ outcome }) => outcome));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return { lintSource, outcomesOf };
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export { BOUND };
|
package/lint/main.js
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/** The `nldd` command, started from cli.js. */
|
|
2
|
+
|
|
3
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, extname, join, relative, resolve, sep } from 'node:path';
|
|
5
|
+
import { parseArgs } from 'node:util';
|
|
6
|
+
import { applyFixes, linesNaming, renameReferences } from './fix.js';
|
|
7
|
+
import { formatGithub, formatJson, formatStatistics, formatText } from './format.js';
|
|
8
|
+
import { BUILT_IN_RULES, createCanonical, loadData, GROUPS, resolveSeverities } from './rule-data.js';
|
|
9
|
+
import { rulesAboutTag } from './rule-index.js';
|
|
10
|
+
import { applyBaseline, findFiles, IGNORED_DIRECTORIES, readBaseline, readConfig, REFERENCE_EXTENSIONS, writeBaseline } from './project.js';
|
|
11
|
+
|
|
12
|
+
const USAGE = `Usage:
|
|
13
|
+
nldd lint [paths...] check files; without paths, the whole project
|
|
14
|
+
--format text|json|github default: text
|
|
15
|
+
--fix apply the fixes that are certain: what only got another name
|
|
16
|
+
--update-baseline accept what is there now, report only new findings
|
|
17
|
+
--max-warnings <n> exit 1 above this number of warnings
|
|
18
|
+
--select <groups or rules> only these, comma separated
|
|
19
|
+
--ignore <groups or rules> all but these
|
|
20
|
+
--statistics count per rule instead of listing every finding
|
|
21
|
+
--stdin --filename <name> check a snippet instead of files
|
|
22
|
+
nldd explain <rule> what a rule checks, and why
|
|
23
|
+
nldd rules [--for <tag>] [--group <group>] [--json]
|
|
24
|
+
list the rules, or those about one component or group
|
|
25
|
+
groups: api, a11y, copy, structure, pattern
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
29
|
+
|
|
30
|
+
function findRule(data, id) {
|
|
31
|
+
const rule = data.rules.find((r) => r.id === id || r.aliases?.includes(id));
|
|
32
|
+
if (rule) return rule;
|
|
33
|
+
return BUILT_IN_RULES[id] ? { id, group: 'api', ...BUILT_IN_RULES[id], message: BUILT_IN_RULES[id].description } : undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function explain(data, id) {
|
|
37
|
+
const rule = findRule(data, id);
|
|
38
|
+
if (!rule) {
|
|
39
|
+
console.error(`Unknown rule: ${id}`);
|
|
40
|
+
return 2;
|
|
41
|
+
}
|
|
42
|
+
const lines = [`${rule.id} (${rule.group}, ${rule.severity})`, '', rule.message];
|
|
43
|
+
if (rule.url) lines.push('', `Why: ${rule.url}`);
|
|
44
|
+
if (rule.runtime) lines.push('', 'Only the running page can tell, so this runs in the browser while developing.');
|
|
45
|
+
if (rule.examples) {
|
|
46
|
+
lines.push('', 'Fine:', ...rule.examples.passed.map((example) => ` ${example}`));
|
|
47
|
+
lines.push('', 'Wrong:', ...rule.examples.failed.map((example) => ` ${example}`));
|
|
48
|
+
}
|
|
49
|
+
console.log(lines.join('\n'));
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function listRules(data, { tag, group, json }) {
|
|
54
|
+
if (group && !GROUPS.includes(group)) throw new Error(`Unknown group: ${group}. Use one of ${GROUPS.join(', ')}.`);
|
|
55
|
+
const rules = (tag ? rulesAboutTag(data.rules, tag) : data.rules).filter((rule) => !group || rule.group === group);
|
|
56
|
+
if (json) console.log(JSON.stringify(rules, null, 2));
|
|
57
|
+
else for (const rule of rules) console.log(`${rule.id} (${rule.group}, ${rule.severity}) ${rule.message}`);
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Walks up, so a package in a monorepo finds the version hoisted to the root. */
|
|
62
|
+
function installedVersion(directory) {
|
|
63
|
+
for (;;) {
|
|
64
|
+
const path = join(directory, 'node_modules/@nldd/design-system/package.json');
|
|
65
|
+
if (existsSync(path)) return JSON.parse(readFileSync(path, 'utf8')).version;
|
|
66
|
+
const parent = dirname(directory);
|
|
67
|
+
if (parent === directory) return undefined;
|
|
68
|
+
directory = parent;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The linter knows the API of its own version, so a project's own `nldd` is always
|
|
74
|
+
* right. A newer one, through `npx @nldd/design-system@latest`, is how you see what
|
|
75
|
+
* an upgrade will break: useful, as long as it is clear that is what you are looking at.
|
|
76
|
+
*/
|
|
77
|
+
function noteOtherVersion(root) {
|
|
78
|
+
const installed = installedVersion(root);
|
|
79
|
+
if (installed && installed !== pkg.version) {
|
|
80
|
+
console.error(`Checking against ${pkg.version}, and this project has ${installed}: findings say what changes on upgrading.`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Writing back what was read as UTF-8 would destroy any other encoding. */
|
|
85
|
+
function isUtf8(filename) {
|
|
86
|
+
const bytes = readFileSync(filename);
|
|
87
|
+
return bytes.equals(Buffer.from(bytes.toString('utf8')));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** The tag is gone from the markup; what still names it would break or stop matching. */
|
|
91
|
+
function fixReferences(renamedTags, paths, root, exclude) {
|
|
92
|
+
const isBuilt = (file) => relative(root, file).split(sep).some((part) => IGNORED_DIRECTORIES.has(part));
|
|
93
|
+
const inMarkup = findFiles(paths, root, exclude);
|
|
94
|
+
const elsewhere = findFiles(paths, root, exclude, REFERENCE_EXTENSIONS).filter((file) => REFERENCE_EXTENSIONS.includes(extname(file)));
|
|
95
|
+
let fixed = 0;
|
|
96
|
+
let files = 0;
|
|
97
|
+
const remaining = [];
|
|
98
|
+
const kindOf = (file) => (inMarkup.includes(file) ? 'markup' : /\.(css|scss|less)$/.test(file) ? 'styles' : 'script');
|
|
99
|
+
for (const list of [inMarkup, elsewhere]) {
|
|
100
|
+
for (const filename of list.filter((file) => !/\.min\.[cm]?js$/.test(file))) {
|
|
101
|
+
const source = readFileSync(filename, 'utf8');
|
|
102
|
+
const change = isBuilt(filename) ? { source, fixed: 0 } : renameReferences(source, renamedTags, kindOf(filename));
|
|
103
|
+
if (change.fixed > 0 && isUtf8(filename)) {
|
|
104
|
+
writeFileSync(filename, change.source);
|
|
105
|
+
fixed += change.fixed;
|
|
106
|
+
files += 1;
|
|
107
|
+
}
|
|
108
|
+
for (const line of linesNaming(change.source, renamedTags)) remaining.push(`${relative(root, filename)}:${line}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { fixed, files, remaining };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const MAX_FIX_PASSES = 10;
|
|
115
|
+
|
|
116
|
+
/** One fix can open the way for the next: a renamed tag has rules of its own. */
|
|
117
|
+
async function fixUntilStable(linter, original, filename) {
|
|
118
|
+
let source = original;
|
|
119
|
+
let fixed = 0;
|
|
120
|
+
const renamedTags = new Map();
|
|
121
|
+
for (let pass = 0; pass < MAX_FIX_PASSES; pass++) {
|
|
122
|
+
const { findings } = await linter.lintSource(source, filename);
|
|
123
|
+
const change = applyFixes(source, findings);
|
|
124
|
+
if (change.fixed === 0) return { source, fixed, renamedTags, findings };
|
|
125
|
+
source = change.source;
|
|
126
|
+
fixed += change.fixed;
|
|
127
|
+
for (const [from, to] of change.renamedTags) renamedTags.set(from, to);
|
|
128
|
+
}
|
|
129
|
+
return { source, fixed, renamedTags, findings: (await linter.lintSource(source, filename)).findings };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async function runLint(data, paths, options) {
|
|
133
|
+
if (!/^\d+$/.test(options['max-warnings'] ?? '0')) throw new Error('--max-warnings takes a whole number, 0 or more.');
|
|
134
|
+
const formatName = options.format ?? 'text';
|
|
135
|
+
const chosen = { text: formatText, json: formatJson, github: formatGithub }[formatName];
|
|
136
|
+
if (!chosen) throw new Error(`Unknown format: ${formatName}`);
|
|
137
|
+
if (options.statistics && formatName !== 'text') throw new Error('--statistics is plain text, so it takes no --format.');
|
|
138
|
+
if (options['update-baseline'] && (options.select || options.ignore)) {
|
|
139
|
+
throw new Error('--update-baseline takes no --select or --ignore: it would forget every finding outside them.');
|
|
140
|
+
}
|
|
141
|
+
const root = process.cwd();
|
|
142
|
+
const started = performance.now();
|
|
143
|
+
if (options.fix && (options.stdin || options['update-baseline'])) {
|
|
144
|
+
throw new Error('--fix writes files, so it takes no --stdin or --update-baseline.');
|
|
145
|
+
}
|
|
146
|
+
const known = new Set([...data.rules.flatMap((r) => [r.id, ...(r.aliases ?? [])]), ...Object.keys(BUILT_IN_RULES), ...GROUPS]);
|
|
147
|
+
const list = (value) => value?.split(',').map((key) => key.trim());
|
|
148
|
+
const select = list(options.select);
|
|
149
|
+
const ignore = list(options.ignore);
|
|
150
|
+
for (const key of [...(select ?? []), ...(ignore ?? [])]) {
|
|
151
|
+
if (!known.has(key)) throw new Error(`Unknown rule or group: ${key}`);
|
|
152
|
+
}
|
|
153
|
+
const config = readConfig(root, known);
|
|
154
|
+
noteOtherVersion(root);
|
|
155
|
+
const canonical = createCanonical(data);
|
|
156
|
+
|
|
157
|
+
const inputs = options.stdin
|
|
158
|
+
? [{ filename: resolve(root, options.filename ?? 'stdin.html'), source: readFileSync(0, 'utf8') }]
|
|
159
|
+
: findFiles(paths, root, config.exclude).map((filename) => ({
|
|
160
|
+
filename,
|
|
161
|
+
source: readFileSync(filename, 'utf8'),
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
// Most files in an app use no component at all, and those need no parser either.
|
|
165
|
+
const relevant = inputs.filter(({ source }) => /nldd-|Nldd/.test(source) || config.wrappers);
|
|
166
|
+
const results = [];
|
|
167
|
+
let fixed = 0;
|
|
168
|
+
let fixedFiles = 0;
|
|
169
|
+
const renamedTags = new Map();
|
|
170
|
+
if (relevant.length > 0) {
|
|
171
|
+
const { createLinter } = await import('./linter.js');
|
|
172
|
+
const linter = createLinter(data, { wrappers: config.wrappers, severities: resolveSeverities(data, config.rules, { select, ignore }) });
|
|
173
|
+
for (const { filename, source } of relevant) {
|
|
174
|
+
const canWrite = options.fix && isUtf8(filename);
|
|
175
|
+
if (options.fix && !canWrite) console.error(`Skipped ${relative(root, filename)}: it is not UTF-8.`);
|
|
176
|
+
if (!canWrite) {
|
|
177
|
+
results.push({ filename, source, ...(await linter.lintSource(source, filename)) });
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
const change = await fixUntilStable(linter, source, filename);
|
|
181
|
+
if (change.fixed > 0) {
|
|
182
|
+
writeFileSync(filename, change.source);
|
|
183
|
+
fixed += change.fixed;
|
|
184
|
+
fixedFiles += 1;
|
|
185
|
+
for (const [from, to] of change.renamedTags) renamedTags.set(from, to);
|
|
186
|
+
}
|
|
187
|
+
results.push({ filename, source: change.source, findings: change.findings });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (options.fix) console.error(`Fixed ${fixed} in ${fixedFiles} of ${inputs.length} files.`);
|
|
191
|
+
if (renamedTags.size > 0) {
|
|
192
|
+
const references = fixReferences(renamedTags, paths, root, config.exclude);
|
|
193
|
+
if (references.fixed > 0) console.error(`Renamed ${references.fixed} imports, classes and selectors of old tags in ${references.files} files.`);
|
|
194
|
+
for (const place of references.remaining) console.error(`Still names an old tag: ${place}`);
|
|
195
|
+
if (paths.some((path) => resolve(root, path) !== root)) {
|
|
196
|
+
console.error('Only in the paths you named: run it without paths to reach the rest of the project.');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (options['update-baseline']) {
|
|
201
|
+
writeBaseline(results, root, canonical);
|
|
202
|
+
const accepted = results.flatMap(({ findings }) => findings).filter(({ severity }) => severity !== 'hint').length;
|
|
203
|
+
console.log(`Baseline updated: ${accepted} findings accepted.`);
|
|
204
|
+
return 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const baseline = readBaseline(root, canonical);
|
|
208
|
+
let skipped = 0;
|
|
209
|
+
const reported = results.map((result) => {
|
|
210
|
+
const fresh = applyBaseline(result.filename, result.findings, baseline, root);
|
|
211
|
+
skipped += result.findings.length - fresh.length;
|
|
212
|
+
return { ...result, findings: fresh };
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
const context = {
|
|
216
|
+
root,
|
|
217
|
+
files: inputs.length,
|
|
218
|
+
ms: Math.round(performance.now() - started),
|
|
219
|
+
skipped,
|
|
220
|
+
explainRule: (id) => findRule(data, id),
|
|
221
|
+
};
|
|
222
|
+
const format = options.statistics ? formatStatistics : chosen;
|
|
223
|
+
const output = format(reported, context);
|
|
224
|
+
if (output) console.log(output);
|
|
225
|
+
|
|
226
|
+
const all = reported.flatMap((result) => result.findings);
|
|
227
|
+
const errors = all.filter((finding) => finding.severity === 'error').length;
|
|
228
|
+
const warnings = all.filter((finding) => finding.severity === 'warn').length;
|
|
229
|
+
const tooManyWarnings =
|
|
230
|
+
options['max-warnings'] !== undefined && warnings > Number(options['max-warnings']);
|
|
231
|
+
return errors > 0 || tooManyWarnings ? 1 : 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async function main() {
|
|
235
|
+
const { values, positionals } = parseArgs({
|
|
236
|
+
allowPositionals: true,
|
|
237
|
+
options: {
|
|
238
|
+
format: { type: 'string' },
|
|
239
|
+
'update-baseline': { type: 'boolean' },
|
|
240
|
+
'max-warnings': { type: 'string' },
|
|
241
|
+
stdin: { type: 'boolean' },
|
|
242
|
+
filename: { type: 'string' },
|
|
243
|
+
for: { type: 'string' },
|
|
244
|
+
group: { type: 'string' },
|
|
245
|
+
select: { type: 'string' },
|
|
246
|
+
ignore: { type: 'string' },
|
|
247
|
+
statistics: { type: 'boolean' },
|
|
248
|
+
fix: { type: 'boolean' },
|
|
249
|
+
json: { type: 'boolean' },
|
|
250
|
+
version: { type: 'boolean', short: 'v' },
|
|
251
|
+
help: { type: 'boolean', short: 'h' },
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
if (values.version) {
|
|
255
|
+
console.log(pkg.version);
|
|
256
|
+
return 0;
|
|
257
|
+
}
|
|
258
|
+
const [command, ...rest] = positionals;
|
|
259
|
+
if (values.help || !command) {
|
|
260
|
+
console.log(USAGE);
|
|
261
|
+
return command || values.help ? 0 : 2;
|
|
262
|
+
}
|
|
263
|
+
const data = loadData();
|
|
264
|
+
if (command === 'lint') return runLint(data, rest, values);
|
|
265
|
+
if (command === 'explain' && rest[0]) return explain(data, rest[0]);
|
|
266
|
+
if (command === 'rules') return listRules(data, { tag: values.for, group: values.group, json: values.json });
|
|
267
|
+
console.error(USAGE);
|
|
268
|
+
return 2;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
main().then(
|
|
272
|
+
(code) => {
|
|
273
|
+
process.exitCode = code;
|
|
274
|
+
},
|
|
275
|
+
(error) => {
|
|
276
|
+
console.error(error.message);
|
|
277
|
+
process.exitCode = 2;
|
|
278
|
+
},
|
|
279
|
+
);
|
package/lint/project.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/** Everything about the consumer's project: its files, config and baseline. */
|
|
2
|
+
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { extname, join, relative, resolve } from 'node:path';
|
|
6
|
+
|
|
7
|
+
export const IGNORED_DIRECTORIES = new Set(['node_modules', 'dist', 'build', 'coverage', '.git', '.next', '.nuxt']);
|
|
8
|
+
/** Markdown is linted on request: documentation is full of deliberately wrong examples. */
|
|
9
|
+
const DEFAULT_EXTENSIONS = ['.html', '.htm', '.j2', '.jinja', '.jinja2', '.vue', '.jsx', '.tsx'];
|
|
10
|
+
|
|
11
|
+
/** Where a tag name stands outside markup: the linter does not read these, a renamed tag does. */
|
|
12
|
+
export const REFERENCE_EXTENSIONS = ['.js', '.mjs', '.cjs', '.ts', '.css', '.scss', '.less'];
|
|
13
|
+
|
|
14
|
+
function walkDirectory(directory, found, extensions) {
|
|
15
|
+
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
|
16
|
+
if (entry.isDirectory()) {
|
|
17
|
+
if (!IGNORED_DIRECTORIES.has(entry.name)) walkDirectory(join(directory, entry.name), found, extensions);
|
|
18
|
+
} else if (extensions.includes(extname(entry.name))) {
|
|
19
|
+
found.push(join(directory, entry.name));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return found;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** `git ls-files` honors .gitignore without this tool parsing it. */
|
|
26
|
+
function trackedFiles(root, extensions) {
|
|
27
|
+
try {
|
|
28
|
+
const output = execFileSync('git', ['ls-files', '-coz', '--exclude-standard'], {
|
|
29
|
+
cwd: root,
|
|
30
|
+
encoding: 'utf8',
|
|
31
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
32
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
33
|
+
});
|
|
34
|
+
return output
|
|
35
|
+
.split('\0')
|
|
36
|
+
.filter((file) => extensions.includes(extname(file)))
|
|
37
|
+
.map((file) => join(root, file));
|
|
38
|
+
} catch {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function matchesExclude(path, patterns) {
|
|
44
|
+
return patterns.some((pattern) => path.includes(pattern));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function findFiles(paths, root, exclude = [], extensions = DEFAULT_EXTENSIONS) {
|
|
48
|
+
const files =
|
|
49
|
+
paths.length === 0
|
|
50
|
+
? (trackedFiles(root, extensions) ?? walkDirectory(root, [], extensions))
|
|
51
|
+
: paths.flatMap((path) => {
|
|
52
|
+
const full = resolve(root, path);
|
|
53
|
+
if (!existsSync(full)) throw new Error(`No such file or directory: ${path}`);
|
|
54
|
+
return statSync(full).isDirectory() ? walkDirectory(full, [], extensions) : [full];
|
|
55
|
+
});
|
|
56
|
+
return [...new Set(files)].filter((file) => existsSync(file) && !matchesExclude(relative(root, file), exclude));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const CONFIG_FILE = '.nldd-lint.json';
|
|
60
|
+
|
|
61
|
+
export function readConfig(root, knownRules) {
|
|
62
|
+
const path = join(root, CONFIG_FILE);
|
|
63
|
+
if (!existsSync(path)) return {};
|
|
64
|
+
let config;
|
|
65
|
+
try {
|
|
66
|
+
config = JSON.parse(readFileSync(path, 'utf8'));
|
|
67
|
+
} catch (error) {
|
|
68
|
+
throw new Error(`${CONFIG_FILE}: ${error.message}`);
|
|
69
|
+
}
|
|
70
|
+
const isMap = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
71
|
+
if (!isMap(config)) throw new Error(`${CONFIG_FILE}: expected an object.`);
|
|
72
|
+
if (config.rules !== undefined && !isMap(config.rules)) throw new Error(`${CONFIG_FILE}: "rules" takes an object.`);
|
|
73
|
+
if (config.wrappers !== undefined && (!isMap(config.wrappers) || !Object.values(config.wrappers).every((tag) => typeof tag === 'string'))) {
|
|
74
|
+
throw new Error(`${CONFIG_FILE}: "wrappers" maps a component to a tag name.`);
|
|
75
|
+
}
|
|
76
|
+
if (config.exclude !== undefined && !Array.isArray(config.exclude)) throw new Error(`${CONFIG_FILE}: "exclude" takes a list.`);
|
|
77
|
+
for (const [rule, level] of Object.entries(config.rules ?? {})) {
|
|
78
|
+
if (!knownRules.has(rule)) throw new Error(`${CONFIG_FILE}: unknown rule "${rule}".`);
|
|
79
|
+
if (!['off', 'hint', 'warn', 'error'].includes(level)) {
|
|
80
|
+
throw new Error(`${CONFIG_FILE}: "${rule}" takes off, hint, warn or error, not ${JSON.stringify(level)}.`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return config;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const BASELINE_FILE = '.nldd-lint-baseline.json';
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Counts per file, rule and tag rather than positions, so moving code around
|
|
90
|
+
* does not turn accepted findings into new ones. The findings in a file beyond
|
|
91
|
+
* the accepted count are the new ones.
|
|
92
|
+
*/
|
|
93
|
+
function mergeRenamed(entries, canonical) {
|
|
94
|
+
const merged = {};
|
|
95
|
+
for (const [key, count] of Object.entries(entries)) {
|
|
96
|
+
const [rule, ...tag] = key.split('|');
|
|
97
|
+
const renamed = [canonical(rule), ...tag].join('|');
|
|
98
|
+
merged[renamed] = (merged[renamed] ?? 0) + count;
|
|
99
|
+
}
|
|
100
|
+
return merged;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function readBaseline(root, canonical = (id) => id) {
|
|
104
|
+
const path = join(root, BASELINE_FILE);
|
|
105
|
+
if (!existsSync(path)) return {};
|
|
106
|
+
const baseline = JSON.parse(readFileSync(path, 'utf8'));
|
|
107
|
+
return Object.fromEntries(
|
|
108
|
+
Object.entries(baseline).map(([file, entries]) => [
|
|
109
|
+
file,
|
|
110
|
+
mergeRenamed(entries, canonical),
|
|
111
|
+
]),
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const baselineKey = ({ rule, tag }) => `${rule}|${tag}`;
|
|
116
|
+
|
|
117
|
+
export function applyBaseline(filename, findings, baseline, root) {
|
|
118
|
+
const accepted = { ...baseline[relative(root, filename)] };
|
|
119
|
+
return findings.filter((finding) => {
|
|
120
|
+
const key = baselineKey(finding);
|
|
121
|
+
// A hint is never in a baseline, so it must not use up a warning of the same rule.
|
|
122
|
+
if (finding.severity === 'hint' || !accepted[key]) return true;
|
|
123
|
+
accepted[key]--;
|
|
124
|
+
return false;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function writeBaseline(results, root, canonical) {
|
|
129
|
+
const baseline = readBaseline(root, canonical);
|
|
130
|
+
for (const { filename, findings } of results) {
|
|
131
|
+
const key = relative(root, filename);
|
|
132
|
+
delete baseline[key];
|
|
133
|
+
if (findings.every(({ severity }) => severity === 'hint')) continue;
|
|
134
|
+
baseline[key] = {};
|
|
135
|
+
// A hint fails nothing, so there is nothing to accept.
|
|
136
|
+
for (const finding of findings.filter(({ severity }) => severity !== 'hint')) {
|
|
137
|
+
const entry = baselineKey(finding);
|
|
138
|
+
baseline[key][entry] = (baseline[key][entry] ?? 0) + 1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const sorted = Object.fromEntries(Object.entries(baseline).sort(([a], [b]) => a.localeCompare(b)));
|
|
142
|
+
writeFileSync(join(root, BASELINE_FILE), `${JSON.stringify(sorted, null, '\t')}\n`);
|
|
143
|
+
}
|