@nldd/design-system 0.13.2 → 0.14.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/README.md +4 -2
- package/custom-elements.json +1425 -136
- package/dist/components/actions/button/button.d.ts +0 -2
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +17 -33
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.template.js +2 -2
- 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.map +1 -1
- package/dist/components/actions/button-group/button-group.js +9 -10
- package/dist/components/actions/button-group/button-group.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +0 -1
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +4 -11
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +2 -2
- 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 +4 -7
- package/dist/components/actions/menu/menu-item.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +1 -4
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +3 -17
- 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 +352 -706
- 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 +13 -11
- package/dist/components/content/code-viewer/code-viewer.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.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +2 -1
- 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 +1 -5
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +15 -27
- package/dist/components/content/title/title.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 +2 -1
- 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-x12uDAK4.js} +9 -1
- package/dist/components/dev-checks-BgrW077W.js +2503 -0
- 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 +1 -2
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +10 -26
- package/dist/components/forms/form-field/form-field.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.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +7 -6
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/{icon-DRpTWSIg.js → icon-IgCyk9ui.js} +17 -4
- package/dist/components/{icon-button-DUEmWlBD.js → icon-button-B5tH4b3c.js} +8 -17
- 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 +2 -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 +2 -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/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +4 -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.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.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.js +2 -1
- package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +5 -4
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +2 -1
- package/dist/components/inputs/file-field/file-field.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 +2 -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 +2 -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 +2 -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 +2 -11
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/slider/slider.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.js +2 -1
- package/dist/components/inputs/slider/slider.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +2 -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 +2 -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 +2 -1
- package/dist/components/inputs/switch-field/switch-field.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.js +7 -3
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +2 -0
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +14 -2
- package/dist/components/inputs/text-editor/text-editor.mentions.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 +6 -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.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 +2 -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 +2 -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 +2 -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.map +1 -1
- package/dist/components/inputs/token-field/token-field.js +2 -1
- package/dist/components/inputs/token-field/token-field.js.map +1 -1
- package/dist/components/just-in-time-education.i18n-BJ5ovWVB.js +370 -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 +0 -2
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +8 -24
- package/dist/components/layout/collection/collection.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.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +6 -7
- package/dist/components/layout/page-footer/page-footer.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 +0 -2
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +6 -25
- 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.map +1 -1
- package/dist/components/layout/task-board/task-board.js +4 -3
- 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-nFB6dZpc.js +13 -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 +2 -1
- 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.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js +2 -1
- 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.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +2 -1
- 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.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +2 -1
- 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.js +53 -98
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +10 -15
- 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 +40 -87
- 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 +2 -2
- 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 +6 -11
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +0 -13
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +6 -41
- 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.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +2 -4
- package/dist/components/navigation/document-tab-bar/document-tab-bar.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.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 +13 -10
- package/dist/components/navigation/menu-bar/menu-bar.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 +2 -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.js +2 -1
- package/dist/components/navigation/pagination/pagination.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 +5 -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.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +7 -6
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/nl.generated-Ny3Kwppu.js +61 -0
- 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 +2 -1
- 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.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +2 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.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 +0 -3
- 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 +2 -14
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.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-DcwzF0_a.js} +1 -7
- package/dist/components/{with-translations-DRuOq3QK.js → with-translations-DLzmBSkU.js} +26 -5
- package/dist/nldd.min.js +775 -775
- package/dist/types/vue.d.ts +76 -6
- 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/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 +2472 -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/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/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 +21 -4
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** The rules as data: what a command needs before anything has to be parsed. */
|
|
2
|
+
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
|
|
5
|
+
/** What a rule is about. The first that fits, top to bottom, is the group of a rule. */
|
|
6
|
+
export const GROUPS = ['api', 'a11y', 'copy', 'structure', 'pattern'];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Turns config keys and --select and --ignore into a level per rule. A key is a
|
|
10
|
+
* group or a rule, and a rule beats its group whatever the order.
|
|
11
|
+
*/
|
|
12
|
+
export function resolveSeverities(data, levels = {}, { select, ignore } = {}) {
|
|
13
|
+
const groupOf = new Map([
|
|
14
|
+
...Object.keys(BUILT_IN_RULES).map((id) => [id, 'api']),
|
|
15
|
+
...data.rules.map((rule) => [rule.id, rule.group]),
|
|
16
|
+
]);
|
|
17
|
+
const canonical = createCanonical(data);
|
|
18
|
+
const matches = (id, keys) => keys.some((key) => key === groupOf.get(id) || canonical(key) === id);
|
|
19
|
+
const severities = Object.fromEntries(
|
|
20
|
+
Object.entries(levels)
|
|
21
|
+
.filter(([key]) => !GROUPS.includes(key))
|
|
22
|
+
.map(([key, level]) => [canonical(key), level]),
|
|
23
|
+
);
|
|
24
|
+
for (const [id, group] of groupOf) {
|
|
25
|
+
if (!severities[id] && levels[group]) severities[id] = levels[group];
|
|
26
|
+
if (select?.length && !matches(id, select)) severities[id] = 'off';
|
|
27
|
+
if (ignore?.length && matches(id, ignore)) severities[id] = 'off';
|
|
28
|
+
}
|
|
29
|
+
return severities;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function loadData() {
|
|
33
|
+
return JSON.parse(readFileSync(new URL('./data.generated.json', import.meta.url), 'utf8'));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Kept in the code rather than src/rules/: they are generated from the contract,
|
|
38
|
+
* for every component, without anyone writing a rule.
|
|
39
|
+
*/
|
|
40
|
+
export const BUILT_IN_RULES = {
|
|
41
|
+
'unknown-element': {
|
|
42
|
+
severity: 'error',
|
|
43
|
+
description: 'The tag does not exist in this version of the design system.',
|
|
44
|
+
},
|
|
45
|
+
'unknown-attribute': {
|
|
46
|
+
severity: 'warn',
|
|
47
|
+
description: 'The component does not have this attribute, so setting it does nothing.',
|
|
48
|
+
},
|
|
49
|
+
'invalid-value': {
|
|
50
|
+
severity: 'warn',
|
|
51
|
+
description: 'The attribute only accepts a fixed set of values, and this is not one of them.',
|
|
52
|
+
},
|
|
53
|
+
'unknown-icon': {
|
|
54
|
+
severity: 'warn',
|
|
55
|
+
description: 'There is no icon with this name.',
|
|
56
|
+
},
|
|
57
|
+
'unknown-slot': {
|
|
58
|
+
severity: 'warn',
|
|
59
|
+
description: 'The parent component has no slot with this name, so the element does not render.',
|
|
60
|
+
},
|
|
61
|
+
deprecated: {
|
|
62
|
+
severity: 'warn',
|
|
63
|
+
description: 'This still works, but will go away in a later version.',
|
|
64
|
+
},
|
|
65
|
+
'suppression-needs-reason': {
|
|
66
|
+
severity: 'warn',
|
|
67
|
+
description: 'Say why after `--`, so the next reader knows why this rule is off here.',
|
|
68
|
+
},
|
|
69
|
+
'syntax-error': {
|
|
70
|
+
severity: 'warn',
|
|
71
|
+
description: 'This file could not be read, so most of it was not checked.',
|
|
72
|
+
},
|
|
73
|
+
'suppression-not-needed': {
|
|
74
|
+
severity: 'warn',
|
|
75
|
+
description: 'This rule does not fire on the next line, so the suppression can go.',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** A rule id is API: a former id keeps working wherever consumers wrote it down. */
|
|
80
|
+
export function createCanonical(data) {
|
|
81
|
+
const former = new Map(data.rules.flatMap(({ id, aliases = [] }) => aliases.map((alias) => [alias, id])));
|
|
82
|
+
return (id) => former.get(id) ?? id;
|
|
83
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** What connects a rule to the docs: the components it names and the pattern it explains. */
|
|
2
|
+
|
|
3
|
+
export function selectorsOf(rule) {
|
|
4
|
+
return [rule.context, rule.assert, rule.report, rule.count?.of, rule.ref?.target].filter(Boolean);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** Every component a rule is about, so a rule on two components shows up at both. */
|
|
8
|
+
export function tagsOf(rule) {
|
|
9
|
+
const named = selectorsOf(rule).flatMap((selector) => selector.match(/nldd-[a-z0-9-]+/g) ?? []);
|
|
10
|
+
return [...new Set([...(rule.tags ?? []), ...named])];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function rulesAboutTag(rules, tag) {
|
|
14
|
+
return rules.filter((rule) => tagsOf(rule).includes(tag));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** A rule belongs to a pattern by pointing at it, so nobody keeps a list per pattern. */
|
|
18
|
+
export function rulesOfPattern(rules, slug) {
|
|
19
|
+
return rules.filter((rule) => rule.see === `patronen/${slug}`);
|
|
20
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "nldd lint rule",
|
|
4
|
+
"description": "One rule in src/rules/. The file name is the rule id. A rule without assert, report, count or ref forbids its context.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["severity", "context", "message"],
|
|
8
|
+
"if": { "properties": { "runtime": { "const": true } }, "required": ["runtime"] },
|
|
9
|
+
"then": {},
|
|
10
|
+
"else": { "required": ["examples"] },
|
|
11
|
+
"properties": {
|
|
12
|
+
"severity": { "enum": ["error", "warn", "hint"], "description": "error and warn can fail CI. A hint never does: it points at how this is meant to be done." },
|
|
13
|
+
"runtime": { "type": "boolean", "description": "Only the running page can tell, because the selector reads a :state() a component sets. The linter skips it, and it needs no examples." },
|
|
14
|
+
"tags": { "type": "array", "items": { "type": "string" }, "description": "Components this rule is about, when the selector does not name them." },
|
|
15
|
+
"removed": { "type": "array", "items": { "type": "string" }, "description": "Attributes or tags that are gone, which is what the rule is about. A selector may name them, and being there is enough." },
|
|
16
|
+
"fix": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"description": "What `--fix` changes. Only what keeps the meaning, for every value; anything else stays a finding.",
|
|
21
|
+
"properties": {
|
|
22
|
+
"rename": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Attributes in `removed` that got another name, old to new." },
|
|
23
|
+
"value": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "string" } }, "description": "Per attribute, values that got another name, old to new. Only a value written out in the markup." },
|
|
24
|
+
"remove": { "type": "array", "items": { "type": "string" }, "description": "Attributes in `removed` that do nothing any more." },
|
|
25
|
+
"tag": { "type": "string", "description": "The new tag of a component in `removed` that got another name." }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"context": { "type": "string", "description": "CSS selector for the elements the rule applies to." },
|
|
29
|
+
"assert": { "type": "string", "description": "Selector the context element must match." },
|
|
30
|
+
"report": { "type": "string", "description": "Selector the context element must not match." },
|
|
31
|
+
"count": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": ["of"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"of": { "type": "string", "description": "Selector for the direct children to count." },
|
|
37
|
+
"min": { "type": "integer", "minimum": 0 },
|
|
38
|
+
"max": { "type": "integer", "minimum": 0 }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"ref": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"required": ["attr", "target"],
|
|
45
|
+
"properties": {
|
|
46
|
+
"attr": { "type": "string", "description": "Attribute holding the id of another element." },
|
|
47
|
+
"target": { "type": "string", "description": "Selector the referenced element must match." },
|
|
48
|
+
"equal": { "type": "string", "description": "Attribute that must have the same value on both." }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"message": { "type": "string", "description": "What is wrong here, in English, for the developer." },
|
|
52
|
+
"see": { "type": "string", "pattern": "^(patronen|ontwerprichtlijnen)/", "description": "Where the why is explained." },
|
|
53
|
+
"aliases": { "type": "array", "items": { "type": "string" }, "description": "Former ids, so baselines and suppressions keep working." },
|
|
54
|
+
"examples": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"required": ["passed", "failed"],
|
|
58
|
+
"properties": {
|
|
59
|
+
"passed": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
60
|
+
"failed": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
61
|
+
"cantTell": { "type": "array", "items": { "type": "string" } }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
package/lint/tree.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The normalized element tree every frontend produces and the engine reads.
|
|
3
|
+
*
|
|
4
|
+
* A template is not a document. Part of what ends up in the DOM is unknown when
|
|
5
|
+
* reading the source: a bound value, a spread, a child component. The tree
|
|
6
|
+
* records that instead of guessing, so a rule can tell "wrong" from "unknown".
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Marks an attribute whose value only exists at runtime. */
|
|
10
|
+
export const BOUND = Symbol('bound');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {object} TreeNode
|
|
14
|
+
* @property {string} name
|
|
15
|
+
* @property {TreeNode | null} parent
|
|
16
|
+
* @property {TreeNode[]} children
|
|
17
|
+
* @property {Map<string, string | typeof BOUND>} attrs
|
|
18
|
+
* @property {number} offset Position in the source file.
|
|
19
|
+
* @property {number} [endOffset] Last character of the element, when the parser saw its end.
|
|
20
|
+
* @property {boolean} spread Any attribute may be set (`v-bind="o"`, `{...p}`).
|
|
21
|
+
* @property {boolean} opaque Stands for content this file cannot see.
|
|
22
|
+
* @property {boolean} conditional Rendered only some of the time.
|
|
23
|
+
* @property {boolean} repeated Rendered any number of times.
|
|
24
|
+
* @property {boolean} toggled In the DOM, but maybe not visible (`v-show`).
|
|
25
|
+
* @property {boolean} wrapped A framework wrapper standing in for this tag.
|
|
26
|
+
* @property {boolean} templated A template language writes into the tag itself.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** @returns {TreeNode} */
|
|
30
|
+
export function createNode(name, offset = 0) {
|
|
31
|
+
return {
|
|
32
|
+
name,
|
|
33
|
+
parent: null,
|
|
34
|
+
children: [],
|
|
35
|
+
attrs: new Map(),
|
|
36
|
+
offset,
|
|
37
|
+
spread: false,
|
|
38
|
+
opaque: false,
|
|
39
|
+
conditional: false,
|
|
40
|
+
repeated: false,
|
|
41
|
+
toggled: false,
|
|
42
|
+
wrapped: false,
|
|
43
|
+
templated: false,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The root of one tree. An open root stands for whatever renders this file: a
|
|
49
|
+
* component's parent is in another file, so ancestors and siblings are unknown.
|
|
50
|
+
* Only a full HTML document is closed.
|
|
51
|
+
*/
|
|
52
|
+
export function createRoot({ closed = false } = {}) {
|
|
53
|
+
const root = createNode('#root');
|
|
54
|
+
root.opaque = !closed;
|
|
55
|
+
return root;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function appendChild(parent, child) {
|
|
59
|
+
child.parent = parent;
|
|
60
|
+
parent.children.push(child);
|
|
61
|
+
return child;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Calls `visit` for every node below `root`, in document order. */
|
|
65
|
+
export function walk(root, visit) {
|
|
66
|
+
for (const child of root.children) {
|
|
67
|
+
visit(child);
|
|
68
|
+
walk(child, visit);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Stands in the tree for content that cannot be read here, such as `{children}`. */
|
|
73
|
+
export function appendUnknown(parent, offset) {
|
|
74
|
+
const node = createNode('#unknown', offset);
|
|
75
|
+
node.opaque = true;
|
|
76
|
+
return appendChild(parent, node);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Whether a tag is a component this linter has no view into: PascalCase,
|
|
81
|
+
* someone else's custom element, or a framework outlet.
|
|
82
|
+
*/
|
|
83
|
+
export function isOpaqueTag(name) {
|
|
84
|
+
return (
|
|
85
|
+
/^[A-Z]/.test(name) ||
|
|
86
|
+
name.includes('.') ||
|
|
87
|
+
(name.includes('-') && !name.startsWith('nldd-')) ||
|
|
88
|
+
name === 'component' ||
|
|
89
|
+
name === 'teleport' ||
|
|
90
|
+
name === 'slot' ||
|
|
91
|
+
name === 'ng-content'
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** css-select adapter over this tree. Nothing here depends on a DOM. */
|
|
96
|
+
export const adapter = {
|
|
97
|
+
isTag: (node) => Boolean(node) && typeof node === 'object',
|
|
98
|
+
getAttributeValue(node, name) {
|
|
99
|
+
const value = node.attrs.get(name);
|
|
100
|
+
return typeof value === 'string' ? value : undefined;
|
|
101
|
+
},
|
|
102
|
+
hasAttrib: (node, name) => typeof node.attrs.get(name) === 'string',
|
|
103
|
+
getChildren: (node) => node.children,
|
|
104
|
+
getName: (node) => node.name,
|
|
105
|
+
getParent: (node) => node.parent,
|
|
106
|
+
getSiblings: (node) => (node.parent ? node.parent.children : [node]),
|
|
107
|
+
getText: () => '',
|
|
108
|
+
removeSubsets: (nodes) => nodes,
|
|
109
|
+
existsOne(test, nodes) {
|
|
110
|
+
return nodes.some((node) => test(node) || adapter.existsOne(test, node.children));
|
|
111
|
+
},
|
|
112
|
+
findAll(test, nodes) {
|
|
113
|
+
const found = [];
|
|
114
|
+
const visit = (list) => {
|
|
115
|
+
for (const node of list) {
|
|
116
|
+
if (test(node)) found.push(node);
|
|
117
|
+
visit(node.children);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
visit(nodes);
|
|
121
|
+
return found;
|
|
122
|
+
},
|
|
123
|
+
findOne(test, nodes) {
|
|
124
|
+
for (const node of nodes) {
|
|
125
|
+
if (test(node)) return node;
|
|
126
|
+
const match = adapter.findOne(test, node.children);
|
|
127
|
+
if (match) return match;
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
},
|
|
131
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nldd/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Designsysteem voor de Nederlandse Digitale Dienst",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/components/components.js",
|
|
@@ -508,6 +508,8 @@
|
|
|
508
508
|
},
|
|
509
509
|
"files": [
|
|
510
510
|
"dist",
|
|
511
|
+
"lint",
|
|
512
|
+
"!lint/**/*.test.mjs",
|
|
511
513
|
"custom-elements.json",
|
|
512
514
|
"LICENSE",
|
|
513
515
|
"NOTICES.md"
|
|
@@ -527,7 +529,8 @@
|
|
|
527
529
|
"generate:colors": "node scripts/generate-colors.js && npm run generate:themes",
|
|
528
530
|
"generate:themes": "node scripts/generate-themes.js",
|
|
529
531
|
"generate:component-reference": "node scripts/generate-component-reference.js",
|
|
530
|
-
"generate:cem": "cem analyze && npm run generate:vue-types",
|
|
532
|
+
"generate:cem": "cem analyze && npm run generate:vue-types && npm run generate:lint-data",
|
|
533
|
+
"generate:lint-data": "node scripts/generate-lint-data.js",
|
|
531
534
|
"generate:vue-types": "node scripts/generate-vue-types.js",
|
|
532
535
|
"generate:skill-changelog": "node scripts/generate-skill-changelog.js",
|
|
533
536
|
"generate:skill-principles": "node scripts/generate-skill-principles.js",
|
|
@@ -539,6 +542,7 @@
|
|
|
539
542
|
"validate:host-styles": "node scripts/validate-host-styles.js",
|
|
540
543
|
"validate:component-api": "node scripts/validate-component-api.js",
|
|
541
544
|
"validate:skill-markup": "node scripts/validate-skill-markup.js",
|
|
545
|
+
"lint:stories": "node scripts/lint-stories.js",
|
|
542
546
|
"build:components": "npm run clean:components && npm run build:icons && npm run generate:translations && npm run build:components:modules && npm run build:components:bundle && npm run build:components:standalone && npm run build:exports && npm run generate:cem",
|
|
543
547
|
"build:icons": "node scripts/generate-icon-registry.js && node scripts/generate-logo.js",
|
|
544
548
|
"optimize:icons": "svgo --config scripts/svgo.config.mjs",
|
|
@@ -557,6 +561,8 @@
|
|
|
557
561
|
"build-storybook": "storybook build",
|
|
558
562
|
"lint": "eslint src/",
|
|
559
563
|
"lint:fix": "eslint src/ --fix",
|
|
564
|
+
"lint:rules": "node scripts/check-lint-rules.js",
|
|
565
|
+
"lint:corpus": "node scripts/lint-corpus.js",
|
|
560
566
|
"lint:a11y": "eslint src/ --rule 'lit-a11y/*: error'",
|
|
561
567
|
"changelog:draft": "node scripts/changelog-draft.mjs",
|
|
562
568
|
"prepare": "pre-commit install || true",
|
|
@@ -564,7 +570,7 @@
|
|
|
564
570
|
"pretest:run": "npm run build:icons",
|
|
565
571
|
"test": "vitest",
|
|
566
572
|
"test:run": "vitest run",
|
|
567
|
-
"test:scripts": "node --test scripts/*.test.mjs scripts/lib/*.test.mjs",
|
|
573
|
+
"test:scripts": "node --test scripts/*.test.mjs scripts/lib/*.test.mjs lint/*.test.mjs",
|
|
568
574
|
"pretypecheck": "npm run build:icons",
|
|
569
575
|
"typecheck": "tsc --noEmit",
|
|
570
576
|
"test:vue-types": "vue-tsc --noEmit -p type-tests/vue/tsconfig.json",
|
|
@@ -586,6 +592,7 @@
|
|
|
586
592
|
"@storybook/web-components-vite": "^10.6.0",
|
|
587
593
|
"@vitest/browser-playwright": "5.0.5",
|
|
588
594
|
"@vitest/coverage-v8": "5.0.5",
|
|
595
|
+
"ajv": "^8.20.0",
|
|
589
596
|
"axe-core": "^4.13.0",
|
|
590
597
|
"conventional-changelog": "^8.1.0",
|
|
591
598
|
"conventional-changelog-conventionalcommits": "10.2.1",
|
|
@@ -602,7 +609,8 @@
|
|
|
602
609
|
"vite": "8.3.5",
|
|
603
610
|
"vitest": "5.0.5",
|
|
604
611
|
"vue": "^3.5.40",
|
|
605
|
-
"vue-tsc": "^3.3.7"
|
|
612
|
+
"vue-tsc": "^3.3.7",
|
|
613
|
+
"yaml": "^2.9.1"
|
|
606
614
|
},
|
|
607
615
|
"engines": {
|
|
608
616
|
"node": ">=18.0.0"
|
|
@@ -634,10 +642,19 @@
|
|
|
634
642
|
"@codemirror/view": "^6.43.4",
|
|
635
643
|
"@floating-ui/dom": "^1.7.6",
|
|
636
644
|
"@lezer/highlight": "^1.2.3",
|
|
645
|
+
"css-select": "^5.2.2",
|
|
646
|
+
"css-what": "^6.2.2",
|
|
647
|
+
"htmlparser2": "^10.1.0",
|
|
637
648
|
"lit": "^3.3.1"
|
|
638
649
|
},
|
|
639
650
|
"customElements": "custom-elements.json",
|
|
640
651
|
"overrides": {
|
|
641
652
|
"conventional-changelog-conventionalcommits": "10.2.1"
|
|
653
|
+
},
|
|
654
|
+
"optionalDependencies": {
|
|
655
|
+
"oxc-parser": "^0.156.0"
|
|
656
|
+
},
|
|
657
|
+
"bin": {
|
|
658
|
+
"nldd": "lint/cli.js"
|
|
642
659
|
}
|
|
643
660
|
}
|