@nldd/design-system 0.8.92 → 0.8.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICES.md +9 -27
- package/README.md +37 -24
- package/custom-elements.json +1640 -1494
- package/dist/components/actions/button/button.d.ts +20 -1
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +47 -3
- 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 +3 -1
- package/dist/components/actions/button/button.styles.js.map +1 -1
- package/dist/components/actions/button/button.template.js +3 -3
- package/dist/components/actions/button-group/button-group.d.ts +48 -3
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +104 -11
- package/dist/components/actions/button-group/button-group.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 +64 -4
- package/dist/components/actions/button-group/button-group.styles.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +5 -2
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- 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.template.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +7 -4
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +29 -29
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +53 -53
- package/dist/components/actions/menu/menu.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 -0
- package/dist/components/actions/menu/menu.styles.js.map +1 -1
- package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.template.js +8 -2
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +24 -10
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +57 -26
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +7 -7
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +3 -2
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/components.js +1909 -928
- package/dist/components/content/avatar/avatar.d.ts +23 -5
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +23 -5
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar/avatar.template.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.template.js +5 -2
- package/dist/components/content/avatar/avatar.template.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.js +6 -2
- package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -1
- package/dist/components/content/icon/icon.d.ts +18 -6
- package/dist/components/content/icon/icon.d.ts.map +1 -1
- package/dist/components/content/icon/icon.js +30 -10
- package/dist/components/content/icon/icon.js.map +1 -1
- package/dist/components/content/identity/identity.template.d.ts.map +1 -1
- package/dist/components/content/identity/identity.template.js +4 -1
- package/dist/components/content/identity/identity.template.js.map +1 -1
- package/dist/components/content/image/image.template.d.ts.map +1 -1
- package/dist/components/content/image/image.template.js +7 -2
- package/dist/components/content/image/image.template.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +18 -9
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +24 -15
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tag/tag.d.ts +2 -2
- 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/tag/tag.template.js +2 -2
- package/dist/components/content/title/title.d.ts +30 -6
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +72 -8
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/content/title/title.styles.d.ts.map +1 -1
- package/dist/components/content/title/title.styles.js +41 -4
- package/dist/components/content/title/title.styles.js.map +1 -1
- package/dist/components/content/title/title.template.d.ts +2 -1
- package/dist/components/content/title/title.template.d.ts.map +1 -1
- package/dist/components/content/title/title.template.js +33 -5
- package/dist/components/content/title/title.template.js.map +1 -1
- package/dist/components/content/token/token.d.ts +15 -5
- package/dist/components/content/token/token.d.ts.map +1 -1
- package/dist/components/content/token/token.i18n.d.ts +7 -0
- package/dist/components/content/token/token.i18n.d.ts.map +1 -0
- package/dist/components/content/token/token.i18n.js +6 -0
- package/dist/components/content/token/token.i18n.js.map +1 -0
- package/dist/components/content/token/token.js +55 -14
- package/dist/components/content/token/token.js.map +1 -1
- package/dist/components/content/token/token.template.js +4 -4
- package/dist/components/content/token/token.template.js.map +1 -1
- package/dist/components/forms/form/form.d.ts +18 -7
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +18 -7
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.d.ts +1 -1
- package/dist/components/forms/form-actions/form-actions.js +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +12 -1
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +12 -1
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/forms/form-section/form-section.d.ts +3 -3
- package/dist/components/forms/form-section/form-section.js +8 -8
- package/dist/components/forms/form-section/form-section.js.map +1 -1
- package/dist/components/forms/validation-list/validation-list.d.ts +7 -4
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +7 -4
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/{icon-C_zwJZ_g.js → icon-DWNVcttg.js} +4 -4
- package/dist/components/{icon-button-oua8pmMC.js → icon-button-hO6k8W63.js} +17 -11
- package/dist/components/inputs/checkbox/checkbox.template.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.template.js +11 -5
- package/dist/components/inputs/checkbox/checkbox.template.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts +4 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +4 -1
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.template.js +2 -2
- package/dist/components/inputs/date-field/date-field.template.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.template.js +5 -3
- package/dist/components/inputs/date-field/date-field.template.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js +1 -1
- package/dist/components/inputs/dropdown/dropdown.template.js +3 -3
- package/dist/components/inputs/file-field/file-field.template.js +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.template.js +2 -2
- package/dist/components/inputs/number-field/number-field.styles.js +4 -4
- package/dist/components/inputs/password-field/password-field.template.js +2 -2
- package/dist/components/inputs/radio-button/radio-button.template.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.template.js +3 -1
- package/dist/components/inputs/radio-button/radio-button.template.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +24 -24
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +40 -40
- package/dist/components/inputs/search-field/search-field.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 +4 -2
- package/dist/components/inputs/search-field/search-field.template.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.template.js +2 -2
- package/dist/components/inputs/switch/switch.template.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +1 -1
- package/dist/components/inputs/text-field/text-field.template.js +2 -2
- package/dist/components/inputs/time-field/time-field.template.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.js +5 -3
- package/dist/components/inputs/time-field/time-field.template.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.template.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.template.js +4 -3
- package/dist/components/inputs/toggle-button/toggle-button.template.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.i18n.js +1 -1
- package/dist/components/inputs/token-field/token-field.i18n.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.styles.js +2 -1
- package/dist/components/inputs/token-field/token-field.styles.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.template.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.template.js +6 -4
- package/dist/components/inputs/token-field/token-field.template.js.map +1 -1
- package/dist/components/layout/app-view/app-view.d.ts +8 -0
- package/dist/components/layout/app-view/app-view.d.ts.map +1 -1
- package/dist/components/layout/app-view/app-view.js +8 -0
- package/dist/components/layout/app-view/app-view.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +4 -4
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.js +7 -7
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/card/card.template.d.ts.map +1 -1
- package/dist/components/layout/card/card.template.js +4 -2
- package/dist/components/layout/card/card.template.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +11 -6
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +19 -14
- package/dist/components/layout/collection/collection.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 -1
- package/dist/components/layout/collection/collection.template.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +13 -8
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +19 -14
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +52 -2
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +94 -3
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.template.d.ts +6 -0
- package/dist/components/layout/page/page.template.d.ts.map +1 -1
- package/dist/components/layout/page/page.template.js +21 -6
- package/dist/components/layout/page/page.template.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts +2 -2
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +4 -4
- package/dist/components/layout/page-footer/page-footer.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.template.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.template.js +16 -4
- package/dist/components/layout/page-footer/page-footer.template.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +4 -6
- 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 +4 -5
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.template.js +8 -2
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +12 -14
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +19 -20
- package/dist/components/layout/page-sections/hero/hero.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 +6 -2
- 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.d.ts +6 -8
- 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 +6 -7
- 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-half-one-half-section/one-half-one-half-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.template.js +8 -2
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +6 -8
- 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 +6 -7
- 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/one-third-two-thirds-section/one-third-two-thirds-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.template.js +8 -2
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/page-section-controls.d.ts +139 -44
- package/dist/components/layout/page-sections/page-section-controls.d.ts.map +1 -1
- package/dist/components/layout/page-sections/page-section-controls.js +44 -47
- package/dist/components/layout/page-sections/page-section-controls.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +11 -12
- 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 +19 -19
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js +8 -2
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +14 -8
- 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 +14 -7
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.template.js +8 -2
- package/dist/components/layout/page-sections/simple-section/simple-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +6 -8
- 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 +6 -7
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.js +8 -2
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +12 -8
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +38 -18
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +26 -11
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +59 -20
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.js +4 -0
- package/dist/components/layout/sheet/sheet.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.template.js +1 -1
- package/dist/components/layout/sheet/sheet.template.js.map +1 -1
- package/dist/components/layout/spacer/spacer.d.ts +13 -0
- package/dist/components/layout/spacer/spacer.d.ts.map +1 -1
- package/dist/components/layout/spacer/spacer.js +13 -0
- package/dist/components/layout/spacer/spacer.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +4 -1
- 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 +4 -1
- 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 +11 -6
- 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 +17 -12
- 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 +4 -0
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +3 -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 +3 -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-pane/split-view-pane.d.ts +4 -4
- 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 +8 -8
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +30 -18
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +66 -31
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.d.ts +4 -2
- package/dist/components/lists-and-tables/cells/cell/cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.js +7 -5
- package/dist/components/lists-and-tables/cells/cell/cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.template.js +88 -16
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts +4 -2
- 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 +7 -5
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.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 +23 -0
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.template.js +11 -2
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +2 -2
- 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 +5 -5
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.template.js +8 -2
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.d.ts +5 -5
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.js +8 -8
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.template.js +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +3 -3
- 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 +6 -6
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.template.js +8 -2
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +3 -3
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +6 -6
- 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 +4 -0
- package/dist/components/lists-and-tables/list/list.styles.js.map +1 -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 +25 -8
- 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 +61 -39
- 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 +106 -37
- 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 +4 -14
- package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +35 -10
- 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 +45 -18
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js +4 -14
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +11 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +2 -2
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +5 -5
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +6 -6
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +9 -3
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
- package/dist/components/navigation/link/link.template.js +2 -2
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js +4 -4
- package/dist/components/navigation/pagination/pagination.styles.js +4 -4
- package/dist/components/navigation/pagination/pagination.template.js +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +2 -2
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.template.js +4 -2
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.template.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +6 -2
- 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 -2
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.styles.js +2 -2
- package/dist/components/navigation/top-title-bar/top-title-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.template.js +18 -3
- package/dist/components/navigation/top-title-bar/top-title-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +4 -4
- package/dist/components/status-and-feedback/badge/badge.template.js +1 -1
- package/dist/components/status-and-feedback/banner/banner.template.js +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +14 -5
- 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 +43 -13
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js +4 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts +8 -8
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +13 -13
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.template.js +5 -2
- package/dist/components/status-and-feedback/notification/notification.template.js.map +1 -1
- package/dist/components/status-and-feedback/notification/{notification-region.d.ts → notifications-area.d.ts} +3 -3
- package/dist/components/status-and-feedback/notification/notifications-area.d.ts.map +1 -0
- package/dist/components/status-and-feedback/notification/{notification-region.js → notifications-area.js} +137 -140
- package/dist/components/status-and-feedback/notification/notifications-area.js.map +1 -0
- 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 -0
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js +2 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js +106 -18
- package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.template.js +1 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.d.ts +4 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.js +4 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.template.js +2 -2
- package/dist/css/form-section.css +4 -4
- package/dist/css/form.css +4 -0
- package/dist/css/rich-text.css +26 -11
- package/dist/css/variables.css +3 -14
- package/dist/nldd.min.js +1316 -841
- package/dist/types/vue.d.ts +313 -266
- package/dist/utilities/page-section-mixin.d.ts +3 -8
- package/dist/utilities/page-section-mixin.d.ts.map +1 -1
- package/dist/utilities/page-section-mixin.js +4 -84
- package/dist/utilities/page-section-mixin.js.map +1 -1
- package/dist/utilities/title-bar-label-controller.d.ts +25 -0
- package/dist/utilities/title-bar-label-controller.d.ts.map +1 -0
- package/dist/utilities/title-bar-label-controller.js +52 -0
- package/dist/utilities/title-bar-label-controller.js.map +1 -0
- package/package.json +4 -2
- package/dist/components/status-and-feedback/notification/notification-region.d.ts.map +0 -1
- package/dist/components/status-and-feedback/notification/notification-region.js.map +0 -1
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* @attr {string} popovertarget - ID of a popover element this button invokes; forwarded to the inner button. Use the popoverTargetElement property instead when the popover lives in another tree.
|
|
12
12
|
* @attr {boolean} expandable - Whether the button has a icon to indicate it opens a menu or popover
|
|
13
13
|
* @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
|
|
14
|
-
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state.
|
|
14
|
+
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
|
|
15
|
+
* @attr {string} form - Id of the form this button submits or resets, for a button that sits outside it. Takes an `nldd-form` as well as a plain `<form>`. Without it the button acts on the form it stands in. The id is looked up in the button's own root, as the platform does it: a button inside a shadow tree does not reach a form in the document around it. An id that finds nothing, or an `nldd-form` that has not rendered its form yet, says so in development rather than letting the click do nothing.
|
|
15
16
|
* @attr {string} width - Width mode: 'full' (stretches to container) or any CSS length (e.g. '240px')
|
|
16
17
|
* @attr {string} max-width - Caps the width at this CSS length (e.g. '320px'). Combines with `width="full"`: the button follows its container up to the cap. A label that doesn't fit is truncated with an ellipsis — a cap only means something if the content respects it.
|
|
17
18
|
* @attr {string} text - Button text
|
|
@@ -128,12 +129,30 @@ export declare class NLDDButton extends NLDDButton_base {
|
|
|
128
129
|
*/
|
|
129
130
|
rel: string | undefined;
|
|
130
131
|
private _warnedA11y;
|
|
132
|
+
private _warnedFormId;
|
|
131
133
|
/** Shared wiring for an overlay slotted into `popup`: anchors it to this
|
|
132
134
|
* button and turns clicks into open/close. Not private: the template module
|
|
133
135
|
* binds its handlers. */
|
|
134
136
|
_popup: PopupAnchorController;
|
|
135
137
|
updated(changedProperties: Map<string, unknown>): void;
|
|
136
138
|
private _handleClick;
|
|
139
|
+
/**
|
|
140
|
+
* The form this button acts on: the one it sits in, or the one its `form`
|
|
141
|
+
* attribute names.
|
|
142
|
+
*
|
|
143
|
+
* The platform resolves that attribute itself, but only to a real `<form>`.
|
|
144
|
+
* An `nldd-form` renders its form in the light DOM without handing it the id
|
|
145
|
+
* the consumer wrote, so an id pointing at the component finds an element
|
|
146
|
+
* that is not a form, and the button ends up with no form owner at all. That
|
|
147
|
+
* is the whole reason a save button in a page footer, outside the form it
|
|
148
|
+
* belongs to, used to do nothing.
|
|
149
|
+
*
|
|
150
|
+
* The id is looked up in the button's own root, the same scope the platform
|
|
151
|
+
* searches: a button inside a shadow tree reaches the forms in that tree, not
|
|
152
|
+
* one in the document around it. Put the two in the same tree, or hand the
|
|
153
|
+
* button its form another way.
|
|
154
|
+
*/
|
|
155
|
+
private _ownerForm;
|
|
137
156
|
/**
|
|
138
157
|
* Delegates focus to the inner `<button>` (or `<a>` when `href` is set), so
|
|
139
158
|
* consumers can call `buttonEl.focus()` without reaching into shadow DOM.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAO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AAO,UAAS;IAGhB,QAAQ,UAAS;IAEjB,mBAAmB;IAEnB,IAAI,SAAM;IAEV,mMAAmM;IAEnM,cAAc,SAAM;IAGpB,UAAU,UAAS;IAEnB,gHAAgH;IAEhH,iBAAiB,UAAS;IAE1B,6FAA6F;IAE7F,SAAS,SAAM;IAEf,wFAAwF;IAExF,OAAO,SAAM;IAEb,0GAA0G;IAE1G,eAAe,SAAM;IAErB,4DAA4D;IAE5D,IAAI,EAAE,MAAM,GAAG,SAAS,CAAa;IAErC,+DAA+D;IAE/D,MAAM,EAAE,MAAM,GAAG,SAAS,CAAa;IAEvC;;;OAGG;IAEH,GAAG,EAAE,MAAM,GAAG,SAAS,CAAa;IAEpC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAuB;IAE5C;;6BAEyB;IACzB,MAAM,wBAAmC;IAEhC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAmC/D,OAAO,CAAC,YAAY;IAgCpB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,UAAU;IAuBlB;;;OAGG;IACM,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAI5C,6DAA6D;IACpD,eAAe,IAAI,OAAO,GAAG,IAAI;IAIjC,MAAM;CAKf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD"}
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* @attr {string} popovertarget - ID of a popover element this button invokes; forwarded to the inner button. Use the popoverTargetElement property instead when the popover lives in another tree.
|
|
12
12
|
* @attr {boolean} expandable - Whether the button has a icon to indicate it opens a menu or popover
|
|
13
13
|
* @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
|
|
14
|
-
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state.
|
|
14
|
+
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
|
|
15
|
+
* @attr {string} form - Id of the form this button submits or resets, for a button that sits outside it. Takes an `nldd-form` as well as a plain `<form>`. Without it the button acts on the form it stands in. The id is looked up in the button's own root, as the platform does it: a button inside a shadow tree does not reach a form in the document around it. An id that finds nothing, or an `nldd-form` that has not rendered its form yet, says so in development rather than letting the click do nothing.
|
|
15
16
|
* @attr {string} width - Width mode: 'full' (stretches to container) or any CSS length (e.g. '240px')
|
|
16
17
|
* @attr {string} max-width - Caps the width at this CSS length (e.g. '320px'). Combines with `width="full"`: the button follows its container up to the cap. A label that doesn't fit is truncated with an ellipsis — a cap only means something if the content respects it.
|
|
17
18
|
* @attr {string} text - Button text
|
|
@@ -125,6 +126,7 @@ let NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitElemen
|
|
|
125
126
|
*/
|
|
126
127
|
this.rel = undefined;
|
|
127
128
|
this._warnedA11y = false;
|
|
129
|
+
this._warnedFormId = null;
|
|
128
130
|
/** Shared wiring for an overlay slotted into `popup`: anchors it to this
|
|
129
131
|
* button and turns clicks into open/close. Not private: the template module
|
|
130
132
|
* binds its handlers. */
|
|
@@ -194,10 +196,52 @@ let NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitElemen
|
|
|
194
196
|
// or separate forms.
|
|
195
197
|
if (this.href)
|
|
196
198
|
return;
|
|
199
|
+
const form = this._ownerForm();
|
|
197
200
|
if (this.type === 'submit')
|
|
198
|
-
|
|
201
|
+
form?.requestSubmit();
|
|
199
202
|
else if (this.type === 'reset')
|
|
200
|
-
|
|
203
|
+
form?.reset();
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* The form this button acts on: the one it sits in, or the one its `form`
|
|
207
|
+
* attribute names.
|
|
208
|
+
*
|
|
209
|
+
* The platform resolves that attribute itself, but only to a real `<form>`.
|
|
210
|
+
* An `nldd-form` renders its form in the light DOM without handing it the id
|
|
211
|
+
* the consumer wrote, so an id pointing at the component finds an element
|
|
212
|
+
* that is not a form, and the button ends up with no form owner at all. That
|
|
213
|
+
* is the whole reason a save button in a page footer, outside the form it
|
|
214
|
+
* belongs to, used to do nothing.
|
|
215
|
+
*
|
|
216
|
+
* The id is looked up in the button's own root, the same scope the platform
|
|
217
|
+
* searches: a button inside a shadow tree reaches the forms in that tree, not
|
|
218
|
+
* one in the document around it. Put the two in the same tree, or hand the
|
|
219
|
+
* button its form another way.
|
|
220
|
+
*/
|
|
221
|
+
_ownerForm() {
|
|
222
|
+
const id = this.getAttribute('form');
|
|
223
|
+
if (!id)
|
|
224
|
+
return this._internals.form;
|
|
225
|
+
const root = this.getRootNode();
|
|
226
|
+
const target = 'getElementById' in root ? root.getElementById(id) : null;
|
|
227
|
+
if (target instanceof HTMLFormElement)
|
|
228
|
+
return target;
|
|
229
|
+
const rendered = target?.form;
|
|
230
|
+
if (rendered instanceof HTMLFormElement)
|
|
231
|
+
return rendered;
|
|
232
|
+
// Nothing to submit is the silent failure this attribute exists to end:
|
|
233
|
+
// the click does nothing and no error says why. Say it once per button,
|
|
234
|
+
// naming what the id found, since a typo and an nldd-form that has not
|
|
235
|
+
// rendered yet look identical from the outside.
|
|
236
|
+
// Keyed on the id, not a flag: fix a typo and point at another form that
|
|
237
|
+
// does not exist either, and that one has to be said as well.
|
|
238
|
+
if (import.meta.env?.DEV && this._warnedFormId !== id) {
|
|
239
|
+
this._warnedFormId = id;
|
|
240
|
+
console.warn(target
|
|
241
|
+
? `<nldd-button form="${id}">: that id is an <${target.tagName.toLowerCase()}> without a form, so this button submits nothing. An nldd-form only has one once it has rendered.`
|
|
242
|
+
: `<nldd-button form="${id}">: nothing in this root has that id, so this button submits nothing.`);
|
|
243
|
+
}
|
|
244
|
+
return null;
|
|
201
245
|
}
|
|
202
246
|
/**
|
|
203
247
|
* Delegates focus to the inner `<button>` (or `<a>` when `href` is set), so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,8BAA8B,CAAC;AACtC,OAAO,sEAAsE,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAoBhE,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,WAAW,CAAC,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC;IAA1F;;QAOE,eAAU,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAG5C,YAAO,GAAY,gBAAgB,CAAC;QAGpC,SAAI,GAAS,IAAI,CAAC;QAElB,mGAAmG;QAEnG,wBAAmB,GAAqC,EAAE,CAAC;QAE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AE,MAAM,EAAE,CAAC;0CACY;AAOvC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACS;AApIxB,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA0QtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,yBAonBxB,CAAC"}
|
|
@@ -10,7 +10,9 @@ export const buttonStyles = css `
|
|
|
10
10
|
|
|
11
11
|
:host {
|
|
12
12
|
--_corner-radius: var(--semantics-controls-md-corner-radius);
|
|
13
|
-
|
|
13
|
+
/* A parent that stacks its buttons says so through the context variable;
|
|
14
|
+
the button's own width attribute overrides it with an inline style. */
|
|
15
|
+
--_width: var(--context-button-width, auto);
|
|
14
16
|
--_min-size: var(--semantics-controls-md-min-size);
|
|
15
17
|
--_block-padding: var(--semantics-controls-md-block-padding);
|
|
16
18
|
--_inline-padding: var(--semantics-buttons-md-inline-padding);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkC3B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAklBrB,CAAC"}
|
|
@@ -8,7 +8,7 @@ function renderContent(component) {
|
|
|
8
8
|
<span class="button__content">
|
|
9
9
|
${component.startIcon ? html `
|
|
10
10
|
<span class="button__start-icon">
|
|
11
|
-
<nldd-icon
|
|
11
|
+
<nldd-icon icon=${component.startIcon}></nldd-icon>
|
|
12
12
|
</span>
|
|
13
13
|
` : html `<slot name="start-icon"></slot>`}
|
|
14
14
|
<span class="button__text-area">
|
|
@@ -17,13 +17,13 @@ function renderContent(component) {
|
|
|
17
17
|
</span>
|
|
18
18
|
${component.endIcon ? html `
|
|
19
19
|
<span class="button__end-icon">
|
|
20
|
-
<nldd-icon
|
|
20
|
+
<nldd-icon icon=${component.endIcon}></nldd-icon>
|
|
21
21
|
</span>
|
|
22
22
|
` : html `<slot name="end-icon"></slot>`}
|
|
23
23
|
</span>
|
|
24
24
|
${component.expandable ? html `
|
|
25
25
|
<nldd-icon class="button__disclosure-icon"
|
|
26
|
-
|
|
26
|
+
icon="chevron-down-small"
|
|
27
27
|
></nldd-icon>
|
|
28
28
|
` : nothing}
|
|
29
29
|
`;
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Nederlandse Digitale Dienst Button Group Component (Lit + TypeScript)
|
|
3
3
|
*
|
|
4
|
-
* A container for grouping related buttons together,
|
|
4
|
+
* A container for grouping related buttons together, in a row or stacked.
|
|
5
|
+
*
|
|
6
|
+
* `auto`, the default, is a row on a container wide enough for one and a stack
|
|
7
|
+
* over the full width below the sm breakpoint, where two labels beside each
|
|
8
|
+
* other leave no room for either. The group is its own container, so it follows
|
|
9
|
+
* the width it was given rather than the width of the window: the same group is
|
|
10
|
+
* a row in a page and a stack in a sheet beside it.
|
|
11
|
+
*
|
|
12
|
+
* Being a container has one consequence to know: the width has to come from the
|
|
13
|
+
* parent, since a container may not size itself from what is inside it. In a
|
|
14
|
+
* parent that shrink-wraps its content (an inline-flex box, a float, a table
|
|
15
|
+
* cell, a flex item at `width: auto`) the group measures zero and its buttons
|
|
16
|
+
* are invisible. It says so once in development. Give the group or that parent
|
|
17
|
+
* a width.
|
|
18
|
+
*
|
|
19
|
+
* A stack fills the width with its buttons, except an `nldd-icon-button`, which
|
|
20
|
+
* keeps its own size: a bar with a single glyph in the middle is not a bigger
|
|
21
|
+
* target, only a wider one.
|
|
5
22
|
*
|
|
6
23
|
* @element nldd-button-group
|
|
7
24
|
* @attr {string} size - Button group size: 'sm' | 'md' (default: 'md')
|
|
8
|
-
* @attr {string} orientation - Layout direction: 'horizontal' | 'vertical' (default: '
|
|
25
|
+
* @attr {string} orientation - Layout direction: 'auto' | 'horizontal' | 'vertical' (default: 'auto')
|
|
9
26
|
*
|
|
10
27
|
* @slot - Default slot for buttons (max 3)
|
|
11
28
|
*
|
|
@@ -13,14 +30,42 @@
|
|
|
13
30
|
*/
|
|
14
31
|
import { LitElement } from 'lit';
|
|
15
32
|
type Size = 'sm' | 'md';
|
|
16
|
-
type Orientation = 'horizontal' | 'vertical';
|
|
33
|
+
type Orientation = 'auto' | 'horizontal' | 'vertical';
|
|
17
34
|
export declare class NLDDButtonGroup extends LitElement {
|
|
18
35
|
static styles: import("lit").CSSResult;
|
|
19
36
|
size: Size;
|
|
20
37
|
orientation: Orientation;
|
|
21
38
|
private _slot;
|
|
39
|
+
/** DEV only: watches for the collapse below, then lets itself go. */
|
|
40
|
+
private _collapseObserver;
|
|
41
|
+
/** Timer holding a zero-width reading before it counts as a verdict. */
|
|
42
|
+
private _collapseVerdict;
|
|
22
43
|
handleSlotChange(): void;
|
|
23
44
|
updated(changedProperties: Map<string, unknown>): void;
|
|
45
|
+
connectedCallback(): void;
|
|
46
|
+
disconnectedCallback(): void;
|
|
47
|
+
/**
|
|
48
|
+
* The group is an inline-size container while `orientation` is `auto`, so its
|
|
49
|
+
* width has to come from its parent: a container may not size itself from its
|
|
50
|
+
* own contents. In a parent that shrink-wraps (inline-flex, a float, a table
|
|
51
|
+
* cell, a flex item at `width: auto`) there is nothing to take, the group
|
|
52
|
+
* measures zero and the buttons disappear without an error.
|
|
53
|
+
*
|
|
54
|
+
* Watched rather than sampled: a group can be in a closed sheet or behind
|
|
55
|
+
* `display: none` on its first frame, and a parent can get its width a tick
|
|
56
|
+
* later, so one look would call both of those a collapse or miss the real
|
|
57
|
+
* one. The observer waits for the group to be displayed, says it once and
|
|
58
|
+
* stops watching either way. It starts again when the group is reconnected
|
|
59
|
+
* somewhere else or when `orientation` turns to `auto`, since both change
|
|
60
|
+
* the answer.
|
|
61
|
+
*
|
|
62
|
+
* A zero reading waits before it counts: a parent can hand over its width a
|
|
63
|
+
* frame or two after the first paint, and that looks exactly like a collapse
|
|
64
|
+
* until it does. Only a zero that is still zero when the timer runs out gets
|
|
65
|
+
* said out loud.
|
|
66
|
+
*/
|
|
67
|
+
private _watchForCollapse;
|
|
68
|
+
private _stopWatchingForCollapse;
|
|
24
69
|
render(): import("lit-html").TemplateResult<1>;
|
|
25
70
|
}
|
|
26
71
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMjC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACxB,KAAK,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;AAEtD,qBACa,eAAgB,SAAQ,UAAU;IAC9C,OAAgB,MAAM,0BAAqB;IAG3C,IAAI,EAAE,IAAI,CAAQ;IAGlB,WAAW,EAAE,WAAW,CAAU;IAGlC,OAAO,CAAC,KAAK,CAAmB;IAEhC,qEAAqE;IACrE,OAAO,CAAC,iBAAiB,CAA+B;IACxD,wEAAwE;IACxE,OAAO,CAAC,gBAAgB,CAAK;IAE7B,gBAAgB;IAeP,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAO/C,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAKrC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,iBAAiB;IAgCzB,OAAO,CAAC,wBAAwB;IAOvB,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD"}
|
|
@@ -7,11 +7,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
/**
|
|
8
8
|
* Nederlandse Digitale Dienst Button Group Component (Lit + TypeScript)
|
|
9
9
|
*
|
|
10
|
-
* A container for grouping related buttons together,
|
|
10
|
+
* A container for grouping related buttons together, in a row or stacked.
|
|
11
|
+
*
|
|
12
|
+
* `auto`, the default, is a row on a container wide enough for one and a stack
|
|
13
|
+
* over the full width below the sm breakpoint, where two labels beside each
|
|
14
|
+
* other leave no room for either. The group is its own container, so it follows
|
|
15
|
+
* the width it was given rather than the width of the window: the same group is
|
|
16
|
+
* a row in a page and a stack in a sheet beside it.
|
|
17
|
+
*
|
|
18
|
+
* Being a container has one consequence to know: the width has to come from the
|
|
19
|
+
* parent, since a container may not size itself from what is inside it. In a
|
|
20
|
+
* parent that shrink-wraps its content (an inline-flex box, a float, a table
|
|
21
|
+
* cell, a flex item at `width: auto`) the group measures zero and its buttons
|
|
22
|
+
* are invisible. It says so once in development. Give the group or that parent
|
|
23
|
+
* a width.
|
|
24
|
+
*
|
|
25
|
+
* A stack fills the width with its buttons, except an `nldd-icon-button`, which
|
|
26
|
+
* keeps its own size: a bar with a single glyph in the middle is not a bigger
|
|
27
|
+
* target, only a wider one.
|
|
11
28
|
*
|
|
12
29
|
* @element nldd-button-group
|
|
13
30
|
* @attr {string} size - Button group size: 'sm' | 'md' (default: 'md')
|
|
14
|
-
* @attr {string} orientation - Layout direction: 'horizontal' | 'vertical' (default: '
|
|
31
|
+
* @attr {string} orientation - Layout direction: 'auto' | 'horizontal' | 'vertical' (default: 'auto')
|
|
15
32
|
*
|
|
16
33
|
* @slot - Default slot for buttons (max 3)
|
|
17
34
|
*
|
|
@@ -26,7 +43,11 @@ let NLDDButtonGroup = class NLDDButtonGroup extends LitElement {
|
|
|
26
43
|
constructor() {
|
|
27
44
|
super(...arguments);
|
|
28
45
|
this.size = 'md';
|
|
29
|
-
this.orientation = '
|
|
46
|
+
this.orientation = 'auto';
|
|
47
|
+
/** DEV only: watches for the collapse below, then lets itself go. */
|
|
48
|
+
this._collapseObserver = null;
|
|
49
|
+
/** Timer holding a zero-width reading before it counts as a verdict. */
|
|
50
|
+
this._collapseVerdict = 0;
|
|
30
51
|
}
|
|
31
52
|
handleSlotChange() {
|
|
32
53
|
const assigned = this._slot
|
|
@@ -38,19 +59,91 @@ let NLDDButtonGroup = class NLDDButtonGroup extends LitElement {
|
|
|
38
59
|
if (import.meta.env?.DEV)
|
|
39
60
|
console.warn('nldd-button-group: Only 3 buttons are allowed. Extra buttons will be hidden.');
|
|
40
61
|
}
|
|
41
|
-
if (this.orientation === 'vertical') {
|
|
42
|
-
el.setAttribute('width', 'full');
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
el.removeAttribute('width');
|
|
46
|
-
}
|
|
47
62
|
el.setAttribute('size', this.size);
|
|
48
63
|
});
|
|
49
64
|
}
|
|
50
65
|
updated(changedProperties) {
|
|
51
|
-
if (changedProperties.has('
|
|
66
|
+
if (changedProperties.has('size'))
|
|
52
67
|
this.handleSlotChange();
|
|
68
|
+
// Switching to auto makes the group a container after the fact, so the
|
|
69
|
+
// question it can then fail is only worth asking from here on.
|
|
70
|
+
if (changedProperties.has('orientation'))
|
|
71
|
+
this._watchForCollapse();
|
|
72
|
+
}
|
|
73
|
+
connectedCallback() {
|
|
74
|
+
super.connectedCallback();
|
|
75
|
+
// Also on reconnect: a group that moves takes a new parent with it, and
|
|
76
|
+
// that parent decides whether there is a width to take.
|
|
77
|
+
this._watchForCollapse();
|
|
78
|
+
}
|
|
79
|
+
disconnectedCallback() {
|
|
80
|
+
super.disconnectedCallback();
|
|
81
|
+
this._stopWatchingForCollapse();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The group is an inline-size container while `orientation` is `auto`, so its
|
|
85
|
+
* width has to come from its parent: a container may not size itself from its
|
|
86
|
+
* own contents. In a parent that shrink-wraps (inline-flex, a float, a table
|
|
87
|
+
* cell, a flex item at `width: auto`) there is nothing to take, the group
|
|
88
|
+
* measures zero and the buttons disappear without an error.
|
|
89
|
+
*
|
|
90
|
+
* Watched rather than sampled: a group can be in a closed sheet or behind
|
|
91
|
+
* `display: none` on its first frame, and a parent can get its width a tick
|
|
92
|
+
* later, so one look would call both of those a collapse or miss the real
|
|
93
|
+
* one. The observer waits for the group to be displayed, says it once and
|
|
94
|
+
* stops watching either way. It starts again when the group is reconnected
|
|
95
|
+
* somewhere else or when `orientation` turns to `auto`, since both change
|
|
96
|
+
* the answer.
|
|
97
|
+
*
|
|
98
|
+
* A zero reading waits before it counts: a parent can hand over its width a
|
|
99
|
+
* frame or two after the first paint, and that looks exactly like a collapse
|
|
100
|
+
* until it does. Only a zero that is still zero when the timer runs out gets
|
|
101
|
+
* said out loud.
|
|
102
|
+
*/
|
|
103
|
+
_watchForCollapse() {
|
|
104
|
+
if (!import.meta.env?.DEV)
|
|
105
|
+
return;
|
|
106
|
+
if (this.orientation !== 'auto') {
|
|
107
|
+
this._stopWatchingForCollapse();
|
|
108
|
+
return;
|
|
53
109
|
}
|
|
110
|
+
if (this._collapseObserver)
|
|
111
|
+
return;
|
|
112
|
+
this._collapseObserver = new ResizeObserver(() => {
|
|
113
|
+
// No box at all (display:none, a closed sheet): nothing to judge yet.
|
|
114
|
+
// Client rects rather than offsetParent: that is null for a fixed
|
|
115
|
+
// element too, and a fixed group can collapse like any other.
|
|
116
|
+
if (!this.isConnected || this.getClientRects().length === 0)
|
|
117
|
+
return;
|
|
118
|
+
if (!this._slot?.assignedElements({ flatten: true }).length)
|
|
119
|
+
return;
|
|
120
|
+
if (this.getBoundingClientRect().width > 0) {
|
|
121
|
+
// It got a width, from the start or a tick late. Nothing to say.
|
|
122
|
+
this._stopWatchingForCollapse();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
// Zero, but not yet a verdict: a parent can hand over its width a
|
|
126
|
+
// frame or two later, and that is the same zero. Give it a moment and
|
|
127
|
+
// keep watching, so a width that arrives cancels this.
|
|
128
|
+
if (this._collapseVerdict !== 0)
|
|
129
|
+
return;
|
|
130
|
+
this._collapseVerdict = window.setTimeout(() => {
|
|
131
|
+
if (!this.isConnected || this.getClientRects().length === 0)
|
|
132
|
+
return;
|
|
133
|
+
if (this.getBoundingClientRect().width > 0)
|
|
134
|
+
return;
|
|
135
|
+
console.warn('nldd-button-group: the group is 0 wide, so its buttons are invisible. It takes its width from its parent (it is a container query while orientation is auto), and a parent that sizes itself from its content leaves nothing to take. Give the group or that parent a width.');
|
|
136
|
+
this._stopWatchingForCollapse();
|
|
137
|
+
}, 250);
|
|
138
|
+
});
|
|
139
|
+
this._collapseObserver.observe(this);
|
|
140
|
+
}
|
|
141
|
+
_stopWatchingForCollapse() {
|
|
142
|
+
this._collapseObserver?.disconnect();
|
|
143
|
+
this._collapseObserver = null;
|
|
144
|
+
if (this._collapseVerdict)
|
|
145
|
+
clearTimeout(this._collapseVerdict);
|
|
146
|
+
this._collapseVerdict = 0;
|
|
54
147
|
}
|
|
55
148
|
render() {
|
|
56
149
|
return template.call(this);
|
|
@@ -61,7 +154,7 @@ __decorate([
|
|
|
61
154
|
property({ reflect: true, converter: reflectNonDefault('md') })
|
|
62
155
|
], NLDDButtonGroup.prototype, "size", void 0);
|
|
63
156
|
__decorate([
|
|
64
|
-
property({ reflect: true, converter: reflectNonDefault('
|
|
157
|
+
property({ reflect: true, converter: reflectNonDefault('auto') })
|
|
65
158
|
], NLDDButtonGroup.prototype, "orientation", void 0);
|
|
66
159
|
__decorate([
|
|
67
160
|
query('slot')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.js","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"button-group.js","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,UA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styles.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-group.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,yBA6G7B,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { breakpoints } from "../../../assets/styles/breakpoints.js";
|
|
3
|
+
const smMax = unsafeCSS(breakpoints.smMax);
|
|
2
4
|
export const buttonGroupStyles = css `
|
|
3
5
|
:host {
|
|
4
6
|
box-sizing: border-box;
|
|
@@ -18,24 +20,82 @@ export const buttonGroupStyles = css `
|
|
|
18
20
|
justify-content: flex-start;
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
/* Only auto asks its own width a question, so only auto becomes a container.
|
|
24
|
+
A container may not size itself from its contents, and a group pinned to a
|
|
25
|
+
row or a stack would then measure zero in a parent that shrink-wraps, for
|
|
26
|
+
a query it never runs. */
|
|
27
|
+
:host(:not([orientation="horizontal"], [orientation="vertical"])) {
|
|
28
|
+
container-type: inline-size;
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
:host([size="sm"]) {
|
|
22
32
|
--_gap: var(--components-button-group-sm-gap);
|
|
23
33
|
}
|
|
24
34
|
|
|
25
|
-
/* ##
|
|
26
|
-
The row keeps the full width (like
|
|
35
|
+
/* ## In a row
|
|
36
|
+
The row keeps the full width (like the stack) so full-width children
|
|
27
37
|
can actually stretch; content-sized buttons still sit left within
|
|
28
38
|
the row. */
|
|
29
39
|
|
|
30
|
-
:host([orientation="horizontal"])
|
|
40
|
+
:host([orientation="horizontal"]),
|
|
41
|
+
:host(:not([orientation="horizontal"], [orientation="vertical"])) {
|
|
31
42
|
--_flex-direction: row;
|
|
32
43
|
--_flex-wrap: wrap;
|
|
33
44
|
}
|
|
34
45
|
|
|
46
|
+
/* ## Auto
|
|
47
|
+
Auto is the default: a row, and stacked over the full width on a narrow
|
|
48
|
+
container, where two labels beside each other leave no room for either.
|
|
49
|
+
|
|
50
|
+
Auto is matched as "neither of the other two" rather than as itself: the
|
|
51
|
+
attribute reflects only when it is not the default, so auto is written out
|
|
52
|
+
OR absent, and a rule that named it would have needed a second selector
|
|
53
|
+
beside it everywhere. */
|
|
54
|
+
|
|
55
|
+
@container (max-width: ${smMax}) {
|
|
56
|
+
:host(:not([orientation="horizontal"], [orientation="vertical"])) .button-group {
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
--context-button-width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* display as well as width: a button host shrink-wraps as inline-flex, so
|
|
62
|
+
width alone leaves the button itself content-sized in a stretched box.
|
|
63
|
+
An icon-only control is the exception: its size is its icon, and a
|
|
64
|
+
full-width bar with one glyph in the middle is not a bigger target for
|
|
65
|
+
the thumb, just a wider one. */
|
|
66
|
+
:host(:not([orientation="horizontal"], [orientation="vertical"])) ::slotted(:not(nldd-icon-button)) {
|
|
67
|
+
display: block;
|
|
68
|
+
width: 100%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* align-self as well: a column stretches its items across the full width
|
|
72
|
+
on its own, so without this the icon button is a wide bar regardless of
|
|
73
|
+
the width rule above. */
|
|
74
|
+
:host(:not([orientation="horizontal"], [orientation="vertical"])) ::slotted(nldd-icon-button) {
|
|
75
|
+
align-self: flex-start;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([orientation="vertical"]) .button-group {
|
|
80
|
+
--context-button-width: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([orientation="vertical"]) ::slotted(:not(nldd-icon-button)) {
|
|
84
|
+
display: block;
|
|
85
|
+
width: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([orientation="vertical"]) ::slotted(nldd-icon-button) {
|
|
89
|
+
align-self: flex-start;
|
|
90
|
+
}
|
|
91
|
+
|
|
35
92
|
:host([hidden]) {
|
|
36
93
|
display: none;
|
|
37
94
|
}
|
|
38
95
|
|
|
96
|
+
/* The stacking rules above set display on every slotted child at a higher
|
|
97
|
+
specificity than this selector, so without !important a hidden button in
|
|
98
|
+
a stacked group stays in the row. */
|
|
39
99
|
::slotted([hidden]) {
|
|
40
100
|
display: none !important;
|
|
41
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.styles.js","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"button-group.styles.js","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAmDV,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D9B,CAAC"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @attr {string} type - Button type for form submission: 'button' | 'submit' | 'reset' (ignored when href is set)
|
|
13
13
|
* @attr {boolean} expandable - Whether the button opens a menu or popover and shows chevron next to the icon
|
|
14
14
|
* @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
|
|
15
|
-
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state.
|
|
15
|
+
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
|
|
16
16
|
* @attr {string} width - Width mode: 'full' (stretches to container) or any CSS length (e.g. '240px')
|
|
17
17
|
* @attr {string} text - Button text, used as aria-label and shown below the icon in lg size
|
|
18
18
|
* @attr {string} icon - Icon name for the nldd-icon element. Defaults to a placeholder icon when neither this attribute nor the icon slot is set.
|
|
@@ -29,7 +29,10 @@
|
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```html
|
|
32
|
-
* <nldd-icon-button
|
|
32
|
+
* <nldd-icon-button
|
|
33
|
+
* text="Download"
|
|
34
|
+
* icon="download"
|
|
35
|
+
* ></nldd-icon-button>
|
|
33
36
|
* ```
|
|
34
37
|
*
|
|
35
38
|
* @fires click - When button is clicked (not fired when disabled)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/icon-button/icon-button.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/icon-button/icon-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAOjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,8BAA8B,CAAC;AACtC,OAAO,sEAAsE,CAAC;AAE9E,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7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AA4D;IAE5D,IAAI,EAAE,MAAM,GAAG,SAAS,CAAa;IAErC,+DAA+D;IAE/D,MAAM,EAAE,MAAM,GAAG,SAAS,CAAa;IAEvC;;;OAGG;IAEH,GAAG,EAAE,MAAM,GAAG,SAAS,CAAa;IAEpC,wDAAwD;IACxD,OAAO,KAAK,QAAQ,GAInB;IAED,OAAO,CAAC,WAAW,CAAS;IAE5B;;6BAEyB;IACzB,MAAM,wBAAmC;IAEhC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IA0B/D,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IA6B3C;;;OAGG;IACM,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAM5C,iBAAiB,IAAI,IAAI;IAIhB,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,kBAAkB,EAAE,cAAc,CAAC;KACnC;CACD"}
|
|
@@ -18,7 +18,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
18
18
|
* @attr {string} type - Button type for form submission: 'button' | 'submit' | 'reset' (ignored when href is set)
|
|
19
19
|
* @attr {boolean} expandable - Whether the button opens a menu or popover and shows chevron next to the icon
|
|
20
20
|
* @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
|
|
21
|
-
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state.
|
|
21
|
+
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
|
|
22
22
|
* @attr {string} width - Width mode: 'full' (stretches to container) or any CSS length (e.g. '240px')
|
|
23
23
|
* @attr {string} text - Button text, used as aria-label and shown below the icon in lg size
|
|
24
24
|
* @attr {string} icon - Icon name for the nldd-icon element. Defaults to a placeholder icon when neither this attribute nor the icon slot is set.
|
|
@@ -35,7 +35,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```html
|
|
38
|
-
* <nldd-icon-button
|
|
38
|
+
* <nldd-icon-button
|
|
39
|
+
* text="Download"
|
|
40
|
+
* icon="download"
|
|
41
|
+
* ></nldd-icon-button>
|
|
39
42
|
* ```
|
|
40
43
|
*
|
|
41
44
|
* @fires click - When button is clicked (not fired when disabled)
|