@nldd/design-system 0.8.62 → 0.8.64
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/dist/assets/styles/{slotted-reset.d.ts → style-resets.d.ts} +1 -1
- package/dist/assets/styles/style-resets.d.ts.map +1 -0
- package/dist/assets/styles/{slotted-reset.fixtures.d.ts → style-resets.fixtures.d.ts} +4 -4
- package/dist/assets/styles/style-resets.fixtures.d.ts.map +1 -0
- package/dist/assets/styles/{slotted-reset.fixtures.js → style-resets.fixtures.js} +4 -4
- package/dist/assets/styles/style-resets.fixtures.js.map +1 -0
- package/dist/assets/styles/{slotted-reset.js → style-resets.js} +1 -1
- package/dist/assets/styles/style-resets.js.map +1 -0
- package/dist/components/actions/button/button.d.ts +9 -2
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.i18n.d.ts +5 -0
- package/dist/components/actions/button/button.i18n.d.ts.map +1 -0
- package/dist/components/actions/button/button.i18n.js +4 -0
- package/dist/components/actions/button/button.i18n.js.map +1 -0
- package/dist/components/actions/button/button.js +5 -2
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.styles.d.ts.map +1 -1
- package/dist/components/actions/button/button.styles.js +21 -7
- package/dist/components/actions/button/button.styles.js.map +1 -1
- package/dist/components/actions/button/button.template.d.ts.map +1 -1
- package/dist/components/actions/button/button.template.js +17 -4
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/button-bar/button-bar.styles.d.ts.map +1 -1
- package/dist/components/actions/button-bar/button-bar.styles.js +3 -0
- package/dist/components/actions/button-bar/button-bar.styles.js.map +1 -1
- package/dist/components/actions/button-group/button-group.styles.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.styles.js +3 -0
- package/dist/components/actions/button-group/button-group.styles.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +10 -2
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.i18n.d.ts +5 -0
- package/dist/components/actions/icon-button/icon-button.i18n.d.ts.map +1 -0
- package/dist/components/actions/icon-button/icon-button.i18n.js +4 -0
- package/dist/components/actions/icon-button/icon-button.i18n.js.map +1 -0
- package/dist/components/actions/icon-button/icon-button.js +5 -2
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.js +4 -1
- package/dist/components/actions/icon-button/icon-button.styles.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 +11 -2
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.styles.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.styles.js +4 -1
- package/dist/components/actions/menu/menu.styles.js.map +1 -1
- package/dist/components/actions/split-button/split-button.styles.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.styles.js +4 -1
- package/dist/components/actions/split-button/split-button.styles.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +4 -1
- package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
- package/dist/components/components.js +64 -62
- package/dist/components/content/blockquote/blockquote.styles.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.styles.js +4 -1
- package/dist/components/content/blockquote/blockquote.styles.js.map +1 -1
- package/dist/components/content/byline/byline.d.ts +11 -0
- package/dist/components/content/byline/byline.d.ts.map +1 -1
- package/dist/components/content/byline/byline.js +20 -0
- package/dist/components/content/byline/byline.js.map +1 -1
- package/dist/components/content/byline/byline.styles.d.ts.map +1 -1
- package/dist/components/content/byline/byline.styles.js +17 -2
- package/dist/components/content/byline/byline.styles.js.map +1 -1
- package/dist/components/content/byline/byline.template.d.ts.map +1 -1
- package/dist/components/content/byline/byline.template.js +17 -2
- package/dist/components/content/byline/byline.template.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +4 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +1 -1
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon.styles.d.ts.map +1 -1
- package/dist/components/content/icon/icon.styles.js +3 -0
- package/dist/components/content/icon/icon.styles.js.map +1 -1
- package/dist/components/content/image/image.styles.d.ts.map +1 -1
- package/dist/components/content/image/image.styles.js +4 -1
- package/dist/components/content/image/image.styles.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js +4 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js.map +1 -1
- package/dist/components/content/tag/tag.styles.d.ts.map +1 -1
- package/dist/components/content/tag/tag.styles.js +4 -1
- package/dist/components/content/tag/tag.styles.js.map +1 -1
- package/dist/components/content/title/title.styles.d.ts.map +1 -1
- package/dist/components/content/title/title.styles.js +4 -1
- package/dist/components/content/title/title.styles.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.js +4 -1
- package/dist/components/content/tooltip/tooltip.styles.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.styles.d.ts.map +1 -1
- package/dist/components/forms/form-actions/form-actions.styles.js +4 -0
- package/dist/components/forms/form-actions/form-actions.styles.js.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.js +5 -1
- package/dist/components/forms/form-field/form-field.styles.js.map +1 -1
- package/dist/components/{index-DPe5myEj.js → index-BNhqNvDd.js} +4882 -2776
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.styles.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.styles.js +3 -0
- package/dist/components/inputs/checkbox/checkbox.styles.js.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.styles.js +4 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.styles.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 +4 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.styles.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.styles.js +4 -1
- package/dist/components/inputs/combo-box/combo-box.styles.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.styles.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.styles.js +4 -1
- package/dist/components/inputs/dropdown/dropdown.styles.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js +4 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.styles.js +4 -1
- package/dist/components/inputs/number-field/number-field.styles.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.styles.js +4 -1
- package/dist/components/inputs/password-field/password-field.styles.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.js +3 -0
- package/dist/components/inputs/radio-button/radio-button.styles.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.styles.js +4 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.styles.js.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.styles.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.styles.js +4 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.styles.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.styles.js +13 -1
- package/dist/components/inputs/search-field/search-field.styles.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.template.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.template.js +47 -39
- package/dist/components/inputs/search-field/search-field.template.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.js +4 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.styles.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.styles.js +3 -0
- package/dist/components/inputs/stepper/stepper.styles.js.map +1 -1
- package/dist/components/inputs/switch/switch.styles.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.styles.js +3 -0
- package/dist/components/inputs/switch/switch.styles.js.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.styles.js +4 -1
- package/dist/components/inputs/switch-field/switch-field.styles.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.styles.js +4 -1
- package/dist/components/inputs/text-field/text-field.styles.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.js +4 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.styles.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.styles.js +3 -0
- package/dist/components/inputs/toggle-button-group/toggle-button-group.styles.js.map +1 -1
- package/dist/components/inputs/token/token.styles.d.ts.map +1 -1
- package/dist/components/inputs/token/token.styles.js +4 -1
- package/dist/components/inputs/token/token.styles.js.map +1 -1
- package/dist/components/layout/app-view/app-view.styles.d.ts.map +1 -1
- package/dist/components/layout/app-view/app-view.styles.js +3 -0
- package/dist/components/layout/app-view/app-view.styles.js.map +1 -1
- package/dist/components/layout/box/box.styles.d.ts.map +1 -1
- package/dist/components/layout/box/box.styles.js +3 -0
- package/dist/components/layout/box/box.styles.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +28 -2
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.i18n.d.ts +5 -0
- package/dist/components/layout/card/card.i18n.d.ts.map +1 -0
- package/dist/components/layout/card/card.i18n.js +4 -0
- package/dist/components/layout/card/card.i18n.js.map +1 -0
- package/dist/components/layout/card/card.js +54 -2
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/card/card.styles.d.ts.map +1 -1
- package/dist/components/layout/card/card.styles.js +20 -0
- package/dist/components/layout/card/card.styles.js.map +1 -1
- package/dist/components/layout/card/card.template.d.ts.map +1 -1
- package/dist/components/layout/card/card.template.js +17 -1
- package/dist/components/layout/card/card.template.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +7 -5
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +17 -5
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/collection/collection.styles.js +12 -12
- package/dist/components/layout/collection/collection.styles.js.map +1 -1
- package/dist/components/layout/collection/collection.template.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.template.js +4 -2
- package/dist/components/layout/collection/collection.template.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +7 -3
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +15 -3
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/container/container.styles.d.ts.map +1 -1
- package/dist/components/layout/container/container.styles.js +42 -1
- package/dist/components/layout/container/container.styles.js.map +1 -1
- package/dist/components/layout/divider/divider.styles.d.ts.map +1 -1
- package/dist/components/layout/divider/divider.styles.js +3 -0
- package/dist/components/layout/divider/divider.styles.js.map +1 -1
- package/dist/components/layout/page/page.styles.d.ts.map +1 -1
- package/dist/components/layout/page/page.styles.js +3 -0
- package/dist/components/layout/page/page.styles.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts +1 -0
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +12 -4
- 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 +13 -1
- package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js +3 -0
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +25 -5
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +60 -11
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.js +15 -4
- package/dist/components/layout/page-sections/hero/hero.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.template.js +13 -1
- package/dist/components/layout/page-sections/hero/hero.template.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js +3 -0
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js +3 -0
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +119 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.i18n.d.ts +6 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.i18n.d.ts.map +1 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.i18n.js +5 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.i18n.js.map +1 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +219 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts +2 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +157 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.d.ts +4 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.d.ts.map +1 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js +57 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js.map +1 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.js +3 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js +3 -0
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js.map +1 -1
- package/dist/components/layout/popover/popover.styles.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.styles.js +3 -0
- package/dist/components/layout/popover/popover.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.js +3 -0
- package/dist/components/layout/sheet/sheet.styles.js.map +1 -1
- package/dist/components/layout/spacer/spacer.styles.d.ts.map +1 -1
- package/dist/components/layout/spacer/spacer.styles.js +3 -0
- package/dist/components/layout/spacer/spacer.styles.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.js +3 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +47 -19
- 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 +123 -73
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js +17 -14
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js +10 -8
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.js +3 -0
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.styles.js +3 -0
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.styles.js.map +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.js +3 -0
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.js.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.js +3 -0
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +1 -19
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +1 -187
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/layout/window/window.styles.d.ts.map +1 -1
- package/dist/components/layout/window/window.styles.js +5 -28
- package/dist/components/layout/window/window.styles.js.map +1 -1
- package/dist/components/layout/window/window.template.d.ts.map +1 -1
- package/dist/components/layout/window/window.template.js +1 -2
- package/dist/components/layout/window/window.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.styles.js +4 -1
- package/dist/components/lists-and-tables/cells/cell/cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.js +4 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.styles.js +3 -0
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js +3 -0
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.styles.js +3 -0
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +4 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.styles.js +3 -0
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +4 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +183 -8
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.i18n.d.ts +3 -0
- package/dist/components/lists-and-tables/list/list.i18n.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.i18n.js +3 -0
- package/dist/components/lists-and-tables/list/list.i18n.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +522 -17
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.styles.js +163 -25
- package/dist/components/lists-and-tables/list/list.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.template.d.ts +26 -1
- package/dist/components/lists-and-tables/list/list.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.template.js +76 -18
- package/dist/components/lists-and-tables/list/list.template.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +30 -9
- 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.i18n.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.js +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +81 -20
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.js +55 -32
- package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js +10 -5
- package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.js +4 -1
- package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +0 -44
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.i18n.d.ts +0 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.i18n.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.i18n.js +0 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.i18n.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +1 -84
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.styles.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.styles.js +6 -52
- package/dist/components/navigation/breadcrumbs/breadcrumbs.styles.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.template.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js +1 -17
- package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js +5 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +9 -2
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.i18n.d.ts +5 -0
- package/dist/components/navigation/link/link.i18n.d.ts.map +1 -0
- package/dist/components/navigation/link/link.i18n.js +4 -0
- package/dist/components/navigation/link/link.i18n.js.map +1 -0
- package/dist/components/navigation/link/link.js +5 -2
- 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 +18 -1
- package/dist/components/navigation/link/link.styles.js.map +1 -1
- package/dist/components/navigation/link/link.template.d.ts.map +1 -1
- package/dist/components/navigation/link/link.template.js +14 -1
- package/dist/components/navigation/link/link.template.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 +4 -1
- package/dist/components/navigation/menu-bar/menu-bar.styles.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +4 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
- package/dist/components/navigation/pagination/pagination.styles.js +4 -1
- package/dist/components/navigation/pagination/pagination.styles.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.styles.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.styles.js +4 -1
- package/dist/components/navigation/skip-link/skip-link.styles.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +11 -4
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.styles.js +29 -4
- package/dist/components/navigation/tab-bar/tab-bar.styles.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +5 -0
- 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 +17 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +32 -16
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.styles.js +4 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.styles.js.map +1 -1
- package/dist/components/{prism-python-mIMEATOA.js → prism-python--N285k7w.js} +1 -1
- package/dist/components/{prism-rust-Ig3wVTFD.js → prism-rust-Cnm1tSdo.js} +1 -1
- package/dist/components/{prism-typescript-BeulJu8Z.js → prism-typescript-BPJAiB1s.js} +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +35 -12
- 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 +48 -13
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +81 -18
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.d.ts +1 -2
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js +21 -7
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.styles.js +4 -1
- package/dist/components/status-and-feedback/badge/badge.styles.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.styles.js +4 -1
- package/dist/components/status-and-feedback/banner/banner.styles.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 +12 -2
- 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 +4 -1
- 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 +124 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts.map +1 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.i18n.d.ts +6 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.i18n.d.ts.map +1 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.i18n.js +5 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.i18n.js.map +1 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +550 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js.map +1 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.d.ts +2 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.d.ts.map +1 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.js +304 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.js.map +1 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.template.d.ts +4 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.template.d.ts.map +1 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.template.js +72 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.template.js.map +1 -0
- 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 +4 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js +4 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js +4 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +6 -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 +23 -9
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.styles.js +4 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.styles.js.map +1 -1
- package/dist/css/rich-text.css +63 -0
- package/dist/css/settings.css +10 -3
- package/package.json +9 -1
- package/dist/assets/styles/slotted-reset.d.ts.map +0 -1
- package/dist/assets/styles/slotted-reset.fixtures.d.ts.map +0 -1
- package/dist/assets/styles/slotted-reset.fixtures.js.map +0 -1
- package/dist/assets/styles/slotted-reset.js.map +0 -1
|
@@ -4,14 +4,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var NLDDList_1;
|
|
7
8
|
import { LitElement } from 'lit';
|
|
8
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
9
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
9
10
|
import { listStyles } from './list.styles.js';
|
|
10
11
|
import { template } from './list.template.js';
|
|
11
12
|
import { nlddListTranslations } from './list.i18n.js';
|
|
12
13
|
import '../../status-and-feedback/inline-dialog/inline-dialog.js';
|
|
14
|
+
import '../../content/icon/icon.js';
|
|
15
|
+
import '../../actions/icon-button/icon-button.js';
|
|
13
16
|
/**
|
|
14
|
-
* A container for `nldd-list-item` elements
|
|
17
|
+
* A container for `nldd-list-item` elements.
|
|
15
18
|
*
|
|
16
19
|
* The `type` attribute switches the list's a11y role and behavior:
|
|
17
20
|
* - `list` (default) — `role="list"`, items `role="listitem"`. Reorderable allowed.
|
|
@@ -19,9 +22,37 @@ import '../../status-and-feedback/inline-dialog/inline-dialog.js';
|
|
|
19
22
|
* has no special keyboard semantics.
|
|
20
23
|
* - `navigation` — host `role="navigation"`, items with `selected` get
|
|
21
24
|
* `aria-current="page"` on their inner `<a>` or `<button>`.
|
|
25
|
+
* - `listbox` — an accessible, filterable listbox (combobox pattern). The
|
|
26
|
+
* list renders its OWN search input (`role="combobox"`) pinned
|
|
27
|
+
* above the options; `.list__items` becomes `role="listbox"`
|
|
28
|
+
* and items become `role="option"`. Focus stays in the input,
|
|
29
|
+
* the active option moves via `aria-activedescendant`, and
|
|
30
|
+
* filtering is consumer-managed via the `input` event (toggle
|
|
31
|
+
* `[hidden]` on items). See "Listbox" below.
|
|
22
32
|
*
|
|
23
33
|
* Selection state is consumer-managed: the list never mutates `selected` itself.
|
|
24
34
|
*
|
|
35
|
+
* ### Listbox
|
|
36
|
+
*
|
|
37
|
+
* In `type="listbox"` the list owns a native `<input role="combobox">` (mirroring
|
|
38
|
+
* how `nldd-combo-box` wires an input to a slotted listbox). Keyboard, handled on
|
|
39
|
+
* the input so focus never leaves it:
|
|
40
|
+
* - ArrowDown / ArrowUp — move the active option among the VISIBLE (non-`[hidden]`)
|
|
41
|
+
* options (wrap around).
|
|
42
|
+
* - Home / End — first / last visible option.
|
|
43
|
+
* - Enter — activate the active option by triggering its inner action (a link
|
|
44
|
+
* navigates, a button fires the consumer's handler). Selection stays
|
|
45
|
+
* consumer-managed.
|
|
46
|
+
* - Escape — clear the search value (and refire `input`).
|
|
47
|
+
*
|
|
48
|
+
* On every active change the input's `aria-activedescendant` is set to the active
|
|
49
|
+
* option's id and the option is scrolled into view. The active option (`_highlighted`
|
|
50
|
+
* on the item, a highlight) is distinct from `selected`. Filtering is the
|
|
51
|
+
* consumer's job: listen to `input` (`{ detail: { value } }`) and toggle `[hidden]`
|
|
52
|
+
* on items; after the visible set changes the list resets the active option to the
|
|
53
|
+
* first visible one. `reorderable` and `arrow-navigation` are ignored in listbox
|
|
54
|
+
* mode (listbox has its own keyboard).
|
|
55
|
+
*
|
|
25
56
|
* ### Reorder
|
|
26
57
|
*
|
|
27
58
|
* On reorder (type="list" + reorderable), the list dispatches `nldd-reorder` with
|
|
@@ -33,16 +64,24 @@ import '../../status-and-feedback/inline-dialog/inline-dialog.js';
|
|
|
33
64
|
* should manage focus themselves after their render commits.
|
|
34
65
|
*
|
|
35
66
|
* @slot - List items (`nldd-list-item`)
|
|
36
|
-
* @slot
|
|
37
|
-
*
|
|
67
|
+
* @slot toolbar - Controls below the search field (filters, sort, counts,
|
|
68
|
+
* view toggles). Available for every type; collapses when empty.
|
|
69
|
+
* @slot search-bar-end - Controls inline at the end of the search bar, beside the
|
|
70
|
+
* search field (e.g. a filter or options button). Listbox only;
|
|
71
|
+
* collapses when empty.
|
|
38
72
|
* @slot empty - Shown when no items are visible (all `[hidden]` or none). Defaults
|
|
39
73
|
* to `nldd-inline-dialog` with `empty-text` / `empty-supporting-text`
|
|
40
|
-
* (falling back to Dutch i18n "Geen
|
|
41
|
-
* overrides the default dialog entirely.
|
|
74
|
+
* (falling back to Dutch i18n "Geen items"). Slot content
|
|
75
|
+
* overrides the default dialog entirely. In `type="listbox"` it is
|
|
76
|
+
* suppressed while the search field is empty (no query yet), so the
|
|
77
|
+
* consumer can show just the search field or its own hint outside
|
|
78
|
+
* the list.
|
|
42
79
|
*
|
|
43
80
|
* @fires nldd-reorder - Reorderable `type="list"`: `{ fromIndex, toIndex }` on drop
|
|
81
|
+
* @fires input - `type="listbox"`: search value changed; `{ value }`. Toggle
|
|
82
|
+
* `[hidden]` on items to filter.
|
|
44
83
|
*/
|
|
45
|
-
let NLDDList = class NLDDList extends LitElement {
|
|
84
|
+
let NLDDList = NLDDList_1 = class NLDDList extends LitElement {
|
|
46
85
|
constructor() {
|
|
47
86
|
super(...arguments);
|
|
48
87
|
/** Visual style of the list. `simple` is a plain vertical strip with
|
|
@@ -55,9 +94,38 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
55
94
|
this.reorderable = false;
|
|
56
95
|
/** Hides dividers between list items. */
|
|
57
96
|
this.noDividers = false;
|
|
97
|
+
/**
|
|
98
|
+
* Roving-tabindex arrow-key navigation. When set, ArrowUp/ArrowDown move focus
|
|
99
|
+
* between the (interactive) items, Home/End jump to the first/last, and the
|
|
100
|
+
* whole list becomes a single tab stop — so Tab moves past the rest instead of
|
|
101
|
+
* stepping through every item. Arrows move focus only; selection stays
|
|
102
|
+
* consumer-managed.
|
|
103
|
+
*
|
|
104
|
+
* Pragmatic by design: the `list`/`navigation` role is kept (no widget role).
|
|
105
|
+
* Use it only on **simple** lists where each item has a single action and no
|
|
106
|
+
* extra controls (a control in a `start`/`end` slot would not be reachable as
|
|
107
|
+
* its own tab stop). Mutually exclusive with `reorderable` (both use the arrow
|
|
108
|
+
* keys); when both are set, `reorderable` wins and this is ignored.
|
|
109
|
+
*
|
|
110
|
+
* Known a11y limitation: because the role stays `list`/`navigation` (not
|
|
111
|
+
* `listbox`/`menu`), screen readers do not auto-announce that the arrow keys
|
|
112
|
+
* navigate. As a best-effort signal the host carries
|
|
113
|
+
* `aria-keyshortcuts="ArrowUp ArrowDown Home End"` while active, but blind users
|
|
114
|
+
* may still not discover the feature — another reason to keep it to genuinely
|
|
115
|
+
* simple lists.
|
|
116
|
+
*/
|
|
117
|
+
this.arrowNavigation = false;
|
|
118
|
+
/**
|
|
119
|
+
* Only in `type="listbox"`: caps the options' scroll region at this CSS
|
|
120
|
+
* length (any value `CSS.supports('max-height', …)` accepts, e.g. "320px").
|
|
121
|
+
* The search input stays pinned above and the options scroll; the active
|
|
122
|
+
* option is kept in view via `scrollIntoView`. Unset → no cap. No effect
|
|
123
|
+
* outside listbox mode.
|
|
124
|
+
*/
|
|
125
|
+
this.height = '';
|
|
58
126
|
/**
|
|
59
127
|
* Text for the default empty-state dialog. Falls back to the Dutch
|
|
60
|
-
* i18n default ("Geen
|
|
128
|
+
* i18n default ("Geen items"). Ignored when consumers slot their
|
|
61
129
|
* own content into `[slot=empty]`.
|
|
62
130
|
*/
|
|
63
131
|
this.emptyText = '';
|
|
@@ -66,11 +134,28 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
66
134
|
* Ignored when consumers slot their own content into `[slot=empty]`.
|
|
67
135
|
*/
|
|
68
136
|
this.emptySupportingText = '';
|
|
137
|
+
/** Accessible name for the list, forwarded to the inner role: the list in
|
|
138
|
+
* `type=list`, the search field in `type=listbox`. For `type=navigation`,
|
|
139
|
+
* set `aria-label` / `aria-labelledby` on the element directly (it is a
|
|
140
|
+
* landmark). Falls back to the default i18n label when unset. */
|
|
141
|
+
this.accessibleLabel = '';
|
|
69
142
|
/** Override one or more translation keys. Unset keys fall back to the Dutch default. */
|
|
70
143
|
this.translations = {};
|
|
71
144
|
this._mergedTranslations = { ...nlddListTranslations };
|
|
72
|
-
this.
|
|
145
|
+
this._hasToolbar = false;
|
|
146
|
+
this._hasSearchBarEnd = false;
|
|
73
147
|
this._isEmpty = false;
|
|
148
|
+
// — Listbox state ————————————————————————————————————————————————————————
|
|
149
|
+
/** Current search value (listbox mode). Mirrored to the input. */
|
|
150
|
+
this._searchValue = '';
|
|
151
|
+
/** ID of the active option (listbox mode), or '' when none. Fed to the
|
|
152
|
+
* input's aria-activedescendant. Distinct from selection. */
|
|
153
|
+
this._activeId = '';
|
|
154
|
+
/** Whether the search input has focus. aria-activedescendant is the input's
|
|
155
|
+
* virtual focus, so the active-option highlight only shows while it is
|
|
156
|
+
* focused; _activeId is remembered across blur so focus resumes there. */
|
|
157
|
+
this._searchFocused = false;
|
|
158
|
+
this._listboxId = `nldd-list-listbox-${NLDDList_1._idCounter++}`;
|
|
74
159
|
// — Drag state ——————————————————————————————————————————————————————————
|
|
75
160
|
this._draggingEl = null;
|
|
76
161
|
this._draggingFromIndex = -1;
|
|
@@ -82,6 +167,117 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
82
167
|
this._listRect = null;
|
|
83
168
|
// — Observers ————————————————————————————————————————————————————————————
|
|
84
169
|
this._itemsObserver = null;
|
|
170
|
+
this._contextScheduled = false;
|
|
171
|
+
/** Keep the active option valid after the visible set changes (initial
|
|
172
|
+
* render, slot change, or consumer-driven `[hidden]` filtering): ensure ids,
|
|
173
|
+
* reset the active option to the first visible one when the current active is
|
|
174
|
+
* gone (or none was set), push `_highlighted` onto the items, and refresh the
|
|
175
|
+
* input's aria-activedescendant. When nothing is visible the empty state
|
|
176
|
+
* shows and aria-activedescendant is cleared. Deferred to a microtask for the
|
|
177
|
+
* same reason as roving — it can run inside the update lifecycle and would
|
|
178
|
+
* otherwise trip Lit's change-in-update warning. */
|
|
179
|
+
this._listboxScheduled = false;
|
|
180
|
+
this._onSearchInput = (event) => {
|
|
181
|
+
// The native input event is composed and would escape the shadow root
|
|
182
|
+
// alongside our own CustomEvent, reaching consumers as a second `input`
|
|
183
|
+
// without a `detail`. Stop it so the only `input` they see is ours,
|
|
184
|
+
// carrying { value }.
|
|
185
|
+
event.stopPropagation();
|
|
186
|
+
const input = event.target;
|
|
187
|
+
this._searchValue = input.value;
|
|
188
|
+
this._emitListboxInput(this._searchValue);
|
|
189
|
+
};
|
|
190
|
+
this._onClearClick = () => {
|
|
191
|
+
this._clearSearch();
|
|
192
|
+
};
|
|
193
|
+
/** Track whether the search-bar-end slot has content, so its wrapper (and the
|
|
194
|
+
* bar gap) collapses when empty. Bound in the template so it follows the slot
|
|
195
|
+
* even though the search bar only renders in listbox mode. */
|
|
196
|
+
this._onSearchBarEndSlotChange = (event) => {
|
|
197
|
+
this._hasSearchBarEnd = event.target.assignedElements().length > 0;
|
|
198
|
+
};
|
|
199
|
+
this._onSearchFocus = () => {
|
|
200
|
+
this._searchFocused = true;
|
|
201
|
+
// Resume at the remembered active option, or the first visible one if none
|
|
202
|
+
// is set or it was filtered away.
|
|
203
|
+
this._applyListboxOptions();
|
|
204
|
+
};
|
|
205
|
+
this._onSearchBlur = () => {
|
|
206
|
+
this._searchFocused = false;
|
|
207
|
+
this._syncHighlight();
|
|
208
|
+
};
|
|
209
|
+
/** Clicking an option moves the (remembered) active descendant to it, so the
|
|
210
|
+
* highlight resumes there when the search input regains focus. */
|
|
211
|
+
this._onListClick = (event) => {
|
|
212
|
+
if (this.type !== 'listbox')
|
|
213
|
+
return;
|
|
214
|
+
const item = event.target?.closest?.('nldd-list-item');
|
|
215
|
+
if (item && item.parentElement === this && !item.hasAttribute('hidden')) {
|
|
216
|
+
this._activeId = this._ensureOptionId(item);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Listbox keyboard, handled on the search input — focus never leaves it.
|
|
221
|
+
* Arrows/Home/End move the active option among the visible set; Enter
|
|
222
|
+
* activates it by triggering its inner action; Escape clears the value.
|
|
223
|
+
*/
|
|
224
|
+
this._onSearchKeyDown = (event) => {
|
|
225
|
+
const { key } = event;
|
|
226
|
+
if (key === 'Escape') {
|
|
227
|
+
if (this._searchValue !== '') {
|
|
228
|
+
event.preventDefault();
|
|
229
|
+
this._clearSearch();
|
|
230
|
+
}
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (key === 'Enter') {
|
|
234
|
+
const active = this._activeItem;
|
|
235
|
+
if (active) {
|
|
236
|
+
event.preventDefault();
|
|
237
|
+
// Trigger the option's inner action: a link navigates, a button
|
|
238
|
+
// fires the consumer's handler. Selection stays consumer-managed.
|
|
239
|
+
active.shadowRoot?.querySelector('.list-item__action')?.click();
|
|
240
|
+
// Enter is keyboard interaction, so keep focus on the search input
|
|
241
|
+
// (the combobox model: the active option is the virtual focus via
|
|
242
|
+
// aria-activedescendant). The option's click would otherwise pull DOM
|
|
243
|
+
// focus onto it; refocus so typing/arrowing continues and the
|
|
244
|
+
// highlight stays.
|
|
245
|
+
this._searchInput?.focus();
|
|
246
|
+
}
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (key !== 'ArrowDown' && key !== 'ArrowUp' && key !== 'Home' && key !== 'End')
|
|
250
|
+
return;
|
|
251
|
+
const visible = this._getVisibleItems();
|
|
252
|
+
if (visible.length === 0)
|
|
253
|
+
return;
|
|
254
|
+
event.preventDefault();
|
|
255
|
+
const current = visible.findIndex(item => item.id === this._activeId);
|
|
256
|
+
let next;
|
|
257
|
+
if (key === 'Home') {
|
|
258
|
+
next = 0;
|
|
259
|
+
}
|
|
260
|
+
else if (key === 'End') {
|
|
261
|
+
next = visible.length - 1;
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
const dir = key === 'ArrowDown' ? 1 : -1;
|
|
265
|
+
const base = current === -1 ? (dir === 1 ? -1 : 0) : current;
|
|
266
|
+
next = (base + dir + visible.length) % visible.length; // wrap around
|
|
267
|
+
}
|
|
268
|
+
this._setActiveOption(visible[next]);
|
|
269
|
+
};
|
|
270
|
+
this._rovingScheduled = false;
|
|
271
|
+
this._onFocusIn = (event) => {
|
|
272
|
+
if (!this._arrowNavActive)
|
|
273
|
+
return;
|
|
274
|
+
const item = event.composedPath().find((el) => el instanceof Element && el.tagName.toLowerCase() === 'nldd-list-item');
|
|
275
|
+
// Keep the roving entry point wherever focus actually lands (Tab in, a
|
|
276
|
+
// click, or programmatic focus), so arrows continue from there.
|
|
277
|
+
if (item && (item.href || item.button) && !item._rovingActive) {
|
|
278
|
+
this._setRovingActive(item);
|
|
279
|
+
}
|
|
280
|
+
};
|
|
85
281
|
// — Drag: pointer ————————————————————————————————————————————————————————
|
|
86
282
|
this._onPointerDown = (event) => {
|
|
87
283
|
if (!this.reorderable || this.type !== 'list')
|
|
@@ -143,6 +339,12 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
143
339
|
// Mirrors nldd-document-tab-bar: no grab-and-drop cycle — each arrow press
|
|
144
340
|
// reorders the DOM, fires nldd-reorder and restores focus on the handle.
|
|
145
341
|
this._onKeyDown = (event) => {
|
|
342
|
+
// Arrow-navigation and reorder both claim the arrow keys; _arrowNavActive
|
|
343
|
+
// is false whenever reorderable wins, so the two never run together.
|
|
344
|
+
if (this._arrowNavActive) {
|
|
345
|
+
this._onArrowNav(event);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
146
348
|
if (!this.reorderable || this.type !== 'list')
|
|
147
349
|
return;
|
|
148
350
|
if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')
|
|
@@ -189,10 +391,17 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
189
391
|
});
|
|
190
392
|
this._updateItems();
|
|
191
393
|
this._updateEmpty();
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
394
|
+
this._warnArrowNav();
|
|
395
|
+
const toolbarSlot = this.shadowRoot?.querySelector('slot[name="toolbar"]');
|
|
396
|
+
const syncToolbar = () => { this._hasToolbar = (toolbarSlot?.assignedElements().length ?? 0) > 0; };
|
|
397
|
+
toolbarSlot?.addEventListener('slotchange', syncToolbar);
|
|
398
|
+
syncToolbar();
|
|
399
|
+
// The search-bar-end slot only renders in listbox; sync its initial presence
|
|
400
|
+
// here. The @slotchange binding in the template keeps it updated afterwards
|
|
401
|
+
// and re-binds whenever the search bar (re)renders on a type change.
|
|
402
|
+
const searchBarEndSlot = this.shadowRoot?.querySelector('slot[name="search-bar-end"]');
|
|
403
|
+
if (searchBarEndSlot)
|
|
404
|
+
this._hasSearchBarEnd = searchBarEndSlot.assignedElements().length > 0;
|
|
196
405
|
// Watch direct children for add/remove (nldd-list-item gains/lose) and
|
|
197
406
|
// for `hidden` toggles on those direct children (consumer-driven
|
|
198
407
|
// filtering). `subtree: true` is required because `attributes` on the
|
|
@@ -234,31 +443,60 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
234
443
|
this.style.containerName = 'cells-container';
|
|
235
444
|
this.addEventListener('pointerdown', this._onPointerDown);
|
|
236
445
|
this.addEventListener('keydown', this._onKeyDown);
|
|
446
|
+
this.addEventListener('focusin', this._onFocusIn);
|
|
447
|
+
this.addEventListener('click', this._onListClick);
|
|
237
448
|
}
|
|
238
449
|
disconnectedCallback() {
|
|
239
450
|
super.disconnectedCallback();
|
|
240
451
|
this.removeEventListener('pointerdown', this._onPointerDown);
|
|
241
452
|
this.removeEventListener('keydown', this._onKeyDown);
|
|
453
|
+
this.removeEventListener('focusin', this._onFocusIn);
|
|
454
|
+
this.removeEventListener('click', this._onListClick);
|
|
242
455
|
this._itemsObserver?.disconnect();
|
|
243
456
|
this._itemsObserver = null;
|
|
244
457
|
this._cancelDrag();
|
|
245
458
|
}
|
|
246
459
|
updated(changed) {
|
|
247
|
-
if (changed.has('reorderable') || changed.has('type')) {
|
|
460
|
+
if (changed.has('reorderable') || changed.has('type') || changed.has('arrowNavigation')) {
|
|
248
461
|
if (this.reorderable && this.type !== 'list' && import.meta.env?.DEV) {
|
|
249
462
|
console.warn('nldd-list: `reorderable` is only valid when type="list". Ignoring.');
|
|
250
463
|
}
|
|
251
464
|
this._updateItems();
|
|
465
|
+
this._warnArrowNav();
|
|
466
|
+
}
|
|
467
|
+
if (changed.has('variant')) {
|
|
468
|
+
this._updateItemContext();
|
|
252
469
|
}
|
|
253
470
|
if (changed.has('translations')) {
|
|
254
471
|
this._mergedTranslations = { ...nlddListTranslations, ...this.translations };
|
|
255
472
|
}
|
|
256
473
|
if (changed.has('type')) {
|
|
257
474
|
this._applyHostType();
|
|
475
|
+
// Leaving listbox mode: drop the active highlight and reset state so a
|
|
476
|
+
// stale `_highlighted`/aria-activedescendant doesn't survive the switch.
|
|
477
|
+
if (changed.get('type') === 'listbox' && this.type !== 'listbox') {
|
|
478
|
+
this._activeId = '';
|
|
479
|
+
this._getItems().forEach(item => { item._highlighted = false; });
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
if (changed.has('height')) {
|
|
483
|
+
// Mirror the width/height inline-style pattern: validate, then feed a
|
|
484
|
+
// local var the CSS reads as max-height on the scroll region.
|
|
485
|
+
const h = this.height;
|
|
486
|
+
if (h && CSS.supports('max-height', h)) {
|
|
487
|
+
this.style.setProperty('--_max-height', h);
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
this.style.removeProperty('--_max-height');
|
|
491
|
+
}
|
|
258
492
|
}
|
|
259
493
|
}
|
|
260
494
|
// — Host attribute routing ————————————————————————————————————————————————
|
|
261
495
|
_applyHostType() {
|
|
496
|
+
// Only `navigation` puts a role on the host. `list` and `listbox` leave
|
|
497
|
+
// the host role-less: `list` carries role="list" on `.list__items`, and
|
|
498
|
+
// `listbox` carries role="listbox" there — putting a second widget role
|
|
499
|
+
// on the host would nest landmarks/roles incorrectly.
|
|
262
500
|
if (this.type === 'navigation') {
|
|
263
501
|
this.setAttribute('role', 'navigation');
|
|
264
502
|
if (!this.hasAttribute('aria-label') && !this.hasAttribute('aria-labelledby')) {
|
|
@@ -287,12 +525,19 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
287
525
|
const slot = this.shadowRoot?.querySelector('slot:not([name])');
|
|
288
526
|
return (slot?.assignedElements() ?? []).filter((el) => el.tagName.toLowerCase() === 'nldd-list-item' && !el.hasAttribute('data-nldd-placeholder'));
|
|
289
527
|
}
|
|
528
|
+
/** Visible (non-`[hidden]`) items, in DOM order. The active-option model and
|
|
529
|
+
* listbox keyboard operate over this set. */
|
|
530
|
+
_getVisibleItems() {
|
|
531
|
+
return this._getItems().filter(item => !item.hasAttribute('hidden'));
|
|
532
|
+
}
|
|
290
533
|
_updateItems() {
|
|
291
534
|
const items = this._getItems();
|
|
292
535
|
const visibleItems = items.filter(item => !item.hasAttribute('hidden'));
|
|
536
|
+
const firstVisible = visibleItems[0];
|
|
293
537
|
const lastVisible = visibleItems[visibleItems.length - 1];
|
|
294
538
|
const reorderActive = this.reorderable && this.type === 'list';
|
|
295
539
|
items.forEach((item) => {
|
|
540
|
+
item.classList.toggle('is-first', item === firstVisible);
|
|
296
541
|
item.classList.toggle('is-last', item === lastVisible);
|
|
297
542
|
if (reorderActive) {
|
|
298
543
|
item.setAttribute('reorderable', '');
|
|
@@ -301,11 +546,220 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
301
546
|
item.removeAttribute('reorderable');
|
|
302
547
|
}
|
|
303
548
|
});
|
|
549
|
+
this._updateItemContext();
|
|
550
|
+
this._updateRoving();
|
|
551
|
+
if (this.type === 'listbox')
|
|
552
|
+
this._updateListboxOptions();
|
|
553
|
+
}
|
|
554
|
+
/** Push the list's variant + type onto every item, deferred to a microtask:
|
|
555
|
+
* _updateItems runs inside the update lifecycle (firstUpdated/updated), and
|
|
556
|
+
* setting the items' reactive state there would trip Lit's change-in-update
|
|
557
|
+
* warning. Coalesced so repeated item updates schedule it only once. */
|
|
558
|
+
_updateItemContext() {
|
|
559
|
+
if (this._contextScheduled)
|
|
560
|
+
return;
|
|
561
|
+
this._contextScheduled = true;
|
|
562
|
+
queueMicrotask(() => {
|
|
563
|
+
this._contextScheduled = false;
|
|
564
|
+
this._applyItemContext();
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
/** The list owns variant + type; every item mirrors them (is-boxed styling and
|
|
568
|
+
* the option/listitem role). Pushing from the list, not a per-item observer,
|
|
569
|
+
* means a runtime variant/type switch, or a freshly added item, always tracks
|
|
570
|
+
* the list. */
|
|
571
|
+
_applyItemContext() {
|
|
572
|
+
this._getItems().forEach((item) => {
|
|
573
|
+
item._applyVariant(this.variant);
|
|
574
|
+
item._applyParentType(this.type);
|
|
575
|
+
});
|
|
304
576
|
}
|
|
305
577
|
_updateEmpty() {
|
|
306
578
|
const items = this._getItems();
|
|
307
579
|
this._isEmpty = items.length === 0 || items.every(item => item.hasAttribute('hidden'));
|
|
308
580
|
}
|
|
581
|
+
// — Listbox: active-option model ————————————————————————————————————————————
|
|
582
|
+
/** Every option needs a stable id for aria-activedescendant. Assign one to
|
|
583
|
+
* any item that lacks one (consumer-supplied ids win). */
|
|
584
|
+
_ensureOptionId(item) {
|
|
585
|
+
if (!item.id) {
|
|
586
|
+
item.id = `nldd-list-option-${NLDDList_1._optionIdCounter++}`;
|
|
587
|
+
}
|
|
588
|
+
return item.id;
|
|
589
|
+
}
|
|
590
|
+
_updateListboxOptions() {
|
|
591
|
+
if (this._listboxScheduled)
|
|
592
|
+
return;
|
|
593
|
+
this._listboxScheduled = true;
|
|
594
|
+
queueMicrotask(() => {
|
|
595
|
+
this._listboxScheduled = false;
|
|
596
|
+
this._applyListboxOptions();
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
_applyListboxOptions() {
|
|
600
|
+
if (this.type !== 'listbox')
|
|
601
|
+
return;
|
|
602
|
+
const visible = this._getVisibleItems();
|
|
603
|
+
visible.forEach(item => this._ensureOptionId(item));
|
|
604
|
+
// Keep the active option if it's still visible, otherwise fall back to the
|
|
605
|
+
// first visible option (or none when the list is empty).
|
|
606
|
+
const current = visible.find(item => item.id === this._activeId);
|
|
607
|
+
const active = current ?? visible[0];
|
|
608
|
+
this._activeId = active?.id ?? '';
|
|
609
|
+
this._syncHighlight();
|
|
610
|
+
}
|
|
611
|
+
/** Move the active option to `item`: update state, reflect aria-activedescendant
|
|
612
|
+
* on the input, and scroll the option into view (it may be inside the capped
|
|
613
|
+
* scroll region). */
|
|
614
|
+
_setActiveOption(item) {
|
|
615
|
+
this._activeId = this._ensureOptionId(item);
|
|
616
|
+
this._syncHighlight();
|
|
617
|
+
item.scrollIntoView({ block: 'nearest' });
|
|
618
|
+
}
|
|
619
|
+
/** Reflect the active descendant onto the items, but only while the search
|
|
620
|
+
* input is focused (aria-activedescendant is its virtual focus). _activeId is
|
|
621
|
+
* remembered across blur so focus resumes at the same option; the template
|
|
622
|
+
* gates aria-activedescendant on _searchFocused the same way. */
|
|
623
|
+
_syncHighlight() {
|
|
624
|
+
const active = this._searchFocused ? this._activeItem : null;
|
|
625
|
+
this._getItems().forEach(i => { i._highlighted = i === active; });
|
|
626
|
+
}
|
|
627
|
+
/** The currently active option element, or null. */
|
|
628
|
+
get _activeItem() {
|
|
629
|
+
if (!this._activeId)
|
|
630
|
+
return null;
|
|
631
|
+
return this._getVisibleItems().find(item => item.id === this._activeId) ?? null;
|
|
632
|
+
}
|
|
633
|
+
// — Listbox: search input ————————————————————————————————————————————————————
|
|
634
|
+
/** Dispatch the consumer-facing `input` event so it can filter (toggle
|
|
635
|
+
* `[hidden]` on items). Composed + bubbling, `{ detail: { value } }`. */
|
|
636
|
+
_emitListboxInput(value) {
|
|
637
|
+
this.dispatchEvent(new CustomEvent('input', {
|
|
638
|
+
detail: { value },
|
|
639
|
+
bubbles: true,
|
|
640
|
+
composed: true,
|
|
641
|
+
}));
|
|
642
|
+
}
|
|
643
|
+
/** Clear the search value (clear button / Escape) and refire `input` so the
|
|
644
|
+
* consumer refilters. Focus stays on the input. */
|
|
645
|
+
_clearSearch() {
|
|
646
|
+
this._searchValue = '';
|
|
647
|
+
if (this._searchInput)
|
|
648
|
+
this._searchInput.value = '';
|
|
649
|
+
this._emitListboxInput('');
|
|
650
|
+
this._searchInput?.focus();
|
|
651
|
+
}
|
|
652
|
+
// — Arrow navigation (roving tabindex) ————————————————————————————————————
|
|
653
|
+
/** Arrow-navigation is effective only when reorderable isn't already claiming
|
|
654
|
+
* the arrow keys for drag-reorder (reorderable wins). The guard also checks
|
|
655
|
+
* `type === 'list'` on purpose: reorderable is inert without it, so there is no
|
|
656
|
+
* conflict to resolve. `arrow-navigation reorderable` without `type="list"`
|
|
657
|
+
* therefore keeps arrow-nav active (reorderable does nothing), and
|
|
658
|
+
* `_warnArrowNav` likewise only warns for the real reorderable-list conflict. */
|
|
659
|
+
get _arrowNavActive() {
|
|
660
|
+
// Listbox has its own keyboard (on the search input) and supersedes the
|
|
661
|
+
// roving-tabindex arrow-nav — never run both.
|
|
662
|
+
if (this.type === 'listbox')
|
|
663
|
+
return false;
|
|
664
|
+
return this.arrowNavigation && !(this.reorderable && this.type === 'list');
|
|
665
|
+
}
|
|
666
|
+
/** Interactive, visible items — the roving stops. Non-interactive items (no
|
|
667
|
+
* link/button) and hidden items are skipped. */
|
|
668
|
+
_getInteractiveItems() {
|
|
669
|
+
return this._getItems().filter((item) => !item.hasAttribute('hidden') && Boolean(item.href || item.button));
|
|
670
|
+
}
|
|
671
|
+
/** Push roving state onto the items, deferred to a microtask: _updateItems can
|
|
672
|
+
* run inside the update lifecycle (firstUpdated/updated), and setting the
|
|
673
|
+
* items' reactive state there would trip Lit's change-in-update warning.
|
|
674
|
+
* Coalesced so repeated item updates schedule it only once. */
|
|
675
|
+
_updateRoving() {
|
|
676
|
+
if (this._rovingScheduled)
|
|
677
|
+
return;
|
|
678
|
+
this._rovingScheduled = true;
|
|
679
|
+
queueMicrotask(() => {
|
|
680
|
+
this._rovingScheduled = false;
|
|
681
|
+
this._applyRoving();
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
/** Sets the arrow-navigation flag on all items and a single roving entry point
|
|
685
|
+
* (keep the current one if still valid, else the selected item, else the first
|
|
686
|
+
* interactive item). */
|
|
687
|
+
_applyRoving() {
|
|
688
|
+
const active = this._arrowNavActive;
|
|
689
|
+
const items = this._getItems();
|
|
690
|
+
items.forEach((item) => { item._arrowNavigation = active; });
|
|
691
|
+
// Best-effort AT discoverability: role="list"/"navigation" doesn't imply
|
|
692
|
+
// arrow-key navigation the way listbox/menu would, so advertise the keys via
|
|
693
|
+
// aria-keyshortcuts (queryable) and a plain-language aria-description (surfaced
|
|
694
|
+
// when AT reaches the list). See the arrowNavigation JSDoc — known limitation.
|
|
695
|
+
if (active) {
|
|
696
|
+
this.setAttribute('aria-keyshortcuts', 'ArrowUp ArrowDown Home End');
|
|
697
|
+
this.setAttribute('aria-description', this._t('components.list.arrow-navigation-description-text'));
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
this.removeAttribute('aria-keyshortcuts');
|
|
701
|
+
this.removeAttribute('aria-description');
|
|
702
|
+
}
|
|
703
|
+
if (!active) {
|
|
704
|
+
items.forEach((item) => { item._rovingActive = false; });
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
const interactive = this._getInteractiveItems();
|
|
708
|
+
if (interactive.length === 0)
|
|
709
|
+
return;
|
|
710
|
+
const entry = interactive.find((item) => item._rovingActive)
|
|
711
|
+
?? interactive.find((item) => item.selected)
|
|
712
|
+
?? interactive[0];
|
|
713
|
+
items.forEach((item) => { item._rovingActive = item === entry; });
|
|
714
|
+
}
|
|
715
|
+
// items defaults to all items; _onArrowNav passes the interactive set it already
|
|
716
|
+
// computed (non-interactive items are kept out of roving, so they stay false).
|
|
717
|
+
_setRovingActive(activeItem, items = this._getItems()) {
|
|
718
|
+
items.forEach((item) => { item._rovingActive = item === activeItem; });
|
|
719
|
+
}
|
|
720
|
+
_onArrowNav(event) {
|
|
721
|
+
const { key } = event;
|
|
722
|
+
if (key !== 'ArrowUp' && key !== 'ArrowDown' && key !== 'Home' && key !== 'End')
|
|
723
|
+
return;
|
|
724
|
+
const items = this._getInteractiveItems();
|
|
725
|
+
if (items.length === 0)
|
|
726
|
+
return;
|
|
727
|
+
const current = items.findIndex((item) => item._rovingActive);
|
|
728
|
+
let next;
|
|
729
|
+
if (key === 'Home') {
|
|
730
|
+
next = 0;
|
|
731
|
+
}
|
|
732
|
+
else if (key === 'End') {
|
|
733
|
+
next = items.length - 1;
|
|
734
|
+
}
|
|
735
|
+
else {
|
|
736
|
+
const dir = key === 'ArrowDown' ? 1 : -1;
|
|
737
|
+
const base = current === -1 ? (dir === 1 ? -1 : 0) : current;
|
|
738
|
+
next = (base + dir + items.length) % items.length; // wrap around
|
|
739
|
+
}
|
|
740
|
+
event.preventDefault();
|
|
741
|
+
const target = items[next];
|
|
742
|
+
this._setRovingActive(target, items);
|
|
743
|
+
target.focus();
|
|
744
|
+
}
|
|
745
|
+
_warnArrowNav() {
|
|
746
|
+
if (!import.meta.env?.DEV)
|
|
747
|
+
return;
|
|
748
|
+
if (this.arrowNavigation && this.reorderable && this.type === 'list') {
|
|
749
|
+
console.warn('nldd-list: `arrow-navigation` and `reorderable` both use the arrow keys; `reorderable` wins and arrow-navigation is ignored.');
|
|
750
|
+
}
|
|
751
|
+
if (this._arrowNavActive) {
|
|
752
|
+
// Best-effort, light-DOM only: a slotted custom element (e.g. nldd-switch)
|
|
753
|
+
// keeps its focusable control in its own shadow root, so this query won't
|
|
754
|
+
// catch every extra control. Detecting custom elements generically would
|
|
755
|
+
// false-positive on non-interactive ones (nldd-icon, nldd-badge), so this
|
|
756
|
+
// stays a heuristic dev aid for the documented "simple lists" case.
|
|
757
|
+
const hasExtraControls = this._getInteractiveItems().some((item) => item.querySelector('a[href], button, input, select, textarea, [tabindex]') !== null);
|
|
758
|
+
if (hasExtraControls) {
|
|
759
|
+
console.warn('nldd-list: `arrow-navigation` is for simple lists, but a list-item has an extra focusable control (slotted) that will not be reachable as its own tab stop. Remove the control or disable arrow-navigation.');
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
309
763
|
_getDeepActiveElement() {
|
|
310
764
|
let active = document.activeElement;
|
|
311
765
|
while (active?.shadowRoot?.activeElement) {
|
|
@@ -456,10 +910,37 @@ let NLDDList = class NLDDList extends LitElement {
|
|
|
456
910
|
}));
|
|
457
911
|
}
|
|
458
912
|
render() {
|
|
459
|
-
return template(
|
|
913
|
+
return template({
|
|
914
|
+
itemsLabel: this.accessibleLabel || this._t('components.list.items-label-text'),
|
|
915
|
+
hasToolbar: this._hasToolbar,
|
|
916
|
+
type: this.type,
|
|
917
|
+
isEmpty: this._isEmpty,
|
|
918
|
+
emptyText: this.emptyText || this._t('components.list.empty-text'),
|
|
919
|
+
emptySupportingText: this.emptySupportingText,
|
|
920
|
+
listbox: {
|
|
921
|
+
listboxId: this._listboxId,
|
|
922
|
+
searchValue: this._searchValue,
|
|
923
|
+
activeId: this._searchFocused ? this._activeId : '',
|
|
924
|
+
searchPlaceholder: this._t('components.list.search-placeholder-text'),
|
|
925
|
+
searchAccessibleLabel: this.accessibleLabel || this._t('components.list.search-placeholder-text'),
|
|
926
|
+
searchClearLabel: this._t('components.list.search-clear-action'),
|
|
927
|
+
hasSearchBarEnd: this._hasSearchBarEnd,
|
|
928
|
+
onSearchInput: this._onSearchInput,
|
|
929
|
+
onSearchKeyDown: this._onSearchKeyDown,
|
|
930
|
+
onSearchFocus: this._onSearchFocus,
|
|
931
|
+
onSearchBlur: this._onSearchBlur,
|
|
932
|
+
onClearClick: this._onClearClick,
|
|
933
|
+
onSearchBarEndSlotChange: this._onSearchBarEndSlotChange,
|
|
934
|
+
},
|
|
935
|
+
});
|
|
460
936
|
}
|
|
461
937
|
};
|
|
462
938
|
NLDDList.styles = [listStyles];
|
|
939
|
+
/** Stable id for `.list__items` (the listbox), referenced by the input's
|
|
940
|
+
* aria-controls. Per-instance, like nldd-combo-box's `_menuId`. */
|
|
941
|
+
NLDDList._idCounter = 0;
|
|
942
|
+
/** Counter for auto-assigned option ids (listbox mode). */
|
|
943
|
+
NLDDList._optionIdCounter = 0;
|
|
463
944
|
__decorate([
|
|
464
945
|
property({ reflect: true })
|
|
465
946
|
], NLDDList.prototype, "variant", void 0);
|
|
@@ -475,12 +956,21 @@ __decorate([
|
|
|
475
956
|
__decorate([
|
|
476
957
|
property({ type: Boolean, reflect: true, attribute: 'no-dividers' })
|
|
477
958
|
], NLDDList.prototype, "noDividers", void 0);
|
|
959
|
+
__decorate([
|
|
960
|
+
property({ type: Boolean, reflect: true, attribute: 'arrow-navigation' })
|
|
961
|
+
], NLDDList.prototype, "arrowNavigation", void 0);
|
|
962
|
+
__decorate([
|
|
963
|
+
property({ type: String, reflect: true })
|
|
964
|
+
], NLDDList.prototype, "height", void 0);
|
|
478
965
|
__decorate([
|
|
479
966
|
property({ type: String, attribute: 'empty-text' })
|
|
480
967
|
], NLDDList.prototype, "emptyText", void 0);
|
|
481
968
|
__decorate([
|
|
482
969
|
property({ type: String, attribute: 'empty-supporting-text' })
|
|
483
970
|
], NLDDList.prototype, "emptySupportingText", void 0);
|
|
971
|
+
__decorate([
|
|
972
|
+
property({ type: String, attribute: 'accessible-label' })
|
|
973
|
+
], NLDDList.prototype, "accessibleLabel", void 0);
|
|
484
974
|
__decorate([
|
|
485
975
|
property({ type: Object })
|
|
486
976
|
], NLDDList.prototype, "translations", void 0);
|
|
@@ -489,11 +979,26 @@ __decorate([
|
|
|
489
979
|
], NLDDList.prototype, "_mergedTranslations", void 0);
|
|
490
980
|
__decorate([
|
|
491
981
|
state()
|
|
492
|
-
], NLDDList.prototype, "
|
|
982
|
+
], NLDDList.prototype, "_hasToolbar", void 0);
|
|
983
|
+
__decorate([
|
|
984
|
+
state()
|
|
985
|
+
], NLDDList.prototype, "_hasSearchBarEnd", void 0);
|
|
493
986
|
__decorate([
|
|
494
987
|
state()
|
|
495
988
|
], NLDDList.prototype, "_isEmpty", void 0);
|
|
496
|
-
|
|
989
|
+
__decorate([
|
|
990
|
+
state()
|
|
991
|
+
], NLDDList.prototype, "_searchValue", void 0);
|
|
992
|
+
__decorate([
|
|
993
|
+
state()
|
|
994
|
+
], NLDDList.prototype, "_activeId", void 0);
|
|
995
|
+
__decorate([
|
|
996
|
+
state()
|
|
997
|
+
], NLDDList.prototype, "_searchFocused", void 0);
|
|
998
|
+
__decorate([
|
|
999
|
+
query('.list__search-field-input')
|
|
1000
|
+
], NLDDList.prototype, "_searchInput", void 0);
|
|
1001
|
+
NLDDList = NLDDList_1 = __decorate([
|
|
497
1002
|
customElement('nldd-list')
|
|
498
1003
|
], NLDDList);
|
|
499
1004
|
export { NLDDList };
|