@nldd/design-system 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +2726 -617
- package/dist/components/actions/button-group/button-group.d.ts +4 -3
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +4 -3
- 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 +6 -6
- package/dist/components/actions/button-group/button-group.styles.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +3 -0
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/components.js +21704 -19266
- package/dist/components/content/avatar/avatar.d.ts +2 -1
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +12 -1
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +30 -2
- package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.i18n.d.ts +1 -0
- package/dist/components/content/avatar-group/avatar-group.i18n.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.i18n.js +1 -0
- package/dist/components/content/avatar-group/avatar-group.i18n.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.js +96 -7
- package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.styles.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.styles.js +35 -1
- package/dist/components/content/avatar-group/avatar-group.styles.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.d.ts +1 -0
- package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.js +52 -29
- package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts +14 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.diff.d.ts +40 -0
- package/dist/components/content/code-viewer/code-viewer.diff.d.ts.map +1 -0
- package/dist/components/content/code-viewer/code-viewer.diff.js +261 -0
- package/dist/components/content/code-viewer/code-viewer.diff.js.map +1 -0
- package/dist/components/content/code-viewer/code-viewer.i18n.d.ts +5 -0
- package/dist/components/content/code-viewer/code-viewer.i18n.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.i18n.js +9 -0
- package/dist/components/content/code-viewer/code-viewer.i18n.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +98 -6
- package/dist/components/content/code-viewer/code-viewer.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 +180 -14
- package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.js +5 -4
- package/dist/components/content/code-viewer/code-viewer.template.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +32 -4
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.js +19 -0
- package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
- package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
- package/dist/components/content/icon/icon-registry.js +19 -4
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +10 -0
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +10 -0
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +2 -0
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/{dist-Bo5Jeyfn.js → dist-B5E3q-ea.js} +2 -1
- package/dist/components/{dist-DbNhCpS5.js → dist-BFw_yEMS.js} +2 -1
- package/dist/components/{dist-DnZmcpbQ.js → dist-BNLAXAyO.js} +2 -1
- package/dist/components/{dist-DkqAbJH8.js → dist-BOVSVPSz.js} +1 -1
- package/dist/components/{dist-Ch3gNAuT.js → dist-BPB3rWnd.js} +2 -1
- package/dist/components/{dist-Bud_7w5g.js → dist-BWlUmyq3.js} +34 -2869
- package/dist/components/dist-CC8oiVtm.js +366 -0
- package/dist/components/dist-COKR0tYU.js +2860 -0
- package/dist/components/{dist-CaxHkqR2.js → dist-Co-tsc9S.js} +4 -3
- package/dist/components/{dist-iC2RTM0V.js → dist-D_9ZyZ5v.js} +3 -2
- package/dist/components/{dist-BB5mlo7D.js → dist-Dn9pjiud.js} +3 -2
- package/dist/components/{dist-B2QcygzG.js → dist-Dz28se9B.js} +2 -1
- package/dist/components/{dist-CA0yDFIt.js → dist-IPm8ilWf.js} +3 -2
- package/dist/components/{icon-zNX9A6d3.js → icon-BJHKWhY5.js} +39 -8
- package/dist/components/{icon-button-Cntrg4_E.js → icon-button-DhBIq6lN.js} +75 -2
- package/dist/components/inputs/code-editor/code-editor.d.ts +4 -54
- package/dist/components/inputs/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.js +22 -262
- package/dist/components/inputs/code-editor/code-editor.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js +43 -6
- package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.d.ts +2 -2
- package/dist/components/inputs/date-picker/date-picker.i18n.d.ts +1 -1
- package/dist/components/inputs/date-picker/date-picker.i18n.js +1 -1
- package/dist/components/inputs/date-picker/date-picker.i18n.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts +86 -10
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.drop.d.ts +34 -0
- package/dist/components/inputs/file-field/file-field.drop.d.ts.map +1 -0
- package/dist/components/inputs/file-field/file-field.drop.js +176 -0
- package/dist/components/inputs/file-field/file-field.drop.js.map +1 -0
- package/dist/components/inputs/file-field/file-field.i18n.d.ts +20 -1
- package/dist/components/inputs/file-field/file-field.i18n.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.i18n.js +20 -1
- package/dist/components/inputs/file-field/file-field.i18n.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +283 -15
- package/dist/components/inputs/file-field/file-field.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.js +245 -10
- package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.d.ts +1 -0
- package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.js +167 -28
- package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.truncate.d.ts +22 -0
- package/dist/components/inputs/file-field/file-field.truncate.d.ts.map +1 -0
- package/dist/components/inputs/file-field/file-field.truncate.js +62 -0
- package/dist/components/inputs/file-field/file-field.truncate.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js +9 -7
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotations.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotations.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.clipboard.d.ts +16 -0
- package/dist/components/inputs/text-editor/text-editor.clipboard.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.clipboard.js +50 -0
- package/dist/components/inputs/text-editor/text-editor.clipboard.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.code-copy.d.ts +10 -0
- package/dist/components/inputs/text-editor/text-editor.code-copy.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.code-copy.js +141 -0
- package/dist/components/inputs/text-editor/text-editor.code-copy.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.commands.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.commands.js +31 -58
- package/dist/components/inputs/text-editor/text-editor.commands.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts +17 -64
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.drag.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.drag.js +2 -1
- package/dist/components/inputs/text-editor/text-editor.drag.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.focus-selection.d.ts +3 -0
- package/dist/components/inputs/text-editor/text-editor.focus-selection.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.focus-selection.js +55 -0
- package/dist/components/inputs/text-editor/text-editor.focus-selection.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts +6 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js +305 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +5 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.i18n.js +7 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +126 -315
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.keymap.d.ts +6 -0
- package/dist/components/inputs/text-editor/text-editor.keymap.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.keymap.js +38 -0
- package/dist/components/inputs/text-editor/text-editor.keymap.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.links.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.js +11 -9
- package/dist/components/inputs/text-editor/text-editor.links.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts +1 -17
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.js +32 -188
- package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mention.d.ts +52 -0
- package/dist/components/inputs/text-editor/text-editor.mention.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.mention.js +186 -0
- package/dist/components/inputs/text-editor/text-editor.mention.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +0 -16
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +1 -41
- package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.selection.d.ts +13 -0
- package/dist/components/inputs/text-editor/text-editor.selection.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.selection.js +72 -0
- package/dist/components/inputs/text-editor/text-editor.selection.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.spellcheck.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.spellcheck.js +4 -6
- package/dist/components/inputs/text-editor/text-editor.spellcheck.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.js +301 -60
- package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.syntax.d.ts +22 -0
- package/dist/components/inputs/text-editor/text-editor.syntax.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.syntax.js +44 -0
- package/dist/components/inputs/text-editor/text-editor.syntax.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.tasks.d.ts +17 -0
- package/dist/components/inputs/text-editor/text-editor.tasks.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.tasks.js +109 -0
- package/dist/components/inputs/text-editor/text-editor.tasks.js.map +1 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js +61 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +1 -1
- package/dist/components/layout/popover/popover.d.ts +6 -0
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +16 -0
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/popover/popover.styles.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.styles.js +13 -0
- package/dist/components/layout/popover/popover.styles.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +5 -0
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +2 -0
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +3 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts +1 -1
- package/dist/components/status-and-feedback/banner/banner.js +2 -2
- package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts +3 -2
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +9 -4
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.styles.js +18 -0
- package/dist/components/status-and-feedback/notification/notification.styles.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notifications-area.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notifications-area.js +14 -0
- package/dist/components/status-and-feedback/notification/notifications-area.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.d.ts +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.js +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.d.ts +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.js +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/css/rich-text.css +61 -1
- package/dist/css/themes/donkergeel.css +12 -3
- package/dist/css/themes/geel.css +12 -3
- package/dist/css/themes.css +24 -6
- package/dist/css/variables.css +16 -10
- package/dist/nldd.min.js +2217 -1329
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +34 -4
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +29 -4
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +34 -4
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +29 -4
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +29 -4
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/vue.d.ts +43 -39
- package/dist/utilities/carried-context.d.ts +20 -0
- package/dist/utilities/carried-context.d.ts.map +1 -0
- package/dist/utilities/carried-context.js +76 -0
- package/dist/utilities/carried-context.js.map +1 -0
- package/dist/utilities/codemirror/codemirror-input.d.ts +90 -0
- package/dist/utilities/codemirror/codemirror-input.d.ts.map +1 -0
- package/dist/utilities/codemirror/codemirror-input.js +250 -0
- package/dist/utilities/codemirror/codemirror-input.js.map +1 -0
- package/dist/utilities/codemirror/languages.d.ts +5 -1
- package/dist/utilities/codemirror/languages.d.ts.map +1 -1
- package/dist/utilities/codemirror/languages.js +21 -1
- package/dist/utilities/codemirror/languages.js.map +1 -1
- package/dist/utilities/dismiss-from-title-bar.d.ts +1 -1
- package/dist/utilities/dismiss-from-title-bar.js +1 -1
- package/package.json +2 -1
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* @attr {string} accessible-label - Name of the link or button; without it `name` is used
|
|
37
37
|
* @attr {boolean} decorative - Hides the avatar from assistive software (use when the name already stands beside it as text)
|
|
38
38
|
* @attr {string} tooltip-timing - When the name appears as a tooltip on hover or focus: `delay` (the default, after 700ms), `instant`, or `never`. An avatar shows no text, so without a tooltip the name is readable by assistive software only. A `decorative` avatar shows none regardless: there the name already stands beside it as text
|
|
39
|
-
* @attr {string} href - Makes the avatar a link to this URL; the shape itself becomes the link, so the hit area and the focus ring follow it
|
|
39
|
+
* @attr {string} href - Makes the avatar a link to this URL; the shape itself becomes the link, so the hit area and the focus ring follow it. As a link or a button the avatar needs size 24 or larger (WCAG 2.5.8)
|
|
40
40
|
* @attr {boolean} no-tab - Takes the control out of the tab order (tabindex="-1"), for an avatar that is a link or a button inside a roving container (a row of an nldd-list). Does nothing on a decorative avatar.
|
|
41
41
|
* @attr {boolean} button - Makes the avatar a button; ignored when `href` is set
|
|
42
42
|
* @attr {string} target - Link target for href (e.g. '_blank'); completes rel and announces "Opens in a new tab". An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off.
|
|
@@ -120,6 +120,7 @@ export declare class NLDDAvatar extends NLDDAvatar_base {
|
|
|
120
120
|
/** True once the avatar is a control itself. */
|
|
121
121
|
get isInteractive(): boolean;
|
|
122
122
|
private _warnedLabel;
|
|
123
|
+
private _warnedTargetSize;
|
|
123
124
|
/** Set when the image errors, so the template falls through to the next
|
|
124
125
|
* content step. Not private: the template module reads it. */
|
|
125
126
|
_imageFailed: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar/avatar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAOtD,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,cAAc,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAOhD,qFAAqF;AACrF,MAAM,MAAM,UAAU,GACrB,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;;;;;;;;;AAE5F,qBACa,UAAW,SA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(this && this.__decorate) || function (decorators, target, key,
|
|
|
42
42
|
* @attr {string} accessible-label - Name of the link or button; without it `name` is used
|
|
43
43
|
* @attr {boolean} decorative - Hides the avatar from assistive software (use when the name already stands beside it as text)
|
|
44
44
|
* @attr {string} tooltip-timing - When the name appears as a tooltip on hover or focus: `delay` (the default, after 700ms), `instant`, or `never`. An avatar shows no text, so without a tooltip the name is readable by assistive software only. A `decorative` avatar shows none regardless: there the name already stands beside it as text
|
|
45
|
-
* @attr {string} href - Makes the avatar a link to this URL; the shape itself becomes the link, so the hit area and the focus ring follow it
|
|
45
|
+
* @attr {string} href - Makes the avatar a link to this URL; the shape itself becomes the link, so the hit area and the focus ring follow it. As a link or a button the avatar needs size 24 or larger (WCAG 2.5.8)
|
|
46
46
|
* @attr {boolean} no-tab - Takes the control out of the tab order (tabindex="-1"), for an avatar that is a link or a button inside a roving container (a row of an nldd-list). Does nothing on a decorative avatar.
|
|
47
47
|
* @attr {boolean} button - Makes the avatar a button; ignored when `href` is set
|
|
48
48
|
* @attr {string} target - Link target for href (e.g. '_blank'); completes rel and announces "Opens in a new tab". An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off.
|
|
@@ -123,6 +123,7 @@ let NLDDAvatar = class NLDDAvatar extends withTranslations(LitElement, nlddAvata
|
|
|
123
123
|
this.target = '';
|
|
124
124
|
this.rel = '';
|
|
125
125
|
this._warnedLabel = false;
|
|
126
|
+
this._warnedTargetSize = false;
|
|
126
127
|
/** Set when the image errors, so the template falls through to the next
|
|
127
128
|
* content step. Not private: the template module reads it. */
|
|
128
129
|
this._imageFailed = false;
|
|
@@ -216,6 +217,16 @@ let NLDDAvatar = class NLDDAvatar extends withTranslations(LitElement, nlddAvata
|
|
|
216
217
|
else if (!missing) {
|
|
217
218
|
this._warnedLabel = false;
|
|
218
219
|
}
|
|
220
|
+
// WCAG 2.5.8: a target under 24px passes only with room around it, which
|
|
221
|
+
// the avatar cannot measure. `full` takes its size from the container.
|
|
222
|
+
const small = this.isInteractive && Number(this.size) < 24;
|
|
223
|
+
if (small && !this._warnedTargetSize) {
|
|
224
|
+
this._warnedTargetSize = true;
|
|
225
|
+
console.warn(`<nldd-avatar size="${this.size}">: a link or button under 24px is too small a target (WCAG 2.5.8) unless nothing else to click lies within 24px of its center. Use size 24 or larger.`);
|
|
226
|
+
}
|
|
227
|
+
else if (!small) {
|
|
228
|
+
this._warnedTargetSize = false;
|
|
229
|
+
}
|
|
219
230
|
}
|
|
220
231
|
// The shape does not resize when only its content does, so the
|
|
221
232
|
// ResizeObserver won't fire — re-measure here on every change that can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../../src/components/content/avatar/avatar.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,OAAO,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,iBAAiB,CAAC;AAMzB;;sEAEsE;AACtE,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAOzB,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAA7E;;QAIN,SAAI,GAAe,QAAQ,CAAC;QAG5B,SAAI,GAAe,MAAM,CAAC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U;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAmNtB"}
|
|
@@ -15,19 +15,31 @@
|
|
|
15
15
|
*
|
|
16
16
|
* The size applies to the whole group: it is imposed on the avatars, a slotted
|
|
17
17
|
* `img` included. That keeps the row on one line whatever a consumer hands over.
|
|
18
|
+
* Avatars that are links or buttons need size 32 or larger: they overlap, so
|
|
19
|
+
* each keeps only part of its width as a target (WCAG 2.5.8).
|
|
20
|
+
*
|
|
21
|
+
* On sm the list behind the button is a bottom sheet with a title bar, which
|
|
22
|
+
* names the group (its `accessible-label`) and closes it.
|
|
23
|
+
*
|
|
24
|
+
* The row never overflows its container. Where there is no room for every
|
|
25
|
+
* avatar, the group shows as many as fit and puts the rest behind the "+N"
|
|
26
|
+
* button, as `max` does; `max` is then the most it shows, not a fixed count.
|
|
18
27
|
*
|
|
19
28
|
* @element nldd-avatar-group
|
|
20
29
|
*
|
|
21
30
|
* @attr {string} size - Diameter of each avatar in px (spacer-aligned: 16, 20, 24, 28, 32, 40, 44, 48, 56, 64, 80, 96); default 40
|
|
22
|
-
* @attr {number} max - Shows at most this many avatars; the rest go behind a "+N" button that opens them as a list of names
|
|
31
|
+
* @attr {number} max - Shows at most this many avatars; the rest go behind a "+N" button that opens them as a list of names. A longer number is set smaller, and where it no longer fits the disc the button shows an ellipsis with the count in a tooltip (a number shows from size 24 with one digit, 40 with two, 56 with three and 80 with four)
|
|
23
32
|
* @attr {string} accessible-label - Describes the group as a whole (e.g. "Editors"); without a label the group is not a landmark of its own and the avatars speak for themselves
|
|
24
33
|
*
|
|
25
34
|
* @slot - One or more `nldd-avatar` elements
|
|
26
35
|
*/
|
|
27
36
|
import { LitElement } from 'lit';
|
|
28
37
|
import '../avatar/avatar.js';
|
|
38
|
+
import '../icon/icon.js';
|
|
29
39
|
import '../../layout/popover/popover.js';
|
|
30
40
|
import '../../layout/container/container.js';
|
|
41
|
+
import '../../layout/page/page.js';
|
|
42
|
+
import '../../navigation/top-title-bar/top-title-bar.js';
|
|
31
43
|
import '../../lists-and-tables/list/list.js';
|
|
32
44
|
import '../../lists-and-tables/list-item/list-item.js';
|
|
33
45
|
import '../../lists-and-tables/cells/cell/cell.js';
|
|
@@ -37,8 +49,9 @@ declare const NLDDAvatarGroup_base: (abstract new (...args: any[]) => LitElement
|
|
|
37
49
|
translations: Partial<{
|
|
38
50
|
'components.avatar-group.overflow-label': string;
|
|
39
51
|
'components.avatar-group.overflow-popover-label': string;
|
|
52
|
+
'components.avatar-group.overflow-close': string;
|
|
40
53
|
}>;
|
|
41
|
-
_t(key: "components.avatar-group.overflow-label" | "components.avatar-group.overflow-popover-label", vars?: Record<string, string | number>): string;
|
|
54
|
+
_t(key: "components.avatar-group.overflow-label" | "components.avatar-group.overflow-popover-label" | "components.avatar-group.overflow-close", vars?: Record<string, string | number>): string;
|
|
42
55
|
}) & typeof LitElement;
|
|
43
56
|
export declare class NLDDAvatarGroup extends NLDDAvatarGroup_base {
|
|
44
57
|
static styles: import("lit").CSSResult;
|
|
@@ -56,17 +69,32 @@ export declare class NLDDAvatarGroup extends NLDDAvatarGroup_base {
|
|
|
56
69
|
* written after every render: slotchange can beat the first render, and
|
|
57
70
|
* then the style element they go in does not exist yet. */
|
|
58
71
|
_total: number;
|
|
72
|
+
/** How many avatars fit the width the group has, or undefined when they all
|
|
73
|
+
* do. Measured, so it works as a second `max` that the container sets. */
|
|
74
|
+
_fitMax: number | undefined;
|
|
75
|
+
private _resizeObserver;
|
|
59
76
|
/** The trigger and its popover have to agree on an id, and two groups on a
|
|
60
77
|
* page must not open each other's list. */
|
|
61
78
|
private readonly _id;
|
|
62
79
|
get _popoverId(): string;
|
|
63
80
|
get _triggerId(): string;
|
|
81
|
+
/** The lower of `max` and what fits the width. */
|
|
82
|
+
get _effectiveMax(): number | undefined;
|
|
83
|
+
/** Every disc after the first adds its diameter less the overlap. */
|
|
84
|
+
private _rowWidth;
|
|
85
|
+
private _measureFit;
|
|
86
|
+
connectedCallback(): void;
|
|
87
|
+
disconnectedCallback(): void;
|
|
88
|
+
/** Whether the overflow count fits its disc, centered and clear of the
|
|
89
|
+
* avatar that overlaps it. Where it does not, the button shows an ellipsis. */
|
|
90
|
+
get _overflowCountFits(): boolean;
|
|
64
91
|
/** Not guaranteed: a decorative avatar beside a name in the text carries
|
|
65
92
|
* none, and then the row simply has no name to show. */
|
|
66
93
|
private _nameOf;
|
|
67
94
|
/** The avatars as slotted, kept so a change to `max` can recompute without
|
|
68
95
|
* waiting for a slotchange that will not come. */
|
|
69
96
|
private _assigned;
|
|
97
|
+
private _warnedTargetSize;
|
|
70
98
|
willUpdate(changed: Map<string, unknown>): void;
|
|
71
99
|
_onSlotChange: (e: Event) => void;
|
|
72
100
|
private _recompute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-group.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"avatar-group.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iCAAiC,CAAC;AACzC,OAAO,qCAAqC,CAAC;AAC7C,OAAO,2BAA2B,CAAC;AACnC,OAAO,iDAAiD,CAAC;AACzD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,+CAA+C,CAAC;AACvD,OAAO,2CAA2C,CAAC;AACnD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,yDAAyD,CAAC;;;;;;;;;AAUjE,qBACa,eAAgB,SAAQ,oBAAyD;IAC7F,OAAgB,MAAM,0BAAqB;IAG3C,IAAI,SAAQ;IAGZ,GAAG,EAAE,MAAM,GAAG,SAAS,CAAa;IAGpC,eAAe,SAAM;IAErB;;iEAE6D;IAE7D,SAAS,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAM;IAEpD;;gEAE4D;IAE5D,MAAM,SAAK;IAEX;+EAC2E;IAE3E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAa;IAExC,OAAO,CAAC,eAAe,CAA8E;IAErG;gDAC4C;IAC5C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA0C;IAE9D,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,kDAAkD;IAClD,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAItC;IAED,qEAAqE;IACrE,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,WAAW;IAaV,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAKrC;oFACgF;IAChF,IAAI,kBAAkB,IAAI,OAAO,CAIhC;IAED;6DACyD;IACzD,OAAO,CAAC,OAAO;IAIf;uDACmD;IACnD,OAAO,CAAC,SAAS,CAAiB;IAElC,OAAO,CAAC,iBAAiB,CAAS;IAEzB,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIxD,aAAa,GAAI,GAAG,KAAK,KAAG,IAAI,CAG9B;IAEF,OAAO,CAAC,UAAU;IA+ClB;;;;mEAI+D;IAC/D,OAAO,CAAC,mBAAmB;IAsB3B;mEAC+D;IACtD,OAAO,IAAI,IAAI;IAaf,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const nlddAvatarGroupTranslations: {
|
|
2
2
|
'components.avatar-group.overflow-label': string;
|
|
3
3
|
'components.avatar-group.overflow-popover-label': string;
|
|
4
|
+
'components.avatar-group.overflow-close': string;
|
|
4
5
|
};
|
|
5
6
|
export type NLDDAvatarGroupTranslations = typeof nlddAvatarGroupTranslations;
|
|
6
7
|
//# sourceMappingURL=avatar-group.i18n.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-group.i18n.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.i18n.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"avatar-group.i18n.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.i18n.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B;;;;CAIvC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const nlddAvatarGroupTranslations = {
|
|
2
2
|
'components.avatar-group.overflow-label': 'Nog {count} tonen',
|
|
3
3
|
'components.avatar-group.overflow-popover-label': 'Overige namen',
|
|
4
|
+
'components.avatar-group.overflow-close': 'Sluit',
|
|
4
5
|
};
|
|
5
6
|
//# sourceMappingURL=avatar-group.i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-group.i18n.js","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.i18n.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C,wCAAwC,EAAE,mBAAmB;IAC7D,gDAAgD,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"avatar-group.i18n.js","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.i18n.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C,wCAAwC,EAAE,mBAAmB;IAC7D,gDAAgD,EAAE,eAAe;IACjE,wCAAwC,EAAE,OAAO;CACjD,CAAC"}
|
|
@@ -15,11 +15,20 @@
|
|
|
15
15
|
*
|
|
16
16
|
* The size applies to the whole group: it is imposed on the avatars, a slotted
|
|
17
17
|
* `img` included. That keeps the row on one line whatever a consumer hands over.
|
|
18
|
+
* Avatars that are links or buttons need size 32 or larger: they overlap, so
|
|
19
|
+
* each keeps only part of its width as a target (WCAG 2.5.8).
|
|
20
|
+
*
|
|
21
|
+
* On sm the list behind the button is a bottom sheet with a title bar, which
|
|
22
|
+
* names the group (its `accessible-label`) and closes it.
|
|
23
|
+
*
|
|
24
|
+
* The row never overflows its container. Where there is no room for every
|
|
25
|
+
* avatar, the group shows as many as fit and puts the rest behind the "+N"
|
|
26
|
+
* button, as `max` does; `max` is then the most it shows, not a fixed count.
|
|
18
27
|
*
|
|
19
28
|
* @element nldd-avatar-group
|
|
20
29
|
*
|
|
21
30
|
* @attr {string} size - Diameter of each avatar in px (spacer-aligned: 16, 20, 24, 28, 32, 40, 44, 48, 56, 64, 80, 96); default 40
|
|
22
|
-
* @attr {number} max - Shows at most this many avatars; the rest go behind a "+N" button that opens them as a list of names
|
|
31
|
+
* @attr {number} max - Shows at most this many avatars; the rest go behind a "+N" button that opens them as a list of names. A longer number is set smaller, and where it no longer fits the disc the button shows an ellipsis with the count in a tooltip (a number shows from size 24 with one digit, 40 with two, 56 with three and 80 with four)
|
|
23
32
|
* @attr {string} accessible-label - Describes the group as a whole (e.g. "Editors"); without a label the group is not a landmark of its own and the avatars speak for themselves
|
|
24
33
|
*
|
|
25
34
|
* @slot - One or more `nldd-avatar` elements
|
|
@@ -35,8 +44,11 @@ import { customElement, property, state } from 'lit/decorators.js';
|
|
|
35
44
|
import { avatarGroupStyles } from './avatar-group.styles.js';
|
|
36
45
|
import { avatarGroupTemplate } from './avatar-group.template.js';
|
|
37
46
|
import '../avatar/avatar.js';
|
|
47
|
+
import '../icon/icon.js';
|
|
38
48
|
import '../../layout/popover/popover.js';
|
|
39
49
|
import '../../layout/container/container.js';
|
|
50
|
+
import '../../layout/page/page.js';
|
|
51
|
+
import '../../navigation/top-title-bar/top-title-bar.js';
|
|
40
52
|
import '../../lists-and-tables/list/list.js';
|
|
41
53
|
import '../../lists-and-tables/list-item/list-item.js';
|
|
42
54
|
import '../../lists-and-tables/cells/cell/cell.js';
|
|
@@ -44,6 +56,10 @@ import '../../lists-and-tables/cells/text-cell/text-cell.js';
|
|
|
44
56
|
import '../../lists-and-tables/cells/spacer-cell/spacer-cell.js';
|
|
45
57
|
import { withTranslations } from '../../../utilities/with-translations.js';
|
|
46
58
|
import { nlddAvatarGroupTranslations } from './avatar-group.i18n.js';
|
|
59
|
+
/** The smallest size at which a count of one, two, three and four digits fits. */
|
|
60
|
+
const MIN_SIZE_FOR_COUNT = [24, 40, 56, 80];
|
|
61
|
+
/** The share of a disc the next one covers; matches --_avatar-group-overlap-size. */
|
|
62
|
+
const OVERLAP = 0.2;
|
|
47
63
|
let NLDDAvatarGroup = class NLDDAvatarGroup extends withTranslations(LitElement, nlddAvatarGroupTranslations) {
|
|
48
64
|
constructor() {
|
|
49
65
|
super(...arguments);
|
|
@@ -58,12 +74,17 @@ let NLDDAvatarGroup = class NLDDAvatarGroup extends withTranslations(LitElement,
|
|
|
58
74
|
* written after every render: slotchange can beat the first render, and
|
|
59
75
|
* then the style element they go in does not exist yet. */
|
|
60
76
|
this._total = 0;
|
|
77
|
+
/** How many avatars fit the width the group has, or undefined when they all
|
|
78
|
+
* do. Measured, so it works as a second `max` that the container sets. */
|
|
79
|
+
this._fitMax = undefined;
|
|
80
|
+
this._resizeObserver = new ResizeObserver(([entry]) => this._measureFit(entry.contentRect.width));
|
|
61
81
|
/** The trigger and its popover have to agree on an id, and two groups on a
|
|
62
82
|
* page must not open each other's list. */
|
|
63
83
|
this._id = Math.random().toString(36).slice(2, 9);
|
|
64
84
|
/** The avatars as slotted, kept so a change to `max` can recompute without
|
|
65
85
|
* waiting for a slotchange that will not come. */
|
|
66
86
|
this._assigned = [];
|
|
87
|
+
this._warnedTargetSize = false;
|
|
67
88
|
this._onSlotChange = (e) => {
|
|
68
89
|
this._assigned = e.target.assignedElements();
|
|
69
90
|
this._recompute();
|
|
@@ -75,13 +96,53 @@ let NLDDAvatarGroup = class NLDDAvatarGroup extends withTranslations(LitElement,
|
|
|
75
96
|
get _triggerId() {
|
|
76
97
|
return `avatar-group-trigger-${this._id}`;
|
|
77
98
|
}
|
|
99
|
+
/** The lower of `max` and what fits the width. */
|
|
100
|
+
get _effectiveMax() {
|
|
101
|
+
const max = typeof this.max === 'number' && this.max > 0 ? this.max : undefined;
|
|
102
|
+
if (this._fitMax === undefined)
|
|
103
|
+
return max;
|
|
104
|
+
return max === undefined ? this._fitMax : Math.min(max, this._fitMax);
|
|
105
|
+
}
|
|
106
|
+
/** Every disc after the first adds its diameter less the overlap. */
|
|
107
|
+
_rowWidth(discs) {
|
|
108
|
+
const size = Number(this.size);
|
|
109
|
+
return discs * size * (1 - OVERLAP) + size * OVERLAP;
|
|
110
|
+
}
|
|
111
|
+
_measureFit(width) {
|
|
112
|
+
// A hidden group measures 0; keep what it had until it shows again.
|
|
113
|
+
if (width === 0)
|
|
114
|
+
return;
|
|
115
|
+
const total = this._assigned.length;
|
|
116
|
+
if (this._rowWidth(total) <= width + 0.5) {
|
|
117
|
+
this._fitMax = undefined;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
// Room for the overflow button too, and always at least one avatar.
|
|
121
|
+
const discs = Math.floor((width + 0.5 - this._rowWidth(0)) / (Number(this.size) * (1 - OVERLAP)));
|
|
122
|
+
this._fitMax = Math.max(1, discs - 1);
|
|
123
|
+
}
|
|
124
|
+
connectedCallback() {
|
|
125
|
+
super.connectedCallback();
|
|
126
|
+
this._resizeObserver.observe(this);
|
|
127
|
+
}
|
|
128
|
+
disconnectedCallback() {
|
|
129
|
+
super.disconnectedCallback();
|
|
130
|
+
this._resizeObserver.disconnect();
|
|
131
|
+
}
|
|
132
|
+
/** Whether the overflow count fits its disc, centered and clear of the
|
|
133
|
+
* avatar that overlaps it. Where it does not, the button shows an ellipsis. */
|
|
134
|
+
get _overflowCountFits() {
|
|
135
|
+
const digits = String(this._overflow.length).length;
|
|
136
|
+
const minSize = MIN_SIZE_FOR_COUNT[digits - 1];
|
|
137
|
+
return minSize !== undefined && Number(this.size) >= minSize;
|
|
138
|
+
}
|
|
78
139
|
/** Not guaranteed: a decorative avatar beside a name in the text carries
|
|
79
140
|
* none, and then the row simply has no name to show. */
|
|
80
141
|
_nameOf(el) {
|
|
81
142
|
return el.getAttribute('name') || '';
|
|
82
143
|
}
|
|
83
144
|
willUpdate(changed) {
|
|
84
|
-
if (changed.has('max'))
|
|
145
|
+
if (changed.has('max') || changed.has('_fitMax') || changed.has('size'))
|
|
85
146
|
this._recompute();
|
|
86
147
|
}
|
|
87
148
|
_recompute() {
|
|
@@ -94,8 +155,22 @@ let NLDDAvatarGroup = class NLDDAvatarGroup extends withTranslations(LitElement,
|
|
|
94
155
|
+ 'carries the name that the tooltip and the overflow list read.');
|
|
95
156
|
}
|
|
96
157
|
}
|
|
97
|
-
|
|
98
|
-
|
|
158
|
+
if (import.meta.env?.DEV) {
|
|
159
|
+
// Each avatar covers part of the next, so a link or button keeps only
|
|
160
|
+
// (1 - OVERLAP) of its width as a target, and the targets touch: no
|
|
161
|
+
// room for the WCAG 2.5.8 spacing exception.
|
|
162
|
+
const interactive = assigned.some(el => el.hasAttribute('href') || el.hasAttribute('button'));
|
|
163
|
+
const small = interactive && Number(this.size) * (1 - OVERLAP) < 24;
|
|
164
|
+
if (small && !this._warnedTargetSize) {
|
|
165
|
+
this._warnedTargetSize = true;
|
|
166
|
+
console.warn(`<nldd-avatar-group size="${this.size}">: avatars that are links or buttons overlap, so each keeps too small a target (WCAG 2.5.8). Use size 32 or larger.`);
|
|
167
|
+
}
|
|
168
|
+
else if (!small) {
|
|
169
|
+
this._warnedTargetSize = false;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const max = this._effectiveMax;
|
|
173
|
+
const hidden = max !== undefined && assigned.length > max
|
|
99
174
|
? assigned.slice(max)
|
|
100
175
|
: [];
|
|
101
176
|
this._overflow = hidden.map(node => {
|
|
@@ -124,19 +199,30 @@ let NLDDAvatarGroup = class NLDDAvatarGroup extends withTranslations(LitElement,
|
|
|
124
199
|
if (!sheet)
|
|
125
200
|
return;
|
|
126
201
|
const total = this._total;
|
|
127
|
-
const
|
|
128
|
-
|
|
202
|
+
const max = this._effectiveMax;
|
|
203
|
+
const hide = this._overflow.length > 0 && max !== undefined
|
|
204
|
+
? `.avatar-group ::slotted(:nth-child(n + ${max + 1})) { display: none; }`
|
|
129
205
|
: '';
|
|
206
|
+
// The width the row asks for is what `max` alone would show. Taken from
|
|
207
|
+
// what fits instead, the group could only ever shrink.
|
|
208
|
+
const requested = typeof this.max === 'number' && this.max > 0 && total > this.max
|
|
209
|
+
? this.max + 1
|
|
210
|
+
: total;
|
|
211
|
+
const width = `:host { --_avatar-group-discs: ${requested}; }`;
|
|
130
212
|
// Descending, so the leftmost avatar is the whole one and each next is
|
|
131
213
|
// tucked under it — the row reads as a stack you look at from the left,
|
|
132
214
|
// and the overflow button ends up at the bottom of it.
|
|
133
215
|
const stack = Array.from({ length: total }, (_, i) => `.avatar-group ::slotted(:nth-child(${i + 1})) { z-index: ${total - i}; }`).join('\n');
|
|
134
|
-
sheet.textContent = `${hide}\n${stack}`;
|
|
216
|
+
sheet.textContent = `${width}\n${hide}\n${stack}`;
|
|
135
217
|
}
|
|
136
218
|
/** The popover resolves its anchor by id against the document, and an id in
|
|
137
219
|
* a shadow root is not there. Hand it the element instead. */
|
|
138
220
|
updated() {
|
|
139
221
|
this._syncGeneratedRules();
|
|
222
|
+
// With the new rules in place. A group that is held to its container's
|
|
223
|
+
// width keeps that width when the avatars change, and then the observer
|
|
224
|
+
// stays silent.
|
|
225
|
+
this._measureFit(this.getBoundingClientRect().width);
|
|
140
226
|
const popover = this.shadowRoot?.querySelector('nldd-popover');
|
|
141
227
|
const trigger = this.shadowRoot?.querySelector('.avatar-group__overflow-button') ?? null;
|
|
142
228
|
if (popover && popover.anchorElement !== trigger)
|
|
@@ -162,6 +248,9 @@ __decorate([
|
|
|
162
248
|
__decorate([
|
|
163
249
|
state()
|
|
164
250
|
], NLDDAvatarGroup.prototype, "_total", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
state()
|
|
253
|
+
], NLDDAvatarGroup.prototype, "_fitMax", void 0);
|
|
165
254
|
NLDDAvatarGroup = __decorate([
|
|
166
255
|
customElement('nldd-avatar-group')
|
|
167
256
|
], NLDDAvatarGroup);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-group.js","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"avatar-group.js","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iCAAiC,CAAC;AACzC,OAAO,qCAAqC,CAAC;AAC7C,OAAO,2BAA2B,CAAC;AACnC,OAAO,iDAAiD,CAAC;AACzD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,+CAA+C,CAAC;AACvD,OAAO,2CAA2C,CAAC;AACnD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,yDAAyD,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,kFAAkF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,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAwM3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-group.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avatar-group.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,yBAuJ7B,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { queryBreakpoints } from '../../../assets/styles/breakpoints.js';
|
|
3
|
+
const mdMin = unsafeCSS(queryBreakpoints.mdMin);
|
|
2
4
|
export const avatarGroupStyles = css `
|
|
3
5
|
:host {
|
|
4
6
|
box-sizing: border-box;
|
|
@@ -10,6 +12,8 @@ export const avatarGroupStyles = css `
|
|
|
10
12
|
:host {
|
|
11
13
|
--_avatar-group-size: var(--primitives-space-40);
|
|
12
14
|
--_avatar-group-overlap-size: calc(var(--_avatar-group-size) * 0.2);
|
|
15
|
+
--_avatar-group-width: calc(var(--_avatar-group-discs) * (var(--_avatar-group-size) - var(--_avatar-group-overlap-size)) + var(--_avatar-group-overlap-size));
|
|
16
|
+
--_avatar-group-min-width: calc(2 * (var(--_avatar-group-size) - var(--_avatar-group-overlap-size)) + var(--_avatar-group-overlap-size));
|
|
13
17
|
--_avatar-group-ring-thickness: var(--semantics-surfaces-ring-thickness);
|
|
14
18
|
--_avatar-group-ring-color: var(--context-parent-background-color, var(--semantics-surfaces-base-background-color));
|
|
15
19
|
--_avatar-group-corner-radius: var(--primitives-corner-radius-full);
|
|
@@ -17,8 +21,15 @@ export const avatarGroupStyles = css `
|
|
|
17
21
|
--_avatar-group-overflow-hover-background-color: light-dark(var(--primitives-color-neutral-50), var(--primitives-color-neutral-200));
|
|
18
22
|
--_avatar-group-overflow-content-color: var(--semantics-content-secondary-color);
|
|
19
23
|
--_avatar-group-overflow-font: var(--primitives-font-body-xs-medium-flat);
|
|
24
|
+
--_avatar-group-overflow-font-scale: 0.235;
|
|
25
|
+
--_avatar-group-overflow-font-offset: 5.5px;
|
|
26
|
+
--_avatar-group-overflow-digits-scale: 1;
|
|
27
|
+
--_avatar-group-overflow-icon-scale: 0.5;
|
|
20
28
|
|
|
21
29
|
display: inline-flex;
|
|
30
|
+
width: var(--_avatar-group-width);
|
|
31
|
+
min-width: min(var(--_avatar-group-width), var(--_avatar-group-min-width));
|
|
32
|
+
max-width: 100%;
|
|
22
33
|
vertical-align: middle;
|
|
23
34
|
}
|
|
24
35
|
|
|
@@ -77,6 +88,21 @@ export const avatarGroupStyles = css `
|
|
|
77
88
|
justify-content: center;
|
|
78
89
|
color: var(--_avatar-group-overflow-content-color);
|
|
79
90
|
font: var(--_avatar-group-overflow-font);
|
|
91
|
+
/* The offset makes the count relatively larger on a small disc and smaller on a large one. */
|
|
92
|
+
font-size: calc((var(--_avatar-group-overflow-font-scale) * var(--_avatar-group-size) + var(--_avatar-group-overflow-font-offset)) * var(--_avatar-group-overflow-digits-scale));
|
|
93
|
+
line-height: 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.avatar-group__overflow-button--digits-3 {
|
|
97
|
+
--_avatar-group-overflow-digits-scale: 0.8;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.avatar-group__overflow-button--digits-4 {
|
|
101
|
+
--_avatar-group-overflow-digits-scale: 0.7;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.avatar-group__overflow-icon {
|
|
105
|
+
width: calc(var(--_avatar-group-overflow-icon-scale) * var(--_avatar-group-size));
|
|
80
106
|
}
|
|
81
107
|
|
|
82
108
|
/* The smallest step the neutral scale has, one notch off the resting fill.
|
|
@@ -93,6 +119,14 @@ export const avatarGroupStyles = css `
|
|
|
93
119
|
}
|
|
94
120
|
|
|
95
121
|
|
|
122
|
+
/* Anchored on md and up, the list needs no bar to close it. */
|
|
123
|
+
@media (min-width: ${mdMin}) {
|
|
124
|
+
.avatar-group__overflow-title-bar {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
96
130
|
/* # Avatars
|
|
97
131
|
|
|
98
132
|
A slotted avatar can't be wrapped, so the group sizes it here. The ring
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-group.styles.js","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"avatar-group.styles.js","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,MAAM,KAAK,GAAG,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAuHd,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-group.template.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"avatar-group.template.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar-group/avatar-group.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,uBAAuB,CAAC;AAoB/B,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,eAAe,wCAyD7D"}
|
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import { html, nothing } from 'lit';
|
|
2
|
+
import '../tooltip/tooltip.js';
|
|
3
|
+
function overflowButton(component, label) {
|
|
4
|
+
const fits = component._overflowCountFits;
|
|
5
|
+
const digits = Math.min(String(component._overflow.length).length, 4);
|
|
6
|
+
const button = html `
|
|
7
|
+
<button class="avatar-group__overflow-button avatar-group__overflow-button--digits-${digits}"
|
|
8
|
+
id=${component._triggerId}
|
|
9
|
+
type="button"
|
|
10
|
+
aria-label=${label}
|
|
11
|
+
popovertarget=${component._popoverId}
|
|
12
|
+
>
|
|
13
|
+
${fits
|
|
14
|
+
? `+${component._overflow.length}`
|
|
15
|
+
: html `<nldd-icon class="avatar-group__overflow-icon" icon="ellipsis"></nldd-icon>`}
|
|
16
|
+
</button>
|
|
17
|
+
`;
|
|
18
|
+
return fits ? button : html `<nldd-tooltip text=${label}>${button}</nldd-tooltip>`;
|
|
19
|
+
}
|
|
2
20
|
export function avatarGroupTemplate(component) {
|
|
3
21
|
const overflow = component._overflow;
|
|
4
22
|
const label = component._t('components.avatar-group.overflow-label')
|
|
5
23
|
.replace('{count}', String(overflow.length));
|
|
24
|
+
// On sm the list is a bottom sheet, and its title bar says whose names these are.
|
|
25
|
+
const title = component.accessibleLabel || component._t('components.avatar-group.overflow-popover-label');
|
|
6
26
|
return html `
|
|
7
27
|
<style id="generated-rules"></style>
|
|
8
28
|
<div class="avatar-group"
|
|
@@ -10,43 +30,46 @@ export function avatarGroupTemplate(component) {
|
|
|
10
30
|
aria-label=${component.accessibleLabel || nothing}
|
|
11
31
|
>
|
|
12
32
|
<slot @slotchange=${component._onSlotChange}></slot>
|
|
13
|
-
${overflow.length > 0 ?
|
|
14
|
-
<button class="avatar-group__overflow-button"
|
|
15
|
-
id=${component._triggerId}
|
|
16
|
-
type="button"
|
|
17
|
-
aria-label=${label}
|
|
18
|
-
popovertarget=${component._popoverId}
|
|
19
|
-
>
|
|
20
|
-
+${overflow.length}
|
|
21
|
-
</button>
|
|
22
|
-
` : nothing}
|
|
33
|
+
${overflow.length > 0 ? overflowButton(component, label) : nothing}
|
|
23
34
|
</div>
|
|
24
35
|
${overflow.length > 0 ? html `
|
|
25
36
|
<nldd-popover
|
|
26
37
|
id=${component._popoverId}
|
|
27
38
|
anchor=${component._triggerId}
|
|
28
39
|
placement="bottom-end"
|
|
29
|
-
accessible-label=${
|
|
40
|
+
accessible-label=${title}
|
|
30
41
|
>
|
|
31
|
-
<nldd-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
<nldd-page
|
|
43
|
+
landmarks="region"
|
|
44
|
+
sticky-header
|
|
34
45
|
>
|
|
35
|
-
<nldd-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
<nldd-top-title-bar
|
|
47
|
+
class="avatar-group__overflow-title-bar"
|
|
48
|
+
slot="header"
|
|
49
|
+
text=${title}
|
|
50
|
+
heading-level="2"
|
|
51
|
+
dismiss-text=${component._t('components.avatar-group.overflow-close')}
|
|
52
|
+
></nldd-top-title-bar>
|
|
53
|
+
<nldd-container
|
|
54
|
+
padding-inline="16"
|
|
55
|
+
padding-block="8"
|
|
56
|
+
>
|
|
57
|
+
<nldd-list dividers="never">
|
|
58
|
+
${overflow.map(entry => html `
|
|
59
|
+
<nldd-list-item size="sm">
|
|
60
|
+
<nldd-cell width="fit-content">
|
|
61
|
+
${entry.avatar}
|
|
62
|
+
</nldd-cell>
|
|
63
|
+
<nldd-spacer-cell size="8"></nldd-spacer-cell>
|
|
64
|
+
<nldd-text-cell
|
|
65
|
+
width="full"
|
|
66
|
+
text=${entry.name}
|
|
67
|
+
></nldd-text-cell>
|
|
68
|
+
</nldd-list-item>
|
|
69
|
+
`)}
|
|
70
|
+
</nldd-list>
|
|
71
|
+
</nldd-container>
|
|
72
|
+
</nldd-page>
|
|
50
73
|
</nldd-popover>
|
|
51
74
|
` : nothing}
|
|
52
75
|
`;
|